@dodoex/wallet-web3 0.5.4 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/__tslib-6e4ae2f5.js +1 -0
  2. package/dist/{alchemy-provider-5870b6fa-7183581f.js → alchemy-provider-5870b6fa-bb821a34.js} +1 -1
  3. package/dist/{alchemy-websocket-provider-213da986-d5a91aac.js → alchemy-websocket-provider-213da986-702b5398.js} +1 -1
  4. package/dist/{blocto-0ec2fc36.js → blocto-c38e644a.js} +1 -1
  5. package/dist/browser-3f7e560e.js +1 -0
  6. package/dist/{ccip-d1141d3a.js → ccip-86a505f2.js} +1 -1
  7. package/dist/cjs/__tslib-44b18af7.cjs +1 -0
  8. package/dist/cjs/{alchemy-provider-5870b6fa-94b8a05d.cjs → alchemy-provider-5870b6fa-38f9ed80.cjs} +1 -1
  9. package/dist/cjs/{alchemy-websocket-provider-213da986-cb2dca69.cjs → alchemy-websocket-provider-213da986-fb48ef07.cjs} +1 -1
  10. package/dist/cjs/{blocto-c4470598.cjs → blocto-7eb7575b.cjs} +1 -1
  11. package/dist/cjs/browser-d0e333da.cjs +1 -0
  12. package/dist/cjs/{ccip-466d4e59.cjs → ccip-a63a44a2.cjs} +1 -1
  13. package/dist/cjs/{draggabilly-53856a31.cjs → draggabilly-76e13056.cjs} +1 -1
  14. package/dist/cjs/id-749531a6.cjs +1 -0
  15. package/dist/cjs/{index-76cccf0c.cjs → index-0029a709.cjs} +1 -1
  16. package/dist/cjs/index-10979fb2.cjs +1 -0
  17. package/dist/cjs/{index-86ef4f22.cjs → index-3617a04a.cjs} +1 -1
  18. package/dist/cjs/index-563a38d7.cjs +27 -0
  19. package/dist/cjs/{index-9d9946f3.cjs → index-56a82537.cjs} +7 -7
  20. package/dist/cjs/index-6c5027af.cjs +15 -0
  21. package/dist/cjs/index-7eb41eb1.cjs +2 -0
  22. package/dist/cjs/{index-c4c73f44.cjs → index-a19ffa92.cjs} +1 -1
  23. package/dist/cjs/{index-6aa1755b.cjs → index-aa28e9f9.cjs} +2 -2
  24. package/dist/cjs/index-b64e1d7e.cjs +1 -0
  25. package/dist/cjs/{index-9075d9c2.cjs → index-cc156a43.cjs} +1 -1
  26. package/dist/cjs/{index-56fff369.cjs → index-df00325f.cjs} +1 -1
  27. package/dist/cjs/{index-63b5eebb.cjs → index-e85aaa9d.cjs} +1 -1
  28. package/dist/cjs/index-ef8a01c5.cjs +16 -0
  29. package/dist/cjs/index.cjs +1 -1
  30. package/dist/cjs/index.es-f6621022.cjs +9 -0
  31. package/dist/cjs/{interface-d5ec613a.cjs → interface-d50ce16b.cjs} +1 -1
  32. package/dist/cjs/lib-typedarrays-82021648.cjs +1 -0
  33. package/dist/cjs/mm-install-modal_2.entry-4950a7e9.cjs +1 -0
  34. package/dist/cjs/{portis-9af3489b.cjs → portis-3a895975.cjs} +1 -1
  35. package/dist/cjs/rainbow-6579e86d.cjs +1 -0
  36. package/dist/cjs/sha224-ed46e71e.cjs +1 -0
  37. package/dist/cjs/{sha256-6785be1d.cjs → sha256-d1b2312d.cjs} +1 -1
  38. package/dist/cjs/{typed-data-a102eb38.cjs → typed-data-460b86be.cjs} +1 -1
  39. package/dist/cjs/uAuth-37ec9004.cjs +1 -0
  40. package/dist/cjs/{walletConnect-d4368503.cjs → walletConnect-333618c1.cjs} +1 -1
  41. package/dist/cjs/{walletLink-1b5e5056.cjs → walletLink-1bbb754c.cjs} +2 -2
  42. package/dist/{draggabilly-96bd4e8a.js → draggabilly-9c13a931.js} +1 -1
  43. package/dist/id-72e0c1a1.js +1 -0
  44. package/dist/index-06f6f79c.js +27 -0
  45. package/dist/{index-29d50f5e.js → index-2c7120ea.js} +1 -1
  46. package/dist/index-3354aa33.js +15 -0
  47. package/dist/{index-d9690f1f.js → index-352a03ce.js} +1 -1
  48. package/dist/{index-de489272.js → index-46da6d5f.js} +7 -7
  49. package/dist/{index-ec77233b.js → index-4b6b9842.js} +1 -1
  50. package/dist/{index-9a72391b.js → index-69adc195.js} +1 -1
  51. package/dist/index-754d059b.js +1 -0
  52. package/dist/index-7b0eeb5c.js +1 -0
  53. package/dist/index-a3d1a073.js +16 -0
  54. package/dist/{index-aa09ffe2.js → index-b0e82b69.js} +1 -1
  55. package/dist/{index-b27ec2be.js → index-badfa46e.js} +1 -1
  56. package/dist/{index-25f5dd77.js → index-e3d55f2e.js} +1 -1
  57. package/dist/index-fcb3d760.js +2 -0
  58. package/dist/index.es-2327b5db.js +9 -0
  59. package/dist/index.js +1 -1
  60. package/dist/{interface-501ba1ce.js → interface-367d293e.js} +1 -1
  61. package/dist/lib-typedarrays-3210a74e.js +1 -0
  62. package/dist/mm-install-modal_2.entry-e9e33358.js +1 -0
  63. package/dist/{portis-59e75b95.js → portis-0126b01f.js} +1 -1
  64. package/dist/rainbow-46822247.js +1 -0
  65. package/dist/sha224-58bed7be.js +1 -0
  66. package/dist/{sha256-cdb06d7c.js → sha256-ad86865d.js} +1 -1
  67. package/dist/{typed-data-d46cb643.js → typed-data-cc0c21ba.js} +1 -1
  68. package/dist/uAuth-e9b4faa5.js +1 -0
  69. package/dist/{walletConnect-23af88ec.js → walletConnect-a7ad9f23.js} +1 -1
  70. package/dist/{walletLink-782b101e.js → walletLink-a6e7bead.js} +2 -2
  71. package/package.json +2 -2
  72. package/dist/cjs/id-07cfd31e.cjs +0 -1
  73. package/dist/cjs/index-af8c9c8e.cjs +0 -15
  74. package/dist/cjs/index-b82ccec9.cjs +0 -9
  75. package/dist/cjs/index.es-d9e722ea.cjs +0 -9
  76. package/dist/cjs/lib-typedarrays-afe9c8e7.cjs +0 -1
  77. package/dist/cjs/rainbow-4b5d0839.cjs +0 -1
  78. package/dist/cjs/sha224-8f3f5508.cjs +0 -1
  79. package/dist/cjs/uAuth-22dae0a4.cjs +0 -1
  80. package/dist/cjs/v4-3e682452.cjs +0 -1
  81. package/dist/id-6dc2a6aa.js +0 -1
  82. package/dist/index-0534a22e.js +0 -15
  83. package/dist/index-66392fdc.js +0 -9
  84. package/dist/index.es-d60f6859.js +0 -9
  85. package/dist/lib-typedarrays-5ac4ff04.js +0 -1
  86. package/dist/rainbow-2c04e9df.js +0 -1
  87. package/dist/sha224-b20bdf3b.js +0 -1
  88. package/dist/uAuth-a93ad1ec.js +0 -1
  89. package/dist/v4-95658a31.js +0 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{b8 as ChainId,H as HD_PATH_LIST,b4 as OpenBlockIframeWallet,ar as WalletType,bC as WatchResult,b3 as allWalletList,b1 as allWalletObject,bI as approve,a as convertTransactionType,z as convertWeb3Provider,b0 as default,by as getAlchemyConnector,bn as getAlchemyPackage,bv as getBinanceConnector,bk as getBinancePackage,bo as getBloctoConnector,bg as getBloctoPackage,bG as getContract,bt as getCyberConnector,bi as getCyberPackage,bD as getEstimateGas,bE as getGasPrice,bb as getGnosisPackage,bP as getIsAndroid,N as getIsIOS,M as getIsMobile,bB as getIsOpenBlockIframe,b7 as getIsolatedEnvironmentWallet,ba as getLedgerUSBPackage,bw as getMetamaskConnector,bl as getMetamaskPackage,bA as getOpenBlockIframeConnector,bp as getPortisConnector,bd as getPortisPackage,bH as getProviderByChain,bh as getRainbowConnectPackage,bs as getRainbowConnector,bx as getSocialLoginConnector,bm as getSocialLoginPackage,bc as getUAuthPackage,bu as getUniPassConnector,bj as getUniPassPackage,br as getWalletConnectConnector,bf as getWalletConnectPackage,b5 as getWalletDisabledState,bq as getWalletLinkConnector,be as getWalletLinkPackage,b6 as getWalletList,bS as getWindow,J as injectedConnect,bT as isAddress,bR as isLargeIOS,bQ as isSmallIOS,bO as isSupportWebHid,bK as personalSign,bz as registerNetworkWithMetamask,bF as sendTransaction,bL as sign,bM as signTransaction,bN as signTypedData,b2 as standaloneList,b9 as standaloneListObject,A as useWalletStore,bJ as watchTx}from"./index-de489272.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/address";import"@ethersproject/abstract-signer";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";
1
+ export{bi as ChainId,H as HD_PATH_LIST,be as OpenBlockIframeWallet,aB as WalletType,bM as WatchResult,bd as allWalletList,bb as allWalletObject,bS as approve,a as convertTransactionType,z as convertWeb3Provider,ba as default,bI as getAlchemyConnector,bx as getAlchemyPackage,bF as getBinanceConnector,bu as getBinancePackage,by as getBloctoConnector,bq as getBloctoPackage,bQ as getContract,bD as getCyberConnector,bs as getCyberPackage,bN as getEstimateGas,bO as getGasPrice,bl as getGnosisPackage,bZ as getIsAndroid,N as getIsIOS,M as getIsMobile,bL as getIsOpenBlockIframe,bh as getIsolatedEnvironmentWallet,bk as getLedgerUSBPackage,bG as getMetamaskConnector,bv as getMetamaskPackage,bK as getOpenBlockIframeConnector,bz as getPortisConnector,bn as getPortisPackage,bR as getProviderByChain,br as getRainbowConnectPackage,bC as getRainbowConnector,bH as getSocialLoginConnector,bw as getSocialLoginPackage,bm as getUAuthPackage,bE as getUniPassConnector,bt as getUniPassPackage,bB as getWalletConnectConnector,bp as getWalletConnectPackage,bf as getWalletDisabledState,bA as getWalletLinkConnector,bo as getWalletLinkPackage,bg as getWalletList,c0 as getWindow,J as injectedConnect,c1 as isAddress,b$ as isLargeIOS,b_ as isSmallIOS,bY as isSupportWebHid,bU as personalSign,bJ as registerNetworkWithMetamask,bP as sendTransaction,bV as sign,bW as signTransaction,bX as signTypedData,bc as standaloneList,bj as standaloneListObject,A as useWalletStore,bT as watchTx}from"./index-46da6d5f.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/address";import"@ethersproject/abstract-signer";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";
@@ -1 +1 @@
1
- import{getAddress as t}from"@ethersproject/address";import{hexConcat as e,concat as r,arrayify as n,hexlify as a,hexZeroPad as s,hexDataSlice as o,isHexString as i}from"@ethersproject/bytes";import{i as u}from"./id-6dc2a6aa.js";import{L as c,B as l,t as h,b as m,k as p}from"./index-de489272.js";import{defineReadOnly as d,Description as g,getStatic as f}from"@ethersproject/properties";import{MaxUint256 as y,One as b,NegativeOne as w,Zero as E}from"@ethersproject/constants";const v="abi/5.7.0",_=new c(v),A={};let x={calldata:!0,memory:!0,storage:!0},O={calldata:!0,memory:!0};function S(t,e){if("bytes"===t||"string"===t){if(x[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&O[e])return!0;return(x[e]||"payable"===e)&&_.throwArgumentError("invalid modifier","name",e),!1}function j(t,e){for(let r in e)d(t,r,e[r])}const N=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),T=new RegExp(/^(.*)\[([0-9]*)\]$/);class F{constructor(t,e){t!==A&&_.throwError("use fromString",c.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),j(this,e);let r=this.type.match(T);j(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:F.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=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.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!==N.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===N.full?", ":",")+")"):e+=this.type,t!==N.sighash&&(!0===this.indexed&&(e+=" indexed"),t===N.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?F.fromString(t,e):F.fromObject(t)}static fromObject(t){return F.isParamType(t)?t:new F(A,{name:t.name||null,type:$(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(F.fromObject):null})}static fromString(t,e){return r=function(t,e){let r=t;function n(e){_.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function a(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let s={type:"",name:"",state:{allowType:!0}},o=s;for(let r=0;r<t.length;r++){let s=t[r];switch(s){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||n(r),o.state.allowType=!1,o.type=$(o.type),o.components=[a(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(e||n(r),o.indexed=!0,o.name=""),S(o.type,o.name)&&(o.name=""),o.type=$(o.type);let t=o;o=o.parent,o||n(r),delete t.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(e||n(r),o.indexed=!0,o.name=""),S(o.type,o.name)&&(o.name=""),o.type=$(o.type);let i=a(o.parent);o.parent.components.push(i),delete o.parent,o=i;break;case" ":o.state.allowType&&""!==o.type&&(o.type=$(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(e||n(r),o.indexed&&n(r),o.indexed=!0,o.name=""):S(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(r),o.type+=s,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(r),o.type+=s,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=s,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=s,delete o.state.allowArray):o.state.readArray?o.type+=s:n(r)}}return o.parent&&_.throwArgumentError("unexpected eof","param",t),delete s.state,"indexed"===o.name?(e||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):S(o.type,o.name)&&(o.name=""),s.type=$(s.type),s}(t,!!e),F.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(t){return!(null==t||!t._isParamType)}}function V(t,e){return function(t){t=t.trim();let e=[],r="",n=0;for(let a=0;a<t.length;a++){let s=t[a];","===s&&0===n?(e.push(r),r=""):(r+=s,"("===s?n++:")"===s&&(n--,-1===n&&_.throwArgumentError("unbalanced parenthesis","value",t)))}r&&e.push(r);return e}(t).map((t=>F.fromString(t,e)))}class M{constructor(t,e){t!==A&&_.throwError("use a static from method",c.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),j(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 L.fromObject(t);case"event":return z.fromObject(t);case"constructor":return k.fromObject(t);case"error":return U.fromObject(t);case"fallback":case"receive":return null}return _.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]?z.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?L.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?k.fromString(t.trim()):"error"===t.split(" ")[0]?U.fromString(t.substring(5).trim()):_.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!(!t||!t._isFragment)}}class z extends M{format(t){if(t||(t=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.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!==N.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===N.full?", ":",")+") ",t!==N.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?z.fromString(t):z.fromObject(t)}static fromObject(t){if(z.isEventFragment(t))return t;"event"!==t.type&&_.throwArgumentError("invalid event object","value",t);const e={name:D(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(F.fromObject):[],type:"event"};return new z(A,e)}static fromString(t){let e=t.match(J);e||_.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:_.warn("unknown modifier: "+t)}})),z.fromObject({name:e[1].trim(),anonymous:r,inputs:V(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function R(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&_.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||_.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=l.from(r[1]),r[0]):t}function C(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 P(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&&_.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&_.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||_.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&&_.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&&_.throwArgumentError("unable to determine stateMutability","value",t),e}class k extends M{format(t){if(t||(t=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.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===N.sighash&&_.throwError("cannot format a constructor for sighash",c.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map((e=>e.format(t))).join(t===N.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?k.fromString(t):k.fromObject(t)}static fromObject(t){if(k.isConstructorFragment(t))return t;"constructor"!==t.type&&_.throwArgumentError("invalid constructor object","value",t);let e=P(t);e.constant&&_.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(F.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?l.from(t.gas):null};return new k(A,r)}static fromString(t){let e={type:"constructor"},r=(t=R(t,e)).match(J);return r&&"constructor"===r[1].trim()||_.throwArgumentError("invalid constructor string","value",t),e.inputs=V(r[2].trim(),!1),C(r[3].trim(),e),k.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class L extends k{format(t){if(t||(t=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.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!==N.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===N.full?", ":",")+") ",t!==N.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?L.fromString(t):L.fromObject(t)}static fromObject(t){if(L.isFunctionFragment(t))return t;"function"!==t.type&&_.throwArgumentError("invalid function object","value",t);let e=P(t);const r={type:t.type,name:D(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(F.fromObject):[],outputs:t.outputs?t.outputs.map(F.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?l.from(t.gas):null};return new L(A,r)}static fromString(t){let e={type:"function"},r=(t=R(t,e)).split(" returns ");r.length>2&&_.throwArgumentError("invalid function string","value",t);let n=r[0].match(J);if(n||_.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&D(e.name),e.inputs=V(n[2],!1),C(n[3].trim(),e),r.length>1){let n=r[1].match(J);""==n[1].trim()&&""==n[3].trim()||_.throwArgumentError("unexpected tokens","value",t),e.outputs=V(n[2],!1)}else e.outputs=[];return L.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function I(t){const e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||_.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class U extends M{format(t){if(t||(t=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==N.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===N.full?", ":",")+") ",e.trim()}static from(t){return"string"==typeof t?U.fromString(t):U.fromObject(t)}static fromObject(t){if(U.isErrorFragment(t))return t;"error"!==t.type&&_.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:D(t.name),inputs:t.inputs?t.inputs.map(F.fromObject):[]};return I(new U(A,e))}static fromString(t){let e={type:"error"},r=t.match(J);return r||_.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&D(e.name),e.inputs=V(r[2],!1),I(U.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function $(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const B=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function D(t){return t&&t.match(B)||_.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const J=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const W=new c(v);function G(t){const e=[],r=function(t,n){if(Array.isArray(n))for(let a in n){const s=t.slice();s.push(a);try{r(s,n[a])}catch(t){e.push({path:s,error:t})}}};return r([],t),e}class Z{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){W.throwArgumentError(t,this.localName,e)}}class H{constructor(t){d(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return e(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(r(t._data))}writeBytes(t){let e=n(t);const a=e.length%this.wordSize;return a&&(e=r([e,this._padding.slice(a)])),this._writeData(e)}_getValue(t){let e=n(l.from(t));return e.length>this.wordSize&&W.throwError("value out-of-bounds",c.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=r([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 X{constructor(t,e,r,a){d(this,"_data",n(t)),d(this,"wordSize",e||32),d(this,"_coerceFunc",r),d(this,"allowLoose",a),this._offset=0}get data(){return a(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):X.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:W.throwError("data out-of-bounds",c.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new X(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 l.from(this.readBytes(this.wordSize))}}class q extends Z{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=t(r)}catch(t){this._throwError(t.message,r)}return e.writeValue(r)}decode(e){return t(s(e.readValue().toHexString(),20))}}class K extends Z{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 Q=new c(v);function Y(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||Q.throwError("cannot encode object for signature with missing names",c.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]&&Q.throwError("cannot encode object for signature with duplicate names",c.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]=!0,r[n]}))}else Q.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Q.throwArgumentError("types/value length mismatch","tuple",r);let a=new H(t.wordSize),s=new H(t.wordSize),o=[];e.forEach(((t,e)=>{let r=n[e];if(t.dynamic){let e=s.length;t.encode(s,r);let n=a.writeUpdatableValue();o.push((t=>{n(t+e)}))}else t.encode(a,r)})),o.forEach((t=>{t(a.length)}));let i=t.appendWriter(a);return i+=t.appendWriter(s),i}function tt(t,e){let r=[],n=t.subReader(0);e.forEach((e=>{let a=null;if(e.dynamic){let r=t.readValue(),s=n.subReader(r.toNumber());try{a=e.decode(s)}catch(t){if(t.code===c.errors.BUFFER_OVERRUN)throw t;a=t,a.baseType=e.name,a.name=e.localName,a.type=e.type}}else try{a=e.decode(t)}catch(t){if(t.code===c.errors.BUFFER_OVERRUN)throw t;a=t,a.baseType=e.name,a.name=e.localName,a.type=e.type}null!=a&&r.push(a)}));const a=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!==a[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const s=r[e];s instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw s}}):r[n]=s}));for(let t=0;t<r.length;t++){const e=r[t];e instanceof Error&&Object.defineProperty(r,t,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(r)}class et extends Z{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;r<this.length;r++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),Q.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let t=0;t<e.length;t++)n.push(this.coder);return Y(t,n,e)}decode(t){let e=this.length;-1===e&&(e=t.readValue().toNumber(),32*e>t._data.length&&Q.throwError("insufficient data length",c.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let r=[];for(let t=0;t<e;t++)r.push(new K(this.coder));return t.coerce(this.name,tt(t,r))}}class rt extends Z{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class nt extends Z{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=n(e);let r=t.writeValue(e.length);return r+=t.writeBytes(e),r}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class at extends nt{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,a(super.decode(t)))}}class st extends Z{constructor(t,e){let r="bytes"+String(t);super(r,r,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let r=n(e);return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return t.coerce(this.name,a(t.readBytes(this.size)))}}class ot extends Z{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}class it extends Z{constructor(t,e,r){const n=(e?"int":"uint")+8*t;super(n,n,r,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let r=l.from(e),n=y.mask(8*t.wordSize);if(this.signed){let t=n.mask(8*this.size-1);(r.gt(t)||r.lt(t.add(b).mul(w)))&&this._throwError("value out-of-bounds",e)}else(r.lt(E)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(r)}decode(t){let e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}class ut extends nt{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,h(e))}decode(t){return m(super.decode(t))}}class ct extends Z{constructor(t,e){let r=!1;const n=[];t.forEach((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 a=r.localName;a&&1===e[a]&&("length"===a&&(a="_length"),null==t[a]&&(t[a]=t[n]))})),Object.freeze(t)}encode(t,e){return Y(t,this.coders,e)}decode(t){return t.coerce(this.name,tt(t,this.coders))}}const lt=new c(v),ht=new RegExp(/^bytes([0-9]*)$/),mt=new RegExp(/^(u?int)([0-9]*)$/);class pt{constructor(t){d(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new q(t.name);case"bool":return new rt(t.name);case"string":return new ut(t.name);case"bytes":return new at(t.name);case"array":return new et(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new ct((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new ot(t.name)}let e=t.type.match(mt);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&lt.throwArgumentError("invalid "+e[1]+" bit length","param",t),new it(r/8,"int"===e[1],t.name)}if(e=t.type.match(ht),e){let r=parseInt(e[1]);return(0===r||r>32)&&lt.throwArgumentError("invalid bytes length","param",t),new st(r,t.name)}return lt.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new X(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new H(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(F.from(t))));return new ct(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&lt.throwError("types/values length mismatch",c.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const r=t.map((t=>this._getCoder(F.from(t)))),n=new ct(r,"_"),a=this._getWriter();return n.encode(a,e),a.data}decode(t,e,r){const a=t.map((t=>this._getCoder(F.from(t))));return new ct(a,"_").decode(this._getReader(n(e),r))}}const dt=new pt,gt=new c(v);class ft extends g{}class yt extends g{}class bt extends g{}class wt extends g{static isIndexed(t){return!(!t||!t._isIndexed)}}const Et={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function vt(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class _t{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,d(this,"fragments",e.map((t=>M.from(t))).filter((t=>null!=t))),d(this,"_abiCoder",f(new.target,"getAbiCoder")()),d(this,"functions",{}),d(this,"errors",{}),d(this,"events",{}),d(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void gt.warn("duplicate definition - constructor"):void d(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]?gt.warn("duplicate definition - "+r):e[r]=t})),this.deploy||d(this,"deploy",k.from({payable:!1,type:"constructor"})),d(this,"_isInterface",!0)}format(t){t||(t=N.full),t===N.sighash&&gt.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===N.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return dt}static getAddress(e){return t(e)}static getSighash(t){return o(u(t.format()),0,4)}static getEventTopic(t){return u(t.format())}getFunction(t){if(i(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];gt.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?gt.throwArgumentError("no matching function","name",e):r.length>1&&gt.throwArgumentError("multiple matching functions","name",e),this.functions[r[0]]}const e=this.functions[L.fromString(t).format()];return e||gt.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(i(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];gt.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?gt.throwArgumentError("no matching event","name",e):r.length>1&&gt.throwArgumentError("multiple matching events","name",e),this.events[r[0]]}const e=this.events[z.fromString(t).format()];return e||gt.throwArgumentError("no matching event","signature",t),e}getError(t){if(i(t)){const e=f(this.constructor,"getSighash");for(const r in this.errors){if(t===e(this.errors[r]))return this.errors[r]}gt.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?gt.throwArgumentError("no matching error","name",e):r.length>1&&gt.throwArgumentError("multiple matching errors","name",e),this.errors[r[0]]}const e=this.errors[L.fromString(t).format()];return e||gt.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 f(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),f(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=n(e);return a(r.slice(0,4))!==this.getSighash(t)&&gt.throwArgumentError(`data signature does not match error ${t.name}.`,"data",a(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),a(r([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const r=n(e);return a(r.slice(0,4))!==this.getSighash(t)&&gt.throwArgumentError(`data signature does not match function ${t.name}.`,"data",a(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),a(r([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=n(e),s=null,o="",i=null,u=null,l=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(t){}break;case 4:{const t=a(r.slice(0,4)),e=Et[t];if(e)i=this._abiCoder.decode(e.inputs,r.slice(4)),u=e.name,l=e.signature,e.reason&&(s=i[0]),"Error"===u?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(i[0])}`:"Panic"===u&&(o=`; VM Exception while processing transaction: reverted with panic code ${i[0]}`);else try{const e=this.getError(t);i=this._abiCoder.decode(e.inputs,r.slice(4)),u=e.name,l=e.format()}catch(t){}break}}return gt.throwError("call revert exception"+o,c.errors.CALL_EXCEPTION,{method:t.format(),data:a(e),errorArgs:i,errorName:u,errorSignature:l,reason:s})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),a(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&gt.throwError("too many arguments for "+t.format(),c.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));const n=(t,e)=>"string"===t.type?u(e):"bytes"===t.type?p(a(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=l.from(e).toHexString()),"address"===t.type&&this._abiCoder.encode(["address"],[e]),s(a(e),32));for(e.forEach(((e,a)=>{let s=t.inputs[a];s.indexed?null==e?r.push(null):"array"===s.baseType||"tuple"===s.baseType?gt.throwArgumentError("filtering with tuples or arrays not supported","contract."+s.name,e):Array.isArray(e)?r.push(e.map((t=>n(s,t)))):r.push(n(s,e)):null!=e&&gt.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+s.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=[],a=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&gt.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,s)=>{const o=e[s];if(t.indexed)if("string"===t.type)r.push(u(o));else if("bytes"===t.type)r.push(p(o));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([t.type],[o]))}else n.push(t),a.push(o)})),{data:this._abiCoder.encode(n,a),topics:r}}decodeEventLog(t,e,n){if("string"==typeof t&&(t=this.getEvent(t)),null!=n&&!t.anonymous){let e=this.getEventTopic(t);i(n[0],32)&&n[0].toLowerCase()===e||gt.throwError("fragment/topic mismatch",c.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:n[0]}),n=n.slice(1)}let a=[],s=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(a.push(F.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(a.push(t),o.push(!1)):(s.push(t),o.push(!1))}));let u=null!=n?this._abiCoder.decode(a,r(n)):null,l=this._abiCoder.decode(s,e,!0),h=[],m=0,p=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==u)h[e]=new wt({_isIndexed:!0,hash:null});else if(o[e])h[e]=new wt({_isIndexed:!0,hash:u[p++]});else try{h[e]=u[p++]}catch(t){h[e]=t}else try{h[e]=l[m++]}catch(t){h[e]=t}if(t.name&&null==h[t.name]){const r=h[e];r instanceof Error?Object.defineProperty(h,t.name,{enumerable:!0,get:()=>{throw vt(`property ${JSON.stringify(t.name)}`,r)}}):h[t.name]=r}}));for(let t=0;t<h.length;t++){const e=h[t];e instanceof Error&&Object.defineProperty(h,t,{enumerable:!0,get:()=>{throw vt(`index ${t}`,e)}})}return Object.freeze(h)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new yt({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:l.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new ft({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=a(t);let r=this.getError(e.substring(0,10).toLowerCase());return r?new bt({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)}}export{pt as A,k as C,U as E,M as F,_t as I,ft as L,F as P,yt as T,z as a,L as b,N as c,dt as d,G as e,wt as f};
1
+ import{getAddress as t}from"@ethersproject/address";import{hexConcat as e,concat as r,arrayify as n,hexlify as a,hexZeroPad as s,hexDataSlice as o,isHexString as i}from"@ethersproject/bytes";import{i as u}from"./id-72e0c1a1.js";import{L as c,B as l,t as h,b as m,k as p}from"./index-46da6d5f.js";import{defineReadOnly as d,Description as g,getStatic as f}from"@ethersproject/properties";import{MaxUint256 as y,One as b,NegativeOne as w,Zero as E}from"@ethersproject/constants";const v="abi/5.7.0",_=new c(v),A={};let x={calldata:!0,memory:!0,storage:!0},O={calldata:!0,memory:!0};function S(t,e){if("bytes"===t||"string"===t){if(x[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&O[e])return!0;return(x[e]||"payable"===e)&&_.throwArgumentError("invalid modifier","name",e),!1}function j(t,e){for(let r in e)d(t,r,e[r])}const N=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),T=new RegExp(/^(.*)\[([0-9]*)\]$/);class F{constructor(t,e){t!==A&&_.throwError("use fromString",c.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),j(this,e);let r=this.type.match(T);j(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:F.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=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.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!==N.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===N.full?", ":",")+")"):e+=this.type,t!==N.sighash&&(!0===this.indexed&&(e+=" indexed"),t===N.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?F.fromString(t,e):F.fromObject(t)}static fromObject(t){return F.isParamType(t)?t:new F(A,{name:t.name||null,type:$(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(F.fromObject):null})}static fromString(t,e){return r=function(t,e){let r=t;function n(e){_.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function a(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let s={type:"",name:"",state:{allowType:!0}},o=s;for(let r=0;r<t.length;r++){let s=t[r];switch(s){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||n(r),o.state.allowType=!1,o.type=$(o.type),o.components=[a(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(e||n(r),o.indexed=!0,o.name=""),S(o.type,o.name)&&(o.name=""),o.type=$(o.type);let t=o;o=o.parent,o||n(r),delete t.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(e||n(r),o.indexed=!0,o.name=""),S(o.type,o.name)&&(o.name=""),o.type=$(o.type);let i=a(o.parent);o.parent.components.push(i),delete o.parent,o=i;break;case" ":o.state.allowType&&""!==o.type&&(o.type=$(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(e||n(r),o.indexed&&n(r),o.indexed=!0,o.name=""):S(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(r),o.type+=s,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(r),o.type+=s,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=s,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=s,delete o.state.allowArray):o.state.readArray?o.type+=s:n(r)}}return o.parent&&_.throwArgumentError("unexpected eof","param",t),delete s.state,"indexed"===o.name?(e||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):S(o.type,o.name)&&(o.name=""),s.type=$(s.type),s}(t,!!e),F.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(t){return!(null==t||!t._isParamType)}}function V(t,e){return function(t){t=t.trim();let e=[],r="",n=0;for(let a=0;a<t.length;a++){let s=t[a];","===s&&0===n?(e.push(r),r=""):(r+=s,"("===s?n++:")"===s&&(n--,-1===n&&_.throwArgumentError("unbalanced parenthesis","value",t)))}r&&e.push(r);return e}(t).map((t=>F.fromString(t,e)))}class M{constructor(t,e){t!==A&&_.throwError("use a static from method",c.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),j(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 L.fromObject(t);case"event":return z.fromObject(t);case"constructor":return k.fromObject(t);case"error":return U.fromObject(t);case"fallback":case"receive":return null}return _.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]?z.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?L.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?k.fromString(t.trim()):"error"===t.split(" ")[0]?U.fromString(t.substring(5).trim()):_.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!(!t||!t._isFragment)}}class z extends M{format(t){if(t||(t=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.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!==N.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===N.full?", ":",")+") ",t!==N.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?z.fromString(t):z.fromObject(t)}static fromObject(t){if(z.isEventFragment(t))return t;"event"!==t.type&&_.throwArgumentError("invalid event object","value",t);const e={name:D(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(F.fromObject):[],type:"event"};return new z(A,e)}static fromString(t){let e=t.match(J);e||_.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:_.warn("unknown modifier: "+t)}})),z.fromObject({name:e[1].trim(),anonymous:r,inputs:V(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function R(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&_.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||_.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=l.from(r[1]),r[0]):t}function C(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 P(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&&_.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&_.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||_.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&&_.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&&_.throwArgumentError("unable to determine stateMutability","value",t),e}class k extends M{format(t){if(t||(t=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.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===N.sighash&&_.throwError("cannot format a constructor for sighash",c.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map((e=>e.format(t))).join(t===N.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?k.fromString(t):k.fromObject(t)}static fromObject(t){if(k.isConstructorFragment(t))return t;"constructor"!==t.type&&_.throwArgumentError("invalid constructor object","value",t);let e=P(t);e.constant&&_.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(F.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?l.from(t.gas):null};return new k(A,r)}static fromString(t){let e={type:"constructor"},r=(t=R(t,e)).match(J);return r&&"constructor"===r[1].trim()||_.throwArgumentError("invalid constructor string","value",t),e.inputs=V(r[2].trim(),!1),C(r[3].trim(),e),k.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class L extends k{format(t){if(t||(t=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.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!==N.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===N.full?", ":",")+") ",t!==N.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?L.fromString(t):L.fromObject(t)}static fromObject(t){if(L.isFunctionFragment(t))return t;"function"!==t.type&&_.throwArgumentError("invalid function object","value",t);let e=P(t);const r={type:t.type,name:D(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(F.fromObject):[],outputs:t.outputs?t.outputs.map(F.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?l.from(t.gas):null};return new L(A,r)}static fromString(t){let e={type:"function"},r=(t=R(t,e)).split(" returns ");r.length>2&&_.throwArgumentError("invalid function string","value",t);let n=r[0].match(J);if(n||_.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&D(e.name),e.inputs=V(n[2],!1),C(n[3].trim(),e),r.length>1){let n=r[1].match(J);""==n[1].trim()&&""==n[3].trim()||_.throwArgumentError("unexpected tokens","value",t),e.outputs=V(n[2],!1)}else e.outputs=[];return L.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function I(t){const e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||_.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class U extends M{format(t){if(t||(t=N.sighash),N[t]||_.throwArgumentError("invalid format type","format",t),t===N.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==N.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===N.full?", ":",")+") ",e.trim()}static from(t){return"string"==typeof t?U.fromString(t):U.fromObject(t)}static fromObject(t){if(U.isErrorFragment(t))return t;"error"!==t.type&&_.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:D(t.name),inputs:t.inputs?t.inputs.map(F.fromObject):[]};return I(new U(A,e))}static fromString(t){let e={type:"error"},r=t.match(J);return r||_.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&D(e.name),e.inputs=V(r[2],!1),I(U.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function $(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const B=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function D(t){return t&&t.match(B)||_.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const J=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const W=new c(v);function G(t){const e=[],r=function(t,n){if(Array.isArray(n))for(let a in n){const s=t.slice();s.push(a);try{r(s,n[a])}catch(t){e.push({path:s,error:t})}}};return r([],t),e}class Z{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){W.throwArgumentError(t,this.localName,e)}}class H{constructor(t){d(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return e(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(r(t._data))}writeBytes(t){let e=n(t);const a=e.length%this.wordSize;return a&&(e=r([e,this._padding.slice(a)])),this._writeData(e)}_getValue(t){let e=n(l.from(t));return e.length>this.wordSize&&W.throwError("value out-of-bounds",c.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=r([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 X{constructor(t,e,r,a){d(this,"_data",n(t)),d(this,"wordSize",e||32),d(this,"_coerceFunc",r),d(this,"allowLoose",a),this._offset=0}get data(){return a(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):X.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:W.throwError("data out-of-bounds",c.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new X(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 l.from(this.readBytes(this.wordSize))}}class q extends Z{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=t(r)}catch(t){this._throwError(t.message,r)}return e.writeValue(r)}decode(e){return t(s(e.readValue().toHexString(),20))}}class K extends Z{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 Q=new c(v);function Y(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||Q.throwError("cannot encode object for signature with missing names",c.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]&&Q.throwError("cannot encode object for signature with duplicate names",c.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]=!0,r[n]}))}else Q.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Q.throwArgumentError("types/value length mismatch","tuple",r);let a=new H(t.wordSize),s=new H(t.wordSize),o=[];e.forEach(((t,e)=>{let r=n[e];if(t.dynamic){let e=s.length;t.encode(s,r);let n=a.writeUpdatableValue();o.push((t=>{n(t+e)}))}else t.encode(a,r)})),o.forEach((t=>{t(a.length)}));let i=t.appendWriter(a);return i+=t.appendWriter(s),i}function tt(t,e){let r=[],n=t.subReader(0);e.forEach((e=>{let a=null;if(e.dynamic){let r=t.readValue(),s=n.subReader(r.toNumber());try{a=e.decode(s)}catch(t){if(t.code===c.errors.BUFFER_OVERRUN)throw t;a=t,a.baseType=e.name,a.name=e.localName,a.type=e.type}}else try{a=e.decode(t)}catch(t){if(t.code===c.errors.BUFFER_OVERRUN)throw t;a=t,a.baseType=e.name,a.name=e.localName,a.type=e.type}null!=a&&r.push(a)}));const a=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!==a[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const s=r[e];s instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw s}}):r[n]=s}));for(let t=0;t<r.length;t++){const e=r[t];e instanceof Error&&Object.defineProperty(r,t,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(r)}class et extends Z{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;r<this.length;r++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),Q.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let t=0;t<e.length;t++)n.push(this.coder);return Y(t,n,e)}decode(t){let e=this.length;-1===e&&(e=t.readValue().toNumber(),32*e>t._data.length&&Q.throwError("insufficient data length",c.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let r=[];for(let t=0;t<e;t++)r.push(new K(this.coder));return t.coerce(this.name,tt(t,r))}}class rt extends Z{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class nt extends Z{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=n(e);let r=t.writeValue(e.length);return r+=t.writeBytes(e),r}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class at extends nt{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,a(super.decode(t)))}}class st extends Z{constructor(t,e){let r="bytes"+String(t);super(r,r,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let r=n(e);return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return t.coerce(this.name,a(t.readBytes(this.size)))}}class ot extends Z{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}class it extends Z{constructor(t,e,r){const n=(e?"int":"uint")+8*t;super(n,n,r,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let r=l.from(e),n=y.mask(8*t.wordSize);if(this.signed){let t=n.mask(8*this.size-1);(r.gt(t)||r.lt(t.add(b).mul(w)))&&this._throwError("value out-of-bounds",e)}else(r.lt(E)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(r)}decode(t){let e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}class ut extends nt{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,h(e))}decode(t){return m(super.decode(t))}}class ct extends Z{constructor(t,e){let r=!1;const n=[];t.forEach((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 a=r.localName;a&&1===e[a]&&("length"===a&&(a="_length"),null==t[a]&&(t[a]=t[n]))})),Object.freeze(t)}encode(t,e){return Y(t,this.coders,e)}decode(t){return t.coerce(this.name,tt(t,this.coders))}}const lt=new c(v),ht=new RegExp(/^bytes([0-9]*)$/),mt=new RegExp(/^(u?int)([0-9]*)$/);class pt{constructor(t){d(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new q(t.name);case"bool":return new rt(t.name);case"string":return new ut(t.name);case"bytes":return new at(t.name);case"array":return new et(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new ct((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new ot(t.name)}let e=t.type.match(mt);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&lt.throwArgumentError("invalid "+e[1]+" bit length","param",t),new it(r/8,"int"===e[1],t.name)}if(e=t.type.match(ht),e){let r=parseInt(e[1]);return(0===r||r>32)&&lt.throwArgumentError("invalid bytes length","param",t),new st(r,t.name)}return lt.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new X(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new H(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(F.from(t))));return new ct(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&lt.throwError("types/values length mismatch",c.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const r=t.map((t=>this._getCoder(F.from(t)))),n=new ct(r,"_"),a=this._getWriter();return n.encode(a,e),a.data}decode(t,e,r){const a=t.map((t=>this._getCoder(F.from(t))));return new ct(a,"_").decode(this._getReader(n(e),r))}}const dt=new pt,gt=new c(v);class ft extends g{}class yt extends g{}class bt extends g{}class wt extends g{static isIndexed(t){return!(!t||!t._isIndexed)}}const Et={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function vt(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class _t{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,d(this,"fragments",e.map((t=>M.from(t))).filter((t=>null!=t))),d(this,"_abiCoder",f(new.target,"getAbiCoder")()),d(this,"functions",{}),d(this,"errors",{}),d(this,"events",{}),d(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void gt.warn("duplicate definition - constructor"):void d(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]?gt.warn("duplicate definition - "+r):e[r]=t})),this.deploy||d(this,"deploy",k.from({payable:!1,type:"constructor"})),d(this,"_isInterface",!0)}format(t){t||(t=N.full),t===N.sighash&&gt.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===N.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return dt}static getAddress(e){return t(e)}static getSighash(t){return o(u(t.format()),0,4)}static getEventTopic(t){return u(t.format())}getFunction(t){if(i(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];gt.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?gt.throwArgumentError("no matching function","name",e):r.length>1&&gt.throwArgumentError("multiple matching functions","name",e),this.functions[r[0]]}const e=this.functions[L.fromString(t).format()];return e||gt.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(i(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];gt.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?gt.throwArgumentError("no matching event","name",e):r.length>1&&gt.throwArgumentError("multiple matching events","name",e),this.events[r[0]]}const e=this.events[z.fromString(t).format()];return e||gt.throwArgumentError("no matching event","signature",t),e}getError(t){if(i(t)){const e=f(this.constructor,"getSighash");for(const r in this.errors){if(t===e(this.errors[r]))return this.errors[r]}gt.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?gt.throwArgumentError("no matching error","name",e):r.length>1&&gt.throwArgumentError("multiple matching errors","name",e),this.errors[r[0]]}const e=this.errors[L.fromString(t).format()];return e||gt.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 f(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),f(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=n(e);return a(r.slice(0,4))!==this.getSighash(t)&&gt.throwArgumentError(`data signature does not match error ${t.name}.`,"data",a(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),a(r([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const r=n(e);return a(r.slice(0,4))!==this.getSighash(t)&&gt.throwArgumentError(`data signature does not match function ${t.name}.`,"data",a(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),a(r([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=n(e),s=null,o="",i=null,u=null,l=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(t){}break;case 4:{const t=a(r.slice(0,4)),e=Et[t];if(e)i=this._abiCoder.decode(e.inputs,r.slice(4)),u=e.name,l=e.signature,e.reason&&(s=i[0]),"Error"===u?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(i[0])}`:"Panic"===u&&(o=`; VM Exception while processing transaction: reverted with panic code ${i[0]}`);else try{const e=this.getError(t);i=this._abiCoder.decode(e.inputs,r.slice(4)),u=e.name,l=e.format()}catch(t){}break}}return gt.throwError("call revert exception"+o,c.errors.CALL_EXCEPTION,{method:t.format(),data:a(e),errorArgs:i,errorName:u,errorSignature:l,reason:s})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),a(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&gt.throwError("too many arguments for "+t.format(),c.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));const n=(t,e)=>"string"===t.type?u(e):"bytes"===t.type?p(a(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=l.from(e).toHexString()),"address"===t.type&&this._abiCoder.encode(["address"],[e]),s(a(e),32));for(e.forEach(((e,a)=>{let s=t.inputs[a];s.indexed?null==e?r.push(null):"array"===s.baseType||"tuple"===s.baseType?gt.throwArgumentError("filtering with tuples or arrays not supported","contract."+s.name,e):Array.isArray(e)?r.push(e.map((t=>n(s,t)))):r.push(n(s,e)):null!=e&&gt.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+s.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=[],a=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&gt.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,s)=>{const o=e[s];if(t.indexed)if("string"===t.type)r.push(u(o));else if("bytes"===t.type)r.push(p(o));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([t.type],[o]))}else n.push(t),a.push(o)})),{data:this._abiCoder.encode(n,a),topics:r}}decodeEventLog(t,e,n){if("string"==typeof t&&(t=this.getEvent(t)),null!=n&&!t.anonymous){let e=this.getEventTopic(t);i(n[0],32)&&n[0].toLowerCase()===e||gt.throwError("fragment/topic mismatch",c.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:n[0]}),n=n.slice(1)}let a=[],s=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(a.push(F.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(a.push(t),o.push(!1)):(s.push(t),o.push(!1))}));let u=null!=n?this._abiCoder.decode(a,r(n)):null,l=this._abiCoder.decode(s,e,!0),h=[],m=0,p=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==u)h[e]=new wt({_isIndexed:!0,hash:null});else if(o[e])h[e]=new wt({_isIndexed:!0,hash:u[p++]});else try{h[e]=u[p++]}catch(t){h[e]=t}else try{h[e]=l[m++]}catch(t){h[e]=t}if(t.name&&null==h[t.name]){const r=h[e];r instanceof Error?Object.defineProperty(h,t.name,{enumerable:!0,get:()=>{throw vt(`property ${JSON.stringify(t.name)}`,r)}}):h[t.name]=r}}));for(let t=0;t<h.length;t++){const e=h[t];e instanceof Error&&Object.defineProperty(h,t,{enumerable:!0,get:()=>{throw vt(`index ${t}`,e)}})}return Object.freeze(h)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new yt({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:l.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new ft({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=a(t);let r=this.getError(e.substring(0,10).toLowerCase());return r?new bt({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)}}export{pt as A,k as C,U as E,M as F,_t as I,ft as L,F as P,yt as T,z as a,L as b,N as c,dt as d,G as e,wt as f};
@@ -0,0 +1 @@
1
+ import{c as r}from"./index-46da6d5f.js";import{r as t}from"./sha256-ad86865d.js";var o,i,e={exports:{}},a={exports:{}};function n(){return o?a.exports:(o=1,a.exports=(f=t(),e=(i=f).lib,n=e.Base,s=e.WordArray,(h=i.x64={}).Word=n.extend({init:function(r,t){this.high=r,this.low=t}}),h.WordArray=n.extend({init:function(t,o){t=this.words=t||[],this.sigBytes=o!=r?o:8*t.length},toX32:function(){for(var r=this.words,t=r.length,o=[],i=0;i<t;i++){var e=r[i];o.push(e.high),o.push(e.low)}return s.create(o,this.sigBytes)},clone:function(){for(var r=n.clone.call(this),t=r.words=this.words.slice(0),o=t.length,i=0;i<o;i++)t[i]=t[i].clone();return r}}),f));var r,i,e,n,s,h,f}e.exports=(i=t(),n(),function(r){var t=i,o=t.lib,e=o.WordArray,a=o.Hasher,n=t.x64.Word,s=t.algo,h=[],f=[],l=[];!function(){for(var r=1,t=0,o=0;o<24;o++){h[r+5*t]=(o+1)*(o+2)/2%64;var i=(2*r+3*t)%5;r=t%5,t=i}for(r=0;r<5;r++)for(t=0;t<5;t++)f[r+5*t]=t+(2*r+3*t)%5*5;for(var e=1,a=0;a<24;a++){for(var s=0,c=0,g=0;g<7;g++){if(1&e){var u=(1<<g)-1;u<32?c^=1<<u:s^=1<<u-32}128&e?e=e<<1^113:e<<=1}l[a]=n.create(s,c)}}();var c=[];!function(){for(var r=0;r<25;r++)c[r]=n.create()}();var g=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var r=this._state=[],t=0;t<25;t++)r[t]=new n.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(r,t){for(var o=this._state,i=this.blockSize/2,e=0;e<i;e++){var a=r[t+2*e],n=r[t+2*e+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),n=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),(W=o[e]).high^=n,W.low^=a}for(var s=0;s<24;s++){for(var g=0;g<5;g++){for(var u=0,v=0,y=0;y<5;y++)u^=(W=o[g+5*y]).high,v^=W.low;var d=c[g];d.high=u,d.low=v}for(g=0;g<5;g++){var p=c[(g+4)%5],w=c[(g+1)%5],A=w.high,x=w.low;for(u=p.high^(A<<1|x>>>31),v=p.low^(x<<1|A>>>31),y=0;y<5;y++)(W=o[g+5*y]).high^=u,W.low^=v}for(var _=1;_<25;_++){var b=(W=o[_]).high,B=W.low,H=h[_];H<32?(u=b<<H|B>>>32-H,v=B<<H|b>>>32-H):(u=B<<H-32|b>>>64-H,v=b<<H-32|B>>>64-H);var m=c[f[_]];m.high=u,m.low=v}var S=c[0],U=o[0];for(S.high=U.high,S.low=U.low,g=0;g<5;g++)for(y=0;y<5;y++){var W=o[_=g+5*y],L=c[_],k=c[(g+1)%5+5*y],z=c[(g+2)%5+5*y];W.high=L.high^~k.high&z.high,W.low=L.low^~k.low&z.low}W=o[0];var F=l[s];W.high^=F.high,W.low^=F.low}},_doFinalize:function(){var t=this._data,o=t.words;this._nDataBytes;var i=8*t.sigBytes,a=32*this.blockSize;o[i>>>5]|=1<<24-i%32,o[(r.ceil((i+1)/a)*a>>>5)-1]|=128,t.sigBytes=4*o.length,this._process();for(var n=this._state,s=this.cfg.outputLength/8,h=s/8,f=[],l=0;l<h;l++){var c=n[l],g=c.high,u=c.low;g=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),u=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),f.push(u),f.push(g)}return new e.init(f,s)},clone:function(){for(var r=a.clone.call(this),t=r._state=this._state.slice(0),o=0;o<25;o++)t[o]=t[o].clone();return r}});t.SHA3=a._createHelper(g),t.HmacSHA3=a._createHmacHelper(g)}(Math),i.SHA3);var s={exports:{}};s.exports=function(r){return function(){if("function"==typeof ArrayBuffer){var t=r.lib.WordArray,o=t.init,i=t.init=function(r){if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),(r instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)&&(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)),r instanceof Uint8Array){for(var t=r.byteLength,i=[],e=0;e<t;e++)i[e>>>2]|=r[e]<<24-e%4*8;o.call(this,i,t)}else o.apply(this,arguments)};i.prototype=t}}(),r.lib.WordArray}(t());export{s as l,n as r,e as s};
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i,g as n}from"./index-7b0eeb5c.js";const o={fontFamily:'"Euclid Circular B", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'},r=({className:t},e)=>i("div",{style:o,class:t},e),s=()=>i("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M10.4249 12.6668C10.0613 12.6668 9.81883 12.4002 9.81883 12.0002C9.81883 11.6002 10.0613 11.3335 10.4249 11.3335C12.1219 11.3335 13.4552 9.86683 13.4552 8.00016C13.4552 6.1335 12.1219 4.66683 10.4249 4.66683C8.72792 4.66683 7.39459 6.1335 7.39459 8.00016C7.39459 8.40016 7.15217 8.66683 6.78853 8.66683C6.42489 8.66683 6.18247 8.40016 6.18247 8.00016C6.18247 5.40016 8.06126 3.3335 10.4249 3.3335C12.7885 3.3335 14.6673 5.40016 14.6673 8.00016C14.6673 10.6002 12.7885 12.6668 10.4249 12.6668ZM5.4552 12.5335C3.15217 12.5335 1.33398 10.4668 1.33398 8.00016C1.33398 5.5335 3.15217 3.46683 5.4552 3.46683C5.81883 3.46683 6.06126 3.7335 6.06126 4.1335C6.06126 4.5335 5.81883 4.80016 5.4552 4.80016C3.81883 4.80016 2.54611 6.26683 2.54611 8.00016C2.54611 9.7335 3.81883 11.2002 5.4552 11.2002C7.09156 11.2002 8.36429 9.80016 8.36429 8.00016C8.36429 7.60016 8.60671 7.3335 8.97035 7.3335C9.33398 7.3335 9.57641 7.60016 9.57641 8.00016C9.5158 10.4668 7.69762 12.5335 5.4552 12.5335Z",fill:"white"})),a=()=>i("svg",{width:"12",height:"11",viewBox:"0 0 12 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M1.25861 10.9543C1.08083 10.9543 0.962312 10.895 0.843793 10.7765C0.606756 10.5394 0.606756 10.1839 0.843793 9.94686L10.3253 0.465375C10.5623 0.228338 10.9179 0.228338 11.1549 0.465375C11.3919 0.702412 11.3919 1.05797 11.1549 1.295L1.67342 10.7765C1.5549 10.895 1.43639 10.9543 1.25861 10.9543Z",fill:"#141618"}),i("path",{d:"M10.7401 10.9543C10.5623 10.9543 10.4438 10.895 10.3253 10.7765L0.843793 1.295C0.606756 1.05797 0.606756 0.702412 0.843793 0.465375C1.08083 0.228338 1.43639 0.228338 1.67342 0.465375L11.1549 9.94686C11.3919 10.1839 11.3919 10.5394 11.1549 10.7765C11.0364 10.895 10.9179 10.9543 10.7401 10.9543Z",fill:"#141618"}));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var h,l={exports:{}};h=()=>(()=>{var t={873:(t,e)=>{var i,n,o=function(){var t=function(t,e){var i=t,n=s[e],o=null,r=0,d=null,w=[],m={},_=function(t,e){o=function(t){for(var e=new Array(t),i=0;i<t;i+=1){e[i]=new Array(t);for(var n=0;n<t;n+=1)e[i][n]=null}return e}(r=4*i+17),y(0,0),y(r-7,0),y(0,r-7),M(),b(),C(t,e),i>=7&&x(t),null==d&&(d=S(i,n,w)),N(d,e)},y=function(t,e){for(var i=-1;i<=7;i+=1)if(!(t+i<=-1||r<=t+i))for(var n=-1;n<=7;n+=1)e+n<=-1||r<=e+n||(o[t+i][e+n]=0<=i&&i<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=n&&n<=4)},b=function(){for(var t=8;t<r-8;t+=1)null==o[t][6]&&(o[t][6]=t%2==0);for(var e=8;e<r-8;e+=1)null==o[6][e]&&(o[6][e]=e%2==0)},M=function(){for(var t=a.getPatternPosition(i),e=0;e<t.length;e+=1)for(var n=0;n<t.length;n+=1){var r=t[e],s=t[n];if(null==o[r][s])for(var d=-2;d<=2;d+=1)for(var h=-2;h<=2;h+=1)o[r+d][s+h]=-2==d||2==d||-2==h||2==h||0==d&&0==h}},x=function(t){for(var e=a.getBCHTypeNumber(i),n=0;n<18;n+=1){var s=!t&&1==(e>>n&1);o[Math.floor(n/3)][n%3+r-8-3]=s}for(n=0;n<18;n+=1)s=!t&&1==(e>>n&1),o[n%3+r-8-3][Math.floor(n/3)]=s},C=function(t,e){for(var i=n<<3|e,s=a.getBCHTypeInfo(i),d=0;d<15;d+=1){var h=!t&&1==(s>>d&1);d<6?o[d][8]=h:d<8?o[d+1][8]=h:o[r-15+d][8]=h}for(d=0;d<15;d+=1)h=!t&&1==(s>>d&1),d<8?o[8][r-d-1]=h:d<9?o[8][15-d-1+1]=h:o[8][15-d-1]=h;o[r-8][8]=!t},N=function(t,e){for(var i=-1,n=r-1,s=7,d=0,h=a.getMaskFunction(e),l=r-1;l>0;l-=2)for(6==l&&(l-=1);;){for(var c=0;c<2;c+=1)if(null==o[n][l-c]){var u=!1;d<t.length&&(u=1==(t[d]>>>s&1)),h(n,l-c)&&(u=!u),o[n][l-c]=u,-1==(s-=1)&&(d+=1,s=7)}if((n+=i)<0||r<=n){n-=i,i=-i;break}}},S=function(t,e,i){for(var n=l.getRSBlocks(t,e),o=c(),r=0;r<i.length;r+=1){var s=i[r];o.put(s.getMode(),4),o.put(s.getLength(),a.getLengthInBits(s.getMode(),t)),s.write(o)}var d=0;for(r=0;r<n.length;r+=1)d+=n[r].dataCount;if(o.getLengthInBits()>8*d)throw"code length overflow. ("+o.getLengthInBits()+">"+8*d+")";for(o.getLengthInBits()+4<=8*d&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*d||(o.put(236,8),o.getLengthInBits()>=8*d));)o.put(17,8);return function(t,e){for(var i=0,n=0,o=0,r=new Array(e.length),s=new Array(e.length),d=0;d<e.length;d+=1){var l=e[d].dataCount,c=e[d].totalCount-l;n=Math.max(n,l),o=Math.max(o,c),r[d]=new Array(l);for(var u=0;u<r[d].length;u+=1)r[d][u]=255&t.getBuffer()[u+i];i+=l;var g=a.getErrorCorrectPolynomial(c),p=h(r[d],g.getLength()-1).mod(g);for(s[d]=new Array(g.getLength()-1),u=0;u<s[d].length;u+=1){var f=u+p.getLength()-s[d].length;s[d][u]=f>=0?p.getAt(f):0}}var w=0;for(u=0;u<e.length;u+=1)w+=e[u].totalCount;var m=new Array(w),v=0;for(u=0;u<n;u+=1)for(d=0;d<e.length;d+=1)u<r[d].length&&(m[v]=r[d][u],v+=1);for(u=0;u<o;u+=1)for(d=0;d<e.length;d+=1)u<s[d].length&&(m[v]=s[d][u],v+=1);return m}(o,n)};m.addData=function(t,e){var i=null;switch(e=e||"Byte"){case"Numeric":i=u(t);break;case"Alphanumeric":i=g(t);break;case"Byte":i=p(t);break;case"Kanji":i=f(t);break;default:throw"mode:"+e}w.push(i),d=null},m.isDark=function(t,e){if(t<0||r<=t||e<0||r<=e)throw t+","+e;return o[t][e]},m.getModuleCount=function(){return r},m.make=function(){if(i<1){for(var t=1;t<40;t++){for(var e=l.getRSBlocks(t,n),o=c(),r=0;r<w.length;r++){var s=w[r];o.put(s.getMode(),4),o.put(s.getLength(),a.getLengthInBits(s.getMode(),t)),s.write(o)}var d=0;for(r=0;r<e.length;r++)d+=e[r].dataCount;if(o.getLengthInBits()<=8*d)break}i=t}_(!1,function(){for(var t=0,e=0,i=0;i<8;i+=1){_(!0,i);var n=a.getLostPoint(m);(0==i||t>n)&&(t=n,e=i)}return e}())},m.createTableTag=function(t,e){t=t||2;var i="";i+='<table style="',i+=" border-width: 0px; border-style: none;",i+=" border-collapse: collapse;",i+=" padding: 0px; margin: "+(e=void 0===e?4*t:e)+"px;",i+='">',i+="<tbody>";for(var n=0;n<m.getModuleCount();n+=1){i+="<tr>";for(var o=0;o<m.getModuleCount();o+=1)i+='<td style="',i+=" border-width: 0px; border-style: none;",i+=" border-collapse: collapse;",i+=" padding: 0px; margin: 0px;",i+=" width: "+t+"px;",i+=" height: "+t+"px;",i+=" background-color: ",i+=m.isDark(n,o)?"#000000":"#ffffff",i+=";",i+='"/>';i+="</tr>"}return(i+="</tbody>")+"</table>"},m.createSvgTag=function(t,e,i,n){var o={};"object"==typeof arguments[0]&&(t=(o=arguments[0]).cellSize,e=o.margin,i=o.alt,n=o.title),t=t||2,e=void 0===e?4*t:e,(i="string"==typeof i?{text:i}:i||{}).text=i.text||null,i.id=i.text?i.id||"qrcode-description":null,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-title":null;var r,s,a,d,h=m.getModuleCount()*t+2*e,l="";for(d="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",l+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',l+=o.scalable?"":' width="'+h+'px" height="'+h+'px"',l+=' viewBox="0 0 '+h+" "+h+'" ',l+=' preserveAspectRatio="xMinYMin meet"',l+=n.text||i.text?' role="img" aria-labelledby="'+O([n.id,i.id].join(" ").trim())+'"':"",l+=">",l+=n.text?'<title id="'+O(n.id)+'">'+O(n.text)+"</title>":"",l+=i.text?'<description id="'+O(i.id)+'">'+O(i.text)+"</description>":"",l+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',l+='<path d="',s=0;s<m.getModuleCount();s+=1)for(a=s*t+e,r=0;r<m.getModuleCount();r+=1)m.isDark(s,r)&&(l+="M"+(r*t+e)+","+a+d);return(l+='" stroke="transparent" fill="black"/>')+"</svg>"},m.createDataURL=function(t,e){t=t||2,e=void 0===e?4*t:e;var i=m.getModuleCount()*t+2*e,n=e,o=i-e;return v(i,i,(function(e,i){if(n<=e&&e<o&&n<=i&&i<o){var r=Math.floor((e-n)/t),s=Math.floor((i-n)/t);return m.isDark(s,r)?0:1}return 1}))},m.createImgTag=function(t,e,i){t=t||2,e=void 0===e?4*t:e;var n=m.getModuleCount()*t+2*e,o="";return o+="<img",o+=' src="',o+=m.createDataURL(t,e),o+='"',o+=' width="',o+=n,o+='"',o+=' height="',o+=n,o+='"',i&&(o+=' alt="',o+=O(i),o+='"'),o+"/>"};var O=function(t){for(var e="",i=0;i<t.length;i+=1){var n=t.charAt(i);switch(n){case"<":e+="&lt;";break;case">":e+="&gt;";break;case"&":e+="&amp;";break;case'"':e+="&quot;";break;default:e+=n}}return e};return m.createASCII=function(t,e){if((t=t||1)<2)return function(t){t=void 0===t?2:t;var e,i,n,o,r,s=1*m.getModuleCount()+2*t,a=t,d=s-t,h={"██":"█","█ ":"▀"," █":"▄"," ":" "},l={"██":"▀","█ ":"▀"," █":" "," ":" "},c="";for(e=0;e<s;e+=2){for(n=Math.floor((e-a)/1),o=Math.floor((e+1-a)/1),i=0;i<s;i+=1)r="█",a<=i&&i<d&&a<=e&&e<d&&m.isDark(n,Math.floor((i-a)/1))&&(r=" "),a<=i&&i<d&&a<=e+1&&e+1<d&&m.isDark(o,Math.floor((i-a)/1))?r+=" ":r+="█",c+=t<1&&e+1>=d?l[r]:h[r];c+="\n"}return s%2&&t>0?c.substring(0,c.length-s-1)+Array(s+1).join("▀"):c.substring(0,c.length-1)}(e);t-=1,e=void 0===e?2*t:e;var i,n,o,r,s=m.getModuleCount()*t+2*e,a=e,d=s-e,h=Array(t+1).join("██"),l=Array(t+1).join(" "),c="",u="";for(i=0;i<s;i+=1){for(o=Math.floor((i-a)/t),u="",n=0;n<s;n+=1)r=1,a<=n&&n<d&&a<=i&&i<d&&m.isDark(o,Math.floor((n-a)/t))&&(r=0),u+=r?h:l;for(o=0;o<t;o+=1)c+=u+"\n"}return c.substring(0,c.length-1)},m.renderTo2dContext=function(t,e){e=e||2;for(var i=m.getModuleCount(),n=0;n<i;n++)for(var o=0;o<i;o++)t.fillStyle=m.isDark(n,o)?"black":"white",t.fillRect(n*e,o*e,e,e)},m};t.stringToBytes=(t.stringToBytesFuncs={default:function(t){for(var e=[],i=0;i<t.length;i+=1){var n=t.charCodeAt(i);e.push(255&n)}return e}}).default,t.createStringToBytes=function(t,e){var i=function(){for(var i=m(t),n=function(){var t=i.read();if(-1==t)throw"eof";return t},o=0,r={};;){var s=i.read();if(-1==s)break;var a=n(),d=n()<<8|n();r[String.fromCharCode(s<<8|a)]=d,o+=1}if(o!=e)throw o+" != "+e;return r}(),n="?".charCodeAt(0);return function(t){for(var e=[],o=0;o<t.length;o+=1){var r=t.charCodeAt(o);if(r<128)e.push(r);else{var s=i[t.charAt(o)];"number"==typeof s?(255&s)==s?e.push(s):(e.push(s>>>8),e.push(255&s)):e.push(n)}}return e}};var e,i,n,o,r,s={L:1,M:0,Q:3,H:2},a=(e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],i=1335,n=7973,r=function(t){for(var e=0;0!=t;)e+=1,t>>>=1;return e},(o={}).getBCHTypeInfo=function(t){for(var e=t<<10;r(e)-r(i)>=0;)e^=i<<r(e)-r(i);return 21522^(t<<10|e)},o.getBCHTypeNumber=function(t){for(var e=t<<12;r(e)-r(n)>=0;)e^=n<<r(e)-r(n);return t<<12|e},o.getPatternPosition=function(t){return e[t-1]},o.getMaskFunction=function(t){switch(t){case 0:return function(t,e){return(t+e)%2==0};case 1:return function(t,e){return t%2==0};case 2:return function(t,e){return e%3==0};case 3:return function(t,e){return(t+e)%3==0};case 4:return function(t,e){return(Math.floor(t/2)+Math.floor(e/3))%2==0};case 5:return function(t,e){return t*e%2+t*e%3==0};case 6:return function(t,e){return(t*e%2+t*e%3)%2==0};case 7:return function(t,e){return(t*e%3+(t+e)%2)%2==0};default:throw"bad maskPattern:"+t}},o.getErrorCorrectPolynomial=function(t){for(var e=h([1],0),i=0;i<t;i+=1)e=e.multiply(h([1,d.gexp(i)],0));return e},o.getLengthInBits=function(t,e){if(1<=e&&e<10)switch(t){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+t}else if(e<27)switch(t){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+t}else{if(!(e<41))throw"type:"+e;switch(t){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+t}}},o.getLostPoint=function(t){for(var e=t.getModuleCount(),i=0,n=0;n<e;n+=1)for(var o=0;o<e;o+=1){for(var r=0,s=t.isDark(n,o),a=-1;a<=1;a+=1)if(!(n+a<0||e<=n+a))for(var d=-1;d<=1;d+=1)o+d<0||e<=o+d||0==a&&0==d||s==t.isDark(n+a,o+d)&&(r+=1);r>5&&(i+=3+r-5)}for(n=0;n<e-1;n+=1)for(o=0;o<e-1;o+=1){var h=0;t.isDark(n,o)&&(h+=1),t.isDark(n+1,o)&&(h+=1),t.isDark(n,o+1)&&(h+=1),t.isDark(n+1,o+1)&&(h+=1),0!=h&&4!=h||(i+=3)}for(n=0;n<e;n+=1)for(o=0;o<e-6;o+=1)t.isDark(n,o)&&!t.isDark(n,o+1)&&t.isDark(n,o+2)&&t.isDark(n,o+3)&&t.isDark(n,o+4)&&!t.isDark(n,o+5)&&t.isDark(n,o+6)&&(i+=40);for(o=0;o<e;o+=1)for(n=0;n<e-6;n+=1)t.isDark(n,o)&&!t.isDark(n+1,o)&&t.isDark(n+2,o)&&t.isDark(n+3,o)&&t.isDark(n+4,o)&&!t.isDark(n+5,o)&&t.isDark(n+6,o)&&(i+=40);var l=0;for(o=0;o<e;o+=1)for(n=0;n<e;n+=1)t.isDark(n,o)&&(l+=1);return i+Math.abs(100*l/e/e-50)/5*10},o),d=function(){for(var t=new Array(256),e=new Array(256),i=0;i<8;i+=1)t[i]=1<<i;for(i=8;i<256;i+=1)t[i]=t[i-4]^t[i-5]^t[i-6]^t[i-8];for(i=0;i<255;i+=1)e[t[i]]=i;return{glog:function(t){if(t<1)throw"glog("+t+")";return e[t]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return t[e]}}}();function h(t,e){if(void 0===t.length)throw t.length+"/"+e;var i=function(){for(var i=0;i<t.length&&0==t[i];)i+=1;for(var n=new Array(t.length-i+e),o=0;o<t.length-i;o+=1)n[o]=t[o+i];return n}(),n={getAt:function(t){return i[t]},getLength:function(){return i.length},multiply:function(t){for(var e=new Array(n.getLength()+t.getLength()-1),i=0;i<n.getLength();i+=1)for(var o=0;o<t.getLength();o+=1)e[i+o]^=d.gexp(d.glog(n.getAt(i))+d.glog(t.getAt(o)));return h(e,0)},mod:function(t){if(n.getLength()-t.getLength()<0)return n;for(var e=d.glog(n.getAt(0))-d.glog(t.getAt(0)),i=new Array(n.getLength()),o=0;o<n.getLength();o+=1)i[o]=n.getAt(o);for(o=0;o<t.getLength();o+=1)i[o]^=d.gexp(d.glog(t.getAt(o))+e);return h(i,0).mod(t)}};return n}var l=function(){var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(t,e){var i={};return i.totalCount=t,i.dataCount=e,i},i={getRSBlocks:function(i,n){var o=function(e,i){switch(i){case s.L:return t[4*(e-1)+0];case s.M:return t[4*(e-1)+1];case s.Q:return t[4*(e-1)+2];case s.H:return t[4*(e-1)+3];default:return}}(i,n);if(void 0===o)throw"bad rs block @ typeNumber:"+i+"/errorCorrectionLevel:"+n;for(var r=o.length/3,a=[],d=0;d<r;d+=1)for(var h=o[3*d+0],l=o[3*d+1],c=o[3*d+2],u=0;u<h;u+=1)a.push(e(l,c));return a}};return i}(),c=function(){var t=[],e=0,i={getBuffer:function(){return t},getAt:function(e){var i=Math.floor(e/8);return 1==(t[i]>>>7-e%8&1)},put:function(t,e){for(var n=0;n<e;n+=1)i.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return e},putBit:function(i){var n=Math.floor(e/8);t.length<=n&&t.push(0),i&&(t[n]|=128>>>e%8),e+=1}};return i},u=function(t){var e=t,i={getMode:function(){return 1},getLength:function(t){return e.length},write:function(t){for(var i=e,o=0;o+2<i.length;)t.put(n(i.substring(o,o+3)),10),o+=3;o<i.length&&(i.length-o==1?t.put(n(i.substring(o,o+1)),4):i.length-o==2&&t.put(n(i.substring(o,o+2)),7))}},n=function(t){for(var e=0,i=0;i<t.length;i+=1)e=10*e+o(t.charAt(i));return e},o=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return i},g=function(t){var e=t,i={getMode:function(){return 2},getLength:function(t){return e.length},write:function(t){for(var i=e,o=0;o+1<i.length;)t.put(45*n(i.charAt(o))+n(i.charAt(o+1)),11),o+=2;o<i.length&&t.put(n(i.charAt(o)),6)}},n=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10;switch(t){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+t}};return i},p=function(e){var i=t.stringToBytes(e);return{getMode:function(){return 4},getLength:function(t){return i.length},write:function(t){for(var e=0;e<i.length;e+=1)t.put(i[e],8)}}},f=function(e){var i=t.stringToBytesFuncs.SJIS;if(!i)throw"sjis not supported.";!function(){var t=i("友");if(2!=t.length||38726!=(t[0]<<8|t[1]))throw"sjis not supported."}();var n=i(e),o={getMode:function(){return 8},getLength:function(t){return~~(n.length/2)},write:function(t){for(var e=n,i=0;i+1<e.length;){var o=(255&e[i])<<8|255&e[i+1];if(33088<=o&&o<=40956)o-=33088;else{if(!(57408<=o&&o<=60351))throw"illegal char at "+(i+1)+"/"+o;o-=49472}o=192*(o>>>8&255)+(255&o),t.put(o,13),i+=2}if(i<e.length)throw"illegal char at "+(i+1)}};return o},w=function(){var t=[],e={writeByte:function(e){t.push(255&e)},writeShort:function(t){e.writeByte(t),e.writeByte(t>>>8)},writeBytes:function(t,i,n){i=i||0,n=n||t.length;for(var o=0;o<n;o+=1)e.writeByte(t[o+i])},writeString:function(t){for(var i=0;i<t.length;i+=1)e.writeByte(t.charCodeAt(i))},toByteArray:function(){return t},toString:function(){var e="";e+="[";for(var i=0;i<t.length;i+=1)i>0&&(e+=","),e+=t[i];return e+"]"}};return e},m=function(t){var e=t,i=0,n=0,o=0,r={read:function(){for(;o<8;){if(i>=e.length){if(0==o)return-1;throw"unexpected end of file./"+o}var t=e.charAt(i);if(i+=1,"="==t)return o=0,-1;t.match(/^\s$/)||(n=n<<6|s(t.charCodeAt(0)),o+=6)}var r=n>>>o-8&255;return o-=8,r}},s=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return r},v=function(t,e,i){for(var n=function(t,e){var i=t,n=e,o=new Array(t*e),r={setPixel:function(t,e,n){o[e*i+t]=n},write:function(t){t.writeString("GIF87a"),t.writeShort(i),t.writeShort(n),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(i),t.writeShort(n),t.writeByte(0);var e=s(2);t.writeByte(2);for(var o=0;e.length-o>255;)t.writeByte(255),t.writeBytes(e,o,255),o+=255;t.writeByte(e.length-o),t.writeBytes(e,o,e.length-o),t.writeByte(0),t.writeString(";")}},s=function(t){for(var e=1<<t,i=1+(1<<t),n=t+1,r=a(),s=0;s<e;s+=1)r.add(String.fromCharCode(s));r.add(String.fromCharCode(e)),r.add(String.fromCharCode(i));var d,h,l,c=w(),u=(d=c,h=0,l=0,{write:function(t,e){if(t>>>e!=0)throw"length over";for(;h+e>=8;)d.writeByte(255&(t<<h|l)),e-=8-h,t>>>=8-h,l=0,h=0;l|=t<<h,h+=e},flush:function(){h>0&&d.writeByte(l)}});u.write(e,n);var g=0,p=String.fromCharCode(o[g]);for(g+=1;g<o.length;){var f=String.fromCharCode(o[g]);g+=1,r.contains(p+f)?p+=f:(u.write(r.indexOf(p),n),r.size()<4095&&(r.size()==1<<n&&(n+=1),r.add(p+f)),p=f)}return u.write(r.indexOf(p),n),u.write(i,n),u.flush(),c.toByteArray()},a=function(){var t={},e=0,i={add:function(n){if(i.contains(n))throw"dup key:"+n;t[n]=e,e+=1},size:function(){return e},indexOf:function(e){return t[e]},contains:function(e){return void 0!==t[e]}};return i};return r}(t,e),o=0;o<e;o+=1)for(var r=0;r<t;r+=1)n.setPixel(r,o,i(r,o));var s=w();n.write(s);for(var a=function(){var t=0,e=0,i=0,n="",o={},r=function(t){n+=String.fromCharCode(s(63&t))},s=function(t){if(t<0);else{if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47}throw"n:"+t};return o.writeByte=function(n){for(t=t<<8|255&n,e+=8,i+=1;e>=6;)r(t>>>e-6),e-=6},o.flush=function(){if(e>0&&(r(t<<6-e),t=0,e=0),i%3!=0)for(var o=3-i%3,s=0;s<o;s+=1)n+="="},o.toString=function(){return n},o}(),d=s.toByteArray(),h=0;h<d.length;h+=1)a.writeByte(d[h]);return a.flush(),"data:image/gif;base64,"+a};return t}();o.stringToBytesFuncs["UTF-8"]=function(t){return function(t){for(var e=[],i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?e.push(n):n<2048?e.push(192|n>>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(i++,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return e}(t)},void 0===(n="function"==typeof(i=function(){return o})?i.apply(e,[]):i)||(t.exports=n)}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};return(()=>{i.d(n,{default:()=>O});const t=t=>!!t&&"object"==typeof t&&!Array.isArray(t);function e(i,...n){if(!n.length)return i;const o=n.shift();return void 0!==o&&t(i)&&t(o)?(i=Object.assign({},i),Object.keys(o).forEach((n=>{const r=i[n],s=o[n];Array.isArray(r)&&Array.isArray(s)?i[n]=s:t(r)&&t(s)?i[n]=e(Object.assign({},r),s):i[n]=s})),e(i,...n)):i}function o(t,e){const i=document.createElement("a");i.download=e,i.href=t,document.body.appendChild(i),i.click(),document.body.removeChild(i)}const r={L:.07,M:.15,Q:.25,H:.3};class s{constructor({svg:t,type:e,window:i}){this._svg=t,this._type=e,this._window=i}draw(t,e,i,n){let o;switch(this._type){case"dots":o=this._drawDot;break;case"classy":o=this._drawClassy;break;case"classy-rounded":o=this._drawClassyRounded;break;case"rounded":o=this._drawRounded;break;case"extra-rounded":o=this._drawExtraRounded;break;default:o=this._drawSquare}o.call(this,{x:t,y:e,size:i,getNeighbor:n})}_rotateFigure({x:t,y:e,size:i,rotation:n=0,draw:o}){var r;const s=t+i/2,a=e+i/2;o(),null===(r=this._element)||void 0===r||r.setAttribute("transform",`rotate(${180*n/Math.PI},${s},${a})`)}_basicDot(t){const{size:e,x:i,y:n}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(i+e/2)),this._element.setAttribute("cy",String(n+e/2)),this._element.setAttribute("r",String(e/2))}}))}_basicSquare(t){const{size:e,x:i,y:n}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(i)),this._element.setAttribute("y",String(n)),this._element.setAttribute("width",String(e)),this._element.setAttribute("height",String(e))}}))}_basicSideRounded(t){const{size:e,x:i,y:n}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${i} ${n}v ${e}h `+e/2+`a ${e/2} ${e/2}, 0, 0, 0, 0 ${-e}`)}}))}_basicCornerRounded(t){const{size:e,x:i,y:n}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${i} ${n}v ${e}h ${e}v `+-e/2+`a ${e/2} ${e/2}, 0, 0, 0, ${-e/2} ${-e/2}`)}}))}_basicCornerExtraRounded(t){const{size:e,x:i,y:n}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${i} ${n}v ${e}h ${e}a ${e} ${e}, 0, 0, 0, ${-e} ${-e}`)}}))}_basicCornersRounded(t){const{size:e,x:i,y:n}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${i} ${n}v `+e/2+`a ${e/2} ${e/2}, 0, 0, 0, ${e/2} ${e/2}h `+e/2+"v "+-e/2+`a ${e/2} ${e/2}, 0, 0, 0, ${-e/2} ${-e/2}`)}}))}_drawDot({x:t,y:e,size:i}){this._basicDot({x:t,y:e,size:i,rotation:0})}_drawSquare({x:t,y:e,size:i}){this._basicSquare({x:t,y:e,size:i,rotation:0})}_drawRounded({x:t,y:e,size:i,getNeighbor:n}){const o=n?+n(-1,0):0,r=n?+n(1,0):0,s=n?+n(0,-1):0,a=n?+n(0,1):0,d=o+r+s+a;if(0!==d)if(d>2||o&&r||s&&a)this._basicSquare({x:t,y:e,size:i,rotation:0});else{if(2===d){let n=0;return o&&s?n=Math.PI/2:s&&r?n=Math.PI:r&&a&&(n=-Math.PI/2),void this._basicCornerRounded({x:t,y:e,size:i,rotation:n})}if(1===d){let n=0;return s?n=Math.PI/2:r?n=Math.PI:a&&(n=-Math.PI/2),void this._basicSideRounded({x:t,y:e,size:i,rotation:n})}}else this._basicDot({x:t,y:e,size:i,rotation:0})}_drawExtraRounded({x:t,y:e,size:i,getNeighbor:n}){const o=n?+n(-1,0):0,r=n?+n(1,0):0,s=n?+n(0,-1):0,a=n?+n(0,1):0,d=o+r+s+a;if(0!==d)if(d>2||o&&r||s&&a)this._basicSquare({x:t,y:e,size:i,rotation:0});else{if(2===d){let n=0;return o&&s?n=Math.PI/2:s&&r?n=Math.PI:r&&a&&(n=-Math.PI/2),void this._basicCornerExtraRounded({x:t,y:e,size:i,rotation:n})}if(1===d){let n=0;return s?n=Math.PI/2:r?n=Math.PI:a&&(n=-Math.PI/2),void this._basicSideRounded({x:t,y:e,size:i,rotation:n})}}else this._basicDot({x:t,y:e,size:i,rotation:0})}_drawClassy({x:t,y:e,size:i,getNeighbor:n}){const o=n?+n(-1,0):0,r=n?+n(1,0):0,s=n?+n(0,-1):0,a=n?+n(0,1):0;0!==o+r+s+a?o||s?r||a?this._basicSquare({x:t,y:e,size:i,rotation:0}):this._basicCornerRounded({x:t,y:e,size:i,rotation:Math.PI/2}):this._basicCornerRounded({x:t,y:e,size:i,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:e,size:i,rotation:Math.PI/2})}_drawClassyRounded({x:t,y:e,size:i,getNeighbor:n}){const o=n?+n(-1,0):0,r=n?+n(1,0):0,s=n?+n(0,-1):0,a=n?+n(0,1):0;0!==o+r+s+a?o||s?r||a?this._basicSquare({x:t,y:e,size:i,rotation:0}):this._basicCornerExtraRounded({x:t,y:e,size:i,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:t,y:e,size:i,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:e,size:i,rotation:Math.PI/2})}}const a={dot:"dot",square:"square",extraRounded:"extra-rounded"},d=Object.values(a);class h{constructor({svg:t,type:e,window:i}){this._svg=t,this._type=e,this._window=i}draw(t,e,i,n){let o;switch(this._type){case a.square:o=this._drawSquare;break;case a.extraRounded:o=this._drawExtraRounded;break;default:o=this._drawDot}o.call(this,{x:t,y:e,size:i,rotation:n})}_rotateFigure({x:t,y:e,size:i,rotation:n=0,draw:o}){var r;const s=t+i/2,a=e+i/2;o(),null===(r=this._element)||void 0===r||r.setAttribute("transform",`rotate(${180*n/Math.PI},${s},${a})`)}_basicDot(t){const{size:e,x:i,y:n}=t,o=e/7;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${i+e/2} ${n}a ${e/2} ${e/2} 0 1 0 0.1 0zm 0 ${o}a ${e/2-o} ${e/2-o} 0 1 1 -0.1 0Z`)}}))}_basicSquare(t){const{size:e,x:i,y:n}=t,o=e/7;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${i} ${n}v ${e}h ${e}v `+-e+"z"+`M ${i+o} ${n+o}h `+(e-2*o)+"v "+(e-2*o)+"h "+(2*o-e)+"z")}}))}_basicExtraRounded(t){const{size:e,x:i,y:n}=t,o=e/7;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${i} ${n+2.5*o}v `+2*o+`a ${2.5*o} ${2.5*o}, 0, 0, 0, ${2.5*o} ${2.5*o}h `+2*o+`a ${2.5*o} ${2.5*o}, 0, 0, 0, ${2.5*o} ${2.5*-o}v `+-2*o+`a ${2.5*o} ${2.5*o}, 0, 0, 0, ${2.5*-o} ${2.5*-o}h `+-2*o+`a ${2.5*o} ${2.5*o}, 0, 0, 0, ${2.5*-o} ${2.5*o}`+`M ${i+2.5*o} ${n+o}h `+2*o+`a ${1.5*o} ${1.5*o}, 0, 0, 1, ${1.5*o} ${1.5*o}v `+2*o+`a ${1.5*o} ${1.5*o}, 0, 0, 1, ${1.5*-o} ${1.5*o}h `+-2*o+`a ${1.5*o} ${1.5*o}, 0, 0, 1, ${1.5*-o} ${1.5*-o}v `+-2*o+`a ${1.5*o} ${1.5*o}, 0, 0, 1, ${1.5*o} ${1.5*-o}`)}}))}_drawDot({x:t,y:e,size:i,rotation:n}){this._basicDot({x:t,y:e,size:i,rotation:n})}_drawSquare({x:t,y:e,size:i,rotation:n}){this._basicSquare({x:t,y:e,size:i,rotation:n})}_drawExtraRounded({x:t,y:e,size:i,rotation:n}){this._basicExtraRounded({x:t,y:e,size:i,rotation:n})}}const l={dot:"dot",square:"square"},c=Object.values(l);class u{constructor({svg:t,type:e,window:i}){this._svg=t,this._type=e,this._window=i}draw(t,e,i,n){let o;o=this._type===l.square?this._drawSquare:this._drawDot,o.call(this,{x:t,y:e,size:i,rotation:n})}_rotateFigure({x:t,y:e,size:i,rotation:n=0,draw:o}){var r;const s=t+i/2,a=e+i/2;o(),null===(r=this._element)||void 0===r||r.setAttribute("transform",`rotate(${180*n/Math.PI},${s},${a})`)}_basicDot(t){const{size:e,x:i,y:n}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(i+e/2)),this._element.setAttribute("cy",String(n+e/2)),this._element.setAttribute("r",String(e/2))}}))}_basicSquare(t){const{size:e,x:i,y:n}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(i)),this._element.setAttribute("y",String(n)),this._element.setAttribute("width",String(e)),this._element.setAttribute("height",String(e))}}))}_drawDot({x:t,y:e,size:i,rotation:n}){this._basicDot({x:t,y:e,size:i,rotation:n})}_drawSquare({x:t,y:e,size:i,rotation:n}){this._basicSquare({x:t,y:e,size:i,rotation:n})}}const g="circle",p=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],f=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class w{constructor(t,e){this._roundSize=t=>this._options.dotsOptions.roundSize?Math.floor(t):t,this._window=e,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(t.width)),this._element.setAttribute("height",String(t.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${t.width} ${t.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=t.image,this._instanceId=w.instanceCount++,this._options=t}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(t){const e=t.getModuleCount(),i=Math.min(this._options.width,this._options.height)-2*this._options.margin,n=this._options.shape===g?i/Math.sqrt(2):i,o=this._roundSize(n/e);let s={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=t,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:t,qrOptions:i}=this._options,n=t.imageSize*r[i.errorCorrectionLevel],a=Math.floor(n*e*e);s=function({originalHeight:t,originalWidth:e,maxHiddenDots:i,maxHiddenAxisDots:n,dotSize:o}){const r={x:0,y:0},s={x:0,y:0};if(t<=0||e<=0||i<=0||o<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const a=t/e;return r.x=Math.floor(Math.sqrt(i/a)),r.x<=0&&(r.x=1),n&&n<r.x&&(r.x=n),r.x%2==0&&r.x--,s.x=r.x*o,r.y=1+2*Math.ceil((r.x*a-1)/2),s.y=Math.round(s.x*a),(r.y*r.x>i||n&&n<r.y)&&(n&&n<r.y?(r.y=n,r.y%2==0&&r.x--):r.y-=2,s.y=r.y*o,r.x=1+2*Math.ceil((r.y/a-1)/2),s.x=Math.round(s.y/a)),{height:s.y,width:s.x,hideYDots:r.y,hideXDots:r.x}}({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:a,maxHiddenAxisDots:e-14,dotSize:o})}this.drawBackground(),this.drawDots(((t,i)=>{var n,o,r,a,d,h;return!(this._options.imageOptions.hideBackgroundDots&&t>=(e-s.hideYDots)/2&&t<(e+s.hideYDots)/2&&i>=(e-s.hideXDots)/2&&i<(e+s.hideXDots)/2||(null===(n=p[t])||void 0===n?void 0:n[i])||(null===(o=p[t-e+7])||void 0===o?void 0:o[i])||(null===(r=p[t])||void 0===r?void 0:r[i-e+7])||(null===(a=f[t])||void 0===a?void 0:a[i])||(null===(d=f[t-e+7])||void 0===d?void 0:d[i])||(null===(h=f[t])||void 0===h?void 0:h[i-e+7]))})),this.drawCorners(),this._options.image&&await this.drawImage({width:s.width,height:s.height,count:e,dotSize:o})}drawBackground(){var t,e,i;const n=this._element,o=this._options;if(n){const n=null===(t=o.backgroundOptions)||void 0===t?void 0:t.gradient,r=null===(e=o.backgroundOptions)||void 0===e?void 0:e.color;let s=o.height,a=o.width;if(n||r){const t=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),(null===(i=o.backgroundOptions)||void 0===i?void 0:i.round)&&(s=a=Math.min(o.width,o.height),t.setAttribute("rx",String(s/2*o.backgroundOptions.round))),t.setAttribute("x",String(this._roundSize((o.width-a)/2))),t.setAttribute("y",String(this._roundSize((o.height-s)/2))),t.setAttribute("width",String(a)),t.setAttribute("height",String(s)),this._backgroundClipPath.appendChild(t),this._createColor({options:n,color:r,additionalRotation:0,x:0,y:0,height:o.height,width:o.width,name:`background-color-${this._instanceId}`})}}}drawDots(t){var e,i;if(!this._qr)throw"QR code is not defined";const n=this._options,o=this._qr.getModuleCount();if(o>n.width||o>n.height)throw"The canvas is too small.";const r=Math.min(n.width,n.height)-2*n.margin,a=n.shape===g?r/Math.sqrt(2):r,d=this._roundSize(a/o),h=this._roundSize((n.width-o*d)/2),l=this._roundSize((n.height-o*d)/2),c=new s({svg:this._element,type:n.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null===(e=n.dotsOptions)||void 0===e?void 0:e.gradient,color:n.dotsOptions.color,additionalRotation:0,x:0,y:0,height:n.height,width:n.width,name:`dot-color-${this._instanceId}`});for(let e=0;e<o;e++)for(let n=0;n<o;n++)t&&!t(e,n)||(null===(i=this._qr)||void 0===i?void 0:i.isDark(e,n))&&(c.draw(h+n*d,l+e*d,d,((i,r)=>!(n+i<0||e+r<0||n+i>=o||e+r>=o)&&!(t&&!t(e+r,n+i))&&!!this._qr&&this._qr.isDark(e+r,n+i))),c._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(c._element));if(n.shape===g){const t=this._roundSize((r/d-o)/2),e=o+2*t,i=h-t*d,n=l-t*d,s=[],a=this._roundSize(e/2);for(let i=0;i<e;i++){s[i]=[];for(let n=0;n<e;n++)i>=t-1&&i<=e-t&&n>=t-1&&n<=e-t||Math.sqrt((i-a)*(i-a)+(n-a)*(n-a))>a?s[i][n]=0:s[i][n]=this._qr.isDark(n-2*t<0?n:n>=o?n-2*t:n-t,i-2*t<0?i:i>=o?i-2*t:i-t)?1:0}for(let t=0;t<e;t++)for(let o=0;o<e;o++)s[t][o]&&(c.draw(i+o*d,n+t*d,d,((e,i)=>{var n;return!!(null===(n=s[t+i])||void 0===n?void 0:n[o+e])})),c._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(c._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const t=this._element,e=this._options;if(!t)throw"Element code is not defined";const i=this._qr.getModuleCount(),n=Math.min(e.width,e.height)-2*e.margin,o=e.shape===g?n/Math.sqrt(2):n,r=this._roundSize(o/i),a=7*r,l=3*r,w=this._roundSize((e.width-i*r)/2),m=this._roundSize((e.height-i*r)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach((([t,n,o])=>{var g,v,_,y,b,M,x,C,N,S,O,A,D,I;const T=w+t*r*(i-7),j=m+n*r*(i-7);let L=this._dotsClipPath,k=this._dotsClipPath;if(((null===(g=e.cornersSquareOptions)||void 0===g?void 0:g.gradient)||(null===(v=e.cornersSquareOptions)||void 0===v?void 0:v.color))&&(L=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),L.setAttribute("id",`clip-path-corners-square-color-${t}-${n}-${this._instanceId}`),this._defs.appendChild(L),this._cornersSquareClipPath=this._cornersDotClipPath=k=L,this._createColor({options:null===(_=e.cornersSquareOptions)||void 0===_?void 0:_.gradient,color:null===(y=e.cornersSquareOptions)||void 0===y?void 0:y.color,additionalRotation:o,x:T,y:j,height:a,width:a,name:`corners-square-color-${t}-${n}-${this._instanceId}`})),(null===(b=e.cornersSquareOptions)||void 0===b?void 0:b.type)&&d.includes(e.cornersSquareOptions.type)){const t=new h({svg:this._element,type:e.cornersSquareOptions.type,window:this._window});t.draw(T,j,a,o),t._element&&L&&L.appendChild(t._element)}else{const t=new s({svg:this._element,type:(null===(M=e.cornersSquareOptions)||void 0===M?void 0:M.type)||e.dotsOptions.type,window:this._window});for(let e=0;e<p.length;e++)for(let i=0;i<p[e].length;i++)(null===(x=p[e])||void 0===x?void 0:x[i])&&(t.draw(T+i*r,j+e*r,r,((t,n)=>{var o;return!!(null===(o=p[e+n])||void 0===o?void 0:o[i+t])})),t._element&&L&&L.appendChild(t._element))}if(((null===(C=e.cornersDotOptions)||void 0===C?void 0:C.gradient)||(null===(N=e.cornersDotOptions)||void 0===N?void 0:N.color))&&(k=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),k.setAttribute("id",`clip-path-corners-dot-color-${t}-${n}-${this._instanceId}`),this._defs.appendChild(k),this._cornersDotClipPath=k,this._createColor({options:null===(S=e.cornersDotOptions)||void 0===S?void 0:S.gradient,color:null===(O=e.cornersDotOptions)||void 0===O?void 0:O.color,additionalRotation:o,x:T+2*r,y:j+2*r,height:l,width:l,name:`corners-dot-color-${t}-${n}-${this._instanceId}`})),(null===(A=e.cornersDotOptions)||void 0===A?void 0:A.type)&&c.includes(e.cornersDotOptions.type)){const t=new u({svg:this._element,type:e.cornersDotOptions.type,window:this._window});t.draw(T+2*r,j+2*r,l,o),t._element&&k&&k.appendChild(t._element)}else{const t=new s({svg:this._element,type:(null===(D=e.cornersDotOptions)||void 0===D?void 0:D.type)||e.dotsOptions.type,window:this._window});for(let e=0;e<f.length;e++)for(let i=0;i<f[e].length;i++)(null===(I=f[e])||void 0===I?void 0:I[i])&&(t.draw(T+i*r,j+e*r,r,((t,n)=>{var o;return!!(null===(o=f[e+n])||void 0===o?void 0:o[i+t])})),t._element&&k&&k.appendChild(t._element))}}))}loadImage(){return new Promise(((t,e)=>{var i;const n=this._options;if(!n.image)return e("Image is not defined");if(null===(i=n.nodeCanvas)||void 0===i?void 0:i.loadImage)n.nodeCanvas.loadImage(n.image).then((e=>{var i,o;if(this._image=e,this._options.imageOptions.saveAsBlob){const t=null===(i=n.nodeCanvas)||void 0===i?void 0:i.createCanvas(this._image.width,this._image.height);null===(o=null==t?void 0:t.getContext("2d"))||void 0===o||o.drawImage(e,0,0),this._imageUri=null==t?void 0:t.toDataURL()}t()})).catch(e);else{const e=new this._window.Image;"string"==typeof n.imageOptions.crossOrigin&&(e.crossOrigin=n.imageOptions.crossOrigin),this._image=e,e.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await async function(t,e){return new Promise((i=>{const n=new e.XMLHttpRequest;n.onload=function(){const t=new e.FileReader;t.onloadend=function(){i(t.result)},t.readAsDataURL(n.response)},n.open("GET",t),n.responseType="blob",n.send()}))}(n.image||"",this._window)),t()},e.src=n.image}}))}async drawImage({width:t,height:e,count:i,dotSize:n}){const o=this._options,r=this._roundSize((o.width-i*n)/2),s=this._roundSize((o.height-i*n)/2),a=r+this._roundSize(o.imageOptions.margin+(i*n-t)/2),d=s+this._roundSize(o.imageOptions.margin+(i*n-e)/2),h=t-2*o.imageOptions.margin,l=e-2*o.imageOptions.margin,c=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");c.setAttribute("href",this._imageUri||""),c.setAttribute("xlink:href",this._imageUri||""),c.setAttribute("x",String(a)),c.setAttribute("y",String(d)),c.setAttribute("width",`${h}px`),c.setAttribute("height",`${l}px`),this._element.appendChild(c)}_createColor({options:t,color:e,additionalRotation:i,x:n,y:o,height:r,width:s,name:a}){const d=s>r?s:r,h=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(h.setAttribute("x",String(n)),h.setAttribute("y",String(o)),h.setAttribute("height",String(r)),h.setAttribute("width",String(s)),h.setAttribute("clip-path",`url('#clip-path-${a}')`),t){let e;if("radial"===t.type)e=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),e.setAttribute("id",a),e.setAttribute("gradientUnits","userSpaceOnUse"),e.setAttribute("fx",String(n+s/2)),e.setAttribute("fy",String(o+r/2)),e.setAttribute("cx",String(n+s/2)),e.setAttribute("cy",String(o+r/2)),e.setAttribute("r",String(d/2));else{const d=((t.rotation||0)+i)%(2*Math.PI),h=(d+2*Math.PI)%(2*Math.PI);let l=n+s/2,c=o+r/2,u=n+s/2,g=o+r/2;h>=0&&h<=.25*Math.PI||h>1.75*Math.PI&&h<=2*Math.PI?(l-=s/2,c-=r/2*Math.tan(d),u+=s/2,g+=r/2*Math.tan(d)):h>.25*Math.PI&&h<=.75*Math.PI?(c-=r/2,l-=s/2/Math.tan(d),g+=r/2,u+=s/2/Math.tan(d)):h>.75*Math.PI&&h<=1.25*Math.PI?(l+=s/2,c+=r/2*Math.tan(d),u-=s/2,g-=r/2*Math.tan(d)):h>1.25*Math.PI&&h<=1.75*Math.PI&&(c+=r/2,l+=s/2/Math.tan(d),g-=r/2,u-=s/2/Math.tan(d)),e=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),e.setAttribute("id",a),e.setAttribute("gradientUnits","userSpaceOnUse"),e.setAttribute("x1",String(Math.round(l))),e.setAttribute("y1",String(Math.round(c))),e.setAttribute("x2",String(Math.round(u))),e.setAttribute("y2",String(Math.round(g)))}t.colorStops.forEach((({offset:t,color:i})=>{const n=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");n.setAttribute("offset",100*t+"%"),n.setAttribute("stop-color",i),e.appendChild(n)})),h.setAttribute("fill",`url('#${a}')`),this._defs.appendChild(e)}else e&&h.setAttribute("fill",e);this._element.appendChild(h)}}w.instanceCount=0;const m=w,v="canvas",_={};for(let t=0;t<=40;t++)_[t]=t;const y={type:v,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:_[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function b(t){const e=Object.assign({},t);if(!e.colorStops||!e.colorStops.length)throw"Field 'colorStops' is required in gradient";return e.rotation?e.rotation=Number(e.rotation):e.rotation=0,e.colorStops=e.colorStops.map((t=>Object.assign(Object.assign({},t),{offset:Number(t.offset)}))),e}function M(t){const e=Object.assign({},t);return e.width=Number(e.width),e.height=Number(e.height),e.margin=Number(e.margin),e.imageOptions=Object.assign(Object.assign({},e.imageOptions),{hideBackgroundDots:Boolean(e.imageOptions.hideBackgroundDots),imageSize:Number(e.imageOptions.imageSize),margin:Number(e.imageOptions.margin)}),e.margin>Math.min(e.width,e.height)&&(e.margin=Math.min(e.width,e.height)),e.dotsOptions=Object.assign({},e.dotsOptions),e.dotsOptions.gradient&&(e.dotsOptions.gradient=b(e.dotsOptions.gradient)),e.cornersSquareOptions&&(e.cornersSquareOptions=Object.assign({},e.cornersSquareOptions),e.cornersSquareOptions.gradient&&(e.cornersSquareOptions.gradient=b(e.cornersSquareOptions.gradient))),e.cornersDotOptions&&(e.cornersDotOptions=Object.assign({},e.cornersDotOptions),e.cornersDotOptions.gradient&&(e.cornersDotOptions.gradient=b(e.cornersDotOptions.gradient))),e.backgroundOptions&&(e.backgroundOptions=Object.assign({},e.backgroundOptions),e.backgroundOptions.gradient&&(e.backgroundOptions.gradient=b(e.backgroundOptions.gradient))),e}var x=i(873),C=i.n(x);function N(t){if(!t)throw new Error("Extension must be defined");"."===t[0]&&(t=t.substring(1));const e={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[t.toLowerCase()];if(!e)throw new Error(`Extension "${t}" is not supported`);return e}class S{constructor(t){(null==t?void 0:t.jsdom)?this._window=new t.jsdom("",{resources:"usable"}).window:this._window=window,this._options=t?M(e(y,t)):y,this.update()}static _clearContainer(t){t&&(t.innerHTML="")}_setupSvg(){if(!this._qr)return;const t=new m(this._options,this._window);this._svg=t.getElement(),this._svgDrawingPromise=t.drawQR(this._qr).then((()=>{var e;this._svg&&(null===(e=this._extension)||void 0===e||e.call(this,t.getElement(),this._options))}))}_setupCanvas(){var t,e;this._qr&&((null===(t=this._options.nodeCanvas)||void 0===t?void 0:t.createCanvas)?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=null===(e=this._svgDrawingPromise)||void 0===e?void 0:e.then((()=>{var t;if(!this._svg)return;const e=this._svg,i=(new this._window.XMLSerializer).serializeToString(e),n=btoa(i),o=`data:${N("svg")};base64,${n}`;if(null===(t=this._options.nodeCanvas)||void 0===t?void 0:t.loadImage)return this._options.nodeCanvas.loadImage(o).then((t=>{var e,i;t.width=this._options.width,t.height=this._options.height,null===(i=null===(e=this._nodeCanvas)||void 0===e?void 0:e.getContext("2d"))||void 0===i||i.drawImage(t,0,0)}));{const t=new this._window.Image;return new Promise((e=>{t.onload=()=>{var i,n;null===(n=null===(i=this._domCanvas)||void 0===i?void 0:i.getContext("2d"))||void 0===n||n.drawImage(t,0,0),e()},t.src=o}))}})))}async _getElement(t="png"){if(!this._qr)throw"QR code is empty";return"svg"===t.toLowerCase()?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(t){S._clearContainer(this._container),this._options=t?M(e(this._options,t)):this._options,this._options.data&&(this._qr=C()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(t){switch(!0){case/^[0-9]*$/.test(t):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(t):return"Alphanumeric";default:return"Byte"}}(this._options.data)),this._qr.make(),this._options.type===v?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(t){if(t){if("function"!=typeof t.appendChild)throw"Container should be a single DOM node";this._options.type===v?this._domCanvas&&t.appendChild(this._domCanvas):this._svg&&t.appendChild(this._svg),this._container=t}}applyExtension(t){if(!t)throw"Extension function should be defined.";this._extension=t,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(t="png"){if(!this._qr)throw"QR code is empty";const e=await this._getElement(t),i=N(t);if(!e)return null;if("svg"===t.toLowerCase()){const t=`<?xml version="1.0" standalone="no"?>\r\n${(new this._window.XMLSerializer).serializeToString(e)}`;return"undefined"==typeof Blob||this._options.jsdom?Buffer.from(t):new Blob([t],{type:i})}return new Promise((t=>{const n=e;if("toBuffer"in n)if("image/png"===i)t(n.toBuffer(i));else if("image/jpeg"===i)t(n.toBuffer(i));else{if("application/pdf"!==i)throw Error("Unsupported extension");t(n.toBuffer(i))}else"toBlob"in n&&n.toBlob(t,i,1)}))}async download(t){if(!this._qr)throw"QR code is empty";if("undefined"==typeof Blob)throw"Cannot download in Node.js, call getRawData instead.";let e="png",i="qr";"string"==typeof t?(e=t,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):"object"==typeof t&&null!==t&&(t.name&&(i=t.name),t.extension&&(e=t.extension));const n=await this._getElement(e);if(n)if("svg"===e.toLowerCase()){let t=(new XMLSerializer).serializeToString(n);t='<?xml version="1.0" standalone="no"?>\r\n'+t,o(`data:${N(e)};charset=utf-8,${encodeURIComponent(t)}`,`${i}.svg`)}else o(n.toDataURL(N(e)),`${i}.${e}`)}}const O=S})(),n.default})();const c=d(l.exports=h()),u={CONNECT_WITH_METAMASK:"Connect with Metamask",USE_EXTENSION:"Use extension",USE_MOBILE:"Use mobile",ONE_CLICK_CONNECT:"Connect in one click to the MetaMask extension.",CONNECT_WITH_EXTENSION:"Connect With Extension",SCAN_TO_CONNECT:"Scan to connect with the MetaMask mobile app.",DESKTOP:"Desktop",MOBILE:"Mobile",META_MASK_MOBILE_APP:"MetaMask mobile app",INSTALL_MODAL:{TRUSTED_BY_USERS:"Trusted by over 30 million users to buy, store, send and swap crypto securely",LEADING_CRYPTO_WALLET:"The leading crypto wallet & gateway to blockchain apps built on Ethereum Mainnet, Polygon, Optimism, and many other networks",CONTROL_DIGITAL_INTERACTIONS:"Puts you in control of your digital interactions by making power of cryptography more accessible",INSTALL_META_MASK_EXTENSION_BUTTON:"Install MetaMask Extension",INSTALL_META_MASK_EXTENSION_TEXT:"Install and try the MetaMask browser extension."},PENDING_MODAL:{OPEN_META_MASK_SELECT_CODE:"Please open the MetaMask wallet app and select the code on the screen OR disconnect",OPEN_META_MASK_CONTINUE:"Open the MetaMask app to continue with your session.",NUMBER_AFTER_OPEN_NOTICE:"If a number doesn't appear after opening MetaMask, please click disconnect and re-scan the QRCode.",DISCONNECT:"Disconnect"},SELECT_MODAL:{CRYPTO_TAKE_CONTROL_TEXT:"Take control of your crypto and explore the blockchain with the wallet trusted by over 30 million people worldwide"},META_MASK_MODAL:{ADDRESS_COPIED:"Address copied to clipboard!",DISCONNECT:"Disconnect",ACTIVE_NETWORK:"Active Network"}};class g{constructor(t){var e;this.translations=u,this.supportedLocales=["es","fr","he","it","pt","tr"],this.baseUrl=null!==(e=null==t?void 0:t.baseUrl)&&void 0!==e?e:"https://raw.githubusercontent.com/MetaMask/metamask-sdk/refs/heads/gh-pages/locales"}getBrowserLanguage(){if((navigator.languages||[navigator.language]).some((t=>t.toLowerCase().startsWith("en"))))return"en";const t=navigator.language.toLowerCase().split("-")[0];return this.supportedLocales.includes(t)?t:"en"}async init(t){const e=this.getBrowserLanguage()||t.fallbackLng;await this.loadTranslations(e)}async loadTranslations(t){const e=t.split("-")[0];if("en"!==e&&this.supportedLocales.includes(e))try{const t=`${this.baseUrl}/${e}.json`,i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);this.translations=await i.json()}catch(t){console.warn(`❌ Failed to load ${e} translations, falling back to English:`,t),this.translations=u}else this.translations=u}t(t){return this.getNestedTranslation(t,this.translations)||t}getNestedTranslation(t,e){const i=t.split(".");let n=e;for(const t of i){if("object"!=typeof n)return"";n=n[t]}return"string"==typeof n?n:""}}const p=class{constructor(i){t(this,i),this.close=e(this,"close",7),this.startDesktopOnboarding=e(this,"startDesktopOnboarding",7),this.updateLink=e(this,"updateLink",7),this.updateExpiresIn=e(this,"updateExpiresIn",7),this.link=void 0,this.expiresIn=void 0,this.showInstallModal=void 0,this.translationsLoaded=!1,this.onClose=this.onClose.bind(this),this.onStartDesktopOnboardingHandler=this.onStartDesktopOnboardingHandler.bind(this),this.render=this.render.bind(this),this.i18nInstance=new g}componentDidLoad(){this.generateQRCode(this.link)}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}generateQRCode(t){if(!this.qrCodeContainer)return;const e=new c({data:t,type:"svg",image:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDIgMTM3Ij4KICA8cGF0aCBmaWxsPSIjRkY1QzE2IiBkPSJtMTMyLjI0IDEzMS43NTEtMzAuNDgxLTkuMDc2LTIyLjk4NiAxMy43NDEtMTYuMDM4LS4wMDctMjMtMTMuNzM0LTMwLjQ2NyA5LjA3NkwwIDEwMC40NjVsOS4yNjgtMzQuNzIzTDAgMzYuMzg1IDkuMjY4IDBsNDcuNjA3IDI4LjQ0M2gyNy43NTdMMTMyLjI0IDBsOS4yNjggMzYuMzg1LTkuMjY4IDI5LjM1NyA5LjI2OCAzNC43MjMtOS4yNjggMzEuMjg2WiIvPgogIDxwYXRoIGZpbGw9IiNGRjVDMTYiIGQ9Im05LjI3NCAwIDQ3LjYwOCAyOC40NjMtMS44OTMgMTkuNTM0TDkuMjc0IDBabTMwLjQ2OCAxMDAuNDc4IDIwLjk0NyAxNS45NTctMjAuOTQ3IDYuMjR2LTIyLjE5N1ptMTkuMjczLTI2LjM4MUw1NC45ODkgNDguMDFsLTI1Ljc3IDE3Ljc0LS4wMTQtLjAwN3YuMDEzbC4wOCAxOC4yNiAxMC40NS05LjkxOGgxOS4yOFpNMTMyLjI0IDAgODQuNjMyIDI4LjQ2M2wxLjg4NyAxOS41MzRMMTMyLjI0IDBabS0zMC40NjcgMTAwLjQ3OC0yMC45NDggMTUuOTU3IDIwLjk0OCA2LjI0di0yMi4xOTdabTEwLjUyOS0zNC43MjNoLjAwNy0uMDA3di0uMDEzbC0uMDA2LjAwNy0yNS43Ny0xNy43MzlMODIuNSA3NC4wOTdoMTkuMjcybDEwLjQ1NyA5LjkxNy4wNzMtMTguMjU5WiIvPgogIDxwYXRoIGZpbGw9IiNFMzQ4MDciIGQ9Im0zOS43MzUgMTIyLjY3NS0zMC40NjcgOS4wNzZMMCAxMDAuNDc4aDM5LjczNXYyMi4xOTdaTTU5LjAwOCA3NC4wOWw1LjgyIDM3LjcxNC04LjA2Ni0yMC45Ny0yNy40OS02LjgyIDEwLjQ1Ni05LjkyM2gxOS4yOFptNDIuNzY0IDQ4LjU4NSAzMC40NjggOS4wNzYgOS4yNjgtMzEuMjczaC0zOS43MzZ2MjIuMTk3Wk04Mi41IDc0LjA5bC01LjgyIDM3LjcxNCA4LjA2NS0yMC45NyAyNy40OTEtNi44Mi0xMC40NjMtOS45MjNIODIuNVoiLz4KICA8cGF0aCBmaWxsPSIjRkY4RDVEIiBkPSJtMCAxMDAuNDY1IDkuMjY4LTM0LjcyM2gxOS45M2wuMDczIDE4LjI2NiAyNy40OTIgNi44MiA4LjA2NSAyMC45NjktNC4xNDYgNC42MTgtMjAuOTQ3LTE1Ljk1N0gwdi4wMDdabTE0MS41MDggMC05LjI2OC0zNC43MjNoLTE5LjkzMWwtLjA3MyAxOC4yNjYtMjcuNDkgNi44Mi04LjA2NiAyMC45NjkgNC4xNDUgNC42MTggMjAuOTQ4LTE1Ljk1N2gzOS43MzV2LjAwN1pNODQuNjMyIDI4LjQ0M0g1Ni44NzVMNTQuOTkgNDcuOTc3bDkuODM5IDYzLjhINzYuNjhsOS44NDUtNjMuOC0xLjg5My0xOS41MzRaIi8+CiAgPHBhdGggZmlsbD0iIzY2MTgwMCIgZD0iTTkuMjY4IDAgMCAzNi4zODVsOS4yNjggMjkuMzU3aDE5LjkzbDI1Ljc4NC0xNy43NDVMOS4yNjggMFptNDMuOTggODEuNjY1aC05LjAyOWwtNC45MTYgNC44MTkgMTcuNDY2IDQuMzMtMy41MjEtOS4xNTV2LjAwNlpNMTMyLjI0IDBsOS4yNjggMzYuMzg1LTkuMjY4IDI5LjM1N2gtMTkuOTMxTDg2LjUyNiA0Ny45OTcgMTMyLjI0IDBaTTg4LjI3MyA4MS42NjVoOS4wNDJsNC45MTYgNC44MjUtMTcuNDg2IDQuMzM4IDMuNTI4LTkuMTd2LjAwN1ptLTkuNTA3IDQyLjMwNSAyLjA2LTcuNTQyLTQuMTQ2LTQuNjE4SDY0LjgybC00LjE0NSA0LjYxOCAyLjA1OSA3LjU0MiIvPgogIDxwYXRoIGZpbGw9IiNDMEM0Q0QiIGQ9Ik03OC43NjYgMTIzLjk2OXYxMi40NTNINjIuNzM1di0xMi40NTNoMTYuMDNaIi8+CiAgPHBhdGggZmlsbD0iI0U3RUJGNiIgZD0ibTM5Ljc0MiAxMjIuNjYyIDIzLjAwNiAxMy43NTR2LTEyLjQ1M2wtMi4wNi03LjU0MS0yMC45NDYgNi4yNFptNjIuMDMxIDAtMjMuMDA3IDEzLjc1NHYtMTIuNDUzbDIuMDYtNy41NDEgMjAuOTQ3IDYuMjRaIi8+Cjwvc3ZnPgo=",imageOptions:{hideBackgroundDots:!0,crossOrigin:void 0,imageSize:.3,saveAsBlob:!1},dotsOptions:{color:"#222222",type:"square",gradient:void 0,roundSize:!1},cornersSquareOptions:{color:"#222222",type:"square",gradient:void 0},cornersDotOptions:{color:"#ff5c16"},backgroundOptions:{color:"transparent"},qrOptions:{typeNumber:0,mode:"Byte",errorCorrectionLevel:"Q"}});this.qrCodeContainer.innerHTML="",e.append(this.qrCodeContainer)}onClose(t=!1){this.close.emit({shouldTerminate:t})}onStartDesktopOnboardingHandler(){this.startDesktopOnboarding.emit()}updateLinkHandler(t){this.generateQRCode(t)}updateExpiresInHandler(t){console.debug("QRCode expires in:",t)}render(){if(!this.translationsLoaded)return null;const t=t=>this.i18nInstance.t(t),e=this.showInstallModal;return i(r,{className:"install-model"},i("div",{class:"backdrop",onClick:()=>this.onClose(!0)}),i("div",{class:"modal"},i("div",{class:"closeButtonContainer"},i("div",{class:"right"},i("span",{class:"closeButton",onClick:()=>this.onClose(!0)},i(a,null)))),i("div",{class:"modalHeader"},i("h2",{class:"modalTitle"},t("CONNECT_WITH_METAMASK"))),i("div",{class:"modalContent"},e?i("div",null,i("div",{class:"connectionSection"},i("h3",{class:"sectionTitle"},t("USE_EXTENSION")),i("p",{class:"sectionDescription"},t("ONE_CLICK_CONNECT")),i("button",{class:"button extensionButton",onClick:()=>this.onStartDesktopOnboardingHandler()},i(s,null),i("span",{class:"buttonText"},t("CONNECT_WITH_EXTENSION")))),i("div",{class:"sectionDivider"}),i("div",{class:"connectionSection"},i("h3",{class:"sectionTitle"},t("USE_MOBILE")),i("p",{class:"sectionDescription"},t("SCAN_TO_CONNECT")),i("div",{class:"qrContainer"},i("div",{id:"sdk-mm-qrcode",class:"qrCode",ref:t=>{t&&(this.qrCodeContainer=t)}})))):i("div",null,i("div",{class:"connectionSection"},i("h3",{class:"sectionTitle"},t("USE_MOBILE")),i("p",{class:"sectionDescription"},t("SCAN_TO_CONNECT")),i("div",{class:"qrContainer"},i("div",{id:"sdk-mm-qrcode",class:"qrCode",ref:t=>{t&&(this.qrCodeContainer=t)}}))),i("div",{class:"sectionDivider"}),i("div",{class:"connectionSection"},i("h3",{class:"sectionTitle"},t("USE_EXTENSION")),i("p",{class:"sectionDescription"},t("INSTALL_MODAL.INSTALL_META_MASK_EXTENSION_TEXT")),i("button",{class:"button extensionButton",onClick:()=>this.onStartDesktopOnboardingHandler()},i(s,null),i("span",{class:"buttonText"},t("INSTALL_MODAL.INSTALL_META_MASK_EXTENSION_BUTTON"))))))))}get el(){return n(this)}static get watchers(){return{link:["updateLinkHandler"],expiresIn:["updateExpiresInHandler"]}}};p.style="@font-face{font-family:'Euclid Circular B';src:url('../assets/fonts/Euclid Circular B Regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}.flexContainer{display:flex;justify-content:center;align-items:center;flex-direction:row}.flexItem11{flex:11;justify-content:center;align-items:center}.flexItem1{flex:1;justify-content:center;align-items:center}.button{margin-top:41.5px;margin-bottom:20px;width:100%;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px 20px;background:#0376C9;border-radius:32px;color:white;border:0;font-size:14px;cursor:pointer}.backdrop{visibility:visible;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;z-index:99998;background:rgba(0, 0, 0, 0.87);opacity:0.3}.modal{visibility:visible;position:fixed;left:50%;transform:translate(-50%, -50%);z-index:99999;background:white;padding:20px;border-radius:8px;top:50%;max-width:360px;width:460px;min-width:300px;box-shadow:rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;-webkit-font-smoothing:antialiased}.sectionDivider{height:1px;background-color:#B7BBC866;margin-top:17px;margin-bottom:10px}.closeButtonContainer{position:absolute;right:15px;top:15px;padding:10px;user-select:none}.buttonText{margin-left:10px}.closeButton{color:#BBC0C5;cursor:pointer;user-select:none}.right{display:flex;align-items:center;justify-content:right}#sdk-mm-qrcode{margin-top:10px;margin-bottom:10px;display:flex;justify-content:center;align-items:center;border:none !important;outline:none !important;box-shadow:none !important}#sdk-mm-qrcode svg{width:100% !important;height:auto !important;border:none !important;outline:none !important;box-shadow:none !important;stroke:none !important;stroke-width:0 !important;background:transparent !important}*{font-family:'Euclid Circular B', sans-serif}.modalTitle{font-size:16px;font-weight:700;letter-spacing:0px;line-height:24px;color:#141618;margin-top:4px;text-align:center;user-select:none}.sectionTitle{text-align:center;font-size:14px;font-weight:500;margin-bottom:0px;margin-top:20px;font-weight:bold}.sectionDescription{text-align:center;font-size:14px;font-weight:400;margin-top:5px;color:#6A737D}.extensionButton{padding:15px 20px;margin-top:15px;margin-bottom:0px}.qrContainer{display:flex;justify-content:center;align-items:center;width:100%}.qrCode{margin:0 auto;display:flex;justify-content:center;align-items:center}";const f=class{constructor(i){t(this,i),this.close=e(this,"close",7),this.disconnect=e(this,"disconnect",7),this.updateOTPCode=e(this,"updateOTPCode",7),this.displayOTP=void 0,this.otpCode=void 0,this.translationsLoaded=!1,this.i18nInstance=new g}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}onClose(){this.close.emit()}onDisconnect(){this.disconnect.emit()}onUpdateOTPValueHandler(t){this.updateOTPCode.emit({otpCode:t})}disconnectedCallback(){this.onClose()}render(){var t;if(!this.translationsLoaded)return null;const e=null===(t=this.displayOTP)||void 0===t||t,n=t=>this.i18nInstance.t(t);return i(r,{className:"pending-modal"},i("div",{class:"backdrop",onClick:()=>this.onClose()}),i("div",{class:"modal"},i("div",{class:"closeButtonContainer"},i("div",{class:"right"},i("span",{class:"closeButton",onClick:()=>this.onClose()},i(a,null)))),i("div",{class:"logoContainer"},i(s,null)),i("div",null,i("div",{class:"flexContainer",style:{flexDirection:"column",color:"black"}},i("div",{class:"flexItem",style:{textAlign:"center",marginTop:"30px",marginBottom:"30px",fontSize:"16px"}},n(e?"PENDING_MODAL.OPEN_META_MASK_SELECT_CODE":"PENDING_MODAL.OPEN_META_MASK_CONTINUE")),i("div",{id:"sdk-mm-otp-value",style:{padding:"10px",fontSize:"32px",display:this.otpCode?"block":"none"}},this.otpCode),e&&i("div",{class:"notice"},"* ",n("PENDING_MODAL.NUMBER_AFTER_OPEN_NOTICE"))),i("div",{style:{marginTop:"20px"}},i("button",{class:"button blue",style:{marginTop:"5px",color:"#0376C9",borderColor:"#0376C9",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white"},onClick:()=>this.onDisconnect()},n("PENDING_MODAL.DISCONNECT"))))))}get el(){return n(this)}};f.style="@font-face{font-family:'Euclid Circular B';src:url('../assets/fonts/Euclid Circular B Regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}.flexContainer{display:flex;justify-content:center;align-items:center;flex-direction:row}.flexItem11{flex:11;justify-content:center;align-items:center}.flexItem1{flex:1;justify-content:center;align-items:center}.button{margin-top:41.5px;margin-bottom:20px;width:100%;display:flex;flex-direction:row;justify-content:center;align-items:center;padding:12px 20px;background:#0376C9;border-radius:32px;color:white;border:0;font-size:14px;cursor:pointer}.backdrop{visibility:visible;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;z-index:99998;background:rgba(0, 0, 0, 0.87);opacity:0.3}.modal{visibility:visible;position:fixed;left:50%;transform:translate(-50%, -50%);z-index:99999;background:white;padding:20px;border-radius:8px;top:50%;max-width:360px;width:460px;min-width:300px;box-shadow:rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;-webkit-font-smoothing:antialiased}.sectionDivider{height:1px;background-color:#B7BBC866;margin-top:17px;margin-bottom:10px}.closeButtonContainer{position:absolute;right:15px;top:15px;padding:10px;user-select:none}.buttonText{margin-left:10px}.closeButton{color:#BBC0C5;cursor:pointer;user-select:none}.right{display:flex;align-items:center;justify-content:right}#sdk-mm-qrcode{margin-top:10px;margin-bottom:10px;display:flex;justify-content:center;align-items:center;border:none !important;outline:none !important;box-shadow:none !important}#sdk-mm-qrcode svg{width:100% !important;height:auto !important;border:none !important;outline:none !important;box-shadow:none !important;stroke:none !important;stroke-width:0 !important;background:transparent !important}*{font-family:'Euclid Circular B', sans-serif}.modalTitle{font-size:16px;font-weight:700;letter-spacing:0px;line-height:24px;color:#141618;margin-top:4px;text-align:center;user-select:none}.sectionTitle{text-align:center;font-size:14px;font-weight:500;margin-bottom:0px;margin-top:20px;font-weight:bold}.sectionDescription{text-align:center;font-size:14px;font-weight:400;margin-top:5px;color:#6A737D}.extensionButton{padding:15px 20px;margin-top:15px;margin-bottom:0px}.qrContainer{display:flex;justify-content:center;align-items:center;width:100%}.qrCode{margin:0 auto;display:flex;justify-content:center;align-items:center}";export{p as mm_install_modal,f as mm_otp_modal};
@@ -1,4 +1,4 @@
1
- import{y as e,c as t,z as r}from"./index-de489272.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/address";import"@ethersproject/abstract-signer";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";var n={exports:{}},i=e(n.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=262)}([function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){(function(e){
1
+ import{y as e,c as t,z as r}from"./index-46da6d5f.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/address";import"@ethersproject/abstract-signer";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";var n={exports:{}},i=e(n.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=262)}([function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){(function(e){
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *
@@ -0,0 +1 @@
1
+ import{EthereumProvider as e}from"./index.es-2327b5db.js";import{M as o,N as t,z as r}from"./index-46da6d5f.js";import"@ethersproject/address";import"events";import"./_commonjs-dynamic-modules-7cfc9805.js";import"./__tslib-6e4ae2f5.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/abstract-signer";import"buffer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"@ethersproject/constants";import"@ethersproject/transactions";async function n({chainId:n,rpcUrl:a,rpc:c,walletConnectParams:s,darkMode:i},p){let d,m,l="wss://relay.walletconnect.com",h=!0;s&&(l=s.bridge||l,h=void 0!==s.qrcode?s.qrcode:h,s.infuraId,m=s.qrModalOptions||void 0),c?d=c:n&&a&&(d={[n]:a});const j=o(),b=await e.init({projectId:s?.projectId,chains:n?[n]:[],showQrModal:!j,rpcMap:d,qrModalOptions:{themeMode:i?"dark":"light",...m}});return b.on("display_uri",(e=>{m?.openCallback&&m.openCallback(e)})),b.on("connect",p.connect),b.on("disconnect",(e=>{p.disconnect(e),p.accountsChanged([])})),b.on("accountsChanged",p.accountsChanged),b.on("chainChanged",p.chainChanged),b.on("message",(({type:e,data:o})=>p.message(e,o))),new Promise((async e=>{j?(b.once("display_uri",(o=>{let n=o;t()&&(n=`rainbow://wc?uri=${encodeURIComponent(o)}&connector=rainbowkit`),window.location.href=n,e(r(b))})),b.enable()):(await b.enable(),e(r(b)))}))}export{n as default};
@@ -0,0 +1 @@
1
+ import{c as r}from"./index-46da6d5f.js";import{r as e,s as a}from"./sha256-ad86865d.js";var t,s={exports:{}};function o(){return t?s.exports:(t=1,s.exports=(c=e(),a.exports,o=(r=c).lib.WordArray,i=r.algo,n=i.SHA256,d=i.SHA224=n.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var r=n._doFinalize.call(this);return r.sigBytes-=4,r}}),r.SHA224=n._createHelper(d),r.HmacSHA224=n._createHmacHelper(d),c.SHA224));var r,o,i,n,d,c}export{o as r};
@@ -1 +1 @@
1
- import{c as t,r as n}from"./index-de489272.js";import{c as r}from"./_commonjs-dynamic-modules-7cfc9805.js";var e,i={exports:{}};function o(){return e||(e=1,i.exports=(o=o||function(e,i){var o;if("undefined"!=typeof window&&window.crypto&&(o=window.crypto),"undefined"!=typeof self&&self.crypto&&(o=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(o=globalThis.crypto),!o&&"undefined"!=typeof window&&window.msCrypto&&(o=window.msCrypto),!o&&void 0!==t&&t.crypto&&(o=t.crypto),!o&&"function"==typeof r)try{o=n}catch(t){}var s=function(){if(o){if("function"==typeof o.getRandomValues)try{return o.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof o.randomBytes)try{return o.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function t(){}return function(n){var r;return t.prototype=n,r=new t,t.prototype=null,r}}(),c={},f=c.lib={},u=f.Base={extend:function(t){var n=a(this);return t&&n.mixIn(t),n.hasOwnProperty("init")&&this.init!==n.init||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},h=f.WordArray=u.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=n!=i?n:4*t.length},toString:function(t){return(t||d).stringify(this)},concat:function(t){var n=this.words,r=t.words,e=this.sigBytes,i=t.sigBytes;if(this.clamp(),e%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;n[e+o>>>2]|=s<<24-(e+o)%4*8}else for(var a=0;a<i;a+=4)n[e+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var n=[],r=0;r<t;r+=4)n.push(s());return new h.init(n,t)}}),p=c.enc={},d=p.Hex={stringify:function(t){for(var n=t.words,r=t.sigBytes,e=[],i=0;i<r;i++){var o=n[i>>>2]>>>24-i%4*8&255;e.push((o>>>4).toString(16)),e.push((15&o).toString(16))}return e.join("")},parse:function(t){for(var n=t.length,r=[],e=0;e<n;e+=2)r[e>>>3]|=parseInt(t.substr(e,2),16)<<24-e%8*4;return new h.init(r,n/2)}},l=p.Latin1={stringify:function(t){for(var n=t.words,r=t.sigBytes,e=[],i=0;i<r;i++){var o=n[i>>>2]>>>24-i%4*8&255;e.push(String.fromCharCode(o))}return e.join("")},parse:function(t){for(var n=t.length,r=[],e=0;e<n;e++)r[e>>>2]|=(255&t.charCodeAt(e))<<24-e%4*8;return new h.init(r,n)}},y=p.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return l.parse(unescape(encodeURIComponent(t)))}},g=f.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=y.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,f=e.min(4*c,o);if(c){for(var u=0;u<c;u+=s)this._doProcessBlock(i,u);n=i.splice(0,c),r.sigBytes-=f}return new h.init(n,f)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});f.Hasher=g.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(n,r){return new t.init(r).finalize(n)}},_createHmacHelper:function(t){return function(n,r){return new w.HMAC.init(t,r).finalize(n)}}});var w=c.algo={};return c}(Math),o)),i.exports;var o}var s,a={exports:{}};function c(){return s?a.exports:(s=1,a.exports=(t=o(),function(n){var r=t,e=r.lib,i=e.WordArray,o=e.Hasher,s=r.algo,a=[],c=[];!function(){function t(t){for(var r=n.sqrt(t),e=2;e<=r;e++)if(!(t%e))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var e=2,i=0;i<64;)t(e)&&(i<8&&(a[i]=r(n.pow(e,.5))),c[i]=r(n.pow(e,1/3)),i++),e++}();var f=[],u=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(t,n){for(var r=this._hash.words,e=r[0],i=r[1],o=r[2],s=r[3],a=r[4],u=r[5],h=r[6],p=r[7],d=0;d<64;d++){if(d<16)f[d]=0|t[n+d];else{var l=f[d-15],y=(l<<25|l>>>7)^(l<<14|l>>>18)^l>>>3,g=f[d-2],w=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;f[d]=y+f[d-7]+w+f[d-16]}var v=e&i^e&o^i&o,m=(e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22),_=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&h)+c[d]+f[d];p=h,h=u,u=a,a=s+_|0,s=o,o=i,i=e,e=_+(m+v)|0}r[0]=r[0]+e|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+u|0,r[6]=r[6]+h|0,r[7]=r[7]+p|0},_doFinalize:function(){var t=this._data,r=t.words,e=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=n.floor(e/4294967296),r[15+(i+64>>>9<<4)]=e,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});r.SHA256=o._createHelper(u),r.HmacSHA256=o._createHmacHelper(u)}(Math),t.SHA256));var t}export{c as a,o as r};
1
+ import{c as t,r as n}from"./index-46da6d5f.js";import{c as r}from"./_commonjs-dynamic-modules-7cfc9805.js";var e,i={exports:{}};function o(){return e||(e=1,i.exports=(o=o||function(e,i){var o;if("undefined"!=typeof window&&window.crypto&&(o=window.crypto),"undefined"!=typeof self&&self.crypto&&(o=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(o=globalThis.crypto),!o&&"undefined"!=typeof window&&window.msCrypto&&(o=window.msCrypto),!o&&void 0!==t&&t.crypto&&(o=t.crypto),!o&&"function"==typeof r)try{o=n}catch(t){}var s=function(){if(o){if("function"==typeof o.getRandomValues)try{return o.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof o.randomBytes)try{return o.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function t(){}return function(n){var r;return t.prototype=n,r=new t,t.prototype=null,r}}(),c={},f=c.lib={},u=f.Base={extend:function(t){var n=a(this);return t&&n.mixIn(t),n.hasOwnProperty("init")&&this.init!==n.init||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},h=f.WordArray=u.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=n!=i?n:4*t.length},toString:function(t){return(t||d).stringify(this)},concat:function(t){var n=this.words,r=t.words,e=this.sigBytes,i=t.sigBytes;if(this.clamp(),e%4)for(var o=0;o<i;o++){var s=r[o>>>2]>>>24-o%4*8&255;n[e+o>>>2]|=s<<24-(e+o)%4*8}else for(var a=0;a<i;a+=4)n[e+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var n=[],r=0;r<t;r+=4)n.push(s());return new h.init(n,t)}}),p=c.enc={},d=p.Hex={stringify:function(t){for(var n=t.words,r=t.sigBytes,e=[],i=0;i<r;i++){var o=n[i>>>2]>>>24-i%4*8&255;e.push((o>>>4).toString(16)),e.push((15&o).toString(16))}return e.join("")},parse:function(t){for(var n=t.length,r=[],e=0;e<n;e+=2)r[e>>>3]|=parseInt(t.substr(e,2),16)<<24-e%8*4;return new h.init(r,n/2)}},l=p.Latin1={stringify:function(t){for(var n=t.words,r=t.sigBytes,e=[],i=0;i<r;i++){var o=n[i>>>2]>>>24-i%4*8&255;e.push(String.fromCharCode(o))}return e.join("")},parse:function(t){for(var n=t.length,r=[],e=0;e<n;e++)r[e>>>2]|=(255&t.charCodeAt(e))<<24-e%4*8;return new h.init(r,n)}},y=p.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return l.parse(unescape(encodeURIComponent(t)))}},g=f.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=y.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,f=e.min(4*c,o);if(c){for(var u=0;u<c;u+=s)this._doProcessBlock(i,u);n=i.splice(0,c),r.sigBytes-=f}return new h.init(n,f)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});f.Hasher=g.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(n,r){return new t.init(r).finalize(n)}},_createHmacHelper:function(t){return function(n,r){return new w.HMAC.init(t,r).finalize(n)}}});var w=c.algo={};return c}(Math),o)),i.exports;var o}var s,a={exports:{}};a.exports=(s=o(),function(t){var n=s,r=n.lib,e=r.WordArray,i=r.Hasher,o=n.algo,a=[],c=[];!function(){function n(n){for(var r=t.sqrt(n),e=2;e<=r;e++)if(!(n%e))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var e=2,i=0;i<64;)n(e)&&(i<8&&(a[i]=r(t.pow(e,.5))),c[i]=r(t.pow(e,1/3)),i++),e++}();var f=[],u=o.SHA256=i.extend({_doReset:function(){this._hash=new e.init(a.slice(0))},_doProcessBlock:function(t,n){for(var r=this._hash.words,e=r[0],i=r[1],o=r[2],s=r[3],a=r[4],u=r[5],h=r[6],p=r[7],d=0;d<64;d++){if(d<16)f[d]=0|t[n+d];else{var l=f[d-15],y=(l<<25|l>>>7)^(l<<14|l>>>18)^l>>>3,g=f[d-2],w=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;f[d]=y+f[d-7]+w+f[d-16]}var v=e&i^e&o^i&o,m=(e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22),_=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&h)+c[d]+f[d];p=h,h=u,u=a,a=s+_|0,s=o,o=i,i=e,e=_+(m+v)|0}r[0]=r[0]+e|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+u|0,r[6]=r[6]+h|0,r[7]=r[7]+p|0},_doFinalize:function(){var n=this._data,r=n.words,e=8*this._nDataBytes,i=8*n.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(e/4294967296),r[15+(i+64>>>9<<4)]=e,n.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});n.SHA256=i._createHelper(u),n.HmacSHA256=i._createHmacHelper(u)}(Math),s.SHA256);export{o as r,a as s};
@@ -1 +1 @@
1
- import{getAddress as t}from"@ethersproject/address";import{hexZeroPad as r,hexConcat as n,isHexString as e,hexlify as o,arrayify as i}from"@ethersproject/bytes";import{L as s,B as a,k as c}from"./index-de489272.js";import{defineReadOnly as f,deepCopy as u,shallowCopy as h}from"@ethersproject/properties";import{i as m}from"./id-6dc2a6aa.js";const y="hash/5.7.0";var p=function(t,r,n,e){return new(n||(n=Promise))((function(o,i){function s(t){try{c(e.next(t))}catch(t){i(t)}}function a(t){try{c(e.throw(t))}catch(t){i(t)}}function c(t){var r;t.done?o(t.value):(r=t.value,r instanceof n?r:new n((function(t){t(r)}))).then(s,a)}c((e=e.apply(t,r||[])).next())}))};const d=new s(y),g=new Uint8Array(32);g.fill(0);const l=a.from(-1),v=a.from(0),w=a.from(1),E=a.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const A=r(w.toHexString(),32),$=r(v.toHexString(),32),b={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},x=["name","version","chainId","verifyingContract","salt"];function S(t){return function(r){return"string"!=typeof r&&d.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,r),r}}const C={name:S("name"),version:S("version"),chainId:function(t){try{return a.from(t).toString()}catch(t){}return d.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(r){try{return t(r).toLowerCase()}catch(t){}return d.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(t){try{const r=i(t);if(32!==r.length)throw new Error("bad length");return o(r)}catch(t){}return d.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function O(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const n=""===t[1],o=parseInt(t[2]||"256");(o%8!=0||o>256||t[2]&&t[2]!==String(o))&&d.throwArgumentError("invalid numeric width","type",e);const i=E.mask(n?o-1:o),s=n?i.add(w).mul(l):v;return function(t){const n=a.from(t);return(n.lt(s)||n.gt(i))&&d.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),r(n.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&d.throwArgumentError("invalid bytes width","type",e),function(t){return i(t).length!==r&&d.throwArgumentError(`invalid length for ${e}`,"value",t),function(t){const r=i(t),e=r.length%32;return e?n([r,g.slice(e)]):o(r)}(t)}}}switch(e){case"address":return function(n){return r(t(n),32)};case"bool":return function(t){return t?A:$};case"bytes":return function(t){return c(t)};case"string":return function(t){return m(t)}}return null}function I(t,r){return`${t}(${r.map((({name:t,type:r})=>r+" "+t)).join(",")})`}class _{constructor(t){f(this,"types",Object.freeze(u(t))),f(this,"_encoderCache",{}),f(this,"_types",{});const r={},n={},e={};Object.keys(t).forEach((t=>{r[t]={},n[t]=[],e[t]={}}));for(const e in t){const o={};t[e].forEach((i=>{o[i.name]&&d.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(e)}`,"types",t),o[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===e&&d.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);O(s)||(n[s]||d.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),n[s].push(e),r[e][s]=!0)}))}const o=Object.keys(n).filter((t=>0===n[t].length));0===o.length?d.throwArgumentError("missing primary type","types",t):o.length>1&&d.throwArgumentError(`ambiguous primary types or unused types: ${o.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),f(this,"primaryType",o[0]),function o(i,s){s[i]&&d.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",t),s[i]=!0,Object.keys(r[i]).forEach((t=>{n[t]&&(o(t,s),Object.keys(s).forEach((r=>{e[r][t]=!0})))})),delete s[i]}(this.primaryType,{});for(const r in e){const n=Object.keys(e[r]);n.sort(),this._types[r]=I(r,t[r])+n.map((r=>I(r,t[r]))).join("")}}getEncoder(t){let r=this._encoderCache[t];return r||(r=this._encoderCache[t]=this._getEncoder(t)),r}_getEncoder(t){{const r=O(t);if(r)return r}const r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const t=r[1],e=this.getEncoder(t),o=parseInt(r[3]);return r=>{o>=0&&r.length!==o&&d.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r);let i=r.map(e);return this._types[t]&&(i=i.map(c)),c(n(i))}}const e=this.types[t];if(e){const r=m(this._types[t]);return t=>{const o=e.map((({name:r,type:n})=>{const e=this.getEncoder(n)(t[r]);return this._types[n]?c(e):e}));return o.unshift(r),n(o)}}return d.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const r=this._types[t];return r||d.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),r}encodeData(t,r){return this.getEncoder(t)(r)}hashStruct(t,r){return c(this.encodeData(t,r))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,r,n){if(O(t))return n(t,r);const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],o=parseInt(e[3]);return o>=0&&r.length!==o&&d.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map((r=>this._visit(t,r,n)))}const o=this.types[t];return o?o.reduce(((t,{name:e,type:o})=>(t[e]=this._visit(o,r[e],n),t)),{}):d.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,r){return this._visit(this.primaryType,t,r)}static from(t){return new _(t)}static getPrimaryType(t){return _.from(t).primaryType}static hashStruct(t,r,n){return _.from(r).hashStruct(t,n)}static hashDomain(t){const r=[];for(const n in t){const e=b[n];e||d.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),r.push({name:n,type:e})}return r.sort(((t,r)=>x.indexOf(t.name)-x.indexOf(r.name))),_.hashStruct("EIP712Domain",{EIP712Domain:r},t)}static encode(t,r,e){return n(["0x1901",_.hashDomain(t),_.from(r).hash(e)])}static hash(t,r,n){return c(_.encode(t,r,n))}static resolveNames(t,r,n,o){return p(this,void 0,void 0,(function*(){t=h(t);const i={};t.verifyingContract&&!e(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const s=_.from(r);s.visit(n,((t,r)=>("address"!==t||e(r,20)||(i[r]="0x"),r)));for(const t in i)i[t]=yield o(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),n=s.visit(n,((t,r)=>"address"===t&&i[r]?i[r]:r)),{domain:t,value:n}}))}static getPayload(t,r,n){_.hashDomain(t);const e={},s=[];x.forEach((r=>{const n=t[r];null!=n&&(e[r]=C[r](n),s.push({name:r,type:b[r]}))}));const c=_.from(r),f=h(r);return f.EIP712Domain?d.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):f.EIP712Domain=s,c.encode(n),{types:f,domain:e,primaryType:c.primaryType,message:c.visit(n,((t,r)=>{if(t.match(/^bytes(\d*)/))return o(i(r));if(t.match(/^u?int/))return a.from(r).toString();switch(t){case"address":return r.toLowerCase();case"bool":return!!r;case"string":return"string"!=typeof r&&d.throwArgumentError("invalid string","value",r),r}return d.throwArgumentError("unsupported type","type",t)}))}}}export{_ as T,y as v};
1
+ import{getAddress as t}from"@ethersproject/address";import{hexZeroPad as r,hexConcat as n,isHexString as e,hexlify as o,arrayify as i}from"@ethersproject/bytes";import{L as s,B as a,k as c}from"./index-46da6d5f.js";import{defineReadOnly as f,deepCopy as u,shallowCopy as h}from"@ethersproject/properties";import{i as m}from"./id-72e0c1a1.js";const y="hash/5.7.0";var p=function(t,r,n,e){return new(n||(n=Promise))((function(o,i){function s(t){try{c(e.next(t))}catch(t){i(t)}}function a(t){try{c(e.throw(t))}catch(t){i(t)}}function c(t){var r;t.done?o(t.value):(r=t.value,r instanceof n?r:new n((function(t){t(r)}))).then(s,a)}c((e=e.apply(t,r||[])).next())}))};const d=new s(y),g=new Uint8Array(32);g.fill(0);const l=a.from(-1),v=a.from(0),w=a.from(1),E=a.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const A=r(w.toHexString(),32),$=r(v.toHexString(),32),b={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},x=["name","version","chainId","verifyingContract","salt"];function S(t){return function(r){return"string"!=typeof r&&d.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,r),r}}const C={name:S("name"),version:S("version"),chainId:function(t){try{return a.from(t).toString()}catch(t){}return d.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(r){try{return t(r).toLowerCase()}catch(t){}return d.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(t){try{const r=i(t);if(32!==r.length)throw new Error("bad length");return o(r)}catch(t){}return d.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function O(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const n=""===t[1],o=parseInt(t[2]||"256");(o%8!=0||o>256||t[2]&&t[2]!==String(o))&&d.throwArgumentError("invalid numeric width","type",e);const i=E.mask(n?o-1:o),s=n?i.add(w).mul(l):v;return function(t){const n=a.from(t);return(n.lt(s)||n.gt(i))&&d.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),r(n.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&d.throwArgumentError("invalid bytes width","type",e),function(t){return i(t).length!==r&&d.throwArgumentError(`invalid length for ${e}`,"value",t),function(t){const r=i(t),e=r.length%32;return e?n([r,g.slice(e)]):o(r)}(t)}}}switch(e){case"address":return function(n){return r(t(n),32)};case"bool":return function(t){return t?A:$};case"bytes":return function(t){return c(t)};case"string":return function(t){return m(t)}}return null}function I(t,r){return`${t}(${r.map((({name:t,type:r})=>r+" "+t)).join(",")})`}class _{constructor(t){f(this,"types",Object.freeze(u(t))),f(this,"_encoderCache",{}),f(this,"_types",{});const r={},n={},e={};Object.keys(t).forEach((t=>{r[t]={},n[t]=[],e[t]={}}));for(const e in t){const o={};t[e].forEach((i=>{o[i.name]&&d.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(e)}`,"types",t),o[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===e&&d.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);O(s)||(n[s]||d.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),n[s].push(e),r[e][s]=!0)}))}const o=Object.keys(n).filter((t=>0===n[t].length));0===o.length?d.throwArgumentError("missing primary type","types",t):o.length>1&&d.throwArgumentError(`ambiguous primary types or unused types: ${o.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),f(this,"primaryType",o[0]),function o(i,s){s[i]&&d.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",t),s[i]=!0,Object.keys(r[i]).forEach((t=>{n[t]&&(o(t,s),Object.keys(s).forEach((r=>{e[r][t]=!0})))})),delete s[i]}(this.primaryType,{});for(const r in e){const n=Object.keys(e[r]);n.sort(),this._types[r]=I(r,t[r])+n.map((r=>I(r,t[r]))).join("")}}getEncoder(t){let r=this._encoderCache[t];return r||(r=this._encoderCache[t]=this._getEncoder(t)),r}_getEncoder(t){{const r=O(t);if(r)return r}const r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const t=r[1],e=this.getEncoder(t),o=parseInt(r[3]);return r=>{o>=0&&r.length!==o&&d.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r);let i=r.map(e);return this._types[t]&&(i=i.map(c)),c(n(i))}}const e=this.types[t];if(e){const r=m(this._types[t]);return t=>{const o=e.map((({name:r,type:n})=>{const e=this.getEncoder(n)(t[r]);return this._types[n]?c(e):e}));return o.unshift(r),n(o)}}return d.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const r=this._types[t];return r||d.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),r}encodeData(t,r){return this.getEncoder(t)(r)}hashStruct(t,r){return c(this.encodeData(t,r))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,r,n){if(O(t))return n(t,r);const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],o=parseInt(e[3]);return o>=0&&r.length!==o&&d.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map((r=>this._visit(t,r,n)))}const o=this.types[t];return o?o.reduce(((t,{name:e,type:o})=>(t[e]=this._visit(o,r[e],n),t)),{}):d.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,r){return this._visit(this.primaryType,t,r)}static from(t){return new _(t)}static getPrimaryType(t){return _.from(t).primaryType}static hashStruct(t,r,n){return _.from(r).hashStruct(t,n)}static hashDomain(t){const r=[];for(const n in t){const e=b[n];e||d.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),r.push({name:n,type:e})}return r.sort(((t,r)=>x.indexOf(t.name)-x.indexOf(r.name))),_.hashStruct("EIP712Domain",{EIP712Domain:r},t)}static encode(t,r,e){return n(["0x1901",_.hashDomain(t),_.from(r).hash(e)])}static hash(t,r,n){return c(_.encode(t,r,n))}static resolveNames(t,r,n,o){return p(this,void 0,void 0,(function*(){t=h(t);const i={};t.verifyingContract&&!e(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const s=_.from(r);s.visit(n,((t,r)=>("address"!==t||e(r,20)||(i[r]="0x"),r)));for(const t in i)i[t]=yield o(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),n=s.visit(n,((t,r)=>"address"===t&&i[r]?i[r]:r)),{domain:t,value:n}}))}static getPayload(t,r,n){_.hashDomain(t);const e={},s=[];x.forEach((r=>{const n=t[r];null!=n&&(e[r]=C[r](n),s.push({name:r,type:b[r]}))}));const c=_.from(r),f=h(r);return f.EIP712Domain?d.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):f.EIP712Domain=s,c.encode(n),{types:f,domain:e,primaryType:c.primaryType,message:c.visit(n,((t,r)=>{if(t.match(/^bytes(\d*)/))return o(i(r));if(t.match(/^u?int/))return a.from(r).toString();switch(t){case"address":return r.toLowerCase();case"bool":return!!r;case"string":return"string"!=typeof r&&d.throwArgumentError("invalid string","value",r),r}return d.throwArgumentError("unsupported type","type",t)}))}}}export{_ as T,y as v};