From b0a41848b0c0b1b05839d6b9deeec0046b9f72ca Mon Sep 17 00:00:00 2001 From: Nick Taras Date: Thu, 8 Dec 2022 10:27:24 +1100 Subject: [PATCH] update un end point --- src/client/auth/signedUNChallenge.ts | 2 +- token-negotiator-dist/negotiator.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/auth/signedUNChallenge.ts b/src/client/auth/signedUNChallenge.ts index 079ff05f..4637082e 100644 --- a/src/client/auth/signedUNChallenge.ts +++ b/src/client/auth/signedUNChallenge.ts @@ -6,7 +6,7 @@ import {UN, UNInterface} from "./util/UN"; export class SignedUNChallenge extends AbstractAuthentication implements AuthenticationMethod { TYPE = "signedUN"; - private static DEFAULT_ENDPOINT = "https://crypto-verify.herokuapp.com/use-devcon-ticket"; + private static DEFAULT_ENDPOINT = "https://attestation-verify.tokenscript.org/un"; async getTokenProof(_issuerConfig: OnChainTokenConfig | OffChainTokenConfig, _tokens: Array, request: AuthenticateInterface): Promise { diff --git a/token-negotiator-dist/negotiator.js b/token-negotiator-dist/negotiator.js index 169f23a1..a6a2acb3 100644 --- a/token-negotiator-dist/negotiator.js +++ b/token-negotiator-dist/negotiator.js @@ -1,2 +1,2 @@ /*! For license information please see negotiator.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.negotiator=e():t.negotiator=e()}(self,(()=>(()=>{var t,e,r={95851:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="abi/5.6.4"},72734:(t,e,r)=>{"use strict";r.d(e,{R:()=>I,$:()=>B});var n=r(93286),i=r(53587),o=r(80711),s=r(95851),a=r(61184),c=r(64594);class u extends a.XI{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=(0,c.getAddress)(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return(0,c.getAddress)((0,n.hexZeroPad)(t.readValue().toHexString(),20))}}class l extends a.XI{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const f=new o.Logger(s.i);function h(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let t={};n=e.map((e=>{const n=e.localName;return n||f.throwError("cannot encode object for signature with missing names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]&&f.throwError("cannot encode object for signature with duplicate names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]=!0,r[n]}))}else f.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&f.throwArgumentError("types/value length mismatch","tuple",r);let i=new a.QV(t.wordSize),s=new a.QV(t.wordSize),c=[];e.forEach(((t,e)=>{let r=n[e];if(t.dynamic){let e=s.length;t.encode(s,r);let n=i.writeUpdatableValue();c.push((t=>{n(t+e)}))}else t.encode(i,r)})),c.forEach((t=>{t(i.length)}));let u=t.appendWriter(i);return u+=t.appendWriter(s),u}function d(t,e){let r=[],n=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let r=t.readValue(),s=n.subReader(r.toNumber());try{i=e.decode(s)}catch(t){if(t.code===o.Logger.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===o.Logger.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&r.push(i)}));const i=e.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach(((t,e)=>{let n=t.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[e];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let t=0;t{throw e}})}return Object.freeze(r)}class p extends a.XI{constructor(t,e,r){super("array",t.type+"["+(e>=0?e:"")+"]",r,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let r=0;rt._data.length&&f.throwError("insufficient data length",o.Logger.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let r=[];for(let t=0;t{t.dynamic&&(r=!0),n.push(t.type)}));super("tuple","tuple("+n.join(",")+")",e,r),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))})),Object.freeze(t)}encode(t,e){return h(t,this.coders,e)}decode(t){return t.coerce(this.name,d(t,this.coders))}}var P=r(11388);const T=new o.Logger(s.i),_=new RegExp(/^bytes([0-9]*)$/),O=new RegExp(/^(u?int)([0-9]*)$/);class I{constructor(t){(0,i.defineReadOnly)(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new u(t.name);case"bool":return new g(t.name);case"string":return new k(t.name);case"bytes":return new m(t.name);case"array":return new p(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new x((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new v(t.name)}let e=t.type.match(O);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&T.throwArgumentError("invalid "+e[1]+" bit length","param",t),new A(r/8,"int"===e[1],t.name)}if(e=t.type.match(_),e){let r=parseInt(e[1]);return(0===r||r>32)&&T.throwArgumentError("invalid bytes length","param",t),new b(r,t.name)}return T.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new a.Ej(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new a.QV(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(P._R.from(t))));return new x(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&T.throwError("types/values length mismatch",o.Logger.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const r=t.map((t=>this._getCoder(P._R.from(t)))),n=new x(r,"_"),i=this._getWriter();return n.encode(i,e),i.data}decode(t,e,r){const i=t.map((t=>this._getCoder(P._R.from(t))));return new x(i,"_").decode(this._getReader((0,n.arrayify)(e),r))}}const B=new I},61184:(t,e,r)=>{"use strict";r.d(e,{BR:()=>u,Ej:()=>h,QV:()=>f,XI:()=>l});var n=r(93286),i=r(2593),o=r(53587),s=r(80711),a=r(95851);const c=new s.Logger(a.i);function u(t){const e=[],r=function(t,n){if(Array.isArray(n))for(let i in n){const o=t.slice();o.push(i);try{r(o,n[i])}catch(t){e.push({path:o,error:t})}}};return r([],t),e}class l{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){c.throwArgumentError(t,this.localName,e)}}class f{constructor(t){(0,o.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return(0,n.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData((0,n.concat)(t._data))}writeBytes(t){let e=(0,n.arrayify)(t);const r=e.length%this.wordSize;return r&&(e=(0,n.concat)([e,this._padding.slice(r)])),this._writeData(e)}_getValue(t){let e=(0,n.arrayify)(i.O$.from(t));return e.length>this.wordSize&&c.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=(0,n.concat)([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class h{constructor(t,e,r,i){(0,o.defineReadOnly)(this,"_data",(0,n.arrayify)(t)),(0,o.defineReadOnly)(this,"wordSize",e||32),(0,o.defineReadOnly)(this,"_coerceFunc",r),(0,o.defineReadOnly)(this,"allowLoose",i),this._offset=0}get data(){return(0,n.hexlify)(this._data)}get consumed(){return this._offset}static coerce(t,e){let r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):h.coerce(t,e)}_peekBytes(t,e,r){let n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:c.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new h(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}readValue(){return i.O$.from(this.readBytes(this.wordSize))}}},11388:(t,e,r)=>{"use strict";r.d(e,{HY:()=>m,IC:()=>x,QV:()=>b,Xg:()=>A,YW:()=>S,_R:()=>g,pc:()=>d});var n=r(2593),i=r(53587),o=r(80711),s=r(95851);const a=new o.Logger(s.i),c={};let u={calldata:!0,memory:!0,storage:!0},l={calldata:!0,memory:!0};function f(t,e){if("bytes"===t||"string"===t){if(u[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&l[e])return!0;return(u[e]||"payable"===e)&&a.throwArgumentError("invalid modifier","name",e),!1}function h(t,e){for(let r in e)(0,i.defineReadOnly)(t,r,e[r])}const d=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=new RegExp(/^(.*)\[([0-9]*)\]$/);class g{constructor(t,e){t!==c&&a.throwError("use fromString",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),h(this,e);let r=this.type.match(p);h(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:g.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(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(e)}let e="";return"array"===this.baseType?(e+=this.arrayChildren.format(t),e+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==d.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===d.full?", ":",")+")"):e+=this.type,t!==d.sighash&&(!0===this.indexed&&(e+=" indexed"),t===d.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?g.fromString(t,e):g.fromObject(t)}static fromObject(t){return g.isParamType(t)?t:new g(c,{name:t.name||null,type:P(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(g.fromObject):null})}static fromString(t,e){return r=function(t,e){let r=t;function n(e){a.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function i(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let r=0;rg.fromString(t,e)))}class m{constructor(t,e){t!==c&&a.throwError("use a static from method",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),h(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return m.isFragment(t)?t:"string"==typeof t?m.fromString(t):m.fromObject(t)}static fromObject(t){if(m.isFragment(t))return t;switch(t.type){case"function":return S.fromObject(t);case"event":return b.fromObject(t);case"constructor":return A.fromObject(t);case"error":return x.fromObject(t);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?b.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?S.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?A.fromString(t.trim()):"error"===t.split(" ")[0]?x.fromString(t.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!(!t||!t._isFragment)}}class b extends m{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==d.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===d.full?", ":",")+") ",t!==d.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?b.fromString(t):b.fromObject(t)}static fromObject(t){if(b.isEventFragment(t))return t;"event"!==t.type&&a.throwArgumentError("invalid event object","value",t);const e={name:_(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(g.fromObject):[],type:"event"};return new b(c,e)}static fromString(t){let e=t.match(O);e||a.throwArgumentError("invalid event string","value",t);let r=!1;return e[3].split(" ").forEach((t=>{switch(t.trim()){case"anonymous":r=!0;break;case"":break;default:a.warn("unknown modifier: "+t)}})),b.fromObject({name:e[1].trim(),anonymous:r,inputs:y(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function v(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=n.O$.from(r[1]),r[0]):t}function w(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function E(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&a.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&a.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||a.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&a.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&a.throwArgumentError("unable to determine stateMutability","value",t),e}class A extends m{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.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((e=>JSON.parse(e.format(t))))});t===d.sighash&&a.throwError("cannot format a constructor for sighash",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map((e=>e.format(t))).join(t===d.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?A.fromString(t):A.fromObject(t)}static fromObject(t){if(A.isConstructorFragment(t))return t;"constructor"!==t.type&&a.throwArgumentError("invalid constructor object","value",t);let e=E(t);e.constant&&a.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(g.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new A(c,r)}static fromString(t){let e={type:"constructor"},r=(t=v(t,e)).match(O);return r&&"constructor"===r[1].trim()||a.throwArgumentError("invalid constructor string","value",t),e.inputs=y(r[2].trim(),!1),w(r[3].trim(),e),A.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class S extends A{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.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((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==d.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===d.full?", ":",")+") ",t!==d.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((e=>e.format(t))).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?S.fromString(t):S.fromObject(t)}static fromObject(t){if(S.isFunctionFragment(t))return t;"function"!==t.type&&a.throwArgumentError("invalid function object","value",t);let e=E(t);const r={type:t.type,name:_(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(g.fromObject):[],outputs:t.outputs?t.outputs.map(g.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new S(c,r)}static fromString(t){let e={type:"function"},r=(t=v(t,e)).split(" returns ");r.length>2&&a.throwArgumentError("invalid function string","value",t);let n=r[0].match(O);if(n||a.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&_(e.name),e.inputs=y(n[2],!1),w(n[3].trim(),e),r.length>1){let n=r[1].match(O);""==n[1].trim()&&""==n[3].trim()||a.throwArgumentError("unexpected tokens","value",t),e.outputs=y(n[2],!1)}else e.outputs=[];return S.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function k(t){const e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||a.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class x extends m{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==d.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===d.full?", ":",")+") ",e.trim()}static from(t){return"string"==typeof t?x.fromString(t):x.fromObject(t)}static fromObject(t){if(x.isErrorFragment(t))return t;"error"!==t.type&&a.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:_(t.name),inputs:t.inputs?t.inputs.map(g.fromObject):[]};return k(new x(c,e))}static fromString(t){let e={type:"error"},r=t.match(O);return r||a.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&_(e.name),e.inputs=y(r[2],!1),k(x.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function P(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const T=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function _(t){return t&&t.match(T)||a.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const O=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},83893:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AbiCoder:()=>i.R,ConstructorFragment:()=>n.Xg,ErrorFragment:()=>n.IC,EventFragment:()=>n.QV,FormatTypes:()=>n.pc,Fragment:()=>n.HY,FunctionFragment:()=>n.YW,Indexed:()=>o.Hk,Interface:()=>o.vU,LogDescription:()=>o.CC,ParamType:()=>n._R,TransactionDescription:()=>o.vk,checkResultErrors:()=>s.BR,defaultAbiCoder:()=>i.$});var n=r(11388),i=r(72734),o=r(8198),s=r(61184)},8198:(t,e,r)=>{"use strict";r.d(e,{CC:()=>p,Hk:()=>m,vU:()=>w,vk:()=>g});var n=r(64594),i=r(2593),o=r(93286),s=r(32046),a=r(38197),c=r(53587),u=r(72734),l=r(11388),f=r(80711),h=r(95851);const d=new f.Logger(h.i);class p extends c.Description{}class g extends c.Description{}class y extends c.Description{}class m extends c.Description{static isIndexed(t){return!(!t||!t._isIndexed)}}const b={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function v(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class w{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,(0,c.defineReadOnly)(this,"fragments",e.map((t=>l.HY.from(t))).filter((t=>null!=t))),(0,c.defineReadOnly)(this,"_abiCoder",(0,c.getStatic)(new.target,"getAbiCoder")()),(0,c.defineReadOnly)(this,"functions",{}),(0,c.defineReadOnly)(this,"errors",{}),(0,c.defineReadOnly)(this,"events",{}),(0,c.defineReadOnly)(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void d.warn("duplicate definition - constructor"):void(0,c.defineReadOnly)(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let r=t.format();e[r]?d.warn("duplicate definition - "+r):e[r]=t})),this.deploy||(0,c.defineReadOnly)(this,"deploy",l.Xg.from({payable:!1,type:"constructor"})),(0,c.defineReadOnly)(this,"_isInterface",!0)}format(t){t||(t=l.pc.full),t===l.pc.sighash&&d.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===l.pc.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return u.$}static getAddress(t){return(0,n.getAddress)(t)}static getSighash(t){return(0,o.hexDataSlice)((0,s.id)(t.format()),0,4)}static getEventTopic(t){return(0,s.id)(t.format())}getFunction(t){if((0,o.isHexString)(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];d.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===r.length?d.throwArgumentError("no matching function","name",e):r.length>1&&d.throwArgumentError("multiple matching functions","name",e),this.functions[r[0]]}const e=this.functions[l.YW.fromString(t).format()];return e||d.throwArgumentError("no matching function","signature",t),e}getEvent(t){if((0,o.isHexString)(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];d.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===r.length?d.throwArgumentError("no matching event","name",e):r.length>1&&d.throwArgumentError("multiple matching events","name",e),this.events[r[0]]}const e=this.events[l.QV.fromString(t).format()];return e||d.throwArgumentError("no matching event","signature",t),e}getError(t){if((0,o.isHexString)(t)){const e=(0,c.getStatic)(this.constructor,"getSighash");for(const r in this.errors){if(t===e(this.errors[r]))return this.errors[r]}d.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===r.length?d.throwArgumentError("no matching error","name",e):r.length>1&&d.throwArgumentError("multiple matching errors","name",e),this.errors[r[0]]}const e=this.errors[l.YW.fromString(t).format()];return e||d.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return(0,c.getStatic)(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),(0,c.getStatic)(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const r=(0,o.arrayify)(e);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(t)&&d.throwArgumentError(`data signature does not match error ${t.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),(0,o.hexlify)((0,o.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const r=(0,o.arrayify)(e);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(t)&&d.throwArgumentError(`data signature does not match function ${t.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,o.hexlify)((0,o.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=(0,o.arrayify)(e),n=null,i="",s=null,a=null,c=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(t){}break;case 4:{const t=(0,o.hexlify)(r.slice(0,4)),e=b[t];if(e)s=this._abiCoder.decode(e.inputs,r.slice(4)),a=e.name,c=e.signature,e.reason&&(n=s[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const e=this.getError(t);s=this._abiCoder.decode(e.inputs,r.slice(4)),a=e.name,c=e.format()}catch(t){}break}}return d.throwError("call revert exception"+i,f.Logger.errors.CALL_EXCEPTION,{method:t.format(),data:(0,o.hexlify)(e),errorArgs:s,errorName:a,errorSignature:c,reason:n})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,o.hexlify)(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&d.throwError("too many arguments for "+t.format(),f.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));const n=(t,e)=>"string"===t.type?(0,s.id)(e):"bytes"===t.type?(0,a.keccak256)((0,o.hexlify)(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=i.O$.from(e).toHexString()),"address"===t.type&&this._abiCoder.encode(["address"],[e]),(0,o.hexZeroPad)((0,o.hexlify)(e),32));for(e.forEach(((e,i)=>{let o=t.inputs[i];o.indexed?null==e?r.push(null):"array"===o.baseType||"tuple"===o.baseType?d.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?r.push(e.map((t=>n(o,t)))):r.push(n(o,e)):null!=e&&d.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const r=[],n=[],i=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&d.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,o)=>{const c=e[o];if(t.indexed)if("string"===t.type)r.push((0,s.id)(c));else if("bytes"===t.type)r.push((0,a.keccak256)(c));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([t.type],[c]))}else n.push(t),i.push(c)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){let e=this.getEventTopic(t);(0,o.isHexString)(r[0],32)&&r[0].toLowerCase()===e||d.throwError("fragment/topic mismatch",f.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:r[0]}),r=r.slice(1)}let n=[],i=[],s=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(n.push(l._R.fromObject({type:"bytes32",name:t.name})),s.push(!0)):(n.push(t),s.push(!1)):(i.push(t),s.push(!1))}));let a=null!=r?this._abiCoder.decode(n,(0,o.concat)(r)):null,c=this._abiCoder.decode(i,e,!0),u=[],h=0,p=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==a)u[e]=new m({_isIndexed:!0,hash:null});else if(s[e])u[e]=new m({_isIndexed:!0,hash:a[p++]});else try{u[e]=a[p++]}catch(t){u[e]=t}else try{u[e]=c[h++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const r=u[e];r instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw v(`property ${JSON.stringify(t.name)}`,r)}}):u[t.name]=r}}));for(let t=0;t{throw v(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new g({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:i.O$.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new p({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=(0,o.hexlify)(t);let r=this.getError(e.substring(0,10).toLowerCase());return r?new y({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(t){return!(!t||!t._isInterface)}}},64353:(t,e,r)=>{"use strict";r.d(e,{Sg:()=>c,zt:()=>u});var n=r(2593),i=r(53587),o=r(80711);var s=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const a=new o.Logger("abstract-provider/5.6.1");class c extends i.Description{static isForkEvent(t){return!(!t||!t._isForkEvent)}}class u{constructor(){a.checkAbstract(new.target,u),(0,i.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return s(this,void 0,void 0,(function*(){const{block:t,gasPrice:e}=yield(0,i.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let r=null,o=null;return t&&t.baseFeePerGas&&(o=n.O$.from("1500000000"),r=t.baseFeePerGas.mul(2).add(o)),{maxFeePerGas:r,maxPriorityFeePerGas:o,gasPrice:e}}))}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}},48171:(t,e,r)=>{"use strict";r.d(e,{E:()=>u,b:()=>l});var n=r(53587),i=r(80711);var o=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const s=new i.Logger("abstract-signer/5.6.2"),a=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],c=[i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED];class u{constructor(){s.checkAbstract(new.target,u),(0,n.defineReadOnly)(this,"_isSigner",!0)}getBalance(t){return o(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return o(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return o(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield(0,n.resolveProperties)(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return o(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield(0,n.resolveProperties)(this.checkTransaction(t));return yield this.provider.call(r,e)}))}sendTransaction(t){return o(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),r=yield this.signTransaction(e);return yield this.provider.sendTransaction(r)}))}getChainId(){return o(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return o(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const e in t)-1===a.indexOf(e)&&s.throwArgumentError("invalid transaction key: "+e,"transaction",t);const e=(0,n.shallowCopy)(t);return null==e.from?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then((e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&s.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return o(this,void 0,void 0,(function*(){const e=yield(0,n.resolveProperties)(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>o(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&s.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})))),e.to.catch((t=>{})));const r=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null==e.gasPrice||2!==e.type&&!r?0!==e.type&&1!==e.type||!r||s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==e.type&&null!=e.type||null==e.maxFeePerGas||null==e.maxPriorityFeePerGas)if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(null==e.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(e.type=2,null!=e.gasPrice){const t=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=t,e.maxPriorityFeePerGas=t}else null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(r&&s.throwError("network does not support EIP-1559",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):s.throwError("failed to get consistent fee data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else e.type=2;return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch((t=>{if(c.indexOf(t.code)>=0)throw t;return s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})}))),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then((e=>(0!==e[1]&&e[0]!==e[1]&&s.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield(0,n.resolveProperties)(e)}))}_checkProvider(t){this.provider||s.throwError("missing provider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}class l extends u{constructor(t,e){super(),(0,n.defineReadOnly)(this,"address",t),(0,n.defineReadOnly)(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then((()=>{s.throwError(t,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})}))}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new l(this.address,t)}}},64594:(t,e,r)=>{"use strict";r.r(e),r.d(e,{getAddress:()=>d,getContractAddress:()=>y,getCreate2Address:()=>m,getIcapAddress:()=>g,isAddress:()=>p});var n=r(93286),i=r(2593),o=r(38197),s=r(61843);const a=new(r(80711).Logger)("address/5.6.1");function c(t){(0,n.isHexString)(t,20)||a.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const i=(0,n.arrayify)((0,o.keccak256)(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const u={};for(let t=0;t<10;t++)u[String(t)]=String(t);for(let t=0;t<26;t++)u[String.fromCharCode(65+t)]=String(10+t);const l=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/Math.LN10));var f;function h(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>u[t])).join("");for(;e.length>=l;){let t=e.substring(0,l);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function d(t){let e=null;if("string"!=typeof t&&a.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=c(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&a.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==h(t)&&a.throwArgumentError("bad icap checksum","address",t),e=(0,i.g$)(t.substring(4));e.length<40;)e="0"+e;e=c("0x"+e)}else a.throwArgumentError("invalid address","address",t);return e}function p(t){try{return d(t),!0}catch(t){}return!1}function g(t){let e=(0,i.t2)(d(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+h("XE00"+e)+e}function y(t){let e=null;try{e=d(t.from)}catch(e){a.throwArgumentError("missing from address","transaction",t)}const r=(0,n.stripZeros)((0,n.arrayify)(i.O$.from(t.nonce).toHexString()));return d((0,n.hexDataSlice)((0,o.keccak256)((0,s.encode)([e,r])),12))}function m(t,e,r){return 32!==(0,n.hexDataLength)(e)&&a.throwArgumentError("salt must be 32 bytes","salt",e),32!==(0,n.hexDataLength)(r)&&a.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),d((0,n.hexDataSlice)((0,o.keccak256)((0,n.concat)(["0xff",d(t),e,r])),12))}},59567:(t,e,r)=>{"use strict";r.d(e,{J:()=>i,c:()=>o});var n=r(93286);function i(t){t=atob(t);const e=[];for(let r=0;r{"use strict";r.r(e),r.d(e,{decode:()=>n.J,encode:()=>n.c});var n=r(59567)},57727:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Base32:()=>s,Base58:()=>a,BaseX:()=>o});var n=r(93286),i=r(53587);class o{constructor(t){(0,i.defineReadOnly)(this,"alphabet",t),(0,i.defineReadOnly)(this,"base",t.length),(0,i.defineReadOnly)(this,"_alphabetMap",{}),(0,i.defineReadOnly)(this,"_leader",t.charAt(0));for(let e=0;e0;)r.push(n%this.base),n=n/this.base|0}let i="";for(let t=0;0===e[t]&&t=0;--t)i+=this.alphabet[r[t]];return i}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let r=0;r>=8;for(;i>0;)e.push(255&i),i>>=8}for(let r=0;t[r]===this._leader&&r{"use strict";r.d(e,{i:()=>n});const n="bignumber/5.6.2"},2593:(t,e,r)=>{"use strict";r.d(e,{O$:()=>p,Zm:()=>h,g$:()=>v,t2:()=>w});var n=r(13550),i=r.n(n),o=r(93286),s=r(80711),a=r(48794),c=i().BN;const u=new s.Logger(a.i),l={},f=9007199254740991;function h(t){return null!=t&&(p.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||(0,o.isHexString)(t)||"bigint"==typeof t||(0,o.isBytes)(t))}let d=!1;class p{constructor(t,e){t!==l&&u.throwError("cannot call constructor directly; use BigNumber.from",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return y(m(this).fromTwos(t))}toTwos(t){return y(m(this).toTwos(t))}abs(){return"-"===this._hex[0]?p.from(this._hex.substring(1)):this}add(t){return y(m(this).add(m(t)))}sub(t){return y(m(this).sub(m(t)))}div(t){return p.from(t).isZero()&&b("division-by-zero","div"),y(m(this).div(m(t)))}mul(t){return y(m(this).mul(m(t)))}mod(t){const e=m(t);return e.isNeg()&&b("division-by-zero","mod"),y(m(this).umod(e))}pow(t){const e=m(t);return e.isNeg()&&b("negative-power","pow"),y(m(this).pow(e))}and(t){const e=m(t);return(this.isNegative()||e.isNeg())&&b("unbound-bitwise-result","and"),y(m(this).and(e))}or(t){const e=m(t);return(this.isNegative()||e.isNeg())&&b("unbound-bitwise-result","or"),y(m(this).or(e))}xor(t){const e=m(t);return(this.isNegative()||e.isNeg())&&b("unbound-bitwise-result","xor"),y(m(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&b("negative-width","mask"),y(m(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&b("negative-width","shl"),y(m(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&b("negative-width","shr"),y(m(this).shrn(t))}eq(t){return m(this).eq(m(t))}lt(t){return m(this).lt(m(t))}lte(t){return m(this).lte(m(t))}gt(t){return m(this).gt(m(t))}gte(t){return m(this).gte(m(t))}isNegative(){return"-"===this._hex[0]}isZero(){return m(this).isZero()}toNumber(){try{return m(this).toNumber()}catch(t){b("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return u.throwError("this platform does not support BigInt",s.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?d||(d=!0,u.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?u.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):u.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),m(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof p)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new p(l,g(t)):t.match(/^-?[0-9]+$/)?new p(l,g(new c(t))):u.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&b("underflow","BigNumber.from",t),(t>=f||t<=-f)&&b("overflow","BigNumber.from",t),p.from(String(t));const e=t;if("bigint"==typeof e)return p.from(e.toString());if((0,o.isBytes)(e))return p.from((0,o.hexlify)(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return p.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&((0,o.isHexString)(t)||"-"===t[0]&&(0,o.isHexString)(t.substring(1))))return p.from(t)}return u.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function g(t){if("string"!=typeof t)return g(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&u.throwArgumentError("invalid hex","value",t),"0x00"===(t=g(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function y(t){return p.from(g(t))}function m(t){const e=p.from(t).toHexString();return"-"===e[0]?new c("-"+e.substring(3),16):new c(e.substring(2),16)}function b(t,e,r){const n={fault:t,operation:e};return null!=r&&(n.value=r),u.throwError(t,s.Logger.errors.NUMERIC_FAULT,n)}function v(t){return new c(t,36).toString(16)}function w(t){return new c(t,16).toString(36)}},20335:(t,e,r)=>{"use strict";r.d(e,{Ox:()=>g,S5:()=>p,xs:()=>m});var n=r(93286),i=r(80711),o=r(48794),s=r(2593);const a=new i.Logger(o.i),c={},u=s.O$.from(0),l=s.O$.from(-1);function f(t,e,r,n){const o={fault:e,operation:r};return void 0!==n&&(o.value=n),a.throwError(t,i.Logger.errors.NUMERIC_FAULT,o)}let h="0";for(;h.length<256;)h+=h;function d(t){if("number"!=typeof t)try{t=s.O$.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+h.substring(0,t):a.throwArgumentError("invalid decimal size","decimals",t)}function p(t,e){null==e&&(e=0);const r=d(e),n=(t=s.O$.from(t)).lt(u);n&&(t=t.mul(l));let i=t.mod(r).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",t);let o=i[0],c=i[1];for(o||(o="0"),c||(c="0");"0"===c[c.length-1];)c=c.substring(0,c.length-1);for(c.length>r.length-1&&f("fractional component exceeds decimals","underflow","parseFixed"),""===c&&(c="0");c.lengthnull==t[e]?n:(typeof t[e]!==r&&a.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new y(c,e,r,n)}}class m{constructor(t,e,r,n){t!==c&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=g(this._value,this.format.decimals),r=g(t._value,t.format.decimals);return m.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=g(this._value,this.format.decimals),r=g(t._value,t.format.decimals);return m.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=g(this._value,this.format.decimals),r=g(t._value,t.format.decimals);return m.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=g(this._value,this.format.decimals),r=g(t._value,t.format.decimals);return m.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=m.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(b.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=m.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(b.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&a.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=m.from("1"+h.substring(0,t),this.format),n=v.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(t){if(null==t)return this._hex;t%8&&a.throwArgumentError("invalid byte width","width",t);const e=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return(0,n.hexZeroPad)(e,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return m.fromString(this._value,t)}static fromValue(t,e,r){return null!=r||null==e||(0,s.Zm)(e)||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),m.fromString(p(t,e),y.from(r))}static fromString(t,e){null==e&&(e="fixed");const r=y.from(e),i=g(t,r.decimals);!r.signed&&i.lt(u)&&f("unsigned value cannot be negative","overflow","value",t);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=(0,n.hexZeroPad)(o,r.width/8));const s=p(i,r.decimals);return new m(c,o,s,r)}static fromBytes(t,e){null==e&&(e="fixed");const r=y.from(e);if((0,n.arrayify)(t).length>r.width/8)throw new Error("overflow");let i=s.O$.from(t);r.signed&&(i=i.fromTwos(r.width));const o=i.toTwos((r.signed?0:1)+r.width).toHexString(),a=p(i,r.decimals);return new m(c,o,a,r)}static from(t,e){if("string"==typeof t)return m.fromString(t,e);if((0,n.isBytes)(t))return m.fromBytes(t,e);try{return m.fromValue(t,0,e)}catch(t){if(t.code!==i.Logger.errors.INVALID_ARGUMENT)throw t}return a.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const b=m.from(1),v=m.from("0.5")},93286:(t,e,r)=>{"use strict";r.r(e),r.d(e,{arrayify:()=>u,concat:()=>l,hexConcat:()=>b,hexDataLength:()=>y,hexDataSlice:()=>m,hexStripZeros:()=>w,hexValue:()=>v,hexZeroPad:()=>E,hexlify:()=>g,isBytes:()=>c,isBytesLike:()=>s,isHexString:()=>d,joinSignature:()=>S,splitSignature:()=>A,stripZeros:()=>f,zeroPad:()=>h});const n=new(r(80711).Logger)("bytes/5.6.1");function i(t){return!!t.toHexString}function o(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function s(t){return d(t)&&!(t.length%2)||c(t)}function a(t){return"number"==typeof t&&t==t&&t%1==0}function c(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!a(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function u(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),o(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t)&&(t=t.toHexString()),d(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let t=0;tu(t))),r=e.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(r);return e.reduce(((t,e)=>(n.set(e,t),t+e.length)),0),o(n)}function f(t){let e=u(t);if(0===e.length)return e;let r=0;for(;re&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),o(r)}function d(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}const p="0123456789abcdef";function g(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=p[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t))return t.toHexString();if(d(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":n.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(c(t)){let e="0x";for(let r=0;r>4]+p[15&n]}return e}return n.throwArgumentError("invalid hexlify value","value",t)}function y(t){if("string"!=typeof t)t=g(t);else if(!d(t)||t.length%2)return null;return(t.length-2)/2}function m(t,e,r){return"string"!=typeof t?t=g(t):(!d(t)||t.length%2)&&n.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function b(t){let e="0x";return t.forEach((t=>{e+=g(t).substring(2)})),e}function v(t){const e=w(g(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function w(t){"string"!=typeof t&&(t=g(t)),d(t)||n.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&n.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function A(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(s(t)){let r=u(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=g(r.slice(0,32)),e.s=g(r.slice(32,64))):65===r.length?(e.r=g(r.slice(0,32)),e.s=g(r.slice(32,64)),e.v=r[64]):n.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:n.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=g(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=h(u(e._vs),32);e._vs=g(r);const i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const o=g(r);null==e.s?e.s=o:e.s!==o&&n.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?n.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&d(e.r)?e.r=E(e.r,32):n.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&d(e.s)?e.s=E(e.s,32):n.throwArgumentError("signature missing or invalid s","signature",t);const r=u(e.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=g(r);e._vs&&(d(e._vs)||n.throwArgumentError("signature invalid _vs","signature",t),e._vs=E(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function S(t){return g(l([(t=A(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},9279:(t,e,r)=>{"use strict";r.d(e,{d:()=>n});const n="0x0000000000000000000000000000000000000000"},21046:(t,e,r)=>{"use strict";r.d(e,{$B:()=>l,Bz:()=>u,Ce:()=>c,PS:()=>f,Py:()=>a,_Y:()=>o,fh:()=>s,tL:()=>i});var n=r(2593);const i=n.O$.from(-1),o=n.O$.from(0),s=n.O$.from(1),a=n.O$.from(2),c=n.O$.from("1000000000000000000"),u=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),l=n.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),f=n.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},57218:(t,e,r)=>{"use strict";r.d(e,{R:()=>n});const n="0x0000000000000000000000000000000000000000000000000000000000000000"},35644:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="hash/5.6.1"},32046:(t,e,r)=>{"use strict";r.d(e,{id:()=>o});var n=r(38197),i=r(44242);function o(t){return(0,n.keccak256)((0,i.Y0)(t))}},75931:(t,e,r)=>{"use strict";r.r(e),r.d(e,{_TypedDataEncoder:()=>s.E,dnsEncode:()=>i.Kn,hashMessage:()=>o.r,id:()=>n.id,isValidName:()=>i.r1,messagePrefix:()=>o.B,namehash:()=>i.VM});var n=r(32046),i=r(84706),o=r(93684),s=r(67827)},93684:(t,e,r)=>{"use strict";r.d(e,{B:()=>s,r:()=>a});var n=r(93286),i=r(38197),o=r(44242);const s="Ethereum Signed Message:\n";function a(t){return"string"==typeof t&&(t=(0,o.Y0)(t)),(0,i.keccak256)((0,n.concat)([(0,o.Y0)(s),(0,o.Y0)(String(t.length)),t]))}},84706:(t,e,r)=>{"use strict";r.d(e,{Kn:()=>p,VM:()=>d,r1:()=>h});var n=r(93286),i=r(35637),o=r(44242),s=r(38197),a=r(80711),c=r(35644);const u=new a.Logger(c.i),l=new Uint8Array(32);l.fill(0);const f=new RegExp("^((.*)\\.)?([^.]+)$");function h(t){try{const e=t.split(".");for(let t=0;t{const e=(0,o.Y0)("_"+(0,i.Ll)(t));return e[0]=e.length-1,e}))))+"00"}},67827:(t,e,r)=>{"use strict";r.d(e,{E:()=>P});var n=r(64594),i=r(2593),o=r(93286),s=r(38197),a=r(53587),c=r(80711),u=r(35644),l=r(32046),f=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const h=new c.Logger(u.i),d=new Uint8Array(32);d.fill(0);const p=i.O$.from(-1),g=i.O$.from(0),y=i.O$.from(1),m=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const b=(0,o.hexZeroPad)(y.toHexString(),32),v=(0,o.hexZeroPad)(g.toHexString(),32),w={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},E=["name","version","chainId","verifyingContract","salt"];function A(t){return function(e){return"string"!=typeof e&&h.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const S={name:A("name"),version:A("version"),chainId:function(t){try{return i.O$.from(t).toString()}catch(t){}return h.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return(0,n.getAddress)(t).toLowerCase()}catch(t){}return h.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=(0,o.arrayify)(t);if(32!==e.length)throw new Error("bad length");return(0,o.hexlify)(e)}catch(t){}return h.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function k(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&h.throwArgumentError("invalid numeric width","type",t);const s=m.mask(r?n-1:n),a=r?s.add(y).mul(p):g;return function(e){const r=i.O$.from(e);return(r.lt(a)||r.gt(s))&&h.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),(0,o.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&h.throwArgumentError("invalid bytes width","type",t),function(e){return(0,o.arrayify)(e).length!==r&&h.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=(0,o.arrayify)(t),r=e.length%32;return r?(0,o.hexConcat)([e,d.slice(r)]):(0,o.hexlify)(e)}(e)}}}switch(t){case"address":return function(t){return(0,o.hexZeroPad)((0,n.getAddress)(t),32)};case"bool":return function(t){return t?b:v};case"bytes":return function(t){return(0,s.keccak256)(t)};case"string":return function(t){return(0,l.id)(t)}}return null}function x(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class P{constructor(t){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(t))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&h.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&h.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);k(s)||(r[s]||h.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?h.throwArgumentError("missing primary type","types",t):i.length>1&&h.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),(0,a.defineReadOnly)(this,"primaryType",i[0]),function i(o,s){s[o]&&h.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=x(e,t[e])+r.map((e=>x(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=k(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(s.keccak256)),(0,s.keccak256)((0,o.hexConcat)(i))}}const r=this.types[t];if(r){const e=(0,l.id)(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?(0,s.keccak256)(n):n}));return n.unshift(e),(0,o.hexConcat)(n)}}return h.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||h.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return(0,s.keccak256)(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(k(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):h.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new P(t)}static getPrimaryType(t){return P.from(t).primaryType}static hashStruct(t,e,r){return P.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=w[r];n||h.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>E.indexOf(t.name)-E.indexOf(e.name))),P.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return(0,o.hexConcat)(["0x1901",P.hashDomain(t),P.from(e).hash(r)])}static hash(t,e,r){return(0,s.keccak256)(P.encode(t,e,r))}static resolveNames(t,e,r,n){return f(this,void 0,void 0,(function*(){t=(0,a.shallowCopy)(t);const i={};t.verifyingContract&&!(0,o.isHexString)(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const s=P.from(e);s.visit(r,((t,e)=>("address"!==t||(0,o.isHexString)(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=s.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){P.hashDomain(t);const n={},s=[];E.forEach((e=>{const r=t[e];null!=r&&(n[e]=S[e](r),s.push({name:e,type:w[e]}))}));const c=P.from(e),u=(0,a.shallowCopy)(e);return u.EIP712Domain?h.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):u.EIP712Domain=s,c.encode(r),{types:u,domain:n,primaryType:c.primaryType,message:c.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.arrayify)(e));if(t.match(/^u?int/))return i.O$.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&h.throwArgumentError("invalid string","value",e),e}return h.throwArgumentError("unsupported type","type",t)}))}}}},36274:(t,e,r)=>{"use strict";r.r(e),r.d(e,{HDNode:()=>k,defaultPath:()=>S,entropyToMnemonic:()=>T,getAccountPath:()=>O,isValidMnemonic:()=>_,mnemonicToEntropy:()=>P,mnemonicToSeed:()=>x});var n=r(57727),i=r(93286),o=r(2593),s=r(44242),a=r(85306),c=r(53587),u=r(62768),l=r(77158),f=r(21261),h=r(13479),d=r(9855);const p=new(r(80711).Logger)("hdnode/5.6.2"),g=o.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y=(0,s.Y0)("Bitcoin seed"),m=2147483648;function b(t){return(1<=256)throw new Error("Depth too large!");return w((0,i.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,i.hexlify)(this.depth),this.parentFingerprint,(0,i.hexZeroPad)((0,i.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,i.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new k(A,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(t){if(t>4294967295)throw new Error("invalid index - "+String(t));let e=this.path;e&&(e+="/"+(2147483647&t));const r=new Uint8Array(37);if(t&m){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,i.arrayify)(this.privateKey),1),e&&(e+="'")}else r.set((0,i.arrayify)(this.publicKey));for(let e=24;e>=0;e-=8)r[33+(e>>3)]=t>>24-e&255;const n=(0,i.arrayify)((0,l.Gy)(f.p.sha512,this.chainCode,r)),s=n.slice(0,32),a=n.slice(32);let c=null,h=null;if(this.privateKey)c=v(o.O$.from(s).add(this.privateKey).mod(g));else{h=new u.SigningKey((0,i.hexlify)(s))._addPoint(this.publicKey)}let d=e;const p=this.mnemonic;return p&&(d=Object.freeze({phrase:p.phrase,path:e,locale:p.locale||"en"})),new k(A,c,h,this.fingerprint,v(a),t,this.depth+1,d)}derivePath(t){const e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();let r=this;for(let t=0;t=m)throw new Error("invalid path index - "+n);r=r._derive(m+t)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const t=parseInt(n);if(t>=m)throw new Error("invalid path index - "+n);r=r._derive(t)}}}return r}static _fromSeed(t,e){const r=(0,i.arrayify)(t);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=(0,i.arrayify)((0,l.Gy)(f.p.sha512,y,r));return new k(A,v(n.slice(0,32)),null,"0x00000000",v(n.slice(32)),0,0,e)}static fromMnemonic(t,e,r){return t=T(P(t,r=E(r)),r),k._fromSeed(x(t,e),{phrase:t,path:"m",locale:r.locale})}static fromSeed(t){return k._fromSeed(t,null)}static fromExtendedKey(t){const e=n.Base58.decode(t);82===e.length&&w(e.slice(0,78))===t||p.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=e[4],o=(0,i.hexlify)(e.slice(5,9)),s=parseInt((0,i.hexlify)(e.slice(9,13)).substring(2),16),a=(0,i.hexlify)(e.slice(13,45)),c=e.slice(45,78);switch((0,i.hexlify)(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new k(A,null,(0,i.hexlify)(c),o,a,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new k(A,(0,i.hexlify)(c.slice(1)),null,o,a,s,r,null)}return p.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function x(t,e){e||(e="");const r=(0,s.Y0)("mnemonic"+e,s.Uj.NFKD);return(0,a.n)((0,s.Y0)(t,s.Uj.NFKD),r,2048,64,"sha512")}function P(t,e){e=E(e),p.checkNormalize();const r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=(0,i.arrayify)(new Uint8Array(Math.ceil(11*r.length/8)));let o=0;for(let t=0;t>3]|=1<<7-o%8),o++}const s=32*r.length/3,a=b(r.length/3);if(((0,i.arrayify)((0,l.JQ)(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return(0,i.hexlify)(n.slice(0,s/8))}function T(t,e){if(e=E(e),(t=(0,i.arrayify)(t)).length%4!=0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let e=0;e8?(r[r.length-1]<<=8,r[r.length-1]|=t[e],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[e]>>8-n,r.push(t[e]&(1<<8-n)-1),n+=3);const o=t.length/4,s=(0,i.arrayify)((0,l.JQ)(t))[0]&b(o);return r[r.length-1]<<=o,r[r.length-1]|=s>>8-o,e.join(r.map((t=>e.getWord(t))))}function _(t,e){try{return P(t,e),!0}catch(t){}return!1}function O(t){return("number"!=typeof t||t<0||t>=m||t%1)&&p.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}},29816:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="json-wallets/5.6.1"},19380:(t,e,r)=>{"use strict";r.r(e),r.d(e,{decryptCrowdsale:()=>y,decryptJsonWallet:()=>v,decryptJsonWalletSync:()=>w,decryptKeystore:()=>b.pe,decryptKeystoreSync:()=>b.hb,encryptKeystore:()=>b.HI,getJsonWalletAddress:()=>m.Rb,isCrowdsaleWallet:()=>m.LW,isKeystoreWallet:()=>m.aO});var n=r(48709),i=r.n(n),o=r(64594),s=r(93286),a=r(38197),c=r(85306),u=r(44242),l=r(53587),f=r(80711),h=r(29816),d=r(97013);const p=new f.Logger(h.i);class g extends l.Description{isCrowdsaleAccount(t){return!(!t||!t._isCrowdsaleAccount)}}function y(t,e){const r=JSON.parse(t);e=(0,d.Ij)(e);const n=(0,o.getAddress)((0,d.gx)(r,"ethaddr")),l=(0,d.p3)((0,d.gx)(r,"encseed"));l&&l.length%16==0||p.throwArgumentError("invalid encseed","json",t);const f=(0,s.arrayify)((0,c.n)(e,e,2e3,32,"sha256")).slice(0,16),h=l.slice(0,16),y=l.slice(16),m=new(i().ModeOfOperation.cbc)(f,h),b=i().padding.pkcs7.strip((0,s.arrayify)(m.decrypt(y)));let v="";for(let t=0;t{"use strict";r.d(e,{LW:()=>i,Rb:()=>s,aO:()=>o});var n=r(64594);function i(t){let e=null;try{e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function o(t){let e=null;try{e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}function s(t){if(i(t))try{return(0,n.getAddress)(JSON.parse(t).ethaddr)}catch(t){return null}if(o(t))try{return(0,n.getAddress)(JSON.parse(t).address)}catch(t){return null}return null}},81964:(t,e,r)=>{"use strict";r.d(e,{HI:()=>_,hb:()=>P,pe:()=>T});var n=r(48709),i=r.n(n),o=r(17635),s=r.n(o),a=r(64594),c=r(93286),u=r(36274),l=r(38197),f=r(85306),h=r(44478),d=r(53587),p=r(13479),g=r(97013),y=r(80711),m=r(29816),b=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const v=new y.Logger(m.i);function w(t){return null!=t&&t.mnemonic&&t.mnemonic.phrase}class E extends d.Description{isKeystoreAccount(t){return!(!t||!t._isKeystoreAccount)}}function A(t,e){const r=(0,g.p3)((0,g.gx)(t,"crypto/ciphertext"));if((0,c.hexlify)((0,l.keccak256)((0,c.concat)([e.slice(16,32),r]))).substring(2)!==(0,g.gx)(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(t,e,r){if("aes-128-ctr"===(0,g.gx)(t,"crypto/cipher")){const n=(0,g.p3)((0,g.gx)(t,"crypto/cipherparams/iv")),o=new(i().Counter)(n),s=new(i().ModeOfOperation.ctr)(e,o);return(0,c.arrayify)(s.decrypt(r))}return null}(t,e.slice(0,16),r);n||v.throwError("unsupported cipher",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const o=e.slice(32,64),s=(0,p.computeAddress)(n);if(t.address){let e=t.address.toLowerCase();if("0x"!==e.substring(0,2)&&(e="0x"+e),(0,a.getAddress)(e)!==s)throw new Error("address mismatch")}const f={_isKeystoreAccount:!0,address:s,privateKey:(0,c.hexlify)(n)};if("0.1"===(0,g.gx)(t,"x-ethers/version")){const e=(0,g.p3)((0,g.gx)(t,"x-ethers/mnemonicCiphertext")),r=(0,g.p3)((0,g.gx)(t,"x-ethers/mnemonicCounter")),n=new(i().Counter)(r),s=new(i().ModeOfOperation.ctr)(o,n),a=(0,g.gx)(t,"x-ethers/path")||u.defaultPath,l=(0,g.gx)(t,"x-ethers/locale")||"en",h=(0,c.arrayify)(s.decrypt(e));try{const t=(0,u.entropyToMnemonic)(h,l),e=u.HDNode.fromMnemonic(t,null,l).derivePath(a);if(e.privateKey!=f.privateKey)throw new Error("mnemonic mismatch");f.mnemonic=e.mnemonic}catch(t){if(t.code!==y.Logger.errors.INVALID_ARGUMENT||"wordlist"!==t.argument)throw t}}return new E(f)}function S(t,e,r,n,i){return(0,c.arrayify)((0,f.n)(t,e,r,n,i))}function k(t,e,r,n,i){return Promise.resolve(S(t,e,r,n,i))}function x(t,e,r,n,i){const o=(0,g.Ij)(e),s=(0,g.gx)(t,"crypto/kdf");if(s&&"string"==typeof s){const e=function(t,e){return v.throwArgumentError("invalid key-derivation function parameters",t,e)};if("scrypt"===s.toLowerCase()){const r=(0,g.p3)((0,g.gx)(t,"crypto/kdfparams/salt")),a=parseInt((0,g.gx)(t,"crypto/kdfparams/n")),c=parseInt((0,g.gx)(t,"crypto/kdfparams/r")),u=parseInt((0,g.gx)(t,"crypto/kdfparams/p"));a&&c&&u||e("kdf",s),0!=(a&a-1)&&e("N",a);const l=parseInt((0,g.gx)(t,"crypto/kdfparams/dklen"));return 32!==l&&e("dklen",l),n(o,r,a,c,u,64,i)}if("pbkdf2"===s.toLowerCase()){const n=(0,g.p3)((0,g.gx)(t,"crypto/kdfparams/salt"));let i=null;const s=(0,g.gx)(t,"crypto/kdfparams/prf");"hmac-sha256"===s?i="sha256":"hmac-sha512"===s?i="sha512":e("prf",s);const a=parseInt((0,g.gx)(t,"crypto/kdfparams/c")),c=parseInt((0,g.gx)(t,"crypto/kdfparams/dklen"));return 32!==c&&e("dklen",c),r(o,n,a,c,i)}}return v.throwArgumentError("unsupported key-derivation function","kdf",s)}function P(t,e){const r=JSON.parse(t);return A(r,x(r,e,S,s().syncScrypt))}function T(t,e,r){return b(this,void 0,void 0,(function*(){const n=JSON.parse(t);return A(n,yield x(n,e,k,s().scrypt,r))}))}function _(t,e,r,n){try{if((0,a.getAddress)(t.address)!==(0,p.computeAddress)(t.privateKey))throw new Error("address/privateKey mismatch");if(w(t)){const e=t.mnemonic;if(u.HDNode.fromMnemonic(e.phrase,null,e.locale).derivePath(e.path||u.defaultPath).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(t){return Promise.reject(t)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const o=(0,c.arrayify)(t.privateKey),f=(0,g.Ij)(e);let d=null,y=null,m=null;if(w(t)){const e=t.mnemonic;d=(0,c.arrayify)((0,u.mnemonicToEntropy)(e.phrase,e.locale||"en")),y=e.path||u.defaultPath,m=e.locale||"en"}let b=r.client;b||(b="ethers.js");let v=null;v=r.salt?(0,c.arrayify)(r.salt):(0,h.O)(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,h.O)(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,h.O)(16);let S=1<<17,k=8,x=1;return r.scrypt&&(r.scrypt.N&&(S=r.scrypt.N),r.scrypt.r&&(k=r.scrypt.r),r.scrypt.p&&(x=r.scrypt.p)),s().scrypt(f,v,S,k,x,64,n).then((e=>{const r=(e=(0,c.arrayify)(e)).slice(0,16),n=e.slice(16,32),s=e.slice(32,64),a=new(i().Counter)(E),u=new(i().ModeOfOperation.ctr)(r,a),f=(0,c.arrayify)(u.encrypt(o)),p=(0,l.keccak256)((0,c.concat)([n,f])),w={address:t.address.substring(2).toLowerCase(),id:(0,g.EH)(A),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,c.hexlify)(E).substring(2)},ciphertext:(0,c.hexlify)(f).substring(2),kdf:"scrypt",kdfparams:{salt:(0,c.hexlify)(v).substring(2),n:S,dklen:32,p:x,r:k},mac:p.substring(2)}};if(d){const t=(0,h.O)(16),e=new(i().Counter)(t),r=new(i().ModeOfOperation.ctr)(s,e),n=(0,c.arrayify)(r.encrypt(d)),o=new Date,a=o.getUTCFullYear()+"-"+(0,g.VP)(o.getUTCMonth()+1,2)+"-"+(0,g.VP)(o.getUTCDate(),2)+"T"+(0,g.VP)(o.getUTCHours(),2)+"-"+(0,g.VP)(o.getUTCMinutes(),2)+"-"+(0,g.VP)(o.getUTCSeconds(),2)+".0Z";w["x-ethers"]={client:b,gethFilename:"UTC--"+a+"--"+w.address,mnemonicCounter:(0,c.hexlify)(t).substring(2),mnemonicCiphertext:(0,c.hexlify)(n).substring(2),path:y,locale:m,version:"0.1"}}return JSON.stringify(w)}))}},97013:(t,e,r)=>{"use strict";r.d(e,{EH:()=>u,Ij:()=>a,VP:()=>s,gx:()=>c,p3:()=>o});var n=r(93286),i=r(44242);function o(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),(0,n.arrayify)(t)}function s(t,e){for(t=String(t);t.length255)return!1;return!0}function i(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!n(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&n(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function o(t){return new Uint8Array(t)}function s(t,e,r,n,i){null==n&&null==i||(t=t.slice?t.slice(n,i):Array.prototype.slice.call(t,n,i)),e.set(t,r)}var a,c={toBytes:function(t){var e=[],r=0;for(t=encodeURI(t);r191&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},u=(a="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r>4]+a[15&n])}return e.join("")}}),l={16:10,24:12,32:14},f=[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],h=[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],d=[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],g=[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],y=[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],m=[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],b=[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],v=[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],w=[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],S=[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],k=[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],x=[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 P(t){for(var e=[],r=0;r>2,this._Ke[r][e%4]=o[e],this._Kd[t-r][e%4]=o[e];for(var s,a=0,c=i;c>16&255]<<24^h[s>>8&255]<<16^h[255&s]<<8^h[s>>24&255]^f[a]<<24,a+=1,8!=i)for(e=1;e>8&255]<<8^h[s>>16&255]<<16^h[s>>24&255]<<24;for(e=i/2+1;e>2,d=c%4,this._Ke[u][d]=o[e],this._Kd[t-u][d]=o[e++],c++}for(var u=1;u>24&255]^S[s>>16&255]^k[s>>8&255]^x[255&s]},T.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=P(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s>24&255]^g[n[(i+1)%4]>>16&255]^y[n[(i+2)%4]>>8&255]^m[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Ke[e][i],c[4*i]=255&(h[n[i]>>24&255]^a>>24),c[4*i+1]=255&(h[n[(i+1)%4]>>16&255]^a>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(h[255&n[(i+3)%4]]^a);return c},T.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=P(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^E[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Kd[e][i],c[4*i]=255&(d[n[i]>>24&255]^a>>24),c[4*i+1]=255&(d[n[(i+3)%4]>>16&255]^a>>16),c[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(d[255&n[(i+1)%4]]^a);return c};var _=function(t){if(!(this instanceof _))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new T(t)};_.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=o(t.length),r=o(16),n=0;n=0;--e)this._counter[e]=t%256,t>>=8},M.prototype.setBytes=function(t){if(16!=(t=i(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},M.prototype.increment=function(){for(var t=15;t>=0;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var N=function(t,e){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof M||(e=new M(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new T(t)};N.prototype.encrypt=function(t){for(var e=i(t,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n{"use strict";r.r(e),r.d(e,{keccak256:()=>s});var n=r(91094),i=r.n(n),o=r(93286);function s(t){return"0x"+i().keccak_256((0,o.arrayify)(t))}},80711:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ErrorCode:()=>l,LogLevel:()=>u,Logger:()=>h});let n=!1,i=!1;const o={debug:1,default:2,info:2,warning:3,error:4,off:5};let s=o.default,a=null;const c=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var u,l;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(u||(u={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(l||(l={}));const f="0123456789abcdef";class h{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==o[r]&&this.throwArgumentError("invalid log level name","logLevel",t),s>o[r]||console.log.apply(console,e)}debug(...t){this._log(h.levels.DEBUG,t)}info(...t){this._log(h.levels.INFO,t)}warn(...t){this._log(h.levels.WARNING,t)}makeError(t,e,r){if(i)return this.makeError("censored error",e,{});e||(e=h.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=f[15&e[t]];n.push(t+"=Uint8Array(0x"+r+")")}else n.push(t+"="+JSON.stringify(e))}catch(e){n.push(t+"="+JSON.stringify(r[t].toString()))}})),n.push(`code=${e}`),n.push(`version=${this.version}`);const o=t;let s="";switch(e){case l.NUMERIC_FAULT:{s="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case l.CALL_EXCEPTION:case l.INSUFFICIENT_FUNDS:case l.MISSING_NEW:case l.NONCE_EXPIRED:case l.REPLACEMENT_UNDERPRICED:case l.TRANSACTION_REPLACED:case l.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(t+=" ("+n.join(", ")+")");const a=new Error(t);return a.reason=o,a.code=e,Object.keys(r).forEach((function(t){a[t]=r[t]})),a}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,h.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),c&&this.throwError("platform missing String.prototype.normalize",h.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:c})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,h.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",h.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",h.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",h.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return a||(a=new h("logger/5.6.0")),a}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!t)return;this.globalLogger().throwError("error censorship permanent",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!t,n=!!e}static setLogLevel(t){const e=o[t.toLowerCase()];null!=e?s=e:h.globalLogger().warn("invalid log level - "+t)}static from(t){return new h(t)}}h.errors=l,h.levels=u},79861:(t,e,r)=>{"use strict";r.d(e,{H:()=>l});const n=new(r(80711).Logger)("networks/5.6.4");function i(t){const e=function(e,r){null==r&&(r={});const n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby"];try{const o=new e.PocketProvider(t,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new e.AnkrProvider(t,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(n,i)}return n[0]};return e.renetwork=function(t){return i(t)},e}function o(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return o(t,e)},r}const s={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:i("homestead")},a={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:i("ropsten")},c={chainId:63,name:"classicMordor",_defaultProvider:o("https://www.ethercluster.com/mordor","classicMordor")},u={unspecified:{chainId:0,name:"unspecified"},homestead:s,mainnet:s,morden:{chainId:2,name:"morden"},ropsten:a,testnet:a,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:i("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:i("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:i("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:o("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:c,classicTestnet:c,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:o("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:i("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:i("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function l(t){if(null==t)return null;if("number"==typeof t){for(const e in u){const r=u[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=u[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=u[t.name];if(!e)return"number"!=typeof t.chainId&&n.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&n.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;var i;return null==r&&e._defaultProvider&&(r=(i=e._defaultProvider)&&"function"==typeof i.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}},85306:(t,e,r)=>{"use strict";r.d(e,{n:()=>o});var n=r(93286),i=r(77158);function o(t,e,r,o,s){let a;t=(0,n.arrayify)(t),e=(0,n.arrayify)(e);let c=1;const u=new Uint8Array(o),l=new Uint8Array(e.length+4);let f,h;l.set(e);for(let d=1;d<=c;d++){l[e.length]=d>>24&255,l[e.length+1]=d>>16&255,l[e.length+2]=d>>8&255,l[e.length+3]=255&d;let p=(0,n.arrayify)((0,i.Gy)(s,t,l));a||(a=p.length,h=new Uint8Array(a),c=Math.ceil(o/a),f=o-(c-1)*a),h.set(p);for(let e=1;e{"use strict";r.r(e),r.d(e,{Description:()=>g,checkProperties:()=>u,deepCopy:()=>p,defineReadOnly:()=>s,getStatic:()=>a,resolveProperties:()=>c,shallowCopy:()=>l});var n=r(80711);var i=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const o=new n.Logger("properties/5.6.0");function s(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function a(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!=typeof t.prototype)break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function c(t){return i(this,void 0,void 0,(function*(){const e=Object.keys(t).map((e=>{const r=t[e];return Promise.resolve(r).then((t=>({key:e,value:t})))}));return(yield Promise.all(e)).reduce(((t,e)=>(t[e.key]=e.value,t)),{})}))}function u(t,e){t&&"object"==typeof t||o.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||o.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}function l(t){const e={};for(const r in t)e[r]=t[r];return e}const f={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function h(t){if(null==t||f[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rp(t))));if("object"==typeof t){const e={};for(const r in t){const n=t[r];void 0!==n&&s(e,r,p(n))}return e}return o.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function p(t){return d(t)}class g{constructor(t){for(const e in t)this[e]=p(t[e])}}},34216:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="providers/5.6.8"},75361:(t,e,r)=>{"use strict";r.d(e,{H2:()=>j,Zk:()=>H});var n=r(64353),i=r(59567),o=r(57727),s=r(2593),a=r(93286),c=r(57218),u=r(84706),l=r(79861),f=r(53587),h=r(77158),d=r(44242),p=r(58341),g=r(92882),y=r.n(g),m=r(80711),b=r(34216),v=r(30032),w=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const E=new m.Logger(b.i);function A(t){return null==t?"null":(32!==(0,a.hexDataLength)(t)&&E.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function S(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[A(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return A(t)})).join("&")}function k(t){if("string"==typeof t){if(t=t.toLowerCase(),32===(0,a.hexDataLength)(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+S(t);if(n.Sg.isForkEvent(t))throw E.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+S(t.topics||[])}throw new Error("invalid event - "+t)}function x(){return(new Date).getTime()}function P(t){return new Promise((e=>{setTimeout(e,t)}))}const T=["block","network","pending","poll"];class _{constructor(t,e,r){(0,f.defineReadOnly)(this,"tag",t),(0,f.defineReadOnly)(this,"listener",e),(0,f.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],r=""===(n=t[2])?[]:n.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var n;const i={};return r.length>0&&(i.topics=r),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||T.indexOf(this.tag)>=0}}const O={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function I(t){return(0,a.hexZeroPad)(s.O$.from(t).toHexString(),32)}function B(t){return o.Base58.encode((0,a.concat)([t,(0,a.hexDataSlice)((0,h.JQ)((0,h.JQ)(t)),0,4)]))}const M=new RegExp("^(ipfs)://(.*)$","i"),N=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),M,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function C(t,e){try{return(0,d.ZN)(L(t,e))}catch(t){}return null}function L(t,e){if("0x"===t)return null;const r=s.O$.from((0,a.hexDataSlice)(t,e,e+32)).toNumber(),n=s.O$.from((0,a.hexDataSlice)(t,r,r+32)).toNumber();return(0,a.hexDataSlice)(t,r+32,r+32+n)}function R(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):E.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function U(t){const e=(0,a.arrayify)(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function D(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function F(t){const e=[];let r=0;for(let n=0;ns.O$.from(t).eq(1))).catch((t=>{if(t.code===m.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return w(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:(0,a.hexConcat)([t,(0,u.VM)(this.name),e||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,a.hexConcat)(["0x9061b923",F([(0,u.Kn)(this.name),r.data])]));try{let t=yield this.provider.call(r);return(0,a.arrayify)(t).length%32==4&&E.throwError("resolver threw error",m.Logger.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=L(t,0)),t}catch(t){if(t.code===m.Logger.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return w(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?L(r,0):null}))}_getAddress(t,e){const r=O[String(t)];if(null==r&&E.throwError(`unsupported coin type: ${t}`,m.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=(0,a.arrayify)(e);if(null!=r.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return B((0,a.concat)([[r.p2pkh],"0x"+t[2]]))}}if(null!=r.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return B((0,a.concat)([[r.p2sh],"0x"+t[2]]))}}if(null!=r.prefix){const t=n[1];let e=n[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&n.length===2+t&&t>=1&&t<=75){const t=y().toWords(n.slice(2));return t.unshift(e),y().encode(r.prefix,t)}}return null}getAddress(t){return w(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||t===c.R?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===m.Logger.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",I(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&E.throwError("invalid or unsupported coin data",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return w(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let r=0;rt[e]))}return E.throwError("invalid or unsupported content hash data",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return w(this,void 0,void 0,(function*(){let e=(0,d.Y0)(t);e=(0,a.concat)([I(64),I(e.length),e]),e.length%32!=0&&(e=(0,a.concat)([e,(0,a.hexZeroPad)("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",(0,a.hexlify)(e));return null==r||"0x"===r?null:(0,d.ZN)(r)}))}}let V=null,G=1;class H extends n.zt{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,f.defineReadOnly)(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=(0,f.getStatic)(new.target,"getNetwork")(t);e?((0,f.defineReadOnly)(this,"_network",e),this.emit("network",e,null)):E.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return w(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||E.throwError("no network detected",m.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return(0,p.poll)((()=>this._ready().then((t=>t),(t=>{if(t.code!==m.Logger.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==V&&(V=new v.Mb),V}static getNetwork(t){return(0,l.H)(null==t?"homestead":t)}ccipReadFetch(t,e,r){return w(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t=0?null:JSON.stringify({data:i,sender:n}),c=yield(0,p.fetchJson)({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return E.throwError(`response not found during CCIP fetch: ${u}`,m.Logger.errors.SERVER_ERROR,{url:e,errorMessage:u});o.push(u)}return E.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,m.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return w(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const r=yield e;if(x()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=x(),r=(0,f.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=x();return(t=s.O$.from(t).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return w(this,void 0,void 0,(function*(){const t=G++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)E.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",E.makeError("network block skew detected",m.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let t=this._emitted.block+1;t<=r;t++)this.emit("block",t);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((t=>{switch(t.type){case"tx":{const r=t.hash;let n=this.getTransactionReceipt(r).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+r]=t.blockNumber,this.emit(r,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(n);break}case"filter":if(!t._inflight){t._inflight=!0;const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=r,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const i=this.getLogs(n).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(n,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=r,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return w(this,void 0,void 0,(function*(){return E.throwError("provider does not support network detection",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return w(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield P(0),this._network;const r=E.makeError("underlying network changed",m.Logger.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=x();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&tthis._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return w(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return w(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},u=t=>{t.confirmations{this.removeListener(t,u)})),n){let r=n.startBlock,i=null;const u=s=>w(this,void 0,void 0,(function*(){a||(yield P(1e3),this.getTransactionCount(n.from).then((l=>w(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=r-3,i{a||this.once("block",u)})))}));if(a)return;this.once("block",u),s.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{c()||o(E.makeError("timeout exceeded",m.Logger.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return w(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return s.O$.from(t)}catch(e){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return s.O$.from(n)}catch(t){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return s.O$.from(n).toNumber()}catch(t){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return(0,a.hexlify)(n)}catch(t){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,f.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>(0,a.hexValue)(t)))}),i=yield this.perform("getStorageAt",n);try{return(0,a.hexlify)(i)}catch(t){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==(0,a.hexDataLength)(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&E.throwError("Transaction hash mismatch from Provider.sendTransaction.",m.Logger.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>w(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});const o=yield this._waitForTransaction(t.hash,e,n,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&E.throwError("transaction failed",m.Logger.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>(0,a.hexlify)(t))),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,t,n)}catch(t){throw t.transaction=r,t.transactionHash=r.hash,t}}))}_getTransactionRequest(t){return w(this,void 0,void 0,(function*(){const e=yield t,r={};return["from","to"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?s.O$.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?(0,a.hexlify)(t):null)))})),this.formatter.transactionRequest(yield(0,f.resolveProperties)(r))}))}_getFilter(t){return w(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((r=>{null!=t[r]&&(e[r]=t[r])})),["fromBlock","toBlock"].forEach((r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))})),this.formatter.filter(yield(0,f.resolveProperties)(e))}))}_call(t,e,r){return w(this,void 0,void 0,(function*(){r>=10&&E.throwError("CCIP read exceeded maximum redirections",m.Logger.errors.SERVER_ERROR,{redirects:r,transaction:t});const n=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===i.substring(0,10)&&(0,a.hexDataLength)(i)%32==4)try{const o=(0,a.hexDataSlice)(i,4),c=(0,a.hexDataSlice)(o,0,32);s.O$.from(c).eq(n)||E.throwError("CCIP Read sender did not match",m.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const u=[],l=s.O$.from((0,a.hexDataSlice)(o,32,64)).toNumber(),f=s.O$.from((0,a.hexDataSlice)(o,l,l+32)).toNumber(),h=(0,a.hexDataSlice)(o,l+32);for(let e=0;ew(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let e=null;for(let r=0;rthis._wrapTransaction(t))),r}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return w(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return(0,p.poll)((()=>w(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(t){return w(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return(0,p.poll)((()=>w(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return n}))),{oncePoll:this})}))}getLogs(t){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield(0,f.resolveProperties)({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),v.Mb.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return w(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return w(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&E.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return w(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const r=yield this._getResolver(e,"getResolver");if(null!=r){const n=new j(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return w(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||E.throwError("network does not support ENS",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+(0,u.VM)(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return w(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if((0,a.isHexString)(t))throw e}"string"!=typeof t&&E.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return w(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;const n=C(yield this.call({to:r,data:"0x691f3431"+(0,u.VM)(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return w(this,void 0,void 0,(function*(){let e=null;if((0,a.isHexString)(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new j(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==m.Logger.errors.CALL_EXCEPTION)throw t}try{const t=C(yield this.call({to:n,data:"0x691f3431"+(0,u.VM)(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==m.Logger.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const r=yield e.getAvatar();return null==r?null:r.url}))}perform(t,e){return E.throwError(t+" not implemented",m.Logger.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,r){const n=new _(k(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],i=k(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),r=!0,!t.once||(n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),r}listenerCount(t){if(!t)return this._events.length;let e=k(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=k(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const r=[];let n=!1,i=k(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!n||(n=!0,r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const r=k(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}},30032:(t,e,r)=>{"use strict";r.d(e,{Ed:()=>d,Gp:()=>p,Mb:()=>h,vh:()=>y});var n=r(64594),i=r(2593),o=r(93286),s=r(9279),a=r(53587),c=r(13479),u=r(80711),l=r(34216);const f=new u.Logger(l.i);class h{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),c=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:h.allowNull(this.accessList.bind(this),null),blockHash:h.allowNull(o,null),blockNumber:h.allowNull(c,null),transactionIndex:h.allowNull(c,null),confirmations:h.allowNull(c,null),from:e,gasPrice:h.allowNull(r),maxPriorityFeePerGas:h.allowNull(r),maxFeePerGas:h.allowNull(r),gasLimit:r,to:h.allowNull(e,null),value:r,nonce:c,data:i,r:h.allowNull(this.uint256),s:h.allowNull(this.uint256),v:h.allowNull(c),creates:h.allowNull(e,null),raw:h.allowNull(i)},t.transactionRequest={from:h.allowNull(e),nonce:h.allowNull(c),gasLimit:h.allowNull(r),gasPrice:h.allowNull(r),maxPriorityFeePerGas:h.allowNull(r),maxFeePerGas:h.allowNull(r),to:h.allowNull(e),value:h.allowNull(r),data:h.allowNull((t=>this.data(t,!0))),type:h.allowNull(c),accessList:h.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:e,topics:h.arrayOf(o),data:i,logIndex:c,blockHash:o},t.receipt={to:h.allowNull(this.address,null),from:h.allowNull(this.address,null),contractAddress:h.allowNull(e,null),transactionIndex:c,root:h.allowNull(s),gasUsed:r,logsBloom:h.allowNull(i),blockHash:o,transactionHash:o,logs:h.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:h.allowNull(c,null),cumulativeGasUsed:r,effectiveGasPrice:h.allowNull(r),status:h.allowNull(c),type:u},t.block={hash:h.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:h.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:h.allowNull(e),extraData:i,transactions:h.allowNull(h.arrayOf(o)),baseFeePerGas:h.allowNull(r)},t.blockWithTransactions=(0,a.shallowCopy)(t.block),t.blockWithTransactions.transactions=h.allowNull(h.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:h.allowNull(n,void 0),toBlock:h.allowNull(n,void 0),blockHash:h.allowNull(o,void 0),address:h.allowNull(e,void 0),topics:h.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:h.allowNull(c),blockHash:h.allowNull(o),transactionIndex:c,removed:h.allowNull(this.boolean.bind(this)),address:e,data:h.allowFalsish(i,"0x"),topics:h.arrayOf(o),transactionHash:o,logIndex:c},t}accessList(t){return(0,c.accessListify)(t||[])}number(t){return"0x"===t?0:i.O$.from(t).toNumber()}type(t){return"0x"===t||null==t?0:i.O$.from(t).toNumber()}bigNumber(t){return i.O$.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),(0,o.isHexString)(t))?t.toLowerCase():f.throwArgumentError("invalid hash","value",t)}data(t,e){const r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}address(t){return(0,n.getAddress)(t)}callAddress(t){if(!(0,o.isHexString)(t,32))return null;const e=(0,n.getAddress)((0,o.hexDataSlice)(t,12));return e===s.d?null:e}contractAddress(t){return(0,n.getContractAddress)(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||(0,o.isHexString)(t))return(0,o.hexValue)(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==(0,o.hexDataLength)(r)?f.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=i.O$.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!(0,o.isHexString)(t))throw new Error("invalid uint256");return(0,o.hexZeroPad)(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const r=null!=t._difficulty?t._difficulty:t.difficulty,n=h.check(e,t);return n._difficulty=null==r?null:i.O$.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return h.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&i.O$.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=h.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),"number"!=typeof r&&null!=e.v&&(r=(e.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),e.chainId=r}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return(0,c.parse)(t)}receiptLog(t){return h.check(this.formats.receiptLog,t)}receipt(t){const e=h.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=i.O$.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&f.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):f.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&f.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return h.check(this.formats.filter,t)}filterLog(t){return h.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const n in t)try{const i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}static allowNull(t,e){return function(r){return null==r?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const r=[];return e.forEach((function(e){r.push(t(e))})),r}}}function d(t){return t&&"function"==typeof t.isCommunityResource}function p(t){return d(t)&&t.isCommunityResource()}let g=!1;function y(){g||(g=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}},82169:(t,e,r)=>{"use strict";r.d(e,{C:()=>S,r:()=>P});var n=r(48171),i=r(2593),o=r(93286),s=r(67827),a=r(53587),c=r(44242),u=r(13479),l=r(58341),f=r(80711),h=r(34216),d=r(75361),p=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const g=new f.Logger(h.i),y=["call","estimateGas"];function m(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const r=(0,o.isHexString)(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"==typeof t){for(const r in t){const n=m(t[r],e);if(n)return n}return null}if("string"==typeof t)try{return m(JSON.parse(t),e)}catch(t){}return null}function b(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=m(e,!0);if(t)return t.data;g.throwError("missing revert data in call exception; Transaction reverted without a reason string",f.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=m(e.body,!1);null==r&&(r=m(e,!1)),r&&g.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",f.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===f.Logger.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&g.throwError("insufficient funds for intrinsic transaction cost",f.Logger.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&g.throwError("nonce has already been used",f.Logger.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&g.throwError("replacement fee too low",f.Logger.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&g.throwError("legacy pre-eip-155 transactions not supported",f.Logger.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),y.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&g.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",f.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function v(t){return new Promise((function(e){setTimeout(e,t)}))}function w(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function E(t){return t?t.toLowerCase():t}const A={};class S extends n.E{constructor(t,e,r){if(super(),t!==A)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,a.defineReadOnly)(this,"provider",e),null==r&&(r=0),"string"==typeof r?((0,a.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,a.defineReadOnly)(this,"_index",null)):"number"==typeof r?((0,a.defineReadOnly)(this,"_index",r),(0,a.defineReadOnly)(this,"_address",null)):g.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return g.throwError("cannot alter JSON-RPC Signer connection",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new k(A,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&g.throwError("unknown account #"+this._index,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=(0,a.shallowCopy)(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=(0,a.shallowCopy)(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>p(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&g.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),(0,a.resolveProperties)({tx:(0,a.resolveProperties)(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&g.throwArgumentError("from address mismatch","transaction",t):e.from=r;const n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((t=>t),(t=>b("sendTransaction",t,n)))}))}signTransaction(t){return g.throwError("signing transactions is unsupported",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return p(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield(0,l.poll)((()=>p(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=r,t}}))}signMessage(t){return p(this,void 0,void 0,(function*(){const e="string"==typeof t?(0,c.Y0)(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[(0,o.hexlify)(e),r.toLowerCase()])}))}_legacySignMessage(t){return p(this,void 0,void 0,(function*(){const e="string"==typeof t?(0,c.Y0)(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,o.hexlify)(e)])}))}_signTypedData(t,e,r){return p(this,void 0,void 0,(function*(){const n=yield s.E.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(s.E.getPayload(n.domain,e,n.value))])}))}unlock(t){return p(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class k extends S{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const x={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class P extends d.Zk{constructor(t,e){let r=e;null==r&&(r=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(r),t||(t=(0,a.getStatic)(this.constructor,"defaultUrl")()),"string"==typeof t?(0,a.defineReadOnly)(this,"connection",Object.freeze({url:t})):(0,a.defineReadOnly)(this,"connection",Object.freeze((0,a.shallowCopy)(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return p(this,void 0,void 0,(function*(){yield v(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=(0,a.getStatic)(this.constructor,"getNetwork");try{return e(i.O$.from(t).toNumber())}catch(e){return g.throwError("could not detect network",f.Logger.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return g.throwError("could not detect network",f.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new S(A,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,a.deepCopy)(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=(0,l.fetchJson)(this.connection,JSON.stringify(r),w).then((t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t}));return n&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[E(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[E(e.address),e.blockTag]];case"getCode":return["eth_getCode",[E(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[E(e.address),(0,o.hexZeroPad)(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[(0,a.getStatic)(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,a.getStatic)(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=E(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return p(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&i.O$.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=(0,a.shallowCopy)(e)).transaction=(0,a.shallowCopy)(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&g.throwError(t+" not implemented",f.Logger.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return b(t,r,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return v(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((t=>{}))}(),r})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const r=(0,a.shallowCopy)(x);if(e)for(const t in e)e[t]&&(r[t]=!0);(0,a.checkProperties)(t,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=(0,o.hexValue)(i.O$.from(t[e]));"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=(0,o.hexlify)(t[e]))})),t.accessList&&(n.accessList=(0,u.accessListify)(t.accessList)),n}}},241:(t,e,r)=>{"use strict";r.d(e,{Q:()=>l});var n=r(53587),i=r(80711),o=r(34216),s=r(82169);const a=new i.Logger(o.i);let c=1;function u(t,e){const r="Web3LegacyFetcher";return function(t,i){const o={method:t,params:i,id:c++,jsonrpc:"2.0"};return new Promise(((t,i)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,n.deepCopy)(o),provider:this}),e(o,((e,n)=>{if(e)return this.emit("debug",{action:"response",fetcher:r,error:e,request:o,provider:this}),i(e);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:n,provider:this}),n.error){const t=new Error(n.error.message);return t.code=n.error.code,t.data=n.error.data,i(t)}t(n.result)}))}))}}class l extends s.r{constructor(t,e){null==t&&a.throwArgumentError("missing provider","provider",t);let r=null,i=null,o=null;"function"==typeof t?(r="unknown:",i=t):(r=t.host||t.path||"",!r&&t.isMetaMask&&(r="metamask"),o=t,t.request?(""===r&&(r="eip-1193:"),i=function(t){return function(e,r){null==r&&(r=[]);const i={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,n.deepCopy)(i),provider:this}),t.request(i).then((t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:t,provider:this}),t}))}}(t)):t.sendAsync?i=u(0,t.sendAsync.bind(t)):t.send?i=u(0,t.send.bind(t)):a.throwArgumentError("unsupported provider","provider",t),r||(r="unknown:")),super(r,e),(0,n.defineReadOnly)(this,"jsonRpcFetchFunc",i),(0,n.defineReadOnly)(this,"provider",o)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}},22118:(t,e,r)=>{"use strict";r.r(e),r.d(e,{randomBytes:()=>n.O,shuffled:()=>i.y});var n=r(44478),i=r(52472)},44478:(t,e,r)=>{"use strict";r.d(e,{O:()=>c});var n=r(93286),i=r(80711);const o=new i.Logger("random/5.6.1");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 a=s.crypto||s.msCrypto;function c(t){(t<=0||t>1024||t%1||t!=t)&&o.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return a.getRandomValues(e),(0,n.arrayify)(e)}a&&a.getRandomValues||(o.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(t){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},52472:(t,e,r)=>{"use strict";function n(t){for(let e=(t=t.slice()).length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}r.d(e,{y:()=>n})},61843:(t,e,r)=>{"use strict";r.r(e),r.d(e,{decode:()=>h,encode:()=>u});var n=r(93286),i=r(80711);const o=new i.Logger("rlp/5.6.1");function s(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function a(t,e,r){let n=0;for(let i=0;ie+1+n&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:s}}function f(t,e){if(0===t.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});const n=a(t,e+1,r);return e+1+r+n>t.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(t,e,e+1+r,r+n)}if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(t,e,e+1,r)}if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});const s=a(t,e+1,r);e+1+r+s>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r+s,result:(0,n.hexlify)(t.slice(e+1+r,e+1+r+s))}}if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:(0,n.hexlify)(t.slice(e+1,e+1+r))}}return{consumed:1,result:(0,n.hexlify)(t[e])}}function h(t){const e=(0,n.arrayify)(t),r=f(e,0);return r.consumed!==e.length&&o.throwArgumentError("invalid rlp data","data",t),r.result}},91278:(t,e,r)=>{"use strict";r.r(e),r.d(e,{SupportedAlgorithm:()=>i.p,computeHmac:()=>n.Gy,ripemd160:()=>n.bP,sha256:()=>n.JQ,sha512:()=>n.o});var n=r(77158),i=r(21261)},77158:(t,e,r)=>{"use strict";r.d(e,{Gy:()=>h,bP:()=>u,JQ:()=>l,o:()=>f});var n=r(33715),i=r.n(n),o=r(93286),s=r(21261),a=r(80711);const c=new a.Logger("sha2/5.6.1");function u(t){return"0x"+i().ripemd160().update((0,o.arrayify)(t)).digest("hex")}function l(t){return"0x"+i().sha256().update((0,o.arrayify)(t)).digest("hex")}function f(t){return"0x"+i().sha512().update((0,o.arrayify)(t)).digest("hex")}function h(t,e,r){return s.p[t]||c.throwError("unsupported algorithm "+t,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+i().hmac(i()[t],(0,o.arrayify)(e)).update((0,o.arrayify)(r)).digest("hex")}},21261:(t,e,r)=>{"use strict";var n;r.d(e,{p:()=>n}),function(t){t.sha256="sha256",t.sha512="sha512"}(n||(n={}))},62768:(t,e,r)=>{"use strict";r.r(e),r.d(e,{SigningKey:()=>$,computePublicKey:()=>Z,recoverPublicKey:()=>J});var n=r(13550),i=r.n(n),o=r(33715),s=r.n(o);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;function a(t,e,r){return r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},t(r,r.exports),r.exports}var c=u;function u(t,e){if(!t)throw new Error(e||"Assertion failed")}u.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var l=a((function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}})),f=a((function(t,e){var r=e;r.assert=c,r.toArray=l.toArray,r.zero2=l.zero2,r.toHex=l.toHex,r.encode=l.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,c=t.andln(3)+i&3,u=e.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new(i())(t,"hex","le")}})),h=f.getNAF,d=f.getJSF,p=f.assert;function g(t,e){this.type=t,this.p=new(i())(e.p,16),this.red=e.prime?i().red(e.prime):i().mont(this.p),this.zero=new(i())(0).toRed(this.red),this.one=new(i())(1).toRed(this.red),this.two=new(i())(2).toRed(this.red),this.n=e.n&&new(i())(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 y=g;function m(t,e){this.curve=t,this.type=e,this.precomputed=null}g.prototype.point=function(){throw new Error("Not implemented")},g.prototype.validate=function(){throw new Error("Not implemented")},g.prototype._fixedNafMul=function(t,e){p(t.precomputed);var r=t._getDoubles(),n=h(e,1,this._bitLength),i=(1<=o;c--)s=(s<<1)+n[c];a.push(s)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;a--){for(var c=0;a>=0&&0===o[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var u=o[a];p(0!==u),s="affine"===t.type?u>0?s.mixedAdd(i[u-1>>1]):s.mixedAdd(i[-u-1>>1].neg()):u>0?s.add(i[u-1>>1]):s.add(i[-u-1>>1].neg())}return"affine"===t.type?s.toP():s},g.prototype._wnafMulAdd=function(t,e,r,n,i){var o,s,a,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,f=0;for(o=0;o=1;o-=2){var g=o-1,y=o;if(1===c[g]&&1===c[y]){var m=[e[g],null,null,e[y]];0===e[g].y.cmp(e[y].y)?(m[1]=e[g].add(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg())):0===e[g].y.cmp(e[y].y.redNeg())?(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].add(e[y].neg())):(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=d(r[g],r[y]);for(f=Math.max(v[0].length,f),l[g]=new Array(f),l[y]=new Array(f),s=0;s=0;o--){for(var k=0;o>=0;){var x=!0;for(s=0;s=0&&k++,A=A.dblp(k),o<0)break;for(s=0;s0?a=u[s][P-1>>1]:P<0&&(a=u[s][-P-1>>1].neg()),A="affine"===a.type?A.mixedAdd(a):A.add(a))}}for(o=0;o=Math.ceil((t.bitLength()+1)/e.step)},m.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},w.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:c.add(u).neg()}},w.prototype.pointFromX=function(t,e){(t=new(i())(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},w.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},w.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},A.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(t){return t=new(i())(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},A.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},A.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},A.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},A.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.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 e},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},b(S,y.BasePoint),w.prototype.jpoint=function(t,e,r){return new S(this,t,e,r)},S.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},S.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},S.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),f=n.redMul(u),h=c.redSqr().redIAdd(l).redISub(f).redISub(f),d=c.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,d,p)},S.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(l).redISub(l),h=a.redMul(l.redISub(f)).redISub(i.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(f,h,d)},S.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},S.prototype.inspect=function(){return this.isInfinity()?"":""},S.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var k=a((function(t,e){var r=e;r.base=y,r.short=E,r.mont=null,r.edwards=null})),x=a((function(t,e){var r,n=e,i=f.assert;function o(t){"short"===t.type?this.curve=new k.short(t):"edwards"===t.type?this.curve=new k.edwards(t):this.curve=new k.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new o(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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"]}),a("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"]}),a("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"]}),a("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"]}),a("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"]}),a("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"]}),a("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(t){r=void 0}a("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 P(t){if(!(this instanceof P))return new P(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=l.toArray(t.entropy,t.entropyEnc||"hex"),r=l.toArray(t.nonce,t.nonceEnc||"hex"),n=l.toArray(t.pers,t.persEnc||"hex");c(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var T=P;P.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},P.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=l.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var B=f.assert;function M(t,e){if(t instanceof M)return t;this._importDER(t,e)||(B(t.r&&t.s,"Signature without r or s"),this.r=new(i())(t.r,16),this.s=new(i())(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var N=M;function C(){this.place=0}function L(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function R(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}M.prototype._importDER=function(t,e){t=f.toArray(t,e);var r=new C;if(48!==t[r.place++])return!1;var n=L(t,r);if(!1===n)return!1;if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=L(t,r);if(!1===o)return!1;var s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var a=L(t,r);if(!1===a)return!1;if(t.length!==a+r.place)return!1;var c=t.slice(r.place,a+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(i())(s),this.s=new(i())(c),this.recoveryParam=null,!0},M.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=R(e),r=R(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];U(n,e.length),(n=n.concat(e)).push(2),U(n,r.length);var i=n.concat(r),o=[48];return U(o,i.length),o=o.concat(i),f.encode(o,t)};var D=function(){throw new Error("unsupported")},F=f.assert;function j(t){if(!(this instanceof j))return new j(t);"string"==typeof t&&(F(Object.prototype.hasOwnProperty.call(x,t),"Unknown curve "+t),t=x[t]),t instanceof x.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var V=j;j.prototype.keyPair=function(t){return new I(this,t)},j.prototype.keyFromPrivate=function(t,e){return I.fromPrivate(this,t,e)},j.prototype.keyFromPublic=function(t,e){return I.fromPublic(this,t,e)},j.prototype.genKeyPair=function(t){t||(t={});for(var e=new T({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||D(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(i())(2));;){var o=new(i())(e.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},j.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},j.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new(i())(t,16));for(var o=this.n.byteLength(),s=e.getPrivate().toArray("be",o),a=t.toArray("be",o),c=new T({hash:this.hash,entropy:s,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(i())(1)),l=0;;l++){var f=n.k?n.k(l):new(i())(c.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(u)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var d=h.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var g=f.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(h.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new N({r:p,s:g,recoveryParam:y})}}}}}},j.prototype.verify=function(t,e,r,n){t=this._truncateToN(new(i())(t,16)),r=this.keyFromPublic(r,n);var o=(e=new N(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(t).umod(this.n),l=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},j.prototype.recoverPubKey=function(t,e,r,n){F((3&r)===r,"The recovery param is more than two bits"),e=new N(e,n);var o=this.n,s=new(i())(t),a=e.r,c=e.s,u=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var f=e.r.invm(o),h=o.sub(s).mul(f).umod(o),d=c.mul(f).umod(o);return this.g.mulAdd(h,a,d)},j.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new N(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var G=a((function(t,e){var r=e;r.version="6.5.4",r.utils=f,r.rand=function(){throw new Error("unsupported")},r.curve=k,r.curves=x,r.ec=V,r.eddsa=null})).ec,H=r(93286),K=r(53587);const q=new(r(80711).Logger)("signing-key/5.6.2");let W=null;function z(){return W||(W=new G("secp256k1")),W}class ${constructor(t){(0,K.defineReadOnly)(this,"curve","secp256k1"),(0,K.defineReadOnly)(this,"privateKey",(0,H.hexlify)(t)),32!==(0,H.hexDataLength)(this.privateKey)&&q.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=z().keyFromPrivate((0,H.arrayify)(this.privateKey));(0,K.defineReadOnly)(this,"publicKey","0x"+e.getPublic(!1,"hex")),(0,K.defineReadOnly)(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),(0,K.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(t){const e=z().keyFromPublic((0,H.arrayify)(this.publicKey)),r=z().keyFromPublic((0,H.arrayify)(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){const e=z().keyFromPrivate((0,H.arrayify)(this.privateKey)),r=(0,H.arrayify)(t);32!==r.length&&q.throwArgumentError("bad digest length","digest",t);const n=e.sign(r,{canonical:!0});return(0,H.splitSignature)({recoveryParam:n.recoveryParam,r:(0,H.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,H.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(t){const e=z().keyFromPrivate((0,H.arrayify)(this.privateKey)),r=z().keyFromPublic((0,H.arrayify)(Z(t)));return(0,H.hexZeroPad)("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function J(t,e){const r=(0,H.splitSignature)(e),n={r:(0,H.arrayify)(r.r),s:(0,H.arrayify)(r.s)};return"0x"+z().recoverPubKey((0,H.arrayify)(t),n,r.recoveryParam).encode("hex",!1)}function Z(t,e){const r=(0,H.arrayify)(t);if(32===r.length){const t=new $(r);return e?"0x"+z().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?(0,H.hexlify)(r):"0x"+z().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+z().keyFromPublic(r).getPublic(!0,"hex"):(0,H.hexlify)(r):q.throwArgumentError("invalid public or private key","key","[REDACTED]")}},33777:(t,e,r)=>{"use strict";r.r(e),r.d(e,{keccak256:()=>g,pack:()=>p,sha256:()=>y});var n=r(2593),i=r(93286),o=r(38197),s=r(77158),a=r(44242),c=r(80711);const u=new RegExp("^bytes([0-9]+)$"),l=new RegExp("^(u?int)([0-9]*)$"),f=new RegExp("^(.*)\\[([0-9]*)\\]$"),h=new c.Logger("solidity/5.6.1");function d(t,e,r){switch(t){case"address":return r?(0,i.zeroPad)(e,32):(0,i.arrayify)(e);case"string":return(0,a.Y0)(e);case"bytes":return(0,i.arrayify)(e);case"bool":return e=e?"0x01":"0x00",r?(0,i.zeroPad)(e,32):(0,i.arrayify)(e)}let o=t.match(l);if(o){let s=parseInt(o[2]||"256");return(o[2]&&String(s)!==o[2]||s%8!=0||0===s||s>256)&&h.throwArgumentError("invalid number type","type",t),r&&(s=256),e=n.O$.from(e).toTwos(s),(0,i.zeroPad)(e,s/8)}if(o=t.match(u),o){const n=parseInt(o[1]);return(String(n)!==o[1]||0===n||n>32)&&h.throwArgumentError("invalid bytes type","type",t),(0,i.arrayify)(e).byteLength!==n&&h.throwArgumentError(`invalid value for ${t}`,"value",e),r?(0,i.arrayify)((e+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):e}if(o=t.match(f),o&&Array.isArray(e)){const r=o[1];parseInt(o[2]||String(e.length))!=e.length&&h.throwArgumentError(`invalid array length for ${t}`,"value",e);const n=[];return e.forEach((function(t){n.push(d(r,t,!0))})),(0,i.concat)(n)}return h.throwArgumentError("invalid type","type",t)}function p(t,e){t.length!=e.length&&h.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach((function(t,n){r.push(d(t,e[n]))})),(0,i.hexlify)((0,i.concat)(r))}function g(t,e){return(0,o.keccak256)(p(t,e))}function y(t,e){return(0,s.JQ)(p(t,e))}},86237:(t,e,r)=>{"use strict";r.d(e,{F:()=>a,s:()=>s});var n=r(57218),i=r(93286),o=r(44242);function s(t){const e=(0,o.Y0)(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([e,n.R]).slice(0,32))}function a(t){const e=(0,i.arrayify)(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===e[r-1];)r--;return(0,o.ZN)(e.slice(0,r))}},35637:(t,e,r)=>{"use strict";r.d(e,{Ll:()=>p});var n=r(44242);function i(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,n={};return t.split(",").forEach((t=>{let i=t.split(":");r+=parseInt(i[0],16),n[r]=e(i[1])})),n}function o(t){let e=0;return t.split(",").map((t=>{let r=t.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=e+parseInt(r[0],16);return e=parseInt(r[1],16),{l:n,h:e}}))}function s(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-r))continue;return i}}return null}const a=o("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"),c="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),u=[{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}],l=i("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"),f=i("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"),h=i("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(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let r=0;r{if(c.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=function(t){let e=s(t,u);if(e)return[t+e.s];let r=l[t];if(r)return r;let n=f[t];return n?[t+n[0]]:h[t]||null}(t);return e||[t]})),e=r.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[]),e=(0,n.XL)((0,n.uu)(e),n.Uj.NFKC),e.forEach((t=>{if(s(t,d))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),e.forEach((t=>{if(s(t,a))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let i=(0,n.uu)(e);if("-"===i.substring(0,1)||"--"===i.substring(2,4)||"-"===i.substring(i.length-1))throw new Error("invalid hyphen");if(i.length>63)throw new Error("too long");return i}},62741:(t,e,r)=>{"use strict";r.r(e),r.d(e,{UnicodeNormalizationForm:()=>o.Uj,Utf8ErrorFuncs:()=>o.te,Utf8ErrorReason:()=>o.Uw,_toEscapedUtf8String:()=>o.U$,formatBytes32String:()=>n.s,nameprep:()=>i.Ll,parseBytes32String:()=>n.F,toUtf8Bytes:()=>o.Y0,toUtf8CodePoints:()=>o.XL,toUtf8String:()=>o.ZN});var n=r(86237),i=r(35637),o=r(44242)},44242:(t,e,r)=>{"use strict";r.d(e,{Uj:()=>o,te:()=>c,Uw:()=>s,U$:()=>h,uu:()=>d,Y0:()=>l,XL:()=>g,ZN:()=>p});var n=r(93286);const i=new(r(80711).Logger)("strings/5.6.1");var o,s;function a(t,e,r,n,i){if(t===s.BAD_PREFIX||t===s.UNEXPECTED_CONTINUE){let t=0;for(let n=e+1;n>6==2;n++)t++;return t}return t===s.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(o||(o={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(s||(s={}));const c=Object.freeze({error:function(t,e,r,n,o){return i.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:a,replace:function(t,e,r,n,i){return t===s.OVERLONG?(n.push(i),0):(n.push(65533),a(t,e,r))}});function u(t,e){null==e&&(e=c.error),t=(0,n.arrayify)(t);const r=[];let i=0;for(;i>7==0){r.push(n);continue}let o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){i+=e(128==(192&n)?s.UNEXPECTED_CONTINUE:s.BAD_PREFIX,i-1,t,r);continue}o=3,a=65535}if(i-1+o>=t.length){i+=e(s.OVERRUN,i-1,t,r);continue}let c=n&(1<<8-o-1)-1;for(let n=0;n1114111?i+=e(s.OUT_OF_RANGE,i-1-o,t,r,c):c>=55296&&c<=57343?i+=e(s.UTF16_SURROGATE,i-1-o,t,r,c):c<=a?i+=e(s.OVERLONG,i-1-o,t,r,c):r.push(c))}return r}function l(t,e=o.current){e!=o.current&&(i.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e>6|192),r.push(63&n|128);else if(55296==(64512&n)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return(0,n.arrayify)(r)}function f(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function h(t,e){return'"'+u(t,e).map((t=>{if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?f(t):f(55296+((t-=65536)>>10&1023))+f(56320+(1023&t))})).join("")+'"'}function d(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function p(t,e){return d(u(t,e))}function g(t,e=o.current){return u(l(t,e))}},13479:(t,e,r)=>{"use strict";r.r(e),r.d(e,{TransactionTypes:()=>d,accessListify:()=>A,computeAddress:()=>b,parse:()=>_,recoverAddress:()=>v,serialize:()=>P});var n=r(64594),i=r(2593),o=r(93286),s=r(21046),a=r(38197),c=r(53587),u=r(61843),l=r(62768),f=r(80711);const h=new f.Logger("transactions/5.6.2");var d;function p(t){return"0x"===t?null:(0,n.getAddress)(t)}function g(t){return"0x"===t?s._Y:i.O$.from(t)}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(d||(d={}));const y=[{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"}],m={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(t){const e=(0,l.computePublicKey)(t);return(0,n.getAddress)((0,o.hexDataSlice)((0,a.keccak256)((0,o.hexDataSlice)(e,1)),12))}function v(t,e){return b((0,l.recoverPublicKey)((0,o.arrayify)(t),e))}function w(t,e){const r=(0,o.stripZeros)(i.O$.from(t).toHexString());return r.length>32&&h.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function E(t,e){return{address:(0,n.getAddress)(t),storageKeys:(e||[]).map(((e,r)=>(32!==(0,o.hexDataLength)(e)&&h.throwArgumentError("invalid access list storageKey",`accessList[${t}:${r}]`,e),e.toLowerCase())))}}function A(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&h.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),E(t[0],t[1])):E(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const r=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return E(e,Object.keys(r).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function S(t){return A(t).map((t=>[t.address,t.storageKeys]))}function k(t,e){if(null!=t.gasPrice){const e=i.O$.from(t.gasPrice),r=i.O$.from(t.maxFeePerGas||0);e.eq(r)||h.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:r})}const r=[w(t.chainId||0,"chainId"),w(t.nonce||0,"nonce"),w(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(t.maxFeePerGas||0,"maxFeePerGas"),w(t.gasLimit||0,"gasLimit"),null!=t.to?(0,n.getAddress)(t.to):"0x",w(t.value||0,"value"),t.data||"0x",S(t.accessList||[])];if(e){const t=(0,o.splitSignature)(e);r.push(w(t.recoveryParam,"recoveryParam")),r.push((0,o.stripZeros)(t.r)),r.push((0,o.stripZeros)(t.s))}return(0,o.hexConcat)(["0x02",u.encode(r)])}function x(t,e){const r=[w(t.chainId||0,"chainId"),w(t.nonce||0,"nonce"),w(t.gasPrice||0,"gasPrice"),w(t.gasLimit||0,"gasLimit"),null!=t.to?(0,n.getAddress)(t.to):"0x",w(t.value||0,"value"),t.data||"0x",S(t.accessList||[])];if(e){const t=(0,o.splitSignature)(e);r.push(w(t.recoveryParam,"recoveryParam")),r.push((0,o.stripZeros)(t.r)),r.push((0,o.stripZeros)(t.s))}return(0,o.hexConcat)(["0x01",u.encode(r)])}function P(t,e){if(null==t.type||0===t.type)return null!=t.accessList&&h.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),function(t,e){(0,c.checkProperties)(t,m);const r=[];y.forEach((function(e){let n=t[e.name]||[];const i={};e.numeric&&(i.hexPad="left"),n=(0,o.arrayify)((0,o.hexlify)(n,i)),e.length&&n.length!==e.length&&n.length>0&&h.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=(0,o.stripZeros)(n),n.length>e.maxLength&&h.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n)),r.push((0,o.hexlify)(n))}));let n=0;if(null!=t.chainId?(n=t.chainId,"number"!=typeof n&&h.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!(0,o.isBytesLike)(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),0!==n&&(r.push((0,o.hexlify)(n)),r.push("0x"),r.push("0x")),!e)return u.encode(r);const i=(0,o.splitSignature)(e);let s=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),s+=2*n+8,i.v>28&&i.v!==s&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push((0,o.hexlify)(s)),r.push((0,o.stripZeros)((0,o.arrayify)(i.r))),r.push((0,o.stripZeros)((0,o.arrayify)(i.s))),u.encode(r)}(t,e);switch(t.type){case 1:return x(t,e);case 2:return k(t,e)}return h.throwError(`unsupported transaction type: ${t.type}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function T(t,e,r){try{const r=g(e[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");t.v=r}catch(t){h.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=(0,o.hexZeroPad)(e[1],32),t.s=(0,o.hexZeroPad)(e[2],32);try{const e=(0,a.keccak256)(r(t));t.from=v(e,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function _(t){const e=(0,o.arrayify)(t);if(e[0]>127)return function(t){const e=u.decode(t);9!==e.length&&6!==e.length&&h.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:g(e[0]).toNumber(),gasPrice:g(e[1]),gasLimit:g(e[2]),to:p(e[3]),value:g(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=i.O$.from(e[6]).toNumber()}catch(t){return r}if(r.r=(0,o.hexZeroPad)(e[7],32),r.s=(0,o.hexZeroPad)(e[8],32),i.O$.from(r.r).isZero()&&i.O$.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 i=e.slice(0,6);0!==r.chainId&&(i.push((0,o.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const s=(0,a.keccak256)(u.encode(i));try{r.from=v(s,{r:(0,o.hexlify)(r.r),s:(0,o.hexlify)(r.s),recoveryParam:n})}catch(t){}r.hash=(0,a.keccak256)(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){const e=u.decode(t.slice(1));8!==e.length&&11!==e.length&&h.throwArgumentError("invalid component count for transaction type: 1","payload",(0,o.hexlify)(t));const r={type:1,chainId:g(e[0]).toNumber(),nonce:g(e[1]).toNumber(),gasPrice:g(e[2]),gasLimit:g(e[3]),to:p(e[4]),value:g(e[5]),data:e[6],accessList:A(e[7])};return 8===e.length||(r.hash=(0,a.keccak256)(t),T(r,e.slice(8),x)),r}(e);case 2:return function(t){const e=u.decode(t.slice(1));9!==e.length&&12!==e.length&&h.throwArgumentError("invalid component count for transaction type: 2","payload",(0,o.hexlify)(t));const r=g(e[2]),n=g(e[3]),i={type:2,chainId:g(e[0]).toNumber(),nonce:g(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:g(e[4]),to:p(e[5]),value:g(e[6]),data:e[7],accessList:A(e[8])};return 9===e.length||(i.hash=(0,a.keccak256)(t),T(i,e.slice(9),k)),i}(e)}return h.throwError(`unsupported transaction type: ${e[0]}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}},46441:(t,e,r)=>{"use strict";r.r(e),r.d(e,{commify:()=>s,formatEther:()=>u,formatUnits:()=>a,parseEther:()=>l,parseUnits:()=>c});var n=r(20335);const i=new(r(80711).Logger)("units/5.6.1"),o=["wei","kwei","mwei","gwei","szabo","finney","ether"];function s(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&i.throwArgumentError("invalid value","value",t);let r=e[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 o="";for(2===e.length&&(o="."+(e[1]||"0"));o.length>2&&"0"===o[o.length-1];)o=o.substring(0,o.length-1);const s=[];for(;r.length;){if(r.length<=3){s.unshift(r);break}{const t=r.length-3;s.unshift(r.substring(t)),r=r.substring(0,t)}}return n+s.join(",")+o}function a(t,e){if("string"==typeof e){const t=o.indexOf(e);-1!==t&&(e=3*t)}return(0,n.S5)(t,null!=e?e:18)}function c(t,e){if("string"!=typeof t&&i.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=o.indexOf(e);-1!==t&&(e=3*t)}return(0,n.Ox)(t,null!=e?e:18)}function u(t){return a(t,18)}function l(t){return c(t,18)}},44958:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Wallet:()=>w,verifyMessage:()=>E,verifyTypedData:()=>A});var n=r(64594),i=r(64353),o=r(48171),s=r(93286),a=r(93684),c=r(67827),u=r(36274),l=r(38197),f=r(53587),h=r(44478),d=r(62768),p=r(19380),g=r(81964),y=r(13479),m=r(80711);var b=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const v=new m.Logger("wallet/5.6.2");class w extends o.E{constructor(t,e){if(super(),null!=(r=t)&&(0,s.isHexString)(r.privateKey,32)&&null!=r.address){const e=new d.SigningKey(t.privateKey);if((0,f.defineReadOnly)(this,"_signingKey",(()=>e)),(0,f.defineReadOnly)(this,"address",(0,y.computeAddress)(this.publicKey)),this.address!==(0,n.getAddress)(t.address)&&v.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(t){const e=t.mnemonic;return e&&e.phrase}(t)){const e=t.mnemonic;(0,f.defineReadOnly)(this,"_mnemonic",(()=>({phrase:e.phrase,path:e.path||u.defaultPath,locale:e.locale||"en"})));const r=this.mnemonic,n=u.HDNode.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path);(0,y.computeAddress)(n.privateKey)!==this.address&&v.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,f.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(d.SigningKey.isSigningKey(t))"secp256k1"!==t.curve&&v.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,f.defineReadOnly)(this,"_signingKey",(()=>t));else{"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t);const e=new d.SigningKey(t);(0,f.defineReadOnly)(this,"_signingKey",(()=>e))}(0,f.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,f.defineReadOnly)(this,"address",(0,y.computeAddress)(this.publicKey))}var r;e&&!i.zt.isProvider(e)&&v.throwArgumentError("invalid provider","provider",e),(0,f.defineReadOnly)(this,"provider",e||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(t){return new w(this,t)}signTransaction(t){return(0,f.resolveProperties)(t).then((e=>{null!=e.from&&((0,n.getAddress)(e.from)!==this.address&&v.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete e.from);const r=this._signingKey().signDigest((0,l.keccak256)((0,y.serialize)(e)));return(0,y.serialize)(e,r)}))}signMessage(t){return b(this,void 0,void 0,(function*(){return(0,s.joinSignature)(this._signingKey().signDigest((0,a.r)(t)))}))}_signTypedData(t,e,r){return b(this,void 0,void 0,(function*(){const n=yield c.E.resolveNames(t,e,r,(t=>(null==this.provider&&v.throwError("cannot resolve ENS names without a provider",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:t}),this.provider.resolveName(t))));return(0,s.joinSignature)(this._signingKey().signDigest(c.E.hash(n.domain,e,n.value)))}))}encrypt(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e||(e={}),(0,g.HI)(this,t,e,r)}static createRandom(t){let e=(0,h.O)(16);t||(t={}),t.extraEntropy&&(e=(0,s.arrayify)((0,s.hexDataSlice)((0,l.keccak256)((0,s.concat)([e,t.extraEntropy])),0,16)));const r=(0,u.entropyToMnemonic)(e,t.locale);return w.fromMnemonic(r,t.path,t.locale)}static fromEncryptedJson(t,e,r){return(0,p.decryptJsonWallet)(t,e,r).then((t=>new w(t)))}static fromEncryptedJsonSync(t,e){return new w((0,p.decryptJsonWalletSync)(t,e))}static fromMnemonic(t,e,r){return e||(e=u.defaultPath),new w(u.HDNode.fromMnemonic(t,null,r).derivePath(e))}}function E(t,e){return(0,y.recoverAddress)((0,a.r)(t),e)}function A(t,e,r,n){return(0,y.recoverAddress)(c.E.hash(t,e,r),n)}},58341:(t,e,r)=>{"use strict";r.r(e),r.d(e,{_fetchData:()=>p,fetchJson:()=>g,poll:()=>y});var n=r(59567),i=r(93286),o=r(53587),s=r(44242),a=r(80711);var c=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};function u(t,e){return c(this,void 0,void 0,(function*(){null==e&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};!0!==e.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client");const n=yield fetch(t,r),o=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach(((t,e)=>{s[e.toLowerCase()]=t})):n.headers.keys().forEach((t=>{s[t.toLowerCase()]=n.headers.get(t)})),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:(0,i.arrayify)(new Uint8Array(o))}}))}var l=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const f=new a.Logger("web/5.6.1");function h(t){return new Promise((e=>{setTimeout(e,t)}))}function d(t,e){if(null==t)return null;if("string"==typeof t)return t;if((0,i.isBytesLike)(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return(0,s.ZN)(t)}catch(t){}return(0,i.hexlify)(t)}return t}function p(t,e,r){const i="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;f.assertArgument(i>0&&i%1==0,"invalid connection throttle limit","connection.throttleLimit",i);const o="object"==typeof t?t.throttleCallback:null,c="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;f.assertArgument(c>0&&c%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",c);const p="object"==typeof t&&!!t.errorPassThrough,g={};let y=null;const m={method:"GET"};let b=!1,v=12e4;if("string"==typeof t)y=t;else if("object"==typeof t){if(null!=t&&null!=t.url||f.throwArgumentError("missing URL","connection.url",t),y=t.url,"number"==typeof t.timeout&&t.timeout>0&&(v=t.timeout),t.headers)for(const e in t.headers)g[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(b=!0);if(m.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==y.substring(0,6)&&!0!==t.allowInsecureAuthentication&&f.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:y,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;g.authorization={key:"Authorization",value:"Basic "+(0,n.c)((0,s.Y0)(e))}}null!=t.skipFetchSetup&&(m.skipFetchSetup=!!t.skipFetchSetup)}const w=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),E=y?y.match(w):null;if(E)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":E[1]},body:(0,n.J)(E[2])};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){f.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:d(E[1],E[2]),error:t,requestBody:null,requestMethod:"GET",url:y})}e&&(m.method="POST",m.body=e,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(e.length)}));const A={};Object.keys(g).forEach((t=>{const e=g[t];A[e.key]=e.value})),m.headers=A;const S=function(){let t=null;return{promise:new Promise((function(e,r){v&&(t=setTimeout((()=>{null!=t&&(t=null,r(f.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:d(m.body,A["content-type"]),requestMethod:m.method,timeout:v,url:y})))}),v))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),k=function(){return l(this,void 0,void 0,(function*(){for(let t=0;t=300)&&(S.cancel(),f.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:d(n,e.headers?e.headers["content-type"]:null),requestBody:d(m.body,A["content-type"]),requestMethod:m.method,url:y})),r)try{const t=yield r(n,e);return S.cancel(),t}catch(r){if(r.throttleRetry&&t"content-type"===t.toLowerCase())).length||(r.headers=(0,o.shallowCopy)(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return p(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse((0,s.ZN)(t))}catch(e){f.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function y(t,e){return e||(e={}),null==(e=(0,o.shallowCopy)(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let c=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(c++,c>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));te.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}},48659:(t,e,r)=>{"use strict";r.d(e,{D:()=>a});var n=r(32046),i=r(53587),o=r(80711);const s=new o.Logger("wordlists/5.6.1");class a{constructor(t){s.checkAbstract(new.target,a),(0,i.defineReadOnly)(this,"locale",t)}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}static check(t){const e=[];for(let r=0;r<2048;r++){const n=t.getWord(r);if(r!==t.getWordIndex(n))return"0x";e.push(n)}return(0,n.id)(e.join("\n")+"\n")}static register(t,e){e||(e=t.locale)}}},9855:(t,e,r)=>{"use strict";r.d(e,{E:()=>c});var n=r(48659);let i=null;function o(t){if(null==i&&(i="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==n.D.check(t)))throw i=null,new Error("BIP39 Wordlist for en (English) FAILED")}class s extends n.D{constructor(){super("en")}getWord(t){return o(this),i[t]}getWordIndex(t){return o(this),i.indexOf(t)}}const a=new s;n.D.register(a);const c={en:a}},96858:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AsnAnyConverter:()=>s,AsnArray:()=>z,AsnBitStringConverter:()=>f,AsnBmpStringConverter:()=>m,AsnBooleanConverter:()=>d,AsnCharacterStringConverter:()=>T,AsnChoiceType:()=>j,AsnConvert:()=>$,AsnEnumeratedConverter:()=>c,AsnGeneralStringConverter:()=>P,AsnGeneralizedTimeConverter:()=>O,AsnGraphicStringConverter:()=>k,AsnIA5StringConverter:()=>S,AsnIntegerArrayBufferConverter:()=>u,AsnIntegerBigIntConverter:()=>l,AsnIntegerConverter:()=>a,AsnNullConverter:()=>I,AsnNumericStringConverter:()=>v,AsnObjectIdentifierConverter:()=>h,AsnOctetStringConverter:()=>p,AsnParser:()=>q,AsnPrintableStringConverter:()=>w,AsnProp:()=>H,AsnPropTypes:()=>i,AsnSchemaValidationError:()=>K,AsnSequenceType:()=>G,AsnSerializer:()=>W,AsnSetType:()=>V,AsnTeletexStringConverter:()=>E,AsnType:()=>F,AsnTypeTypes:()=>n,AsnUTCTimeConverter:()=>_,AsnUniversalStringConverter:()=>b,AsnUtf8StringConverter:()=>y,AsnVideotexStringConverter:()=>A,AsnVisibleStringConverter:()=>x,BitString:()=>N,OctetString:()=>C,defaultConverter:()=>B});var n,i,o=r(12858);!function(t){t[t.Sequence=0]="Sequence",t[t.Set=1]="Set",t[t.Choice=2]="Choice"}(n||(n={})),function(t){t[t.Any=1]="Any",t[t.Boolean=2]="Boolean",t[t.OctetString=3]="OctetString",t[t.BitString=4]="BitString",t[t.Integer=5]="Integer",t[t.Enumerated=6]="Enumerated",t[t.ObjectIdentifier=7]="ObjectIdentifier",t[t.Utf8String=8]="Utf8String",t[t.BmpString=9]="BmpString",t[t.UniversalString=10]="UniversalString",t[t.NumericString=11]="NumericString",t[t.PrintableString=12]="PrintableString",t[t.TeletexString=13]="TeletexString",t[t.VideotexString=14]="VideotexString",t[t.IA5String=15]="IA5String",t[t.GraphicString=16]="GraphicString",t[t.VisibleString=17]="VisibleString",t[t.GeneralString=18]="GeneralString",t[t.CharacterString=19]="CharacterString",t[t.UTCTime=20]="UTCTime",t[t.GeneralizedTime=21]="GeneralizedTime",t[t.DATE=22]="DATE",t[t.TimeOfDay=23]="TimeOfDay",t[t.DateTime=24]="DateTime",t[t.Duration=25]="Duration",t[t.TIME=26]="TIME",t[t.Null=27]="Null"}(i||(i={}));const s={fromASN:t=>t instanceof o.Null?null:t.valueBeforeDecode,toASN:t=>{if(null===t)return new o.Null;const e=o.fromBER(t);if(e.result.error)throw new Error(e.result.error);return e.result}},a={fromASN:t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new o.Integer({value:t})},c={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new o.Enumerated({value:t})},u={fromASN:t=>t.valueBlock.valueHex,toASN:t=>new o.Integer({valueHex:t})},l={fromASN:t=>t.toBigInt(),toASN:t=>o.Integer.fromBigInt(t)},f={fromASN:t=>t.valueBlock.valueHex,toASN:t=>new o.BitString({valueHex:t})},h={fromASN:t=>t.valueBlock.toString(),toASN:t=>new o.ObjectIdentifier({value:t})},d={fromASN:t=>t.valueBlock.value,toASN:t=>new o.Boolean({value:t})},p={fromASN:t=>t.valueBlock.valueHex,toASN:t=>new o.OctetString({valueHex:t})};function g(t){return{fromASN:t=>t.valueBlock.value,toASN:e=>new t({value:e})}}const y=g(o.Utf8String),m=g(o.BmpString),b=g(o.UniversalString),v=g(o.NumericString),w=g(o.PrintableString),E=g(o.TeletexString),A=g(o.VideotexString),S=g(o.IA5String),k=g(o.GraphicString),x=g(o.VisibleString),P=g(o.GeneralString),T=g(o.CharacterString),_={fromASN:t=>t.toDate(),toASN:t=>new o.UTCTime({valueDate:t})},O={fromASN:t=>t.toDate(),toASN:t=>new o.GeneralizedTime({valueDate:t})},I={fromASN:t=>null,toASN:t=>new o.Null};function B(t){switch(t){case i.Any:return s;case i.BitString:return f;case i.BmpString:return m;case i.Boolean:return d;case i.CharacterString:return T;case i.Enumerated:return c;case i.GeneralString:return P;case i.GeneralizedTime:return O;case i.GraphicString:return k;case i.IA5String:return S;case i.Integer:return a;case i.Null:return I;case i.NumericString:return v;case i.ObjectIdentifier:return h;case i.OctetString:return p;case i.PrintableString:return w;case i.TeletexString:return E;case i.UTCTime:return _;case i.UniversalString:return b;case i.Utf8String:return y;case i.VideotexString:return A;case i.VisibleString:return x;default:return null}}var M=r(72043);class N{constructor(t,e=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if("number"==typeof t)this.fromNumber(t);else{if(!M.vJ.isBufferSource(t))throw TypeError("Unsupported type of 'params' argument for BitString");this.unusedBits=e,this.value=M.vJ.toArrayBuffer(t)}}fromASN(t){if(!(t instanceof o.BitString))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=t.valueBlock.unusedBits,this.value=t.valueBlock.valueHex,this}toASN(){return new o.BitString({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new o.BitString({name:t})}toNumber(){let t="";const e=new Uint8Array(this.value);for(const r of e)t+=r.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let e=t.toString(2);const r=e.length+7>>3;this.unusedBits=(r<<3)-e.length;const n=new Uint8Array(r);e=e.padStart(r<<3,"0").split("").reverse().join("");let i=0;for(;ie=>{let r;D.has(e)?r=D.get(e):(r=D.createDefault(e),D.set(e,r)),Object.assign(r,t)},j=()=>F({type:n.Choice}),V=t=>F({type:n.Set,...t}),G=t=>F({type:n.Sequence,...t}),H=t=>(e,r)=>{let n;D.has(e.constructor)?n=D.get(e.constructor):(n=D.createDefault(e.constructor),D.set(e.constructor,n));const i=Object.assign({},t);if("number"==typeof i.type&&!i.converter){const n=B(t.type);if(!n)throw new Error(`Cannot get default converter for property '${r}' of ${e.constructor.name}`);i.converter=n}n.items[r]=i};class K extends Error{constructor(){super(...arguments),this.schemas=[]}}class q{static parse(t,e){const r=o.fromBER(t);if(r.result.error)throw new Error(r.result.error);return this.fromASN(r.result,e)}static fromASN(t,e){var r;try{if(L(e)){return(new e).fromASN(t)}const s=D.get(e);D.cache(e);let a=s.schema;if(t.constructor===o.Constructed&&s.type!==n.Choice){a=new o.Constructed({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:s.schema.valueBlock.value});for(const e in s.items)delete t[e]}const c=o.compareSchema({},t,a);if(!c.verified)throw new K(`Data does not match to ${e.name} ASN1 schema. ${c.result.error}`);const u=new e;if(R(e)){if("number"==typeof s.itemType){const r=B(s.itemType);if(!r)throw new Error(`Cannot get default converter for array item of ${e.name} ASN1 schema`);return e.from(t.valueBlock.value,(t=>r.fromASN(t)))}return e.from(t.valueBlock.value,(t=>this.fromASN(t,s.itemType)))}for(const t in s.items){const e=c.result[t];if(!e)continue;const n=s.items[t];if("number"==typeof n.type||L(n.type)){const s=null!==(r=n.converter)&&void 0!==r?r:L(n.type)?new n.type:null;if(!s)throw new Error("Converter is empty");if(n.repeated)if(n.implicit){const r=new("sequence"===n.repeated?o.Sequence:o.Set);r.valueBlock=e.valueBlock;const i=o.fromBER(r.toBER(!1)).result.valueBlock.value;u[t]=Array.from(i,(t=>s.fromASN(t)))}else u[t]=Array.from(e,(t=>s.fromASN(t)));else{let r=e;if(n.implicit){let t;if(L(n.type))t=(new n.type).toSchema("");else{const e=i[n.type],r=o[e];if(!r)throw new Error(`Cannot get '${e}' class from asn1js module`);t=new r}t.valueBlock=r.valueBlock,r=o.fromBER(t.toBER(!1)).result}u[t]=s.fromASN(r)}}else n.repeated?u[t]=Array.from(e,(t=>this.fromASN(t,n.type))):u[t]=this.fromASN(e,n.type)}return u}catch(t){throw t instanceof K&&t.schemas.push(e.name),t}}}class W{static serialize(t){return t instanceof o.BaseBlock?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&L(t.constructor))return t.toASN();const e=t.constructor,r=D.get(e);D.cache(e);let i,s=[];if(r.itemType)if("number"==typeof r.itemType){const n=B(r.itemType);if(!n)throw new Error(`Cannot get default converter for array item of ${e.name} ASN1 schema`);s=t.map((t=>n.toASN(t)))}else s=t.map((t=>this.toAsnItem({type:r.itemType},"[]",e,t)));else for(const n in r.items){const i=r.items[n],a=t[n];if(void 0===a||i.defaultValue===a||"object"==typeof i.defaultValue&&"object"==typeof a&&U(this.serialize(i.defaultValue),this.serialize(a)))continue;let c=W.toAsnItem(i,n,e,a);if("number"==typeof i.context)if(i.implicit)if(i.repeated||"number"!=typeof i.type&&!L(i.type))s.push(new o.Constructed({optional:i.optional,idBlock:{tagClass:3,tagNumber:i.context},value:c.valueBlock.value}));else{const t={};t.valueHex=c instanceof o.Null?c.valueBeforeDecode:c.valueBlock.toBER(),s.push(new o.Primitive({optional:i.optional,idBlock:{tagClass:3,tagNumber:i.context},...t}))}else s.push(new o.Constructed({optional:i.optional,idBlock:{tagClass:3,tagNumber:i.context},value:[c]}));else i.repeated?s=s.concat(c):s.push(c)}switch(r.type){case n.Sequence:i=new o.Sequence({value:s});break;case n.Set:i=new o.Set({value:s});break;case n.Choice:if(!s[0])throw new Error(`Schema '${e.name}' has wrong data. Choice cannot be empty.`);i=s[0]}return i}static toAsnItem(t,e,r,n){let s;if("number"==typeof t.type){const a=t.converter;if(!a)throw new Error(`Property '${e}' doesn't have converter for type ${i[t.type]} in schema '${r.name}'`);if(t.repeated){const e=Array.from(n,(t=>a.toASN(t)));s=new("sequence"===t.repeated?o.Sequence:o.Set)({value:e})}else s=a.toASN(n)}else if(t.repeated){const e=Array.from(n,(t=>this.toASN(t)));s=new("sequence"===t.repeated?o.Sequence:o.Set)({value:e})}else s=this.toASN(n);return s}}class z extends Array{constructor(t=[]){if("number"==typeof t)super(t);else{super();for(const e of t)this.push(e)}}}class ${static serialize(t){return W.serialize(t)}static parse(t,e){return q.parse(t,e)}static toString(t){const e=M.vJ.isBufferSource(t)?M.vJ.toArrayBuffer(t):$.serialize(t),r=o.fromBER(e);if(-1===r.offset)throw new Error(`Cannot decode ASN.1 data. ${r.result.error}`);return r.result.toString()}}},12858:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Any:()=>fe,BaseBlock:()=>O,BaseStringBlock:()=>B,BitString:()=>xt,BmpString:()=>Wt,Boolean:()=>Et,CharacterString:()=>ne,Choice:()=>he,Constructed:()=>yt,DATE:()=>se,DateTime:()=>ce,Duration:()=>ue,EndOfContent:()=>bt,Enumerated:()=>Bt,GeneralString:()=>re,GeneralizedTime:()=>oe,GraphicString:()=>te,HexBlock:()=>S,IA5String:()=>Qt,Integer:()=>It,Null:()=>vt,NumericString:()=>Jt,ObjectIdentifier:()=>Ct,OctetString:()=>St,Primitive:()=>ht,PrintableString:()=>Zt,RawData:()=>pe,RelativeObjectIdentifier:()=>Ut,Repeated:()=>de,Sequence:()=>Dt,Set:()=>Ft,TIME:()=>le,TeletexString:()=>Xt,TimeOfDay:()=>ae,UTCTime:()=>ie,UniversalString:()=>$t,Utf8String:()=>Kt,ValueBlock:()=>x,VideotexString:()=>Yt,ViewWriter:()=>h,VisibleString:()=>ee,compareSchema:()=>ge,fromBER:()=>pt,verifySchema:()=>ye});var n=r(72043);function i(t,e){let r=0;if(1===t.length)return t[0];for(let n=t.length-1;n>=0;n--)r+=t[t.length-1-n]*Math.pow(2,e*n);return r}function o(t,e,r=-1){const n=r;let i=t,o=0,s=Math.pow(2,e);for(let r=1;r<8;r++){if(t=0;t--){const r=Math.pow(2,t*e);s[o-t-1]=Math.floor(i/r),i-=s[o-t-1]*r}return t}s*=Math.pow(2,e)}return new ArrayBuffer(0)}function s(...t){let e=0,r=0;for(const r of t)e+=r.length;const n=new ArrayBuffer(e),i=new Uint8Array(n);for(const e of t)i.set(e,r),r+=e.length;return i}function a(){const t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const e=255===t[0]&&128&t[1],r=0===t[0]&&0==(128&t[1]);(e||r)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let t=0;t=s.length)return this.error="End of input reached before message was fully decoded",-1;if(t===r){r+=255;const t=new Uint8Array(r);for(let r=0;r8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=e+1,u=o.subarray(c,c+a);return 0===u[a-1]&&this.warnings.push("Needlessly long encoded length"),this.length=i(u,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,e+this.blockLength}toBER(t=!1){let e,r;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return e=new ArrayBuffer(1),!1===t&&(r=new Uint8Array(e),r[0]=128),e;if(this.longFormUsed){const n=o(this.length,8);if(n.byteLength>127)return this.error="Too big length",b;if(e=new ArrayBuffer(n.byteLength+1),t)return e;const i=new Uint8Array(n);r=new Uint8Array(e),r[0]=128|n.byteLength;for(let t=0;t=37&&!1===i.idBlock.isHexOnly)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};a=_.EndOfContent;break;case 1:a=_.Boolean;break;case 2:a=_.Integer;break;case 3:a=_.BitString;break;case 4:a=_.OctetString;break;case 5:a=_.Null;break;case 6:a=_.ObjectIdentifier;break;case 10:a=_.Enumerated;break;case 12:a=_.Utf8String;break;case 13:a=_.RelativeObjectIdentifier;break;case 14:a=_.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:a=_.Sequence;break;case 17:a=_.Set;break;case 18:a=_.NumericString;break;case 19:a=_.PrintableString;break;case 20:a=_.TeletexString;break;case 21:a=_.VideotexString;break;case 22:a=_.IA5String;break;case 23:a=_.UTCTime;break;case 24:a=_.GeneralizedTime;break;case 25:a=_.GraphicString;break;case 26:a=_.VisibleString;break;case 27:a=_.GeneralString;break;case 28:a=_.UniversalString;break;case 29:a=_.CharacterString;break;case 30:a=_.BmpString;break;case 31:a=_.DATE;break;case 32:a=_.TimeOfDay;break;case 33:a=_.DateTime;break;case 34:a=_.Duration;break;default:{const t=i.idBlock.isConstructed?new _.Constructed:new _.Primitive;t.idBlock=i.idBlock,t.lenBlock=i.lenBlock,t.warnings=i.warnings,i=t}}}else a=i.idBlock.isConstructed?_.Constructed:_.Primitive;return i=function(t,e){if(t instanceof e)return t;const r=new e;return r.idBlock=t.idBlock,r.lenBlock=t.lenBlock,r.warnings=t.warnings,r.valueBeforeDecodeView=t.valueBeforeDecodeView,r}(i,a),s=i.fromBER(t,e,i.lenBlock.isIndefiniteForm?r:i.lenBlock.length),i.valueBeforeDecodeView=t.subarray(n,n+i.blockLength),{offset:s,result:i}}function pt(t){if(!t.byteLength){const t=new O({},x);return t.error="Input buffer has zero length",{offset:-1,result:t}}return dt(n.vJ.toUint8Array(t).slice(),0,t.byteLength)}N=ht,_.Primitive=N,ht.NAME="PRIMITIVE";class gt extends x{constructor({value:t=[],isIndefiniteForm:e=!1,...r}={}){super(r),this.value=t,this.isIndefiniteForm=e}fromBER(t,e,r){const i=n.vJ.toUint8Array(t);if(!f(this,i,e,r))return-1;if(this.valueBeforeDecodeView=i.subarray(e,e+r),0===this.valueBeforeDecodeView.length)return this.warnings.push("Zero buffer length"),e;let o=e;for(;s=this.isIndefiniteForm,a=r,(s?1:a)>0;){const t=dt(i,o,r);if(-1===t.offset)return this.error=t.result.error,this.warnings.concat(t.result.warnings),-1;if(o=t.offset,this.blockLength+=t.result.blockLength,r-=t.result.blockLength,this.value.push(t.result),this.isIndefiniteForm&&t.result.constructor.NAME===w)break}var s,a;return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===w?this.value.pop():this.warnings.push("No EndOfContent block encoded")),o}toBER(t,e){const r=e||new h;for(let e=0;e` ${t}`)).join("\n"));const e=3===this.idBlock.tagClass?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return t.length?`${e} :\n${t.join("\n")}`:`${e} :`}}C=yt,_.Constructed=C,yt.NAME="CONSTRUCTED";class mt extends x{fromBER(t,e,r){return e}toBER(t){return b}}mt.override="EndOfContentValueBlock";class bt extends O{constructor(t={}){super(t,mt),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}L=bt,_.EndOfContent=L,bt.NAME=w;class vt extends O{constructor(t={}){super(t,x),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,e,r){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=r,e+r>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):e+r}toBER(t,e){const r=new ArrayBuffer(2);if(!t){const t=new Uint8Array(r);t[0]=5,t[1]=0}return e&&e.write(r),r}onAsciiEncoding(){return`${this.constructor.NAME}`}}R=vt,_.Null=R,vt.NAME="NULL";class wt extends(S(x)){constructor({value:t,...e}={}){super(e),e.valueHex?this.valueHexView=n.vJ.toUint8Array(e.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,e,r){const i=n.vJ.toUint8Array(t);return f(this,i,e,r)?(this.valueHexView=i.subarray(e,e+r),r>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,a.call(this),this.blockLength=r,e+r):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}wt.NAME="BooleanValueBlock";class Et extends O{constructor(t={}){super(t,wt),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}}U=Et,_.Boolean=U,Et.NAME="BOOLEAN";class At extends(S(gt)){constructor({isConstructed:t=!1,...e}={}){super(e),this.isConstructed=t}fromBER(t,e,r){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=gt.prototype.fromBER.call(this,t,e,r),-1===n)return n;for(let t=0;t0&&r.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=r.unusedBits}return i}const o=n.vJ.toUint8Array(t);if(!f(this,o,e,r))return-1;const s=o.subarray(e,e+r);if(this.unusedBits=s[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const t=s.subarray(1);try{if(t.byteLength){const e=dt(t,0,t.byteLength);-1!==e.offset&&e.offset===r-1&&(this.value=[e.result])}}catch(t){}}return this.valueHexView=s.subarray(1),this.blockLength=s.length,e+r}toBER(t,e){if(this.isConstructed)return gt.prototype.toBER.call(this,t,e);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return b;const r=new Uint8Array(this.valueHexView.length+1);return r[0]=this.unusedBits,r.set(this.valueHexView,1),r.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}kt.NAME="BitStringValueBlock";class xt extends O{constructor({idBlock:t={},lenBlock:e={},...r}={}){var n,i;null!==(n=r.isConstructed)&&void 0!==n||(r.isConstructed=!!(null===(i=r.value)||void 0===i?void 0:i.length)),super({idBlock:{isConstructed:r.isConstructed,...t},lenBlock:{...e,isIndefiniteForm:!!r.isIndefiniteForm},...r},kt),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,e,r){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,e,r)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return yt.prototype.onAsciiEncoding.call(this);{const t=[],e=this.valueBlock.valueHexView;for(const r of e)t.push(r.toString(2).padStart(8,"0"));const r=t.join("");return`${this.constructor.NAME} : ${r.substring(0,r.length-this.valueBlock.unusedBits)}`}}}function Pt(t,e){const r=new Uint8Array([0]),n=new Uint8Array(t),i=new Uint8Array(e);let o=n.slice(0);const a=o.length-1,c=i.slice(0),u=c.length-1;let l=0;let f=0;for(let t=u=0;t--,f++){if(!0==f=o.length)o=s(new Uint8Array([l%10]),o);else o[a-f]=l%10}return r[0]>0&&(o=s(r,o)),o}function Tt(t){if(t>=d.length)for(let e=d.length;e<=t;e++){const t=new Uint8Array([0]);let r=d[e-1].slice(0);for(let e=r.length-1;e>=0;e--){const n=new Uint8Array([(r[e]<<1)+t[0]]);t[0]=n[0]/10,r[e]=n[0]%10}t[0]>0&&(r=s(t,r)),d.push(r)}return d[t]}function _t(t,e){let r=0;const n=new Uint8Array(t),i=new Uint8Array(e),o=n.slice(0),s=o.length-1,a=i.slice(0),c=a.length-1;let u,l=0;for(let t=c;t>=0;t--,l++)if(u=o[s-l]-a[c-l]-r,!0==u<0)r=1,o[s-l]=u+10;else r=0,o[s-l]=u;if(r>0)for(let t=s-c+1;t>=0;t--,l++){if(u=o[s-l]-r,!(u<0)){r=0,o[s-l]=u;break}r=1,o[s-l]=u+10}return o.slice()}F=xt,_.BitString=F,xt.NAME=A;class Ot extends(S(x)){constructor({value:t,...e}={}){super(e),this._valueDec=0,e.valueHex&&this.setValueHex(),void 0!==t&&(this.valueDec=t)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=a.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(function(t){const e=t<0?-1*t:t;let r=128;for(let n=1;n<8;n++){if(e<=r){if(t<0){const t=o(r-e,8,n);return new Uint8Array(t)[0]|=128,t}let i=o(e,8,n),s=new Uint8Array(i);if(128&s[0]){const t=i.slice(0),e=new Uint8Array(t);i=new ArrayBuffer(i.byteLength+1),s=new Uint8Array(i);for(let r=0;r1&&(n=o.length+1),this.valueHexView=o.subarray(n-o.length)),i}toDER(t=!1){const e=this.valueHexView;switch(!0){case 0!=(128&e[0]):{const t=new Uint8Array(this.valueHexView.length+1);t[0]=0,t.set(e,1),this.valueHexView=t}break;case 0===e[0]&&0==(128&e[1]):this.valueHexView=this.valueHexView.subarray(1)}return this.toBER(t)}fromBER(t,e,r){const n=super.fromBER(t,e,r);return-1===n||this.setValueHex(),n}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=8*this.valueHexView.length-1;let e,r=new Uint8Array(8*this.valueHexView.length/3),n=0;const i=this.valueHexView;let o="",s=!1;for(let s=i.byteLength-1;s>=0;s--){e=i[s];for(let i=0;i<8;i++){if(1==(1&e))if(n===t)r=_t(Tt(n),r),o="-";else r=Pt(r,Tt(n));n++,e>>=1}}for(let t=0;t0;){const e=new Mt;if(n=e.fromBER(t,n,r),-1===n)return this.blockLength=0,this.error=e.error,n;0===this.value.length&&(e.isFirstSid=!0),this.blockLength+=e.blockLength,r-=e.blockLength,this.value.push(e)}return n}toBER(t){const e=[];for(let r=0;rNumber.MAX_SAFE_INTEGER){u();const e=BigInt(n);t.valueBigInt=e}else if(t.valueDec=parseInt(n,10),isNaN(t.valueDec))return;this.value.length||(t.isFirstSid=!0,i=!0),this.value.push(t)}}while(-1!==r)}toString(){let t="",e=!1;for(let r=0;r0;){const e=new Lt;if(n=e.fromBER(t,n,r),-1===n)return this.blockLength=0,this.error=e.error,n;this.blockLength+=e.blockLength,r-=e.blockLength,this.value.push(e)}return n}toBER(t,e){const r=[];for(let e=0;e4)continue;const s=4-i.length;for(let t=i.length-1;t>=0;t--)r[4*n+t+s]=i[t]}this.valueBlock.value=t}}zt.NAME="UniversalStringValueBlock";class $t extends zt{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}J=$t,_.UniversalString=J,$t.NAME="UniversalString";class Jt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Z=Jt,_.NumericString=Z,Jt.NAME="NumericString";class Zt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}X=Zt,_.PrintableString=X,Zt.NAME="PrintableString";class Xt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Y=Xt,_.TeletexString=Y,Xt.NAME="TeletexString";class Yt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Q=Yt,_.VideotexString=Q,Yt.NAME="VideotexString";class Qt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}tt=Qt,_.IA5String=tt,Qt.NAME="IA5String";class te extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}et=te,_.GraphicString=et,te.NAME="GraphicString";class ee extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}rt=ee,_.VisibleString=rt,ee.NAME="VisibleString";class re extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}nt=re,_.GeneralString=nt,re.NAME="GeneralString";class ne extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}it=ne,_.CharacterString=it,ne.NAME="CharacterString";class ie extends ee{constructor({value:t,valueDate:e,...r}={}){if(super(r),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let e=0;e=50?1900+r:2e3+r,this.month=parseInt(e[2],10),this.day=parseInt(e[3],10),this.hour=parseInt(e[4],10),this.minute=parseInt(e[5],10),this.second=parseInt(e[6],10)}toString(t="iso"){if("iso"===t){const t=new Array(7);return t[0]=c(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=c(this.month,2),t[2]=c(this.day,2),t[3]=c(this.hour,2),t[4]=c(this.minute,2),t[5]=c(this.second,2),t[6]="Z",t.join("")}return super.toString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}ot=ie,_.UTCTime=ot,ie.NAME="UTCTime";class oe extends ie{constructor(t={}){var e;super(t),null!==(e=this.millisecond)&&void 0!==e||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let e,r=!1,n="",i="",o=0,s=0,a=0;if("Z"===t[t.length-1])n=t.substring(0,t.length-1),r=!0;else{const e=new Number(t[t.length-1]);if(isNaN(e.valueOf()))throw new Error("Wrong input string for conversion");n=t}if(r){if(-1!==n.indexOf("+"))throw new Error("Wrong input string for conversion");if(-1!==n.indexOf("-"))throw new Error("Wrong input string for conversion")}else{let t=1,e=n.indexOf("+"),r="";if(-1===e&&(e=n.indexOf("-"),t=-1),-1!==e){if(r=n.substring(e+1),n=n.substring(0,e),2!==r.length&&4!==r.length)throw new Error("Wrong input string for conversion");let i=parseInt(r.substring(0,2),10);if(isNaN(i.valueOf()))throw new Error("Wrong input string for conversion");if(s=t*i,4===r.length){if(i=parseInt(r.substring(2,4),10),isNaN(i.valueOf()))throw new Error("Wrong input string for conversion");a=t*i}}}let c=n.indexOf(".");if(-1===c&&(c=n.indexOf(",")),-1!==c){const t=new Number(`0${n.substring(c)}`);if(isNaN(t.valueOf()))throw new Error("Wrong input string for conversion");o=t.valueOf(),i=n.substring(0,c)}else i=n;switch(!0){case 8===i.length:if(e=/(\d{4})(\d{2})(\d{2})/gi,-1!==c)throw new Error("Wrong input string for conversion");break;case 10===i.length:if(e=/(\d{4})(\d{2})(\d{2})(\d{2})/gi,-1!==c){let t=60*o;this.minute=Math.floor(t),t=60*(t-this.minute),this.second=Math.floor(t),t=1e3*(t-this.second),this.millisecond=Math.floor(t)}break;case 12===i.length:if(e=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi,-1!==c){let t=60*o;this.second=Math.floor(t),t=1e3*(t-this.second),this.millisecond=Math.floor(t)}break;case 14===i.length:if(e=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi,-1!==c){const t=1e3*o;this.millisecond=Math.floor(t)}break;default:throw new Error("Wrong input string for conversion")}const u=e.exec(i);if(null===u)throw new Error("Wrong input string for conversion");for(let t=1;t0&&r.valueBlock.value[0]instanceof de&&(o=e.valueBlock.value.length),0===o)return{verified:!0,result:t};if(0===e.valueBlock.value.length&&0!==r.valueBlock.value.length){let e=!0;for(let t=0;t=e.valueBlock.value.length){if(!1===r.valueBlock.value[s].optional){const e={verified:!1,result:t};return t.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&(delete t[r.name],e.name=r.name)),e}}else if(r.valueBlock.value[0]instanceof de){if(i=ge(t,e.valueBlock.value[s],r.valueBlock.value[0].value),!1===i.verified){if(!r.valueBlock.value[0].optional)return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&delete t[r.name]),i;n++}if(g in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let n={};n="local"in r.valueBlock.value[0]&&r.valueBlock.value[0].local?e:t,void 0===n[r.valueBlock.value[0].name]&&(n[r.valueBlock.value[0].name]=[]),n[r.valueBlock.value[0].name].push(e.valueBlock.value[s])}}else if(i=ge(t,e.valueBlock.value[s-n],r.valueBlock.value[s]),!1===i.verified){if(!r.valueBlock.value[s].optional)return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&delete t[r.name]),i;n++}if(!1===i.verified){const e={verified:!1,result:t};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&(delete t[r.name],e.name=r.name)),e}return{verified:!0,result:t}}if(r.primitiveSchema&&y in e.valueBlock){const n=dt(e.valueBlock.valueHexView);if(-1===n.offset){const e={verified:!1,result:n.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&(delete t[r.name],e.name=r.name)),e}return ge(t,n.result,r.primitiveSchema)}return{verified:!0,result:t}}function ye(t,e){if(e instanceof Object==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=dt(n.vJ.toUint8Array(t));return-1===r.offset?{verified:!1,result:r.result}:ge(r.result,r.result,e)}},79742:(t,e)=>{"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=c(t),s=o[0],a=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e);1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,c=n-i;ac?c:a+s));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},92882:t=>{"use strict";for(var e="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function s(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=o(e)^n>>5}for(e=o(e),r=0;re)return"Exceeds length limit";var n=t.toLowerCase(),i=t.toUpperCase();if(t!==n&&t!==i)return"Mixed-case string "+t;var a=(t=n).lastIndexOf("1");if(-1===a)return"No separator character for "+t;if(0===a)return"Missing prefix for "+t;var c=t.slice(0,a),u=t.slice(a+1);if(u.length<6)return"Data too short";var l=s(c);if("string"==typeof l)return l;for(var f=[],h=0;h=u.length||f.push(p)}return 1!==l?"Invalid checksum for "+t:{prefix:c,words:f}}function c(t,e,r,n){for(var i=0,o=0,s=(1<=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<=e)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var i=s(t=t.toLowerCase());if("string"==typeof i)throw new Error(i);for(var a=t+"1",c=0;c>5!=0)throw new Error("Non 5-bit word");i=o(i)^u,a+=e.charAt(u)}for(c=0;c<6;++c)i=o(i);for(i^=1,c=0;c<6;++c){a+=e.charAt(i>>5*(5-c)&31)}return a},toWordsUnsafe:function(t){var e=c(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=c(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=c(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=c(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}}},13550:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(46601).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);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 "+t)}function c(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function u(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),c=e;c=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&s0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=c(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(t){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var h=["","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"],d=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?h[6-c.length]+c+r:c+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=d[t],l=p[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var g=f.modrn(l).toString(t);r=(f=f.idivn(l)).isZero()?g+r:h[u-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function g(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,f=67108863&c,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,b=y>>>13,v=0|s[3],w=8191&v,E=v>>>13,A=0|s[4],S=8191&A,k=A>>>13,x=0|s[5],P=8191&x,T=x>>>13,_=0|s[6],O=8191&_,I=_>>>13,B=0|s[7],M=8191&B,N=B>>>13,C=0|s[8],L=8191&C,R=C>>>13,U=0|s[9],D=8191&U,F=U>>>13,j=0|a[0],V=8191&j,G=j>>>13,H=0|a[1],K=8191&H,q=H>>>13,W=0|a[2],z=8191&W,$=W>>>13,J=0|a[3],Z=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,lt=0|a[8],ft=8191<,ht=lt>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(u+(n=Math.imul(f,V))|0)+((8191&(i=(i=Math.imul(f,G))+Math.imul(h,V)|0))<<13)|0;u=((o=Math.imul(h,G))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,G))+Math.imul(g,V)|0,o=Math.imul(g,G);var mt=(u+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(h,K)|0))<<13)|0;u=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,V),i=(i=Math.imul(m,G))+Math.imul(b,V)|0,o=Math.imul(b,G),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,q)|0;var bt=(u+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,z)|0))<<13)|0;u=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,G))+Math.imul(E,V)|0,o=Math.imul(E,G),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,q)|0,n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,$)|0;var vt=(u+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,Z)|0))<<13)|0;u=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,G))+Math.imul(k,V)|0,o=Math.imul(k,G),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,X)|0;var wt=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,Q)|0))<<13)|0;u=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,V),i=(i=Math.imul(P,G))+Math.imul(T,V)|0,o=Math.imul(T,G),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0;var Et=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(O,V),i=(i=Math.imul(O,G))+Math.imul(I,V)|0,o=Math.imul(I,G),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(k,z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0;var At=(u+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(h,ot)|0))<<13)|0;u=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(M,V),i=(i=Math.imul(M,G))+Math.imul(N,V)|0,o=Math.imul(N,G),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var St=(u+(n=n+Math.imul(f,ct)|0)|0)+((8191&(i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,ct)|0))<<13)|0;u=((o=o+Math.imul(h,ut)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(R,V)|0,o=Math.imul(R,G),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(O,z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0;var kt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,G))+Math.imul(F,V)|0,o=Math.imul(F,G),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(m,ct)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,ut)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,ht)|0;var xt=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((o=o+Math.imul(h,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,q))+Math.imul(F,K)|0,o=Math.imul(F,q),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,ut)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var Pt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,z),i=(i=Math.imul(D,$))+Math.imul(F,z)|0,o=Math.imul(F,$),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0;var Tt=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,gt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ut)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,ht)|0;var _t=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,gt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ut)|0,n=n+Math.imul(P,ft)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,ht)|0;var Ot=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,gt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,ut)|0,n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(I,ft)|0,o=o+Math.imul(I,ht)|0;var It=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((o=o+Math.imul(T,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,ht)|0;var Bt=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,gt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((o=o+Math.imul(I,gt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0;var Mt=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(D,ft),i=(i=Math.imul(D,ht))+Math.imul(F,ft)|0,o=Math.imul(F,ht);var Nt=(u+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,gt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ct=(u+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,gt))+Math.imul(F,pt)|0))<<13)|0;return u=((o=Math.imul(F,gt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,c[0]=yt,c[1]=mt,c[2]=bt,c[3]=vt,c[4]=wt,c[5]=Et,c[6]=At,c[7]=St,c[8]=kt,c[9]=xt,c[10]=Pt,c[11]=Tt,c[12]=_t,c[13]=Ot,c[14]=It,c[15]=Bt,c[16]=Mt,c[17]=Nt,c[18]=Ct,0!==u&&(c[19]=u,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(t,e,r){return m(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(y=g),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?g(this,t,e):r<1024?m(this,t,e):b(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==e){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=h)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(c)):(r.isub(e),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new P(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(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 S(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){P.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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 t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},i(A,E),A.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new S;else if("p192"===t)e=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return w[t]=e,e},P.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},P.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},P.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},P.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},P.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},P.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},P.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},P.prototype.isqr=function(t){return this.imul(t,t.clone())},P.prototype.sqr=function(t){return this.mul(t,t)},P.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();n(y=0;n--){for(var u=e.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},P.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},P.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},i(T,P),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},29931:(t,e,r)=>{var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r{"use strict";const n=r(79742),i=r(80645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=a(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||Z(t.length)?a(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return l(t),a(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(i)return n?-1:W(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function _(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){G(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function L(t,e,r,n,i){G(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function R(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||M(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||M(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Y((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||M(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||M(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||M(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Y((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||M(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||M(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||M(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||M(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){N(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,!n){N(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Y((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Y((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Y((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Y((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=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),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function G(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||K(e,t.length-(r+1))}(n,i,o)}function H(t,e){if("number"!=typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function K(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function W(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},21924:(t,e,r)=>{"use strict";var n=r(40210),i=r(55559),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},55559:(t,e,r)=>{"use strict";var n=r(58612),i=r(40210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=a(n,s,arguments);if(c&&u){var r=c(e,"length");r.configurable&&u(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var f=function(){return a(n,o,arguments)};u?u(t.exports,"apply",{value:f}):t.exports.apply=f},4289:(t,e,r)=>{"use strict";var n=r(82215),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,c=r(31044)(),u=a&&c,l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(u?a(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{"use strict";var n=e;n.version=r(18597).i8,n.utils=r(80953),n.rand=r(29931),n.curve=r(88254),n.curves=r(45427),n.ec=r(57954),n.eddsa=r(65980)},4918:(t,e,r)=>{"use strict";var n=r(73785),i=r(80953),o=i.getNAF,s=i.getJSF,a=i.assert;function c(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.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=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=s;l--)c=(c<<1)+n[l];u.push(c)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var f=s[u];a(0!==f),c="affine"===t.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===t.type?c.toP():c},c.prototype._wnafMulAdd=function(t,e,r,n,i){var a,c,u,l=this._wnafT1,f=this._wnafT2,h=this._wnafT3,d=0;for(a=0;a=1;a-=2){var g=a-1,y=a;if(1===l[g]&&1===l[y]){var m=[e[g],null,null,e[y]];0===e[g].y.cmp(e[y].y)?(m[1]=e[g].add(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg())):0===e[g].y.cmp(e[y].y.redNeg())?(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].add(e[y].neg())):(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[g],r[y]);for(d=Math.max(v[0].length,d),h[g]=new Array(d),h[y]=new Array(d),c=0;c=0;a--){for(var k=0;a>=0;){var x=!0;for(c=0;c=0&&k++,A=A.dblp(k),a<0)break;for(c=0;c0?u=f[c][P-1>>1]:P<0&&(u=f[c][-P-1>>1].neg()),A="affine"===u.type?A.mixedAdd(u):A.add(u))}}for(a=0;a=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i{"use strict";var n=r(80953),i=r(73785),o=r(35717),s=r(4918),a=n.assert;function c(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&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 i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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()))))}o(c,s),t.exports=c,c.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},c.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},c.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(e&&!c||!e&&c)&&(a=a.redNeg()),this.point(t,a)},c.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},c.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(u,s.BasePoint),c.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},c.prototype.point=function(t,e,r,n){return new u(this,t,e,r,n)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),f=s.redMul(o);return this.curve.point(c,u,f,l)},u.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(t=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),e=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),t=s.redSub(a).redISub(c).redMul(o),e=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(e),u=o.redMul(s),l=a.redMul(c),f=o.redMul(c),h=s.redMul(a);return this.curve.point(u,l,h,f)},u.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),f=n.redMul(c).redMul(l);return this.curve.twisted?(e=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(e=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},88254:(t,e,r)=>{"use strict";var n=e;n.base=r(4918),n.short=r(6673),n.mont=r(22881),n.edwards=r(31138)},22881:(t,e,r)=>{"use strict";var n=r(73785),i=r(35717),o=r(4918),s=r(80953);function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,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)))}i(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new c(this,t,e)},a.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(t,e){return new c(t,e[0],e[1]||t.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),c=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(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(t){return 0===this.getX().cmp(t.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()}},6673:(t,e,r)=>{"use strict";var n=r(80953),i=r(73785),o=r(35717),s=r(4918),a=n.assert;function c(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(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 l(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(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}o(c,s),t.exports=c,c.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,c,u,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,d=this.n.clone(),p=new i(1),g=new i(0),y=new i(0),m=new i(1),b=0;0!==h.cmpn(0);){var v=d.div(h);u=d.sub(v.mul(h)),l=y.sub(v.mul(p));var w=m.sub(v.mul(g));if(!n&&u.cmp(f)<0)e=c.neg(),r=p,n=u.neg(),o=l;else if(n&&2==++b)break;c=u,d=h,h=u,y=p,p=l,m=g,g=w}s=u.neg(),a=l;var E=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(E)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},c.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.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 e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(t,e,r){return new l(this,t,e,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),f=n.redMul(u),h=c.redSqr().redIAdd(l).redISub(f).redISub(f),d=c.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(l).redISub(l),h=a.redMul(l.redISub(f)).redISub(i.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},45427:(t,e,r)=>{"use strict";var n,i=e,o=r(33715),s=r(88254),a=r(80953).assert;function c(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new c(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:o.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"]}),u("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:o.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(91037)}catch(t){n=void 0}u("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},57954:(t,e,r)=>{"use strict";var n=r(73785),i=r(2156),o=r(80953),s=r(45427),a=r(29931),c=o.assert,u=r(31251),l=r(90611);function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(c(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=f,f.prototype.keyPair=function(t){return new u(this,t)},f.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),c=t.toArray("be",s),u=new i({hash:this.hash,entropy:a,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),h=0;;h++){var d=o.k?o.k(h):new n(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(0!==y.cmpn(0)){var m=d.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==g.cmp(y)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),b^=1),new l({r:y,s:m,recoveryParam:b})}}}}}},f.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new l(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(t).umod(this.n),f=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(t,e,r,i){c((3&r)===r,"The recovery param is more than two bits"),e=new l(e,i);var o=this.n,s=new n(t),a=e.r,u=e.s,f=1&r,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),g=u.mul(d).umod(o);return this.g.mulAdd(p,a,g)},f.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new l(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},31251:(t,e,r)=>{"use strict";var n=r(73785),i=r(80953).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},90611:(t,e,r)=>{"use strict";var n=r(73785),i=r(80953),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=c(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=c(t,r);if(!1===s)return!1;var u=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var l=c(t,r);if(!1===l)return!1;if(t.length!==l+r.place)return!1;var f=t.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(u),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,e.length),(n=n.concat(e)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,t)}},65980:(t,e,r)=>{"use strict";var n=r(33715),i=r(45427),o=r(80953),s=o.assert,a=o.parseBytes,c=r(79087),u=r(23622);function l(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof l))return new l(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=l,l.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},l.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var t=this.hash(),e=0;e{"use strict";var n=r(80953),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=a},23622:(t,e,r)=>{"use strict";var n=r(73785),i=r(80953),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function c(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.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 i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=c},91037:t=>{t.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"]]}}},80953:(t,e,r)=>{"use strict";var n=e,i=r(73785),o=r(79746),s=r(34504);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,c=t.andln(3)+i&3,u=e.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},73785:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(85568).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=c(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};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"],f=[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],h=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,f=67108863&c,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:l[u-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===e,u=new t(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,b=y>>>13,v=0|s[3],w=8191&v,E=v>>>13,A=0|s[4],S=8191&A,k=A>>>13,x=0|s[5],P=8191&x,T=x>>>13,_=0|s[6],O=8191&_,I=_>>>13,B=0|s[7],M=8191&B,N=B>>>13,C=0|s[8],L=8191&C,R=C>>>13,U=0|s[9],D=8191&U,F=U>>>13,j=0|a[0],V=8191&j,G=j>>>13,H=0|a[1],K=8191&H,q=H>>>13,W=0|a[2],z=8191&W,$=W>>>13,J=0|a[3],Z=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,lt=0|a[8],ft=8191<,ht=lt>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(u+(n=Math.imul(f,V))|0)+((8191&(i=(i=Math.imul(f,G))+Math.imul(h,V)|0))<<13)|0;u=((o=Math.imul(h,G))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,G))+Math.imul(g,V)|0,o=Math.imul(g,G);var mt=(u+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(h,K)|0))<<13)|0;u=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,V),i=(i=Math.imul(m,G))+Math.imul(b,V)|0,o=Math.imul(b,G),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,q)|0;var bt=(u+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,z)|0))<<13)|0;u=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,G))+Math.imul(E,V)|0,o=Math.imul(E,G),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,q)|0,n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,$)|0;var vt=(u+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,Z)|0))<<13)|0;u=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,G))+Math.imul(k,V)|0,o=Math.imul(k,G),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,X)|0;var wt=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,Q)|0))<<13)|0;u=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,V),i=(i=Math.imul(P,G))+Math.imul(T,V)|0,o=Math.imul(T,G),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0;var Et=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(O,V),i=(i=Math.imul(O,G))+Math.imul(I,V)|0,o=Math.imul(I,G),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(k,z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0;var At=(u+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(h,ot)|0))<<13)|0;u=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(M,V),i=(i=Math.imul(M,G))+Math.imul(N,V)|0,o=Math.imul(N,G),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var St=(u+(n=n+Math.imul(f,ct)|0)|0)+((8191&(i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,ct)|0))<<13)|0;u=((o=o+Math.imul(h,ut)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(R,V)|0,o=Math.imul(R,G),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(O,z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0;var kt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,G))+Math.imul(F,V)|0,o=Math.imul(F,G),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(m,ct)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,ut)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,ht)|0;var xt=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((o=o+Math.imul(h,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,q))+Math.imul(F,K)|0,o=Math.imul(F,q),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,ut)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var Pt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,z),i=(i=Math.imul(D,$))+Math.imul(F,z)|0,o=Math.imul(F,$),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0;var Tt=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,gt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ut)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,ht)|0;var _t=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,gt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ut)|0,n=n+Math.imul(P,ft)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,ht)|0;var Ot=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,gt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,ut)|0,n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(I,ft)|0,o=o+Math.imul(I,ht)|0;var It=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((o=o+Math.imul(T,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,ht)|0;var Bt=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,gt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((o=o+Math.imul(I,gt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0;var Mt=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(D,ft),i=(i=Math.imul(D,ht))+Math.imul(F,ft)|0,o=Math.imul(F,ht);var Nt=(u+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,gt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ct=(u+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,gt))+Math.imul(F,pt)|0))<<13)|0;return u=((o=Math.imul(F,gt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,c[0]=yt,c[1]=mt,c[2]=bt,c[3]=vt,c[4]=wt,c[5]=Et,c[6]=At,c[7]=St,c[8]=kt,c[9]=xt,c[10]=Pt,c[11]=Tt,c[12]=_t,c[13]=Ot,c[14]=It,c[15]=Bt,c[16]=Mt,c[17]=Nt,c[18]=Ct,0!==u&&(c[19]=u,r.length++),r};function g(t,e,r){return(new y).mulp(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):g(this,t,e),r},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},y.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==e){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=h)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(c)):(r.isub(e),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return m[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();n(y=0;n--){for(var u=e.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,S),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},41503:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r(34149),o=r(95320),s=r(18923),a=r(12636),c=function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=u(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var o=e.call(t,r);if(i(o))return o;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(t)||a(t))&&(r="string"),c(t,"default"===r?"number":r)}},34149:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},93343:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BaseContract:()=>B,BigNumber:()=>h.O$,Contract:()=>M,ContractFactory:()=>N,FixedNumber:()=>C.xs,Signer:()=>l.E,VoidSigner:()=>l.b,Wallet:()=>L.Wallet,Wordlist:()=>Yt.D,constants:()=>n,errors:()=>y.ErrorCode,ethers:()=>s,getDefaultProvider:()=>Zt,logger:()=>Ee,providers:()=>i,utils:()=>o,version:()=>we,wordlists:()=>Xt.E});var n={};r.r(n),r.d(n,{AddressZero:()=>R.d,EtherSymbol:()=>F,HashZero:()=>D.R,MaxInt256:()=>U.PS,MaxUint256:()=>U.Bz,MinInt256:()=>U.$B,NegativeOne:()=>U.tL,One:()=>U.fh,Two:()=>U.Py,WeiPerEther:()=>U.Ce,Zero:()=>U._Y});var i={};r.r(i),r.d(i,{AlchemyProvider:()=>nt,AlchemyWebSocketProvider:()=>rt,AnkrProvider:()=>at,BaseProvider:()=>V.Zk,CloudflareProvider:()=>lt,EtherscanProvider:()=>wt,FallbackProvider:()=>Rt,Formatter:()=>G.Mb,InfuraProvider:()=>Vt,InfuraWebSocketProvider:()=>jt,IpcProvider:()=>Ut,JsonRpcBatchProvider:()=>Gt,JsonRpcProvider:()=>H.r,JsonRpcSigner:()=>H.C,NodesmithProvider:()=>Kt,PocketProvider:()=>zt,Provider:()=>u.zt,Resolver:()=>V.H2,StaticJsonRpcProvider:()=>Y,UrlJsonRpcProvider:()=>Q,Web3Provider:()=>$t.Q,WebSocketProvider:()=>J,getDefaultProvider:()=>Zt,getNetwork:()=>j.H,isCommunityResourcable:()=>G.Ed,isCommunityResource:()=>G.Gp,showThrottleMessage:()=>G.vh});var o={};r.r(o),r.d(o,{AbiCoder:()=>Qt.R,ConstructorFragment:()=>te.Xg,ErrorFragment:()=>te.IC,EventFragment:()=>te.QV,FormatTypes:()=>te.pc,Fragment:()=>te.HY,FunctionFragment:()=>te.YW,HDNode:()=>ae.HDNode,Indexed:()=>c.Hk,Interface:()=>c.vU,LogDescription:()=>c.CC,Logger:()=>y.Logger,ParamType:()=>te._R,RLP:()=>de,SigningKey:()=>pe.SigningKey,SupportedAlgorithm:()=>ve.p,TransactionDescription:()=>c.vk,TransactionTypes:()=>g.TransactionTypes,UnicodeNormalizationForm:()=>ye.Uj,Utf8ErrorFuncs:()=>ye.te,Utf8ErrorReason:()=>ye.Uw,_TypedDataEncoder:()=>se.E,_fetchData:()=>ft._fetchData,_toEscapedUtf8String:()=>ye.U$,accessListify:()=>g.accessListify,arrayify:()=>d.arrayify,base58:()=>re.Base58,base64:()=>ee,checkProperties:()=>p.checkProperties,checkResultErrors:()=>a.BR,commify:()=>be.commify,computeAddress:()=>g.computeAddress,computeHmac:()=>le.Gy,computePublicKey:()=>pe.computePublicKey,concat:()=>d.concat,deepCopy:()=>p.deepCopy,defaultAbiCoder:()=>Qt.$,defaultPath:()=>ae.defaultPath,defineReadOnly:()=>p.defineReadOnly,dnsEncode:()=>ne.Kn,entropyToMnemonic:()=>ae.entropyToMnemonic,fetchJson:()=>ft.fetchJson,formatBytes32String:()=>me.s,formatEther:()=>be.formatEther,formatUnits:()=>be.formatUnits,getAccountPath:()=>ae.getAccountPath,getAddress:()=>f.getAddress,getContractAddress:()=>f.getContractAddress,getCreate2Address:()=>f.getCreate2Address,getIcapAddress:()=>f.getIcapAddress,getJsonWalletAddress:()=>ce.Rb,getStatic:()=>p.getStatic,hashMessage:()=>ie.r,hexConcat:()=>d.hexConcat,hexDataLength:()=>d.hexDataLength,hexDataSlice:()=>d.hexDataSlice,hexStripZeros:()=>d.hexStripZeros,hexValue:()=>d.hexValue,hexZeroPad:()=>d.hexZeroPad,hexlify:()=>d.hexlify,id:()=>oe.id,isAddress:()=>f.isAddress,isBytes:()=>d.isBytes,isBytesLike:()=>d.isBytesLike,isHexString:()=>d.isHexString,isValidMnemonic:()=>ae.isValidMnemonic,isValidName:()=>ne.r1,joinSignature:()=>d.joinSignature,keccak256:()=>ue.keccak256,mnemonicToEntropy:()=>ae.mnemonicToEntropy,mnemonicToSeed:()=>ae.mnemonicToSeed,namehash:()=>ne.VM,nameprep:()=>ge.Ll,parseBytes32String:()=>me.F,parseEther:()=>be.parseEther,parseTransaction:()=>g.parse,parseUnits:()=>be.parseUnits,poll:()=>ft.poll,randomBytes:()=>he.O,recoverAddress:()=>g.recoverAddress,recoverPublicKey:()=>pe.recoverPublicKey,resolveProperties:()=>p.resolveProperties,ripemd160:()=>le.bP,serializeTransaction:()=>g.serialize,sha256:()=>le.JQ,sha512:()=>le.o,shallowCopy:()=>p.shallowCopy,shuffled:()=>Et.y,solidityKeccak256:()=>fe.keccak256,solidityPack:()=>fe.pack,soliditySha256:()=>fe.sha256,splitSignature:()=>d.splitSignature,stripZeros:()=>d.stripZeros,toUtf8Bytes:()=>ye.Y0,toUtf8CodePoints:()=>ye.XL,toUtf8String:()=>ye.ZN,verifyMessage:()=>L.verifyMessage,verifyTypedData:()=>L.verifyTypedData,zeroPad:()=>d.zeroPad});var s={};r.r(s),r.d(s,{BaseContract:()=>B,BigNumber:()=>h.O$,Contract:()=>M,ContractFactory:()=>N,FixedNumber:()=>C.xs,Signer:()=>l.E,VoidSigner:()=>l.b,Wallet:()=>L.Wallet,Wordlist:()=>Yt.D,constants:()=>n,errors:()=>y.ErrorCode,getDefaultProvider:()=>Zt,logger:()=>Ee,providers:()=>i,utils:()=>o,version:()=>we,wordlists:()=>Xt.E});var a=r(61184),c=r(8198),u=r(64353),l=r(48171),f=r(64594),h=r(2593),d=r(93286),p=r(53587),g=r(13479),y=r(80711);var m=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const b=new y.Logger("contracts/5.6.2"),v={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function w(t,e){return m(this,void 0,void 0,(function*(){const r=yield e;"string"!=typeof r&&b.throwArgumentError("invalid address or ENS name","name",r);try{return(0,f.getAddress)(r)}catch(t){}t||b.throwError("a provider or signer is needed to resolve ENS names",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return null==n&&b.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function E(t,e,r){return m(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>E(t,Array.isArray(e)?e[n]:e[r.name],r)))):"address"===r.type?yield w(t,e):"tuple"===r.type?yield E(t,e,r.components):"array"===r.baseType?Array.isArray(e)?yield Promise.all(e.map((e=>E(t,e,r.arrayChildren)))):Promise.reject(b.makeError("invalid value for array",y.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e}))}function A(t,e,r){return m(this,void 0,void 0,(function*(){let n={};r.length===e.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=(0,p.shallowCopy)(r.pop())),b.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=(0,p.resolveProperties)({override:w(t.signer,n.from),signer:t.signer.getAddress()}).then((t=>m(this,void 0,void 0,(function*(){return(0,f.getAddress)(t.signer)!==t.override&&b.throwError("Contract with a Signer cannot override from",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})))):n.from=t.signer.getAddress():n.from&&(n.from=w(t.provider,n.from));const i=yield(0,p.resolveProperties)({args:E(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:(0,p.resolveProperties)(n)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},a=i.overrides;if(null!=a.nonce&&(s.nonce=h.O$.from(a.nonce).toNumber()),null!=a.gasLimit&&(s.gasLimit=h.O$.from(a.gasLimit)),null!=a.gasPrice&&(s.gasPrice=h.O$.from(a.gasPrice)),null!=a.maxFeePerGas&&(s.maxFeePerGas=h.O$.from(a.maxFeePerGas)),null!=a.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=h.O$.from(a.maxPriorityFeePerGas)),null!=a.from&&(s.from=a.from),null!=a.type&&(s.type=a.type),null!=a.accessList&&(s.accessList=(0,g.accessListify)(a.accessList)),null==s.gasLimit&&null!=e.gas){let t=21e3;const r=(0,d.arrayify)(o);for(let e=0;enull!=n[t]));return c.length&&b.throwError(`cannot override ${c.map((t=>JSON.stringify(t))).join(",")}`,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),s}))}function S(t,e){const r=e.wait.bind(e);e.wait=e=>r(e).then((e=>(e.events=e.logs.map((r=>{let n=(0,p.deepCopy)(r),i=null;try{i=t.interface.parseLog(r)}catch(t){}return i&&(n.args=i.args,n.decode=(e,r)=>t.interface.decodeEventLog(i.eventFragment,e,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>t.provider,n.getBlock=()=>t.provider.getBlock(e.blockHash),n.getTransaction=()=>t.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(e),n})),e)))}function k(t,e,r){const n=t.signer||t.provider;return function(...i){return m(this,void 0,void 0,(function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){const t=(0,p.shallowCopy)(i.pop());null!=t.blockTag&&(o=yield t.blockTag),delete t.blockTag,i.push(t)}null!=t.deployTransaction&&(yield t._deployed(o));const s=yield A(t,e,i),a=yield n.call(s,o);try{let n=t.interface.decodeFunctionResult(e,a);return r&&1===e.outputs.length&&(n=n[0]),n}catch(e){throw e.code===y.Logger.errors.CALL_EXCEPTION&&(e.address=t.address,e.args=i,e.transaction=s),e}}))}}function x(t,e,r){return e.constant?k(t,e,r):function(t,e){return function(...r){return m(this,void 0,void 0,(function*(){t.signer||b.throwError("sending a transaction requires a signer",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());const n=yield A(t,e,r),i=yield t.signer.sendTransaction(n);return S(t,i),i}))}}(t,e)}function P(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((t=>Array.isArray(t)?t.join("|"):t)).join(":"):""):"*"}class T{constructor(t,e){(0,p.defineReadOnly)(this,"tag",t),(0,p.defineReadOnly)(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter((r=>!(!e&&r.listener===t)||(e=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((t=>t.listener))}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter((e=>{const r=t.slice();return setTimeout((()=>{e.listener.apply(this,r)}),0),!e.once})),e}prepareEvent(t){}getEmit(t){return[t]}}class _ extends T{constructor(){super("error",null)}}class O extends T{constructor(t,e,r,n){const i={address:t};let o=e.getEventTopic(r);n?(o!==n[0]&&b.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(P(i),i),(0,p.defineReadOnly)(this,"address",t),(0,p.defineReadOnly)(this,"interface",e),(0,p.defineReadOnly)(this,"fragment",r)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=(0,a.BR)(t.args);if(e.length)throw e[0].error;const r=(t.args||[]).slice();return r.push(t),r}}class I extends T{constructor(t,e){super("*",{address:t}),(0,p.defineReadOnly)(this,"address",t),(0,p.defineReadOnly)(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,r)=>this.interface.decodeEventLog(e.eventFragment,t,r),t.args=e.args}catch(t){}}}class B{constructor(t,e,r){(0,p.defineReadOnly)(this,"interface",(0,p.getStatic)(new.target,"getInterface")(e)),null==r?((0,p.defineReadOnly)(this,"provider",null),(0,p.defineReadOnly)(this,"signer",null)):l.E.isSigner(r)?((0,p.defineReadOnly)(this,"provider",r.provider||null),(0,p.defineReadOnly)(this,"signer",r)):u.zt.isProvider(r)?((0,p.defineReadOnly)(this,"provider",r),(0,p.defineReadOnly)(this,"signer",null)):b.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,p.defineReadOnly)(this,"callStatic",{}),(0,p.defineReadOnly)(this,"estimateGas",{}),(0,p.defineReadOnly)(this,"functions",{}),(0,p.defineReadOnly)(this,"populateTransaction",{}),(0,p.defineReadOnly)(this,"filters",{});{const t={};Object.keys(this.interface.events).forEach((e=>{const r=this.interface.events[e];(0,p.defineReadOnly)(this.filters,e,((...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,t)}))),t[r.name]||(t[r.name]=[]),t[r.name].push(e)})),Object.keys(t).forEach((e=>{const r=t[e];1===r.length?(0,p.defineReadOnly)(this.filters,e,this.filters[r[0]]):b.warn(`Duplicate definition of ${e} (${r.join(", ")})`)}))}if((0,p.defineReadOnly)(this,"_runningEvents",{}),(0,p.defineReadOnly)(this,"_wrappedEmits",{}),null==t&&b.throwArgumentError("invalid contract address or ENS name","addressOrName",t),(0,p.defineReadOnly)(this,"address",t),this.provider)(0,p.defineReadOnly)(this,"resolvedAddress",w(this.provider,t));else try{(0,p.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,f.getAddress)(t)))}catch(t){b.throwError("provider is required to use ENS name as contract address",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((t=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((t=>{const e=this.interface.functions[t];if(i[t])b.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);else{i[t]=!0;{const r=e.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(t)}null==this[t]&&(0,p.defineReadOnly)(this,t,x(this,e,!0)),null==this.functions[t]&&(0,p.defineReadOnly)(this.functions,t,x(this,e,!1)),null==this.callStatic[t]&&(0,p.defineReadOnly)(this.callStatic,t,k(this,e,!0)),null==this.populateTransaction[t]&&(0,p.defineReadOnly)(this.populateTransaction,t,function(t,e){return function(...r){return A(t,e,r)}}(this,e)),null==this.estimateGas[t]&&(0,p.defineReadOnly)(this.estimateGas,t,function(t,e){const r=t.signer||t.provider;return function(...n){return m(this,void 0,void 0,(function*(){r||b.throwError("estimate require a provider or signer",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield A(t,e,n);return yield r.estimateGas(i)}))}}(this,e))}})),Object.keys(n).forEach((t=>{const e=n[t];if(e.length>1)return;t=t.substring(1);const r=e[0];try{null==this[t]&&(0,p.defineReadOnly)(this,t,this[r])}catch(t){}null==this.functions[t]&&(0,p.defineReadOnly)(this.functions,t,this.functions[r]),null==this.callStatic[t]&&(0,p.defineReadOnly)(this.callStatic,t,this.callStatic[r]),null==this.populateTransaction[t]&&(0,p.defineReadOnly)(this.populateTransaction,t,this.populateTransaction[r]),null==this.estimateGas[t]&&(0,p.defineReadOnly)(this.estimateGas,t,this.estimateGas[r])}))}static getContractAddress(t){return(0,f.getContractAddress)(t)}static getInterface(t){return c.vU.isInterface(t)?t:new c.vU(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,t).then((t=>("0x"===t&&b.throwError("contract not deployed",y.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(t){this.signer||b.throwError("sending a transactions require a signer",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=(0,p.shallowCopy)(t||{});return["from","to"].forEach((function(t){null!=e[t]&&b.throwError("cannot override "+t,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(e)))}connect(t){"string"==typeof t&&(t=new l.b(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&(0,p.defineReadOnly)(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return c.Hk.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new _);if("event"===t)return this._normalizeRunningEvent(new T("event",null));if("*"===t)return this._normalizeRunningEvent(new I(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new O(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const e=t.topics[0];if("string"!=typeof e)throw new Error("invalid topic");const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new O(this.address,this.interface,r,t.topics))}catch(t){}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new T(P(e),e))}return this._normalizeRunningEvent(new I(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,r){const n=(0,p.deepCopy)(e);return n.removeListener=()=>{r&&(t.removeListener(r),this._checkRunningEvents(t))},n.getBlock=()=>this.provider.getBlock(e.blockHash),n.getTransaction=()=>this.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(n),n}_addEventListener(t,e,r){if(this.provider||b.throwError("events require a provider or a signer with a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const r=r=>{let n=this._wrapEvent(t,r,e);if(null==n.decodeError)try{const e=t.getEmit(n);this.emit(t.filter,...e)}catch(t){n.decodeError=t.error}null!=t.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[t.tag]=r,null!=t.filter&&this.provider.on(t.filter,r)}}queryFilter(t,e,r){const n=this._getRunningEvent(t),i=(0,p.shallowCopy)(n.filter);return"string"==typeof e&&(0,d.isHexString)(e,32)?(null!=r&&b.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((t=>t.map((t=>this._wrapEvent(n,t,null)))))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const r=this._getRunningEvent(t),n=r.run(e)>0;return this._checkRunningEvents(r),n}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce(((t,e)=>t+this._runningEvents[e].listenerCount()),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){const t=[];for(let e in this._runningEvents)this._runningEvents[e].listeners().forEach((e=>{t.push(e)}));return t}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(const t in this._runningEvents){const e=this._runningEvents[t];e.removeAllListeners(),this._checkRunningEvents(e)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}removeListener(t,e){return this.off(t,e)}}class M extends B{}class N{constructor(t,e,r){let n=null;n="string"==typeof e?e:(0,d.isBytes)(e)?(0,d.hexlify)(e):e&&"string"==typeof e.object?e.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!(0,d.isHexString)(n)||n.length%2)&&b.throwArgumentError("invalid bytecode","bytecode",e),r&&!l.E.isSigner(r)&&b.throwArgumentError("invalid signer","signer",r),(0,p.defineReadOnly)(this,"bytecode",n),(0,p.defineReadOnly)(this,"interface",(0,p.getStatic)(new.target,"getInterface")(t)),(0,p.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(...t){let e={};if(t.length===this.interface.deploy.inputs.length+1&&"object"==typeof t[t.length-1]){e=(0,p.shallowCopy)(t.pop());for(const t in e)if(!v[t])throw new Error("unknown transaction override "+t)}if(["data","from","to"].forEach((t=>{null!=e[t]&&b.throwError("cannot override "+t,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.value){h.O$.from(e.value).isZero()||this.interface.deploy.payable||b.throwError("non-payable constructor cannot override value",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})}return b.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=(0,d.hexlify)((0,d.concat)([this.bytecode,this.interface.encodeDeploy(t)])),e}deploy(...t){return m(this,void 0,void 0,(function*(){let e={};t.length===this.interface.deploy.inputs.length+1&&(e=t.pop()),b.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield E(this.signer,t,this.interface.deploy.inputs);r.push(e);const n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=(0,p.getStatic)(this.constructor,"getContractAddress")(i),s=(0,p.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return S(s,i),(0,p.defineReadOnly)(s,"deployTransaction",i),s}))}attach(t){return this.constructor.getContract(t,this.interface,this.signer)}connect(t){return new this.constructor(this.interface,this.bytecode,t)}static fromSolidity(t,e){null==t&&b.throwError("missing compiler output",y.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));const r=t.abi;let n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}static getInterface(t){return M.getInterface(t)}static getContractAddress(t){return(0,f.getContractAddress)(t)}static getContract(t,e,r){return new M(t,e,r)}}var C=r(20335),L=r(44958),R=r(9279),U=r(21046),D=r(57218);const F="Ξ";var j=r(79861),V=r(75361),G=r(30032),H=r(82169),K=r(34216);let q=null;try{if(q=WebSocket,null==q)throw new Error("inject please")}catch(t){const e=new y.Logger(K.i);q=function(){e.throwError("WebSockets not supported in this environment",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var W=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const z=new y.Logger(K.i);let $=1;class J extends H.r{constructor(t,e){"any"===e&&z.throwError("WebSocketProvider does not support 'any' network yet",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"==typeof t?t:"_websocket",e),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof t?(0,p.defineReadOnly)(this,"_websocket",new q(this.connection.url)):(0,p.defineReadOnly)(this,"_websocket",t),(0,p.defineReadOnly)(this,"_requests",{}),(0,p.defineReadOnly)(this,"_subs",{}),(0,p.defineReadOnly)(this,"_subIds",{}),(0,p.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((t=>{this.websocket.send(this._requests[t].payload)}))},this.websocket.onmessage=t=>{const e=t.data,r=JSON.parse(e);if(null!=r.id){const t=String(r.id),n=this._requests[t];if(delete this._requests[t],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let t=null;r.error?(t=new Error(r.error.message||"unknown error"),(0,p.defineReadOnly)(t,"code",r.error.code||null),(0,p.defineReadOnly)(t,"response",e)):t=new Error("unknown error"),n.callback(t,void 0),this.emit("debug",{action:"response",error:t,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const t=this._subs[r.params.subscription];t&&t.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(t){z.throwError("cannot reset events block on WebSocketProvider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(t){z.throwError("cannot set polling interval on WebSocketProvider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return W(this,void 0,void 0,(function*(){return null}))}set polling(t){t&&z.throwError("cannot set polling on WebSocketProvider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(t,e){const r=$++;return new Promise(((n,i)=>{const o=JSON.stringify({method:t,params:e,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(t,e){return t?i(t):n(e)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(t,e,r){return W(this,void 0,void 0,(function*(){let n=this._subIds[t];null==n&&(n=Promise.all(e).then((t=>this.send("eth_subscribe",t))),this._subIds[t]=n);const i=yield n;this._subs[i]={tag:t,processFunc:r}}))}_startEvent(t){switch(t.type){case"block":this._subscribe("block",["newHeads"],(t=>{const e=h.O$.from(t.number).toNumber();this._emitted.block=e,this.emit("block",e)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(t=>{this.emit("pending",t)}));break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],(e=>{null==e.removed&&(e.removed=!1),this.emit(t.filter,this.formatter.filterLog(e))}));break;case"tx":{const e=t=>{const e=t.hash;this.getTransactionReceipt(e).then((t=>{t&&this.emit(e,t)}))};e(t),this._subscribe("tx",["newHeads"],(t=>{this._events.filter((t=>"tx"===t.type)).forEach(e)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}_stopEvent(t){let e=t.tag;if("tx"===t.type){if(this._events.filter((t=>"tx"===t.type)).length)return;e="tx"}else if(this.listenerCount(t.event))return;const r=this._subIds[e];r&&(delete this._subIds[e],r.then((t=>{this._subs[t]&&(delete this._subs[t],this.send("eth_unsubscribe",[t]))})))}destroy(){return W(this,void 0,void 0,(function*(){this.websocket.readyState===q.CONNECTING&&(yield new Promise((t=>{this.websocket.onopen=function(){t(!0)},this.websocket.onerror=function(){t(!1)}}))),this.websocket.close(1e3)}))}}var Z=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const X=new y.Logger(K.i);class Y extends H.r{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return Z(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||X.throwError("no network detected",y.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,p.defineReadOnly)(this,"_network",e),this.emit("network",e,null))),e}))}}class Q extends Y{constructor(t,e){X.checkAbstract(new.target,Q),t=(0,p.getStatic)(new.target,"getNetwork")(t),e=(0,p.getStatic)(new.target,"getApiKey")(e);super((0,p.getStatic)(new.target,"getUrl")(t,e),t),"string"==typeof e?(0,p.defineReadOnly)(this,"apiKey",e):null!=e&&Object.keys(e).forEach((t=>{(0,p.defineReadOnly)(this,t,e[t])}))}_startPending(){X.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(t){return X.throwError("API provider does not support signing",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(t){return t}static getUrl(t,e){return X.throwError("not implemented; sub-classes must override getUrl",y.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const tt=new y.Logger(K.i),et="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class rt extends J{constructor(t,e){const r=new nt(t,e);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),(0,p.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===et}}class nt extends Q{static getWebSocketProvider(t,e){return new rt(t,e)}static getApiKey(t){return null==t?et:(t&&"string"!=typeof t&&tt.throwArgumentError("invalid apiKey","apiKey",t),t)}static getUrl(t,e){let r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-rinkeby":r="arb-rinkeby.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-kovan":r="opt-kovan.g.alchemy.com/v2/";break;default:tt.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:(t,r)=>(e===et&&(0,G.vh)(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===et}}const it=new y.Logger(K.i),ot="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function st(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return it.throwArgumentError("unsupported network","name",t)}class at extends Q{isCommunityResource(){return this.apiKey===ot}static getApiKey(t){return null==t?ot:t}static getUrl(t,e){null==e&&(e=ot);const r={allowGzip:!0,url:"https://"+st(t.name)+e,throttleCallback:(t,r)=>(e.apiKey===ot&&(0,G.vh)(),Promise.resolve(!0))};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}var ct=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const ut=new y.Logger(K.i);class lt extends Q{static getApiKey(t){return null!=t&&ut.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}static getUrl(t,e){let r=null;if("homestead"===t.name)r="https://cloudflare-eth.com/";else ut.throwArgumentError("unsupported network","network",arguments[0]);return r}perform(t,e){const r=Object.create(null,{perform:{get:()=>super.perform}});return ct(this,void 0,void 0,(function*(){if("getBlockNumber"===t){return(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number}return r.perform.call(this,t,e)}))}}var ft=r(58341),ht=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const dt=new y.Logger(K.i);function pt(t){const e={};for(let r in t){if(null==t[r])continue;let n=t[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,d.hexValue)((0,d.hexlify)(n)):"accessList"===r?"["+(0,g.accessListify)(n).map((t=>`{address:"${t.address}",storageKeys:["${t.storageKeys.join('","')}"]}`)).join(",")+"]":(0,d.hexlify)(n),e[r]=n)}return e}function gt(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"OK"!=t.message){const e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function yt(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){const e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){const e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){const e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function mt(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}const bt="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function vt(t,e,r){if("call"===t&&e.code===y.Logger.errors.SERVER_ERROR){const t=e.error;if(t&&(t.message.match(/reverted/i)||t.message.match(/VM execution error/i))){let r=t.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),(0,d.isHexString)(r))return r;dt.throwError("missing revert data in call exception",y.Logger.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let n=e.message;throw e.code===y.Logger.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?n=e.error.message:"string"==typeof e.body?n=e.body:"string"==typeof e.responseText&&(n=e.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&dt.throwError("insufficient funds for intrinsic transaction cost",y.Logger.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&dt.throwError("nonce has already been used",y.Logger.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),n.match(/another transaction with same nonce/)&&dt.throwError("replacement fee too low",y.Logger.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&dt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class wt extends V.Zk{constructor(t,e){super(t),(0,p.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,p.defineReadOnly)(this,"apiKey",e||bt)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"optimism":return"https://api-optimistic.etherscan.io"}return dt.throwArgumentError("unsupported network","network",this.network.name)}getUrl(t,e){const r=Object.keys(e).reduce(((t,r)=>{const n=e[r];return null!=n&&(t+=`&${r}=${n}`),t}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${t}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(t,e){return e.module=t,e.apikey=this.apiKey,e}fetch(t,e,r){return ht(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(t,e),i=r?this.getPostData(t,e):null,o="proxy"===t?yt:gt;this.emit("debug",{action:"request",request:n,provider:this});const s={url:n,throttleSlotInterval:1e3,throttleCallback:(t,e)=>(this.isCommunityResource()&&(0,G.vh)(),Promise.resolve(!0))};let a=null;i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(i).map((t=>`${t}=${i[t]}`)).join("&"));const c=yield(0,ft.fetchJson)(s,a,o||yt);return this.emit("debug",{action:"response",request:n,response:(0,p.deepCopy)(c),provider:this}),c}))}detectNetwork(){return ht(this,void 0,void 0,(function*(){return this.network}))}perform(t,e){const r=Object.create(null,{perform:{get:()=>super.perform}});return ht(this,void 0,void 0,(function*(){switch(t){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch((t=>vt("sendTransaction",t,e.signedTransaction)));case"getBlock":if(e.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.transactionHash});case"call":{if("latest"!==e.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const t=pt(e.transaction);t.module="proxy",t.action="eth_call";try{return yield this.fetch("proxy",t,!0)}catch(t){return vt("call",t,e.transaction)}}case"estimateGas":{const t=pt(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return yield this.fetch("proxy",t,!0)}catch(t){return vt("estimateGas",t,e.transaction)}}case"getLogs":{const t={action:"getLogs"};if(e.filter.fromBlock&&(t.fromBlock=mt(e.filter.fromBlock)),e.filter.toBlock&&(t.toBlock=mt(e.filter.toBlock)),e.filter.address&&(t.address=e.filter.address),e.filter.topics&&e.filter.topics.length>0&&(e.filter.topics.length>1&&dt.throwError("unsupported topic count",y.Logger.errors.UNSUPPORTED_OPERATION,{topics:e.filter.topics}),1===e.filter.topics.length)){const r=e.filter.topics[0];"string"==typeof r&&66===r.length||dt.throwError("unsupported topic format",y.Logger.errors.UNSUPPORTED_OPERATION,{topic0:r}),t.topic0=r}const r=yield this.fetch("logs",t);let n={};for(let t=0;t{["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);const e=this.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e}))}))}isCommunityResource(){return this.apiKey===bt}}var Et=r(52472),At=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const St=new y.Logger(K.i);function kt(){return(new Date).getTime()}function xt(t){let e=null;for(let r=0;re?null:(n+i)/2}function Tt(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(h.O$.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map((t=>Tt(t))));if("object"==typeof t){const e=Object.keys(t);return e.sort(),"{"+e.map((e=>{let r=t[e];return r="function"==typeof r?"[function]":Tt(r),JSON.stringify(e)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let _t=1;function Ot(t){let e=null,r=null,n=new Promise((n=>{e=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(e,t)}));return{cancel:e,getPromise:function(){return n},wait:t=>(n=n.then(t),n)}}const It=[y.Logger.errors.CALL_EXCEPTION,y.Logger.errors.INSUFFICIENT_FUNDS,y.Logger.errors.NONCE_EXPIRED,y.Logger.errors.REPLACEMENT_UNDERPRICED,y.Logger.errors.UNPREDICTABLE_GAS_LIMIT],Bt=["address","args","errorArgs","errorSignature","method","transaction"];function Mt(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function Nt(t,e,r){let n=Tt;switch(e){case"getBlockNumber":return function(e){const r=e.map((t=>t.result));let n=Pt(e.map((t=>t.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){const e=t.map((t=>t.result));return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return Pt(t.map((t=>t.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(t){return null==t?null:((t=(0,p.shallowCopy)(t)).confirmations=-1,Tt(t))};break;case"getBlock":n=r.includeTransactions?function(t){return null==t?null:((t=(0,p.shallowCopy)(t)).transactions=t.transactions.map((t=>((t=(0,p.shallowCopy)(t)).confirmations=-1,t))),Tt(t))}:function(t){return null==t?null:Tt(t)};break;default:throw new Error("unknown method: "+e)}return function(t,e){return function(r){const n={};r.forEach((e=>{const r=t(e.result);n[r]||(n[r]={count:0,result:e.result}),n[r].count++}));const i=Object.keys(n);for(let t=0;t=e)return r.result}}}(n,t.quorum)}function Ct(t,e){return At(this,void 0,void 0,(function*(){const r=t.provider;return null!=r.blockNumber&&r.blockNumber>=e||-1===e?r:(0,ft.poll)((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function Lt(t,e,r,n){return At(this,void 0,void 0,(function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ct(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ct(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ct(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ct(t,e)),i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&(0,d.isHexString)(r.fromBlock)||r.toBlock&&(0,d.isHexString)(r.toBlock))&&(i=yield Ct(t,e)),i.getLogs(r)}}return St.throwError("unknown method error",y.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Rt extends V.Zk{constructor(t,e){0===t.length&&St.throwArgumentError("missing providers","providers",t);const r=t.map(((t,e)=>{if(u.zt.isProvider(t)){const e=(0,G.Gp)(t)?2e3:750,r=1;return Object.freeze({provider:t,weight:1,stallTimeout:e,priority:r})}const r=(0,p.shallowCopy)(t);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=(0,G.Gp)(t)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&St.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${e}].weight`,n),Object.freeze(r)})),n=r.reduce(((t,e)=>t+e.weight),0);null==e?e=n/2:e>n&&St.throwArgumentError("quorum will always fail; larger than total weight","quorum",e);let i=xt(r.map((t=>t.provider.network)));null==i&&(i=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then(t,e)}),0)}))),super(i),(0,p.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,p.defineReadOnly)(this,"quorum",e),this._highestBlockNumber=-1}detectNetwork(){return At(this,void 0,void 0,(function*(){return xt(yield Promise.all(this.providerConfigs.map((t=>t.provider.getNetwork()))))}))}perform(t,e){return At(this,void 0,void 0,(function*(){if("sendTransaction"===t){const t=yield Promise.all(this.providerConfigs.map((t=>t.provider.sendTransaction(e.signedTransaction).then((t=>t.hash),(t=>t)))));for(let e=0;et.priority-e.priority));const i=this._highestBlockNumber;let o=0,s=!0;for(;;){const a=kt();let c=n.filter((t=>t.runner&&a-t.startt+e.weight),0);for(;c{r.staller=null})),r.runner=Lt(r,i,t,e).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Mt(r,kt()),request:{method:t,params:(0,p.deepCopy)(e)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Mt(r,kt()),request:{method:t,params:(0,p.deepCopy)(e)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Mt(r,null),request:{method:t,params:(0,p.deepCopy)(e)},provider:this}),c+=r.weight}const u=[];n.forEach((t=>{!t.done&&t.runner&&(u.push(t.runner),t.staller&&u.push(t.staller.getPromise()))})),u.length&&(yield Promise.race(u));const l=n.filter((t=>t.done&&null==t.error));if(l.length>=this.quorum){const t=r(l);if(void 0!==t)return n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0})),t;s||(yield Ot(100).getPromise()),s=!1}const f=n.reduce(((t,e)=>{if(!e.done||null==e.error)return t;const r=e.error.code;return It.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t}),{});if(Object.keys(f).forEach((t=>{const e=f[t];if(e.weight{t.staller&&t.staller.cancel(),t.cancelled=!0}));const r=e.error,i={};Bt.forEach((t=>{null!=r[t]&&(i[t]=r[t])})),St.throwError(r.reason||r.message,t,i)})),0===n.filter((t=>!t.done)).length)break}return n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0})),St.throwError("failed to meet quorum",y.Logger.errors.SERVER_ERROR,{method:t,params:e,results:n.map((t=>Mt(t))),provider:this})}))}}const Ut=null,Dt=new y.Logger(K.i),Ft="84842078b09946638c03157f83405213";class jt extends J{constructor(t,e){const r=new Vt(t,e),n=r.connection;n.password&&Dt.throwError("INFURA WebSocket project secrets unsupported",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),t),(0,p.defineReadOnly)(this,"apiKey",r.projectId),(0,p.defineReadOnly)(this,"projectId",r.projectId),(0,p.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===Ft}}class Vt extends Q{static getWebSocketProvider(t,e){return new jt(t,e)}static getApiKey(t){const e={apiKey:Ft,projectId:Ft,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(Dt.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),Dt.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"ropsten":r="ropsten.infura.io";break;case"rinkeby":r="rinkeby.infura.io";break;case"kovan":r="kovan.infura.io";break;case"goerli":r="goerli.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-kovan":r="optimism-kovan.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-rinkeby":r="arbitrum-rinkeby.infura.io";break;default:Dt.throwError("unsupported network",y.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:(t,r)=>(e.projectId===Ft&&(0,G.vh)(),Promise.resolve(!0))};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}isCommunityResource(){return this.projectId===Ft}}class Gt extends H.r{send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((t,e)=>{n.resolve=t,n.reject=e}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const t=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const e=t.map((t=>t.request));return this.emit("debug",{action:"requestBatch",request:(0,p.deepCopy)(e),provider:this}),(0,ft.fetchJson)(this.connection,JSON.stringify(e)).then((r=>{this.emit("debug",{action:"response",request:e,response:r,provider:this}),t.forEach(((t,e)=>{const n=r[e];if(n.error){const e=new Error(n.error.message);e.code=n.error.code,e.data=n.error.data,t.reject(e)}else t.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:e,provider:this}),t.forEach((t=>{t.reject(r)}))}))}),10)),i}}const Ht=new y.Logger(K.i);class Kt extends Q{static getApiKey(t){return t&&"string"!=typeof t&&Ht.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}static getUrl(t,e){Ht.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Ht.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}const qt=new y.Logger(K.i),Wt={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};class zt extends Q{constructor(t,e){if(null==e){const r=(0,p.getStatic)(new.target,"getNetwork")(t);if(r){const t=Wt[r.name];t&&(e={applicationId:t,loadBalancer:!0})}null==e&&qt.throwError("unsupported network",y.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}super(t,e)}static getApiKey(t){null==t&&qt.throwArgumentError("PocketProvider.getApiKey does not support null apiKey","apiKey",t);const e={applicationId:null,loadBalancer:!1,applicationSecretKey:null};return"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?(qt.assertArgument("string"==typeof t.applicationId,"applicationSecretKey requires an applicationId","applicationId",t.applicationId),qt.assertArgument("string"==typeof t.applicationSecretKey,"invalid applicationSecretKey","applicationSecretKey","[REDACTED]"),e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey,e.loadBalancer=!!t.loadBalancer):t.applicationId?(qt.assertArgument("string"==typeof t.applicationId,"apiKey.applicationId must be a string","apiKey.applicationId",t.applicationId),e.applicationId=t.applicationId,e.loadBalancer=!!t.loadBalancer):qt.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"goerli":r="eth-goerli.gateway.pokt.network";break;default:qt.throwError("unsupported network",y.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}let n=null;n=e.loadBalancer?`https://${r}/v1/lb/${e.applicationId}`:`https://${r}/v1/${e.applicationId}`;const i={url:n,headers:{}};return null!=e.applicationSecretKey&&(i.user="",i.password=e.applicationSecretKey),i}isCommunityResource(){return this.applicationId===Wt[this.network.name]}}var $t=r(241);const Jt=new y.Logger(K.i);function Zt(t,e){if(null==t&&(t="homestead"),"string"==typeof t){const e=t.match(/^(ws|http)s?:/i);if(e)switch(e[1].toLowerCase()){case"http":case"https":return new H.r(t);case"ws":case"wss":return new J(t);default:Jt.throwArgumentError("unsupported URL scheme","network",t)}}const r=(0,j.H)(t);return r&&r._defaultProvider||Jt.throwError("unsupported getDefaultProvider network",y.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:Rt,AlchemyProvider:nt,AnkrProvider:at,CloudflareProvider:lt,EtherscanProvider:wt,InfuraProvider:Vt,JsonRpcProvider:H.r,NodesmithProvider:Kt,PocketProvider:zt,Web3Provider:$t.Q,IpcProvider:Ut},e)}var Xt=r(9855),Yt=r(48659),Qt=r(72734),te=r(11388),ee=r(4089),re=r(57727),ne=r(84706),ie=r(93684),oe=r(32046),se=r(67827),ae=r(36274),ce=r(67949),ue=r(38197),le=r(77158),fe=r(33777),he=r(44478),de=r(61843),pe=r(62768),ge=r(35637),ye=r(44242),me=r(86237),be=r(46441),ve=r(21261);const we="ethers/5.6.9",Ee=new y.Logger(we);try{const t=window;null==t._ethers&&(t._ethers=s)}catch(t){}},56371:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var s=r(83893);Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return s.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return s.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return s.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}});var a=r(64594);Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var c=o(r(4089));e.base64=c;var u=r(57727);Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return u.Base58}});var l=r(93286);Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return l.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return l.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return l.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return l.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return l.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return l.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return l.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return l.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return l.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return l.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return l.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return l.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return l.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return l.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return l.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return l.stripZeros}});var f=r(75931);Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var h=r(36274);Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return h.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return h.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return h.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return h.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return h.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return h.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return h.mnemonicToSeed}});var d=r(19380);Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return d.getJsonWalletAddress}});var p=r(38197);Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return p.keccak256}});var g=r(80711);Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return g.Logger}});var y=r(91278);Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return y.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return y.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return y.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return y.sha512}});var m=r(33777);Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return m.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return m.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return m.sha256}});var b=r(22118);Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return b.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return b.shuffled}});var v=r(53587);Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return v.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return v.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return v.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return v.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return v.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return v.shallowCopy}});var w=o(r(61843));e.RLP=w;var E=r(62768);Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return E.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return E.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return E.SigningKey}});var A=r(62741);Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var S=r(13479);Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return S.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return S.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return S.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return S.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return S.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return S.TransactionTypes}});var k=r(46441);Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return k.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return k.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return k.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return k.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return k.parseUnits}});var x=r(44958);Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return x.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return x.verifyTypedData}});var P=r(58341);Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return P._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return P.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return P.poll}});var T=r(91278);Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return T.SupportedAlgorithm}});var _=r(62741);Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return _.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return _.Utf8ErrorReason}})},17648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),c=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},u=Math.max(0,o.length-a.length),l=[],f=0;f{"use strict";var n=r(17648);t.exports=Function.prototype.bind||n},25972:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},40210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(t){c=null}var u=function(){throw new s},l=c?function(){try{return u}catch(t){try{return c(arguments,"callee").get}catch(t){return u}}}():u,f=r(41405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},d={},p="undefined"==typeof Uint8Array?n:h(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?h(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return g[e]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(58612),v=r(17642),w=b.call(Function.call,Array.prototype.concat),E=b.call(Function.apply,Array.prototype.splice),A=b.call(Function.call,String.prototype.replace),S=b.call(Function.call,String.prototype.slice),k=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,P=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return A(t,k,(function(t,e,r,i){n[n.length]=r?A(i,x,"$1"):e||t})),n},T=function(t,e){var r,n=t;if(v(m,n)&&(n="%"+(r=m[n])[0]+"%"),v(g,n)){var o=g[n];if(o===d&&(o=y(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var r=P(t),n=r.length>0?r[0]:"",o=T("%"+n+"%",e),a=o.name,u=o.value,l=!1,f=o.alias;f&&(n=f[0],E(r,w([0,1],f)));for(var h=1,d=!0;h=r.length){var b=c(u,p);u=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[p]}else d=v(u,p),u=u[p];d&&!l&&(g[a]=u)}}return u}},31044:(t,e,r)=>{"use strict";var n=r(40210)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},41405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(55419);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},55419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},96410:(t,e,r)=>{"use strict";var n=r(55419);t.exports=function(){return n()&&!!Symbol.toStringTag}},17642:(t,e,r)=>{"use strict";var n=r(58612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},33715:(t,e,r)=>{var n=e;n.utils=r(26436),n.common=r(95772),n.sha=r(89041),n.ripemd=r(12949),n.hmac=r(52344),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},95772:(t,e,r)=>{"use strict";var n=r(26436),i=r(79746);function o(){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}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o{"use strict";var n=r(26436),i=r(79746);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e{"use strict";var n=r(26436),i=r(95772),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(l,u),e.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],b=r,v=n,w=i,E=u,A=l,S=0;S<80;S++){var k=s(o(c(r,f(S,n,i,u),t[p[S]+e],h(S)),y[S]),l);r=l,l=u,u=o(i,10),i=n,n=k,k=s(o(c(b,f(79-S,v,w,E),t[g[S]+e],d(S)),m[S]),A),b=A,A=E,E=o(w,10),w=v,v=k}k=a(this.h[1],i,E),this.h[1]=a(this.h[2],u,A),this.h[2]=a(this.h[3],l,b),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=k},l.prototype._digest=function(t){return"hex"===t?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],g=[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],y=[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],m=[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]},89041:(t,e,r)=>{"use strict";e.sha1=r(84761),e.sha224=r(10799),e.sha256=r(89344),e.sha384=r(80772),e.sha512=r(45900)},84761:(t,e,r)=>{"use strict";var n=r(26436),i=r(95772),o=r(37038),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,l),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n{"use strict";var n=r(26436),i=r(89344);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},89344:(t,e,r)=>{"use strict";var n=r(26436),i=r(95772),o=r(37038),s=r(79746),a=n.sum32,c=n.sum32_4,u=n.sum32_5,l=o.ch32,f=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,g=o.g1_256,y=i.BlockHash,m=[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 b(){if(!(this instanceof b))return new b;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(b,y),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n{"use strict";var n=r(26436),i=r(45900);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},45900:(t,e,r)=>{"use strict";var n=r(26436),i=r(95772),o=r(79746),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,f=n.sum64_hi,h=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,g=n.sum64_5_hi,y=n.sum64_5_lo,m=i.BlockHash,b=[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 v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function A(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function S(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function k(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function P(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function _(t,e){var r=s(t,e,1)^s(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=s(t,e,19)^s(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}function B(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,m),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n{"use strict";var n=r(26436).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},26436:(t,e,r)=>{"use strict";var n=r(79746),i=r(35717);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),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(i=0;i>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var c=0,u=e;return c+=(u=u+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,c,u){var l=0,f=e;return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,c,u){return e+n+o+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},2156:(t,e,r)=>{"use strict";var n=r(33715),i=r(34504),o=r(79746);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*c-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}},35717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},9496:(t,e,r)=>{"use strict";var n=r(40210),i=r(17642),o=r(37478)(),s=n("%TypeError%"),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`O` is not an object");if("string"!=typeof e)throw new s("`slot` must be a string");o.assert(t)},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`O` is not an object");if("string"!=typeof e)throw new s("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`O` is not an object");if("string"!=typeof e)throw new s("`slot` must be a string");var r=o.get(t);return!!r&&i(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`O` is not an object");if("string"!=typeof e)throw new s("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},95320:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=i?function(t){if(t===u)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)}:function(t){if(t===u)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(c)return function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(s(t))return!1;var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},18923:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,i=Object.prototype.toString,o=r(96410)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},98420:(t,e,r)=>{"use strict";var n,i,o,s,a=r(21924),c=r(96410)();if(c){n=a("Object.prototype.hasOwnProperty"),i=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var l=a("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!(e&&n(e,"value")))return!1;try{i(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},12636:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(41405)()){var i=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&o.test(i.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},91094:(t,e,r)=>{var n,i=r(34155);!function(){"use strict";var o="input is invalid type",s="object"==typeof window,a=s?window:{};a.JS_SHA3_NO_WINDOW&&(s=!1);var c=!s&&"object"==typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?a=r.g:c&&(a=self);var u=!a.JS_SHA3_NO_COMMON_JS&&t.exports,l=r.amdO,f=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),d=[4,1024,262144,67108864],p=[0,8,16,24],g=[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],y=[224,256,384,512],m=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var w=function(t,e,r){return function(n){return new L(t,e,t).update(n)[r]()}},E=function(t,e,r){return function(n,i){return new L(t,e,i).update(n)[r]()}},A=function(t,e,r){return function(e,n,i,o){return T["cshake"+t].update(e,n,i,o)[r]()}},S=function(t,e,r){return function(e,n,i,o){return T["kmac"+t].update(e,n,i,o)[r]()}},k=function(t,e,r,n){for(var i=0;i>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 R(t,e,r){L.call(this,t,e,r)}L.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(o);if(null===t)throw new Error(o);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(o);e=!0}for(var n,i,s=this.blocks,a=this.byteCount,c=t.length,u=this.blockCount,l=0,h=this.s;l>2]|=t[l]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=s[u],n=0;n>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},L.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(o);if(null===t)throw new Error(o);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(o);e=!0}var n=0,i=t.length;if(e)n=i;else for(var s=0;s=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},L.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+h[15&t]+h[t>>12&15]+h[t>>8&15]+h[t>>20&15]+h[t>>16&15]+h[t>>28&15]+h[t>>24&15];s%e==0&&(U(r),o=0)}return i&&(t=r[o],a+=h[t>>4&15]+h[15&t],i>1&&(a+=h[t>>12&15]+h[t>>8&15]),i>2&&(a+=h[t>>20&15]+h[t>>16&15])),a},L.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(t);s>8&255,c[t+2]=e>>16&255,c[t+3]=e>>24&255;a%r==0&&U(n)}return o&&(t=a<<2,e=n[s],c[t]=255&e,o>1&&(c[t+1]=e>>8&255),o>2&&(c[t+2]=e>>16&255)),c},R.prototype=new L,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var U=function(t){var e,r,n,i,o,s,a,c,u,l,f,h,d,p,y,m,b,v,w,E,A,S,k,x,P,T,_,O,I,B,M,N,C,L,R,U,D,F,j,V,G,H,K,q,W,z,$,J,Z,X,Y,Q,tt,et,rt,nt,it,ot,st,at,ct,ut,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],c=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|f>>>31),r=a^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=c^(h<<1|d>>>31),r=u^(d<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],y=t[1],z=t[11]<<4|t[10]>>>28,$=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ct=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,L=t[2]<<1|t[3]>>>31,R=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,b=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,B=t[33]<<13|t[32]>>>19,M=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,N=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,P=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,E=t[36]<<21|t[37]>>>11,A=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,T=t[18]<<20|t[19]>>>12,_=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,V=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,k=t[49]<<14|t[48]>>>18,t[0]=p^~m&v,t[1]=y^~b&w,t[10]=x^~T&O,t[11]=P^~_&I,t[20]=L^~U&F,t[21]=R^~D&j,t[30]=q^~z&J,t[31]=W^~$&Z,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=m^~v&E,t[3]=b^~w&A,t[12]=T^~O&B,t[13]=_^~I&M,t[22]=U^~F&V,t[23]=D^~j&G,t[32]=z^~J&X,t[33]=$^~Z&Y,t[42]=nt^~ot&at,t[43]=it^~st&ct,t[4]=v^~E&S,t[5]=w^~A&k,t[14]=O^~B&N,t[15]=I^~M&C,t[24]=F^~V&H,t[25]=j^~G&K,t[34]=J^~X&Q,t[35]=Z^~Y&tt,t[44]=ot^~at&ut,t[45]=st^~ct<,t[6]=E^~S&p,t[7]=A^~k&y,t[16]=B^~N&x,t[17]=M^~C&P,t[26]=V^~H&L,t[27]=G^~K&R,t[36]=X^~Q&q,t[37]=Y^~tt&W,t[46]=at^~ut&et,t[47]=ct^~lt&rt,t[8]=S^~p&m,t[9]=k^~y&b,t[18]=N^~x&T,t[19]=C^~P&_,t[28]=H^~L&U,t[29]=K^~R&D,t[38]=Q^~q&z,t[39]=tt^~W&$,t[48]=ut^~et&nt,t[49]=lt^~rt&it,t[0]^=g[n],t[1]^=g[n+1]};if(u)t.exports=T;else{for(O=0;O<_.length;++O)a[_[O]]=T[_[O]];l&&(void 0===(n=function(){return T}.call(e,r,e,t))||(t.exports=n))}}()},79746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},34504:(t,e)=>{"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},70631:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,E=String.prototype.toLowerCase,A=RegExp.prototype.test,S=Array.prototype.concat,k=Array.prototype.join,x=Array.prototype.slice,P=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,_=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,I="function"==typeof Symbol&&"object"==typeof Symbol.iterator,B="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===I||"symbol")?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function C(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||A.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-P(-t):P(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var L=r(24654).custom,R=L&&j(L)?L:null;function U(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function D(t){return v.call(String(t),/"/g,""")}function F(t){return!("[object Array]"!==H(t)||B&&"object"==typeof t&&B in t)}function j(t){if(I)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!O)return!1;try{return O.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,i){var a=r||{};if(G(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!G(a,"customInspect")||a.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=a.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,a);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return g?C(e,w):w}if("bigint"==typeof e){var A=String(e)+"n";return g?C(e,A):A}var P=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=P&&P>0&&"object"==typeof e)return F(e)?"[Array]":"[Object]";var _=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=k.call(Array(t.indent+1)," ")}return{base:r,prev:k.call(Array(e+1),r)}}(a,n);if(void 0===i)i=[];else if(K(i,e)>=0)return"[Circular]";function L(e,r,o){if(r&&(i=x.call(i)).push(r),o){var s={depth:a.depth};return G(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),t(e,s,n+1,i)}return t(e,a,n+1,i)}if("function"==typeof e){var V=function(t){if(t.name)return t.name;var e=m.call(y.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),W=X(e,L);return"[Function"+(V?": "+V:" (anonymous)")+"]"+(W.length>0?" { "+k.call(W,", ")+" }":"")}if(j(e)){var Y=I?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(e);return"object"!=typeof e||I?Y:z(Y)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var Q="<"+E.call(String(e.nodeName)),tt=e.attributes||[],et=0;et"}if(F(e)){if(0===e.length)return"[]";var rt=X(e,L);return _&&!function(t){for(var e=0;e=0)return!1;return!0}(rt)?"["+Z(rt,_)+"]":"[ "+k.call(rt,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||B&&"object"==typeof t&&B in t)}(e)){var nt=X(e,L);return"cause"in e&&!M.call(e,"cause")?"{ ["+String(e)+"] "+k.call(S.call("[cause]: "+L(e.cause),nt),", ")+" }":0===nt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+k.call(nt,", ")+" }"}if("object"==typeof e&&c){if(R&&"function"==typeof e[R])return e[R]();if("symbol"!==c&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var it=[];return s.call(e,(function(t,r){it.push(L(r,e,!0)+" => "+L(t,e))})),J("Map",o.call(e),it,_)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ot=[];return l.call(e,(function(t){ot.push(L(t,e))})),J("Set",u.call(e),ot,_)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return $("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return $("WeakSet");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return $("WeakRef");if(function(t){return!("[object Number]"!==H(t)||B&&"object"==typeof t&&B in t)}(e))return z(L(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return z(L(T.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||B&&"object"==typeof t&&B in t)}(e))return z(p.call(e));if(function(t){return!("[object String]"!==H(t)||B&&"object"==typeof t&&B in t)}(e))return z(L(String(e)));if(!function(t){return!("[object Date]"!==H(t)||B&&"object"==typeof t&&B in t)}(e)&&!function(t){return!("[object RegExp]"!==H(t)||B&&"object"==typeof t&&B in t)}(e)){var st=X(e,L),at=N?N(e)===Object.prototype:e instanceof Object||e.constructor===Object,ct=e instanceof Object?"":"null prototype",ut=!at&&B&&Object(e)===e&&B in e?b.call(H(e),8,-1):ct?"Object":"",lt=(at||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ut||ct?"["+k.call(S.call([],ut||[],ct||[]),": ")+"] ":"");return 0===st.length?lt+"{}":_?lt+"{"+Z(st,_)+"}":lt+"{ "+k.call(st,", ")+" }"}return String(e)};var V=Object.prototype.hasOwnProperty||function(t){return t in this};function G(t,e){return V.call(t,e)}function H(t){return g.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return U(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,W),"single",e)}function W(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function z(t){return"Object("+t+")"}function $(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Z(r,n):k.call(r,", "))+"}"}function Z(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+k.call(t,","+r)+"\n"+e.prev}function X(t,e){var r=F(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(21414),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),h=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var g=0;g0)for(var y=0;y{"use strict";var n=Array.prototype.slice,i=r(21414),o=Object.keys,s=o?function(t){return o(t)}:r(18987),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},21414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},34155:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,l=-1;function f(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&h())}function h(){if(!u){var t=s(f);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l1)for(var r=1;r{"use strict";var n=r(48764).Buffer;class i{static isArrayBuffer(t){return"[object ArrayBuffer]"===Object.prototype.toString.call(t)}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t).slice().buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,e){if(t.constructor===e)return t;if(this.isArrayBuffer(t))return new e(t);if(this.isArrayBufferView(t))return new e(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,e){const r=i.toUint8Array(t),n=i.toUint8Array(e);if(r.length!==n.byteLength)return!1;for(let t=0;t{"use strict";var n=r(25972).functionsHaveConfigurableNames(),i=Object,o=TypeError;t.exports=function(){if(null!=this&&this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.sticky&&(t+="y"),t},n&&Object.defineProperty&&Object.defineProperty(t.exports,"name",{value:"get flags"})},2847:(t,e,r)=>{"use strict";var n=r(4289),i=r(55559),o=r(53697),s=r(71721),a=r(32753),c=i(s());n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},71721:(t,e,r)=>{"use strict";var n=r(53697),i=r(4289).supportsDescriptors,o=Object.getOwnPropertyDescriptor;t.exports=function(){if(i&&"gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},32753:(t,e,r)=>{"use strict";var n=r(4289).supportsDescriptors,i=r(71721),o=Object.getOwnPropertyDescriptor,s=Object.defineProperty,a=TypeError,c=Object.getPrototypeOf,u=/a/;t.exports=function(){if(!n||!c)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=i(),e=c(u),r=o(e,"flags");return r&&r.get===t||s(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},17635:function(t){"use strict";!function(e){const r=2147483647;function n(t){const e=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,i=1013904242,o=2773480762,s=1359893119,a=2600822924,c=528734635,u=1541459225;const l=new Uint32Array(64);function f(t){let f=0,h=t.length;for(;h>=64;){let d,p,g,y,m,b=r,v=n,w=i,E=o,A=s,S=a,k=c,x=u;for(p=0;p<16;p++)g=f+4*p,l[p]=(255&t[g])<<24|(255&t[g+1])<<16|(255&t[g+2])<<8|255&t[g+3];for(p=16;p<64;p++)d=l[p-2],y=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,d=l[p-15],m=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,l[p]=(y+l[p-7]|0)+(m+l[p-16]|0)|0;for(p=0;p<64;p++)y=(((A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&S^~A&k)|0)+(x+(e[p]+l[p]|0)|0)|0,m=((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+(b&v^b&w^v&w)|0,x=k,k=S,S=A,A=E+y|0,E=w,w=v,v=b,b=y+m|0;r=r+b|0,n=n+v|0,i=i+w|0,o=o+E|0,s=s+A|0,a=a+S|0,c=c+k|0,u=u+x|0,f+=64,h-=64}}f(t);let h,d=t.length%64,p=t.length/536870912|0,g=t.length<<3,y=d<56?56:120,m=t.slice(t.length-d,t.length);for(m.push(128),h=d+1;h>>24&255),m.push(p>>>16&255),m.push(p>>>8&255),m.push(p>>>0&255),m.push(g>>>24&255),m.push(g>>>16&255),m.push(g>>>8&255),m.push(g>>>0&255),f(m),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(t,e,r){t=t.length<=64?t:n(t);const i=64+e.length+4,o=new Array(i),s=new Array(64);let a,c=[];for(a=0;a<64;a++)o[a]=54;for(a=0;a=i-4;t--){if(o[t]++,o[t]<=255)return;o[t]=0}}for(;r>=32;)u(),c=c.concat(n(s.concat(n(o)))),r-=32;return r>0&&(u(),c=c.concat(n(s.concat(n(o))).slice(0,r))),c}function o(t,e,r,n,i){let o;for(u(t,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(t,16*o,i,16),a(i,n),u(i,0,t,e+16*o,16);for(o=0;o>>32-e}function a(t,e){u(t,0,e,0,16);for(let t=8;t>0;t-=2)e[4]^=s(e[0]+e[12],7),e[8]^=s(e[4]+e[0],9),e[12]^=s(e[8]+e[4],13),e[0]^=s(e[12]+e[8],18),e[9]^=s(e[5]+e[1],7),e[13]^=s(e[9]+e[5],9),e[1]^=s(e[13]+e[9],13),e[5]^=s(e[1]+e[13],18),e[14]^=s(e[10]+e[6],7),e[2]^=s(e[14]+e[10],9),e[6]^=s(e[2]+e[14],13),e[10]^=s(e[6]+e[2],18),e[3]^=s(e[15]+e[11],7),e[7]^=s(e[3]+e[15],9),e[11]^=s(e[7]+e[3],13),e[15]^=s(e[11]+e[7],18),e[1]^=s(e[0]+e[3],7),e[2]^=s(e[1]+e[0],9),e[3]^=s(e[2]+e[1],13),e[0]^=s(e[3]+e[2],18),e[6]^=s(e[5]+e[4],7),e[7]^=s(e[6]+e[5],9),e[4]^=s(e[7]+e[6],13),e[5]^=s(e[4]+e[7],18),e[11]^=s(e[10]+e[9],7),e[8]^=s(e[11]+e[10],9),e[9]^=s(e[8]+e[11],13),e[10]^=s(e[9]+e[8],18),e[12]^=s(e[15]+e[14],7),e[13]^=s(e[12]+e[15],9),e[14]^=s(e[13]+e[12],13),e[15]^=s(e[14]+e[13],18);for(let r=0;r<16;++r)t[r]+=e[r]}function c(t,e,r,n){for(let i=0;i=256)return!1}return!0}function f(t,e){if("number"!=typeof t||t%1)throw new Error("invalid "+e);return t}function h(t,e,n,s,a,h,d){if(n=f(n,"N"),s=f(s,"r"),a=f(a,"p"),h=f(h,"dkLen"),0===n||0!=(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/a)throw new Error("r too large");if(!l(t))throw new Error("password must be an array or buffer");if(t=Array.prototype.slice.call(t),!l(e))throw new Error("salt must be an array or buffer");e=Array.prototype.slice.call(e);let p=i(t,e,128*a*s);const g=new Uint32Array(32*a*s);for(let t=0;tO&&(e=O);for(let t=0;tO&&(e=O);for(let t=0;t>0&255),p.push(g[t]>>8&255),p.push(g[t]>>16&255),p.push(g[t]>>24&255);const r=i(t,p,h);return d&&d(null,1,r),r}d&&I(B)};if(!d)for(;;){const t=B();if(null!=t)return t}B()}const d={scrypt:function(t,e,r,n,i,o,s){return new Promise((function(a,c){let u=0;s&&s(0),h(t,e,r,n,i,o,(function(t,e,r){if(t)c(t);else if(r)s&&1!==u&&s(1),a(new Uint8Array(r));else if(s&&e!==u)return u=e,s(e)}))}))},syncScrypt:function(t,e,r,n,i,o){return new Uint8Array(h(t,e,r,n,i,o))}};t.exports=d}()},37478:(t,e,r)=>{"use strict";var n=r(40210),i=r(21924),o=r(70631),s=n("%TypeError%"),a=n("%WeakMap%",!0),c=n("%Map%",!0),u=i("WeakMap.prototype.get",!0),l=i("WeakMap.prototype.set",!0),f=i("WeakMap.prototype.has",!0),h=i("Map.prototype.get",!0),d=i("Map.prototype.set",!0),p=i("Map.prototype.has",!0),g=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new s("Side channel does not contain "+o(t))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return u(t,n)}else if(c){if(e)return h(e,n)}else if(r)return function(t,e){var r=g(t,e);return r&&r.value}(r,n)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){return!!g(t,e)}(r,n);return!1},set:function(n,i){a&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new a),l(t,n,i)):c?(e||(e=new c),d(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=g(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n}},19505:(t,e,r)=>{"use strict";var n=r(50581),i=r(1391),o=r(67364),s=r(10840),a=r(96846),c=r(39619),u=r(21924),l=r(41405)(),f=r(2847),h=u("String.prototype.indexOf"),d=r(46966),p=function(t){var e=d();if(l&&"symbol"==typeof Symbol.matchAll){var r=o(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(s(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(s(t)){var r="flags"in t?i(t,"flags"):f(t);if(c(r),h(a(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var o=p(t);if(void 0!==o)return n(o,t,[e])}var u=a(e),l=new RegExp(t,"g");return n(p(l),l,[u])}},94956:(t,e,r)=>{"use strict";var n=r(55559),i=r(4289),o=r(19505),s=r(83447),a=r(42376),c=n(o);i(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},46966:(t,e,r)=>{"use strict";var n=r(41405)(),i=r(27201);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:i}},83447:(t,e,r)=>{"use strict";var n=r(19505);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},27201:(t,e,r)=>{"use strict";var n=r(53937),i=r(1391),o=r(40105),s=r(39655),a=r(88305),c=r(96846),u=r(53633),l=r(2847),f=r(21924)("String.prototype.indexOf"),h=RegExp,d="flags"in RegExp.prototype,p=function(t){var e=this;if("Object"!==u(e))throw new TypeError('"this" value must be an Object');var r=c(t),p=function(t,e){var r="flags"in e?i(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===h?e.source:e,r)}}(s(e,h),e),g=p.flags,y=p.matcher,m=a(i(e,"lastIndex"));o(y,"lastIndex",m,!0);var b=f(g,"g")>-1,v=f(g,"u")>-1;return n(y,r,b,v)},g=Object.defineProperty,y=Object.getOwnPropertyDescriptor;if(g&&y){var m=y(p,"name");m&&m.configurable&&g(p,"name",{value:"[Symbol.matchAll]"})}t.exports=p},42376:(t,e,r)=>{"use strict";var n=r(4289),i=r(41405)(),o=r(83447),s=r(46966),a=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=o();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),i){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),a&&c){var r=c(Symbol,e);r&&!r.configurable||a(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var u=s(),l={};l[e]=u;var f={};f[e]=function(){return RegExp.prototype[e]!==u},n(RegExp.prototype,l,f)}return t}},77267:(t,e,r)=>{"use strict";r.d(e,{G:()=>n});var n=function(){function t(t){this.client=t}return t.prototype.saveProof=function(e,r){var n=this.getProofs();n[this.getFullKey(e)]=r,localStorage.setItem(t.STORAGE_KEY,JSON.stringify(n))},t.prototype.getSavedProof=function(t){var e=this.getProofs(),r=this.getFullKey(t);return e[r]?e[r]:null},t.prototype.deleteProof=function(e){var r=this.getProofs(),n=this.getFullKey(e);r[n]&&delete r[n],localStorage.setItem(t.STORAGE_KEY,JSON.stringify(r))},t.prototype.getFullKey=function(t){return this.TYPE+"-"+t.toLowerCase()},t.prototype.getProofs=function(){var e=localStorage.getItem(t.STORAGE_KEY);return e&&e.length?JSON.parse(e):{}},t.STORAGE_KEY="tn-proof",t}()},82250:(t,e,r)=>{"use strict";r.d(e,{KU:()=>dt,XF:()=>ct,ct:()=>ut,kS:()=>at});var n,i=r(42595),o=function(){function t(t,e,r,n){this.params={},this.client=t,this.ui=e,this.viewContainer=r,this.params=n,this.init()}return t.prototype.init=function(){},t.prototype.update=function(t){this.params=t,this.render()},t}(),s=function(){function t(t,e){this.params={},this.viewContainer=t,this.params=e}return t.prototype.render=function(){var t,e=this,r=this.params.src;r&&"undefined"!==r?((t=document.createElement("img")).loading="lazy",t.addEventListener("load",(function(t){e.onLoad(t)})),t.addEventListener("error",(function(t){e.onError(t)})),t.src=r):(t=this.createAvatar(),this.viewContainer.classList.remove("shimmer-tn")),this.viewContainer.appendChild(t)},t.prototype.onLoad=function(t){this.viewContainer.classList.remove("shimmer-tn")},t.prototype.onError=function(t){this.viewContainer.innerHTML="",this.viewContainer.appendChild(this.createAvatar()),this.viewContainer.classList.remove("shimmer-tn")},t.prototype.createAvatar=function(){var t=document.createElement("img");return t.src=this.generateAvatar(this.params.title),t},t.prototype.generateAvatar=function(t){var e=document.createElement("canvas"),r=e.getContext("2d");if(e.width=200,e.height=200,!r)return"";r.fillStyle=this.getRandomBackgroundColor(),r.fillRect(0,0,e.width,e.height),r.font="bold 100px 'Arial', sans-serif",r.fillStyle="#fff",r.textAlign="center",r.textBaseline="middle";for(var n=t.split(" "),i="",o=0;i.length<2&&o=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.loadedCount=0,e.numberToLoad=25,e.autoLoadMore=!0,e}return c(e,t),e.prototype.init=function(){var t=this;this.viewContainer.addEventListener("click",(function(e){e.target.classList.contains("mobileToggle-tn")?t.tokenToggleSelection():e.target.classList.contains("load-more-btn-tn")&&t.loadMoreTokens()}))},e.prototype.render=function(){var t=this;if(this.loadedCount=0,this.viewContainer.innerHTML=this.getTokenListItems(),this.renderIcons(),this.autoLoadMore){var e=this.viewContainer.querySelector(".load-more-tn");e&&(this.interceptObs||(this.interceptObs=new IntersectionObserver((function(e){e[0].isIntersecting&&t.loadMoreTokens()}),{root:document.querySelector(".view-content-tn")})),this.interceptObs.observe(e))}},e.prototype.getTokenListItems=function(){for(var t="",e=Math.min(this.loadedCount+this.numberToLoad,this.params.tokens.length),r=this.loadedCount;r\n \n \n "},e.prototype.createTokenMarkup=function(t){var e=t.tokenIssuerKey,r=t.title,n=t.data,i=t.index,o=t.image,s=t.toggleState,a=i.length>15?i.substring(0,5)+"..."+i.substring(i.length-5,i.length):i;return'\n
  • \n
    \n
    \n

    ").concat(r,"

    \n

    #').concat(a,"

    \n
    \n
    \n \n \n
    \n
  • \n ")},e}(o),f=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),h=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},d=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.init=function(){var t=this;this.client.registerUiUpdateCallback(at.ISSUERS_LOADING,(function(){t.issuersLoading()})),this.client.registerUiUpdateCallback(at.ISSUERS_LOADED,(function(){t.ui.dismissLoader(),t.client.cancelTokenAutoload(),t.render()}))},e.prototype.render=function(){var t=this;if(this.viewContainer.innerHTML='\n
    \n
    \n
    \n
    \n

    '.concat(this.params.options.issuerHeading,'

    \n \n
    \n\t\t\t\t\t\t\t\t\n
    \n \n
    \n '),this.viewContainer.querySelector(".back-to-menu-tn").addEventListener("click",this.backToIssuers.bind(this)),this.viewContainer.querySelector(".dis-wallet-tn").addEventListener("click",(function(){t.client.disconnectWallet()})),this.issuerListContainer=document.querySelector(".token-issuer-list-container-tn"),this.tokensContainer=document.getElementsByClassName("token-view-tn")[0],this.issuerListContainer){this.populateIssuers();var e=this.tokensContainer.getElementsByClassName("token-list-container-tn")[0];this.tokenListView=new l(this.client,this.ui,e,{}),this.client.issuersLoaded?this.client.getTokenStore().hasUnloadedTokens()&&this.autoLoadTokens():this.issuersLoading()}else(0,a.kg)(2,"Element .token-issuer-list-container-tn not found")},e.prototype.issuersLoading=function(){this.ui.showLoader("

    Loading contract data...

    ")},e.prototype.populateIssuers=function(){var t,e,r=this,n="",i=this.client.getTokenStore().getCurrentIssuers();for(var o in i){var a=i[o],c=this.client.getTokenStore().getIssuerTokens(o),u=a.title?a.title:a.collectionID.replace(/[-,_]+/g," ");n+=this.issuerConnectMarkup(u,a.image,o,c)}this.issuerListContainer.innerHTML=n;try{for(var l=p(this.issuerListContainer.getElementsByClassName("img-container-tn")),f=l.next();!f.done;f=l.next()){var h=f.value,d={src:h.getAttribute("data-image-src"),title:h.getAttribute("data-token-title")};new s(h,d).render()}}catch(e){t={error:e}}finally{try{f&&!f.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}this.issuerListContainer.addEventListener("click",(function(t){if(t.target.classList.contains("connect-btn-tn"))r.connectTokenIssuer(t);else if(t.target.classList.contains("tokens-btn-tn")){var e=t.target.parentNode.dataset.issuer;r.navigateToTokensView(e)}}))},e.prototype.issuerConnectMarkup=function(t,e,r,n){return'\n \n ")},e.prototype.backToIssuers=function(){this.tokensContainer.style.display="none",this.viewContainer.querySelector(".issuer-slider-tn").classList.toggle("open")},e.prototype.autoLoadTokens=function(){return h(this,void 0,void 0,(function(){var t=this;return d(this,(function(e){switch(e.label){case 0:return[4,this.client.tokenAutoLoad(this.issuerLoading.bind(this),(function(e,r){if(null==r?void 0:r.length)t.issuerConnected(e,r,!1);else{var n=t.issuerListContainer.querySelector('[data-issuer*="'.concat(e,'"] .connect-btn-tn'));n&&(n.innerText="Load")}}))];case 1:return e.sent(),[2]}}))}))},e.prototype.connectTokenIssuer=function(t){return h(this,void 0,void 0,(function(){var e,r,n,i;return d(this,(function(o){switch(o.label){case 0:e=t.target.dataset,r=e.issuer,n=[],this.ui.showLoader("

    Loading tokens...

    "),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.client.connectTokenIssuer(r)];case 2:return n=o.sent(),[3,4];case 3:return i=o.sent(),(0,a.kg)(2,i),this.ui.showError(i),this.client.eventSender.emitErrorToClient(i,r),[2];case 4:return this.ui.dismissLoader(),(null==n?void 0:n.length)?(this.issuerConnected(r,n),[2]):(this.ui.showError("No tokens found!"),[2])}}))}))},e.prototype.issuerLoading=function(t){var e=this.issuerListContainer.querySelector('[data-issuer*="'.concat(t,'"] .connect-btn-tn'));e&&(e.innerHTML='
    ')},e.prototype.issuerConnected=function(t,e,r){var n=this;void 0===r&&(r=!0);var i=this.issuerListContainer.querySelector('[data-issuer*="'.concat(t,'"] .connect-btn-tn')),o=this.issuerListContainer.querySelector('[data-issuer*="'.concat(t,'"] .tokens-btn-tn'));i&&o||(0,a.kg)(2,"Could not find button handler"),i.style.display="none",i.setAttribute("tabIndex",-1),o.style.display="block",o.innerHTML="".concat(e.length," token").concat(e.length>1?"s":""," available"),o.setAttribute("aria-label","Navigate to select from ".concat(e.length," of your ").concat(t," tokens")),o.setAttribute("tabIndex",1),r&&setTimeout((function(){n.navigateToTokensView(t)}),250)},e.prototype.navigateToTokensView=function(t){this.updateTokensView(t),this.showTokenView(t)},e.prototype.updateTokensView=function(t){var e;this.tokensContainer.style.display="block",this.tokensContainer.scrollTo(0,0);var r=this.client.getTokenStore(),n=r.getCurrentIssuers()[t],i=r.getIssuerTokens(t);n.title&&(document.getElementsByClassName("headline-tn token-name")[0].innerHTML=n.title);var o=[];null==i||i.map((function(e,i){var s,a,c,u=!1;if(null===(s=r.getSelectedTokens()[t])||void 0===s||s.tokens.map((function(t){JSON.stringify(e)===JSON.stringify(t)&&(u=!0)})),!1===n.onChain){var l=n.title,f=n.image;o.push({data:e,tokenIssuerKey:t,index:null!==(a=e.tiketIdNumber)&&void 0!==a?a:i,title:l,image:f,toggleState:u})}else{var h=null!==(c=e.tokenId)&&void 0!==c?c:i.toString();o.push({data:e,tokenIssuerKey:t,index:h,title:e.title,image:e.image,toggleState:u})}})),null===(e=this.tokenListView)||void 0===e||e.update({issuer:t,tokens:o})},e.prototype.showTokenView=function(t){this.viewContainer.querySelector(".issuer-slider-tn").classList.toggle("open")},e}(o),y=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),m=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},b=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]\n '.concat('Metamask logo',"\n

    MetaMask

    \n "):"",r=this.client.solanaAvailable()?'"):"",n=this.client.safeConnectAvailable()?'"):"";this.viewContainer.innerHTML='\n
    \n
    \n
    \n
    \n
    \n

    Select Wallet

    \n
    \n
    \n \t'.concat(n,"\n ").concat(e,'\n \n \n ").concat(r,"\n
    \n
    \n
    \n
    \n "),this.viewContainer.querySelectorAll(".wallet-button-tn").forEach((function(e){e.addEventListener("click",t.connectWallet.bind(t))}))},e.prototype.connectWallet=function(t){var e,r,n,i;return m(this,void 0,void 0,(function(){var o,s;return b(this,(function(c){switch(c.label){case 0:o=t.currentTarget.dataset.wallet,(0,a.kg)(2,"Connect wallet: "+o),this.ui.showLoaderDelayed(["

    Connecting to "+o+"...

    ","You may need to unlock your wallet to continue."],500),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.client.negotiatorConnectToWallet(o)];case 2:return c.sent(),this.ui.dismissLoader(),(null===(r=null===(e=this.params)||void 0===e?void 0:e.data)||void 0===r?void 0:r.connectCallback)?null===(i=null===(n=this.params)||void 0===n?void 0:n.data)||void 0===i||i.connectCallback():this.ui.updateUI(g),[3,4];case 3:return s=c.sent(),this.ui.showError(s),[2];case 4:return[2]}}))}))},e}(o),w=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),E=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},A=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]\n
    \n
    \n
    \n \n
    '.concat(this.params.options.openingHeading,"
    \n
    \n
    \n \n "),this.viewContainer.querySelector(".opening-btn-tn").addEventListener("click",this.goToWalletSelection.bind(this))},e.prototype.goToWalletSelection=function(){return E(this,void 0,void 0,(function(){var t;return A(this,(function(e){switch(e.label){case 0:return this.client.checkInternetConnectivity(),this.ui.showLoaderDelayed(["Initializing wallet.."],500),this.client.getTokenStore().hasOnChainTokens()?[4,this.client.getWalletProvider()]:[3,3];case 1:return[4,(t=e.sent()).loadConnections()];case 2:return e.sent(),this.client.enrichTokenLookupDataOnChainTokens(),this.ui.updateUI(t.getConnectedWalletData().length?g:v),[3,4];case 3:this.ui.updateUI(g),e.label=4;case 4:return this.ui.dismissLoader(),[2]}}))}))},e}(o),k=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},x=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i\n\t\t\t\n\t\t\t
    \n\t\t\n\t',t.FAB_BUTTON_HTML='\n\t\t\n\t',t}(),T=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},_=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},j=function(){function t(t){this.currentIssuers={},this.tokens={},this.tokenLookup={},this.selectedTokens={},this.autoEnableTokens=t}return t.prototype.updateIssuers=function(t){Object.keys(this.currentIssuers).length>0&&(this.selectedTokens={}),this.prePopulateTokenLookupStore(t)},t.prototype.clearCachedTokens=function(t){for(var e in this.tokens)void 0!==t&&t!==this.tokenLookup[e].onChain||(this.tokens[e]=[]);this.selectedTokens={}},t.prototype.hasOnChainTokens=function(){for(var t in this.currentIssuers)if(this.currentIssuers[t])return!0;return!1},t.prototype.getCurrentIssuers=function(t){var e={};for(var r in this.currentIssuers)void 0!==t&&t!==this.currentIssuers[r]||(e[r]=this.tokenLookup[r]);return e},t.prototype.getCurrentTokens=function(t){var e={};for(var r in this.currentIssuers)void 0!==t&&t!==this.currentIssuers[r]||(e[r]=this.tokens[r]);return e},t.prototype.hasUnloadedIssuers=function(){var t=this.getCurrentIssuers(!0);for(var e in t)if(!t[e].title)return!0;return!1},t.prototype.hasUnloadedTokens=function(){var t,e;try{for(var r=F(Object.values(this.getCurrentTokens())),n=r.next();!n.done;n=r.next()){if(0===n.value.length)return!0}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return!1},t.prototype.getIssuerTokens=function(t){return this.tokens[t]?this.tokens[t]:null},t.prototype.setTokens=function(t,e){this.tokens[t]=e,this.autoEnableTokens&&(this.selectedTokens[t]={tokens:e})},t.prototype.getSelectedTokens=function(){return this.selectedTokens},t.prototype.setSelectedTokens=function(t){this.selectedTokens=t},t.prototype.prePopulateTokenLookupStore=function(t){var e=this,r={};t.forEach((function(t,n){t.collectionID&&(void 0===t.onChain&&(t.onChain=!0),t.collectionID=e.formatCollectionID(t.collectionID),void 0===r[t.collectionID]?("chain"in t&&(t.chain=e.formatCollectionChain(t.chain)),void 0!==e.tokens[t.collectionID]?e.autoEnableTokens&&e.tokens[t.collectionID].length&&(e.selectedTokens[t.collectionID]={tokens:e.tokens[t.collectionID]}):e.tokens[t.collectionID]=[],e.tokenLookup[t.collectionID]||e.updateTokenLookupStore(t.collectionID,t),r[t.collectionID]=t.onChain):(0,a.kg)(1,"duplicate collectionID key ".concat(t.collectionID,", use unique keys per collection.")))})),this.currentIssuers=r},t.prototype.updateTokenLookupStore=function(t,e){this.tokenLookup[t]=D(D({},this.tokenLookup[t]),e)},t.prototype.formatCollectionChain=function(t){return t.toLowerCase()},t.prototype.formatCollectionID=function(t){var e=t;return(/[A-Z]+/g.test(t)||/\s+/g.test(t))&&(e=t.replace(/\s+/g,"-").toLowerCase(),(0,a.kg)(1,"Token Negotiator: Spaces or capital letters found in collectionID definition ".concat(t,", this has been re-formatted to ").concat(e)),t=e),t},t}(),V=r(77267),G=r(951),H=r(93684),K=r(93286),q=r(13479),W=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},z=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&this.tokenStore.updateIssuers(this.config.issuers),this.messaging=new i.sT}return t.getKey=function(t){return U._F.decodePublicKey(t)},t.prototype.mergeConfig=function(t,e){var r;for(var n in e)e[n]&&e[n].constructor===Object?t[n]=this.mergeConfig(null!==(r=t[n])&&void 0!==r?r:{},e[n]):t[n]=e[n];return t},t.prototype.getTokenStore=function(){return this.tokenStore},t.prototype.getUi=function(){return this.ui},t.prototype.triggerUiUpdateCallback=function(t,e){this.uiUpdateCallbacks[t]&&this.uiUpdateCallbacks[t](e)},t.prototype.registerUiUpdateCallback=function(t,e){this.uiUpdateCallbacks[t]=e},t.prototype.safeConnectAvailable=function(){return void 0!==this.config.safeConnectOptions},t.prototype.solanaAvailable=function(){return void 0!==window.solana&&this.config.issuers.filter((function(t){var e;return"solana"===(null===(e=null==t?void 0:t.blockchain)||void 0===e?void 0:e.toLowerCase())})).length>0},t.prototype.getWalletProvider=function(){return ot(this,void 0,void 0,(function(){var t;return st(this,(function(e){switch(e.label){case 0:return this.web3WalletProvider?[3,2]:[4,r.e(827).then(r.bind(r,18827))];case 1:t=e.sent().Web3WalletProvider,this.web3WalletProvider=new t(this,this.config.safeConnectOptions),e.label=2;case 2:return[2,this.web3WalletProvider]}}))}))},t.prototype.disconnectWallet=function(){return ot(this,void 0,void 0,(function(){return st(this,(function(t){switch(t.label){case 0:return[4,this.getWalletProvider()];case 1:return t.sent().deleteConnections(),this.tokenStore.clearCachedTokens(),this.ui.updateUI(v),[2]}}))}))},t.prototype.negotiatorConnectToWallet=function(t){return ot(this,void 0,void 0,(function(){var e;return st(this,(function(r){switch(r.label){case 0:return[4,this.getWalletProvider()];case 1:return[4,r.sent().connectWith(t)];case 2:return e=r.sent(),(0,a.kg)(2,"wallet address found: "+e),[2,e]}}))}))},t.prototype.enrichTokenLookupDataOnChainTokens=function(){return ot(this,void 0,void 0,(function(){var t,e,r,n,i,o,s,c;return st(this,(function(u){switch(u.label){case 0:for(r in this.issuersLoaded=!1,this.triggerUiUpdateCallback(at.ISSUERS_LOADING),t=this.tokenStore.getCurrentIssuers(!0),e=[],t)e.push(r);n=0,u.label=1;case 1:if(!(n0)return[3,6];t(s),f.label=2;case 2:return f.trys.push([2,4,,5]),[4,this.connectTokenIssuer(s)];case 3:return u=f.sent(),e(s,u),[3,5];case 4:return(l=f.sent()).message="Failed to load "+s+": "+l.message,(0,a.kg)(2,l.message),this.eventSender.emitErrorToClient(l,s),e(s,null),[3,5];case 5:if(r++,this.cancelAutoload||!0!==this.config.autoLoadTokens&&r>this.config.autoLoadTokens)return[3,7];f.label=6;case 6:return o++,[3,1];case 7:return[2]}}))}))},t.prototype.cancelTokenAutoload=function(){this.cancelAutoload=!0},t.prototype.setPassiveNegotiationWebTokens=function(){return ot(this,void 0,void 0,(function(){var t,e,r,n,o,s,c,u;return st(this,(function(l){switch(l.label){case 0:for(r in t=this.tokenStore.getCurrentIssuers(!1),e=[],t)e.push(r);n=0,l.label=1;case 1:if(!(nAuthenticating...","You may need to sign a new challenge in your wallet"],600,!0),i=t.type?t.type:n.onChain?Y:nt,o=new i(this),u.label=1;case 1:return u.trys.push([1,3,,4]),t.options||(t.options={}),t.options.messagingForceTab=this.config.messagingForceTab,[4,o.getTokenProof(n,[t.unsignedToken],t)];case 2:return s=u.sent(),(0,a.kg)(2,"Ticket proof successfully validated."),this.eventSender.emitProofToClient(s.data,e),[3,4];case 3:if(c=u.sent(),(0,a.kg)(2,c),"WALLET_REQUIRED"===c.message)return[2,this.handleWalletRequired(t)];throw this.handleProofError(c,e),c;case 4:return this.ui&&(this.ui.dismissLoader(),this.ui.closeOverlay()),[2,s.data]}}))}))},t.prototype.handleWalletRequired=function(t){return ot(this,void 0,void 0,(function(){var e=this;return st(this,(function(r){switch(r.label){case 0:return this.ui?(this.ui.dismissLoader(),this.ui.openOverlay(),[3,4]):[3,1];case 1:return[4,this.getWalletProvider()];case 2:return[4,r.sent().connectWith("MetaMask")];case 3:return r.sent(),[2,this.authenticate(t)];case 4:return[2,new Promise((function(r,n){e.ui.updateUI(v,{connectCallback:function(){return ot(e,void 0,void 0,(function(){var e,i;return st(this,(function(o){switch(o.label){case 0:this.ui.updateUI(g),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.authenticate(t)];case 2:return e=o.sent(),r(e),[3,4];case 3:return i=o.sent(),n(i),[3,4];case 4:return[2]}}))}))}})}))]}}))}))},t.prototype.handleProofError=function(t,e){this.ui&&this.ui.showError(t),this.eventSender.emitProofToClient(null,e,t)},t.prototype.checkInternetConnectivity=function(){var t,e=this;if(!navigator.onLine)throw"active"===this.config.type&&setTimeout((function(){var t;e.ui.showError(null!==(t=e.config.noInternetErrorMessage)&&void 0!==t?t:ft)}),1e3),new Error(null!==(t=this.config.noInternetErrorMessage)&&void 0!==t?t:ft)},t.prototype.addTokenViaMagicLink=function(t){return ot(this,void 0,void 0,(function(){var e,r,n;return st(this,(function(o){switch(o.label){case 0:return e=new URL(t),r=e.hash.length>1?e.hash.substring(1):e.search.substring(1),[4,this.messaging.sendMessage({action:i.gF.MAGIC_URL,origin:e.origin+e.pathname,data:{urlParams:r}},this.config.messagingForceTab)];case 1:if((n=o.sent()).evt===i.AJ.ISSUER_TOKENS)return[2,n.data.tokens];throw new Error(n.errors.join("\n"))}}))}))},t.prototype.on=function(t,e,r){if((0,a.Sg)(t,"Event type is not defined"),e)this.clientCallBackEvents[t]=e;else if(this.clientCallBackEvents[t])return this.clientCallBackEvents[t].call(t,r)},t.prototype.switchTheme=function(t){this.ui.switchTheme(t)},t}()},42595:(t,e,r)=>{"use strict";r.d(e,{AJ:()=>i,gF:()=>n,sT:()=>u});var n,i,o=r(96960),s=r(82250),a=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},c=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{"use strict";r.d(e,{k:()=>n,s:()=>c});var n,i=r(93951),o=r(82250),s=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},a=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(l=setTimeout((function(){u||s(new Error("Failed to receive response from window/iframe")),h()}),r))},t.prototype.getModal=function(t){var e=document.getElementById("modal-tn");return e||!t||((e=document.createElement("div")).id="modal-tn",e.className="modal-tn",e.style.display="none",e.innerHTML='\n \n ',document.body.appendChild(e),e.getElementsByClassName("modal-close-tn")[0].addEventListener("click",(function(){t()}))),e},t.prototype.removeModal=function(){var t=this.getModal();t&&(t.style.display="none",t.remove())},t.prototype.constructUrl=function(t,e){var r="".concat(e.origin,"#evtid=").concat(t,"&action=").concat(e.action);for(var n in e.data){var i=e.data[n];i&&(r+=i instanceof Array||i instanceof Object?"&".concat(n,"=").concat(JSON.stringify(i)):"urlParams"===n?"&".concat(i):"&".concat(n,"=").concat(i))}return r},t.prototype.openTab=function(t){return window.open(t,"_blank")},t.prototype.createIframe=function(t){var e=document.createElement("iframe");return e.setAttribute("allow","clipboard-read"),this.getModal(t).getElementsByClassName("modal-body-tn")[0].appendChild(e),e},t.getUniqueEventId=function(){return(new Date).getTime().toString()},t}()},93951:(t,e,r)=>{"use strict";r.d(e,{BT:()=>d,C$:()=>u,Ov:()=>f,Pb:()=>h,Sg:()=>c,kg:()=>a,t:()=>l});var n=r(48764),i=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function a(t){for(var e=[],r=1;rparseInt(window.DISPLAY_DEBUG_LEVEL)||console.log.apply(console,o([],i(e),!1))}var c=function(t,e){if(!t)throw new Error(e)};function u(t){return void 0!==n.Buffer?n.Buffer.from(t):t}var l=function(t,e){var r,n,i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;try{for(var a=s(i),c=a.next();!c.done;c=a.next()){var u=c.value;if("object"==typeof e[u]){if(JSON.stringify(t[u])!==JSON.stringify(e[u]))return!1}else if(t[u]!==e[u])return!1}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!0},f=function(t){return t=t.split("-").join("+").split("_").join("/").split(".").join("="),Uint8Array.from(n.Buffer.from(t,"base64"))},h=function(t){window.addEventListener?window.addEventListener("message",t,!1):window.attachEvent("onmessage",t)},d=function(t){window.removeEventListener?window.removeEventListener("message",t):window.detachEvent("onmessage",t)}},75522:(t,e,r)=>{"use strict";r.d(e,{M:()=>n});var n=function(){var t="undefined"!=typeof window&&window.navigator.userAgent.toLowerCase(),e=t&&/msie|trident/.test(t),r=t&&t.indexOf("msie 9.0")>0,n=t&&t.indexOf("edg/")>0,i=t&&/chrome\/\d+/.test(t)&&!n,o=t&&/phantomjs/.test(t),s=t&&/firefox\/\d+/.test(t),a=!!window.safari,c=!!window.navigator.brave,u=t&&t.indexOf("android")>0,l=t&&/iphone|ipad|ipod|ios/.test(t),f=t&&/\smac\s/.test(t),h=t&&/windows/.test(t),d=!1,p=window.matchMedia;p&&(d=p("(pointer:coarse)").matches);var g=window.ethereum;void 0===window.ethereum&&(g={isMetaMask:!1,isAlphaWallet:!1,isTrust:!1,isStatusWallet:!1,isGoWallet:!1});var y=d&&!!g.isAlphaWallet,m=d&&!!g.isTrust,b=d&&!!g.isStatusWallet,v=d&&!!g.isGoWallet,w=d&&!!g.isTrust&&!!g.isMetaMask,E=!!navigator.userAgent.match(/\simToken\//),A=d&&!!g.isMetaMask&&!m&&!c;return{iE:e,iE9:r,edge:n,chrome:i,phantomJS:o,fireFox:s,safari:a,android:u,iOS:l,mac:f,windows:h,touchDevice:d,metaMask:A,alphaWallet:y,mew:w,trust:m,goWallet:v,status:b,imToken:E,brave:c,braveAndroid:c&&u,braveIOS:c&&l,metaMaskAndroid:u&&A,alphaWalletAndroid:u&&y,mewAndroid:u&&w,imTokenAndroid:u&&E}}},951:(t,e,r)=>{"use strict";r.r(e),r.d(e,{SafeConnectAction:()=>i,SafeConnectProvider:()=>x});var n,i,o=r(42595),s=r(50284),a=r(77267),c=r(55050),u=r(52410),l=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},f=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]299||i.status<200))return[3,6];o=void 0,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,i.json()];case 3:return o=s.sent().error,[3,5];case 4:return s.sent(),o="HTTP Request error: "+i.statusText,[3,5];case 5:throw new Error(o);case 6:return[4,i.json()];case 7:return[2,s.sent()]}}))}))},t.createAndSignLinkAttestation=function(t,e,r){return l(this,void 0,void 0,(function(){var n;return f(this,(function(i){switch(i.label){case 0:return(n=new u.b).create(t,e,3600),[4,n.sign(r)];case 1:return i.sent(),[2,n.getBase64()]}}))}))},t.HOLDING_KEY_ALGORITHM="RSASSA-PKCS1-v1_5",t.keyStore=new s.t,t}(),d=(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=function(){return p=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{window.KeyshapeJS=function(){function t(t){return void 0!==t}function e(t,e){return t&&0==t.indexOf(e)}function r(t){var e,r={};for(e in t)r[e]=t[e];return r}function n(t){if(!isFinite(t))throw Error("Non-finite value")}function i(e){if(14>=e)return 16;var r=O[e];return r||(r=t(I[e])?0|(e.toLowerCase().indexOf("color")==e.length-5?48:0):1),r}function o(t){return 0<=t?Math.pow(t,1/3):-Math.pow(-t,1/3)}function s(t,e){if(48==t&&"number"==typeof e)return"rgba("+(e>>>24)+","+(e>>>16&255)+","+(e>>>8&255)+","+(255&e)/255+")";if(64==t)return e=e.map((function(t){return t+"px"})),e.join(",");if(96==t){t="";for(var r=e.length,n=0;n>>24)+","+(e[n+4]>>16&255)+","+(e[n+4]>>8&255)+","+(255&e[n+4])/255+")) ",n+=3):t=2==e[n]?t+"("+e[n+1]+"px) ":7==e[n]?t+"("+e[n+1]+"deg) ":t+"("+(0>e[n+1]?0:e[n+1])+") ",n+=2;return t}return 32==t?e+"px":e}function a(t){return 0>=t?0:255<=t?255:t}function c(t,e){t:{for(var r=t+e[2],n=e[4].length,i=0;ir-1)if(1==(n=e[6][r-1])[0])if(0>=t)t=0;else if(1<=t)t=1;else{i=n[1];var s=n[3];t=function(t,e,r,n){if(0==t)return e=0==e?-n/r:0<=(n=(-r+(t=Math.sqrt(r*r-4*e*n)))/(2*e))&&1>=n||0<=(n=(-r-t)/(2*e))&&1>=n?n:0,e;var i=r/t-e*e/(t*t)/3,s=(r=e*e*e/(t*t*t)/13.5-e*r/(t*t)/3+n/t)*r/4+i*i*i/27;if(e=-e/(3*t),0>=s){if(0==i&&0==r)return-o(n/t);if(t=Math.sqrt(r*r/4-s),n=Math.acos(-r/2/t),r=Math.cos(n/3),n=Math.sqrt(3)*Math.sin(n/3),0<=(i=2*(t=o(t))*r+e)&&1>=i)return i;if(0<=(i=-t*(r+n)+e)&&1>=i)return i;if(0<=(i=t*(n-r)+e)&&1>=i)return i}else{if(0<=(n=(t=o(-r/2+Math.sqrt(s)))+(r=o(-r/2-Math.sqrt(s)))+e)&&1>=n)return n;if(0<=(n=-(t+r)/2+e)&&1>=n)return n}return 0}(3*i-3*s+1,-6*i+3*s,3*i,-t),t=3*t*(1-t)*(1-t)*n[2]+3*t*t*(1-t)*n[4]+t*t*t}else 2==n[0]?(n=n[1],t=Math.ceil(t*n)/n):3==n[0]&&(n=n[1],t=Math.floor(t*n)/n);return function(t,e,r,n){if(16==t||32==t)return(r-e)*n+e;if(0==t)return.5>n?e:r;if(48==t){if("number"==typeof e&&"number"==typeof r){var i=1-n;return(a(i*(e>>>24)+n*(r>>>24))<<24|a(i*(e>>>16&255)+n*(r>>>16&255))<<16|a(i*(e>>>8&255)+n*(r>>>8&255))<<8|a(i*(255&e)+n*(255&r)))>>>0}return.5>n?e:r}if(64==t){0==e.length&&(e=[0]),0==r.length&&(r=[0]);var o=e.length;e.length!=r.length&&(o=e.length*r.length);var s=[];for(t=0;tu&&(u=0),s.push(u)}return s}if(96==t){if(e.length!=r.length)return.5>n?e:r;for(o=e.length,s=[],t=0;tn?e:r;for(s[t]=e[t],s[t+1]=[],c=0;cn?e:r;for(s=[],t=0;tn?e:r;if(s[t]=e[t],s[t+1]=(r[t+1]-e[t+1])*n+e[t+1],5==e[t]){s[t+2]=(r[t+2]-e[t+2])*n+e[t+2],s[t+3]=(r[t+3]-e[t+3])*n+e[t+3],i=1-n;var l=e[t+4],f=r[t+4];u=i*(l>>>24)+n*(f>>>24);var h=i*(l>>16&255)+n*(f>>16&255);c=i*(l>>8&255)+n*(f>>8&255),i=i*(255&l)+n*(255&f),s[t+4]=(a(h)<<16|a(c)<<8|a(i))+16777216*(0|a(u)),t+=3}t+=2}return s}return 0}(240&e[1],e[5][r-1],e[5][r],t)}function u(){T||(M=(new Date).getTime()+N)}function l(t){if(t||!B){for(var e=!1,r=0;r=i;++i)n[i]=0;if(n[10]=1,n[11]=1,r=r.getAttribute("transform")){for(i=(r=r.trim().split(") ")).length-2;0<=i;--i)if(e(r[i],"translate(")){for(var o=0;o=this.f?this.i?(this.c=M-this.g/this.b,this.i--,e=2):(e=1,this.a=t?r:this.s?Math.max(this.s,this.f):this.f):0>this.b&&null!==r&&r<=this.g?this.i&&1/0!=this.f?(this.c=M-this.f/this.b,this.i--,e=2):(this.i=0,e=1,this.a=t?r:this.s?Math.min(this.s,this.g):this.g):null!==r&&0!=this.b&&(t&&null!==this.a&&(this.c=M-this.a/this.b),this.a=null)}return this.s=this.l(),e},J:function(t){if(t&&(this.o&&(this.o=!1,null===this.c&&(0!=this.b&&null!==this.a?(this.c=M-this.a/this.b,this.a=null):this.c=M)),null===this.a&&null!==this.c&&(0!=(t=this.B(!1))&&L.push([this,t]))),null===(t=this.l()))return!1;for(var e=this.A,r=this.C,n=0;n=f+u[3]?0==u[3]%d?u[5][h-1]:c(u[3]%d,u):c((t-f)%d,u),0==l?(i._ks.mpath=u[8],i._ks.transform[l]=f,o=!0):14>=l?(i._ks.transform[l]=f,o=!0):(f=s(240&u[1],f),1&u[1]?i.setAttribute(l,f):i.style[l]=f)}}if(o){for(g(o=i),a=o._ks.transform,u="",(l=o._ks.mpath)&&(0>(h=a[0])&&(h=0),100h?(h=f,f=l[1].getPointAtLength(.5)):h=l[1].getPointAtLength(h-.5),u+="rotate("+180*Math.atan2(f.y-h.y,f.x-h.x)/Math.PI+") ")),l=1;l=l?u+(1==l?f+",0":"0,"+f):13<=l?u+(13==l?f+",0":"0,"+f):10<=l?u+(10==l?f+",1":"1,"+f):u+f,u+=")");o.setAttribute("transform",u)}_&&i.setAttribute("opacity",i.getAttribute("opacity"))}return"running"==this.m()},I:function(){!1!==this.h.autoremove&&"finished"==this.m()&&E(this)},D:function(){if(!this.F){this.F=!0;for(var t=this.A,e=this.C,r=0;r=e[r][i][0]&&g(n)}},u:function(e){if("number"==typeof e)return e;if(!t(this.h.markers)||!t(this.h.markers[e]))throw Error("Invalid marker: "+e);return+this.h.markers[e]},play:function(e){if(t(e)&&null!==e&&(n(e=this.u(e)),0>this.b&&ethis.f&&(e=this.f),this.w(e,!0)),!this.j)throw A;if(e=this.l(),0=this.f))this.a=this.g;else if(0>this.b&&(null===e||e<=this.g)){if(1/0==this.f)throw Error("Cannot seek to Infinity");this.a=this.f}else 0==this.b&&null===e&&(this.a=this.g);return null===this.a||(this.c=null,this.o=!0,this.D(),h()),this},pause:function(e){if(!this.j)throw A;if(t(e)&&n(e=this.u(e)),"paused"!=this.m()){u();var r=this.l();if(null===r)if(0<=this.b)this.a=this.g;else{if(1/0==this.f)throw Error("Cannot seek to Infinity");this.a=this.f}null!==this.c&&null===this.a&&(this.a=r),this.c=null,this.o=!1,this.B(!1),this.D(),h()}return t(e)&&this.w(e,!0),this},range:function(e,r){if(0==arguments.length)return{in:this.g,out:this.f};var i=this.u(e),o=this.v;if(t(r)&&(o=this.u(r)),n(i),0>i||0>o||i>=o||isNaN(o))throw Error("Invalid range");var s=this.m();return this.g=i,this.f=o,"finished"==s&&"running"==this.m()&&this.play(),this},loop:function(e){return t(e)?(this.i=!0===e?1/0:Math.floor(e),(0>this.i||isNaN(this.i))&&(this.i=0),this):{count:this.i}},l:function(){return null!==this.a?this.a:null===this.c?null:(M-this.c)*this.b},w:function(t,e){e&&u(),null!==t&&(this.D(),null!==this.a||null===this.c||0==this.b?(this.a=t,l(!1)):this.c=M-t/this.b,this.j||(this.c=null),this.s=null,this.B(!0),h())},G:function(){return this.l()},time:function(e){if(t(e)){if(!this.j)throw A;return n(e=this.u(e)),this.w(e,!0),this}return this.G()},m:function(){var t=this.l();return this.o?"running":null===t?"idle":null===this.c?"paused":0=this.f||0>this.b&&t<=this.g?"finished":"running"},state:function(){return this.m()},duration:function(){return this.v},H:function(t){n(t),u();var e=this.l();this.b=t,null!==e&&this.w(e,!1)},rate:function(e){return t(e)?(this.H(e),this):this.b},markers:function(e){return t(e)?(this.h.markers=r(e),this):t(this.h.markers)?this.h.markers:{}},marker:function(e){return t(this.h.markers)?this.h.markers[e]:void 0},_cancel:function(){return this.j&&"idle"!=this.m()?(this.c=this.a=null,this.o=!1,this):this}},{version:"1.1.1",animate:function(){var o={};1==arguments.length%2&&(o=r(arguments[arguments.length-1])),o=new y(o);for(var s=arguments,a=0,c=0;cA.length)throw Error("Not enough times");if(A=A.slice(),!isFinite(A[0])||0>A[0])throw Error("Invalid time: "+A[0]);for(var k=1;kA[k]||A[k]T&&(T=1),a<(P*=T)+k&&(a=P+k);var _=m(p,"v","values");if(!_||_.length!=A.length)throw Error("Values do not match times");for(var I=g,B=_=_.slice(),M=240&i(I),N=0;Nj&&(j=R.length-1),F=R.substring(F+1,j).split(" "),5==D?(U.push(parseFloat(F[0])),U.push(parseFloat(F[1])),U.push(parseFloat(F[2])),U.push(v(F[3]))):1==D?U.push(F[0]):U.push(parseFloat(F[0])),F=(R=R.substring(j+1).trim()).indexOf("(")}R=U}C[L]=R}else 64==M?"none"!=B[N]?/^[0-9 .]*$/.test(B[N])?B[N]=d(B[N]," "):(console.warn("unsupported value: "+B[N]),B[N]=[0]):B[N]=[0]:32==M?(n(B[N]),B[N]=parseFloat(B[N])):0===I&&(B[N]=parseFloat(B[N]));for(I=m(p,"e","easing"),B=A.length,I||(I=[]);I.length{},27912:()=>{},9278:()=>{},46601:()=>{},89214:()=>{},85568:()=>{},24654:()=>{},84102:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Authenticator=void 0;const n=r(58204),i=r(65185),o=r(55050),s=r(80716),a=r(58015),c=r(5393),u=r(94807),l=r(92219),f=r(73506),h=r(3365),d=r(69112),p=r(49674),g=r(22110),y=r(95899),m=r(81453),b=r(19421),v=r(27309);let w;w="object"==typeof crypto&&crypto.subtle?crypto.subtle:r(9278).webcrypto.subtle;class E{static decodePublicKey(t){return i.KeyPair.publicFromBase64orPEM(t)}static async getUseTicket(t,e,r,c,u,l){let f,h,d;try{l=i.KeyPair.parseKeyArrayStrings(l)}catch(t){throw(0,o.logger)(b.DEBUGLEVEL.LOW,t),new Error("Issuer key error")}if(!r)throw new Error("Ticket is empty");if(f=n.Ticket.fromBase64(r,l),!f.checkValidity())throw(0,o.logger)(b.DEBUGLEVEL.LOW,"Could not validate ticket"),new Error("Ticket Validation failed");if(!f.verify())throw(0,o.logger)(b.DEBUGLEVEL.LOW,"Could not verify ticket"),new Error("Ticket Verification failed");if((0,o.logger)(b.DEBUGLEVEL.MEDIUM,"ticked valid (signature OK)"),!u)throw new Error("Attesator key not defined");try{d=i.KeyPair.publicFromBase64orPEM(u)}catch(t){throw new Error("Attesator key read error")}try{h=s.SignedIdentifierAttestation.fromBytes((0,o.base64ToUint8array)(c),d)}catch(t){throw new Error("IDAttestation decode error")}if(!h.checkValidity())throw new Error("IDAttestation Validation failed");if(!h.verify())throw new Error("IDAttestation Verification failed");(0,o.logger)(b.DEBUGLEVEL.HIGH,"attestation valid");try{let r=new a.AttestedObject;r.create(f,h,BigInt(e),BigInt(t));let n=r.getDerEncoding();return(0,o.logger)(b.DEBUGLEVEL.HIGH,n),(0,o.hexStringToBase64)(n)}catch(t){throw(0,o.logger)(b.DEBUGLEVEL.MEDIUM,"getUseTicket: redeem failed",t),new Error("Attestation doesnt fit Ticket: "+t.message)}}static validateUseTicket(t,e,r,s){let c=i.KeyPair.publicFromBase64orPEM(e),u=i.KeyPair.parseKeyArrayStrings(r);try{let e=a.AttestedObject.fromBytes((0,o.base64ToUint8array)(t),v.UseToken,c,n.Ticket,u);if((0,o.logger)(b.DEBUGLEVEL.LOW,"Verified attested object"),!e.checkValidity(s))throw new Error("Ticket validity check failed!")}catch(t){let e="Ticket proof validation failed! "+t.message;throw(0,o.logger)(b.DEBUGLEVEL.MEDIUM,e),new Error(e)}}static async requestAttest(t,e,r,n,i=null){let s,a=new c.AttestationCrypto;if(i)s=i.getAddress();else try{s=await d.SignatureUtility.connectMetamaskAndGetAddress()}catch(t){return(0,o.logger)(b.DEBUGLEVEL.LOW,"Cant find user Ethereum Address. Please check Metamask. "+t),void(0,o.logger)(b.DEBUGLEVEL.MEDIUM,t)}let h=await l.Nonce.makeNonce(s,r);(0,o.logger)(b.DEBUGLEVEL.HIGH,"nonce = "+(0,o.uint8tohex)(h));let p=a.computeAttestationProof(n,h),g=u.AttestationRequest.fromData(a.getType(e),p),y=new f.Eip712AttestationRequest(i);return await y.addData(r,2e4,t,g),y.getJsonEncoding()}static constructAttest(t,e,r,n,i,a=""){let u,l,d,p=new c.AttestationCrypto;try{l=new f.Eip712AttestationRequest,l.setDomain(i),a&&l.setUsageValue(a),l.fillJsonData(n),E.checkAttestRequestVerifiability(l),E.checkAttestRequestValidity(l)}catch(t){let e="Failed to fill attestation data from json. "+t+"\nRestores as an Eip712AttestationRequestWithUsage object instead";(0,o.logger)(b.DEBUGLEVEL.MEDIUM,e);try{l=new y.Eip712AttestationRequestWithUsage,l.setDomain(i),l.fillJsonData(n),E.checkAttestRequestVerifiability(l),E.checkAttestRequestValidity(l)}catch(t){let e="Failed to parse Eip712AttestationRequestWithUsage. "+t;throw(0,o.logger)(b.DEBUGLEVEL.LOW,e),(0,o.logger)(b.DEBUGLEVEL.MEDIUM,t),new Error(e)}}d=p.makeCommitmentFromHiding(l.getIdentifier(),l.getType(),l.getPok().getRiddle()),u=new h.IdentifierAttestation,u.fromCommitment(d,l.getUserPublicKey()),u.setIssuer("CN="+e),u.setSerialNumber(Math.round(Math.random()*Number.MAX_SAFE_INTEGER));let g=Date.now();return u.setNotValidBefore(g),u.setNotValidAfter(g+r),s.SignedIdentifierAttestation.fromData(u,t).getDerEncoding()}static async useAttest(t,e,r,n,i,a,u=null,f=null){const h=(0,o.base64ToUint8array)(t);let y,m=s.SignedIdentifierAttestation.fromBytes(h,r),v=(0,o.base64ToUint8array)(e),w=(0,o.uint8ToBn)(v.slice(4)),E=new c.AttestationCrypto;y=f?f.getAddress():await d.SignatureUtility.connectMetamaskAndGetAddress();let A=await l.Nonce.makeNonce(y,a),S=E.computeAttestationProof(w,A);try{let t=p.UseAttestation.fromData(m,E.getType(i),S,u),e=new g.Eip712AttestationUsage(f),r=await e.addData(a,n,t);return(0,o.logger)(b.DEBUGLEVEL.HIGH,"usageRequest ready state = "+r),(0,o.logger)(b.DEBUGLEVEL.HIGH,"usageRequest.getJsonEncoding() = "+e.getJsonEncoding()),e.getJsonEncoding()}catch(t){(0,o.logger)(b.DEBUGLEVEL.LOW,t)}}static checkAttestRequestVerifiability(t){if(!t.verify())throw(0,o.logger)(b.DEBUGLEVEL.MEDIUM,"Could not verify attestation signing request"),new Error("Verification failed")}static checkAttestRequestValidity(t){if(!t.checkValidity())throw(0,o.logger)(b.DEBUGLEVEL.HIGH,"Could not validate attestation signing request"),new Error("Validation failed")}static checkUsageVerifiability(t){if(!t.verify())throw(0,o.logger)(b.DEBUGLEVEL.LOW,"Could not verify usage request"),new Error("Verification failed")}static checkUsageValidity(t){if(!t.checkTokenValidity())throw(0,o.logger)(b.DEBUGLEVEL.LOW,"Could not validate usage request"),new Error("Validation failed")}static async verifyUsage(t,e,r,n,s){let a;try{let r=new g.Eip712AttestationUsage;r.setDomain(n),r.fillJsonData(t,e),E.checkUsageVerifiability(r),E.checkUsageValidity(r),a=r.getSessionPublicKey()}catch(e){(0,o.logger)(b.DEBUGLEVEL.MEDIUM,"Eip712AttestationUsage failed. "+e+". Lets try to verify Eip712AttestationRequestWithUsage");let r=new y.Eip712AttestationRequestWithUsage;r.setDomain(n),r.fillJsonData(t),E.checkUsageVerifiability(r),E.checkUsageValidity(r),a=r.getSessionPublicKey(),(0,o.logger)(b.DEBUGLEVEL.HIGH,"sessionPublicKey from Eip712AttestationRequestWithUsage = "+a.getAddress())}try{if(!await a.verifyStringWithSubtle(i.KeyPair.anySignatureToRawUint8(s),r))throw(0,o.logger)(b.DEBUGLEVEL.MEDIUM,"Could not verify message signature"),new Error("Signature verification failed");return"SUCCESSFULLY validated usage request!"}catch(t){let e="Cant verify session with subtle. "+t;(0,o.logger)(b.DEBUGLEVEL.LOW,e),(0,o.logger)(b.DEBUGLEVEL.MEDIUM,t)}}static async requestAttestAndUsage(t,e,r,n,i,s){try{let a,u=(0,o.uint8ToBn)((0,o.base64ToUint8array)(i));a=t?t.getAddress():await d.SignatureUtility.connectMetamaskAndGetAddress();let f=await l.Nonce.makeNonce(a,n,new Uint8Array(0),Date.now()),h=new c.AttestationCrypto,p=h.computeAttestationProof(u,f),g=m.AttestationRequestWithUsage.fromData(h.getType(r),p,s),v=new y.Eip712AttestationRequestWithUsage(t);return await v.fromData(n,void 0,void 0,e,g),(0,o.logger)(b.DEBUGLEVEL.HIGH,"request.getJsonEncoding() = "+v.getJsonEncoding()),v.getJsonEncoding()}catch(t){let e="requestAttestAndUsage error. "+t;(0,o.logger)(b.DEBUGLEVEL.LOW,e),(0,o.logger)(b.DEBUGLEVEL.MEDIUM,t)}}static validateTicket(t,e,r){let s,a={};try{a[e]=i.KeyPair.publicFromBase64orPEM(r)}catch(t){return{valid:!1,massage:"Broken Public Key"}}try{s=n.Ticket.fromBase64(t,a)}catch(t){return(0,o.logger)(b.DEBUGLEVEL.LOW,t),{valid:!1,massage:"Wrong Ticket"}}return{valid:!0,ticketId:s.getTicketId(),ticketClass:s.getTicketClass()}}}e.Authenticator=E},58204:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Ticket=void 0;const n=r(5393),i=r(13649),o=r(4625),s=r(55050),a=r(79896),c=r(96858);class u extends o.AttestableObject{constructor(){super(),this.magicLinkURLPrefix="https://ticket.devcon.org/",this.isLegasy=!1}fromData(t,e,r,n){this.ticketId=e,this.ticketClass=r,this.devconId=t,this.keys=n,this.key=n[t]}createWithCommitment(t,e,r,n,i,o){if(this.fromData(t,e,r,o),this.commitment=n,this.signature=i,this.encoded=this.encodeSignedTicket(this.makeTicket()),!this.verify())throw new Error("Ticket Signature is invalid")}static createWithMail(t,e,r,i,o,a){let c=new this;c.fromData(e,r,i,o);let u,l=new n.AttestationCrypto;try{c.commitment=l.makeCommitment(t,l.getType("mail"),a);let e=c.makeTicket();u=c.key.signRawBytesWithEthereum((0,s.hexStringToArray)(e))}catch(t){throw new Error(t)}return c.createWithCommitment(e,r,i,c.commitment,u,o),c}makeTicket(){let t;try{const e=BigInt(this.ticketId);t=i.Asn1Der.encode("INTEGER",e)}catch(e){t=i.Asn1Der.encode("UTF8STRING",this.ticketId)}let e=i.Asn1Der.encode("UTF8STRING",this.devconId)+t+i.Asn1Der.encode("INTEGER",this.ticketClass);return this.isLegasy||(e+=i.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.commitment))),i.Asn1Der.encode("SEQUENCE_30",e)}encodeSignedTicket(t){return this.isLegasy&&(t+=i.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.commitment))),t+=i.Asn1Der.encode("BIT_STRING",this.signature),i.Asn1Der.encode("SEQUENCE_30",t)}getDerEncodingWithPK(){let t=this.makeTicket()+i.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.commitment))+this.key.getAsnDerPublic()+i.Asn1Der.encode("BIT_STRING",this.signature);return i.Asn1Der.encode("SEQUENCE_30",t)}getDerEncoding(){return this.encoded}verify(){return this.key.verifyBytesWithEthereum((0,s.hexStringToArray)(this.makeTicket()),this.signature)}checkValidity(){return!0}getTicketId(){return this.ticketId}getTicketClass(){return this.ticketClass}getSignature(){return this.signature}static fromBase64(t,e){let r=new this;return r.fromBytes((0,s.base64ToUint8array)(t),e),r}fromBytes(t,e){const r=c.AsnParser.parse(t,a.SignedDevconTicket);let n=r.ticket.devconId;if(!e||!e[n])throw new Error("Issuer key not defined.");this.key=e[n];let i,o=r.ticket.ticketIdNumber,u=o?o.toString():r.ticket.ticketIdString,l=r.ticket.ticketClass;r.ticket.commitment?i=r.ticket.commitment:(i=r.commitment,this.isLegasy=!0);let f=r.signatureValue;this.createWithCommitment(n,u,l,new Uint8Array(i),(0,s.uint8tohex)(new Uint8Array(f)),e)}getCommitment(){return this.commitment}getKey(){return this.key}getUrlEncoding(){}}e.Ticket=u},54759:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.MyAttestationDecoded=e.MyAttestation=e.SignedInfo=e.SmartContract=e.Payload=e.PrivateKeyInfo=e.PrivateKeyData=e.SubjectPublicKeyInfo=e.PublicKeyInfoValue=void 0;const i=r(96858),o=r(93312),s=r(83458);class a{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],a.prototype,"algorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],a.prototype,"publicKey",void 0),e.PublicKeyInfoValue=a;let c=class{constructor(){this.null=!1}};n([(0,i.AsnProp)({type:a})],c.prototype,"value",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],c.prototype,"null",void 0),c=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],c),e.SubjectPublicKeyInfo=c;class u{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],u.prototype,"one",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],u.prototype,"privateKey",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any,context:0})],u.prototype,"algDescr",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString,context:1})],u.prototype,"publicKey",void 0),e.PrivateKeyData=u;class l{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],l.prototype,"one",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],l.prototype,"algIdent",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],l.prototype,"keysData",void 0),e.PrivateKeyInfo=l;let f=class{};n([(0,i.AsnProp)({type:o.Extensions,context:3})],f.prototype,"extensions",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any,context:4})],f.prototype,"dataObject",void 0),f=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],f),e.Payload=f;class h{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],h.prototype,"value",void 0),e.SmartContract=h;class d{}n([(0,i.AsnProp)({type:o.Version})],d.prototype,"version",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],d.prototype,"serialNumber",void 0),n([(0,i.AsnProp)({type:o.AlgorithmIdentifierASN})],d.prototype,"signature",void 0),n([(0,i.AsnProp)({type:s.Name})],d.prototype,"issuer",void 0),n([(0,i.AsnProp)({type:o.ValidityValue,optional:!0})],d.prototype,"validity",void 0),n([(0,i.AsnProp)({type:s.Name})],d.prototype,"subject",void 0),n([(0,i.AsnProp)({type:c})],d.prototype,"subjectPublicKeyInfo",void 0),n([(0,i.AsnProp)({type:h,optional:!0})],d.prototype,"contract",void 0),n([(0,i.AsnProp)({type:f,optional:!0})],d.prototype,"attestsTo",void 0),e.SignedInfo=d;class p{constructor(){this.signedInfo=new Uint8Array}}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],p.prototype,"signedInfo",void 0),n([(0,i.AsnProp)({type:o.AlgorithmIdentifierASN})],p.prototype,"signatureAlgorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],p.prototype,"signatureValue",void 0),e.MyAttestation=p;class g{}n([(0,i.AsnProp)({type:d})],g.prototype,"signedInfo",void 0),n([(0,i.AsnProp)({type:o.AlgorithmIdentifierASN})],g.prototype,"signatureAlgorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],g.prototype,"signatureValue",void 0),e.MyAttestationDecoded=g},61709:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Identifier=void 0;const i=r(96858),o=r(61538);class s{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],s.prototype,"type",void 0),n([(0,i.AsnProp)({type:o.Proof})],s.prototype,"proof",void 0),e.Identifier=s},84962:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Identifier=void 0;const i=r(96858),o=r(61538),s=r(54759);class a{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],a.prototype,"type",void 0),n([(0,i.AsnProp)({type:o.Proof})],a.prototype,"proof",void 0),n([(0,i.AsnProp)({type:s.PublicKeyInfoValue})],a.prototype,"sessionKey",void 0),e.Identifier=a},93312:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Extensions=e.Extension=e.ValidityValue=e.Version=e.AlgorithmIdentifierASN=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.ObjectIdentifier})],o.prototype,"algorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any,optional:!0})],o.prototype,"parameters",void 0),e.AlgorithmIdentifierASN=o;class s{constructor(){this.version=0}}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],s.prototype,"version",void 0),e.Version=s;let a=class{};n([(0,i.AsnProp)({type:i.AsnPropTypes.UTCTime})],a.prototype,"utcTime",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.GeneralizedTime})],a.prototype,"generalizedTime",void 0),a=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],a);class c{}n([(0,i.AsnProp)({type:a})],c.prototype,"notBefore",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,optional:!0})],c.prototype,"notBeforeInt",void 0),n([(0,i.AsnProp)({type:a})],c.prototype,"notAfter",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,optional:!0})],c.prototype,"notAfterInt",void 0),e.ValidityValue=c;let u=class{};n([(0,i.AsnProp)({type:c,context:0})],u.prototype,"value",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,context:1})],u.prototype,"null",void 0),u=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],u);class l{}n([(0,i.AsnProp)({type:i.AsnPropTypes.ObjectIdentifier})],l.prototype,"extnId",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Boolean})],l.prototype,"critical",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],l.prototype,"extnValue",void 0),e.Extension=l;class f{}n([(0,i.AsnProp)({type:l})],f.prototype,"extension",void 0),e.Extensions=f},35403:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.EpochTimeValidity=void 0;const i=r(96858),o=r(12858),s={fromASN:t=>{if(t.valueBlock.valueHex.byteLength>4)return t.valueBlock.toString();return new DataView(t.valueBlock.valueHex,0).getUint32(0)},toASN:t=>new o.Integer({value:t})};class a{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,converter:s})],a.prototype,"notBefore",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,converter:s})],a.prototype,"notAfter",void 0),e.EpochTimeValidity=a},95978:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.EthereumAddressAttestation=void 0;const i=r(96858),o=r(35403);class s{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],s.prototype,"subjectPublicKey",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"ethereumAddress",void 0),n([(0,i.AsnProp)({type:o.EpochTimeValidity})],s.prototype,"validity",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],s.prototype,"context",void 0),e.EthereumAddressAttestation=s},42909:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.SignedEthereumKeyLinkingAttestation=e.EthereumKeyLinkingAttestation=void 0;const i=r(96858),o=r(35403),s=r(93312),a=r(52551);class c{}n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],c.prototype,"subjectEthereumAddress",void 0),n([(0,i.AsnProp)({type:a.SignedLinkedAttestation})],c.prototype,"linkedAttestation",void 0),n([(0,i.AsnProp)({type:o.EpochTimeValidity})],c.prototype,"validity",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],c.prototype,"context",void 0),e.EthereumKeyLinkingAttestation=c;class u{}n([(0,i.AsnProp)({type:c})],u.prototype,"ethereumKeyLinkingAttestation",void 0),n([(0,i.AsnProp)({type:s.AlgorithmIdentifierASN})],u.prototype,"signingAlgorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],u.prototype,"signatureValue",void 0),e.SignedEthereumKeyLinkingAttestation=u},83458:function(t,e,r){"use strict";var n,i,o=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Name=e.AttributeTypeAndValue=void 0;const s=r(96858);class a{}o([(0,s.AsnProp)({type:s.AsnPropTypes.ObjectIdentifier})],a.prototype,"type",void 0),o([(0,s.AsnProp)({type:s.AsnPropTypes.Utf8String})],a.prototype,"value",void 0),e.AttributeTypeAndValue=a;let c=n=class extends s.AsnArray{constructor(t){super(t),Object.setPrototypeOf(this,n.prototype)}};c=n=o([(0,s.AsnType)({type:s.AsnTypeTypes.Set,itemType:a})],c);let u=i=class extends s.AsnArray{constructor(t){super(t),Object.setPrototypeOf(this,i.prototype)}};u=i=o([(0,s.AsnType)({type:s.AsnTypeTypes.Sequence,itemType:c})],u);let l=class{};o([(0,s.AsnProp)({type:u})],l.prototype,"rdnSequence",void 0),o([(0,s.AsnProp)({type:s.AsnPropTypes.Null})],l.prototype,"null",void 0),l=o([(0,s.AsnType)({type:s.AsnTypeTypes.Choice})],l),e.Name=l},83874:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.NFTOwnershipAttestation=e.ERC721=void 0;const i=r(96858),o=r(35403);class s{}n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"address",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],s.prototype,"chainId",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0,repeated:"sequence"})],s.prototype,"tokenIds",void 0),e.ERC721=s;class a{constructor(){this.tokens=[]}}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],a.prototype,"subjectPublicKey",void 0),n([(0,i.AsnProp)({type:s,repeated:"sequence"})],a.prototype,"tokens",void 0),n([(0,i.AsnProp)({type:o.EpochTimeValidity})],a.prototype,"validity",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],a.prototype,"context",void 0),e.NFTOwnershipAttestation=a},61538:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.UsageProof=e.Proof=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],o.prototype,"riddle",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],o.prototype,"challengePoint",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],o.prototype,"responseValue",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],o.prototype,"nonce",void 0),e.Proof=o;class s{}n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"challengePoint",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"responseValue",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"nonce",void 0),e.UsageProof=s},8573:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Signature=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],o.prototype,"r",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],o.prototype,"s",void 0),e.Signature=o},79896:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.SignedDevconTicket=e.DevconTicket=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Utf8String})],o.prototype,"devconId",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,optional:!0})],o.prototype,"ticketIdNumber",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Utf8String,optional:!0})],o.prototype,"ticketIdString",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],o.prototype,"ticketClass",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],o.prototype,"commitment",void 0),e.DevconTicket=o;class s{}n([(0,i.AsnProp)({type:o})],s.prototype,"ticket",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],s.prototype,"commitment",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],s.prototype,"signatureValue",void 0),e.SignedDevconTicket=s},52551:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.SignedLinkedAttestation=e.LinkedAttestation=void 0;const i=r(96858),o=r(93312),s=r(83874),a=r(95978);let c=class{};n([(0,i.AsnProp)({type:s.NFTOwnershipAttestation,context:0})],c.prototype,"nftOwnership",void 0),n([(0,i.AsnProp)({type:a.EthereumAddressAttestation,context:1})],c.prototype,"ethereumAddress",void 0),c=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],c),e.LinkedAttestation=c;class u{}n([(0,i.AsnProp)({type:c})],u.prototype,"attestation",void 0),n([(0,i.AsnProp)({type:o.AlgorithmIdentifierASN})],u.prototype,"signingAlgorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],u.prototype,"signatureValue",void 0),e.SignedLinkedAttestation=u},91462:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.UseAttestation=void 0;const i=r(96858),o=r(61538),s=r(54759);class a{}n([(0,i.AsnProp)({type:s.MyAttestation})],a.prototype,"attestation",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],a.prototype,"type",void 0),n([(0,i.AsnProp)({type:o.Proof})],a.prototype,"proof",void 0),n([(0,i.AsnProp)({type:s.PublicKeyInfoValue})],a.prototype,"sessionKey",void 0),e.UseAttestation=a},27309:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.UseToken=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],o.prototype,"signedToken",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],o.prototype,"attestation",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],o.prototype,"proof",void 0),e.UseToken=o},19421:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEBUGLEVEL=void 0,e.DEBUGLEVEL={LOW:1,MEDIUM:2,HIGH:3,VERBOSE:4}},72353:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XMLconfigData=void 0;const n=r(79896),i=r(65185);e.XMLconfigData={attestationOrigin:"http://stage.attestation.id",tokensOrigin:"https://devcontickets.herokuapp.com/outlet/",tokenUrlName:"ticket",tokenSecretName:"secret",unsignedTokenDataName:"ticket",tokenParser:n.SignedDevconTicket,localStorageItemName:"dcTokens",base64senderPublicKeys:{6:i.KeyPair.publicFromBase64orPEM("-----BEGIN PUBLIC KEY-----\nMIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA////////////////\n/////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5m\nfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0\nSKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFB\nAgEBA0IABJUMfAvtI8PKxcwxu7mq2btVMjh4gmcKwrHN8HmasOvHZMJn9wTo/doH\nlquDl6TSEBAk0kxO//aVs6QX8u0OSM0=\n-----END PUBLIC KEY-----"),26:i.KeyPair.publicFromBase64orPEM("-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEQKYTwFMIzSq1QVxoRKoOZXLQ9mUhce8M\ndIzvJx3unbpR3m3TiuWKZKTP4/XCPnS56d1tAhjM43hHjHbZ0k3RKQ==\n-----END PUBLIC KEY-----")},base64attestorPubKey:"MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABL+y43T1OJFScEep69/yTqpqnV/jzONz9Sp4TEHyAJ7IPN9+GHweCX1hT4OFxt152sBN3jJc1s0Ymzd8pNGZNoQ=",webDomain:"devcon.org"}},68810:(t,e,r)=>{"use strict";e._F=void 0;var n=r(84102);Object.defineProperty(e,"_F",{enumerable:!0,get:function(){return n.Authenticator}});var i=r(73506);var o=r(5393)},4625:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestableObject=void 0;e.AttestableObject=class{constructor(){}getDerEncoding(){return this.encoded}getCommitment(){return this.commitment}}},86085:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Attestation=void 0;const n=r(55050),i=r(96858),o=r(54759),s=r(65185),a=r(13649),c=r(54288),u=r(19421);class l{constructor(){this.version=18,this.blockchainFriendly=!0}parseNames(t){let e={};Object.keys(a.X500NamesLabels).forEach((t=>{e[a.X500NamesLabels[t].toLowerCase()]=t}));let r=[];return t.forEach((t=>{let n=e[t.type.toString().toLowerCase()];if(!n)throw new Error(`X500 with name ${t.type.toString()} not implemented yet.`);r.push(`${n}="${t.value}"`)})),r.join(",")}fromBytes(t){const e=this;let r=i.AsnParser.parse(t,o.SignedInfo);e.signedInfo=t,e.version=r.version.version,e.serialNumber=r.serialNumber,e.signingAlgorithm=r.signature.algorithm.toString(),r.validity&&(e.notValidBefore=r.validity.notBefore.generalizedTime.getTime(),e.notValidAfter=r.validity.notAfter.generalizedTime.getTime(),void 0===r.validity.notBeforeInt||void 0===r.validity.notAfterInt?this.blockchainFriendly=!1:this.blockchainFriendly=!0);let n=r.subject.rdnSequence;e.subject="",n&&n[0]&&n[0].length&&(e.subject=this.parseNames(n[0])),e.subjectKey=s.KeyPair.publicFromSubjectPublicKeyInfo(r.subjectPublicKeyInfo);let a=r.issuer.rdnSequence;if(e.issuer="",a.length&&(e.issuer=this.parseNames(a[0])),r.contract&&(e.smartcontracts=r.contract),r.attestsTo&&r.attestsTo.extensions)e.extensions=r.attestsTo.extensions,e.commitment=new Uint8Array(e.extensions.extension.extnValue);else if(r.attestsTo&&r.attestsTo.dataObject)throw new Error("Implement parse dataObject")}isValidX509(){return 0!=this.version&&1!=this.version&&2!=this.version?((0,n.logger)(u.DEBUGLEVEL.LOW,"Incorrect version number"),!1):this.issuer?null==this.notValidBefore||null==this.notValidAfter?((0,n.logger)(u.DEBUGLEVEL.LOW,"Validity period not set"),!1):null==this.subject?((0,n.logger)(u.DEBUGLEVEL.LOW,"Subject info not set"),!1):this.subjectKey?null!=this.smartcontracts?((0,n.logger)(u.DEBUGLEVEL.LOW,"Smart contract info set"),!1):null!=this.dataObject?((0,n.logger)(u.DEBUGLEVEL.LOW,"Data object set"),!1):null!=this.version&&null!=this.serialNumber&&null!=this.signingAlgorithm||((0,n.logger)(u.DEBUGLEVEL.LOW,"Version, serial number, subject or algorithm missing"),!1):((0,n.logger)(u.DEBUGLEVEL.LOW,"No subject public key info set"),!1):((0,n.logger)(u.DEBUGLEVEL.LOW,"Issuer info not set"),!1)}getDerEncoding(){if(this.signedInfo||(this.signedInfo=this.getPrehash()),!this.signedInfo)throw new Error("Empty Attestaion Der Encoding");return(0,n.uint8tohex)(new Uint8Array(this.signedInfo))}getCommitment(){return this.commitment}getNotValidBefore(){return this.notValidBefore}setNotValidBefore(t){this.notValidBefore=t}getNotValidAfter(){return this.notValidAfter}setNotValidAfter(t){this.notValidAfter=t}getSubjectPublicKeyInfo(){return this.subjectKey}checkValidity(){if(null==this.version)return(0,n.logger)(u.DEBUGLEVEL.LOW,"Attest version missed"),!1;if(null==this.serialNumber)return(0,n.logger)(u.DEBUGLEVEL.LOW,"Attest serial number missed"),!1;if(null==this.subject)return(0,n.logger)(u.DEBUGLEVEL.LOW,"Attest subject missed"),!1;if(null==this.signingAlgorithm)return(0,n.logger)(u.DEBUGLEVEL.LOW,"Attest signing algorithm missed"),!1;let t=this.getNotValidBefore(),e=this.getNotValidAfter(),r=new c.Timestamp(t);return r.setValidity(e-t),!!r.validateAgainstExpiration(e)&&(null==this.extensions||null==this.dataObject||((0,n.logger)(u.DEBUGLEVEL.LOW,"Both Extensions and dataObject not allowed"),!1))}getExtensions(){return this.extensions}setVersion(t){this.version=t}getVersion(){return this.version}setSubject(t){this.subject=t}getSubject(){return this.subject}setSigningAlgorithm(t){this.signingAlgorithm=t}getPrehash(){if(!this.checkValidity())return null;let t=a.Asn1Der.encode("TAG",a.Asn1Der.encode("INTEGER",this.version),0)+a.Asn1Der.encode("INTEGER",this.serialNumber)+a.Asn1Der.encodeObjectId(this.signingAlgorithm);if(t+=this.issuer?a.Asn1Der.encodeName(this.issuer):a.Asn1Der.encode("NULL_VALUE",""),null!=this.notValidAfter&&null!=this.notValidBefore){let e=a.Asn1Der.encode("GENERALIZED_TIME",this.notValidBefore)+(this.blockchainFriendly?a.Asn1Der.encode("INTEGER",Math.floor(this.notValidBefore/1e3)):"")+a.Asn1Der.encode("GENERALIZED_TIME",this.notValidAfter)+(this.blockchainFriendly?a.Asn1Der.encode("INTEGER",Math.floor(this.notValidAfter/1e3)):"");t+=a.Asn1Der.encode("SEQUENCE_30",e)}else t+=a.Asn1Der.encode("NULL_VALUE","");return t+=this.subject?a.Asn1Der.encodeName(this.subject):a.Asn1Der.encode("NULL_VALUE",""),t+=this.subjectKey?this.subjectKey.getAsnDerPublic():a.Asn1Der.encode("NULL_VALUE",""),null!=this.smartcontracts&&(t+=this.smartcontracts),null!=this.extensions&&(t+=a.Asn1Der.encode("TAG",a.Asn1Der.encode("SEQUENCE_30",a.Asn1Der.encode("SEQUENCE_30",this.extensions)),3)),null!=this.dataObject&&(t+=a.Asn1Der.encode("TAG",a.Asn1Der.encode("SEQUENCE_30",a.Asn1Der.encode("SEQUENCE_30",this.dataObject)),4)),(0,n.hexStringToUint8)(a.Asn1Der.encode("SEQUENCE_30",t))}getSigningAlgorithm(){return this.signingAlgorithm}}e.Attestation=l,l.OID_OCTETSTRING="1.3.6.1.4.1.1466.115.121.1.40"},5393:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestationCrypto=e.Pedestren_H=e.Pedestren_G=void 0;const n=r(61602),i=r(93431),o=r(55050),s=r(98478),a=r(19421),c=r(86332);let u=r(91094);e.Pedestren_G=new i.Point(21282764439311451829394129092047993080259557426320933158672611067687630484067n,3813889942691430704369624600187664845713336792511424430006907067499686345744n,i.CURVE_BN256),e.Pedestren_H=new i.Point(10844896013696871595893151490650636250667003995871483372134187278207473369077n,9393217696329481319187854592386054938412168121447413803797200472841959383227n,i.CURVE_BN256);class l{constructor(){if(this.curveOrderBitLength=254n,this.rand=this.makeSecret(),!this.verifyCurveOrder(i.CURVE_BN256.n))throw new Error("Static values do not work with current implementation")}verifyCurveOrder(t){let e=BigInt(t.toString(2).length);return!(t<1n<>e>0n)||((0,o.logger)(a.DEBUGLEVEL.LOW,"Curve order is not 253 bits which is required by the current implementation"),!1)}getType(t){switch(t.toLowerCase()){case"mail":return n.ATTESTATION_TYPE.mail;case"phone":return n.ATTESTATION_TYPE.phone;case"inetpersona":return n.ATTESTATION_TYPE.InetPersona;default:throw new Error("Wrong type of identifier")}}makeCommitment(t,r,n){let i=this.mapToCurveMultiplier(r,t);return e.Pedestren_G.multiplyDA(i).add(e.Pedestren_H.multiplyDA(n)).getEncoded(!1)}makeCommitmentFromHiding(t,r,n){let i=this.mapToCurveMultiplier(r,t);return e.Pedestren_G.multiplyDA(i).add(n).getEncoded(!1)}injectIdentifierType(t,e){return(0,o.uint8merge)([Uint8Array.from([0,0,0,t]),e])}mapToInteger(t){return BigInt("0x"+u.keccak256(t))>>256n-this.curveOrderBitLength}mapToCurveMultiplier(t,e){let r=Uint8Array.from((0,o.stringToArray)(e.trim().toLowerCase())),n=this.injectIdentifierType(t,r),s=(0,o.uint8ToBn)(n);do{s=this.mapToInteger((0,o.bnToUint8)(s))}while(s>=i.CURVE_BN256.n);return s}computePoint_bn256(t){let e=i.CURVE_BN256.P;t=(0,o.mod)(t,e);let r,n,s,a=0n,c=0n,u=e+1n>>2n,l=e-1n>>1n;do{do{t=(0,o.mod)(t+1n),c=(0,o.mod)((0,o.BnPowMod)(t,3n,e)+i.CURVE_BN256.A*t+i.CURVE_BN256.B),s=(0,o.BnPowMod)(c,l,e)}while(1n!==s);a=(0,o.BnPowMod)(c,u,e),r=new i.Point(t,a,i.CURVE_BN256),r.x>e>>1n&&(r=new i.Point(t,e-a,i.CURVE_BN256)),n=r.multiplyDA(i.CURVE_BN256.n-1n),n.y>e>>1n&&(n=new i.Point(n.x,e-n.y,i.CURVE_BN256))}while(!r.equals(n)||r.isInfinity());return r}makeSecret(t=48){return(0,o.mod)(BigInt(l.generateRandomHexString(t)),i.CURVE_BN256.n)}static generateRandomHexString(t){var e=new Uint8Array(t);window&&window.crypto?window.crypto.getRandomValues(e):e=new Uint8Array(c.randomBytes(t));let r="0x";for(var n=0;n=i.CURVE_BN256.n);return f=(0,o.mod)(u+l*r,i.CURVE_BN256.n),s.FullProofOfExponent.fromData(t,c,f,a)}computeChallenge(t,e,r){let n=e.concat(t),i=this.makeArray(n),s=(0,o.uint8merge)([i,r]);return this.mapToInteger(s)}verifyFullProof(t){let r=this.computeChallenge(t.getPoint(),[e.Pedestren_H,t.getRiddle()],t.getNonce());return this.verifyPok(t,r)}verifyEqualityProof(t,r,n){let o=i.Point.decodeFromUint8(t,i.CURVE_BN256),a=i.Point.decodeFromUint8(r,i.CURVE_BN256),c=o.subtract(a),u=this.computeChallenge(n.getPoint(),[e.Pedestren_H,o,a],n.getNonce());return this.verifyPok(s.FullProofOfExponent.fromData(c,n.getPoint(),n.getChallengeResponse(),n.getNonce()),u)}verifyPok(t,r){if(r>=i.CURVE_BN256.n)return!1;let n=e.Pedestren_H.multiplyDA(t.getChallengeResponse()),o=t.getRiddle().multiplyDA(r).add(t.getPoint());return n.equals(o)}makeArray(t){let e=new Uint8Array(0);return t.forEach((t=>{e=new Uint8Array([...e,...t.getEncoded(!1)])})),e}static hashWithKeccak(t){return u.keccak256(t)}}e.AttestationCrypto=l,l.OID_SIGNATURE_ALG="1.2.840.10045.2.1",l.BYTES_IN_DIGEST=32},94807:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestationRequest=void 0;const n=r(93431),i=r(13649),o=r(55050),s=r(5393),a=r(98478),c=r(96858),u=r(61709),l=r(19421);e.AttestationRequest=class{constructor(){}static fromData(t,e){let r=new this;if(r.type=t,r.pok=e,!r.verify())throw new Error("The proof is not valid");return r}getDerEncoding(){let t=i.Asn1Der.encode("INTEGER",this.type)+this.pok.getDerEncoding();return i.Asn1Der.encode("SEQUENCE_30",t)}static fromBytes(t){let e,r=new this;try{e=c.AsnParser.parse(t,u.Identifier),r.type=e.type}catch(t){throw new Error("Cant parse AttestationRequest Identifier")}try{let t=new Uint8Array(e.proof.riddle),i=new Uint8Array(e.proof.challengePoint),s=new Uint8Array(e.proof.responseValue),c=new Uint8Array(e.proof.nonce),u=n.Point.decodeFromHex((0,o.uint8tohex)(t),n.CURVE_BN256),l=(0,o.uint8ToBn)(i),f=n.Point.decodeFromHex((0,o.uint8tohex)(s),n.CURVE_BN256);r.pok=a.FullProofOfExponent.fromData(u,f,l,c)}catch(t){throw new Error("Cant create FullProofOfExponent")}if(!r.verify())throw new Error("Could not verify the proof");return(0,o.logger)(l.DEBUGLEVEL.HIGH,"proof OK"),r}verify(){return!!(new s.AttestationCrypto).verifyFullProof(this.pok)&&((0,o.logger)(l.DEBUGLEVEL.HIGH,"VerifyAttestationRequestProof OK"),!0)}getPok(){return this.pok}getType(){return this.type}getAsn(){const t=this.getPok().getAsnType(),e=new u.Identifier;return e.type=this.getType(),e.proof=t,e}getAsnEncoded(){return c.AsnSerializer.serialize(this.getAsn())}}},81453:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestationRequestWithUsage=void 0;const n=r(65185),i=r(98478),o=r(84962),s=r(96858),a=r(55050),c=r(93431),u=r(5393),l=r(13649),f=r(19421);e.AttestationRequestWithUsage=class{constructor(){}static fromData(t,e,r){let n=new this;if(n.type=t,n.pok=e,n.sessionPublicKey=r,!n.verify())throw new Error("Could not verify the proof");return n}static fromBytes(t){let e,r=new this;try{e=s.AsnParser.parse(t,o.Identifier),r.type=e.type,r.sessionPublicKey=n.KeyPair.publicFromSubjectPublicKeyValue(e.sessionKey)}catch(t){throw new Error("Cant parse AttestationRequest Identifier")}try{let t=new Uint8Array(e.proof.riddle),n=new Uint8Array(e.proof.challengePoint),o=new Uint8Array(e.proof.responseValue),s=new Uint8Array(e.proof.nonce),u=c.Point.decodeFromHex((0,a.uint8tohex)(t),c.CURVE_BN256),l=(0,a.uint8ToBn)(n),f=c.Point.decodeFromHex((0,a.uint8tohex)(o),c.CURVE_BN256);r.pok=i.FullProofOfExponent.fromData(u,f,l,s)}catch(t){throw new Error("Cant create FullProofOfExponent")}if(!r.verify())throw new Error("Could not verify the proof");return(0,a.logger)(f.DEBUGLEVEL.HIGH,"proof OK"),r}verify(){return!!(new u.AttestationCrypto).verifyFullProof(this.pok)}getDerEncoding(){let t=l.Asn1Der.encode("INTEGER",this.type)+this.pok.getDerEncoding()+this.sessionPublicKey.getAsnDerPublic();return l.Asn1Der.encode("SEQUENCE_30",t)}getPok(){return this.pok}getType(){return this.type}getSessionPublicKey(){return this.sessionPublicKey}}},58015:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestedObject=void 0;const n=r(5393),i=r(80716),o=r(55050),s=r(13649),a=r(96858),c=r(8441),u=r(3365),l=r(19421);class f{constructor(){}create(t,e,r,i){this.attestableObject=t,this.att=e,this.attestationSecret=r,this.objectSecret=i,this.crypto=new n.AttestationCrypto,this.pok=this.makeProof(r,i,this.crypto),this.derEncodedProof=this.pok.getDerEncoding(),this.fillPresignData()}setWebDomain(t){this.webDomain=t}fillPresignData(){this.preSignEncoded=this.attestableObject.getDerEncoding()+this.att.getDerEncoding()+this.pok.getDerEncoding(),this.encoding=s.Asn1Der.encode("SEQUENCE_30",this.preSignEncoded)}fromDecodedData(t,e,r){this.attestableObject=t,this.att=e,this.pok=r,this.fillPresignData(),this.userKeyPair=this.att.getUnsignedAttestation().getSubjectPublicKeyInfo(),this.constructorCheck()}verify(){return this.attestableObject.verify()?this.att.verify()?!!this.crypto.verifyEqualityProof(this.att.getUnsignedAttestation().getCommitment(),this.attestableObject.getCommitment(),this.pok)||((0,o.logger)(l.DEBUGLEVEL.LOW,"Could not verify the consistency between the commitment in the attestation and the attested object"),!1):((0,o.logger)(l.DEBUGLEVEL.LOW,"Could not verify attestation"),!1):((0,o.logger)(l.DEBUGLEVEL.LOW,"Could not verify attestable object"),!1)}static fromBytes(t,e,r,o,s){let u=a.AsnParser.parse(t,e),l=new this;l.attestableObject=new o,l.attestableObject.fromBytes(u.signedToken,s),l.att=i.SignedIdentifierAttestation.fromBytes(new Uint8Array(u.attestation),r);let f=new c.UsageProofOfExponent;return f.fromBytes(new Uint8Array(u.proof)),l.pok=f,l.userKeyPair=l.att.getUnsignedAttestation().getSubjectPublicKeyInfo(),l.crypto=new n.AttestationCrypto,l.constructorCheck(),l}makeProof(t,e,r){let n=this.att.getUnsignedAttestation().getCommitment(),i=this.attestableObject.getCommitment(),s=r.computeEqualityProof((0,o.uint8tohex)(n),(0,o.uint8tohex)(i),t,e);if(!r.verifyEqualityProof(n,i,s))throw new Error("The redeem proof did not verify");return s}getAttestableObject(){return this.attestableObject}getAtt(){return this.att}getDerEncodeProof(){return this.derEncodedProof}getDerEncoding(){return this.encoding}constructorCheck(){if(!this.verify())throw new Error("The redeem request is not valid")}checkValidity(t=null){try{let t=this.att.getUnsignedAttestation().getDerEncoding();if(!u.IdentifierAttestation.fromBytes(new Uint8Array((0,o.hexStringToArray)(t))).checkValidity())return(0,o.logger)(l.DEBUGLEVEL.LOW,"The attestation is not a valid standard attestation"),!1}catch(t){return(0,o.logger)(l.DEBUGLEVEL.LOW,"The attestation is invalid"),!1}try{if(!this.getAttestableObject().checkValidity())return(0,o.logger)(l.DEBUGLEVEL.LOW,"Cheque is not valid"),!1}catch(t){return(0,o.logger)(l.DEBUGLEVEL.LOW,"Cheque validation failed"),!1}try{let e=this.getAtt().getUnsignedAttestation().getAddress();if((0,o.logger)(l.DEBUGLEVEL.HIGH,"attestationEthereumAddress: "+e),(0,o.logger)(l.DEBUGLEVEL.HIGH,"providedEthereumAddress: "+t),e.toLowerCase()!==t.toLowerCase())return(0,o.logger)(l.DEBUGLEVEL.LOW,"The attestation is not to the same Ethereum user who is sending this request"),!1}catch(t){return(0,o.logger)(l.DEBUGLEVEL.LOW,"Address validation failed"),(0,o.logger)(l.DEBUGLEVEL.MEDIUM,t),!1}return!0}}e.AttestedObject=f,f.Eip712UserData={payload:"",description:"",timestamp:0},f.Eip712UserDataTypes=[{name:"payload",type:"string"},{name:"description",type:"string"},{name:"timestamp",type:"uint256"}],f.Eip712UserDataPrimaryName="Authentication",f.Eip712UserDataDescription="Single-use authentication"},13649:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Asn1Der=e.X500NamesLabels=void 0;const n=r(55050),i=r(19421),o=(r(94956),{END_OF_CONTENT:0,BOOLEAN:1,INTEGER:2,BIT_STRING:3,OCTET_STRING:4,NULL_VALUE:5,OBJECT_ID:6,OBJECT_DESCRIPTOR:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED_PDV:11,UTF8STRING:12,RELATIVE_OID:13,SEQUENCE_10:16,SET_OF:17,NUMERABLE_STRING:18,PRINTABLE_STRING:19,T61STRING:20,VIDEO_TEX_STRING:21,IA5STRING:22,UTC_TIME:23,GENERALIZED_TIME:24,GRAPHIC_STRING:25,VISIBLE_STRING:26,GENERAL_STRING:27,UNIVERSAL_STRING:28,CHARACTER_STRING:29,BMP_STRING:30,SEQUENCE_30:48,SET:49}),s={0:"END_OF_CONTENT",1:"BOOLEAN",2:"INTEGER",3:"BIT_STRING",4:"OCTET_STRING",5:"NULL_VALUE",6:"OBJECT_ID",7:"OBJECT_DESCRIPTOR",8:"EXTERNAL",9:"REAL",10:"ENUMERATED",11:"EMBEDDED_PDV",12:"UTF8STRING",13:"RELATIVE_OID",16:"SEQUENCE_10",19:"PRINTABLE_STRING",22:"IA5STRING",24:"GENERALIZED_TIME",26:"VISIBLE_STRING",48:"SEQUENCE_30",49:"SET"};e.X500NamesLabels={CN:"2.5.4.3",C:"2.5.4.6",O:"2.5.4.10",OU:"2.5.4.11",L:"2.5.4.7",labeledURI:"1.3.6.1.4.1.250.1.57"};class a{static encodeAsInteger(t){return this.encode("INTEGER",t)}static encodeObjectId(t){return a.encode("SEQUENCE_30",a.encode("OBJECT_ID",t))}static parseX500Names(t){let r=t.matchAll(/(\w+)=("[^"]+"|[\w\.]+)/g),n="";if(!r)throw new Error("wrong Name format");let i=[];for(const t of r){let r=t[1],o=t[2];if('"'==o.substr(0,1)&&'"'==o.substr(-1)&&(o=o.slice(1,o.length-1)),n=e.X500NamesLabels[r],!n)throw new Error('Type "'+r+'" not implemented yet');i.push({type:r,value:o})}return i}static encodeName(t){let r="";return a.parseX500Names(t).forEach((t=>{let n=e.X500NamesLabels[t.type];if(!n)throw new Error(`X500 Name Object ID not implemented.(${t.value})`);let i=a.encode("OBJECT_ID",n)+a.encode("UTF8STRING",t.value);r+=a.encode("SEQUENCE_30",i)})),a.encode("SEQUENCE_30",a.encode("SET",r))}static encode(t,e,r=0){if(void 0===e)throw new Error("Missing value for Der encoding");let i=o[t],s="";switch(t){case"OBJECT_ID":if("string"!=typeof e)throw new Error("OBJECT_ID value must be a string");let o=e.split("."),a=o.shift(),c=o.shift();o.unshift((40*parseInt(a)+parseInt(c)).toString()),o.forEach((t=>{let e=parseInt(t),r="",n=!0;do{let t=127&e;e>>=7,t+=n?0:128,r=t.toString(16).padStart(2,"0")+r,n=!1}while(e);s+=r}));break;case"NULL_VALUE":s="";break;case"GENERALIZED_TIME":s=(0,n.stringToHex)((0,n.formatGeneralizedDateTime)(e));break;case"VISIBLE_STRING":case"UTF8STRING":s=(0,n.stringToHex)(e);break;case"INTEGER":s=BigInt(e).toString(16),s=(s.length%2?"0":"")+s,parseInt("0x"+s.slice(0,1),16)>7&&(s="00"+s);break;case"TAG":if(r>15)throw new Error("DER TAG more than 15 is not implemented");i=parseInt("0xA"+r);case"SEQUENCE_30":case"SET":case"OCTET_STRING":if("string"==typeof e)s=e;else{if(e.constructor!==Uint8Array)throw new Error("Wrong data type for OCTET_STRING");s=(0,n.uint8tohex)(e)}break;case"BIT_STRING":s="00"+e;break;case"BOOLEAN":s=parseInt(e).toString().padStart(2,"0");break;default:throw new Error("Sorry, "+t+" not implemented.")}let a="",c=Math.ceil(s.length/2),u=c.toString(16);return c||(u="00"),u=(u.length%2?"0":"")+u,a=c<128?u:(128+Math.round(u.length/2)).toString(16)+u,s=(s.length%2?"0":"")+s,i.toString(16).padStart(2,"0")+a+s}decode(t){let e=Array.from(t);return this.read(e)}lenEncoded(t){let e=t.shift();if(e<128)return e;if(e>128){let r=0;for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712AttestationRequest=void 0;const n=r(94807),i=r(65185),o=r(69112),s=r(55050),a=r(92219),c=r(9567),u=r(54288),l=r(19421);class f extends c.Eip712Token{constructor(t=null,e=u.Timestamp.DEFAULT_TIME_LIMIT_MS){super(),this.Eip712UserDataTypes=[{name:"payload",type:"string"},{name:"description",type:"string"},{name:"timestamp",type:"string"},{name:"identifier",type:"string"}],this.Eip712UserDataPrimaryName="AttestationRequest",this.Eip712UserDataDescription="Linking Ethereum address to phone or email",this.userKey=t,this.acceptableTimeLimit=e,this.usageValue=this.Eip712UserDataDescription}setUsageValue(t){this.usageValue=t}async addData(t,e=u.Timestamp.DEFAULT_TIME_LIMIT_MS,r,n){this.setDomain(t),this.attestationRequest=n,this.acceptableTimeLimit=e,this.jsonEncoding=await this.makeToken(r);try{this.fillJsonData(this.jsonEncoding)}catch(t){return(0,s.logger)(l.DEBUGLEVEL.LOW,t),!1}}fillJsonData(t){if(!t)throw new Error("Empty json");this.jsonEncoding=t;let e=JSON.parse(t),r=e.signatureInHex,a=JSON.parse(e.jsonSigned);this.eip712DomainData=a.domain,this.data=a.message;try{let t=o.SignatureUtility.recoverPublicKeyFromTypedMessageSignature(a,r);this.requestorKeys=i.KeyPair.fromPublicHex(t.substr(2)),(0,s.logger)(l.DEBUGLEVEL.HIGH,"restored address: "+this.requestorKeys.getAddress())}catch(t){let e="Recover Address failed with error:"+t;throw(0,s.logger)(l.DEBUGLEVEL.LOW,e,t),new Error(e)}this.attestationRequest||(this.attestationRequest=n.AttestationRequest.fromBytes((0,s.base64ToUint8array)(this.data.payload))),this.constructorCheck()}constructorCheck(){if(!this.verify())throw new Error("Could not verify Eip712 AttestationRequest");(0,s.logger)(l.DEBUGLEVEL.HIGH,"Eip712 Attestaion Request verify OK")}async makeToken(t){let e;e=this.userKey?this.userKey.getAddress():await o.SignatureUtility.connectMetamaskAndGetAddress();let r=a.Nonce.getTimestamp(this.attestationRequest.getPok().getNonce()),n=new u.Timestamp(r).getTimeAsString(),i={payload:(0,s.hexStringToBase64Url)(this.attestationRequest.getDerEncoding()),description:this.usageValue,timestamp:n,identifier:t};return await o.SignatureUtility.signEIP712WithBrowserWallet(this.domain,i,this.Eip712UserDataTypes,this.Eip712UserDataPrimaryName,this.userKey)}setAcceptableTimeLimit(t){this.acceptableTimeLimit=t}getJsonEncoding(){return this.jsonEncoding}verify(){return!!this.attestationRequest.verify()&&this.verifyDomainData()}verifyDomainData(){return this.eip712DomainData.name.toLowerCase()===this.getDomain().toLowerCase()&&this.eip712DomainData.version===o.SignatureUtility.Eip712Data.PROTOCOL_VERSION}checkValidity(){if(this.data.description!==this.usageValue)return(0,s.logger)(l.DEBUGLEVEL.MEDIUM,"Description is not correct. :"+this.data.description+" !== "+this.usageValue),!1;let t=new u.Timestamp(this.data.timestamp);return t.setValidity(this.acceptableTimeLimit),t.validateTimestamp()?!!(new a.Nonce).validateNonce(this.getPok().getNonce(),this.requestorKeys.getAddress(),this.domain,u.Timestamp.stringTimestampToLong(this.data.timestamp)-this.acceptableTimeLimit,u.Timestamp.stringTimestampToLong(this.data.timestamp)+this.acceptableTimeLimit)||((0,s.logger)(l.DEBUGLEVEL.LOW,"nonce is not correct"),!1):((0,s.logger)(l.DEBUGLEVEL.LOW,`timestamp is not correct. timestamp = ${this.data.timestamp}, acceptableTimeLimit = ${this.acceptableTimeLimit}`),!1)}getIdentifier(){return this.data.identifier}getType(){return this.attestationRequest.getType()}getPok(){return this.attestationRequest.getPok()}getUserPublicKey(){return this.requestorKeys}}e.Eip712AttestationRequest=f},95899:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712AttestationRequestWithUsage=void 0;const n=r(81453),i=r(65185),o=r(55050),s=r(69112),a=r(92219),c=r(9567),u=r(54288),l=r(19421);class f extends c.Eip712Token{constructor(t=null,e=u.Timestamp.DEFAULT_TIME_LIMIT_MS,r=u.Timestamp.DEFAULT_TOKEN_TIME_LIMIT){super(),this.Eip712UserDataTypes=[{name:"payload",type:"string"},{name:"description",type:"string"},{name:"identifier",type:"string"},{name:"timestamp",type:"string"},{name:"expirationTime",type:"string"}],this.Eip712UserDataPrimaryName="AttestationRequestWUsage",this.Eip712UserDataDescription='Prove that the "identifier" is the identifier hidden in attestation contained in"payload" and use this to authorize usage of local, temporary keys.',this.userKey=t,this.acceptableTimeLimit=e,this.maxTokenValidityInMs=r}async fromData(t,e=u.Timestamp.DEFAULT_TIME_LIMIT_MS,r=u.Timestamp.DEFAULT_TOKEN_TIME_LIMIT,n,i,s=null){this.setDomain(t),s&&(this.userKey=s);try{this.acceptableTimeLimit=e,this.maxTokenValidityInMs=r,this.attestationRequestWithUsage=i,this.jsonEncoding=await this.makeToken(n,i)}catch(t){throw(0,o.logger)(l.DEBUGLEVEL.LOW,t),new Error("Could not encode object")}try{this.fillJsonData(this.jsonEncoding)}catch(t){throw new Error("Could not decode object")}}Eip712AttestationRequestWithUsage(t,e,r,n){try{this.acceptableTimeLimit=e,this.maxTokenValidityInMs=r,this.jsonEncoding=n,this.fillJsonData(this.jsonEncoding)}catch(t){throw(0,o.logger)(l.DEBUGLEVEL.LOW,t),new Error("Could not decode object")}}fillJsonData(t){if(!t)throw new Error("Empty json");this.jsonEncoding=t;let e=JSON.parse(t),r=e.signatureInHex,a=JSON.parse(e.jsonSigned);this.eip712DomainData=a.domain,this.data=a.message;try{let t=s.SignatureUtility.recoverPublicKeyFromTypedMessageSignature(a,r);this.userPublicKey=i.KeyPair.fromPublicHex(t.substr(2)),(0,o.logger)(l.DEBUGLEVEL.HIGH,"Eip712 withUsage restored address: "+this.userPublicKey.getAddress())}catch(t){let e="Recover Address failed with error:"+t;throw(0,o.logger)(l.DEBUGLEVEL.LOW,e,t),new Error(e)}this.attestationRequestWithUsage||(this.attestationRequestWithUsage=n.AttestationRequestWithUsage.fromBytes((0,o.base64ToUint8array)(this.data.payload))),this.constructorCheck()}constructorCheck(){if(!this.verify())throw new Error("Could not verify Eip712 use attestation")}async makeToken(t,e){this.userKey||await s.SignatureUtility.connectMetamaskAndGetAddress();let r=(new u.Timestamp).getTimeAsString(),n=new u.Timestamp(Date.now()+this.maxTokenValidityInMs).getTimeAsString(),i={payload:(0,o.hexStringToBase64Url)(e.getDerEncoding()),description:this.Eip712UserDataDescription,timestamp:r,identifier:t,expirationTime:n};return await s.SignatureUtility.signEIP712WithBrowserWallet(this.domain,i,this.Eip712UserDataTypes,this.Eip712UserDataPrimaryName,this.userKey)}getIdentifier(){return this.data.identifier}getUserPublicKey(){return this.userPublicKey}getPok(){return this.attestationRequestWithUsage.getPok()}getType(){return this.attestationRequestWithUsage.getType()}getSessionPublicKey(){return this.attestationRequestWithUsage.getSessionPublicKey()}getJsonEncoding(){return this.jsonEncoding}checkValidity(){return!!this.testNonceAndDescription(this.acceptableTimeLimit)}checkTokenValidity(){let t=new u.Timestamp(this.data.timestamp);return t.setValidity(this.maxTokenValidityInMs),t.validateAgainstExpiration(u.Timestamp.stringTimestampToLong(this.data.expirationTime))?!!this.testNonceAndDescription(this.maxTokenValidityInMs):((0,o.logger)(l.DEBUGLEVEL.LOW,"time.validateAgainstExpiration filed"),!1)}testNonceAndDescription(t){if(!t)throw new Error("timeLimit required");let e=u.Timestamp.stringTimestampToLong(this.data.timestamp)-t,r=u.Timestamp.stringTimestampToLong(this.data.timestamp)+t;return!!(new a.Nonce).validateNonce(this.attestationRequestWithUsage.getPok().getNonce(),this.userPublicKey.getAddress(),this.domain,e,r)&&this.data.description===this.Eip712UserDataDescription}verify(){return!!this.attestationRequestWithUsage.verify()}}e.Eip712AttestationRequestWithUsage=f},22110:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712AttestationUsage=void 0;const n=r(65185),i=r(69112),o=r(9567),s=r(49674),a=r(55050),c=r(5393),u=r(93431),l=r(92219),f=r(54288),h=r(19421);class d extends o.Eip712Token{constructor(t=null,e=f.Timestamp.DEFAULT_TOKEN_TIME_LIMIT){super(),this.PLACEHOLDER_CHAIN_ID=0,this.Eip712PrimaryName="AttestationUsage",this.Eip712Description='Prove that the "identifier" is the identifier hidden in attestation contained in"payload".',this.Eip712UserTypes=[{name:"description",type:"string"},{name:"identifier",type:"string"},{name:"payload",type:"string"},{name:"timestamp",type:"string"},{name:"expirationTime",type:"string"}],this.maxTokenValidityInMs=e,this.userKey=t}async addData(t,e,r){this.setDomain(t),this.useAttestation=r;try{this.jsonEncoding=await this.makeToken(e,r)}catch(t){throw(0,a.logger)(h.DEBUGLEVEL.LOW,t),new Error("Could not encode object. "+t)}try{this.fillJsonData(this.jsonEncoding)}catch(t){return(0,a.logger)(h.DEBUGLEVEL.LOW,t),!1}this.constructorCheck()}fillJsonData(t,e=null){if(!t)throw new Error("Empty json");null!==e&&(this.attestorKey=e),this.jsonEncoding=t;let r=JSON.parse(t),o=r.signatureInHex,c=JSON.parse(r.jsonSigned);this.eip712DomainData=c.domain,this.data=c.message;try{let t=i.SignatureUtility.recoverPublicKeyFromTypedMessageSignature(c,o);this.requestorKeys=n.KeyPair.fromPublicHex(t.substr(2)),(0,a.logger)(h.DEBUGLEVEL.HIGH,"restored address: "+this.requestorKeys.getAddress())}catch(t){let e="Recover Address failed with error:"+t;throw(0,a.logger)(h.DEBUGLEVEL.LOW,e,t),new Error(e)}if(!this.useAttestation)try{(0,a.logger)(h.DEBUGLEVEL.VERBOSE,(0,a.uint8tohex)((0,a.base64ToUint8array)(this.data.payload))),this.useAttestation=s.UseAttestation.fromBytes((0,a.base64ToUint8array)(this.data.payload),this.attestorKey)}catch(t){let e="Failed to read UseAttestation. "+t;throw(0,a.logger)(h.DEBUGLEVEL.MEDIUM,e,t),new Error(e)}this.constructorCheck()}constructorCheck(){if(!this.verify())throw new Error("Could not verify Eip712 use attestation")}async makeToken(t,e){this.userKey||await i.SignatureUtility.connectMetamaskAndGetAddress();let r={payload:(0,a.hexStringToBase64Url)(e.getDerEncoding()),description:this.Eip712Description,timestamp:(new f.Timestamp).getTimeAsString(),identifier:t,expirationTime:new f.Timestamp(Date.now()+this.maxTokenValidityInMs).getTimeAsString()};return await i.SignatureUtility.signEIP712WithBrowserWallet(this.domain,r,this.Eip712UserTypes,this.Eip712PrimaryName,this.userKey)}proofLinking(){let t=(new c.AttestationCrypto).mapToCurveMultiplier(this.getType(),this.getIdentifier());return!!u.Point.decodeFromUint8(this.getAttestation().getUnsignedAttestation().getCommitment(),u.CURVE_BN256).subtract(c.Pedestren_G.multiplyDA(t)).equals(this.getPok().getRiddle())||((0,a.logger)(h.DEBUGLEVEL.LOW,"candidateRiddle.equals(this.getPok().getRiddle()) error"),!1)}getPok(){return this.useAttestation.getPok()}getType(){return this.useAttestation.type}getIdentifier(){return this.data.identifier}getAttestation(){return this.useAttestation.getAttestation()}getJsonEncoding(){return this.jsonEncoding}checkTokenValidity(){let t=f.Timestamp.stringTimestampToLong(this.data.expirationTime)-this.maxTokenValidityInMs-2*f.Timestamp.ALLOWED_ROUNDING,e=f.Timestamp.stringTimestampToLong(this.data.expirationTime);if(!this.useAttestation.checkValidity())return(0,a.logger)(h.DEBUGLEVEL.LOW,"useAttestation.checkValidity failed"),!1;if(this.data.description!=this.Eip712Description)return(0,a.logger)(h.DEBUGLEVEL.LOW,`wrong description: "${this.data.description}", must be "${this.Eip712Description}"`),!1;let r=new f.Timestamp(this.data.timestamp);return r.setValidity(this.maxTokenValidityInMs),r.validateAgainstExpiration(f.Timestamp.stringTimestampToLong(this.data.expirationTime))?this.requestorKeys.getAddress().toLowerCase()!==this.useAttestation.getAttestation().getUnsignedAttestation().getAddress().toLowerCase()?((0,a.logger)(h.DEBUGLEVEL.LOW,"wrong address"),!1):(new l.Nonce).validateNonce(this.useAttestation.getPok().getNonce(),this.useAttestation.getAttestation().getUnsignedAttestation().getAddress(),this.domain,t,e)?!!this.proofLinking()||((0,a.logger)(h.DEBUGLEVEL.LOW,"wrong proofLinking"),!1):((0,a.logger)(h.DEBUGLEVEL.LOW,"wrong Nonce"),!1):((0,a.logger)(h.DEBUGLEVEL.LOW,"verify timestamp failed.\n"+this.data.timestamp+"\n"+this.maxTokenValidityInMs+"\n"+this.data.expirationTime+"\n"+f.Timestamp.stringTimestampToLong(this.data.expirationTime)+"\n"),!1)}verify(){return!!this.useAttestation.verify()}getSessionPublicKey(){return this.useAttestation.getSessionPublicKey()}}e.Eip712AttestationUsage=d},9567:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712Token=void 0;const n=r(75888);class i extends n.Eip712Validator{}e.Eip712Token=i},75888:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712Validator=void 0;const n=r(58015),i=r(27309),o=r(72353),s=r(65185),a=r(58204),c=r(69112),u=r(55050),l=r(19421);class f{constructor(){this.XMLConfig=o.XMLconfigData}static stringIsAValidUrl(t){let e;try{e=new URL(t)}catch(t){return(0,u.logger)(l.DEBUGLEVEL.LOW,"cant construct url. Error:",t),!1}return"http:"===e.protocol||"https:"===e.protocol}setDomainAndTimout(t){if(!f.stringIsAValidUrl(t))throw new Error("wrong domain");this.domain=t}setDomain(t){if(!f.stringIsAValidUrl(t))throw new Error("wrong domain");this.domain=t}getDomain(){return this.domain}validateRequest(t){try{let e=JSON.parse(t),r=JSON.parse(e.jsonSigned),n=r.domain,i=r.message;this.retrieveAttestedObject(i);return this.validateDomain(n)}catch(t){return(0,u.logger)(l.DEBUGLEVEL.LOW,"Validate error!",t),!1}}validateDomain(t){return t.name.toLowerCase()!==this.domain.toLowerCase()?((0,u.logger)(l.DEBUGLEVEL.LOW,"Domain name is not valid"),!1):t.version===c.SignatureUtility.Eip712Data.PROTOCOL_VERSION||((0,u.logger)(l.DEBUGLEVEL.LOW,"Protocol version is wrong"),!1)}retrieveAttestedObject(t){let e=t.payload,r=s.KeyPair.publicFromBase64orPEM(o.XMLconfigData.base64attestorPubKey),c=o.XMLconfigData.base64senderPublicKeys;return n.AttestedObject.fromBytes((0,u.hexStringToUint8)(e),i.UseToken,r,a.Ticket,c)}verifySignature(t,e){let r=JSON.parse(t),n=r.signatureInHex,i=JSON.parse(r.jsonSigned),o=c.SignatureUtility.recoverPublicKeyFromTypedMessageSignature(i,n),a=s.KeyPair.fromPublicHex(o.substr(2));return e.toLowerCase()!==i.message.address.toLowerCase()?((0,u.logger)(l.DEBUGLEVEL.LOW,"message.address is not equal pkAddress"),!1):e.toLowerCase()===a.getAddress().toLowerCase()||((0,u.logger)(l.DEBUGLEVEL.LOW,"Recovered address is not equal pkAddress"),!1)}}e.Eip712Validator=f},98478:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FullProofOfExponent=void 0;const n=r(93431),i=r(61538),o=r(96858),s=r(55050),a=r(13649),c=r(8441);class u{constructor(){}static fromData(t,e,r,n=new Uint8Array([])){let i=new this;return i.riddle=t,i.tPoint=e,i.challengeResponse=r,i.nonce=n,i.encoding=i.makeEncoding(t,e,r,n),i}static fromBytes(t){let e=o.AsnParser.parse(t,i.Proof);return this.fromASNType(e)}static fromASNType(t){let e=new Uint8Array(t.riddle),r=n.Point.decodeFromUint8(e,n.CURVE_BN256),i=new Uint8Array(t.challengePoint),o=(0,s.uint8ToBn)(i),a=new Uint8Array(t.responseValue),c=n.Point.decodeFromUint8(a,n.CURVE_BN256),u=new Uint8Array(t.nonce);return this.fromData(r,c,o,u)}static fromBase64(t){return u.fromBytes((0,s.base64ToUint8array)(t))}makeEncoding(t,e,r,n=new Uint8Array([])){let i=a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(t.getEncoded()))+a.Asn1Der.encode("OCTET_STRING",r.toString(16))+a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(e.getEncoded()))+a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(n));return a.Asn1Der.encode("SEQUENCE_30",i)}getRiddle(){return this.riddle}getPoint(){return this.tPoint}getChallengeResponse(){return this.challengeResponse}getNonce(){return this.nonce}getUsageProofOfExponent(){return c.UsageProofOfExponent.fromData(this.tPoint,this.challengeResponse,this.nonce)}getDerEncoding(){return this.encoding}getAsnType(){const t=new i.Proof;return t.nonce=this.getNonce(),t.challengePoint=(0,s.bnToUint8)(this.getChallengeResponse()),t.riddle=this.getRiddle().getEncoded(),t.responseValue=this.getPoint().getEncoded(),t}}e.FullProofOfExponent=u},3365:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IdentifierAttestation=void 0;const n=r(5393),i=r(86085),o=r(55050),s=r(19421),a=r(13649);class c extends i.Attestation{constructor(){super()}fromCommitment(t,e){this.subjectKey=e,this.setVersion(c.HIDDEN_IDENTIFIER_VERSION),this.setSubject("CN="),this.setSigningAlgorithm(c.DEFAULT_SIGNING_ALGORITHM),this.setSubjectPublicKeyInfo(e),this.setCommitment(t),this.type=c.HIDDEN_TYPE,this.identifier=c.HIDDEN_IDENTIFIER,this.setUnlimitedValidity()}setUnlimitedValidity(){super.setNotValidBefore(Date.now()),super.setNotValidAfter(Date.parse("31 Dec 9999 23:59:59"))}static fromData(t,e,r,i){let o=(new n.AttestationCrypto).makeCommitment(t,e,i),s=new this;return s.fromCommitment(o,r),s.type=e.toString(),s.identifier=t,s}static fromLabelAndUrl(t,e,r){let n=new this;return n.subjectKey=r,n.setVersion(c.NFT_VERSION),n.setSubject(n.makeLabeledURI(t,e)),n.setSigningAlgorithm(c.DEFAULT_SIGNING_ALGORITHM),n.setIssuer("CN=attestation.id"),n.setSerialNumber(1),n.setSubjectPublicKeyInfo(r),n.setUnlimitedValidity(),n.type=t,n.identifier=e,n}makeLabeledURI(t,e){return`${c.LABELED_URI_LABEL}="${e} ${t}"`}static fromBytes(t){let e=new this;if(e.fromBytes(t),!e.checkValidity())throw new Error("Could not validate object");if(e.getVersion()==c.NFT_VERSION){let t=a.Asn1Der.parseX500Names(e.getSubject()),r=!1;if(t.forEach((t=>{if(!r&&t.type==c.LABELED_URI_LABEL){r=!0;let n=t.value.split(" ");if(2!=n.length)throw new Error("LabeledURI values should be separated with space and 2 items only: "+t.value);e.type=n[0],e.identifier=n[1]}})),!r)throw new Error("Cant find LABELED_URI")}else e.type=c.HIDDEN_TYPE,e.identifier=c.HIDDEN_IDENTIFIER;return e}setSubjectPublicKeyInfo(t){this.subjectKey=t}setCommitment(t){this.commitment=t}checkValidity(){return super.checkValidity()?this.getVersion()!=c.HIDDEN_IDENTIFIER_VERSION&&this.getVersion()!=c.NFT_VERSION?((0,o.logger)(s.DEBUGLEVEL.LOW,"The version number is "+this.getVersion()+", it must be either "+c.HIDDEN_IDENTIFIER_VERSION+" or "+c.NFT_VERSION),!1):this.getSigningAlgorithm()!==c.DEFAULT_SIGNING_ALGORITHM?((0,o.logger)(s.DEBUGLEVEL.LOW,"The subject is supposed to only be an Ethereum address as the Common Name"),!1):this.getVersion()!=c.NFT_VERSION||this.subject.includes(c.LABELED_URI_LABEL+"=")?!(this.getVersion()==c.HIDDEN_IDENTIFIER_VERSION&&this.getCommitment().length{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyPair=e.subtle=void 0;const n=r(55050),i=r(13649),o=r(93431),s=r(96858),a=r(54759),c=r(93343),u=r(8573),l=r(19421);let f=r(86266);if("object"==typeof crypto&&crypto.subtle)e.subtle=crypto.subtle;else{let t=r(86332).webcrypto;if(!t)throw(0,n.logger)(l.DEBUGLEVEL.LOW,"Webcrypto not accessible"),new Error("webcrypto.subtle missing");e.subtle=t.subtle}let h=new f.ec("secp256k1"),d=r(91094);const p={p192:null,p224:null,p256:"P-256",p384:"P-384",p521:"P-521",curve25519:null,ed25519:null,secp256k1:null};new o.Point(55066263022277343669578718895168534326250603453777594175500187360389116729240n,32670510020758816978083085130507043184471273380659243275938904335757337482424n);class g{constructor(){this.ethereumPrefix="Ethereum Signed Message:\n",this.algorithmASNList={secp256k1:["3081ec06072a8648ce3d02013081e0020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3044042000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101","06052b8104000a"],sect283k1:["3081f806072a8648ce3d02013081ec020101302506072a8648ce3d0102301a0202011b06092a8648ce3d01020303300902010502010702010c304c042400000000000000000000000000000000000000000000000000000000000000000000000004240000000000000000000000000000000000000000000000000000000000000000000000010449040503213f78ca44883f1a3b8162f188e553cd265f23c1567a16876913b0c2ac245849283601ccda380f1c9e318d90f95d07e5426fe87e45c0e8184698e45962364e34116177dd2259022401ffffffffffffffffffffffffffffffffffe9ae2ed07577265dff7f94451e061e163c61020104"],p256:["3081ec06072a8648ce3d02013081e0020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff30440420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b0441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020101"]}}getPrivateAsUint8(){return this.privKey}getPrivateAsHexString(){return(0,n.uint8tohex)(this.privKey)}getPrivateAsBigInt(){return(0,n.uint8ToBn)(this.privKey)}static privateFromBigInt(t){let e=new this;return e.privKey=new Uint8Array((0,n.hexStringToArray)(t.toString(16).padStart(64,"0"))),e}static fromPublicHex(t){if(null===t.toLowerCase().match(/^[a-f0-9]+$/i))throw new Error("Wrong Hex string input");if(t.length<129||t.length>130)throw new Error("Wrong public hex length");let e=new this;return e.pubKey=new Uint8Array((0,n.hexStringToArray)(t)),e}static fromPrivateUint8(t,e=""){if(!t||32!=t.length)throw new Error("Wrong private key. Should be 32 bytes Uint8");let r=new this;if(r.privKey=t,!e||!o.CURVES.hasOwnProperty(e))throw new Error(`Algorithm ${e} not implemented.`);return r.algorithm=e,r}static publicFromBase64orPEM(t){return g.publicFromPEM((0,n.pemOrBase64Orbase64urlToString)(t))}static publicFromPEM(t){const e=(0,n.base64ToUint8array)(t);let r=s.AsnParser.parse(e,a.PublicKeyInfoValue);return g.publicFromUint(new Uint8Array(r.publicKey))}static publicFromUint(t){let e=new this;if(65!=t.byteLength)throw(0,n.logger)(l.DEBUGLEVEL.LOW,"Wrong public key length"),new Error("Wrong public key length");return e.pubKey=new Uint8Array(t),e}static publicFromSubjectPublicKeyInfo(t){let e=new this;return e.pubKey=new Uint8Array(t.value.publicKey),e}static publicFromSubjectPublicKeyValue(t){let e=new this;return e.pubKey=new Uint8Array(t.publicKey),e.algorithm=e.getAlgorithNameFromASN1((0,n.uint8tohex)(new Uint8Array(t.algorithm))),e}static privateFromKeyInfo(t){let e=new this,r=s.AsnParser.parse(t.keysData,a.PrivateKeyData);return e.algorithm=e.getAlgorithNameFromASN1((0,n.uint8tohex)(new Uint8Array(t.algIdent))),e.privKey=new Uint8Array(r.privateKey),e}static privateFromKeyDataPEM(t){const e=(0,n.base64ToUint8array)(t);let r=s.AsnParser.parse(e,a.PrivateKeyData),i=new this;return i.algorithm=i.getAlgorithNameFromASN1((0,n.uint8tohex)(new Uint8Array(r.algDescr))),i.privKey=new Uint8Array(r.privateKey),i}getAlgorithNameFromASN1(t){let e={};for(const t in this.algorithmASNList)this.algorithmASNList[t].forEach((r=>{e[r]=t}));if(e.hasOwnProperty(t))return e[t];{let t="Unknown algorithm.";throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}}static privateFromPEM(t){const e=(0,n.base64ToUint8array)(t);let r=s.AsnParser.parse(e,a.PrivateKeyInfo);return g.privateFromKeyInfo(r)}static async generateKeyAsync(){const t=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt"]);let e=["0x"];const r=await crypto.subtle.exportKey("raw",t);return new Uint8Array(r).forEach((t=>{var r=t.toString(16);r.length%2&&(r="0"+r),e.push(r)})),this.privateFromBigInt(BigInt(e.join(""))%o.CURVE_SECP256k1.n)}static createKeys(){return this.privateFromBigInt(BigInt("0x"+(0,n.uint8tohex)(crypto.getRandomValues(new Uint8Array(32))))%o.CURVE_SECP256k1.n)}getPublicKeyAsHexStr(){if(this.pubKey)return(0,n.uint8tohex)(this.pubKey);if(o.CURVES.hasOwnProperty(this.algorithm)&&p.hasOwnProperty(this.algorithm)){let t=new f.ec(this.algorithm);if(!this.getPrivateAsHexString())throw(0,n.logger)(l.DEBUGLEVEL.LOW,this),new Error("Cant sign. This is only public key.");return t.keyFromPrivate(this.getPrivateAsHexString(),"hex").getPublic("hex").toString()}{let t='Private -> Public key not implemented for that aglorighm - "'+this.algorithm+'"';throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}}getAsnDerPublic(){var t=this.getPublicKeyAsHexStr();let e="";if(this.algorithm){if(!this.algorithmASNList.hasOwnProperty(this.algorithm)){let t="Fatal Error. Algorithm not implemented yet - "+this.algorithm;throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}e=this.algorithmASNList[this.algorithm][0]}else{let t="algorithm undefined, lets use default.";(0,n.logger)(l.DEBUGLEVEL.VERBOSE,t),e=this.algorithmASNList.secp256k1[0]}return i.Asn1Der.encode("SEQUENCE_30",e+i.Asn1Der.encode("BIT_STRING",t))}getAddress(){var t=this.getPublicKeyAsHexStr();return t=t.substr(2),"0x"+d.keccak256((0,n.hexStringToArray)(t)).substr(-40).toUpperCase()}signBytes(t){if(!this.getPrivateAsHexString())throw new Error("Cant sign. This is only public key.");let e=h.keyFromPrivate(this.getPrivateAsHexString(),"hex"),r=d.keccak256(t);return e.sign(r).toDER("hex")}signStringWithEthereum(t){if(!this.getPrivateAsHexString())throw new Error("Cant sign. This is only public key.");let e=h.keyFromPrivate(this.getPrivateAsHexString(),"hex"),r=this.ethereumPrefix+t.length+t,i=d.keccak256((0,n.stringToArray)(r));return e.sign(i).toDER("hex")}signHexStringWithEthereum(t){return this.signStringWithEthereum("0x"+t)}signBytesWithEthereum(t){let e="0x"+(0,n.uint8tohex)(new Uint8Array(t));return(0,n.logger)(l.DEBUGLEVEL.HIGH,"message: "+e),this.signStringWithEthereum(e)}signDeterministicSHA256(t){let e=Array.from(c.ethers.utils.arrayify(c.ethers.utils.sha256(t)));return this.signBytes(e)}verifyDeterministicSHA256(t,e){let r,i,a=c.ethers.utils.sha256(t).substr(2);if(!o.CURVES.hasOwnProperty(this.algorithm)||!p.hasOwnProperty(this.algorithm)){let t='Elliptic.js curve not implemented for that aglorighm - "'+this.algorithm+'"';throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}r=new f.ec(this.algorithm).keyFromPublic(this.getPublicKeyAsHexStr(),"hex");if(128==e.length||130==e.length){var h=e.match(/([a-f\d]{64})/gi);i={r:h[0],s:h[1]}}else{let t=s.AsnParser.parse((0,n.hexStringToUint8)(e),u.Signature);i={r:BigInt(t.r).toString(16).padStart(64,"0"),s:BigInt(t.s).toString(16).padStart(64,"0")}}return r.verify(a,i)}verifyHexStringWithEthereum(t,e){let r="0x"+t,i=d.keccak256((0,n.stringToArray)(this.ethereumPrefix+r.length+r)),o=h.keyFromPublic(this.getPublicKeyAsHexStr(),"hex");var s=e.match(/([a-f\d]{64})/gi);let a={r:s[0],s:s[1]};return o.verify(i,a)}signRawBytesWithEthereum(t){let e=c.ethers.utils.keccak256(t).substring(2);if((0,n.logger)(l.DEBUGLEVEL.HIGH,`signRawBytesWithEthereum: key: ${this.getAddress()}, hash: ${e}`),!this.getPrivateAsHexString())throw new Error("Cant sign. This is only public key.");let r=h.keyFromPrivate(this.getPrivateAsHexString(),"hex"),i=r.sign((0,n.hexStringToUint8)(e));return(0,n.ecSignatureToSRVhex)(i,r)}verifyBytesWithEthereum(t,e){if(!t||!t.length)throw new Error("Missing data to verify");if(!e)throw new Error("Missing signature to verify");let r=(0,n.hexStringToArray)(c.ethers.utils.keccak256(t)),i=h.keyFromPublic(this.getPublicKeyAsHexStr(),"hex");(0,n.logger)(l.DEBUGLEVEL.HIGH,`verifyBytesWithEthereum: key: ${this.getAddress()}, hash: ${(0,n.uint8tohex)(new Uint8Array(r))}`);var o=(e=(0,n.uint8tohex)(g.anySignatureToRawUint8(e))).match(/([a-f\d]{64})/gi);let s={r:o[0],s:o[1]};return i.verify(r,s)}getJWTParams(){let t=p[this.algorithm];if(!t){let t=`Cant create subtleCrypto key for curve '${this.algorithm}'`;throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}let e=this.getPublicKeyAsHexStr();return{crv:t,d:(0,n.uint8arrayToBase64)(this.getPrivateAsUint8()),key_ops:["sign"],kty:"EC",x:(0,n.uint8arrayToBase64)((0,n.hexStringToUint8)(e.substr(2,64))),y:(0,n.uint8arrayToBase64)((0,n.hexStringToUint8)(e.substr(66,64)))}}getSubtlePrivateKey(){let t=p[this.algorithm];return e.subtle.importKey("jwk",this.getJWTParams(),{name:"ECDSA",namedCurve:t},!0,["sign"])}getSubtlePublicKey(){let t=p[this.algorithm],r=this.getJWTParams();return delete r.d,r.key_ops=["verify"],e.subtle.importKey("jwk",r,{name:"ECDSA",namedCurve:t},!0,["verify"])}async signStringWithSubtle(t){return await e.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},await this.getSubtlePrivateKey(),Uint8Array.from((0,n.stringToArray)(t)))}async verifyStringWithSubtle(t,r){return(0,n.logger)(l.DEBUGLEVEL.VERBOSE,"pubkey: "+this.getPublicKeyAsHexStr()+" msg:"+r+" signature:"+(0,n.uint8tohex)(t)),(0,n.logger)(l.DEBUGLEVEL.VERBOSE,await this.getSubtlePublicKey()),await e.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},await this.getSubtlePublicKey(),t,Uint8Array.from((0,n.stringToArray)(r)))}async verifyStringWithSubtleDerSignature(t,e){let r=s.AsnParser.parse(t,u.Signature);const i=BigInt(r.r).toString(16).padStart(64,"0")+BigInt(r.s).toString(16).padStart(64,"0");return this.verifyStringWithSubtle((0,n.hexStringToUint8)(i),e)}static anySignatureToRawUint8(t){let e,r;if(e="string"==typeof t?(0,n.hexStringToUint8)(t):t,!e||!e.length)throw new Error("Empty signature received");switch(e.length){case 64:(0,n.logger)(l.DEBUGLEVEL.LOW,`anySignatureToRawUint8 received 64 bytes signature (without v value) = ${(0,n.uint8tohex)(e)}`);case 65:r=e;break;case 66:if(4!=e[0])throw new Error(`Cant recognize signature: ${(0,n.uint8tohex)(e)}`);r=e.slice(1,65);break;case 70:case 71:case 72:let t=s.AsnParser.parse(e,u.Signature);r=(0,n.hexStringToUint8)(BigInt(t.r).toString(16).padStart(64,"0")+BigInt(t.s).toString(16).padStart(64,"0"));break;default:let i="wrong Signature: "+(0,n.uint8tohex)(e);throw new Error(i)}return(0,n.logger)(l.DEBUGLEVEL.VERBOSE,"ready signature:"+(0,n.uint8tohex)(r)),r}static parseKeyArrayStrings(t){for(let e in t)"string"==typeof t[e]&&(t[e]=g.publicFromBase64orPEM(t[e]));return t}}e.KeyPair=g},92219:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Nonce=void 0;const n=r(55050),i=r(69112),o=r(91104),s=r(54288),a=r(19421);class c{constructor(){this.DEFAULT_NONCE_TIME_LIMIT_MS=12e5}static async makeNonce(t="",e,r=new Uint8Array(0),s=0){if(t||(t=await i.SignatureUtility.connectMetamaskAndGetAddress()),!o.ValidationTools.isAddress(t))throw new Error("Address is not valid");return t=t.toUpperCase(),s||(s=Date.now()),(0,n.uint8merge)([Uint8Array.from((0,n.stringToArray)(t)),(0,n.hashStringTo32bytesUint8)(e),(0,n.getInt64Bytes)(s),r])}validateNonce(t,e,r,i,o,s=new Uint8Array(0)){return c.validateAddress(t,e)?this.validateReceiverIdentifier(t,r)?this.validateTimestamp(t,i,o)?this.validateOtherData(t,s)?this.validateOtherData(t,s):((0,n.logger)(a.DEBUGLEVEL.LOW,"otherData check failed"),!1):((0,n.logger)(a.DEBUGLEVEL.LOW,"timestamp check failed"),!1):((0,n.logger)(a.DEBUGLEVEL.LOW,"validateReceiverIdentifier check failed"),!1):((0,n.logger)(a.DEBUGLEVEL.LOW,"validateAddress check failed for "+e),!1)}validateTimestamp(t,e,r){let n=c.getTimestamp(t),i=new s.Timestamp(n);return i.setValidity(r-e),i.validateAgainstExpiration(r)}static validateAddress(t,e){let r=(0,n.uint8toString)(t.slice(c.senderAddressIndexStart,c.senderAddressIndexStop));return e.toUpperCase()===r.toUpperCase()||((0,n.logger)(a.DEBUGLEVEL.LOW,"nonceAddress = "+r),!1)}validateReceiverIdentifier(t,e){return(0,n.uint8tohex)((0,n.hashStringTo32bytesUint8)(e)).toLowerCase()===(0,n.uint8tohex)(t.slice(c.receiverIdentifierIndexStart,c.receiverIdentifierIndexStop)).toLowerCase()}validateOtherData(t,e){return(0,n.uint8tohex)(e).toLowerCase()===(0,n.uint8tohex)(t.slice(c.otherDataIndexStart,c.otherDataIndexStart+e.length)).toLowerCase()}static getTimestamp(t){let e=t.slice(c.timestampIndexStart,c.timestampIndexStop),r=(0,n.uint8ToBn)(e);if(r>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("timestamp value bigger than MAX_SAFE_INTEGER");return Number(r)}}e.Nonce=c,c.LONG_BYTES=8,c.senderAddressIndexStart=0,c.senderAddressIndexStop=o.ValidationTools.ADDRESS_LENGTH_IN_BYTES,c.receiverIdentifierIndexStart=c.senderAddressIndexStop,c.receiverIdentifierIndexStop=c.receiverIdentifierIndexStart+32,c.timestampIndexStart=c.receiverIdentifierIndexStop,c.timestampIndexStop=c.timestampIndexStart+c.LONG_BYTES,c.otherDataIndexStart=c.timestampIndexStop},93431:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Point=e.CURVE_BN256=e.CURVES=e.CURVE_SECP256k1=void 0;const n=r(55050),i=r(19421);e.CURVE_SECP256k1={P:2n**256n-2n**32n-977n,n:2n**256n-432420386565659656852420866394968145599n,magicExp:(2n**256n-2n**32n-977n+1n)/4n,A:0n,B:7n},e.CURVES={p256:{P:BigInt("0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),A:BigInt("0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),B:BigInt("0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),n:BigInt("0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),GX:BigInt("0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"),GY:BigInt("0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),h:1n},secp256k1:{P:2n**256n-2n**32n-977n,A:0n,B:7n,n:2n**256n-432420386565659656852420866394968145599n,GX:55066263022277343669578718895168534326250603453777594175500187360389116729240n,GY:32670510020758816978083085130507043184471273380659243275938904335757337482424n},BN256:{P:115792089237314936872688561244471742058375878355761205198700409522629664518163n,n:115792089237314936872688561244471742058035595988840268584488757999429535617037n,magicExp:115792089237314936872688561244471742058375878355761205198700409522629664518164n>>2n,A:0n,B:3n,h:1n}},e.CURVE_BN256={P:21888242871839275222246405745257275088696311157297823662689037894645226208583n,n:21888242871839275222246405745257275088548364400416034343698204186575808495617n,A:0n,B:3n,h:1n};class o{constructor(t,r,n=e.CURVES.secp256r1){this.x=t,this.y=r,this.useCurve=n}double(){const t=this.x,e=this.y,r=(0,n.mod)(3n*t**2n*(0,n.invert)(2n*e,this.useCurve.P),this.useCurve.P),i=(0,n.mod)(r*r-2n*t,this.useCurve.P),s=(0,n.mod)(r*(t-i)-e,this.useCurve.P);return new o(i,s,this.useCurve)}newZero(){return new o(0n,0n,this.useCurve)}add(t){const[e,r]=[this,t],[i,s,a,c]=[e.x,e.y,r.x,r.y];if(0n===i||0n===s)return r;if(0n===a||0n===c)return e;if(i===a&&s===c)return this.double();if(i===a&&s===-c)return this.newZero();const u=(0,n.mod)((c-s)*(0,n.invert)(a-i,this.useCurve.P),this.useCurve.P),l=(0,n.mod)(u*u-i-a,this.useCurve.P),f=(0,n.mod)(u*(i-l)-s,this.useCurve.P);return new o(l,f,this.useCurve)}multiplyDA(t){let e=this.newZero(),r=this;for(;t>0n;)1n&t&&(e=e.add(r)),r=r.double(),t>>=1n;return e}isInfinity(){return null==this.x||null==this.y}getEncoded(t=!1){if(this.isInfinity())return new Uint8Array(0);let e=(0,n.bnToBuf)(this.x,32);return t?(0,n.uint8merge)([Uint8Array.from([2]),e]):(0,n.uint8merge)([Uint8Array.from([4]),e,(0,n.bnToBuf)(this.y,32)])}equals(t){if(null==t)return!1;let e=this.isInfinity(),r=t.isInfinity();if(e||r)return e&&r;let n=t;return this.x===n.x&&this.y===n.y}static decodeFromHex(t,r=e.CURVE_SECP256k1){if(130!=t.length)throw new Error("only decompressed points allowed. 65 bytes.");return o.decodeFromUint8((0,n.hexStringToUint8)(t),r)}static decodeFromUint8(t,r=e.CURVE_SECP256k1){if(65!=t.length)throw new Error("only decompressed points allowed. 65 bytes.");let s;if(4!==t[0])throw new Error("only decompressed points allowed");{let e=(0,n.uint8ToBn)(t.slice(1,33)),i=(0,n.uint8ToBn)(t.slice(33));s=new o(e,i,r)}if(!s.validate()){let t="Point is not valid ("+s.x.toString(16)+","+s.y.toString(16)+")";throw(0,n.logger)(i.DEBUGLEVEL.LOW,t),new Error(t)}return s}validate(){return 0n==(0,n.mod)((0,n.mod)(this.y*this.y,this.useCurve.P)-(0,n.mod)((0,n.BnPowMod)(this.x,3n,this.useCurve.P)+(0,n.mod)(this.x*this.useCurve.A,this.useCurve.P)+this.useCurve.B,this.useCurve.P),this.useCurve.P)}negate(){return new o(this.x,this.useCurve.P-this.y,this.useCurve)}subtract(t){return this.add(t.negate())}}e.Point=o},69112:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignatureUtility=void 0;const n=r(55050),i=r(93343),o=r(56371),s=r(19421);let a=new(r(86266).ec)("secp256k1"),c=r(91094);class u{static sign(t,e){let r=a.keyFromPrivate(e.getPrivateAsHexString(),"hex"),i=c.keccak256((0,n.hexStringToArray)(t));return r.sign(i).toDER("hex")}static verify(t,e,r){return u.verifyArrayBuf((0,n.hexStringToArray)(t),e,r)}static verifyArrayBuf(t,e,r){let n=a.keyFromPublic(r.getPublicKeyAsHexStr(),"hex"),i=c.keccak256(t);return n.verify(i,e)}static async signMessageWithBrowserWallet(t){await u.connectMetamaskAndGetAddress();let e=new i.ethers.providers.Web3Provider(window.ethereum).getSigner();return await e.signMessage(t)}static async recoverPublicKeyFromMessageSignature(t,e){const r=i.ethers.utils.hashMessage(t),n=i.ethers.utils.arrayify(r);return await i.ethers.utils.recoverPublicKey(n,e)}static recoverPublicKeyFromTypedMessageSignature(t,e){let r,s;try{let e=t.message.payload;t.message.payload=i.ethers.utils.id(e).substr(2);let n=t.types;delete n.EIP712Domain,r=o._TypedDataEncoder.hash(t.domain,n,t.message),t.message.payload=e}catch(t){throw new Error("Cant sign data, possibly wrong format. "+t)}try{s=(0,o.recoverPublicKey)((0,n.hexStringToUint8)(r.substr(2)),e)}catch(t){throw new Error("Cant recoverPublicKey. "+t)}return s}static async signEIP712WithBrowserWallet(t,e,r,o,a=null){try{let n;if(a)n=new i.ethers.Wallet("0x"+a.getPrivateAsHexString());else{n=new i.ethers.providers.Web3Provider(window.ethereum).getSigner()}if(!n)throw new Error("Active Wallet required");const s={name:t,version:u.Eip712Data.PROTOCOL_VERSION},l={};l[o]=r;let f=Object.assign({},e);f.payload=c.keccak256(f.payload);let h=await n._signTypedData(s,l,f),d={types:{EIP712Domain:u.Eip712domainTypes},primaryType:o,message:e,domain:s};d.types[o]=l[o];let p={signatureInHex:h,jsonSigned:JSON.stringify(d)};return JSON.stringify(p)}catch(t){return(0,n.logger)(s.DEBUGLEVEL.LOW,"Cant sign eip712 data. Error: "+t),""}}static async connectMetamaskAndGetAddress(){if(!window.ethereum)throw new Error("Please install metamask before.");const t=await window.ethereum.request({method:"eth_requestAccounts"});if(!t||!t.length)throw new Error("Active Wallet required");return t[0]}static getChainIdFromSignature(t){let e=Number("0x"+t.substr(-2));return 27==e||28==e?0:e-35>>1}static convertToPersonalEthMessage(t){return(0,n.stringToArray)(this.ethereumPrefix+t.length+t)}}e.SignatureUtility=u,u.ethereumPrefix="Ethereum Signed Message:\n",u.OID_ECDSA_PUBLICKEY="1.2.840.10045.2.1",u.Eip712Data={PROTOCOL_VERSION:"0.1"},u.Eip712domainTypes=[{name:"name",type:"string"},{name:"version",type:"string"}]},80716:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignedIdentifierAttestation=void 0;const n=r(96858),i=r(54759),o=r(65185),s=r(55050),a=r(13649),c=r(3365),u=r(19421);class l{constructor(){}static fromBytes(t,e){const r=n.AsnParser.parse(t,i.MyAttestation);return this.fromASNType(r,e,t)}static fromASNType(t,e,r=new Uint8Array(0)){let n=new this;n.uint8data=r,n.attestorKeys=e;let i=t.signatureAlgorithm.algorithm;if(n.att=c.IdentifierAttestation.fromBytes(t.signedInfo),n.signature=(0,s.uint8tohex)(new Uint8Array(t.signatureValue)),i!==n.att.getSigningAlgorithm())throw new Error("Algorithm specified is not consistent");return n.constructorCheck(),n}static fromData(t,e){let r=new this;return r.attestorKeys=e,r.att=t,r.signature=r.attestorKeys.signRawBytesWithEthereum(Array.from(r.att.getPrehash())),r.constructorCheck(),r}verify(){try{return this.attestorKeys.verifyBytesWithEthereum((0,s.hexStringToArray)(this.att.getDerEncoding()),this.signature)}catch(t){return(0,s.logger)(u.DEBUGLEVEL.LOW,t),!1}}checkValidity(){return this.getUnsignedAttestation().checkValidity()}getUnsignedAttestation(){return this.att}getDerEncoding(){return this.uint8data&&this.uint8data.length?(0,s.uint8tohex)(new Uint8Array(this.uint8data)):this.constructSignedAttestation(this.getUnsignedAttestation(),this.signature)}constructSignedAttestation(t,e){let r=t.getPrehash(),n=a.Asn1Der.encode("OBJECT_ID",t.getSigningAlgorithm()),i=(0,s.uint8tohex)(r)+a.Asn1Der.encode("SEQUENCE_30",n)+a.Asn1Der.encode("BIT_STRING",(0,s.uint8tohex)(o.KeyPair.anySignatureToRawUint8(e)));return a.Asn1Der.encode("SEQUENCE_30",i)}constructorCheck(){if(!this.verify())throw new Error("The signature is not valid")}}e.SignedIdentifierAttestation=l,l.ECDSA_WITH_SHA256="1.2.840.10045.4.3.2"},54288:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=void 0;const n=r(55050),i=r(19421);class o{constructor(t=null){this.ALLOWED_ROUNDING=1e4,this.validity=0,t||(this.time=Date.now()),"number"==typeof t&&(this.time=t),"string"==typeof t&&(this.time=o.stringTimestampToLong(t)),this.time=this.time-this.time%1e3}fromString(t){this.time=o.stringTimestampToLong(t)}getValidity(){return this.validity}setValidity(t){this.validity=t}getTime(){return this.time}getTimeAsString(){let t=new Date(this.time).toString();return t.substr(0,t.indexOf("(")-1)}validateTimestamp(){let t=this.getCurrentTime();return!(this.time>t+this.ALLOWED_ROUNDING)&&!(this.time+this.ALLOWED_ROUNDING+this.validitye+this.ALLOWED_ROUNDING?((0,n.logger)(i.DEBUGLEVEL.LOW,"Object still not valid. Details: not valid before = "+this.time+", currentTime = "+e),!1):t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UsageProofOfExponent=void 0;const n=r(93431),i=r(61538),o=r(96858),s=r(55050),a=r(13649);e.UsageProofOfExponent=class{constructor(){}static fromData(t,e,r=new Uint8Array([])){let n=new this;return n.tPoint=t,n.challengeResponse=e,n.nonce=r,n.encoding=n.makeEncoding(),n}fromBase64(t){this.encoding=t,this.fromBytes((0,s.base64ToUint8array)(t))}fromBytes(t){this.encodingBytes=t;let e=o.AsnParser.parse(t,i.UsageProof);this.challengeResponse=(0,s.uint8ToBn)(new Uint8Array(e.challengePoint));let r=new Uint8Array(e.responseValue);this.nonce=new Uint8Array(e.nonce),this.tPoint=n.Point.decodeFromHex((0,s.uint8tohex)(r),n.CURVE_BN256)}makeEncoding(){let t=a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)((0,s.bnToUint8)(this.challengeResponse)))+a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.tPoint.getEncoded(!1)))+a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.nonce));return a.Asn1Der.encode("SEQUENCE_30",t)}getPoint(){return this.tPoint}getChallengeResponse(){return this.challengeResponse}getDerEncoding(){return this.encoding}getNonce(){return this.nonce}}},49674:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UseAttestation=void 0;const n=r(65185),i=r(98478),o=r(5393),s=r(80716),a=r(91462),c=r(96858),u=r(13649);e.UseAttestation=class{static fromData(t,e,r,n){let i=new this;return i.attestation=t,i.type=e,i.pok=r,i.sessionPublicKey=n,i.encoding=i.makeEncoding(t,e,r,n),i.constructorCheck(),i}static fromBytes(t,e){let r,o=new this;try{r=c.AsnParser.parse(t,a.UseAttestation)}catch(t){throw new Error("Cant parse UseAttestationASN. "+t)}try{o.attestation=s.SignedIdentifierAttestation.fromASNType(r.attestation,e),o.type=r.type,o.pok=i.FullProofOfExponent.fromASNType(r.proof),o.sessionPublicKey=n.KeyPair.publicFromSubjectPublicKeyValue(r.sessionKey)}catch(t){throw new Error("Cant decode internal data. "+t)}return o.constructorCheck(),o}constructorCheck(){if(!this.verify())throw new Error("The use attestation object is not valid")}makeEncoding(t,e,r,n){let i=t.getDerEncoding()+u.Asn1Der.encode("INTEGER",e)+r.getDerEncoding()+n.getAsnDerPublic();return u.Asn1Der.encode("SEQUENCE_30",i)}getAttestation(){return this.attestation}getType(){return this.type}getPok(){return this.pok}getSessionPublicKey(){return this.sessionPublicKey}getDerEncoding(){return this.encoding}verify(){return this.attestation.verify()&&(new o.AttestationCrypto).verifyFullProof(this.pok)}checkValidity(){return this.attestation.checkValidity()}}},91104:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ValidationTools=void 0;const n=r(55050),i=r(19421);class o{static validateTimestamp(t,e,r){return!(t>e+r)&&!(t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ATTESTATION_TYPE=void 0,e.ATTESTATION_TYPE={phone:0,mail:1,InetPersona:2}},55050:(t,e,r)=>{"use strict";var n=r(34155),i=r(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.ecSignatureToSRVhex=e.testsLogger=e.logger=e.isDomainValid=e.formatGeneralizedDateTime=e.ethAddressToUint8=e.hashUint8To32bytesUint8=e.hashStringTo32bytesUint8=e.getInt64Bytes=e.uint8tohex=e.BnPowMod=e.stringToArray=e.base64ToUint8array=e.pemOrBase64Orbase64urlToString=e.base64toBase64Url=e.uint8arrayToBase64=e.uint8toString=e.uint8merge=e.bnToBuf=e.bnToUint8=e.bufToBn=e.uint8ToBn=e.egcd=e.invert=e.mod=e.hexStringToBase64Url=e.hexStringToBase64=e.hexStringToUint8=e.hexStringToArray=e.stringToHex=void 0;const o=r(19421),s=r(93431);let a,c,u=r(91094);function l(t=""){"0x"===t.substr(0,2).toLowerCase()&&(t=t.substr(2));let e=[],r=[...t];r.length%2&&r.unshift("0");let n,i="";if(!r||void 0===r||!r.length)return[];for(;r.length;){if(i="",i+=r.shift()+r.shift(),n=parseInt(i,16),isNaN(n))throw new Error("hexStringToArray input is not a hex string.");e.push(n)}return e}function f(t=""){return Uint8Array.from(l(t))}function h(t,e=s.CURVE_BN256.P){const r=t%e;return r>=0n?r:e+r}function d(t,e){let[r,n,i,o]=[0n,1n,1n,0n];for(;0n!==t;){let[s,a]=[e/t,e%t],[c,u]=[r-i*s,n-o*s];[e,t]=[t,a],[r,n]=[i,o],[i,o]=[c,u]}return[e,r,n]}function p(t){let e=[];return Uint8Array.from(t).forEach((function(t){var r=t.toString(16);r.length%2&&(r="0"+r),e.push(r)})),BigInt("0x"+e.join(""))}function g(t,e=0){var r=BigInt(t).toString(16).padStart(2*e,"0");r.length%2&&(r="0"+r);for(var n=r.length/2,i=new Uint8Array(n),o=0,s=0;oa||console.log(...e)}n&&n.env&&n.env.DISPLAY_DEBUG_LEVEL?a=parseInt(n.env.DISPLAY_DEBUG_LEVEL):"undefined"!=typeof window&&window.DISPLAY_DEBUG_LEVEL&&(a=parseInt(window.DISPLAY_DEBUG_LEVEL)),n&&n.env&&n.env.DISPLAY_DEBUG_LEVEL_TESTS&&(c=parseInt(n.env.DISPLAY_DEBUG_LEVEL_TESTS)),e.stringToHex=function(t){for(var e="",r=0;rt.charCodeAt(0))):Uint8Array.from(i.from(t,"base64")),e},e.stringToArray=E,e.BnPowMod=function(t,e,r){let n=1n,i=t;for(;e>0n;)1n&e&&(n=n*i%r),i=i*i%r,e>>=1n;return n},e.uint8tohex=function(t){return t&&t.length?Array.from(t).map((t=>("0"+t.toString(16)).slice(-2))).join(""):""},e.getInt64Bytes=function(t){let e=Math.floor(t/2**32);return new Uint8Array([e,e<<8,e<<16,e<<24,t,t<<8,t<<16,t<<24].map((t=>t>>>24)))},e.hashStringTo32bytesUint8=function(t){return A(Uint8Array.from(E(t)))},e.hashUint8To32bytesUint8=A,e.ethAddressToUint8=function(t){if(null===t.toLowerCase().match(/^0x[a-f0-9]{40}$/i))throw new Error("Wrong Ethereum Address");let e=Uint8Array.from(l(t.substr(2)));if(20!=e.length)throw new Error("wrong address length");return e},e.formatGeneralizedDateTime=function(t){var e=new Date(t),r=""+(e.getUTCMonth()+1),n=""+e.getUTCDate(),i=e.getUTCFullYear();let o=""+e.getUTCHours(),s=""+e.getUTCMinutes(),a=""+e.getUTCSeconds();return r.length<2&&(r="0"+r),n.length<2&&(n="0"+n),o.length<2&&(o="0"+o),s.length<2&&(s="0"+s),a.length<2&&(a="0"+a),[i,r,n,o,s,a].join("")+"Z"},e.isDomainValid=function(t){try{new URL(t)}catch(t){return!1}return!0},e.logger=S,e.testsLogger=function(t,...e){!c||t>c||console.log(...e)},e.ecSignatureToSRVhex=function(t,e){try{let r=t.r.toString(16).padStart(64,"0"),n=t.s,i=t.recoveryParam,o=e.ec.curve.n.shrn(1);return n.cmp(o)>0&&(n=e.ec.curve.n.sub(n),i=1-i),r+n.toString(16).padStart(64,"0")+(1==i?"1c":"1b")}catch(t){throw S(o.DEBUGLEVEL.LOW,t),new Error("Signature format doesn't fit.")}}},92580:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractLinkedAttestation=void 0;const n=r(96858),i=r(52551),o=r(55050),s=r(93343),a=r(93312);e.AbstractLinkedAttestation=class{fromObject(t){this.linkedAttestation=t}fromBytes(t){this.linkedAttestation=n.AsnParser.parse(t,i.SignedLinkedAttestation)}fromBase64(t){this.fromBytes((0,o.base64ToUint8array)(t))}getAttestationData(){return this.linkedAttestation.attestation[this.TYPE]}getSubjectPublicKey(){return this.getAttestationData().subjectPublicKey}getEncoded(){return new Uint8Array(n.AsnSerializer.serialize(this.linkedAttestation))}getBase64(){return(0,o.uint8arrayToBase64)(this.getEncoded())}sign(t){const e=n.AsnSerializer.serialize(this.linkedAttestation.attestation[this.TYPE]);this.linkedAttestation.signingAlgorithm=new a.AlgorithmIdentifierASN,this.linkedAttestation.signingAlgorithm.algorithm="1.2.840.10045.4.2",this.linkedAttestation.signatureValue=(0,o.hexStringToUint8)(t.signRawBytesWithEthereum(Array.from(new Uint8Array(e))))}verify(t){const e=n.AsnSerializer.serialize(this.getAttestationData());let r=(0,o.hexStringToUint8)(s.ethers.utils.keccak256(new Uint8Array(e))),i=s.ethers.utils.recoverPublicKey(r,s.ethers.utils.splitSignature(new Uint8Array(this.linkedAttestation.signatureValue)));if(i.substring(2)!==t.getPublicKeyAsHexStr())throw new Error("Attestor public key does not match, expected "+t.getPublicKeyAsHexStr()+" got "+i.substring(2));let a=Math.round(Date.now()/1e3),c=this.getAttestationData();if(c.validity.notBefore>a)throw new Error("Linked attestation is not yet valid");if(c.validity.notAfter{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EthereumAddressAttestation=void 0;const n=r(92580),i=r(52551),o=r(95978),s=r(35403),a=r(55050);class c extends n.AbstractLinkedAttestation{constructor(){super(...arguments),this.TYPE="ethereumAddress"}create(t,e,r,n,c,u){this.linkedAttestation=new i.SignedLinkedAttestation,this.linkedAttestation.attestation=new i.LinkedAttestation,this.linkedAttestation.attestation.ethereumAddress=new o.EthereumAddressAttestation,this.linkedAttestation.attestation.ethereumAddress.subjectPublicKey=t,u||(u=Math.round(Date.now()/1e3));const l=u+n;this.linkedAttestation.attestation.ethereumAddress.validity=new s.EpochTimeValidity,this.linkedAttestation.attestation.ethereumAddress.validity.notBefore=u,this.linkedAttestation.attestation.ethereumAddress.validity.notAfter=l,this.linkedAttestation.attestation.ethereumAddress.ethereumAddress=(0,a.hexStringToUint8)(e),c&&(this.linkedAttestation.attestation.ethereumAddress.context=c),this.sign(r)}}e.EthereumAddressAttestation=c},52410:(t,e,r)=>{"use strict";e.b=void 0;const n=r(52551),i=r(42909),o=r(96858),s=r(55050),a=r(35403),c=r(42909),u=r(93312),l=r(92475),f=r(1754),h=r(78147),d="RSASSA-PKCS1-v1_5";e.b=class{create(t,e,r,u,l){let f=o.AsnParser.parse((0,s.base64ToUint8array)(t),n.SignedLinkedAttestation);this.linkAttest=new i.SignedEthereumKeyLinkingAttestation,this.linkAttest.ethereumKeyLinkingAttestation=new c.EthereumKeyLinkingAttestation,this.linkAttest.ethereumKeyLinkingAttestation.subjectEthereumAddress=(0,s.hexStringToUint8)(e),this.linkAttest.ethereumKeyLinkingAttestation.linkedAttestation=f,l||(l=Math.round(Date.now()/1e3));const h=l+r;this.linkAttest.ethereumKeyLinkingAttestation.validity=new a.EpochTimeValidity,this.linkAttest.ethereumKeyLinkingAttestation.validity.notBefore=l,this.linkAttest.ethereumKeyLinkingAttestation.validity.notAfter=h,u||(this.linkAttest.ethereumKeyLinkingAttestation.context=u)}async sign(t){const e=o.AsnSerializer.serialize(this.linkAttest.ethereumKeyLinkingAttestation),r=await h.default.sign({name:d,saltLength:128},t,e);this.linkAttest.signingAlgorithm=new u.AlgorithmIdentifierASN,this.linkAttest.signingAlgorithm.algorithm="1.2.840.113549.1.1.11",this.linkAttest.signatureValue=new Uint8Array(r)}fromBytes(t){this.linkAttest=o.AsnParser.parse(t,i.SignedEthereumKeyLinkingAttestation)}fromBase64(t){this.fromBytes((0,s.base64ToUint8array)(t))}getEncoded(){return new Uint8Array(o.AsnSerializer.serialize(this.linkAttest))}getBase64(){return(0,s.uint8arrayToBase64)(this.getEncoded())}getAttestation(){return this.linkAttest}getSignedLinkedAttestation(){return this.linkAttest.ethereumKeyLinkingAttestation.linkedAttestation}getLinkedAttestationData(){const t=this.getSignedLinkedAttestation();return t.attestation.ethereumAddress??t.attestation.nftOwnership}getLinkedAttestationObject(){const t=this.getSignedLinkedAttestation();let e;return t.attestation.ethereumAddress?(e=new l.EthereumAddressAttestation,e.fromObject(t)):(e=new f.NFTOwnershipAttestation,e.fromObject(t)),e}async verify(t){let e=this.getLinkedAttestationObject();e.verify(t);let r=e.getSubjectPublicKey();const n=o.AsnSerializer.serialize(this.linkAttest.ethereumKeyLinkingAttestation),i=await h.default.importKey("spki",new Uint8Array(r),{name:d,hash:{name:"SHA-256"}},!0,["verify"]);if(!await h.default.verify({name:d,saltLength:128},i,this.linkAttest.signatureValue,n))throw new Error("Signature verification failed");let s=Math.round(Date.now()/1e3),a=this.linkAttest.ethereumKeyLinkingAttestation;if(a.validity.notBefore>s)throw new Error("Linked attestation is not yet valid");if(a.validity.notAfter{"use strict";e.t=void 0;const n=r(55050),i=r(78147);class o{async getOrCreateKey(t,e){let r,o,s=t+(e?"-"+e:"");try{return r=await this.getKey(s),r?o=(0,n.hexStringToUint8)(r.spki):(r=await i.default.generateKey({name:t,modulusLength:1024,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!1,["sign","verify"]),o=new Uint8Array(await i.default.exportKey("spki",r.publicKey)),await this.saveKey(s,r.privateKey,r.publicKey,(0,n.uint8tohex)(o))),{attestHoldingKey:r,holdingPubKey:o}}catch(t){throw console.log("Failed to create attestor keypair: "+t.message),t}}async getKey(t){return new Promise((async(e,r)=>{try{this.getDb().then((n=>{let i=n.transaction(o.TABLE_NAME,"readwrite").objectStore(o.TABLE_NAME).get(t);i.onsuccess=()=>{e(i.result),n.close()},i.onerror=t=>{r(t)}}))}catch(t){console.log(t),r(t.message)}}))}async saveKey(t,e,r,n){try{let i=await this.getDb(),s=i.transaction(o.TABLE_NAME,"readwrite").objectStore(o.TABLE_NAME),a={id:t,privateKey:e,publicKey:r,spki:n};s.put(a).onsuccess=()=>{i.close()}}catch(t){console.log("Failed to store key"+t.message)}}async getDb(){return new Promise((function(t,e){let r=indexedDB.open(o.DB_NAME,1);r.onupgradeneeded=function(t){let e=t.target.result;e.objectStoreNames.contains(o.TABLE_NAME)||e.createObjectStore(o.TABLE_NAME,{keyPath:"id"})},r.onsuccess=function(e){let r=e.target.result;t(r)},r.onerror=function(t){e("Error opening database "+t.target.errorCode)}}))}}e.t=o,o.DB_NAME="AttestationKeyStore",o.TABLE_NAME="Keys"},1754:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NFTOwnershipAttestation=void 0;const n=r(92580),i=r(52551),o=r(83874),s=r(35403),a=r(55050);class c extends n.AbstractLinkedAttestation{constructor(){super(...arguments),this.TYPE="nftOwnership"}create(t,e,r,n,c,u){this.linkedAttestation=new i.SignedLinkedAttestation,this.linkedAttestation.attestation=new i.LinkedAttestation,this.linkedAttestation.attestation.nftOwnership=new o.NFTOwnershipAttestation,this.linkedAttestation.attestation.nftOwnership.subjectPublicKey=t,u||(u=Math.round(Date.now()/1e3));const l=u+n;this.linkedAttestation.attestation.nftOwnership.validity=new s.EpochTimeValidity,this.linkedAttestation.attestation.nftOwnership.validity.notBefore=u,this.linkedAttestation.attestation.nftOwnership.validity.notAfter=l;for(let t of e){let e=new o.ERC721;if(e.address=(0,a.hexStringToUint8)(t.address),e.chainId=t.chainId,t.tokenIds){e.tokenIds=[];for(let r of t.tokenIds)e.tokenIds.push((0,a.bnToUint8)(r))}this.linkedAttestation.attestation.nftOwnership.tokens.push(e)}c&&(this.linkedAttestation.attestation.nftOwnership.context=c),this.sign(r)}}e.NFTOwnershipAttestation=c},78147:(t,e,r)=>{"use strict";let n;if(Object.defineProperty(e,"__esModule",{value:!0}),"object"==typeof crypto&&crypto.subtle)n=crypto.subtle;else{let t=r(27912).webcrypto;if(!t)throw new Error("webcrypto.subtle missing");n=t.subtle}e.default=n},37912:(t,e,r)=>{"use strict";var n=r(40210)("%Array%"),i=!n.isArray&&r(21924)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},4200:(t,e,r)=>{"use strict";var n=r(40210),i=r(62432),o=r(57312),s=r(53633),a=r(11645),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==s(t))throw new c("Assertion failed: `S` must be a String");if(!o(e)||e<0||e>a)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==s(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+i(t,e)["[[CodeUnitCount]]"]:e+1}},50581:(t,e,r)=>{"use strict";var n=r(40210),i=r(21924),o=n("%TypeError%"),s=r(96975),a=n("%Reflect.apply%",!0)||i("%Function.prototype.apply%");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!s(r))throw new o("Assertion failed: optional `argumentsList`, if provided, must be a List");return a(t,e,r)}},62432:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(21924),o=r(29544),s=r(65424),a=r(53633),c=r(84857),u=i("String.prototype.charAt"),l=i("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==a(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var i=l(t,e),f=u(t,e),h=o(i),d=s(i);if(!h&&!d)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(d||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=l(t,e+1);return s(p)?{"[[CodePoint]]":c(i,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},82658:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(53633);t.exports=function(t,e){if("Boolean"!==i(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},67730:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(63682),o=r(18334),s=r(13746),a=r(14305),c=r(40484),u=r(53633);t.exports=function(t,e,r){if("Object"!==u(t))throw new n("Assertion failed: Type(O) is not Object");if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return i(s,c,o,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},53937:(t,e,r)=>{"use strict";var n=r(40210),i=r(41405)(),o=n("%TypeError%"),s=n("%IteratorPrototype%",!0),a=n("%Object.defineProperty%",!0),c=r(4200),u=r(82658),l=r(67730),f=r(1391),h=r(20953),d=r(96258),p=r(40105),g=r(88305),y=r(96846),m=r(53633),b=r(9496),v=function(t,e,r,n){if("String"!==m(e))throw new o("`S` must be a string");if("Boolean"!==m(r))throw new o("`global` must be a boolean");if("Boolean"!==m(n))throw new o("`fullUnicode` must be a boolean");b.set(this,"[[IteratingRegExp]]",t),b.set(this,"[[IteratedString]]",e),b.set(this,"[[Global]]",r),b.set(this,"[[Unicode]]",n),b.set(this,"[[Done]]",!1)};s&&(v.prototype=h(s));if(l(v.prototype,"next",(function(){var t=this;if("Object"!==m(t))throw new o("receiver must be an object");if(!(t instanceof v&&b.has(t,"[[IteratingRegExp]]")&&b.has(t,"[[IteratedString]]")&&b.has(t,"[[Global]]")&&b.has(t,"[[Unicode]]")&&b.has(t,"[[Done]]")))throw new o('"this" value must be a RegExpStringIterator instance');if(b.get(t,"[[Done]]"))return u(void 0,!0);var e=b.get(t,"[[IteratingRegExp]]"),r=b.get(t,"[[IteratedString]]"),n=b.get(t,"[[Global]]"),i=b.get(t,"[[Unicode]]"),s=d(e,r);if(null===s)return b.set(t,"[[Done]]",!0),u(void 0,!0);if(n){if(""===y(f(s,"0"))){var a=g(f(e,"lastIndex")),l=c(r,a,i);p(e,"lastIndex",l,!0)}return u(s,!1)}return b.set(t,"[[Done]]",!0),u(s,!1)})),i&&(Symbol.toStringTag&&(a?a(v.prototype,Symbol.toStringTag,{configurable:!0,enumerable:!1,value:"RegExp String Iterator",writable:!1}):v.prototype[Symbol.toStringTag]="RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])){l(v.prototype,Symbol.iterator,(function(){return this}))}t.exports=function(t,e,r,n){return new v(t,e,r,n)}},43950:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(2435),o=r(63682),s=r(18334),a=r(52435),c=r(13746),u=r(14305),l=r(40484),f=r(69916),h=r(53633);t.exports=function(t,e,r){if("Object"!==h(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var d=i({Type:h,IsDataDescriptor:c,IsAccessorDescriptor:a},r)?r:f(r);if(!i({Type:h,IsDataDescriptor:c,IsAccessorDescriptor:a},d))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return o(c,l,s,t,e,d)}},18334:(t,e,r)=>{"use strict";var n=r(62188),i=r(17141),o=r(53633);t.exports=function(t){return void 0!==t&&n(o,"Property Descriptor","Desc",t),i(t)}},1391:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(70631),o=r(14305),s=r(53633);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!o(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+i(e));return t[e]}},67364:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(631),o=r(61787),s=r(14305);t.exports=function(t,e){if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=i(t,e);if(null!=r){if(!o(r))throw new n(e+"is not a function");return r}}},631:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(14305),o=r(30821);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(t)[e]}},52435:(t,e,r)=>{"use strict";var n=r(17642),i=r(62188),o=r(53633);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},96975:(t,e,r)=>{"use strict";var n=r(40210)("%Array%"),i=!n.isArray&&r(21924)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},61787:(t,e,r)=>{"use strict";t.exports=r(95320)},41974:(t,e,r)=>{"use strict";var n=r(14445)("%Reflect.construct%",!0),i=r(43950);try{i({},"",{"[[Get]]":function(){}})}catch(t){i=null}if(i&&n){var o={},s={};i(s,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,s)}catch(t){return t===o}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},13746:(t,e,r)=>{"use strict";var n=r(17642),i=r(62188),o=r(53633);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},57312:(t,e,r)=>{"use strict";var n=r(54908),i=r(375),o=r(53633),s=r(29086),a=r(22633);t.exports=function(t){if("Number"!==o(t)||s(t)||!a(t))return!1;var e=n(t);return i(e)===e}},14305:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},10840:(t,e,r)=>{"use strict";var n=r(40210)("%Symbol.match%",!0),i=r(98420),o=r(39731);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return o(e)}return i(t)}},20953:(t,e,r)=>{"use strict";var n=r(40210),i=n("%Object.create%",!0),o=n("%TypeError%"),s=n("%SyntaxError%"),a=r(96975),c=r(53633),u=!({__proto__:null}instanceof Object);t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new o("Assertion failed: `proto` must be null or an object");var e=arguments.length<2?[]:arguments[1];if(!a(e))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(e.length>0)throw new s("es-abstract does not yet support internal slots");if(i)return i(t);if(u)return{__proto__:t};if(null===t)throw new s("native Object.create support is required to create null objects");var r=function(){};return r.prototype=t,new r}},96258:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(21924)("RegExp.prototype.exec"),o=r(50581),s=r(1391),a=r(61787),c=r(53633);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=s(t,"exec");if(a(r)){var u=o(r,t,[e]);if(null===u||"Object"===c(u))return u;throw new n('"exec" method must return `null` or an Object')}return i(t,e)}},39619:(t,e,r)=>{"use strict";t.exports=r(4559)},40484:(t,e,r)=>{"use strict";var n=r(29086);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},40105:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(14305),o=r(40484),s=r(53633),a=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==s(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,a&&!o(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!a||o(t[e],r)}catch(t){return!1}}},39655:(t,e,r)=>{"use strict";var n=r(40210),i=n("%Symbol.species%",!0),o=n("%TypeError%"),s=r(41974),a=r(53633);t.exports=function(t,e){if("Object"!==a(t))throw new o("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==a(r))throw new o("O.constructor is not an Object");var n=i?r[i]:void 0;if(null==n)return e;if(s(n))return n;throw new o("no constructor found")}},39731:t=>{"use strict";t.exports=function(t){return!!t}},751:(t,e,r)=>{"use strict";var n=r(54908),i=r(375),o=r(55631),s=r(29086),a=r(22633),c=r(38111);t.exports=function(t){var e=o(t);return s(e)||0===e?0:a(e)?c(e)*i(n(e)):e}},88305:(t,e,r)=>{"use strict";var n=r(11645),i=r(751);t.exports=function(t){var e=i(t);return e<=0?0:e>n?n:e}},55631:(t,e,r)=>{"use strict";var n=r(40210),i=n("%TypeError%"),o=n("%Number%"),s=n("%RegExp%"),a=n("%parseInt%"),c=r(21924),u=r(50823),l=r(64790),f=c("String.prototype.slice"),h=u(/^0b[01]+$/i),d=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),g=u(new s("["+["…","​","￾"].join("")+"]","g")),y=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),m=new RegExp("(^["+y+"]+)|(["+y+"]+$)","g"),b=c("String.prototype.replace"),v=r(54607);t.exports=function t(e){var r=l(e)?e:v(e,o);if("symbol"==typeof r)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof r)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof r){if(h(r))return t(a(f(r,2),2));if(d(r))return t(a(f(r,2),8));if(g(r)||p(r))return NaN;var n=function(t){return b(t,m,"")}(r);if(n!==r)return t(n)}return o(r)}},30821:(t,e,r)=>{"use strict";var n=r(40210)("%Object%"),i=r(39619);t.exports=function(t){return i(t),n(t)}},54607:(t,e,r)=>{"use strict";var n=r(41503);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},69916:(t,e,r)=>{"use strict";var n=r(17642),i=r(40210)("%TypeError%"),o=r(53633),s=r(39731),a=r(61787);t.exports=function(t){if("Object"!==o(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new i("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!a(c))throw new i("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},96846:(t,e,r)=>{"use strict";var n=r(40210),i=n("%String%"),o=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return i(t)}},53633:(t,e,r)=>{"use strict";var n=r(23951);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},84857:(t,e,r)=>{"use strict";var n=r(40210),i=n("%TypeError%"),o=n("%String.fromCharCode%"),s=r(29544),a=r(65424);t.exports=function(t,e){if(!s(t)||!a(e))throw new i("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return o(t)+o(e)}},54908:(t,e,r)=>{"use strict";var n=r(40210)("%Math.abs%");t.exports=function(t){return n(t)}},375:t=>{"use strict";var e=Math.floor;t.exports=function(t){return e(t)}},4559:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},23951:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},14445:(t,e,r)=>{"use strict";t.exports=r(40210)},63682:(t,e,r)=>{"use strict";var n=r(31044),i=r(40210),o=n()&&i("%Object.defineProperty%",!0),s=n.hasArrayLengthDefineBug(),a=s&&r(37912),c=r(21924)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,i,u){if(!o){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(i in n&&c(n,i)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[i]=l,e(n[i],l)}return s&&"length"===i&&"[[Value]]"in u&&a(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(o(n,i,r(u)),!0)}},62188:(t,e,r)=>{"use strict";var n=r(40210),i=n("%TypeError%"),o=n("%SyntaxError%"),s=r(17642),a={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(s(t,r)&&!e[r])return!1;var n=s(t,"[[Value]]"),o=s(t,"[[Get]]")||s(t,"[[Set]]");if(n&&o)throw new i("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(64377)};t.exports=function(t,e,r,n){var s=a[e];if("function"!=typeof s)throw new o("unknown record type: "+e);if("Object"!==t(n)||!s(n))throw new i(r+" must be a "+e)}},17141:t=>{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},22633:t=>{"use strict";var e=Number.isNaN||function(t){return t!=t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!e(t)&&t!==1/0&&t!==-1/0}},29544:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},64377:(t,e,r)=>{"use strict";var n=r(17642);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},29086:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},64790:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},2435:(t,e,r)=>{"use strict";var n=r(40210),i=r(17642),o=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(i(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},65424:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},11645:(t,e,r)=>{"use strict";var n=r(40210),i=n("%Math%"),o=n("%Number%");t.exports=o.MAX_SAFE_INTEGER||i.pow(2,53)-1},50823:(t,e,r)=>{"use strict";var n=r(21924)("RegExp.prototype.exec");t.exports=function(t){return function(e){return null!==n(t,e)}}},38111:t=>{"use strict";t.exports=function(t){return t>=0?1:-1}},18597:t=>{"use strict";t.exports={i8:"6.5.4"}}},n={};function i(t){var e=n[t];if(void 0!==e)return e.exports;var o=n[t]={id:t,loaded:!1,exports:{}};return r[t].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=r,i.amdO={},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.f={},i.e=t=>Promise.all(Object.keys(i.f).reduce(((e,r)=>(i.f[r](t,e),e)),[])),i.u=t=>t+".negotiator.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="negotiator:",i.l=(r,n,o,s)=>{if(t[r])t[r].push(n);else{var a,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l{a.onerror=a.onload=null,clearTimeout(d);var i=t[r];if(delete t[r],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((t=>t(n))),e)return e(n)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),c&&document.head.appendChild(a)}},i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;i.g.importScripts&&(t=i.g.location+"");var e=i.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t})(),(()=>{var t={179:0};i.f.j=(e,r)=>{var n=i.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,i)=>n=t[e]=[r,i]));r.push(n[2]=o);var s=i.p+i.u(e),a=new Error;i.l(s,(r=>{if(i.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+s+")",a.name="ChunkLoadError",a.type=o,a.request=s,n[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,o,[s,a,c]=r,u=0;if(s.some((e=>0!==t[e]))){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(c)c(i)}for(e&&e(r);u{"use strict";i.r(o),i.d(o,{Client:()=>t.KU,Outlet:()=>S});var t=i(82250),e=i(93951),r=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},n=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]Needs email attestation to complete verification.

    '),this.buttonOverlay.appendChild(r),this.buttonOverlay.appendChild(i),document.body.appendChild(this.buttonOverlay)}else(0,e.kg)(2,"open attestation in iframe"),this.createIframe()},t.prototype.authenticate=function(){var t=this;return new Promise((function(e,r){if(t.rejectHandler=r,t.attestationInTab&&!(0,d.M)().brave&&(t.tryingToGetAttestationInBackground=!0),!t.attestationOrigin)return r(new Error("Attestation origin is null"));window.addEventListener("message",(function(n){if(t.attestationOrigin){var i=new URL(t.attestationOrigin);n.origin===i.origin&&(t.iframe&&t.iframeWrap&&t.iframe.contentWindow||t.attestationTabHandler)&&t.postMessageAttestationListener(n,e,r)}})),t.openAttestationApp(r)}))},t.prototype.createIframe=function(){var t,e=document.createElement("iframe");e.setAttribute("allow","clipboard-read"),this.iframe=e,e.src=null!==(t=this.attestationOrigin)&&void 0!==t?t:"",e.style.width="800px",e.style.height="700px",e.style.maxWidth="100%",e.style.background="#fff";var r=document.createElement("div");this.iframeWrap=r,r.setAttribute("style","width:100%;min-height: 100vh; position: fixed; align-items: center; justify-content: center;display: none;top: 0; left: 0; background: #fffa"),r.appendChild(e),document.body.appendChild(r)},t.prototype.postMessageAttestationListener=function(t,r,n){var i,o,s,a;return p(this,void 0,void 0,(function(){var c,u,l,d;return g(this,(function(p){switch(p.label){case 0:if((0,e.kg)(2,"postMessageAttestationListener event (auth-handler)",t.data),c=this.attestationTabHandler?this.attestationTabHandler:this.iframe.contentWindow,void 0!==t.data.ready&&!0===t.data.ready)return u={force:!1},this.email&&(u.email=this.email),this.wallet&&(u.wallet=this.wallet),this.address&&(u.address=this.address),c.postMessage(u,this.attestationOrigin),[2];if(void 0!==t.data.display)if(!0===t.data.display){if(this.iframeWrap){if(this.tryingToGetAttestationInBackground)return this.tryingToGetAttestationInBackground=!1,this.iframe.remove(),this.iframeWrap.remove(),this.openAttestationApp(),[2];this.iframeWrap.style.display="flex",this.outlet.sendMessageResponse({evtid:this.evtid,evt:f.k.SHOW_FRAME})}}else t.data.error&&((0,e.kg)(2,"Error received from the iframe: "+t.data.error),n(new Error(t.data.error))),this.iframeWrap&&(this.iframeWrap.style.display="none");if(!(null===(i=t.data)||void 0===i?void 0:i.attestation)||!(null===(o=t.data)||void 0===o?void 0:o.requestSecret))return[2];this.attestationTabHandler&&this.attestationTabHandler.close(),this.iframeWrap&&this.iframeWrap.remove(),this.attestationBlob=null===(s=t.data)||void 0===s?void 0:s.attestation,this.attestationSecret=null===(a=t.data)||void 0===a?void 0:a.requestSecret,p.label=1;case 1:if(p.trys.push([1,3,,4]),!this.signedTokenSecret)throw new Error("signedTokenSecret required");if(!this.attestationSecret)throw new Error("attestationSecret required");if(!this.signedTokenBlob)throw new Error("signedTokenBlob required");if(!this.attestationBlob)throw new Error("attestationBlob required");if(!this.base64attestorPubKey)throw new Error("base64attestorPubKey required");if(!this.base64senderPublicKeys)throw new Error("base64senderPublicKeys required");return[4,h._F.getUseTicket(this.signedTokenSecret,this.attestationSecret,this.signedTokenBlob,this.attestationBlob,this.base64attestorPubKey,this.base64senderPublicKeys)];case 2:if(!(l=p.sent()))throw console.log("this.authResultCallback( empty ): "),new Error("Empty useToken");return(0,e.kg)(2,"this.authResultCallback( useToken ): "),r(l),[3,4];case 3:return d=p.sent(),(0,e.kg)(2,"UseDevconTicket failed.",d.message),(0,e.kg)(3,d),n(new Error("Failed to create UseTicket. "+d.message)),[3,4];case 4:return[2]}}))}))},t}(),m=i(79896),b=i(96858),v=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},w=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?"?"+window.location.hash.substring(1):window.location.search;this.urlParams=new URLSearchParams(t);var r=this.getDataFromQuery("evtid"),n=this.getDataFromQuery("action");switch((0,e.kg)(2,"Outlet received event ID "+r+" action "+n),n!==l.gF.MAGIC_URL&&this.sendCookieCheck(r),n){case l.gF.GET_ISSUER_TOKENS:this.sendTokens(r);break;case l.gF.GET_PROOF:var i=this.getDataFromQuery("token"),o=this.getDataFromQuery("wallet"),a=this.getDataFromQuery("address");(0,e.Sg)(i,"unsigned token is missing"),this.sendTokenProof(r,i,a,o);break;default:localStorage.setItem("cookie-support-check","test"),this.sendCookieCheck(r);var c=this.tokenConfig,u=c.tokenUrlName,f=c.tokenSecretName,h=c.tokenIdName,d=c.itemStorageKey;try{var p=function(t,e,r,n,i){void 0===i&&(i=null),null===i&&(i=new URLSearchParams(window.location.search));var o=i.get(t),a=i.get(e),c=i.get(r)||"";if(!o||!a)throw new Error("Incomplete token params in URL.");var u=s(n),l=!0,f=u.tokens.map((function(t){return t.token===o&&(l=!1),t}));if(l)return f.push({token:o,secret:a,id:decodeURIComponent(c),magic_link:window.location.href}),f;throw new Error("Token already added.")}(u,f,h,d,this.urlParams);!function(t,e){t&&localStorage.setItem(e,JSON.stringify(t))}(p,d);var g=new Event("tokensupdated");document.body.dispatchEvent(g),this.sendTokens(r)}catch(t){this.sendErrorResponse(r,t.message)}}},t.prototype.sendCookieCheck=function(t){this.sendMessageResponse({evtid:t,evt:f.k.COOKIE_CHECK,data:{thirdPartyCookies:localStorage.getItem("cookie-support-check")}})},t.prototype.prepareTokenOutput=function(t){var r,n,i,o,s=localStorage.getItem(this.tokenConfig.itemStorageKey);return s?function(t,e){void 0===e&&(e=[]);var r=[];if(t.length&&"object"==typeof e&&Object.keys(e).length){var n=Object.keys(e);return t.forEach((function(t){var i=1;n.forEach((function(r){t[r]&&t[r].toString()!==e[r].toString()&&(i=0)})),i&&r.push(t)})),r}return t}((r=s,n=this.tokenConfig.tokenParser,i=this.tokenConfig.unsignedTokenDataName,(o=JSON.parse(r)).length?o.map((function(t){if(t.token){var r=new n((0,e.Ov)(t.token).buffer);if(r&&r[i])return a(r[i])}})):[]),t):[]},t.prototype.sendTokenProof=function(t,r,n,i){return v(this,void 0,void 0,(function(){var o,s,a,u;return w(this,(function(f){switch(f.label){case 0:if(!r)return[2,"error"];o=JSON.parse(r),f.label=1;case 1:return f.trys.push([1,4,,5]),[4,c(o,this.tokenConfig)];case 2:return s=f.sent(),[4,new y(this,t,this.tokenConfig,s,n,i).authenticate()];case 3:return a=f.sent(),this.sendMessageResponse({evtid:t,evt:l.AJ.PROOF,data:{issuer:this.tokenConfig.collectionID,proof:a}}),[3,5];case 4:return u=f.sent(),(0,e.kg)(2,u),this.sendErrorResponse(t,u.message),[3,5];case 5:return[2]}}))}))},t.prototype.sendTokens=function(t){var e=this.prepareTokenOutput(this.getFilter());this.sendMessageResponse({evtid:t,evt:l.AJ.ISSUER_TOKENS,data:{issuer:this.tokenConfig.collectionID,tokens:e}})},t.prototype.sendErrorResponse=function(t,e){this.sendMessageResponse({evtid:t,evt:f.k.ERROR,errors:[e]})},t.prototype.sendMessageResponse=function(t){var e;document.referrer&&((e=window.opener?window.opener:window.parent)&&e.postMessage(t,"*"))},t}()})(),o})())); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.negotiator=e():t.negotiator=e()}(self,(()=>(()=>{var t,e,r={95851:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="abi/5.6.4"},72734:(t,e,r)=>{"use strict";r.d(e,{R:()=>I,$:()=>B});var n=r(93286),i=r(53587),o=r(80711),s=r(95851),a=r(61184),c=r(64594);class u extends a.XI{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=(0,c.getAddress)(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return(0,c.getAddress)((0,n.hexZeroPad)(t.readValue().toHexString(),20))}}class l extends a.XI{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const f=new o.Logger(s.i);function h(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let t={};n=e.map((e=>{const n=e.localName;return n||f.throwError("cannot encode object for signature with missing names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]&&f.throwError("cannot encode object for signature with duplicate names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]=!0,r[n]}))}else f.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&f.throwArgumentError("types/value length mismatch","tuple",r);let i=new a.QV(t.wordSize),s=new a.QV(t.wordSize),c=[];e.forEach(((t,e)=>{let r=n[e];if(t.dynamic){let e=s.length;t.encode(s,r);let n=i.writeUpdatableValue();c.push((t=>{n(t+e)}))}else t.encode(i,r)})),c.forEach((t=>{t(i.length)}));let u=t.appendWriter(i);return u+=t.appendWriter(s),u}function d(t,e){let r=[],n=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let r=t.readValue(),s=n.subReader(r.toNumber());try{i=e.decode(s)}catch(t){if(t.code===o.Logger.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===o.Logger.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&r.push(i)}));const i=e.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach(((t,e)=>{let n=t.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[e];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let t=0;t{throw e}})}return Object.freeze(r)}class p extends a.XI{constructor(t,e,r){super("array",t.type+"["+(e>=0?e:"")+"]",r,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let r=0;rt._data.length&&f.throwError("insufficient data length",o.Logger.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let r=[];for(let t=0;t{t.dynamic&&(r=!0),n.push(t.type)}));super("tuple","tuple("+n.join(",")+")",e,r),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))})),Object.freeze(t)}encode(t,e){return h(t,this.coders,e)}decode(t){return t.coerce(this.name,d(t,this.coders))}}var P=r(11388);const T=new o.Logger(s.i),_=new RegExp(/^bytes([0-9]*)$/),O=new RegExp(/^(u?int)([0-9]*)$/);class I{constructor(t){(0,i.defineReadOnly)(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new u(t.name);case"bool":return new g(t.name);case"string":return new k(t.name);case"bytes":return new m(t.name);case"array":return new p(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new x((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new v(t.name)}let e=t.type.match(O);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&T.throwArgumentError("invalid "+e[1]+" bit length","param",t),new A(r/8,"int"===e[1],t.name)}if(e=t.type.match(_),e){let r=parseInt(e[1]);return(0===r||r>32)&&T.throwArgumentError("invalid bytes length","param",t),new b(r,t.name)}return T.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new a.Ej(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new a.QV(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(P._R.from(t))));return new x(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&T.throwError("types/values length mismatch",o.Logger.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const r=t.map((t=>this._getCoder(P._R.from(t)))),n=new x(r,"_"),i=this._getWriter();return n.encode(i,e),i.data}decode(t,e,r){const i=t.map((t=>this._getCoder(P._R.from(t))));return new x(i,"_").decode(this._getReader((0,n.arrayify)(e),r))}}const B=new I},61184:(t,e,r)=>{"use strict";r.d(e,{BR:()=>u,Ej:()=>h,QV:()=>f,XI:()=>l});var n=r(93286),i=r(2593),o=r(53587),s=r(80711),a=r(95851);const c=new s.Logger(a.i);function u(t){const e=[],r=function(t,n){if(Array.isArray(n))for(let i in n){const o=t.slice();o.push(i);try{r(o,n[i])}catch(t){e.push({path:o,error:t})}}};return r([],t),e}class l{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){c.throwArgumentError(t,this.localName,e)}}class f{constructor(t){(0,o.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return(0,n.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData((0,n.concat)(t._data))}writeBytes(t){let e=(0,n.arrayify)(t);const r=e.length%this.wordSize;return r&&(e=(0,n.concat)([e,this._padding.slice(r)])),this._writeData(e)}_getValue(t){let e=(0,n.arrayify)(i.O$.from(t));return e.length>this.wordSize&&c.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=(0,n.concat)([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class h{constructor(t,e,r,i){(0,o.defineReadOnly)(this,"_data",(0,n.arrayify)(t)),(0,o.defineReadOnly)(this,"wordSize",e||32),(0,o.defineReadOnly)(this,"_coerceFunc",r),(0,o.defineReadOnly)(this,"allowLoose",i),this._offset=0}get data(){return(0,n.hexlify)(this._data)}get consumed(){return this._offset}static coerce(t,e){let r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):h.coerce(t,e)}_peekBytes(t,e,r){let n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:c.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new h(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}readValue(){return i.O$.from(this.readBytes(this.wordSize))}}},11388:(t,e,r)=>{"use strict";r.d(e,{HY:()=>m,IC:()=>x,QV:()=>b,Xg:()=>A,YW:()=>S,_R:()=>g,pc:()=>d});var n=r(2593),i=r(53587),o=r(80711),s=r(95851);const a=new o.Logger(s.i),c={};let u={calldata:!0,memory:!0,storage:!0},l={calldata:!0,memory:!0};function f(t,e){if("bytes"===t||"string"===t){if(u[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&l[e])return!0;return(u[e]||"payable"===e)&&a.throwArgumentError("invalid modifier","name",e),!1}function h(t,e){for(let r in e)(0,i.defineReadOnly)(t,r,e[r])}const d=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=new RegExp(/^(.*)\[([0-9]*)\]$/);class g{constructor(t,e){t!==c&&a.throwError("use fromString",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),h(this,e);let r=this.type.match(p);h(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:g.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(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(e)}let e="";return"array"===this.baseType?(e+=this.arrayChildren.format(t),e+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==d.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===d.full?", ":",")+")"):e+=this.type,t!==d.sighash&&(!0===this.indexed&&(e+=" indexed"),t===d.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?g.fromString(t,e):g.fromObject(t)}static fromObject(t){return g.isParamType(t)?t:new g(c,{name:t.name||null,type:P(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(g.fromObject):null})}static fromString(t,e){return r=function(t,e){let r=t;function n(e){a.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function i(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let r=0;rg.fromString(t,e)))}class m{constructor(t,e){t!==c&&a.throwError("use a static from method",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),h(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return m.isFragment(t)?t:"string"==typeof t?m.fromString(t):m.fromObject(t)}static fromObject(t){if(m.isFragment(t))return t;switch(t.type){case"function":return S.fromObject(t);case"event":return b.fromObject(t);case"constructor":return A.fromObject(t);case"error":return x.fromObject(t);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?b.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?S.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?A.fromString(t.trim()):"error"===t.split(" ")[0]?x.fromString(t.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!(!t||!t._isFragment)}}class b extends m{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==d.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===d.full?", ":",")+") ",t!==d.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?b.fromString(t):b.fromObject(t)}static fromObject(t){if(b.isEventFragment(t))return t;"event"!==t.type&&a.throwArgumentError("invalid event object","value",t);const e={name:_(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(g.fromObject):[],type:"event"};return new b(c,e)}static fromString(t){let e=t.match(O);e||a.throwArgumentError("invalid event string","value",t);let r=!1;return e[3].split(" ").forEach((t=>{switch(t.trim()){case"anonymous":r=!0;break;case"":break;default:a.warn("unknown modifier: "+t)}})),b.fromObject({name:e[1].trim(),anonymous:r,inputs:y(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function v(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=n.O$.from(r[1]),r[0]):t}function w(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function E(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&a.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&a.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||a.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&a.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&a.throwArgumentError("unable to determine stateMutability","value",t),e}class A extends m{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.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((e=>JSON.parse(e.format(t))))});t===d.sighash&&a.throwError("cannot format a constructor for sighash",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map((e=>e.format(t))).join(t===d.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?A.fromString(t):A.fromObject(t)}static fromObject(t){if(A.isConstructorFragment(t))return t;"constructor"!==t.type&&a.throwArgumentError("invalid constructor object","value",t);let e=E(t);e.constant&&a.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(g.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new A(c,r)}static fromString(t){let e={type:"constructor"},r=(t=v(t,e)).match(O);return r&&"constructor"===r[1].trim()||a.throwArgumentError("invalid constructor string","value",t),e.inputs=y(r[2].trim(),!1),w(r[3].trim(),e),A.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class S extends A{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.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((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==d.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===d.full?", ":",")+") ",t!==d.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((e=>e.format(t))).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?S.fromString(t):S.fromObject(t)}static fromObject(t){if(S.isFunctionFragment(t))return t;"function"!==t.type&&a.throwArgumentError("invalid function object","value",t);let e=E(t);const r={type:t.type,name:_(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(g.fromObject):[],outputs:t.outputs?t.outputs.map(g.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new S(c,r)}static fromString(t){let e={type:"function"},r=(t=v(t,e)).split(" returns ");r.length>2&&a.throwArgumentError("invalid function string","value",t);let n=r[0].match(O);if(n||a.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&_(e.name),e.inputs=y(n[2],!1),w(n[3].trim(),e),r.length>1){let n=r[1].match(O);""==n[1].trim()&&""==n[3].trim()||a.throwArgumentError("unexpected tokens","value",t),e.outputs=y(n[2],!1)}else e.outputs=[];return S.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function k(t){const e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||a.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class x extends m{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==d.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===d.full?", ":",")+") ",e.trim()}static from(t){return"string"==typeof t?x.fromString(t):x.fromObject(t)}static fromObject(t){if(x.isErrorFragment(t))return t;"error"!==t.type&&a.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:_(t.name),inputs:t.inputs?t.inputs.map(g.fromObject):[]};return k(new x(c,e))}static fromString(t){let e={type:"error"},r=t.match(O);return r||a.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&_(e.name),e.inputs=y(r[2],!1),k(x.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function P(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const T=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function _(t){return t&&t.match(T)||a.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const O=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},83893:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AbiCoder:()=>i.R,ConstructorFragment:()=>n.Xg,ErrorFragment:()=>n.IC,EventFragment:()=>n.QV,FormatTypes:()=>n.pc,Fragment:()=>n.HY,FunctionFragment:()=>n.YW,Indexed:()=>o.Hk,Interface:()=>o.vU,LogDescription:()=>o.CC,ParamType:()=>n._R,TransactionDescription:()=>o.vk,checkResultErrors:()=>s.BR,defaultAbiCoder:()=>i.$});var n=r(11388),i=r(72734),o=r(8198),s=r(61184)},8198:(t,e,r)=>{"use strict";r.d(e,{CC:()=>p,Hk:()=>m,vU:()=>w,vk:()=>g});var n=r(64594),i=r(2593),o=r(93286),s=r(32046),a=r(38197),c=r(53587),u=r(72734),l=r(11388),f=r(80711),h=r(95851);const d=new f.Logger(h.i);class p extends c.Description{}class g extends c.Description{}class y extends c.Description{}class m extends c.Description{static isIndexed(t){return!(!t||!t._isIndexed)}}const b={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function v(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class w{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,(0,c.defineReadOnly)(this,"fragments",e.map((t=>l.HY.from(t))).filter((t=>null!=t))),(0,c.defineReadOnly)(this,"_abiCoder",(0,c.getStatic)(new.target,"getAbiCoder")()),(0,c.defineReadOnly)(this,"functions",{}),(0,c.defineReadOnly)(this,"errors",{}),(0,c.defineReadOnly)(this,"events",{}),(0,c.defineReadOnly)(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void d.warn("duplicate definition - constructor"):void(0,c.defineReadOnly)(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let r=t.format();e[r]?d.warn("duplicate definition - "+r):e[r]=t})),this.deploy||(0,c.defineReadOnly)(this,"deploy",l.Xg.from({payable:!1,type:"constructor"})),(0,c.defineReadOnly)(this,"_isInterface",!0)}format(t){t||(t=l.pc.full),t===l.pc.sighash&&d.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===l.pc.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return u.$}static getAddress(t){return(0,n.getAddress)(t)}static getSighash(t){return(0,o.hexDataSlice)((0,s.id)(t.format()),0,4)}static getEventTopic(t){return(0,s.id)(t.format())}getFunction(t){if((0,o.isHexString)(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];d.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===r.length?d.throwArgumentError("no matching function","name",e):r.length>1&&d.throwArgumentError("multiple matching functions","name",e),this.functions[r[0]]}const e=this.functions[l.YW.fromString(t).format()];return e||d.throwArgumentError("no matching function","signature",t),e}getEvent(t){if((0,o.isHexString)(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];d.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===r.length?d.throwArgumentError("no matching event","name",e):r.length>1&&d.throwArgumentError("multiple matching events","name",e),this.events[r[0]]}const e=this.events[l.QV.fromString(t).format()];return e||d.throwArgumentError("no matching event","signature",t),e}getError(t){if((0,o.isHexString)(t)){const e=(0,c.getStatic)(this.constructor,"getSighash");for(const r in this.errors){if(t===e(this.errors[r]))return this.errors[r]}d.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===r.length?d.throwArgumentError("no matching error","name",e):r.length>1&&d.throwArgumentError("multiple matching errors","name",e),this.errors[r[0]]}const e=this.errors[l.YW.fromString(t).format()];return e||d.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return(0,c.getStatic)(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),(0,c.getStatic)(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const r=(0,o.arrayify)(e);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(t)&&d.throwArgumentError(`data signature does not match error ${t.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),(0,o.hexlify)((0,o.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const r=(0,o.arrayify)(e);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(t)&&d.throwArgumentError(`data signature does not match function ${t.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,o.hexlify)((0,o.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=(0,o.arrayify)(e),n=null,i="",s=null,a=null,c=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(t){}break;case 4:{const t=(0,o.hexlify)(r.slice(0,4)),e=b[t];if(e)s=this._abiCoder.decode(e.inputs,r.slice(4)),a=e.name,c=e.signature,e.reason&&(n=s[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const e=this.getError(t);s=this._abiCoder.decode(e.inputs,r.slice(4)),a=e.name,c=e.format()}catch(t){}break}}return d.throwError("call revert exception"+i,f.Logger.errors.CALL_EXCEPTION,{method:t.format(),data:(0,o.hexlify)(e),errorArgs:s,errorName:a,errorSignature:c,reason:n})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,o.hexlify)(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&d.throwError("too many arguments for "+t.format(),f.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));const n=(t,e)=>"string"===t.type?(0,s.id)(e):"bytes"===t.type?(0,a.keccak256)((0,o.hexlify)(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=i.O$.from(e).toHexString()),"address"===t.type&&this._abiCoder.encode(["address"],[e]),(0,o.hexZeroPad)((0,o.hexlify)(e),32));for(e.forEach(((e,i)=>{let o=t.inputs[i];o.indexed?null==e?r.push(null):"array"===o.baseType||"tuple"===o.baseType?d.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?r.push(e.map((t=>n(o,t)))):r.push(n(o,e)):null!=e&&d.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const r=[],n=[],i=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&d.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,o)=>{const c=e[o];if(t.indexed)if("string"===t.type)r.push((0,s.id)(c));else if("bytes"===t.type)r.push((0,a.keccak256)(c));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([t.type],[c]))}else n.push(t),i.push(c)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){let e=this.getEventTopic(t);(0,o.isHexString)(r[0],32)&&r[0].toLowerCase()===e||d.throwError("fragment/topic mismatch",f.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:r[0]}),r=r.slice(1)}let n=[],i=[],s=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(n.push(l._R.fromObject({type:"bytes32",name:t.name})),s.push(!0)):(n.push(t),s.push(!1)):(i.push(t),s.push(!1))}));let a=null!=r?this._abiCoder.decode(n,(0,o.concat)(r)):null,c=this._abiCoder.decode(i,e,!0),u=[],h=0,p=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==a)u[e]=new m({_isIndexed:!0,hash:null});else if(s[e])u[e]=new m({_isIndexed:!0,hash:a[p++]});else try{u[e]=a[p++]}catch(t){u[e]=t}else try{u[e]=c[h++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const r=u[e];r instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw v(`property ${JSON.stringify(t.name)}`,r)}}):u[t.name]=r}}));for(let t=0;t{throw v(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new g({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:i.O$.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new p({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=(0,o.hexlify)(t);let r=this.getError(e.substring(0,10).toLowerCase());return r?new y({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(t){return!(!t||!t._isInterface)}}},64353:(t,e,r)=>{"use strict";r.d(e,{Sg:()=>c,zt:()=>u});var n=r(2593),i=r(53587),o=r(80711);var s=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const a=new o.Logger("abstract-provider/5.6.1");class c extends i.Description{static isForkEvent(t){return!(!t||!t._isForkEvent)}}class u{constructor(){a.checkAbstract(new.target,u),(0,i.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return s(this,void 0,void 0,(function*(){const{block:t,gasPrice:e}=yield(0,i.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let r=null,o=null;return t&&t.baseFeePerGas&&(o=n.O$.from("1500000000"),r=t.baseFeePerGas.mul(2).add(o)),{maxFeePerGas:r,maxPriorityFeePerGas:o,gasPrice:e}}))}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}},48171:(t,e,r)=>{"use strict";r.d(e,{E:()=>u,b:()=>l});var n=r(53587),i=r(80711);var o=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const s=new i.Logger("abstract-signer/5.6.2"),a=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],c=[i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED];class u{constructor(){s.checkAbstract(new.target,u),(0,n.defineReadOnly)(this,"_isSigner",!0)}getBalance(t){return o(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return o(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return o(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield(0,n.resolveProperties)(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return o(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield(0,n.resolveProperties)(this.checkTransaction(t));return yield this.provider.call(r,e)}))}sendTransaction(t){return o(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),r=yield this.signTransaction(e);return yield this.provider.sendTransaction(r)}))}getChainId(){return o(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return o(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return o(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const e in t)-1===a.indexOf(e)&&s.throwArgumentError("invalid transaction key: "+e,"transaction",t);const e=(0,n.shallowCopy)(t);return null==e.from?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then((e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&s.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return o(this,void 0,void 0,(function*(){const e=yield(0,n.resolveProperties)(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>o(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&s.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})))),e.to.catch((t=>{})));const r=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null==e.gasPrice||2!==e.type&&!r?0!==e.type&&1!==e.type||!r||s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==e.type&&null!=e.type||null==e.maxFeePerGas||null==e.maxPriorityFeePerGas)if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(null==e.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(e.type=2,null!=e.gasPrice){const t=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=t,e.maxPriorityFeePerGas=t}else null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(r&&s.throwError("network does not support EIP-1559",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):s.throwError("failed to get consistent fee data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else e.type=2;return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch((t=>{if(c.indexOf(t.code)>=0)throw t;return s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})}))),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then((e=>(0!==e[1]&&e[0]!==e[1]&&s.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield(0,n.resolveProperties)(e)}))}_checkProvider(t){this.provider||s.throwError("missing provider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}class l extends u{constructor(t,e){super(),(0,n.defineReadOnly)(this,"address",t),(0,n.defineReadOnly)(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then((()=>{s.throwError(t,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})}))}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new l(this.address,t)}}},64594:(t,e,r)=>{"use strict";r.r(e),r.d(e,{getAddress:()=>d,getContractAddress:()=>y,getCreate2Address:()=>m,getIcapAddress:()=>g,isAddress:()=>p});var n=r(93286),i=r(2593),o=r(38197),s=r(61843);const a=new(r(80711).Logger)("address/5.6.1");function c(t){(0,n.isHexString)(t,20)||a.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const i=(0,n.arrayify)((0,o.keccak256)(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const u={};for(let t=0;t<10;t++)u[String(t)]=String(t);for(let t=0;t<26;t++)u[String.fromCharCode(65+t)]=String(10+t);const l=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/Math.LN10));var f;function h(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>u[t])).join("");for(;e.length>=l;){let t=e.substring(0,l);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function d(t){let e=null;if("string"!=typeof t&&a.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=c(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&a.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==h(t)&&a.throwArgumentError("bad icap checksum","address",t),e=(0,i.g$)(t.substring(4));e.length<40;)e="0"+e;e=c("0x"+e)}else a.throwArgumentError("invalid address","address",t);return e}function p(t){try{return d(t),!0}catch(t){}return!1}function g(t){let e=(0,i.t2)(d(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+h("XE00"+e)+e}function y(t){let e=null;try{e=d(t.from)}catch(e){a.throwArgumentError("missing from address","transaction",t)}const r=(0,n.stripZeros)((0,n.arrayify)(i.O$.from(t.nonce).toHexString()));return d((0,n.hexDataSlice)((0,o.keccak256)((0,s.encode)([e,r])),12))}function m(t,e,r){return 32!==(0,n.hexDataLength)(e)&&a.throwArgumentError("salt must be 32 bytes","salt",e),32!==(0,n.hexDataLength)(r)&&a.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),d((0,n.hexDataSlice)((0,o.keccak256)((0,n.concat)(["0xff",d(t),e,r])),12))}},59567:(t,e,r)=>{"use strict";r.d(e,{J:()=>i,c:()=>o});var n=r(93286);function i(t){t=atob(t);const e=[];for(let r=0;r{"use strict";r.r(e),r.d(e,{decode:()=>n.J,encode:()=>n.c});var n=r(59567)},57727:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Base32:()=>s,Base58:()=>a,BaseX:()=>o});var n=r(93286),i=r(53587);class o{constructor(t){(0,i.defineReadOnly)(this,"alphabet",t),(0,i.defineReadOnly)(this,"base",t.length),(0,i.defineReadOnly)(this,"_alphabetMap",{}),(0,i.defineReadOnly)(this,"_leader",t.charAt(0));for(let e=0;e0;)r.push(n%this.base),n=n/this.base|0}let i="";for(let t=0;0===e[t]&&t=0;--t)i+=this.alphabet[r[t]];return i}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let r=0;r>=8;for(;i>0;)e.push(255&i),i>>=8}for(let r=0;t[r]===this._leader&&r{"use strict";r.d(e,{i:()=>n});const n="bignumber/5.6.2"},2593:(t,e,r)=>{"use strict";r.d(e,{O$:()=>p,Zm:()=>h,g$:()=>v,t2:()=>w});var n=r(13550),i=r.n(n),o=r(93286),s=r(80711),a=r(48794),c=i().BN;const u=new s.Logger(a.i),l={},f=9007199254740991;function h(t){return null!=t&&(p.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||(0,o.isHexString)(t)||"bigint"==typeof t||(0,o.isBytes)(t))}let d=!1;class p{constructor(t,e){t!==l&&u.throwError("cannot call constructor directly; use BigNumber.from",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return y(m(this).fromTwos(t))}toTwos(t){return y(m(this).toTwos(t))}abs(){return"-"===this._hex[0]?p.from(this._hex.substring(1)):this}add(t){return y(m(this).add(m(t)))}sub(t){return y(m(this).sub(m(t)))}div(t){return p.from(t).isZero()&&b("division-by-zero","div"),y(m(this).div(m(t)))}mul(t){return y(m(this).mul(m(t)))}mod(t){const e=m(t);return e.isNeg()&&b("division-by-zero","mod"),y(m(this).umod(e))}pow(t){const e=m(t);return e.isNeg()&&b("negative-power","pow"),y(m(this).pow(e))}and(t){const e=m(t);return(this.isNegative()||e.isNeg())&&b("unbound-bitwise-result","and"),y(m(this).and(e))}or(t){const e=m(t);return(this.isNegative()||e.isNeg())&&b("unbound-bitwise-result","or"),y(m(this).or(e))}xor(t){const e=m(t);return(this.isNegative()||e.isNeg())&&b("unbound-bitwise-result","xor"),y(m(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&b("negative-width","mask"),y(m(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&b("negative-width","shl"),y(m(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&b("negative-width","shr"),y(m(this).shrn(t))}eq(t){return m(this).eq(m(t))}lt(t){return m(this).lt(m(t))}lte(t){return m(this).lte(m(t))}gt(t){return m(this).gt(m(t))}gte(t){return m(this).gte(m(t))}isNegative(){return"-"===this._hex[0]}isZero(){return m(this).isZero()}toNumber(){try{return m(this).toNumber()}catch(t){b("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return u.throwError("this platform does not support BigInt",s.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?d||(d=!0,u.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?u.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):u.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),m(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof p)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new p(l,g(t)):t.match(/^-?[0-9]+$/)?new p(l,g(new c(t))):u.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&b("underflow","BigNumber.from",t),(t>=f||t<=-f)&&b("overflow","BigNumber.from",t),p.from(String(t));const e=t;if("bigint"==typeof e)return p.from(e.toString());if((0,o.isBytes)(e))return p.from((0,o.hexlify)(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return p.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&((0,o.isHexString)(t)||"-"===t[0]&&(0,o.isHexString)(t.substring(1))))return p.from(t)}return u.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function g(t){if("string"!=typeof t)return g(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&u.throwArgumentError("invalid hex","value",t),"0x00"===(t=g(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function y(t){return p.from(g(t))}function m(t){const e=p.from(t).toHexString();return"-"===e[0]?new c("-"+e.substring(3),16):new c(e.substring(2),16)}function b(t,e,r){const n={fault:t,operation:e};return null!=r&&(n.value=r),u.throwError(t,s.Logger.errors.NUMERIC_FAULT,n)}function v(t){return new c(t,36).toString(16)}function w(t){return new c(t,16).toString(36)}},20335:(t,e,r)=>{"use strict";r.d(e,{Ox:()=>g,S5:()=>p,xs:()=>m});var n=r(93286),i=r(80711),o=r(48794),s=r(2593);const a=new i.Logger(o.i),c={},u=s.O$.from(0),l=s.O$.from(-1);function f(t,e,r,n){const o={fault:e,operation:r};return void 0!==n&&(o.value=n),a.throwError(t,i.Logger.errors.NUMERIC_FAULT,o)}let h="0";for(;h.length<256;)h+=h;function d(t){if("number"!=typeof t)try{t=s.O$.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+h.substring(0,t):a.throwArgumentError("invalid decimal size","decimals",t)}function p(t,e){null==e&&(e=0);const r=d(e),n=(t=s.O$.from(t)).lt(u);n&&(t=t.mul(l));let i=t.mod(r).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",t);let o=i[0],c=i[1];for(o||(o="0"),c||(c="0");"0"===c[c.length-1];)c=c.substring(0,c.length-1);for(c.length>r.length-1&&f("fractional component exceeds decimals","underflow","parseFixed"),""===c&&(c="0");c.lengthnull==t[e]?n:(typeof t[e]!==r&&a.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new y(c,e,r,n)}}class m{constructor(t,e,r,n){t!==c&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=g(this._value,this.format.decimals),r=g(t._value,t.format.decimals);return m.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=g(this._value,this.format.decimals),r=g(t._value,t.format.decimals);return m.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=g(this._value,this.format.decimals),r=g(t._value,t.format.decimals);return m.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=g(this._value,this.format.decimals),r=g(t._value,t.format.decimals);return m.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=m.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(b.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=m.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(b.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&a.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=m.from("1"+h.substring(0,t),this.format),n=v.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(t){if(null==t)return this._hex;t%8&&a.throwArgumentError("invalid byte width","width",t);const e=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return(0,n.hexZeroPad)(e,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return m.fromString(this._value,t)}static fromValue(t,e,r){return null!=r||null==e||(0,s.Zm)(e)||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),m.fromString(p(t,e),y.from(r))}static fromString(t,e){null==e&&(e="fixed");const r=y.from(e),i=g(t,r.decimals);!r.signed&&i.lt(u)&&f("unsigned value cannot be negative","overflow","value",t);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=(0,n.hexZeroPad)(o,r.width/8));const s=p(i,r.decimals);return new m(c,o,s,r)}static fromBytes(t,e){null==e&&(e="fixed");const r=y.from(e);if((0,n.arrayify)(t).length>r.width/8)throw new Error("overflow");let i=s.O$.from(t);r.signed&&(i=i.fromTwos(r.width));const o=i.toTwos((r.signed?0:1)+r.width).toHexString(),a=p(i,r.decimals);return new m(c,o,a,r)}static from(t,e){if("string"==typeof t)return m.fromString(t,e);if((0,n.isBytes)(t))return m.fromBytes(t,e);try{return m.fromValue(t,0,e)}catch(t){if(t.code!==i.Logger.errors.INVALID_ARGUMENT)throw t}return a.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const b=m.from(1),v=m.from("0.5")},93286:(t,e,r)=>{"use strict";r.r(e),r.d(e,{arrayify:()=>u,concat:()=>l,hexConcat:()=>b,hexDataLength:()=>y,hexDataSlice:()=>m,hexStripZeros:()=>w,hexValue:()=>v,hexZeroPad:()=>E,hexlify:()=>g,isBytes:()=>c,isBytesLike:()=>s,isHexString:()=>d,joinSignature:()=>S,splitSignature:()=>A,stripZeros:()=>f,zeroPad:()=>h});const n=new(r(80711).Logger)("bytes/5.6.1");function i(t){return!!t.toHexString}function o(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function s(t){return d(t)&&!(t.length%2)||c(t)}function a(t){return"number"==typeof t&&t==t&&t%1==0}function c(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!a(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function u(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),o(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t)&&(t=t.toHexString()),d(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let t=0;tu(t))),r=e.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(r);return e.reduce(((t,e)=>(n.set(e,t),t+e.length)),0),o(n)}function f(t){let e=u(t);if(0===e.length)return e;let r=0;for(;re&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),o(r)}function d(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}const p="0123456789abcdef";function g(t,e){if(e||(e={}),"number"==typeof t){n.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=p[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),i(t))return t.toHexString();if(d(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":n.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(c(t)){let e="0x";for(let r=0;r>4]+p[15&n]}return e}return n.throwArgumentError("invalid hexlify value","value",t)}function y(t){if("string"!=typeof t)t=g(t);else if(!d(t)||t.length%2)return null;return(t.length-2)/2}function m(t,e,r){return"string"!=typeof t?t=g(t):(!d(t)||t.length%2)&&n.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function b(t){let e="0x";return t.forEach((t=>{e+=g(t).substring(2)})),e}function v(t){const e=w(g(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function w(t){"string"!=typeof t&&(t=g(t)),d(t)||n.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&n.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function A(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(s(t)){let r=u(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=g(r.slice(0,32)),e.s=g(r.slice(32,64))):65===r.length?(e.r=g(r.slice(0,32)),e.s=g(r.slice(32,64)),e.v=r[64]):n.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:n.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=g(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=h(u(e._vs),32);e._vs=g(r);const i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const o=g(r);null==e.s?e.s=o:e.s!==o&&n.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?n.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&d(e.r)?e.r=E(e.r,32):n.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&d(e.s)?e.s=E(e.s,32):n.throwArgumentError("signature missing or invalid s","signature",t);const r=u(e.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=g(r);e._vs&&(d(e._vs)||n.throwArgumentError("signature invalid _vs","signature",t),e._vs=E(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function S(t){return g(l([(t=A(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},9279:(t,e,r)=>{"use strict";r.d(e,{d:()=>n});const n="0x0000000000000000000000000000000000000000"},21046:(t,e,r)=>{"use strict";r.d(e,{$B:()=>l,Bz:()=>u,Ce:()=>c,PS:()=>f,Py:()=>a,_Y:()=>o,fh:()=>s,tL:()=>i});var n=r(2593);const i=n.O$.from(-1),o=n.O$.from(0),s=n.O$.from(1),a=n.O$.from(2),c=n.O$.from("1000000000000000000"),u=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),l=n.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),f=n.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},57218:(t,e,r)=>{"use strict";r.d(e,{R:()=>n});const n="0x0000000000000000000000000000000000000000000000000000000000000000"},35644:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="hash/5.6.1"},32046:(t,e,r)=>{"use strict";r.d(e,{id:()=>o});var n=r(38197),i=r(44242);function o(t){return(0,n.keccak256)((0,i.Y0)(t))}},75931:(t,e,r)=>{"use strict";r.r(e),r.d(e,{_TypedDataEncoder:()=>s.E,dnsEncode:()=>i.Kn,hashMessage:()=>o.r,id:()=>n.id,isValidName:()=>i.r1,messagePrefix:()=>o.B,namehash:()=>i.VM});var n=r(32046),i=r(84706),o=r(93684),s=r(67827)},93684:(t,e,r)=>{"use strict";r.d(e,{B:()=>s,r:()=>a});var n=r(93286),i=r(38197),o=r(44242);const s="Ethereum Signed Message:\n";function a(t){return"string"==typeof t&&(t=(0,o.Y0)(t)),(0,i.keccak256)((0,n.concat)([(0,o.Y0)(s),(0,o.Y0)(String(t.length)),t]))}},84706:(t,e,r)=>{"use strict";r.d(e,{Kn:()=>p,VM:()=>d,r1:()=>h});var n=r(93286),i=r(35637),o=r(44242),s=r(38197),a=r(80711),c=r(35644);const u=new a.Logger(c.i),l=new Uint8Array(32);l.fill(0);const f=new RegExp("^((.*)\\.)?([^.]+)$");function h(t){try{const e=t.split(".");for(let t=0;t{const e=(0,o.Y0)("_"+(0,i.Ll)(t));return e[0]=e.length-1,e}))))+"00"}},67827:(t,e,r)=>{"use strict";r.d(e,{E:()=>P});var n=r(64594),i=r(2593),o=r(93286),s=r(38197),a=r(53587),c=r(80711),u=r(35644),l=r(32046),f=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const h=new c.Logger(u.i),d=new Uint8Array(32);d.fill(0);const p=i.O$.from(-1),g=i.O$.from(0),y=i.O$.from(1),m=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const b=(0,o.hexZeroPad)(y.toHexString(),32),v=(0,o.hexZeroPad)(g.toHexString(),32),w={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},E=["name","version","chainId","verifyingContract","salt"];function A(t){return function(e){return"string"!=typeof e&&h.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const S={name:A("name"),version:A("version"),chainId:function(t){try{return i.O$.from(t).toString()}catch(t){}return h.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return(0,n.getAddress)(t).toLowerCase()}catch(t){}return h.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=(0,o.arrayify)(t);if(32!==e.length)throw new Error("bad length");return(0,o.hexlify)(e)}catch(t){}return h.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function k(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&h.throwArgumentError("invalid numeric width","type",t);const s=m.mask(r?n-1:n),a=r?s.add(y).mul(p):g;return function(e){const r=i.O$.from(e);return(r.lt(a)||r.gt(s))&&h.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),(0,o.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&h.throwArgumentError("invalid bytes width","type",t),function(e){return(0,o.arrayify)(e).length!==r&&h.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=(0,o.arrayify)(t),r=e.length%32;return r?(0,o.hexConcat)([e,d.slice(r)]):(0,o.hexlify)(e)}(e)}}}switch(t){case"address":return function(t){return(0,o.hexZeroPad)((0,n.getAddress)(t),32)};case"bool":return function(t){return t?b:v};case"bytes":return function(t){return(0,s.keccak256)(t)};case"string":return function(t){return(0,l.id)(t)}}return null}function x(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class P{constructor(t){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(t))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&h.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&h.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);k(s)||(r[s]||h.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?h.throwArgumentError("missing primary type","types",t):i.length>1&&h.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),(0,a.defineReadOnly)(this,"primaryType",i[0]),function i(o,s){s[o]&&h.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=x(e,t[e])+r.map((e=>x(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=k(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(s.keccak256)),(0,s.keccak256)((0,o.hexConcat)(i))}}const r=this.types[t];if(r){const e=(0,l.id)(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?(0,s.keccak256)(n):n}));return n.unshift(e),(0,o.hexConcat)(n)}}return h.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||h.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return(0,s.keccak256)(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(k(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):h.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new P(t)}static getPrimaryType(t){return P.from(t).primaryType}static hashStruct(t,e,r){return P.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=w[r];n||h.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>E.indexOf(t.name)-E.indexOf(e.name))),P.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return(0,o.hexConcat)(["0x1901",P.hashDomain(t),P.from(e).hash(r)])}static hash(t,e,r){return(0,s.keccak256)(P.encode(t,e,r))}static resolveNames(t,e,r,n){return f(this,void 0,void 0,(function*(){t=(0,a.shallowCopy)(t);const i={};t.verifyingContract&&!(0,o.isHexString)(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const s=P.from(e);s.visit(r,((t,e)=>("address"!==t||(0,o.isHexString)(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=s.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){P.hashDomain(t);const n={},s=[];E.forEach((e=>{const r=t[e];null!=r&&(n[e]=S[e](r),s.push({name:e,type:w[e]}))}));const c=P.from(e),u=(0,a.shallowCopy)(e);return u.EIP712Domain?h.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):u.EIP712Domain=s,c.encode(r),{types:u,domain:n,primaryType:c.primaryType,message:c.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.arrayify)(e));if(t.match(/^u?int/))return i.O$.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&h.throwArgumentError("invalid string","value",e),e}return h.throwArgumentError("unsupported type","type",t)}))}}}},36274:(t,e,r)=>{"use strict";r.r(e),r.d(e,{HDNode:()=>k,defaultPath:()=>S,entropyToMnemonic:()=>T,getAccountPath:()=>O,isValidMnemonic:()=>_,mnemonicToEntropy:()=>P,mnemonicToSeed:()=>x});var n=r(57727),i=r(93286),o=r(2593),s=r(44242),a=r(85306),c=r(53587),u=r(62768),l=r(77158),f=r(21261),h=r(13479),d=r(9855);const p=new(r(80711).Logger)("hdnode/5.6.2"),g=o.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y=(0,s.Y0)("Bitcoin seed"),m=2147483648;function b(t){return(1<=256)throw new Error("Depth too large!");return w((0,i.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,i.hexlify)(this.depth),this.parentFingerprint,(0,i.hexZeroPad)((0,i.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,i.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new k(A,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(t){if(t>4294967295)throw new Error("invalid index - "+String(t));let e=this.path;e&&(e+="/"+(2147483647&t));const r=new Uint8Array(37);if(t&m){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,i.arrayify)(this.privateKey),1),e&&(e+="'")}else r.set((0,i.arrayify)(this.publicKey));for(let e=24;e>=0;e-=8)r[33+(e>>3)]=t>>24-e&255;const n=(0,i.arrayify)((0,l.Gy)(f.p.sha512,this.chainCode,r)),s=n.slice(0,32),a=n.slice(32);let c=null,h=null;if(this.privateKey)c=v(o.O$.from(s).add(this.privateKey).mod(g));else{h=new u.SigningKey((0,i.hexlify)(s))._addPoint(this.publicKey)}let d=e;const p=this.mnemonic;return p&&(d=Object.freeze({phrase:p.phrase,path:e,locale:p.locale||"en"})),new k(A,c,h,this.fingerprint,v(a),t,this.depth+1,d)}derivePath(t){const e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();let r=this;for(let t=0;t=m)throw new Error("invalid path index - "+n);r=r._derive(m+t)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const t=parseInt(n);if(t>=m)throw new Error("invalid path index - "+n);r=r._derive(t)}}}return r}static _fromSeed(t,e){const r=(0,i.arrayify)(t);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=(0,i.arrayify)((0,l.Gy)(f.p.sha512,y,r));return new k(A,v(n.slice(0,32)),null,"0x00000000",v(n.slice(32)),0,0,e)}static fromMnemonic(t,e,r){return t=T(P(t,r=E(r)),r),k._fromSeed(x(t,e),{phrase:t,path:"m",locale:r.locale})}static fromSeed(t){return k._fromSeed(t,null)}static fromExtendedKey(t){const e=n.Base58.decode(t);82===e.length&&w(e.slice(0,78))===t||p.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=e[4],o=(0,i.hexlify)(e.slice(5,9)),s=parseInt((0,i.hexlify)(e.slice(9,13)).substring(2),16),a=(0,i.hexlify)(e.slice(13,45)),c=e.slice(45,78);switch((0,i.hexlify)(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new k(A,null,(0,i.hexlify)(c),o,a,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new k(A,(0,i.hexlify)(c.slice(1)),null,o,a,s,r,null)}return p.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function x(t,e){e||(e="");const r=(0,s.Y0)("mnemonic"+e,s.Uj.NFKD);return(0,a.n)((0,s.Y0)(t,s.Uj.NFKD),r,2048,64,"sha512")}function P(t,e){e=E(e),p.checkNormalize();const r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=(0,i.arrayify)(new Uint8Array(Math.ceil(11*r.length/8)));let o=0;for(let t=0;t>3]|=1<<7-o%8),o++}const s=32*r.length/3,a=b(r.length/3);if(((0,i.arrayify)((0,l.JQ)(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return(0,i.hexlify)(n.slice(0,s/8))}function T(t,e){if(e=E(e),(t=(0,i.arrayify)(t)).length%4!=0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let e=0;e8?(r[r.length-1]<<=8,r[r.length-1]|=t[e],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[e]>>8-n,r.push(t[e]&(1<<8-n)-1),n+=3);const o=t.length/4,s=(0,i.arrayify)((0,l.JQ)(t))[0]&b(o);return r[r.length-1]<<=o,r[r.length-1]|=s>>8-o,e.join(r.map((t=>e.getWord(t))))}function _(t,e){try{return P(t,e),!0}catch(t){}return!1}function O(t){return("number"!=typeof t||t<0||t>=m||t%1)&&p.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}},29816:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="json-wallets/5.6.1"},19380:(t,e,r)=>{"use strict";r.r(e),r.d(e,{decryptCrowdsale:()=>y,decryptJsonWallet:()=>v,decryptJsonWalletSync:()=>w,decryptKeystore:()=>b.pe,decryptKeystoreSync:()=>b.hb,encryptKeystore:()=>b.HI,getJsonWalletAddress:()=>m.Rb,isCrowdsaleWallet:()=>m.LW,isKeystoreWallet:()=>m.aO});var n=r(48709),i=r.n(n),o=r(64594),s=r(93286),a=r(38197),c=r(85306),u=r(44242),l=r(53587),f=r(80711),h=r(29816),d=r(97013);const p=new f.Logger(h.i);class g extends l.Description{isCrowdsaleAccount(t){return!(!t||!t._isCrowdsaleAccount)}}function y(t,e){const r=JSON.parse(t);e=(0,d.Ij)(e);const n=(0,o.getAddress)((0,d.gx)(r,"ethaddr")),l=(0,d.p3)((0,d.gx)(r,"encseed"));l&&l.length%16==0||p.throwArgumentError("invalid encseed","json",t);const f=(0,s.arrayify)((0,c.n)(e,e,2e3,32,"sha256")).slice(0,16),h=l.slice(0,16),y=l.slice(16),m=new(i().ModeOfOperation.cbc)(f,h),b=i().padding.pkcs7.strip((0,s.arrayify)(m.decrypt(y)));let v="";for(let t=0;t{"use strict";r.d(e,{LW:()=>i,Rb:()=>s,aO:()=>o});var n=r(64594);function i(t){let e=null;try{e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function o(t){let e=null;try{e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}function s(t){if(i(t))try{return(0,n.getAddress)(JSON.parse(t).ethaddr)}catch(t){return null}if(o(t))try{return(0,n.getAddress)(JSON.parse(t).address)}catch(t){return null}return null}},81964:(t,e,r)=>{"use strict";r.d(e,{HI:()=>_,hb:()=>P,pe:()=>T});var n=r(48709),i=r.n(n),o=r(17635),s=r.n(o),a=r(64594),c=r(93286),u=r(36274),l=r(38197),f=r(85306),h=r(44478),d=r(53587),p=r(13479),g=r(97013),y=r(80711),m=r(29816),b=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const v=new y.Logger(m.i);function w(t){return null!=t&&t.mnemonic&&t.mnemonic.phrase}class E extends d.Description{isKeystoreAccount(t){return!(!t||!t._isKeystoreAccount)}}function A(t,e){const r=(0,g.p3)((0,g.gx)(t,"crypto/ciphertext"));if((0,c.hexlify)((0,l.keccak256)((0,c.concat)([e.slice(16,32),r]))).substring(2)!==(0,g.gx)(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(t,e,r){if("aes-128-ctr"===(0,g.gx)(t,"crypto/cipher")){const n=(0,g.p3)((0,g.gx)(t,"crypto/cipherparams/iv")),o=new(i().Counter)(n),s=new(i().ModeOfOperation.ctr)(e,o);return(0,c.arrayify)(s.decrypt(r))}return null}(t,e.slice(0,16),r);n||v.throwError("unsupported cipher",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const o=e.slice(32,64),s=(0,p.computeAddress)(n);if(t.address){let e=t.address.toLowerCase();if("0x"!==e.substring(0,2)&&(e="0x"+e),(0,a.getAddress)(e)!==s)throw new Error("address mismatch")}const f={_isKeystoreAccount:!0,address:s,privateKey:(0,c.hexlify)(n)};if("0.1"===(0,g.gx)(t,"x-ethers/version")){const e=(0,g.p3)((0,g.gx)(t,"x-ethers/mnemonicCiphertext")),r=(0,g.p3)((0,g.gx)(t,"x-ethers/mnemonicCounter")),n=new(i().Counter)(r),s=new(i().ModeOfOperation.ctr)(o,n),a=(0,g.gx)(t,"x-ethers/path")||u.defaultPath,l=(0,g.gx)(t,"x-ethers/locale")||"en",h=(0,c.arrayify)(s.decrypt(e));try{const t=(0,u.entropyToMnemonic)(h,l),e=u.HDNode.fromMnemonic(t,null,l).derivePath(a);if(e.privateKey!=f.privateKey)throw new Error("mnemonic mismatch");f.mnemonic=e.mnemonic}catch(t){if(t.code!==y.Logger.errors.INVALID_ARGUMENT||"wordlist"!==t.argument)throw t}}return new E(f)}function S(t,e,r,n,i){return(0,c.arrayify)((0,f.n)(t,e,r,n,i))}function k(t,e,r,n,i){return Promise.resolve(S(t,e,r,n,i))}function x(t,e,r,n,i){const o=(0,g.Ij)(e),s=(0,g.gx)(t,"crypto/kdf");if(s&&"string"==typeof s){const e=function(t,e){return v.throwArgumentError("invalid key-derivation function parameters",t,e)};if("scrypt"===s.toLowerCase()){const r=(0,g.p3)((0,g.gx)(t,"crypto/kdfparams/salt")),a=parseInt((0,g.gx)(t,"crypto/kdfparams/n")),c=parseInt((0,g.gx)(t,"crypto/kdfparams/r")),u=parseInt((0,g.gx)(t,"crypto/kdfparams/p"));a&&c&&u||e("kdf",s),0!=(a&a-1)&&e("N",a);const l=parseInt((0,g.gx)(t,"crypto/kdfparams/dklen"));return 32!==l&&e("dklen",l),n(o,r,a,c,u,64,i)}if("pbkdf2"===s.toLowerCase()){const n=(0,g.p3)((0,g.gx)(t,"crypto/kdfparams/salt"));let i=null;const s=(0,g.gx)(t,"crypto/kdfparams/prf");"hmac-sha256"===s?i="sha256":"hmac-sha512"===s?i="sha512":e("prf",s);const a=parseInt((0,g.gx)(t,"crypto/kdfparams/c")),c=parseInt((0,g.gx)(t,"crypto/kdfparams/dklen"));return 32!==c&&e("dklen",c),r(o,n,a,c,i)}}return v.throwArgumentError("unsupported key-derivation function","kdf",s)}function P(t,e){const r=JSON.parse(t);return A(r,x(r,e,S,s().syncScrypt))}function T(t,e,r){return b(this,void 0,void 0,(function*(){const n=JSON.parse(t);return A(n,yield x(n,e,k,s().scrypt,r))}))}function _(t,e,r,n){try{if((0,a.getAddress)(t.address)!==(0,p.computeAddress)(t.privateKey))throw new Error("address/privateKey mismatch");if(w(t)){const e=t.mnemonic;if(u.HDNode.fromMnemonic(e.phrase,null,e.locale).derivePath(e.path||u.defaultPath).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(t){return Promise.reject(t)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const o=(0,c.arrayify)(t.privateKey),f=(0,g.Ij)(e);let d=null,y=null,m=null;if(w(t)){const e=t.mnemonic;d=(0,c.arrayify)((0,u.mnemonicToEntropy)(e.phrase,e.locale||"en")),y=e.path||u.defaultPath,m=e.locale||"en"}let b=r.client;b||(b="ethers.js");let v=null;v=r.salt?(0,c.arrayify)(r.salt):(0,h.O)(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,h.O)(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,h.O)(16);let S=1<<17,k=8,x=1;return r.scrypt&&(r.scrypt.N&&(S=r.scrypt.N),r.scrypt.r&&(k=r.scrypt.r),r.scrypt.p&&(x=r.scrypt.p)),s().scrypt(f,v,S,k,x,64,n).then((e=>{const r=(e=(0,c.arrayify)(e)).slice(0,16),n=e.slice(16,32),s=e.slice(32,64),a=new(i().Counter)(E),u=new(i().ModeOfOperation.ctr)(r,a),f=(0,c.arrayify)(u.encrypt(o)),p=(0,l.keccak256)((0,c.concat)([n,f])),w={address:t.address.substring(2).toLowerCase(),id:(0,g.EH)(A),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,c.hexlify)(E).substring(2)},ciphertext:(0,c.hexlify)(f).substring(2),kdf:"scrypt",kdfparams:{salt:(0,c.hexlify)(v).substring(2),n:S,dklen:32,p:x,r:k},mac:p.substring(2)}};if(d){const t=(0,h.O)(16),e=new(i().Counter)(t),r=new(i().ModeOfOperation.ctr)(s,e),n=(0,c.arrayify)(r.encrypt(d)),o=new Date,a=o.getUTCFullYear()+"-"+(0,g.VP)(o.getUTCMonth()+1,2)+"-"+(0,g.VP)(o.getUTCDate(),2)+"T"+(0,g.VP)(o.getUTCHours(),2)+"-"+(0,g.VP)(o.getUTCMinutes(),2)+"-"+(0,g.VP)(o.getUTCSeconds(),2)+".0Z";w["x-ethers"]={client:b,gethFilename:"UTC--"+a+"--"+w.address,mnemonicCounter:(0,c.hexlify)(t).substring(2),mnemonicCiphertext:(0,c.hexlify)(n).substring(2),path:y,locale:m,version:"0.1"}}return JSON.stringify(w)}))}},97013:(t,e,r)=>{"use strict";r.d(e,{EH:()=>u,Ij:()=>a,VP:()=>s,gx:()=>c,p3:()=>o});var n=r(93286),i=r(44242);function o(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),(0,n.arrayify)(t)}function s(t,e){for(t=String(t);t.length255)return!1;return!0}function i(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!n(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&n(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function o(t){return new Uint8Array(t)}function s(t,e,r,n,i){null==n&&null==i||(t=t.slice?t.slice(n,i):Array.prototype.slice.call(t,n,i)),e.set(t,r)}var a,c={toBytes:function(t){var e=[],r=0;for(t=encodeURI(t);r191&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},u=(a="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r>4]+a[15&n])}return e.join("")}}),l={16:10,24:12,32:14},f=[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],h=[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],d=[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],g=[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],y=[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],m=[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],b=[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],v=[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],w=[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],S=[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],k=[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],x=[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 P(t){for(var e=[],r=0;r>2,this._Ke[r][e%4]=o[e],this._Kd[t-r][e%4]=o[e];for(var s,a=0,c=i;c>16&255]<<24^h[s>>8&255]<<16^h[255&s]<<8^h[s>>24&255]^f[a]<<24,a+=1,8!=i)for(e=1;e>8&255]<<8^h[s>>16&255]<<16^h[s>>24&255]<<24;for(e=i/2+1;e>2,d=c%4,this._Ke[u][d]=o[e],this._Kd[t-u][d]=o[e++],c++}for(var u=1;u>24&255]^S[s>>16&255]^k[s>>8&255]^x[255&s]},T.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=P(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s>24&255]^g[n[(i+1)%4]>>16&255]^y[n[(i+2)%4]>>8&255]^m[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Ke[e][i],c[4*i]=255&(h[n[i]>>24&255]^a>>24),c[4*i+1]=255&(h[n[(i+1)%4]>>16&255]^a>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(h[255&n[(i+3)%4]]^a);return c},T.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=P(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^E[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Kd[e][i],c[4*i]=255&(d[n[i]>>24&255]^a>>24),c[4*i+1]=255&(d[n[(i+3)%4]>>16&255]^a>>16),c[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(d[255&n[(i+1)%4]]^a);return c};var _=function(t){if(!(this instanceof _))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new T(t)};_.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=o(t.length),r=o(16),n=0;n=0;--e)this._counter[e]=t%256,t>>=8},M.prototype.setBytes=function(t){if(16!=(t=i(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},M.prototype.increment=function(){for(var t=15;t>=0;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var N=function(t,e){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof M||(e=new M(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new T(t)};N.prototype.encrypt=function(t){for(var e=i(t,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n{"use strict";r.r(e),r.d(e,{keccak256:()=>s});var n=r(91094),i=r.n(n),o=r(93286);function s(t){return"0x"+i().keccak_256((0,o.arrayify)(t))}},80711:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ErrorCode:()=>l,LogLevel:()=>u,Logger:()=>h});let n=!1,i=!1;const o={debug:1,default:2,info:2,warning:3,error:4,off:5};let s=o.default,a=null;const c=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var u,l;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(u||(u={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(l||(l={}));const f="0123456789abcdef";class h{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==o[r]&&this.throwArgumentError("invalid log level name","logLevel",t),s>o[r]||console.log.apply(console,e)}debug(...t){this._log(h.levels.DEBUG,t)}info(...t){this._log(h.levels.INFO,t)}warn(...t){this._log(h.levels.WARNING,t)}makeError(t,e,r){if(i)return this.makeError("censored error",e,{});e||(e=h.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=f[15&e[t]];n.push(t+"=Uint8Array(0x"+r+")")}else n.push(t+"="+JSON.stringify(e))}catch(e){n.push(t+"="+JSON.stringify(r[t].toString()))}})),n.push(`code=${e}`),n.push(`version=${this.version}`);const o=t;let s="";switch(e){case l.NUMERIC_FAULT:{s="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":s+="-"+e;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case l.CALL_EXCEPTION:case l.INSUFFICIENT_FUNDS:case l.MISSING_NEW:case l.NONCE_EXPIRED:case l.REPLACEMENT_UNDERPRICED:case l.TRANSACTION_REPLACED:case l.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(t+=" ("+n.join(", ")+")");const a=new Error(t);return a.reason=o,a.code=e,Object.keys(r).forEach((function(t){a[t]=r[t]})),a}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,h.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),c&&this.throwError("platform missing String.prototype.normalize",h.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:c})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,h.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",h.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",h.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",h.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return a||(a=new h("logger/5.6.0")),a}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!t)return;this.globalLogger().throwError("error censorship permanent",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!t,n=!!e}static setLogLevel(t){const e=o[t.toLowerCase()];null!=e?s=e:h.globalLogger().warn("invalid log level - "+t)}static from(t){return new h(t)}}h.errors=l,h.levels=u},79861:(t,e,r)=>{"use strict";r.d(e,{H:()=>l});const n=new(r(80711).Logger)("networks/5.6.4");function i(t){const e=function(e,r){null==r&&(r={});const n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby"];try{const o=new e.PocketProvider(t,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new e.AnkrProvider(t,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(n,i)}return n[0]};return e.renetwork=function(t){return i(t)},e}function o(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return o(t,e)},r}const s={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:i("homestead")},a={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:i("ropsten")},c={chainId:63,name:"classicMordor",_defaultProvider:o("https://www.ethercluster.com/mordor","classicMordor")},u={unspecified:{chainId:0,name:"unspecified"},homestead:s,mainnet:s,morden:{chainId:2,name:"morden"},ropsten:a,testnet:a,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:i("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:i("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:i("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:o("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:c,classicTestnet:c,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:o("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:i("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:i("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function l(t){if(null==t)return null;if("number"==typeof t){for(const e in u){const r=u[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=u[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=u[t.name];if(!e)return"number"!=typeof t.chainId&&n.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&n.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;var i;return null==r&&e._defaultProvider&&(r=(i=e._defaultProvider)&&"function"==typeof i.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}},85306:(t,e,r)=>{"use strict";r.d(e,{n:()=>o});var n=r(93286),i=r(77158);function o(t,e,r,o,s){let a;t=(0,n.arrayify)(t),e=(0,n.arrayify)(e);let c=1;const u=new Uint8Array(o),l=new Uint8Array(e.length+4);let f,h;l.set(e);for(let d=1;d<=c;d++){l[e.length]=d>>24&255,l[e.length+1]=d>>16&255,l[e.length+2]=d>>8&255,l[e.length+3]=255&d;let p=(0,n.arrayify)((0,i.Gy)(s,t,l));a||(a=p.length,h=new Uint8Array(a),c=Math.ceil(o/a),f=o-(c-1)*a),h.set(p);for(let e=1;e{"use strict";r.r(e),r.d(e,{Description:()=>g,checkProperties:()=>u,deepCopy:()=>p,defineReadOnly:()=>s,getStatic:()=>a,resolveProperties:()=>c,shallowCopy:()=>l});var n=r(80711);var i=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const o=new n.Logger("properties/5.6.0");function s(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function a(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!=typeof t.prototype)break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function c(t){return i(this,void 0,void 0,(function*(){const e=Object.keys(t).map((e=>{const r=t[e];return Promise.resolve(r).then((t=>({key:e,value:t})))}));return(yield Promise.all(e)).reduce(((t,e)=>(t[e.key]=e.value,t)),{})}))}function u(t,e){t&&"object"==typeof t||o.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||o.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}function l(t){const e={};for(const r in t)e[r]=t[r];return e}const f={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function h(t){if(null==t||f[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rp(t))));if("object"==typeof t){const e={};for(const r in t){const n=t[r];void 0!==n&&s(e,r,p(n))}return e}return o.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function p(t){return d(t)}class g{constructor(t){for(const e in t)this[e]=p(t[e])}}},34216:(t,e,r)=>{"use strict";r.d(e,{i:()=>n});const n="providers/5.6.8"},75361:(t,e,r)=>{"use strict";r.d(e,{H2:()=>j,Zk:()=>H});var n=r(64353),i=r(59567),o=r(57727),s=r(2593),a=r(93286),c=r(57218),u=r(84706),l=r(79861),f=r(53587),h=r(77158),d=r(44242),p=r(58341),g=r(92882),y=r.n(g),m=r(80711),b=r(34216),v=r(30032),w=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const E=new m.Logger(b.i);function A(t){return null==t?"null":(32!==(0,a.hexDataLength)(t)&&E.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function S(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[A(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return A(t)})).join("&")}function k(t){if("string"==typeof t){if(t=t.toLowerCase(),32===(0,a.hexDataLength)(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+S(t);if(n.Sg.isForkEvent(t))throw E.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+S(t.topics||[])}throw new Error("invalid event - "+t)}function x(){return(new Date).getTime()}function P(t){return new Promise((e=>{setTimeout(e,t)}))}const T=["block","network","pending","poll"];class _{constructor(t,e,r){(0,f.defineReadOnly)(this,"tag",t),(0,f.defineReadOnly)(this,"listener",e),(0,f.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],r=""===(n=t[2])?[]:n.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var n;const i={};return r.length>0&&(i.topics=r),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||T.indexOf(this.tag)>=0}}const O={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function I(t){return(0,a.hexZeroPad)(s.O$.from(t).toHexString(),32)}function B(t){return o.Base58.encode((0,a.concat)([t,(0,a.hexDataSlice)((0,h.JQ)((0,h.JQ)(t)),0,4)]))}const M=new RegExp("^(ipfs)://(.*)$","i"),N=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),M,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function C(t,e){try{return(0,d.ZN)(L(t,e))}catch(t){}return null}function L(t,e){if("0x"===t)return null;const r=s.O$.from((0,a.hexDataSlice)(t,e,e+32)).toNumber(),n=s.O$.from((0,a.hexDataSlice)(t,r,r+32)).toNumber();return(0,a.hexDataSlice)(t,r+32,r+32+n)}function R(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):E.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function U(t){const e=(0,a.arrayify)(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function D(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function F(t){const e=[];let r=0;for(let n=0;ns.O$.from(t).eq(1))).catch((t=>{if(t.code===m.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return w(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:(0,a.hexConcat)([t,(0,u.VM)(this.name),e||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,a.hexConcat)(["0x9061b923",F([(0,u.Kn)(this.name),r.data])]));try{let t=yield this.provider.call(r);return(0,a.arrayify)(t).length%32==4&&E.throwError("resolver threw error",m.Logger.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=L(t,0)),t}catch(t){if(t.code===m.Logger.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return w(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?L(r,0):null}))}_getAddress(t,e){const r=O[String(t)];if(null==r&&E.throwError(`unsupported coin type: ${t}`,m.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=(0,a.arrayify)(e);if(null!=r.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return B((0,a.concat)([[r.p2pkh],"0x"+t[2]]))}}if(null!=r.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return B((0,a.concat)([[r.p2sh],"0x"+t[2]]))}}if(null!=r.prefix){const t=n[1];let e=n[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&n.length===2+t&&t>=1&&t<=75){const t=y().toWords(n.slice(2));return t.unshift(e),y().encode(r.prefix,t)}}return null}getAddress(t){return w(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||t===c.R?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===m.Logger.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",I(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&E.throwError("invalid or unsupported coin data",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return w(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let r=0;rt[e]))}return E.throwError("invalid or unsupported content hash data",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return w(this,void 0,void 0,(function*(){let e=(0,d.Y0)(t);e=(0,a.concat)([I(64),I(e.length),e]),e.length%32!=0&&(e=(0,a.concat)([e,(0,a.hexZeroPad)("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",(0,a.hexlify)(e));return null==r||"0x"===r?null:(0,d.ZN)(r)}))}}let V=null,G=1;class H extends n.zt{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,f.defineReadOnly)(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=(0,f.getStatic)(new.target,"getNetwork")(t);e?((0,f.defineReadOnly)(this,"_network",e),this.emit("network",e,null)):E.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return w(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||E.throwError("no network detected",m.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return(0,p.poll)((()=>this._ready().then((t=>t),(t=>{if(t.code!==m.Logger.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==V&&(V=new v.Mb),V}static getNetwork(t){return(0,l.H)(null==t?"homestead":t)}ccipReadFetch(t,e,r){return w(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t=0?null:JSON.stringify({data:i,sender:n}),c=yield(0,p.fetchJson)({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return E.throwError(`response not found during CCIP fetch: ${u}`,m.Logger.errors.SERVER_ERROR,{url:e,errorMessage:u});o.push(u)}return E.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,m.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return w(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const r=yield e;if(x()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=x(),r=(0,f.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=x();return(t=s.O$.from(t).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return w(this,void 0,void 0,(function*(){const t=G++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)E.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",E.makeError("network block skew detected",m.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let t=this._emitted.block+1;t<=r;t++)this.emit("block",t);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((t=>{switch(t.type){case"tx":{const r=t.hash;let n=this.getTransactionReceipt(r).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+r]=t.blockNumber,this.emit(r,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(n);break}case"filter":if(!t._inflight){t._inflight=!0;const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=r,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const i=this.getLogs(n).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(n,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=r,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return w(this,void 0,void 0,(function*(){return E.throwError("provider does not support network detection",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return w(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield P(0),this._network;const r=E.makeError("underlying network changed",m.Logger.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=x();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&tthis._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return w(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return w(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},u=t=>{t.confirmations{this.removeListener(t,u)})),n){let r=n.startBlock,i=null;const u=s=>w(this,void 0,void 0,(function*(){a||(yield P(1e3),this.getTransactionCount(n.from).then((l=>w(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=r-3,i{a||this.once("block",u)})))}));if(a)return;this.once("block",u),s.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{c()||o(E.makeError("timeout exceeded",m.Logger.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return w(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return s.O$.from(t)}catch(e){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return s.O$.from(n)}catch(t){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return s.O$.from(n).toNumber()}catch(t){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return(0,a.hexlify)(n)}catch(t){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,f.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>(0,a.hexValue)(t)))}),i=yield this.perform("getStorageAt",n);try{return(0,a.hexlify)(i)}catch(t){return E.throwError("bad result from backend",m.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==(0,a.hexDataLength)(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&E.throwError("Transaction hash mismatch from Provider.sendTransaction.",m.Logger.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>w(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});const o=yield this._waitForTransaction(t.hash,e,n,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&E.throwError("transaction failed",m.Logger.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>(0,a.hexlify)(t))),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,t,n)}catch(t){throw t.transaction=r,t.transactionHash=r.hash,t}}))}_getTransactionRequest(t){return w(this,void 0,void 0,(function*(){const e=yield t,r={};return["from","to"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?s.O$.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?(0,a.hexlify)(t):null)))})),this.formatter.transactionRequest(yield(0,f.resolveProperties)(r))}))}_getFilter(t){return w(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((r=>{null!=t[r]&&(e[r]=t[r])})),["fromBlock","toBlock"].forEach((r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))})),this.formatter.filter(yield(0,f.resolveProperties)(e))}))}_call(t,e,r){return w(this,void 0,void 0,(function*(){r>=10&&E.throwError("CCIP read exceeded maximum redirections",m.Logger.errors.SERVER_ERROR,{redirects:r,transaction:t});const n=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===i.substring(0,10)&&(0,a.hexDataLength)(i)%32==4)try{const o=(0,a.hexDataSlice)(i,4),c=(0,a.hexDataSlice)(o,0,32);s.O$.from(c).eq(n)||E.throwError("CCIP Read sender did not match",m.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const u=[],l=s.O$.from((0,a.hexDataSlice)(o,32,64)).toNumber(),f=s.O$.from((0,a.hexDataSlice)(o,l,l+32)).toNumber(),h=(0,a.hexDataSlice)(o,l+32);for(let e=0;ew(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let e=null;for(let r=0;rthis._wrapTransaction(t))),r}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return w(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return(0,p.poll)((()=>w(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(t){return w(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return(0,p.poll)((()=>w(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return n}))),{oncePoll:this})}))}getLogs(t){return w(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield(0,f.resolveProperties)({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),v.Mb.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return w(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return w(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&E.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return w(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const r=yield this._getResolver(e,"getResolver");if(null!=r){const n=new j(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return w(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||E.throwError("network does not support ENS",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+(0,u.VM)(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return w(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if((0,a.isHexString)(t))throw e}"string"!=typeof t&&E.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return w(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;const n=C(yield this.call({to:r,data:"0x691f3431"+(0,u.VM)(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return w(this,void 0,void 0,(function*(){let e=null;if((0,a.isHexString)(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new j(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==m.Logger.errors.CALL_EXCEPTION)throw t}try{const t=C(yield this.call({to:n,data:"0x691f3431"+(0,u.VM)(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==m.Logger.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const r=yield e.getAvatar();return null==r?null:r.url}))}perform(t,e){return E.throwError(t+" not implemented",m.Logger.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,r){const n=new _(k(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],i=k(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),r=!0,!t.once||(n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),r}listenerCount(t){if(!t)return this._events.length;let e=k(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=k(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const r=[];let n=!1,i=k(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!n||(n=!0,r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const r=k(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}},30032:(t,e,r)=>{"use strict";r.d(e,{Ed:()=>d,Gp:()=>p,Mb:()=>h,vh:()=>y});var n=r(64594),i=r(2593),o=r(93286),s=r(9279),a=r(53587),c=r(13479),u=r(80711),l=r(34216);const f=new u.Logger(l.i);class h{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),c=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:h.allowNull(this.accessList.bind(this),null),blockHash:h.allowNull(o,null),blockNumber:h.allowNull(c,null),transactionIndex:h.allowNull(c,null),confirmations:h.allowNull(c,null),from:e,gasPrice:h.allowNull(r),maxPriorityFeePerGas:h.allowNull(r),maxFeePerGas:h.allowNull(r),gasLimit:r,to:h.allowNull(e,null),value:r,nonce:c,data:i,r:h.allowNull(this.uint256),s:h.allowNull(this.uint256),v:h.allowNull(c),creates:h.allowNull(e,null),raw:h.allowNull(i)},t.transactionRequest={from:h.allowNull(e),nonce:h.allowNull(c),gasLimit:h.allowNull(r),gasPrice:h.allowNull(r),maxPriorityFeePerGas:h.allowNull(r),maxFeePerGas:h.allowNull(r),to:h.allowNull(e),value:h.allowNull(r),data:h.allowNull((t=>this.data(t,!0))),type:h.allowNull(c),accessList:h.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:e,topics:h.arrayOf(o),data:i,logIndex:c,blockHash:o},t.receipt={to:h.allowNull(this.address,null),from:h.allowNull(this.address,null),contractAddress:h.allowNull(e,null),transactionIndex:c,root:h.allowNull(s),gasUsed:r,logsBloom:h.allowNull(i),blockHash:o,transactionHash:o,logs:h.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:h.allowNull(c,null),cumulativeGasUsed:r,effectiveGasPrice:h.allowNull(r),status:h.allowNull(c),type:u},t.block={hash:h.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:h.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:h.allowNull(e),extraData:i,transactions:h.allowNull(h.arrayOf(o)),baseFeePerGas:h.allowNull(r)},t.blockWithTransactions=(0,a.shallowCopy)(t.block),t.blockWithTransactions.transactions=h.allowNull(h.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:h.allowNull(n,void 0),toBlock:h.allowNull(n,void 0),blockHash:h.allowNull(o,void 0),address:h.allowNull(e,void 0),topics:h.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:h.allowNull(c),blockHash:h.allowNull(o),transactionIndex:c,removed:h.allowNull(this.boolean.bind(this)),address:e,data:h.allowFalsish(i,"0x"),topics:h.arrayOf(o),transactionHash:o,logIndex:c},t}accessList(t){return(0,c.accessListify)(t||[])}number(t){return"0x"===t?0:i.O$.from(t).toNumber()}type(t){return"0x"===t||null==t?0:i.O$.from(t).toNumber()}bigNumber(t){return i.O$.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),(0,o.isHexString)(t))?t.toLowerCase():f.throwArgumentError("invalid hash","value",t)}data(t,e){const r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}address(t){return(0,n.getAddress)(t)}callAddress(t){if(!(0,o.isHexString)(t,32))return null;const e=(0,n.getAddress)((0,o.hexDataSlice)(t,12));return e===s.d?null:e}contractAddress(t){return(0,n.getContractAddress)(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||(0,o.isHexString)(t))return(0,o.hexValue)(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==(0,o.hexDataLength)(r)?f.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=i.O$.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!(0,o.isHexString)(t))throw new Error("invalid uint256");return(0,o.hexZeroPad)(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const r=null!=t._difficulty?t._difficulty:t.difficulty,n=h.check(e,t);return n._difficulty=null==r?null:i.O$.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return h.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&i.O$.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=h.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),"number"!=typeof r&&null!=e.v&&(r=(e.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),e.chainId=r}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return(0,c.parse)(t)}receiptLog(t){return h.check(this.formats.receiptLog,t)}receipt(t){const e=h.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=i.O$.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&f.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):f.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&f.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return h.check(this.formats.filter,t)}filterLog(t){return h.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const n in t)try{const i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}static allowNull(t,e){return function(r){return null==r?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const r=[];return e.forEach((function(e){r.push(t(e))})),r}}}function d(t){return t&&"function"==typeof t.isCommunityResource}function p(t){return d(t)&&t.isCommunityResource()}let g=!1;function y(){g||(g=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}},82169:(t,e,r)=>{"use strict";r.d(e,{C:()=>S,r:()=>P});var n=r(48171),i=r(2593),o=r(93286),s=r(67827),a=r(53587),c=r(44242),u=r(13479),l=r(58341),f=r(80711),h=r(34216),d=r(75361),p=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const g=new f.Logger(h.i),y=["call","estimateGas"];function m(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const r=(0,o.isHexString)(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"==typeof t){for(const r in t){const n=m(t[r],e);if(n)return n}return null}if("string"==typeof t)try{return m(JSON.parse(t),e)}catch(t){}return null}function b(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=m(e,!0);if(t)return t.data;g.throwError("missing revert data in call exception; Transaction reverted without a reason string",f.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=m(e.body,!1);null==r&&(r=m(e,!1)),r&&g.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",f.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===f.Logger.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&g.throwError("insufficient funds for intrinsic transaction cost",f.Logger.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&g.throwError("nonce has already been used",f.Logger.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&g.throwError("replacement fee too low",f.Logger.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&g.throwError("legacy pre-eip-155 transactions not supported",f.Logger.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),y.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&g.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",f.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function v(t){return new Promise((function(e){setTimeout(e,t)}))}function w(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function E(t){return t?t.toLowerCase():t}const A={};class S extends n.E{constructor(t,e,r){if(super(),t!==A)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,a.defineReadOnly)(this,"provider",e),null==r&&(r=0),"string"==typeof r?((0,a.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,a.defineReadOnly)(this,"_index",null)):"number"==typeof r?((0,a.defineReadOnly)(this,"_index",r),(0,a.defineReadOnly)(this,"_address",null)):g.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return g.throwError("cannot alter JSON-RPC Signer connection",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new k(A,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&g.throwError("unknown account #"+this._index,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=(0,a.shallowCopy)(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=(0,a.shallowCopy)(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>p(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&g.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),(0,a.resolveProperties)({tx:(0,a.resolveProperties)(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&g.throwArgumentError("from address mismatch","transaction",t):e.from=r;const n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((t=>t),(t=>b("sendTransaction",t,n)))}))}signTransaction(t){return g.throwError("signing transactions is unsupported",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return p(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield(0,l.poll)((()=>p(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=r,t}}))}signMessage(t){return p(this,void 0,void 0,(function*(){const e="string"==typeof t?(0,c.Y0)(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[(0,o.hexlify)(e),r.toLowerCase()])}))}_legacySignMessage(t){return p(this,void 0,void 0,(function*(){const e="string"==typeof t?(0,c.Y0)(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,o.hexlify)(e)])}))}_signTypedData(t,e,r){return p(this,void 0,void 0,(function*(){const n=yield s.E.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(s.E.getPayload(n.domain,e,n.value))])}))}unlock(t){return p(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class k extends S{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const x={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class P extends d.Zk{constructor(t,e){let r=e;null==r&&(r=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(r),t||(t=(0,a.getStatic)(this.constructor,"defaultUrl")()),"string"==typeof t?(0,a.defineReadOnly)(this,"connection",Object.freeze({url:t})):(0,a.defineReadOnly)(this,"connection",Object.freeze((0,a.shallowCopy)(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return p(this,void 0,void 0,(function*(){yield v(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=(0,a.getStatic)(this.constructor,"getNetwork");try{return e(i.O$.from(t).toNumber())}catch(e){return g.throwError("could not detect network",f.Logger.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return g.throwError("could not detect network",f.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new S(A,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,a.deepCopy)(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=(0,l.fetchJson)(this.connection,JSON.stringify(r),w).then((t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t}));return n&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[E(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[E(e.address),e.blockTag]];case"getCode":return["eth_getCode",[E(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[E(e.address),(0,o.hexZeroPad)(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[(0,a.getStatic)(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,a.getStatic)(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=E(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return p(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&i.O$.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=(0,a.shallowCopy)(e)).transaction=(0,a.shallowCopy)(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&g.throwError(t+" not implemented",f.Logger.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return b(t,r,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return v(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((t=>{}))}(),r})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const r=(0,a.shallowCopy)(x);if(e)for(const t in e)e[t]&&(r[t]=!0);(0,a.checkProperties)(t,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=(0,o.hexValue)(i.O$.from(t[e]));"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=(0,o.hexlify)(t[e]))})),t.accessList&&(n.accessList=(0,u.accessListify)(t.accessList)),n}}},241:(t,e,r)=>{"use strict";r.d(e,{Q:()=>l});var n=r(53587),i=r(80711),o=r(34216),s=r(82169);const a=new i.Logger(o.i);let c=1;function u(t,e){const r="Web3LegacyFetcher";return function(t,i){const o={method:t,params:i,id:c++,jsonrpc:"2.0"};return new Promise(((t,i)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,n.deepCopy)(o),provider:this}),e(o,((e,n)=>{if(e)return this.emit("debug",{action:"response",fetcher:r,error:e,request:o,provider:this}),i(e);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:n,provider:this}),n.error){const t=new Error(n.error.message);return t.code=n.error.code,t.data=n.error.data,i(t)}t(n.result)}))}))}}class l extends s.r{constructor(t,e){null==t&&a.throwArgumentError("missing provider","provider",t);let r=null,i=null,o=null;"function"==typeof t?(r="unknown:",i=t):(r=t.host||t.path||"",!r&&t.isMetaMask&&(r="metamask"),o=t,t.request?(""===r&&(r="eip-1193:"),i=function(t){return function(e,r){null==r&&(r=[]);const i={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,n.deepCopy)(i),provider:this}),t.request(i).then((t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:t,provider:this}),t}))}}(t)):t.sendAsync?i=u(0,t.sendAsync.bind(t)):t.send?i=u(0,t.send.bind(t)):a.throwArgumentError("unsupported provider","provider",t),r||(r="unknown:")),super(r,e),(0,n.defineReadOnly)(this,"jsonRpcFetchFunc",i),(0,n.defineReadOnly)(this,"provider",o)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}},22118:(t,e,r)=>{"use strict";r.r(e),r.d(e,{randomBytes:()=>n.O,shuffled:()=>i.y});var n=r(44478),i=r(52472)},44478:(t,e,r)=>{"use strict";r.d(e,{O:()=>c});var n=r(93286),i=r(80711);const o=new i.Logger("random/5.6.1");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 a=s.crypto||s.msCrypto;function c(t){(t<=0||t>1024||t%1||t!=t)&&o.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return a.getRandomValues(e),(0,n.arrayify)(e)}a&&a.getRandomValues||(o.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(t){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},52472:(t,e,r)=>{"use strict";function n(t){for(let e=(t=t.slice()).length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}r.d(e,{y:()=>n})},61843:(t,e,r)=>{"use strict";r.r(e),r.d(e,{decode:()=>h,encode:()=>u});var n=r(93286),i=r(80711);const o=new i.Logger("rlp/5.6.1");function s(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function a(t,e,r){let n=0;for(let i=0;ie+1+n&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:s}}function f(t,e){if(0===t.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});const n=a(t,e+1,r);return e+1+r+n>t.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(t,e,e+1+r,r+n)}if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(t,e,e+1,r)}if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});const s=a(t,e+1,r);e+1+r+s>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r+s,result:(0,n.hexlify)(t.slice(e+1+r,e+1+r+s))}}if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:(0,n.hexlify)(t.slice(e+1,e+1+r))}}return{consumed:1,result:(0,n.hexlify)(t[e])}}function h(t){const e=(0,n.arrayify)(t),r=f(e,0);return r.consumed!==e.length&&o.throwArgumentError("invalid rlp data","data",t),r.result}},91278:(t,e,r)=>{"use strict";r.r(e),r.d(e,{SupportedAlgorithm:()=>i.p,computeHmac:()=>n.Gy,ripemd160:()=>n.bP,sha256:()=>n.JQ,sha512:()=>n.o});var n=r(77158),i=r(21261)},77158:(t,e,r)=>{"use strict";r.d(e,{Gy:()=>h,bP:()=>u,JQ:()=>l,o:()=>f});var n=r(33715),i=r.n(n),o=r(93286),s=r(21261),a=r(80711);const c=new a.Logger("sha2/5.6.1");function u(t){return"0x"+i().ripemd160().update((0,o.arrayify)(t)).digest("hex")}function l(t){return"0x"+i().sha256().update((0,o.arrayify)(t)).digest("hex")}function f(t){return"0x"+i().sha512().update((0,o.arrayify)(t)).digest("hex")}function h(t,e,r){return s.p[t]||c.throwError("unsupported algorithm "+t,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+i().hmac(i()[t],(0,o.arrayify)(e)).update((0,o.arrayify)(r)).digest("hex")}},21261:(t,e,r)=>{"use strict";var n;r.d(e,{p:()=>n}),function(t){t.sha256="sha256",t.sha512="sha512"}(n||(n={}))},62768:(t,e,r)=>{"use strict";r.r(e),r.d(e,{SigningKey:()=>$,computePublicKey:()=>Z,recoverPublicKey:()=>J});var n=r(13550),i=r.n(n),o=r(33715),s=r.n(o);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;function a(t,e,r){return r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},t(r,r.exports),r.exports}var c=u;function u(t,e){if(!t)throw new Error(e||"Assertion failed")}u.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var l=a((function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}})),f=a((function(t,e){var r=e;r.assert=c,r.toArray=l.toArray,r.zero2=l.zero2,r.toHex=l.toHex,r.encode=l.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,c=t.andln(3)+i&3,u=e.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new(i())(t,"hex","le")}})),h=f.getNAF,d=f.getJSF,p=f.assert;function g(t,e){this.type=t,this.p=new(i())(e.p,16),this.red=e.prime?i().red(e.prime):i().mont(this.p),this.zero=new(i())(0).toRed(this.red),this.one=new(i())(1).toRed(this.red),this.two=new(i())(2).toRed(this.red),this.n=e.n&&new(i())(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 y=g;function m(t,e){this.curve=t,this.type=e,this.precomputed=null}g.prototype.point=function(){throw new Error("Not implemented")},g.prototype.validate=function(){throw new Error("Not implemented")},g.prototype._fixedNafMul=function(t,e){p(t.precomputed);var r=t._getDoubles(),n=h(e,1,this._bitLength),i=(1<=o;c--)s=(s<<1)+n[c];a.push(s)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;a--){for(var c=0;a>=0&&0===o[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var u=o[a];p(0!==u),s="affine"===t.type?u>0?s.mixedAdd(i[u-1>>1]):s.mixedAdd(i[-u-1>>1].neg()):u>0?s.add(i[u-1>>1]):s.add(i[-u-1>>1].neg())}return"affine"===t.type?s.toP():s},g.prototype._wnafMulAdd=function(t,e,r,n,i){var o,s,a,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,f=0;for(o=0;o=1;o-=2){var g=o-1,y=o;if(1===c[g]&&1===c[y]){var m=[e[g],null,null,e[y]];0===e[g].y.cmp(e[y].y)?(m[1]=e[g].add(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg())):0===e[g].y.cmp(e[y].y.redNeg())?(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].add(e[y].neg())):(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=d(r[g],r[y]);for(f=Math.max(v[0].length,f),l[g]=new Array(f),l[y]=new Array(f),s=0;s=0;o--){for(var k=0;o>=0;){var x=!0;for(s=0;s=0&&k++,A=A.dblp(k),o<0)break;for(s=0;s0?a=u[s][P-1>>1]:P<0&&(a=u[s][-P-1>>1].neg()),A="affine"===a.type?A.mixedAdd(a):A.add(a))}}for(o=0;o=Math.ceil((t.bitLength()+1)/e.step)},m.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},w.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:c.add(u).neg()}},w.prototype.pointFromX=function(t,e){(t=new(i())(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},w.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},w.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},A.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(t){return t=new(i())(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},A.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},A.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},A.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},A.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.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 e},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},b(S,y.BasePoint),w.prototype.jpoint=function(t,e,r){return new S(this,t,e,r)},S.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},S.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},S.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),f=n.redMul(u),h=c.redSqr().redIAdd(l).redISub(f).redISub(f),d=c.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,d,p)},S.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(l).redISub(l),h=a.redMul(l.redISub(f)).redISub(i.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(f,h,d)},S.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},S.prototype.inspect=function(){return this.isInfinity()?"":""},S.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var k=a((function(t,e){var r=e;r.base=y,r.short=E,r.mont=null,r.edwards=null})),x=a((function(t,e){var r,n=e,i=f.assert;function o(t){"short"===t.type?this.curve=new k.short(t):"edwards"===t.type?this.curve=new k.edwards(t):this.curve=new k.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new o(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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"]}),a("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"]}),a("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"]}),a("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"]}),a("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"]}),a("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"]}),a("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(t){r=void 0}a("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 P(t){if(!(this instanceof P))return new P(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=l.toArray(t.entropy,t.entropyEnc||"hex"),r=l.toArray(t.nonce,t.nonceEnc||"hex"),n=l.toArray(t.pers,t.persEnc||"hex");c(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var T=P;P.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},P.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=l.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var B=f.assert;function M(t,e){if(t instanceof M)return t;this._importDER(t,e)||(B(t.r&&t.s,"Signature without r or s"),this.r=new(i())(t.r,16),this.s=new(i())(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var N=M;function C(){this.place=0}function L(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function R(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}M.prototype._importDER=function(t,e){t=f.toArray(t,e);var r=new C;if(48!==t[r.place++])return!1;var n=L(t,r);if(!1===n)return!1;if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=L(t,r);if(!1===o)return!1;var s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var a=L(t,r);if(!1===a)return!1;if(t.length!==a+r.place)return!1;var c=t.slice(r.place,a+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(i())(s),this.s=new(i())(c),this.recoveryParam=null,!0},M.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=R(e),r=R(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];U(n,e.length),(n=n.concat(e)).push(2),U(n,r.length);var i=n.concat(r),o=[48];return U(o,i.length),o=o.concat(i),f.encode(o,t)};var D=function(){throw new Error("unsupported")},F=f.assert;function j(t){if(!(this instanceof j))return new j(t);"string"==typeof t&&(F(Object.prototype.hasOwnProperty.call(x,t),"Unknown curve "+t),t=x[t]),t instanceof x.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var V=j;j.prototype.keyPair=function(t){return new I(this,t)},j.prototype.keyFromPrivate=function(t,e){return I.fromPrivate(this,t,e)},j.prototype.keyFromPublic=function(t,e){return I.fromPublic(this,t,e)},j.prototype.genKeyPair=function(t){t||(t={});for(var e=new T({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||D(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(i())(2));;){var o=new(i())(e.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},j.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},j.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new(i())(t,16));for(var o=this.n.byteLength(),s=e.getPrivate().toArray("be",o),a=t.toArray("be",o),c=new T({hash:this.hash,entropy:s,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(i())(1)),l=0;;l++){var f=n.k?n.k(l):new(i())(c.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(u)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var d=h.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var g=f.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(h.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new N({r:p,s:g,recoveryParam:y})}}}}}},j.prototype.verify=function(t,e,r,n){t=this._truncateToN(new(i())(t,16)),r=this.keyFromPublic(r,n);var o=(e=new N(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(t).umod(this.n),l=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},j.prototype.recoverPubKey=function(t,e,r,n){F((3&r)===r,"The recovery param is more than two bits"),e=new N(e,n);var o=this.n,s=new(i())(t),a=e.r,c=e.s,u=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var f=e.r.invm(o),h=o.sub(s).mul(f).umod(o),d=c.mul(f).umod(o);return this.g.mulAdd(h,a,d)},j.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new N(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var G=a((function(t,e){var r=e;r.version="6.5.4",r.utils=f,r.rand=function(){throw new Error("unsupported")},r.curve=k,r.curves=x,r.ec=V,r.eddsa=null})).ec,H=r(93286),K=r(53587);const q=new(r(80711).Logger)("signing-key/5.6.2");let W=null;function z(){return W||(W=new G("secp256k1")),W}class ${constructor(t){(0,K.defineReadOnly)(this,"curve","secp256k1"),(0,K.defineReadOnly)(this,"privateKey",(0,H.hexlify)(t)),32!==(0,H.hexDataLength)(this.privateKey)&&q.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=z().keyFromPrivate((0,H.arrayify)(this.privateKey));(0,K.defineReadOnly)(this,"publicKey","0x"+e.getPublic(!1,"hex")),(0,K.defineReadOnly)(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),(0,K.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(t){const e=z().keyFromPublic((0,H.arrayify)(this.publicKey)),r=z().keyFromPublic((0,H.arrayify)(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){const e=z().keyFromPrivate((0,H.arrayify)(this.privateKey)),r=(0,H.arrayify)(t);32!==r.length&&q.throwArgumentError("bad digest length","digest",t);const n=e.sign(r,{canonical:!0});return(0,H.splitSignature)({recoveryParam:n.recoveryParam,r:(0,H.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,H.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(t){const e=z().keyFromPrivate((0,H.arrayify)(this.privateKey)),r=z().keyFromPublic((0,H.arrayify)(Z(t)));return(0,H.hexZeroPad)("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function J(t,e){const r=(0,H.splitSignature)(e),n={r:(0,H.arrayify)(r.r),s:(0,H.arrayify)(r.s)};return"0x"+z().recoverPubKey((0,H.arrayify)(t),n,r.recoveryParam).encode("hex",!1)}function Z(t,e){const r=(0,H.arrayify)(t);if(32===r.length){const t=new $(r);return e?"0x"+z().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?(0,H.hexlify)(r):"0x"+z().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+z().keyFromPublic(r).getPublic(!0,"hex"):(0,H.hexlify)(r):q.throwArgumentError("invalid public or private key","key","[REDACTED]")}},33777:(t,e,r)=>{"use strict";r.r(e),r.d(e,{keccak256:()=>g,pack:()=>p,sha256:()=>y});var n=r(2593),i=r(93286),o=r(38197),s=r(77158),a=r(44242),c=r(80711);const u=new RegExp("^bytes([0-9]+)$"),l=new RegExp("^(u?int)([0-9]*)$"),f=new RegExp("^(.*)\\[([0-9]*)\\]$"),h=new c.Logger("solidity/5.6.1");function d(t,e,r){switch(t){case"address":return r?(0,i.zeroPad)(e,32):(0,i.arrayify)(e);case"string":return(0,a.Y0)(e);case"bytes":return(0,i.arrayify)(e);case"bool":return e=e?"0x01":"0x00",r?(0,i.zeroPad)(e,32):(0,i.arrayify)(e)}let o=t.match(l);if(o){let s=parseInt(o[2]||"256");return(o[2]&&String(s)!==o[2]||s%8!=0||0===s||s>256)&&h.throwArgumentError("invalid number type","type",t),r&&(s=256),e=n.O$.from(e).toTwos(s),(0,i.zeroPad)(e,s/8)}if(o=t.match(u),o){const n=parseInt(o[1]);return(String(n)!==o[1]||0===n||n>32)&&h.throwArgumentError("invalid bytes type","type",t),(0,i.arrayify)(e).byteLength!==n&&h.throwArgumentError(`invalid value for ${t}`,"value",e),r?(0,i.arrayify)((e+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):e}if(o=t.match(f),o&&Array.isArray(e)){const r=o[1];parseInt(o[2]||String(e.length))!=e.length&&h.throwArgumentError(`invalid array length for ${t}`,"value",e);const n=[];return e.forEach((function(t){n.push(d(r,t,!0))})),(0,i.concat)(n)}return h.throwArgumentError("invalid type","type",t)}function p(t,e){t.length!=e.length&&h.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach((function(t,n){r.push(d(t,e[n]))})),(0,i.hexlify)((0,i.concat)(r))}function g(t,e){return(0,o.keccak256)(p(t,e))}function y(t,e){return(0,s.JQ)(p(t,e))}},86237:(t,e,r)=>{"use strict";r.d(e,{F:()=>a,s:()=>s});var n=r(57218),i=r(93286),o=r(44242);function s(t){const e=(0,o.Y0)(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([e,n.R]).slice(0,32))}function a(t){const e=(0,i.arrayify)(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===e[r-1];)r--;return(0,o.ZN)(e.slice(0,r))}},35637:(t,e,r)=>{"use strict";r.d(e,{Ll:()=>p});var n=r(44242);function i(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,n={};return t.split(",").forEach((t=>{let i=t.split(":");r+=parseInt(i[0],16),n[r]=e(i[1])})),n}function o(t){let e=0;return t.split(",").map((t=>{let r=t.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=e+parseInt(r[0],16);return e=parseInt(r[1],16),{l:n,h:e}}))}function s(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-r))continue;return i}}return null}const a=o("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"),c="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),u=[{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}],l=i("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"),f=i("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"),h=i("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(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let r=0;r{if(c.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=function(t){let e=s(t,u);if(e)return[t+e.s];let r=l[t];if(r)return r;let n=f[t];return n?[t+n[0]]:h[t]||null}(t);return e||[t]})),e=r.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[]),e=(0,n.XL)((0,n.uu)(e),n.Uj.NFKC),e.forEach((t=>{if(s(t,d))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),e.forEach((t=>{if(s(t,a))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let i=(0,n.uu)(e);if("-"===i.substring(0,1)||"--"===i.substring(2,4)||"-"===i.substring(i.length-1))throw new Error("invalid hyphen");if(i.length>63)throw new Error("too long");return i}},62741:(t,e,r)=>{"use strict";r.r(e),r.d(e,{UnicodeNormalizationForm:()=>o.Uj,Utf8ErrorFuncs:()=>o.te,Utf8ErrorReason:()=>o.Uw,_toEscapedUtf8String:()=>o.U$,formatBytes32String:()=>n.s,nameprep:()=>i.Ll,parseBytes32String:()=>n.F,toUtf8Bytes:()=>o.Y0,toUtf8CodePoints:()=>o.XL,toUtf8String:()=>o.ZN});var n=r(86237),i=r(35637),o=r(44242)},44242:(t,e,r)=>{"use strict";r.d(e,{Uj:()=>o,te:()=>c,Uw:()=>s,U$:()=>h,uu:()=>d,Y0:()=>l,XL:()=>g,ZN:()=>p});var n=r(93286);const i=new(r(80711).Logger)("strings/5.6.1");var o,s;function a(t,e,r,n,i){if(t===s.BAD_PREFIX||t===s.UNEXPECTED_CONTINUE){let t=0;for(let n=e+1;n>6==2;n++)t++;return t}return t===s.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(o||(o={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(s||(s={}));const c=Object.freeze({error:function(t,e,r,n,o){return i.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:a,replace:function(t,e,r,n,i){return t===s.OVERLONG?(n.push(i),0):(n.push(65533),a(t,e,r))}});function u(t,e){null==e&&(e=c.error),t=(0,n.arrayify)(t);const r=[];let i=0;for(;i>7==0){r.push(n);continue}let o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){i+=e(128==(192&n)?s.UNEXPECTED_CONTINUE:s.BAD_PREFIX,i-1,t,r);continue}o=3,a=65535}if(i-1+o>=t.length){i+=e(s.OVERRUN,i-1,t,r);continue}let c=n&(1<<8-o-1)-1;for(let n=0;n1114111?i+=e(s.OUT_OF_RANGE,i-1-o,t,r,c):c>=55296&&c<=57343?i+=e(s.UTF16_SURROGATE,i-1-o,t,r,c):c<=a?i+=e(s.OVERLONG,i-1-o,t,r,c):r.push(c))}return r}function l(t,e=o.current){e!=o.current&&(i.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e>6|192),r.push(63&n|128);else if(55296==(64512&n)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return(0,n.arrayify)(r)}function f(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function h(t,e){return'"'+u(t,e).map((t=>{if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?f(t):f(55296+((t-=65536)>>10&1023))+f(56320+(1023&t))})).join("")+'"'}function d(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function p(t,e){return d(u(t,e))}function g(t,e=o.current){return u(l(t,e))}},13479:(t,e,r)=>{"use strict";r.r(e),r.d(e,{TransactionTypes:()=>d,accessListify:()=>A,computeAddress:()=>b,parse:()=>_,recoverAddress:()=>v,serialize:()=>P});var n=r(64594),i=r(2593),o=r(93286),s=r(21046),a=r(38197),c=r(53587),u=r(61843),l=r(62768),f=r(80711);const h=new f.Logger("transactions/5.6.2");var d;function p(t){return"0x"===t?null:(0,n.getAddress)(t)}function g(t){return"0x"===t?s._Y:i.O$.from(t)}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(d||(d={}));const y=[{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"}],m={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(t){const e=(0,l.computePublicKey)(t);return(0,n.getAddress)((0,o.hexDataSlice)((0,a.keccak256)((0,o.hexDataSlice)(e,1)),12))}function v(t,e){return b((0,l.recoverPublicKey)((0,o.arrayify)(t),e))}function w(t,e){const r=(0,o.stripZeros)(i.O$.from(t).toHexString());return r.length>32&&h.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function E(t,e){return{address:(0,n.getAddress)(t),storageKeys:(e||[]).map(((e,r)=>(32!==(0,o.hexDataLength)(e)&&h.throwArgumentError("invalid access list storageKey",`accessList[${t}:${r}]`,e),e.toLowerCase())))}}function A(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&h.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),E(t[0],t[1])):E(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const r=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return E(e,Object.keys(r).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function S(t){return A(t).map((t=>[t.address,t.storageKeys]))}function k(t,e){if(null!=t.gasPrice){const e=i.O$.from(t.gasPrice),r=i.O$.from(t.maxFeePerGas||0);e.eq(r)||h.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:r})}const r=[w(t.chainId||0,"chainId"),w(t.nonce||0,"nonce"),w(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),w(t.maxFeePerGas||0,"maxFeePerGas"),w(t.gasLimit||0,"gasLimit"),null!=t.to?(0,n.getAddress)(t.to):"0x",w(t.value||0,"value"),t.data||"0x",S(t.accessList||[])];if(e){const t=(0,o.splitSignature)(e);r.push(w(t.recoveryParam,"recoveryParam")),r.push((0,o.stripZeros)(t.r)),r.push((0,o.stripZeros)(t.s))}return(0,o.hexConcat)(["0x02",u.encode(r)])}function x(t,e){const r=[w(t.chainId||0,"chainId"),w(t.nonce||0,"nonce"),w(t.gasPrice||0,"gasPrice"),w(t.gasLimit||0,"gasLimit"),null!=t.to?(0,n.getAddress)(t.to):"0x",w(t.value||0,"value"),t.data||"0x",S(t.accessList||[])];if(e){const t=(0,o.splitSignature)(e);r.push(w(t.recoveryParam,"recoveryParam")),r.push((0,o.stripZeros)(t.r)),r.push((0,o.stripZeros)(t.s))}return(0,o.hexConcat)(["0x01",u.encode(r)])}function P(t,e){if(null==t.type||0===t.type)return null!=t.accessList&&h.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),function(t,e){(0,c.checkProperties)(t,m);const r=[];y.forEach((function(e){let n=t[e.name]||[];const i={};e.numeric&&(i.hexPad="left"),n=(0,o.arrayify)((0,o.hexlify)(n,i)),e.length&&n.length!==e.length&&n.length>0&&h.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=(0,o.stripZeros)(n),n.length>e.maxLength&&h.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n)),r.push((0,o.hexlify)(n))}));let n=0;if(null!=t.chainId?(n=t.chainId,"number"!=typeof n&&h.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!(0,o.isBytesLike)(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),0!==n&&(r.push((0,o.hexlify)(n)),r.push("0x"),r.push("0x")),!e)return u.encode(r);const i=(0,o.splitSignature)(e);let s=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),s+=2*n+8,i.v>28&&i.v!==s&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push((0,o.hexlify)(s)),r.push((0,o.stripZeros)((0,o.arrayify)(i.r))),r.push((0,o.stripZeros)((0,o.arrayify)(i.s))),u.encode(r)}(t,e);switch(t.type){case 1:return x(t,e);case 2:return k(t,e)}return h.throwError(`unsupported transaction type: ${t.type}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function T(t,e,r){try{const r=g(e[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");t.v=r}catch(t){h.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=(0,o.hexZeroPad)(e[1],32),t.s=(0,o.hexZeroPad)(e[2],32);try{const e=(0,a.keccak256)(r(t));t.from=v(e,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){}}function _(t){const e=(0,o.arrayify)(t);if(e[0]>127)return function(t){const e=u.decode(t);9!==e.length&&6!==e.length&&h.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:g(e[0]).toNumber(),gasPrice:g(e[1]),gasLimit:g(e[2]),to:p(e[3]),value:g(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=i.O$.from(e[6]).toNumber()}catch(t){return r}if(r.r=(0,o.hexZeroPad)(e[7],32),r.s=(0,o.hexZeroPad)(e[8],32),i.O$.from(r.r).isZero()&&i.O$.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 i=e.slice(0,6);0!==r.chainId&&(i.push((0,o.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const s=(0,a.keccak256)(u.encode(i));try{r.from=v(s,{r:(0,o.hexlify)(r.r),s:(0,o.hexlify)(r.s),recoveryParam:n})}catch(t){}r.hash=(0,a.keccak256)(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){const e=u.decode(t.slice(1));8!==e.length&&11!==e.length&&h.throwArgumentError("invalid component count for transaction type: 1","payload",(0,o.hexlify)(t));const r={type:1,chainId:g(e[0]).toNumber(),nonce:g(e[1]).toNumber(),gasPrice:g(e[2]),gasLimit:g(e[3]),to:p(e[4]),value:g(e[5]),data:e[6],accessList:A(e[7])};return 8===e.length||(r.hash=(0,a.keccak256)(t),T(r,e.slice(8),x)),r}(e);case 2:return function(t){const e=u.decode(t.slice(1));9!==e.length&&12!==e.length&&h.throwArgumentError("invalid component count for transaction type: 2","payload",(0,o.hexlify)(t));const r=g(e[2]),n=g(e[3]),i={type:2,chainId:g(e[0]).toNumber(),nonce:g(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:g(e[4]),to:p(e[5]),value:g(e[6]),data:e[7],accessList:A(e[8])};return 9===e.length||(i.hash=(0,a.keccak256)(t),T(i,e.slice(9),k)),i}(e)}return h.throwError(`unsupported transaction type: ${e[0]}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}},46441:(t,e,r)=>{"use strict";r.r(e),r.d(e,{commify:()=>s,formatEther:()=>u,formatUnits:()=>a,parseEther:()=>l,parseUnits:()=>c});var n=r(20335);const i=new(r(80711).Logger)("units/5.6.1"),o=["wei","kwei","mwei","gwei","szabo","finney","ether"];function s(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&i.throwArgumentError("invalid value","value",t);let r=e[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 o="";for(2===e.length&&(o="."+(e[1]||"0"));o.length>2&&"0"===o[o.length-1];)o=o.substring(0,o.length-1);const s=[];for(;r.length;){if(r.length<=3){s.unshift(r);break}{const t=r.length-3;s.unshift(r.substring(t)),r=r.substring(0,t)}}return n+s.join(",")+o}function a(t,e){if("string"==typeof e){const t=o.indexOf(e);-1!==t&&(e=3*t)}return(0,n.S5)(t,null!=e?e:18)}function c(t,e){if("string"!=typeof t&&i.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=o.indexOf(e);-1!==t&&(e=3*t)}return(0,n.Ox)(t,null!=e?e:18)}function u(t){return a(t,18)}function l(t){return c(t,18)}},44958:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Wallet:()=>w,verifyMessage:()=>E,verifyTypedData:()=>A});var n=r(64594),i=r(64353),o=r(48171),s=r(93286),a=r(93684),c=r(67827),u=r(36274),l=r(38197),f=r(53587),h=r(44478),d=r(62768),p=r(19380),g=r(81964),y=r(13479),m=r(80711);var b=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const v=new m.Logger("wallet/5.6.2");class w extends o.E{constructor(t,e){if(super(),null!=(r=t)&&(0,s.isHexString)(r.privateKey,32)&&null!=r.address){const e=new d.SigningKey(t.privateKey);if((0,f.defineReadOnly)(this,"_signingKey",(()=>e)),(0,f.defineReadOnly)(this,"address",(0,y.computeAddress)(this.publicKey)),this.address!==(0,n.getAddress)(t.address)&&v.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(t){const e=t.mnemonic;return e&&e.phrase}(t)){const e=t.mnemonic;(0,f.defineReadOnly)(this,"_mnemonic",(()=>({phrase:e.phrase,path:e.path||u.defaultPath,locale:e.locale||"en"})));const r=this.mnemonic,n=u.HDNode.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path);(0,y.computeAddress)(n.privateKey)!==this.address&&v.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,f.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(d.SigningKey.isSigningKey(t))"secp256k1"!==t.curve&&v.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,f.defineReadOnly)(this,"_signingKey",(()=>t));else{"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t);const e=new d.SigningKey(t);(0,f.defineReadOnly)(this,"_signingKey",(()=>e))}(0,f.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,f.defineReadOnly)(this,"address",(0,y.computeAddress)(this.publicKey))}var r;e&&!i.zt.isProvider(e)&&v.throwArgumentError("invalid provider","provider",e),(0,f.defineReadOnly)(this,"provider",e||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(t){return new w(this,t)}signTransaction(t){return(0,f.resolveProperties)(t).then((e=>{null!=e.from&&((0,n.getAddress)(e.from)!==this.address&&v.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete e.from);const r=this._signingKey().signDigest((0,l.keccak256)((0,y.serialize)(e)));return(0,y.serialize)(e,r)}))}signMessage(t){return b(this,void 0,void 0,(function*(){return(0,s.joinSignature)(this._signingKey().signDigest((0,a.r)(t)))}))}_signTypedData(t,e,r){return b(this,void 0,void 0,(function*(){const n=yield c.E.resolveNames(t,e,r,(t=>(null==this.provider&&v.throwError("cannot resolve ENS names without a provider",m.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:t}),this.provider.resolveName(t))));return(0,s.joinSignature)(this._signingKey().signDigest(c.E.hash(n.domain,e,n.value)))}))}encrypt(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e||(e={}),(0,g.HI)(this,t,e,r)}static createRandom(t){let e=(0,h.O)(16);t||(t={}),t.extraEntropy&&(e=(0,s.arrayify)((0,s.hexDataSlice)((0,l.keccak256)((0,s.concat)([e,t.extraEntropy])),0,16)));const r=(0,u.entropyToMnemonic)(e,t.locale);return w.fromMnemonic(r,t.path,t.locale)}static fromEncryptedJson(t,e,r){return(0,p.decryptJsonWallet)(t,e,r).then((t=>new w(t)))}static fromEncryptedJsonSync(t,e){return new w((0,p.decryptJsonWalletSync)(t,e))}static fromMnemonic(t,e,r){return e||(e=u.defaultPath),new w(u.HDNode.fromMnemonic(t,null,r).derivePath(e))}}function E(t,e){return(0,y.recoverAddress)((0,a.r)(t),e)}function A(t,e,r,n){return(0,y.recoverAddress)(c.E.hash(t,e,r),n)}},58341:(t,e,r)=>{"use strict";r.r(e),r.d(e,{_fetchData:()=>p,fetchJson:()=>g,poll:()=>y});var n=r(59567),i=r(93286),o=r(53587),s=r(44242),a=r(80711);var c=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};function u(t,e){return c(this,void 0,void 0,(function*(){null==e&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};!0!==e.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client");const n=yield fetch(t,r),o=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach(((t,e)=>{s[e.toLowerCase()]=t})):n.headers.keys().forEach((t=>{s[t.toLowerCase()]=n.headers.get(t)})),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:(0,i.arrayify)(new Uint8Array(o))}}))}var l=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const f=new a.Logger("web/5.6.1");function h(t){return new Promise((e=>{setTimeout(e,t)}))}function d(t,e){if(null==t)return null;if("string"==typeof t)return t;if((0,i.isBytesLike)(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return(0,s.ZN)(t)}catch(t){}return(0,i.hexlify)(t)}return t}function p(t,e,r){const i="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;f.assertArgument(i>0&&i%1==0,"invalid connection throttle limit","connection.throttleLimit",i);const o="object"==typeof t?t.throttleCallback:null,c="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;f.assertArgument(c>0&&c%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",c);const p="object"==typeof t&&!!t.errorPassThrough,g={};let y=null;const m={method:"GET"};let b=!1,v=12e4;if("string"==typeof t)y=t;else if("object"==typeof t){if(null!=t&&null!=t.url||f.throwArgumentError("missing URL","connection.url",t),y=t.url,"number"==typeof t.timeout&&t.timeout>0&&(v=t.timeout),t.headers)for(const e in t.headers)g[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(b=!0);if(m.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==y.substring(0,6)&&!0!==t.allowInsecureAuthentication&&f.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:y,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;g.authorization={key:"Authorization",value:"Basic "+(0,n.c)((0,s.Y0)(e))}}null!=t.skipFetchSetup&&(m.skipFetchSetup=!!t.skipFetchSetup)}const w=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),E=y?y.match(w):null;if(E)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":E[1]},body:(0,n.J)(E[2])};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){f.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:d(E[1],E[2]),error:t,requestBody:null,requestMethod:"GET",url:y})}e&&(m.method="POST",m.body=e,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(e.length)}));const A={};Object.keys(g).forEach((t=>{const e=g[t];A[e.key]=e.value})),m.headers=A;const S=function(){let t=null;return{promise:new Promise((function(e,r){v&&(t=setTimeout((()=>{null!=t&&(t=null,r(f.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:d(m.body,A["content-type"]),requestMethod:m.method,timeout:v,url:y})))}),v))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),k=function(){return l(this,void 0,void 0,(function*(){for(let t=0;t=300)&&(S.cancel(),f.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:d(n,e.headers?e.headers["content-type"]:null),requestBody:d(m.body,A["content-type"]),requestMethod:m.method,url:y})),r)try{const t=yield r(n,e);return S.cancel(),t}catch(r){if(r.throttleRetry&&t"content-type"===t.toLowerCase())).length||(r.headers=(0,o.shallowCopy)(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return p(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse((0,s.ZN)(t))}catch(e){f.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function y(t,e){return e||(e={}),null==(e=(0,o.shallowCopy)(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let c=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(c++,c>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));te.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}},48659:(t,e,r)=>{"use strict";r.d(e,{D:()=>a});var n=r(32046),i=r(53587),o=r(80711);const s=new o.Logger("wordlists/5.6.1");class a{constructor(t){s.checkAbstract(new.target,a),(0,i.defineReadOnly)(this,"locale",t)}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}static check(t){const e=[];for(let r=0;r<2048;r++){const n=t.getWord(r);if(r!==t.getWordIndex(n))return"0x";e.push(n)}return(0,n.id)(e.join("\n")+"\n")}static register(t,e){e||(e=t.locale)}}},9855:(t,e,r)=>{"use strict";r.d(e,{E:()=>c});var n=r(48659);let i=null;function o(t){if(null==i&&(i="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==n.D.check(t)))throw i=null,new Error("BIP39 Wordlist for en (English) FAILED")}class s extends n.D{constructor(){super("en")}getWord(t){return o(this),i[t]}getWordIndex(t){return o(this),i.indexOf(t)}}const a=new s;n.D.register(a);const c={en:a}},96858:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AsnAnyConverter:()=>s,AsnArray:()=>z,AsnBitStringConverter:()=>f,AsnBmpStringConverter:()=>m,AsnBooleanConverter:()=>d,AsnCharacterStringConverter:()=>T,AsnChoiceType:()=>j,AsnConvert:()=>$,AsnEnumeratedConverter:()=>c,AsnGeneralStringConverter:()=>P,AsnGeneralizedTimeConverter:()=>O,AsnGraphicStringConverter:()=>k,AsnIA5StringConverter:()=>S,AsnIntegerArrayBufferConverter:()=>u,AsnIntegerBigIntConverter:()=>l,AsnIntegerConverter:()=>a,AsnNullConverter:()=>I,AsnNumericStringConverter:()=>v,AsnObjectIdentifierConverter:()=>h,AsnOctetStringConverter:()=>p,AsnParser:()=>q,AsnPrintableStringConverter:()=>w,AsnProp:()=>H,AsnPropTypes:()=>i,AsnSchemaValidationError:()=>K,AsnSequenceType:()=>G,AsnSerializer:()=>W,AsnSetType:()=>V,AsnTeletexStringConverter:()=>E,AsnType:()=>F,AsnTypeTypes:()=>n,AsnUTCTimeConverter:()=>_,AsnUniversalStringConverter:()=>b,AsnUtf8StringConverter:()=>y,AsnVideotexStringConverter:()=>A,AsnVisibleStringConverter:()=>x,BitString:()=>N,OctetString:()=>C,defaultConverter:()=>B});var n,i,o=r(12858);!function(t){t[t.Sequence=0]="Sequence",t[t.Set=1]="Set",t[t.Choice=2]="Choice"}(n||(n={})),function(t){t[t.Any=1]="Any",t[t.Boolean=2]="Boolean",t[t.OctetString=3]="OctetString",t[t.BitString=4]="BitString",t[t.Integer=5]="Integer",t[t.Enumerated=6]="Enumerated",t[t.ObjectIdentifier=7]="ObjectIdentifier",t[t.Utf8String=8]="Utf8String",t[t.BmpString=9]="BmpString",t[t.UniversalString=10]="UniversalString",t[t.NumericString=11]="NumericString",t[t.PrintableString=12]="PrintableString",t[t.TeletexString=13]="TeletexString",t[t.VideotexString=14]="VideotexString",t[t.IA5String=15]="IA5String",t[t.GraphicString=16]="GraphicString",t[t.VisibleString=17]="VisibleString",t[t.GeneralString=18]="GeneralString",t[t.CharacterString=19]="CharacterString",t[t.UTCTime=20]="UTCTime",t[t.GeneralizedTime=21]="GeneralizedTime",t[t.DATE=22]="DATE",t[t.TimeOfDay=23]="TimeOfDay",t[t.DateTime=24]="DateTime",t[t.Duration=25]="Duration",t[t.TIME=26]="TIME",t[t.Null=27]="Null"}(i||(i={}));const s={fromASN:t=>t instanceof o.Null?null:t.valueBeforeDecode,toASN:t=>{if(null===t)return new o.Null;const e=o.fromBER(t);if(e.result.error)throw new Error(e.result.error);return e.result}},a={fromASN:t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new o.Integer({value:t})},c={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new o.Enumerated({value:t})},u={fromASN:t=>t.valueBlock.valueHex,toASN:t=>new o.Integer({valueHex:t})},l={fromASN:t=>t.toBigInt(),toASN:t=>o.Integer.fromBigInt(t)},f={fromASN:t=>t.valueBlock.valueHex,toASN:t=>new o.BitString({valueHex:t})},h={fromASN:t=>t.valueBlock.toString(),toASN:t=>new o.ObjectIdentifier({value:t})},d={fromASN:t=>t.valueBlock.value,toASN:t=>new o.Boolean({value:t})},p={fromASN:t=>t.valueBlock.valueHex,toASN:t=>new o.OctetString({valueHex:t})};function g(t){return{fromASN:t=>t.valueBlock.value,toASN:e=>new t({value:e})}}const y=g(o.Utf8String),m=g(o.BmpString),b=g(o.UniversalString),v=g(o.NumericString),w=g(o.PrintableString),E=g(o.TeletexString),A=g(o.VideotexString),S=g(o.IA5String),k=g(o.GraphicString),x=g(o.VisibleString),P=g(o.GeneralString),T=g(o.CharacterString),_={fromASN:t=>t.toDate(),toASN:t=>new o.UTCTime({valueDate:t})},O={fromASN:t=>t.toDate(),toASN:t=>new o.GeneralizedTime({valueDate:t})},I={fromASN:t=>null,toASN:t=>new o.Null};function B(t){switch(t){case i.Any:return s;case i.BitString:return f;case i.BmpString:return m;case i.Boolean:return d;case i.CharacterString:return T;case i.Enumerated:return c;case i.GeneralString:return P;case i.GeneralizedTime:return O;case i.GraphicString:return k;case i.IA5String:return S;case i.Integer:return a;case i.Null:return I;case i.NumericString:return v;case i.ObjectIdentifier:return h;case i.OctetString:return p;case i.PrintableString:return w;case i.TeletexString:return E;case i.UTCTime:return _;case i.UniversalString:return b;case i.Utf8String:return y;case i.VideotexString:return A;case i.VisibleString:return x;default:return null}}var M=r(72043);class N{constructor(t,e=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if("number"==typeof t)this.fromNumber(t);else{if(!M.vJ.isBufferSource(t))throw TypeError("Unsupported type of 'params' argument for BitString");this.unusedBits=e,this.value=M.vJ.toArrayBuffer(t)}}fromASN(t){if(!(t instanceof o.BitString))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=t.valueBlock.unusedBits,this.value=t.valueBlock.valueHex,this}toASN(){return new o.BitString({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new o.BitString({name:t})}toNumber(){let t="";const e=new Uint8Array(this.value);for(const r of e)t+=r.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let e=t.toString(2);const r=e.length+7>>3;this.unusedBits=(r<<3)-e.length;const n=new Uint8Array(r);e=e.padStart(r<<3,"0").split("").reverse().join("");let i=0;for(;ie=>{let r;D.has(e)?r=D.get(e):(r=D.createDefault(e),D.set(e,r)),Object.assign(r,t)},j=()=>F({type:n.Choice}),V=t=>F({type:n.Set,...t}),G=t=>F({type:n.Sequence,...t}),H=t=>(e,r)=>{let n;D.has(e.constructor)?n=D.get(e.constructor):(n=D.createDefault(e.constructor),D.set(e.constructor,n));const i=Object.assign({},t);if("number"==typeof i.type&&!i.converter){const n=B(t.type);if(!n)throw new Error(`Cannot get default converter for property '${r}' of ${e.constructor.name}`);i.converter=n}n.items[r]=i};class K extends Error{constructor(){super(...arguments),this.schemas=[]}}class q{static parse(t,e){const r=o.fromBER(t);if(r.result.error)throw new Error(r.result.error);return this.fromASN(r.result,e)}static fromASN(t,e){var r;try{if(L(e)){return(new e).fromASN(t)}const s=D.get(e);D.cache(e);let a=s.schema;if(t.constructor===o.Constructed&&s.type!==n.Choice){a=new o.Constructed({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:s.schema.valueBlock.value});for(const e in s.items)delete t[e]}const c=o.compareSchema({},t,a);if(!c.verified)throw new K(`Data does not match to ${e.name} ASN1 schema. ${c.result.error}`);const u=new e;if(R(e)){if("number"==typeof s.itemType){const r=B(s.itemType);if(!r)throw new Error(`Cannot get default converter for array item of ${e.name} ASN1 schema`);return e.from(t.valueBlock.value,(t=>r.fromASN(t)))}return e.from(t.valueBlock.value,(t=>this.fromASN(t,s.itemType)))}for(const t in s.items){const e=c.result[t];if(!e)continue;const n=s.items[t];if("number"==typeof n.type||L(n.type)){const s=null!==(r=n.converter)&&void 0!==r?r:L(n.type)?new n.type:null;if(!s)throw new Error("Converter is empty");if(n.repeated)if(n.implicit){const r=new("sequence"===n.repeated?o.Sequence:o.Set);r.valueBlock=e.valueBlock;const i=o.fromBER(r.toBER(!1)).result.valueBlock.value;u[t]=Array.from(i,(t=>s.fromASN(t)))}else u[t]=Array.from(e,(t=>s.fromASN(t)));else{let r=e;if(n.implicit){let t;if(L(n.type))t=(new n.type).toSchema("");else{const e=i[n.type],r=o[e];if(!r)throw new Error(`Cannot get '${e}' class from asn1js module`);t=new r}t.valueBlock=r.valueBlock,r=o.fromBER(t.toBER(!1)).result}u[t]=s.fromASN(r)}}else n.repeated?u[t]=Array.from(e,(t=>this.fromASN(t,n.type))):u[t]=this.fromASN(e,n.type)}return u}catch(t){throw t instanceof K&&t.schemas.push(e.name),t}}}class W{static serialize(t){return t instanceof o.BaseBlock?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&L(t.constructor))return t.toASN();const e=t.constructor,r=D.get(e);D.cache(e);let i,s=[];if(r.itemType)if("number"==typeof r.itemType){const n=B(r.itemType);if(!n)throw new Error(`Cannot get default converter for array item of ${e.name} ASN1 schema`);s=t.map((t=>n.toASN(t)))}else s=t.map((t=>this.toAsnItem({type:r.itemType},"[]",e,t)));else for(const n in r.items){const i=r.items[n],a=t[n];if(void 0===a||i.defaultValue===a||"object"==typeof i.defaultValue&&"object"==typeof a&&U(this.serialize(i.defaultValue),this.serialize(a)))continue;let c=W.toAsnItem(i,n,e,a);if("number"==typeof i.context)if(i.implicit)if(i.repeated||"number"!=typeof i.type&&!L(i.type))s.push(new o.Constructed({optional:i.optional,idBlock:{tagClass:3,tagNumber:i.context},value:c.valueBlock.value}));else{const t={};t.valueHex=c instanceof o.Null?c.valueBeforeDecode:c.valueBlock.toBER(),s.push(new o.Primitive({optional:i.optional,idBlock:{tagClass:3,tagNumber:i.context},...t}))}else s.push(new o.Constructed({optional:i.optional,idBlock:{tagClass:3,tagNumber:i.context},value:[c]}));else i.repeated?s=s.concat(c):s.push(c)}switch(r.type){case n.Sequence:i=new o.Sequence({value:s});break;case n.Set:i=new o.Set({value:s});break;case n.Choice:if(!s[0])throw new Error(`Schema '${e.name}' has wrong data. Choice cannot be empty.`);i=s[0]}return i}static toAsnItem(t,e,r,n){let s;if("number"==typeof t.type){const a=t.converter;if(!a)throw new Error(`Property '${e}' doesn't have converter for type ${i[t.type]} in schema '${r.name}'`);if(t.repeated){const e=Array.from(n,(t=>a.toASN(t)));s=new("sequence"===t.repeated?o.Sequence:o.Set)({value:e})}else s=a.toASN(n)}else if(t.repeated){const e=Array.from(n,(t=>this.toASN(t)));s=new("sequence"===t.repeated?o.Sequence:o.Set)({value:e})}else s=this.toASN(n);return s}}class z extends Array{constructor(t=[]){if("number"==typeof t)super(t);else{super();for(const e of t)this.push(e)}}}class ${static serialize(t){return W.serialize(t)}static parse(t,e){return q.parse(t,e)}static toString(t){const e=M.vJ.isBufferSource(t)?M.vJ.toArrayBuffer(t):$.serialize(t),r=o.fromBER(e);if(-1===r.offset)throw new Error(`Cannot decode ASN.1 data. ${r.result.error}`);return r.result.toString()}}},12858:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Any:()=>fe,BaseBlock:()=>O,BaseStringBlock:()=>B,BitString:()=>xt,BmpString:()=>Wt,Boolean:()=>Et,CharacterString:()=>ne,Choice:()=>he,Constructed:()=>yt,DATE:()=>se,DateTime:()=>ce,Duration:()=>ue,EndOfContent:()=>bt,Enumerated:()=>Bt,GeneralString:()=>re,GeneralizedTime:()=>oe,GraphicString:()=>te,HexBlock:()=>S,IA5String:()=>Qt,Integer:()=>It,Null:()=>vt,NumericString:()=>Jt,ObjectIdentifier:()=>Ct,OctetString:()=>St,Primitive:()=>ht,PrintableString:()=>Zt,RawData:()=>pe,RelativeObjectIdentifier:()=>Ut,Repeated:()=>de,Sequence:()=>Dt,Set:()=>Ft,TIME:()=>le,TeletexString:()=>Xt,TimeOfDay:()=>ae,UTCTime:()=>ie,UniversalString:()=>$t,Utf8String:()=>Kt,ValueBlock:()=>x,VideotexString:()=>Yt,ViewWriter:()=>h,VisibleString:()=>ee,compareSchema:()=>ge,fromBER:()=>pt,verifySchema:()=>ye});var n=r(72043);function i(t,e){let r=0;if(1===t.length)return t[0];for(let n=t.length-1;n>=0;n--)r+=t[t.length-1-n]*Math.pow(2,e*n);return r}function o(t,e,r=-1){const n=r;let i=t,o=0,s=Math.pow(2,e);for(let r=1;r<8;r++){if(t=0;t--){const r=Math.pow(2,t*e);s[o-t-1]=Math.floor(i/r),i-=s[o-t-1]*r}return t}s*=Math.pow(2,e)}return new ArrayBuffer(0)}function s(...t){let e=0,r=0;for(const r of t)e+=r.length;const n=new ArrayBuffer(e),i=new Uint8Array(n);for(const e of t)i.set(e,r),r+=e.length;return i}function a(){const t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const e=255===t[0]&&128&t[1],r=0===t[0]&&0==(128&t[1]);(e||r)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let t=0;t=s.length)return this.error="End of input reached before message was fully decoded",-1;if(t===r){r+=255;const t=new Uint8Array(r);for(let r=0;r8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=e+1,u=o.subarray(c,c+a);return 0===u[a-1]&&this.warnings.push("Needlessly long encoded length"),this.length=i(u,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,e+this.blockLength}toBER(t=!1){let e,r;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return e=new ArrayBuffer(1),!1===t&&(r=new Uint8Array(e),r[0]=128),e;if(this.longFormUsed){const n=o(this.length,8);if(n.byteLength>127)return this.error="Too big length",b;if(e=new ArrayBuffer(n.byteLength+1),t)return e;const i=new Uint8Array(n);r=new Uint8Array(e),r[0]=128|n.byteLength;for(let t=0;t=37&&!1===i.idBlock.isHexOnly)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};a=_.EndOfContent;break;case 1:a=_.Boolean;break;case 2:a=_.Integer;break;case 3:a=_.BitString;break;case 4:a=_.OctetString;break;case 5:a=_.Null;break;case 6:a=_.ObjectIdentifier;break;case 10:a=_.Enumerated;break;case 12:a=_.Utf8String;break;case 13:a=_.RelativeObjectIdentifier;break;case 14:a=_.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:a=_.Sequence;break;case 17:a=_.Set;break;case 18:a=_.NumericString;break;case 19:a=_.PrintableString;break;case 20:a=_.TeletexString;break;case 21:a=_.VideotexString;break;case 22:a=_.IA5String;break;case 23:a=_.UTCTime;break;case 24:a=_.GeneralizedTime;break;case 25:a=_.GraphicString;break;case 26:a=_.VisibleString;break;case 27:a=_.GeneralString;break;case 28:a=_.UniversalString;break;case 29:a=_.CharacterString;break;case 30:a=_.BmpString;break;case 31:a=_.DATE;break;case 32:a=_.TimeOfDay;break;case 33:a=_.DateTime;break;case 34:a=_.Duration;break;default:{const t=i.idBlock.isConstructed?new _.Constructed:new _.Primitive;t.idBlock=i.idBlock,t.lenBlock=i.lenBlock,t.warnings=i.warnings,i=t}}}else a=i.idBlock.isConstructed?_.Constructed:_.Primitive;return i=function(t,e){if(t instanceof e)return t;const r=new e;return r.idBlock=t.idBlock,r.lenBlock=t.lenBlock,r.warnings=t.warnings,r.valueBeforeDecodeView=t.valueBeforeDecodeView,r}(i,a),s=i.fromBER(t,e,i.lenBlock.isIndefiniteForm?r:i.lenBlock.length),i.valueBeforeDecodeView=t.subarray(n,n+i.blockLength),{offset:s,result:i}}function pt(t){if(!t.byteLength){const t=new O({},x);return t.error="Input buffer has zero length",{offset:-1,result:t}}return dt(n.vJ.toUint8Array(t).slice(),0,t.byteLength)}N=ht,_.Primitive=N,ht.NAME="PRIMITIVE";class gt extends x{constructor({value:t=[],isIndefiniteForm:e=!1,...r}={}){super(r),this.value=t,this.isIndefiniteForm=e}fromBER(t,e,r){const i=n.vJ.toUint8Array(t);if(!f(this,i,e,r))return-1;if(this.valueBeforeDecodeView=i.subarray(e,e+r),0===this.valueBeforeDecodeView.length)return this.warnings.push("Zero buffer length"),e;let o=e;for(;s=this.isIndefiniteForm,a=r,(s?1:a)>0;){const t=dt(i,o,r);if(-1===t.offset)return this.error=t.result.error,this.warnings.concat(t.result.warnings),-1;if(o=t.offset,this.blockLength+=t.result.blockLength,r-=t.result.blockLength,this.value.push(t.result),this.isIndefiniteForm&&t.result.constructor.NAME===w)break}var s,a;return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===w?this.value.pop():this.warnings.push("No EndOfContent block encoded")),o}toBER(t,e){const r=e||new h;for(let e=0;e` ${t}`)).join("\n"));const e=3===this.idBlock.tagClass?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return t.length?`${e} :\n${t.join("\n")}`:`${e} :`}}C=yt,_.Constructed=C,yt.NAME="CONSTRUCTED";class mt extends x{fromBER(t,e,r){return e}toBER(t){return b}}mt.override="EndOfContentValueBlock";class bt extends O{constructor(t={}){super(t,mt),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}L=bt,_.EndOfContent=L,bt.NAME=w;class vt extends O{constructor(t={}){super(t,x),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,e,r){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=r,e+r>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):e+r}toBER(t,e){const r=new ArrayBuffer(2);if(!t){const t=new Uint8Array(r);t[0]=5,t[1]=0}return e&&e.write(r),r}onAsciiEncoding(){return`${this.constructor.NAME}`}}R=vt,_.Null=R,vt.NAME="NULL";class wt extends(S(x)){constructor({value:t,...e}={}){super(e),e.valueHex?this.valueHexView=n.vJ.toUint8Array(e.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,e,r){const i=n.vJ.toUint8Array(t);return f(this,i,e,r)?(this.valueHexView=i.subarray(e,e+r),r>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,a.call(this),this.blockLength=r,e+r):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}wt.NAME="BooleanValueBlock";class Et extends O{constructor(t={}){super(t,wt),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}}U=Et,_.Boolean=U,Et.NAME="BOOLEAN";class At extends(S(gt)){constructor({isConstructed:t=!1,...e}={}){super(e),this.isConstructed=t}fromBER(t,e,r){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=gt.prototype.fromBER.call(this,t,e,r),-1===n)return n;for(let t=0;t0&&r.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=r.unusedBits}return i}const o=n.vJ.toUint8Array(t);if(!f(this,o,e,r))return-1;const s=o.subarray(e,e+r);if(this.unusedBits=s[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const t=s.subarray(1);try{if(t.byteLength){const e=dt(t,0,t.byteLength);-1!==e.offset&&e.offset===r-1&&(this.value=[e.result])}}catch(t){}}return this.valueHexView=s.subarray(1),this.blockLength=s.length,e+r}toBER(t,e){if(this.isConstructed)return gt.prototype.toBER.call(this,t,e);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return b;const r=new Uint8Array(this.valueHexView.length+1);return r[0]=this.unusedBits,r.set(this.valueHexView,1),r.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}kt.NAME="BitStringValueBlock";class xt extends O{constructor({idBlock:t={},lenBlock:e={},...r}={}){var n,i;null!==(n=r.isConstructed)&&void 0!==n||(r.isConstructed=!!(null===(i=r.value)||void 0===i?void 0:i.length)),super({idBlock:{isConstructed:r.isConstructed,...t},lenBlock:{...e,isIndefiniteForm:!!r.isIndefiniteForm},...r},kt),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,e,r){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,e,r)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return yt.prototype.onAsciiEncoding.call(this);{const t=[],e=this.valueBlock.valueHexView;for(const r of e)t.push(r.toString(2).padStart(8,"0"));const r=t.join("");return`${this.constructor.NAME} : ${r.substring(0,r.length-this.valueBlock.unusedBits)}`}}}function Pt(t,e){const r=new Uint8Array([0]),n=new Uint8Array(t),i=new Uint8Array(e);let o=n.slice(0);const a=o.length-1,c=i.slice(0),u=c.length-1;let l=0;let f=0;for(let t=u=0;t--,f++){if(!0==f=o.length)o=s(new Uint8Array([l%10]),o);else o[a-f]=l%10}return r[0]>0&&(o=s(r,o)),o}function Tt(t){if(t>=d.length)for(let e=d.length;e<=t;e++){const t=new Uint8Array([0]);let r=d[e-1].slice(0);for(let e=r.length-1;e>=0;e--){const n=new Uint8Array([(r[e]<<1)+t[0]]);t[0]=n[0]/10,r[e]=n[0]%10}t[0]>0&&(r=s(t,r)),d.push(r)}return d[t]}function _t(t,e){let r=0;const n=new Uint8Array(t),i=new Uint8Array(e),o=n.slice(0),s=o.length-1,a=i.slice(0),c=a.length-1;let u,l=0;for(let t=c;t>=0;t--,l++)if(u=o[s-l]-a[c-l]-r,!0==u<0)r=1,o[s-l]=u+10;else r=0,o[s-l]=u;if(r>0)for(let t=s-c+1;t>=0;t--,l++){if(u=o[s-l]-r,!(u<0)){r=0,o[s-l]=u;break}r=1,o[s-l]=u+10}return o.slice()}F=xt,_.BitString=F,xt.NAME=A;class Ot extends(S(x)){constructor({value:t,...e}={}){super(e),this._valueDec=0,e.valueHex&&this.setValueHex(),void 0!==t&&(this.valueDec=t)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=a.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(function(t){const e=t<0?-1*t:t;let r=128;for(let n=1;n<8;n++){if(e<=r){if(t<0){const t=o(r-e,8,n);return new Uint8Array(t)[0]|=128,t}let i=o(e,8,n),s=new Uint8Array(i);if(128&s[0]){const t=i.slice(0),e=new Uint8Array(t);i=new ArrayBuffer(i.byteLength+1),s=new Uint8Array(i);for(let r=0;r1&&(n=o.length+1),this.valueHexView=o.subarray(n-o.length)),i}toDER(t=!1){const e=this.valueHexView;switch(!0){case 0!=(128&e[0]):{const t=new Uint8Array(this.valueHexView.length+1);t[0]=0,t.set(e,1),this.valueHexView=t}break;case 0===e[0]&&0==(128&e[1]):this.valueHexView=this.valueHexView.subarray(1)}return this.toBER(t)}fromBER(t,e,r){const n=super.fromBER(t,e,r);return-1===n||this.setValueHex(),n}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=8*this.valueHexView.length-1;let e,r=new Uint8Array(8*this.valueHexView.length/3),n=0;const i=this.valueHexView;let o="",s=!1;for(let s=i.byteLength-1;s>=0;s--){e=i[s];for(let i=0;i<8;i++){if(1==(1&e))if(n===t)r=_t(Tt(n),r),o="-";else r=Pt(r,Tt(n));n++,e>>=1}}for(let t=0;t0;){const e=new Mt;if(n=e.fromBER(t,n,r),-1===n)return this.blockLength=0,this.error=e.error,n;0===this.value.length&&(e.isFirstSid=!0),this.blockLength+=e.blockLength,r-=e.blockLength,this.value.push(e)}return n}toBER(t){const e=[];for(let r=0;rNumber.MAX_SAFE_INTEGER){u();const e=BigInt(n);t.valueBigInt=e}else if(t.valueDec=parseInt(n,10),isNaN(t.valueDec))return;this.value.length||(t.isFirstSid=!0,i=!0),this.value.push(t)}}while(-1!==r)}toString(){let t="",e=!1;for(let r=0;r0;){const e=new Lt;if(n=e.fromBER(t,n,r),-1===n)return this.blockLength=0,this.error=e.error,n;this.blockLength+=e.blockLength,r-=e.blockLength,this.value.push(e)}return n}toBER(t,e){const r=[];for(let e=0;e4)continue;const s=4-i.length;for(let t=i.length-1;t>=0;t--)r[4*n+t+s]=i[t]}this.valueBlock.value=t}}zt.NAME="UniversalStringValueBlock";class $t extends zt{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}J=$t,_.UniversalString=J,$t.NAME="UniversalString";class Jt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Z=Jt,_.NumericString=Z,Jt.NAME="NumericString";class Zt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}X=Zt,_.PrintableString=X,Zt.NAME="PrintableString";class Xt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Y=Xt,_.TeletexString=Y,Xt.NAME="TeletexString";class Yt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Q=Yt,_.VideotexString=Q,Yt.NAME="VideotexString";class Qt extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}tt=Qt,_.IA5String=tt,Qt.NAME="IA5String";class te extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}et=te,_.GraphicString=et,te.NAME="GraphicString";class ee extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}rt=ee,_.VisibleString=rt,ee.NAME="VisibleString";class re extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}nt=re,_.GeneralString=nt,re.NAME="GeneralString";class ne extends Gt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}it=ne,_.CharacterString=it,ne.NAME="CharacterString";class ie extends ee{constructor({value:t,valueDate:e,...r}={}){if(super(r),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let e=0;e=50?1900+r:2e3+r,this.month=parseInt(e[2],10),this.day=parseInt(e[3],10),this.hour=parseInt(e[4],10),this.minute=parseInt(e[5],10),this.second=parseInt(e[6],10)}toString(t="iso"){if("iso"===t){const t=new Array(7);return t[0]=c(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=c(this.month,2),t[2]=c(this.day,2),t[3]=c(this.hour,2),t[4]=c(this.minute,2),t[5]=c(this.second,2),t[6]="Z",t.join("")}return super.toString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}ot=ie,_.UTCTime=ot,ie.NAME="UTCTime";class oe extends ie{constructor(t={}){var e;super(t),null!==(e=this.millisecond)&&void 0!==e||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let e,r=!1,n="",i="",o=0,s=0,a=0;if("Z"===t[t.length-1])n=t.substring(0,t.length-1),r=!0;else{const e=new Number(t[t.length-1]);if(isNaN(e.valueOf()))throw new Error("Wrong input string for conversion");n=t}if(r){if(-1!==n.indexOf("+"))throw new Error("Wrong input string for conversion");if(-1!==n.indexOf("-"))throw new Error("Wrong input string for conversion")}else{let t=1,e=n.indexOf("+"),r="";if(-1===e&&(e=n.indexOf("-"),t=-1),-1!==e){if(r=n.substring(e+1),n=n.substring(0,e),2!==r.length&&4!==r.length)throw new Error("Wrong input string for conversion");let i=parseInt(r.substring(0,2),10);if(isNaN(i.valueOf()))throw new Error("Wrong input string for conversion");if(s=t*i,4===r.length){if(i=parseInt(r.substring(2,4),10),isNaN(i.valueOf()))throw new Error("Wrong input string for conversion");a=t*i}}}let c=n.indexOf(".");if(-1===c&&(c=n.indexOf(",")),-1!==c){const t=new Number(`0${n.substring(c)}`);if(isNaN(t.valueOf()))throw new Error("Wrong input string for conversion");o=t.valueOf(),i=n.substring(0,c)}else i=n;switch(!0){case 8===i.length:if(e=/(\d{4})(\d{2})(\d{2})/gi,-1!==c)throw new Error("Wrong input string for conversion");break;case 10===i.length:if(e=/(\d{4})(\d{2})(\d{2})(\d{2})/gi,-1!==c){let t=60*o;this.minute=Math.floor(t),t=60*(t-this.minute),this.second=Math.floor(t),t=1e3*(t-this.second),this.millisecond=Math.floor(t)}break;case 12===i.length:if(e=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi,-1!==c){let t=60*o;this.second=Math.floor(t),t=1e3*(t-this.second),this.millisecond=Math.floor(t)}break;case 14===i.length:if(e=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi,-1!==c){const t=1e3*o;this.millisecond=Math.floor(t)}break;default:throw new Error("Wrong input string for conversion")}const u=e.exec(i);if(null===u)throw new Error("Wrong input string for conversion");for(let t=1;t0&&r.valueBlock.value[0]instanceof de&&(o=e.valueBlock.value.length),0===o)return{verified:!0,result:t};if(0===e.valueBlock.value.length&&0!==r.valueBlock.value.length){let e=!0;for(let t=0;t=e.valueBlock.value.length){if(!1===r.valueBlock.value[s].optional){const e={verified:!1,result:t};return t.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&(delete t[r.name],e.name=r.name)),e}}else if(r.valueBlock.value[0]instanceof de){if(i=ge(t,e.valueBlock.value[s],r.valueBlock.value[0].value),!1===i.verified){if(!r.valueBlock.value[0].optional)return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&delete t[r.name]),i;n++}if(g in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let n={};n="local"in r.valueBlock.value[0]&&r.valueBlock.value[0].local?e:t,void 0===n[r.valueBlock.value[0].name]&&(n[r.valueBlock.value[0].name]=[]),n[r.valueBlock.value[0].name].push(e.valueBlock.value[s])}}else if(i=ge(t,e.valueBlock.value[s-n],r.valueBlock.value[s]),!1===i.verified){if(!r.valueBlock.value[s].optional)return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&delete t[r.name]),i;n++}if(!1===i.verified){const e={verified:!1,result:t};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&(delete t[r.name],e.name=r.name)),e}return{verified:!0,result:t}}if(r.primitiveSchema&&y in e.valueBlock){const n=dt(e.valueBlock.valueHexView);if(-1===n.offset){const e={verified:!1,result:n.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,m),r.name&&(delete t[r.name],e.name=r.name)),e}return ge(t,n.result,r.primitiveSchema)}return{verified:!0,result:t}}function ye(t,e){if(e instanceof Object==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=dt(n.vJ.toUint8Array(t));return-1===r.offset?{verified:!1,result:r.result}:ge(r.result,r.result,e)}},79742:(t,e)=>{"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=c(t),s=o[0],a=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e);1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,c=n-i;ac?c:a+s));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},92882:t=>{"use strict";for(var e="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function s(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=o(e)^n>>5}for(e=o(e),r=0;re)return"Exceeds length limit";var n=t.toLowerCase(),i=t.toUpperCase();if(t!==n&&t!==i)return"Mixed-case string "+t;var a=(t=n).lastIndexOf("1");if(-1===a)return"No separator character for "+t;if(0===a)return"Missing prefix for "+t;var c=t.slice(0,a),u=t.slice(a+1);if(u.length<6)return"Data too short";var l=s(c);if("string"==typeof l)return l;for(var f=[],h=0;h=u.length||f.push(p)}return 1!==l?"Invalid checksum for "+t:{prefix:c,words:f}}function c(t,e,r,n){for(var i=0,o=0,s=(1<=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<=e)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var i=s(t=t.toLowerCase());if("string"==typeof i)throw new Error(i);for(var a=t+"1",c=0;c>5!=0)throw new Error("Non 5-bit word");i=o(i)^u,a+=e.charAt(u)}for(c=0;c<6;++c)i=o(i);for(i^=1,c=0;c<6;++c){a+=e.charAt(i>>5*(5-c)&31)}return a},toWordsUnsafe:function(t){var e=c(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=c(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=c(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=c(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}}},13550:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(46601).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);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 "+t)}function c(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function u(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),c=e;c=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&s0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=c(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(t){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var h=["","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"],d=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?h[6-c.length]+c+r:c+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=d[t],l=p[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var g=f.modrn(l).toString(t);r=(f=f.idivn(l)).isZero()?g+r:h[u-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function g(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,f=67108863&c,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,b=y>>>13,v=0|s[3],w=8191&v,E=v>>>13,A=0|s[4],S=8191&A,k=A>>>13,x=0|s[5],P=8191&x,T=x>>>13,_=0|s[6],O=8191&_,I=_>>>13,B=0|s[7],M=8191&B,N=B>>>13,C=0|s[8],L=8191&C,R=C>>>13,U=0|s[9],D=8191&U,F=U>>>13,j=0|a[0],V=8191&j,G=j>>>13,H=0|a[1],K=8191&H,q=H>>>13,W=0|a[2],z=8191&W,$=W>>>13,J=0|a[3],Z=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,lt=0|a[8],ft=8191<,ht=lt>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(u+(n=Math.imul(f,V))|0)+((8191&(i=(i=Math.imul(f,G))+Math.imul(h,V)|0))<<13)|0;u=((o=Math.imul(h,G))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,G))+Math.imul(g,V)|0,o=Math.imul(g,G);var mt=(u+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(h,K)|0))<<13)|0;u=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,V),i=(i=Math.imul(m,G))+Math.imul(b,V)|0,o=Math.imul(b,G),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,q)|0;var bt=(u+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,z)|0))<<13)|0;u=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,G))+Math.imul(E,V)|0,o=Math.imul(E,G),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,q)|0,n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,$)|0;var vt=(u+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,Z)|0))<<13)|0;u=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,G))+Math.imul(k,V)|0,o=Math.imul(k,G),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,X)|0;var wt=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,Q)|0))<<13)|0;u=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,V),i=(i=Math.imul(P,G))+Math.imul(T,V)|0,o=Math.imul(T,G),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0;var Et=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(O,V),i=(i=Math.imul(O,G))+Math.imul(I,V)|0,o=Math.imul(I,G),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(k,z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0;var At=(u+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(h,ot)|0))<<13)|0;u=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(M,V),i=(i=Math.imul(M,G))+Math.imul(N,V)|0,o=Math.imul(N,G),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var St=(u+(n=n+Math.imul(f,ct)|0)|0)+((8191&(i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,ct)|0))<<13)|0;u=((o=o+Math.imul(h,ut)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(R,V)|0,o=Math.imul(R,G),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(O,z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0;var kt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,G))+Math.imul(F,V)|0,o=Math.imul(F,G),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(m,ct)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,ut)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,ht)|0;var xt=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((o=o+Math.imul(h,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,q))+Math.imul(F,K)|0,o=Math.imul(F,q),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,ut)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var Pt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,z),i=(i=Math.imul(D,$))+Math.imul(F,z)|0,o=Math.imul(F,$),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0;var Tt=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,gt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ut)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,ht)|0;var _t=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,gt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ut)|0,n=n+Math.imul(P,ft)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,ht)|0;var Ot=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,gt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,ut)|0,n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(I,ft)|0,o=o+Math.imul(I,ht)|0;var It=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((o=o+Math.imul(T,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,ht)|0;var Bt=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,gt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((o=o+Math.imul(I,gt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0;var Mt=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(D,ft),i=(i=Math.imul(D,ht))+Math.imul(F,ft)|0,o=Math.imul(F,ht);var Nt=(u+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,gt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ct=(u+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,gt))+Math.imul(F,pt)|0))<<13)|0;return u=((o=Math.imul(F,gt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,c[0]=yt,c[1]=mt,c[2]=bt,c[3]=vt,c[4]=wt,c[5]=Et,c[6]=At,c[7]=St,c[8]=kt,c[9]=xt,c[10]=Pt,c[11]=Tt,c[12]=_t,c[13]=Ot,c[14]=It,c[15]=Bt,c[16]=Mt,c[17]=Nt,c[18]=Ct,0!==u&&(c[19]=u,r.length++),r};function m(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(t,e,r){return m(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(y=g),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?y(this,t,e):r<63?g(this,t,e):r<1024?m(this,t,e):b(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==e){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=h)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(c)):(r.isub(e),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new P(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(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 S(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){P.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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 t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},i(A,E),A.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new S;else if("p192"===t)e=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return w[t]=e,e},P.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},P.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},P.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},P.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},P.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},P.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},P.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},P.prototype.isqr=function(t){return this.imul(t,t.clone())},P.prototype.sqr=function(t){return this.mul(t,t)},P.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();n(y=0;n--){for(var u=e.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},P.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},P.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},i(T,P),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},29931:(t,e,r)=>{var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r{"use strict";const n=r(79742),i=r(80645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=a(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||Z(t.length)?a(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return l(t),a(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(i)return n?-1:W(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function _(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){G(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function L(t,e,r,n,i){G(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function R(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||M(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||M(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||M(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Y((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||M(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||M(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||M(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||M(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Y((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||M(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||M(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||M(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||M(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){N(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,!n){N(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Y((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Y((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Y((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Y((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=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),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function G(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||K(e,t.length-(r+1))}(n,i,o)}function H(t,e){if("number"!=typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function K(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function W(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},21924:(t,e,r)=>{"use strict";var n=r(40210),i=r(55559),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},55559:(t,e,r)=>{"use strict";var n=r(58612),i=r(40210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=a(n,s,arguments);if(c&&u){var r=c(e,"length");r.configurable&&u(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var f=function(){return a(n,o,arguments)};u?u(t.exports,"apply",{value:f}):t.exports.apply=f},4289:(t,e,r)=>{"use strict";var n=r(82215),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,c=r(31044)(),u=a&&c,l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(u?a(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{"use strict";var n=e;n.version=r(18597).i8,n.utils=r(80953),n.rand=r(29931),n.curve=r(88254),n.curves=r(45427),n.ec=r(57954),n.eddsa=r(65980)},4918:(t,e,r)=>{"use strict";var n=r(73785),i=r(80953),o=i.getNAF,s=i.getJSF,a=i.assert;function c(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.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=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=s;l--)c=(c<<1)+n[l];u.push(c)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var f=s[u];a(0!==f),c="affine"===t.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===t.type?c.toP():c},c.prototype._wnafMulAdd=function(t,e,r,n,i){var a,c,u,l=this._wnafT1,f=this._wnafT2,h=this._wnafT3,d=0;for(a=0;a=1;a-=2){var g=a-1,y=a;if(1===l[g]&&1===l[y]){var m=[e[g],null,null,e[y]];0===e[g].y.cmp(e[y].y)?(m[1]=e[g].add(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg())):0===e[g].y.cmp(e[y].y.redNeg())?(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].add(e[y].neg())):(m[1]=e[g].toJ().mixedAdd(e[y]),m[2]=e[g].toJ().mixedAdd(e[y].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[g],r[y]);for(d=Math.max(v[0].length,d),h[g]=new Array(d),h[y]=new Array(d),c=0;c=0;a--){for(var k=0;a>=0;){var x=!0;for(c=0;c=0&&k++,A=A.dblp(k),a<0)break;for(c=0;c0?u=f[c][P-1>>1]:P<0&&(u=f[c][-P-1>>1].neg()),A="affine"===u.type?A.mixedAdd(u):A.add(u))}}for(a=0;a=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i{"use strict";var n=r(80953),i=r(73785),o=r(35717),s=r(4918),a=n.assert;function c(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&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 i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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()))))}o(c,s),t.exports=c,c.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},c.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},c.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(e&&!c||!e&&c)&&(a=a.redNeg()),this.point(t,a)},c.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},c.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(u,s.BasePoint),c.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},c.prototype.point=function(t,e,r,n){return new u(this,t,e,r,n)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),f=s.redMul(o);return this.curve.point(c,u,f,l)},u.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(t=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),e=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),t=s.redSub(a).redISub(c).redMul(o),e=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(e),u=o.redMul(s),l=a.redMul(c),f=o.redMul(c),h=s.redMul(a);return this.curve.point(u,l,h,f)},u.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),f=n.redMul(c).redMul(l);return this.curve.twisted?(e=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(e=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},88254:(t,e,r)=>{"use strict";var n=e;n.base=r(4918),n.short=r(6673),n.mont=r(22881),n.edwards=r(31138)},22881:(t,e,r)=>{"use strict";var n=r(73785),i=r(35717),o=r(4918),s=r(80953);function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,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)))}i(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new c(this,t,e)},a.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(t,e){return new c(t,e[0],e[1]||t.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),c=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(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(t){return 0===this.getX().cmp(t.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()}},6673:(t,e,r)=>{"use strict";var n=r(80953),i=r(73785),o=r(35717),s=r(4918),a=n.assert;function c(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(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 l(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(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}o(c,s),t.exports=c,c.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,c,u,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,d=this.n.clone(),p=new i(1),g=new i(0),y=new i(0),m=new i(1),b=0;0!==h.cmpn(0);){var v=d.div(h);u=d.sub(v.mul(h)),l=y.sub(v.mul(p));var w=m.sub(v.mul(g));if(!n&&u.cmp(f)<0)e=c.neg(),r=p,n=u.neg(),o=l;else if(n&&2==++b)break;c=u,d=h,h=u,y=p,p=l,m=g,g=w}s=u.neg(),a=l;var E=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(E)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},c.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.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 e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(t,e,r){return new l(this,t,e,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),f=n.redMul(u),h=c.redSqr().redIAdd(l).redISub(f).redISub(f),d=c.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(l).redISub(l),h=a.redMul(l.redISub(f)).redISub(i.redMul(u)),d=this.z.redMul(s);return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},45427:(t,e,r)=>{"use strict";var n,i=e,o=r(33715),s=r(88254),a=r(80953).assert;function c(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new c(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:o.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"]}),u("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:o.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(91037)}catch(t){n=void 0}u("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},57954:(t,e,r)=>{"use strict";var n=r(73785),i=r(2156),o=r(80953),s=r(45427),a=r(29931),c=o.assert,u=r(31251),l=r(90611);function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(c(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=f,f.prototype.keyPair=function(t){return new u(this,t)},f.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),c=t.toArray("be",s),u=new i({hash:this.hash,entropy:a,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),h=0;;h++){var d=o.k?o.k(h):new n(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(0!==y.cmpn(0)){var m=d.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==g.cmp(y)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),b^=1),new l({r:y,s:m,recoveryParam:b})}}}}}},f.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new l(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(t).umod(this.n),f=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(t,e,r,i){c((3&r)===r,"The recovery param is more than two bits"),e=new l(e,i);var o=this.n,s=new n(t),a=e.r,u=e.s,f=1&r,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),g=u.mul(d).umod(o);return this.g.mulAdd(p,a,g)},f.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new l(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},31251:(t,e,r)=>{"use strict";var n=r(73785),i=r(80953).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},90611:(t,e,r)=>{"use strict";var n=r(73785),i=r(80953),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=c(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=c(t,r);if(!1===s)return!1;var u=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var l=c(t,r);if(!1===l)return!1;if(t.length!==l+r.place)return!1;var f=t.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(u),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,e.length),(n=n.concat(e)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,t)}},65980:(t,e,r)=>{"use strict";var n=r(33715),i=r(45427),o=r(80953),s=o.assert,a=o.parseBytes,c=r(79087),u=r(23622);function l(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof l))return new l(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=l,l.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},l.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var t=this.hash(),e=0;e{"use strict";var n=r(80953),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=a},23622:(t,e,r)=>{"use strict";var n=r(73785),i=r(80953),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function c(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.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 i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=c},91037:t=>{t.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"]]}}},80953:(t,e,r)=>{"use strict";var n=e,i=r(73785),o=r(79746),s=r(34504);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,c=t.andln(3)+i&3,u=e.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},73785:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(85568).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=c(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};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"],f=[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],h=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u>>26,f=67108863&c,h=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=h;d++){var p=u-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?g+r:l[u-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===e,u=new t(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,g=d>>>13,y=0|s[2],m=8191&y,b=y>>>13,v=0|s[3],w=8191&v,E=v>>>13,A=0|s[4],S=8191&A,k=A>>>13,x=0|s[5],P=8191&x,T=x>>>13,_=0|s[6],O=8191&_,I=_>>>13,B=0|s[7],M=8191&B,N=B>>>13,C=0|s[8],L=8191&C,R=C>>>13,U=0|s[9],D=8191&U,F=U>>>13,j=0|a[0],V=8191&j,G=j>>>13,H=0|a[1],K=8191&H,q=H>>>13,W=0|a[2],z=8191&W,$=W>>>13,J=0|a[3],Z=8191&J,X=J>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,lt=0|a[8],ft=8191<,ht=lt>>>13,dt=0|a[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(u+(n=Math.imul(f,V))|0)+((8191&(i=(i=Math.imul(f,G))+Math.imul(h,V)|0))<<13)|0;u=((o=Math.imul(h,G))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,G))+Math.imul(g,V)|0,o=Math.imul(g,G);var mt=(u+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(h,K)|0))<<13)|0;u=((o=o+Math.imul(h,q)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,V),i=(i=Math.imul(m,G))+Math.imul(b,V)|0,o=Math.imul(b,G),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,q)|0;var bt=(u+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,z)|0))<<13)|0;u=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,G))+Math.imul(E,V)|0,o=Math.imul(E,G),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,q)|0,n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,$)|0;var vt=(u+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,Z)|0))<<13)|0;u=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,G))+Math.imul(k,V)|0,o=Math.imul(k,G),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(b,z)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,X)|0;var wt=(u+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,Q)|0))<<13)|0;u=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,V),i=(i=Math.imul(P,G))+Math.imul(T,V)|0,o=Math.imul(T,G),n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0;var Et=(u+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(O,V),i=(i=Math.imul(O,G))+Math.imul(I,V)|0,o=Math.imul(I,G),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(k,z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0;var At=(u+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(h,ot)|0))<<13)|0;u=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(M,V),i=(i=Math.imul(M,G))+Math.imul(N,V)|0,o=Math.imul(N,G),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var St=(u+(n=n+Math.imul(f,ct)|0)|0)+((8191&(i=(i=i+Math.imul(f,ut)|0)+Math.imul(h,ct)|0))<<13)|0;u=((o=o+Math.imul(h,ut)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(R,V)|0,o=Math.imul(R,G),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(O,z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ut)|0;var kt=(u+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;u=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,G))+Math.imul(F,V)|0,o=Math.imul(F,G),n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(m,ct)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,ut)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,ht)|0;var xt=(u+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,gt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((o=o+Math.imul(h,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,q))+Math.imul(F,K)|0,o=Math.imul(F,q),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(w,ct)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,ut)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ht)|0;var Pt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;u=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(D,z),i=(i=Math.imul(D,$))+Math.imul(F,z)|0,o=Math.imul(F,$),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0;var Tt=(u+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,gt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ut)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,ht)|0;var _t=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,gt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,gt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ut)|0,n=n+Math.imul(P,ft)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,ht)|0;var Ot=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,gt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,ut)|0,n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(I,ft)|0,o=o+Math.imul(I,ht)|0;var It=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((o=o+Math.imul(T,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,ut)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ut)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,ht)|0;var Bt=(u+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,gt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((o=o+Math.imul(I,gt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,ct),i=(i=Math.imul(D,ut))+Math.imul(F,ct)|0,o=Math.imul(F,ut),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,ht)|0;var Mt=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(D,ft),i=(i=Math.imul(D,ht))+Math.imul(F,ft)|0,o=Math.imul(F,ht);var Nt=(u+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,gt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ct=(u+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,gt))+Math.imul(F,pt)|0))<<13)|0;return u=((o=Math.imul(F,gt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,c[0]=yt,c[1]=mt,c[2]=bt,c[3]=vt,c[4]=wt,c[5]=Et,c[6]=At,c[7]=St,c[8]=kt,c[9]=xt,c[10]=Pt,c[11]=Tt,c[12]=_t,c[13]=Ot,c[14]=It,c[15]=Bt,c[16]=Mt,c[17]=Nt,c[18]=Ct,0!==u&&(c[19]=u,r.length++),r};function g(t,e,r){return(new y).mulp(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):g(this,t,e),r},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},y.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,u=0;u=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==e){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=h)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(c)):(r.isub(e),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new A}return m[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var g=d,y=0;0!==g.cmp(a);y++)g=g.redSqr();n(y=0;n--){for(var u=e.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,S),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},41503:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r(34149),o=r(95320),s=r(18923),a=r(12636),c=function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=u(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var o=e.call(t,r);if(i(o))return o;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(t)||a(t))&&(r="string"),c(t,"default"===r?"number":r)}},34149:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},93343:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BaseContract:()=>B,BigNumber:()=>h.O$,Contract:()=>M,ContractFactory:()=>N,FixedNumber:()=>C.xs,Signer:()=>l.E,VoidSigner:()=>l.b,Wallet:()=>L.Wallet,Wordlist:()=>Yt.D,constants:()=>n,errors:()=>y.ErrorCode,ethers:()=>s,getDefaultProvider:()=>Zt,logger:()=>Ee,providers:()=>i,utils:()=>o,version:()=>we,wordlists:()=>Xt.E});var n={};r.r(n),r.d(n,{AddressZero:()=>R.d,EtherSymbol:()=>F,HashZero:()=>D.R,MaxInt256:()=>U.PS,MaxUint256:()=>U.Bz,MinInt256:()=>U.$B,NegativeOne:()=>U.tL,One:()=>U.fh,Two:()=>U.Py,WeiPerEther:()=>U.Ce,Zero:()=>U._Y});var i={};r.r(i),r.d(i,{AlchemyProvider:()=>nt,AlchemyWebSocketProvider:()=>rt,AnkrProvider:()=>at,BaseProvider:()=>V.Zk,CloudflareProvider:()=>lt,EtherscanProvider:()=>wt,FallbackProvider:()=>Rt,Formatter:()=>G.Mb,InfuraProvider:()=>Vt,InfuraWebSocketProvider:()=>jt,IpcProvider:()=>Ut,JsonRpcBatchProvider:()=>Gt,JsonRpcProvider:()=>H.r,JsonRpcSigner:()=>H.C,NodesmithProvider:()=>Kt,PocketProvider:()=>zt,Provider:()=>u.zt,Resolver:()=>V.H2,StaticJsonRpcProvider:()=>Y,UrlJsonRpcProvider:()=>Q,Web3Provider:()=>$t.Q,WebSocketProvider:()=>J,getDefaultProvider:()=>Zt,getNetwork:()=>j.H,isCommunityResourcable:()=>G.Ed,isCommunityResource:()=>G.Gp,showThrottleMessage:()=>G.vh});var o={};r.r(o),r.d(o,{AbiCoder:()=>Qt.R,ConstructorFragment:()=>te.Xg,ErrorFragment:()=>te.IC,EventFragment:()=>te.QV,FormatTypes:()=>te.pc,Fragment:()=>te.HY,FunctionFragment:()=>te.YW,HDNode:()=>ae.HDNode,Indexed:()=>c.Hk,Interface:()=>c.vU,LogDescription:()=>c.CC,Logger:()=>y.Logger,ParamType:()=>te._R,RLP:()=>de,SigningKey:()=>pe.SigningKey,SupportedAlgorithm:()=>ve.p,TransactionDescription:()=>c.vk,TransactionTypes:()=>g.TransactionTypes,UnicodeNormalizationForm:()=>ye.Uj,Utf8ErrorFuncs:()=>ye.te,Utf8ErrorReason:()=>ye.Uw,_TypedDataEncoder:()=>se.E,_fetchData:()=>ft._fetchData,_toEscapedUtf8String:()=>ye.U$,accessListify:()=>g.accessListify,arrayify:()=>d.arrayify,base58:()=>re.Base58,base64:()=>ee,checkProperties:()=>p.checkProperties,checkResultErrors:()=>a.BR,commify:()=>be.commify,computeAddress:()=>g.computeAddress,computeHmac:()=>le.Gy,computePublicKey:()=>pe.computePublicKey,concat:()=>d.concat,deepCopy:()=>p.deepCopy,defaultAbiCoder:()=>Qt.$,defaultPath:()=>ae.defaultPath,defineReadOnly:()=>p.defineReadOnly,dnsEncode:()=>ne.Kn,entropyToMnemonic:()=>ae.entropyToMnemonic,fetchJson:()=>ft.fetchJson,formatBytes32String:()=>me.s,formatEther:()=>be.formatEther,formatUnits:()=>be.formatUnits,getAccountPath:()=>ae.getAccountPath,getAddress:()=>f.getAddress,getContractAddress:()=>f.getContractAddress,getCreate2Address:()=>f.getCreate2Address,getIcapAddress:()=>f.getIcapAddress,getJsonWalletAddress:()=>ce.Rb,getStatic:()=>p.getStatic,hashMessage:()=>ie.r,hexConcat:()=>d.hexConcat,hexDataLength:()=>d.hexDataLength,hexDataSlice:()=>d.hexDataSlice,hexStripZeros:()=>d.hexStripZeros,hexValue:()=>d.hexValue,hexZeroPad:()=>d.hexZeroPad,hexlify:()=>d.hexlify,id:()=>oe.id,isAddress:()=>f.isAddress,isBytes:()=>d.isBytes,isBytesLike:()=>d.isBytesLike,isHexString:()=>d.isHexString,isValidMnemonic:()=>ae.isValidMnemonic,isValidName:()=>ne.r1,joinSignature:()=>d.joinSignature,keccak256:()=>ue.keccak256,mnemonicToEntropy:()=>ae.mnemonicToEntropy,mnemonicToSeed:()=>ae.mnemonicToSeed,namehash:()=>ne.VM,nameprep:()=>ge.Ll,parseBytes32String:()=>me.F,parseEther:()=>be.parseEther,parseTransaction:()=>g.parse,parseUnits:()=>be.parseUnits,poll:()=>ft.poll,randomBytes:()=>he.O,recoverAddress:()=>g.recoverAddress,recoverPublicKey:()=>pe.recoverPublicKey,resolveProperties:()=>p.resolveProperties,ripemd160:()=>le.bP,serializeTransaction:()=>g.serialize,sha256:()=>le.JQ,sha512:()=>le.o,shallowCopy:()=>p.shallowCopy,shuffled:()=>Et.y,solidityKeccak256:()=>fe.keccak256,solidityPack:()=>fe.pack,soliditySha256:()=>fe.sha256,splitSignature:()=>d.splitSignature,stripZeros:()=>d.stripZeros,toUtf8Bytes:()=>ye.Y0,toUtf8CodePoints:()=>ye.XL,toUtf8String:()=>ye.ZN,verifyMessage:()=>L.verifyMessage,verifyTypedData:()=>L.verifyTypedData,zeroPad:()=>d.zeroPad});var s={};r.r(s),r.d(s,{BaseContract:()=>B,BigNumber:()=>h.O$,Contract:()=>M,ContractFactory:()=>N,FixedNumber:()=>C.xs,Signer:()=>l.E,VoidSigner:()=>l.b,Wallet:()=>L.Wallet,Wordlist:()=>Yt.D,constants:()=>n,errors:()=>y.ErrorCode,getDefaultProvider:()=>Zt,logger:()=>Ee,providers:()=>i,utils:()=>o,version:()=>we,wordlists:()=>Xt.E});var a=r(61184),c=r(8198),u=r(64353),l=r(48171),f=r(64594),h=r(2593),d=r(93286),p=r(53587),g=r(13479),y=r(80711);var m=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const b=new y.Logger("contracts/5.6.2"),v={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function w(t,e){return m(this,void 0,void 0,(function*(){const r=yield e;"string"!=typeof r&&b.throwArgumentError("invalid address or ENS name","name",r);try{return(0,f.getAddress)(r)}catch(t){}t||b.throwError("a provider or signer is needed to resolve ENS names",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return null==n&&b.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function E(t,e,r){return m(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>E(t,Array.isArray(e)?e[n]:e[r.name],r)))):"address"===r.type?yield w(t,e):"tuple"===r.type?yield E(t,e,r.components):"array"===r.baseType?Array.isArray(e)?yield Promise.all(e.map((e=>E(t,e,r.arrayChildren)))):Promise.reject(b.makeError("invalid value for array",y.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e}))}function A(t,e,r){return m(this,void 0,void 0,(function*(){let n={};r.length===e.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=(0,p.shallowCopy)(r.pop())),b.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=(0,p.resolveProperties)({override:w(t.signer,n.from),signer:t.signer.getAddress()}).then((t=>m(this,void 0,void 0,(function*(){return(0,f.getAddress)(t.signer)!==t.override&&b.throwError("Contract with a Signer cannot override from",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})))):n.from=t.signer.getAddress():n.from&&(n.from=w(t.provider,n.from));const i=yield(0,p.resolveProperties)({args:E(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:(0,p.resolveProperties)(n)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},a=i.overrides;if(null!=a.nonce&&(s.nonce=h.O$.from(a.nonce).toNumber()),null!=a.gasLimit&&(s.gasLimit=h.O$.from(a.gasLimit)),null!=a.gasPrice&&(s.gasPrice=h.O$.from(a.gasPrice)),null!=a.maxFeePerGas&&(s.maxFeePerGas=h.O$.from(a.maxFeePerGas)),null!=a.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=h.O$.from(a.maxPriorityFeePerGas)),null!=a.from&&(s.from=a.from),null!=a.type&&(s.type=a.type),null!=a.accessList&&(s.accessList=(0,g.accessListify)(a.accessList)),null==s.gasLimit&&null!=e.gas){let t=21e3;const r=(0,d.arrayify)(o);for(let e=0;enull!=n[t]));return c.length&&b.throwError(`cannot override ${c.map((t=>JSON.stringify(t))).join(",")}`,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),s}))}function S(t,e){const r=e.wait.bind(e);e.wait=e=>r(e).then((e=>(e.events=e.logs.map((r=>{let n=(0,p.deepCopy)(r),i=null;try{i=t.interface.parseLog(r)}catch(t){}return i&&(n.args=i.args,n.decode=(e,r)=>t.interface.decodeEventLog(i.eventFragment,e,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>t.provider,n.getBlock=()=>t.provider.getBlock(e.blockHash),n.getTransaction=()=>t.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(e),n})),e)))}function k(t,e,r){const n=t.signer||t.provider;return function(...i){return m(this,void 0,void 0,(function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){const t=(0,p.shallowCopy)(i.pop());null!=t.blockTag&&(o=yield t.blockTag),delete t.blockTag,i.push(t)}null!=t.deployTransaction&&(yield t._deployed(o));const s=yield A(t,e,i),a=yield n.call(s,o);try{let n=t.interface.decodeFunctionResult(e,a);return r&&1===e.outputs.length&&(n=n[0]),n}catch(e){throw e.code===y.Logger.errors.CALL_EXCEPTION&&(e.address=t.address,e.args=i,e.transaction=s),e}}))}}function x(t,e,r){return e.constant?k(t,e,r):function(t,e){return function(...r){return m(this,void 0,void 0,(function*(){t.signer||b.throwError("sending a transaction requires a signer",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());const n=yield A(t,e,r),i=yield t.signer.sendTransaction(n);return S(t,i),i}))}}(t,e)}function P(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((t=>Array.isArray(t)?t.join("|"):t)).join(":"):""):"*"}class T{constructor(t,e){(0,p.defineReadOnly)(this,"tag",t),(0,p.defineReadOnly)(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter((r=>!(!e&&r.listener===t)||(e=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((t=>t.listener))}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter((e=>{const r=t.slice();return setTimeout((()=>{e.listener.apply(this,r)}),0),!e.once})),e}prepareEvent(t){}getEmit(t){return[t]}}class _ extends T{constructor(){super("error",null)}}class O extends T{constructor(t,e,r,n){const i={address:t};let o=e.getEventTopic(r);n?(o!==n[0]&&b.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(P(i),i),(0,p.defineReadOnly)(this,"address",t),(0,p.defineReadOnly)(this,"interface",e),(0,p.defineReadOnly)(this,"fragment",r)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=(0,a.BR)(t.args);if(e.length)throw e[0].error;const r=(t.args||[]).slice();return r.push(t),r}}class I extends T{constructor(t,e){super("*",{address:t}),(0,p.defineReadOnly)(this,"address",t),(0,p.defineReadOnly)(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,r)=>this.interface.decodeEventLog(e.eventFragment,t,r),t.args=e.args}catch(t){}}}class B{constructor(t,e,r){(0,p.defineReadOnly)(this,"interface",(0,p.getStatic)(new.target,"getInterface")(e)),null==r?((0,p.defineReadOnly)(this,"provider",null),(0,p.defineReadOnly)(this,"signer",null)):l.E.isSigner(r)?((0,p.defineReadOnly)(this,"provider",r.provider||null),(0,p.defineReadOnly)(this,"signer",r)):u.zt.isProvider(r)?((0,p.defineReadOnly)(this,"provider",r),(0,p.defineReadOnly)(this,"signer",null)):b.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,p.defineReadOnly)(this,"callStatic",{}),(0,p.defineReadOnly)(this,"estimateGas",{}),(0,p.defineReadOnly)(this,"functions",{}),(0,p.defineReadOnly)(this,"populateTransaction",{}),(0,p.defineReadOnly)(this,"filters",{});{const t={};Object.keys(this.interface.events).forEach((e=>{const r=this.interface.events[e];(0,p.defineReadOnly)(this.filters,e,((...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,t)}))),t[r.name]||(t[r.name]=[]),t[r.name].push(e)})),Object.keys(t).forEach((e=>{const r=t[e];1===r.length?(0,p.defineReadOnly)(this.filters,e,this.filters[r[0]]):b.warn(`Duplicate definition of ${e} (${r.join(", ")})`)}))}if((0,p.defineReadOnly)(this,"_runningEvents",{}),(0,p.defineReadOnly)(this,"_wrappedEmits",{}),null==t&&b.throwArgumentError("invalid contract address or ENS name","addressOrName",t),(0,p.defineReadOnly)(this,"address",t),this.provider)(0,p.defineReadOnly)(this,"resolvedAddress",w(this.provider,t));else try{(0,p.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,f.getAddress)(t)))}catch(t){b.throwError("provider is required to use ENS name as contract address",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((t=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((t=>{const e=this.interface.functions[t];if(i[t])b.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);else{i[t]=!0;{const r=e.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(t)}null==this[t]&&(0,p.defineReadOnly)(this,t,x(this,e,!0)),null==this.functions[t]&&(0,p.defineReadOnly)(this.functions,t,x(this,e,!1)),null==this.callStatic[t]&&(0,p.defineReadOnly)(this.callStatic,t,k(this,e,!0)),null==this.populateTransaction[t]&&(0,p.defineReadOnly)(this.populateTransaction,t,function(t,e){return function(...r){return A(t,e,r)}}(this,e)),null==this.estimateGas[t]&&(0,p.defineReadOnly)(this.estimateGas,t,function(t,e){const r=t.signer||t.provider;return function(...n){return m(this,void 0,void 0,(function*(){r||b.throwError("estimate require a provider or signer",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield A(t,e,n);return yield r.estimateGas(i)}))}}(this,e))}})),Object.keys(n).forEach((t=>{const e=n[t];if(e.length>1)return;t=t.substring(1);const r=e[0];try{null==this[t]&&(0,p.defineReadOnly)(this,t,this[r])}catch(t){}null==this.functions[t]&&(0,p.defineReadOnly)(this.functions,t,this.functions[r]),null==this.callStatic[t]&&(0,p.defineReadOnly)(this.callStatic,t,this.callStatic[r]),null==this.populateTransaction[t]&&(0,p.defineReadOnly)(this.populateTransaction,t,this.populateTransaction[r]),null==this.estimateGas[t]&&(0,p.defineReadOnly)(this.estimateGas,t,this.estimateGas[r])}))}static getContractAddress(t){return(0,f.getContractAddress)(t)}static getInterface(t){return c.vU.isInterface(t)?t:new c.vU(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,t).then((t=>("0x"===t&&b.throwError("contract not deployed",y.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(t){this.signer||b.throwError("sending a transactions require a signer",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=(0,p.shallowCopy)(t||{});return["from","to"].forEach((function(t){null!=e[t]&&b.throwError("cannot override "+t,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(e)))}connect(t){"string"==typeof t&&(t=new l.b(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&(0,p.defineReadOnly)(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return c.Hk.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new _);if("event"===t)return this._normalizeRunningEvent(new T("event",null));if("*"===t)return this._normalizeRunningEvent(new I(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new O(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const e=t.topics[0];if("string"!=typeof e)throw new Error("invalid topic");const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new O(this.address,this.interface,r,t.topics))}catch(t){}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new T(P(e),e))}return this._normalizeRunningEvent(new I(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,r){const n=(0,p.deepCopy)(e);return n.removeListener=()=>{r&&(t.removeListener(r),this._checkRunningEvents(t))},n.getBlock=()=>this.provider.getBlock(e.blockHash),n.getTransaction=()=>this.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(n),n}_addEventListener(t,e,r){if(this.provider||b.throwError("events require a provider or a signer with a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const r=r=>{let n=this._wrapEvent(t,r,e);if(null==n.decodeError)try{const e=t.getEmit(n);this.emit(t.filter,...e)}catch(t){n.decodeError=t.error}null!=t.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[t.tag]=r,null!=t.filter&&this.provider.on(t.filter,r)}}queryFilter(t,e,r){const n=this._getRunningEvent(t),i=(0,p.shallowCopy)(n.filter);return"string"==typeof e&&(0,d.isHexString)(e,32)?(null!=r&&b.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((t=>t.map((t=>this._wrapEvent(n,t,null)))))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const r=this._getRunningEvent(t),n=r.run(e)>0;return this._checkRunningEvents(r),n}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce(((t,e)=>t+this._runningEvents[e].listenerCount()),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){const t=[];for(let e in this._runningEvents)this._runningEvents[e].listeners().forEach((e=>{t.push(e)}));return t}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(const t in this._runningEvents){const e=this._runningEvents[t];e.removeAllListeners(),this._checkRunningEvents(e)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}removeListener(t,e){return this.off(t,e)}}class M extends B{}class N{constructor(t,e,r){let n=null;n="string"==typeof e?e:(0,d.isBytes)(e)?(0,d.hexlify)(e):e&&"string"==typeof e.object?e.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!(0,d.isHexString)(n)||n.length%2)&&b.throwArgumentError("invalid bytecode","bytecode",e),r&&!l.E.isSigner(r)&&b.throwArgumentError("invalid signer","signer",r),(0,p.defineReadOnly)(this,"bytecode",n),(0,p.defineReadOnly)(this,"interface",(0,p.getStatic)(new.target,"getInterface")(t)),(0,p.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(...t){let e={};if(t.length===this.interface.deploy.inputs.length+1&&"object"==typeof t[t.length-1]){e=(0,p.shallowCopy)(t.pop());for(const t in e)if(!v[t])throw new Error("unknown transaction override "+t)}if(["data","from","to"].forEach((t=>{null!=e[t]&&b.throwError("cannot override "+t,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.value){h.O$.from(e.value).isZero()||this.interface.deploy.payable||b.throwError("non-payable constructor cannot override value",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})}return b.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=(0,d.hexlify)((0,d.concat)([this.bytecode,this.interface.encodeDeploy(t)])),e}deploy(...t){return m(this,void 0,void 0,(function*(){let e={};t.length===this.interface.deploy.inputs.length+1&&(e=t.pop()),b.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield E(this.signer,t,this.interface.deploy.inputs);r.push(e);const n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=(0,p.getStatic)(this.constructor,"getContractAddress")(i),s=(0,p.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return S(s,i),(0,p.defineReadOnly)(s,"deployTransaction",i),s}))}attach(t){return this.constructor.getContract(t,this.interface,this.signer)}connect(t){return new this.constructor(this.interface,this.bytecode,t)}static fromSolidity(t,e){null==t&&b.throwError("missing compiler output",y.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));const r=t.abi;let n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}static getInterface(t){return M.getInterface(t)}static getContractAddress(t){return(0,f.getContractAddress)(t)}static getContract(t,e,r){return new M(t,e,r)}}var C=r(20335),L=r(44958),R=r(9279),U=r(21046),D=r(57218);const F="Ξ";var j=r(79861),V=r(75361),G=r(30032),H=r(82169),K=r(34216);let q=null;try{if(q=WebSocket,null==q)throw new Error("inject please")}catch(t){const e=new y.Logger(K.i);q=function(){e.throwError("WebSockets not supported in this environment",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var W=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const z=new y.Logger(K.i);let $=1;class J extends H.r{constructor(t,e){"any"===e&&z.throwError("WebSocketProvider does not support 'any' network yet",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"==typeof t?t:"_websocket",e),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof t?(0,p.defineReadOnly)(this,"_websocket",new q(this.connection.url)):(0,p.defineReadOnly)(this,"_websocket",t),(0,p.defineReadOnly)(this,"_requests",{}),(0,p.defineReadOnly)(this,"_subs",{}),(0,p.defineReadOnly)(this,"_subIds",{}),(0,p.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((t=>{this.websocket.send(this._requests[t].payload)}))},this.websocket.onmessage=t=>{const e=t.data,r=JSON.parse(e);if(null!=r.id){const t=String(r.id),n=this._requests[t];if(delete this._requests[t],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let t=null;r.error?(t=new Error(r.error.message||"unknown error"),(0,p.defineReadOnly)(t,"code",r.error.code||null),(0,p.defineReadOnly)(t,"response",e)):t=new Error("unknown error"),n.callback(t,void 0),this.emit("debug",{action:"response",error:t,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const t=this._subs[r.params.subscription];t&&t.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(t){z.throwError("cannot reset events block on WebSocketProvider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(t){z.throwError("cannot set polling interval on WebSocketProvider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return W(this,void 0,void 0,(function*(){return null}))}set polling(t){t&&z.throwError("cannot set polling on WebSocketProvider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(t,e){const r=$++;return new Promise(((n,i)=>{const o=JSON.stringify({method:t,params:e,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(t,e){return t?i(t):n(e)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(t,e,r){return W(this,void 0,void 0,(function*(){let n=this._subIds[t];null==n&&(n=Promise.all(e).then((t=>this.send("eth_subscribe",t))),this._subIds[t]=n);const i=yield n;this._subs[i]={tag:t,processFunc:r}}))}_startEvent(t){switch(t.type){case"block":this._subscribe("block",["newHeads"],(t=>{const e=h.O$.from(t.number).toNumber();this._emitted.block=e,this.emit("block",e)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(t=>{this.emit("pending",t)}));break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],(e=>{null==e.removed&&(e.removed=!1),this.emit(t.filter,this.formatter.filterLog(e))}));break;case"tx":{const e=t=>{const e=t.hash;this.getTransactionReceipt(e).then((t=>{t&&this.emit(e,t)}))};e(t),this._subscribe("tx",["newHeads"],(t=>{this._events.filter((t=>"tx"===t.type)).forEach(e)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}_stopEvent(t){let e=t.tag;if("tx"===t.type){if(this._events.filter((t=>"tx"===t.type)).length)return;e="tx"}else if(this.listenerCount(t.event))return;const r=this._subIds[e];r&&(delete this._subIds[e],r.then((t=>{this._subs[t]&&(delete this._subs[t],this.send("eth_unsubscribe",[t]))})))}destroy(){return W(this,void 0,void 0,(function*(){this.websocket.readyState===q.CONNECTING&&(yield new Promise((t=>{this.websocket.onopen=function(){t(!0)},this.websocket.onerror=function(){t(!1)}}))),this.websocket.close(1e3)}))}}var Z=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const X=new y.Logger(K.i);class Y extends H.r{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return Z(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||X.throwError("no network detected",y.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,p.defineReadOnly)(this,"_network",e),this.emit("network",e,null))),e}))}}class Q extends Y{constructor(t,e){X.checkAbstract(new.target,Q),t=(0,p.getStatic)(new.target,"getNetwork")(t),e=(0,p.getStatic)(new.target,"getApiKey")(e);super((0,p.getStatic)(new.target,"getUrl")(t,e),t),"string"==typeof e?(0,p.defineReadOnly)(this,"apiKey",e):null!=e&&Object.keys(e).forEach((t=>{(0,p.defineReadOnly)(this,t,e[t])}))}_startPending(){X.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(t){return X.throwError("API provider does not support signing",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(t){return t}static getUrl(t,e){return X.throwError("not implemented; sub-classes must override getUrl",y.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const tt=new y.Logger(K.i),et="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class rt extends J{constructor(t,e){const r=new nt(t,e);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),(0,p.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===et}}class nt extends Q{static getWebSocketProvider(t,e){return new rt(t,e)}static getApiKey(t){return null==t?et:(t&&"string"!=typeof t&&tt.throwArgumentError("invalid apiKey","apiKey",t),t)}static getUrl(t,e){let r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-rinkeby":r="arb-rinkeby.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-kovan":r="opt-kovan.g.alchemy.com/v2/";break;default:tt.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:(t,r)=>(e===et&&(0,G.vh)(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===et}}const it=new y.Logger(K.i),ot="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function st(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return it.throwArgumentError("unsupported network","name",t)}class at extends Q{isCommunityResource(){return this.apiKey===ot}static getApiKey(t){return null==t?ot:t}static getUrl(t,e){null==e&&(e=ot);const r={allowGzip:!0,url:"https://"+st(t.name)+e,throttleCallback:(t,r)=>(e.apiKey===ot&&(0,G.vh)(),Promise.resolve(!0))};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}var ct=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const ut=new y.Logger(K.i);class lt extends Q{static getApiKey(t){return null!=t&&ut.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}static getUrl(t,e){let r=null;if("homestead"===t.name)r="https://cloudflare-eth.com/";else ut.throwArgumentError("unsupported network","network",arguments[0]);return r}perform(t,e){const r=Object.create(null,{perform:{get:()=>super.perform}});return ct(this,void 0,void 0,(function*(){if("getBlockNumber"===t){return(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number}return r.perform.call(this,t,e)}))}}var ft=r(58341),ht=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const dt=new y.Logger(K.i);function pt(t){const e={};for(let r in t){if(null==t[r])continue;let n=t[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,d.hexValue)((0,d.hexlify)(n)):"accessList"===r?"["+(0,g.accessListify)(n).map((t=>`{address:"${t.address}",storageKeys:["${t.storageKeys.join('","')}"]}`)).join(",")+"]":(0,d.hexlify)(n),e[r]=n)}return e}function gt(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"OK"!=t.message){const e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function yt(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){const e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){const e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){const e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function mt(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}const bt="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function vt(t,e,r){if("call"===t&&e.code===y.Logger.errors.SERVER_ERROR){const t=e.error;if(t&&(t.message.match(/reverted/i)||t.message.match(/VM execution error/i))){let r=t.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),(0,d.isHexString)(r))return r;dt.throwError("missing revert data in call exception",y.Logger.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let n=e.message;throw e.code===y.Logger.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?n=e.error.message:"string"==typeof e.body?n=e.body:"string"==typeof e.responseText&&(n=e.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&dt.throwError("insufficient funds for intrinsic transaction cost",y.Logger.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&dt.throwError("nonce has already been used",y.Logger.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),n.match(/another transaction with same nonce/)&&dt.throwError("replacement fee too low",y.Logger.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&dt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class wt extends V.Zk{constructor(t,e){super(t),(0,p.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,p.defineReadOnly)(this,"apiKey",e||bt)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"optimism":return"https://api-optimistic.etherscan.io"}return dt.throwArgumentError("unsupported network","network",this.network.name)}getUrl(t,e){const r=Object.keys(e).reduce(((t,r)=>{const n=e[r];return null!=n&&(t+=`&${r}=${n}`),t}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${t}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(t,e){return e.module=t,e.apikey=this.apiKey,e}fetch(t,e,r){return ht(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(t,e),i=r?this.getPostData(t,e):null,o="proxy"===t?yt:gt;this.emit("debug",{action:"request",request:n,provider:this});const s={url:n,throttleSlotInterval:1e3,throttleCallback:(t,e)=>(this.isCommunityResource()&&(0,G.vh)(),Promise.resolve(!0))};let a=null;i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(i).map((t=>`${t}=${i[t]}`)).join("&"));const c=yield(0,ft.fetchJson)(s,a,o||yt);return this.emit("debug",{action:"response",request:n,response:(0,p.deepCopy)(c),provider:this}),c}))}detectNetwork(){return ht(this,void 0,void 0,(function*(){return this.network}))}perform(t,e){const r=Object.create(null,{perform:{get:()=>super.perform}});return ht(this,void 0,void 0,(function*(){switch(t){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch((t=>vt("sendTransaction",t,e.signedTransaction)));case"getBlock":if(e.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.transactionHash});case"call":{if("latest"!==e.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const t=pt(e.transaction);t.module="proxy",t.action="eth_call";try{return yield this.fetch("proxy",t,!0)}catch(t){return vt("call",t,e.transaction)}}case"estimateGas":{const t=pt(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return yield this.fetch("proxy",t,!0)}catch(t){return vt("estimateGas",t,e.transaction)}}case"getLogs":{const t={action:"getLogs"};if(e.filter.fromBlock&&(t.fromBlock=mt(e.filter.fromBlock)),e.filter.toBlock&&(t.toBlock=mt(e.filter.toBlock)),e.filter.address&&(t.address=e.filter.address),e.filter.topics&&e.filter.topics.length>0&&(e.filter.topics.length>1&&dt.throwError("unsupported topic count",y.Logger.errors.UNSUPPORTED_OPERATION,{topics:e.filter.topics}),1===e.filter.topics.length)){const r=e.filter.topics[0];"string"==typeof r&&66===r.length||dt.throwError("unsupported topic format",y.Logger.errors.UNSUPPORTED_OPERATION,{topic0:r}),t.topic0=r}const r=yield this.fetch("logs",t);let n={};for(let t=0;t{["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);const e=this.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e}))}))}isCommunityResource(){return this.apiKey===bt}}var Et=r(52472),At=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))};const St=new y.Logger(K.i);function kt(){return(new Date).getTime()}function xt(t){let e=null;for(let r=0;re?null:(n+i)/2}function Tt(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(h.O$.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map((t=>Tt(t))));if("object"==typeof t){const e=Object.keys(t);return e.sort(),"{"+e.map((e=>{let r=t[e];return r="function"==typeof r?"[function]":Tt(r),JSON.stringify(e)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let _t=1;function Ot(t){let e=null,r=null,n=new Promise((n=>{e=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(e,t)}));return{cancel:e,getPromise:function(){return n},wait:t=>(n=n.then(t),n)}}const It=[y.Logger.errors.CALL_EXCEPTION,y.Logger.errors.INSUFFICIENT_FUNDS,y.Logger.errors.NONCE_EXPIRED,y.Logger.errors.REPLACEMENT_UNDERPRICED,y.Logger.errors.UNPREDICTABLE_GAS_LIMIT],Bt=["address","args","errorArgs","errorSignature","method","transaction"];function Mt(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function Nt(t,e,r){let n=Tt;switch(e){case"getBlockNumber":return function(e){const r=e.map((t=>t.result));let n=Pt(e.map((t=>t.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){const e=t.map((t=>t.result));return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return Pt(t.map((t=>t.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(t){return null==t?null:((t=(0,p.shallowCopy)(t)).confirmations=-1,Tt(t))};break;case"getBlock":n=r.includeTransactions?function(t){return null==t?null:((t=(0,p.shallowCopy)(t)).transactions=t.transactions.map((t=>((t=(0,p.shallowCopy)(t)).confirmations=-1,t))),Tt(t))}:function(t){return null==t?null:Tt(t)};break;default:throw new Error("unknown method: "+e)}return function(t,e){return function(r){const n={};r.forEach((e=>{const r=t(e.result);n[r]||(n[r]={count:0,result:e.result}),n[r].count++}));const i=Object.keys(n);for(let t=0;t=e)return r.result}}}(n,t.quorum)}function Ct(t,e){return At(this,void 0,void 0,(function*(){const r=t.provider;return null!=r.blockNumber&&r.blockNumber>=e||-1===e?r:(0,ft.poll)((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function Lt(t,e,r,n){return At(this,void 0,void 0,(function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ct(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ct(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ct(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&(0,d.isHexString)(n.blockTag)&&(i=yield Ct(t,e)),i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&(0,d.isHexString)(r.fromBlock)||r.toBlock&&(0,d.isHexString)(r.toBlock))&&(i=yield Ct(t,e)),i.getLogs(r)}}return St.throwError("unknown method error",y.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Rt extends V.Zk{constructor(t,e){0===t.length&&St.throwArgumentError("missing providers","providers",t);const r=t.map(((t,e)=>{if(u.zt.isProvider(t)){const e=(0,G.Gp)(t)?2e3:750,r=1;return Object.freeze({provider:t,weight:1,stallTimeout:e,priority:r})}const r=(0,p.shallowCopy)(t);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=(0,G.Gp)(t)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&St.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${e}].weight`,n),Object.freeze(r)})),n=r.reduce(((t,e)=>t+e.weight),0);null==e?e=n/2:e>n&&St.throwArgumentError("quorum will always fail; larger than total weight","quorum",e);let i=xt(r.map((t=>t.provider.network)));null==i&&(i=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then(t,e)}),0)}))),super(i),(0,p.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,p.defineReadOnly)(this,"quorum",e),this._highestBlockNumber=-1}detectNetwork(){return At(this,void 0,void 0,(function*(){return xt(yield Promise.all(this.providerConfigs.map((t=>t.provider.getNetwork()))))}))}perform(t,e){return At(this,void 0,void 0,(function*(){if("sendTransaction"===t){const t=yield Promise.all(this.providerConfigs.map((t=>t.provider.sendTransaction(e.signedTransaction).then((t=>t.hash),(t=>t)))));for(let e=0;et.priority-e.priority));const i=this._highestBlockNumber;let o=0,s=!0;for(;;){const a=kt();let c=n.filter((t=>t.runner&&a-t.startt+e.weight),0);for(;c{r.staller=null})),r.runner=Lt(r,i,t,e).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Mt(r,kt()),request:{method:t,params:(0,p.deepCopy)(e)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Mt(r,kt()),request:{method:t,params:(0,p.deepCopy)(e)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Mt(r,null),request:{method:t,params:(0,p.deepCopy)(e)},provider:this}),c+=r.weight}const u=[];n.forEach((t=>{!t.done&&t.runner&&(u.push(t.runner),t.staller&&u.push(t.staller.getPromise()))})),u.length&&(yield Promise.race(u));const l=n.filter((t=>t.done&&null==t.error));if(l.length>=this.quorum){const t=r(l);if(void 0!==t)return n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0})),t;s||(yield Ot(100).getPromise()),s=!1}const f=n.reduce(((t,e)=>{if(!e.done||null==e.error)return t;const r=e.error.code;return It.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t}),{});if(Object.keys(f).forEach((t=>{const e=f[t];if(e.weight{t.staller&&t.staller.cancel(),t.cancelled=!0}));const r=e.error,i={};Bt.forEach((t=>{null!=r[t]&&(i[t]=r[t])})),St.throwError(r.reason||r.message,t,i)})),0===n.filter((t=>!t.done)).length)break}return n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0})),St.throwError("failed to meet quorum",y.Logger.errors.SERVER_ERROR,{method:t,params:e,results:n.map((t=>Mt(t))),provider:this})}))}}const Ut=null,Dt=new y.Logger(K.i),Ft="84842078b09946638c03157f83405213";class jt extends J{constructor(t,e){const r=new Vt(t,e),n=r.connection;n.password&&Dt.throwError("INFURA WebSocket project secrets unsupported",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),t),(0,p.defineReadOnly)(this,"apiKey",r.projectId),(0,p.defineReadOnly)(this,"projectId",r.projectId),(0,p.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===Ft}}class Vt extends Q{static getWebSocketProvider(t,e){return new jt(t,e)}static getApiKey(t){const e={apiKey:Ft,projectId:Ft,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(Dt.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),Dt.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"ropsten":r="ropsten.infura.io";break;case"rinkeby":r="rinkeby.infura.io";break;case"kovan":r="kovan.infura.io";break;case"goerli":r="goerli.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-kovan":r="optimism-kovan.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-rinkeby":r="arbitrum-rinkeby.infura.io";break;default:Dt.throwError("unsupported network",y.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:(t,r)=>(e.projectId===Ft&&(0,G.vh)(),Promise.resolve(!0))};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}isCommunityResource(){return this.projectId===Ft}}class Gt extends H.r{send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((t,e)=>{n.resolve=t,n.reject=e}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const t=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const e=t.map((t=>t.request));return this.emit("debug",{action:"requestBatch",request:(0,p.deepCopy)(e),provider:this}),(0,ft.fetchJson)(this.connection,JSON.stringify(e)).then((r=>{this.emit("debug",{action:"response",request:e,response:r,provider:this}),t.forEach(((t,e)=>{const n=r[e];if(n.error){const e=new Error(n.error.message);e.code=n.error.code,e.data=n.error.data,t.reject(e)}else t.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:e,provider:this}),t.forEach((t=>{t.reject(r)}))}))}),10)),i}}const Ht=new y.Logger(K.i);class Kt extends Q{static getApiKey(t){return t&&"string"!=typeof t&&Ht.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}static getUrl(t,e){Ht.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Ht.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}const qt=new y.Logger(K.i),Wt={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};class zt extends Q{constructor(t,e){if(null==e){const r=(0,p.getStatic)(new.target,"getNetwork")(t);if(r){const t=Wt[r.name];t&&(e={applicationId:t,loadBalancer:!0})}null==e&&qt.throwError("unsupported network",y.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}super(t,e)}static getApiKey(t){null==t&&qt.throwArgumentError("PocketProvider.getApiKey does not support null apiKey","apiKey",t);const e={applicationId:null,loadBalancer:!1,applicationSecretKey:null};return"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?(qt.assertArgument("string"==typeof t.applicationId,"applicationSecretKey requires an applicationId","applicationId",t.applicationId),qt.assertArgument("string"==typeof t.applicationSecretKey,"invalid applicationSecretKey","applicationSecretKey","[REDACTED]"),e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey,e.loadBalancer=!!t.loadBalancer):t.applicationId?(qt.assertArgument("string"==typeof t.applicationId,"apiKey.applicationId must be a string","apiKey.applicationId",t.applicationId),e.applicationId=t.applicationId,e.loadBalancer=!!t.loadBalancer):qt.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"goerli":r="eth-goerli.gateway.pokt.network";break;default:qt.throwError("unsupported network",y.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}let n=null;n=e.loadBalancer?`https://${r}/v1/lb/${e.applicationId}`:`https://${r}/v1/${e.applicationId}`;const i={url:n,headers:{}};return null!=e.applicationSecretKey&&(i.user="",i.password=e.applicationSecretKey),i}isCommunityResource(){return this.applicationId===Wt[this.network.name]}}var $t=r(241);const Jt=new y.Logger(K.i);function Zt(t,e){if(null==t&&(t="homestead"),"string"==typeof t){const e=t.match(/^(ws|http)s?:/i);if(e)switch(e[1].toLowerCase()){case"http":case"https":return new H.r(t);case"ws":case"wss":return new J(t);default:Jt.throwArgumentError("unsupported URL scheme","network",t)}}const r=(0,j.H)(t);return r&&r._defaultProvider||Jt.throwError("unsupported getDefaultProvider network",y.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:Rt,AlchemyProvider:nt,AnkrProvider:at,CloudflareProvider:lt,EtherscanProvider:wt,InfuraProvider:Vt,JsonRpcProvider:H.r,NodesmithProvider:Kt,PocketProvider:zt,Web3Provider:$t.Q,IpcProvider:Ut},e)}var Xt=r(9855),Yt=r(48659),Qt=r(72734),te=r(11388),ee=r(4089),re=r(57727),ne=r(84706),ie=r(93684),oe=r(32046),se=r(67827),ae=r(36274),ce=r(67949),ue=r(38197),le=r(77158),fe=r(33777),he=r(44478),de=r(61843),pe=r(62768),ge=r(35637),ye=r(44242),me=r(86237),be=r(46441),ve=r(21261);const we="ethers/5.6.9",Ee=new y.Logger(we);try{const t=window;null==t._ethers&&(t._ethers=s)}catch(t){}},56371:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var s=r(83893);Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return s.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return s.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return s.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}});var a=r(64594);Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var c=o(r(4089));e.base64=c;var u=r(57727);Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return u.Base58}});var l=r(93286);Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return l.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return l.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return l.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return l.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return l.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return l.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return l.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return l.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return l.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return l.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return l.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return l.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return l.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return l.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return l.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return l.stripZeros}});var f=r(75931);Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var h=r(36274);Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return h.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return h.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return h.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return h.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return h.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return h.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return h.mnemonicToSeed}});var d=r(19380);Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return d.getJsonWalletAddress}});var p=r(38197);Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return p.keccak256}});var g=r(80711);Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return g.Logger}});var y=r(91278);Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return y.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return y.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return y.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return y.sha512}});var m=r(33777);Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return m.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return m.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return m.sha256}});var b=r(22118);Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return b.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return b.shuffled}});var v=r(53587);Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return v.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return v.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return v.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return v.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return v.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return v.shallowCopy}});var w=o(r(61843));e.RLP=w;var E=r(62768);Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return E.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return E.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return E.SigningKey}});var A=r(62741);Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var S=r(13479);Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return S.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return S.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return S.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return S.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return S.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return S.TransactionTypes}});var k=r(46441);Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return k.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return k.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return k.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return k.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return k.parseUnits}});var x=r(44958);Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return x.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return x.verifyTypedData}});var P=r(58341);Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return P._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return P.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return P.poll}});var T=r(91278);Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return T.SupportedAlgorithm}});var _=r(62741);Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return _.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return _.Utf8ErrorReason}})},17648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),c=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},u=Math.max(0,o.length-a.length),l=[],f=0;f{"use strict";var n=r(17648);t.exports=Function.prototype.bind||n},25972:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},40210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(t){c=null}var u=function(){throw new s},l=c?function(){try{return u}catch(t){try{return c(arguments,"callee").get}catch(t){return u}}}():u,f=r(41405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},d={},p="undefined"==typeof Uint8Array?n:h(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?h(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return g[e]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(58612),v=r(17642),w=b.call(Function.call,Array.prototype.concat),E=b.call(Function.apply,Array.prototype.splice),A=b.call(Function.call,String.prototype.replace),S=b.call(Function.call,String.prototype.slice),k=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,P=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return A(t,k,(function(t,e,r,i){n[n.length]=r?A(i,x,"$1"):e||t})),n},T=function(t,e){var r,n=t;if(v(m,n)&&(n="%"+(r=m[n])[0]+"%"),v(g,n)){var o=g[n];if(o===d&&(o=y(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var r=P(t),n=r.length>0?r[0]:"",o=T("%"+n+"%",e),a=o.name,u=o.value,l=!1,f=o.alias;f&&(n=f[0],E(r,w([0,1],f)));for(var h=1,d=!0;h=r.length){var b=c(u,p);u=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[p]}else d=v(u,p),u=u[p];d&&!l&&(g[a]=u)}}return u}},31044:(t,e,r)=>{"use strict";var n=r(40210)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},41405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(55419);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},55419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},96410:(t,e,r)=>{"use strict";var n=r(55419);t.exports=function(){return n()&&!!Symbol.toStringTag}},17642:(t,e,r)=>{"use strict";var n=r(58612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},33715:(t,e,r)=>{var n=e;n.utils=r(26436),n.common=r(95772),n.sha=r(89041),n.ripemd=r(12949),n.hmac=r(52344),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},95772:(t,e,r)=>{"use strict";var n=r(26436),i=r(79746);function o(){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}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o{"use strict";var n=r(26436),i=r(79746);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e{"use strict";var n=r(26436),i=r(95772),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(l,u),e.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],b=r,v=n,w=i,E=u,A=l,S=0;S<80;S++){var k=s(o(c(r,f(S,n,i,u),t[p[S]+e],h(S)),y[S]),l);r=l,l=u,u=o(i,10),i=n,n=k,k=s(o(c(b,f(79-S,v,w,E),t[g[S]+e],d(S)),m[S]),A),b=A,A=E,E=o(w,10),w=v,v=k}k=a(this.h[1],i,E),this.h[1]=a(this.h[2],u,A),this.h[2]=a(this.h[3],l,b),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=k},l.prototype._digest=function(t){return"hex"===t?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],g=[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],y=[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],m=[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]},89041:(t,e,r)=>{"use strict";e.sha1=r(84761),e.sha224=r(10799),e.sha256=r(89344),e.sha384=r(80772),e.sha512=r(45900)},84761:(t,e,r)=>{"use strict";var n=r(26436),i=r(95772),o=r(37038),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,l),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n{"use strict";var n=r(26436),i=r(89344);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},89344:(t,e,r)=>{"use strict";var n=r(26436),i=r(95772),o=r(37038),s=r(79746),a=n.sum32,c=n.sum32_4,u=n.sum32_5,l=o.ch32,f=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,g=o.g1_256,y=i.BlockHash,m=[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 b(){if(!(this instanceof b))return new b;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(b,y),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n{"use strict";var n=r(26436),i=r(45900);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},45900:(t,e,r)=>{"use strict";var n=r(26436),i=r(95772),o=r(79746),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,f=n.sum64_hi,h=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,g=n.sum64_5_hi,y=n.sum64_5_lo,m=i.BlockHash,b=[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 v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function A(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function S(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function k(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function P(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function _(t,e){var r=s(t,e,1)^s(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=s(t,e,19)^s(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}function B(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,m),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n{"use strict";var n=r(26436).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},26436:(t,e,r)=>{"use strict";var n=r(79746),i=r(35717);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),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(i=0;i>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var c=0,u=e;return c+=(u=u+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,c,u){var l=0,f=e;return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,c,u){return e+n+o+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},2156:(t,e,r)=>{"use strict";var n=r(33715),i=r(34504),o=r(79746);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*c-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}},35717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},9496:(t,e,r)=>{"use strict";var n=r(40210),i=r(17642),o=r(37478)(),s=n("%TypeError%"),a={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`O` is not an object");if("string"!=typeof e)throw new s("`slot` must be a string");o.assert(t)},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`O` is not an object");if("string"!=typeof e)throw new s("`slot` must be a string");var r=o.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`O` is not an object");if("string"!=typeof e)throw new s("`slot` must be a string");var r=o.get(t);return!!r&&i(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`O` is not an object");if("string"!=typeof e)throw new s("`slot` must be a string");var n=o.get(t);n||(n={},o.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(a),t.exports=a},95320:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=i?function(t){if(t===u)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)}:function(t){if(t===u)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(c)return function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(s(t))return!1;var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},18923:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,i=Object.prototype.toString,o=r(96410)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},98420:(t,e,r)=>{"use strict";var n,i,o,s,a=r(21924),c=r(96410)();if(c){n=a("Object.prototype.hasOwnProperty"),i=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var l=a("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!(e&&n(e,"value")))return!1;try{i(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},12636:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(41405)()){var i=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&o.test(i.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},91094:(t,e,r)=>{var n,i=r(34155);!function(){"use strict";var o="input is invalid type",s="object"==typeof window,a=s?window:{};a.JS_SHA3_NO_WINDOW&&(s=!1);var c=!s&&"object"==typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?a=r.g:c&&(a=self);var u=!a.JS_SHA3_NO_COMMON_JS&&t.exports,l=r.amdO,f=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),d=[4,1024,262144,67108864],p=[0,8,16,24],g=[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],y=[224,256,384,512],m=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var w=function(t,e,r){return function(n){return new L(t,e,t).update(n)[r]()}},E=function(t,e,r){return function(n,i){return new L(t,e,i).update(n)[r]()}},A=function(t,e,r){return function(e,n,i,o){return T["cshake"+t].update(e,n,i,o)[r]()}},S=function(t,e,r){return function(e,n,i,o){return T["kmac"+t].update(e,n,i,o)[r]()}},k=function(t,e,r,n){for(var i=0;i>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 R(t,e,r){L.call(this,t,e,r)}L.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(o);if(null===t)throw new Error(o);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(o);e=!0}for(var n,i,s=this.blocks,a=this.byteCount,c=t.length,u=this.blockCount,l=0,h=this.s;l>2]|=t[l]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=s[u],n=0;n>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},L.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(o);if(null===t)throw new Error(o);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(o);e=!0}var n=0,i=t.length;if(e)n=i;else for(var s=0;s=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},L.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+h[15&t]+h[t>>12&15]+h[t>>8&15]+h[t>>20&15]+h[t>>16&15]+h[t>>28&15]+h[t>>24&15];s%e==0&&(U(r),o=0)}return i&&(t=r[o],a+=h[t>>4&15]+h[15&t],i>1&&(a+=h[t>>12&15]+h[t>>8&15]),i>2&&(a+=h[t>>20&15]+h[t>>16&15])),a},L.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(t);s>8&255,c[t+2]=e>>16&255,c[t+3]=e>>24&255;a%r==0&&U(n)}return o&&(t=a<<2,e=n[s],c[t]=255&e,o>1&&(c[t+1]=e>>8&255),o>2&&(c[t+2]=e>>16&255)),c},R.prototype=new L,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var U=function(t){var e,r,n,i,o,s,a,c,u,l,f,h,d,p,y,m,b,v,w,E,A,S,k,x,P,T,_,O,I,B,M,N,C,L,R,U,D,F,j,V,G,H,K,q,W,z,$,J,Z,X,Y,Q,tt,et,rt,nt,it,ot,st,at,ct,ut,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],c=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|f>>>31),r=a^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=c^(h<<1|d>>>31),r=u^(d<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],y=t[1],z=t[11]<<4|t[10]>>>28,$=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ct=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,L=t[2]<<1|t[3]>>>31,R=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,b=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,B=t[33]<<13|t[32]>>>19,M=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,N=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,P=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,E=t[36]<<21|t[37]>>>11,A=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,T=t[18]<<20|t[19]>>>12,_=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,V=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,S=t[48]<<14|t[49]>>>18,k=t[49]<<14|t[48]>>>18,t[0]=p^~m&v,t[1]=y^~b&w,t[10]=x^~T&O,t[11]=P^~_&I,t[20]=L^~U&F,t[21]=R^~D&j,t[30]=q^~z&J,t[31]=W^~$&Z,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=m^~v&E,t[3]=b^~w&A,t[12]=T^~O&B,t[13]=_^~I&M,t[22]=U^~F&V,t[23]=D^~j&G,t[32]=z^~J&X,t[33]=$^~Z&Y,t[42]=nt^~ot&at,t[43]=it^~st&ct,t[4]=v^~E&S,t[5]=w^~A&k,t[14]=O^~B&N,t[15]=I^~M&C,t[24]=F^~V&H,t[25]=j^~G&K,t[34]=J^~X&Q,t[35]=Z^~Y&tt,t[44]=ot^~at&ut,t[45]=st^~ct<,t[6]=E^~S&p,t[7]=A^~k&y,t[16]=B^~N&x,t[17]=M^~C&P,t[26]=V^~H&L,t[27]=G^~K&R,t[36]=X^~Q&q,t[37]=Y^~tt&W,t[46]=at^~ut&et,t[47]=ct^~lt&rt,t[8]=S^~p&m,t[9]=k^~y&b,t[18]=N^~x&T,t[19]=C^~P&_,t[28]=H^~L&U,t[29]=K^~R&D,t[38]=Q^~q&z,t[39]=tt^~W&$,t[48]=ut^~et&nt,t[49]=lt^~rt&it,t[0]^=g[n],t[1]^=g[n+1]};if(u)t.exports=T;else{for(O=0;O<_.length;++O)a[_[O]]=T[_[O]];l&&(void 0===(n=function(){return T}.call(e,r,e,t))||(t.exports=n))}}()},79746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},34504:(t,e)=>{"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},70631:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,E=String.prototype.toLowerCase,A=RegExp.prototype.test,S=Array.prototype.concat,k=Array.prototype.join,x=Array.prototype.slice,P=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,_=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,I="function"==typeof Symbol&&"object"==typeof Symbol.iterator,B="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===I||"symbol")?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function C(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||A.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-P(-t):P(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var L=r(24654).custom,R=L&&j(L)?L:null;function U(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function D(t){return v.call(String(t),/"/g,""")}function F(t){return!("[object Array]"!==H(t)||B&&"object"==typeof t&&B in t)}function j(t){if(I)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!O)return!1;try{return O.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,i){var a=r||{};if(G(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!G(a,"customInspect")||a.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=a.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,a);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return g?C(e,w):w}if("bigint"==typeof e){var A=String(e)+"n";return g?C(e,A):A}var P=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=P&&P>0&&"object"==typeof e)return F(e)?"[Array]":"[Object]";var _=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=k.call(Array(t.indent+1)," ")}return{base:r,prev:k.call(Array(e+1),r)}}(a,n);if(void 0===i)i=[];else if(K(i,e)>=0)return"[Circular]";function L(e,r,o){if(r&&(i=x.call(i)).push(r),o){var s={depth:a.depth};return G(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),t(e,s,n+1,i)}return t(e,a,n+1,i)}if("function"==typeof e){var V=function(t){if(t.name)return t.name;var e=m.call(y.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),W=X(e,L);return"[Function"+(V?": "+V:" (anonymous)")+"]"+(W.length>0?" { "+k.call(W,", ")+" }":"")}if(j(e)){var Y=I?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(e);return"object"!=typeof e||I?Y:z(Y)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var Q="<"+E.call(String(e.nodeName)),tt=e.attributes||[],et=0;et"}if(F(e)){if(0===e.length)return"[]";var rt=X(e,L);return _&&!function(t){for(var e=0;e=0)return!1;return!0}(rt)?"["+Z(rt,_)+"]":"[ "+k.call(rt,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||B&&"object"==typeof t&&B in t)}(e)){var nt=X(e,L);return"cause"in e&&!M.call(e,"cause")?"{ ["+String(e)+"] "+k.call(S.call("[cause]: "+L(e.cause),nt),", ")+" }":0===nt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+k.call(nt,", ")+" }"}if("object"==typeof e&&c){if(R&&"function"==typeof e[R])return e[R]();if("symbol"!==c&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var it=[];return s.call(e,(function(t,r){it.push(L(r,e,!0)+" => "+L(t,e))})),J("Map",o.call(e),it,_)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ot=[];return l.call(e,(function(t){ot.push(L(t,e))})),J("Set",u.call(e),ot,_)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return $("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return $("WeakSet");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return $("WeakRef");if(function(t){return!("[object Number]"!==H(t)||B&&"object"==typeof t&&B in t)}(e))return z(L(Number(e)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}(e))return z(L(T.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||B&&"object"==typeof t&&B in t)}(e))return z(p.call(e));if(function(t){return!("[object String]"!==H(t)||B&&"object"==typeof t&&B in t)}(e))return z(L(String(e)));if(!function(t){return!("[object Date]"!==H(t)||B&&"object"==typeof t&&B in t)}(e)&&!function(t){return!("[object RegExp]"!==H(t)||B&&"object"==typeof t&&B in t)}(e)){var st=X(e,L),at=N?N(e)===Object.prototype:e instanceof Object||e.constructor===Object,ct=e instanceof Object?"":"null prototype",ut=!at&&B&&Object(e)===e&&B in e?b.call(H(e),8,-1):ct?"Object":"",lt=(at||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ut||ct?"["+k.call(S.call([],ut||[],ct||[]),": ")+"] ":"");return 0===st.length?lt+"{}":_?lt+"{"+Z(st,_)+"}":lt+"{ "+k.call(st,", ")+" }"}return String(e)};var V=Object.prototype.hasOwnProperty||function(t){return t in this};function G(t,e){return V.call(t,e)}function H(t){return g.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return U(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,W),"single",e)}function W(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function z(t){return"Object("+t+")"}function $(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Z(r,n):k.call(r,", "))+"}"}function Z(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+k.call(t,","+r)+"\n"+e.prev}function X(t,e){var r=F(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(21414),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),h=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var g=0;g0)for(var y=0;y{"use strict";var n=Array.prototype.slice,i=r(21414),o=Object.keys,s=o?function(t){return o(t)}:r(18987),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},21414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},34155:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,l=-1;function f(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&h())}function h(){if(!u){var t=s(f);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l1)for(var r=1;r{"use strict";var n=r(48764).Buffer;class i{static isArrayBuffer(t){return"[object ArrayBuffer]"===Object.prototype.toString.call(t)}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t).slice().buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,e){if(t.constructor===e)return t;if(this.isArrayBuffer(t))return new e(t);if(this.isArrayBufferView(t))return new e(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,e){const r=i.toUint8Array(t),n=i.toUint8Array(e);if(r.length!==n.byteLength)return!1;for(let t=0;t{"use strict";var n=r(25972).functionsHaveConfigurableNames(),i=Object,o=TypeError;t.exports=function(){if(null!=this&&this!==i(this))throw new o("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.sticky&&(t+="y"),t},n&&Object.defineProperty&&Object.defineProperty(t.exports,"name",{value:"get flags"})},2847:(t,e,r)=>{"use strict";var n=r(4289),i=r(55559),o=r(53697),s=r(71721),a=r(32753),c=i(s());n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},71721:(t,e,r)=>{"use strict";var n=r(53697),i=r(4289).supportsDescriptors,o=Object.getOwnPropertyDescriptor;t.exports=function(){if(i&&"gim"===/a/gim.flags){var t=o(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},32753:(t,e,r)=>{"use strict";var n=r(4289).supportsDescriptors,i=r(71721),o=Object.getOwnPropertyDescriptor,s=Object.defineProperty,a=TypeError,c=Object.getPrototypeOf,u=/a/;t.exports=function(){if(!n||!c)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=i(),e=c(u),r=o(e,"flags");return r&&r.get===t||s(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},17635:function(t){"use strict";!function(e){const r=2147483647;function n(t){const e=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,i=1013904242,o=2773480762,s=1359893119,a=2600822924,c=528734635,u=1541459225;const l=new Uint32Array(64);function f(t){let f=0,h=t.length;for(;h>=64;){let d,p,g,y,m,b=r,v=n,w=i,E=o,A=s,S=a,k=c,x=u;for(p=0;p<16;p++)g=f+4*p,l[p]=(255&t[g])<<24|(255&t[g+1])<<16|(255&t[g+2])<<8|255&t[g+3];for(p=16;p<64;p++)d=l[p-2],y=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,d=l[p-15],m=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,l[p]=(y+l[p-7]|0)+(m+l[p-16]|0)|0;for(p=0;p<64;p++)y=(((A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&S^~A&k)|0)+(x+(e[p]+l[p]|0)|0)|0,m=((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+(b&v^b&w^v&w)|0,x=k,k=S,S=A,A=E+y|0,E=w,w=v,v=b,b=y+m|0;r=r+b|0,n=n+v|0,i=i+w|0,o=o+E|0,s=s+A|0,a=a+S|0,c=c+k|0,u=u+x|0,f+=64,h-=64}}f(t);let h,d=t.length%64,p=t.length/536870912|0,g=t.length<<3,y=d<56?56:120,m=t.slice(t.length-d,t.length);for(m.push(128),h=d+1;h>>24&255),m.push(p>>>16&255),m.push(p>>>8&255),m.push(p>>>0&255),m.push(g>>>24&255),m.push(g>>>16&255),m.push(g>>>8&255),m.push(g>>>0&255),f(m),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(t,e,r){t=t.length<=64?t:n(t);const i=64+e.length+4,o=new Array(i),s=new Array(64);let a,c=[];for(a=0;a<64;a++)o[a]=54;for(a=0;a=i-4;t--){if(o[t]++,o[t]<=255)return;o[t]=0}}for(;r>=32;)u(),c=c.concat(n(s.concat(n(o)))),r-=32;return r>0&&(u(),c=c.concat(n(s.concat(n(o))).slice(0,r))),c}function o(t,e,r,n,i){let o;for(u(t,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(t,16*o,i,16),a(i,n),u(i,0,t,e+16*o,16);for(o=0;o>>32-e}function a(t,e){u(t,0,e,0,16);for(let t=8;t>0;t-=2)e[4]^=s(e[0]+e[12],7),e[8]^=s(e[4]+e[0],9),e[12]^=s(e[8]+e[4],13),e[0]^=s(e[12]+e[8],18),e[9]^=s(e[5]+e[1],7),e[13]^=s(e[9]+e[5],9),e[1]^=s(e[13]+e[9],13),e[5]^=s(e[1]+e[13],18),e[14]^=s(e[10]+e[6],7),e[2]^=s(e[14]+e[10],9),e[6]^=s(e[2]+e[14],13),e[10]^=s(e[6]+e[2],18),e[3]^=s(e[15]+e[11],7),e[7]^=s(e[3]+e[15],9),e[11]^=s(e[7]+e[3],13),e[15]^=s(e[11]+e[7],18),e[1]^=s(e[0]+e[3],7),e[2]^=s(e[1]+e[0],9),e[3]^=s(e[2]+e[1],13),e[0]^=s(e[3]+e[2],18),e[6]^=s(e[5]+e[4],7),e[7]^=s(e[6]+e[5],9),e[4]^=s(e[7]+e[6],13),e[5]^=s(e[4]+e[7],18),e[11]^=s(e[10]+e[9],7),e[8]^=s(e[11]+e[10],9),e[9]^=s(e[8]+e[11],13),e[10]^=s(e[9]+e[8],18),e[12]^=s(e[15]+e[14],7),e[13]^=s(e[12]+e[15],9),e[14]^=s(e[13]+e[12],13),e[15]^=s(e[14]+e[13],18);for(let r=0;r<16;++r)t[r]+=e[r]}function c(t,e,r,n){for(let i=0;i=256)return!1}return!0}function f(t,e){if("number"!=typeof t||t%1)throw new Error("invalid "+e);return t}function h(t,e,n,s,a,h,d){if(n=f(n,"N"),s=f(s,"r"),a=f(a,"p"),h=f(h,"dkLen"),0===n||0!=(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/a)throw new Error("r too large");if(!l(t))throw new Error("password must be an array or buffer");if(t=Array.prototype.slice.call(t),!l(e))throw new Error("salt must be an array or buffer");e=Array.prototype.slice.call(e);let p=i(t,e,128*a*s);const g=new Uint32Array(32*a*s);for(let t=0;tO&&(e=O);for(let t=0;tO&&(e=O);for(let t=0;t>0&255),p.push(g[t]>>8&255),p.push(g[t]>>16&255),p.push(g[t]>>24&255);const r=i(t,p,h);return d&&d(null,1,r),r}d&&I(B)};if(!d)for(;;){const t=B();if(null!=t)return t}B()}const d={scrypt:function(t,e,r,n,i,o,s){return new Promise((function(a,c){let u=0;s&&s(0),h(t,e,r,n,i,o,(function(t,e,r){if(t)c(t);else if(r)s&&1!==u&&s(1),a(new Uint8Array(r));else if(s&&e!==u)return u=e,s(e)}))}))},syncScrypt:function(t,e,r,n,i,o){return new Uint8Array(h(t,e,r,n,i,o))}};t.exports=d}()},37478:(t,e,r)=>{"use strict";var n=r(40210),i=r(21924),o=r(70631),s=n("%TypeError%"),a=n("%WeakMap%",!0),c=n("%Map%",!0),u=i("WeakMap.prototype.get",!0),l=i("WeakMap.prototype.set",!0),f=i("WeakMap.prototype.has",!0),h=i("Map.prototype.get",!0),d=i("Map.prototype.set",!0),p=i("Map.prototype.has",!0),g=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new s("Side channel does not contain "+o(t))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return u(t,n)}else if(c){if(e)return h(e,n)}else if(r)return function(t,e){var r=g(t,e);return r&&r.value}(r,n)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){return!!g(t,e)}(r,n);return!1},set:function(n,i){a&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new a),l(t,n,i)):c?(e||(e=new c),d(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=g(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n}},19505:(t,e,r)=>{"use strict";var n=r(50581),i=r(1391),o=r(67364),s=r(10840),a=r(96846),c=r(39619),u=r(21924),l=r(41405)(),f=r(2847),h=u("String.prototype.indexOf"),d=r(46966),p=function(t){var e=d();if(l&&"symbol"==typeof Symbol.matchAll){var r=o(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(s(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(s(t)){var r="flags"in t?i(t,"flags"):f(t);if(c(r),h(a(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var o=p(t);if(void 0!==o)return n(o,t,[e])}var u=a(e),l=new RegExp(t,"g");return n(p(l),l,[u])}},94956:(t,e,r)=>{"use strict";var n=r(55559),i=r(4289),o=r(19505),s=r(83447),a=r(42376),c=n(o);i(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},46966:(t,e,r)=>{"use strict";var n=r(41405)(),i=r(27201);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:i}},83447:(t,e,r)=>{"use strict";var n=r(19505);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},27201:(t,e,r)=>{"use strict";var n=r(53937),i=r(1391),o=r(40105),s=r(39655),a=r(88305),c=r(96846),u=r(53633),l=r(2847),f=r(21924)("String.prototype.indexOf"),h=RegExp,d="flags"in RegExp.prototype,p=function(t){var e=this;if("Object"!==u(e))throw new TypeError('"this" value must be an Object');var r=c(t),p=function(t,e){var r="flags"in e?i(e,"flags"):c(l(e));return{flags:r,matcher:new t(d&&"string"==typeof r?e:t===h?e.source:e,r)}}(s(e,h),e),g=p.flags,y=p.matcher,m=a(i(e,"lastIndex"));o(y,"lastIndex",m,!0);var b=f(g,"g")>-1,v=f(g,"u")>-1;return n(y,r,b,v)},g=Object.defineProperty,y=Object.getOwnPropertyDescriptor;if(g&&y){var m=y(p,"name");m&&m.configurable&&g(p,"name",{value:"[Symbol.matchAll]"})}t.exports=p},42376:(t,e,r)=>{"use strict";var n=r(4289),i=r(41405)(),o=r(83447),s=r(46966),a=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=o();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),i){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),a&&c){var r=c(Symbol,e);r&&!r.configurable||a(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var u=s(),l={};l[e]=u;var f={};f[e]=function(){return RegExp.prototype[e]!==u},n(RegExp.prototype,l,f)}return t}},77267:(t,e,r)=>{"use strict";r.d(e,{G:()=>n});var n=function(){function t(t){this.client=t}return t.prototype.saveProof=function(e,r){var n=this.getProofs();n[this.getFullKey(e)]=r,localStorage.setItem(t.STORAGE_KEY,JSON.stringify(n))},t.prototype.getSavedProof=function(t){var e=this.getProofs(),r=this.getFullKey(t);return e[r]?e[r]:null},t.prototype.deleteProof=function(e){var r=this.getProofs(),n=this.getFullKey(e);r[n]&&delete r[n],localStorage.setItem(t.STORAGE_KEY,JSON.stringify(r))},t.prototype.getFullKey=function(t){return this.TYPE+"-"+t.toLowerCase()},t.prototype.getProofs=function(){var e=localStorage.getItem(t.STORAGE_KEY);return e&&e.length?JSON.parse(e):{}},t.STORAGE_KEY="tn-proof",t}()},82250:(t,e,r)=>{"use strict";r.d(e,{KU:()=>dt,XF:()=>ct,ct:()=>ut,kS:()=>at});var n,i=r(42595),o=function(){function t(t,e,r,n){this.params={},this.client=t,this.ui=e,this.viewContainer=r,this.params=n,this.init()}return t.prototype.init=function(){},t.prototype.update=function(t){this.params=t,this.render()},t}(),s=function(){function t(t,e){this.params={},this.viewContainer=t,this.params=e}return t.prototype.render=function(){var t,e=this,r=this.params.src;r&&"undefined"!==r?((t=document.createElement("img")).loading="lazy",t.addEventListener("load",(function(t){e.onLoad(t)})),t.addEventListener("error",(function(t){e.onError(t)})),t.src=r):(t=this.createAvatar(),this.viewContainer.classList.remove("shimmer-tn")),this.viewContainer.appendChild(t)},t.prototype.onLoad=function(t){this.viewContainer.classList.remove("shimmer-tn")},t.prototype.onError=function(t){this.viewContainer.innerHTML="",this.viewContainer.appendChild(this.createAvatar()),this.viewContainer.classList.remove("shimmer-tn")},t.prototype.createAvatar=function(){var t=document.createElement("img");return t.src=this.generateAvatar(this.params.title),t},t.prototype.generateAvatar=function(t){var e=document.createElement("canvas"),r=e.getContext("2d");if(e.width=200,e.height=200,!r)return"";r.fillStyle=this.getRandomBackgroundColor(),r.fillRect(0,0,e.width,e.height),r.font="bold 100px 'Arial', sans-serif",r.fillStyle="#fff",r.textAlign="center",r.textBaseline="middle";for(var n=t.split(" "),i="",o=0;i.length<2&&o=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.loadedCount=0,e.numberToLoad=25,e.autoLoadMore=!0,e}return c(e,t),e.prototype.init=function(){var t=this;this.viewContainer.addEventListener("click",(function(e){e.target.classList.contains("mobileToggle-tn")?t.tokenToggleSelection():e.target.classList.contains("load-more-btn-tn")&&t.loadMoreTokens()}))},e.prototype.render=function(){var t=this;if(this.loadedCount=0,this.viewContainer.innerHTML=this.getTokenListItems(),this.renderIcons(),this.autoLoadMore){var e=this.viewContainer.querySelector(".load-more-tn");e&&(this.interceptObs||(this.interceptObs=new IntersectionObserver((function(e){e[0].isIntersecting&&t.loadMoreTokens()}),{root:document.querySelector(".view-content-tn")})),this.interceptObs.observe(e))}},e.prototype.getTokenListItems=function(){for(var t="",e=Math.min(this.loadedCount+this.numberToLoad,this.params.tokens.length),r=this.loadedCount;r\n \n \n "},e.prototype.createTokenMarkup=function(t){var e=t.tokenIssuerKey,r=t.title,n=t.data,i=t.index,o=t.image,s=t.toggleState,a=i.length>15?i.substring(0,5)+"..."+i.substring(i.length-5,i.length):i;return'\n
  • \n
    \n
    \n

    ").concat(r,"

    \n

    #').concat(a,"

    \n
    \n
    \n \n \n
    \n
  • \n ")},e}(o),f=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),h=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},d=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.init=function(){var t=this;this.client.registerUiUpdateCallback(at.ISSUERS_LOADING,(function(){t.issuersLoading()})),this.client.registerUiUpdateCallback(at.ISSUERS_LOADED,(function(){t.ui.dismissLoader(),t.client.cancelTokenAutoload(),t.render()}))},e.prototype.render=function(){var t=this;if(this.viewContainer.innerHTML='\n
    \n
    \n
    \n
    \n

    '.concat(this.params.options.issuerHeading,'

    \n \n
    \n\t\t\t\t\t\t\t\t\n
    \n \n
    \n '),this.viewContainer.querySelector(".back-to-menu-tn").addEventListener("click",this.backToIssuers.bind(this)),this.viewContainer.querySelector(".dis-wallet-tn").addEventListener("click",(function(){t.client.disconnectWallet()})),this.issuerListContainer=document.querySelector(".token-issuer-list-container-tn"),this.tokensContainer=document.getElementsByClassName("token-view-tn")[0],this.issuerListContainer){this.populateIssuers();var e=this.tokensContainer.getElementsByClassName("token-list-container-tn")[0];this.tokenListView=new l(this.client,this.ui,e,{}),this.client.issuersLoaded?this.client.getTokenStore().hasUnloadedTokens()&&this.autoLoadTokens():this.issuersLoading()}else(0,a.kg)(2,"Element .token-issuer-list-container-tn not found")},e.prototype.issuersLoading=function(){this.ui.showLoader("

    Loading contract data...

    ")},e.prototype.populateIssuers=function(){var t,e,r=this,n="",i=this.client.getTokenStore().getCurrentIssuers();for(var o in i){var a=i[o],c=this.client.getTokenStore().getIssuerTokens(o),u=a.title?a.title:a.collectionID.replace(/[-,_]+/g," ");n+=this.issuerConnectMarkup(u,a.image,o,c)}this.issuerListContainer.innerHTML=n;try{for(var l=p(this.issuerListContainer.getElementsByClassName("img-container-tn")),f=l.next();!f.done;f=l.next()){var h=f.value,d={src:h.getAttribute("data-image-src"),title:h.getAttribute("data-token-title")};new s(h,d).render()}}catch(e){t={error:e}}finally{try{f&&!f.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}this.issuerListContainer.addEventListener("click",(function(t){if(t.target.classList.contains("connect-btn-tn"))r.connectTokenIssuer(t);else if(t.target.classList.contains("tokens-btn-tn")){var e=t.target.parentNode.dataset.issuer;r.navigateToTokensView(e)}}))},e.prototype.issuerConnectMarkup=function(t,e,r,n){return'\n \n ")},e.prototype.backToIssuers=function(){this.tokensContainer.style.display="none",this.viewContainer.querySelector(".issuer-slider-tn").classList.toggle("open")},e.prototype.autoLoadTokens=function(){return h(this,void 0,void 0,(function(){var t=this;return d(this,(function(e){switch(e.label){case 0:return[4,this.client.tokenAutoLoad(this.issuerLoading.bind(this),(function(e,r){if(null==r?void 0:r.length)t.issuerConnected(e,r,!1);else{var n=t.issuerListContainer.querySelector('[data-issuer*="'.concat(e,'"] .connect-btn-tn'));n&&(n.innerText="Load")}}))];case 1:return e.sent(),[2]}}))}))},e.prototype.connectTokenIssuer=function(t){return h(this,void 0,void 0,(function(){var e,r,n,i;return d(this,(function(o){switch(o.label){case 0:e=t.target.dataset,r=e.issuer,n=[],this.ui.showLoader("

    Loading tokens...

    "),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.client.connectTokenIssuer(r)];case 2:return n=o.sent(),[3,4];case 3:return i=o.sent(),(0,a.kg)(2,i),this.ui.showError(i),this.client.eventSender.emitErrorToClient(i,r),[2];case 4:return this.ui.dismissLoader(),(null==n?void 0:n.length)?(this.issuerConnected(r,n),[2]):(this.ui.showError("No tokens found!"),[2])}}))}))},e.prototype.issuerLoading=function(t){var e=this.issuerListContainer.querySelector('[data-issuer*="'.concat(t,'"] .connect-btn-tn'));e&&(e.innerHTML='
    ')},e.prototype.issuerConnected=function(t,e,r){var n=this;void 0===r&&(r=!0);var i=this.issuerListContainer.querySelector('[data-issuer*="'.concat(t,'"] .connect-btn-tn')),o=this.issuerListContainer.querySelector('[data-issuer*="'.concat(t,'"] .tokens-btn-tn'));i&&o||(0,a.kg)(2,"Could not find button handler"),i.style.display="none",i.setAttribute("tabIndex",-1),o.style.display="block",o.innerHTML="".concat(e.length," token").concat(e.length>1?"s":""," available"),o.setAttribute("aria-label","Navigate to select from ".concat(e.length," of your ").concat(t," tokens")),o.setAttribute("tabIndex",1),r&&setTimeout((function(){n.navigateToTokensView(t)}),250)},e.prototype.navigateToTokensView=function(t){this.updateTokensView(t),this.showTokenView(t)},e.prototype.updateTokensView=function(t){var e;this.tokensContainer.style.display="block",this.tokensContainer.scrollTo(0,0);var r=this.client.getTokenStore(),n=r.getCurrentIssuers()[t],i=r.getIssuerTokens(t);n.title&&(document.getElementsByClassName("headline-tn token-name")[0].innerHTML=n.title);var o=[];null==i||i.map((function(e,i){var s,a,c,u=!1;if(null===(s=r.getSelectedTokens()[t])||void 0===s||s.tokens.map((function(t){JSON.stringify(e)===JSON.stringify(t)&&(u=!0)})),!1===n.onChain){var l=n.title,f=n.image;o.push({data:e,tokenIssuerKey:t,index:null!==(a=e.tiketIdNumber)&&void 0!==a?a:i,title:l,image:f,toggleState:u})}else{var h=null!==(c=e.tokenId)&&void 0!==c?c:i.toString();o.push({data:e,tokenIssuerKey:t,index:h,title:e.title,image:e.image,toggleState:u})}})),null===(e=this.tokenListView)||void 0===e||e.update({issuer:t,tokens:o})},e.prototype.showTokenView=function(t){this.viewContainer.querySelector(".issuer-slider-tn").classList.toggle("open")},e}(o),y=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),m=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},b=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]\n '.concat('Metamask logo',"\n

    MetaMask

    \n "):"",r=this.client.solanaAvailable()?'"):"",n=this.client.safeConnectAvailable()?'"):"";this.viewContainer.innerHTML='\n
    \n
    \n
    \n
    \n
    \n

    Select Wallet

    \n
    \n
    \n \t'.concat(n,"\n ").concat(e,'\n \n \n ").concat(r,"\n
    \n
    \n
    \n
    \n "),this.viewContainer.querySelectorAll(".wallet-button-tn").forEach((function(e){e.addEventListener("click",t.connectWallet.bind(t))}))},e.prototype.connectWallet=function(t){var e,r,n,i;return m(this,void 0,void 0,(function(){var o,s;return b(this,(function(c){switch(c.label){case 0:o=t.currentTarget.dataset.wallet,(0,a.kg)(2,"Connect wallet: "+o),this.ui.showLoaderDelayed(["

    Connecting to "+o+"...

    ","You may need to unlock your wallet to continue."],500),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.client.negotiatorConnectToWallet(o)];case 2:return c.sent(),this.ui.dismissLoader(),(null===(r=null===(e=this.params)||void 0===e?void 0:e.data)||void 0===r?void 0:r.connectCallback)?null===(i=null===(n=this.params)||void 0===n?void 0:n.data)||void 0===i||i.connectCallback():this.ui.updateUI(g),[3,4];case 3:return s=c.sent(),this.ui.showError(s),[2];case 4:return[2]}}))}))},e}(o),w=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),E=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},A=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]\n
    \n
    \n
    \n \n
    '.concat(this.params.options.openingHeading,"
    \n
    \n
    \n \n "),this.viewContainer.querySelector(".opening-btn-tn").addEventListener("click",this.goToWalletSelection.bind(this))},e.prototype.goToWalletSelection=function(){return E(this,void 0,void 0,(function(){var t;return A(this,(function(e){switch(e.label){case 0:return this.client.checkInternetConnectivity(),this.ui.showLoaderDelayed(["Initializing wallet.."],500),this.client.getTokenStore().hasOnChainTokens()?[4,this.client.getWalletProvider()]:[3,3];case 1:return[4,(t=e.sent()).loadConnections()];case 2:return e.sent(),this.client.enrichTokenLookupDataOnChainTokens(),this.ui.updateUI(t.getConnectedWalletData().length?g:v),[3,4];case 3:this.ui.updateUI(g),e.label=4;case 4:return this.ui.dismissLoader(),[2]}}))}))},e}(o),k=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},x=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i\n\t\t\t\n\t\t\t
    \n\t\t\n\t',t.FAB_BUTTON_HTML='\n\t\t\n\t',t}(),T=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},_=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},j=function(){function t(t){this.currentIssuers={},this.tokens={},this.tokenLookup={},this.selectedTokens={},this.autoEnableTokens=t}return t.prototype.updateIssuers=function(t){Object.keys(this.currentIssuers).length>0&&(this.selectedTokens={}),this.prePopulateTokenLookupStore(t)},t.prototype.clearCachedTokens=function(t){for(var e in this.tokens)void 0!==t&&t!==this.tokenLookup[e].onChain||(this.tokens[e]=[]);this.selectedTokens={}},t.prototype.hasOnChainTokens=function(){for(var t in this.currentIssuers)if(this.currentIssuers[t])return!0;return!1},t.prototype.getCurrentIssuers=function(t){var e={};for(var r in this.currentIssuers)void 0!==t&&t!==this.currentIssuers[r]||(e[r]=this.tokenLookup[r]);return e},t.prototype.getCurrentTokens=function(t){var e={};for(var r in this.currentIssuers)void 0!==t&&t!==this.currentIssuers[r]||(e[r]=this.tokens[r]);return e},t.prototype.hasUnloadedIssuers=function(){var t=this.getCurrentIssuers(!0);for(var e in t)if(!t[e].title)return!0;return!1},t.prototype.hasUnloadedTokens=function(){var t,e;try{for(var r=F(Object.values(this.getCurrentTokens())),n=r.next();!n.done;n=r.next()){if(0===n.value.length)return!0}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return!1},t.prototype.getIssuerTokens=function(t){return this.tokens[t]?this.tokens[t]:null},t.prototype.setTokens=function(t,e){this.tokens[t]=e,this.autoEnableTokens&&(this.selectedTokens[t]={tokens:e})},t.prototype.getSelectedTokens=function(){return this.selectedTokens},t.prototype.setSelectedTokens=function(t){this.selectedTokens=t},t.prototype.prePopulateTokenLookupStore=function(t){var e=this,r={};t.forEach((function(t,n){t.collectionID&&(void 0===t.onChain&&(t.onChain=!0),t.collectionID=e.formatCollectionID(t.collectionID),void 0===r[t.collectionID]?("chain"in t&&(t.chain=e.formatCollectionChain(t.chain)),void 0!==e.tokens[t.collectionID]?e.autoEnableTokens&&e.tokens[t.collectionID].length&&(e.selectedTokens[t.collectionID]={tokens:e.tokens[t.collectionID]}):e.tokens[t.collectionID]=[],e.tokenLookup[t.collectionID]||e.updateTokenLookupStore(t.collectionID,t),r[t.collectionID]=t.onChain):(0,a.kg)(1,"duplicate collectionID key ".concat(t.collectionID,", use unique keys per collection.")))})),this.currentIssuers=r},t.prototype.updateTokenLookupStore=function(t,e){this.tokenLookup[t]=D(D({},this.tokenLookup[t]),e)},t.prototype.formatCollectionChain=function(t){return t.toLowerCase()},t.prototype.formatCollectionID=function(t){var e=t;return(/[A-Z]+/g.test(t)||/\s+/g.test(t))&&(e=t.replace(/\s+/g,"-").toLowerCase(),(0,a.kg)(1,"Token Negotiator: Spaces or capital letters found in collectionID definition ".concat(t,", this has been re-formatted to ").concat(e)),t=e),t},t}(),V=r(77267),G=r(951),H=r(93684),K=r(93286),q=r(13479),W=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},z=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&this.tokenStore.updateIssuers(this.config.issuers),this.messaging=new i.sT}return t.getKey=function(t){return U._F.decodePublicKey(t)},t.prototype.mergeConfig=function(t,e){var r;for(var n in e)e[n]&&e[n].constructor===Object?t[n]=this.mergeConfig(null!==(r=t[n])&&void 0!==r?r:{},e[n]):t[n]=e[n];return t},t.prototype.getTokenStore=function(){return this.tokenStore},t.prototype.getUi=function(){return this.ui},t.prototype.triggerUiUpdateCallback=function(t,e){this.uiUpdateCallbacks[t]&&this.uiUpdateCallbacks[t](e)},t.prototype.registerUiUpdateCallback=function(t,e){this.uiUpdateCallbacks[t]=e},t.prototype.safeConnectAvailable=function(){return void 0!==this.config.safeConnectOptions},t.prototype.solanaAvailable=function(){return void 0!==window.solana&&this.config.issuers.filter((function(t){var e;return"solana"===(null===(e=null==t?void 0:t.blockchain)||void 0===e?void 0:e.toLowerCase())})).length>0},t.prototype.getWalletProvider=function(){return ot(this,void 0,void 0,(function(){var t;return st(this,(function(e){switch(e.label){case 0:return this.web3WalletProvider?[3,2]:[4,r.e(827).then(r.bind(r,18827))];case 1:t=e.sent().Web3WalletProvider,this.web3WalletProvider=new t(this,this.config.safeConnectOptions),e.label=2;case 2:return[2,this.web3WalletProvider]}}))}))},t.prototype.disconnectWallet=function(){return ot(this,void 0,void 0,(function(){return st(this,(function(t){switch(t.label){case 0:return[4,this.getWalletProvider()];case 1:return t.sent().deleteConnections(),this.tokenStore.clearCachedTokens(),this.ui.updateUI(v),[2]}}))}))},t.prototype.negotiatorConnectToWallet=function(t){return ot(this,void 0,void 0,(function(){var e;return st(this,(function(r){switch(r.label){case 0:return[4,this.getWalletProvider()];case 1:return[4,r.sent().connectWith(t)];case 2:return e=r.sent(),(0,a.kg)(2,"wallet address found: "+e),[2,e]}}))}))},t.prototype.enrichTokenLookupDataOnChainTokens=function(){return ot(this,void 0,void 0,(function(){var t,e,r,n,i,o,s,c;return st(this,(function(u){switch(u.label){case 0:for(r in this.issuersLoaded=!1,this.triggerUiUpdateCallback(at.ISSUERS_LOADING),t=this.tokenStore.getCurrentIssuers(!0),e=[],t)e.push(r);n=0,u.label=1;case 1:if(!(n0)return[3,6];t(s),f.label=2;case 2:return f.trys.push([2,4,,5]),[4,this.connectTokenIssuer(s)];case 3:return u=f.sent(),e(s,u),[3,5];case 4:return(l=f.sent()).message="Failed to load "+s+": "+l.message,(0,a.kg)(2,l.message),this.eventSender.emitErrorToClient(l,s),e(s,null),[3,5];case 5:if(r++,this.cancelAutoload||!0!==this.config.autoLoadTokens&&r>this.config.autoLoadTokens)return[3,7];f.label=6;case 6:return o++,[3,1];case 7:return[2]}}))}))},t.prototype.cancelTokenAutoload=function(){this.cancelAutoload=!0},t.prototype.setPassiveNegotiationWebTokens=function(){return ot(this,void 0,void 0,(function(){var t,e,r,n,o,s,c,u;return st(this,(function(l){switch(l.label){case 0:for(r in t=this.tokenStore.getCurrentIssuers(!1),e=[],t)e.push(r);n=0,l.label=1;case 1:if(!(nAuthenticating...","You may need to sign a new challenge in your wallet"],600,!0),i=t.type?t.type:n.onChain?Y:nt,o=new i(this),u.label=1;case 1:return u.trys.push([1,3,,4]),t.options||(t.options={}),t.options.messagingForceTab=this.config.messagingForceTab,[4,o.getTokenProof(n,[t.unsignedToken],t)];case 2:return s=u.sent(),(0,a.kg)(2,"Ticket proof successfully validated."),this.eventSender.emitProofToClient(s.data,e),[3,4];case 3:if(c=u.sent(),(0,a.kg)(2,c),"WALLET_REQUIRED"===c.message)return[2,this.handleWalletRequired(t)];throw this.handleProofError(c,e),c;case 4:return this.ui&&(this.ui.dismissLoader(),this.ui.closeOverlay()),[2,s.data]}}))}))},t.prototype.handleWalletRequired=function(t){return ot(this,void 0,void 0,(function(){var e=this;return st(this,(function(r){switch(r.label){case 0:return this.ui?(this.ui.dismissLoader(),this.ui.openOverlay(),[3,4]):[3,1];case 1:return[4,this.getWalletProvider()];case 2:return[4,r.sent().connectWith("MetaMask")];case 3:return r.sent(),[2,this.authenticate(t)];case 4:return[2,new Promise((function(r,n){e.ui.updateUI(v,{connectCallback:function(){return ot(e,void 0,void 0,(function(){var e,i;return st(this,(function(o){switch(o.label){case 0:this.ui.updateUI(g),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.authenticate(t)];case 2:return e=o.sent(),r(e),[3,4];case 3:return i=o.sent(),n(i),[3,4];case 4:return[2]}}))}))}})}))]}}))}))},t.prototype.handleProofError=function(t,e){this.ui&&this.ui.showError(t),this.eventSender.emitProofToClient(null,e,t)},t.prototype.checkInternetConnectivity=function(){var t,e=this;if(!navigator.onLine)throw"active"===this.config.type&&setTimeout((function(){var t;e.ui.showError(null!==(t=e.config.noInternetErrorMessage)&&void 0!==t?t:ft)}),1e3),new Error(null!==(t=this.config.noInternetErrorMessage)&&void 0!==t?t:ft)},t.prototype.addTokenViaMagicLink=function(t){return ot(this,void 0,void 0,(function(){var e,r,n;return st(this,(function(o){switch(o.label){case 0:return e=new URL(t),r=e.hash.length>1?e.hash.substring(1):e.search.substring(1),[4,this.messaging.sendMessage({action:i.gF.MAGIC_URL,origin:e.origin+e.pathname,data:{urlParams:r}},this.config.messagingForceTab)];case 1:if((n=o.sent()).evt===i.AJ.ISSUER_TOKENS)return[2,n.data.tokens];throw new Error(n.errors.join("\n"))}}))}))},t.prototype.on=function(t,e,r){if((0,a.Sg)(t,"Event type is not defined"),e)this.clientCallBackEvents[t]=e;else if(this.clientCallBackEvents[t])return this.clientCallBackEvents[t].call(t,r)},t.prototype.switchTheme=function(t){this.ui.switchTheme(t)},t}()},42595:(t,e,r)=>{"use strict";r.d(e,{AJ:()=>i,gF:()=>n,sT:()=>u});var n,i,o=r(96960),s=r(82250),a=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},c=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{"use strict";r.d(e,{k:()=>n,s:()=>c});var n,i=r(93951),o=r(82250),s=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},a=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(l=setTimeout((function(){u||s(new Error("Failed to receive response from window/iframe")),h()}),r))},t.prototype.getModal=function(t){var e=document.getElementById("modal-tn");return e||!t||((e=document.createElement("div")).id="modal-tn",e.className="modal-tn",e.style.display="none",e.innerHTML='\n \n ',document.body.appendChild(e),e.getElementsByClassName("modal-close-tn")[0].addEventListener("click",(function(){t()}))),e},t.prototype.removeModal=function(){var t=this.getModal();t&&(t.style.display="none",t.remove())},t.prototype.constructUrl=function(t,e){var r="".concat(e.origin,"#evtid=").concat(t,"&action=").concat(e.action);for(var n in e.data){var i=e.data[n];i&&(r+=i instanceof Array||i instanceof Object?"&".concat(n,"=").concat(JSON.stringify(i)):"urlParams"===n?"&".concat(i):"&".concat(n,"=").concat(i))}return r},t.prototype.openTab=function(t){return window.open(t,"_blank")},t.prototype.createIframe=function(t){var e=document.createElement("iframe");return e.setAttribute("allow","clipboard-read"),this.getModal(t).getElementsByClassName("modal-body-tn")[0].appendChild(e),e},t.getUniqueEventId=function(){return(new Date).getTime().toString()},t}()},93951:(t,e,r)=>{"use strict";r.d(e,{BT:()=>d,C$:()=>u,Ov:()=>f,Pb:()=>h,Sg:()=>c,kg:()=>a,t:()=>l});var n=r(48764),i=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function a(t){for(var e=[],r=1;rparseInt(window.DISPLAY_DEBUG_LEVEL)||console.log.apply(console,o([],i(e),!1))}var c=function(t,e){if(!t)throw new Error(e)};function u(t){return void 0!==n.Buffer?n.Buffer.from(t):t}var l=function(t,e){var r,n,i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;try{for(var a=s(i),c=a.next();!c.done;c=a.next()){var u=c.value;if("object"==typeof e[u]){if(JSON.stringify(t[u])!==JSON.stringify(e[u]))return!1}else if(t[u]!==e[u])return!1}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!0},f=function(t){return t=t.split("-").join("+").split("_").join("/").split(".").join("="),Uint8Array.from(n.Buffer.from(t,"base64"))},h=function(t){window.addEventListener?window.addEventListener("message",t,!1):window.attachEvent("onmessage",t)},d=function(t){window.removeEventListener?window.removeEventListener("message",t):window.detachEvent("onmessage",t)}},75522:(t,e,r)=>{"use strict";r.d(e,{M:()=>n});var n=function(){var t="undefined"!=typeof window&&window.navigator.userAgent.toLowerCase(),e=t&&/msie|trident/.test(t),r=t&&t.indexOf("msie 9.0")>0,n=t&&t.indexOf("edg/")>0,i=t&&/chrome\/\d+/.test(t)&&!n,o=t&&/phantomjs/.test(t),s=t&&/firefox\/\d+/.test(t),a=!!window.safari,c=!!window.navigator.brave,u=t&&t.indexOf("android")>0,l=t&&/iphone|ipad|ipod|ios/.test(t),f=t&&/\smac\s/.test(t),h=t&&/windows/.test(t),d=!1,p=window.matchMedia;p&&(d=p("(pointer:coarse)").matches);var g=window.ethereum;void 0===window.ethereum&&(g={isMetaMask:!1,isAlphaWallet:!1,isTrust:!1,isStatusWallet:!1,isGoWallet:!1});var y=d&&!!g.isAlphaWallet,m=d&&!!g.isTrust,b=d&&!!g.isStatusWallet,v=d&&!!g.isGoWallet,w=d&&!!g.isTrust&&!!g.isMetaMask,E=!!navigator.userAgent.match(/\simToken\//),A=d&&!!g.isMetaMask&&!m&&!c;return{iE:e,iE9:r,edge:n,chrome:i,phantomJS:o,fireFox:s,safari:a,android:u,iOS:l,mac:f,windows:h,touchDevice:d,metaMask:A,alphaWallet:y,mew:w,trust:m,goWallet:v,status:b,imToken:E,brave:c,braveAndroid:c&&u,braveIOS:c&&l,metaMaskAndroid:u&&A,alphaWalletAndroid:u&&y,mewAndroid:u&&w,imTokenAndroid:u&&E}}},951:(t,e,r)=>{"use strict";r.r(e),r.d(e,{SafeConnectAction:()=>i,SafeConnectProvider:()=>x});var n,i,o=r(42595),s=r(50284),a=r(77267),c=r(55050),u=r(52410),l=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},f=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]299||i.status<200))return[3,6];o=void 0,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,i.json()];case 3:return o=s.sent().error,[3,5];case 4:return s.sent(),o="HTTP Request error: "+i.statusText,[3,5];case 5:throw new Error(o);case 6:return[4,i.json()];case 7:return[2,s.sent()]}}))}))},t.createAndSignLinkAttestation=function(t,e,r){return l(this,void 0,void 0,(function(){var n;return f(this,(function(i){switch(i.label){case 0:return(n=new u.b).create(t,e,3600),[4,n.sign(r)];case 1:return i.sent(),[2,n.getBase64()]}}))}))},t.HOLDING_KEY_ALGORITHM="RSASSA-PKCS1-v1_5",t.keyStore=new s.t,t}(),d=(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),p=function(){return p=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{window.KeyshapeJS=function(){function t(t){return void 0!==t}function e(t,e){return t&&0==t.indexOf(e)}function r(t){var e,r={};for(e in t)r[e]=t[e];return r}function n(t){if(!isFinite(t))throw Error("Non-finite value")}function i(e){if(14>=e)return 16;var r=O[e];return r||(r=t(I[e])?0|(e.toLowerCase().indexOf("color")==e.length-5?48:0):1),r}function o(t){return 0<=t?Math.pow(t,1/3):-Math.pow(-t,1/3)}function s(t,e){if(48==t&&"number"==typeof e)return"rgba("+(e>>>24)+","+(e>>>16&255)+","+(e>>>8&255)+","+(255&e)/255+")";if(64==t)return e=e.map((function(t){return t+"px"})),e.join(",");if(96==t){t="";for(var r=e.length,n=0;n>>24)+","+(e[n+4]>>16&255)+","+(e[n+4]>>8&255)+","+(255&e[n+4])/255+")) ",n+=3):t=2==e[n]?t+"("+e[n+1]+"px) ":7==e[n]?t+"("+e[n+1]+"deg) ":t+"("+(0>e[n+1]?0:e[n+1])+") ",n+=2;return t}return 32==t?e+"px":e}function a(t){return 0>=t?0:255<=t?255:t}function c(t,e){t:{for(var r=t+e[2],n=e[4].length,i=0;ir-1)if(1==(n=e[6][r-1])[0])if(0>=t)t=0;else if(1<=t)t=1;else{i=n[1];var s=n[3];t=function(t,e,r,n){if(0==t)return e=0==e?-n/r:0<=(n=(-r+(t=Math.sqrt(r*r-4*e*n)))/(2*e))&&1>=n||0<=(n=(-r-t)/(2*e))&&1>=n?n:0,e;var i=r/t-e*e/(t*t)/3,s=(r=e*e*e/(t*t*t)/13.5-e*r/(t*t)/3+n/t)*r/4+i*i*i/27;if(e=-e/(3*t),0>=s){if(0==i&&0==r)return-o(n/t);if(t=Math.sqrt(r*r/4-s),n=Math.acos(-r/2/t),r=Math.cos(n/3),n=Math.sqrt(3)*Math.sin(n/3),0<=(i=2*(t=o(t))*r+e)&&1>=i)return i;if(0<=(i=-t*(r+n)+e)&&1>=i)return i;if(0<=(i=t*(n-r)+e)&&1>=i)return i}else{if(0<=(n=(t=o(-r/2+Math.sqrt(s)))+(r=o(-r/2-Math.sqrt(s)))+e)&&1>=n)return n;if(0<=(n=-(t+r)/2+e)&&1>=n)return n}return 0}(3*i-3*s+1,-6*i+3*s,3*i,-t),t=3*t*(1-t)*(1-t)*n[2]+3*t*t*(1-t)*n[4]+t*t*t}else 2==n[0]?(n=n[1],t=Math.ceil(t*n)/n):3==n[0]&&(n=n[1],t=Math.floor(t*n)/n);return function(t,e,r,n){if(16==t||32==t)return(r-e)*n+e;if(0==t)return.5>n?e:r;if(48==t){if("number"==typeof e&&"number"==typeof r){var i=1-n;return(a(i*(e>>>24)+n*(r>>>24))<<24|a(i*(e>>>16&255)+n*(r>>>16&255))<<16|a(i*(e>>>8&255)+n*(r>>>8&255))<<8|a(i*(255&e)+n*(255&r)))>>>0}return.5>n?e:r}if(64==t){0==e.length&&(e=[0]),0==r.length&&(r=[0]);var o=e.length;e.length!=r.length&&(o=e.length*r.length);var s=[];for(t=0;tu&&(u=0),s.push(u)}return s}if(96==t){if(e.length!=r.length)return.5>n?e:r;for(o=e.length,s=[],t=0;tn?e:r;for(s[t]=e[t],s[t+1]=[],c=0;cn?e:r;for(s=[],t=0;tn?e:r;if(s[t]=e[t],s[t+1]=(r[t+1]-e[t+1])*n+e[t+1],5==e[t]){s[t+2]=(r[t+2]-e[t+2])*n+e[t+2],s[t+3]=(r[t+3]-e[t+3])*n+e[t+3],i=1-n;var l=e[t+4],f=r[t+4];u=i*(l>>>24)+n*(f>>>24);var h=i*(l>>16&255)+n*(f>>16&255);c=i*(l>>8&255)+n*(f>>8&255),i=i*(255&l)+n*(255&f),s[t+4]=(a(h)<<16|a(c)<<8|a(i))+16777216*(0|a(u)),t+=3}t+=2}return s}return 0}(240&e[1],e[5][r-1],e[5][r],t)}function u(){T||(M=(new Date).getTime()+N)}function l(t){if(t||!B){for(var e=!1,r=0;r=i;++i)n[i]=0;if(n[10]=1,n[11]=1,r=r.getAttribute("transform")){for(i=(r=r.trim().split(") ")).length-2;0<=i;--i)if(e(r[i],"translate(")){for(var o=0;o=this.f?this.i?(this.c=M-this.g/this.b,this.i--,e=2):(e=1,this.a=t?r:this.s?Math.max(this.s,this.f):this.f):0>this.b&&null!==r&&r<=this.g?this.i&&1/0!=this.f?(this.c=M-this.f/this.b,this.i--,e=2):(this.i=0,e=1,this.a=t?r:this.s?Math.min(this.s,this.g):this.g):null!==r&&0!=this.b&&(t&&null!==this.a&&(this.c=M-this.a/this.b),this.a=null)}return this.s=this.l(),e},J:function(t){if(t&&(this.o&&(this.o=!1,null===this.c&&(0!=this.b&&null!==this.a?(this.c=M-this.a/this.b,this.a=null):this.c=M)),null===this.a&&null!==this.c&&(0!=(t=this.B(!1))&&L.push([this,t]))),null===(t=this.l()))return!1;for(var e=this.A,r=this.C,n=0;n=f+u[3]?0==u[3]%d?u[5][h-1]:c(u[3]%d,u):c((t-f)%d,u),0==l?(i._ks.mpath=u[8],i._ks.transform[l]=f,o=!0):14>=l?(i._ks.transform[l]=f,o=!0):(f=s(240&u[1],f),1&u[1]?i.setAttribute(l,f):i.style[l]=f)}}if(o){for(g(o=i),a=o._ks.transform,u="",(l=o._ks.mpath)&&(0>(h=a[0])&&(h=0),100h?(h=f,f=l[1].getPointAtLength(.5)):h=l[1].getPointAtLength(h-.5),u+="rotate("+180*Math.atan2(f.y-h.y,f.x-h.x)/Math.PI+") ")),l=1;l=l?u+(1==l?f+",0":"0,"+f):13<=l?u+(13==l?f+",0":"0,"+f):10<=l?u+(10==l?f+",1":"1,"+f):u+f,u+=")");o.setAttribute("transform",u)}_&&i.setAttribute("opacity",i.getAttribute("opacity"))}return"running"==this.m()},I:function(){!1!==this.h.autoremove&&"finished"==this.m()&&E(this)},D:function(){if(!this.F){this.F=!0;for(var t=this.A,e=this.C,r=0;r=e[r][i][0]&&g(n)}},u:function(e){if("number"==typeof e)return e;if(!t(this.h.markers)||!t(this.h.markers[e]))throw Error("Invalid marker: "+e);return+this.h.markers[e]},play:function(e){if(t(e)&&null!==e&&(n(e=this.u(e)),0>this.b&&ethis.f&&(e=this.f),this.w(e,!0)),!this.j)throw A;if(e=this.l(),0=this.f))this.a=this.g;else if(0>this.b&&(null===e||e<=this.g)){if(1/0==this.f)throw Error("Cannot seek to Infinity");this.a=this.f}else 0==this.b&&null===e&&(this.a=this.g);return null===this.a||(this.c=null,this.o=!0,this.D(),h()),this},pause:function(e){if(!this.j)throw A;if(t(e)&&n(e=this.u(e)),"paused"!=this.m()){u();var r=this.l();if(null===r)if(0<=this.b)this.a=this.g;else{if(1/0==this.f)throw Error("Cannot seek to Infinity");this.a=this.f}null!==this.c&&null===this.a&&(this.a=r),this.c=null,this.o=!1,this.B(!1),this.D(),h()}return t(e)&&this.w(e,!0),this},range:function(e,r){if(0==arguments.length)return{in:this.g,out:this.f};var i=this.u(e),o=this.v;if(t(r)&&(o=this.u(r)),n(i),0>i||0>o||i>=o||isNaN(o))throw Error("Invalid range");var s=this.m();return this.g=i,this.f=o,"finished"==s&&"running"==this.m()&&this.play(),this},loop:function(e){return t(e)?(this.i=!0===e?1/0:Math.floor(e),(0>this.i||isNaN(this.i))&&(this.i=0),this):{count:this.i}},l:function(){return null!==this.a?this.a:null===this.c?null:(M-this.c)*this.b},w:function(t,e){e&&u(),null!==t&&(this.D(),null!==this.a||null===this.c||0==this.b?(this.a=t,l(!1)):this.c=M-t/this.b,this.j||(this.c=null),this.s=null,this.B(!0),h())},G:function(){return this.l()},time:function(e){if(t(e)){if(!this.j)throw A;return n(e=this.u(e)),this.w(e,!0),this}return this.G()},m:function(){var t=this.l();return this.o?"running":null===t?"idle":null===this.c?"paused":0=this.f||0>this.b&&t<=this.g?"finished":"running"},state:function(){return this.m()},duration:function(){return this.v},H:function(t){n(t),u();var e=this.l();this.b=t,null!==e&&this.w(e,!1)},rate:function(e){return t(e)?(this.H(e),this):this.b},markers:function(e){return t(e)?(this.h.markers=r(e),this):t(this.h.markers)?this.h.markers:{}},marker:function(e){return t(this.h.markers)?this.h.markers[e]:void 0},_cancel:function(){return this.j&&"idle"!=this.m()?(this.c=this.a=null,this.o=!1,this):this}},{version:"1.1.1",animate:function(){var o={};1==arguments.length%2&&(o=r(arguments[arguments.length-1])),o=new y(o);for(var s=arguments,a=0,c=0;cA.length)throw Error("Not enough times");if(A=A.slice(),!isFinite(A[0])||0>A[0])throw Error("Invalid time: "+A[0]);for(var k=1;kA[k]||A[k]T&&(T=1),a<(P*=T)+k&&(a=P+k);var _=m(p,"v","values");if(!_||_.length!=A.length)throw Error("Values do not match times");for(var I=g,B=_=_.slice(),M=240&i(I),N=0;Nj&&(j=R.length-1),F=R.substring(F+1,j).split(" "),5==D?(U.push(parseFloat(F[0])),U.push(parseFloat(F[1])),U.push(parseFloat(F[2])),U.push(v(F[3]))):1==D?U.push(F[0]):U.push(parseFloat(F[0])),F=(R=R.substring(j+1).trim()).indexOf("(")}R=U}C[L]=R}else 64==M?"none"!=B[N]?/^[0-9 .]*$/.test(B[N])?B[N]=d(B[N]," "):(console.warn("unsupported value: "+B[N]),B[N]=[0]):B[N]=[0]:32==M?(n(B[N]),B[N]=parseFloat(B[N])):0===I&&(B[N]=parseFloat(B[N]));for(I=m(p,"e","easing"),B=A.length,I||(I=[]);I.length{},27912:()=>{},9278:()=>{},46601:()=>{},89214:()=>{},85568:()=>{},24654:()=>{},84102:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Authenticator=void 0;const n=r(58204),i=r(65185),o=r(55050),s=r(80716),a=r(58015),c=r(5393),u=r(94807),l=r(92219),f=r(73506),h=r(3365),d=r(69112),p=r(49674),g=r(22110),y=r(95899),m=r(81453),b=r(19421),v=r(27309);let w;w="object"==typeof crypto&&crypto.subtle?crypto.subtle:r(9278).webcrypto.subtle;class E{static decodePublicKey(t){return i.KeyPair.publicFromBase64orPEM(t)}static async getUseTicket(t,e,r,c,u,l){let f,h,d;try{l=i.KeyPair.parseKeyArrayStrings(l)}catch(t){throw(0,o.logger)(b.DEBUGLEVEL.LOW,t),new Error("Issuer key error")}if(!r)throw new Error("Ticket is empty");if(f=n.Ticket.fromBase64(r,l),!f.checkValidity())throw(0,o.logger)(b.DEBUGLEVEL.LOW,"Could not validate ticket"),new Error("Ticket Validation failed");if(!f.verify())throw(0,o.logger)(b.DEBUGLEVEL.LOW,"Could not verify ticket"),new Error("Ticket Verification failed");if((0,o.logger)(b.DEBUGLEVEL.MEDIUM,"ticked valid (signature OK)"),!u)throw new Error("Attesator key not defined");try{d=i.KeyPair.publicFromBase64orPEM(u)}catch(t){throw new Error("Attesator key read error")}try{h=s.SignedIdentifierAttestation.fromBytes((0,o.base64ToUint8array)(c),d)}catch(t){throw new Error("IDAttestation decode error")}if(!h.checkValidity())throw new Error("IDAttestation Validation failed");if(!h.verify())throw new Error("IDAttestation Verification failed");(0,o.logger)(b.DEBUGLEVEL.HIGH,"attestation valid");try{let r=new a.AttestedObject;r.create(f,h,BigInt(e),BigInt(t));let n=r.getDerEncoding();return(0,o.logger)(b.DEBUGLEVEL.HIGH,n),(0,o.hexStringToBase64)(n)}catch(t){throw(0,o.logger)(b.DEBUGLEVEL.MEDIUM,"getUseTicket: redeem failed",t),new Error("Attestation doesnt fit Ticket: "+t.message)}}static validateUseTicket(t,e,r,s){let c=i.KeyPair.publicFromBase64orPEM(e),u=i.KeyPair.parseKeyArrayStrings(r);try{let e=a.AttestedObject.fromBytes((0,o.base64ToUint8array)(t),v.UseToken,c,n.Ticket,u);if((0,o.logger)(b.DEBUGLEVEL.LOW,"Verified attested object"),!e.checkValidity(s))throw new Error("Ticket validity check failed!")}catch(t){let e="Ticket proof validation failed! "+t.message;throw(0,o.logger)(b.DEBUGLEVEL.MEDIUM,e),new Error(e)}}static async requestAttest(t,e,r,n,i=null){let s,a=new c.AttestationCrypto;if(i)s=i.getAddress();else try{s=await d.SignatureUtility.connectMetamaskAndGetAddress()}catch(t){return(0,o.logger)(b.DEBUGLEVEL.LOW,"Cant find user Ethereum Address. Please check Metamask. "+t),void(0,o.logger)(b.DEBUGLEVEL.MEDIUM,t)}let h=await l.Nonce.makeNonce(s,r);(0,o.logger)(b.DEBUGLEVEL.HIGH,"nonce = "+(0,o.uint8tohex)(h));let p=a.computeAttestationProof(n,h),g=u.AttestationRequest.fromData(a.getType(e),p),y=new f.Eip712AttestationRequest(i);return await y.addData(r,2e4,t,g),y.getJsonEncoding()}static constructAttest(t,e,r,n,i,a=""){let u,l,d,p=new c.AttestationCrypto;try{l=new f.Eip712AttestationRequest,l.setDomain(i),a&&l.setUsageValue(a),l.fillJsonData(n),E.checkAttestRequestVerifiability(l),E.checkAttestRequestValidity(l)}catch(t){let e="Failed to fill attestation data from json. "+t+"\nRestores as an Eip712AttestationRequestWithUsage object instead";(0,o.logger)(b.DEBUGLEVEL.MEDIUM,e);try{l=new y.Eip712AttestationRequestWithUsage,l.setDomain(i),l.fillJsonData(n),E.checkAttestRequestVerifiability(l),E.checkAttestRequestValidity(l)}catch(t){let e="Failed to parse Eip712AttestationRequestWithUsage. "+t;throw(0,o.logger)(b.DEBUGLEVEL.LOW,e),(0,o.logger)(b.DEBUGLEVEL.MEDIUM,t),new Error(e)}}d=p.makeCommitmentFromHiding(l.getIdentifier(),l.getType(),l.getPok().getRiddle()),u=new h.IdentifierAttestation,u.fromCommitment(d,l.getUserPublicKey()),u.setIssuer("CN="+e),u.setSerialNumber(Math.round(Math.random()*Number.MAX_SAFE_INTEGER));let g=Date.now();return u.setNotValidBefore(g),u.setNotValidAfter(g+r),s.SignedIdentifierAttestation.fromData(u,t).getDerEncoding()}static async useAttest(t,e,r,n,i,a,u=null,f=null){const h=(0,o.base64ToUint8array)(t);let y,m=s.SignedIdentifierAttestation.fromBytes(h,r),v=(0,o.base64ToUint8array)(e),w=(0,o.uint8ToBn)(v.slice(4)),E=new c.AttestationCrypto;y=f?f.getAddress():await d.SignatureUtility.connectMetamaskAndGetAddress();let A=await l.Nonce.makeNonce(y,a),S=E.computeAttestationProof(w,A);try{let t=p.UseAttestation.fromData(m,E.getType(i),S,u),e=new g.Eip712AttestationUsage(f),r=await e.addData(a,n,t);return(0,o.logger)(b.DEBUGLEVEL.HIGH,"usageRequest ready state = "+r),(0,o.logger)(b.DEBUGLEVEL.HIGH,"usageRequest.getJsonEncoding() = "+e.getJsonEncoding()),e.getJsonEncoding()}catch(t){(0,o.logger)(b.DEBUGLEVEL.LOW,t)}}static checkAttestRequestVerifiability(t){if(!t.verify())throw(0,o.logger)(b.DEBUGLEVEL.MEDIUM,"Could not verify attestation signing request"),new Error("Verification failed")}static checkAttestRequestValidity(t){if(!t.checkValidity())throw(0,o.logger)(b.DEBUGLEVEL.HIGH,"Could not validate attestation signing request"),new Error("Validation failed")}static checkUsageVerifiability(t){if(!t.verify())throw(0,o.logger)(b.DEBUGLEVEL.LOW,"Could not verify usage request"),new Error("Verification failed")}static checkUsageValidity(t){if(!t.checkTokenValidity())throw(0,o.logger)(b.DEBUGLEVEL.LOW,"Could not validate usage request"),new Error("Validation failed")}static async verifyUsage(t,e,r,n,s){let a;try{let r=new g.Eip712AttestationUsage;r.setDomain(n),r.fillJsonData(t,e),E.checkUsageVerifiability(r),E.checkUsageValidity(r),a=r.getSessionPublicKey()}catch(e){(0,o.logger)(b.DEBUGLEVEL.MEDIUM,"Eip712AttestationUsage failed. "+e+". Lets try to verify Eip712AttestationRequestWithUsage");let r=new y.Eip712AttestationRequestWithUsage;r.setDomain(n),r.fillJsonData(t),E.checkUsageVerifiability(r),E.checkUsageValidity(r),a=r.getSessionPublicKey(),(0,o.logger)(b.DEBUGLEVEL.HIGH,"sessionPublicKey from Eip712AttestationRequestWithUsage = "+a.getAddress())}try{if(!await a.verifyStringWithSubtle(i.KeyPair.anySignatureToRawUint8(s),r))throw(0,o.logger)(b.DEBUGLEVEL.MEDIUM,"Could not verify message signature"),new Error("Signature verification failed");return"SUCCESSFULLY validated usage request!"}catch(t){let e="Cant verify session with subtle. "+t;(0,o.logger)(b.DEBUGLEVEL.LOW,e),(0,o.logger)(b.DEBUGLEVEL.MEDIUM,t)}}static async requestAttestAndUsage(t,e,r,n,i,s){try{let a,u=(0,o.uint8ToBn)((0,o.base64ToUint8array)(i));a=t?t.getAddress():await d.SignatureUtility.connectMetamaskAndGetAddress();let f=await l.Nonce.makeNonce(a,n,new Uint8Array(0),Date.now()),h=new c.AttestationCrypto,p=h.computeAttestationProof(u,f),g=m.AttestationRequestWithUsage.fromData(h.getType(r),p,s),v=new y.Eip712AttestationRequestWithUsage(t);return await v.fromData(n,void 0,void 0,e,g),(0,o.logger)(b.DEBUGLEVEL.HIGH,"request.getJsonEncoding() = "+v.getJsonEncoding()),v.getJsonEncoding()}catch(t){let e="requestAttestAndUsage error. "+t;(0,o.logger)(b.DEBUGLEVEL.LOW,e),(0,o.logger)(b.DEBUGLEVEL.MEDIUM,t)}}static validateTicket(t,e,r){let s,a={};try{a[e]=i.KeyPair.publicFromBase64orPEM(r)}catch(t){return{valid:!1,massage:"Broken Public Key"}}try{s=n.Ticket.fromBase64(t,a)}catch(t){return(0,o.logger)(b.DEBUGLEVEL.LOW,t),{valid:!1,massage:"Wrong Ticket"}}return{valid:!0,ticketId:s.getTicketId(),ticketClass:s.getTicketClass()}}}e.Authenticator=E},58204:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Ticket=void 0;const n=r(5393),i=r(13649),o=r(4625),s=r(55050),a=r(79896),c=r(96858);class u extends o.AttestableObject{constructor(){super(),this.magicLinkURLPrefix="https://ticket.devcon.org/",this.isLegasy=!1}fromData(t,e,r,n){this.ticketId=e,this.ticketClass=r,this.devconId=t,this.keys=n,this.key=n[t]}createWithCommitment(t,e,r,n,i,o){if(this.fromData(t,e,r,o),this.commitment=n,this.signature=i,this.encoded=this.encodeSignedTicket(this.makeTicket()),!this.verify())throw new Error("Ticket Signature is invalid")}static createWithMail(t,e,r,i,o,a){let c=new this;c.fromData(e,r,i,o);let u,l=new n.AttestationCrypto;try{c.commitment=l.makeCommitment(t,l.getType("mail"),a);let e=c.makeTicket();u=c.key.signRawBytesWithEthereum((0,s.hexStringToArray)(e))}catch(t){throw new Error(t)}return c.createWithCommitment(e,r,i,c.commitment,u,o),c}makeTicket(){let t;try{const e=BigInt(this.ticketId);t=i.Asn1Der.encode("INTEGER",e)}catch(e){t=i.Asn1Der.encode("UTF8STRING",this.ticketId)}let e=i.Asn1Der.encode("UTF8STRING",this.devconId)+t+i.Asn1Der.encode("INTEGER",this.ticketClass);return this.isLegasy||(e+=i.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.commitment))),i.Asn1Der.encode("SEQUENCE_30",e)}encodeSignedTicket(t){return this.isLegasy&&(t+=i.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.commitment))),t+=i.Asn1Der.encode("BIT_STRING",this.signature),i.Asn1Der.encode("SEQUENCE_30",t)}getDerEncodingWithPK(){let t=this.makeTicket()+i.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.commitment))+this.key.getAsnDerPublic()+i.Asn1Der.encode("BIT_STRING",this.signature);return i.Asn1Der.encode("SEQUENCE_30",t)}getDerEncoding(){return this.encoded}verify(){return this.key.verifyBytesWithEthereum((0,s.hexStringToArray)(this.makeTicket()),this.signature)}checkValidity(){return!0}getTicketId(){return this.ticketId}getTicketClass(){return this.ticketClass}getSignature(){return this.signature}static fromBase64(t,e){let r=new this;return r.fromBytes((0,s.base64ToUint8array)(t),e),r}fromBytes(t,e){const r=c.AsnParser.parse(t,a.SignedDevconTicket);let n=r.ticket.devconId;if(!e||!e[n])throw new Error("Issuer key not defined.");this.key=e[n];let i,o=r.ticket.ticketIdNumber,u=o?o.toString():r.ticket.ticketIdString,l=r.ticket.ticketClass;r.ticket.commitment?i=r.ticket.commitment:(i=r.commitment,this.isLegasy=!0);let f=r.signatureValue;this.createWithCommitment(n,u,l,new Uint8Array(i),(0,s.uint8tohex)(new Uint8Array(f)),e)}getCommitment(){return this.commitment}getKey(){return this.key}getUrlEncoding(){}}e.Ticket=u},54759:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.MyAttestationDecoded=e.MyAttestation=e.SignedInfo=e.SmartContract=e.Payload=e.PrivateKeyInfo=e.PrivateKeyData=e.SubjectPublicKeyInfo=e.PublicKeyInfoValue=void 0;const i=r(96858),o=r(93312),s=r(83458);class a{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],a.prototype,"algorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],a.prototype,"publicKey",void 0),e.PublicKeyInfoValue=a;let c=class{constructor(){this.null=!1}};n([(0,i.AsnProp)({type:a})],c.prototype,"value",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],c.prototype,"null",void 0),c=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],c),e.SubjectPublicKeyInfo=c;class u{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],u.prototype,"one",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],u.prototype,"privateKey",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any,context:0})],u.prototype,"algDescr",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString,context:1})],u.prototype,"publicKey",void 0),e.PrivateKeyData=u;class l{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],l.prototype,"one",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],l.prototype,"algIdent",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],l.prototype,"keysData",void 0),e.PrivateKeyInfo=l;let f=class{};n([(0,i.AsnProp)({type:o.Extensions,context:3})],f.prototype,"extensions",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any,context:4})],f.prototype,"dataObject",void 0),f=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],f),e.Payload=f;class h{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],h.prototype,"value",void 0),e.SmartContract=h;class d{}n([(0,i.AsnProp)({type:o.Version})],d.prototype,"version",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],d.prototype,"serialNumber",void 0),n([(0,i.AsnProp)({type:o.AlgorithmIdentifierASN})],d.prototype,"signature",void 0),n([(0,i.AsnProp)({type:s.Name})],d.prototype,"issuer",void 0),n([(0,i.AsnProp)({type:o.ValidityValue,optional:!0})],d.prototype,"validity",void 0),n([(0,i.AsnProp)({type:s.Name})],d.prototype,"subject",void 0),n([(0,i.AsnProp)({type:c})],d.prototype,"subjectPublicKeyInfo",void 0),n([(0,i.AsnProp)({type:h,optional:!0})],d.prototype,"contract",void 0),n([(0,i.AsnProp)({type:f,optional:!0})],d.prototype,"attestsTo",void 0),e.SignedInfo=d;class p{constructor(){this.signedInfo=new Uint8Array}}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],p.prototype,"signedInfo",void 0),n([(0,i.AsnProp)({type:o.AlgorithmIdentifierASN})],p.prototype,"signatureAlgorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],p.prototype,"signatureValue",void 0),e.MyAttestation=p;class g{}n([(0,i.AsnProp)({type:d})],g.prototype,"signedInfo",void 0),n([(0,i.AsnProp)({type:o.AlgorithmIdentifierASN})],g.prototype,"signatureAlgorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],g.prototype,"signatureValue",void 0),e.MyAttestationDecoded=g},61709:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Identifier=void 0;const i=r(96858),o=r(61538);class s{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],s.prototype,"type",void 0),n([(0,i.AsnProp)({type:o.Proof})],s.prototype,"proof",void 0),e.Identifier=s},84962:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Identifier=void 0;const i=r(96858),o=r(61538),s=r(54759);class a{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],a.prototype,"type",void 0),n([(0,i.AsnProp)({type:o.Proof})],a.prototype,"proof",void 0),n([(0,i.AsnProp)({type:s.PublicKeyInfoValue})],a.prototype,"sessionKey",void 0),e.Identifier=a},93312:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Extensions=e.Extension=e.ValidityValue=e.Version=e.AlgorithmIdentifierASN=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.ObjectIdentifier})],o.prototype,"algorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any,optional:!0})],o.prototype,"parameters",void 0),e.AlgorithmIdentifierASN=o;class s{constructor(){this.version=0}}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],s.prototype,"version",void 0),e.Version=s;let a=class{};n([(0,i.AsnProp)({type:i.AsnPropTypes.UTCTime})],a.prototype,"utcTime",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.GeneralizedTime})],a.prototype,"generalizedTime",void 0),a=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],a);class c{}n([(0,i.AsnProp)({type:a})],c.prototype,"notBefore",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,optional:!0})],c.prototype,"notBeforeInt",void 0),n([(0,i.AsnProp)({type:a})],c.prototype,"notAfter",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,optional:!0})],c.prototype,"notAfterInt",void 0),e.ValidityValue=c;let u=class{};n([(0,i.AsnProp)({type:c,context:0})],u.prototype,"value",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,context:1})],u.prototype,"null",void 0),u=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],u);class l{}n([(0,i.AsnProp)({type:i.AsnPropTypes.ObjectIdentifier})],l.prototype,"extnId",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Boolean})],l.prototype,"critical",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],l.prototype,"extnValue",void 0),e.Extension=l;class f{}n([(0,i.AsnProp)({type:l})],f.prototype,"extension",void 0),e.Extensions=f},35403:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.EpochTimeValidity=void 0;const i=r(96858),o=r(12858),s={fromASN:t=>{if(t.valueBlock.valueHex.byteLength>4)return t.valueBlock.toString();return new DataView(t.valueBlock.valueHex,0).getUint32(0)},toASN:t=>new o.Integer({value:t})};class a{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,converter:s})],a.prototype,"notBefore",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,converter:s})],a.prototype,"notAfter",void 0),e.EpochTimeValidity=a},95978:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.EthereumAddressAttestation=void 0;const i=r(96858),o=r(35403);class s{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],s.prototype,"subjectPublicKey",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"ethereumAddress",void 0),n([(0,i.AsnProp)({type:o.EpochTimeValidity})],s.prototype,"validity",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],s.prototype,"context",void 0),e.EthereumAddressAttestation=s},42909:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.SignedEthereumKeyLinkingAttestation=e.EthereumKeyLinkingAttestation=void 0;const i=r(96858),o=r(35403),s=r(93312),a=r(52551);class c{}n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],c.prototype,"subjectEthereumAddress",void 0),n([(0,i.AsnProp)({type:a.SignedLinkedAttestation})],c.prototype,"linkedAttestation",void 0),n([(0,i.AsnProp)({type:o.EpochTimeValidity})],c.prototype,"validity",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],c.prototype,"context",void 0),e.EthereumKeyLinkingAttestation=c;class u{}n([(0,i.AsnProp)({type:c})],u.prototype,"ethereumKeyLinkingAttestation",void 0),n([(0,i.AsnProp)({type:s.AlgorithmIdentifierASN})],u.prototype,"signingAlgorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],u.prototype,"signatureValue",void 0),e.SignedEthereumKeyLinkingAttestation=u},83458:function(t,e,r){"use strict";var n,i,o=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Name=e.AttributeTypeAndValue=void 0;const s=r(96858);class a{}o([(0,s.AsnProp)({type:s.AsnPropTypes.ObjectIdentifier})],a.prototype,"type",void 0),o([(0,s.AsnProp)({type:s.AsnPropTypes.Utf8String})],a.prototype,"value",void 0),e.AttributeTypeAndValue=a;let c=n=class extends s.AsnArray{constructor(t){super(t),Object.setPrototypeOf(this,n.prototype)}};c=n=o([(0,s.AsnType)({type:s.AsnTypeTypes.Set,itemType:a})],c);let u=i=class extends s.AsnArray{constructor(t){super(t),Object.setPrototypeOf(this,i.prototype)}};u=i=o([(0,s.AsnType)({type:s.AsnTypeTypes.Sequence,itemType:c})],u);let l=class{};o([(0,s.AsnProp)({type:u})],l.prototype,"rdnSequence",void 0),o([(0,s.AsnProp)({type:s.AsnPropTypes.Null})],l.prototype,"null",void 0),l=o([(0,s.AsnType)({type:s.AsnTypeTypes.Choice})],l),e.Name=l},83874:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.NFTOwnershipAttestation=e.ERC721=void 0;const i=r(96858),o=r(35403);class s{}n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"address",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],s.prototype,"chainId",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0,repeated:"sequence"})],s.prototype,"tokenIds",void 0),e.ERC721=s;class a{constructor(){this.tokens=[]}}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],a.prototype,"subjectPublicKey",void 0),n([(0,i.AsnProp)({type:s,repeated:"sequence"})],a.prototype,"tokens",void 0),n([(0,i.AsnProp)({type:o.EpochTimeValidity})],a.prototype,"validity",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],a.prototype,"context",void 0),e.NFTOwnershipAttestation=a},61538:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.UsageProof=e.Proof=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],o.prototype,"riddle",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],o.prototype,"challengePoint",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],o.prototype,"responseValue",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],o.prototype,"nonce",void 0),e.Proof=o;class s{}n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"challengePoint",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"responseValue",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString})],s.prototype,"nonce",void 0),e.UsageProof=s},8573:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.Signature=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],o.prototype,"r",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],o.prototype,"s",void 0),e.Signature=o},79896:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.SignedDevconTicket=e.DevconTicket=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Utf8String})],o.prototype,"devconId",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer,optional:!0})],o.prototype,"ticketIdNumber",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Utf8String,optional:!0})],o.prototype,"ticketIdString",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],o.prototype,"ticketClass",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],o.prototype,"commitment",void 0),e.DevconTicket=o;class s{}n([(0,i.AsnProp)({type:o})],s.prototype,"ticket",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.OctetString,optional:!0})],s.prototype,"commitment",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],s.prototype,"signatureValue",void 0),e.SignedDevconTicket=s},52551:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.SignedLinkedAttestation=e.LinkedAttestation=void 0;const i=r(96858),o=r(93312),s=r(83874),a=r(95978);let c=class{};n([(0,i.AsnProp)({type:s.NFTOwnershipAttestation,context:0})],c.prototype,"nftOwnership",void 0),n([(0,i.AsnProp)({type:a.EthereumAddressAttestation,context:1})],c.prototype,"ethereumAddress",void 0),c=n([(0,i.AsnType)({type:i.AsnTypeTypes.Choice})],c),e.LinkedAttestation=c;class u{}n([(0,i.AsnProp)({type:c})],u.prototype,"attestation",void 0),n([(0,i.AsnProp)({type:o.AlgorithmIdentifierASN})],u.prototype,"signingAlgorithm",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.BitString})],u.prototype,"signatureValue",void 0),e.SignedLinkedAttestation=u},91462:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.UseAttestation=void 0;const i=r(96858),o=r(61538),s=r(54759);class a{}n([(0,i.AsnProp)({type:s.MyAttestation})],a.prototype,"attestation",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Integer})],a.prototype,"type",void 0),n([(0,i.AsnProp)({type:o.Proof})],a.prototype,"proof",void 0),n([(0,i.AsnProp)({type:s.PublicKeyInfoValue})],a.prototype,"sessionKey",void 0),e.UseAttestation=a},27309:function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(e,"__esModule",{value:!0}),e.UseToken=void 0;const i=r(96858);class o{}n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],o.prototype,"signedToken",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],o.prototype,"attestation",void 0),n([(0,i.AsnProp)({type:i.AsnPropTypes.Any})],o.prototype,"proof",void 0),e.UseToken=o},19421:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEBUGLEVEL=void 0,e.DEBUGLEVEL={LOW:1,MEDIUM:2,HIGH:3,VERBOSE:4}},72353:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XMLconfigData=void 0;const n=r(79896),i=r(65185);e.XMLconfigData={attestationOrigin:"http://stage.attestation.id",tokensOrigin:"https://devcontickets.herokuapp.com/outlet/",tokenUrlName:"ticket",tokenSecretName:"secret",unsignedTokenDataName:"ticket",tokenParser:n.SignedDevconTicket,localStorageItemName:"dcTokens",base64senderPublicKeys:{6:i.KeyPair.publicFromBase64orPEM("-----BEGIN PUBLIC KEY-----\nMIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA////////////////\n/////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5m\nfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0\nSKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFB\nAgEBA0IABJUMfAvtI8PKxcwxu7mq2btVMjh4gmcKwrHN8HmasOvHZMJn9wTo/doH\nlquDl6TSEBAk0kxO//aVs6QX8u0OSM0=\n-----END PUBLIC KEY-----"),26:i.KeyPair.publicFromBase64orPEM("-----BEGIN PUBLIC KEY-----\nMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEQKYTwFMIzSq1QVxoRKoOZXLQ9mUhce8M\ndIzvJx3unbpR3m3TiuWKZKTP4/XCPnS56d1tAhjM43hHjHbZ0k3RKQ==\n-----END PUBLIC KEY-----")},base64attestorPubKey:"MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////////////////////////////////////v///C8wRAQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHBEEEeb5mfvncu6xVoGKVzocLBwKb/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIhAP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABL+y43T1OJFScEep69/yTqpqnV/jzONz9Sp4TEHyAJ7IPN9+GHweCX1hT4OFxt152sBN3jJc1s0Ymzd8pNGZNoQ=",webDomain:"devcon.org"}},68810:(t,e,r)=>{"use strict";e._F=void 0;var n=r(84102);Object.defineProperty(e,"_F",{enumerable:!0,get:function(){return n.Authenticator}});var i=r(73506);var o=r(5393)},4625:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestableObject=void 0;e.AttestableObject=class{constructor(){}getDerEncoding(){return this.encoded}getCommitment(){return this.commitment}}},86085:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Attestation=void 0;const n=r(55050),i=r(96858),o=r(54759),s=r(65185),a=r(13649),c=r(54288),u=r(19421);class l{constructor(){this.version=18,this.blockchainFriendly=!0}parseNames(t){let e={};Object.keys(a.X500NamesLabels).forEach((t=>{e[a.X500NamesLabels[t].toLowerCase()]=t}));let r=[];return t.forEach((t=>{let n=e[t.type.toString().toLowerCase()];if(!n)throw new Error(`X500 with name ${t.type.toString()} not implemented yet.`);r.push(`${n}="${t.value}"`)})),r.join(",")}fromBytes(t){const e=this;let r=i.AsnParser.parse(t,o.SignedInfo);e.signedInfo=t,e.version=r.version.version,e.serialNumber=r.serialNumber,e.signingAlgorithm=r.signature.algorithm.toString(),r.validity&&(e.notValidBefore=r.validity.notBefore.generalizedTime.getTime(),e.notValidAfter=r.validity.notAfter.generalizedTime.getTime(),void 0===r.validity.notBeforeInt||void 0===r.validity.notAfterInt?this.blockchainFriendly=!1:this.blockchainFriendly=!0);let n=r.subject.rdnSequence;e.subject="",n&&n[0]&&n[0].length&&(e.subject=this.parseNames(n[0])),e.subjectKey=s.KeyPair.publicFromSubjectPublicKeyInfo(r.subjectPublicKeyInfo);let a=r.issuer.rdnSequence;if(e.issuer="",a.length&&(e.issuer=this.parseNames(a[0])),r.contract&&(e.smartcontracts=r.contract),r.attestsTo&&r.attestsTo.extensions)e.extensions=r.attestsTo.extensions,e.commitment=new Uint8Array(e.extensions.extension.extnValue);else if(r.attestsTo&&r.attestsTo.dataObject)throw new Error("Implement parse dataObject")}isValidX509(){return 0!=this.version&&1!=this.version&&2!=this.version?((0,n.logger)(u.DEBUGLEVEL.LOW,"Incorrect version number"),!1):this.issuer?null==this.notValidBefore||null==this.notValidAfter?((0,n.logger)(u.DEBUGLEVEL.LOW,"Validity period not set"),!1):null==this.subject?((0,n.logger)(u.DEBUGLEVEL.LOW,"Subject info not set"),!1):this.subjectKey?null!=this.smartcontracts?((0,n.logger)(u.DEBUGLEVEL.LOW,"Smart contract info set"),!1):null!=this.dataObject?((0,n.logger)(u.DEBUGLEVEL.LOW,"Data object set"),!1):null!=this.version&&null!=this.serialNumber&&null!=this.signingAlgorithm||((0,n.logger)(u.DEBUGLEVEL.LOW,"Version, serial number, subject or algorithm missing"),!1):((0,n.logger)(u.DEBUGLEVEL.LOW,"No subject public key info set"),!1):((0,n.logger)(u.DEBUGLEVEL.LOW,"Issuer info not set"),!1)}getDerEncoding(){if(this.signedInfo||(this.signedInfo=this.getPrehash()),!this.signedInfo)throw new Error("Empty Attestaion Der Encoding");return(0,n.uint8tohex)(new Uint8Array(this.signedInfo))}getCommitment(){return this.commitment}getNotValidBefore(){return this.notValidBefore}setNotValidBefore(t){this.notValidBefore=t}getNotValidAfter(){return this.notValidAfter}setNotValidAfter(t){this.notValidAfter=t}getSubjectPublicKeyInfo(){return this.subjectKey}checkValidity(){if(null==this.version)return(0,n.logger)(u.DEBUGLEVEL.LOW,"Attest version missed"),!1;if(null==this.serialNumber)return(0,n.logger)(u.DEBUGLEVEL.LOW,"Attest serial number missed"),!1;if(null==this.subject)return(0,n.logger)(u.DEBUGLEVEL.LOW,"Attest subject missed"),!1;if(null==this.signingAlgorithm)return(0,n.logger)(u.DEBUGLEVEL.LOW,"Attest signing algorithm missed"),!1;let t=this.getNotValidBefore(),e=this.getNotValidAfter(),r=new c.Timestamp(t);return r.setValidity(e-t),!!r.validateAgainstExpiration(e)&&(null==this.extensions||null==this.dataObject||((0,n.logger)(u.DEBUGLEVEL.LOW,"Both Extensions and dataObject not allowed"),!1))}getExtensions(){return this.extensions}setVersion(t){this.version=t}getVersion(){return this.version}setSubject(t){this.subject=t}getSubject(){return this.subject}setSigningAlgorithm(t){this.signingAlgorithm=t}getPrehash(){if(!this.checkValidity())return null;let t=a.Asn1Der.encode("TAG",a.Asn1Der.encode("INTEGER",this.version),0)+a.Asn1Der.encode("INTEGER",this.serialNumber)+a.Asn1Der.encodeObjectId(this.signingAlgorithm);if(t+=this.issuer?a.Asn1Der.encodeName(this.issuer):a.Asn1Der.encode("NULL_VALUE",""),null!=this.notValidAfter&&null!=this.notValidBefore){let e=a.Asn1Der.encode("GENERALIZED_TIME",this.notValidBefore)+(this.blockchainFriendly?a.Asn1Der.encode("INTEGER",Math.floor(this.notValidBefore/1e3)):"")+a.Asn1Der.encode("GENERALIZED_TIME",this.notValidAfter)+(this.blockchainFriendly?a.Asn1Der.encode("INTEGER",Math.floor(this.notValidAfter/1e3)):"");t+=a.Asn1Der.encode("SEQUENCE_30",e)}else t+=a.Asn1Der.encode("NULL_VALUE","");return t+=this.subject?a.Asn1Der.encodeName(this.subject):a.Asn1Der.encode("NULL_VALUE",""),t+=this.subjectKey?this.subjectKey.getAsnDerPublic():a.Asn1Der.encode("NULL_VALUE",""),null!=this.smartcontracts&&(t+=this.smartcontracts),null!=this.extensions&&(t+=a.Asn1Der.encode("TAG",a.Asn1Der.encode("SEQUENCE_30",a.Asn1Der.encode("SEQUENCE_30",this.extensions)),3)),null!=this.dataObject&&(t+=a.Asn1Der.encode("TAG",a.Asn1Der.encode("SEQUENCE_30",a.Asn1Der.encode("SEQUENCE_30",this.dataObject)),4)),(0,n.hexStringToUint8)(a.Asn1Der.encode("SEQUENCE_30",t))}getSigningAlgorithm(){return this.signingAlgorithm}}e.Attestation=l,l.OID_OCTETSTRING="1.3.6.1.4.1.1466.115.121.1.40"},5393:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestationCrypto=e.Pedestren_H=e.Pedestren_G=void 0;const n=r(61602),i=r(93431),o=r(55050),s=r(98478),a=r(19421),c=r(86332);let u=r(91094);e.Pedestren_G=new i.Point(21282764439311451829394129092047993080259557426320933158672611067687630484067n,3813889942691430704369624600187664845713336792511424430006907067499686345744n,i.CURVE_BN256),e.Pedestren_H=new i.Point(10844896013696871595893151490650636250667003995871483372134187278207473369077n,9393217696329481319187854592386054938412168121447413803797200472841959383227n,i.CURVE_BN256);class l{constructor(){if(this.curveOrderBitLength=254n,this.rand=this.makeSecret(),!this.verifyCurveOrder(i.CURVE_BN256.n))throw new Error("Static values do not work with current implementation")}verifyCurveOrder(t){let e=BigInt(t.toString(2).length);return!(t<1n<>e>0n)||((0,o.logger)(a.DEBUGLEVEL.LOW,"Curve order is not 253 bits which is required by the current implementation"),!1)}getType(t){switch(t.toLowerCase()){case"mail":return n.ATTESTATION_TYPE.mail;case"phone":return n.ATTESTATION_TYPE.phone;case"inetpersona":return n.ATTESTATION_TYPE.InetPersona;default:throw new Error("Wrong type of identifier")}}makeCommitment(t,r,n){let i=this.mapToCurveMultiplier(r,t);return e.Pedestren_G.multiplyDA(i).add(e.Pedestren_H.multiplyDA(n)).getEncoded(!1)}makeCommitmentFromHiding(t,r,n){let i=this.mapToCurveMultiplier(r,t);return e.Pedestren_G.multiplyDA(i).add(n).getEncoded(!1)}injectIdentifierType(t,e){return(0,o.uint8merge)([Uint8Array.from([0,0,0,t]),e])}mapToInteger(t){return BigInt("0x"+u.keccak256(t))>>256n-this.curveOrderBitLength}mapToCurveMultiplier(t,e){let r=Uint8Array.from((0,o.stringToArray)(e.trim().toLowerCase())),n=this.injectIdentifierType(t,r),s=(0,o.uint8ToBn)(n);do{s=this.mapToInteger((0,o.bnToUint8)(s))}while(s>=i.CURVE_BN256.n);return s}computePoint_bn256(t){let e=i.CURVE_BN256.P;t=(0,o.mod)(t,e);let r,n,s,a=0n,c=0n,u=e+1n>>2n,l=e-1n>>1n;do{do{t=(0,o.mod)(t+1n),c=(0,o.mod)((0,o.BnPowMod)(t,3n,e)+i.CURVE_BN256.A*t+i.CURVE_BN256.B),s=(0,o.BnPowMod)(c,l,e)}while(1n!==s);a=(0,o.BnPowMod)(c,u,e),r=new i.Point(t,a,i.CURVE_BN256),r.x>e>>1n&&(r=new i.Point(t,e-a,i.CURVE_BN256)),n=r.multiplyDA(i.CURVE_BN256.n-1n),n.y>e>>1n&&(n=new i.Point(n.x,e-n.y,i.CURVE_BN256))}while(!r.equals(n)||r.isInfinity());return r}makeSecret(t=48){return(0,o.mod)(BigInt(l.generateRandomHexString(t)),i.CURVE_BN256.n)}static generateRandomHexString(t){var e=new Uint8Array(t);window&&window.crypto?window.crypto.getRandomValues(e):e=new Uint8Array(c.randomBytes(t));let r="0x";for(var n=0;n=i.CURVE_BN256.n);return f=(0,o.mod)(u+l*r,i.CURVE_BN256.n),s.FullProofOfExponent.fromData(t,c,f,a)}computeChallenge(t,e,r){let n=e.concat(t),i=this.makeArray(n),s=(0,o.uint8merge)([i,r]);return this.mapToInteger(s)}verifyFullProof(t){let r=this.computeChallenge(t.getPoint(),[e.Pedestren_H,t.getRiddle()],t.getNonce());return this.verifyPok(t,r)}verifyEqualityProof(t,r,n){let o=i.Point.decodeFromUint8(t,i.CURVE_BN256),a=i.Point.decodeFromUint8(r,i.CURVE_BN256),c=o.subtract(a),u=this.computeChallenge(n.getPoint(),[e.Pedestren_H,o,a],n.getNonce());return this.verifyPok(s.FullProofOfExponent.fromData(c,n.getPoint(),n.getChallengeResponse(),n.getNonce()),u)}verifyPok(t,r){if(r>=i.CURVE_BN256.n)return!1;let n=e.Pedestren_H.multiplyDA(t.getChallengeResponse()),o=t.getRiddle().multiplyDA(r).add(t.getPoint());return n.equals(o)}makeArray(t){let e=new Uint8Array(0);return t.forEach((t=>{e=new Uint8Array([...e,...t.getEncoded(!1)])})),e}static hashWithKeccak(t){return u.keccak256(t)}}e.AttestationCrypto=l,l.OID_SIGNATURE_ALG="1.2.840.10045.2.1",l.BYTES_IN_DIGEST=32},94807:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestationRequest=void 0;const n=r(93431),i=r(13649),o=r(55050),s=r(5393),a=r(98478),c=r(96858),u=r(61709),l=r(19421);e.AttestationRequest=class{constructor(){}static fromData(t,e){let r=new this;if(r.type=t,r.pok=e,!r.verify())throw new Error("The proof is not valid");return r}getDerEncoding(){let t=i.Asn1Der.encode("INTEGER",this.type)+this.pok.getDerEncoding();return i.Asn1Der.encode("SEQUENCE_30",t)}static fromBytes(t){let e,r=new this;try{e=c.AsnParser.parse(t,u.Identifier),r.type=e.type}catch(t){throw new Error("Cant parse AttestationRequest Identifier")}try{let t=new Uint8Array(e.proof.riddle),i=new Uint8Array(e.proof.challengePoint),s=new Uint8Array(e.proof.responseValue),c=new Uint8Array(e.proof.nonce),u=n.Point.decodeFromHex((0,o.uint8tohex)(t),n.CURVE_BN256),l=(0,o.uint8ToBn)(i),f=n.Point.decodeFromHex((0,o.uint8tohex)(s),n.CURVE_BN256);r.pok=a.FullProofOfExponent.fromData(u,f,l,c)}catch(t){throw new Error("Cant create FullProofOfExponent")}if(!r.verify())throw new Error("Could not verify the proof");return(0,o.logger)(l.DEBUGLEVEL.HIGH,"proof OK"),r}verify(){return!!(new s.AttestationCrypto).verifyFullProof(this.pok)&&((0,o.logger)(l.DEBUGLEVEL.HIGH,"VerifyAttestationRequestProof OK"),!0)}getPok(){return this.pok}getType(){return this.type}getAsn(){const t=this.getPok().getAsnType(),e=new u.Identifier;return e.type=this.getType(),e.proof=t,e}getAsnEncoded(){return c.AsnSerializer.serialize(this.getAsn())}}},81453:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestationRequestWithUsage=void 0;const n=r(65185),i=r(98478),o=r(84962),s=r(96858),a=r(55050),c=r(93431),u=r(5393),l=r(13649),f=r(19421);e.AttestationRequestWithUsage=class{constructor(){}static fromData(t,e,r){let n=new this;if(n.type=t,n.pok=e,n.sessionPublicKey=r,!n.verify())throw new Error("Could not verify the proof");return n}static fromBytes(t){let e,r=new this;try{e=s.AsnParser.parse(t,o.Identifier),r.type=e.type,r.sessionPublicKey=n.KeyPair.publicFromSubjectPublicKeyValue(e.sessionKey)}catch(t){throw new Error("Cant parse AttestationRequest Identifier")}try{let t=new Uint8Array(e.proof.riddle),n=new Uint8Array(e.proof.challengePoint),o=new Uint8Array(e.proof.responseValue),s=new Uint8Array(e.proof.nonce),u=c.Point.decodeFromHex((0,a.uint8tohex)(t),c.CURVE_BN256),l=(0,a.uint8ToBn)(n),f=c.Point.decodeFromHex((0,a.uint8tohex)(o),c.CURVE_BN256);r.pok=i.FullProofOfExponent.fromData(u,f,l,s)}catch(t){throw new Error("Cant create FullProofOfExponent")}if(!r.verify())throw new Error("Could not verify the proof");return(0,a.logger)(f.DEBUGLEVEL.HIGH,"proof OK"),r}verify(){return!!(new u.AttestationCrypto).verifyFullProof(this.pok)}getDerEncoding(){let t=l.Asn1Der.encode("INTEGER",this.type)+this.pok.getDerEncoding()+this.sessionPublicKey.getAsnDerPublic();return l.Asn1Der.encode("SEQUENCE_30",t)}getPok(){return this.pok}getType(){return this.type}getSessionPublicKey(){return this.sessionPublicKey}}},58015:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttestedObject=void 0;const n=r(5393),i=r(80716),o=r(55050),s=r(13649),a=r(96858),c=r(8441),u=r(3365),l=r(19421);class f{constructor(){}create(t,e,r,i){this.attestableObject=t,this.att=e,this.attestationSecret=r,this.objectSecret=i,this.crypto=new n.AttestationCrypto,this.pok=this.makeProof(r,i,this.crypto),this.derEncodedProof=this.pok.getDerEncoding(),this.fillPresignData()}setWebDomain(t){this.webDomain=t}fillPresignData(){this.preSignEncoded=this.attestableObject.getDerEncoding()+this.att.getDerEncoding()+this.pok.getDerEncoding(),this.encoding=s.Asn1Der.encode("SEQUENCE_30",this.preSignEncoded)}fromDecodedData(t,e,r){this.attestableObject=t,this.att=e,this.pok=r,this.fillPresignData(),this.userKeyPair=this.att.getUnsignedAttestation().getSubjectPublicKeyInfo(),this.constructorCheck()}verify(){return this.attestableObject.verify()?this.att.verify()?!!this.crypto.verifyEqualityProof(this.att.getUnsignedAttestation().getCommitment(),this.attestableObject.getCommitment(),this.pok)||((0,o.logger)(l.DEBUGLEVEL.LOW,"Could not verify the consistency between the commitment in the attestation and the attested object"),!1):((0,o.logger)(l.DEBUGLEVEL.LOW,"Could not verify attestation"),!1):((0,o.logger)(l.DEBUGLEVEL.LOW,"Could not verify attestable object"),!1)}static fromBytes(t,e,r,o,s){let u=a.AsnParser.parse(t,e),l=new this;l.attestableObject=new o,l.attestableObject.fromBytes(u.signedToken,s),l.att=i.SignedIdentifierAttestation.fromBytes(new Uint8Array(u.attestation),r);let f=new c.UsageProofOfExponent;return f.fromBytes(new Uint8Array(u.proof)),l.pok=f,l.userKeyPair=l.att.getUnsignedAttestation().getSubjectPublicKeyInfo(),l.crypto=new n.AttestationCrypto,l.constructorCheck(),l}makeProof(t,e,r){let n=this.att.getUnsignedAttestation().getCommitment(),i=this.attestableObject.getCommitment(),s=r.computeEqualityProof((0,o.uint8tohex)(n),(0,o.uint8tohex)(i),t,e);if(!r.verifyEqualityProof(n,i,s))throw new Error("The redeem proof did not verify");return s}getAttestableObject(){return this.attestableObject}getAtt(){return this.att}getDerEncodeProof(){return this.derEncodedProof}getDerEncoding(){return this.encoding}constructorCheck(){if(!this.verify())throw new Error("The redeem request is not valid")}checkValidity(t=null){try{let t=this.att.getUnsignedAttestation().getDerEncoding();if(!u.IdentifierAttestation.fromBytes(new Uint8Array((0,o.hexStringToArray)(t))).checkValidity())return(0,o.logger)(l.DEBUGLEVEL.LOW,"The attestation is not a valid standard attestation"),!1}catch(t){return(0,o.logger)(l.DEBUGLEVEL.LOW,"The attestation is invalid"),!1}try{if(!this.getAttestableObject().checkValidity())return(0,o.logger)(l.DEBUGLEVEL.LOW,"Cheque is not valid"),!1}catch(t){return(0,o.logger)(l.DEBUGLEVEL.LOW,"Cheque validation failed"),!1}try{let e=this.getAtt().getUnsignedAttestation().getAddress();if((0,o.logger)(l.DEBUGLEVEL.HIGH,"attestationEthereumAddress: "+e),(0,o.logger)(l.DEBUGLEVEL.HIGH,"providedEthereumAddress: "+t),e.toLowerCase()!==t.toLowerCase())return(0,o.logger)(l.DEBUGLEVEL.LOW,"The attestation is not to the same Ethereum user who is sending this request"),!1}catch(t){return(0,o.logger)(l.DEBUGLEVEL.LOW,"Address validation failed"),(0,o.logger)(l.DEBUGLEVEL.MEDIUM,t),!1}return!0}}e.AttestedObject=f,f.Eip712UserData={payload:"",description:"",timestamp:0},f.Eip712UserDataTypes=[{name:"payload",type:"string"},{name:"description",type:"string"},{name:"timestamp",type:"uint256"}],f.Eip712UserDataPrimaryName="Authentication",f.Eip712UserDataDescription="Single-use authentication"},13649:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Asn1Der=e.X500NamesLabels=void 0;const n=r(55050),i=r(19421),o=(r(94956),{END_OF_CONTENT:0,BOOLEAN:1,INTEGER:2,BIT_STRING:3,OCTET_STRING:4,NULL_VALUE:5,OBJECT_ID:6,OBJECT_DESCRIPTOR:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED_PDV:11,UTF8STRING:12,RELATIVE_OID:13,SEQUENCE_10:16,SET_OF:17,NUMERABLE_STRING:18,PRINTABLE_STRING:19,T61STRING:20,VIDEO_TEX_STRING:21,IA5STRING:22,UTC_TIME:23,GENERALIZED_TIME:24,GRAPHIC_STRING:25,VISIBLE_STRING:26,GENERAL_STRING:27,UNIVERSAL_STRING:28,CHARACTER_STRING:29,BMP_STRING:30,SEQUENCE_30:48,SET:49}),s={0:"END_OF_CONTENT",1:"BOOLEAN",2:"INTEGER",3:"BIT_STRING",4:"OCTET_STRING",5:"NULL_VALUE",6:"OBJECT_ID",7:"OBJECT_DESCRIPTOR",8:"EXTERNAL",9:"REAL",10:"ENUMERATED",11:"EMBEDDED_PDV",12:"UTF8STRING",13:"RELATIVE_OID",16:"SEQUENCE_10",19:"PRINTABLE_STRING",22:"IA5STRING",24:"GENERALIZED_TIME",26:"VISIBLE_STRING",48:"SEQUENCE_30",49:"SET"};e.X500NamesLabels={CN:"2.5.4.3",C:"2.5.4.6",O:"2.5.4.10",OU:"2.5.4.11",L:"2.5.4.7",labeledURI:"1.3.6.1.4.1.250.1.57"};class a{static encodeAsInteger(t){return this.encode("INTEGER",t)}static encodeObjectId(t){return a.encode("SEQUENCE_30",a.encode("OBJECT_ID",t))}static parseX500Names(t){let r=t.matchAll(/(\w+)=("[^"]+"|[\w\.]+)/g),n="";if(!r)throw new Error("wrong Name format");let i=[];for(const t of r){let r=t[1],o=t[2];if('"'==o.substr(0,1)&&'"'==o.substr(-1)&&(o=o.slice(1,o.length-1)),n=e.X500NamesLabels[r],!n)throw new Error('Type "'+r+'" not implemented yet');i.push({type:r,value:o})}return i}static encodeName(t){let r="";return a.parseX500Names(t).forEach((t=>{let n=e.X500NamesLabels[t.type];if(!n)throw new Error(`X500 Name Object ID not implemented.(${t.value})`);let i=a.encode("OBJECT_ID",n)+a.encode("UTF8STRING",t.value);r+=a.encode("SEQUENCE_30",i)})),a.encode("SEQUENCE_30",a.encode("SET",r))}static encode(t,e,r=0){if(void 0===e)throw new Error("Missing value for Der encoding");let i=o[t],s="";switch(t){case"OBJECT_ID":if("string"!=typeof e)throw new Error("OBJECT_ID value must be a string");let o=e.split("."),a=o.shift(),c=o.shift();o.unshift((40*parseInt(a)+parseInt(c)).toString()),o.forEach((t=>{let e=parseInt(t),r="",n=!0;do{let t=127&e;e>>=7,t+=n?0:128,r=t.toString(16).padStart(2,"0")+r,n=!1}while(e);s+=r}));break;case"NULL_VALUE":s="";break;case"GENERALIZED_TIME":s=(0,n.stringToHex)((0,n.formatGeneralizedDateTime)(e));break;case"VISIBLE_STRING":case"UTF8STRING":s=(0,n.stringToHex)(e);break;case"INTEGER":s=BigInt(e).toString(16),s=(s.length%2?"0":"")+s,parseInt("0x"+s.slice(0,1),16)>7&&(s="00"+s);break;case"TAG":if(r>15)throw new Error("DER TAG more than 15 is not implemented");i=parseInt("0xA"+r);case"SEQUENCE_30":case"SET":case"OCTET_STRING":if("string"==typeof e)s=e;else{if(e.constructor!==Uint8Array)throw new Error("Wrong data type for OCTET_STRING");s=(0,n.uint8tohex)(e)}break;case"BIT_STRING":s="00"+e;break;case"BOOLEAN":s=parseInt(e).toString().padStart(2,"0");break;default:throw new Error("Sorry, "+t+" not implemented.")}let a="",c=Math.ceil(s.length/2),u=c.toString(16);return c||(u="00"),u=(u.length%2?"0":"")+u,a=c<128?u:(128+Math.round(u.length/2)).toString(16)+u,s=(s.length%2?"0":"")+s,i.toString(16).padStart(2,"0")+a+s}decode(t){let e=Array.from(t);return this.read(e)}lenEncoded(t){let e=t.shift();if(e<128)return e;if(e>128){let r=0;for(let n=0;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712AttestationRequest=void 0;const n=r(94807),i=r(65185),o=r(69112),s=r(55050),a=r(92219),c=r(9567),u=r(54288),l=r(19421);class f extends c.Eip712Token{constructor(t=null,e=u.Timestamp.DEFAULT_TIME_LIMIT_MS){super(),this.Eip712UserDataTypes=[{name:"payload",type:"string"},{name:"description",type:"string"},{name:"timestamp",type:"string"},{name:"identifier",type:"string"}],this.Eip712UserDataPrimaryName="AttestationRequest",this.Eip712UserDataDescription="Linking Ethereum address to phone or email",this.userKey=t,this.acceptableTimeLimit=e,this.usageValue=this.Eip712UserDataDescription}setUsageValue(t){this.usageValue=t}async addData(t,e=u.Timestamp.DEFAULT_TIME_LIMIT_MS,r,n){this.setDomain(t),this.attestationRequest=n,this.acceptableTimeLimit=e,this.jsonEncoding=await this.makeToken(r);try{this.fillJsonData(this.jsonEncoding)}catch(t){return(0,s.logger)(l.DEBUGLEVEL.LOW,t),!1}}fillJsonData(t){if(!t)throw new Error("Empty json");this.jsonEncoding=t;let e=JSON.parse(t),r=e.signatureInHex,a=JSON.parse(e.jsonSigned);this.eip712DomainData=a.domain,this.data=a.message;try{let t=o.SignatureUtility.recoverPublicKeyFromTypedMessageSignature(a,r);this.requestorKeys=i.KeyPair.fromPublicHex(t.substr(2)),(0,s.logger)(l.DEBUGLEVEL.HIGH,"restored address: "+this.requestorKeys.getAddress())}catch(t){let e="Recover Address failed with error:"+t;throw(0,s.logger)(l.DEBUGLEVEL.LOW,e,t),new Error(e)}this.attestationRequest||(this.attestationRequest=n.AttestationRequest.fromBytes((0,s.base64ToUint8array)(this.data.payload))),this.constructorCheck()}constructorCheck(){if(!this.verify())throw new Error("Could not verify Eip712 AttestationRequest");(0,s.logger)(l.DEBUGLEVEL.HIGH,"Eip712 Attestaion Request verify OK")}async makeToken(t){let e;e=this.userKey?this.userKey.getAddress():await o.SignatureUtility.connectMetamaskAndGetAddress();let r=a.Nonce.getTimestamp(this.attestationRequest.getPok().getNonce()),n=new u.Timestamp(r).getTimeAsString(),i={payload:(0,s.hexStringToBase64Url)(this.attestationRequest.getDerEncoding()),description:this.usageValue,timestamp:n,identifier:t};return await o.SignatureUtility.signEIP712WithBrowserWallet(this.domain,i,this.Eip712UserDataTypes,this.Eip712UserDataPrimaryName,this.userKey)}setAcceptableTimeLimit(t){this.acceptableTimeLimit=t}getJsonEncoding(){return this.jsonEncoding}verify(){return!!this.attestationRequest.verify()&&this.verifyDomainData()}verifyDomainData(){return this.eip712DomainData.name.toLowerCase()===this.getDomain().toLowerCase()&&this.eip712DomainData.version===o.SignatureUtility.Eip712Data.PROTOCOL_VERSION}checkValidity(){if(this.data.description!==this.usageValue)return(0,s.logger)(l.DEBUGLEVEL.MEDIUM,"Description is not correct. :"+this.data.description+" !== "+this.usageValue),!1;let t=new u.Timestamp(this.data.timestamp);return t.setValidity(this.acceptableTimeLimit),t.validateTimestamp()?!!(new a.Nonce).validateNonce(this.getPok().getNonce(),this.requestorKeys.getAddress(),this.domain,u.Timestamp.stringTimestampToLong(this.data.timestamp)-this.acceptableTimeLimit,u.Timestamp.stringTimestampToLong(this.data.timestamp)+this.acceptableTimeLimit)||((0,s.logger)(l.DEBUGLEVEL.LOW,"nonce is not correct"),!1):((0,s.logger)(l.DEBUGLEVEL.LOW,`timestamp is not correct. timestamp = ${this.data.timestamp}, acceptableTimeLimit = ${this.acceptableTimeLimit}`),!1)}getIdentifier(){return this.data.identifier}getType(){return this.attestationRequest.getType()}getPok(){return this.attestationRequest.getPok()}getUserPublicKey(){return this.requestorKeys}}e.Eip712AttestationRequest=f},95899:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712AttestationRequestWithUsage=void 0;const n=r(81453),i=r(65185),o=r(55050),s=r(69112),a=r(92219),c=r(9567),u=r(54288),l=r(19421);class f extends c.Eip712Token{constructor(t=null,e=u.Timestamp.DEFAULT_TIME_LIMIT_MS,r=u.Timestamp.DEFAULT_TOKEN_TIME_LIMIT){super(),this.Eip712UserDataTypes=[{name:"payload",type:"string"},{name:"description",type:"string"},{name:"identifier",type:"string"},{name:"timestamp",type:"string"},{name:"expirationTime",type:"string"}],this.Eip712UserDataPrimaryName="AttestationRequestWUsage",this.Eip712UserDataDescription='Prove that the "identifier" is the identifier hidden in attestation contained in"payload" and use this to authorize usage of local, temporary keys.',this.userKey=t,this.acceptableTimeLimit=e,this.maxTokenValidityInMs=r}async fromData(t,e=u.Timestamp.DEFAULT_TIME_LIMIT_MS,r=u.Timestamp.DEFAULT_TOKEN_TIME_LIMIT,n,i,s=null){this.setDomain(t),s&&(this.userKey=s);try{this.acceptableTimeLimit=e,this.maxTokenValidityInMs=r,this.attestationRequestWithUsage=i,this.jsonEncoding=await this.makeToken(n,i)}catch(t){throw(0,o.logger)(l.DEBUGLEVEL.LOW,t),new Error("Could not encode object")}try{this.fillJsonData(this.jsonEncoding)}catch(t){throw new Error("Could not decode object")}}Eip712AttestationRequestWithUsage(t,e,r,n){try{this.acceptableTimeLimit=e,this.maxTokenValidityInMs=r,this.jsonEncoding=n,this.fillJsonData(this.jsonEncoding)}catch(t){throw(0,o.logger)(l.DEBUGLEVEL.LOW,t),new Error("Could not decode object")}}fillJsonData(t){if(!t)throw new Error("Empty json");this.jsonEncoding=t;let e=JSON.parse(t),r=e.signatureInHex,a=JSON.parse(e.jsonSigned);this.eip712DomainData=a.domain,this.data=a.message;try{let t=s.SignatureUtility.recoverPublicKeyFromTypedMessageSignature(a,r);this.userPublicKey=i.KeyPair.fromPublicHex(t.substr(2)),(0,o.logger)(l.DEBUGLEVEL.HIGH,"Eip712 withUsage restored address: "+this.userPublicKey.getAddress())}catch(t){let e="Recover Address failed with error:"+t;throw(0,o.logger)(l.DEBUGLEVEL.LOW,e,t),new Error(e)}this.attestationRequestWithUsage||(this.attestationRequestWithUsage=n.AttestationRequestWithUsage.fromBytes((0,o.base64ToUint8array)(this.data.payload))),this.constructorCheck()}constructorCheck(){if(!this.verify())throw new Error("Could not verify Eip712 use attestation")}async makeToken(t,e){this.userKey||await s.SignatureUtility.connectMetamaskAndGetAddress();let r=(new u.Timestamp).getTimeAsString(),n=new u.Timestamp(Date.now()+this.maxTokenValidityInMs).getTimeAsString(),i={payload:(0,o.hexStringToBase64Url)(e.getDerEncoding()),description:this.Eip712UserDataDescription,timestamp:r,identifier:t,expirationTime:n};return await s.SignatureUtility.signEIP712WithBrowserWallet(this.domain,i,this.Eip712UserDataTypes,this.Eip712UserDataPrimaryName,this.userKey)}getIdentifier(){return this.data.identifier}getUserPublicKey(){return this.userPublicKey}getPok(){return this.attestationRequestWithUsage.getPok()}getType(){return this.attestationRequestWithUsage.getType()}getSessionPublicKey(){return this.attestationRequestWithUsage.getSessionPublicKey()}getJsonEncoding(){return this.jsonEncoding}checkValidity(){return!!this.testNonceAndDescription(this.acceptableTimeLimit)}checkTokenValidity(){let t=new u.Timestamp(this.data.timestamp);return t.setValidity(this.maxTokenValidityInMs),t.validateAgainstExpiration(u.Timestamp.stringTimestampToLong(this.data.expirationTime))?!!this.testNonceAndDescription(this.maxTokenValidityInMs):((0,o.logger)(l.DEBUGLEVEL.LOW,"time.validateAgainstExpiration filed"),!1)}testNonceAndDescription(t){if(!t)throw new Error("timeLimit required");let e=u.Timestamp.stringTimestampToLong(this.data.timestamp)-t,r=u.Timestamp.stringTimestampToLong(this.data.timestamp)+t;return!!(new a.Nonce).validateNonce(this.attestationRequestWithUsage.getPok().getNonce(),this.userPublicKey.getAddress(),this.domain,e,r)&&this.data.description===this.Eip712UserDataDescription}verify(){return!!this.attestationRequestWithUsage.verify()}}e.Eip712AttestationRequestWithUsage=f},22110:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712AttestationUsage=void 0;const n=r(65185),i=r(69112),o=r(9567),s=r(49674),a=r(55050),c=r(5393),u=r(93431),l=r(92219),f=r(54288),h=r(19421);class d extends o.Eip712Token{constructor(t=null,e=f.Timestamp.DEFAULT_TOKEN_TIME_LIMIT){super(),this.PLACEHOLDER_CHAIN_ID=0,this.Eip712PrimaryName="AttestationUsage",this.Eip712Description='Prove that the "identifier" is the identifier hidden in attestation contained in"payload".',this.Eip712UserTypes=[{name:"description",type:"string"},{name:"identifier",type:"string"},{name:"payload",type:"string"},{name:"timestamp",type:"string"},{name:"expirationTime",type:"string"}],this.maxTokenValidityInMs=e,this.userKey=t}async addData(t,e,r){this.setDomain(t),this.useAttestation=r;try{this.jsonEncoding=await this.makeToken(e,r)}catch(t){throw(0,a.logger)(h.DEBUGLEVEL.LOW,t),new Error("Could not encode object. "+t)}try{this.fillJsonData(this.jsonEncoding)}catch(t){return(0,a.logger)(h.DEBUGLEVEL.LOW,t),!1}this.constructorCheck()}fillJsonData(t,e=null){if(!t)throw new Error("Empty json");null!==e&&(this.attestorKey=e),this.jsonEncoding=t;let r=JSON.parse(t),o=r.signatureInHex,c=JSON.parse(r.jsonSigned);this.eip712DomainData=c.domain,this.data=c.message;try{let t=i.SignatureUtility.recoverPublicKeyFromTypedMessageSignature(c,o);this.requestorKeys=n.KeyPair.fromPublicHex(t.substr(2)),(0,a.logger)(h.DEBUGLEVEL.HIGH,"restored address: "+this.requestorKeys.getAddress())}catch(t){let e="Recover Address failed with error:"+t;throw(0,a.logger)(h.DEBUGLEVEL.LOW,e,t),new Error(e)}if(!this.useAttestation)try{(0,a.logger)(h.DEBUGLEVEL.VERBOSE,(0,a.uint8tohex)((0,a.base64ToUint8array)(this.data.payload))),this.useAttestation=s.UseAttestation.fromBytes((0,a.base64ToUint8array)(this.data.payload),this.attestorKey)}catch(t){let e="Failed to read UseAttestation. "+t;throw(0,a.logger)(h.DEBUGLEVEL.MEDIUM,e,t),new Error(e)}this.constructorCheck()}constructorCheck(){if(!this.verify())throw new Error("Could not verify Eip712 use attestation")}async makeToken(t,e){this.userKey||await i.SignatureUtility.connectMetamaskAndGetAddress();let r={payload:(0,a.hexStringToBase64Url)(e.getDerEncoding()),description:this.Eip712Description,timestamp:(new f.Timestamp).getTimeAsString(),identifier:t,expirationTime:new f.Timestamp(Date.now()+this.maxTokenValidityInMs).getTimeAsString()};return await i.SignatureUtility.signEIP712WithBrowserWallet(this.domain,r,this.Eip712UserTypes,this.Eip712PrimaryName,this.userKey)}proofLinking(){let t=(new c.AttestationCrypto).mapToCurveMultiplier(this.getType(),this.getIdentifier());return!!u.Point.decodeFromUint8(this.getAttestation().getUnsignedAttestation().getCommitment(),u.CURVE_BN256).subtract(c.Pedestren_G.multiplyDA(t)).equals(this.getPok().getRiddle())||((0,a.logger)(h.DEBUGLEVEL.LOW,"candidateRiddle.equals(this.getPok().getRiddle()) error"),!1)}getPok(){return this.useAttestation.getPok()}getType(){return this.useAttestation.type}getIdentifier(){return this.data.identifier}getAttestation(){return this.useAttestation.getAttestation()}getJsonEncoding(){return this.jsonEncoding}checkTokenValidity(){let t=f.Timestamp.stringTimestampToLong(this.data.expirationTime)-this.maxTokenValidityInMs-2*f.Timestamp.ALLOWED_ROUNDING,e=f.Timestamp.stringTimestampToLong(this.data.expirationTime);if(!this.useAttestation.checkValidity())return(0,a.logger)(h.DEBUGLEVEL.LOW,"useAttestation.checkValidity failed"),!1;if(this.data.description!=this.Eip712Description)return(0,a.logger)(h.DEBUGLEVEL.LOW,`wrong description: "${this.data.description}", must be "${this.Eip712Description}"`),!1;let r=new f.Timestamp(this.data.timestamp);return r.setValidity(this.maxTokenValidityInMs),r.validateAgainstExpiration(f.Timestamp.stringTimestampToLong(this.data.expirationTime))?this.requestorKeys.getAddress().toLowerCase()!==this.useAttestation.getAttestation().getUnsignedAttestation().getAddress().toLowerCase()?((0,a.logger)(h.DEBUGLEVEL.LOW,"wrong address"),!1):(new l.Nonce).validateNonce(this.useAttestation.getPok().getNonce(),this.useAttestation.getAttestation().getUnsignedAttestation().getAddress(),this.domain,t,e)?!!this.proofLinking()||((0,a.logger)(h.DEBUGLEVEL.LOW,"wrong proofLinking"),!1):((0,a.logger)(h.DEBUGLEVEL.LOW,"wrong Nonce"),!1):((0,a.logger)(h.DEBUGLEVEL.LOW,"verify timestamp failed.\n"+this.data.timestamp+"\n"+this.maxTokenValidityInMs+"\n"+this.data.expirationTime+"\n"+f.Timestamp.stringTimestampToLong(this.data.expirationTime)+"\n"),!1)}verify(){return!!this.useAttestation.verify()}getSessionPublicKey(){return this.useAttestation.getSessionPublicKey()}}e.Eip712AttestationUsage=d},9567:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712Token=void 0;const n=r(75888);class i extends n.Eip712Validator{}e.Eip712Token=i},75888:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Eip712Validator=void 0;const n=r(58015),i=r(27309),o=r(72353),s=r(65185),a=r(58204),c=r(69112),u=r(55050),l=r(19421);class f{constructor(){this.XMLConfig=o.XMLconfigData}static stringIsAValidUrl(t){let e;try{e=new URL(t)}catch(t){return(0,u.logger)(l.DEBUGLEVEL.LOW,"cant construct url. Error:",t),!1}return"http:"===e.protocol||"https:"===e.protocol}setDomainAndTimout(t){if(!f.stringIsAValidUrl(t))throw new Error("wrong domain");this.domain=t}setDomain(t){if(!f.stringIsAValidUrl(t))throw new Error("wrong domain");this.domain=t}getDomain(){return this.domain}validateRequest(t){try{let e=JSON.parse(t),r=JSON.parse(e.jsonSigned),n=r.domain,i=r.message;this.retrieveAttestedObject(i);return this.validateDomain(n)}catch(t){return(0,u.logger)(l.DEBUGLEVEL.LOW,"Validate error!",t),!1}}validateDomain(t){return t.name.toLowerCase()!==this.domain.toLowerCase()?((0,u.logger)(l.DEBUGLEVEL.LOW,"Domain name is not valid"),!1):t.version===c.SignatureUtility.Eip712Data.PROTOCOL_VERSION||((0,u.logger)(l.DEBUGLEVEL.LOW,"Protocol version is wrong"),!1)}retrieveAttestedObject(t){let e=t.payload,r=s.KeyPair.publicFromBase64orPEM(o.XMLconfigData.base64attestorPubKey),c=o.XMLconfigData.base64senderPublicKeys;return n.AttestedObject.fromBytes((0,u.hexStringToUint8)(e),i.UseToken,r,a.Ticket,c)}verifySignature(t,e){let r=JSON.parse(t),n=r.signatureInHex,i=JSON.parse(r.jsonSigned),o=c.SignatureUtility.recoverPublicKeyFromTypedMessageSignature(i,n),a=s.KeyPair.fromPublicHex(o.substr(2));return e.toLowerCase()!==i.message.address.toLowerCase()?((0,u.logger)(l.DEBUGLEVEL.LOW,"message.address is not equal pkAddress"),!1):e.toLowerCase()===a.getAddress().toLowerCase()||((0,u.logger)(l.DEBUGLEVEL.LOW,"Recovered address is not equal pkAddress"),!1)}}e.Eip712Validator=f},98478:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FullProofOfExponent=void 0;const n=r(93431),i=r(61538),o=r(96858),s=r(55050),a=r(13649),c=r(8441);class u{constructor(){}static fromData(t,e,r,n=new Uint8Array([])){let i=new this;return i.riddle=t,i.tPoint=e,i.challengeResponse=r,i.nonce=n,i.encoding=i.makeEncoding(t,e,r,n),i}static fromBytes(t){let e=o.AsnParser.parse(t,i.Proof);return this.fromASNType(e)}static fromASNType(t){let e=new Uint8Array(t.riddle),r=n.Point.decodeFromUint8(e,n.CURVE_BN256),i=new Uint8Array(t.challengePoint),o=(0,s.uint8ToBn)(i),a=new Uint8Array(t.responseValue),c=n.Point.decodeFromUint8(a,n.CURVE_BN256),u=new Uint8Array(t.nonce);return this.fromData(r,c,o,u)}static fromBase64(t){return u.fromBytes((0,s.base64ToUint8array)(t))}makeEncoding(t,e,r,n=new Uint8Array([])){let i=a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(t.getEncoded()))+a.Asn1Der.encode("OCTET_STRING",r.toString(16))+a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(e.getEncoded()))+a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(n));return a.Asn1Der.encode("SEQUENCE_30",i)}getRiddle(){return this.riddle}getPoint(){return this.tPoint}getChallengeResponse(){return this.challengeResponse}getNonce(){return this.nonce}getUsageProofOfExponent(){return c.UsageProofOfExponent.fromData(this.tPoint,this.challengeResponse,this.nonce)}getDerEncoding(){return this.encoding}getAsnType(){const t=new i.Proof;return t.nonce=this.getNonce(),t.challengePoint=(0,s.bnToUint8)(this.getChallengeResponse()),t.riddle=this.getRiddle().getEncoded(),t.responseValue=this.getPoint().getEncoded(),t}}e.FullProofOfExponent=u},3365:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IdentifierAttestation=void 0;const n=r(5393),i=r(86085),o=r(55050),s=r(19421),a=r(13649);class c extends i.Attestation{constructor(){super()}fromCommitment(t,e){this.subjectKey=e,this.setVersion(c.HIDDEN_IDENTIFIER_VERSION),this.setSubject("CN="),this.setSigningAlgorithm(c.DEFAULT_SIGNING_ALGORITHM),this.setSubjectPublicKeyInfo(e),this.setCommitment(t),this.type=c.HIDDEN_TYPE,this.identifier=c.HIDDEN_IDENTIFIER,this.setUnlimitedValidity()}setUnlimitedValidity(){super.setNotValidBefore(Date.now()),super.setNotValidAfter(Date.parse("31 Dec 9999 23:59:59"))}static fromData(t,e,r,i){let o=(new n.AttestationCrypto).makeCommitment(t,e,i),s=new this;return s.fromCommitment(o,r),s.type=e.toString(),s.identifier=t,s}static fromLabelAndUrl(t,e,r){let n=new this;return n.subjectKey=r,n.setVersion(c.NFT_VERSION),n.setSubject(n.makeLabeledURI(t,e)),n.setSigningAlgorithm(c.DEFAULT_SIGNING_ALGORITHM),n.setIssuer("CN=attestation.id"),n.setSerialNumber(1),n.setSubjectPublicKeyInfo(r),n.setUnlimitedValidity(),n.type=t,n.identifier=e,n}makeLabeledURI(t,e){return`${c.LABELED_URI_LABEL}="${e} ${t}"`}static fromBytes(t){let e=new this;if(e.fromBytes(t),!e.checkValidity())throw new Error("Could not validate object");if(e.getVersion()==c.NFT_VERSION){let t=a.Asn1Der.parseX500Names(e.getSubject()),r=!1;if(t.forEach((t=>{if(!r&&t.type==c.LABELED_URI_LABEL){r=!0;let n=t.value.split(" ");if(2!=n.length)throw new Error("LabeledURI values should be separated with space and 2 items only: "+t.value);e.type=n[0],e.identifier=n[1]}})),!r)throw new Error("Cant find LABELED_URI")}else e.type=c.HIDDEN_TYPE,e.identifier=c.HIDDEN_IDENTIFIER;return e}setSubjectPublicKeyInfo(t){this.subjectKey=t}setCommitment(t){this.commitment=t}checkValidity(){return super.checkValidity()?this.getVersion()!=c.HIDDEN_IDENTIFIER_VERSION&&this.getVersion()!=c.NFT_VERSION?((0,o.logger)(s.DEBUGLEVEL.LOW,"The version number is "+this.getVersion()+", it must be either "+c.HIDDEN_IDENTIFIER_VERSION+" or "+c.NFT_VERSION),!1):this.getSigningAlgorithm()!==c.DEFAULT_SIGNING_ALGORITHM?((0,o.logger)(s.DEBUGLEVEL.LOW,"The subject is supposed to only be an Ethereum address as the Common Name"),!1):this.getVersion()!=c.NFT_VERSION||this.subject.includes(c.LABELED_URI_LABEL+"=")?!(this.getVersion()==c.HIDDEN_IDENTIFIER_VERSION&&this.getCommitment().length{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyPair=e.subtle=void 0;const n=r(55050),i=r(13649),o=r(93431),s=r(96858),a=r(54759),c=r(93343),u=r(8573),l=r(19421);let f=r(86266);if("object"==typeof crypto&&crypto.subtle)e.subtle=crypto.subtle;else{let t=r(86332).webcrypto;if(!t)throw(0,n.logger)(l.DEBUGLEVEL.LOW,"Webcrypto not accessible"),new Error("webcrypto.subtle missing");e.subtle=t.subtle}let h=new f.ec("secp256k1"),d=r(91094);const p={p192:null,p224:null,p256:"P-256",p384:"P-384",p521:"P-521",curve25519:null,ed25519:null,secp256k1:null};new o.Point(55066263022277343669578718895168534326250603453777594175500187360389116729240n,32670510020758816978083085130507043184471273380659243275938904335757337482424n);class g{constructor(){this.ethereumPrefix="Ethereum Signed Message:\n",this.algorithmASNList={secp256k1:["3081ec06072a8648ce3d02013081e0020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f3044042000000000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000000704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101","06052b8104000a"],sect283k1:["3081f806072a8648ce3d02013081ec020101302506072a8648ce3d0102301a0202011b06092a8648ce3d01020303300902010502010702010c304c042400000000000000000000000000000000000000000000000000000000000000000000000004240000000000000000000000000000000000000000000000000000000000000000000000010449040503213f78ca44883f1a3b8162f188e553cd265f23c1567a16876913b0c2ac245849283601ccda380f1c9e318d90f95d07e5426fe87e45c0e8184698e45962364e34116177dd2259022401ffffffffffffffffffffffffffffffffffe9ae2ed07577265dff7f94451e061e163c61020104"],p256:["3081ec06072a8648ce3d02013081e0020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff30440420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b0441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020101"]}}getPrivateAsUint8(){return this.privKey}getPrivateAsHexString(){return(0,n.uint8tohex)(this.privKey)}getPrivateAsBigInt(){return(0,n.uint8ToBn)(this.privKey)}static privateFromBigInt(t){let e=new this;return e.privKey=new Uint8Array((0,n.hexStringToArray)(t.toString(16).padStart(64,"0"))),e}static fromPublicHex(t){if(null===t.toLowerCase().match(/^[a-f0-9]+$/i))throw new Error("Wrong Hex string input");if(t.length<129||t.length>130)throw new Error("Wrong public hex length");let e=new this;return e.pubKey=new Uint8Array((0,n.hexStringToArray)(t)),e}static fromPrivateUint8(t,e=""){if(!t||32!=t.length)throw new Error("Wrong private key. Should be 32 bytes Uint8");let r=new this;if(r.privKey=t,!e||!o.CURVES.hasOwnProperty(e))throw new Error(`Algorithm ${e} not implemented.`);return r.algorithm=e,r}static publicFromBase64orPEM(t){return g.publicFromPEM((0,n.pemOrBase64Orbase64urlToString)(t))}static publicFromPEM(t){const e=(0,n.base64ToUint8array)(t);let r=s.AsnParser.parse(e,a.PublicKeyInfoValue);return g.publicFromUint(new Uint8Array(r.publicKey))}static publicFromUint(t){let e=new this;if(65!=t.byteLength)throw(0,n.logger)(l.DEBUGLEVEL.LOW,"Wrong public key length"),new Error("Wrong public key length");return e.pubKey=new Uint8Array(t),e}static publicFromSubjectPublicKeyInfo(t){let e=new this;return e.pubKey=new Uint8Array(t.value.publicKey),e}static publicFromSubjectPublicKeyValue(t){let e=new this;return e.pubKey=new Uint8Array(t.publicKey),e.algorithm=e.getAlgorithNameFromASN1((0,n.uint8tohex)(new Uint8Array(t.algorithm))),e}static privateFromKeyInfo(t){let e=new this,r=s.AsnParser.parse(t.keysData,a.PrivateKeyData);return e.algorithm=e.getAlgorithNameFromASN1((0,n.uint8tohex)(new Uint8Array(t.algIdent))),e.privKey=new Uint8Array(r.privateKey),e}static privateFromKeyDataPEM(t){const e=(0,n.base64ToUint8array)(t);let r=s.AsnParser.parse(e,a.PrivateKeyData),i=new this;return i.algorithm=i.getAlgorithNameFromASN1((0,n.uint8tohex)(new Uint8Array(r.algDescr))),i.privKey=new Uint8Array(r.privateKey),i}getAlgorithNameFromASN1(t){let e={};for(const t in this.algorithmASNList)this.algorithmASNList[t].forEach((r=>{e[r]=t}));if(e.hasOwnProperty(t))return e[t];{let t="Unknown algorithm.";throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}}static privateFromPEM(t){const e=(0,n.base64ToUint8array)(t);let r=s.AsnParser.parse(e,a.PrivateKeyInfo);return g.privateFromKeyInfo(r)}static async generateKeyAsync(){const t=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt"]);let e=["0x"];const r=await crypto.subtle.exportKey("raw",t);return new Uint8Array(r).forEach((t=>{var r=t.toString(16);r.length%2&&(r="0"+r),e.push(r)})),this.privateFromBigInt(BigInt(e.join(""))%o.CURVE_SECP256k1.n)}static createKeys(){return this.privateFromBigInt(BigInt("0x"+(0,n.uint8tohex)(crypto.getRandomValues(new Uint8Array(32))))%o.CURVE_SECP256k1.n)}getPublicKeyAsHexStr(){if(this.pubKey)return(0,n.uint8tohex)(this.pubKey);if(o.CURVES.hasOwnProperty(this.algorithm)&&p.hasOwnProperty(this.algorithm)){let t=new f.ec(this.algorithm);if(!this.getPrivateAsHexString())throw(0,n.logger)(l.DEBUGLEVEL.LOW,this),new Error("Cant sign. This is only public key.");return t.keyFromPrivate(this.getPrivateAsHexString(),"hex").getPublic("hex").toString()}{let t='Private -> Public key not implemented for that aglorighm - "'+this.algorithm+'"';throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}}getAsnDerPublic(){var t=this.getPublicKeyAsHexStr();let e="";if(this.algorithm){if(!this.algorithmASNList.hasOwnProperty(this.algorithm)){let t="Fatal Error. Algorithm not implemented yet - "+this.algorithm;throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}e=this.algorithmASNList[this.algorithm][0]}else{let t="algorithm undefined, lets use default.";(0,n.logger)(l.DEBUGLEVEL.VERBOSE,t),e=this.algorithmASNList.secp256k1[0]}return i.Asn1Der.encode("SEQUENCE_30",e+i.Asn1Der.encode("BIT_STRING",t))}getAddress(){var t=this.getPublicKeyAsHexStr();return t=t.substr(2),"0x"+d.keccak256((0,n.hexStringToArray)(t)).substr(-40).toUpperCase()}signBytes(t){if(!this.getPrivateAsHexString())throw new Error("Cant sign. This is only public key.");let e=h.keyFromPrivate(this.getPrivateAsHexString(),"hex"),r=d.keccak256(t);return e.sign(r).toDER("hex")}signStringWithEthereum(t){if(!this.getPrivateAsHexString())throw new Error("Cant sign. This is only public key.");let e=h.keyFromPrivate(this.getPrivateAsHexString(),"hex"),r=this.ethereumPrefix+t.length+t,i=d.keccak256((0,n.stringToArray)(r));return e.sign(i).toDER("hex")}signHexStringWithEthereum(t){return this.signStringWithEthereum("0x"+t)}signBytesWithEthereum(t){let e="0x"+(0,n.uint8tohex)(new Uint8Array(t));return(0,n.logger)(l.DEBUGLEVEL.HIGH,"message: "+e),this.signStringWithEthereum(e)}signDeterministicSHA256(t){let e=Array.from(c.ethers.utils.arrayify(c.ethers.utils.sha256(t)));return this.signBytes(e)}verifyDeterministicSHA256(t,e){let r,i,a=c.ethers.utils.sha256(t).substr(2);if(!o.CURVES.hasOwnProperty(this.algorithm)||!p.hasOwnProperty(this.algorithm)){let t='Elliptic.js curve not implemented for that aglorighm - "'+this.algorithm+'"';throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}r=new f.ec(this.algorithm).keyFromPublic(this.getPublicKeyAsHexStr(),"hex");if(128==e.length||130==e.length){var h=e.match(/([a-f\d]{64})/gi);i={r:h[0],s:h[1]}}else{let t=s.AsnParser.parse((0,n.hexStringToUint8)(e),u.Signature);i={r:BigInt(t.r).toString(16).padStart(64,"0"),s:BigInt(t.s).toString(16).padStart(64,"0")}}return r.verify(a,i)}verifyHexStringWithEthereum(t,e){let r="0x"+t,i=d.keccak256((0,n.stringToArray)(this.ethereumPrefix+r.length+r)),o=h.keyFromPublic(this.getPublicKeyAsHexStr(),"hex");var s=e.match(/([a-f\d]{64})/gi);let a={r:s[0],s:s[1]};return o.verify(i,a)}signRawBytesWithEthereum(t){let e=c.ethers.utils.keccak256(t).substring(2);if((0,n.logger)(l.DEBUGLEVEL.HIGH,`signRawBytesWithEthereum: key: ${this.getAddress()}, hash: ${e}`),!this.getPrivateAsHexString())throw new Error("Cant sign. This is only public key.");let r=h.keyFromPrivate(this.getPrivateAsHexString(),"hex"),i=r.sign((0,n.hexStringToUint8)(e));return(0,n.ecSignatureToSRVhex)(i,r)}verifyBytesWithEthereum(t,e){if(!t||!t.length)throw new Error("Missing data to verify");if(!e)throw new Error("Missing signature to verify");let r=(0,n.hexStringToArray)(c.ethers.utils.keccak256(t)),i=h.keyFromPublic(this.getPublicKeyAsHexStr(),"hex");(0,n.logger)(l.DEBUGLEVEL.HIGH,`verifyBytesWithEthereum: key: ${this.getAddress()}, hash: ${(0,n.uint8tohex)(new Uint8Array(r))}`);var o=(e=(0,n.uint8tohex)(g.anySignatureToRawUint8(e))).match(/([a-f\d]{64})/gi);let s={r:o[0],s:o[1]};return i.verify(r,s)}getJWTParams(){let t=p[this.algorithm];if(!t){let t=`Cant create subtleCrypto key for curve '${this.algorithm}'`;throw(0,n.logger)(l.DEBUGLEVEL.LOW,t),new Error(t)}let e=this.getPublicKeyAsHexStr();return{crv:t,d:(0,n.uint8arrayToBase64)(this.getPrivateAsUint8()),key_ops:["sign"],kty:"EC",x:(0,n.uint8arrayToBase64)((0,n.hexStringToUint8)(e.substr(2,64))),y:(0,n.uint8arrayToBase64)((0,n.hexStringToUint8)(e.substr(66,64)))}}getSubtlePrivateKey(){let t=p[this.algorithm];return e.subtle.importKey("jwk",this.getJWTParams(),{name:"ECDSA",namedCurve:t},!0,["sign"])}getSubtlePublicKey(){let t=p[this.algorithm],r=this.getJWTParams();return delete r.d,r.key_ops=["verify"],e.subtle.importKey("jwk",r,{name:"ECDSA",namedCurve:t},!0,["verify"])}async signStringWithSubtle(t){return await e.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},await this.getSubtlePrivateKey(),Uint8Array.from((0,n.stringToArray)(t)))}async verifyStringWithSubtle(t,r){return(0,n.logger)(l.DEBUGLEVEL.VERBOSE,"pubkey: "+this.getPublicKeyAsHexStr()+" msg:"+r+" signature:"+(0,n.uint8tohex)(t)),(0,n.logger)(l.DEBUGLEVEL.VERBOSE,await this.getSubtlePublicKey()),await e.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},await this.getSubtlePublicKey(),t,Uint8Array.from((0,n.stringToArray)(r)))}async verifyStringWithSubtleDerSignature(t,e){let r=s.AsnParser.parse(t,u.Signature);const i=BigInt(r.r).toString(16).padStart(64,"0")+BigInt(r.s).toString(16).padStart(64,"0");return this.verifyStringWithSubtle((0,n.hexStringToUint8)(i),e)}static anySignatureToRawUint8(t){let e,r;if(e="string"==typeof t?(0,n.hexStringToUint8)(t):t,!e||!e.length)throw new Error("Empty signature received");switch(e.length){case 64:(0,n.logger)(l.DEBUGLEVEL.LOW,`anySignatureToRawUint8 received 64 bytes signature (without v value) = ${(0,n.uint8tohex)(e)}`);case 65:r=e;break;case 66:if(4!=e[0])throw new Error(`Cant recognize signature: ${(0,n.uint8tohex)(e)}`);r=e.slice(1,65);break;case 70:case 71:case 72:let t=s.AsnParser.parse(e,u.Signature);r=(0,n.hexStringToUint8)(BigInt(t.r).toString(16).padStart(64,"0")+BigInt(t.s).toString(16).padStart(64,"0"));break;default:let i="wrong Signature: "+(0,n.uint8tohex)(e);throw new Error(i)}return(0,n.logger)(l.DEBUGLEVEL.VERBOSE,"ready signature:"+(0,n.uint8tohex)(r)),r}static parseKeyArrayStrings(t){for(let e in t)"string"==typeof t[e]&&(t[e]=g.publicFromBase64orPEM(t[e]));return t}}e.KeyPair=g},92219:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Nonce=void 0;const n=r(55050),i=r(69112),o=r(91104),s=r(54288),a=r(19421);class c{constructor(){this.DEFAULT_NONCE_TIME_LIMIT_MS=12e5}static async makeNonce(t="",e,r=new Uint8Array(0),s=0){if(t||(t=await i.SignatureUtility.connectMetamaskAndGetAddress()),!o.ValidationTools.isAddress(t))throw new Error("Address is not valid");return t=t.toUpperCase(),s||(s=Date.now()),(0,n.uint8merge)([Uint8Array.from((0,n.stringToArray)(t)),(0,n.hashStringTo32bytesUint8)(e),(0,n.getInt64Bytes)(s),r])}validateNonce(t,e,r,i,o,s=new Uint8Array(0)){return c.validateAddress(t,e)?this.validateReceiverIdentifier(t,r)?this.validateTimestamp(t,i,o)?this.validateOtherData(t,s)?this.validateOtherData(t,s):((0,n.logger)(a.DEBUGLEVEL.LOW,"otherData check failed"),!1):((0,n.logger)(a.DEBUGLEVEL.LOW,"timestamp check failed"),!1):((0,n.logger)(a.DEBUGLEVEL.LOW,"validateReceiverIdentifier check failed"),!1):((0,n.logger)(a.DEBUGLEVEL.LOW,"validateAddress check failed for "+e),!1)}validateTimestamp(t,e,r){let n=c.getTimestamp(t),i=new s.Timestamp(n);return i.setValidity(r-e),i.validateAgainstExpiration(r)}static validateAddress(t,e){let r=(0,n.uint8toString)(t.slice(c.senderAddressIndexStart,c.senderAddressIndexStop));return e.toUpperCase()===r.toUpperCase()||((0,n.logger)(a.DEBUGLEVEL.LOW,"nonceAddress = "+r),!1)}validateReceiverIdentifier(t,e){return(0,n.uint8tohex)((0,n.hashStringTo32bytesUint8)(e)).toLowerCase()===(0,n.uint8tohex)(t.slice(c.receiverIdentifierIndexStart,c.receiverIdentifierIndexStop)).toLowerCase()}validateOtherData(t,e){return(0,n.uint8tohex)(e).toLowerCase()===(0,n.uint8tohex)(t.slice(c.otherDataIndexStart,c.otherDataIndexStart+e.length)).toLowerCase()}static getTimestamp(t){let e=t.slice(c.timestampIndexStart,c.timestampIndexStop),r=(0,n.uint8ToBn)(e);if(r>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("timestamp value bigger than MAX_SAFE_INTEGER");return Number(r)}}e.Nonce=c,c.LONG_BYTES=8,c.senderAddressIndexStart=0,c.senderAddressIndexStop=o.ValidationTools.ADDRESS_LENGTH_IN_BYTES,c.receiverIdentifierIndexStart=c.senderAddressIndexStop,c.receiverIdentifierIndexStop=c.receiverIdentifierIndexStart+32,c.timestampIndexStart=c.receiverIdentifierIndexStop,c.timestampIndexStop=c.timestampIndexStart+c.LONG_BYTES,c.otherDataIndexStart=c.timestampIndexStop},93431:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Point=e.CURVE_BN256=e.CURVES=e.CURVE_SECP256k1=void 0;const n=r(55050),i=r(19421);e.CURVE_SECP256k1={P:2n**256n-2n**32n-977n,n:2n**256n-432420386565659656852420866394968145599n,magicExp:(2n**256n-2n**32n-977n+1n)/4n,A:0n,B:7n},e.CURVES={p256:{P:BigInt("0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),A:BigInt("0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),B:BigInt("0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),n:BigInt("0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),GX:BigInt("0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"),GY:BigInt("0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),h:1n},secp256k1:{P:2n**256n-2n**32n-977n,A:0n,B:7n,n:2n**256n-432420386565659656852420866394968145599n,GX:55066263022277343669578718895168534326250603453777594175500187360389116729240n,GY:32670510020758816978083085130507043184471273380659243275938904335757337482424n},BN256:{P:115792089237314936872688561244471742058375878355761205198700409522629664518163n,n:115792089237314936872688561244471742058035595988840268584488757999429535617037n,magicExp:115792089237314936872688561244471742058375878355761205198700409522629664518164n>>2n,A:0n,B:3n,h:1n}},e.CURVE_BN256={P:21888242871839275222246405745257275088696311157297823662689037894645226208583n,n:21888242871839275222246405745257275088548364400416034343698204186575808495617n,A:0n,B:3n,h:1n};class o{constructor(t,r,n=e.CURVES.secp256r1){this.x=t,this.y=r,this.useCurve=n}double(){const t=this.x,e=this.y,r=(0,n.mod)(3n*t**2n*(0,n.invert)(2n*e,this.useCurve.P),this.useCurve.P),i=(0,n.mod)(r*r-2n*t,this.useCurve.P),s=(0,n.mod)(r*(t-i)-e,this.useCurve.P);return new o(i,s,this.useCurve)}newZero(){return new o(0n,0n,this.useCurve)}add(t){const[e,r]=[this,t],[i,s,a,c]=[e.x,e.y,r.x,r.y];if(0n===i||0n===s)return r;if(0n===a||0n===c)return e;if(i===a&&s===c)return this.double();if(i===a&&s===-c)return this.newZero();const u=(0,n.mod)((c-s)*(0,n.invert)(a-i,this.useCurve.P),this.useCurve.P),l=(0,n.mod)(u*u-i-a,this.useCurve.P),f=(0,n.mod)(u*(i-l)-s,this.useCurve.P);return new o(l,f,this.useCurve)}multiplyDA(t){let e=this.newZero(),r=this;for(;t>0n;)1n&t&&(e=e.add(r)),r=r.double(),t>>=1n;return e}isInfinity(){return null==this.x||null==this.y}getEncoded(t=!1){if(this.isInfinity())return new Uint8Array(0);let e=(0,n.bnToBuf)(this.x,32);return t?(0,n.uint8merge)([Uint8Array.from([2]),e]):(0,n.uint8merge)([Uint8Array.from([4]),e,(0,n.bnToBuf)(this.y,32)])}equals(t){if(null==t)return!1;let e=this.isInfinity(),r=t.isInfinity();if(e||r)return e&&r;let n=t;return this.x===n.x&&this.y===n.y}static decodeFromHex(t,r=e.CURVE_SECP256k1){if(130!=t.length)throw new Error("only decompressed points allowed. 65 bytes.");return o.decodeFromUint8((0,n.hexStringToUint8)(t),r)}static decodeFromUint8(t,r=e.CURVE_SECP256k1){if(65!=t.length)throw new Error("only decompressed points allowed. 65 bytes.");let s;if(4!==t[0])throw new Error("only decompressed points allowed");{let e=(0,n.uint8ToBn)(t.slice(1,33)),i=(0,n.uint8ToBn)(t.slice(33));s=new o(e,i,r)}if(!s.validate()){let t="Point is not valid ("+s.x.toString(16)+","+s.y.toString(16)+")";throw(0,n.logger)(i.DEBUGLEVEL.LOW,t),new Error(t)}return s}validate(){return 0n==(0,n.mod)((0,n.mod)(this.y*this.y,this.useCurve.P)-(0,n.mod)((0,n.BnPowMod)(this.x,3n,this.useCurve.P)+(0,n.mod)(this.x*this.useCurve.A,this.useCurve.P)+this.useCurve.B,this.useCurve.P),this.useCurve.P)}negate(){return new o(this.x,this.useCurve.P-this.y,this.useCurve)}subtract(t){return this.add(t.negate())}}e.Point=o},69112:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignatureUtility=void 0;const n=r(55050),i=r(93343),o=r(56371),s=r(19421);let a=new(r(86266).ec)("secp256k1"),c=r(91094);class u{static sign(t,e){let r=a.keyFromPrivate(e.getPrivateAsHexString(),"hex"),i=c.keccak256((0,n.hexStringToArray)(t));return r.sign(i).toDER("hex")}static verify(t,e,r){return u.verifyArrayBuf((0,n.hexStringToArray)(t),e,r)}static verifyArrayBuf(t,e,r){let n=a.keyFromPublic(r.getPublicKeyAsHexStr(),"hex"),i=c.keccak256(t);return n.verify(i,e)}static async signMessageWithBrowserWallet(t){await u.connectMetamaskAndGetAddress();let e=new i.ethers.providers.Web3Provider(window.ethereum).getSigner();return await e.signMessage(t)}static async recoverPublicKeyFromMessageSignature(t,e){const r=i.ethers.utils.hashMessage(t),n=i.ethers.utils.arrayify(r);return await i.ethers.utils.recoverPublicKey(n,e)}static recoverPublicKeyFromTypedMessageSignature(t,e){let r,s;try{let e=t.message.payload;t.message.payload=i.ethers.utils.id(e).substr(2);let n=t.types;delete n.EIP712Domain,r=o._TypedDataEncoder.hash(t.domain,n,t.message),t.message.payload=e}catch(t){throw new Error("Cant sign data, possibly wrong format. "+t)}try{s=(0,o.recoverPublicKey)((0,n.hexStringToUint8)(r.substr(2)),e)}catch(t){throw new Error("Cant recoverPublicKey. "+t)}return s}static async signEIP712WithBrowserWallet(t,e,r,o,a=null){try{let n;if(a)n=new i.ethers.Wallet("0x"+a.getPrivateAsHexString());else{n=new i.ethers.providers.Web3Provider(window.ethereum).getSigner()}if(!n)throw new Error("Active Wallet required");const s={name:t,version:u.Eip712Data.PROTOCOL_VERSION},l={};l[o]=r;let f=Object.assign({},e);f.payload=c.keccak256(f.payload);let h=await n._signTypedData(s,l,f),d={types:{EIP712Domain:u.Eip712domainTypes},primaryType:o,message:e,domain:s};d.types[o]=l[o];let p={signatureInHex:h,jsonSigned:JSON.stringify(d)};return JSON.stringify(p)}catch(t){return(0,n.logger)(s.DEBUGLEVEL.LOW,"Cant sign eip712 data. Error: "+t),""}}static async connectMetamaskAndGetAddress(){if(!window.ethereum)throw new Error("Please install metamask before.");const t=await window.ethereum.request({method:"eth_requestAccounts"});if(!t||!t.length)throw new Error("Active Wallet required");return t[0]}static getChainIdFromSignature(t){let e=Number("0x"+t.substr(-2));return 27==e||28==e?0:e-35>>1}static convertToPersonalEthMessage(t){return(0,n.stringToArray)(this.ethereumPrefix+t.length+t)}}e.SignatureUtility=u,u.ethereumPrefix="Ethereum Signed Message:\n",u.OID_ECDSA_PUBLICKEY="1.2.840.10045.2.1",u.Eip712Data={PROTOCOL_VERSION:"0.1"},u.Eip712domainTypes=[{name:"name",type:"string"},{name:"version",type:"string"}]},80716:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignedIdentifierAttestation=void 0;const n=r(96858),i=r(54759),o=r(65185),s=r(55050),a=r(13649),c=r(3365),u=r(19421);class l{constructor(){}static fromBytes(t,e){const r=n.AsnParser.parse(t,i.MyAttestation);return this.fromASNType(r,e,t)}static fromASNType(t,e,r=new Uint8Array(0)){let n=new this;n.uint8data=r,n.attestorKeys=e;let i=t.signatureAlgorithm.algorithm;if(n.att=c.IdentifierAttestation.fromBytes(t.signedInfo),n.signature=(0,s.uint8tohex)(new Uint8Array(t.signatureValue)),i!==n.att.getSigningAlgorithm())throw new Error("Algorithm specified is not consistent");return n.constructorCheck(),n}static fromData(t,e){let r=new this;return r.attestorKeys=e,r.att=t,r.signature=r.attestorKeys.signRawBytesWithEthereum(Array.from(r.att.getPrehash())),r.constructorCheck(),r}verify(){try{return this.attestorKeys.verifyBytesWithEthereum((0,s.hexStringToArray)(this.att.getDerEncoding()),this.signature)}catch(t){return(0,s.logger)(u.DEBUGLEVEL.LOW,t),!1}}checkValidity(){return this.getUnsignedAttestation().checkValidity()}getUnsignedAttestation(){return this.att}getDerEncoding(){return this.uint8data&&this.uint8data.length?(0,s.uint8tohex)(new Uint8Array(this.uint8data)):this.constructSignedAttestation(this.getUnsignedAttestation(),this.signature)}constructSignedAttestation(t,e){let r=t.getPrehash(),n=a.Asn1Der.encode("OBJECT_ID",t.getSigningAlgorithm()),i=(0,s.uint8tohex)(r)+a.Asn1Der.encode("SEQUENCE_30",n)+a.Asn1Der.encode("BIT_STRING",(0,s.uint8tohex)(o.KeyPair.anySignatureToRawUint8(e)));return a.Asn1Der.encode("SEQUENCE_30",i)}constructorCheck(){if(!this.verify())throw new Error("The signature is not valid")}}e.SignedIdentifierAttestation=l,l.ECDSA_WITH_SHA256="1.2.840.10045.4.3.2"},54288:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=void 0;const n=r(55050),i=r(19421);class o{constructor(t=null){this.ALLOWED_ROUNDING=1e4,this.validity=0,t||(this.time=Date.now()),"number"==typeof t&&(this.time=t),"string"==typeof t&&(this.time=o.stringTimestampToLong(t)),this.time=this.time-this.time%1e3}fromString(t){this.time=o.stringTimestampToLong(t)}getValidity(){return this.validity}setValidity(t){this.validity=t}getTime(){return this.time}getTimeAsString(){let t=new Date(this.time).toString();return t.substr(0,t.indexOf("(")-1)}validateTimestamp(){let t=this.getCurrentTime();return!(this.time>t+this.ALLOWED_ROUNDING)&&!(this.time+this.ALLOWED_ROUNDING+this.validitye+this.ALLOWED_ROUNDING?((0,n.logger)(i.DEBUGLEVEL.LOW,"Object still not valid. Details: not valid before = "+this.time+", currentTime = "+e),!1):t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UsageProofOfExponent=void 0;const n=r(93431),i=r(61538),o=r(96858),s=r(55050),a=r(13649);e.UsageProofOfExponent=class{constructor(){}static fromData(t,e,r=new Uint8Array([])){let n=new this;return n.tPoint=t,n.challengeResponse=e,n.nonce=r,n.encoding=n.makeEncoding(),n}fromBase64(t){this.encoding=t,this.fromBytes((0,s.base64ToUint8array)(t))}fromBytes(t){this.encodingBytes=t;let e=o.AsnParser.parse(t,i.UsageProof);this.challengeResponse=(0,s.uint8ToBn)(new Uint8Array(e.challengePoint));let r=new Uint8Array(e.responseValue);this.nonce=new Uint8Array(e.nonce),this.tPoint=n.Point.decodeFromHex((0,s.uint8tohex)(r),n.CURVE_BN256)}makeEncoding(){let t=a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)((0,s.bnToUint8)(this.challengeResponse)))+a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.tPoint.getEncoded(!1)))+a.Asn1Der.encode("OCTET_STRING",(0,s.uint8tohex)(this.nonce));return a.Asn1Der.encode("SEQUENCE_30",t)}getPoint(){return this.tPoint}getChallengeResponse(){return this.challengeResponse}getDerEncoding(){return this.encoding}getNonce(){return this.nonce}}},49674:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UseAttestation=void 0;const n=r(65185),i=r(98478),o=r(5393),s=r(80716),a=r(91462),c=r(96858),u=r(13649);e.UseAttestation=class{static fromData(t,e,r,n){let i=new this;return i.attestation=t,i.type=e,i.pok=r,i.sessionPublicKey=n,i.encoding=i.makeEncoding(t,e,r,n),i.constructorCheck(),i}static fromBytes(t,e){let r,o=new this;try{r=c.AsnParser.parse(t,a.UseAttestation)}catch(t){throw new Error("Cant parse UseAttestationASN. "+t)}try{o.attestation=s.SignedIdentifierAttestation.fromASNType(r.attestation,e),o.type=r.type,o.pok=i.FullProofOfExponent.fromASNType(r.proof),o.sessionPublicKey=n.KeyPair.publicFromSubjectPublicKeyValue(r.sessionKey)}catch(t){throw new Error("Cant decode internal data. "+t)}return o.constructorCheck(),o}constructorCheck(){if(!this.verify())throw new Error("The use attestation object is not valid")}makeEncoding(t,e,r,n){let i=t.getDerEncoding()+u.Asn1Der.encode("INTEGER",e)+r.getDerEncoding()+n.getAsnDerPublic();return u.Asn1Der.encode("SEQUENCE_30",i)}getAttestation(){return this.attestation}getType(){return this.type}getPok(){return this.pok}getSessionPublicKey(){return this.sessionPublicKey}getDerEncoding(){return this.encoding}verify(){return this.attestation.verify()&&(new o.AttestationCrypto).verifyFullProof(this.pok)}checkValidity(){return this.attestation.checkValidity()}}},91104:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ValidationTools=void 0;const n=r(55050),i=r(19421);class o{static validateTimestamp(t,e,r){return!(t>e+r)&&!(t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ATTESTATION_TYPE=void 0,e.ATTESTATION_TYPE={phone:0,mail:1,InetPersona:2}},55050:(t,e,r)=>{"use strict";var n=r(34155),i=r(48764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.ecSignatureToSRVhex=e.testsLogger=e.logger=e.isDomainValid=e.formatGeneralizedDateTime=e.ethAddressToUint8=e.hashUint8To32bytesUint8=e.hashStringTo32bytesUint8=e.getInt64Bytes=e.uint8tohex=e.BnPowMod=e.stringToArray=e.base64ToUint8array=e.pemOrBase64Orbase64urlToString=e.base64toBase64Url=e.uint8arrayToBase64=e.uint8toString=e.uint8merge=e.bnToBuf=e.bnToUint8=e.bufToBn=e.uint8ToBn=e.egcd=e.invert=e.mod=e.hexStringToBase64Url=e.hexStringToBase64=e.hexStringToUint8=e.hexStringToArray=e.stringToHex=void 0;const o=r(19421),s=r(93431);let a,c,u=r(91094);function l(t=""){"0x"===t.substr(0,2).toLowerCase()&&(t=t.substr(2));let e=[],r=[...t];r.length%2&&r.unshift("0");let n,i="";if(!r||void 0===r||!r.length)return[];for(;r.length;){if(i="",i+=r.shift()+r.shift(),n=parseInt(i,16),isNaN(n))throw new Error("hexStringToArray input is not a hex string.");e.push(n)}return e}function f(t=""){return Uint8Array.from(l(t))}function h(t,e=s.CURVE_BN256.P){const r=t%e;return r>=0n?r:e+r}function d(t,e){let[r,n,i,o]=[0n,1n,1n,0n];for(;0n!==t;){let[s,a]=[e/t,e%t],[c,u]=[r-i*s,n-o*s];[e,t]=[t,a],[r,n]=[i,o],[i,o]=[c,u]}return[e,r,n]}function p(t){let e=[];return Uint8Array.from(t).forEach((function(t){var r=t.toString(16);r.length%2&&(r="0"+r),e.push(r)})),BigInt("0x"+e.join(""))}function g(t,e=0){var r=BigInt(t).toString(16).padStart(2*e,"0");r.length%2&&(r="0"+r);for(var n=r.length/2,i=new Uint8Array(n),o=0,s=0;oa||console.log(...e)}n&&n.env&&n.env.DISPLAY_DEBUG_LEVEL?a=parseInt(n.env.DISPLAY_DEBUG_LEVEL):"undefined"!=typeof window&&window.DISPLAY_DEBUG_LEVEL&&(a=parseInt(window.DISPLAY_DEBUG_LEVEL)),n&&n.env&&n.env.DISPLAY_DEBUG_LEVEL_TESTS&&(c=parseInt(n.env.DISPLAY_DEBUG_LEVEL_TESTS)),e.stringToHex=function(t){for(var e="",r=0;rt.charCodeAt(0))):Uint8Array.from(i.from(t,"base64")),e},e.stringToArray=E,e.BnPowMod=function(t,e,r){let n=1n,i=t;for(;e>0n;)1n&e&&(n=n*i%r),i=i*i%r,e>>=1n;return n},e.uint8tohex=function(t){return t&&t.length?Array.from(t).map((t=>("0"+t.toString(16)).slice(-2))).join(""):""},e.getInt64Bytes=function(t){let e=Math.floor(t/2**32);return new Uint8Array([e,e<<8,e<<16,e<<24,t,t<<8,t<<16,t<<24].map((t=>t>>>24)))},e.hashStringTo32bytesUint8=function(t){return A(Uint8Array.from(E(t)))},e.hashUint8To32bytesUint8=A,e.ethAddressToUint8=function(t){if(null===t.toLowerCase().match(/^0x[a-f0-9]{40}$/i))throw new Error("Wrong Ethereum Address");let e=Uint8Array.from(l(t.substr(2)));if(20!=e.length)throw new Error("wrong address length");return e},e.formatGeneralizedDateTime=function(t){var e=new Date(t),r=""+(e.getUTCMonth()+1),n=""+e.getUTCDate(),i=e.getUTCFullYear();let o=""+e.getUTCHours(),s=""+e.getUTCMinutes(),a=""+e.getUTCSeconds();return r.length<2&&(r="0"+r),n.length<2&&(n="0"+n),o.length<2&&(o="0"+o),s.length<2&&(s="0"+s),a.length<2&&(a="0"+a),[i,r,n,o,s,a].join("")+"Z"},e.isDomainValid=function(t){try{new URL(t)}catch(t){return!1}return!0},e.logger=S,e.testsLogger=function(t,...e){!c||t>c||console.log(...e)},e.ecSignatureToSRVhex=function(t,e){try{let r=t.r.toString(16).padStart(64,"0"),n=t.s,i=t.recoveryParam,o=e.ec.curve.n.shrn(1);return n.cmp(o)>0&&(n=e.ec.curve.n.sub(n),i=1-i),r+n.toString(16).padStart(64,"0")+(1==i?"1c":"1b")}catch(t){throw S(o.DEBUGLEVEL.LOW,t),new Error("Signature format doesn't fit.")}}},92580:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractLinkedAttestation=void 0;const n=r(96858),i=r(52551),o=r(55050),s=r(93343),a=r(93312);e.AbstractLinkedAttestation=class{fromObject(t){this.linkedAttestation=t}fromBytes(t){this.linkedAttestation=n.AsnParser.parse(t,i.SignedLinkedAttestation)}fromBase64(t){this.fromBytes((0,o.base64ToUint8array)(t))}getAttestationData(){return this.linkedAttestation.attestation[this.TYPE]}getSubjectPublicKey(){return this.getAttestationData().subjectPublicKey}getEncoded(){return new Uint8Array(n.AsnSerializer.serialize(this.linkedAttestation))}getBase64(){return(0,o.uint8arrayToBase64)(this.getEncoded())}sign(t){const e=n.AsnSerializer.serialize(this.linkedAttestation.attestation[this.TYPE]);this.linkedAttestation.signingAlgorithm=new a.AlgorithmIdentifierASN,this.linkedAttestation.signingAlgorithm.algorithm="1.2.840.10045.4.2",this.linkedAttestation.signatureValue=(0,o.hexStringToUint8)(t.signRawBytesWithEthereum(Array.from(new Uint8Array(e))))}verify(t){const e=n.AsnSerializer.serialize(this.getAttestationData());let r=(0,o.hexStringToUint8)(s.ethers.utils.keccak256(new Uint8Array(e))),i=s.ethers.utils.recoverPublicKey(r,s.ethers.utils.splitSignature(new Uint8Array(this.linkedAttestation.signatureValue)));if(i.substring(2)!==t.getPublicKeyAsHexStr())throw new Error("Attestor public key does not match, expected "+t.getPublicKeyAsHexStr()+" got "+i.substring(2));let a=Math.round(Date.now()/1e3),c=this.getAttestationData();if(c.validity.notBefore>a)throw new Error("Linked attestation is not yet valid");if(c.validity.notAfter{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EthereumAddressAttestation=void 0;const n=r(92580),i=r(52551),o=r(95978),s=r(35403),a=r(55050);class c extends n.AbstractLinkedAttestation{constructor(){super(...arguments),this.TYPE="ethereumAddress"}create(t,e,r,n,c,u){this.linkedAttestation=new i.SignedLinkedAttestation,this.linkedAttestation.attestation=new i.LinkedAttestation,this.linkedAttestation.attestation.ethereumAddress=new o.EthereumAddressAttestation,this.linkedAttestation.attestation.ethereumAddress.subjectPublicKey=t,u||(u=Math.round(Date.now()/1e3));const l=u+n;this.linkedAttestation.attestation.ethereumAddress.validity=new s.EpochTimeValidity,this.linkedAttestation.attestation.ethereumAddress.validity.notBefore=u,this.linkedAttestation.attestation.ethereumAddress.validity.notAfter=l,this.linkedAttestation.attestation.ethereumAddress.ethereumAddress=(0,a.hexStringToUint8)(e),c&&(this.linkedAttestation.attestation.ethereumAddress.context=c),this.sign(r)}}e.EthereumAddressAttestation=c},52410:(t,e,r)=>{"use strict";e.b=void 0;const n=r(52551),i=r(42909),o=r(96858),s=r(55050),a=r(35403),c=r(42909),u=r(93312),l=r(92475),f=r(1754),h=r(78147),d="RSASSA-PKCS1-v1_5";e.b=class{create(t,e,r,u,l){let f=o.AsnParser.parse((0,s.base64ToUint8array)(t),n.SignedLinkedAttestation);this.linkAttest=new i.SignedEthereumKeyLinkingAttestation,this.linkAttest.ethereumKeyLinkingAttestation=new c.EthereumKeyLinkingAttestation,this.linkAttest.ethereumKeyLinkingAttestation.subjectEthereumAddress=(0,s.hexStringToUint8)(e),this.linkAttest.ethereumKeyLinkingAttestation.linkedAttestation=f,l||(l=Math.round(Date.now()/1e3));const h=l+r;this.linkAttest.ethereumKeyLinkingAttestation.validity=new a.EpochTimeValidity,this.linkAttest.ethereumKeyLinkingAttestation.validity.notBefore=l,this.linkAttest.ethereumKeyLinkingAttestation.validity.notAfter=h,u||(this.linkAttest.ethereumKeyLinkingAttestation.context=u)}async sign(t){const e=o.AsnSerializer.serialize(this.linkAttest.ethereumKeyLinkingAttestation),r=await h.default.sign({name:d,saltLength:128},t,e);this.linkAttest.signingAlgorithm=new u.AlgorithmIdentifierASN,this.linkAttest.signingAlgorithm.algorithm="1.2.840.113549.1.1.11",this.linkAttest.signatureValue=new Uint8Array(r)}fromBytes(t){this.linkAttest=o.AsnParser.parse(t,i.SignedEthereumKeyLinkingAttestation)}fromBase64(t){this.fromBytes((0,s.base64ToUint8array)(t))}getEncoded(){return new Uint8Array(o.AsnSerializer.serialize(this.linkAttest))}getBase64(){return(0,s.uint8arrayToBase64)(this.getEncoded())}getAttestation(){return this.linkAttest}getSignedLinkedAttestation(){return this.linkAttest.ethereumKeyLinkingAttestation.linkedAttestation}getLinkedAttestationData(){const t=this.getSignedLinkedAttestation();return t.attestation.ethereumAddress??t.attestation.nftOwnership}getLinkedAttestationObject(){const t=this.getSignedLinkedAttestation();let e;return t.attestation.ethereumAddress?(e=new l.EthereumAddressAttestation,e.fromObject(t)):(e=new f.NFTOwnershipAttestation,e.fromObject(t)),e}async verify(t){let e=this.getLinkedAttestationObject();e.verify(t);let r=e.getSubjectPublicKey();const n=o.AsnSerializer.serialize(this.linkAttest.ethereumKeyLinkingAttestation),i=await h.default.importKey("spki",new Uint8Array(r),{name:d,hash:{name:"SHA-256"}},!0,["verify"]);if(!await h.default.verify({name:d,saltLength:128},i,this.linkAttest.signatureValue,n))throw new Error("Signature verification failed");let s=Math.round(Date.now()/1e3),a=this.linkAttest.ethereumKeyLinkingAttestation;if(a.validity.notBefore>s)throw new Error("Linked attestation is not yet valid");if(a.validity.notAfter{"use strict";e.t=void 0;const n=r(55050),i=r(78147);class o{async getOrCreateKey(t,e){let r,o,s=t+(e?"-"+e:"");try{return r=await this.getKey(s),r?o=(0,n.hexStringToUint8)(r.spki):(r=await i.default.generateKey({name:t,modulusLength:1024,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!1,["sign","verify"]),o=new Uint8Array(await i.default.exportKey("spki",r.publicKey)),await this.saveKey(s,r.privateKey,r.publicKey,(0,n.uint8tohex)(o))),{attestHoldingKey:r,holdingPubKey:o}}catch(t){throw console.log("Failed to create attestor keypair: "+t.message),t}}async getKey(t){return new Promise((async(e,r)=>{try{this.getDb().then((n=>{let i=n.transaction(o.TABLE_NAME,"readwrite").objectStore(o.TABLE_NAME).get(t);i.onsuccess=()=>{e(i.result),n.close()},i.onerror=t=>{r(t)}}))}catch(t){console.log(t),r(t.message)}}))}async saveKey(t,e,r,n){try{let i=await this.getDb(),s=i.transaction(o.TABLE_NAME,"readwrite").objectStore(o.TABLE_NAME),a={id:t,privateKey:e,publicKey:r,spki:n};s.put(a).onsuccess=()=>{i.close()}}catch(t){console.log("Failed to store key"+t.message)}}async getDb(){return new Promise((function(t,e){let r=indexedDB.open(o.DB_NAME,1);r.onupgradeneeded=function(t){let e=t.target.result;e.objectStoreNames.contains(o.TABLE_NAME)||e.createObjectStore(o.TABLE_NAME,{keyPath:"id"})},r.onsuccess=function(e){let r=e.target.result;t(r)},r.onerror=function(t){e("Error opening database "+t.target.errorCode)}}))}}e.t=o,o.DB_NAME="AttestationKeyStore",o.TABLE_NAME="Keys"},1754:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NFTOwnershipAttestation=void 0;const n=r(92580),i=r(52551),o=r(83874),s=r(35403),a=r(55050);class c extends n.AbstractLinkedAttestation{constructor(){super(...arguments),this.TYPE="nftOwnership"}create(t,e,r,n,c,u){this.linkedAttestation=new i.SignedLinkedAttestation,this.linkedAttestation.attestation=new i.LinkedAttestation,this.linkedAttestation.attestation.nftOwnership=new o.NFTOwnershipAttestation,this.linkedAttestation.attestation.nftOwnership.subjectPublicKey=t,u||(u=Math.round(Date.now()/1e3));const l=u+n;this.linkedAttestation.attestation.nftOwnership.validity=new s.EpochTimeValidity,this.linkedAttestation.attestation.nftOwnership.validity.notBefore=u,this.linkedAttestation.attestation.nftOwnership.validity.notAfter=l;for(let t of e){let e=new o.ERC721;if(e.address=(0,a.hexStringToUint8)(t.address),e.chainId=t.chainId,t.tokenIds){e.tokenIds=[];for(let r of t.tokenIds)e.tokenIds.push((0,a.bnToUint8)(r))}this.linkedAttestation.attestation.nftOwnership.tokens.push(e)}c&&(this.linkedAttestation.attestation.nftOwnership.context=c),this.sign(r)}}e.NFTOwnershipAttestation=c},78147:(t,e,r)=>{"use strict";let n;if(Object.defineProperty(e,"__esModule",{value:!0}),"object"==typeof crypto&&crypto.subtle)n=crypto.subtle;else{let t=r(27912).webcrypto;if(!t)throw new Error("webcrypto.subtle missing");n=t.subtle}e.default=n},37912:(t,e,r)=>{"use strict";var n=r(40210)("%Array%"),i=!n.isArray&&r(21924)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},4200:(t,e,r)=>{"use strict";var n=r(40210),i=r(62432),o=r(57312),s=r(53633),a=r(11645),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==s(t))throw new c("Assertion failed: `S` must be a String");if(!o(e)||e<0||e>a)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==s(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+i(t,e)["[[CodeUnitCount]]"]:e+1}},50581:(t,e,r)=>{"use strict";var n=r(40210),i=r(21924),o=n("%TypeError%"),s=r(96975),a=n("%Reflect.apply%",!0)||i("%Function.prototype.apply%");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!s(r))throw new o("Assertion failed: optional `argumentsList`, if provided, must be a List");return a(t,e,r)}},62432:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(21924),o=r(29544),s=r(65424),a=r(53633),c=r(84857),u=i("String.prototype.charAt"),l=i("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==a(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var i=l(t,e),f=u(t,e),h=o(i),d=s(i);if(!h&&!d)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(d||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var p=l(t,e+1);return s(p)?{"[[CodePoint]]":c(i,p),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},82658:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(53633);t.exports=function(t,e){if("Boolean"!==i(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},67730:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(63682),o=r(18334),s=r(13746),a=r(14305),c=r(40484),u=r(53633);t.exports=function(t,e,r){if("Object"!==u(t))throw new n("Assertion failed: Type(O) is not Object");if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return i(s,c,o,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},53937:(t,e,r)=>{"use strict";var n=r(40210),i=r(41405)(),o=n("%TypeError%"),s=n("%IteratorPrototype%",!0),a=n("%Object.defineProperty%",!0),c=r(4200),u=r(82658),l=r(67730),f=r(1391),h=r(20953),d=r(96258),p=r(40105),g=r(88305),y=r(96846),m=r(53633),b=r(9496),v=function(t,e,r,n){if("String"!==m(e))throw new o("`S` must be a string");if("Boolean"!==m(r))throw new o("`global` must be a boolean");if("Boolean"!==m(n))throw new o("`fullUnicode` must be a boolean");b.set(this,"[[IteratingRegExp]]",t),b.set(this,"[[IteratedString]]",e),b.set(this,"[[Global]]",r),b.set(this,"[[Unicode]]",n),b.set(this,"[[Done]]",!1)};s&&(v.prototype=h(s));if(l(v.prototype,"next",(function(){var t=this;if("Object"!==m(t))throw new o("receiver must be an object");if(!(t instanceof v&&b.has(t,"[[IteratingRegExp]]")&&b.has(t,"[[IteratedString]]")&&b.has(t,"[[Global]]")&&b.has(t,"[[Unicode]]")&&b.has(t,"[[Done]]")))throw new o('"this" value must be a RegExpStringIterator instance');if(b.get(t,"[[Done]]"))return u(void 0,!0);var e=b.get(t,"[[IteratingRegExp]]"),r=b.get(t,"[[IteratedString]]"),n=b.get(t,"[[Global]]"),i=b.get(t,"[[Unicode]]"),s=d(e,r);if(null===s)return b.set(t,"[[Done]]",!0),u(void 0,!0);if(n){if(""===y(f(s,"0"))){var a=g(f(e,"lastIndex")),l=c(r,a,i);p(e,"lastIndex",l,!0)}return u(s,!1)}return b.set(t,"[[Done]]",!0),u(s,!1)})),i&&(Symbol.toStringTag&&(a?a(v.prototype,Symbol.toStringTag,{configurable:!0,enumerable:!1,value:"RegExp String Iterator",writable:!1}):v.prototype[Symbol.toStringTag]="RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])){l(v.prototype,Symbol.iterator,(function(){return this}))}t.exports=function(t,e,r,n){return new v(t,e,r,n)}},43950:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(2435),o=r(63682),s=r(18334),a=r(52435),c=r(13746),u=r(14305),l=r(40484),f=r(69916),h=r(53633);t.exports=function(t,e,r){if("Object"!==h(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var d=i({Type:h,IsDataDescriptor:c,IsAccessorDescriptor:a},r)?r:f(r);if(!i({Type:h,IsDataDescriptor:c,IsAccessorDescriptor:a},d))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return o(c,l,s,t,e,d)}},18334:(t,e,r)=>{"use strict";var n=r(62188),i=r(17141),o=r(53633);t.exports=function(t){return void 0!==t&&n(o,"Property Descriptor","Desc",t),i(t)}},1391:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(70631),o=r(14305),s=r(53633);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!o(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+i(e));return t[e]}},67364:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(631),o=r(61787),s=r(14305);t.exports=function(t,e){if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=i(t,e);if(null!=r){if(!o(r))throw new n(e+"is not a function");return r}}},631:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(14305),o=r(30821);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(t)[e]}},52435:(t,e,r)=>{"use strict";var n=r(17642),i=r(62188),o=r(53633);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},96975:(t,e,r)=>{"use strict";var n=r(40210)("%Array%"),i=!n.isArray&&r(21924)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},61787:(t,e,r)=>{"use strict";t.exports=r(95320)},41974:(t,e,r)=>{"use strict";var n=r(14445)("%Reflect.construct%",!0),i=r(43950);try{i({},"",{"[[Get]]":function(){}})}catch(t){i=null}if(i&&n){var o={},s={};i(s,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,s)}catch(t){return t===o}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},13746:(t,e,r)=>{"use strict";var n=r(17642),i=r(62188),o=r(53633);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},57312:(t,e,r)=>{"use strict";var n=r(54908),i=r(375),o=r(53633),s=r(29086),a=r(22633);t.exports=function(t){if("Number"!==o(t)||s(t)||!a(t))return!1;var e=n(t);return i(e)===e}},14305:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},10840:(t,e,r)=>{"use strict";var n=r(40210)("%Symbol.match%",!0),i=r(98420),o=r(39731);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return o(e)}return i(t)}},20953:(t,e,r)=>{"use strict";var n=r(40210),i=n("%Object.create%",!0),o=n("%TypeError%"),s=n("%SyntaxError%"),a=r(96975),c=r(53633),u=!({__proto__:null}instanceof Object);t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new o("Assertion failed: `proto` must be null or an object");var e=arguments.length<2?[]:arguments[1];if(!a(e))throw new o("Assertion failed: `additionalInternalSlotsList` must be an Array");if(e.length>0)throw new s("es-abstract does not yet support internal slots");if(i)return i(t);if(u)return{__proto__:t};if(null===t)throw new s("native Object.create support is required to create null objects");var r=function(){};return r.prototype=t,new r}},96258:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(21924)("RegExp.prototype.exec"),o=r(50581),s=r(1391),a=r(61787),c=r(53633);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=s(t,"exec");if(a(r)){var u=o(r,t,[e]);if(null===u||"Object"===c(u))return u;throw new n('"exec" method must return `null` or an Object')}return i(t,e)}},39619:(t,e,r)=>{"use strict";t.exports=r(4559)},40484:(t,e,r)=>{"use strict";var n=r(29086);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},40105:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%"),i=r(14305),o=r(40484),s=r(53633),a=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==s(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,a&&!o(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!a||o(t[e],r)}catch(t){return!1}}},39655:(t,e,r)=>{"use strict";var n=r(40210),i=n("%Symbol.species%",!0),o=n("%TypeError%"),s=r(41974),a=r(53633);t.exports=function(t,e){if("Object"!==a(t))throw new o("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==a(r))throw new o("O.constructor is not an Object");var n=i?r[i]:void 0;if(null==n)return e;if(s(n))return n;throw new o("no constructor found")}},39731:t=>{"use strict";t.exports=function(t){return!!t}},751:(t,e,r)=>{"use strict";var n=r(54908),i=r(375),o=r(55631),s=r(29086),a=r(22633),c=r(38111);t.exports=function(t){var e=o(t);return s(e)||0===e?0:a(e)?c(e)*i(n(e)):e}},88305:(t,e,r)=>{"use strict";var n=r(11645),i=r(751);t.exports=function(t){var e=i(t);return e<=0?0:e>n?n:e}},55631:(t,e,r)=>{"use strict";var n=r(40210),i=n("%TypeError%"),o=n("%Number%"),s=n("%RegExp%"),a=n("%parseInt%"),c=r(21924),u=r(50823),l=r(64790),f=c("String.prototype.slice"),h=u(/^0b[01]+$/i),d=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),g=u(new s("["+["…","​","￾"].join("")+"]","g")),y=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),m=new RegExp("(^["+y+"]+)|(["+y+"]+$)","g"),b=c("String.prototype.replace"),v=r(54607);t.exports=function t(e){var r=l(e)?e:v(e,o);if("symbol"==typeof r)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof r)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof r){if(h(r))return t(a(f(r,2),2));if(d(r))return t(a(f(r,2),8));if(g(r)||p(r))return NaN;var n=function(t){return b(t,m,"")}(r);if(n!==r)return t(n)}return o(r)}},30821:(t,e,r)=>{"use strict";var n=r(40210)("%Object%"),i=r(39619);t.exports=function(t){return i(t),n(t)}},54607:(t,e,r)=>{"use strict";var n=r(41503);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},69916:(t,e,r)=>{"use strict";var n=r(17642),i=r(40210)("%TypeError%"),o=r(53633),s=r(39731),a=r(61787);t.exports=function(t){if("Object"!==o(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new i("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!a(c))throw new i("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},96846:(t,e,r)=>{"use strict";var n=r(40210),i=n("%String%"),o=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new o("Cannot convert a Symbol value to a string");return i(t)}},53633:(t,e,r)=>{"use strict";var n=r(23951);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},84857:(t,e,r)=>{"use strict";var n=r(40210),i=n("%TypeError%"),o=n("%String.fromCharCode%"),s=r(29544),a=r(65424);t.exports=function(t,e){if(!s(t)||!a(e))throw new i("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return o(t)+o(e)}},54908:(t,e,r)=>{"use strict";var n=r(40210)("%Math.abs%");t.exports=function(t){return n(t)}},375:t=>{"use strict";var e=Math.floor;t.exports=function(t){return e(t)}},4559:(t,e,r)=>{"use strict";var n=r(40210)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},23951:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},14445:(t,e,r)=>{"use strict";t.exports=r(40210)},63682:(t,e,r)=>{"use strict";var n=r(31044),i=r(40210),o=n()&&i("%Object.defineProperty%",!0),s=n.hasArrayLengthDefineBug(),a=s&&r(37912),c=r(21924)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,i,u){if(!o){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(i in n&&c(n,i)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[i]=l,e(n[i],l)}return s&&"length"===i&&"[[Value]]"in u&&a(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(o(n,i,r(u)),!0)}},62188:(t,e,r)=>{"use strict";var n=r(40210),i=n("%TypeError%"),o=n("%SyntaxError%"),s=r(17642),a={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(s(t,r)&&!e[r])return!1;var n=s(t,"[[Value]]"),o=s(t,"[[Get]]")||s(t,"[[Set]]");if(n&&o)throw new i("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(64377)};t.exports=function(t,e,r,n){var s=a[e];if("function"!=typeof s)throw new o("unknown record type: "+e);if("Object"!==t(n)||!s(n))throw new i(r+" must be a "+e)}},17141:t=>{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},22633:t=>{"use strict";var e=Number.isNaN||function(t){return t!=t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!e(t)&&t!==1/0&&t!==-1/0}},29544:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=55296&&t<=56319}},64377:(t,e,r)=>{"use strict";var n=r(17642);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},29086:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},64790:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},2435:(t,e,r)=>{"use strict";var n=r(40210),i=r(17642),o=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(i(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new o("Property Descriptors may not be both accessor and data descriptors");return!0}},65424:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},11645:(t,e,r)=>{"use strict";var n=r(40210),i=n("%Math%"),o=n("%Number%");t.exports=o.MAX_SAFE_INTEGER||i.pow(2,53)-1},50823:(t,e,r)=>{"use strict";var n=r(21924)("RegExp.prototype.exec");t.exports=function(t){return function(e){return null!==n(t,e)}}},38111:t=>{"use strict";t.exports=function(t){return t>=0?1:-1}},18597:t=>{"use strict";t.exports={i8:"6.5.4"}}},n={};function i(t){var e=n[t];if(void 0!==e)return e.exports;var o=n[t]={id:t,loaded:!1,exports:{}};return r[t].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=r,i.amdO={},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.f={},i.e=t=>Promise.all(Object.keys(i.f).reduce(((e,r)=>(i.f[r](t,e),e)),[])),i.u=t=>t+".negotiator.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="negotiator:",i.l=(r,n,o,s)=>{if(t[r])t[r].push(n);else{var a,c;if(void 0!==o)for(var u=document.getElementsByTagName("script"),l=0;l{a.onerror=a.onload=null,clearTimeout(d);var i=t[r];if(delete t[r],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((t=>t(n))),e)return e(n)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),c&&document.head.appendChild(a)}},i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;i.g.importScripts&&(t=i.g.location+"");var e=i.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t})(),(()=>{var t={179:0};i.f.j=(e,r)=>{var n=i.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,i)=>n=t[e]=[r,i]));r.push(n[2]=o);var s=i.p+i.u(e),a=new Error;i.l(s,(r=>{if(i.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+s+")",a.name="ChunkLoadError",a.type=o,a.request=s,n[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,o,[s,a,c]=r,u=0;if(s.some((e=>0!==t[e]))){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(c)c(i)}for(e&&e(r);u{"use strict";i.r(o),i.d(o,{Client:()=>t.KU,Outlet:()=>S});var t=i(82250),e=i(93951),r=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},n=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]Needs email attestation to complete verification.

    '),this.buttonOverlay.appendChild(r),this.buttonOverlay.appendChild(i),document.body.appendChild(this.buttonOverlay)}else(0,e.kg)(2,"open attestation in iframe"),this.createIframe()},t.prototype.authenticate=function(){var t=this;return new Promise((function(e,r){if(t.rejectHandler=r,t.attestationInTab&&!(0,d.M)().brave&&(t.tryingToGetAttestationInBackground=!0),!t.attestationOrigin)return r(new Error("Attestation origin is null"));window.addEventListener("message",(function(n){if(t.attestationOrigin){var i=new URL(t.attestationOrigin);n.origin===i.origin&&(t.iframe&&t.iframeWrap&&t.iframe.contentWindow||t.attestationTabHandler)&&t.postMessageAttestationListener(n,e,r)}})),t.openAttestationApp(r)}))},t.prototype.createIframe=function(){var t,e=document.createElement("iframe");e.setAttribute("allow","clipboard-read"),this.iframe=e,e.src=null!==(t=this.attestationOrigin)&&void 0!==t?t:"",e.style.width="800px",e.style.height="700px",e.style.maxWidth="100%",e.style.background="#fff";var r=document.createElement("div");this.iframeWrap=r,r.setAttribute("style","width:100%;min-height: 100vh; position: fixed; align-items: center; justify-content: center;display: none;top: 0; left: 0; background: #fffa"),r.appendChild(e),document.body.appendChild(r)},t.prototype.postMessageAttestationListener=function(t,r,n){var i,o,s,a;return p(this,void 0,void 0,(function(){var c,u,l,d;return g(this,(function(p){switch(p.label){case 0:if((0,e.kg)(2,"postMessageAttestationListener event (auth-handler)",t.data),c=this.attestationTabHandler?this.attestationTabHandler:this.iframe.contentWindow,void 0!==t.data.ready&&!0===t.data.ready)return u={force:!1},this.email&&(u.email=this.email),this.wallet&&(u.wallet=this.wallet),this.address&&(u.address=this.address),c.postMessage(u,this.attestationOrigin),[2];if(void 0!==t.data.display)if(!0===t.data.display){if(this.iframeWrap){if(this.tryingToGetAttestationInBackground)return this.tryingToGetAttestationInBackground=!1,this.iframe.remove(),this.iframeWrap.remove(),this.openAttestationApp(),[2];this.iframeWrap.style.display="flex",this.outlet.sendMessageResponse({evtid:this.evtid,evt:f.k.SHOW_FRAME})}}else t.data.error&&((0,e.kg)(2,"Error received from the iframe: "+t.data.error),n(new Error(t.data.error))),this.iframeWrap&&(this.iframeWrap.style.display="none");if(!(null===(i=t.data)||void 0===i?void 0:i.attestation)||!(null===(o=t.data)||void 0===o?void 0:o.requestSecret))return[2];this.attestationTabHandler&&this.attestationTabHandler.close(),this.iframeWrap&&this.iframeWrap.remove(),this.attestationBlob=null===(s=t.data)||void 0===s?void 0:s.attestation,this.attestationSecret=null===(a=t.data)||void 0===a?void 0:a.requestSecret,p.label=1;case 1:if(p.trys.push([1,3,,4]),!this.signedTokenSecret)throw new Error("signedTokenSecret required");if(!this.attestationSecret)throw new Error("attestationSecret required");if(!this.signedTokenBlob)throw new Error("signedTokenBlob required");if(!this.attestationBlob)throw new Error("attestationBlob required");if(!this.base64attestorPubKey)throw new Error("base64attestorPubKey required");if(!this.base64senderPublicKeys)throw new Error("base64senderPublicKeys required");return[4,h._F.getUseTicket(this.signedTokenSecret,this.attestationSecret,this.signedTokenBlob,this.attestationBlob,this.base64attestorPubKey,this.base64senderPublicKeys)];case 2:if(!(l=p.sent()))throw console.log("this.authResultCallback( empty ): "),new Error("Empty useToken");return(0,e.kg)(2,"this.authResultCallback( useToken ): "),r(l),[3,4];case 3:return d=p.sent(),(0,e.kg)(2,"UseDevconTicket failed.",d.message),(0,e.kg)(3,d),n(new Error("Failed to create UseTicket. "+d.message)),[3,4];case 4:return[2]}}))}))},t}(),m=i(79896),b=i(96858),v=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))},w=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?"?"+window.location.hash.substring(1):window.location.search;this.urlParams=new URLSearchParams(t);var r=this.getDataFromQuery("evtid"),n=this.getDataFromQuery("action");switch((0,e.kg)(2,"Outlet received event ID "+r+" action "+n),n!==l.gF.MAGIC_URL&&this.sendCookieCheck(r),n){case l.gF.GET_ISSUER_TOKENS:this.sendTokens(r);break;case l.gF.GET_PROOF:var i=this.getDataFromQuery("token"),o=this.getDataFromQuery("wallet"),a=this.getDataFromQuery("address");(0,e.Sg)(i,"unsigned token is missing"),this.sendTokenProof(r,i,a,o);break;default:localStorage.setItem("cookie-support-check","test"),this.sendCookieCheck(r);var c=this.tokenConfig,u=c.tokenUrlName,f=c.tokenSecretName,h=c.tokenIdName,d=c.itemStorageKey;try{var p=function(t,e,r,n,i){void 0===i&&(i=null),null===i&&(i=new URLSearchParams(window.location.search));var o=i.get(t),a=i.get(e),c=i.get(r)||"";if(!o||!a)throw new Error("Incomplete token params in URL.");var u=s(n),l=!0,f=u.tokens.map((function(t){return t.token===o&&(l=!1),t}));if(l)return f.push({token:o,secret:a,id:decodeURIComponent(c),magic_link:window.location.href}),f;throw new Error("Token already added.")}(u,f,h,d,this.urlParams);!function(t,e){t&&localStorage.setItem(e,JSON.stringify(t))}(p,d);var g=new Event("tokensupdated");document.body.dispatchEvent(g),this.sendTokens(r)}catch(t){this.sendErrorResponse(r,t.message)}}},t.prototype.sendCookieCheck=function(t){this.sendMessageResponse({evtid:t,evt:f.k.COOKIE_CHECK,data:{thirdPartyCookies:localStorage.getItem("cookie-support-check")}})},t.prototype.prepareTokenOutput=function(t){var r,n,i,o,s=localStorage.getItem(this.tokenConfig.itemStorageKey);return s?function(t,e){void 0===e&&(e=[]);var r=[];if(t.length&&"object"==typeof e&&Object.keys(e).length){var n=Object.keys(e);return t.forEach((function(t){var i=1;n.forEach((function(r){t[r]&&t[r].toString()!==e[r].toString()&&(i=0)})),i&&r.push(t)})),r}return t}((r=s,n=this.tokenConfig.tokenParser,i=this.tokenConfig.unsignedTokenDataName,(o=JSON.parse(r)).length?o.map((function(t){if(t.token){var r=new n((0,e.Ov)(t.token).buffer);if(r&&r[i])return a(r[i])}})):[]),t):[]},t.prototype.sendTokenProof=function(t,r,n,i){return v(this,void 0,void 0,(function(){var o,s,a,u;return w(this,(function(f){switch(f.label){case 0:if(!r)return[2,"error"];o=JSON.parse(r),f.label=1;case 1:return f.trys.push([1,4,,5]),[4,c(o,this.tokenConfig)];case 2:return s=f.sent(),[4,new y(this,t,this.tokenConfig,s,n,i).authenticate()];case 3:return a=f.sent(),this.sendMessageResponse({evtid:t,evt:l.AJ.PROOF,data:{issuer:this.tokenConfig.collectionID,proof:a}}),[3,5];case 4:return u=f.sent(),(0,e.kg)(2,u),this.sendErrorResponse(t,u.message),[3,5];case 5:return[2]}}))}))},t.prototype.sendTokens=function(t){var e=this.prepareTokenOutput(this.getFilter());this.sendMessageResponse({evtid:t,evt:l.AJ.ISSUER_TOKENS,data:{issuer:this.tokenConfig.collectionID,tokens:e}})},t.prototype.sendErrorResponse=function(t,e){this.sendMessageResponse({evtid:t,evt:f.k.ERROR,errors:[e]})},t.prototype.sendMessageResponse=function(t){var e;document.referrer&&((e=window.opener?window.opener:window.parent)&&e.postMessage(t,"*"))},t}()})(),o})())); \ No newline at end of file