@matchain/matchid-sdk-react 0.1.53-alpha.18 → 0.1.53-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ZMW4L3PS.mjs → chunk-Z7L7RRWB.mjs} +188 -696
- package/dist/chunk-Z7L7RRWB.mjs.map +1 -0
- package/dist/components/index.js +121 -629
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/api/index.js +36 -52
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +1 -1
- package/dist/hooks/index.js +104 -120
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.js +217 -725
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/example/dist/assets/{ccip-BDKXo6px.js → ccip-BhIcA6Sl.js} +1 -1
- package/example/dist/assets/{events-BkMSjA73.js → events-CkdpRqBF.js} +1 -1
- package/example/dist/assets/{index-CYnPIZzU.js → index-BG5XIZpE.js} +1 -1
- package/example/dist/assets/{index-BoheypMD.js → index-BsarjAeg.js} +1 -1
- package/example/dist/assets/{index-B2Qlu4MF.js → index-DK7UFFe7.js} +1 -1
- package/example/dist/assets/{index-cne7xGMC.js → index-DPb8sz1C.js} +1 -1
- package/example/dist/assets/{index-CuOEfj40.js → index-JbpWt42F.js} +1 -1
- package/example/dist/assets/{index-CbmgleoF.js → index-kAjO6hfy.js} +2 -2
- package/example/dist/assets/{index-gNKTdR8a.js → index-qgo91dsq.js} +7 -7
- package/example/dist/assets/{index.es-C16A-vcZ.js → index.es-D44wzsQe.js} +3 -3
- package/example/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZMW4L3PS.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as So,l as D,z as cn,h as Kt,A as ln,x as Fe,t as tc,C as Xl,g as eu}from"./index-gNKTdR8a.js";import{p as tu,a as ru,b as nu}from"./hooks.module-C5ONEBEq.js";import{e as un}from"./events-BkMSjA73.js";const su=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:So,default:So},Symbol.toStringTag,{value:"Module"}));var rc={},fr={},dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.walletLogo=void 0;const iu=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};dn.walletLogo=iu;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.LINK_API_URL=void 0;hn.LINK_API_URL="https://www.walletlink.org";var P={},mr={},tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.errorValues=tt.standardErrorCodes=void 0;tt.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};tt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var fn={},gn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=tt,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,b=r){if(h&&Number.isInteger(h)){const w=h.toString();if(u(t.errorValues,w))return t.errorValues[w].message;if(c(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return b}e.getMessageFromCode=n;function s(h){if(!Number.isInteger(h))return!1;const b=h.toString();return!!(t.errorValues[b]||c(h))}e.isValidCode=s;function i(h){var b;if(typeof h=="number")return h;if(o(h))return(b=h.code)!==null&&b!==void 0?b:h.errorCode}e.getErrorCode=i;function o(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function a(h,{shouldIncludeStack:b=!1}={}){const w={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&s(h.code)){const R=h;w.code=R.code,R.message&&typeof R.message=="string"?(w.message=R.message,u(R,"data")&&(w.data=R.data)):(w.message=n(w.code),w.data={originalError:l(h)})}else w.code=t.standardErrorCodes.rpc.internal,w.message=d(h,"message")?h.message:r,w.data={originalError:l(h)};return b&&(w.stack=d(h,"stack")?h.stack:void 0),w}e.serialize=a;function c(h){return h>=-32099&&h<=-32e3}function l(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,b){return Object.prototype.hasOwnProperty.call(h,b)}function d(h,b){return typeof h=="object"&&h!==null&&b in h&&typeof h[b]=="string"}})(gn);Object.defineProperty(fn,"__esModule",{value:!0});fn.standardErrors=void 0;const me=tt,nc=gn;fn.standardErrors={rpc:{parse:e=>Te(me.standardErrorCodes.rpc.parse,e),invalidRequest:e=>Te(me.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>Te(me.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>Te(me.standardErrorCodes.rpc.methodNotFound,e),internal:e=>Te(me.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Te(t,e)},invalidInput:e=>Te(me.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>Te(me.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Te(me.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Te(me.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Te(me.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Te(me.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Nt(me.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Nt(me.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Nt(me.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Nt(me.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Nt(me.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Nt(me.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new oc(t,r,n)}}};function Te(e,t){const[r,n]=sc(t);return new ic(e,r||(0,nc.getMessageFromCode)(e),n)}function Nt(e,t){const[r,n]=sc(t);return new oc(e,r||(0,nc.getMessageFromCode)(e),n)}function sc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let ic=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},oc=class extends ic{constructor(t,r,n){if(!ou(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function ou(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var pn={},Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.isErrorResponse=void 0;function au(e){return e.errorMessage!==void 0}Qt.isErrorResponse=au;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.LIB_VERSION=void 0;Yt.LIB_VERSION="3.9.3";Object.defineProperty(pn,"__esModule",{value:!0});pn.serializeError=void 0;const cu=Qt,lu=Yt,uu=tt,du=gn;function hu(e,t){const r=(0,du.serialize)(fu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",lu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=gu(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}pn.serializeError=hu;function fu(e){return typeof e=="string"?{message:e,code:uu.standardErrorCodes.rpc.internal}:(0,cu.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function gu(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=tt;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=fn;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=pn;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=gn;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(mr);var fe={};Object.defineProperty(fe,"__esModule",{value:!0});fe.ProviderType=fe.RegExpString=fe.IntNumber=fe.BigIntString=fe.AddressString=fe.HexString=fe.OpaqueType=void 0;function _r(){return e=>e}fe.OpaqueType=_r;fe.HexString=_r();fe.AddressString=_r();fe.BigIntString=_r();function pu(e){return Math.floor(e)}fe.IntNumber=pu;fe.RegExpString=_r();var Ro;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Ro||(fe.ProviderType=Ro={}));var bu=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(P,"__esModule",{value:!0});P.isMobileWeb=P.getLocation=P.isInIFrame=P.createQrUrl=P.getFavicon=P.range=P.isBigNumber=P.ensureParsedJSONObject=P.ensureBN=P.ensureRegExpString=P.ensureIntNumber=P.ensureBuffer=P.ensureAddressString=P.ensureEvenLengthHexString=P.ensureHexString=P.isHexString=P.prepend0x=P.strip0x=P.has0xPrefix=P.hexStringFromIntNumber=P.intNumberFromHexString=P.bigIntStringFromBN=P.hexStringFromBuffer=P.hexStringToUint8Array=P.uint8ArrayToHex=P.randomBytesHex=void 0;const ot=bu(cn),St=mr,Le=fe,ac=/^[0-9]*$/,cc=/^[a-f0-9]*$/;function mu(e){return lc(crypto.getRandomValues(new Uint8Array(e)))}P.randomBytesHex=mu;function lc(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}P.uint8ArrayToHex=lc;function _u(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}P.hexStringToUint8Array=_u;function wu(e,t=!1){const r=e.toString("hex");return(0,Le.HexString)(t?`0x${r}`:r)}P.hexStringFromBuffer=wu;function yu(e){return(0,Le.BigIntString)(e.toString(10))}P.bigIntStringFromBN=yu;function vu(e){return(0,Le.IntNumber)(new ot.default(yr(e,!1),16).toNumber())}P.intNumberFromHexString=vu;function Eu(e){return(0,Le.HexString)(`0x${new ot.default(e).toString(16)}`)}P.hexStringFromIntNumber=Eu;function Di(e){return e.startsWith("0x")||e.startsWith("0X")}P.has0xPrefix=Di;function bn(e){return Di(e)?e.slice(2):e}P.strip0x=bn;function uc(e){return Di(e)?`0x${e.slice(2)}`:`0x${e}`}P.prepend0x=uc;function wr(e){if(typeof e!="string")return!1;const t=bn(e).toLowerCase();return cc.test(t)}P.isHexString=wr;function dc(e,t=!1){if(typeof e=="string"){const r=bn(e).toLowerCase();if(cc.test(r))return(0,Le.HexString)(t?`0x${r}`:r)}throw St.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}P.ensureHexString=dc;function yr(e,t=!1){let r=dc(e,!1);return r.length%2===1&&(r=(0,Le.HexString)(`0${r}`)),t?(0,Le.HexString)(`0x${r}`):r}P.ensureEvenLengthHexString=yr;function Su(e){if(typeof e=="string"){const t=bn(e).toLowerCase();if(wr(t)&&t.length===40)return(0,Le.AddressString)(uc(t))}throw St.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}P.ensureAddressString=Su;function Ru(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(wr(e)){const t=yr(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw St.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}P.ensureBuffer=Ru;function hc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Le.IntNumber)(e);if(typeof e=="string"){if(ac.test(e))return(0,Le.IntNumber)(Number(e));if(wr(e))return(0,Le.IntNumber)(new ot.default(yr(e,!1),16).toNumber())}throw St.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}P.ensureIntNumber=hc;function Cu(e){if(e instanceof RegExp)return(0,Le.RegExpString)(e.toString());throw St.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}P.ensureRegExpString=Cu;function ku(e){if(e!==null&&(ot.default.isBN(e)||fc(e)))return new ot.default(e.toString(10),10);if(typeof e=="number")return new ot.default(hc(e));if(typeof e=="string"){if(ac.test(e))return new ot.default(e,10);if(wr(e))return new ot.default(yr(e,!1),16)}throw St.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}P.ensureBN=ku;function Iu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw St.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}P.ensureParsedJSONObject=Iu;function fc(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}P.isBigNumber=fc;function Au(e,t){return Array.from({length:t-e},(r,n)=>e+n)}P.range=Au;function Tu(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}P.getFavicon=Tu;function Mu(e,t,r,n,s,i){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${a}`}P.createQrUrl=Mu;function gc(){try{return window.frameElement!==null}catch{return!1}}P.isInIFrame=gc;function Nu(){try{return gc()&&window.top?window.top.location:window.location}catch{return window.location}}P.getLocation=Nu;function xu(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}P.isMobileWeb=xu;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.ScopedLocalStorage=void 0;class Lu{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const s=localStorage.key(n);typeof s=="string"&&s.startsWith(t)&&r.push(s)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}mn.ScopedLocalStorage=Lu;var Wt={};const Pu=Kt(su);var vr={},Er={},Xt={};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.EVENTS=void 0;Xt.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.RelayAbstract=xe.APP_VERSION_KEY=xe.LOCAL_STORAGE_ADDRESSES_KEY=xe.WALLET_USER_NAME_KEY=void 0;const Co=mr;xe.WALLET_USER_NAME_KEY="walletUsername";xe.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";xe.APP_VERSION_KEY="AppVersion";class Ou{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Co.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,Co.serializeError)(i,t.method);return s})}}xe.RelayAbstract=Ou;var er={},pc={exports:{}},Mi={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=ln,n=r.Buffer;function s(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=i);function i(o,a,c){return n(o,a,c)}i.prototype=Object.create(n.prototype),s(n,i),i.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},i.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(Mi,Mi.exports);var ut=Mi.exports,bc=ut.Buffer;function _n(e,t){this._block=bc.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}_n.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=bc.from(e,t));for(var r=this._block,n=this._blockSize,s=e.length,i=this._len,o=0;o<s;){for(var a=i%n,c=Math.min(s-o,n-a),l=0;l<c;l++)r[a+l]=e[o+l];i+=c,o+=c,i%n===0&&this._update(r)}return this._len+=s,this};_n.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,s=(r-n)/4294967296;this._block.writeUInt32BE(s,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i};_n.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var tr=_n,$u=Fe,mc=tr,Bu=ut.Buffer,Fu=[1518500249,1859775393,-1894007588,-899497514],Du=new Array(80);function Sr(){this.init(),this._w=Du,mc.call(this,64,56)}$u(Sr,mc);Sr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function ju(e){return e<<5|e>>>27}function Hu(e){return e<<30|e>>>2}function Uu(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Sr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var c=0;c<80;++c){var l=~~(c/20),u=ju(r)+Uu(l,n,s,i)+o+t[c]+Fu[l]|0;o=i,i=s,s=Hu(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};Sr.prototype._hash=function(){var e=Bu.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Wu=Sr,Vu=Fe,_c=tr,zu=ut.Buffer,qu=[1518500249,1859775393,-1894007588,-899497514],Gu=new Array(80);function Rr(){this.init(),this._w=Gu,_c.call(this,64,56)}Vu(Rr,_c);Rr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Ju(e){return e<<1|e>>>31}function Zu(e){return e<<5|e>>>27}function Ku(e){return e<<30|e>>>2}function Qu(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Rr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=Ju(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),u=Zu(r)+Qu(l,n,s,i)+o+t[c]+qu[l]|0;o=i,i=s,s=Ku(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};Rr.prototype._hash=function(){var e=zu.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Yu=Rr,Xu=Fe,wc=tr,ed=ut.Buffer,td=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],rd=new Array(64);function Cr(){this.init(),this._w=rd,wc.call(this,64,56)}Xu(Cr,wc);Cr.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function nd(e,t,r){return r^e&(t^r)}function sd(e,t,r){return e&t|r&(e|t)}function id(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function od(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function ad(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function cd(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Cr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<64;++u)t[u]=cd(t[u-2])+t[u-7]+ad(t[u-15])+t[u-16]|0;for(var d=0;d<64;++d){var h=l+od(o)+nd(o,a,c)+td[d]+t[d]|0,b=id(r)+sd(r,n,s)|0;l=c,c=a,a=o,o=i+h|0,i=s,s=n,n=r,r=h+b|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};Cr.prototype._hash=function(){var e=ed.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var yc=Cr,ld=Fe,ud=yc,dd=tr,hd=ut.Buffer,fd=new Array(64);function wn(){this.init(),this._w=fd,dd.call(this,64,56)}ld(wn,ud);wn.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};wn.prototype._hash=function(){var e=hd.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var gd=wn,pd=Fe,vc=tr,bd=ut.Buffer,ko=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],md=new Array(160);function kr(){this.init(),this._w=md,vc.call(this,128,112)}pd(kr,vc);kr.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Io(e,t,r){return r^e&(t^r)}function Ao(e,t,r){return e&t|r&(e|t)}function To(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Mo(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function _d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function wd(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function yd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function vd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function pe(e,t){return e>>>0<t>>>0?1:0}kr.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,s=this._ch|0,i=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,u=this._al|0,d=this._bl|0,h=this._cl|0,b=this._dl|0,w=this._el|0,R=this._fl|0,E=this._gl|0,p=this._hl|0,_=0;_<32;_+=2)t[_]=e.readInt32BE(_*4),t[_+1]=e.readInt32BE(_*4+4);for(;_<160;_+=2){var m=t[_-30],C=t[_-15*2+1],S=_d(m,C),T=wd(C,m);m=t[_-2*2],C=t[_-2*2+1];var U=yd(m,C),B=vd(C,m),O=t[_-7*2],Q=t[_-7*2+1],oe=t[_-16*2],ne=t[_-16*2+1],se=T+Q|0,M=S+O+pe(se,T)|0;se=se+B|0,M=M+U+pe(se,B)|0,se=se+ne|0,M=M+oe+pe(se,ne)|0,t[_]=M,t[_+1]=se}for(var I=0;I<160;I+=2){M=t[I],se=t[I+1];var $=Ao(r,n,s),x=Ao(u,d,h),F=To(r,u),L=To(u,r),H=Mo(o,w),Z=Mo(w,o),W=ko[I],K=ko[I+1],ue=Io(o,a,c),te=Io(w,R,E),y=p+Z|0,v=l+H+pe(y,p)|0;y=y+te|0,v=v+ue+pe(y,te)|0,y=y+K|0,v=v+W+pe(y,K)|0,y=y+se|0,v=v+M+pe(y,se)|0;var A=L+x|0,j=F+$+pe(A,L)|0;l=c,p=E,c=a,E=R,a=o,R=w,w=b+y|0,o=i+v+pe(w,b)|0,i=s,b=h,s=n,h=d,n=r,d=u,u=y+A|0,r=v+j+pe(u,y)|0}this._al=this._al+u|0,this._bl=this._bl+d|0,this._cl=this._cl+h|0,this._dl=this._dl+b|0,this._el=this._el+w|0,this._fl=this._fl+R|0,this._gl=this._gl+E|0,this._hl=this._hl+p|0,this._ah=this._ah+r+pe(this._al,u)|0,this._bh=this._bh+n+pe(this._bl,d)|0,this._ch=this._ch+s+pe(this._cl,h)|0,this._dh=this._dh+i+pe(this._dl,b)|0,this._eh=this._eh+o+pe(this._el,w)|0,this._fh=this._fh+a+pe(this._fl,R)|0,this._gh=this._gh+c+pe(this._gl,E)|0,this._hh=this._hh+l+pe(this._hl,p)|0};kr.prototype._hash=function(){var e=bd.allocUnsafe(64);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ec=kr,Ed=Fe,Sd=Ec,Rd=tr,Cd=ut.Buffer,kd=new Array(160);function yn(){this.init(),this._w=kd,Rd.call(this,128,112)}Ed(yn,Sd);yn.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};yn.prototype._hash=function(){var e=Cd.allocUnsafe(48);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Id=yn,Rt=pc.exports=function(t){t=t.toLowerCase();var r=Rt[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};Rt.sha=Wu;Rt.sha1=Yu;Rt.sha224=gd;Rt.sha256=yc;Rt.sha384=Id;Rt.sha512=Ec;var Ad=pc.exports;Object.defineProperty(er,"__esModule",{value:!0});er.Session=void 0;const No=Ad,xo=P,Lo="session:id",Po="session:secret",Oo="session:linked";class ji{constructor(t,r,n,s){this._storage=t,this._id=r||(0,xo.randomBytesHex)(16),this._secret=n||(0,xo.randomBytesHex)(32),this._key=new No.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(Lo),n=t.getItem(Oo),s=t.getItem(Po);return r&&s?new ji(t,r,s,n==="1"):null}static hash(t){return new No.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Lo,this._id),this._storage.setItem(Po,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Oo,this._linked?"1":"0")}}er.Session=ji;var vn={},En={};Object.defineProperty(En,"__esModule",{value:!0});En.Cipher=void 0;const Wr=P;class Td{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,Wr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),a=16,c=o.slice(o.byteLength-a),l=o.slice(0,o.byteLength-a),u=new Uint8Array(c),d=new Uint8Array(l),h=new Uint8Array([...n,...u,...d]);return(0,Wr.uint8ArrayToHex)(h)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Wr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Wr.hexStringToUint8Array)(t),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),u=new Uint8Array([...l,...c]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(d,i,u),b=new TextDecoder;n(b.decode(h))}catch(h){s(h)}})()})}}En.Cipher=Td;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.WalletLinkHTTP=void 0;class Md{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}Sn.WalletLinkHTTP=Md;var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.WalletLinkWebSocket=Vt.ConnectionState=void 0;var Ft;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Ft||(Vt.ConnectionState=Ft={}));class Nd{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Ft.CONNECTING),s.onclose=i=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Ft.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Ft.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var o,a;if(i.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Ft.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Vt.WalletLinkWebSocket=Nd;Object.defineProperty(vn,"__esModule",{value:!0});vn.WalletLinkConnection=void 0;const xt=fe,xd=En,Ue=Xt,$o=xe,Lt=er,Ld=Sn,Vr=Vt,Bo=1e4,Pd=6e4;class Od{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,xt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>a.JsonRpcUrl&&this.handleChainUpdated(l,a.JsonRpcUrl)]]).forEach((l,u)=>{const d=a[u];d!==void 0&&l(d)})},this.handleDestroyed=a=>{var c,l;a==="1"&&((c=this.listener)===null||c===void 0||c.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(Ue.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Lt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var c,l;try{const u=await this.cipher.decrypt(a);(c=this.listener)===null||c===void 0||c.accountUpdated(u)}catch{(l=this.diagnostic)===null||l===void 0||l.log(Ue.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.metadataUpdated(a,d)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Ue.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated($o.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated($o.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(a),h=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.chainUpdated(d,h)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Ue.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new xd.Cipher(t.secret),this.diagnostic=s,this.listener=n;const o=new Vr.WalletLinkWebSocket(`${r}/rpc`,i);o.setConnectionStateListener(async a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(Ue.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Lt.Session.hash(t.id)});let l=!1;switch(a){case Vr.ConnectionState.DISCONNECTED:if(!this.destroyed){const u=async()=>{await new Promise(d=>setTimeout(d,5e3)),this.destroyed||o.connect().catch(()=>{u()})};u()}break;case Vr.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Bo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Vr.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(a=>{var c,l,u;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const d=a.type==="IsLinkedOK"?a.linked:void 0;(c=this.diagnostic)===null||c===void 0||c.log(Ue.EVENTS.LINKED,{sessionIdHash:Lt.Session.hash(t.id),linked:d,type:a.type,onlineGuests:a.onlineGuests}),this.linked=d||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(Ue.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Lt.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((u=this.requestResolutions.get(a.id))===null||u===void 0||u(a))}),this.ws=o,this.http=new Ld.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Ue.EVENTS.STARTED_CONNECTING,{sessionIdHash:Lt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Ue.EVENTS.DISCONNECTED,{sessionIdHash:Lt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Ue.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(i);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Bo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Pd){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,o)=>{s=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,o=>{clearTimeout(s),i(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}vn.WalletLinkConnection=Od;var Ir={},Ar={},Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var $d=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.injectCssReset=void 0;const Bd=$d(Hi);function Fd(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Bd.default)),document.documentElement.appendChild(e)}Ar.injectCssReset=Fd;var Rn={};const Re=Kt(tu);var Cn={};const Tr=Kt(ru),kn=Kt(nu);var zt={},In={};Object.defineProperty(In,"__esModule",{value:!0});In.CloseIcon=void 0;const Fo=Re;function Dd(e){return(0,Fo.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Fo.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}In.CloseIcon=Dd;var An={};Object.defineProperty(An,"__esModule",{value:!0});An.CoinbaseWalletRound=void 0;const zr=Re;function jd(e){return(0,zr.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,zr.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,zr.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,zr.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}An.CoinbaseWalletRound=jd;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.QRCodeIcon=void 0;const cr=Re;function Hd(e){return(0,cr.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,cr.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,cr.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,cr.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,cr.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Tn.QRCodeIcon=Hd;var Mn={};function Sc(e){this.mode=Ie.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],s=this.data.charCodeAt(t);s>65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Sc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Je(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Je.prototype={addData:function(e){var t=new Sc(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Je.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=ce.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i<this.modules.length;i++)for(var o=i*s,a=0;a<this.modules[i].length;a++){var c=a*s,l=this.modules[i][a];l&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+s,o),n.lineTo(c+s,o+s),n.lineTo(c,o+s),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=ce.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],s=e[r];if(this.modules[n][s]==null)for(var i=-2;i<=2;i++)for(var o=-2;o<=2;o++)i==-2||i==2||o==-2||o==2||i==0&&o==0?this.modules[n+i][s+o]=!0:this.modules[n+i][s+o]=!1}},setupTypeNumber:function(e){for(var t=ce.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=ce.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;i<e.length&&(c=(e[i]>>>s&1)==1);var l=ce.getMask(t,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Je.PAD0=236;Je.PAD1=17;Je.createData=function(e,t,r){for(var n=Ge.getRSBlocks(e,t),s=new Rc,i=0;i<r.length;i++){var o=r[i];s.put(o.mode,4),s.put(o.getLength(),ce.getLengthInBits(o.mode,e)),o.write(s)}for(var a=0,i=0;i<n.length;i++)a+=n[i].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(Je.PAD0,8),s.getLengthInBits()>=a*8));)s.put(Je.PAD1,8);return Je.createBytes(s,n)};Je.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),o=new Array(t.length),a=0;a<t.length;a++){var c=t[a].dataCount,l=t[a].totalCount-c;n=Math.max(n,c),s=Math.max(s,l),i[a]=new Array(c);for(var u=0;u<i[a].length;u++)i[a][u]=255&e.buffer[u+r];r+=c;var d=ce.getErrorCorrectPolynomial(l),h=new Dt(i[a],d.getLength()-1),b=h.mod(d);o[a]=new Array(d.getLength()-1);for(var u=0;u<o[a].length;u++){var w=u+b.getLength()-o[a].length;o[a][u]=w>=0?b.get(w):0}}for(var R=0,u=0;u<t.length;u++)R+=t[u].totalCount;for(var E=new Array(R),p=0,u=0;u<n;u++)for(var a=0;a<t.length;a++)u<i[a].length&&(E[p++]=i[a][u]);for(var u=0;u<s;u++)for(var a=0;a<t.length;a++)u<o[a].length&&(E[p++]=o[a][u]);return E};var Ie={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},at={L:1,M:0,Q:3,H:2},st={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},ce={PATTERN_POSITION_TABLE:[[],[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]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;ce.getBCHDigit(t)-ce.getBCHDigit(ce.G15)>=0;)t^=ce.G15<<ce.getBCHDigit(t)-ce.getBCHDigit(ce.G15);return(e<<10|t)^ce.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;ce.getBCHDigit(t)-ce.getBCHDigit(ce.G18)>=0;)t^=ce.G18<<ce.getBCHDigit(t)-ce.getBCHDigit(ce.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return ce.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case st.PATTERN000:return(t+r)%2==0;case st.PATTERN001:return t%2==0;case st.PATTERN010:return r%3==0;case st.PATTERN011:return(t+r)%3==0;case st.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case st.PATTERN101:return t*r%2+t*r%3==0;case st.PATTERN110:return(t*r%2+t*r%3)%2==0;case st.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Dt([1],0),r=0;r<e;r++)t=t.multiply(new Dt([1,be.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case Ie.MODE_NUMBER:return 10;case Ie.MODE_ALPHA_NUM:return 9;case Ie.MODE_8BIT_BYTE:return 8;case Ie.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case Ie.MODE_NUMBER:return 12;case Ie.MODE_ALPHA_NUM:return 11;case Ie.MODE_8BIT_BYTE:return 16;case Ie.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case Ie.MODE_NUMBER:return 14;case Ie.MODE_ALPHA_NUM:return 13;case Ie.MODE_8BIT_BYTE:return 16;case Ie.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var s=0;s<t;s++){for(var i=0,o=e.isDark(n,s),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var c=-1;c<=1;c++)s+c<0||t<=s+c||a==0&&c==0||o==e.isDark(n+a,s+c)&&i++;i>5&&(r+=3+i-5)}for(var n=0;n<t-1;n++)for(var s=0;s<t-1;s++){var l=0;e.isDark(n,s)&&l++,e.isDark(n+1,s)&&l++,e.isDark(n,s+1)&&l++,e.isDark(n+1,s+1)&&l++,(l==0||l==4)&&(r+=3)}for(var n=0;n<t;n++)for(var s=0;s<t-6;s++)e.isDark(n,s)&&!e.isDark(n,s+1)&&e.isDark(n,s+2)&&e.isDark(n,s+3)&&e.isDark(n,s+4)&&!e.isDark(n,s+5)&&e.isDark(n,s+6)&&(r+=40);for(var s=0;s<t;s++)for(var n=0;n<t-6;n++)e.isDark(n,s)&&!e.isDark(n+1,s)&&e.isDark(n+2,s)&&e.isDark(n+3,s)&&e.isDark(n+4,s)&&!e.isDark(n+5,s)&&e.isDark(n+6,s)&&(r+=40);for(var u=0,s=0;s<t;s++)for(var n=0;n<t;n++)e.isDark(n,s)&&u++;var d=Math.abs(100*u/t/t-50)/5;return r+=d*10,r}},be={glog:function(e){if(e<1)throw new Error("glog("+e+")");return be.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return be.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var _e=0;_e<8;_e++)be.EXP_TABLE[_e]=1<<_e;for(var _e=8;_e<256;_e++)be.EXP_TABLE[_e]=be.EXP_TABLE[_e-4]^be.EXP_TABLE[_e-5]^be.EXP_TABLE[_e-6]^be.EXP_TABLE[_e-8];for(var _e=0;_e<255;_e++)be.LOG_TABLE[be.EXP_TABLE[_e]]=_e;function Dt(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Dt.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=be.gexp(be.glog(this.get(r))+be.glog(e.get(n)));return new Dt(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=be.glog(this.get(0))-be.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=be.gexp(be.glog(e.get(n))+t);return new Dt(r,0).mod(e)}};function Ge(e,t){this.totalCount=e,this.dataCount=t}Ge.RS_BLOCK_TABLE=[[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],[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]];Ge.getRSBlocks=function(e,t){var r=Ge.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,s=[],i=0;i<n;i++)for(var o=r[i*3+0],a=r[i*3+1],c=r[i*3+2],l=0;l<o;l++)s.push(new Ge(a,c));return s};Ge.getRsBlockTable=function(e,t){switch(t){case at.L:return Ge.RS_BLOCK_TABLE[(e-1)*4+0];case at.M:return Ge.RS_BLOCK_TABLE[(e-1)*4+1];case at.Q:return Ge.RS_BLOCK_TABLE[(e-1)*4+2];case at.H:return Ge.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Rc(){this.buffer=[],this.length=0}Rc.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var ti=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Cc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return at.L;case"M":return at.M;case"Q":return at.Q;case"H":return at.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var u=s(c),d=1,h=0,b=0,w=ti.length;b<=w;b++){var R=ti[b];if(!R)throw new Error("Content too long: expected "+h+" but got "+u);switch(l){case"L":h=R[0];break;case"M":h=R[1];break;case"Q":h=R[2];break;case"H":h=R[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(u<=h)break;d++}if(d>ti.length)throw new Error("Content too long");return d}function s(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var i=this.options.content,o=n(i,this.options.ecl),a=r(this.options.ecl);this.qrcode=new Je(o,a),this.qrcode.addData(i),this.qrcode.make()}Cc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?" ":"",i=n?`\r
|
|
1
|
+
import{E as So,l as D,z as cn,h as Kt,A as ln,x as Fe,t as tc,C as Xl,g as eu}from"./index-qgo91dsq.js";import{p as tu,a as ru,b as nu}from"./hooks.module-C5ONEBEq.js";import{e as un}from"./events-CkdpRqBF.js";const su=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:So,default:So},Symbol.toStringTag,{value:"Module"}));var rc={},fr={},dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.walletLogo=void 0;const iu=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};dn.walletLogo=iu;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.LINK_API_URL=void 0;hn.LINK_API_URL="https://www.walletlink.org";var P={},mr={},tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.errorValues=tt.standardErrorCodes=void 0;tt.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};tt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var fn={},gn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=tt,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,b=r){if(h&&Number.isInteger(h)){const w=h.toString();if(u(t.errorValues,w))return t.errorValues[w].message;if(c(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return b}e.getMessageFromCode=n;function s(h){if(!Number.isInteger(h))return!1;const b=h.toString();return!!(t.errorValues[b]||c(h))}e.isValidCode=s;function i(h){var b;if(typeof h=="number")return h;if(o(h))return(b=h.code)!==null&&b!==void 0?b:h.errorCode}e.getErrorCode=i;function o(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function a(h,{shouldIncludeStack:b=!1}={}){const w={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&s(h.code)){const R=h;w.code=R.code,R.message&&typeof R.message=="string"?(w.message=R.message,u(R,"data")&&(w.data=R.data)):(w.message=n(w.code),w.data={originalError:l(h)})}else w.code=t.standardErrorCodes.rpc.internal,w.message=d(h,"message")?h.message:r,w.data={originalError:l(h)};return b&&(w.stack=d(h,"stack")?h.stack:void 0),w}e.serialize=a;function c(h){return h>=-32099&&h<=-32e3}function l(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,b){return Object.prototype.hasOwnProperty.call(h,b)}function d(h,b){return typeof h=="object"&&h!==null&&b in h&&typeof h[b]=="string"}})(gn);Object.defineProperty(fn,"__esModule",{value:!0});fn.standardErrors=void 0;const me=tt,nc=gn;fn.standardErrors={rpc:{parse:e=>Te(me.standardErrorCodes.rpc.parse,e),invalidRequest:e=>Te(me.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>Te(me.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>Te(me.standardErrorCodes.rpc.methodNotFound,e),internal:e=>Te(me.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Te(t,e)},invalidInput:e=>Te(me.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>Te(me.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Te(me.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Te(me.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Te(me.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Te(me.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Nt(me.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Nt(me.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Nt(me.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Nt(me.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Nt(me.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Nt(me.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new oc(t,r,n)}}};function Te(e,t){const[r,n]=sc(t);return new ic(e,r||(0,nc.getMessageFromCode)(e),n)}function Nt(e,t){const[r,n]=sc(t);return new oc(e,r||(0,nc.getMessageFromCode)(e),n)}function sc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let ic=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},oc=class extends ic{constructor(t,r,n){if(!ou(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function ou(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var pn={},Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.isErrorResponse=void 0;function au(e){return e.errorMessage!==void 0}Qt.isErrorResponse=au;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.LIB_VERSION=void 0;Yt.LIB_VERSION="3.9.3";Object.defineProperty(pn,"__esModule",{value:!0});pn.serializeError=void 0;const cu=Qt,lu=Yt,uu=tt,du=gn;function hu(e,t){const r=(0,du.serialize)(fu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",lu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=gu(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}pn.serializeError=hu;function fu(e){return typeof e=="string"?{message:e,code:uu.standardErrorCodes.rpc.internal}:(0,cu.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function gu(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=tt;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=fn;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=pn;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=gn;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(mr);var fe={};Object.defineProperty(fe,"__esModule",{value:!0});fe.ProviderType=fe.RegExpString=fe.IntNumber=fe.BigIntString=fe.AddressString=fe.HexString=fe.OpaqueType=void 0;function _r(){return e=>e}fe.OpaqueType=_r;fe.HexString=_r();fe.AddressString=_r();fe.BigIntString=_r();function pu(e){return Math.floor(e)}fe.IntNumber=pu;fe.RegExpString=_r();var Ro;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Ro||(fe.ProviderType=Ro={}));var bu=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(P,"__esModule",{value:!0});P.isMobileWeb=P.getLocation=P.isInIFrame=P.createQrUrl=P.getFavicon=P.range=P.isBigNumber=P.ensureParsedJSONObject=P.ensureBN=P.ensureRegExpString=P.ensureIntNumber=P.ensureBuffer=P.ensureAddressString=P.ensureEvenLengthHexString=P.ensureHexString=P.isHexString=P.prepend0x=P.strip0x=P.has0xPrefix=P.hexStringFromIntNumber=P.intNumberFromHexString=P.bigIntStringFromBN=P.hexStringFromBuffer=P.hexStringToUint8Array=P.uint8ArrayToHex=P.randomBytesHex=void 0;const ot=bu(cn),St=mr,Le=fe,ac=/^[0-9]*$/,cc=/^[a-f0-9]*$/;function mu(e){return lc(crypto.getRandomValues(new Uint8Array(e)))}P.randomBytesHex=mu;function lc(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}P.uint8ArrayToHex=lc;function _u(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}P.hexStringToUint8Array=_u;function wu(e,t=!1){const r=e.toString("hex");return(0,Le.HexString)(t?`0x${r}`:r)}P.hexStringFromBuffer=wu;function yu(e){return(0,Le.BigIntString)(e.toString(10))}P.bigIntStringFromBN=yu;function vu(e){return(0,Le.IntNumber)(new ot.default(yr(e,!1),16).toNumber())}P.intNumberFromHexString=vu;function Eu(e){return(0,Le.HexString)(`0x${new ot.default(e).toString(16)}`)}P.hexStringFromIntNumber=Eu;function Di(e){return e.startsWith("0x")||e.startsWith("0X")}P.has0xPrefix=Di;function bn(e){return Di(e)?e.slice(2):e}P.strip0x=bn;function uc(e){return Di(e)?`0x${e.slice(2)}`:`0x${e}`}P.prepend0x=uc;function wr(e){if(typeof e!="string")return!1;const t=bn(e).toLowerCase();return cc.test(t)}P.isHexString=wr;function dc(e,t=!1){if(typeof e=="string"){const r=bn(e).toLowerCase();if(cc.test(r))return(0,Le.HexString)(t?`0x${r}`:r)}throw St.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}P.ensureHexString=dc;function yr(e,t=!1){let r=dc(e,!1);return r.length%2===1&&(r=(0,Le.HexString)(`0${r}`)),t?(0,Le.HexString)(`0x${r}`):r}P.ensureEvenLengthHexString=yr;function Su(e){if(typeof e=="string"){const t=bn(e).toLowerCase();if(wr(t)&&t.length===40)return(0,Le.AddressString)(uc(t))}throw St.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}P.ensureAddressString=Su;function Ru(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(wr(e)){const t=yr(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw St.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}P.ensureBuffer=Ru;function hc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Le.IntNumber)(e);if(typeof e=="string"){if(ac.test(e))return(0,Le.IntNumber)(Number(e));if(wr(e))return(0,Le.IntNumber)(new ot.default(yr(e,!1),16).toNumber())}throw St.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}P.ensureIntNumber=hc;function Cu(e){if(e instanceof RegExp)return(0,Le.RegExpString)(e.toString());throw St.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}P.ensureRegExpString=Cu;function ku(e){if(e!==null&&(ot.default.isBN(e)||fc(e)))return new ot.default(e.toString(10),10);if(typeof e=="number")return new ot.default(hc(e));if(typeof e=="string"){if(ac.test(e))return new ot.default(e,10);if(wr(e))return new ot.default(yr(e,!1),16)}throw St.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}P.ensureBN=ku;function Iu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw St.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}P.ensureParsedJSONObject=Iu;function fc(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}P.isBigNumber=fc;function Au(e,t){return Array.from({length:t-e},(r,n)=>e+n)}P.range=Au;function Tu(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}P.getFavicon=Tu;function Mu(e,t,r,n,s,i){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${a}`}P.createQrUrl=Mu;function gc(){try{return window.frameElement!==null}catch{return!1}}P.isInIFrame=gc;function Nu(){try{return gc()&&window.top?window.top.location:window.location}catch{return window.location}}P.getLocation=Nu;function xu(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}P.isMobileWeb=xu;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.ScopedLocalStorage=void 0;class Lu{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const s=localStorage.key(n);typeof s=="string"&&s.startsWith(t)&&r.push(s)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}mn.ScopedLocalStorage=Lu;var Wt={};const Pu=Kt(su);var vr={},Er={},Xt={};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.EVENTS=void 0;Xt.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.RelayAbstract=xe.APP_VERSION_KEY=xe.LOCAL_STORAGE_ADDRESSES_KEY=xe.WALLET_USER_NAME_KEY=void 0;const Co=mr;xe.WALLET_USER_NAME_KEY="walletUsername";xe.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";xe.APP_VERSION_KEY="AppVersion";class Ou{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Co.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,Co.serializeError)(i,t.method);return s})}}xe.RelayAbstract=Ou;var er={},pc={exports:{}},Mi={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=ln,n=r.Buffer;function s(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=i);function i(o,a,c){return n(o,a,c)}i.prototype=Object.create(n.prototype),s(n,i),i.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},i.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(Mi,Mi.exports);var ut=Mi.exports,bc=ut.Buffer;function _n(e,t){this._block=bc.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}_n.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=bc.from(e,t));for(var r=this._block,n=this._blockSize,s=e.length,i=this._len,o=0;o<s;){for(var a=i%n,c=Math.min(s-o,n-a),l=0;l<c;l++)r[a+l]=e[o+l];i+=c,o+=c,i%n===0&&this._update(r)}return this._len+=s,this};_n.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,s=(r-n)/4294967296;this._block.writeUInt32BE(s,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i};_n.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var tr=_n,$u=Fe,mc=tr,Bu=ut.Buffer,Fu=[1518500249,1859775393,-1894007588,-899497514],Du=new Array(80);function Sr(){this.init(),this._w=Du,mc.call(this,64,56)}$u(Sr,mc);Sr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function ju(e){return e<<5|e>>>27}function Hu(e){return e<<30|e>>>2}function Uu(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Sr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var c=0;c<80;++c){var l=~~(c/20),u=ju(r)+Uu(l,n,s,i)+o+t[c]+Fu[l]|0;o=i,i=s,s=Hu(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};Sr.prototype._hash=function(){var e=Bu.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Wu=Sr,Vu=Fe,_c=tr,zu=ut.Buffer,qu=[1518500249,1859775393,-1894007588,-899497514],Gu=new Array(80);function Rr(){this.init(),this._w=Gu,_c.call(this,64,56)}Vu(Rr,_c);Rr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Ju(e){return e<<1|e>>>31}function Zu(e){return e<<5|e>>>27}function Ku(e){return e<<30|e>>>2}function Qu(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Rr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=Ju(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),u=Zu(r)+Qu(l,n,s,i)+o+t[c]+qu[l]|0;o=i,i=s,s=Ku(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};Rr.prototype._hash=function(){var e=zu.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Yu=Rr,Xu=Fe,wc=tr,ed=ut.Buffer,td=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],rd=new Array(64);function Cr(){this.init(),this._w=rd,wc.call(this,64,56)}Xu(Cr,wc);Cr.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function nd(e,t,r){return r^e&(t^r)}function sd(e,t,r){return e&t|r&(e|t)}function id(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function od(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function ad(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function cd(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Cr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<64;++u)t[u]=cd(t[u-2])+t[u-7]+ad(t[u-15])+t[u-16]|0;for(var d=0;d<64;++d){var h=l+od(o)+nd(o,a,c)+td[d]+t[d]|0,b=id(r)+sd(r,n,s)|0;l=c,c=a,a=o,o=i+h|0,i=s,s=n,n=r,r=h+b|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};Cr.prototype._hash=function(){var e=ed.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var yc=Cr,ld=Fe,ud=yc,dd=tr,hd=ut.Buffer,fd=new Array(64);function wn(){this.init(),this._w=fd,dd.call(this,64,56)}ld(wn,ud);wn.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};wn.prototype._hash=function(){var e=hd.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var gd=wn,pd=Fe,vc=tr,bd=ut.Buffer,ko=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],md=new Array(160);function kr(){this.init(),this._w=md,vc.call(this,128,112)}pd(kr,vc);kr.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Io(e,t,r){return r^e&(t^r)}function Ao(e,t,r){return e&t|r&(e|t)}function To(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Mo(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function _d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function wd(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function yd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function vd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function pe(e,t){return e>>>0<t>>>0?1:0}kr.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,s=this._ch|0,i=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,u=this._al|0,d=this._bl|0,h=this._cl|0,b=this._dl|0,w=this._el|0,R=this._fl|0,E=this._gl|0,p=this._hl|0,_=0;_<32;_+=2)t[_]=e.readInt32BE(_*4),t[_+1]=e.readInt32BE(_*4+4);for(;_<160;_+=2){var m=t[_-30],C=t[_-15*2+1],S=_d(m,C),T=wd(C,m);m=t[_-2*2],C=t[_-2*2+1];var U=yd(m,C),B=vd(C,m),O=t[_-7*2],Q=t[_-7*2+1],oe=t[_-16*2],ne=t[_-16*2+1],se=T+Q|0,M=S+O+pe(se,T)|0;se=se+B|0,M=M+U+pe(se,B)|0,se=se+ne|0,M=M+oe+pe(se,ne)|0,t[_]=M,t[_+1]=se}for(var I=0;I<160;I+=2){M=t[I],se=t[I+1];var $=Ao(r,n,s),x=Ao(u,d,h),F=To(r,u),L=To(u,r),H=Mo(o,w),Z=Mo(w,o),W=ko[I],K=ko[I+1],ue=Io(o,a,c),te=Io(w,R,E),y=p+Z|0,v=l+H+pe(y,p)|0;y=y+te|0,v=v+ue+pe(y,te)|0,y=y+K|0,v=v+W+pe(y,K)|0,y=y+se|0,v=v+M+pe(y,se)|0;var A=L+x|0,j=F+$+pe(A,L)|0;l=c,p=E,c=a,E=R,a=o,R=w,w=b+y|0,o=i+v+pe(w,b)|0,i=s,b=h,s=n,h=d,n=r,d=u,u=y+A|0,r=v+j+pe(u,y)|0}this._al=this._al+u|0,this._bl=this._bl+d|0,this._cl=this._cl+h|0,this._dl=this._dl+b|0,this._el=this._el+w|0,this._fl=this._fl+R|0,this._gl=this._gl+E|0,this._hl=this._hl+p|0,this._ah=this._ah+r+pe(this._al,u)|0,this._bh=this._bh+n+pe(this._bl,d)|0,this._ch=this._ch+s+pe(this._cl,h)|0,this._dh=this._dh+i+pe(this._dl,b)|0,this._eh=this._eh+o+pe(this._el,w)|0,this._fh=this._fh+a+pe(this._fl,R)|0,this._gh=this._gh+c+pe(this._gl,E)|0,this._hh=this._hh+l+pe(this._hl,p)|0};kr.prototype._hash=function(){var e=bd.allocUnsafe(64);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ec=kr,Ed=Fe,Sd=Ec,Rd=tr,Cd=ut.Buffer,kd=new Array(160);function yn(){this.init(),this._w=kd,Rd.call(this,128,112)}Ed(yn,Sd);yn.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};yn.prototype._hash=function(){var e=Cd.allocUnsafe(48);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Id=yn,Rt=pc.exports=function(t){t=t.toLowerCase();var r=Rt[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};Rt.sha=Wu;Rt.sha1=Yu;Rt.sha224=gd;Rt.sha256=yc;Rt.sha384=Id;Rt.sha512=Ec;var Ad=pc.exports;Object.defineProperty(er,"__esModule",{value:!0});er.Session=void 0;const No=Ad,xo=P,Lo="session:id",Po="session:secret",Oo="session:linked";class ji{constructor(t,r,n,s){this._storage=t,this._id=r||(0,xo.randomBytesHex)(16),this._secret=n||(0,xo.randomBytesHex)(32),this._key=new No.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(Lo),n=t.getItem(Oo),s=t.getItem(Po);return r&&s?new ji(t,r,s,n==="1"):null}static hash(t){return new No.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Lo,this._id),this._storage.setItem(Po,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Oo,this._linked?"1":"0")}}er.Session=ji;var vn={},En={};Object.defineProperty(En,"__esModule",{value:!0});En.Cipher=void 0;const Wr=P;class Td{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,Wr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),a=16,c=o.slice(o.byteLength-a),l=o.slice(0,o.byteLength-a),u=new Uint8Array(c),d=new Uint8Array(l),h=new Uint8Array([...n,...u,...d]);return(0,Wr.uint8ArrayToHex)(h)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Wr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Wr.hexStringToUint8Array)(t),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),u=new Uint8Array([...l,...c]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(d,i,u),b=new TextDecoder;n(b.decode(h))}catch(h){s(h)}})()})}}En.Cipher=Td;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.WalletLinkHTTP=void 0;class Md{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}Sn.WalletLinkHTTP=Md;var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.WalletLinkWebSocket=Vt.ConnectionState=void 0;var Ft;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Ft||(Vt.ConnectionState=Ft={}));class Nd{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Ft.CONNECTING),s.onclose=i=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Ft.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Ft.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var o,a;if(i.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Ft.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Vt.WalletLinkWebSocket=Nd;Object.defineProperty(vn,"__esModule",{value:!0});vn.WalletLinkConnection=void 0;const xt=fe,xd=En,Ue=Xt,$o=xe,Lt=er,Ld=Sn,Vr=Vt,Bo=1e4,Pd=6e4;class Od{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,xt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>a.JsonRpcUrl&&this.handleChainUpdated(l,a.JsonRpcUrl)]]).forEach((l,u)=>{const d=a[u];d!==void 0&&l(d)})},this.handleDestroyed=a=>{var c,l;a==="1"&&((c=this.listener)===null||c===void 0||c.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(Ue.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Lt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var c,l;try{const u=await this.cipher.decrypt(a);(c=this.listener)===null||c===void 0||c.accountUpdated(u)}catch{(l=this.diagnostic)===null||l===void 0||l.log(Ue.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.metadataUpdated(a,d)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Ue.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated($o.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated($o.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(a),h=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.chainUpdated(d,h)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Ue.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new xd.Cipher(t.secret),this.diagnostic=s,this.listener=n;const o=new Vr.WalletLinkWebSocket(`${r}/rpc`,i);o.setConnectionStateListener(async a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(Ue.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Lt.Session.hash(t.id)});let l=!1;switch(a){case Vr.ConnectionState.DISCONNECTED:if(!this.destroyed){const u=async()=>{await new Promise(d=>setTimeout(d,5e3)),this.destroyed||o.connect().catch(()=>{u()})};u()}break;case Vr.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Bo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Vr.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(a=>{var c,l,u;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const d=a.type==="IsLinkedOK"?a.linked:void 0;(c=this.diagnostic)===null||c===void 0||c.log(Ue.EVENTS.LINKED,{sessionIdHash:Lt.Session.hash(t.id),linked:d,type:a.type,onlineGuests:a.onlineGuests}),this.linked=d||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(Ue.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Lt.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((u=this.requestResolutions.get(a.id))===null||u===void 0||u(a))}),this.ws=o,this.http=new Ld.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Ue.EVENTS.STARTED_CONNECTING,{sessionIdHash:Lt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Ue.EVENTS.DISCONNECTED,{sessionIdHash:Lt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Ue.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(i);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Bo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Pd){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,o)=>{s=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,o=>{clearTimeout(s),i(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,xt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}vn.WalletLinkConnection=Od;var Ir={},Ar={},Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var $d=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.injectCssReset=void 0;const Bd=$d(Hi);function Fd(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Bd.default)),document.documentElement.appendChild(e)}Ar.injectCssReset=Fd;var Rn={};const Re=Kt(tu);var Cn={};const Tr=Kt(ru),kn=Kt(nu);var zt={},In={};Object.defineProperty(In,"__esModule",{value:!0});In.CloseIcon=void 0;const Fo=Re;function Dd(e){return(0,Fo.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Fo.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}In.CloseIcon=Dd;var An={};Object.defineProperty(An,"__esModule",{value:!0});An.CoinbaseWalletRound=void 0;const zr=Re;function jd(e){return(0,zr.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,zr.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,zr.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,zr.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}An.CoinbaseWalletRound=jd;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.QRCodeIcon=void 0;const cr=Re;function Hd(e){return(0,cr.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,cr.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,cr.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,cr.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,cr.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Tn.QRCodeIcon=Hd;var Mn={};function Sc(e){this.mode=Ie.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],s=this.data.charCodeAt(t);s>65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Sc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Je(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Je.prototype={addData:function(e){var t=new Sc(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Je.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=ce.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i<this.modules.length;i++)for(var o=i*s,a=0;a<this.modules[i].length;a++){var c=a*s,l=this.modules[i][a];l&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+s,o),n.lineTo(c+s,o+s),n.lineTo(c,o+s),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=ce.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],s=e[r];if(this.modules[n][s]==null)for(var i=-2;i<=2;i++)for(var o=-2;o<=2;o++)i==-2||i==2||o==-2||o==2||i==0&&o==0?this.modules[n+i][s+o]=!0:this.modules[n+i][s+o]=!1}},setupTypeNumber:function(e){for(var t=ce.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=ce.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;i<e.length&&(c=(e[i]>>>s&1)==1);var l=ce.getMask(t,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Je.PAD0=236;Je.PAD1=17;Je.createData=function(e,t,r){for(var n=Ge.getRSBlocks(e,t),s=new Rc,i=0;i<r.length;i++){var o=r[i];s.put(o.mode,4),s.put(o.getLength(),ce.getLengthInBits(o.mode,e)),o.write(s)}for(var a=0,i=0;i<n.length;i++)a+=n[i].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(Je.PAD0,8),s.getLengthInBits()>=a*8));)s.put(Je.PAD1,8);return Je.createBytes(s,n)};Je.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),o=new Array(t.length),a=0;a<t.length;a++){var c=t[a].dataCount,l=t[a].totalCount-c;n=Math.max(n,c),s=Math.max(s,l),i[a]=new Array(c);for(var u=0;u<i[a].length;u++)i[a][u]=255&e.buffer[u+r];r+=c;var d=ce.getErrorCorrectPolynomial(l),h=new Dt(i[a],d.getLength()-1),b=h.mod(d);o[a]=new Array(d.getLength()-1);for(var u=0;u<o[a].length;u++){var w=u+b.getLength()-o[a].length;o[a][u]=w>=0?b.get(w):0}}for(var R=0,u=0;u<t.length;u++)R+=t[u].totalCount;for(var E=new Array(R),p=0,u=0;u<n;u++)for(var a=0;a<t.length;a++)u<i[a].length&&(E[p++]=i[a][u]);for(var u=0;u<s;u++)for(var a=0;a<t.length;a++)u<o[a].length&&(E[p++]=o[a][u]);return E};var Ie={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},at={L:1,M:0,Q:3,H:2},st={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},ce={PATTERN_POSITION_TABLE:[[],[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]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;ce.getBCHDigit(t)-ce.getBCHDigit(ce.G15)>=0;)t^=ce.G15<<ce.getBCHDigit(t)-ce.getBCHDigit(ce.G15);return(e<<10|t)^ce.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;ce.getBCHDigit(t)-ce.getBCHDigit(ce.G18)>=0;)t^=ce.G18<<ce.getBCHDigit(t)-ce.getBCHDigit(ce.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return ce.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case st.PATTERN000:return(t+r)%2==0;case st.PATTERN001:return t%2==0;case st.PATTERN010:return r%3==0;case st.PATTERN011:return(t+r)%3==0;case st.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case st.PATTERN101:return t*r%2+t*r%3==0;case st.PATTERN110:return(t*r%2+t*r%3)%2==0;case st.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Dt([1],0),r=0;r<e;r++)t=t.multiply(new Dt([1,be.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case Ie.MODE_NUMBER:return 10;case Ie.MODE_ALPHA_NUM:return 9;case Ie.MODE_8BIT_BYTE:return 8;case Ie.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case Ie.MODE_NUMBER:return 12;case Ie.MODE_ALPHA_NUM:return 11;case Ie.MODE_8BIT_BYTE:return 16;case Ie.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case Ie.MODE_NUMBER:return 14;case Ie.MODE_ALPHA_NUM:return 13;case Ie.MODE_8BIT_BYTE:return 16;case Ie.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var s=0;s<t;s++){for(var i=0,o=e.isDark(n,s),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var c=-1;c<=1;c++)s+c<0||t<=s+c||a==0&&c==0||o==e.isDark(n+a,s+c)&&i++;i>5&&(r+=3+i-5)}for(var n=0;n<t-1;n++)for(var s=0;s<t-1;s++){var l=0;e.isDark(n,s)&&l++,e.isDark(n+1,s)&&l++,e.isDark(n,s+1)&&l++,e.isDark(n+1,s+1)&&l++,(l==0||l==4)&&(r+=3)}for(var n=0;n<t;n++)for(var s=0;s<t-6;s++)e.isDark(n,s)&&!e.isDark(n,s+1)&&e.isDark(n,s+2)&&e.isDark(n,s+3)&&e.isDark(n,s+4)&&!e.isDark(n,s+5)&&e.isDark(n,s+6)&&(r+=40);for(var s=0;s<t;s++)for(var n=0;n<t-6;n++)e.isDark(n,s)&&!e.isDark(n+1,s)&&e.isDark(n+2,s)&&e.isDark(n+3,s)&&e.isDark(n+4,s)&&!e.isDark(n+5,s)&&e.isDark(n+6,s)&&(r+=40);for(var u=0,s=0;s<t;s++)for(var n=0;n<t;n++)e.isDark(n,s)&&u++;var d=Math.abs(100*u/t/t-50)/5;return r+=d*10,r}},be={glog:function(e){if(e<1)throw new Error("glog("+e+")");return be.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return be.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var _e=0;_e<8;_e++)be.EXP_TABLE[_e]=1<<_e;for(var _e=8;_e<256;_e++)be.EXP_TABLE[_e]=be.EXP_TABLE[_e-4]^be.EXP_TABLE[_e-5]^be.EXP_TABLE[_e-6]^be.EXP_TABLE[_e-8];for(var _e=0;_e<255;_e++)be.LOG_TABLE[be.EXP_TABLE[_e]]=_e;function Dt(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Dt.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=be.gexp(be.glog(this.get(r))+be.glog(e.get(n)));return new Dt(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=be.glog(this.get(0))-be.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=be.gexp(be.glog(e.get(n))+t);return new Dt(r,0).mod(e)}};function Ge(e,t){this.totalCount=e,this.dataCount=t}Ge.RS_BLOCK_TABLE=[[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],[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]];Ge.getRSBlocks=function(e,t){var r=Ge.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,s=[],i=0;i<n;i++)for(var o=r[i*3+0],a=r[i*3+1],c=r[i*3+2],l=0;l<o;l++)s.push(new Ge(a,c));return s};Ge.getRsBlockTable=function(e,t){switch(t){case at.L:return Ge.RS_BLOCK_TABLE[(e-1)*4+0];case at.M:return Ge.RS_BLOCK_TABLE[(e-1)*4+1];case at.Q:return Ge.RS_BLOCK_TABLE[(e-1)*4+2];case at.H:return Ge.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Rc(){this.buffer=[],this.length=0}Rc.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var ti=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Cc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return at.L;case"M":return at.M;case"Q":return at.Q;case"H":return at.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var u=s(c),d=1,h=0,b=0,w=ti.length;b<=w;b++){var R=ti[b];if(!R)throw new Error("Content too long: expected "+h+" but got "+u);switch(l){case"L":h=R[0];break;case"M":h=R[1];break;case"Q":h=R[2];break;case"H":h=R[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(u<=h)break;d++}if(d>ti.length)throw new Error("Content too long");return d}function s(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var i=this.options.content,o=n(i,this.options.ecl),a=r(this.options.ecl);this.qrcode=new Je(o,a),this.qrcode.addData(i),this.qrcode.make()}Cc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?" ":"",i=n?`\r
|
|
2
2
|
`:"",o=t.width,a=t.height,c=r.length,l=o/(c+2*t.padding),u=a/(c+2*t.padding),d=typeof t.join<"u"?!!t.join:!1,h=typeof t.swap<"u"?!!t.swap:!1,b=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,w=typeof t.predefined<"u"?!!t.predefined:!1,R=w?s+'<defs><path id="qrmodule" d="M0 0 h'+u+" v"+l+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",E=s+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,p="",_="",m=0;m<c;m++)for(var C=0;C<c;C++){var S=r[C][m];if(S){var T=C*l+t.padding*l,U=m*u+t.padding*u;if(h){var B=T;T=U,U=B}if(d){var O=l+T,Q=u+U;T=Number.isInteger(T)?Number(T):T.toFixed(2),U=Number.isInteger(U)?Number(U):U.toFixed(2),O=Number.isInteger(O)?Number(O):O.toFixed(2),Q=Number.isInteger(Q)?Number(Q):Q.toFixed(2),_+="M"+T+","+U+" V"+Q+" H"+O+" V"+U+" H"+T+" Z "}else w?p+=s+'<use x="'+T.toString()+'" y="'+U.toString()+'" href="#qrmodule" />'+i:p+=s+'<rect x="'+T.toString()+'" y="'+U.toString()+'" width="'+l+'" height="'+u+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}}d&&(p=s+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+_+'" />');let oe="";if(this.options.image!==void 0&&this.options.image.svg){const se=o*this.options.image.width/100,M=a*this.options.image.height/100,I=o/2-se/2,$=a/2-M/2;oe+=`<svg x="${I}" y="${$}" width="${se}" height="${M}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,oe+=this.options.image.svg+i,oe+="</svg>"}var ne="";switch(e.container){case"svg":b&&(ne+='<?xml version="1.0" standalone="yes"?>'+i),ne+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+i,ne+=R+E+p,ne+=oe,ne+="</svg>";break;case"svg-viewbox":b&&(ne+='<?xml version="1.0" standalone="yes"?>'+i),ne+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+i,ne+=R+E+p,ne+=oe,ne+="</svg>";break;case"g":ne+='<g width="'+o+'" height="'+a+'">'+i,ne+=R+E+p,ne+=oe,ne+="</g>";break;default:ne+=(R+E+p+oe).replace(/^\s+/,"");break}return ne};var Ud=Cc,Wd=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.QRCode=void 0;const Vd=Re,Do=kn,zd=Wd(Ud),qd=e=>{const[t,r]=(0,Do.useState)("");return(0,Do.useEffect)(()=>{var n,s;const i=new zd.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(s=e.height)!==null&&s!==void 0?s:256,padding:0,image:e.image}),o=Buffer.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Vd.h)("img",{src:t,alt:"QR Code"}):null};Mn.QRCode=qd;var Nn={},Ui={};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var Gd=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.Spinner=void 0;const qr=Re,Jd=Gd(Ui),Zd=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,qr.h)("div",{class:"-cbwsdk-spinner"},(0,qr.h)("style",null,Jd.default),(0,qr.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,qr.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Nn.Spinner=Zd;var Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var kc=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zt,"__esModule",{value:!0});zt.CoinbaseWalletSteps=zt.ConnectContent=void 0;const yt=kc(Tr),X=Re,Kd=P,Qd=Yt,Yd=In,Xd=An,eh=Tn,th=Mn,rh=Nn,nh=kc(Wi),ri={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Ic},sh=e=>e==="light"?"#FFFFFF":"#0A0B0D";function ih(e){const{theme:t}=e,r=(0,Kd.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=ri.steps;return(0,X.h)("div",{"data-testid":"connect-content",className:(0,yt.default)("-cbwsdk-connect-content",t)},(0,X.h)("style",null,nh.default),(0,X.h)("div",{className:"-cbwsdk-connect-content-header"},(0,X.h)("h2",{className:(0,yt.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,X.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,X.h)(Yd.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,X.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,X.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,X.h)(oh,{title:ri.title,description:ri.description,theme:t})),(0,X.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,X.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,X.h)(th.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,X.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Qd.LIB_VERSION}),(0,X.h)("input",{type:"hidden",value:r})),(0,X.h)(n,{theme:t}),!e.isConnected&&(0,X.h)("div",{"data-testid":"connecting-spinner",className:(0,yt.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,X.h)(rh.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,X.h)("p",null,"Connecting...")))))}zt.ConnectContent=ih;function oh({title:e,description:t,theme:r}){return(0,X.h)("div",{className:(0,yt.default)("-cbwsdk-connect-item",r)},(0,X.h)("div",null,(0,X.h)(Xd.CoinbaseWalletRound,null)),(0,X.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,X.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,X.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Ic({theme:e}){return(0,X.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,X.h)("li",{className:(0,yt.default)("-cbwsdk-wallet-steps-item",e)},(0,X.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,X.h)("li",{className:(0,yt.default)("-cbwsdk-wallet-steps-item",e)},(0,X.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,X.h)("span",null,"Tap ",(0,X.h)("strong",null,"Scan")," "),(0,X.h)("span",{className:(0,yt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,X.h)(eh.QRCodeIcon,{fill:sh(e)})))))}zt.CoinbaseWalletSteps=Ic;var xn={},Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.ArrowLeftIcon=void 0;const jo=Re;function ah(e){return(0,jo.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,jo.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Ln.ArrowLeftIcon=ah;var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.LaptopIcon=void 0;const ni=Re;function ch(e){return(0,ni.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,ni.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,ni.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Pn.LaptopIcon=ch;var On={};Object.defineProperty(On,"__esModule",{value:!0});On.SafeIcon=void 0;const Ho=Re;function lh(e){return(0,Ho.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ho.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}On.SafeIcon=lh;var Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Ac=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xn,"__esModule",{value:!0});xn.TryExtensionContent=void 0;const ht=Ac(Tr),he=Re,si=kn,uh=Ln,dh=Pn,hh=On,fh=Ac(Vi);function gh({theme:e}){const[t,r]=(0,si.useState)(!1),n=(0,si.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,si.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,he.h)("div",{class:(0,ht.default)("-cbwsdk-try-extension",e)},(0,he.h)("style",null,fh.default),(0,he.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,he.h)("h3",{class:(0,ht.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,he.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,he.h)("button",{class:(0,ht.default)("-cbwsdk-try-extension-cta",e),onClick:s},t?"Refresh":"Install"),(0,he.h)("div",null,!t&&(0,he.h)(uh.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,he.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,he.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,he.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,he.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,he.h)("span",{class:(0,ht.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,he.h)(dh.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,he.h)("div",{class:(0,ht.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,he.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,he.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,he.h)("span",{class:(0,ht.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,he.h)(hh.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,he.h)("div",{class:(0,ht.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}xn.TryExtensionContent=gh;var zi={};Object.defineProperty(zi,"__esModule",{value:!0});zi.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Tc=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.ConnectDialog=void 0;const ii=Tc(Tr),ft=Re,oi=kn,ph=zt,bh=xn,mh=Tc(zi),_h=e=>{const{isOpen:t,darkMode:r}=e,[n,s]=(0,oi.useState)(!t),[i,o]=(0,oi.useState)(!t);(0,oi.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!t)},10)];return t?s(!1):c.push(window.setTimeout(()=>{s(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t]);const a=r?"dark":"light";return(0,ft.h)("div",{class:(0,ii.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,ft.h)("style",null,mh.default),(0,ft.h)("div",{class:(0,ii.default)("-cbwsdk-connect-dialog-backdrop",a,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,ft.h)("div",{class:"-cbwsdk-connect-dialog"},(0,ft.h)("div",{class:(0,ii.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,ft.h)(ph.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,ft.h)(bh.TryExtensionContent,{theme:a}))))};Cn.ConnectDialog=_h;Object.defineProperty(Rn,"__esModule",{value:!0});Rn.LinkFlow=void 0;const ai=Re,wh=Cn;class yh{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,ai.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,ai.render)((0,ai.h)(wh.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}Rn.LinkFlow=yh;var qi={},Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=D&&D.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(Tr),n=Re,s=kn,i=t(Gi),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(h){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=h.darkMode}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const b=this.nextItemKey++;return this.items.set(b,h),this.render(),()=>{this.items.delete(b),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,b])=>(0,n.h)(e.SnackbarInstance,Object.assign({},b,{key:h}))))),this.root)}}e.Snackbar=c;const l=d=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},d.children));e.SnackbarContainer=l;const u=({autoExpand:d,message:h,menuItems:b})=>{const[w,R]=(0,s.useState)(!0),[E,p]=(0,s.useState)(d??!1);(0,s.useEffect)(()=>{const m=[window.setTimeout(()=>{R(!1)},1),window.setTimeout(()=>{p(!0)},1e4)];return()=>{m.forEach(window.clearTimeout)}});const _=()=>{p(!E)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",w&&"-cbwsdk-snackbar-instance-hidden",E&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:_},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!E&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),b&&b.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},b.map((m,C)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",m.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:m.onClick,key:C},(0,n.h)("svg",{width:m.svgWidth,height:m.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":m.defaultFillRule,"clip-rule":m.defaultClipRule,d:m.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",m.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},m.info)))))};e.SnackbarInstance=u})(qi);Object.defineProperty(Ir,"__esModule",{value:!0});Ir.WalletLinkRelayUI=void 0;const vh=Ar,Eh=Rn,Sh=qi;class Rh{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new Sh.Snackbar({darkMode:t.darkMode}),this.linkFlow=new Eh.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,vh.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Ir.WalletLinkRelayUI=Rh;Object.defineProperty(Er,"__esModule",{value:!0});Er.WalletLinkRelay=void 0;const Pt=mr,Ch=fe,ae=P,gt=Xt,Uo=xe,it=er,kh=vn,pt=Qt,Ih=Ir;class et extends Uo.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var a;this.isLinked=o;const c=this.storage.getItem(Uo.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,c){const l=c.split(" "),u=this.storage.getItem("IsStandaloneSigning")==="true";if(l[0]!==""&&!o&&this.session.linked&&!u){this.isUnlinkedErrorState=!0;const d=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(gt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:d})}}},this.metadataUpdated=(o,a)=>{this.storage.setItem(o,a)},this.chainUpdated=(o,a)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:o,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(o,a))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),et.accountRequestCallbackIds.size>0&&(Array.from(et.accountRequestCallbackIds.values()).forEach(a=>{const c={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},c),{id:a}))}),et.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:s,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=s}subscribe(){const t=it.Session.load(this.storage)||new it.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,s=new kh.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:i,darkMode:o}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:i,darkMode:o,session:t});return s.connect(),{session:t,ui:a,connection:s}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(gt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=it.Session.load(this.storage);if((s==null?void 0:s.id)===this._session.id?this.storage.clear():s&&((r=this.diagnostic)===null||r===void 0||r.log(gt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:it.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:i,ui:o,connection:a}=this.subscribe();this._session=i,this.connection=a,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(gt.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,ae.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,ae.hexStringFromBuffer)(t,!0),signature:(0,ae.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,ae.bigIntStringFromBN)(t.weiValue),data:(0,ae.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,ae.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,ae.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,ae.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,ae.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,ae.bigIntStringFromBN)(t.weiValue),data:(0,ae.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,ae.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,ae.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,ae.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,ae.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,ae.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,ae.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,ae.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),(0,pt.isErrorResponse)(c))return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:s}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof Ih.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const s={type:"WEB3_REQUEST",id:t,request:r},i=it.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(gt.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?it.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(gt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?it.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(gt.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){et.accountRequestCallbackIds.forEach(s=>this.invokeCallback(Object.assign(Object.assign({},t),{id:s}))),et.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,s){var i;const o=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:(0,Pt.getMessageFromCode)(s);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:s}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,ae.randomBytesHex)(8),n=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,i)};return{promise:new Promise((i,o)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,pt.isErrorResponse)(a))return o(new Error(a.errorMessage));i(a)}),this.ui.inlineAccountsResponse()){const a=c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:c}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=Pt.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}et.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,ae.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},i=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,u=>{if((0,pt.isErrorResponse)(u))return a(new Error(u.errorMessage));o(u)});const c=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:Ch.ProviderType.Unselected}})},l=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:u}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:t})});return{cancel:s,promise:i}}watchAsset(t,r,n,s,i,o){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:s,image:i},chainId:o}};let c=null;const l=(0,ae.randomBytesHex)(8),u=h=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,h),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));const d=new Promise((h,b)=>{this.relayEventManager.callbacks.set(l,E=>{if(c==null||c(),(0,pt.isErrorResponse)(E))return b(new Error(E.errorMessage));h(E)});const w=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!1}})},R=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:R,onCancel:w,type:t,address:r,symbol:n,decimals:s,image:i,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:u,promise:d}}addEthereumChain(t,r,n,s,i,o){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:o}};let c=null;const l=(0,ae.randomBytesHex)(8),u=h=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,h),c==null||c()};return this.ui.inlineAddEthereumChain(t)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload})),{promise:new Promise((h,b)=>{this.relayEventManager.callbacks.set(l,E=>{if(c==null||c(),(0,pt.isErrorResponse)(E))return b(new Error(E.errorMessage));h(E)});const w=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},R=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:E}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:w,onApprove:R,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:u}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},s=(0,ae.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(s,d=>{if((0,pt.isErrorResponse)(d)&&d.errorCode)return c(Pt.standardErrors.provider.custom({code:d.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,pt.isErrorResponse)(d))return c(new Error(d.errorMessage));a(d)});const l=d=>{var h;if(d){const b=(h=(0,Pt.getErrorCode)(d))!==null&&h!==void 0?h:Pt.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(s,"switchEthereumChain",d instanceof Error?d:Pt.standardErrors.provider.unsupportedChain(t),b)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},u=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:d}}})};this.ui.switchEthereumChain({onCancel:l,onApprove:u,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(s,n)}),cancel:i}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return it.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=i=>{this.handleErrorResponse(t,r.method,i)},s=i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:i})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:s,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:s});break;default:n();break}}}Er.WalletLinkRelay=et;et.accountRequestCallbackIds=new Set;var Mr={},$n={},Mc={};(function(e){var t=D&&D.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=D&&D.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(qi,e)})(Mc);var Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Nc=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($n,"__esModule",{value:!0});$n.RedirectDialog=void 0;const Ah=Nc(Tr),qe=Re,Th=Ar,Mh=Mc,Nh=Nc(Ji);class xh{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,Th.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,qe.render)(null,this.root),t&&(0,qe.render)((0,qe.h)(Lh,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}$n.RedirectDialog=xh;const Lh=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:s})=>{const i=r?"dark":"light";return(0,qe.h)(Mh.SnackbarContainer,{darkMode:r},(0,qe.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,qe.h)("style",null,Nh.default),(0,qe.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,qe.h)("div",{class:(0,Ah.default)("-cbwsdk-redirect-dialog-box",i)},(0,qe.h)("p",null,e),(0,qe.h)("button",{onClick:n},t))))};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.MobileRelayUI=void 0;const Ph=$n;class Oh{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new Ph.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}Mr.MobileRelayUI=Oh;Object.defineProperty(vr,"__esModule",{value:!0});vr.MobileRelay=void 0;const $h=P,Bh=Er,Fh=Mr;class Dh extends Bh.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,$h.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof Fh.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}vr.MobileRelay=Dh;var Ni={exports:{}},xc=un.EventEmitter,ci,Wo;function jh(){if(Wo)return ci;Wo=1;function e(w,R){var E=Object.keys(w);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(w);R&&(p=p.filter(function(_){return Object.getOwnPropertyDescriptor(w,_).enumerable})),E.push.apply(E,p)}return E}function t(w){for(var R=1;R<arguments.length;R++){var E=arguments[R]!=null?arguments[R]:{};R%2?e(Object(E),!0).forEach(function(p){r(w,p,E[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(E)):e(Object(E)).forEach(function(p){Object.defineProperty(w,p,Object.getOwnPropertyDescriptor(E,p))})}return w}function r(w,R,E){return R=o(R),R in w?Object.defineProperty(w,R,{value:E,enumerable:!0,configurable:!0,writable:!0}):w[R]=E,w}function n(w,R){if(!(w instanceof R))throw new TypeError("Cannot call a class as a function")}function s(w,R){for(var E=0;E<R.length;E++){var p=R[E];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(w,o(p.key),p)}}function i(w,R,E){return R&&s(w.prototype,R),Object.defineProperty(w,"prototype",{writable:!1}),w}function o(w){var R=a(w,"string");return typeof R=="symbol"?R:String(R)}function a(w,R){if(typeof w!="object"||w===null)return w;var E=w[Symbol.toPrimitive];if(E!==void 0){var p=E.call(w,R||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(w)}var c=ln,l=c.Buffer,u=tc,d=u.inspect,h=d&&d.custom||"inspect";function b(w,R,E){l.prototype.copy.call(w,R,E)}return ci=function(){function w(){n(this,w),this.head=null,this.tail=null,this.length=0}return i(w,[{key:"push",value:function(E){var p={data:E,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(E){var p={data:E,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";for(var p=this.head,_=""+p.data;p=p.next;)_+=E+p.data;return _}},{key:"concat",value:function(E){if(this.length===0)return l.alloc(0);for(var p=l.allocUnsafe(E>>>0),_=this.head,m=0;_;)b(_.data,p,m),m+=_.data.length,_=_.next;return p}},{key:"consume",value:function(E,p){var _;return E<this.head.data.length?(_=this.head.data.slice(0,E),this.head.data=this.head.data.slice(E)):E===this.head.data.length?_=this.shift():_=p?this._getString(E):this._getBuffer(E),_}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(E){var p=this.head,_=1,m=p.data;for(E-=m.length;p=p.next;){var C=p.data,S=E>C.length?C.length:E;if(S===C.length?m+=C:m+=C.slice(0,E),E-=S,E===0){S===C.length?(++_,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=C.slice(S));break}++_}return this.length-=_,m}},{key:"_getBuffer",value:function(E){var p=l.allocUnsafe(E),_=this.head,m=1;for(_.data.copy(p),E-=_.data.length;_=_.next;){var C=_.data,S=E>C.length?C.length:E;if(C.copy(p,p.length-E,0,S),E-=S,E===0){S===C.length?(++m,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=C.slice(S));break}++m}return this.length-=m,p}},{key:h,value:function(E,p){return d(this,t(t({},p),{},{depth:0,customInspect:!1}))}}]),w}(),ci}function Hh(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return n||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(xi,this,e)):process.nextTick(xi,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(i){!t&&i?r._writableState?r._writableState.errorEmitted?process.nextTick(rn,r):(r._writableState.errorEmitted=!0,process.nextTick(Vo,r,i)):process.nextTick(Vo,r,i):t?(process.nextTick(rn,r),t(i)):process.nextTick(rn,r)}),this)}function Vo(e,t){xi(e,t),rn(e)}function rn(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Uh(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function xi(e,t){e.emit("error",t)}function Wh(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Lc={destroy:Hh,undestroy:Uh,errorOrDestroy:Wh},Ct={};function Vh(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Pc={};function Oe(e,t,r){r||(r=Error);function n(i,o,a){return typeof t=="string"?t:t(i,o,a)}var s=function(i){Vh(o,i);function o(a,c,l){return i.call(this,n(a,c,l))||this}return o}(r);s.prototype.name=r.name,s.prototype.code=e,Pc[e]=s}function zo(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function zh(e,t,r){return e.substr(0,t.length)===t}function qh(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Gh(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Oe("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Oe("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&zh(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var s;if(qh(e," argument"))s="The ".concat(e," ").concat(n," ").concat(zo(t,"type"));else{var i=Gh(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(i," ").concat(n," ").concat(zo(t,"type"))}return s+=". Received type ".concat(typeof r),s},TypeError);Oe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Oe("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Oe("ERR_STREAM_PREMATURE_CLOSE","Premature close");Oe("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Oe("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Oe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Oe("ERR_STREAM_WRITE_AFTER_END","write after end");Oe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Oe("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Oe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Ct.codes=Pc;var Jh=Ct.codes.ERR_INVALID_OPT_VALUE;function Zh(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Kh(e,t,r,n){var s=Zh(t,n,r);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var i=n?r:"highWaterMark";throw new Jh(i,s)}return Math.floor(s)}return e.objectMode?16:16*1024}var Oc={getHighWaterMark:Kh},Qh=Yh;function Yh(e,t){if(li("noDeprecation"))return e;var r=!1;function n(){if(!r){if(li("throwDeprecation"))throw new Error(t);li("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function li(e){try{if(!D.localStorage)return!1}catch{return!1}var t=D.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var ui,qo;function $c(){if(qo)return ui;qo=1,ui=B;function e(y){var v=this;this.next=null,this.entry=null,this.finish=function(){te(v,y)}}var t;B.WritableState=T;var r={deprecate:Qh},n=xc,s=ln.Buffer,i=(typeof D<"u"?D:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(y){return s.from(y)}function a(y){return s.isBuffer(y)||y instanceof i}var c=Lc,l=Oc,u=l.getHighWaterMark,d=Ct.codes,h=d.ERR_INVALID_ARG_TYPE,b=d.ERR_METHOD_NOT_IMPLEMENTED,w=d.ERR_MULTIPLE_CALLBACK,R=d.ERR_STREAM_CANNOT_PIPE,E=d.ERR_STREAM_DESTROYED,p=d.ERR_STREAM_NULL_VALUES,_=d.ERR_STREAM_WRITE_AFTER_END,m=d.ERR_UNKNOWN_ENCODING,C=c.errorOrDestroy;Fe(B,n);function S(){}function T(y,v,A){t=t||qt(),y=y||{},typeof A!="boolean"&&(A=v instanceof t),this.objectMode=!!y.objectMode,A&&(this.objectMode=this.objectMode||!!y.writableObjectMode),this.highWaterMark=u(this,y,"writableHighWaterMark",A),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var j=y.decodeStrings===!1;this.decodeStrings=!j,this.defaultEncoding=y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(G){$(v,G)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=y.emitClose!==!1,this.autoDestroy=!!y.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}T.prototype.getBuffer=function(){for(var v=this.bufferedRequest,A=[];v;)A.push(v),v=v.next;return A},function(){try{Object.defineProperty(T.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var U;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(U=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(v){return U.call(this,v)?!0:this!==B?!1:v&&v._writableState instanceof T}})):U=function(v){return v instanceof this};function B(y){t=t||qt();var v=this instanceof t;if(!v&&!U.call(B,this))return new B(y);this._writableState=new T(y,this,v),this.writable=!0,y&&(typeof y.write=="function"&&(this._write=y.write),typeof y.writev=="function"&&(this._writev=y.writev),typeof y.destroy=="function"&&(this._destroy=y.destroy),typeof y.final=="function"&&(this._final=y.final)),n.call(this)}B.prototype.pipe=function(){C(this,new R)};function O(y,v){var A=new _;C(y,A),process.nextTick(v,A)}function Q(y,v,A,j){var G;return A===null?G=new p:typeof A!="string"&&!v.objectMode&&(G=new h("chunk",["string","Buffer"],A)),G?(C(y,G),process.nextTick(j,G),!1):!0}B.prototype.write=function(y,v,A){var j=this._writableState,G=!1,f=!j.objectMode&&a(y);return f&&!s.isBuffer(y)&&(y=o(y)),typeof v=="function"&&(A=v,v=null),f?v="buffer":v||(v=j.defaultEncoding),typeof A!="function"&&(A=S),j.ending?O(this,A):(f||Q(this,j,y,A))&&(j.pendingcb++,G=ne(this,j,f,y,v,A)),G},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){var y=this._writableState;y.corked&&(y.corked--,!y.writing&&!y.corked&&!y.bufferProcessing&&y.bufferedRequest&&L(this,y))},B.prototype.setDefaultEncoding=function(v){if(typeof v=="string"&&(v=v.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((v+"").toLowerCase())>-1))throw new m(v);return this._writableState.defaultEncoding=v,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oe(y,v,A){return!y.objectMode&&y.decodeStrings!==!1&&typeof v=="string"&&(v=s.from(v,A)),v}Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ne(y,v,A,j,G,f){if(!A){var g=oe(v,j,G);j!==g&&(A=!0,G="buffer",j=g)}var k=v.objectMode?1:j.length;v.length+=k;var N=v.length<v.highWaterMark;if(N||(v.needDrain=!0),v.writing||v.corked){var ie=v.lastBufferedRequest;v.lastBufferedRequest={chunk:j,encoding:G,isBuf:A,callback:f,next:null},ie?ie.next=v.lastBufferedRequest:v.bufferedRequest=v.lastBufferedRequest,v.bufferedRequestCount+=1}else se(y,v,!1,k,j,G,f);return N}function se(y,v,A,j,G,f,g){v.writelen=j,v.writecb=g,v.writing=!0,v.sync=!0,v.destroyed?v.onwrite(new E("write")):A?y._writev(G,v.onwrite):y._write(G,f,v.onwrite),v.sync=!1}function M(y,v,A,j,G){--v.pendingcb,A?(process.nextTick(G,j),process.nextTick(K,y,v),y._writableState.errorEmitted=!0,C(y,j)):(G(j),y._writableState.errorEmitted=!0,C(y,j),K(y,v))}function I(y){y.writing=!1,y.writecb=null,y.length-=y.writelen,y.writelen=0}function $(y,v){var A=y._writableState,j=A.sync,G=A.writecb;if(typeof G!="function")throw new w;if(I(A),v)M(y,A,j,v,G);else{var f=H(A)||y.destroyed;!f&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&L(y,A),j?process.nextTick(x,y,A,f,G):x(y,A,f,G)}}function x(y,v,A,j){A||F(y,v),v.pendingcb--,j(),K(y,v)}function F(y,v){v.length===0&&v.needDrain&&(v.needDrain=!1,y.emit("drain"))}function L(y,v){v.bufferProcessing=!0;var A=v.bufferedRequest;if(y._writev&&A&&A.next){var j=v.bufferedRequestCount,G=new Array(j),f=v.corkedRequestsFree;f.entry=A;for(var g=0,k=!0;A;)G[g]=A,A.isBuf||(k=!1),A=A.next,g+=1;G.allBuffers=k,se(y,v,!0,v.length,G,"",f.finish),v.pendingcb++,v.lastBufferedRequest=null,f.next?(v.corkedRequestsFree=f.next,f.next=null):v.corkedRequestsFree=new e(v),v.bufferedRequestCount=0}else{for(;A;){var N=A.chunk,ie=A.encoding,q=A.callback,re=v.objectMode?1:N.length;if(se(y,v,!1,re,N,ie,q),A=A.next,v.bufferedRequestCount--,v.writing)break}A===null&&(v.lastBufferedRequest=null)}v.bufferedRequest=A,v.bufferProcessing=!1}B.prototype._write=function(y,v,A){A(new b("_write()"))},B.prototype._writev=null,B.prototype.end=function(y,v,A){var j=this._writableState;return typeof y=="function"?(A=y,y=null,v=null):typeof v=="function"&&(A=v,v=null),y!=null&&this.write(y,v),j.corked&&(j.corked=1,this.uncork()),j.ending||ue(this,j,A),this},Object.defineProperty(B.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function H(y){return y.ending&&y.length===0&&y.bufferedRequest===null&&!y.finished&&!y.writing}function Z(y,v){y._final(function(A){v.pendingcb--,A&&C(y,A),v.prefinished=!0,y.emit("prefinish"),K(y,v)})}function W(y,v){!v.prefinished&&!v.finalCalled&&(typeof y._final=="function"&&!v.destroyed?(v.pendingcb++,v.finalCalled=!0,process.nextTick(Z,y,v)):(v.prefinished=!0,y.emit("prefinish")))}function K(y,v){var A=H(v);if(A&&(W(y,v),v.pendingcb===0&&(v.finished=!0,y.emit("finish"),v.autoDestroy))){var j=y._readableState;(!j||j.autoDestroy&&j.endEmitted)&&y.destroy()}return A}function ue(y,v,A){v.ending=!0,K(y,v),A&&(v.finished?process.nextTick(A):y.once("finish",A)),v.ended=!0,y.writable=!1}function te(y,v,A){var j=y.entry;for(y.entry=null;j;){var G=j.callback;v.pendingcb--,G(A),j=j.next}v.corkedRequestsFree.next=y}return Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(v){this._writableState&&(this._writableState.destroyed=v)}}),B.prototype.destroy=c.destroy,B.prototype._undestroy=c.undestroy,B.prototype._destroy=function(y,v){v(y)},ui}var di,Go;function qt(){if(Go)return di;Go=1;var e=Object.keys||function(l){var u=[];for(var d in l)u.push(d);return u};di=o;var t=Fc(),r=$c();Fe(o,t);for(var n=e(r.prototype),s=0;s<n.length;s++){var i=n[s];o.prototype[i]||(o.prototype[i]=r.prototype[i])}function o(l){if(!(this instanceof o))return new o(l);t.call(this,l),r.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(c,this)}function c(l){l.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),di}var hi={},Jo;function Zo(){if(Jo)return hi;Jo=1;var e=ut.Buffer,t=e.isEncoding||function(p){switch(p=""+p,p&&p.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(p){if(!p)return"utf8";for(var _;;)switch(p){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return p;default:if(_)return;p=(""+p).toLowerCase(),_=!0}}function n(p){var _=r(p);if(typeof _!="string"&&(e.isEncoding===t||!t(p)))throw new Error("Unknown encoding: "+p);return _||p}hi.StringDecoder=s;function s(p){this.encoding=n(p);var _;switch(this.encoding){case"utf16le":this.text=d,this.end=h,_=4;break;case"utf8":this.fillLast=c,_=4;break;case"base64":this.text=b,this.end=w,_=3;break;default:this.write=R,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(_)}s.prototype.write=function(p){if(p.length===0)return"";var _,m;if(this.lastNeed){if(_=this.fillLast(p),_===void 0)return"";m=this.lastNeed,this.lastNeed=0}else m=0;return m<p.length?_?_+this.text(p,m):this.text(p,m):_||""},s.prototype.end=u,s.prototype.text=l,s.prototype.fillLast=function(p){if(this.lastNeed<=p.length)return p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,p.length),this.lastNeed-=p.length};function i(p){return p<=127?0:p>>5===6?2:p>>4===14?3:p>>3===30?4:p>>6===2?-1:-2}function o(p,_,m){var C=_.length-1;if(C<m)return 0;var S=i(_[C]);return S>=0?(S>0&&(p.lastNeed=S-1),S):--C<m||S===-2?0:(S=i(_[C]),S>=0?(S>0&&(p.lastNeed=S-2),S):--C<m||S===-2?0:(S=i(_[C]),S>=0?(S>0&&(S===2?S=0:p.lastNeed=S-3),S):0))}function a(p,_,m){if((_[0]&192)!==128)return p.lastNeed=0,"�";if(p.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return p.lastNeed=1,"�";if(p.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return p.lastNeed=2,"�"}}function c(p){var _=this.lastTotal-this.lastNeed,m=a(this,p);if(m!==void 0)return m;if(this.lastNeed<=p.length)return p.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,_,0,p.length),this.lastNeed-=p.length}function l(p,_){var m=o(this,p,_);if(!this.lastNeed)return p.toString("utf8",_);this.lastTotal=m;var C=p.length-(m-this.lastNeed);return p.copy(this.lastChar,0,C),p.toString("utf8",_,C)}function u(p){var _=p&&p.length?this.write(p):"";return this.lastNeed?_+"�":_}function d(p,_){if((p.length-_)%2===0){var m=p.toString("utf16le",_);if(m){var C=m.charCodeAt(m.length-1);if(C>=55296&&C<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],m.slice(0,-1)}return m}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",_,p.length-1)}function h(p){var _=p&&p.length?this.write(p):"";if(this.lastNeed){var m=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,m)}return _}function b(p,_){var m=(p.length-_)%3;return m===0?p.toString("base64",_):(this.lastNeed=3-m,this.lastTotal=3,m===1?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",_,p.length-m))}function w(p){var _=p&&p.length?this.write(p):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function R(p){return p.toString(this.encoding)}function E(p){return p&&p.length?this.write(p):""}return hi}var Ko=Ct.codes.ERR_STREAM_PREMATURE_CLOSE;function Xh(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];e.apply(this,n)}}}function ef(){}function tf(e){return e.setHeader&&typeof e.abort=="function"}function Bc(e,t,r){if(typeof t=="function")return Bc(e,null,t);t||(t={}),r=Xh(r||ef);var n=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,i=function(){e.writable||a()},o=e._writableState&&e._writableState.finished,a=function(){s=!1,o=!0,n||r.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){n=!1,c=!0,s||r.call(e)},u=function(w){r.call(e,w)},d=function(){var w;if(n&&!c)return(!e._readableState||!e._readableState.ended)&&(w=new Ko),r.call(e,w);if(s&&!o)return(!e._writableState||!e._writableState.ended)&&(w=new Ko),r.call(e,w)},h=function(){e.req.on("finish",a)};return tf(e)?(e.on("complete",a),e.on("abort",d),e.req?h():e.on("request",h)):s&&!e._writableState&&(e.on("end",i),e.on("close",i)),e.on("end",l),e.on("finish",a),t.error!==!1&&e.on("error",u),e.on("close",d),function(){e.removeListener("complete",a),e.removeListener("abort",d),e.removeListener("request",h),e.req&&e.req.removeListener("finish",a),e.removeListener("end",i),e.removeListener("close",i),e.removeListener("finish",a),e.removeListener("end",l),e.removeListener("error",u),e.removeListener("close",d)}}var Zi=Bc,fi,Qo;function rf(){if(Qo)return fi;Qo=1;var e;function t(m,C,S){return C=r(C),C in m?Object.defineProperty(m,C,{value:S,enumerable:!0,configurable:!0,writable:!0}):m[C]=S,m}function r(m){var C=n(m,"string");return typeof C=="symbol"?C:String(C)}function n(m,C){if(typeof m!="object"||m===null)return m;var S=m[Symbol.toPrimitive];if(S!==void 0){var T=S.call(m,C||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(m)}var s=Zi,i=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),d=Symbol("stream");function h(m,C){return{value:m,done:C}}function b(m){var C=m[i];if(C!==null){var S=m[d].read();S!==null&&(m[l]=null,m[i]=null,m[o]=null,C(h(S,!1)))}}function w(m){process.nextTick(b,m)}function R(m,C){return function(S,T){m.then(function(){if(C[c]){S(h(void 0,!0));return}C[u](S,T)},T)}}var E=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((e={get stream(){return this[d]},next:function(){var C=this,S=this[a];if(S!==null)return Promise.reject(S);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(O,Q){process.nextTick(function(){C[a]?Q(C[a]):O(h(void 0,!0))})});var T=this[l],U;if(T)U=new Promise(R(T,this));else{var B=this[d].read();if(B!==null)return Promise.resolve(h(B,!1));U=new Promise(this[u])}return this[l]=U,U}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var C=this;return new Promise(function(S,T){C[d].destroy(null,function(U){if(U){T(U);return}S(h(void 0,!0))})})}),e),E),_=function(C){var S,T=Object.create(p,(S={},t(S,d,{value:C,writable:!0}),t(S,i,{value:null,writable:!0}),t(S,o,{value:null,writable:!0}),t(S,a,{value:null,writable:!0}),t(S,c,{value:C._readableState.endEmitted,writable:!0}),t(S,u,{value:function(B,O){var Q=T[d].read();Q?(T[l]=null,T[i]=null,T[o]=null,B(h(Q,!1))):(T[i]=B,T[o]=O)},writable:!0}),S));return T[l]=null,s(C,function(U){if(U&&U.code!=="ERR_STREAM_PREMATURE_CLOSE"){var B=T[o];B!==null&&(T[l]=null,T[i]=null,T[o]=null,B(U)),T[a]=U;return}var O=T[i];O!==null&&(T[l]=null,T[i]=null,T[o]=null,O(h(void 0,!0))),T[c]=!0}),C.on("readable",w.bind(null,T)),T};return fi=_,fi}var gi,Yo;function nf(){return Yo||(Yo=1,gi=function(){throw new Error("Readable.from is not available in the browser")}),gi}var pi,Xo;function Fc(){if(Xo)return pi;Xo=1,pi=O;var e;O.ReadableState=B,un.EventEmitter;var t=function(g,k){return g.listeners(k).length},r=xc,n=ln.Buffer,s=(typeof D<"u"?D:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(f){return n.from(f)}function o(f){return n.isBuffer(f)||f instanceof s}var a=tc,c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var l=jh(),u=Lc,d=Oc,h=d.getHighWaterMark,b=Ct.codes,w=b.ERR_INVALID_ARG_TYPE,R=b.ERR_STREAM_PUSH_AFTER_EOF,E=b.ERR_METHOD_NOT_IMPLEMENTED,p=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,_,m,C;Fe(O,r);var S=u.errorOrDestroy,T=["error","close","destroy","pause","resume"];function U(f,g,k){if(typeof f.prependListener=="function")return f.prependListener(g,k);!f._events||!f._events[g]?f.on(g,k):Array.isArray(f._events[g])?f._events[g].unshift(k):f._events[g]=[k,f._events[g]]}function B(f,g,k){e=e||qt(),f=f||{},typeof k!="boolean"&&(k=g instanceof e),this.objectMode=!!f.objectMode,k&&(this.objectMode=this.objectMode||!!f.readableObjectMode),this.highWaterMark=h(this,f,"readableHighWaterMark",k),this.buffer=new l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=f.emitClose!==!1,this.autoDestroy=!!f.autoDestroy,this.destroyed=!1,this.defaultEncoding=f.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,f.encoding&&(_||(_=Zo().StringDecoder),this.decoder=new _(f.encoding),this.encoding=f.encoding)}function O(f){if(e=e||qt(),!(this instanceof O))return new O(f);var g=this instanceof e;this._readableState=new B(f,this,g),this.readable=!0,f&&(typeof f.read=="function"&&(this._read=f.read),typeof f.destroy=="function"&&(this._destroy=f.destroy)),r.call(this)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(g){this._readableState&&(this._readableState.destroyed=g)}}),O.prototype.destroy=u.destroy,O.prototype._undestroy=u.undestroy,O.prototype._destroy=function(f,g){g(f)},O.prototype.push=function(f,g){var k=this._readableState,N;return k.objectMode?N=!0:typeof f=="string"&&(g=g||k.defaultEncoding,g!==k.encoding&&(f=n.from(f,g),g=""),N=!0),Q(this,f,g,!1,N)},O.prototype.unshift=function(f){return Q(this,f,null,!0,!1)};function Q(f,g,k,N,ie){c("readableAddChunk",g);var q=f._readableState;if(g===null)q.reading=!1,$(f,q);else{var re;if(ie||(re=ne(q,g)),re)S(f,re);else if(q.objectMode||g&&g.length>0)if(typeof g!="string"&&!q.objectMode&&Object.getPrototypeOf(g)!==n.prototype&&(g=i(g)),N)q.endEmitted?S(f,new p):oe(f,q,g,!0);else if(q.ended)S(f,new R);else{if(q.destroyed)return!1;q.reading=!1,q.decoder&&!k?(g=q.decoder.write(g),q.objectMode||g.length!==0?oe(f,q,g,!1):L(f,q)):oe(f,q,g,!1)}else N||(q.reading=!1,L(f,q))}return!q.ended&&(q.length<q.highWaterMark||q.length===0)}function oe(f,g,k,N){g.flowing&&g.length===0&&!g.sync?(g.awaitDrain=0,f.emit("data",k)):(g.length+=g.objectMode?1:k.length,N?g.buffer.unshift(k):g.buffer.push(k),g.needReadable&&x(f)),L(f,g)}function ne(f,g){var k;return!o(g)&&typeof g!="string"&&g!==void 0&&!f.objectMode&&(k=new w("chunk",["string","Buffer","Uint8Array"],g)),k}O.prototype.isPaused=function(){return this._readableState.flowing===!1},O.prototype.setEncoding=function(f){_||(_=Zo().StringDecoder);var g=new _(f);this._readableState.decoder=g,this._readableState.encoding=this._readableState.decoder.encoding;for(var k=this._readableState.buffer.head,N="";k!==null;)N+=g.write(k.data),k=k.next;return this._readableState.buffer.clear(),N!==""&&this._readableState.buffer.push(N),this._readableState.length=N.length,this};var se=1073741824;function M(f){return f>=se?f=se:(f--,f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f++),f}function I(f,g){return f<=0||g.length===0&&g.ended?0:g.objectMode?1:f!==f?g.flowing&&g.length?g.buffer.head.data.length:g.length:(f>g.highWaterMark&&(g.highWaterMark=M(f)),f<=g.length?f:g.ended?g.length:(g.needReadable=!0,0))}O.prototype.read=function(f){c("read",f),f=parseInt(f,10);var g=this._readableState,k=f;if(f!==0&&(g.emittedReadable=!1),f===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return c("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?A(this):x(this),null;if(f=I(f,g),f===0&&g.ended)return g.length===0&&A(this),null;var N=g.needReadable;c("need readable",N),(g.length===0||g.length-f<g.highWaterMark)&&(N=!0,c("length less than watermark",N)),g.ended||g.reading?(N=!1,c("reading or ended",N)):N&&(c("do read"),g.reading=!0,g.sync=!0,g.length===0&&(g.needReadable=!0),this._read(g.highWaterMark),g.sync=!1,g.reading||(f=I(k,g)));var ie;return f>0?ie=v(f,g):ie=null,ie===null?(g.needReadable=g.length<=g.highWaterMark,f=0):(g.length-=f,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),k!==f&&g.ended&&A(this)),ie!==null&&this.emit("data",ie),ie};function $(f,g){if(c("onEofChunk"),!g.ended){if(g.decoder){var k=g.decoder.end();k&&k.length&&(g.buffer.push(k),g.length+=g.objectMode?1:k.length)}g.ended=!0,g.sync?x(f):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,F(f)))}}function x(f){var g=f._readableState;c("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(c("emitReadable",g.flowing),g.emittedReadable=!0,process.nextTick(F,f))}function F(f){var g=f._readableState;c("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(f.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,y(f)}function L(f,g){g.readingMore||(g.readingMore=!0,process.nextTick(H,f,g))}function H(f,g){for(;!g.reading&&!g.ended&&(g.length<g.highWaterMark||g.flowing&&g.length===0);){var k=g.length;if(c("maybeReadMore read 0"),f.read(0),k===g.length)break}g.readingMore=!1}O.prototype._read=function(f){S(this,new E("_read()"))},O.prototype.pipe=function(f,g){var k=this,N=this._readableState;switch(N.pipesCount){case 0:N.pipes=f;break;case 1:N.pipes=[N.pipes,f];break;default:N.pipes.push(f);break}N.pipesCount+=1,c("pipe count=%d opts=%j",N.pipesCount,g);var ie=(!g||g.end!==!1)&&f!==process.stdout&&f!==process.stderr,q=ie?Qe:nt;N.endEmitted?process.nextTick(q):k.once("end",q),f.on("unpipe",re);function re(Ye,He){c("onunpipe"),Ye===k&&He&&He.hasUnpiped===!1&&(He.hasUnpiped=!0,Ur())}function Qe(){c("onend"),f.end()}var dt=Z(k);f.on("drain",dt);var or=!1;function Ur(){c("cleanup"),f.removeListener("close",Tt),f.removeListener("finish",Mt),f.removeListener("drain",dt),f.removeListener("error",At),f.removeListener("unpipe",re),k.removeListener("end",Qe),k.removeListener("end",nt),k.removeListener("data",ar),or=!0,N.awaitDrain&&(!f._writableState||f._writableState.needDrain)&&dt()}k.on("data",ar);function ar(Ye){c("ondata");var He=f.write(Ye);c("dest.write",He),He===!1&&((N.pipesCount===1&&N.pipes===f||N.pipesCount>1&&G(N.pipes,f)!==-1)&&!or&&(c("false write response, pause",N.awaitDrain),N.awaitDrain++),k.pause())}function At(Ye){c("onerror",Ye),nt(),f.removeListener("error",At),t(f,"error")===0&&S(f,Ye)}U(f,"error",At);function Tt(){f.removeListener("finish",Mt),nt()}f.once("close",Tt);function Mt(){c("onfinish"),f.removeListener("close",Tt),nt()}f.once("finish",Mt);function nt(){c("unpipe"),k.unpipe(f)}return f.emit("pipe",k),N.flowing||(c("pipe resume"),k.resume()),f};function Z(f){return function(){var k=f._readableState;c("pipeOnDrain",k.awaitDrain),k.awaitDrain&&k.awaitDrain--,k.awaitDrain===0&&t(f,"data")&&(k.flowing=!0,y(f))}}O.prototype.unpipe=function(f){var g=this._readableState,k={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return f&&f!==g.pipes?this:(f||(f=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,f&&f.emit("unpipe",this,k),this);if(!f){var N=g.pipes,ie=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var q=0;q<ie;q++)N[q].emit("unpipe",this,{hasUnpiped:!1});return this}var re=G(g.pipes,f);return re===-1?this:(g.pipes.splice(re,1),g.pipesCount-=1,g.pipesCount===1&&(g.pipes=g.pipes[0]),f.emit("unpipe",this,k),this)},O.prototype.on=function(f,g){var k=r.prototype.on.call(this,f,g),N=this._readableState;return f==="data"?(N.readableListening=this.listenerCount("readable")>0,N.flowing!==!1&&this.resume()):f==="readable"&&!N.endEmitted&&!N.readableListening&&(N.readableListening=N.needReadable=!0,N.flowing=!1,N.emittedReadable=!1,c("on readable",N.length,N.reading),N.length?x(this):N.reading||process.nextTick(K,this)),k},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(f,g){var k=r.prototype.removeListener.call(this,f,g);return f==="readable"&&process.nextTick(W,this),k},O.prototype.removeAllListeners=function(f){var g=r.prototype.removeAllListeners.apply(this,arguments);return(f==="readable"||f===void 0)&&process.nextTick(W,this),g};function W(f){var g=f._readableState;g.readableListening=f.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:f.listenerCount("data")>0&&f.resume()}function K(f){c("readable nexttick read 0"),f.read(0)}O.prototype.resume=function(){var f=this._readableState;return f.flowing||(c("resume"),f.flowing=!f.readableListening,ue(this,f)),f.paused=!1,this};function ue(f,g){g.resumeScheduled||(g.resumeScheduled=!0,process.nextTick(te,f,g))}function te(f,g){c("resume",g.reading),g.reading||f.read(0),g.resumeScheduled=!1,f.emit("resume"),y(f),g.flowing&&!g.reading&&f.read(0)}O.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function y(f){var g=f._readableState;for(c("flow",g.flowing);g.flowing&&f.read()!==null;);}O.prototype.wrap=function(f){var g=this,k=this._readableState,N=!1;f.on("end",function(){if(c("wrapped end"),k.decoder&&!k.ended){var re=k.decoder.end();re&&re.length&&g.push(re)}g.push(null)}),f.on("data",function(re){if(c("wrapped data"),k.decoder&&(re=k.decoder.write(re)),!(k.objectMode&&re==null)&&!(!k.objectMode&&(!re||!re.length))){var Qe=g.push(re);Qe||(N=!0,f.pause())}});for(var ie in f)this[ie]===void 0&&typeof f[ie]=="function"&&(this[ie]=function(Qe){return function(){return f[Qe].apply(f,arguments)}}(ie));for(var q=0;q<T.length;q++)f.on(T[q],this.emit.bind(this,T[q]));return this._read=function(re){c("wrapped _read",re),N&&(N=!1,f.resume())},this},typeof Symbol=="function"&&(O.prototype[Symbol.asyncIterator]=function(){return m===void 0&&(m=rf()),m(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(g){this._readableState&&(this._readableState.flowing=g)}}),O._fromList=v,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function v(f,g){if(g.length===0)return null;var k;return g.objectMode?k=g.buffer.shift():!f||f>=g.length?(g.decoder?k=g.buffer.join(""):g.buffer.length===1?k=g.buffer.first():k=g.buffer.concat(g.length),g.buffer.clear()):k=g.buffer.consume(f,g.decoder),k}function A(f){var g=f._readableState;c("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,process.nextTick(j,g,f))}function j(f,g){if(c("endReadableNT",f.endEmitted,f.length),!f.endEmitted&&f.length===0&&(f.endEmitted=!0,g.readable=!1,g.emit("end"),f.autoDestroy)){var k=g._writableState;(!k||k.autoDestroy&&k.finished)&&g.destroy()}}typeof Symbol=="function"&&(O.from=function(f,g){return C===void 0&&(C=nf()),C(O,f,g)});function G(f,g){for(var k=0,N=f.length;k<N;k++)if(f[k]===g)return k;return-1}return pi}var Dc=rt,Bn=Ct.codes,sf=Bn.ERR_METHOD_NOT_IMPLEMENTED,of=Bn.ERR_MULTIPLE_CALLBACK,af=Bn.ERR_TRANSFORM_ALREADY_TRANSFORMING,cf=Bn.ERR_TRANSFORM_WITH_LENGTH_0,Fn=qt();Fe(rt,Fn);function lf(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new of);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function rt(e){if(!(this instanceof rt))return new rt(e);Fn.call(this,e),this._transformState={afterTransform:lf.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",uf)}function uf(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){ea(e,t,r)}):ea(this,null,null)}rt.prototype.push=function(e,t){return this._transformState.needTransform=!1,Fn.prototype.push.call(this,e,t)};rt.prototype._transform=function(e,t,r){r(new sf("_transform()"))};rt.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var s=this._readableState;(n.needTransform||s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}};rt.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};rt.prototype._destroy=function(e,t){Fn.prototype._destroy.call(this,e,function(r){t(r)})};function ea(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new cf;if(e._transformState.transforming)throw new af;return e.push(null)}var df=gr,jc=Dc;Fe(gr,jc);function gr(e){if(!(this instanceof gr))return new gr(e);jc.call(this,e)}gr.prototype._transform=function(e,t,r){r(null,e)};var bi;function hf(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Hc=Ct.codes,ff=Hc.ERR_MISSING_ARGS,gf=Hc.ERR_STREAM_DESTROYED;function ta(e){if(e)throw e}function pf(e){return e.setHeader&&typeof e.abort=="function"}function bf(e,t,r,n){n=hf(n);var s=!1;e.on("close",function(){s=!0}),bi===void 0&&(bi=Zi),bi(e,{readable:t,writable:r},function(o){if(o)return n(o);s=!0,n()});var i=!1;return function(o){if(!s&&!i){if(i=!0,pf(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new gf("pipe"))}}}function ra(e){e()}function mf(e,t){return e.pipe(t)}function _f(e){return!e.length||typeof e[e.length-1]!="function"?ta:e.pop()}function wf(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=_f(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new ff("streams");var s,i=t.map(function(o,a){var c=a<t.length-1,l=a>0;return bf(o,c,l,function(u){s||(s=u),u&&i.forEach(ra),!c&&(i.forEach(ra),n(s))})});return t.reduce(mf)}var yf=wf;(function(e,t){t=e.exports=Fc(),t.Stream=t,t.Readable=t,t.Writable=$c(),t.Duplex=qt(),t.Transform=Dc,t.PassThrough=df,t.finished=Zi,t.pipeline=yf})(Ni,Ni.exports);var Uc=Ni.exports;const{Transform:vf}=Uc;var Ef=e=>class Wc extends vf{constructor(r,n,s,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(r){let n=null;try{this.push(this.digest())}catch(s){n=s}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Wc(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Sf}=Uc;var Rf=e=>class Vc extends Sf{constructor(r,n,s,i){super(i),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._options=i,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let s=this._state.squeeze(r);return n!==void 0&&(s=s.toString(n)),s}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Vc(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Cf=Ef,kf=Rf;var If=function(e){const t=Cf(e),r=kf(e);return function(n,s){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,s);case"keccak256":return new t(1088,512,null,256,s);case"keccak384":return new t(832,768,null,384,s);case"keccak512":return new t(576,1024,null,512,s);case"sha3-224":return new t(1152,448,6,224,s);case"sha3-256":return new t(1088,512,6,256,s);case"sha3-384":return new t(832,768,6,384,s);case"sha3-512":return new t(576,1024,6,512,s);case"shake128":return new r(1344,256,31,s);case"shake256":return new r(1088,512,31,s);default:throw new Error("Invald algorithm: "+n)}}},zc={};const na=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];zc.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],u=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49];let h=u^(s<<1|i>>>31),b=d^(i<<1|s>>>31);const w=e[0]^h,R=e[1]^b,E=e[10]^h,p=e[11]^b,_=e[20]^h,m=e[21]^b,C=e[30]^h,S=e[31]^b,T=e[40]^h,U=e[41]^b;h=r^(o<<1|a>>>31),b=n^(a<<1|o>>>31);const B=e[2]^h,O=e[3]^b,Q=e[12]^h,oe=e[13]^b,ne=e[22]^h,se=e[23]^b,M=e[32]^h,I=e[33]^b,$=e[42]^h,x=e[43]^b;h=s^(c<<1|l>>>31),b=i^(l<<1|c>>>31);const F=e[4]^h,L=e[5]^b,H=e[14]^h,Z=e[15]^b,W=e[24]^h,K=e[25]^b,ue=e[34]^h,te=e[35]^b,y=e[44]^h,v=e[45]^b;h=o^(u<<1|d>>>31),b=a^(d<<1|u>>>31);const A=e[6]^h,j=e[7]^b,G=e[16]^h,f=e[17]^b,g=e[26]^h,k=e[27]^b,N=e[36]^h,ie=e[37]^b,q=e[46]^h,re=e[47]^b;h=c^(r<<1|n>>>31),b=l^(n<<1|r>>>31);const Qe=e[8]^h,dt=e[9]^b,or=e[18]^h,Ur=e[19]^b,ar=e[28]^h,At=e[29]^b,Tt=e[38]^h,Mt=e[39]^b,nt=e[48]^h,Ye=e[49]^b,He=w,os=R,as=p<<4|E>>>28,cs=E<<4|p>>>28,ls=_<<3|m>>>29,us=m<<3|_>>>29,ds=S<<9|C>>>23,hs=C<<9|S>>>23,fs=T<<18|U>>>14,gs=U<<18|T>>>14,ps=B<<1|O>>>31,bs=O<<1|B>>>31,ms=oe<<12|Q>>>20,_s=Q<<12|oe>>>20,ws=ne<<10|se>>>22,ys=se<<10|ne>>>22,vs=I<<13|M>>>19,Es=M<<13|I>>>19,Ss=$<<2|x>>>30,Rs=x<<2|$>>>30,Cs=L<<30|F>>>2,ks=F<<30|L>>>2,Is=H<<6|Z>>>26,As=Z<<6|H>>>26,Ts=K<<11|W>>>21,Ms=W<<11|K>>>21,Ns=ue<<15|te>>>17,xs=te<<15|ue>>>17,Ls=v<<29|y>>>3,Ps=y<<29|v>>>3,Os=A<<28|j>>>4,$s=j<<28|A>>>4,Bs=f<<23|G>>>9,Fs=G<<23|f>>>9,Ds=g<<25|k>>>7,js=k<<25|g>>>7,Hs=N<<21|ie>>>11,Us=ie<<21|N>>>11,Ws=re<<24|q>>>8,Vs=q<<24|re>>>8,zs=Qe<<27|dt>>>5,qs=dt<<27|Qe>>>5,Gs=or<<20|Ur>>>12,Js=Ur<<20|or>>>12,Zs=At<<7|ar>>>25,Ks=ar<<7|At>>>25,Qs=Tt<<8|Mt>>>24,Ys=Mt<<8|Tt>>>24,Xs=nt<<14|Ye>>>18,ei=Ye<<14|nt>>>18;e[0]=He^~ms&Ts,e[1]=os^~_s&Ms,e[10]=Os^~Gs&ls,e[11]=$s^~Js&us,e[20]=ps^~Is&Ds,e[21]=bs^~As&js,e[30]=zs^~as&ws,e[31]=qs^~cs&ys,e[40]=Cs^~Bs&Zs,e[41]=ks^~Fs&Ks,e[2]=ms^~Ts&Hs,e[3]=_s^~Ms&Us,e[12]=Gs^~ls&vs,e[13]=Js^~us&Es,e[22]=Is^~Ds&Qs,e[23]=As^~js&Ys,e[32]=as^~ws&Ns,e[33]=cs^~ys&xs,e[42]=Bs^~Zs&ds,e[43]=Fs^~Ks&hs,e[4]=Ts^~Hs&Xs,e[5]=Ms^~Us&ei,e[14]=ls^~vs&Ls,e[15]=us^~Es&Ps,e[24]=Ds^~Qs&fs,e[25]=js^~Ys&gs,e[34]=ws^~Ns&Ws,e[35]=ys^~xs&Vs,e[44]=Zs^~ds&Ss,e[45]=Ks^~hs&Rs,e[6]=Hs^~Xs&He,e[7]=Us^~ei&os,e[16]=vs^~Ls&Os,e[17]=Es^~Ps&$s,e[26]=Qs^~fs&ps,e[27]=Ys^~gs&bs,e[36]=Ns^~Ws&zs,e[37]=xs^~Vs&qs,e[46]=ds^~Ss&Cs,e[47]=hs^~Rs&ks,e[8]=Xs^~He&ms,e[9]=ei^~os&_s,e[18]=Ls^~Os&Gs,e[19]=Ps^~$s&Js,e[28]=fs^~ps&Is,e[29]=gs^~bs&As,e[38]=Ws^~zs&as,e[39]=Vs^~qs&cs,e[48]=Ss^~Cs&Bs,e[49]=Rs^~ks&Fs,e[0]^=na[t*2],e[1]^=na[t*2+1]}};const sn=zc;function rr(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}rr.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};rr.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(sn.p1600(this.state),this.count=0)};rr.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&sn.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),sn.p1600(this.state),this.count=0,this.squeezing=!0};rr.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(sn.p1600(this.state),this.count=0);return t};rr.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Af=rr,Tf=If(Af);const Mf=Tf,Nf=cn;function qc(e){return Buffer.allocUnsafe(e).fill(0)}function Gc(e,t,r){const n=qc(t);return e=Dn(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function xf(e,t){return Gc(e,t,!0)}function Dn(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")Jc(e)?e=Buffer.from(Of(Zc(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(Nf.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function Lf(e){return e=Dn(e),"0x"+e.toString("hex")}function Pf(e,t){return e=Dn(e),t||(t=256),Mf("keccak"+t).update(e).digest()}function Of(e){return e.length%2?"0"+e:e}function Jc(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function Zc(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var Kc={zeros:qc,setLength:Gc,setLengthRight:xf,isHexString:Jc,stripHexPrefix:Zc,toBuffer:Dn,bufferToHex:Lf,keccak:Pf};const vt=Kc,_t=cn;function Qc(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function jt(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function sa(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Yc(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function bt(e){var t=typeof e;if(t==="string")return vt.isHexString(e)?new _t(vt.stripHexPrefix(e),16):new _t(e,10);if(t==="number")return new _t(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function ze(e,t){var r,n,s,i;if(e==="address")return ze("uint160",bt(t));if(e==="bool")return ze("uint8",t?1:0);if(e==="string")return ze("bytes",new Buffer(t,"utf8"));if(Bf(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Yc(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);s=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(i in t)s.push(ze(e,t[i]));if(r==="dynamic"){var o=ze("uint256",t.length);s.unshift(o)}return Buffer.concat(s)}else{if(e==="bytes")return t=new Buffer(t),s=Buffer.concat([ze("uint256",t.length),t]),t.length%32!==0&&(s=Buffer.concat([s,vt.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if(r=jt(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return vt.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=jt(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=bt(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=jt(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=bt(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=sa(e),n=bt(t),n<0)throw new Error("Supplied ufixed is negative");return ze("uint256",n.mul(new _t(2).pow(new _t(r[1]))))}else if(e.startsWith("fixed"))return r=sa(e),ze("int256",bt(t).mul(new _t(2).pow(new _t(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function $f(e){return e==="string"||e==="bytes"||Yc(e)==="dynamic"}function Bf(e){return e.lastIndexOf("]")===e.length-1}function Ff(e,t){var r=[],n=[],s=32*e.length;for(var i in e){var o=Qc(e[i]),a=t[i],c=ze(o,a);$f(o)?(r.push(ze("uint256",s)),n.push(c),s+=c.length):r.push(c)}return Buffer.concat(r.concat(n))}function Xc(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,s=[],i=0;i<e.length;i++){var o=Qc(e[i]),a=t[i];if(o==="bytes")s.push(a);else if(o==="string")s.push(new Buffer(a,"utf8"));else if(o==="bool")s.push(new Buffer(a?"01":"00","hex"));else if(o==="address")s.push(vt.setLength(a,20));else if(o.startsWith("bytes")){if(r=jt(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);s.push(vt.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=jt(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=bt(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());s.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=jt(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=bt(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());s.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(s)}function Df(e,t){return vt.keccak(Xc(e,t))}var jf={rawEncode:Ff,solidityPack:Xc,soliditySHA3:Df};const Be=Kc,hr=jf,el={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},mi={encodeData(e,t,r,n=!0){const s=["bytes32"],i=[this.hashType(e,r)];if(n){const o=(a,c,l)=>{if(r[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Be.keccak(this.encodeData(c,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",Be.keccak(l)];if(c==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",Be.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const u=c.slice(0,c.lastIndexOf("[")),d=l.map(h=>o(a,u,h));return["bytes32",Be.keccak(hr.rawEncode(d.map(([h])=>h),d.map(([,h])=>h)))]}return[c,l]};for(const a of r[e]){const[c,l]=o(a.name,a.type,t[a.name]);s.push(c),i.push(l)}}else for(const o of r[e]){let a=t[o.name];if(a!==void 0)if(o.type==="bytes")s.push("bytes32"),a=Be.keccak(a),i.push(a);else if(o.type==="string")s.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=Be.keccak(a),i.push(a);else if(r[o.type]!==void 0)s.push("bytes32"),a=Be.keccak(this.encodeData(o.type,a,r,n)),i.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(o.type),i.push(a)}}return hr.rawEncode(s,i)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(s=>s!==e);n=[e].concat(n.sort());for(const s of n){if(!t[s])throw new Error("No type definition specified: "+s);r+=s+"("+t[s].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const s of this.findTypeDependencies(n.type,t,r))!r.includes(s)&&r.push(s);return r},hashStruct(e,t,r,n=!0){return Be.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Be.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in el.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Be.keccak(Buffer.concat(n))}};var Hf={TYPED_MESSAGE_SCHEMA:el,TypedDataUtils:mi,hashForSignTypedDataLegacy:function(e){return Uf(e.data)},hashForSignTypedData_v3:function(e){return mi.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return mi.hash(e.data)}};function Uf(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(i){return i.type==="bytes"?Be.toBuffer(i.value):i.value}),n=e.map(function(i){return i.type}),s=e.map(function(i){if(!i.name)throw t;return i.type+" "+i.name});return hr.soliditySHA3(["bytes32","bytes32"],[hr.soliditySHA3(new Array(e.length).fill("string"),s),hr.soliditySHA3(n,r)])}var Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.filterFromParam=Gt.FilterPolyfill=void 0;const Bt=fe,ve=P,Wf=5*60*1e3,mt={jsonrpc:"2.0",id:0};class Vf{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Bt.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=tl(t),n=this.makeFilterId(),s=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",s),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,ve.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,ve.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,ve.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,ve.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,ve.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Gr())}async getFilterLogs(t){const r=(0,ve.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},mt),{method:"eth_getLogs",params:[ia(n)]})):Gr()}makeFilterId(){return(0,Bt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(s,i)=>{if(s)return n(s);if(Array.isArray(i)||i==null)return n(new Error(`unexpected response received: ${JSON.stringify(i)}`));r(i)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return Gr();const s=await this.getCurrentBlockHeight(),i=r.toBlock==="latest"?s:r.toBlock;if(n>s||n>Number(r.toBlock))return Jr();console.info(`Fetching logs from ${n} to ${i} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},mt),{method:"eth_getLogs",params:[ia(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,ve.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const l=(0,Bt.IntNumber)(c+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${l}`),this.cursors.set(t,l)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return Gr();const n=await this.getCurrentBlockHeight();if(r>n)return Jr();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const s=(await Promise.all((0,ve.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,Bt.IntNumber)(o))))).filter(o=>!!o),i=(0,Bt.IntNumber)(r+s.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},mt),{result:s})}async getPendingTransactionFilterChanges(t){return Promise.resolve(Jr())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),s=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,s),s}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},Wf);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},mt),{method:"eth_blockNumber",params:[]}));return(0,ve.intNumberFromHexString)((0,ve.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},mt),{method:"eth_getBlockByNumber",params:[(0,ve.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,ve.ensureHexString)(r.result.hash):null}}Gt.FilterPolyfill=Vf;function tl(e){return{fromBlock:oa(e.fromBlock),toBlock:oa(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Gt.filterFromParam=tl;function ia(e){const t={fromBlock:aa(e.fromBlock),toBlock:aa(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function oa(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Bt.IntNumber)(0);if((0,ve.isHexString)(e))return(0,ve.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function aa(e){return e==="latest"?e:(0,ve.hexStringFromIntNumber)(e)}function Gr(){return Object.assign(Object.assign({},mt),{error:{code:-32e3,message:"filter not found"}})}function Jr(){return Object.assign(Object.assign({},mt),{result:[]})}var jn={},rl={},Hn={},Ki=zf;function zf(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const ca=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let s=0;s<arguments.length;s++)n[s]=arguments[s];return new r((s,i)=>{t.errorFirst?n.push(function(o,a){if(t.multiArgs){const c=new Array(arguments.length-1);for(let l=1;l<arguments.length;l++)c[l-1]=arguments[l];o?(c.unshift(o),i(c)):s(c)}else o?i(o):s(a)}):n.push(function(o){if(t.multiArgs){const a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];s(a)}else s(o)}),e.apply(this,n)})};var qf=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=s=>{const i=o=>typeof o=="string"?s===o:o.test(s);return t.include?t.include.some(i):!t.exclude.some(i)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):ca(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const s in e){const i=e[s];n[s]=typeof i=="function"&&r(s)?ca(i,t):i}return n},Nr={},xr={};Object.defineProperty(xr,"__esModule",{value:!0});const Gf=un;function la(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Jf(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Zf=class extends Gf.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")la(i,this,r);else{const o=i.length,a=Jf(i);for(let c=0;c<o;c+=1)la(a[c],this,r)}return!0}};xr.default=Zf;var Kf=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.BaseBlockTracker=void 0;const Qf=Kf(xr),Yf=1e3,Xf=(e,t)=>e+t,ua=["sync","latest"];class e0 extends Qf.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*Yf,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){ua.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return ua.map(t=>this.listenerCount(t)).reduce(Xf)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=da(t),s=da(r);return this._usePastBlocks&&n<s||n>s}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Nr.BaseBlockTracker=e0;function da(e){return Number.parseInt(e,16)}var nl={},sl={},we={};class il extends TypeError{constructor(t,r){let n;const{message:s,explanation:i,...o}=t,{path:a}=t,c=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;super(i??c),i!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function t0(e){return Pe(e)&&typeof e[Symbol.iterator]=="function"}function Pe(e){return typeof e=="object"&&e!=null}function ha(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function ge(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function r0(e){const{done:t,value:r}=e.next();return t?void 0:r}function n0(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:i}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${ge(n)}\``}=e;return{value:n,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...e,message:c}}function*Li(e,t,r,n){t0(e)||(e=[e]);for(const s of e){const i=n0(s,t,r,n);i&&(yield i)}}function*Qi(e,t,r={}){const{path:n=[],branch:s=[e],coerce:i=!1,mask:o=!1}=r,a={path:n,branch:s};if(i&&(e=t.coercer(e,a),o&&t.type!=="type"&&Pe(t.schema)&&Pe(e)&&!Array.isArray(e)))for(const l in e)t.schema[l]===void 0&&delete e[l];let c="valid";for(const l of t.validator(e,a))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,u,d]of t.entries(e,a)){const h=Qi(u,d,{path:l===void 0?n:[...n,l],branch:l===void 0?s:[...s,u],coerce:i,mask:o,message:r.message});for(const b of h)b[0]?(c=b[0].refinement!=null?"not_refined":"not_valid",yield[b[0],void 0]):i&&(u=b[1],l===void 0?e=u:e instanceof Map?e.set(l,u):e instanceof Set?e.add(u):Pe(e)&&(u!==void 0||l in e)&&(e[l]=u))}if(c!=="not_valid")for(const l of t.refiner(e,a))l.explanation=r.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,e])}class de{constructor(t){const{type:r,schema:n,validator:s,refiner:i,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,s?this.validator=(c,l)=>{const u=s(c,l);return Li(u,l,this,c)}:this.validator=()=>[],i?this.refiner=(c,l)=>{const u=i(c,l);return Li(u,l,this,c)}:this.refiner=()=>[]}assert(t,r){return ol(t,this,r)}create(t,r){return al(t,this,r)}is(t){return Yi(t,this)}mask(t,r){return cl(t,this,r)}validate(t,r={}){return nr(t,this,r)}}function ol(e,t,r){const n=nr(e,t,{message:r});if(n[0])throw n[0]}function al(e,t,r){const n=nr(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function cl(e,t,r){const n=nr(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Yi(e,t){return!nr(e,t)[0]}function nr(e,t,r={}){const n=Qi(e,t,r),s=r0(n);return s[0]?[new il(s[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function s0(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),n=Object.assign({},...r);return t?Pr(n):Lr(n)}function Ce(e,t){return new de({type:e,schema:null,validator:t})}function i0(e,t){return new de({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function o0(e){return new de({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function a0(e){let t;return new de({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function c0(e,t){const{schema:r}=e,n={...r};for(const s of t)delete n[s];switch(e.type){case"type":return Pr(n);default:return Lr(n)}}function l0(e){const t=e instanceof de,r=t?{...e.schema}:{...e};for(const n in r)r[n]=ll(r[n]);return t&&e.type==="type"?Pr(r):Lr(r)}function u0(e,t){const{schema:r}=e,n={};for(const s of t)n[s]=r[s];switch(e.type){case"type":return Pr(n);default:return Lr(n)}}function d0(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ce(e,t)}function h0(){return Ce("any",()=>!0)}function f0(e){return new de({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${ge(t)}`}})}function g0(){return Ce("bigint",e=>typeof e=="bigint")}function p0(){return Ce("boolean",e=>typeof e=="boolean")}function b0(){return Ce("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${ge(e)}`)}function m0(e){const t={},r=e.map(n=>ge(n)).join();for(const n of e)t[n]=n;return new de({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${ge(n)}`}})}function _0(){return Ce("func",e=>typeof e=="function"||`Expected a function, but received: ${ge(e)}`)}function w0(e){return Ce("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${ge(t)}`)}function y0(){return Ce("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${ge(e)}`)}function v0(e){return new de({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function E0(e){const t=ge(e),r=typeof e;return new de({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${ge(n)}`}})}function S0(e,t){return new de({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${ge(r)}`}})}function Xi(){return Ce("never",()=>!1)}function R0(e){return new de({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function C0(){return Ce("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${ge(e)}`)}function Lr(e){const t=e?Object.keys(e):[],r=Xi();return new de({type:"object",schema:e||null,*entries(n){if(e&&Pe(n)){const s=new Set(Object.keys(n));for(const i of t)s.delete(i),yield[i,n[i],e[i]];for(const i of s)yield[i,n[i],r]}},validator(n){return Pe(n)||`Expected an object, but received: ${ge(n)}`},coercer(n){return Pe(n)?{...n}:n}})}function ll(e){return new de({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function k0(e,t){return new de({type:"record",schema:null,*entries(r){if(Pe(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator(r){return Pe(r)||`Expected an object, but received: ${ge(r)}`}})}function I0(){return Ce("regexp",e=>e instanceof RegExp)}function A0(e){return new de({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${ge(t)}`}})}function ul(){return Ce("string",e=>typeof e=="string"||`Expected a string, but received: ${ge(e)}`)}function T0(e){const t=Xi();return new de({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;s<n;s++)yield[s,r[s],e[s]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${ge(r)}`}})}function Pr(e){const t=Object.keys(e);return new de({type:"type",schema:e,*entries(r){if(Pe(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return Pe(r)||`Expected an object, but received: ${ge(r)}`},coercer(r){return Pe(r)?{...r}:r}})}function M0(e){const t=e.map(r=>r.type).join(" | ");return new de({type:"union",schema:null,coercer(r){for(const n of e){const[s,i]=n.validate(r,{coerce:!0});if(!s)return i}return r},validator(r,n){const s=[];for(const i of e){const[...o]=Qi(r,i,n),[a]=o;if(a[0])for(const[c]of o)c&&s.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${ge(r)}`,...s]}})}function dl(){return Ce("unknown",()=>!0)}function eo(e,t,r){return new de({...e,coercer:(n,s)=>Yi(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function N0(e,t,r={}){return eo(e,dl(),n=>{const s=typeof t=="function"?t():t;if(n===void 0)return s;if(!r.strict&&ha(n)&&ha(s)){const i={...n};let o=!1;for(const a in s)i[a]===void 0&&(i[a]=s[a],o=!0);if(o)return i}return n})}function x0(e){return eo(e,ul(),t=>t.trim())}function L0(e){return kt(e,"empty",t=>{const r=hl(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function hl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function P0(e,t,r={}){const{exclusive:n}=r;return kt(e,"max",s=>n?s<t:s<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${s}\``)}function O0(e,t,r={}){const{exclusive:n}=r;return kt(e,"min",s=>n?s>t:s>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${s}\``)}function $0(e){return kt(e,"nonempty",t=>hl(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function B0(e,t){return kt(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function F0(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return kt(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return t<=i&&i<=r||`${n} ${s} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:o}=i;return t<=o&&o<=r||`${n} with a size ${s} but received one with a size of \`${o}\``}else{const{length:o}=i;return t<=o&&o<=r||`${n} with a length ${s} but received one with a length of \`${o}\``}})}function kt(e,t,r){return new de({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),o=Li(i,s,e,n);for(const a of o)yield{...a,refinement:t}}})}const D0=Object.freeze(Object.defineProperty({__proto__:null,Struct:de,StructError:il,any:h0,array:f0,assert:ol,assign:s0,bigint:g0,boolean:p0,coerce:eo,create:al,date:b0,defaulted:N0,define:Ce,deprecated:i0,dynamic:o0,empty:L0,enums:m0,func:_0,instance:w0,integer:y0,intersection:v0,is:Yi,lazy:a0,literal:E0,map:S0,mask:cl,max:P0,min:O0,never:Xi,nonempty:$0,nullable:R0,number:C0,object:Lr,omit:c0,optional:ll,partial:l0,pattern:B0,pick:u0,record:k0,refine:kt,regexp:I0,set:A0,size:F0,string:ul,struct:d0,trimmed:x0,tuple:T0,type:Pr,union:M0,unknown:dl,validate:nr},Symbol.toStringTag,{value:"Module"})),It=Kt(D0);Object.defineProperty(we,"__esModule",{value:!0});we.assertExhaustive=we.assertStruct=we.assert=we.AssertionError=void 0;const j0=It;function H0(e){return typeof e=="object"&&e!==null&&"message"in e}function U0(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function W0(e){const t=H0(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function fl(e,t){return U0(e)?new e({message:t}):e({message:t})}class to extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}we.AssertionError=to;function V0(e,t="Assertion failed.",r=to){if(!e)throw t instanceof Error?t:fl(r,t)}we.assert=V0;function z0(e,t,r="Assertion failed",n=to){try{(0,j0.assert)(e,t)}catch(s){throw fl(n,`${r}: ${W0(s)}.`)}}we.assertStruct=z0;function q0(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}we.assertExhaustive=q0;var Or={};Object.defineProperty(Or,"__esModule",{value:!0});Or.base64=void 0;const G0=It,J0=we,Z0=(e,t={})=>{var r,n;const s=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,i=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;i==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,J0.assert)(i==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return s?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,G0.pattern)(e,a)};Or.base64=Z0;var ee={},$r={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=It,r=we;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,t.is)(l,e.HexStruct)}e.isHexString=n;function s(l){return(0,t.is)(l,e.StrictHexStruct)}e.isStrictHexString=s;function i(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function o(l){(0,r.assert)(s(l),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}e.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}e.remove0x=c})($r);Object.defineProperty(ee,"__esModule",{value:!0});ee.createDataView=ee.concatBytes=ee.valueToBytes=ee.stringToBytes=ee.numberToBytes=ee.signedBigIntToBytes=ee.bigIntToBytes=ee.hexToBytes=ee.bytesToString=ee.bytesToNumber=ee.bytesToSignedBigInt=ee.bytesToBigInt=ee.bytesToHex=ee.assertIsBytes=ee.isBytes=void 0;const Ae=we,Pi=$r,fa=48,ga=58,pa=87;function K0(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const Q0=K0();function ro(e){return e instanceof Uint8Array}ee.isBytes=ro;function sr(e){(0,Ae.assert)(ro(e),"Value must be a Uint8Array.")}ee.assertIsBytes=sr;function gl(e){if(sr(e),e.length===0)return"0x";const t=Q0(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Pi.add0x)(r.join(""))}ee.bytesToHex=gl;function pl(e){sr(e);const t=gl(e);return BigInt(t)}ee.bytesToBigInt=pl;function Y0(e){sr(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}ee.bytesToSignedBigInt=Y0;function X0(e){sr(e);const t=pl(e);return(0,Ae.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}ee.bytesToNumber=X0;function e1(e){return sr(e),new TextDecoder().decode(e)}ee.bytesToString=e1;function Un(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Pi.assertIsHexString)(e);const r=(0,Pi.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,s=new Uint8Array(n.length/2);for(let i=0;i<s.length;i++){const o=n.charCodeAt(i*2),a=n.charCodeAt(i*2+1),c=o-(o<ga?fa:pa),l=a-(a<ga?fa:pa);s[i]=c*16+l}return s}ee.hexToBytes=Un;function bl(e){(0,Ae.assert)(typeof e=="bigint","Value must be a bigint."),(0,Ae.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Un(t)}ee.bigIntToBytes=bl;function t1(e,t){(0,Ae.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function r1(e,t){(0,Ae.assert)(typeof e=="bigint","Value must be a bigint."),(0,Ae.assert)(typeof t=="number","Byte length must be a number."),(0,Ae.assert)(t>0,"Byte length must be greater than 0."),(0,Ae.assert)(t1(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let s=0;s<n.length;s++)n[s]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}ee.signedBigIntToBytes=r1;function ml(e){(0,Ae.assert)(typeof e=="number","Value must be a number."),(0,Ae.assert)(e>=0,"Value must be a non-negative number."),(0,Ae.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Un(t)}ee.numberToBytes=ml;function _l(e){return(0,Ae.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ee.stringToBytes=_l;function wl(e){if(typeof e=="bigint")return bl(e);if(typeof e=="number")return ml(e);if(typeof e=="string")return e.startsWith("0x")?Un(e):_l(e);if(ro(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ee.valueToBytes=wl;function n1(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const i=wl(e[s]);t[s]=i,r+=i.length}const n=new Uint8Array(r);for(let s=0,i=0;s<t.length;s++)n.set(t[s],i),i+=t[s].length;return n}ee.concatBytes=n1;function s1(e){if(typeof Buffer<"u"&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}ee.createDataView=s1;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.ChecksumStruct=void 0;const ba=It,i1=Or;Wn.ChecksumStruct=(0,ba.size)((0,i1.base64)((0,ba.string)(),{paddingRequired:!0}),44,44);var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.createHex=Ze.createBytes=Ze.createBigInt=Ze.createNumber=void 0;const le=It,o1=we,yl=ee,Vn=$r,vl=(0,le.union)([(0,le.number)(),(0,le.bigint)(),(0,le.string)(),Vn.StrictHexStruct]),a1=(0,le.coerce)((0,le.number)(),vl,Number),c1=(0,le.coerce)((0,le.bigint)(),vl,BigInt);(0,le.union)([Vn.StrictHexStruct,(0,le.instance)(Uint8Array)]);const l1=(0,le.coerce)((0,le.instance)(Uint8Array),(0,le.union)([Vn.StrictHexStruct]),yl.hexToBytes),u1=(0,le.coerce)(Vn.StrictHexStruct,(0,le.instance)(Uint8Array),yl.bytesToHex);function d1(e){try{const t=(0,le.create)(e,a1);return(0,o1.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof le.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Ze.createNumber=d1;function h1(e){try{return(0,le.create)(e,c1)}catch(t){throw t instanceof le.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Ze.createBigInt=h1;function f1(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,le.create)(e,l1)}catch(t){throw t instanceof le.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Ze.createBytes=f1;function g1(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,le.create)(e,u1)}catch(t){throw t instanceof le.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Ze.createHex=g1;var Jt={},El=D&&D.__classPrivateFieldSet||function(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},Ee=D&&D.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},$e,We;Object.defineProperty(Jt,"__esModule",{value:!0});Jt.FrozenSet=Jt.FrozenMap=void 0;class no{constructor(t){$e.set(this,void 0),El(this,$e,new Map(t),"f"),Object.freeze(this)}get size(){return Ee(this,$e,"f").size}[($e=new WeakMap,Symbol.iterator)](){return Ee(this,$e,"f")[Symbol.iterator]()}entries(){return Ee(this,$e,"f").entries()}forEach(t,r){return Ee(this,$e,"f").forEach((n,s,i)=>t.call(r,n,s,this))}get(t){return Ee(this,$e,"f").get(t)}has(t){return Ee(this,$e,"f").has(t)}keys(){return Ee(this,$e,"f").keys()}values(){return Ee(this,$e,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Jt.FrozenMap=no;class so{constructor(t){We.set(this,void 0),El(this,We,new Set(t),"f"),Object.freeze(this)}get size(){return Ee(this,We,"f").size}[(We=new WeakMap,Symbol.iterator)](){return Ee(this,We,"f")[Symbol.iterator]()}entries(){return Ee(this,We,"f").entries()}forEach(t,r){return Ee(this,We,"f").forEach((n,s,i)=>t.call(r,n,s,this))}has(t){return Ee(this,We,"f").has(t)}keys(){return Ee(this,We,"f").keys()}values(){return Ee(this,We,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Jt.FrozenSet=so;Object.freeze(no);Object.freeze(no.prototype);Object.freeze(so);Object.freeze(so.prototype);var Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});var Rl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=It,r=we,n=()=>(0,t.define)("finite number",S=>(0,t.is)(S,(0,t.number)())&&Number.isFinite(S));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(S,T)=>{function U(B,O){const oe=[...O.validator(B,T)];return oe.length>0?oe:!0}try{const B=U(S,e.UnsafeJsonStruct);return B!==!0?B:U(JSON.parse(JSON.stringify(S)),e.UnsafeJsonStruct)}catch(B){return B instanceof RangeError?"Circular reference detected":!1}});function s(S){return(0,t.is)(S,e.JsonStruct)}e.isValidJson=s;function i(S){(0,r.assertStruct)(S,e.JsonStruct,"Invalid JSON value");const T=JSON.stringify(S);return new TextEncoder().encode(T).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(S){return(0,t.is)(S,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function a(S,T){(0,r.assertStruct)(S,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",T)}e.assertIsJsonRpcNotification=a;function c(S){return(0,t.is)(S,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=c;function l(S,T){(0,r.assertStruct)(S,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",T)}e.assertIsJsonRpcRequest=l,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function u(S){return(0,t.is)(S,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=u;function d(S,T){(0,r.assertStruct)(S,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",T)}e.assertIsPendingJsonRpcResponse=d;function h(S){return(0,t.is)(S,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=h;function b(S,T){(0,r.assertStruct)(S,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",T)}e.assertIsJsonRpcResponse=b;function w(S){return(0,t.is)(S,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=w;function R(S,T){(0,r.assertStruct)(S,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",T)}e.assertIsJsonRpcSuccess=R;function E(S){return(0,t.is)(S,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=E;function p(S,T){(0,r.assertStruct)(S,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",T)}e.assertIsJsonRpcFailure=p;function _(S){return(0,t.is)(S,e.JsonRpcErrorStruct)}e.isJsonRpcError=_;function m(S,T){(0,r.assertStruct)(S,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",T)}e.assertIsJsonRpcError=m;function C(S){const{permitEmptyString:T,permitFractions:U,permitNull:B}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},S);return Q=>!!(typeof Q=="number"&&(U||Number.isInteger(Q))||typeof Q=="string"&&(T||Q.length>0)||B&&Q===null)}e.getJsonRpcIdValidator=C})(Rl);var Cl={};Object.defineProperty(Cl,"__esModule",{value:!0});var Zt={},Oi={exports:{}},_i,ma;function p1(){if(ma)return _i;ma=1;var e=1e3,t=e*60,r=t*60,n=r*24,s=n*7,i=n*365.25;_i=function(u,d){d=d||{};var h=typeof u;if(h==="string"&&u.length>0)return o(u);if(h==="number"&&isFinite(u))return d.long?c(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var h=parseFloat(d[1]),b=(d[2]||"ms").toLowerCase();switch(b){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"weeks":case"week":case"w":return h*s;case"days":case"day":case"d":return h*n;case"hours":case"hour":case"hrs":case"hr":case"h":return h*r;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){var d=Math.abs(u);return d>=n?Math.round(u/n)+"d":d>=r?Math.round(u/r)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function c(u){var d=Math.abs(u);return d>=n?l(u,d,n,"day"):d>=r?l(u,d,r,"hour"):d>=t?l(u,d,t,"minute"):d>=e?l(u,d,e,"second"):u+" ms"}function l(u,d,h,b){var w=d>=h*1.5;return Math.round(u/h)+" "+b+(w?"s":"")}return _i}function b1(e){r.debug=r,r.default=r,r.coerce=c,r.disable=i,r.enable=s,r.enabled=o,r.humanize=p1(),r.destroy=l,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let d=0;for(let h=0;h<u.length;h++)d=(d<<5)-d+u.charCodeAt(h),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=t;function r(u){let d,h=null,b,w;function R(...E){if(!R.enabled)return;const p=R,_=Number(new Date),m=_-(d||_);p.diff=m,p.prev=d,p.curr=_,d=_,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let C=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(T,U)=>{if(T==="%%")return"%";C++;const B=r.formatters[U];if(typeof B=="function"){const O=E[C];T=B.call(p,O),E.splice(C,1),C--}return T}),r.formatArgs.call(p,E),(p.log||r.log).apply(p,E)}return R.namespace=u,R.useColors=r.useColors(),R.color=r.selectColor(u),R.extend=n,R.destroy=r.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(b!==r.namespaces&&(b=r.namespaces,w=r.enabled(u)),w),set:E=>{h=E}}),typeof r.init=="function"&&r.init(R),R}function n(u,d){const h=r(this.namespace+(typeof d>"u"?":":d)+u);return h.log=this.log,h}function s(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let d;const h=(typeof u=="string"?u:"").split(/[\s,]+/),b=h.length;for(d=0;d<b;d++)h[d]&&(u=h[d].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.slice(1)+"$")):r.names.push(new RegExp("^"+u+"$")))}function i(){const u=[...r.names.map(a),...r.skips.map(a).map(d=>"-"+d)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let d,h;for(d=0,h=r.skips.length;d<h;d++)if(r.skips[d].test(u))return!1;for(d=0,h=r.names.length;d<h;d++)if(r.names[d].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var m1=b1;(function(e,t){var r={};t.formatArgs=s,t.save=i,t.load=o,t.useColors=n,t.storage=a(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function s(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;l.splice(1,0,u,"color: inherit");let d=0,h=0;l[0].replace(/%[a-zA-Z%]/g,b=>{b!=="%%"&&(d++,b==="%c"&&(h=d))}),l.splice(h,0,u)}t.log=console.debug||console.log||(()=>{});function i(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=r.DEBUG),l}function a(){try{return localStorage}catch{}}e.exports=m1(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(Oi,Oi.exports);var _1=Oi.exports,w1=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createModuleLogger=Zt.createProjectLogger=void 0;const y1=w1(_1),v1=(0,y1.default)("metamask");function E1(e){return v1.extend(e)}Zt.createProjectLogger=E1;function S1(e,t){return e.extend(t)}Zt.createModuleLogger=S1;var kl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(l){return Array.isArray(l)&&l.length>0}e.isNonEmptyArray=t;function r(l){return l==null}e.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}e.isObject=n;const s=(l,u)=>Object.hasOwnProperty.call(l,u);e.hasProperty=s,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(l){if(typeof l!="object"||l===null)return!1;try{let u=l;for(;Object.getPrototypeOf(u)!==null;)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(l)===u}catch{return!1}}e.isPlainObject=i;function o(l){return l.charCodeAt(0)<=127}e.isASCII=o;function a(l){var u;return l.split("").reduce((h,b)=>o(b)?h+1:h+2,0)+((u=l.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&u!==void 0?u:[]).length}e.calculateStringSize=a;function c(l){return l.toString().length}e.calculateNumberSize=c})(kl);var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.hexToBigInt=Ke.hexToNumber=Ke.bigIntToHex=Ke.numberToHex=void 0;const Ht=we,pr=$r,R1=e=>((0,Ht.assert)(typeof e=="number","Value must be a number."),(0,Ht.assert)(e>=0,"Value must be a non-negative number."),(0,Ht.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,pr.add0x)(e.toString(16)));Ke.numberToHex=R1;const C1=e=>((0,Ht.assert)(typeof e=="bigint","Value must be a bigint."),(0,Ht.assert)(e>=0,"Value must be a non-negative bigint."),(0,pr.add0x)(e.toString(16)));Ke.bigIntToHex=C1;const k1=e=>{(0,pr.assertIsHexString)(e);const t=parseInt(e,16);return(0,Ht.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Ke.hexToNumber=k1;const I1=e=>((0,pr.assertIsHexString)(e),BigInt((0,pr.add0x)(e)));Ke.hexToBigInt=I1;var Il={};Object.defineProperty(Il,"__esModule",{value:!0});var Al={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=i=>Number.isInteger(i)&&i>=0,r=(i,o)=>{if(!t(i))throw new Error(`"${o}" must be a non-negative integer. Received: "${i}".`)};function n(i,o){return r(i,"count"),i*o}e.inMilliseconds=n;function s(i){return r(i,"timestamp"),Date.now()-i}e.timeSince=s})(Al);var Tl={};Object.defineProperty(Tl,"__esModule",{value:!0});var Ml={},$i={exports:{}};const A1="2.0.0",Nl=256,T1=Number.MAX_SAFE_INTEGER||9007199254740991,M1=16,N1=Nl-6,x1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var zn={MAX_LENGTH:Nl,MAX_SAFE_COMPONENT_LENGTH:M1,MAX_SAFE_BUILD_LENGTH:N1,MAX_SAFE_INTEGER:T1,RELEASE_TYPES:x1,SEMVER_SPEC_VERSION:A1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},wi={};const L1=typeof process=="object"&&wi&&wi.NODE_DEBUG&&/\bsemver\b/i.test(wi.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var qn=L1;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=zn,i=qn;t=e.exports={};const o=t.re=[],a=t.safeRe=[],c=t.src=[],l=t.t={};let u=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[d,n]],b=R=>{for(const[E,p]of h)R=R.split(`${E}*`).join(`${E}{0,${p}}`).split(`${E}+`).join(`${E}{1,${p}}`);return R},w=(R,E,p)=>{const _=b(E),m=u++;i(R,m,E),l[R]=m,c[m]=E,o[m]=new RegExp(E,p?"g":void 0),a[m]=new RegExp(_,p?"g":void 0)};w("NUMERICIDENTIFIER","0|[1-9]\\d*"),w("NUMERICIDENTIFIERLOOSE","\\d+"),w("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),w("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),w("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),w("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),w("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),w("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),w("BUILDIDENTIFIER",`${d}+`),w("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),w("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),w("FULL",`^${c[l.FULLPLAIN]}$`),w("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),w("LOOSE",`^${c[l.LOOSEPLAIN]}$`),w("GTLT","((?:<|>)?=?)"),w("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),w("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),w("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),w("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),w("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),w("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),w("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),w("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),w("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),w("COERCERTL",c[l.COERCE],!0),w("COERCERTLFULL",c[l.COERCEFULL],!0),w("LONETILDE","(?:~>?)"),w("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",w("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),w("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),w("LONECARET","(?:\\^)"),w("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",w("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),w("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),w("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),w("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),w("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",w("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),w("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),w("STAR","(<|>)?=?\\s*\\*"),w("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),w("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})($i,$i.exports);var Br=$i.exports;const P1=Object.freeze({loose:!0}),O1=Object.freeze({}),$1=e=>e?typeof e!="object"?P1:e:O1;var io=$1;const _a=/^[0-9]+$/,xl=(e,t)=>{const r=_a.test(e),n=_a.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},B1=(e,t)=>xl(t,e);var Ll={compareIdentifiers:xl,rcompareIdentifiers:B1};const Zr=qn,{MAX_LENGTH:wa,MAX_SAFE_INTEGER:Kr}=zn,{safeRe:ya,t:va}=Br,F1=io,{compareIdentifiers:Ot}=Ll;let D1=class Ve{constructor(t,r){if(r=F1(r),t instanceof Ve){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>wa)throw new TypeError(`version is longer than ${wa} characters`);Zr("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?ya[va.LOOSE]:ya[va.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Kr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Kr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Kr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i<Kr)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Zr("SemVer.compare",this.version,this.options,t),!(t instanceof Ve)){if(typeof t=="string"&&t===this.version)return 0;t=new Ve(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Ve||(t=new Ve(t,this.options)),Ot(this.major,t.major)||Ot(this.minor,t.minor)||Ot(this.patch,t.patch)}comparePre(t){if(t instanceof Ve||(t=new Ve(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],s=t.prerelease[r];if(Zr("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ot(n,s)}while(++r)}compareBuild(t){t instanceof Ve||(t=new Ve(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(Zr("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return Ot(n,s)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),Ot(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Se=D1;const Ea=Se,j1=(e,t,r=!1)=>{if(e instanceof Ea)return e;try{return new Ea(e,t)}catch(n){if(!r)return null;throw n}};var ir=j1;const H1=ir,U1=(e,t)=>{const r=H1(e,t);return r?r.version:null};var W1=U1;const V1=ir,z1=(e,t)=>{const r=V1(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var q1=z1;const Sa=Se,G1=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Sa(e instanceof Sa?e.version:e,r).inc(t,n,s).version}catch{return null}};var J1=G1;const Ra=ir,Z1=(e,t)=>{const r=Ra(e,null,!0),n=Ra(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,o=i?r:n,a=i?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};var K1=Z1;const Q1=Se,Y1=(e,t)=>new Q1(e,t).major;var X1=Y1;const eg=Se,tg=(e,t)=>new eg(e,t).minor;var rg=tg;const ng=Se,sg=(e,t)=>new ng(e,t).patch;var ig=sg;const og=ir,ag=(e,t)=>{const r=og(e,t);return r&&r.prerelease.length?r.prerelease:null};var cg=ag;const Ca=Se,lg=(e,t,r)=>new Ca(e,r).compare(new Ca(t,r));var De=lg;const ug=De,dg=(e,t,r)=>ug(t,e,r);var hg=dg;const fg=De,gg=(e,t)=>fg(e,t,!0);var pg=gg;const ka=Se,bg=(e,t,r)=>{const n=new ka(e,r),s=new ka(t,r);return n.compare(s)||n.compareBuild(s)};var oo=bg;const mg=oo,_g=(e,t)=>e.sort((r,n)=>mg(r,n,t));var wg=_g;const yg=oo,vg=(e,t)=>e.sort((r,n)=>yg(n,r,t));var Eg=vg;const Sg=De,Rg=(e,t,r)=>Sg(e,t,r)>0;var Gn=Rg;const Cg=De,kg=(e,t,r)=>Cg(e,t,r)<0;var ao=kg;const Ig=De,Ag=(e,t,r)=>Ig(e,t,r)===0;var Pl=Ag;const Tg=De,Mg=(e,t,r)=>Tg(e,t,r)!==0;var Ol=Mg;const Ng=De,xg=(e,t,r)=>Ng(e,t,r)>=0;var co=xg;const Lg=De,Pg=(e,t,r)=>Lg(e,t,r)<=0;var lo=Pg;const Og=Pl,$g=Ol,Bg=Gn,Fg=co,Dg=ao,jg=lo,Hg=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Og(e,r,n);case"!=":return $g(e,r,n);case">":return Bg(e,r,n);case">=":return Fg(e,r,n);case"<":return Dg(e,r,n);case"<=":return jg(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var $l=Hg;const Ug=Se,Wg=ir,{safeRe:Qr,t:Yr}=Br,Vg=(e,t)=>{if(e instanceof Ug)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Qr[Yr.COERCEFULL]:Qr[Yr.COERCE]);else{const c=t.includePrerelease?Qr[Yr.COERCERTLFULL]:Qr[Yr.COERCERTL];let l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;const n=r[2],s=r[3]||"0",i=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Wg(`${n}.${s}.${i}${o}${a}`,t)};var zg=Vg;class qg{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var Gg=qg,yi,Ia;function je(){if(Ia)return yi;Ia=1;const e=/\s+/g;class t{constructor(I,$){if($=s($),I instanceof t)return I.loose===!!$.loose&&I.includePrerelease===!!$.includePrerelease?I:new t(I.raw,$);if(I instanceof i)return this.raw=I.value,this.set=[[I]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=I.trim().replace(e," "),this.set=this.raw.split("||").map(x=>this.parseRange(x.trim())).filter(x=>x.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const x=this.set[0];if(this.set=this.set.filter(F=>!R(F[0])),this.set.length===0)this.set=[x];else if(this.set.length>1){for(const F of this.set)if(F.length===1&&E(F[0])){this.set=[F];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let I=0;I<this.set.length;I++){I>0&&(this.formatted+="||");const $=this.set[I];for(let x=0;x<$.length;x++)x>0&&(this.formatted+=" "),this.formatted+=$[x].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(I){const x=((this.options.includePrerelease&&b)|(this.options.loose&&w))+":"+I,F=n.get(x);if(F)return F;const L=this.options.loose,H=L?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];I=I.replace(H,ne(this.options.includePrerelease)),o("hyphen replace",I),I=I.replace(c[l.COMPARATORTRIM],u),o("comparator trim",I),I=I.replace(c[l.TILDETRIM],d),o("tilde trim",I),I=I.replace(c[l.CARETTRIM],h),o("caret trim",I);let Z=I.split(" ").map(te=>_(te,this.options)).join(" ").split(/\s+/).map(te=>oe(te,this.options));L&&(Z=Z.filter(te=>(o("loose invalid filter",te,this.options),!!te.match(c[l.COMPARATORLOOSE])))),o("range list",Z);const W=new Map,K=Z.map(te=>new i(te,this.options));for(const te of K){if(R(te))return[te];W.set(te.value,te)}W.size>1&&W.has("")&&W.delete("");const ue=[...W.values()];return n.set(x,ue),ue}intersects(I,$){if(!(I instanceof t))throw new TypeError("a Range is required");return this.set.some(x=>p(x,$)&&I.set.some(F=>p(F,$)&&x.every(L=>F.every(H=>L.intersects(H,$)))))}test(I){if(!I)return!1;if(typeof I=="string")try{I=new a(I,this.options)}catch{return!1}for(let $=0;$<this.set.length;$++)if(se(this.set[$],I,this.options))return!0;return!1}}yi=t;const r=Gg,n=new r,s=io,i=Jn(),o=qn,a=Se,{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:h}=Br,{FLAG_INCLUDE_PRERELEASE:b,FLAG_LOOSE:w}=zn,R=M=>M.value==="<0.0.0-0",E=M=>M.value==="",p=(M,I)=>{let $=!0;const x=M.slice();let F=x.pop();for(;$&&x.length;)$=x.every(L=>F.intersects(L,I)),F=x.pop();return $},_=(M,I)=>(o("comp",M,I),M=T(M,I),o("caret",M),M=C(M,I),o("tildes",M),M=B(M,I),o("xrange",M),M=Q(M,I),o("stars",M),M),m=M=>!M||M.toLowerCase()==="x"||M==="*",C=(M,I)=>M.trim().split(/\s+/).map($=>S($,I)).join(" "),S=(M,I)=>{const $=I.loose?c[l.TILDELOOSE]:c[l.TILDE];return M.replace($,(x,F,L,H,Z)=>{o("tilde",M,x,F,L,H,Z);let W;return m(F)?W="":m(L)?W=`>=${F}.0.0 <${+F+1}.0.0-0`:m(H)?W=`>=${F}.${L}.0 <${F}.${+L+1}.0-0`:Z?(o("replaceTilde pr",Z),W=`>=${F}.${L}.${H}-${Z} <${F}.${+L+1}.0-0`):W=`>=${F}.${L}.${H} <${F}.${+L+1}.0-0`,o("tilde return",W),W})},T=(M,I)=>M.trim().split(/\s+/).map($=>U($,I)).join(" "),U=(M,I)=>{o("caret",M,I);const $=I.loose?c[l.CARETLOOSE]:c[l.CARET],x=I.includePrerelease?"-0":"";return M.replace($,(F,L,H,Z,W)=>{o("caret",M,F,L,H,Z,W);let K;return m(L)?K="":m(H)?K=`>=${L}.0.0${x} <${+L+1}.0.0-0`:m(Z)?L==="0"?K=`>=${L}.${H}.0${x} <${L}.${+H+1}.0-0`:K=`>=${L}.${H}.0${x} <${+L+1}.0.0-0`:W?(o("replaceCaret pr",W),L==="0"?H==="0"?K=`>=${L}.${H}.${Z}-${W} <${L}.${H}.${+Z+1}-0`:K=`>=${L}.${H}.${Z}-${W} <${L}.${+H+1}.0-0`:K=`>=${L}.${H}.${Z}-${W} <${+L+1}.0.0-0`):(o("no pr"),L==="0"?H==="0"?K=`>=${L}.${H}.${Z}${x} <${L}.${H}.${+Z+1}-0`:K=`>=${L}.${H}.${Z}${x} <${L}.${+H+1}.0-0`:K=`>=${L}.${H}.${Z} <${+L+1}.0.0-0`),o("caret return",K),K})},B=(M,I)=>(o("replaceXRanges",M,I),M.split(/\s+/).map($=>O($,I)).join(" ")),O=(M,I)=>{M=M.trim();const $=I.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return M.replace($,(x,F,L,H,Z,W)=>{o("xRange",M,x,F,L,H,Z,W);const K=m(L),ue=K||m(H),te=ue||m(Z),y=te;return F==="="&&y&&(F=""),W=I.includePrerelease?"-0":"",K?F===">"||F==="<"?x="<0.0.0-0":x="*":F&&y?(ue&&(H=0),Z=0,F===">"?(F=">=",ue?(L=+L+1,H=0,Z=0):(H=+H+1,Z=0)):F==="<="&&(F="<",ue?L=+L+1:H=+H+1),F==="<"&&(W="-0"),x=`${F+L}.${H}.${Z}${W}`):ue?x=`>=${L}.0.0${W} <${+L+1}.0.0-0`:te&&(x=`>=${L}.${H}.0${W} <${L}.${+H+1}.0-0`),o("xRange return",x),x})},Q=(M,I)=>(o("replaceStars",M,I),M.trim().replace(c[l.STAR],"")),oe=(M,I)=>(o("replaceGTE0",M,I),M.trim().replace(c[I.includePrerelease?l.GTE0PRE:l.GTE0],"")),ne=M=>(I,$,x,F,L,H,Z,W,K,ue,te,y)=>(m(x)?$="":m(F)?$=`>=${x}.0.0${M?"-0":""}`:m(L)?$=`>=${x}.${F}.0${M?"-0":""}`:H?$=`>=${$}`:$=`>=${$}${M?"-0":""}`,m(K)?W="":m(ue)?W=`<${+K+1}.0.0-0`:m(te)?W=`<${K}.${+ue+1}.0-0`:y?W=`<=${K}.${ue}.${te}-${y}`:M?W=`<${K}.${ue}.${+te+1}-0`:W=`<=${W}`,`${$} ${W}`.trim()),se=(M,I,$)=>{for(let x=0;x<M.length;x++)if(!M[x].test(I))return!1;if(I.prerelease.length&&!$.includePrerelease){for(let x=0;x<M.length;x++)if(o(M[x].semver),M[x].semver!==i.ANY&&M[x].semver.prerelease.length>0){const F=M[x].semver;if(F.major===I.major&&F.minor===I.minor&&F.patch===I.patch)return!0}return!1}return!0};return yi}var vi,Aa;function Jn(){if(Aa)return vi;Aa=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,d){if(d=r(d),u instanceof t){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const d=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=u.match(d);if(!h)throw new TypeError(`Invalid comparator: ${u}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new c(this.value,d).test(u.semver):(d=r(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}vi=t;const r=io,{safeRe:n,t:s}=Br,i=$l,o=qn,a=Se,c=je();return vi}const Jg=je(),Zg=(e,t,r)=>{try{t=new Jg(t,r)}catch{return!1}return t.test(e)};var Zn=Zg;const Kg=je(),Qg=(e,t)=>new Kg(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Yg=Qg;const Xg=Se,ep=je(),tp=(e,t,r)=>{let n=null,s=null,i=null;try{i=new ep(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new Xg(n,r))}),n};var rp=tp;const np=Se,sp=je(),ip=(e,t,r)=>{let n=null,s=null,i=null;try{i=new sp(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new np(n,r))}),n};var op=ip;const Ei=Se,ap=je(),Ta=Gn,cp=(e,t)=>{e=new ap(e,t);let r=new Ei("0.0.0");if(e.test(r)||(r=new Ei("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const s=e.set[n];let i=null;s.forEach(o=>{const a=new Ei(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||Ta(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||Ta(r,i))&&(r=i)}return r&&e.test(r)?r:null};var lp=cp;const up=je(),dp=(e,t)=>{try{return new up(e,t).range||"*"}catch{return null}};var hp=dp;const fp=Se,Bl=Jn(),{ANY:gp}=Bl,pp=je(),bp=Zn,Ma=Gn,Na=ao,mp=lo,_p=co,wp=(e,t,r,n)=>{e=new fp(e,n),t=new pp(t,n);let s,i,o,a,c;switch(r){case">":s=Ma,i=mp,o=Na,a=">",c=">=";break;case"<":s=Na,i=_p,o=Ma,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(bp(e,t,n))return!1;for(let l=0;l<t.set.length;++l){const u=t.set[l];let d=null,h=null;if(u.forEach(b=>{b.semver===gp&&(b=new Bl(">=0.0.0")),d=d||b,h=h||b,s(b.semver,d.semver,n)?d=b:o(b.semver,h.semver,n)&&(h=b)}),d.operator===a||d.operator===c||(!h.operator||h.operator===a)&&i(e,h.semver))return!1;if(h.operator===c&&o(e,h.semver))return!1}return!0};var uo=wp;const yp=uo,vp=(e,t,r)=>yp(e,t,">",r);var Ep=vp;const Sp=uo,Rp=(e,t,r)=>Sp(e,t,"<",r);var Cp=Rp;const xa=je(),kp=(e,t,r)=>(e=new xa(e,r),t=new xa(t,r),e.intersects(t,r));var Ip=kp;const Ap=Zn,Tp=De;var Mp=(e,t,r)=>{const n=[];let s=null,i=null;const o=e.sort((u,d)=>Tp(u,d,r));for(const u of o)Ap(u,t,r)?(i=u,s||(s=u)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const a=[];for(const[u,d]of n)u===d?a.push(u):!d&&u===o[0]?a.push("*"):d?u===o[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);const c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t};const La=je(),ho=Jn(),{ANY:Si}=ho,lr=Zn,fo=De,Np=(e,t,r={})=>{if(e===t)return!0;e=new La(e,r),t=new La(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const o=Lp(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},xp=[new ho(">=0.0.0-0")],Pa=[new ho(">=0.0.0")],Lp=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Si){if(t.length===1&&t[0].semver===Si)return!0;r.includePrerelease?e=xp:e=Pa}if(t.length===1&&t[0].semver===Si){if(r.includePrerelease)return!0;t=Pa}const n=new Set;let s,i;for(const b of e)b.operator===">"||b.operator===">="?s=Oa(s,b,r):b.operator==="<"||b.operator==="<="?i=$a(i,b,r):n.add(b.semver);if(n.size>1)return null;let o;if(s&&i){if(o=fo(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const b of n){if(s&&!lr(b,String(s),r)||i&&!lr(b,String(i),r))return null;for(const w of t)if(!lr(b,String(w),r))return!1;return!0}let a,c,l,u,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(const b of t){if(u=u||b.operator===">"||b.operator===">=",l=l||b.operator==="<"||b.operator==="<=",s){if(h&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===h.major&&b.semver.minor===h.minor&&b.semver.patch===h.patch&&(h=!1),b.operator===">"||b.operator===">="){if(a=Oa(s,b,r),a===b&&a!==s)return!1}else if(s.operator===">="&&!lr(s.semver,String(b),r))return!1}if(i){if(d&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===d.major&&b.semver.minor===d.minor&&b.semver.patch===d.patch&&(d=!1),b.operator==="<"||b.operator==="<="){if(c=$a(i,b,r),c===b&&c!==i)return!1}else if(i.operator==="<="&&!lr(i.semver,String(b),r))return!1}if(!b.operator&&(i||s)&&o!==0)return!1}return!(s&&l&&!i&&o!==0||i&&u&&!s&&o!==0||h||d)},Oa=(e,t,r)=>{if(!e)return t;const n=fo(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},$a=(e,t,r)=>{if(!e)return t;const n=fo(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Pp=Np;const Ri=Br,Ba=zn,Op=Se,Fa=Ll,$p=ir,Bp=W1,Fp=q1,Dp=J1,jp=K1,Hp=X1,Up=rg,Wp=ig,Vp=cg,zp=De,qp=hg,Gp=pg,Jp=oo,Zp=wg,Kp=Eg,Qp=Gn,Yp=ao,Xp=Pl,eb=Ol,tb=co,rb=lo,nb=$l,sb=zg,ib=Jn(),ob=je(),ab=Zn,cb=Yg,lb=rp,ub=op,db=lp,hb=hp,fb=uo,gb=Ep,pb=Cp,bb=Ip,mb=Mp,_b=Pp;var wb={parse:$p,valid:Bp,clean:Fp,inc:Dp,diff:jp,major:Hp,minor:Up,patch:Wp,prerelease:Vp,compare:zp,rcompare:qp,compareLoose:Gp,compareBuild:Jp,sort:Zp,rsort:Kp,gt:Qp,lt:Yp,eq:Xp,neq:eb,gte:tb,lte:rb,cmp:nb,coerce:sb,Comparator:ib,Range:ob,satisfies:ab,toComparators:cb,maxSatisfying:lb,minSatisfying:ub,minVersion:db,validRange:hb,outside:fb,gtr:gb,ltr:pb,intersects:bb,simplifyRange:mb,subset:_b,SemVer:Op,re:Ri.re,src:Ri.src,tokens:Ri.t,SEMVER_SPEC_VERSION:Ba.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ba.RELEASE_TYPES,compareIdentifiers:Fa.compareIdentifiers,rcompareIdentifiers:Fa.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=wb,r=It,n=we;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",d=>(0,t.valid)(d)===null?`Expected SemVer version, got "${d}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",d=>(0,t.validRange)(d)===null?`Expected SemVer range, got "${d}"`:!0);function s(d){return(0,r.is)(d,e.VersionStruct)}e.isValidSemVerVersion=s;function i(d){return(0,r.is)(d,e.VersionRangeStruct)}e.isValidSemVerRange=i;function o(d){(0,n.assertStruct)(d,e.VersionStruct)}e.assertIsSemVerVersion=o;function a(d){(0,n.assertStruct)(d,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function c(d,h){return(0,t.gt)(d,h)}e.gtVersion=c;function l(d,h){return(0,t.gtr)(d,h)}e.gtRange=l;function u(d,h){return(0,t.satisfies)(d,h,{includePrerelease:!0})}e.satisfiesVersionRange=u})(Ml);(function(e){var t=D&&D.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=D&&D.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(we,e),r(Or,e),r(ee,e),r(Wn,e),r(Ze,e),r(Jt,e),r(Sl,e),r($r,e),r(Rl,e),r(Cl,e),r(Zt,e),r(kl,e),r(Ke,e),r(Il,e),r(Al,e),r(Tl,e),r(Ml,e)})(sl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=sl;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(nl);var Fl=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.PollingBlockTracker=void 0;const yb=Fl(Ki),vb=Fl(qf),Eb=Nr,Da=nl,ja=(0,Da.createModuleLogger)(Da.projectLogger,"polling-block-tracker"),Sb=(0,yb.default)(),Rb=1e3;class Cb extends Eb.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*Rb,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=Ha(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
|
|
3
3
|
${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const s=Ha(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await s}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Sb(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),ja("Making request",t);const r=await(0,vb.default)(n=>this._provider.sendAsync(t,n))();if(ja("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
4
4
|
${r.error.message}`);return r.result}}Hn.PollingBlockTracker=Cb;function Ha(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Kn={},kb=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.SubscribeBlockTracker=void 0;const Ib=kb(Ki),Ab=Nr,Tb=(0,Ib.default)();class Mb extends Ab.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,s)=>{this._provider.sendAsync({id:Tb(),method:t,params:r,jsonrpc:"2.0"},(i,o)=>{i?s(i):n(o.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Kn.SubscribeBlockTracker=Mb;(function(e){var t=D&&D.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=D&&D.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Hn,e),r(Kn,e)})(rl);var go={},Qn={},Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getUniqueId=void 0;const Dl=4294967295;let Ci=Math.floor(Math.random()*Dl);function Nb(){return Ci=(Ci+1)%Dl,Ci}Fr.getUniqueId=Nb;Object.defineProperty(Qn,"__esModule",{value:!0});Qn.createIdRemapMiddleware=void 0;const xb=Fr;function Lb(){return(e,t,r,n)=>{const s=e.id,i=xb.getUniqueId();e.id=i,t.id=i,r(o=>{e.id=s,t.id=s,o()})}}Qn.createIdRemapMiddleware=Lb;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.createAsyncMiddleware=void 0;function Pb(e){return async(t,r,n,s)=>{let i;const o=new Promise(u=>{i=u});let a=null,c=!1;const l=async()=>{c=!0,n(u=>{a=u,i()}),await o};try{await e(t,r,l),c?(await o,a(null)):s(null)}catch(u){a?a(u):s(u)}}}Yn.createAsyncMiddleware=Pb;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.createScaffoldMiddleware=void 0;function Ob(e){return(t,r,n,s)=>{const i=e[t.method];return i===void 0?n():typeof i=="function"?i(t,r,n,s):(r.result=i,s())}}Xn.createScaffoldMiddleware=Ob;var Dr={},po={};Object.defineProperty(po,"__esModule",{value:!0});const $b=un;function Ua(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Bb(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Fb=class extends $b.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")Ua(i,this,r);else{const o=i.length,a=Bb(i);for(let c=0;c<o;c+=1)Ua(a[c],this,r)}return!0}};po.default=Fb;var jl={},ct={},Db=br;br.default=br;br.stable=Wl;br.stableStringify=Wl;var on="[...]",Hl="[Circular]",Et=[],wt=[];function Ul(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function br(e,t,r,n){typeof n>"u"&&(n=Ul()),Bi(e,"",0,[],void 0,0,n);var s;try{wt.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,Vl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Et.length!==0;){var i=Et.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function Ut(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),Et.push([n,r,t,s])):wt.push([t,r,e]):(n[r]=e,Et.push([n,r,t]))}function Bi(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Ut(Hl,e,t,s);return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){Ut(on,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Ut(on,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Bi(e[a],a,a,n,e,i,o);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var l=c[a];Bi(e[l],l,a,n,e,i,o)}}n.pop()}}function jb(e,t){return e<t?-1:e>t?1:0}function Wl(e,t,r,n){typeof n>"u"&&(n=Ul());var s=Fi(e,"",0,[],void 0,0,n)||e,i;try{wt.length===0?i=JSON.stringify(s,t,r):i=JSON.stringify(s,Vl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Et.length!==0;){var o=Et.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Fi(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Ut(Hl,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){Ut(on,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Ut(on,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Fi(e[a],a,a,n,e,i,o);else{var c={},l=Object.keys(e).sort(jb);for(a=0;a<l.length;a++){var u=l[a];Fi(e[u],u,a,n,e,i,o),c[u]=e[u]}if(typeof s<"u")Et.push([s,t,e]),s[t]=c;else return c}n.pop()}}function Vl(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(wt.length>0)for(var n=0;n<wt.length;n++){var s=wt[n];if(s[1]===t&&s[0]===r){r=s[2],wt.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(ct,"__esModule",{value:!0});ct.EthereumProviderError=ct.EthereumRpcError=void 0;const Hb=Db;class zl extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Hb.default(this.serialize(),Vb,2)}}ct.EthereumRpcError=zl;class Ub extends zl{constructor(t,r,n){if(!Wb(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}ct.EthereumProviderError=Ub;function Wb(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Vb(e,t){if(t!=="[Circular]")return t}var bo={},lt={};Object.defineProperty(lt,"__esModule",{value:!0});lt.errorValues=lt.errorCodes=void 0;lt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};lt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=lt,r=ct,n=t.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",i={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(h,b=s){if(Number.isInteger(h)){const w=h.toString();if(d(t.errorValues,w))return t.errorValues[w].message;if(l(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return b}e.getMessageFromCode=o;function a(h){if(!Number.isInteger(h))return!1;const b=h.toString();return!!(t.errorValues[b]||l(h))}e.isValidCode=a;function c(h,{fallbackError:b=i,shouldIncludeStack:w=!1}={}){var R,E;if(!b||!Number.isInteger(b.code)||typeof b.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(h instanceof r.EthereumRpcError)return h.serialize();const p={};if(h&&typeof h=="object"&&!Array.isArray(h)&&d(h,"code")&&a(h.code)){const m=h;p.code=m.code,m.message&&typeof m.message=="string"?(p.message=m.message,d(m,"data")&&(p.data=m.data)):(p.message=o(p.code),p.data={originalError:u(h)})}else{p.code=b.code;const m=(R=h)===null||R===void 0?void 0:R.message;p.message=m&&typeof m=="string"?m:b.message,p.data={originalError:u(h)}}const _=(E=h)===null||E===void 0?void 0:E.stack;return w&&h&&_&&typeof _=="string"&&(p.stack=_),p}e.serializeError=c;function l(h){return h>=-32099&&h<=-32e3}function u(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function d(h,b){return Object.prototype.hasOwnProperty.call(h,b)}})(bo);var es={};Object.defineProperty(es,"__esModule",{value:!0});es.ethErrors=void 0;const mo=ct,ql=bo,ye=lt;es.ethErrors={rpc:{parse:e=>Me(ye.errorCodes.rpc.parse,e),invalidRequest:e=>Me(ye.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Me(ye.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Me(ye.errorCodes.rpc.methodNotFound,e),internal:e=>Me(ye.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Me(t,e)},invalidInput:e=>Me(ye.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Me(ye.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Me(ye.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Me(ye.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Me(ye.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Me(ye.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>ur(ye.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>ur(ye.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>ur(ye.errorCodes.provider.unsupportedMethod,e),disconnected:e=>ur(ye.errorCodes.provider.disconnected,e),chainDisconnected:e=>ur(ye.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new mo.EthereumProviderError(t,r,n)}}};function Me(e,t){const[r,n]=Gl(t);return new mo.EthereumRpcError(e,r||ql.getMessageFromCode(e),n)}function ur(e,t){const[r,n]=Gl(t);return new mo.EthereumProviderError(e,r||ql.getMessageFromCode(e),n)}function Gl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=ct;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=bo;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=es;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=lt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(jl);var zb=D&&D.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.JsonRpcEngine=void 0;const qb=zb(po),Ne=jl;class Xe extends qb.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,s)=>{try{const[i,o,a]=await Xe._runAllMiddleware(t,r,this._middleware);return o?(await Xe._runReturnHandlers(a),s(i)):n(async c=>{try{await Xe._runReturnHandlers(a)}catch(l){return c(l)}return c()})}catch(i){return s(i)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,s)=>{r(s)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new Ne.EthereumRpcError(Ne.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new Ne.EthereumRpcError(Ne.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),s={id:n.id,jsonrpc:n.jsonrpc};let i=null;try{await this._processRequest(n,s)}catch(o){i=o}return i&&(delete s.result,s.error||(s.error=Ne.serializeError(i))),r(i,s)}async _processRequest(t,r){const[n,s,i]=await Xe._runAllMiddleware(t,r,this._middleware);if(Xe._checkForCompletion(t,r,s),await Xe._runReturnHandlers(i),n)throw n}static async _runAllMiddleware(t,r,n){const s=[];let i=null,o=!1;for(const a of n)if([i,o]=await Xe._runMiddleware(t,r,a,s),o)break;return[i,o,s.reverse()]}static _runMiddleware(t,r,n,s){return new Promise(i=>{const o=c=>{const l=c||r.error;l&&(r.error=Ne.serializeError(l)),i([l,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new Ne.EthereumRpcError(Ne.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
|