diff --git a/404.html b/404.html index 1bddadd..276eeef 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -Crust Cloud
\ No newline at end of file +Crust Cloud
\ No newline at end of file diff --git a/_next/static/ofwgz4GGV120MgUVTloZM/_buildManifest.js b/_next/static/VLIK15VaKeYRjrUP0esKG/_buildManifest.js similarity index 100% rename from _next/static/ofwgz4GGV120MgUVTloZM/_buildManifest.js rename to _next/static/VLIK15VaKeYRjrUP0esKG/_buildManifest.js diff --git a/_next/static/ofwgz4GGV120MgUVTloZM/_ssgManifest.js b/_next/static/VLIK15VaKeYRjrUP0esKG/_ssgManifest.js similarity index 100% rename from _next/static/ofwgz4GGV120MgUVTloZM/_ssgManifest.js rename to _next/static/VLIK15VaKeYRjrUP0esKG/_ssgManifest.js diff --git a/_next/static/chunks/396.e5f5ad384b52d077.js b/_next/static/chunks/396.8da447f9b2aaee05.js similarity index 53% rename from _next/static/chunks/396.e5f5ad384b52d077.js rename to _next/static/chunks/396.8da447f9b2aaee05.js index 0344d65..e081fc7 100644 --- a/_next/static/chunks/396.e5f5ad384b52d077.js +++ b/_next/static/chunks/396.8da447f9b2aaee05.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[396],{60007:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return aG}});var a,i,l,r,s,c,o,d,m,u,p,y,h,f,g,b,v,x,A,w,Z,k,N,T,I,C,B,M,S,E,X,O,j,W,P,L,Y,R,D,z,G,H,F,U,J,Q,V,K,q,_,$,ee,et,en,ea,ei,el,er,es,ec=n(35944),eo=n(67294);let ed=()=>{let e=(0,eo.useRef)({safe:!0});return(0,eo.useEffect)(()=>(e.current.safe=!0,()=>{e.current.safe=!1}),[]),e.current};function em(){for(var e=arguments.length,t=Array(e),n=0;nt.map(e=>t=>{a.safe&&e(t)}),[t])}function eu(e){let[t,n]=(0,eo.useState)(e),[a]=em(n);return[t,a]}function ep(e){let t=(0,eo.useRef)(null);return(0,eo.useLayoutEffect)(()=>(t.current=e,()=>{})),(0,eo.useCallback)(function(){for(var e=arguments.length,n=Array(e),a=0;a{e.current||(e.current=!0,t().then(()=>{e.current=!1}))},[]);return[e,t]}let eh={loading:!1},ef=eo.createContext({update(){},oUpdate(){},store:eh}),eg=ef.Provider,eb=(e,t,n)=>{},ev=()=>{let[e,t]=(0,eo.useState)(eh),n=(0,eo.useCallback)(e=>{"function"==typeof e?t(t=>{let n=e(t),a={...t,...n};return eb(n,t,a),a}):t(t=>{let n={...t,...e};return eb(e,t,n),n})},[]);return{store:e,update:n,oUpdate:n}},ex=()=>{let{store:e,update:t}=(0,eo.useContext)(ef),[n]=em(t);return(0,eo.useMemo)(()=>({store:e,update:n,oUpdate:t}),[e,t,n])};var eA=n(94184),ew=n.n(eA),eZ=n(79352);let ek=eo.memo(e=>(0,ec.tZ)(eZ.uur,{...e,className:ew()(e.className,"animate-spin text-5xl")})),eN=eo.memo(e=>{let{text:t="",loading_attr:n={},text_attr:a={},...i}=e;return(0,ec.BX)("div",{...i,className:ew()(i.className," flex flex-col items-center"),children:[(0,ec.tZ)(ek,{...n}),!!t&&(0,ec.tZ)("div",{...a,className:ew()(" text-2xl text-center mt-9",a.className),children:t})]})}),eT=eo.memo(()=>{let e=(0,eo.useCallback)(e=>{e.stopPropagation()},[]),{loading:t}=function(e){let{oUpdate:t,store:{loading:n}}=ex(),a=(0,eo.useCallback)(()=>t({loading:!0}),[t]),i=(0,eo.useCallback)(()=>t({loading:!1}),[t]);return(0,eo.useEffect)(()=>{"boolean"==typeof e&&(e?a():i())},[e]),(0,eo.useMemo)(()=>({show:a,hiden:i,loading:n}),[a,i,n])}();return t?(0,ec.tZ)("div",{className:" fixed left-0 top-0 z-50 w-screen h-screen flex justify-center items-center bg-opacity-60 bg-black-1",onMouseMove:e,onMouseDown:e,onClick:e,children:(0,ec.tZ)(eN,{className:"py-10"})}):null});var eI=n(79655),eC=n(89250);function eB(){return(eB=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{text:t="",className:n}=e;return(0,ec.tZ)("div",{className:ew()("text-left text-black font-medium text-[2.5rem] leading-[2.9375rem]",n),children:t})});function eP(){return(eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:6,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;return e?e.length<=t+n?e:"".concat(e.toString().substring(0,t),"...").concat(e.toString().substring(e.length-n)):""};function eq(e){if(e){let t=document.getElementById(e);t&&t.scrollIntoView({block:"start",behavior:"smooth"})}}function e_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_blank";window.open(e,t)}let e$=new(ez())("800000000");function e0(e){let[t,n]=e.split("-"),a=new(ez())(t,36).sub(e$).toString(10);return[a,n]}function e1(e,t){let n=new(ez())(e).add(e$);return"".concat(n.toString(36),"-").concat(t)}function e2(e){return new Promise(t=>setTimeout(t,e))}function e5(e){switch(e){case eV.c.mainnet.id:break;case eV.c.goerli.id:return"https://goerli.etherscan.io";case eV.c.arbitrum.id:return"https://arbiscan.io";case eV.c.arbitrumGoerli.id:return"https://goerli.arbiscan.io";default:console.warn("chainId:".concat(e," not supported."))}return"https://etherscan.io"}function e3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e<9765625e-10?"".concat(eF().floor(1048576*e,t)," KB"):e<1?"".concat(eF().floor(1024*e,t)," MB"):e<1024?"".concat(eF().floor(e,t)," GB"):e<1048576?"".concat(eF().floor(e/1024,t)," TB"):"".concat(eF().floor(e/1048576,t)," PB")}function e4(e){return"".concat(eR.C5,"/ipfs/").concat(e)}function e6(e,t){return e+Math.floor(Math.random()*(t-e))}eQ.Kc&&(window.parseBucketId=e0,window.genBucketId=e1);var e8=n(70594);let e7="ZXRoLTB4MEVDNzJGNEQ5MWVhN2ZiRjAyZTY2NUQzZDU5QzQ3MmVjY2M0ZWZFZDoweDc3NDdmNDkxMWNhOWY2YWJjODE0MTgxZTkzZmM1YjdlNzQ4MGIwYzM0ZGRmOWFmNGQ4NjQ3OTRiZmYzY2EzMTg2MzQyNWEwZDRjZjAyOTA1Mjc5MTIwNDliYjJlYTRkMTM1OGZlZjQ3ZDU4YzBmMTQxNjI3ZmMzMTIwNzMwODdjMWI";async function e9(e){let{data:t,endpoint:n=eR.sl,authBasic:a="Basic ".concat(e7),onProgress:i,cancelToken:l=e8.Z.CancelToken.source().token}=e,r=await e8.Z.request({data:t,cancelToken:l,headers:{Authorization:a},method:"POST",onUploadProgress(e){i&&i(e.progress)},params:{pin:!0},url:"".concat(n,"/api/v0/add")});return r.data}async function te(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e7;try{if(0===e.length)throw Error("CID len err");let a=await e8.Z.post("".concat("https://pin.crustcode.com/psa","/pins"),JSON.stringify({cid:e,name:t}),{headers:{authorization:"Bearer "+n,"Content-Type":"application/json"}});return a.data}catch(i){return null}}function tt(){let{update:e}=ex(),t=(t,n)=>{e(e=>{let{toasts:n}=e;return{toasts:[{type:"error",msg:t}].concat(n||[])}})},n=(t,n)=>{e(e=>{let{toasts:n}=e;return{toasts:[{type:"success",msg:t}].concat(n||[])}})};return{error:t,success:n}}function tn(e){let{className:t,onClose:n,uploadRender:a,uploadBorder:i=!0,onSuccess:l,id:r=""}=e,s=tt(),[c,o]=(0,eo.useState)({progress:0,status:"stop"}),d=(0,eo.useRef)(null),m=(0,eo.useRef)(null),[u,p]=(0,eo.useState)(null),[y,h]=(0,eo.useState)(null),f=async()=>{"stop"===c.status&&m.current.click()};(0,eo.useEffect)(()=>{if(d.current){let e=d.current;e.addEventListener("dragover",e=>{e.preventDefault()}),e.addEventListener("dragenter",async()=>{e.querySelector("#waitUpload")&&(e.style.borderColor="#FC7823")}),e.addEventListener("dragleave",async()=>{e.style.borderColor="#131521"}),e.addEventListener("drop",async t=>{if(t.stopPropagation(),t.preventDefault(),e.querySelector("#waitUpload")){if(e.style.borderColor="#131521",t.dataTransfer.files.length>1||!/\.[a-zA-Z]+$/.test(t.dataTransfer.files[0].name))return s.error("Folders are not supported!"),!1;let[n]=t.dataTransfer.files;if(!n)return s.error("Please select a file."),!1;let a=n.size/1048576;if(a>100){s.error("Please select a file less than 100MB.");return}await g(n)}})}},[]);let g=async e=>{try{let t=e8.Z.CancelToken.source();p(t),o({progress:0,status:"upload"}),m.current.value="";let n=new FormData;if(!e||!e.name)return!1;n.append("file",e,e.name);let a=await e9({data:n,authBasic:"Basic ".concat("ZXRoLTB4MEVDNzJGNEQ5MWVhN2ZiRjAyZTY2NUQzZDU5QzQ3MmVjY2M0ZWZFZDoweDc3NDdmNDkxMWNhOWY2YWJjODE0MTgxZTkzZmM1YjdlNzQ4MGIwYzM0ZGRmOWFmNGQ4NjQ3OTRiZmYzY2EzMTg2MzQyNWEwZDRjZjAyOTA1Mjc5MTIwNDliYjJlYTRkMTM1OGZlZjQ3ZDU4YzBmMTQxNjI3ZmMzMTIwNzMwODdjMWI="),cancelToken:t.token,onProgress(e){o({progress:Math.round(99*e),status:"upload"})}});p(null),o({progress:100,status:"success"}),h(a),l&&l(a)}catch(i){console.error(i)}},b=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u&&(u.cancel("CanceledError"),p(null)),o({progress:0,status:"stop"}),n&&n(),h(null)},v=async e=>{let t=e.target.files[0];if(!t)return s.error("Please select a file."),!1;let n=t.size/1048576;if(n>100){s.error("Please select a file less than 100MB.");return}await g(t)};return(0,ec.BX)("div",{id:r,className:ew()("w-full flex justify-center",t),children:[(0,ec.BX)("div",{ref:d,onClick:f,className:ew()("w-full h-full cursor-pointer relative max-w-[70rem] flex justify-center items-center border-black-1 border-4 border-dashed"),style:i||"upload"!==c.status?{}:{border:"none"},children:[n&&(0,ec.tZ)(eL,{className:"absolute z-10 right-2 top-2 cursor-pointer",onClick:b}),"stop"!==c.status?"upload"===c.status?(0,ec.tZ)("div",{className:ew()("w-full",{"px-5":!!a,"px-20":!a}),children:a?a(c.progress):(0,ec.tZ)(eY,{value:c.progress})}):(0,ec.BX)("div",{className:"text-black-3 text-lg flex flex-col px-20",children:[(0,ec.tZ)("label",{className:"text-xl font-medium text-black",children:"IPFS CID:"}),(0,ec.tZ)("span",{className:"mt-5",children:y.Hash}),(0,ec.BX)("div",{className:"mt-20",children:[(0,ec.tZ)("label",{className:"text-xl font-medium text-black",children:"You may want to:"}),(0,ec.BX)("div",{className:"flex flex-wrap mt-5",children:[(0,ec.tZ)("div",{className:"mr-5 w-1/2 mb-2 underline",onClick:()=>e_("".concat(eR.C5,"/ipfs/").concat(y.Hash)),children:"Get download link for this file"}),(0,ec.tZ)("div",{className:"underline",onClick:()=>e_("https://ipfs-scan.io/?cid=".concat(y.Hash)),children:"Verify on IPFS"}),(0,ec.tZ)("div",{className:"mr-5 w-1/2 underline",onClick:()=>e_("https://docs.crustcloud.io"),children:"Learn more about Crust Cloud's storage solution"}),(0,ec.tZ)("div",{onClick:()=>e_("http://test.crustcloud.io/#/buckets"),className:"underline",children:"Claim your W3Bucket NFT on testnet"})]})]})]}):(0,ec.tZ)("span",{style:{pointerEvents:"none"},id:"waitUpload",className:"text-black-1 font-medium text-[2rem] leading-normal",children:"Drag and drop your file here"})]}),(0,ec.tZ)("input",{ref:m,hidden:!0,onChange:v,type:"file"})]})}let ta=eo.memo(()=>{let[e,t]=(0,eo.useState)(!1),n=()=>{t(!0),setTimeout(()=>{eq("nftupload")},0)},a=()=>{t(!1),setTimeout(()=>{eq("nft")},0)};return(0,ec.tZ)("div",{className:"w-full py-6 px-12 flex justify-center pb-20 mt-3 text-slate-700 text-lg",id:"nft",children:(0,ec.BX)("div",{className:"w-full max-w-[1112px] flex flex-col text-black",children:[(0,ec.tZ)(eW,{className:"mt-6 mb-8 font-medium",text:"Web3 Storage Buckets & Web3 IPFS Gateways"}),(0,ec.tZ)("p",{className:"pb-20 text-2xl text-black-3",children:"Crust Cloud defines what cloud storage middlewares should look like in Web3 - every storage bucket is a NFT, and every IPFS gateway is a NFT."}),(0,ec.BX)("div",{className:"flex justify-center",children:[(0,ec.BX)("div",{className:"flex flex-col justify-between",children:[(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)(eM,{}),(0,ec.tZ)("span",{className:"text-6xl px-6",children:"="}),(0,ec.tZ)(eE,{})]}),(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)(eO,{}),(0,ec.tZ)("span",{className:"text-6xl px-6",children:"="}),(0,ec.tZ)(eE,{})]})]}),(0,ec.BX)("div",{className:"ml-16",children:[(0,ec.tZ)("h4",{className:"text-[1.375rem] font-semibold text-black mb-4",children:"Store files in W3Buckets: Decentralized, Guaranteed & Alive."}),(0,ec.tZ)("p",{className:"text-black-3",children:"All contents in the W3Buckets are immutable, decentralized stored, guaranteed with up to permanent persistence in the open internet, and most importantly, owned & controlled by the NFT owner."}),(0,ec.tZ)("h4",{className:"text-[1.375rem] font-semibold text-black mb-4 mt-20",children:"IPFS Remote Pin"}),(0,ec.tZ)("p",{className:"text-black-3",children:"Storage service are called by Standard IPFS Remote Pinning Service APIs that make your files always available (alive!) on IPFS with multiple replicas and accessible from everywhere."}),(0,ec.BX)("div",{className:"flex mt-8 text-black-1",children:[(0,ec.tZ)(ej,{onClick:n,className:"btn-173",text:"Play Quick Demo"}),(0,ec.tZ)(ej,{onClick:()=>eQ.Kc?e_("/#/buckets","_self"):e_("/#/buckets"),className:"btn-173 ml-5",text:"Launch App"})]})]})]}),e&&(0,ec.tZ)(tn,{id:"nftupload",className:"h-[32.937rem] mt-12",onClose:a})]})})}),ti=[[[42,49]],[[41,50]],[[38,53]],[[37,53]],[[20,26],[35,52]],[[18,28],[34,51],[82,85],[96,100],[110,111]],[[17,24],[27,27],[29,32],[36,36],[38,51],[81,84],[92,101],[109,111]],[[3,6],[11,12],[16,27],[29,34],[40,51],[80,81],[86,86],[89,89],[91,106],[110,115]],[[2,8],[10,24],[26,27],[30,36],[40,50],[67,74],[83,83],[85,86],[88,123]],[[2,24],[26,26],[28,31],[34,37],[40,49],[66,75],[77,86],[88,124]],[[1,31],[34,38],[40,46],[51,54],[66,73],[76,124]],[[1,28],[31,31],[33,37],[41,44],[52,53],[64,123]],[[2,27],[33,37],[42,43],[63,115],[118,122]],[[4,8],[11,27],[33,38],[60,60],[64,114],[116,119]],[[3,7],[13,30],[33,39],[59,61],[64,109],[116,118]],[[2,3],[13,31],[33,40],[58,62],[64,110],[116,118]],[[0,1],[14,40],[58,111],[116,117]],[[16,36],[40,40],[60,111],[115,116]],[[16,38],[40,41],[61,78],[81,109],[111,111]],[[16,39],[60,71],[73,73],[75,77],[80,108]],[[16,37],[58,62],[66,66],[68,71],[76,78],[80,108],[110,111]],[[16,35],[58,61],[65,65],[67,67],[69,78],[81,102],[104,107],[110,110]],[[17,35],[59,60],[63,65],[67,67],[69,69],[71,78],[80,103],[105,106],[109,110]],[[18,34],[61,65],[74,103],[105,105],[108,110]],[[19,32],[59,66],[69,70],[74,103],[107,108]],[[20,32],[58,104],[106,107]],[[20,27],[31,32],[58,78],[80,104]],[[21,26],[31,31],[57,73],[75,78],[82,103]],[[21,21],[23,25],[56,73],[75,82],[85,103]],[[23,26],[28,29],[31,33],[56,74],[76,82],[86,101]],[[23,29],[34,36],[56,74],[76,81],[87,91],[94,98],[100,100],[104,104]],[[25,30],[56,75],[77,80],[87,90],[94,99],[103,104]],[[28,31],[56,75],[77,78],[87,89],[95,99],[103,104]],[[30,31],[34,37],[55,76],[88,89],[96,99],[104,104]],[[30,39],[56,79],[88,89],[96,96],[98,98],[102,102],[104,105]],[[31,40],[57,79],[88,89],[96,96],[101,102],[104,105]],[[33,42],[58,61],[64,79],[95,97],[101,102]],[[32,42],[65,78],[95,97],[100,102],[106,106]],[[32,43],[65,76],[96,97],[100,104],[106,108]],[[31,45],[65,76],[96,98],[100,102],[104,104],[107,111]],[[31,47],[65,75],[97,99],[107,112]],[[31,47],[66,75],[98,100],[110,113]],[[32,47],[66,75],[100,101],[104,105],[110,113]],[[33,47],[66,76],[78,79],[107,108],[113,113]],[[33,46],[65,76],[78,79],[105,108],[111,111]],[[34,46],[65,75],[77,79],[104,112]],[[35,46],[66,75],[77,79],[104,113]],[[35,45],[66,74],[77,78],[102,113]],[[35,44],[67,74],[77,78],[101,114]],[[35,43],[67,73],[77,77],[101,114]],[[35,43],[67,72],[101,114]],[[35,42],[68,72],[102,114]],[[35,41],[68,71],[102,114]],[[34,41],[68,69],[101,103],[108,108],[110,114],[123,123]],[[34,39],[110,113],[123,124]],[[34,38],[111,112],[122,124]],[[34,37],[112,113],[122,124]],[[34,36],[112,112],[121,122]],[[33,37],[120,121]],[[33,36]],[[33,35]],[[34,37]],[[35,36]]],tl=(0,eo.memo)(function(e){let{className:t,activePos:n,onChange:a}=e,[i,l]=(0,eo.useState)([]);(0,eo.useMemo)(()=>{if(n.length>0){let e=[];n.map(t=>{for(let n=0;n=r[0]&&t.x<=r[1]&&t.y===n){e.push(r),i=!0;break}}if(i)break}}),l(e)}},[n]),(0,eo.useMemo)(()=>{i.length>0&&a&&a(i)},[i]);let r=e=>{let t=e[0],n=e[1],a=[];for(let i=t;i<=n;i++)a.push(i);return a},s=(e,t)=>{let a=eF().find(n,n=>n.x===e&&n.y===t);return a?"red":"#666"};return(0,ec.tZ)("svg",{viewBox:"0 0 880 450",className:ew()("",t),children:ti.map((e,t)=>e.map(e=>r(e).map((e,n)=>(0,ec.tZ)("circle",{fill:s(e,t),cx:(e+1)*7,cy:(t+1)*7,r:"2.6"},"circle".concat(n)))))})});function tr(){return(tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=tu();return{logo:(0,ec.tZ)(tm,{className:""}),name:"AAVE",activePos:e.activePos,total:e.total}})()],ty=eo.memo(()=>{let[e,t]=(0,eo.useState)(0),n=()=>{t(e-1>=0?e-1:tp.length-1)},a=()=>{t(e+1>tp.length-1?0:e+1)};return(0,ec.tZ)("div",{className:"w-full pt-6 pb-[min(12vmin,18.75rem)] px-12 flex flex-col items-center",children:(0,ec.BX)("div",{className:"my-10 text-black w-full max-w-[1310px]",children:[(0,ec.tZ)(eW,{className:"mx-auto max-w-[1120px] ",text:"Discover some real use cases"}),tp.map((t,i)=>i===e&&(0,ec.BX)("div",{className:ew()("flex justify-center pt-5"),children:[(0,ec.tZ)(tl,{activePos:t.activePos,className:"flex-1 pt-16"}),(0,ec.BX)("div",{className:"flex flex-shrink-0 flex-col items-center w-[22.625rem] ml-10 ",children:[(0,ec.BX)("div",{className:"h-[4.625rem] w-full flex justify-between items-center",children:[(0,ec.tZ)(to,{className:"cursor-pointer",onClick:n}),t.logo,(0,ec.tZ)(to,{className:"rotate-180 cursor-pointer",onClick:a})]}),(0,ec.BX)("span",{className:"text-black text-lg mt-12 font-medium",children:["Check this real-time monitor to see how we help ",t.name," decentralized host their Dapp frontend:"]}),(0,ec.BX)("div",{className:"text-black-3 text-lg mt-3",children:[(0,ec.BX)("p",{className:"mt-5",children:[(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:t.total})," IPFS Replicas all around the globe"]}),(0,ec.BX)("p",{className:"mt-5",children:[(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:"99+"})," Years guaranteed with ",(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:"1.5ETH"})," in payment contract"]}),(0,ec.BX)("p",{className:"mt-5",children:["Guranteed by ",(0,ec.tZ)("a",{className:"text-black-3 underline",href:"https://crust.network/",target:"_blank",children:"decentralized incentive protocol"})," on IPFS"]}),(0,ec.BX)("p",{className:"mt-5",children:["Verifiable on ",(0,ec.tZ)("a",{className:"text-black-3 underline",href:"https://ipfs-scan.io/",target:"_blank",children:"IPFS Scan"})]})]})]})]},"monitorProject".concat(i)))]})})});var th=n(85769),tf=n(85118),tg=n(41884),tb=n(15029),tv=n(99477);function tx(){let e="#787980",t=(0,eo.useMemo)(()=>{let e=[],t=new tv.Vector3;for(let n=0;n<2e3;n++){t.x=2*Math.random()-1,t.y=2*Math.random()-1,t.z=2*Math.random()-1,t.normalize(),t.multiplyScalar(26);let a=[t.x,t.y,t.z];t.multiplyScalar(.2*Math.random()+1);let i=[t.x,t.y,t.z];e.push([a,i])}return e},[]),n=(0,eo.useMemo)(()=>{let e=[],t=new tv.Vector3;for(let n=0;n<300;n++){t.x=n%2==0?-1:1,t.y=(2*Math.random()-1)*.5,t.z=(2*Math.random()-1)*.3,t.normalize(),t.multiplyScalar(26+4*Math.random()-2);let a=[t.x,t.y,t.z];t.multiplyScalar(2*Math.random()+1.3);let i=[t.x,t.y,t.z],l=Math.abs(a[0]-i[0]),r=Math.round(1+5*l/27),s=[i[0]-a[0],i[1]-a[1],i[2]-a[2]],[c,o,d]=[s[0]/(r+1),s[1]/(r+1),s[2]/(r+1)],m=[];if(Math.random()>.5)for(let u=1;u<=r;u++){let p=Math.ceil(Math.random()-.5),y=(3*Math.random()+2)*p;m.push([a[0]+u*c,a[1]+u*o+y,a[2]+u*d+0])}e.push([a,i,m])}return e},[]),a=(0,eo.useRef)(),i=(0,eo.useRef)(),l=(0,eo.useRef)({count:0}),r=(0,eo.useRef)({});(0,tg.A)((e,t,n)=>{if(a.current){let s=2*Math.PI,c=a.current.rotation.x+s*t*.01;a.current.rotation.x=c>s?c-s:c}if(i.current){let o=l.current.count%6==0;for(let d of i.current.children)if("Points"===d.type){let u=d,p=u.geometry.getAttribute("position");for(let y=0;y2*f.max?1:g,v=b<=f.max?b-1:2*f.max-b-1;p.setXYZ(y,h.getX(v),h.getY(v),h.getZ(v))}else p.setXYZ(y,h.getX(0),h.getY(0),h.getZ(0))}p.needsUpdate=!0}else if("Line"===d.type){let x=d,A=r[x.name];if(A){let w=A.count+(o?1:0),Z=w>2*A.max?1:w,k=Z<=A.max?Z:2*A.max-Z;x.geometry.setDrawRange(0,k),A.count=Z}else if(x.geometry.setDrawRange(0,0),.001>Math.random()){let N=Math.round(x.geometry.getAttribute("position").array.length/3);r[x.name]={count:1,max:N}}}l.current.count++,l.current.count>600&&(l.current.count=0)}},-2);let s=(0,th.m)("disc.png"),c=(0,eo.useMemo)(()=>new tv.Float32BufferAttribute(t.flatMap(e=>e[1]),3),[t]),o=(0,eo.useMemo)(()=>new tv.Float32BufferAttribute(t.flatMap(e=>e[0].concat(e[1])),3),[t]),d=(0,eo.useMemo)(()=>new tv.Float32BufferAttribute(n.flatMap(e=>e[1]),3),[n]),m=(0,eo.useMemo)(()=>{let e=[];for(let[t,a,i]of n){let l=[t,...i,a],r=new tv.CatmullRomCurve3(l.map(e=>new tv.Vector3(...e)),!1,"chordal",.5),s=Math.abs(t[0]-a[0]),c=Math.round(20+160*s/27),o=r.getPoints(c).flatMap(e=>[e.x,e.y,e.z]);e.push(new tv.Float32BufferAttribute(o,3))}return e},[n]);return(0,ec.BX)("group",{position:[40,0,0],children:[(0,ec.BX)("group",{ref:a,children:[(0,ec.BX)("points",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:c}}),(0,ec.tZ)("pointsMaterial",{color:e,opacity:.7,map:s,size:4,blending:tv.AdditiveBlending,depthTest:!1,transparent:!0})]}),(0,ec.BX)("lineSegments",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:o}}),(0,ec.tZ)("lineBasicMaterial",{color:e,linewidth:1})]})]}),(0,ec.BX)("group",{ref:i,children:[(0,ec.BX)("points",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:d}}),(0,ec.tZ)("pointsMaterial",{color:"#cdcccc",opacity:.7,map:s,size:4,blending:tv.AdditiveBlending,depthTest:!1,transparent:!0})]}),m.map((t,n)=>(0,ec.BX)("line_",{name:n,children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:t}}),(0,ec.tZ)("lineBasicMaterial",{color:e,linewidth:1})]},"line_".concat(n)))]})]})}(0,tg.e)({Line_:tv.Line});let tA=eo.memo(function(){return(0,ec.BX)(tb.Xz,{gl:{antialias:!0},children:[(0,ec.tZ)(tf.i,{makeDefault:!0,zoom:9,args:[-150,50,30,-30,50,-100]}),(0,ec.tZ)("ambientLight",{color:"#eaeaea",intensity:1}),(0,ec.BX)("mesh",{position:[0,0,-100],children:[(0,ec.tZ)("planeGeometry",{args:[1e3,1e3]}),(0,ec.tZ)("meshStandardMaterial",{color:"black"})]}),(0,ec.tZ)(tx,{})]})});var tw=n(21132);function tZ(){return(tZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t((0,tw.tf)(()=>{setTimeout(()=>{window.scroll(0,0)},50)}),(0,ec.BX)("div",{className:"w-full min-h-min relative",children:[(0,ec.tZ)("div",{className:"w-full bg-black h-screen absolute left-0 top-0 z-0",children:(0,ec.tZ)(tA,{})}),(0,ec.BX)("div",{className:"z-1 h-[100vh] relative w-full py-6 px-12 flex flex-col items-center",children:[(0,ec.tZ)("div",{className:"h-14 w-full max-w-[1112px] flex justify-between items-center font-WorkSans",children:(0,ec.tZ)("div",{className:"text-[88px] ml-3 mt-5",children:(0,ec.tZ)(tC,{})})}),(0,ec.BX)("div",{className:"h-full my-10 w-full max-w-[1112px] flex flex-col justify-center mt-[-1rem]",children:[(0,ec.BX)("div",{className:"font-RobotoMono font-bold text-[2.5rem] leading-tight",children:[(0,ec.tZ)("p",{children:"Cloud 3"}),(0,ec.tZ)("p",{children:"Redefining Web3 Storage"})]}),(0,ec.BX)("div",{className:"flex flex-col mt-12 pl-1 mb-20",children:[(0,ec.BX)("div",{className:"flex mb-3",children:[(0,ec.tZ)(ej,{text:"Documentations",className:"btn-173 border-white text-white",onClick:()=>e_("https://docs.crustcloud.io/")}),(0,ec.tZ)(ej,{text:"Launch App",className:"btn-173 ml-3 border-white text-white",onClick:()=>eQ.Kc?e_("/#/buckets","_self"):e_("/#/buckets")})]}),(0,ec.tZ)("div",{className:"flex",children:(0,ec.tZ)(ej,{text:"Subscribe",className:"btn-173 border-white text-white",onClick:()=>e_("https://forms.gle/7pbhXXmjPgzuPRLy5")})})]})]})]})]})));function tM(){return(tM=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,ec.tZ)("div",{className:"w-full py-20 px-12 flex flex-col items-center justify-center text-black-1",children:(0,ec.BX)("div",{className:"w-full max-w-[1112px]",children:[(0,ec.tZ)(eW,{className:"w-full pb-14",text:"Crust Cloud is a Web3 storage cloud"}),(0,ec.BX)("div",{className:"w-full flex justify-between items-end text-lg",children:[(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-black-1 mt-12",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-black-1 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"IaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Infrastructure-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.BX)("div",{className:"flex items-center mt-6",children:[(0,ec.tZ)(tS,{}),(0,ec.tZ)(tX,{className:"ml-11"})]}),(0,ec.tZ)("a",{href:"https://ipfs.io",target:"_blank",className:"text-2xl text-black-1 font-medium leading-7 mt-5 mb-3 underline no-skip-ink",children:"IPFS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"the distrbuted file system"}),(0,ec.tZ)("a",{href:"https://crust.network",target:"_blank",className:"text-2xl text-black-1 font-medium leading-7 mt-5 mb-3 underline no-skip-ink",children:"Crust Network"}),(0,ec.tZ)("p",{className:"w-[294px] leading-[1.3125rem] text-center",children:"the decentralized storage protocol & incentive layer of IPFS"})]}),(0,ec.tZ)("div",{})]}),(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.tZ)("h4",{className:"text-orange-15 font-medium text-[2rem] leading-[2.375rem] mb-4",children:"Crust Cloud Products"}),(0,ec.BX)("div",{className:"flex",children:[(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-orange-15",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-orange-15 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"PaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Platform-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center pt-7 pb-14",children:[(0,ec.BX)("div",{className:"flex items-center text-[2.5rem]",children:[(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tj,{}),(0,ec.tZ)("span",{className:"px-3",children:"+"}),(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tP,{})]}),(0,ec.tZ)("h6",{onClick:()=>eq("nft"),className:"text-2xl font-medium leading-7 mt-[1.7rem] mb-3 underline no-skip-ink cursor-pointer",children:"W3Buckets"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"NFT-nized IPFS storage buckets"}),(0,ec.tZ)("h6",{onClick:()=>eq("nft"),className:"text-2xl font-medium leading-7 mt-5 mb-3 underline no-skip-ink cursor-pointer",children:"W3Gateways"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"NFT-nized IPFS Gateways"})]})]}),(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-orange-15",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-orange-15 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"SaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Software-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center pt-7",children:[(0,ec.BX)("div",{className:"flex items-center text-[2.5rem]",children:[(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tY,{})]}),(0,ec.tZ)("h6",{onClick:()=>eq("widget"),className:"text-2xl font-medium leading-7 mt-[2rem] mb-3 underline no-skip-ink cursor-pointer",children:"Web3 Storage Widgets"}),(0,ec.tZ)("p",{className:"w-[298px] leading-[1.3125rem] text-center",children:"Rich-text Editor/Publisher Widget IPFS File Storage Widget"}),(0,ec.tZ)("p",{className:"w-[298px] leading-[1.3125rem] text-center",children:"IPFS Storage Retrieval Widget and more..."})]})]})]})]})]})]})}));function tD(){return(tD=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{icon:t,...n}=e;return"string"==typeof t?(0,ec.tZ)("span",{...n,className:ew()(n.className,t)}):(0,ec.tZ)(t,{...n})}),tV=eo.memo(e=>{let{onClose:t,title:n,className:a,...i}=e;return(0,ec.BX)("div",{...i,className:ew()(" flex pb-5 justify-between border-b border-solid border-b-gray-16",a),children:[(0,ec.tZ)("div",{className:"text-black-3 text-lg",children:n}),(0,ec.tZ)("div",{className:"text-gray-12",children:(0,ec.tZ)(tQ,{icon:"cru-fo-x",className:" text-xl cursor-pointer",onClick:t})})]})}),tK=eo.memo(e=>{let{outClick:t,outClassname:n,className:a,children:i,...l}=e,r=null==document?void 0:document.getElementById("app-root");return r?(0,tJ.createPortal)((0,ec.tZ)("div",{onClick:t,className:ew()(n,"fixed left-0 top-0 w-screen h-screen z-40 bg-opacity-50 bg-black flex justify-center items-center"),children:(0,ec.tZ)("div",{...l,className:ew()(a," min-w-[27.5rem] p-5 bg-white text-black-1"),children:i})}),r):null});var tq=n(8193);let t_=eo.memo(e=>{let{onClose:t,className:n}=e;return(0,ec.tZ)(tQ,{className:ew()("absolute right-6 top-6 text-3xl font-bold cursor-pointer",n),onClick:t,icon:tq.SV5})});function t$(e){let{onClose:t}=e,[n,a]=(0,eo.useState)(0),[i,l]=(0,eo.useState)({Hash:""}),r=e=>{a(3),l(e)},s=e=>(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.tZ)("p",{className:"w-[24rem] text-black-3 text-2xl text-center mb-10",children:"Publishing & Uploading to IPFS Please wait..."}),(0,ec.tZ)(eY,{value:e})]});return(0,ec.tZ)(tK,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white flex min-h-[40.75rem] relative",children:[(0,ec.tZ)(t_,{onClose:()=>t&&t()}),(0,ec.BX)("div",{className:"bg-black w-80 text-white px-8 py-16 text-lg",children:[(0,ec.tZ)("div",{className:"mb-12 text-2xl font-medium",children:"IPFS File Storage Widget"}),3===n?(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 2:"}),(0,ec.tZ)("p",{className:"font-light",children:"When Upload process is completed, you will get an IPFS CID (unique identifier to your stored content) and a Storage Manager Tx No. (Tx No. for the IPFS storage action of your content)."})]}):(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 1:"}),(0,ec.tZ)("p",{className:"mb-5 font-light",children:"Drag and drop a file into the box."}),(0,ec.BX)("p",{className:"font-light",children:["When you finish, click on the ",(0,ec.tZ)("span",{className:"font-semibold",children:"'Upload'"})," button to continue."]})]})]}),(0,ec.tZ)("div",{className:"min-w-[50rem] flex justify-center items-center",children:3===n?(0,ec.BX)("div",{className:"text-center text-black-3 flex flex-col items-center",children:[(0,ec.tZ)(tQ,{className:"text-[3.125rem] text-black mb-4",icon:tq.KP3}),(0,ec.tZ)("div",{className:"text-[1.375rem] text-black font-semibold mb-4",children:"Publish successfully!"}),(0,ec.tZ)("p",{className:"mb-14 text-lg",children:"This content has been published and decentralized stored on IPFS."}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Your content's IPFS CID:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7 mb-8",children:i.Hash}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Storage Manager Tx No:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7",children:eK("0x69b9f8cf491b55c485dbb43a86a7e48f7649aa45c958cd245461d04c3146bd91",23,23)})]}):(0,ec.tZ)(tn,{uploadRender:s,onSuccess:r,uploadBorder:!1,className:"h-[29.937rem] w-[42.5rem]"})})]})})}var t0=n(7297),t1=n(18872),t2=n(40392),t5=n(86395);n(37640);var t3=n(96412),t4=n.n(t3),t6=n(4979),t8=n.n(t6),t7=n(31026),t9=n(378),ne=n(611),nt=n(49891),nn=n(84672),na=n(56073),ni=n(54340),nl=n(82874),nr=n(5705),ns=n(71265),nc=n(11033),no=n(31871),nd=n(78469),nm=n(55658),nu=n(78822),np=n(98584),ny=n(81373),nh=n(13848),nf=n(32085),ng=n(92003),nb=n.n(ng),nv=n(8605),nx=n(57375),nA=n(27353),nw=n(48764).lW;function nZ(){let e=(0,t0.Z)(['\n width: 100%;\n height: 100%;\n padding: 80px 24px 24px 24px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ol,\n ul {\n list-style: revert !important;\n margin: revert !important;\n padding: revert !important;\n }\n .remirror-editor-wrapper {\n padding-top: unset;\n border-radius: 0;\n border: 1px solid #dfe3e7 !important;\n outline: unset !important;\n overflow: auto;\n height: 447px;\n max-width: 872px;\n max-height: 447px;\n .ProseMirror {\n overflow: hidden;\n min-height: 100%;\n padding: "1rem";\n box-shadow: unset !important;\n pre {\n padding: ',";\n margin: 0;\n }\n .remirror-is-empty:first-of-type::before{\n font-style: normal !important;\n }\n }\n }\n"]);return nZ=function(){return e},e}function nk(){let e=(0,t0.Z)(["\n height: 72px !important;\n background-color: #f4f5f7 !important;\n padding: 24px !important;\n border: 1px solid #dfe3e7 !important;\n overflow: hidden !important;\n button {\n padding: unset !important;\n width: 24px !important;\n height: 24px !important;\n /* font-size: 22px; */\n margin-right: 18px !important;\n outline: unset !important;\n border: unset !important;\n background-color: transparent !important;\n }\n "]);return nk=function(){return e},e}async function nN(e){let t=await nA.J.digest(e);return nx.k0.createV0(t).toString()}let nT=eR.C5,nI=new Map,nC=(0,t1.iv)(nZ(),(0,t7.y2)("space",3)),nB=e=>{let{style:t,className:n,children:a}=e;return(0,ec.tZ)("div",{style:t,className:"".concat(nC," ").concat(n," w-full"),children:a})},nM={color:{primary:"#FC7823",primaryText:"#FC7823",outline:"transparent",background:"transparent",hover:{primary:"#FC7823",primaryText:"#FC7823"}},fontFamily:{default:"var(--work-sans)"}},nS=()=>(0,ec.BX)(t2.o8,{className:(0,t1.iv)(nk()),children:[(0,ec.tZ)(t2.pQ,{attrs:{level:1}}),(0,ec.tZ)(t2.pQ,{attrs:{level:2}}),(0,ec.tZ)(t2.pQ,{attrs:{level:3}}),(0,ec.tZ)(t2.Vu,{}),(0,ec.tZ)(t2.NV,{}),(0,ec.tZ)(t2.kj,{}),(0,ec.tZ)(t2.QD,{}),(0,ec.tZ)(t2.Om,{}),(0,ec.tZ)(t2.XR,{}),(0,ec.tZ)(t2.gf,{})]}),nE=e=>{let{placeholder:t="Please input text...",initialContent:n="",editorUpdate:a,onUpFinish:i}=e,l=(0,eo.useMemo)(()=>{let e=new ne.y5({autoLink:!0});return e.addHandler("onClick",(e,t)=>(console.log("You clicked link: ".concat(JSON.stringify(t))),!0)),e},[]);(0,eo.useRef)("");let[r,s]=(0,eo.useState)(""),[c,o]=(0,eo.useState)(""),[d,m]=(0,eo.useState)(!1),[u,p]=(0,eo.useState)(""),[y,h]=(0,eo.useState)(-1),f=(0,eo.useMemo)(()=>-1!==y?"uping":r?"finish":"edit",[y,r]),g=async()=>{let e=await nb()();if(e&&e.isMetaMask){await e.request({method:"eth_requestAccounts"});let t=new nv.Web3Provider(e),n=t.getSigner(),a=await n.getAddress(),i=await n.signMessage("You are signing this message for DEMO purpose only. Sign this message to prove you own this account and you will be able to publish your Web3 content.");return nw.from("eth-".concat(a,":").concat(i)).toString("base64")}return""},b=async(e,t)=>{try{let n=e8.Z.CancelToken.source();t&&t(0);let a=await e9({data:e,cancelToken:n.token,onProgress:t});return console.log(a),a}catch(i){console.error(i.message)}return null},v=async()=>{try{let e=await g();if(!e)return;let t=new FormData;t.append("file",c);let n=await b(t,e=>h(Math.round(99*e)));if(null===n){p("Cannot save markdown file."),m(!0),s("Save markdown failed.");return}let a=n.Hash;await te(a,"text.md"),s(a),h(-1),i&&i(n)}catch(l){console.error(l)}},x=e=>{let t=0,n=[];for(let{file:a,progress:i}of(console.info("files:",e),e))n.push(()=>new Promise((e,n)=>{let i=new FileReader;i.addEventListener("load",async l=>{console.log(a),t+=1,console.info("readed:",i.result);let r=await nN(new Uint8Array(i.result));console.info("imgKey:",r);let s=nI.get(r);if(!s){let c=new FormData;c.append("file",a,a.name);let o=await b(c);if(null!==o)try{await te(o.Hash,a.name);let d=await function(e){return new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e,n.loading="eager"})}("".concat(nT,"/ipfs/").concat(o.Hash));if(!d)throw"pre load error";s=o.Hash,nI.set(r,o.Hash)}catch(m){console.error(m)}}s?e({src:"".concat(nT,"/ipfs/").concat(s),fileName:a.name}):n()},{once:!0}),i.readAsArrayBuffer(a)}));return n},A=(0,eo.useCallback)(()=>{let e=document.createElement("div");return e.className="w-[100px] h-[100px] p-[30px]",tJ.render((0,ec.tZ)(ek,{}),e),e},[]),w=(0,eo.useCallback)(()=>[new nt.X({placeholder:t}),new nn.x({data:nf,plainText:!0}),l,new na.H({}),new ni.V,new nl.Gc({uploadHandler:x,createPlaceholder:A,enableResizing:!0}),new nr.f,new ns.e({}),new nc.V,new no.z,new nd.UQ({enableSpine:!0}),new nd._3,new nd.Jb({priority:t9.xV.High,enableCollapsible:!0}),new nm.l,new nu.W({supportedLanguages:[t4(),t8()]}),new np.F,new ny.g({copyAsMarkdown:!1}),new nh.h],[t]),{manager:Z}=(0,t5.iF)({extensions:w,stringHandler:"markdown",content:n}),k=e=>{var t;(null===(t=e.tr)||void 0===t?void 0:t.docChanged)&&(null==a||a(e)),console.info("p:",e.helpers.getMarkdown())};return(0,eo.useEffect)(()=>{let e=setInterval(()=>{o(Z.extensionStore.helpers.getMarkdown())},500);return()=>clearInterval(e)},[Z]),(0,ec.BX)(t2.f6,{as:nB,theme:nM,children:["edit"==f&&(0,ec.BX)(t5.O1,{manager:Z,autoFocus:!0,onBlur:k,onChange:k,children:[(0,ec.tZ)(nS,{}),(0,ec.tZ)(t5.PG,{}),(0,ec.tZ)("div",{className:"flex justify-center",children:(0,ec.tZ)(ej,{disabled:!c,className:"btn-173 mt-4",text:"Publish",onClick:v})})]}),"uping"==f&&(0,ec.BX)("div",{className:"mb-[3.5rem] font-WorkSans px-14 flex flex-col items-center",children:[(0,ec.tZ)("p",{className:"w-[24rem] text-black-3 text-2xl text-center mb-10",children:"Publishing & Uploading to IPFS Please wait..."}),(0,ec.tZ)(eY,{value:y})]}),"finish"==f&&(0,ec.tZ)(ec.HY,{children:(0,ec.BX)("div",{className:"mb-[3.5rem] text-center font-WorkSans text-black-3 flex flex-col items-center",children:[(0,ec.tZ)(tQ,{className:"text-[3.125rem] text-black mb-4",icon:tq.KP3}),(0,ec.tZ)("div",{className:"text-[1.375rem] text-black font-semibold mb-4",children:"Publish successfully!"}),(0,ec.tZ)("p",{className:"mb-14 text-lg",children:"This content has been published and decentralized stored on IPFS."}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Your content's IPFS CID:"}),(0,ec.tZ)("div",{className:"text-sm text-gray-7 mb-8",children:r}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Storage Manager Tx No:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7",children:eK("0x69b9f8cf491b55c485dbb43a86a7e48f7649aa45c958cd245461d04c3146bd91",23,23)})]})})]})};function nX(e){let{onClose:t}=e,[n,a]=(0,eo.useState)(0);return(0,ec.tZ)(tK,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white flex h-[40.75rem] relative",children:[(0,ec.tZ)(t_,{onClose:()=>t&&t()}),(0,ec.BX)("div",{className:"bg-black w-80 text-white px-8 py-16 text-lg",children:[(0,ec.tZ)("div",{className:"mb-12 text-2xl font-medium",children:"Rich-text Content Publisher Widget"}),0===n&&(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 1:"}),(0,ec.tZ)("p",{className:"mb-5 font-light",children:"Type in any text and try to do some simple edit work."}),(0,ec.BX)("p",{className:"font-light",children:["When you finish, click on the ",(0,ec.tZ)("span",{className:"font-semibold",children:"'Publish'"})," button to continue."]})]}),1===n&&(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 2:"}),(0,ec.tZ)("p",{className:"font-light",children:"When Publish and Upload processes are completed, you will get an IPFS CID (unique identifier to your stored content) and a Storage Manager Tx No. (Tx No. for the IPFS storage action of your content)."})]})]}),(0,ec.tZ)("div",{className:"min-w-[50rem] flex items-center justify-center",children:(0,ec.tZ)(nE,{onUpFinish:e=>e&&a(1)})})]})})}var nO=n(42820),nj=n(45843),nW=n(32226),nP=n(79166);let nL=eo.memo(e=>(0,ec.tZ)(nO.D,{children:e.code,linkTarget:"_blank",components:{h5(e){let{node:t,...n}=e;return(0,ec.tZ)("h5",{style:{fontSize:"18px",fontStyle:"normal"},...n})},code(e){let{node:t,inline:n,className:a,children:i,...l}=e,r=/language-(\w+)/.exec(a||"");return!n&&r?(0,ec.tZ)(nW.Z,{children:String(i).replace(/\n$/,""),style:nP.Z,language:r[1],PreTag:"div",...l}):(0,ec.tZ)("code",{className:a,...l,children:i})}},remarkPlugins:[nj.Z]}));function nY(e){let{onClose:t}=e;return(0,ec.tZ)(tK,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white min-w-[56rem] flex flex-col relative p-6",children:[(0,ec.BX)("div",{className:"flex justify-between items-center mb-6",children:[(0,ec.tZ)("a",{className:"text-2xl underline text-black-1",href:"https://docs.crustcloud.io",target:"_blank",children:"Dev Guidance"}),(0,ec.tZ)(t_,{className:"mt-[-0.3rem]",onClose:()=>t&&t()})]}),(0,ec.tZ)("div",{children:(0,ec.tZ)(nL,{code:"\n##### React:\n\n~~~jsx\nimport { MDEditor } from '@cloud3/react-widgets'\nexport default function App(){\n return(\n \n )\n}\n~~~\n \n \n\n##### Vue:\n\n~~~jsx\n\n\n~~~\n"})})]})})}function nR(e){let{onClose:t}=e;return(0,ec.tZ)(tK,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white min-w-[56rem] flex flex-col relative p-6",children:[(0,ec.BX)("div",{className:"flex justify-between items-center mb-6",children:[(0,ec.tZ)("a",{className:"text-2xl underline text-black-1",href:"https://docs.crustcloud.io",target:"_blank",children:"Dev Guidance"}),(0,ec.tZ)(t_,{className:"mt-[-0.3rem]",onClose:()=>t&&t()})]}),(0,ec.tZ)("div",{children:(0,ec.tZ)(nL,{code:"\n##### React:\n\n~~~jsx\nimport { DragStorage } from '@cloud3/react-widgets'\nexport function(){\n return(\n \n )\n}\n~~~\n \n \n\n##### Vue:\n~~~jsx\n\n\n~~~\n"})})]})})}let nD=eo.memo(()=>{let[e,t]=(0,eo.useState)(!1),[n,a]=(0,eo.useState)(!1),[i,l]=(0,eo.useState)(!1),[r,s]=(0,eo.useState)(!1);return(0,ec.BX)("div",{id:"widget",className:"w-full pb-20 pt-16 px-12 flex flex-col items-center justify-center text-black bg-[#F5F5F5]",children:[(0,ec.BX)("div",{className:"w-full max-w-[1112px] text-lg",children:[(0,ec.tZ)(eW,{className:"w-full mb-8",text:"Web3 Storage Widgets"}),(0,ec.tZ)("p",{className:"w-full text-left text-2xl text-black-3 mb-20",children:"Users should own their contents and take full control of them just like what they do to their assets, but they do not."}),(0,ec.BX)("div",{className:"flex justify-between",children:[(0,ec.BX)("div",{className:"w-[405px] flex flex-col items-center",children:[(0,ec.tZ)(tz,{}),(0,ec.tZ)("p",{className:"mt-14 text-black-3",children:"Web3 Content Widgets contains several easy-integrating, non-intrusive widges that helps Dapps to manage decentralized IPFS storage and give back content ownership to users."})]}),(0,ec.BX)("div",{className:"flex flex-col",children:[(0,ec.BX)("div",{className:"flex",children:[(0,ec.tZ)(tH,{}),(0,ec.BX)("div",{className:"ml-9",children:[(0,ec.tZ)("h5",{className:"font-semibold text-[1.375rem] mb-4",children:"Rich-text Content Publisher Widget"}),(0,ec.tZ)("p",{className:"w-[490px] text-black-3",children:"This widget contains a rich-text editor that can auto upload contents to IPFS alongside the publish process. "}),(0,ec.BX)("div",{className:"flex mt-5 text-black-1",children:[(0,ec.tZ)(ej,{onClick:()=>t(!0),className:"btn-173",text:"Play Demo"}),(0,ec.tZ)(ej,{onClick:()=>a(!0),className:"btn-173 ml-5",text:"Show Code"})]})]})]}),(0,ec.BX)("div",{className:"flex mt-20",children:[(0,ec.tZ)(tU,{className:"mt-2"}),(0,ec.BX)("div",{className:"ml-9",children:[(0,ec.tZ)("h5",{className:"font-semibold text-[1.375rem] mb-4",children:"IPFS File Storage Widget"}),(0,ec.tZ)("p",{className:"w-[490px] text-black-3",children:"This widget helps applications/dapps to upload files of general types to IPFS and manage file storage for their users. "}),(0,ec.BX)("div",{className:"flex mt-5 text-black-1",children:[(0,ec.tZ)(ej,{onClick:()=>l(!0),className:"btn-173",text:"Play Demo"}),(0,ec.tZ)(ej,{onClick:()=>s(!0),className:"btn-173 ml-5",text:"Show Code"})]})]})]})]})]})]}),e&&(0,ec.tZ)(nX,{onClose:()=>t(!1)}),n&&(0,ec.tZ)(nY,{onClose:()=>a(!1)}),i&&(0,ec.tZ)(t$,{onClose:()=>l(!1)}),r&&(0,ec.tZ)(nR,{onClose:()=>s(!1)})]})}),nz=()=>(0,ec.BX)("div",{className:"w-full",children:[(0,ec.tZ)(tB,{}),(0,ec.tZ)(tR,{}),(0,ec.tZ)(nD,{}),(0,ec.tZ)(ta,{}),(0,ec.tZ)(ty,{})]});var nG=n(38109);function nH(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auth",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,[a,i]=(0,eo.useState)(localStorage.getItem(e)||""),{signTypedDataAsync:l}=(0,nG.yw)(),{chain:r}=(0,nG.LN)(),s=r&&r.id;r&&r.unsupported;let{address:c}=(0,nG.mA)(),o=ep(async a=>{let r=localStorage.getItem(e)||"";if(!l||!c||!s)throw"not connect wallet";let o=eJ()().unix();if(t&&r){let d=JSON.parse(window.atob(r)).data;if(d.domain.chainId==="".concat(s)&&d.message.signingAddress===c&&d.message.tokenId===a&&(0===d.message.expirationTimestamp||d.message.expirationTimestamp-o>300))return i(r),r}let m=n<=0?0:eJ()().add(n,"hours").unix(),u={domain:{chainId:"".concat(s),name:"Cloud3.cc",verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",version:"1"},message:{description:"Sign for W3 Bucket Access Authentication",signingAddress:c,tokenAddress:eR.Jh,effectiveTimestamp:o,expirationTimestamp:m},primaryType:"W3Bucket",types:{W3Bucket:[{name:"description",type:"string"},{name:"signingAddress",type:"address"},{name:"tokenAddress",type:"address"},{name:"effectiveTimestamp",type:"uint256"},{name:"expirationTimestamp",type:"uint256"}]}};a&&(u.message.tokenId=a,u.types.W3Bucket.push({name:"tokenId",type:"string"})),await e2(800);let p=await l({domain:u.domain,types:u.types,value:u.message}),y=window.btoa(JSON.stringify({data:u,signature:p}));return localStorage.setItem(e,y),i(y),y});return[o,a]}function nF(){return nH("for_mint",!0,3)}function nU(){return nH("auth",!0,12)}var nJ=n(63750),nQ=n(86893);let nV=eo.memo(e=>{let{className:t,...n}=e;return(0,ec.tZ)("span",{...n,className:ew()(t," text-white font-SquadaOne text-[2.5rem]"),children:"Crust Cloud"})});var nK=n(82775);let nq=eo.memo(e=>{let{onClose:t}=e,{connectAsync:n,connectors:a,data:i}=(0,nG.$4)(),{switchNetworkAsync:l}=(0,nG.g0)(),r=(0,eC.s0)(),s=ep(async()=>{try{let e=await (async()=>{let e=await nb()();if(e&&e.isMetaMask){await e.request({method:"eth_requestAccounts"});let t=new nv.Web3Provider(e),n=t.getSigner(),a=await n.getChainId();if(eR.k0.has(a))return a}return console.warn("Cannot get chainId from provider or unsupported chain, use ".concat(eR.XL[0].id)),eR.XL[0].id})(),t=new nK.i({chains:[eR.k0.get(e)]});console.info("data:",i),console.info("cts:",a),(!i||i.chain.unsupported)&&l?await l(e):await n({chainId:e,connector:t}),r("/buckets")}catch(s){console.error(s)}});return(0,ec.BX)(tK,{outClick:t,children:[(0,ec.tZ)(tV,{title:"Connect Wallet",onClose:t}),(0,ec.BX)("div",{onClick:s,className:"bg-[#ececec] hover:bg-[#dfdfdf] h-14 mt-5 flex px-6 py-3 cursor-pointer justify-between items-center",children:[(0,ec.tZ)(tI,{className:" text-[1.75rem]"}),(0,ec.tZ)("div",{className:" text-black-1 text-sm",children:"MetaMask"}),(0,ec.tZ)("div",{className:" w-[1.75rem]"})]})]})});var n_=JSON.parse('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"BucketMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"EditionPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"EditionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITIONS_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_MAX_MINTABLE_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_TOKEN_ID_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"}],"name":"getBucketEditionPrices","outputs":[{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"activeOnly","type":"bool"}],"name":"getBucketEditions","outputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"},{"internalType":"uint256","name":"currentSupplyMinted","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEdition[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"prices","type":"tuple[]"}],"name":"setBucketEditionPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEditionParams[]","name":"editions","type":"tuple[]"}],"name":"setBucketEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]'),n$=JSON.parse('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"BucketMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"EditionPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"EditionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITIONS_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_MAX_MINTABLE_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_TOKEN_ID_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"}],"name":"getBucketEditionPrices","outputs":[{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"activeOnly","type":"bool"}],"name":"getBucketEditions","outputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"},{"internalType":"uint256","name":"currentSupplyMinted","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEdition[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"prices","type":"tuple[]"}],"name":"setBucketEditionPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEditionParams[]","name":"editions","type":"tuple[]"}],"name":"setBucketEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]');let n0=[];function n1(){let{chain:e}=(0,nG.LN)(),t=e&&e.id,{address:n}=(0,nG.mA)();return t&&((0,eR._D)(t),(t===eV.c.arbitrumGoerli.id||t===eV.c.arbitrum.id)&&(n0=n_),n0=n$),(0,eo.useMemo)(()=>n&&eR.k0.has(t),[n,t])}var n2=n(60155),n5=n(62313);let n3=eQ.TQ||eQ.Cg?"Claim your test version W3Bucket NFT and start your decentralized cloud storage experience on Crust Cloud testnet. To continue, please connect your Ethereum wallet and switch to Goerli testnet.":"W3Bucket runs on Ethereum mainnet. To start your decentralized cloud storage experience, please connect your Ethereum wallet.",n4=eo.memo(e=>{let{menuId:t,children:n,...a}=e,{address:i}=(0,nG.mA)(),{chain:l}=(0,nG.LN)(),r=n1(),s=(0,eo.useMemo)(()=>[{id:1,icon:nJ.QdO,text:"W3Buckets",path:"/buckets"},{id:2,icon:tT,text:"Settings",path:"/settings"},{id:3,icon:"cru-fo-homework",text:"Docs",url:"https://docs.crustcloud.io"}],[]),c=(0,eC.s0)(),[o,d]=(0,eo.useState)(!1);(0,eo.useEffect)(()=>{r&&d(!1)},[r]);let{disconnect:m}=(0,nG.qL)(),u=ep(()=>{m(),localStorage.removeItem("for_mint"),localStorage.removeItem("auth"),localStorage.removeItem("for_upload"),c("/buckets")}),p=(0,eo.useRef)(null),y=(0,n5.Z)(p);return(0,ec.tZ)("div",{...a,className:ew()(a.className," w-full h-screen min-h-max text-black-1"),children:(0,ec.BX)("div",{className:" w-full flex h-full",children:[(0,ec.BX)("div",{className:"h-full w-64 flex flex-col border-r-8 border-solid border-[#EEEEEE]",children:[(0,ec.BX)("div",{className:"my-8 flex items-center mx-auto",children:[(0,ec.tZ)(nV,{className:"text-black-1"}),r&&(0,ec.tZ)("div",{className:ew()(" ml-4 text-xs px-[0.39rem] py-[0.13rem] mb-[-0.42rem] text-white",eQ.TQ||eQ.Cg?"bg-gray-11":"bg-blue-2"),children:l.name.replace(" ","")})]}),(0,ec.tZ)("div",{className:"flex-1",children:s.map((e,n)=>(0,ec.BX)("div",{className:ew()(" pl-10 py-4 text-lg cursor-pointer ",{"bg-black-1":e.id===t,"text-white":e.id===t,"!text-gray-7 !bg-transparent":!r}),onClick(){r&&(e.path?c(e.path):e.url&&e_(e.url))},children:[(0,ec.tZ)(tQ,{icon:r?e.icon:n2.gMo,className:" text-2xl inline-block align-middle"}),(0,ec.tZ)("span",{className:"ml-3 align-middle",children:e.text})]},"menu_".concat(n)))}),(0,ec.tZ)(ej,{ref:p,className:ew()("w-[12.8125rem] h-[3.375rem] text-lg self-end mx-auto mb-10",{" hidden":!r}),onClick:u,text:y?"Disconnect":eK(i,6,6)})]}),r?n:(0,ec.BX)("div",{className:"flex-1 flex px-[15%] pt-[30vh] h-full flex-col items-center",children:[(0,ec.tZ)("div",{className:" text-xl text-black text-center",children:n3}),(0,ec.tZ)(ej,{text:"Connect Wallet",className:"mt-8",onClick:()=>d(!0)})]}),o&&(0,ec.tZ)(nq,{onClose:()=>d(!1)})]})})});var n6=n(89211),n8=n(69293);let n7=eo.memo(function(e){let{text:t,dropData:n,onChange:a,className:i}=e,[l,r]=(0,n6.Z)(!1),s=(0,eo.useRef)();(0,n8.Z)(s,()=>l&&r(!1));let c=e=>{r(!1),a&&a(e)};return(0,ec.BX)("div",{className:"text-black relative",ref:s,children:[(0,ec.tZ)(ej,{className:"btn-173",text:t,onClick:()=>r(!l)}),l&&(0,ec.tZ)("ul",{className:"text-black absolute w-full bg-white mt-3 border-1 border-gray-300 top-10 left-0 p-2 text-sm",children:n&&n.length>0&&n.map((e,t)=>(0,ec.BX)("li",{onClick:()=>c(e.value),className:"h-10 cursor-pointer leading-10 hover:bg-zinc-200 px-2 flex items-center",children:[e.icon&&(0,ec.tZ)(tQ,{icon:e.icon,className:"text-sm mr-3"}),e.text]},"dropdown".concat(t)))})]})}),n9=eo.memo(function(e){let{text:t,status:n,className:a}=e;return(0,ec.BX)("div",{className:ew()("flex items-center text-sm text-black border-1 h-14 w-full px-5","success"===n?"border-[#32CB9D] bg-green-50":"border-[#EF4C56] bg-rose-50"),children:[(0,ec.tZ)(tQ,{icon:"success"===n?tq.mny:tq.LHV,className:ew()("text-xl mr-3","success"===n?"text-[#32CB9D]":"text-[#EF4C56]")}),(0,ec.tZ)("span",{children:t})]})});function ae(){let{store:{currentGateway:e},oUpdate:t}=ex(),n=(0,eo.useMemo)(()=>e||function(){let e=localStorage.getItem("last_gateway"),t=eR.gi.find(t=>t.value===e);return(console.info("last-:",t),t)?t:eR.gi[0]}(),[e]),a=ep(e=>{t({currentGateway:e}),localStorage.setItem("last_gateway",e.value)});return{list:eR.gi,setCurrent:a,current:n}}function at(e){let{total:t,pgSize:n,pgNum:a,onChange:i,className:l}=e,r=Math.ceil(t/n),s=(0,eo.useMemo)(()=>r<=1?[]:r<=6?eF().range(r).map(e=>({name:"".concat(e+1)})):a<=3?eF().range(a+1).map(e=>({name:"".concat(e+1)})).concat([{name:"..."},{name:""+r}]):a>=r-2?[{name:"1"},{name:"..."}].concat(eF().range(a-2,r).map(e=>({name:"".concat(e+1)}))):(console.log([{name:"1"},{name:"..."},{name:a-1+""},{name:a+""},{name:a+1+""},{name:"..."},{name:r+""}]),[{name:"1"},{name:"..."},{name:a-1+""},{name:a+""},{name:a+1+""},{name:"..."},{name:r+""}]),[r,a]),c=()=>{i&&a{i&&a>1&&i(eF().toNumber(a-1))};return(0,ec.tZ)("div",{className:ew()("flex justify-center text-gray-400 text-sm mt-5",l),children:(0,ec.BX)("div",{className:"flex",children:[r>1&&(0,ec.tZ)("span",{onClick:o,className:"mr-8 cursor-pointer",children:"<"}),s.map((e,t)=>(0,ec.tZ)("div",{className:ew()({"text-black":e.name===""+a,omit:"..."===e.name},"mr-8 cursor-pointer"),onClick(){i&&"..."!==e.name&&i(eF().toNumber(e.name))},children:e.name},"key_page_".concat(t))),r>1&&(0,ec.tZ)("span",{onClick:c,className:"cursor-pointer",children:">"})]})})}var an=n(23395),aa=n(24762),ai=n(20640),al=n.n(ai);function ar(e){let t="https://api.crustcloud.io";return eQ.TQ&&(t="https://beta-api.crustcloud.io"),eQ.Cg&&(t="https://test-api.crustcloud.io"),"".concat(t).concat(e)}function as(e){let t="https://pin.crustcloud.io";return eQ.TQ&&(t="https://beta-pin.crustcloud.io"),eQ.Cg&&(t="https://test-pin.crustcloud.io"),"".concat(t).concat(e)}function ac(e){if(200===e.data.code)return e.data.data;throw{_type:"ResError",...e.data}}let ao=()=>{let{bucketId:e}=(0,eC.UO)(),t=(0,eC.s0)(),n="\n**Upload**\xa0file with the standard\xa0[IPFS API](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-add)\xa0and get the CID:\n\n~~~bash\ncurl -X POST 'https:///api/v0/add?pin=true' --header 'Authorization: Bearer ' --form 'path=@\"\"'\n~~~\n\n**Pin**\xa0the CID with the standard\xa0[IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec/#operation/addPin):\n\n~~~bash\ncurl -X POST '".concat(as("/psa/pins"),'\' --header \'Authorization: Bearer \' --data-raw \'{\n "cid": "",\n "name": ""\n}\'\n~~~\n');return(0,ec.BX)(ec.HY,{children:[(0,ec.BX)("div",{className:"sticky top-0 bg-white px-8 pt-16 flex items-center pb-5 mb-2 min-w-[62rem]",children:[(0,ec.tZ)(tQ,{icon:nJ.QdO,className:"text-xl mr-2"}),(0,ec.tZ)("span",{className:"mr-2 cursor-pointer",onClick(){t("/buckets")},children:"W3Buckets"}),(0,ec.tZ)(tQ,{icon:nQ.Tfp,className:"mr-2"}),(0,ec.tZ)("span",{children:"W3BUCKET(".concat(e,")")})]}),(0,ec.tZ)("div",{className:"px-8 pb-8 text-lg border-b-8 border-solid border-[#eeeeee] min-w-[62rem]",children:(0,ec.BX)("div",{className:" border border-black-1 border-solid px-8 pt-6 pb-5",children:[(0,ec.tZ)("div",{className:" text-xl font-medium",children:"Guidance on Storage"}),(0,ec.tZ)("div",{className:" my-4",children:"Files can be uploaded and decentralized pinned to IPFS by using this web interface, or by CLI as shown in the curl sample below."}),(0,ec.tZ)(nL,{code:n}),(0,ec.tZ)("div",{className:" mt-8 text-xl font-medium",children:"Get more references"}),(0,ec.BX)("div",{className:" mt-4 flex flex-wrap",children:[(0,ec.tZ)("a",{className:" underline text-black-1 mr-5",target:"_blank",href:"https://docs.crustcloud.io/w3bucket/aboutnft",children:"General Guidance on W3Bucket"}),(0,ec.tZ)("a",{className:" underline text-black-1 mr-5",target:"_blank",href:"https://docs.crustcloud.io/w3bucket/uploadfile",children:"Using APIs and W3Auth"})]})]})})]})},ad=e=>new Promise((t,n)=>{let a=localStorage.getItem(e+"_files");a?t(JSON.parse(a)):n()}),am=(e,t)=>new Promise(n=>{t&&localStorage.setItem(e+"_files",JSON.stringify(t)),n(!0)}),au=eo.memo(()=>{let{bucketId:e,ipnsId:t}=(0,eC.UO)(),[,n]=(0,eo.useMemo)(()=>e0(e),[e]),a=(0,eo.useRef)(null),i=(0,eo.useRef)(null),[l,r]=(0,eo.useState)({progress:0,status:"stop",errorMsg:""}),[s,c]=(0,eo.useState)(1),[o,d]=(0,eo.useState)(""),[m,u]=(0,eo.useState)(""),[p,y]=(0,eo.useState)([]),h=tt(),[f,g]=(0,eo.useState)(null),[b]=nH("for_upload",!1,1),[v]=nU(),x=(0,eC.s0)(),{address:A}=(0,nG.mA)();(0,eo.useMemo)(()=>{x("/buckets")},[A]),(0,tw.tf)(()=>{ad(e).then(e=>{y(e)}).catch(()=>{y([])})});let{current:w}=ae(),{value:Z}=(0,an.Z)(async()=>{let e=await e8.Z.request({method:"POST",params:{arg:t},url:"".concat(w.value,"/api/v0/name/resolve")}),n=await e8.Z.request({url:"".concat(w.value).concat(e.data.Path)});return n.data},[t]),{value:k}=(0,an.Z)(async()=>{let e=await v(),n=await e8.Z.request({headers:{Authorization:"Bearer ".concat(e)},method:"GET",url:ar("/auth/bucket/".concat(t))});return n.data.data},[t]),{fFiles:N,total:T}=(0,eo.useMemo)(()=>{let e=[];p&&(e=p);let t=eF().filter(e,e=>e.name.indexOf(m.trim())>-1);t=t.sort(function(e,t){return t.createTime-e.createTime});let n=eF().chunk(t,10),a=t.length;return{fFiles:n,total:a}},[m,p]);(0,eo.useEffect)(()=>{aa.Z.rebuild()},[p,N]),(0,eo.useMemo)(()=>{p&&p.length>0&&am(e,p)},[p]),(0,eo.useMemo)(()=>{if(Z&&Z.length){if(p){p.map(e=>{for(let t=0;t!t.has(e.cid)&&t.set(e.cid,1)))}else y(Z)}},[Z]);let I=()=>{a.current.value="",i.current.value=""},C=e=>{let t=e.target.files,a=0;if(!t.length)return!1;let i=!0;for(let l=0;l64){h.error("The file name cannot exceed 64 characters."),I(),i=!1;break}if(k){let{maxStorageSize:s,usedStorageSize:c}=k;if(a>s-c)return h.error("No enough space for this file/folder!"),I(),!1}if(!i)return!1;b(n).then(async e=>{try{let n=0,i=e8.Z.CancelToken.source();g(i),r({progress:0,status:"upload",errorMsg:""});let l=new FormData;if(1===t.length)l.append("file",t[0],t[0].name);else if(t.length>1){for(let s of t)l.append("file",s,s._webkitRelativePath||s.webkitRelativePath);n=1}I();let c=await e9({cancelToken:i.token,data:l,endpoint:w.value,authBasic:"Bearer ".concat(e),onProgress(e){r({progress:Math.round(99*e),status:"upload",errorMsg:""})}});g(null);let o="",d="";if("string"==typeof c){let m=c.replaceAll("}\n{","},{"),u=JSON.parse("[".concat(m,"]")),h=u.length-1;o=u[h].Hash,d=u[h].Name}else o=c.Hash,d=c.Name;if(!o||!d)return r({progress:0,status:"fail",errorMsg:""}),!1;let f=await e8.Z.request({data:{cid:o,name:d,meta:{gatewayId:1}},cancelToken:i.token,headers:{Authorization:"Bearer ".concat(e)},method:"POST",url:as("/psa/pins")}),{error:b}=f.data;if(b)return r({progress:0,status:"fail",errorMsg:b.details?b.details:""}),!1;r({progress:100,status:"success",errorMsg:""}),y(p.concat([{name:d,cid:o,fileSize:a,fileType:n,createTime:eJ()().format("X").valueOf(),isNew:!0}]))}catch(v){throw console.error(v),v}}).catch(e=>{console.log(e.toString()),I()})},B=e=>{"file"===e?a.current.click():"folder"===e&&i.current.click()},M=()=>{u(o)},S=e=>{let t=window.event||e;13==t.keyCode&&M()},E=()=>{"upload"===l.status&&f&&(f.cancel("stop"),g(null)),r({progress:0,status:"stop",errorMsg:""})};return(0,ec.BX)(n4,{menuId:1,children:[(0,ec.tZ)("div",{className:"flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:"relative",children:[(0,ec.tZ)(ao,{}),(0,ec.BX)("div",{className:"p-8 flex-1 text-lg v-full flex flex-col min-w-[62rem]",children:[(0,ec.BX)("div",{className:"sticky top-[6.5rem] bg-white w-full flex items-center z-10",children:[(0,ec.tZ)(n7,{dropData:[{text:"File",icon:nQ.tHe,value:"file"},{text:"Folder",icon:nQ.QoU,value:"folder"}],text:"Upload",onChange:B}),(0,ec.tZ)("input",{ref:a,type:"file",hidden:!0,onChange:C}),(0,ec.tZ)("input",{ref:i,type:"file",hidden:!0,webkitdirectory:"",directory:!0,onChange:C}),(0,ec.tZ)("span",{className:"ml-5",children:"Thunder Gateway Seattle, US"}),(0,ec.tZ)("div",{className:"flex-1"}),(0,ec.BX)("div",{className:"relative w-1/2 h-12 max-w-sm border-solid border-black-1 border rounded overflow-hidden",children:[(0,ec.tZ)("input",{className:"w-full h-full pl-5 pr-10 active:border-0",onKeyDown:S,onChange:e=>d(e.target.value)}),(0,ec.tZ)(tQ,{icon:nQ.jRj,className:"text-2xl absolute top-[0.7rem] right-2 cursor-pointer",onClick:M})]})]}),(0,ec.BX)("div",{className:"sticky top-36 bg-white py-4 flex items-center font-medium border-b-1 border-solid border-b-black-1 pt-5",children:[(0,ec.tZ)("div",{className:"flex-initial w-[25%] md:w-[20%] pl-3",children:"File Name"}),(0,ec.tZ)("div",{className:"flex-initial w-[20%] md:w-[25%]",children:"CID"}),(0,ec.tZ)("div",{className:"flex-initial w-[30%]",children:"Link"}),(0,ec.tZ)("div",{className:"flex-initial w-[10%]",children:"File Size"}),(0,ec.tZ)("div",{className:"flex-initial w-[15%]",children:"TimeStamp"})]}),(0,ec.tZ)("div",{className:" text-sm text-gray-6",children:N&&N[s-1]&&N[s-1].map((e,t)=>(0,ec.BX)("div",{className:ew()("flex items-center pt-4 pb-8",e.isNew?"text-gray-300":""),children:[(0,ec.tZ)("div",{className:"flex-initial w-[25%] md:w-[20%] pl-3",children:(0,ec.BX)("div",{className:"flex items-center pr-8",children:[(0,ec.tZ)("span",{className:"truncate","data-tip":e.name.length>20?e.name:"",children:e.name}),1===e.fileType&&(0,ec.tZ)(tQ,{className:"ml-2 min-w-[14px]",icon:nQ.QoU})]})}),(0,ec.tZ)("div",{className:"flex-initial w-[20%] md:w-[25%]",children:(0,ec.tZ)("span",{"data-tip":e.cid,"data-for":"cidColumn",children:eK(e.cid,10,10)})}),(0,ec.tZ)("div",{className:"flex-initial w-[30%] truncate pr-8","data-for":"linkColumn","data-tip":"".concat(eR.HE,"/ipfs/").concat(e.cid),children:"".concat(eR.HE,"/ipfs/").concat(e.cid)}),(0,ec.tZ)("div",{className:"flex-initial w-[10%]",children:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+e)return"0 B";let n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(t<0?0:t))," ").concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}(e.fileSize)}),(0,ec.tZ)("div",{className:"flex-initial w-[15%] text-gray-6",children:e.isNew?(0,ec.tZ)("span",{"data-tip":"The ".concat(0===e.fileType?"file":"folder"," has been successfully uploaded to your bucket. It takes several minutes to finalize the decentralized storage and IPNS update processes."),children:(0,ec.tZ)(tQ,{icon:nJ.kjE})}):eJ()(1e3*e.createTime).format("YYYY-MM-DD HH:mm:ss")})]},"files_".concat(t)))}),(0,ec.tZ)(at,{total:T,pgSize:10,pgNum:s,onChange(e){c(e)}})]})]})}),"stop"!==l.status&&(0,ec.BX)(tK,{children:[(0,ec.tZ)(tV,{title:"Upload File",onClose:E}),(0,ec.BX)("div",{className:"bg-white mt-5 flex py-3 cursor-pointer justify-between items-center h-20",children:["upload"===l.status&&(0,ec.tZ)(eY,{value:l.progress}),"success"===l.status&&(0,ec.tZ)(n9,{text:"Upload successful",status:l.status}),"fail"===l.status&&(0,ec.tZ)(n9,{text:l.errorMsg?l.errorMsg:"Upload fail",status:l.status}),"cancel"===l.status&&(0,ec.tZ)(n9,{text:"Upload cancel",status:"fail"})]})]}),(0,ec.tZ)(aa.Z,{id:"cidColumn",effect:"solid",isCapture:!0,delayHide:250,clickable:!0,getContent:e=>(0,ec.tZ)("div",{className:"flex items-center",children:(0,ec.BX)("div",{className:"inline-block w-[13rem] break-words",children:[e,(0,ec.tZ)(tQ,{className:"ml-2 cursor-pointer inline-block",onClick(){al()(e),h.success("copy success")},icon:nQ.C3L})]})})}),(0,ec.tZ)(aa.Z,{id:"linkColumn",effect:"solid",isCapture:!0,delayHide:250,clickable:!0,getContent:e=>(0,ec.tZ)("div",{className:"flex items-center",children:(0,ec.BX)("div",{className:"inline-block w-[15rem] break-words",children:[e,(0,ec.tZ)(tQ,{className:"ml-2 cursor-pointer inline-block",onClick(){al()(e),h.success("copy success")},icon:nQ.C3L})]})})})]})}),ap=eo.memo(e=>{let{text:t="Empty",empty_attr:n={},text_attr:a={},...i}=e;return(0,ec.BX)("div",{...i,className:ew()(i.className,"text-gray-7 flex flex-col items-center"),children:[(0,ec.tZ)(tC,{...n,className:ew()(" text-8xl",null==n?void 0:n.className)}),!!t&&(0,ec.tZ)("div",{...a,className:ew()(" text-2xl",a.className),children:t})]})}),ay=eo.memo(e=>{var t,n,a;let{data:i,className:l}=e,{chain:r}=(0,nG.LN)(),s=(0,eC.s0)(),c=(0,eo.useMemo)(()=>i.maxStorageSize/1024/1024/1024,[i]),o=(0,eo.useMemo)(()=>e3(c),[c]),d=(0,eo.useMemo)(()=>e3(i.usedStorageSize/1024/1024/1024,2),[i]),m=(0,eo.useMemo)(()=>e1(c,i.tokenId),[i,c]),u=()=>{s("/bucket/".concat(m,"/").concat(i.ipnsId))};return(0,ec.BX)("div",{className:ew()("h-min p-5 md:p-2 border border-solid border-black-1",l),children:[(0,ec.tZ)("img",{className:"w-full aspect-[360/531] object-contain",src:e4(i.metadata.image.replace("ipfs://",""))}),(0,ec.tZ)("div",{className:" text-lg font-semibold mt-[0.625rem] truncate",children:"W3BUCKET(".concat(m,")")}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Current Usage"}),(0,ec.BX)("div",{children:[(0,ec.tZ)("span",{className:"text-orange-15",children:d}),"/",o]})]}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Files"}),(0,ec.tZ)("div",{children:"".concat(i.fileCount," Files")})]}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Created"}),(0,ec.tZ)("div",{children:eJ()(1e3*i.mintTimestamp).format("YYYY-MM-DD")})]}),(0,ec.BX)("div",{className:"flex text-xs my-2 justify-between",children:[(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:(t=i.ipnsId,"".concat(eR.gi[0].value,"/ipns/").concat(t)),children:"IPNS Link"}),(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:(n=r.id,a=eR.Jh,"".concat(e5(n),"/address/").concat(a)),children:"View NFT Contract"}),(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:e4(i.metadataCid),children:"View Metadata"})]}),(0,ec.tZ)(ej,{onClick:u,className:"!w-full mt-[2px] text-lg !py-1",text:"Enter W3Bucket"})]})}),ah=eo.memo(()=>{let e=n1(),{address:t}=(0,nG.mA)(),[n]=nU(),{value:a,loading:i}=(0,an.Z)(async()=>{if(!e||!t)return[];let a=await n(),i=await e8.Z.get(ar("/auth/bucket/list"),{headers:{Authorization:"Bearer ".concat(a)}});return ac(i).sort(function(e,t){return t.mintTimestamp-e.mintTimestamp})},[e,t]),l=(0,eC.s0)(),r=(0,eo.useCallback)(()=>l("/mint"),[l]);return(0,ec.tZ)(n4,{menuId:1,children:(0,ec.BX)("div",{className:"flex-1 h-full overflow-y-auto",children:[(0,ec.BX)("div",{className:"px-8 relative pb-8",children:[(0,ec.BX)("div",{className:"sticky top-0 pt-10 bg-white ",children:[(0,ec.BX)("div",{className:" w-full flex justify-between pb-5 whitespace-nowrap ",children:[(0,ec.BX)("div",{className:" inline-block text-2xl self-center font-medium h-min",children:["Your W3Buckets(",(null==a?void 0:a.length)||0,")"]}),(0,ec.tZ)(ej,{className:"whitespace-nowrap w-max",text:"Mint a New W3Bucket",onClick:r})]}),(0,ec.tZ)("div",{className:"h-5 border-t-1 border-solid border-black-1"})]}),a&&!i&&(0,ec.tZ)("div",{className:ew()("w-full overflow-y-auto gap-5 grid grid-cols-[repeat(auto-fill,_minmax(305px,_1fr))]",a.length<3?"grid-cols-[repeat(auto-fill,_minmax(310px,310px))]":""),children:a.map((e,t)=>(0,ec.tZ)(ay,{data:e},"bucket_".concat(t)))})]}),!i&&1>(0,eH.size)(a)&&(0,ec.tZ)(ap,{text:"No Buckets",className:" h-[calc(100%_-_11rem)] justify-center"}),i&&(0,ec.tZ)(eN,{className:" h-[calc(100%_-_11rem)] justify-center"})]})})});function af(e){return(0,ec.tZ)("svg",{width:"1em",height:"1em",viewBox:"0 0 11 9",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,ec.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.4496 2.29301C10.8401 1.90248 10.8401 1.26932 10.4496 0.878796C10.0591 0.488271 9.42591 0.488271 9.03538 0.878796L4.08564 5.82854L1.96432 3.70722C1.57379 3.3167 0.940626 3.3167 0.550102 3.70722C0.159577 4.09775 0.159577 4.73091 0.550102 5.12144L3.37853 7.94986C3.76905 8.34039 4.40222 8.34039 4.79274 7.94986L10.4496 2.29301Z"})})}let ag=eo.memo(e=>{let{finish:t,active:n,text:a,type:i}=e;return(0,ec.BX)("div",{className:" flex-1",children:[(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)("div",{className:ew()(" flex-1 h-[2px] ",{"bg-orange-15":(n||t)&&"left"!==i,"bg-gray-16":!(n||t)&&"left"!==i})}),(0,ec.tZ)("div",{className:ew()(" w-4 h-4 rounded-lg bg-white flex items-center justify-center",{" !bg-orange-15":n||t}),children:t?(0,ec.tZ)(af,{className:"text-xs relative text-white"}):(0,ec.tZ)("div",{className:ew()(" w-2 h-2 rounded bg-gray-16",{" !bg-white":n})})}),(0,ec.tZ)("div",{className:ew()(" flex-1 h-[2px] ",{"bg-orange-15":t&&"right"!==i,"bg-gray-16":!t&&"right"!==i})})]}),(0,ec.tZ)("div",{className:ew()("text-center text-gray-8 mt-2",{" !text-orange-15":n}),children:a})]})}),ab=eo.memo(e=>{let{data:t,current:n}=e;return(0,ec.tZ)("div",{className:" flex",children:t.map((e,a)=>(0,ec.tZ)(ag,{text:e,type:0===a?"left":a===t.length-1?"right":"mid",finish:a{n?t({mintData:av}):t(t=>{let{mintData:n}=t;return{mintData:{...n||av,..."function"==typeof e?e(n):e}}})},[t]);return(0,eo.useMemo)(()=>[e,n],[e,n])}function aA(e){return e.map(e=>e.fmtPrice+" "+e.symbol).join(" or ")}let aw=eo.memo(e=>{let{editions:t,onNext:n}=e,{chain:a}=(0,nG.LN)(),i=a&&a.id,[l,r]=ax();(0,eo.useEffect)(()=>{void 0===l.editionId&&t.length&&r({chainId:i,editionId:t[0].id,price:t[0].prices[0]})},[l,r,t]);let s=l.editionId,c=(0,eo.useMemo)(()=>t.find(e=>e.id===s),[t,s]);return(0,ec.BX)("div",{className:" px-10 pt-9",children:[(0,ec.BX)("div",{className:" text-2xl",children:["Now you are starting to mint a new W3Bucket!",(0,ec.tZ)("br",{}),"First, choose your preferred bucket type:"]}),(0,ec.tZ)(ej,{text:"W3Bucket",disHover:!0,className:" !border-2 !border-orange-15 !text-orange-15 text-2xl py-[9px] !w-[11.25rem] mt-5"}),(0,ec.tZ)("div",{className:" text-2xl mt-12",children:"Select your preferred bucket size:"}),(0,ec.tZ)("div",{className:"flex items-center mt-5",children:t.map((e,t)=>(0,ec.BX)("div",{className:ew()("mr-4 text-center"),children:[(0,ec.tZ)(ej,{text:e3(e.capacityInGb),disHover:e.id===s,className:ew()(" font-medium !border-2 text-2xl mt-5 !w-[11.25rem] py-[9px] cursor-pointer",{"!border-orange-15 !text-orange-15":e.id===s}),onClick(){r({chainId:i,editionId:e.id,price:e.prices[0]})}}),(0,ec.tZ)("span",{className:" whitespace-nowrap text-sm mt-2 font-light",children:"".concat(aA(e.prices))})]},"editions_".concat(t)))}),c&&(0,ec.BX)("div",{className:" text-2xl mt-12",children:["Your W3Bucket NFT to be minted:"," ",(0,ec.tZ)("span",{className:" text-orange-15",children:"W3Bucket"}),","," ",(0,ec.tZ)("span",{className:" text-orange-15",children:e3(c.capacityInGb)}),(0,ec.tZ)("br",{}),"Payable: ",aA(c.prices)]}),(0,ec.tZ)(ej,{text:"Next Step",className:"mt-12 text-lg !w-[11.25rem] !h-[3.375rem]",onClick(){console.info("click:"),n()},disabled:!c})]})});var aZ=n(61501);let ak=["A-b1","A1","A2"],aN=eo.memo(e=>{let{type:t,value:n,...a}=e;return n?(0,ec.BX)("div",{...a,children:["A1"===t&&(0,ec.tZ)(aZ.QRNormal,{value:n}),"A2"===t&&(0,ec.tZ)(aZ.QRNormal,{value:n,type:"round",posType:"round"}),"A3"===t&&(0,ec.tZ)(aZ.QRNormal,{value:n,type:"rand",posType:"planet"}),"A-a1"===t&&(0,ec.tZ)(aZ.QRLine,{value:n,direction:"h-v",posType:"roundRect"}),"A-a2"===t&&(0,ec.tZ)(aZ.QRLine,{value:n,direction:"cross",posType:"rect"}),"A-b1"===t&&(0,ec.tZ)(aZ.QRFunc,{value:n,type:"round",posType:"round"}),"A-b2"===t&&(0,ec.tZ)(aZ.QRFunc,{value:n,type:"round",posType:"round",funcType:"B"}),"C1"===t&&(0,ec.tZ)(aZ.QRImage,{value:n,size:150}),"C2"===t&&(0,ec.tZ)(aZ.QRResImage,{value:n,alignType:"bw",timingType:"bw"}),"SP-1"===t&&(0,ec.tZ)(aZ.QRDsj,{value:n}),"SP-2"===t&&(0,ec.tZ)(aZ.QRRandRect,{value:n}),"SP-3"===t&&(0,ec.tZ)(aZ.QRBubble,{value:n})]}):null}),aT={gray:["#EEEEEE","#FFFFFF","#131521"],yellow:["#FFDC5E","#E9C132","#131521"],red:["#FF6B81","#F4526A","#131521"],purple:["#B073EF","#925DC8","#FFFFFF"],green:["#27C282","#1EA966","#FFFFFF"],blue:["#58AEFF","#3895EB","#FFFFFF"]},aI=eo.memo(eo.forwardRef((e,t)=>{let{size:n}=e,[{color:a,qrcode:i,ipns:l}]=ax(),[r,s,c]=aT[a];return(0,ec.BX)("div",{ref:t,id:"generate_bucket_image",className:" w-[22.5rem] h-[33.1875rem] relative p-6 flex flex-col justify-between",style:{backgroundColor:r},children:[(0,ec.BX)("div",{className:"flex items-center",style:{color:c},children:[(0,ec.tZ)("div",{className:"p-[3px] overflow-hidden rounded-xl",style:{backgroundColor:s},children:(0,ec.tZ)(tC,{style:{fontSize:"2.1875rem"}})}),(0,ec.tZ)("span",{className:" font-Roboto text-3xl font-medium ml-[0.625rem]",children:"W3BUCKET"})]}),l?(0,ec.tZ)(nJ.gHS,{className:" text-[18.75rem]",style:{color:s}}):(0,ec.tZ)(nJ.QdO,{className:" text-[18.75rem]",style:{color:s}}),(0,ec.tZ)("div",{className:" font-bold text-end",style:{color:c},children:e3(n)}),(0,ec.tZ)(aN,{value:l,type:i,className:" w-[11.5rem] h-[11.5rem] absolute left-[5rem] bottom-[7.4rem]"})]})}));var aC=n(46293);function aB(e){let{ipns:t,onContinue:n}=e,[a,i]=(0,eo.useState)(!1);return(0,ec.BX)("div",{className:"pl-12 flex-1 break-words",children:[(0,ec.BX)("div",{className:"p-8 border-solid border-black-1 border flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-xl mb-4",children:"Tip:"}),(0,ec.BX)("div",{className:"text-lg",children:["This is the QR Code of the"," ",(0,ec.tZ)("span",{className:"font-semibold",children:"IPNS name"})," for this W3Bucket. This IPNS name is a ",(0,ec.tZ)("span",{className:"font-semibold",children:"unique"})," and"," ",(0,ec.tZ)("span",{className:"font-semibold",children:"immutable"})," identifier on IPFS that ",(0,ec.tZ)("span",{className:"font-semibold",children:"permanently"})," points to the storage history (a .json file, also acts as the list of the bucket storage) of this W3Bucket."]}),(0,ec.tZ)("div",{className:"text-lg mt-7",children:"You can always fetch the storage history via any IPFS gateway or IPFS node."}),(0,ec.tZ)(ej,{text:"Got it",className:" mt-8 !w-[8.25rem] h-11 self-center",onClick:()=>i(!0)})]}),a&&(0,ec.BX)("div",{className:" mt-10 text-lg flex flex-col",children:[(0,ec.tZ)("div",{className:" break-all text-center",children:t}),(0,ec.tZ)("div",{className:" font-medium text-center",children:"The IPNS name for this W3Bucket has successfully generated and published to IPFS."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-6 !w-[8.25rem] h-11 self-center",onClick:n})]})]})}function aM(e){let t=eF().keys(aT),{onContinue:n}=e,[a,i]=ax();return(0,ec.BX)("div",{className:"px-20 flex-1 flex flex-col justify-center",children:[(0,ec.BX)("div",{className:"flex",children:[(0,ec.tZ)("div",{className:" whitespace-nowrap mr-10 mt-3",children:"Background Color"}),(0,ec.tZ)("div",{className:" flex flex-wrap items-center",children:t.map(e=>(0,ec.tZ)("div",{style:{backgroundColor:aT[e][0]},onClick:()=>i({color:e}),className:ew()("rounded-xl w-5 h-5 overflow-hidden cursor-pointer mr-[1.875rem] my-4",{"border-solid border-orange-15 border":a.color===e})},"mint_colors_".concat(e)))})]}),(0,ec.BX)("div",{className:"flex mt-8",children:[(0,ec.tZ)("div",{className:" mr-16 whitespace-nowrap",children:"QR Code Style"}),(0,ec.tZ)("div",{className:"flex items-center flex-wrap",children:ak.map(e=>(0,ec.tZ)("span",{onClick:()=>i({qrcode:e}),className:ew()(" whitespace-nowrap rounded-md px-2 py-1 overflow-hidden cursor-pointer mr-[1rem] bg-slate-50",{"border-solid border-orange-15 border":a.qrcode===e}),children:e},"mint_colors_".concat(e)))})]}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-16 !w-[11.25rem] !py-3 self-center",onClick:n})]})}function aS(e){let{data:[t,n]}=e;return(0,ec.BX)(ec.HY,{children:[(0,ec.BX)("div",{className:" text-sm mt-4",children:[t,":"]}),(0,ec.tZ)("div",{className:" text-sm text-gray-7",children:n})]})}function aE(e){let{onContinue:t}=e,[n,a]=ax(),[i,l]=eu(!1),[r]=nF(),[,s]=ey(),c=ed(),o=ep(async()=>{i||s(async()=>{try{l(!0),await e2(100);let e=document.getElementById("generate_bucket_image");if(!e)return l(!1);let t=await r(),i=await (0,aC.SE)(e),s=new FormData;s.append("file",i,"bucket_image.png");let o=await e9({data:s});await te(o.Hash,"bucket_image.png");let d=await e8.Z.post(ar("/auth/bucket/metadata/generate"),{uuid:n.uuid,cid:o.Hash},{headers:{Authorization:"Bearer ".concat(t)}}),m="success"===d.data.message;if(!m)throw d.data.message;let u=null;for(;c.safe&&(await e2(1e4),!(u=await e8.Z.get(ar("/auth/bucket/uuid/".concat(n.uuid)),{headers:{Authorization:"Bearer ".concat(t)}}).then(ac).catch(()=>null))||!u.metadataTxHash););if(!c.safe)return;a({metadata:u.metadata,metadataCID:u.metadataCid,metadataTX:u.metadataTxHash})}catch(p){console.error(p)}l(!1)})}),[d,m]=eu(!1);return(0,ec.BX)(ec.HY,{children:[!n.metadata&&!i&&(0,ec.BX)("div",{className:"px-12 flex-1 flex flex-col items-center justify-center",children:[(0,ec.tZ)("div",{className:" text-2xl text-center",children:"The metadata file (including this profile image) for your W3Bucket NFT has been fully generated. Click the Continue button to process decentralized storage for the metadata."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-8 !w-[11.25rem] !py-3 self-center",onClick:o})]}),i&&(0,ec.tZ)(eN,{className:"px-12 flex-1 justify-center",text:"The NFT metadata is being decentralized stored and it will be the very first file stored in this W3Bukcet! Please wait..."}),n.metadata&&!i&&(0,ec.BX)("div",{className:"px-12 flex-1 flex flex-col items-center",children:[(0,ec.BX)("div",{className:"p-8 w-full border-solid border-black-1 border flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-xl mb-4",children:"Tip:"}),(0,ec.BX)("div",{className:"flex",children:[(0,ec.BX)("div",{className:"flex-1 mr-8",children:[(0,ec.tZ)("div",{className:"font-semibold text-lg",children:"NFT Metadata.json file"}),(0,ec.tZ)(aS,{data:["IPFS CID",eK(n.metadataCID,10,10)]}),(0,ec.tZ)(aS,{data:["Crust Network Storage Order TXID",eK(n.metadataTX,10,10)]}),(0,ec.tZ)(aS,{data:["IPNS",eK(n.ipns,10,10)]}),(0,ec.tZ)(aS,{data:["Storage Protocol","Crust"]})]}),(0,ec.BX)("div",{className:"flex-1",children:[(0,ec.tZ)("div",{className:"font-semibold text-lg",children:"NFT profile image"}),(0,ec.tZ)(aS,{data:["IPFS CID",eK(n.metadata.image.replace("ipfs://",""),10,10)]}),(0,ec.tZ)(aS,{data:["Crust Network Storage Order TXID",eK(n.metadata.dStorage.dstorage_note,10,10)]}),(0,ec.tZ)("div",{className:" text-sm font-medium mt-6",children:"You can check them later in the W3Bucket description information."}),(0,ec.tZ)(ej,{text:"Got it",className:" mt-3 !w-[8.25rem] h-11 self-center",onClick:()=>m(!0)})]})]})]}),d&&(0,ec.BX)("div",{className:" mt-10 text-lg flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-center",children:"Congrats! The metadata of this W3Bucket is fully processed. You will soon get this truly Web3 storage bucket NFT! Click the Continue button to the last step."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-6 !w-[8.25rem] h-11 self-center",onClick:()=>t()})]})]})]})}let aX=eo.memo(e=>{let{editions:t,onNext:n}=e,[a,i]=ax(),l=a.editionId,r=(0,eo.useMemo)(()=>t.find(e=>e.id===l)||t[0],[t,l]),[s,c]=eu(0),o=(0,eo.useCallback)(()=>c(e=>e+1),[c]),d=a.ipns,[m]=nF(),[,u]=ey();return(0,eo.useEffect)(()=>{d?a.metadataTX?c(3):d&&c(e=>0===e?1:e):u(()=>m().then(e=>e8.Z.post(ar("/auth/ipns/gen"),{bucketInfo:JSON.stringify({chainId:a.chainId,editionId:a.editionId})},{headers:{Authorization:"Bearer ".concat(e)}}).then(ac)).then(e=>{i({ipns:e.ipnsId,uuid:e.uuid}),c(1)}).catch(e=>{console.info("error:",e),n(-1)}))},[d,a]),(0,ec.BX)("div",{className:" px-10 pt-9 flex",children:[(0,ec.tZ)(aI,{size:r.capacityInGb}),0===s&&(0,ec.tZ)(eN,{className:" self-center text-center p-9",text:"Generating a unique IPNS name for this W3Bucket... Please wait."}),1===s&&(0,ec.tZ)(aB,{ipns:d,onContinue:o}),2===s&&(0,ec.tZ)(aM,{onContinue:o}),3===s&&(0,ec.tZ)(aE,{onContinue:n})]})});function aO(){let e=(0,nG.yL)(),{data:t}=(0,nG.mx)();return(0,nG.cq)({address:eR.Jh,abi:n0,signerOrProvider:t||e})}var aj=n(61744),aW=n(2984);function aP(e){let{data:[t,n,a],target:i="_blank"}=e;return(0,ec.BX)("div",{className:" flex items-center text-2xl",children:[(0,ec.BX)("div",{className:" mr-2",children:[t,":"]}),a?(0,ec.tZ)("a",{className:" underline underline-offset-2 !text-black-1",target:i,href:a,children:n}):(0,ec.tZ)("div",{className:" underline underline-offset-2",children:n})]})}let aL=eo.memo(e=>{var t,n;let{editions:a,onNext:i}=e,{chain:l}=(0,nG.LN)(),r=l&&l.id,[s,c]=ax(),o=s.editionId,d=(0,eo.useMemo)(()=>a.find(e=>e.id===o),[a,o]),[m,u]=eu(!1),p=aO(),{data:y}=(0,nG.mx)(),{address:h}=(0,nG.mA)(),[f]=nF(),g=ed(),b=ep(async()=>{if(m||!p||!h||!s.price||!s.editionId||!y)return;u(!0);let e=aj.parseUnits(s.price.fmtPrice,s.price.decimals);try{let t=await f(),n="0x0000000000000000000000000000000000000000"===s.price.currency,a=null;if(n)a=await p.mint(h,aj.parseUnits(s.editionId+"",0),s.price.currency,"ipfs://".concat(s.metadataCID),{value:e});else{let l=(0,aW.uN)({address:s.price.currency,abi:aW.em,signerOrProvider:y}),r=await p.estimateGas.mint(h,aj.parseUnits(s.editionId+"",0),s.price.currency,"ipfs://".concat(s.metadataCID)).catch(()=>aj.parseUnits("396277",0));await l.approve(eR.Jh,e),a=await p.mint(h,aj.parseUnits(s.editionId+"",0),s.price.currency,"ipfs://".concat(s.metadataCID),{gasLimit:r})}await a.wait(1);let o=null;for(;;){if(!g.safe)return;if((o=await e8.Z.get(ar("/auth/bucket/uuid/".concat(s.uuid)),{headers:{Authorization:"Bearer ".concat(t)}}).then(ac).catch(()=>null))&&o.tokenId&&o.mintTxHash)break;await e2(1e4)}c({mintTx:o.mintTxHash,tokenId:o.tokenId}),i()}catch(d){console.error(d)}u(!1)}),v=(0,eC.s0)(),x=ep(()=>{c({},!0),v("/buckets")}),A=(0,eo.useMemo)(()=>s.mintTx&&d&&s.tokenId?e1(d.capacityInGb,s.tokenId):"",[s,d]);return(0,ec.BX)("div",{className:" px-10 pt-9 flex",children:[(0,ec.tZ)(aI,{size:d.capacityInGb}),!m&&!s.mintTx&&(0,ec.BX)("div",{className:"flex flex-1 px-12 flex-col items-center justify-center",children:[(0,ec.tZ)("div",{className:" text-2xl text-center",children:"Choose your preferred payment method and click the ‘Confirm and Pay’ button to proceed:"}),(0,ec.tZ)("div",{className:" flex ",children:d.prices.map((e,t)=>{var n,a;return(0,ec.BX)("div",{className:ew()("mr-4 text-center"),children:[(0,ec.tZ)(ej,{text:e.symbol,disHover:e.currency===(null===(n=s.price)||void 0===n?void 0:n.currency),className:ew()("font-medium !border-2 text-2xl mt-5 !w-[11.25rem] !py-[9px] cursor-pointer",{"!border-orange-15 !text-orange-15":e.currency===(null===(a=s.price)||void 0===a?void 0:a.currency)}),onClick(){c({price:e})}}),(0,ec.tZ)("span",{className:" text-sm mt-2 font-light whitespace-nowrap",children:"".concat(e.fmtPrice," ").concat(e.symbol," payable in 15 min")})]},"edition_price_".concat(t))})}),(0,ec.tZ)(ej,{text:"Confirm and Pay",className:"mt-12 text-lg w-48 h-[3.375rem]",onClick:b})]}),m&&(0,ec.tZ)(eN,{className:"flex-1 px-12 justify-center",text:"Payment Tx sent, please wait for a while to get on-chain confirmation..."}),!m&&s.mintTx&&(0,ec.BX)("div",{className:"flex flex-1 px-12 flex-col ",children:[(0,ec.BX)("div",{className:" text-2xl font-medium mb-8",children:["Congrats,",(0,ec.tZ)("br",{}),"You have completed all the minting processes for this W3Bucket NFT!"]}),(0,ec.tZ)(aP,{data:["W3Bucket NFT Token ID",s.tokenId,(t=s.tokenId,"".concat(e5(r),"/token/").concat(eR.Jh,"?a=").concat(t))]}),(0,ec.tZ)(aP,{data:["Mint TX ID",eK(s.mintTx,9,5),(n=s.mintTx,"".concat(e5(r),"/tx/").concat(n))]}),(0,ec.tZ)(aP,{target:"_self",data:["W3Bucket Identifier",A,"/#/bucket/".concat(A,"/").concat(s.ipns)]}),(0,ec.tZ)("div",{className:" text-2xl font-medium mt-8",children:"Return to the W3Bucket Home Page and start your Crust Cloud journey. Bon Voyage!"}),(0,ec.tZ)(ej,{text:"Complete",className:" self-center text-lg !w-[11.25rem] h-[3.375rem] mt-20",onClick:x})]})]})}),aY=eo.memo(()=>{let{value:e,loading:t}=function(){let e=aO(),{chain:t}=(0,nG.LN)(),n=t&&t.id,{data:a}=(0,nG.mx)(),i=(0,an.Z)(async()=>{if(e&&n&&a){let t=await e.getBucketEditions(!0);console.info("data:",t);let i=[];for(let l of t){if(l.maxMintableSupply.lte(l.currentSupplyMinted))continue;let r=await e.getBucketEditionPrices(l.editionId);console.info("prices:",r);let s=[];for(let c of r){let o=18,d="ETH";if("0x0000000000000000000000000000000000000000"!==c.currency){let m=(0,aW.uN)({address:c.currency,abi:aW.em,signerOrProvider:a});o=await m.decimals(),d=await m.symbol()}s.push({currency:c.currency,symbol:d,decimals:o,price:c.price.toString(),fmtPrice:aj.formatUnits(c.price,o)})}console.info("mprices:",s),s.length>=1&&i.push({id:l.editionId.toNumber(),capacityInGb:l.capacityInGigabytes.toNumber(),totalSupply:l.maxMintableSupply.toNumber(),minted:l.currentSupplyMinted.toNumber(),prices:s})}return console.info("editions:",i),i}return null},[e,n,a]);return(0,eo.useMemo)(()=>({...i,loading:i.loading}),[i])}(),n=(0,eC.s0)(),a=(0,eo.useMemo)(()=>["1.Select your preferred bucket","2.Process NFT metadata","3.Make payment and mint"],[]),[i,l]=eu(-1),[r,s]=ax(),[c]=nF();(0,eo.useEffect)(()=>{let e=async()=>{try{if(console.info("do taks:"),!r.uuid)return l(0);let e=await c(),t=await e8.Z.get(ar("/auth/bucket/uuid/".concat(r.uuid)),{headers:{Authorization:"Bearer ".concat(e)}}).then(ac),n=r.editionId;if(t.metadata){let a=t.metadata.attributes.find(e=>"Edition"===e.trait_type);a&&(n=new Number(a.value).valueOf())}s({metadata:t.metadata,ipns:t.ipnsId,metadataTX:t.metadataTxHash,metadataCID:t.metadataCid,mintTx:t.mintTxHash,tokenId:t.tokenId,editionId:n}),t.mintTxHash?l(2):t.metadataTxHash?l(1):l(0)}catch(i){l(0)}};return e(),()=>{s({},!0)}},[]);let o=(0,eo.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return l(t=>t+e)},[l]),{address:d}=(0,nG.mA)();return(0,eo.useEffect)(()=>{d&&(s({},!0),l(0))},[d]),(0,ec.tZ)(n4,{menuId:1,children:(0,ec.tZ)("div",{className:" flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:" relative px-8 pb-10",children:[(0,ec.BX)("div",{className:" sticky top-0 z-10 bg-white pt-16 pb-3",children:[(0,ec.tZ)("div",{className:"inline-block",onClick(){s({},!0),n("/buckets")},children:(0,ec.BX)("div",{className:"flex items-center cursor-pointer",children:[(0,ec.tZ)(tQ,{icon:"cru-fo-chevron-left",className:" mr-3"}),(0,ec.tZ)("span",{children:"Exit Mint Process"})]})}),(0,ec.tZ)("div",{className:"h-px bg-black-1 my-7"}),(0,ec.tZ)(ab,{data:a,current:i})]}),e&&(0,ec.BX)(ec.HY,{children:[0===i&&!t&&(0,ec.tZ)(aw,{editions:e,onNext:o}),1===i&&(0,ec.tZ)(aX,{editions:e,onNext:o}),i>=2&&(0,ec.tZ)(aL,{editions:e,onNext:o})]}),(t||i<0)&&(0,ec.tZ)(eN,{className:" text-black-1 justify-center h-[calc(100vh_-_17.75rem)]"})]})})})}),aR=eo.memo(e=>{let{options:t,current:n,perfix:a,className:i,onOptionChange:l,...r}=e,s=(0,eo.useMemo)(()=>a?"".concat(a," ").concat(n.text):n.text,[n,a]),c=(0,eo.useRef)(),[o,d]=(0,n6.Z)(!1);return(0,n8.Z)(c,()=>o&&d(!1)),(0,ec.BX)("div",{...r,ref:c,className:ew()(i," relative text-gray-7"),children:[(0,ec.BX)("div",{className:" whitespace-nowrap cursor-pointer flex items-center",onClick:d,children:[s," ",(0,ec.tZ)("span",{className:"cru-fo-chevron-down ml-3"})]}),o&&(0,ec.tZ)("div",{className:" absolute top-full right-0 shadow-md bg-white z-10",children:t.map((e,t)=>(0,ec.tZ)("div",{className:ew()(" py-[8px] px-4 whitespace-nowrap cursor-pointer",{"bg-black-1 text-white":e===n}),onClick(){l&&l(e),d(!1)},children:e.text},"options_".concat(t)))})]})}),aD=eo.memo(()=>{let{list:e,current:t,setCurrent:n}=ae(),a=(0,eo.useMemo)(()=>e.map(e=>({...e,text:"".concat(e.name," ").concat(e.location)})),[e]),i=(0,eo.useMemo)(()=>[{text:"Random"}],[]),[l,r]=(0,eo.useState)(()=>a.find(e=>e.value===t.value)),s=ep(t=>{r(t),n(e.find(e=>e.value===t.value))}),[c,o]=(0,eo.useState)(i[0]);return(0,ec.tZ)(n4,{menuId:2,children:(0,ec.tZ)("div",{className:"flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:" m-8 px-8 py-[1.5625rem] border-solid border-black-1 border min-w-[35rem]",children:[(0,ec.tZ)("div",{className:" font-medium text-xl",children:"Preferences"}),(0,ec.BX)("div",{className:" mt-4 whitespace-nowrap flex items-center",children:[(0,ec.tZ)("span",{className:"font-medium text-lg",children:"Choose preferred gateway :"}),(0,ec.tZ)(aR,{className:" ml-2",options:a,current:l,onOptionChange:s})]}),(0,ec.BX)("div",{className:" mt-4 whitespace-nowrap flex items-center",children:[(0,ec.tZ)("span",{className:"font-medium text-lg",children:"Gateway Match Strategy :"}),(0,ec.tZ)(aR,{className:" ml-2",options:i,current:c,onOptionChange:o})]})]})})})});function az(){let{store:e,update:t}=ex(),n=e.toasts||[];return(0,eo.useEffect)(()=>{let e=setInterval(()=>{t(()=>(n.shift(),{toasts:n}))},3e3);return()=>clearInterval(e)},[n]),(0,ec.tZ)("div",{className:"fixed top-5 right-5 z-[50]",children:n.map((e,t)=>(0,ec.tZ)("div",{className:"flex py-2 cursor-pointer justify-between items-center",children:(0,ec.tZ)(n9,{text:e.msg,status:e.type})},"toasts".concat(t)))})}var aG=eo.memo(function(){let e=ev();return(0,ec.tZ)(eg,{value:e,children:(0,ec.BX)("div",{className:"App relative",id:"app-root",children:[(0,ec.tZ)(aa.Z,{effect:"solid",clickable:!0,delayHide:200,isCapture:!0,overridePosition(e,t,n,a){let{top:i,left:l}=e;return a.style.maxWidth="300px",a.style.wordBreak="break-all",{top:i,left:l}}}),(0,ec.tZ)("div",{className:"App overflow-y-auto",children:(0,ec.tZ)(eI.UT,{children:(0,ec.BX)(eC.Z5,{children:[(0,ec.tZ)(eC.AW,{path:"/",element:(0,ec.tZ)(nz,{})}),(0,ec.tZ)(eC.AW,{path:"/buckets",element:(0,ec.tZ)(ah,{})}),(0,ec.tZ)(eC.AW,{path:"/bucket/:bucketId/:ipnsId",element:(0,ec.tZ)(au,{})}),(0,ec.tZ)(eC.AW,{path:"/settings",element:(0,ec.tZ)(aD,{})}),(0,ec.tZ)(eC.AW,{path:"/mint",element:(0,ec.tZ)(aY,{})})]})})}),(0,ec.tZ)(eT,{}),(0,ec.tZ)(az,{})]})})})},46601:function(){}}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[396],{60007:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return aG}});var a,i,l,r,s,c,o,d,m,u,p,y,h,f,g,b,v,x,A,w,Z,k,N,T,I,C,B,M,S,E,X,O,j,W,P,L,Y,R,D,z,G,H,F,U,J,Q,V,K,q,_,$,ee,et,en,ea,ei,el,er,es,ec=n(35944),eo=n(67294);let ed=()=>{let e=(0,eo.useRef)({safe:!0});return(0,eo.useEffect)(()=>(e.current.safe=!0,()=>{e.current.safe=!1}),[]),e.current};function em(){for(var e=arguments.length,t=Array(e),n=0;nt.map(e=>t=>{a.safe&&e(t)}),[t])}function eu(e){let[t,n]=(0,eo.useState)(e),[a]=em(n);return[t,a]}function ep(e){let t=(0,eo.useRef)(null);return(0,eo.useLayoutEffect)(()=>(t.current=e,()=>{})),(0,eo.useCallback)(function(){for(var e=arguments.length,n=Array(e),a=0;a{e.current||(e.current=!0,t().then(()=>{e.current=!1}))},[]);return[e,t]}let eh={loading:!1},ef=eo.createContext({update(){},oUpdate(){},store:eh}),eg=ef.Provider,eb=(e,t,n)=>{},ev=()=>{let[e,t]=(0,eo.useState)(eh),n=(0,eo.useCallback)(e=>{"function"==typeof e?t(t=>{let n=e(t),a={...t,...n};return eb(n,t,a),a}):t(t=>{let n={...t,...e};return eb(e,t,n),n})},[]);return{store:e,update:n,oUpdate:n}},ex=()=>{let{store:e,update:t}=(0,eo.useContext)(ef),[n]=em(t);return(0,eo.useMemo)(()=>({store:e,update:n,oUpdate:t}),[e,t,n])};var eA=n(94184),ew=n.n(eA),eZ=n(79352);let ek=eo.memo(e=>(0,ec.tZ)(eZ.uur,{...e,className:ew()(e.className,"animate-spin text-5xl")})),eN=eo.memo(e=>{let{text:t="",loading_attr:n={},text_attr:a={},...i}=e;return(0,ec.BX)("div",{...i,className:ew()(i.className," flex flex-col items-center"),children:[(0,ec.tZ)(ek,{...n}),!!t&&(0,ec.tZ)("div",{...a,className:ew()(" text-2xl text-center mt-9",a.className),children:t})]})}),eT=eo.memo(()=>{let e=(0,eo.useCallback)(e=>{e.stopPropagation()},[]),{loading:t}=function(e){let{oUpdate:t,store:{loading:n}}=ex(),a=(0,eo.useCallback)(()=>t({loading:!0}),[t]),i=(0,eo.useCallback)(()=>t({loading:!1}),[t]);return(0,eo.useEffect)(()=>{"boolean"==typeof e&&(e?a():i())},[e]),(0,eo.useMemo)(()=>({show:a,hiden:i,loading:n}),[a,i,n])}();return t?(0,ec.tZ)("div",{className:" fixed left-0 top-0 z-50 w-screen h-screen flex justify-center items-center bg-opacity-60 bg-black-1",onMouseMove:e,onMouseDown:e,onClick:e,children:(0,ec.tZ)(eN,{className:"py-10"})}):null});var eI=n(79655),eC=n(89250);function eB(){return(eB=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{text:t="",className:n}=e;return(0,ec.tZ)("div",{className:ew()("text-left text-black font-medium text-[2.5rem] leading-[2.9375rem]",n),children:t})});function eP(){return(eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:6,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;return e?e.length<=t+n?e:"".concat(e.toString().substring(0,t),"...").concat(e.toString().substring(e.length-n)):""};function eq(e){if(e){let t=document.getElementById(e);t&&t.scrollIntoView({block:"start",behavior:"smooth"})}}function e_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_blank";window.open(e,t)}let e$=new(ez())("800000000");function e0(e){let[t,n]=e.split("-"),a=new(ez())(t,36).sub(e$).toString(10);return[a,n]}function e1(e,t){let n=new(ez())(e).add(e$);return"".concat(n.toString(36),"-").concat(t)}function e2(e){return new Promise(t=>setTimeout(t,e))}function e5(e){switch(e){case eV.c.mainnet.id:break;case eV.c.goerli.id:return"https://goerli.etherscan.io";case eV.c.arbitrum.id:return"https://arbiscan.io";case eV.c.arbitrumGoerli.id:return"https://goerli.arbiscan.io";default:console.warn("chainId:".concat(e," not supported."))}return"https://etherscan.io"}function e3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e<9765625e-10?"".concat(eF().floor(1048576*e,t)," KB"):e<1?"".concat(eF().floor(1024*e,t)," MB"):e<1024?"".concat(eF().floor(e,t)," GB"):e<1048576?"".concat(eF().floor(e/1024,t)," TB"):"".concat(eF().floor(e/1048576,t)," PB")}function e4(e){return"".concat(eR.C5,"/ipfs/").concat(e)}function e6(e,t){return e+Math.floor(Math.random()*(t-e))}eQ.Kc&&(window.parseBucketId=e0,window.genBucketId=e1);var e8=n(70594);let e7="ZXRoLTB4MEVDNzJGNEQ5MWVhN2ZiRjAyZTY2NUQzZDU5QzQ3MmVjY2M0ZWZFZDoweDc3NDdmNDkxMWNhOWY2YWJjODE0MTgxZTkzZmM1YjdlNzQ4MGIwYzM0ZGRmOWFmNGQ4NjQ3OTRiZmYzY2EzMTg2MzQyNWEwZDRjZjAyOTA1Mjc5MTIwNDliYjJlYTRkMTM1OGZlZjQ3ZDU4YzBmMTQxNjI3ZmMzMTIwNzMwODdjMWI";async function e9(e){let{data:t,endpoint:n=eR.sl,authBasic:a="Basic ".concat(e7),onProgress:i,cancelToken:l=e8.Z.CancelToken.source().token}=e,r=await e8.Z.request({data:t,cancelToken:l,headers:{Authorization:a},method:"POST",onUploadProgress(e){i&&i(e.progress)},params:{pin:!0},url:"".concat(n,"/api/v0/add")});return r.data}async function te(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e7;try{if(0===e.length)throw Error("CID len err");let a=await e8.Z.post("".concat("https://pin.crustcode.com/psa","/pins"),JSON.stringify({cid:e,name:t}),{headers:{authorization:"Bearer "+n,"Content-Type":"application/json"}});return a.data}catch(i){return null}}function tt(){let{update:e}=ex(),t=(t,n)=>{e(e=>{let{toasts:n}=e;return{toasts:[{type:"error",msg:t}].concat(n||[])}})},n=(t,n)=>{e(e=>{let{toasts:n}=e;return{toasts:[{type:"success",msg:t}].concat(n||[])}})};return{error:t,success:n}}function tn(e){let{className:t,onClose:n,uploadRender:a,uploadBorder:i=!0,onSuccess:l,id:r=""}=e,s=tt(),[c,o]=(0,eo.useState)({progress:0,status:"stop"}),d=(0,eo.useRef)(null),m=(0,eo.useRef)(null),[u,p]=(0,eo.useState)(null),[y,h]=(0,eo.useState)(null),f=async()=>{"stop"===c.status&&m.current.click()};(0,eo.useEffect)(()=>{if(d.current){let e=d.current;e.addEventListener("dragover",e=>{e.preventDefault()}),e.addEventListener("dragenter",async()=>{e.querySelector("#waitUpload")&&(e.style.borderColor="#FC7823")}),e.addEventListener("dragleave",async()=>{e.style.borderColor="#131521"}),e.addEventListener("drop",async t=>{if(t.stopPropagation(),t.preventDefault(),e.querySelector("#waitUpload")){if(e.style.borderColor="#131521",t.dataTransfer.files.length>1||!/\.[a-zA-Z]+$/.test(t.dataTransfer.files[0].name))return s.error("Folders are not supported!"),!1;let[n]=t.dataTransfer.files;if(!n)return s.error("Please select a file."),!1;let a=n.size/1048576;if(a>100){s.error("Please select a file less than 100MB.");return}await g(n)}})}},[]);let g=async e=>{try{let t=e8.Z.CancelToken.source();p(t),o({progress:0,status:"upload"}),m.current.value="";let n=new FormData;if(!e||!e.name)return!1;n.append("file",e,e.name);let a=await e9({data:n,authBasic:"Basic ".concat("ZXRoLTB4MEVDNzJGNEQ5MWVhN2ZiRjAyZTY2NUQzZDU5QzQ3MmVjY2M0ZWZFZDoweDc3NDdmNDkxMWNhOWY2YWJjODE0MTgxZTkzZmM1YjdlNzQ4MGIwYzM0ZGRmOWFmNGQ4NjQ3OTRiZmYzY2EzMTg2MzQyNWEwZDRjZjAyOTA1Mjc5MTIwNDliYjJlYTRkMTM1OGZlZjQ3ZDU4YzBmMTQxNjI3ZmMzMTIwNzMwODdjMWI="),cancelToken:t.token,onProgress(e){o({progress:Math.round(99*e),status:"upload"})}});p(null),o({progress:100,status:"success"}),h(a),l&&l(a)}catch(i){console.error(i)}},b=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u&&(u.cancel("CanceledError"),p(null)),o({progress:0,status:"stop"}),n&&n(),h(null)},v=async e=>{let t=e.target.files[0];if(!t)return s.error("Please select a file."),!1;let n=t.size/1048576;if(n>100){s.error("Please select a file less than 100MB.");return}await g(t)};return(0,ec.BX)("div",{id:r,className:ew()("w-full flex justify-center",t),children:[(0,ec.BX)("div",{ref:d,onClick:f,className:ew()("w-full h-full cursor-pointer relative max-w-[70rem] flex justify-center items-center border-black-1 border-4 border-dashed"),style:i||"upload"!==c.status?{}:{border:"none"},children:[n&&(0,ec.tZ)(eL,{className:"absolute z-10 right-2 top-2 cursor-pointer",onClick:b}),"stop"!==c.status?"upload"===c.status?(0,ec.tZ)("div",{className:ew()("w-full",{"px-5":!!a,"px-20":!a}),children:a?a(c.progress):(0,ec.tZ)(eY,{value:c.progress})}):(0,ec.BX)("div",{className:"text-black-3 text-lg flex flex-col px-20",children:[(0,ec.tZ)("label",{className:"text-xl font-medium text-black",children:"IPFS CID:"}),(0,ec.tZ)("span",{className:"mt-5",children:y.Hash}),(0,ec.BX)("div",{className:"mt-20",children:[(0,ec.tZ)("label",{className:"text-xl font-medium text-black",children:"You may want to:"}),(0,ec.BX)("div",{className:"flex flex-wrap mt-5",children:[(0,ec.tZ)("div",{className:"mr-5 w-1/2 mb-2 underline",onClick:()=>e_("".concat(eR.C5,"/ipfs/").concat(y.Hash)),children:"Get download link for this file"}),(0,ec.tZ)("div",{className:"underline",onClick:()=>e_("https://ipfs-scan.io/?cid=".concat(y.Hash)),children:"Verify on IPFS"}),(0,ec.tZ)("div",{className:"mr-5 w-1/2 underline",onClick:()=>e_("https://docs.crustcloud.io"),children:"Learn more about Crust Cloud's storage solution"}),(0,ec.tZ)("div",{onClick:()=>e_("http://test.crustcloud.io/#/buckets"),className:"underline",children:"Claim your W3Bucket NFT on testnet"})]})]})]}):(0,ec.tZ)("span",{style:{pointerEvents:"none"},id:"waitUpload",className:"text-black-1 font-medium text-[2rem] leading-normal",children:"Drag and drop your file here"})]}),(0,ec.tZ)("input",{ref:m,hidden:!0,onChange:v,type:"file"})]})}let ta=eo.memo(()=>{let[e,t]=(0,eo.useState)(!1),n=()=>{t(!0),setTimeout(()=>{eq("nftupload")},0)},a=()=>{t(!1),setTimeout(()=>{eq("nft")},0)};return(0,ec.tZ)("div",{className:"w-full py-6 px-12 flex justify-center pb-20 mt-3 text-slate-700 text-lg",id:"nft",children:(0,ec.BX)("div",{className:"w-full max-w-[1112px] flex flex-col text-black",children:[(0,ec.tZ)(eW,{className:"mt-6 mb-8 font-medium",text:"Web3 Storage Buckets & Web3 IPFS Gateways"}),(0,ec.tZ)("p",{className:"pb-20 text-2xl text-black-3",children:"Crust Cloud defines what cloud storage middlewares should look like in Web3 - every storage bucket is a NFT, and every IPFS gateway is a NFT."}),(0,ec.BX)("div",{className:"flex justify-center",children:[(0,ec.BX)("div",{className:"flex flex-col justify-between",children:[(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)(eM,{}),(0,ec.tZ)("span",{className:"text-6xl px-6",children:"="}),(0,ec.tZ)(eE,{})]}),(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)(eO,{}),(0,ec.tZ)("span",{className:"text-6xl px-6",children:"="}),(0,ec.tZ)(eE,{})]})]}),(0,ec.BX)("div",{className:"ml-16",children:[(0,ec.tZ)("h4",{className:"text-[1.375rem] font-semibold text-black mb-4",children:"Store files in W3Buckets: Decentralized, Guaranteed & Alive."}),(0,ec.tZ)("p",{className:"text-black-3",children:"All contents in the W3Buckets are immutable, decentralized stored, guaranteed with up to permanent persistence in the open internet, and most importantly, owned & controlled by the NFT owner."}),(0,ec.tZ)("h4",{className:"text-[1.375rem] font-semibold text-black mb-4 mt-20",children:"IPFS Remote Pin"}),(0,ec.tZ)("p",{className:"text-black-3",children:"Storage service are called by Standard IPFS Remote Pinning Service APIs that make your files always available (alive!) on IPFS with multiple replicas and accessible from everywhere."}),(0,ec.BX)("div",{className:"flex mt-8 text-black-1",children:[(0,ec.tZ)(ej,{onClick:n,className:"btn-173",text:"Play Quick Demo"}),(0,ec.tZ)(ej,{onClick:()=>eQ.Kc?e_("/#/buckets","_self"):e_("/#/buckets"),className:"btn-173 ml-5",text:"Launch App"})]})]})]}),e&&(0,ec.tZ)(tn,{id:"nftupload",className:"h-[32.937rem] mt-12",onClose:a})]})})}),ti=[[[42,49]],[[41,50]],[[38,53]],[[37,53]],[[20,26],[35,52]],[[18,28],[34,51],[82,85],[96,100],[110,111]],[[17,24],[27,27],[29,32],[36,36],[38,51],[81,84],[92,101],[109,111]],[[3,6],[11,12],[16,27],[29,34],[40,51],[80,81],[86,86],[89,89],[91,106],[110,115]],[[2,8],[10,24],[26,27],[30,36],[40,50],[67,74],[83,83],[85,86],[88,123]],[[2,24],[26,26],[28,31],[34,37],[40,49],[66,75],[77,86],[88,124]],[[1,31],[34,38],[40,46],[51,54],[66,73],[76,124]],[[1,28],[31,31],[33,37],[41,44],[52,53],[64,123]],[[2,27],[33,37],[42,43],[63,115],[118,122]],[[4,8],[11,27],[33,38],[60,60],[64,114],[116,119]],[[3,7],[13,30],[33,39],[59,61],[64,109],[116,118]],[[2,3],[13,31],[33,40],[58,62],[64,110],[116,118]],[[0,1],[14,40],[58,111],[116,117]],[[16,36],[40,40],[60,111],[115,116]],[[16,38],[40,41],[61,78],[81,109],[111,111]],[[16,39],[60,71],[73,73],[75,77],[80,108]],[[16,37],[58,62],[66,66],[68,71],[76,78],[80,108],[110,111]],[[16,35],[58,61],[65,65],[67,67],[69,78],[81,102],[104,107],[110,110]],[[17,35],[59,60],[63,65],[67,67],[69,69],[71,78],[80,103],[105,106],[109,110]],[[18,34],[61,65],[74,103],[105,105],[108,110]],[[19,32],[59,66],[69,70],[74,103],[107,108]],[[20,32],[58,104],[106,107]],[[20,27],[31,32],[58,78],[80,104]],[[21,26],[31,31],[57,73],[75,78],[82,103]],[[21,21],[23,25],[56,73],[75,82],[85,103]],[[23,26],[28,29],[31,33],[56,74],[76,82],[86,101]],[[23,29],[34,36],[56,74],[76,81],[87,91],[94,98],[100,100],[104,104]],[[25,30],[56,75],[77,80],[87,90],[94,99],[103,104]],[[28,31],[56,75],[77,78],[87,89],[95,99],[103,104]],[[30,31],[34,37],[55,76],[88,89],[96,99],[104,104]],[[30,39],[56,79],[88,89],[96,96],[98,98],[102,102],[104,105]],[[31,40],[57,79],[88,89],[96,96],[101,102],[104,105]],[[33,42],[58,61],[64,79],[95,97],[101,102]],[[32,42],[65,78],[95,97],[100,102],[106,106]],[[32,43],[65,76],[96,97],[100,104],[106,108]],[[31,45],[65,76],[96,98],[100,102],[104,104],[107,111]],[[31,47],[65,75],[97,99],[107,112]],[[31,47],[66,75],[98,100],[110,113]],[[32,47],[66,75],[100,101],[104,105],[110,113]],[[33,47],[66,76],[78,79],[107,108],[113,113]],[[33,46],[65,76],[78,79],[105,108],[111,111]],[[34,46],[65,75],[77,79],[104,112]],[[35,46],[66,75],[77,79],[104,113]],[[35,45],[66,74],[77,78],[102,113]],[[35,44],[67,74],[77,78],[101,114]],[[35,43],[67,73],[77,77],[101,114]],[[35,43],[67,72],[101,114]],[[35,42],[68,72],[102,114]],[[35,41],[68,71],[102,114]],[[34,41],[68,69],[101,103],[108,108],[110,114],[123,123]],[[34,39],[110,113],[123,124]],[[34,38],[111,112],[122,124]],[[34,37],[112,113],[122,124]],[[34,36],[112,112],[121,122]],[[33,37],[120,121]],[[33,36]],[[33,35]],[[34,37]],[[35,36]]],tl=(0,eo.memo)(function(e){let{className:t,activePos:n,onChange:a}=e,[i,l]=(0,eo.useState)([]);(0,eo.useMemo)(()=>{if(n.length>0){let e=[];n.map(t=>{for(let n=0;n=r[0]&&t.x<=r[1]&&t.y===n){e.push(r),i=!0;break}}if(i)break}}),l(e)}},[n]),(0,eo.useMemo)(()=>{i.length>0&&a&&a(i)},[i]);let r=e=>{let t=e[0],n=e[1],a=[];for(let i=t;i<=n;i++)a.push(i);return a},s=(e,t)=>{let a=eF().find(n,n=>n.x===e&&n.y===t);return a?"red":"#666"};return(0,ec.tZ)("svg",{viewBox:"0 0 880 450",className:ew()("",t),children:ti.map((e,t)=>e.map(e=>r(e).map((e,n)=>(0,ec.tZ)("circle",{fill:s(e,t),cx:(e+1)*7,cy:(t+1)*7,r:"2.6"},"circle".concat(n)))))})});function tr(){return(tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=tu();return{logo:(0,ec.tZ)(tm,{className:""}),name:"AAVE",activePos:e.activePos,total:e.total}})()],ty=eo.memo(()=>{let[e,t]=(0,eo.useState)(0),n=()=>{t(e-1>=0?e-1:tp.length-1)},a=()=>{t(e+1>tp.length-1?0:e+1)};return(0,ec.tZ)("div",{className:"w-full pt-6 pb-[min(12vmin,18.75rem)] px-12 flex flex-col items-center",children:(0,ec.BX)("div",{className:"my-10 text-black w-full max-w-[1310px]",children:[(0,ec.tZ)(eW,{className:"mx-auto max-w-[1120px] ",text:"Discover some real use cases"}),tp.map((t,i)=>i===e&&(0,ec.BX)("div",{className:ew()("flex justify-center pt-5"),children:[(0,ec.tZ)(tl,{activePos:t.activePos,className:"flex-1 pt-16"}),(0,ec.BX)("div",{className:"flex flex-shrink-0 flex-col items-center w-[22.625rem] ml-10 ",children:[(0,ec.BX)("div",{className:"h-[4.625rem] w-full flex justify-between items-center",children:[(0,ec.tZ)(to,{className:"cursor-pointer",onClick:n}),t.logo,(0,ec.tZ)(to,{className:"rotate-180 cursor-pointer",onClick:a})]}),(0,ec.BX)("span",{className:"text-black text-lg mt-12 font-medium",children:["Check this real-time monitor to see how we help ",t.name," decentralized host their Dapp frontend:"]}),(0,ec.BX)("div",{className:"text-black-3 text-lg mt-3",children:[(0,ec.BX)("p",{className:"mt-5",children:[(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:t.total})," IPFS Replicas all around the globe"]}),(0,ec.BX)("p",{className:"mt-5",children:[(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:"99+"})," Years guaranteed with ",(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:"1.5ETH"})," in payment contract"]}),(0,ec.BX)("p",{className:"mt-5",children:["Guranteed by ",(0,ec.tZ)("a",{className:"text-black-3 underline",href:"https://crust.network/",target:"_blank",children:"decentralized incentive protocol"})," on IPFS"]}),(0,ec.BX)("p",{className:"mt-5",children:["Verifiable on ",(0,ec.tZ)("a",{className:"text-black-3 underline",href:"https://ipfs-scan.io/",target:"_blank",children:"IPFS Scan"})]})]})]})]},"monitorProject".concat(i)))]})})});var th=n(85769),tf=n(85118),tg=n(41884),tb=n(15029),tv=n(99477);function tx(){let e="#787980",t=(0,eo.useMemo)(()=>{let e=[],t=new tv.Vector3;for(let n=0;n<2e3;n++){t.x=2*Math.random()-1,t.y=2*Math.random()-1,t.z=2*Math.random()-1,t.normalize(),t.multiplyScalar(26);let a=[t.x,t.y,t.z];t.multiplyScalar(.2*Math.random()+1);let i=[t.x,t.y,t.z];e.push([a,i])}return e},[]),n=(0,eo.useMemo)(()=>{let e=[],t=new tv.Vector3;for(let n=0;n<300;n++){t.x=n%2==0?-1:1,t.y=(2*Math.random()-1)*.5,t.z=(2*Math.random()-1)*.3,t.normalize(),t.multiplyScalar(26+4*Math.random()-2);let a=[t.x,t.y,t.z];t.multiplyScalar(2*Math.random()+1.3);let i=[t.x,t.y,t.z],l=Math.abs(a[0]-i[0]),r=Math.round(1+5*l/27),s=[i[0]-a[0],i[1]-a[1],i[2]-a[2]],[c,o,d]=[s[0]/(r+1),s[1]/(r+1),s[2]/(r+1)],m=[];if(Math.random()>.5)for(let u=1;u<=r;u++){let p=Math.ceil(Math.random()-.5),y=(3*Math.random()+2)*p;m.push([a[0]+u*c,a[1]+u*o+y,a[2]+u*d+0])}e.push([a,i,m])}return e},[]),a=(0,eo.useRef)(),i=(0,eo.useRef)(),l=(0,eo.useRef)({count:0}),r=(0,eo.useRef)({});(0,tg.A)((e,t,n)=>{if(a.current){let s=2*Math.PI,c=a.current.rotation.x+s*t*.01;a.current.rotation.x=c>s?c-s:c}if(i.current){let o=l.current.count%6==0;for(let d of i.current.children)if("Points"===d.type){let u=d,p=u.geometry.getAttribute("position");for(let y=0;y2*f.max?1:g,v=b<=f.max?b-1:2*f.max-b-1;p.setXYZ(y,h.getX(v),h.getY(v),h.getZ(v))}else p.setXYZ(y,h.getX(0),h.getY(0),h.getZ(0))}p.needsUpdate=!0}else if("Line"===d.type){let x=d,A=r[x.name];if(A){let w=A.count+(o?1:0),Z=w>2*A.max?1:w,k=Z<=A.max?Z:2*A.max-Z;x.geometry.setDrawRange(0,k),A.count=Z}else if(x.geometry.setDrawRange(0,0),.001>Math.random()){let N=Math.round(x.geometry.getAttribute("position").array.length/3);r[x.name]={count:1,max:N}}}l.current.count++,l.current.count>600&&(l.current.count=0)}},-2);let s=(0,th.m)("disc.png"),c=(0,eo.useMemo)(()=>new tv.Float32BufferAttribute(t.flatMap(e=>e[1]),3),[t]),o=(0,eo.useMemo)(()=>new tv.Float32BufferAttribute(t.flatMap(e=>e[0].concat(e[1])),3),[t]),d=(0,eo.useMemo)(()=>new tv.Float32BufferAttribute(n.flatMap(e=>e[1]),3),[n]),m=(0,eo.useMemo)(()=>{let e=[];for(let[t,a,i]of n){let l=[t,...i,a],r=new tv.CatmullRomCurve3(l.map(e=>new tv.Vector3(...e)),!1,"chordal",.5),s=Math.abs(t[0]-a[0]),c=Math.round(20+160*s/27),o=r.getPoints(c).flatMap(e=>[e.x,e.y,e.z]);e.push(new tv.Float32BufferAttribute(o,3))}return e},[n]);return(0,ec.BX)("group",{position:[40,0,0],children:[(0,ec.BX)("group",{ref:a,children:[(0,ec.BX)("points",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:c}}),(0,ec.tZ)("pointsMaterial",{color:e,opacity:.7,map:s,size:4,blending:tv.AdditiveBlending,depthTest:!1,transparent:!0})]}),(0,ec.BX)("lineSegments",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:o}}),(0,ec.tZ)("lineBasicMaterial",{color:e,linewidth:1})]})]}),(0,ec.BX)("group",{ref:i,children:[(0,ec.BX)("points",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:d}}),(0,ec.tZ)("pointsMaterial",{color:"#cdcccc",opacity:.7,map:s,size:4,blending:tv.AdditiveBlending,depthTest:!1,transparent:!0})]}),m.map((t,n)=>(0,ec.BX)("line_",{name:n,children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:t}}),(0,ec.tZ)("lineBasicMaterial",{color:e,linewidth:1})]},"line_".concat(n)))]})]})}(0,tg.e)({Line_:tv.Line});let tA=eo.memo(function(){return(0,ec.BX)(tb.Xz,{gl:{antialias:!0},children:[(0,ec.tZ)(tf.i,{makeDefault:!0,zoom:9,args:[-150,50,30,-30,50,-100]}),(0,ec.tZ)("ambientLight",{color:"#eaeaea",intensity:1}),(0,ec.BX)("mesh",{position:[0,0,-100],children:[(0,ec.tZ)("planeGeometry",{args:[1e3,1e3]}),(0,ec.tZ)("meshStandardMaterial",{color:"black"})]}),(0,ec.tZ)(tx,{})]})});var tw=n(21132);function tZ(){return(tZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t((0,tw.tf)(()=>{setTimeout(()=>{window.scroll(0,0)},50)}),(0,ec.BX)("div",{className:"w-full min-h-min relative",children:[(0,ec.tZ)("div",{className:"w-full bg-black h-screen absolute left-0 top-0 z-0",children:(0,ec.tZ)(tA,{})}),(0,ec.BX)("div",{className:"z-1 h-[100vh] relative w-full py-6 px-12 flex flex-col items-center",children:[(0,ec.tZ)("div",{className:"h-14 w-full max-w-[1112px] flex justify-between items-center font-WorkSans",children:(0,ec.tZ)("div",{className:"text-[88px] ml-3 mt-5",children:(0,ec.tZ)(tC,{})})}),(0,ec.BX)("div",{className:"h-full my-10 w-full max-w-[1112px] flex flex-col justify-center mt-[-1rem]",children:[(0,ec.BX)("div",{className:"font-RobotoMono font-bold text-[2.5rem] leading-tight",children:[(0,ec.tZ)("p",{children:"Cloud 3"}),(0,ec.tZ)("p",{children:"Redefining Web3 Storage"})]}),(0,ec.BX)("div",{className:"flex flex-col mt-12 pl-1 mb-20",children:[(0,ec.BX)("div",{className:"flex mb-3",children:[(0,ec.tZ)(ej,{text:"Documentations",className:"btn-173 border-white text-white",onClick:()=>e_("https://docs.crustcloud.io/")}),(0,ec.tZ)(ej,{text:"Launch App",className:"btn-173 ml-3 border-white text-white",onClick:()=>eQ.Kc?e_("/#/buckets","_self"):e_("/#/buckets")})]}),(0,ec.tZ)("div",{className:"flex",children:(0,ec.tZ)(ej,{text:"Contact the team",className:"btn-173 border-white text-white",onClick:()=>e_("https://forms.gle/NUSvEDDR4AmP8wbV6")})})]})]})]})]})));function tM(){return(tM=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,ec.tZ)("div",{className:"w-full py-20 px-12 flex flex-col items-center justify-center text-black-1",children:(0,ec.BX)("div",{className:"w-full max-w-[1112px]",children:[(0,ec.tZ)(eW,{className:"w-full pb-14",text:"Crust Cloud is a Web3 storage cloud"}),(0,ec.BX)("div",{className:"w-full flex justify-between items-end text-lg",children:[(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-black-1 mt-12",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-black-1 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"IaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Infrastructure-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.BX)("div",{className:"flex items-center mt-6",children:[(0,ec.tZ)(tS,{}),(0,ec.tZ)(tX,{className:"ml-11"})]}),(0,ec.tZ)("a",{href:"https://ipfs.io",target:"_blank",className:"text-2xl text-black-1 font-medium leading-7 mt-5 mb-3 underline no-skip-ink",children:"IPFS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"the distrbuted file system"}),(0,ec.tZ)("a",{href:"https://crust.network",target:"_blank",className:"text-2xl text-black-1 font-medium leading-7 mt-5 mb-3 underline no-skip-ink",children:"Crust Network"}),(0,ec.tZ)("p",{className:"w-[294px] leading-[1.3125rem] text-center",children:"the decentralized storage protocol & incentive layer of IPFS"})]}),(0,ec.tZ)("div",{})]}),(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.tZ)("h4",{className:"text-orange-15 font-medium text-[2rem] leading-[2.375rem] mb-4",children:"Crust Cloud Products"}),(0,ec.BX)("div",{className:"flex",children:[(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-orange-15",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-orange-15 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"PaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Platform-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center pt-7 pb-14",children:[(0,ec.BX)("div",{className:"flex items-center text-[2.5rem]",children:[(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tj,{}),(0,ec.tZ)("span",{className:"px-3",children:"+"}),(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tP,{})]}),(0,ec.tZ)("h6",{onClick:()=>eq("nft"),className:"text-2xl font-medium leading-7 mt-[1.7rem] mb-3 underline no-skip-ink cursor-pointer",children:"W3Buckets"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"NFT-nized IPFS storage buckets"}),(0,ec.tZ)("h6",{onClick:()=>eq("nft"),className:"text-2xl font-medium leading-7 mt-5 mb-3 underline no-skip-ink cursor-pointer",children:"W3Gateways"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"NFT-nized IPFS Gateways"})]})]}),(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-orange-15",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-orange-15 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"SaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Software-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center pt-7",children:[(0,ec.BX)("div",{className:"flex items-center text-[2.5rem]",children:[(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tY,{})]}),(0,ec.tZ)("h6",{onClick:()=>eq("widget"),className:"text-2xl font-medium leading-7 mt-[2rem] mb-3 underline no-skip-ink cursor-pointer",children:"Web3 Storage Widgets"}),(0,ec.tZ)("p",{className:"w-[298px] leading-[1.3125rem] text-center",children:"Rich-text Editor/Publisher Widget IPFS File Storage Widget"}),(0,ec.tZ)("p",{className:"w-[298px] leading-[1.3125rem] text-center",children:"IPFS Storage Retrieval Widget and more..."})]})]})]})]})]})]})}));function tD(){return(tD=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{icon:t,...n}=e;return"string"==typeof t?(0,ec.tZ)("span",{...n,className:ew()(n.className,t)}):(0,ec.tZ)(t,{...n})}),tV=eo.memo(e=>{let{onClose:t,title:n,className:a,...i}=e;return(0,ec.BX)("div",{...i,className:ew()(" flex pb-5 justify-between border-b border-solid border-b-gray-16",a),children:[(0,ec.tZ)("div",{className:"text-black-3 text-lg",children:n}),(0,ec.tZ)("div",{className:"text-gray-12",children:(0,ec.tZ)(tQ,{icon:"cru-fo-x",className:" text-xl cursor-pointer",onClick:t})})]})}),tK=eo.memo(e=>{let{outClick:t,outClassname:n,className:a,children:i,...l}=e,r=null==document?void 0:document.getElementById("app-root");return r?(0,tJ.createPortal)((0,ec.tZ)("div",{onClick:t,className:ew()(n,"fixed left-0 top-0 w-screen h-screen z-40 bg-opacity-50 bg-black flex justify-center items-center"),children:(0,ec.tZ)("div",{...l,className:ew()(a," min-w-[27.5rem] p-5 bg-white text-black-1"),children:i})}),r):null});var tq=n(8193);let t_=eo.memo(e=>{let{onClose:t,className:n}=e;return(0,ec.tZ)(tQ,{className:ew()("absolute right-6 top-6 text-3xl font-bold cursor-pointer",n),onClick:t,icon:tq.SV5})});function t$(e){let{onClose:t}=e,[n,a]=(0,eo.useState)(0),[i,l]=(0,eo.useState)({Hash:""}),r=e=>{a(3),l(e)},s=e=>(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.tZ)("p",{className:"w-[24rem] text-black-3 text-2xl text-center mb-10",children:"Publishing & Uploading to IPFS Please wait..."}),(0,ec.tZ)(eY,{value:e})]});return(0,ec.tZ)(tK,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white flex min-h-[40.75rem] relative",children:[(0,ec.tZ)(t_,{onClose:()=>t&&t()}),(0,ec.BX)("div",{className:"bg-black w-80 text-white px-8 py-16 text-lg",children:[(0,ec.tZ)("div",{className:"mb-12 text-2xl font-medium",children:"IPFS File Storage Widget"}),3===n?(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 2:"}),(0,ec.tZ)("p",{className:"font-light",children:"When Upload process is completed, you will get an IPFS CID (unique identifier to your stored content) and a Storage Manager Tx No. (Tx No. for the IPFS storage action of your content)."})]}):(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 1:"}),(0,ec.tZ)("p",{className:"mb-5 font-light",children:"Drag and drop a file into the box."}),(0,ec.BX)("p",{className:"font-light",children:["When you finish, click on the ",(0,ec.tZ)("span",{className:"font-semibold",children:"'Upload'"})," button to continue."]})]})]}),(0,ec.tZ)("div",{className:"min-w-[50rem] flex justify-center items-center",children:3===n?(0,ec.BX)("div",{className:"text-center text-black-3 flex flex-col items-center",children:[(0,ec.tZ)(tQ,{className:"text-[3.125rem] text-black mb-4",icon:tq.KP3}),(0,ec.tZ)("div",{className:"text-[1.375rem] text-black font-semibold mb-4",children:"Publish successfully!"}),(0,ec.tZ)("p",{className:"mb-14 text-lg",children:"This content has been published and decentralized stored on IPFS."}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Your content's IPFS CID:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7 mb-8",children:i.Hash}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Storage Manager Tx No:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7",children:eK("0x69b9f8cf491b55c485dbb43a86a7e48f7649aa45c958cd245461d04c3146bd91",23,23)})]}):(0,ec.tZ)(tn,{uploadRender:s,onSuccess:r,uploadBorder:!1,className:"h-[29.937rem] w-[42.5rem]"})})]})})}var t0=n(7297),t1=n(18872),t2=n(40392),t5=n(86395);n(37640);var t3=n(96412),t4=n.n(t3),t6=n(4979),t8=n.n(t6),t7=n(31026),t9=n(378),ne=n(611),nt=n(49891),nn=n(84672),na=n(56073),ni=n(54340),nl=n(82874),nr=n(5705),ns=n(71265),nc=n(11033),no=n(31871),nd=n(78469),nm=n(55658),nu=n(78822),np=n(98584),ny=n(81373),nh=n(13848),nf=n(32085),ng=n(92003),nb=n.n(ng),nv=n(5432),nx=n(57375),nA=n(27353),nw=n(48764).lW;function nZ(){let e=(0,t0.Z)(['\n width: 100%;\n height: 100%;\n padding: 80px 24px 24px 24px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ol,\n ul {\n list-style: revert !important;\n margin: revert !important;\n padding: revert !important;\n }\n .remirror-editor-wrapper {\n padding-top: unset;\n border-radius: 0;\n border: 1px solid #dfe3e7 !important;\n outline: unset !important;\n overflow: auto;\n height: 447px;\n max-width: 872px;\n max-height: 447px;\n .ProseMirror {\n overflow: hidden;\n min-height: 100%;\n padding: "1rem";\n box-shadow: unset !important;\n pre {\n padding: ',";\n margin: 0;\n }\n .remirror-is-empty:first-of-type::before{\n font-style: normal !important;\n }\n }\n }\n"]);return nZ=function(){return e},e}function nk(){let e=(0,t0.Z)(["\n height: 72px !important;\n background-color: #f4f5f7 !important;\n padding: 24px !important;\n border: 1px solid #dfe3e7 !important;\n overflow: hidden !important;\n button {\n padding: unset !important;\n width: 24px !important;\n height: 24px !important;\n /* font-size: 22px; */\n margin-right: 18px !important;\n outline: unset !important;\n border: unset !important;\n background-color: transparent !important;\n }\n "]);return nk=function(){return e},e}async function nN(e){let t=await nA.J.digest(e);return nx.k0.createV0(t).toString()}let nT=eR.C5,nI=new Map,nC=(0,t1.iv)(nZ(),(0,t7.y2)("space",3)),nB=e=>{let{style:t,className:n,children:a}=e;return(0,ec.tZ)("div",{style:t,className:"".concat(nC," ").concat(n," w-full"),children:a})},nM={color:{primary:"#FC7823",primaryText:"#FC7823",outline:"transparent",background:"transparent",hover:{primary:"#FC7823",primaryText:"#FC7823"}},fontFamily:{default:"var(--work-sans)"}},nS=()=>(0,ec.BX)(t2.o8,{className:(0,t1.iv)(nk()),children:[(0,ec.tZ)(t2.pQ,{attrs:{level:1}}),(0,ec.tZ)(t2.pQ,{attrs:{level:2}}),(0,ec.tZ)(t2.pQ,{attrs:{level:3}}),(0,ec.tZ)(t2.Vu,{}),(0,ec.tZ)(t2.NV,{}),(0,ec.tZ)(t2.kj,{}),(0,ec.tZ)(t2.QD,{}),(0,ec.tZ)(t2.Om,{}),(0,ec.tZ)(t2.XR,{}),(0,ec.tZ)(t2.gf,{})]}),nE=e=>{let{placeholder:t="Please input text...",initialContent:n="",editorUpdate:a,onUpFinish:i}=e,l=(0,eo.useMemo)(()=>{let e=new ne.y5({autoLink:!0});return e.addHandler("onClick",(e,t)=>(console.log("You clicked link: ".concat(JSON.stringify(t))),!0)),e},[]);(0,eo.useRef)("");let[r,s]=(0,eo.useState)(""),[c,o]=(0,eo.useState)(""),[d,m]=(0,eo.useState)(!1),[u,p]=(0,eo.useState)(""),[y,h]=(0,eo.useState)(-1),f=(0,eo.useMemo)(()=>-1!==y?"uping":r?"finish":"edit",[y,r]),g=async()=>{let e=await nb()();if(e&&e.isMetaMask){await e.request({method:"eth_requestAccounts"});let t=new nv.Web3Provider(e),n=t.getSigner(),a=await n.getAddress(),i=await n.signMessage("You are signing this message for DEMO purpose only. Sign this message to prove you own this account and you will be able to publish your Web3 content.");return nw.from("eth-".concat(a,":").concat(i)).toString("base64")}return""},b=async(e,t)=>{try{let n=e8.Z.CancelToken.source();t&&t(0);let a=await e9({data:e,cancelToken:n.token,onProgress:t});return console.log(a),a}catch(i){console.error(i.message)}return null},v=async()=>{try{let e=await g();if(!e)return;let t=new FormData;t.append("file",c);let n=await b(t,e=>h(Math.round(99*e)));if(null===n){p("Cannot save markdown file."),m(!0),s("Save markdown failed.");return}let a=n.Hash;await te(a,"text.md"),s(a),h(-1),i&&i(n)}catch(l){console.error(l)}},x=e=>{let t=0,n=[];for(let{file:a,progress:i}of(console.info("files:",e),e))n.push(()=>new Promise((e,n)=>{let i=new FileReader;i.addEventListener("load",async l=>{console.log(a),t+=1,console.info("readed:",i.result);let r=await nN(new Uint8Array(i.result));console.info("imgKey:",r);let s=nI.get(r);if(!s){let c=new FormData;c.append("file",a,a.name);let o=await b(c);if(null!==o)try{await te(o.Hash,a.name);let d=await function(e){return new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e,n.loading="eager"})}("".concat(nT,"/ipfs/").concat(o.Hash));if(!d)throw"pre load error";s=o.Hash,nI.set(r,o.Hash)}catch(m){console.error(m)}}s?e({src:"".concat(nT,"/ipfs/").concat(s),fileName:a.name}):n()},{once:!0}),i.readAsArrayBuffer(a)}));return n},A=(0,eo.useCallback)(()=>{let e=document.createElement("div");return e.className="w-[100px] h-[100px] p-[30px]",tJ.render((0,ec.tZ)(ek,{}),e),e},[]),w=(0,eo.useCallback)(()=>[new nt.X({placeholder:t}),new nn.x({data:nf,plainText:!0}),l,new na.H({}),new ni.V,new nl.Gc({uploadHandler:x,createPlaceholder:A,enableResizing:!0}),new nr.f,new ns.e({}),new nc.V,new no.z,new nd.UQ({enableSpine:!0}),new nd._3,new nd.Jb({priority:t9.xV.High,enableCollapsible:!0}),new nm.l,new nu.W({supportedLanguages:[t4(),t8()]}),new np.F,new ny.g({copyAsMarkdown:!1}),new nh.h],[t]),{manager:Z}=(0,t5.iF)({extensions:w,stringHandler:"markdown",content:n}),k=e=>{var t;(null===(t=e.tr)||void 0===t?void 0:t.docChanged)&&(null==a||a(e)),console.info("p:",e.helpers.getMarkdown())};return(0,eo.useEffect)(()=>{let e=setInterval(()=>{o(Z.extensionStore.helpers.getMarkdown())},500);return()=>clearInterval(e)},[Z]),(0,ec.BX)(t2.f6,{as:nB,theme:nM,children:["edit"==f&&(0,ec.BX)(t5.O1,{manager:Z,autoFocus:!0,onBlur:k,onChange:k,children:[(0,ec.tZ)(nS,{}),(0,ec.tZ)(t5.PG,{}),(0,ec.tZ)("div",{className:"flex justify-center",children:(0,ec.tZ)(ej,{disabled:!c,className:"btn-173 mt-4",text:"Publish",onClick:v})})]}),"uping"==f&&(0,ec.BX)("div",{className:"mb-[3.5rem] font-WorkSans px-14 flex flex-col items-center",children:[(0,ec.tZ)("p",{className:"w-[24rem] text-black-3 text-2xl text-center mb-10",children:"Publishing & Uploading to IPFS Please wait..."}),(0,ec.tZ)(eY,{value:y})]}),"finish"==f&&(0,ec.tZ)(ec.HY,{children:(0,ec.BX)("div",{className:"mb-[3.5rem] text-center font-WorkSans text-black-3 flex flex-col items-center",children:[(0,ec.tZ)(tQ,{className:"text-[3.125rem] text-black mb-4",icon:tq.KP3}),(0,ec.tZ)("div",{className:"text-[1.375rem] text-black font-semibold mb-4",children:"Publish successfully!"}),(0,ec.tZ)("p",{className:"mb-14 text-lg",children:"This content has been published and decentralized stored on IPFS."}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Your content's IPFS CID:"}),(0,ec.tZ)("div",{className:"text-sm text-gray-7 mb-8",children:r}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Storage Manager Tx No:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7",children:eK("0x69b9f8cf491b55c485dbb43a86a7e48f7649aa45c958cd245461d04c3146bd91",23,23)})]})})]})};function nX(e){let{onClose:t}=e,[n,a]=(0,eo.useState)(0);return(0,ec.tZ)(tK,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white flex h-[40.75rem] relative",children:[(0,ec.tZ)(t_,{onClose:()=>t&&t()}),(0,ec.BX)("div",{className:"bg-black w-80 text-white px-8 py-16 text-lg",children:[(0,ec.tZ)("div",{className:"mb-12 text-2xl font-medium",children:"Rich-text Content Publisher Widget"}),0===n&&(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 1:"}),(0,ec.tZ)("p",{className:"mb-5 font-light",children:"Type in any text and try to do some simple edit work."}),(0,ec.BX)("p",{className:"font-light",children:["When you finish, click on the ",(0,ec.tZ)("span",{className:"font-semibold",children:"'Publish'"})," button to continue."]})]}),1===n&&(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 2:"}),(0,ec.tZ)("p",{className:"font-light",children:"When Publish and Upload processes are completed, you will get an IPFS CID (unique identifier to your stored content) and a Storage Manager Tx No. (Tx No. for the IPFS storage action of your content)."})]})]}),(0,ec.tZ)("div",{className:"min-w-[50rem] flex items-center justify-center",children:(0,ec.tZ)(nE,{onUpFinish:e=>e&&a(1)})})]})})}var nO=n(42820),nj=n(45843),nW=n(32226),nP=n(79166);let nL=eo.memo(e=>(0,ec.tZ)(nO.D,{children:e.code,linkTarget:"_blank",components:{h5(e){let{node:t,...n}=e;return(0,ec.tZ)("h5",{style:{fontSize:"18px",fontStyle:"normal"},...n})},code(e){let{node:t,inline:n,className:a,children:i,...l}=e,r=/language-(\w+)/.exec(a||"");return!n&&r?(0,ec.tZ)(nW.Z,{children:String(i).replace(/\n$/,""),style:nP.Z,language:r[1],PreTag:"div",...l}):(0,ec.tZ)("code",{className:a,...l,children:i})}},remarkPlugins:[nj.Z]}));function nY(e){let{onClose:t}=e;return(0,ec.tZ)(tK,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white min-w-[56rem] flex flex-col relative p-6",children:[(0,ec.BX)("div",{className:"flex justify-between items-center mb-6",children:[(0,ec.tZ)("a",{className:"text-2xl underline text-black-1",href:"https://docs.crustcloud.io",target:"_blank",children:"Dev Guidance"}),(0,ec.tZ)(t_,{className:"mt-[-0.3rem]",onClose:()=>t&&t()})]}),(0,ec.tZ)("div",{children:(0,ec.tZ)(nL,{code:"\n##### React:\n\n~~~jsx\nimport { MDEditor } from '@cloud3/react-widgets'\nexport default function App(){\n return(\n \n )\n}\n~~~\n \n \n\n##### Vue:\n\n~~~jsx\n\n\n~~~\n"})})]})})}function nR(e){let{onClose:t}=e;return(0,ec.tZ)(tK,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white min-w-[56rem] flex flex-col relative p-6",children:[(0,ec.BX)("div",{className:"flex justify-between items-center mb-6",children:[(0,ec.tZ)("a",{className:"text-2xl underline text-black-1",href:"https://docs.crustcloud.io",target:"_blank",children:"Dev Guidance"}),(0,ec.tZ)(t_,{className:"mt-[-0.3rem]",onClose:()=>t&&t()})]}),(0,ec.tZ)("div",{children:(0,ec.tZ)(nL,{code:"\n##### React:\n\n~~~jsx\nimport { DragStorage } from '@cloud3/react-widgets'\nexport function(){\n return(\n \n )\n}\n~~~\n \n \n\n##### Vue:\n~~~jsx\n\n\n~~~\n"})})]})})}let nD=eo.memo(()=>{let[e,t]=(0,eo.useState)(!1),[n,a]=(0,eo.useState)(!1),[i,l]=(0,eo.useState)(!1),[r,s]=(0,eo.useState)(!1);return(0,ec.BX)("div",{id:"widget",className:"w-full pb-20 pt-16 px-12 flex flex-col items-center justify-center text-black bg-[#F5F5F5]",children:[(0,ec.BX)("div",{className:"w-full max-w-[1112px] text-lg",children:[(0,ec.tZ)(eW,{className:"w-full mb-8",text:"Web3 Storage Widgets"}),(0,ec.tZ)("p",{className:"w-full text-left text-2xl text-black-3 mb-20",children:"Users should own their contents and take full control of them just like what they do to their assets, but they do not."}),(0,ec.BX)("div",{className:"flex justify-between",children:[(0,ec.BX)("div",{className:"w-[405px] flex flex-col items-center",children:[(0,ec.tZ)(tz,{}),(0,ec.tZ)("p",{className:"mt-14 text-black-3",children:"Web3 Content Widgets contains several easy-integrating, non-intrusive widges that helps Dapps to manage decentralized IPFS storage and give back content ownership to users."})]}),(0,ec.BX)("div",{className:"flex flex-col",children:[(0,ec.BX)("div",{className:"flex",children:[(0,ec.tZ)(tH,{}),(0,ec.BX)("div",{className:"ml-9",children:[(0,ec.tZ)("h5",{className:"font-semibold text-[1.375rem] mb-4",children:"Rich-text Content Publisher Widget"}),(0,ec.tZ)("p",{className:"w-[490px] text-black-3",children:"This widget contains a rich-text editor that can auto upload contents to IPFS alongside the publish process. "}),(0,ec.BX)("div",{className:"flex mt-5 text-black-1",children:[(0,ec.tZ)(ej,{onClick:()=>t(!0),className:"btn-173",text:"Play Demo"}),(0,ec.tZ)(ej,{onClick:()=>a(!0),className:"btn-173 ml-5",text:"Show Code"})]})]})]}),(0,ec.BX)("div",{className:"flex mt-20",children:[(0,ec.tZ)(tU,{className:"mt-2"}),(0,ec.BX)("div",{className:"ml-9",children:[(0,ec.tZ)("h5",{className:"font-semibold text-[1.375rem] mb-4",children:"IPFS File Storage Widget"}),(0,ec.tZ)("p",{className:"w-[490px] text-black-3",children:"This widget helps applications/dapps to upload files of general types to IPFS and manage file storage for their users. "}),(0,ec.BX)("div",{className:"flex mt-5 text-black-1",children:[(0,ec.tZ)(ej,{onClick:()=>l(!0),className:"btn-173",text:"Play Demo"}),(0,ec.tZ)(ej,{onClick:()=>s(!0),className:"btn-173 ml-5",text:"Show Code"})]})]})]})]})]})]}),e&&(0,ec.tZ)(nX,{onClose:()=>t(!1)}),n&&(0,ec.tZ)(nY,{onClose:()=>a(!1)}),i&&(0,ec.tZ)(t$,{onClose:()=>l(!1)}),r&&(0,ec.tZ)(nR,{onClose:()=>s(!1)})]})}),nz=()=>(0,ec.BX)("div",{className:"w-full",children:[(0,ec.tZ)(tB,{}),(0,ec.tZ)(tR,{}),(0,ec.tZ)(nD,{}),(0,ec.tZ)(ta,{}),(0,ec.tZ)(ty,{})]});var nG=n(38109);function nH(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auth",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,[a,i]=(0,eo.useState)(localStorage.getItem(e)||""),{signTypedDataAsync:l}=(0,nG.yw)(),{chain:r}=(0,nG.LN)(),s=r&&r.id;r&&r.unsupported;let{address:c}=(0,nG.mA)(),o=ep(async a=>{let r=localStorage.getItem(e)||"";if(!l||!c||!s)throw"not connect wallet";let o=eJ()().unix();if(t&&r){let d=JSON.parse(window.atob(r)).data;if(d.domain.chainId==="".concat(s)&&d.message.signingAddress===c&&d.message.tokenId===a&&(0===d.message.expirationTimestamp||d.message.expirationTimestamp-o>300))return i(r),r}let m=n<=0?0:eJ()().add(n,"hours").unix(),u={domain:{chainId:"".concat(s),name:"Cloud3.cc",verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",version:"1"},message:{description:"Sign for W3 Bucket Access Authentication",signingAddress:c,tokenAddress:eR.Jh,effectiveTimestamp:o,expirationTimestamp:m},primaryType:"W3Bucket",types:{W3Bucket:[{name:"description",type:"string"},{name:"signingAddress",type:"address"},{name:"tokenAddress",type:"address"},{name:"effectiveTimestamp",type:"uint256"},{name:"expirationTimestamp",type:"uint256"}]}};a&&(u.message.tokenId=a,u.types.W3Bucket.push({name:"tokenId",type:"string"})),await e2(800);let p=await l({domain:u.domain,types:u.types,value:u.message}),y=window.btoa(JSON.stringify({data:u,signature:p}));return localStorage.setItem(e,y),i(y),y});return[o,a]}function nF(){return nH("for_mint",!0,3)}function nU(){return nH("auth",!0,12)}var nJ=n(63750),nQ=n(86893);let nV=eo.memo(e=>{let{className:t,...n}=e;return(0,ec.tZ)("span",{...n,className:ew()(t," text-white font-SquadaOne text-[2.5rem]"),children:"Crust Cloud"})});var nK=n(82775);let nq=eo.memo(e=>{let{onClose:t}=e,{connectAsync:n,connectors:a,data:i}=(0,nG.$4)(),{switchNetworkAsync:l}=(0,nG.g0)(),r=(0,eC.s0)(),s=ep(async()=>{try{let e=await (async()=>{let e=await nb()();if(e&&e.isMetaMask){await e.request({method:"eth_requestAccounts"});let t=new nv.Web3Provider(e),n=t.getSigner(),a=await n.getChainId();if(eR.k0.has(a))return a}return console.warn("Cannot get chainId from provider or unsupported chain, use ".concat(eR.XL[0].id)),eR.XL[0].id})(),t=new nK.i({chains:[eR.k0.get(e)]});console.info("data:",i),console.info("cts:",a),(!i||i.chain.unsupported)&&l?await l(e):await n({chainId:e,connector:t}),r("/buckets")}catch(s){console.error(s)}});return(0,ec.BX)(tK,{outClick:t,children:[(0,ec.tZ)(tV,{title:"Connect Wallet",onClose:t}),(0,ec.BX)("div",{onClick:s,className:"bg-[#ececec] hover:bg-[#dfdfdf] h-14 mt-5 flex px-6 py-3 cursor-pointer justify-between items-center",children:[(0,ec.tZ)(tI,{className:" text-[1.75rem]"}),(0,ec.tZ)("div",{className:" text-black-1 text-sm",children:"MetaMask"}),(0,ec.tZ)("div",{className:" w-[1.75rem]"})]})]})});var n_=JSON.parse('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"BucketMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"EditionPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"EditionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITIONS_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_MAX_MINTABLE_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_TOKEN_ID_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"}],"name":"getBucketEditionPrices","outputs":[{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"activeOnly","type":"bool"}],"name":"getBucketEditions","outputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"},{"internalType":"uint256","name":"currentSupplyMinted","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEdition[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"prices","type":"tuple[]"}],"name":"setBucketEditionPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEditionParams[]","name":"editions","type":"tuple[]"}],"name":"setBucketEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]'),n$=JSON.parse('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"BucketMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"EditionPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"EditionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITIONS_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_MAX_MINTABLE_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_TOKEN_ID_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"}],"name":"getBucketEditionPrices","outputs":[{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"activeOnly","type":"bool"}],"name":"getBucketEditions","outputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"},{"internalType":"uint256","name":"currentSupplyMinted","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEdition[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"prices","type":"tuple[]"}],"name":"setBucketEditionPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEditionParams[]","name":"editions","type":"tuple[]"}],"name":"setBucketEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]');let n0=[];function n1(){let{chain:e}=(0,nG.LN)(),t=e&&e.id,{address:n}=(0,nG.mA)();return t&&((0,eR._D)(t),(t===eV.c.arbitrumGoerli.id||t===eV.c.arbitrum.id)&&(n0=n_),n0=n$),(0,eo.useMemo)(()=>n&&eR.k0.has(t),[n,t])}var n2=n(60155),n5=n(62313);let n3=eQ.TQ||eQ.Cg?"Claim your test version W3Bucket NFT and start your decentralized cloud storage experience on Crust Cloud testnet. To continue, please connect your Ethereum wallet and switch to Goerli testnet.":"W3Bucket runs on Ethereum mainnet. To start your decentralized cloud storage experience, please connect your Ethereum wallet.",n4=eo.memo(e=>{let{menuId:t,children:n,...a}=e,{address:i}=(0,nG.mA)(),{chain:l}=(0,nG.LN)(),r=n1(),s=(0,eo.useMemo)(()=>[{id:1,icon:nJ.QdO,text:"W3Buckets",path:"/buckets"},{id:2,icon:tT,text:"Settings",path:"/settings"},{id:3,icon:"cru-fo-homework",text:"Docs",url:"https://docs.crustcloud.io"}],[]),c=(0,eC.s0)(),[o,d]=(0,eo.useState)(!1);(0,eo.useEffect)(()=>{r&&d(!1)},[r]);let{disconnect:m}=(0,nG.qL)(),u=ep(()=>{m(),localStorage.removeItem("for_mint"),localStorage.removeItem("auth"),localStorage.removeItem("for_upload"),c("/buckets")}),p=(0,eo.useRef)(null),y=(0,n5.Z)(p);return(0,ec.tZ)("div",{...a,className:ew()(a.className," w-full h-screen min-h-max text-black-1"),children:(0,ec.BX)("div",{className:" w-full flex h-full",children:[(0,ec.BX)("div",{className:"h-full w-64 flex flex-col border-r-8 border-solid border-[#EEEEEE]",children:[(0,ec.BX)("div",{className:"my-8 flex items-center mx-auto",children:[(0,ec.tZ)(nV,{className:"text-black-1"}),r&&(0,ec.tZ)("div",{className:ew()(" ml-4 text-xs px-[0.39rem] py-[0.13rem] mb-[-0.42rem] text-white",eQ.TQ||eQ.Cg?"bg-gray-11":"bg-blue-2"),children:l.name.replace(" ","")})]}),(0,ec.tZ)("div",{className:"flex-1",children:s.map((e,n)=>(0,ec.BX)("div",{className:ew()(" pl-10 py-4 text-lg cursor-pointer ",{"bg-black-1":e.id===t,"text-white":e.id===t,"!text-gray-7 !bg-transparent":!r}),onClick(){r&&(e.path?c(e.path):e.url&&e_(e.url))},children:[(0,ec.tZ)(tQ,{icon:r?e.icon:n2.gMo,className:" text-2xl inline-block align-middle"}),(0,ec.tZ)("span",{className:"ml-3 align-middle",children:e.text})]},"menu_".concat(n)))}),(0,ec.tZ)(ej,{ref:p,className:ew()("w-[12.8125rem] h-[3.375rem] text-lg self-end mx-auto mb-10",{" hidden":!r}),onClick:u,text:y?"Disconnect":eK(i,6,6)})]}),r?n:(0,ec.BX)("div",{className:"flex-1 flex px-[15%] pt-[30vh] h-full flex-col items-center",children:[(0,ec.tZ)("div",{className:" text-xl text-black text-center",children:n3}),(0,ec.tZ)(ej,{text:"Connect Wallet",className:"mt-8",onClick:()=>d(!0)})]}),o&&(0,ec.tZ)(nq,{onClose:()=>d(!1)})]})})});var n6=n(89211),n8=n(69293);let n7=eo.memo(function(e){let{text:t,dropData:n,onChange:a,className:i}=e,[l,r]=(0,n6.Z)(!1),s=(0,eo.useRef)();(0,n8.Z)(s,()=>l&&r(!1));let c=e=>{r(!1),a&&a(e)};return(0,ec.BX)("div",{className:"text-black relative",ref:s,children:[(0,ec.tZ)(ej,{className:"btn-173",text:t,onClick:()=>r(!l)}),l&&(0,ec.tZ)("ul",{className:"text-black absolute w-full bg-white mt-3 border-1 border-gray-300 top-10 left-0 p-2 text-sm",children:n&&n.length>0&&n.map((e,t)=>(0,ec.BX)("li",{onClick:()=>c(e.value),className:"h-10 cursor-pointer leading-10 hover:bg-zinc-200 px-2 flex items-center",children:[e.icon&&(0,ec.tZ)(tQ,{icon:e.icon,className:"text-sm mr-3"}),e.text]},"dropdown".concat(t)))})]})}),n9=eo.memo(function(e){let{text:t,status:n,className:a}=e;return(0,ec.BX)("div",{className:ew()("flex items-center text-sm text-black border-1 h-14 w-full px-5","success"===n?"border-[#32CB9D] bg-green-50":"border-[#EF4C56] bg-rose-50"),children:[(0,ec.tZ)(tQ,{icon:"success"===n?tq.mny:tq.LHV,className:ew()("text-xl mr-3","success"===n?"text-[#32CB9D]":"text-[#EF4C56]")}),(0,ec.tZ)("span",{children:t})]})});function ae(){let{store:{currentGateway:e},oUpdate:t}=ex(),n=(0,eo.useMemo)(()=>e||function(){let e=localStorage.getItem("last_gateway"),t=eR.gi.find(t=>t.value===e);return(console.info("last-:",t),t)?t:eR.gi[0]}(),[e]),a=ep(e=>{t({currentGateway:e}),localStorage.setItem("last_gateway",e.value)});return{list:eR.gi,setCurrent:a,current:n}}function at(e){let{total:t,pgSize:n,pgNum:a,onChange:i,className:l}=e,r=Math.ceil(t/n),s=(0,eo.useMemo)(()=>r<=1?[]:r<=6?eF().range(r).map(e=>({name:"".concat(e+1)})):a<=3?eF().range(a+1).map(e=>({name:"".concat(e+1)})).concat([{name:"..."},{name:""+r}]):a>=r-2?[{name:"1"},{name:"..."}].concat(eF().range(a-2,r).map(e=>({name:"".concat(e+1)}))):(console.log([{name:"1"},{name:"..."},{name:a-1+""},{name:a+""},{name:a+1+""},{name:"..."},{name:r+""}]),[{name:"1"},{name:"..."},{name:a-1+""},{name:a+""},{name:a+1+""},{name:"..."},{name:r+""}]),[r,a]),c=()=>{i&&a{i&&a>1&&i(eF().toNumber(a-1))};return(0,ec.tZ)("div",{className:ew()("flex justify-center text-gray-400 text-sm mt-5",l),children:(0,ec.BX)("div",{className:"flex",children:[r>1&&(0,ec.tZ)("span",{onClick:o,className:"mr-8 cursor-pointer",children:"<"}),s.map((e,t)=>(0,ec.tZ)("div",{className:ew()({"text-black":e.name===""+a,omit:"..."===e.name},"mr-8 cursor-pointer"),onClick(){i&&"..."!==e.name&&i(eF().toNumber(e.name))},children:e.name},"key_page_".concat(t))),r>1&&(0,ec.tZ)("span",{onClick:c,className:"cursor-pointer",children:">"})]})})}var an=n(23395),aa=n(24762),ai=n(20640),al=n.n(ai);function ar(e){let t="https://api.crustcloud.io";return eQ.TQ&&(t="https://beta-api.crustcloud.io"),eQ.Cg&&(t="https://test-api.crustcloud.io"),"".concat(t).concat(e)}function as(e){let t="https://pin.crustcloud.io";return eQ.TQ&&(t="https://beta-pin.crustcloud.io"),eQ.Cg&&(t="https://test-pin.crustcloud.io"),"".concat(t).concat(e)}function ac(e){if(200===e.data.code)return e.data.data;throw{_type:"ResError",...e.data}}let ao=()=>{let{bucketId:e}=(0,eC.UO)(),t=(0,eC.s0)(),n="\n**Upload**\xa0file with the standard\xa0[IPFS API](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-add)\xa0and get the CID:\n\n~~~bash\ncurl -X POST 'https:///api/v0/add?pin=true' --header 'Authorization: Bearer ' --form 'path=@\"\"'\n~~~\n\n**Pin**\xa0the CID with the standard\xa0[IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec/#operation/addPin):\n\n~~~bash\ncurl -X POST '".concat(as("/psa/pins"),'\' --header \'Authorization: Bearer \' --data-raw \'{\n "cid": "",\n "name": ""\n}\'\n~~~\n');return(0,ec.BX)(ec.HY,{children:[(0,ec.BX)("div",{className:"sticky top-0 bg-white px-8 pt-16 flex items-center pb-5 mb-2 min-w-[62rem]",children:[(0,ec.tZ)(tQ,{icon:nJ.QdO,className:"text-xl mr-2"}),(0,ec.tZ)("span",{className:"mr-2 cursor-pointer",onClick(){t("/buckets")},children:"W3Buckets"}),(0,ec.tZ)(tQ,{icon:nQ.Tfp,className:"mr-2"}),(0,ec.tZ)("span",{children:"W3BUCKET(".concat(e,")")})]}),(0,ec.tZ)("div",{className:"px-8 pb-8 text-lg border-b-8 border-solid border-[#eeeeee] min-w-[62rem]",children:(0,ec.BX)("div",{className:" border border-black-1 border-solid px-8 pt-6 pb-5",children:[(0,ec.tZ)("div",{className:" text-xl font-medium",children:"Guidance on Storage"}),(0,ec.tZ)("div",{className:" my-4",children:"Files can be uploaded and decentralized pinned to IPFS by using this web interface, or by CLI as shown in the curl sample below."}),(0,ec.tZ)(nL,{code:n}),(0,ec.tZ)("div",{className:" mt-8 text-xl font-medium",children:"Get more references"}),(0,ec.BX)("div",{className:" mt-4 flex flex-wrap",children:[(0,ec.tZ)("a",{className:" underline text-black-1 mr-5",target:"_blank",href:"https://docs.crustcloud.io/w3bucket/aboutnft",children:"General Guidance on W3Bucket"}),(0,ec.tZ)("a",{className:" underline text-black-1 mr-5",target:"_blank",href:"https://docs.crustcloud.io/w3bucket/uploadfile",children:"Using APIs and W3Auth"})]})]})})]})},ad=e=>new Promise((t,n)=>{let a=localStorage.getItem(e+"_files");a?t(JSON.parse(a)):n()}),am=(e,t)=>new Promise(n=>{t&&localStorage.setItem(e+"_files",JSON.stringify(t)),n(!0)}),au=eo.memo(()=>{let{bucketId:e,ipnsId:t}=(0,eC.UO)(),[,n]=(0,eo.useMemo)(()=>e0(e),[e]),a=(0,eo.useRef)(null),i=(0,eo.useRef)(null),[l,r]=(0,eo.useState)({progress:0,status:"stop",errorMsg:""}),[s,c]=(0,eo.useState)(1),[o,d]=(0,eo.useState)(""),[m,u]=(0,eo.useState)(""),[p,y]=(0,eo.useState)([]),h=tt(),[f,g]=(0,eo.useState)(null),[b]=nH("for_upload",!1,1),[v]=nU(),x=(0,eC.s0)(),{address:A}=(0,nG.mA)();(0,eo.useMemo)(()=>{x("/buckets")},[A]),(0,tw.tf)(()=>{ad(e).then(e=>{y(e)}).catch(()=>{y([])})});let{current:w}=ae(),{value:Z}=(0,an.Z)(async()=>{let e=await e8.Z.request({method:"POST",params:{arg:t},url:"".concat(w.value,"/api/v0/name/resolve")}),n=await e8.Z.request({url:"".concat(w.value).concat(e.data.Path)});return n.data},[t]),{value:k}=(0,an.Z)(async()=>{let e=await v(),n=await e8.Z.request({headers:{Authorization:"Bearer ".concat(e)},method:"GET",url:ar("/auth/bucket/".concat(t))});return n.data.data},[t]),{fFiles:N,total:T}=(0,eo.useMemo)(()=>{let e=[];p&&(e=p);let t=eF().filter(e,e=>e.name.indexOf(m.trim())>-1);t=t.sort(function(e,t){return t.createTime-e.createTime});let n=eF().chunk(t,10),a=t.length;return{fFiles:n,total:a}},[m,p]);(0,eo.useEffect)(()=>{aa.Z.rebuild()},[p,N]),(0,eo.useMemo)(()=>{p&&p.length>0&&am(e,p)},[p]),(0,eo.useMemo)(()=>{if(Z&&Z.length){if(p){p.map(e=>{for(let t=0;t!t.has(e.cid)&&t.set(e.cid,1)))}else y(Z)}},[Z]);let I=()=>{a.current.value="",i.current.value=""},C=e=>{let t=e.target.files,a=0;if(!t.length)return!1;let i=!0;for(let l=0;l64){h.error("The file name cannot exceed 64 characters."),I(),i=!1;break}if(k){let{maxStorageSize:s,usedStorageSize:c}=k;if(a>s-c)return h.error("No enough space for this file/folder!"),I(),!1}if(!i)return!1;b(n).then(async e=>{try{let n=0,i=e8.Z.CancelToken.source();g(i),r({progress:0,status:"upload",errorMsg:""});let l=new FormData;if(1===t.length)l.append("file",t[0],t[0].name);else if(t.length>1){for(let s of t)l.append("file",s,s._webkitRelativePath||s.webkitRelativePath);n=1}I();let c=await e9({cancelToken:i.token,data:l,endpoint:w.value,authBasic:"Bearer ".concat(e),onProgress(e){r({progress:Math.round(99*e),status:"upload",errorMsg:""})}});g(null);let o="",d="";if("string"==typeof c){let m=c.replaceAll("}\n{","},{"),u=JSON.parse("[".concat(m,"]")),h=u.length-1;o=u[h].Hash,d=u[h].Name}else o=c.Hash,d=c.Name;if(!o||!d)return r({progress:0,status:"fail",errorMsg:""}),!1;let f=await e8.Z.request({data:{cid:o,name:d,meta:{gatewayId:1}},cancelToken:i.token,headers:{Authorization:"Bearer ".concat(e)},method:"POST",url:as("/psa/pins")}),{error:b}=f.data;if(b)return r({progress:0,status:"fail",errorMsg:b.details?b.details:""}),!1;r({progress:100,status:"success",errorMsg:""}),y(p.concat([{name:d,cid:o,fileSize:a,fileType:n,createTime:eJ()().format("X").valueOf(),isNew:!0}]))}catch(v){throw console.error(v),v}}).catch(e=>{console.log(e.toString()),I()})},B=e=>{"file"===e?a.current.click():"folder"===e&&i.current.click()},M=()=>{u(o)},S=e=>{let t=window.event||e;13==t.keyCode&&M()},E=()=>{"upload"===l.status&&f&&(f.cancel("stop"),g(null)),r({progress:0,status:"stop",errorMsg:""})};return(0,ec.BX)(n4,{menuId:1,children:[(0,ec.tZ)("div",{className:"flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:"relative",children:[(0,ec.tZ)(ao,{}),(0,ec.BX)("div",{className:"p-8 flex-1 text-lg v-full flex flex-col min-w-[62rem]",children:[(0,ec.BX)("div",{className:"sticky top-[6.5rem] bg-white w-full flex items-center z-10",children:[(0,ec.tZ)(n7,{dropData:[{text:"File",icon:nQ.tHe,value:"file"},{text:"Folder",icon:nQ.QoU,value:"folder"}],text:"Upload",onChange:B}),(0,ec.tZ)("input",{ref:a,type:"file",hidden:!0,onChange:C}),(0,ec.tZ)("input",{ref:i,type:"file",hidden:!0,webkitdirectory:"",directory:!0,onChange:C}),(0,ec.tZ)("span",{className:"ml-5",children:"Thunder Gateway Seattle, US"}),(0,ec.tZ)("div",{className:"flex-1"}),(0,ec.BX)("div",{className:"relative w-1/2 h-12 max-w-sm border-solid border-black-1 border rounded overflow-hidden",children:[(0,ec.tZ)("input",{className:"w-full h-full pl-5 pr-10 active:border-0",onKeyDown:S,onChange:e=>d(e.target.value)}),(0,ec.tZ)(tQ,{icon:nQ.jRj,className:"text-2xl absolute top-[0.7rem] right-2 cursor-pointer",onClick:M})]})]}),(0,ec.BX)("div",{className:"sticky top-36 bg-white py-4 flex items-center font-medium border-b-1 border-solid border-b-black-1 pt-5",children:[(0,ec.tZ)("div",{className:"flex-initial w-[25%] md:w-[20%] pl-3",children:"File Name"}),(0,ec.tZ)("div",{className:"flex-initial w-[20%] md:w-[25%]",children:"CID"}),(0,ec.tZ)("div",{className:"flex-initial w-[30%]",children:"Link"}),(0,ec.tZ)("div",{className:"flex-initial w-[10%]",children:"File Size"}),(0,ec.tZ)("div",{className:"flex-initial w-[15%]",children:"TimeStamp"})]}),(0,ec.tZ)("div",{className:" text-sm text-gray-6",children:N&&N[s-1]&&N[s-1].map((e,t)=>(0,ec.BX)("div",{className:ew()("flex items-center pt-4 pb-8",e.isNew?"text-gray-300":""),children:[(0,ec.tZ)("div",{className:"flex-initial w-[25%] md:w-[20%] pl-3",children:(0,ec.BX)("div",{className:"flex items-center pr-8",children:[(0,ec.tZ)("span",{className:"truncate","data-tip":e.name.length>20?e.name:"",children:e.name}),1===e.fileType&&(0,ec.tZ)(tQ,{className:"ml-2 min-w-[14px]",icon:nQ.QoU})]})}),(0,ec.tZ)("div",{className:"flex-initial w-[20%] md:w-[25%]",children:(0,ec.tZ)("span",{"data-tip":e.cid,"data-for":"cidColumn",children:eK(e.cid,10,10)})}),(0,ec.tZ)("div",{className:"flex-initial w-[30%] truncate pr-8","data-for":"linkColumn","data-tip":"".concat(eR.HE,"/ipfs/").concat(e.cid),children:"".concat(eR.HE,"/ipfs/").concat(e.cid)}),(0,ec.tZ)("div",{className:"flex-initial w-[10%]",children:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+e)return"0 B";let n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(t<0?0:t))," ").concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}(e.fileSize)}),(0,ec.tZ)("div",{className:"flex-initial w-[15%] text-gray-6",children:e.isNew?(0,ec.tZ)("span",{"data-tip":"The ".concat(0===e.fileType?"file":"folder"," has been successfully uploaded to your bucket. It takes several minutes to finalize the decentralized storage and IPNS update processes."),children:(0,ec.tZ)(tQ,{icon:nJ.kjE})}):eJ()(1e3*e.createTime).format("YYYY-MM-DD HH:mm:ss")})]},"files_".concat(t)))}),(0,ec.tZ)(at,{total:T,pgSize:10,pgNum:s,onChange(e){c(e)}})]})]})}),"stop"!==l.status&&(0,ec.BX)(tK,{children:[(0,ec.tZ)(tV,{title:"Upload File",onClose:E}),(0,ec.BX)("div",{className:"bg-white mt-5 flex py-3 cursor-pointer justify-between items-center h-20",children:["upload"===l.status&&(0,ec.tZ)(eY,{value:l.progress}),"success"===l.status&&(0,ec.tZ)(n9,{text:"Upload successful",status:l.status}),"fail"===l.status&&(0,ec.tZ)(n9,{text:l.errorMsg?l.errorMsg:"Upload fail",status:l.status}),"cancel"===l.status&&(0,ec.tZ)(n9,{text:"Upload cancel",status:"fail"})]})]}),(0,ec.tZ)(aa.Z,{id:"cidColumn",effect:"solid",isCapture:!0,delayHide:250,clickable:!0,getContent:e=>(0,ec.tZ)("div",{className:"flex items-center",children:(0,ec.BX)("div",{className:"inline-block w-[13rem] break-words",children:[e,(0,ec.tZ)(tQ,{className:"ml-2 cursor-pointer inline-block",onClick(){al()(e),h.success("copy success")},icon:nQ.C3L})]})})}),(0,ec.tZ)(aa.Z,{id:"linkColumn",effect:"solid",isCapture:!0,delayHide:250,clickable:!0,getContent:e=>(0,ec.tZ)("div",{className:"flex items-center",children:(0,ec.BX)("div",{className:"inline-block w-[15rem] break-words",children:[e,(0,ec.tZ)(tQ,{className:"ml-2 cursor-pointer inline-block",onClick(){al()(e),h.success("copy success")},icon:nQ.C3L})]})})})]})}),ap=eo.memo(e=>{let{text:t="Empty",empty_attr:n={},text_attr:a={},...i}=e;return(0,ec.BX)("div",{...i,className:ew()(i.className,"text-gray-7 flex flex-col items-center"),children:[(0,ec.tZ)(tC,{...n,className:ew()(" text-8xl",null==n?void 0:n.className)}),!!t&&(0,ec.tZ)("div",{...a,className:ew()(" text-2xl",a.className),children:t})]})}),ay=eo.memo(e=>{var t,n,a;let{data:i,className:l}=e,{chain:r}=(0,nG.LN)(),s=(0,eC.s0)(),c=(0,eo.useMemo)(()=>i.maxStorageSize/1024/1024/1024,[i]),o=(0,eo.useMemo)(()=>e3(c),[c]),d=(0,eo.useMemo)(()=>e3(i.usedStorageSize/1024/1024/1024,2),[i]),m=(0,eo.useMemo)(()=>e1(c,i.tokenId),[i,c]),u=()=>{s("/bucket/".concat(m,"/").concat(i.ipnsId))};return(0,ec.BX)("div",{className:ew()("h-min p-5 md:p-2 border border-solid border-black-1",l),children:[(0,ec.tZ)("img",{className:"w-full aspect-[360/531] object-contain",src:e4(i.metadata.image.replace("ipfs://",""))}),(0,ec.tZ)("div",{className:" text-lg font-semibold mt-[0.625rem] truncate",children:"W3BUCKET(".concat(m,")")}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Current Usage"}),(0,ec.BX)("div",{children:[(0,ec.tZ)("span",{className:"text-orange-15",children:d}),"/",o]})]}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Files"}),(0,ec.tZ)("div",{children:"".concat(i.fileCount," Files")})]}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Created"}),(0,ec.tZ)("div",{children:eJ()(1e3*i.mintTimestamp).format("YYYY-MM-DD")})]}),(0,ec.BX)("div",{className:"flex text-xs my-2 justify-between",children:[(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:(t=i.ipnsId,"".concat(eR.gi[0].value,"/ipns/").concat(t)),children:"IPNS Link"}),(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:(n=r.id,a=eR.Jh,"".concat(e5(n),"/address/").concat(a)),children:"View NFT Contract"}),(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:e4(i.metadataCid),children:"View Metadata"})]}),(0,ec.tZ)(ej,{onClick:u,className:"!w-full mt-[2px] text-lg !py-1",text:"Enter W3Bucket"})]})}),ah=eo.memo(()=>{let e=n1(),{address:t}=(0,nG.mA)(),[n]=nU(),{value:a,loading:i}=(0,an.Z)(async()=>{if(!e||!t)return[];let a=await n(),i=await e8.Z.get(ar("/auth/bucket/list"),{headers:{Authorization:"Bearer ".concat(a)}});return ac(i).sort(function(e,t){return t.mintTimestamp-e.mintTimestamp})},[e,t]),l=(0,eC.s0)(),r=(0,eo.useCallback)(()=>l("/mint"),[l]);return(0,ec.tZ)(n4,{menuId:1,children:(0,ec.BX)("div",{className:"flex-1 h-full overflow-y-auto",children:[(0,ec.BX)("div",{className:"px-8 relative pb-8",children:[(0,ec.BX)("div",{className:"sticky top-0 pt-10 bg-white ",children:[(0,ec.BX)("div",{className:" w-full flex justify-between pb-5 whitespace-nowrap ",children:[(0,ec.BX)("div",{className:" inline-block text-2xl self-center font-medium h-min",children:["Your W3Buckets(",(null==a?void 0:a.length)||0,")"]}),(0,ec.tZ)(ej,{className:"whitespace-nowrap w-max",text:"Mint a New W3Bucket",onClick:r})]}),(0,ec.tZ)("div",{className:"h-5 border-t-1 border-solid border-black-1"})]}),a&&!i&&(0,ec.tZ)("div",{className:ew()("w-full overflow-y-auto gap-5 grid grid-cols-[repeat(auto-fill,_minmax(305px,_1fr))]",a.length<3?"grid-cols-[repeat(auto-fill,_minmax(310px,310px))]":""),children:a.map((e,t)=>(0,ec.tZ)(ay,{data:e},"bucket_".concat(t)))})]}),!i&&1>(0,eH.size)(a)&&(0,ec.tZ)(ap,{text:"No Buckets",className:" h-[calc(100%_-_11rem)] justify-center"}),i&&(0,ec.tZ)(eN,{className:" h-[calc(100%_-_11rem)] justify-center"})]})})});function af(e){return(0,ec.tZ)("svg",{width:"1em",height:"1em",viewBox:"0 0 11 9",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,ec.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.4496 2.29301C10.8401 1.90248 10.8401 1.26932 10.4496 0.878796C10.0591 0.488271 9.42591 0.488271 9.03538 0.878796L4.08564 5.82854L1.96432 3.70722C1.57379 3.3167 0.940626 3.3167 0.550102 3.70722C0.159577 4.09775 0.159577 4.73091 0.550102 5.12144L3.37853 7.94986C3.76905 8.34039 4.40222 8.34039 4.79274 7.94986L10.4496 2.29301Z"})})}let ag=eo.memo(e=>{let{finish:t,active:n,text:a,type:i}=e;return(0,ec.BX)("div",{className:" flex-1",children:[(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)("div",{className:ew()(" flex-1 h-[2px] ",{"bg-orange-15":(n||t)&&"left"!==i,"bg-gray-16":!(n||t)&&"left"!==i})}),(0,ec.tZ)("div",{className:ew()(" w-4 h-4 rounded-lg bg-white flex items-center justify-center",{" !bg-orange-15":n||t}),children:t?(0,ec.tZ)(af,{className:"text-xs relative text-white"}):(0,ec.tZ)("div",{className:ew()(" w-2 h-2 rounded bg-gray-16",{" !bg-white":n})})}),(0,ec.tZ)("div",{className:ew()(" flex-1 h-[2px] ",{"bg-orange-15":t&&"right"!==i,"bg-gray-16":!t&&"right"!==i})})]}),(0,ec.tZ)("div",{className:ew()("text-center text-gray-8 mt-2",{" !text-orange-15":n}),children:a})]})}),ab=eo.memo(e=>{let{data:t,current:n}=e;return(0,ec.tZ)("div",{className:" flex",children:t.map((e,a)=>(0,ec.tZ)(ag,{text:e,type:0===a?"left":a===t.length-1?"right":"mid",finish:a{n?t({mintData:av}):t(t=>{let{mintData:n}=t;return{mintData:{...n||av,..."function"==typeof e?e(n):e}}})},[t]);return(0,eo.useMemo)(()=>[e,n],[e,n])}function aA(e){return e.map(e=>e.fmtPrice+" "+e.symbol).join(" or ")}let aw=eo.memo(e=>{let{editions:t,onNext:n}=e,{chain:a}=(0,nG.LN)(),i=a&&a.id,[l,r]=ax();(0,eo.useEffect)(()=>{void 0===l.editionId&&t.length&&r({chainId:i,editionId:t[0].id,price:t[0].prices[0]})},[l,r,t]);let s=l.editionId,c=(0,eo.useMemo)(()=>t.find(e=>e.id===s),[t,s]);return(0,ec.BX)("div",{className:" px-10 pt-9",children:[(0,ec.BX)("div",{className:" text-2xl",children:["Now you are starting to mint a new W3Bucket!",(0,ec.tZ)("br",{}),"First, choose your preferred bucket type:"]}),(0,ec.tZ)(ej,{text:"W3Bucket",disHover:!0,className:" !border-2 !border-orange-15 !text-orange-15 text-2xl py-[9px] !w-[11.25rem] mt-5"}),(0,ec.tZ)("div",{className:" text-2xl mt-12",children:"Select your preferred bucket size:"}),(0,ec.tZ)("div",{className:"flex items-center mt-5",children:t.map((e,t)=>(0,ec.BX)("div",{className:ew()("mr-4 text-center"),children:[(0,ec.tZ)(ej,{text:e3(e.capacityInGb),disHover:e.id===s,className:ew()(" font-medium !border-2 text-2xl mt-5 !w-[11.25rem] py-[9px] cursor-pointer",{"!border-orange-15 !text-orange-15":e.id===s}),onClick(){r({chainId:i,editionId:e.id,price:e.prices[0]})}}),(0,ec.tZ)("span",{className:" whitespace-nowrap text-sm mt-2 font-light",children:"".concat(aA(e.prices))})]},"editions_".concat(t)))}),c&&(0,ec.BX)("div",{className:" text-2xl mt-12",children:["Your W3Bucket NFT to be minted:"," ",(0,ec.tZ)("span",{className:" text-orange-15",children:"W3Bucket"}),","," ",(0,ec.tZ)("span",{className:" text-orange-15",children:e3(c.capacityInGb)}),(0,ec.tZ)("br",{}),"Payable: ",aA(c.prices)]}),(0,ec.tZ)(ej,{text:"Next Step",className:"mt-12 text-lg !w-[11.25rem] !h-[3.375rem]",onClick(){console.info("click:"),n()},disabled:!c})]})});var aZ=n(61501);let ak=["A-b1","A1","A2"],aN=eo.memo(e=>{let{type:t,value:n,...a}=e;return n?(0,ec.BX)("div",{...a,children:["A1"===t&&(0,ec.tZ)(aZ.QRNormal,{value:n}),"A2"===t&&(0,ec.tZ)(aZ.QRNormal,{value:n,type:"round",posType:"round"}),"A3"===t&&(0,ec.tZ)(aZ.QRNormal,{value:n,type:"rand",posType:"planet"}),"A-a1"===t&&(0,ec.tZ)(aZ.QRLine,{value:n,direction:"h-v",posType:"roundRect"}),"A-a2"===t&&(0,ec.tZ)(aZ.QRLine,{value:n,direction:"cross",posType:"rect"}),"A-b1"===t&&(0,ec.tZ)(aZ.QRFunc,{value:n,type:"round",posType:"round"}),"A-b2"===t&&(0,ec.tZ)(aZ.QRFunc,{value:n,type:"round",posType:"round",funcType:"B"}),"C1"===t&&(0,ec.tZ)(aZ.QRImage,{value:n,size:150}),"C2"===t&&(0,ec.tZ)(aZ.QRResImage,{value:n,alignType:"bw",timingType:"bw"}),"SP-1"===t&&(0,ec.tZ)(aZ.QRDsj,{value:n}),"SP-2"===t&&(0,ec.tZ)(aZ.QRRandRect,{value:n}),"SP-3"===t&&(0,ec.tZ)(aZ.QRBubble,{value:n})]}):null}),aT={gray:["#EEEEEE","#FFFFFF","#131521"],yellow:["#FFDC5E","#E9C132","#131521"],red:["#FF6B81","#F4526A","#131521"],purple:["#B073EF","#925DC8","#FFFFFF"],green:["#27C282","#1EA966","#FFFFFF"],blue:["#58AEFF","#3895EB","#FFFFFF"]},aI=eo.memo(eo.forwardRef((e,t)=>{let{size:n}=e,[{color:a,qrcode:i,ipns:l}]=ax(),[r,s,c]=aT[a];return(0,ec.BX)("div",{ref:t,id:"generate_bucket_image",className:" w-[22.5rem] h-[33.1875rem] relative p-6 flex flex-col justify-between",style:{backgroundColor:r},children:[(0,ec.BX)("div",{className:"flex items-center",style:{color:c},children:[(0,ec.tZ)("div",{className:"p-[3px] overflow-hidden rounded-xl",style:{backgroundColor:s},children:(0,ec.tZ)(tC,{style:{fontSize:"2.1875rem"}})}),(0,ec.tZ)("span",{className:" font-Roboto text-3xl font-medium ml-[0.625rem]",children:"W3BUCKET"})]}),l?(0,ec.tZ)(nJ.gHS,{className:" text-[18.75rem]",style:{color:s}}):(0,ec.tZ)(nJ.QdO,{className:" text-[18.75rem]",style:{color:s}}),(0,ec.tZ)("div",{className:" font-bold text-end",style:{color:c},children:e3(n)}),(0,ec.tZ)(aN,{value:l,type:i,className:" w-[11.5rem] h-[11.5rem] absolute left-[5rem] bottom-[7.4rem]"})]})}));var aC=n(46293);function aB(e){let{ipns:t,onContinue:n}=e,[a,i]=(0,eo.useState)(!1);return(0,ec.BX)("div",{className:"pl-12 flex-1 break-words",children:[(0,ec.BX)("div",{className:"p-8 border-solid border-black-1 border flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-xl mb-4",children:"Tip:"}),(0,ec.BX)("div",{className:"text-lg",children:["This is the QR Code of the"," ",(0,ec.tZ)("span",{className:"font-semibold",children:"IPNS name"})," for this W3Bucket. This IPNS name is a ",(0,ec.tZ)("span",{className:"font-semibold",children:"unique"})," and"," ",(0,ec.tZ)("span",{className:"font-semibold",children:"immutable"})," identifier on IPFS that ",(0,ec.tZ)("span",{className:"font-semibold",children:"permanently"})," points to the storage history (a .json file, also acts as the list of the bucket storage) of this W3Bucket."]}),(0,ec.tZ)("div",{className:"text-lg mt-7",children:"You can always fetch the storage history via any IPFS gateway or IPFS node."}),(0,ec.tZ)(ej,{text:"Got it",className:" mt-8 !w-[8.25rem] h-11 self-center",onClick:()=>i(!0)})]}),a&&(0,ec.BX)("div",{className:" mt-10 text-lg flex flex-col",children:[(0,ec.tZ)("div",{className:" break-all text-center",children:t}),(0,ec.tZ)("div",{className:" font-medium text-center",children:"The IPNS name for this W3Bucket has successfully generated and published to IPFS."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-6 !w-[8.25rem] h-11 self-center",onClick:n})]})]})}function aM(e){let t=eF().keys(aT),{onContinue:n}=e,[a,i]=ax();return(0,ec.BX)("div",{className:"px-20 flex-1 flex flex-col justify-center",children:[(0,ec.BX)("div",{className:"flex",children:[(0,ec.tZ)("div",{className:" whitespace-nowrap mr-10 mt-3",children:"Background Color"}),(0,ec.tZ)("div",{className:" flex flex-wrap items-center",children:t.map(e=>(0,ec.tZ)("div",{style:{backgroundColor:aT[e][0]},onClick:()=>i({color:e}),className:ew()("rounded-xl w-5 h-5 overflow-hidden cursor-pointer mr-[1.875rem] my-4",{"border-solid border-orange-15 border":a.color===e})},"mint_colors_".concat(e)))})]}),(0,ec.BX)("div",{className:"flex mt-8",children:[(0,ec.tZ)("div",{className:" mr-16 whitespace-nowrap",children:"QR Code Style"}),(0,ec.tZ)("div",{className:"flex items-center flex-wrap",children:ak.map(e=>(0,ec.tZ)("span",{onClick:()=>i({qrcode:e}),className:ew()(" whitespace-nowrap rounded-md px-2 py-1 overflow-hidden cursor-pointer mr-[1rem] bg-slate-50",{"border-solid border-orange-15 border":a.qrcode===e}),children:e},"mint_colors_".concat(e)))})]}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-16 !w-[11.25rem] !py-3 self-center",onClick:n})]})}function aS(e){let{data:[t,n]}=e;return(0,ec.BX)(ec.HY,{children:[(0,ec.BX)("div",{className:" text-sm mt-4",children:[t,":"]}),(0,ec.tZ)("div",{className:" text-sm text-gray-7",children:n})]})}function aE(e){let{onContinue:t}=e,[n,a]=ax(),[i,l]=eu(!1),[r]=nF(),[,s]=ey(),c=ed(),o=ep(async()=>{i||s(async()=>{try{l(!0),await e2(100);let e=document.getElementById("generate_bucket_image");if(!e)return l(!1);let t=await r(),i=await (0,aC.SE)(e),s=new FormData;s.append("file",i,"bucket_image.png");let o=await e9({data:s});await te(o.Hash,"bucket_image.png");let d=await e8.Z.post(ar("/auth/bucket/metadata/generate"),{uuid:n.uuid,cid:o.Hash},{headers:{Authorization:"Bearer ".concat(t)}}),m="success"===d.data.message;if(!m)throw d.data.message;let u=null;for(;c.safe&&(await e2(1e4),!(u=await e8.Z.get(ar("/auth/bucket/uuid/".concat(n.uuid)),{headers:{Authorization:"Bearer ".concat(t)}}).then(ac).catch(()=>null))||!u.metadataTxHash););if(!c.safe)return;a({metadata:u.metadata,metadataCID:u.metadataCid,metadataTX:u.metadataTxHash})}catch(p){console.error(p)}l(!1)})}),[d,m]=eu(!1);return(0,ec.BX)(ec.HY,{children:[!n.metadata&&!i&&(0,ec.BX)("div",{className:"px-12 flex-1 flex flex-col items-center justify-center",children:[(0,ec.tZ)("div",{className:" text-2xl text-center",children:"The metadata file (including this profile image) for your W3Bucket NFT has been fully generated. Click the Continue button to process decentralized storage for the metadata."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-8 !w-[11.25rem] !py-3 self-center",onClick:o})]}),i&&(0,ec.tZ)(eN,{className:"px-12 flex-1 justify-center",text:"The NFT metadata is being decentralized stored and it will be the very first file stored in this W3Bukcet! Please wait..."}),n.metadata&&!i&&(0,ec.BX)("div",{className:"px-12 flex-1 flex flex-col items-center",children:[(0,ec.BX)("div",{className:"p-8 w-full border-solid border-black-1 border flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-xl mb-4",children:"Tip:"}),(0,ec.BX)("div",{className:"flex",children:[(0,ec.BX)("div",{className:"flex-1 mr-8",children:[(0,ec.tZ)("div",{className:"font-semibold text-lg",children:"NFT Metadata.json file"}),(0,ec.tZ)(aS,{data:["IPFS CID",eK(n.metadataCID,10,10)]}),(0,ec.tZ)(aS,{data:["Crust Network Storage Order TXID",eK(n.metadataTX,10,10)]}),(0,ec.tZ)(aS,{data:["IPNS",eK(n.ipns,10,10)]}),(0,ec.tZ)(aS,{data:["Storage Protocol","Crust"]})]}),(0,ec.BX)("div",{className:"flex-1",children:[(0,ec.tZ)("div",{className:"font-semibold text-lg",children:"NFT profile image"}),(0,ec.tZ)(aS,{data:["IPFS CID",eK(n.metadata.image.replace("ipfs://",""),10,10)]}),(0,ec.tZ)(aS,{data:["Crust Network Storage Order TXID",eK(n.metadata.dStorage.dstorage_note,10,10)]}),(0,ec.tZ)("div",{className:" text-sm font-medium mt-6",children:"You can check them later in the W3Bucket description information."}),(0,ec.tZ)(ej,{text:"Got it",className:" mt-3 !w-[8.25rem] h-11 self-center",onClick:()=>m(!0)})]})]})]}),d&&(0,ec.BX)("div",{className:" mt-10 text-lg flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-center",children:"Congrats! The metadata of this W3Bucket is fully processed. You will soon get this truly Web3 storage bucket NFT! Click the Continue button to the last step."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-6 !w-[8.25rem] h-11 self-center",onClick:()=>t()})]})]})]})}let aX=eo.memo(e=>{let{editions:t,onNext:n}=e,[a,i]=ax(),l=a.editionId,r=(0,eo.useMemo)(()=>t.find(e=>e.id===l)||t[0],[t,l]),[s,c]=eu(0),o=(0,eo.useCallback)(()=>c(e=>e+1),[c]),d=a.ipns,[m]=nF(),[,u]=ey();return(0,eo.useEffect)(()=>{d?a.metadataTX?c(3):d&&c(e=>0===e?1:e):u(()=>m().then(e=>e8.Z.post(ar("/auth/ipns/gen"),{bucketInfo:JSON.stringify({chainId:a.chainId,editionId:a.editionId})},{headers:{Authorization:"Bearer ".concat(e)}}).then(ac)).then(e=>{i({ipns:e.ipnsId,uuid:e.uuid}),c(1)}).catch(e=>{console.info("error:",e),n(-1)}))},[d,a]),(0,ec.BX)("div",{className:" px-10 pt-9 flex",children:[(0,ec.tZ)(aI,{size:r.capacityInGb}),0===s&&(0,ec.tZ)(eN,{className:" self-center text-center p-9",text:"Generating a unique IPNS name for this W3Bucket... Please wait."}),1===s&&(0,ec.tZ)(aB,{ipns:d,onContinue:o}),2===s&&(0,ec.tZ)(aM,{onContinue:o}),3===s&&(0,ec.tZ)(aE,{onContinue:n})]})});function aO(){let e=(0,nG.yL)(),{data:t}=(0,nG.mx)();return(0,nG.cq)({address:eR.Jh,abi:n0,signerOrProvider:t||e})}var aj=n(61744),aW=n(2984);function aP(e){let{data:[t,n,a],target:i="_blank"}=e;return(0,ec.BX)("div",{className:" flex items-center text-2xl",children:[(0,ec.BX)("div",{className:" mr-2",children:[t,":"]}),a?(0,ec.tZ)("a",{className:" underline underline-offset-2 !text-black-1",target:i,href:a,children:n}):(0,ec.tZ)("div",{className:" underline underline-offset-2",children:n})]})}let aL=eo.memo(e=>{var t,n;let{editions:a,onNext:i}=e,{chain:l}=(0,nG.LN)(),r=l&&l.id,[s,c]=ax(),o=s.editionId,d=(0,eo.useMemo)(()=>a.find(e=>e.id===o),[a,o]),[m,u]=eu(!1),p=aO(),{data:y}=(0,nG.mx)(),{address:h}=(0,nG.mA)(),[f]=nF(),g=ed(),b=ep(async()=>{if(m||!p||!h||!s.price||!s.editionId||!y)return;u(!0);let e=aj.parseUnits(s.price.fmtPrice,s.price.decimals);try{let t=await f(),n="0x0000000000000000000000000000000000000000"===s.price.currency,a=null;if(n)a=await p.mint(h,aj.parseUnits(s.editionId+"",0),s.price.currency,"ipfs://".concat(s.metadataCID),{value:e});else{let l=(0,aW.uN)({address:s.price.currency,abi:aW.em,signerOrProvider:y}),r=await p.estimateGas.mint(h,aj.parseUnits(s.editionId+"",0),s.price.currency,"ipfs://".concat(s.metadataCID)).catch(()=>aj.parseUnits("396277",0));await l.approve(eR.Jh,e),a=await p.mint(h,aj.parseUnits(s.editionId+"",0),s.price.currency,"ipfs://".concat(s.metadataCID),{gasLimit:r})}await a.wait(1);let o=null;for(;;){if(!g.safe)return;if((o=await e8.Z.get(ar("/auth/bucket/uuid/".concat(s.uuid)),{headers:{Authorization:"Bearer ".concat(t)}}).then(ac).catch(()=>null))&&o.tokenId&&o.mintTxHash)break;await e2(1e4)}c({mintTx:o.mintTxHash,tokenId:o.tokenId}),i()}catch(d){console.error(d)}u(!1)}),v=(0,eC.s0)(),x=ep(()=>{c({},!0),v("/buckets")}),A=(0,eo.useMemo)(()=>s.mintTx&&d&&s.tokenId?e1(d.capacityInGb,s.tokenId):"",[s,d]);return(0,ec.BX)("div",{className:" px-10 pt-9 flex",children:[(0,ec.tZ)(aI,{size:d.capacityInGb}),!m&&!s.mintTx&&(0,ec.BX)("div",{className:"flex flex-1 px-12 flex-col items-center justify-center",children:[(0,ec.tZ)("div",{className:" text-2xl text-center",children:"Choose your preferred payment method and click the ‘Confirm and Pay’ button to proceed:"}),(0,ec.tZ)("div",{className:" flex ",children:d.prices.map((e,t)=>{var n,a;return(0,ec.BX)("div",{className:ew()("mr-4 text-center"),children:[(0,ec.tZ)(ej,{text:e.symbol,disHover:e.currency===(null===(n=s.price)||void 0===n?void 0:n.currency),className:ew()("font-medium !border-2 text-2xl mt-5 !w-[11.25rem] !py-[9px] cursor-pointer",{"!border-orange-15 !text-orange-15":e.currency===(null===(a=s.price)||void 0===a?void 0:a.currency)}),onClick(){c({price:e})}}),(0,ec.tZ)("span",{className:" text-sm mt-2 font-light whitespace-nowrap",children:"".concat(e.fmtPrice," ").concat(e.symbol," payable in 15 min")})]},"edition_price_".concat(t))})}),(0,ec.tZ)(ej,{text:"Confirm and Pay",className:"mt-12 text-lg w-48 h-[3.375rem]",onClick:b})]}),m&&(0,ec.tZ)(eN,{className:"flex-1 px-12 justify-center",text:"Payment Tx sent, please wait for a while to get on-chain confirmation..."}),!m&&s.mintTx&&(0,ec.BX)("div",{className:"flex flex-1 px-12 flex-col ",children:[(0,ec.BX)("div",{className:" text-2xl font-medium mb-8",children:["Congrats,",(0,ec.tZ)("br",{}),"You have completed all the minting processes for this W3Bucket NFT!"]}),(0,ec.tZ)(aP,{data:["W3Bucket NFT Token ID",s.tokenId,(t=s.tokenId,"".concat(e5(r),"/token/").concat(eR.Jh,"?a=").concat(t))]}),(0,ec.tZ)(aP,{data:["Mint TX ID",eK(s.mintTx,9,5),(n=s.mintTx,"".concat(e5(r),"/tx/").concat(n))]}),(0,ec.tZ)(aP,{target:"_self",data:["W3Bucket Identifier",A,"/#/bucket/".concat(A,"/").concat(s.ipns)]}),(0,ec.tZ)("div",{className:" text-2xl font-medium mt-8",children:"Return to the W3Bucket Home Page and start your Crust Cloud journey. Bon Voyage!"}),(0,ec.tZ)(ej,{text:"Complete",className:" self-center text-lg !w-[11.25rem] h-[3.375rem] mt-20",onClick:x})]})]})}),aY=eo.memo(()=>{let{value:e,loading:t}=function(){let e=aO(),{chain:t}=(0,nG.LN)(),n=t&&t.id,{data:a}=(0,nG.mx)(),i=(0,an.Z)(async()=>{if(e&&n&&a){let t=await e.getBucketEditions(!0);console.info("data:",t);let i=[];for(let l of t){if(l.maxMintableSupply.lte(l.currentSupplyMinted))continue;let r=await e.getBucketEditionPrices(l.editionId);console.info("prices:",r);let s=[];for(let c of r){let o=18,d="ETH";if("0x0000000000000000000000000000000000000000"!==c.currency){let m=(0,aW.uN)({address:c.currency,abi:aW.em,signerOrProvider:a});o=await m.decimals(),d=await m.symbol()}s.push({currency:c.currency,symbol:d,decimals:o,price:c.price.toString(),fmtPrice:aj.formatUnits(c.price,o)})}console.info("mprices:",s),s.length>=1&&i.push({id:l.editionId.toNumber(),capacityInGb:l.capacityInGigabytes.toNumber(),totalSupply:l.maxMintableSupply.toNumber(),minted:l.currentSupplyMinted.toNumber(),prices:s})}return console.info("editions:",i),i}return null},[e,n,a]);return(0,eo.useMemo)(()=>({...i,loading:i.loading}),[i])}(),n=(0,eC.s0)(),a=(0,eo.useMemo)(()=>["1.Select your preferred bucket","2.Process NFT metadata","3.Make payment and mint"],[]),[i,l]=eu(-1),[r,s]=ax(),[c]=nF();(0,eo.useEffect)(()=>{let e=async()=>{try{if(console.info("do taks:"),!r.uuid)return l(0);let e=await c(),t=await e8.Z.get(ar("/auth/bucket/uuid/".concat(r.uuid)),{headers:{Authorization:"Bearer ".concat(e)}}).then(ac),n=r.editionId;if(t.metadata){let a=t.metadata.attributes.find(e=>"Edition"===e.trait_type);a&&(n=new Number(a.value).valueOf())}s({metadata:t.metadata,ipns:t.ipnsId,metadataTX:t.metadataTxHash,metadataCID:t.metadataCid,mintTx:t.mintTxHash,tokenId:t.tokenId,editionId:n}),t.mintTxHash?l(2):t.metadataTxHash?l(1):l(0)}catch(i){l(0)}};return e(),()=>{s({},!0)}},[]);let o=(0,eo.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return l(t=>t+e)},[l]),{address:d}=(0,nG.mA)();return(0,eo.useEffect)(()=>{d&&(s({},!0),l(0))},[d]),(0,ec.tZ)(n4,{menuId:1,children:(0,ec.tZ)("div",{className:" flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:" relative px-8 pb-10",children:[(0,ec.BX)("div",{className:" sticky top-0 z-10 bg-white pt-16 pb-3",children:[(0,ec.tZ)("div",{className:"inline-block",onClick(){s({},!0),n("/buckets")},children:(0,ec.BX)("div",{className:"flex items-center cursor-pointer",children:[(0,ec.tZ)(tQ,{icon:"cru-fo-chevron-left",className:" mr-3"}),(0,ec.tZ)("span",{children:"Exit Mint Process"})]})}),(0,ec.tZ)("div",{className:"h-px bg-black-1 my-7"}),(0,ec.tZ)(ab,{data:a,current:i})]}),e&&(0,ec.BX)(ec.HY,{children:[0===i&&!t&&(0,ec.tZ)(aw,{editions:e,onNext:o}),1===i&&(0,ec.tZ)(aX,{editions:e,onNext:o}),i>=2&&(0,ec.tZ)(aL,{editions:e,onNext:o})]}),(t||i<0)&&(0,ec.tZ)(eN,{className:" text-black-1 justify-center h-[calc(100vh_-_17.75rem)]"})]})})})}),aR=eo.memo(e=>{let{options:t,current:n,perfix:a,className:i,onOptionChange:l,...r}=e,s=(0,eo.useMemo)(()=>a?"".concat(a," ").concat(n.text):n.text,[n,a]),c=(0,eo.useRef)(),[o,d]=(0,n6.Z)(!1);return(0,n8.Z)(c,()=>o&&d(!1)),(0,ec.BX)("div",{...r,ref:c,className:ew()(i," relative text-gray-7"),children:[(0,ec.BX)("div",{className:" whitespace-nowrap cursor-pointer flex items-center",onClick:d,children:[s," ",(0,ec.tZ)("span",{className:"cru-fo-chevron-down ml-3"})]}),o&&(0,ec.tZ)("div",{className:" absolute top-full right-0 shadow-md bg-white z-10",children:t.map((e,t)=>(0,ec.tZ)("div",{className:ew()(" py-[8px] px-4 whitespace-nowrap cursor-pointer",{"bg-black-1 text-white":e===n}),onClick(){l&&l(e),d(!1)},children:e.text},"options_".concat(t)))})]})}),aD=eo.memo(()=>{let{list:e,current:t,setCurrent:n}=ae(),a=(0,eo.useMemo)(()=>e.map(e=>({...e,text:"".concat(e.name," ").concat(e.location)})),[e]),i=(0,eo.useMemo)(()=>[{text:"Random"}],[]),[l,r]=(0,eo.useState)(()=>a.find(e=>e.value===t.value)),s=ep(t=>{r(t),n(e.find(e=>e.value===t.value))}),[c,o]=(0,eo.useState)(i[0]);return(0,ec.tZ)(n4,{menuId:2,children:(0,ec.tZ)("div",{className:"flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:" m-8 px-8 py-[1.5625rem] border-solid border-black-1 border min-w-[35rem]",children:[(0,ec.tZ)("div",{className:" font-medium text-xl",children:"Preferences"}),(0,ec.BX)("div",{className:" mt-4 whitespace-nowrap flex items-center",children:[(0,ec.tZ)("span",{className:"font-medium text-lg",children:"Choose preferred gateway :"}),(0,ec.tZ)(aR,{className:" ml-2",options:a,current:l,onOptionChange:s})]}),(0,ec.BX)("div",{className:" mt-4 whitespace-nowrap flex items-center",children:[(0,ec.tZ)("span",{className:"font-medium text-lg",children:"Gateway Match Strategy :"}),(0,ec.tZ)(aR,{className:" ml-2",options:i,current:c,onOptionChange:o})]})]})})})});function az(){let{store:e,update:t}=ex(),n=e.toasts||[];return(0,eo.useEffect)(()=>{let e=setInterval(()=>{t(()=>(n.shift(),{toasts:n}))},3e3);return()=>clearInterval(e)},[n]),(0,ec.tZ)("div",{className:"fixed top-5 right-5 z-[50]",children:n.map((e,t)=>(0,ec.tZ)("div",{className:"flex py-2 cursor-pointer justify-between items-center",children:(0,ec.tZ)(n9,{text:e.msg,status:e.type})},"toasts".concat(t)))})}var aG=eo.memo(function(){let e=ev();return(0,ec.tZ)(eg,{value:e,children:(0,ec.BX)("div",{className:"App relative",id:"app-root",children:[(0,ec.tZ)(aa.Z,{effect:"solid",clickable:!0,delayHide:200,isCapture:!0,overridePosition(e,t,n,a){let{top:i,left:l}=e;return a.style.maxWidth="300px",a.style.wordBreak="break-all",{top:i,left:l}}}),(0,ec.tZ)("div",{className:"App overflow-y-auto",children:(0,ec.tZ)(eI.UT,{children:(0,ec.BX)(eC.Z5,{children:[(0,ec.tZ)(eC.AW,{path:"/",element:(0,ec.tZ)(nz,{})}),(0,ec.tZ)(eC.AW,{path:"/buckets",element:(0,ec.tZ)(ah,{})}),(0,ec.tZ)(eC.AW,{path:"/bucket/:bucketId/:ipnsId",element:(0,ec.tZ)(au,{})}),(0,ec.tZ)(eC.AW,{path:"/settings",element:(0,ec.tZ)(aD,{})}),(0,ec.tZ)(eC.AW,{path:"/mint",element:(0,ec.tZ)(aY,{})})]})})}),(0,ec.tZ)(eT,{}),(0,ec.tZ)(az,{})]})})})},46601:function(){}}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/_app-5bb544e673fc4208.js b/_next/static/chunks/pages/_app-5bb544e673fc4208.js new file mode 100644 index 0000000..5c92d52 --- /dev/null +++ b/_next/static/chunks/pages/_app-5bb544e673fc4208.js @@ -0,0 +1,31 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{8417:function(t,e,r){"use strict";r.d(e,{Z:function(){return H}});var n=function(){function t(t){var e=this;this._insertTag=function(t){var r;r=0===e.tags.length?e.insertionPoint?e.insertionPoint.nextSibling:e.prepend?e.container.firstChild:e.before:e.tags[e.tags.length-1].nextSibling,e.container.insertBefore(t,r),e.tags.push(t)},this.isSpeedy=void 0===t.speedy||t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){if(this.ctr%(this.isSpeedy?65e3:1)==0){var e;this._insertTag(((e=document.createElement("style")).setAttribute("data-emotion",this.key),void 0!==this.nonce&&e.setAttribute("nonce",this.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e))}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(t){if(t.sheet)return t.sheet;for(var e=0;e0?m[A]+" "+E:a(E,/&\f/g,m[A])).trim())&&(c[w++]=k);return b(t,e,r,0===o?O:l,c,f,d)}function L(t,e,r,n){return b(t,e,r,R,h(t,0,n),h(t,n+1,-1),n)}var F=function(t,e,r){for(var n=0,i=0;n=i,i=E(),38===n&&12===i&&(e[r]=1),!k(i);)A();return h(v,t,g)},D=function(t,e){var r=-1,n=44;do switch(k(n)){case 0:38===n&&12===E()&&(e[r]=1),t[r]+=F(g-1,e,r);break;case 2:t[r]+=M(n);break;case 4:if(44===n){t[++r]=58===E()?"&\f":"",e[r]=t[r].length;break}default:t[r]+=o(n)}while(n=A());return t},U=function(t,e){var r;return r=D(S(t),e),v="",r},j=new WeakMap,q=function(t){if("rule"===t.type&&t.parent&&!(t.length<1)){for(var e=t.value,r=t.parent,n=t.column===r.column&&t.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==t.props.length||58===e.charCodeAt(0)||j.get(r))&&!n){j.set(t,!0);for(var i=[],o=U(e,i),s=r.props,a=0,u=0;a-1&&!t.return)switch(t.type){case R:t.return=function t(e,r){switch(45^l(e,0)?(((r<<2^l(e,0))<<2^l(e,1))<<2^l(e,2))<<2^l(e,3):0){case 5103:return P+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return P+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return P+e+x+e+_+e+e;case 6828:case 4268:return P+e+_+e+e;case 6165:return P+e+_+"flex-"+e+e;case 5187:return P+e+a(e,/(\w+).+(:[^]+)/,P+"box-$1$2"+_+"flex-$1$2")+e;case 5443:return P+e+_+"flex-item-"+a(e,/flex-|-self/,"")+e;case 4675:return P+e+_+"flex-line-pack"+a(e,/align-content|flex-|-self/,"")+e;case 5548:return P+e+_+a(e,"shrink","negative")+e;case 5292:return P+e+_+a(e,"basis","preferred-size")+e;case 6060:return P+"box-"+a(e,"-grow","")+P+e+_+a(e,"grow","positive")+e;case 4554:return P+a(e,/([^-])(transform)/g,"$1"+P+"$2")+e;case 6187:return a(a(a(e,/(zoom-|grab)/,P+"$1"),/(image-set)/,P+"$1"),e,"")+e;case 5495:case 3959:return a(e,/(image-set\([^]*)/,P+"$1$`$1");case 4968:return a(a(e,/(.+:)(flex-)?(.*)/,P+"box-pack:$3"+_+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+P+e+e;case 4095:case 3583:case 4068:case 2532:return a(e,/(.+)-inline(.+)/,P+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(c(e)-1-r>6)switch(l(e,r+1)){case 109:if(45!==l(e,r+4))break;case 102:return a(e,/(.+:)(.+)-([^]+)/,"$1"+P+"$2-$3$1"+x+(108==l(e,r+3)?"$3":"$2-$3"))+e;case 115:return~u(e,"stretch")?t(a(e,"stretch","fill-available"),r)+e:e}break;case 4949:if(115!==l(e,r+1))break;case 6444:switch(l(e,c(e)-3-(~u(e,"!important")&&10))){case 107:return a(e,":",":"+P)+e;case 101:return a(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+P+(45===l(e,14)?"inline-":"")+"box$3$1"+P+"$2$3$1"+_+"$2box$3")+e}break;case 5936:switch(l(e,r+11)){case 114:return P+e+_+a(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return P+e+_+a(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return P+e+_+a(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return P+e+_+e+e}return e}(t.value,t.length);break;case N:return I([w(t,{value:a(t.value,"@","@"+P)})],n);case O:if(t.length)return t.props.map(function(e){var r;switch(r=e,(r=/(::plac\w+|:read-\w+)/.exec(r))?r[0]:r){case":read-only":case":read-write":return I([w(t,{props:[a(e,/:(read-\w+)/,":"+x+"$1")]})],n);case"::placeholder":return I([w(t,{props:[a(e,/:(plac\w+)/,":"+P+"input-$1")]}),w(t,{props:[a(e,/:(plac\w+)/,":"+x+"$1")]}),w(t,{props:[a(e,/:(plac\w+)/,_+"input-$1")]})],n)}return""}).join("")}}],H=function(t){var e,r,i,s,m,w=t.key;if("css"===w){var _=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(_,function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))})}var x=t.stylisPlugins||G,P={},O=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+w+' "]'),function(t){for(var e=t.getAttribute("data-emotion").split(" "),r=1;r2||k(y)>3?"":" "}(T);break;case 92:z+=function(t,e){for(var r;--e&&A()&&!(y<48)&&!(y>102)&&(!(y>57)||!(y<65))&&(!(y>70)||!(y<97)););return r=g+(e<6&&32==E()&&32==A()),h(v,t,r)}(g-1,7);continue;case 47:switch(E()){case 42:case 47:f(b(x=function(t,e){for(;A();)if(t+y===57)break;else if(t+y===84&&47===E())break;return"/*"+h(v,e,g-1)+"*"+o(47===t?t:A())}(A(),g),r,n,C,o(y),h(x,2,-2),0),_);break;default:z+="/"}break;case 123*F:S[P++]=c(z)*U;case 125*F:case 59:case 0:switch(j){case 0:case 125:D=0;case 59+O:I>0&&c(z)-R&&f(I>32?L(z+";",i,n,R-1):L(a(z," ","")+";",i,n,R-2),_);break;case 59:z+=";";default:if(f(H=B(z,r,n,P,O,s,S,q,K=[],G=[],R),m),123===j){if(0===O)t(z,r,H,H,K,m,R,S,G);else switch(99===N&&110===l(z,3)?100:N){case 100:case 109:case 115:t(e,H,H,i&&f(B(e,H,H,0,0,s,S,q,s,K=[],R),G),s,G,R,S,i?K:G);break;default:t(z,H,H,H,[""],G,0,S,G)}}}P=O=I=0,F=U=1,q=z="",R=w;break;case 58:R=1+c(z),I=T;default:if(F<1){if(123==j)--F;else if(125==j&&0==F++&&125==(y=g>0?l(v,--g):0,p--,10===y&&(p=1,d--),y))continue}switch(z+=o(j),j*F){case 38:U=O>0?1:(z+="\f",-1);break;case 44:S[P++]=(c(z)-1)*U,U=1;break;case 64:45===E()&&(z+=M(A())),N=E(),O=R=c(q=z+=function(t){for(;!k(E());)A();return h(v,t,g)}(g)),j++;break;case 45:45===T&&2==c(z)&&(F=0)}}return m}("",null,null,null,[""],e=S(e=t),0,[0],e),v="",r),R)},F={key:w,sheet:new n({key:w,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:P,registered:{},insert:function(t,e,r,n){m=r,N(t?t+"{"+e.styles+"}":e.styles),n&&(F.inserted[e.name]=!0)}};return F.sheet.hydrate(O),F}},45042:function(t,e){"use strict";e.Z=function(t){var e=Object.create(null);return function(r){return void 0===e[r]&&(e[r]=t(r)),e[r]}}},52443:function(t,e,r){"use strict";r.d(e,{E:function(){return m},T:function(){return c},c:function(){return d},h:function(){return u},w:function(){return h}});var n=r(67294),i=r(8417),o=r(70444),s=r(48137),a=r(27278),u={}.hasOwnProperty,l=(0,n.createContext)("undefined"!=typeof HTMLElement?(0,i.Z)({key:"css"}):null);l.Provider;var h=function(t){return(0,n.forwardRef)(function(e,r){return t(e,(0,n.useContext)(l),r)})},c=(0,n.createContext)({}),f="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",d=function(t,e){var r={};for(var n in e)u.call(e,n)&&(r[n]=e[n]);return r[f]=t,r},p=function(t){var e=t.cache,r=t.serialized,n=t.isStringTag;return(0,o.hC)(e,r,n),(0,a.L)(function(){return(0,o.My)(e,r,n)}),null},m=h(function(t,e,r){var i=t.css;"string"==typeof i&&void 0!==e.registered[i]&&(i=e.registered[i]);var a=t[f],l=[i],h="";"string"==typeof t.className?h=(0,o.fp)(e.registered,l,t.className):null!=t.className&&(h=t.className+" ");var d=(0,s.O)(l,void 0,(0,n.useContext)(c));h+=e.key+"-"+d.name;var m={};for(var g in t)u.call(t,g)&&"css"!==g&&g!==f&&(m[g]=t[g]);return m.ref=r,m.className=h,(0,n.createElement)(n.Fragment,null,(0,n.createElement)(p,{cache:e,serialized:d,isStringTag:"string"==typeof a}),(0,n.createElement)(a,m))})},35944:function(t,e,r){"use strict";r.d(e,{BX:function(){return a},HY:function(){return o},tZ:function(){return s}}),r(67294),r(8417);var n=r(52443);r(8679),r(48137),r(27278);var i=r(85893),o=i.Fragment;function s(t,e,r){return n.h.call(e,"css")?(0,i.jsx)(n.E,(0,n.c)(t,e),r):(0,i.jsx)(t,e,r)}function a(t,e,r){return n.h.call(e,"css")?(0,i.jsxs)(n.E,(0,n.c)(t,e),r):(0,i.jsxs)(t,e,r)}},48137:function(t,e,r){"use strict";r.d(e,{O:function(){return m}});var n,i=function(t){for(var e,r=0,n=0,i=t.length;i>=4;++n,i-=4)e=(65535&(e=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))*1540483477+((e>>>16)*59797<<16),e^=e>>>24,r=(65535&e)*1540483477+((e>>>16)*59797<<16)^(65535&r)*1540483477+((r>>>16)*59797<<16);switch(i){case 3:r^=(255&t.charCodeAt(n+2))<<16;case 2:r^=(255&t.charCodeAt(n+1))<<8;case 1:r^=255&t.charCodeAt(n),r=(65535&r)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,(((r=(65535&r)*1540483477+((r>>>16)*59797<<16))^r>>>15)>>>0).toString(36)},o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},s=r(45042),a=/[A-Z]|^ms/g,u=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(t){return 45===t.charCodeAt(1)},h=function(t){return null!=t&&"boolean"!=typeof t},c=(0,s.Z)(function(t){return l(t)?t:t.replace(a,"-$&").toLowerCase()}),f=function(t,e){switch(t){case"animation":case"animationName":if("string"==typeof e)return e.replace(u,function(t,e,r){return n={name:e,styles:r,next:n},e})}return 1===o[t]||l(t)||"number"!=typeof e||0===e?e:e+"px"};function d(t,e,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return n={name:r.name,styles:r.styles,next:n},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)n={name:i.name,styles:i.styles,next:n},i=i.next;return r.styles+";"}return function(t,e,r){var n="";if(Array.isArray(r))for(var i=0;i{let e=t.localName;return e||c.throwError("cannot encode object for signature with missing names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]&&c.throwError("cannot encode object for signature with duplicate names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]=!0,r[e]})}else c.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&c.throwArgumentError("types/value length mismatch","tuple",r);let s=new a.QV(t.wordSize),u=new a.QV(t.wordSize),l=[];return e.forEach((t,e)=>{let r=n[e];if(t.dynamic){let i=u.length;t.encode(u,r);let o=s.writeUpdatableValue();l.push(t=>{o(t+i)})}else t.encode(s,r)}),l.forEach(t=>{t(s.length)}),t.appendWriter(s)+t.appendWriter(u)}function d(t,e){let r=[],n=t.subReader(0);e.forEach(e=>{let i=null;if(e.dynamic){let s=t.readValue(),a=n.subReader(s.toNumber());try{i=e.decode(a)}catch(u){if(u.code===o.Logger.errors.BUFFER_OVERRUN)throw u;(i=u).baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(l){if(l.code===o.Logger.errors.BUFFER_OVERRUN)throw l;(i=l).baseType=e.name,i.name=e.localName,i.type=e.type}void 0!=i&&r.push(i)});let i=e.reduce((t,e)=>{let r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t},{});e.forEach((t,e)=>{let n=t.localName;if(!n||1!==i[n]||("length"===n&&(n="_length"),null!=r[n]))return;let o=r[e];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get(){throw o}}):r[n]=o});for(let s=0;s=0?e:"")+"]",i=-1===e||t.dynamic;super("array",n,r,i),this.coder=t,this.length=e}defaultValue(){let t=this.coder.defaultValue(),e=[];for(let r=0;rt._data.length&&c.throwError("insufficient data length",o.Logger.errors.BUFFER_OVERRUN,{length:t._data.length,count:e});let r=[];for(let n=0;n{t.dynamic&&(r=!0),n.push(t.type)});let i="tuple("+n.join(",")+")";super("tuple",i,e,r),this.coders=t}defaultValue(){let t=[];this.coders.forEach(e=>{t.push(e.defaultValue())});let e=this.coders.reduce((t,e)=>{let r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t},{});return this.coders.forEach((r,n)=>{let i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))}),Object.freeze(t)}encode(t,e){return f(t,this.coders,e)}decode(t){return t.coerce(this.name,d(t,this.coders))}}var _=r(11388);let x=new o.Logger(s.i),P=RegExp(/^bytes([0-9]*)$/),C=RegExp(/^(u?int)([0-9]*)$/);class O{constructor(t){(0,i.defineReadOnly)(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new l(t.name);case"bool":return new m(t.name);case"string":return new S(t.name);case"bytes":return new y(t.name);case"array":return new p(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new M((t.components||[]).map(t=>this._getCoder(t)),t.name);case"":return new b(t.name)}let e=t.type.match(C);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&x.throwArgumentError("invalid "+e[1]+" bit length","param",t),new E(r/8,"int"===e[1],t.name)}if(e=t.type.match(P)){let n=parseInt(e[1]);return(0===n||n>32)&&x.throwArgumentError("invalid bytes length","param",t),new v(n,t.name)}return x.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new a.Ej(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new a.QV(this._getWordSize())}getDefaultValue(t){let e=t.map(t=>this._getCoder(_._R.from(t))),r=new M(e,"_");return r.defaultValue()}encode(t,e){t.length!==e.length&&x.throwError("types/values length mismatch",o.Logger.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});let r=t.map(t=>this._getCoder(_._R.from(t))),n=new M(r,"_"),i=this._getWriter();return n.encode(i,e),i.data}decode(t,e,r){let i=t.map(t=>this._getCoder(_._R.from(t))),o=new M(i,"_");return o.decode(this._getReader((0,n.arrayify)(e),r))}}let R=new O},61184:function(t,e,r){"use strict";r.d(e,{BR:function(){return l},Ej:function(){return f},QV:function(){return c},XI:function(){return h}});var n=r(16441),i=r(2593),o=r(6881),s=r(1581),a=r(95851);let u=new s.Logger(a.i);function l(t){let e=[],r=function(t,n){if(Array.isArray(n))for(let i in n){let o=t.slice();o.push(i);try{r(o,n[i])}catch(s){e.push({path:o,error:s})}}};return r([],t),e}class h{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){u.throwArgumentError(t,this.localName,e)}}class c{constructor(t){(0,o.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return(0,n.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData((0,n.concat)(t._data))}writeBytes(t){let e=(0,n.arrayify)(t),r=e.length%this.wordSize;return r&&(e=(0,n.concat)([e,this._padding.slice(r)])),this._writeData(e)}_getValue(t){let e=(0,n.arrayify)(i.O$.from(t));return e.length>this.wordSize&&u.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=(0,n.concat)([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){let t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class f{constructor(t,e,r,i){(0,o.defineReadOnly)(this,"_data",(0,n.arrayify)(t)),(0,o.defineReadOnly)(this,"wordSize",e||32),(0,o.defineReadOnly)(this,"_coerceFunc",r),(0,o.defineReadOnly)(this,"allowLoose",i),this._offset=0}get data(){return(0,n.hexlify)(this._data)}get consumed(){return this._offset}static coerce(t,e){let r=t.match("^u?int([0-9]+)$");return r&&48>=parseInt(r[1])&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):f.coerce(t,e)}_peekBytes(t,e,r){let n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:u.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new f(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}readValue(){return i.O$.from(this.readBytes(this.wordSize))}}},11388:function(t,e,r){"use strict";r.d(e,{HY:function(){return y},IC:function(){return M},QV:function(){return v},Xg:function(){return E},YW:function(){return k},_R:function(){return m},pc:function(){return d}});var n=r(2593),i=r(6881),o=r(1581),s=r(95851);let a=new o.Logger(s.i),u={},l={calldata:!0,memory:!0,storage:!0},h={calldata:!0,memory:!0};function c(t,e){if("bytes"===t||"string"===t){if(l[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&h[e])return!0;return(l[e]||"payable"===e)&&a.throwArgumentError("invalid modifier","name",e),!1}function f(t,e){for(let r in e)(0,i.defineReadOnly)(t,r,e[r])}let d=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=RegExp(/^(.*)\[([0-9]*)\]$/);class m{constructor(t,e){t!==u&&a.throwError("use fromString",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),f(this,e);let r=this.type.match(p);r?f(this,{arrayLength:parseInt(r[2]||"-1"),arrayChildren:m.fromObject({type:r[1],components:this.components}),baseType:"array"}):f(this,{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map(e=>JSON.parse(e.format(t)))),JSON.stringify(e)}let r="";return"array"===this.baseType?r+=this.arrayChildren.format(t)+"["+(this.arrayLength<0?"":String(this.arrayLength))+"]":"tuple"===this.baseType?(t!==d.sighash&&(r+=this.type),r+="("+this.components.map(e=>e.format(t)).join(t===d.full?", ":",")+")"):r+=this.type,t!==d.sighash&&(!0===this.indexed&&(r+=" indexed"),t===d.full&&this.name&&(r+=" "+this.name)),r}static from(t,e){return"string"==typeof t?m.fromString(t,e):m.fromObject(t)}static fromObject(t){return m.isParamType(t)?t:new m(u,{name:t.name||null,type:_(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(m.fromObject):null})}static fromString(t,e){var r;return r=function(t,e){let r=t;function n(e){a.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function i(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let u=0;um.fromString(t,e))}class y{constructor(t,e){t!==u&&a.throwError("use a static from method",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return y.isFragment(t)?t:"string"==typeof t?y.fromString(t):y.fromObject(t)}static fromObject(t){if(y.isFragment(t))return t;switch(t.type){case"function":return k.fromObject(t);case"event":return v.fromObject(t);case"constructor":return E.fromObject(t);case"error":return M.fromObject(t);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?v.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?k.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?E.fromString(t.trim()):"error"===t.split(" ")[0]?M.fromString(t.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!!(t&&t._isFragment)}}class v extends y{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(e=>JSON.parse(e.format(t)))});let e="";return t!==d.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map(e=>e.format(t)).join(t===d.full?", ":",")+") ",t!==d.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?v.fromString(t):v.fromObject(t)}static fromObject(t){if(v.isEventFragment(t))return t;"event"!==t.type&&a.throwArgumentError("invalid event object","value",t);let e={name:P(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(m.fromObject):[],type:"event"};return new v(u,e)}static fromString(t){let e=t.match(C);e||a.throwArgumentError("invalid event string","value",t);let r=!1;return e[3].split(" ").forEach(t=>{switch(t.trim()){case"anonymous":r=!0;break;case"":break;default:a.warn("unknown modifier: "+t)}}),v.fromObject({name:e[1].trim(),anonymous:r,inputs:g(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function b(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=n.O$.from(r[1]),r[0]):t}function w(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}})}function A(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&a.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&a.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||a.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&a.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&a.throwArgumentError("unable to determine stateMutability","value",t),e}class E extends y{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(e=>JSON.parse(e.format(t)))});t===d.sighash&&a.throwError("cannot format a constructor for sighash",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map(e=>e.format(t)).join(t===d.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?E.fromString(t):E.fromObject(t)}static fromObject(t){if(E.isConstructorFragment(t))return t;"constructor"!==t.type&&a.throwArgumentError("invalid constructor object","value",t);let e=A(t);e.constant&&a.throwArgumentError("constructor cannot be constant","value",t);let r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(m.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new E(u,r)}static fromString(t){let e={type:"constructor"},r=(t=b(t,e)).match(C);return r&&"constructor"===r[1].trim()||a.throwArgumentError("invalid constructor string","value",t),e.inputs=g(r[2].trim(),!1),w(r[3].trim(),e),E.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class k extends E{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(e=>JSON.parse(e.format(t))),outputs:this.outputs.map(e=>JSON.parse(e.format(t)))});let e="";return t!==d.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map(e=>e.format(t)).join(t===d.full?", ":",")+") ",t!==d.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map(e=>e.format(t)).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?k.fromString(t):k.fromObject(t)}static fromObject(t){if(k.isFunctionFragment(t))return t;"function"!==t.type&&a.throwArgumentError("invalid function object","value",t);let e=A(t),r={type:t.type,name:P(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(m.fromObject):[],outputs:t.outputs?t.outputs.map(m.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new k(u,r)}static fromString(t){let e={type:"function"},r=(t=b(t,e)).split(" returns ");r.length>2&&a.throwArgumentError("invalid function string","value",t);let n=r[0].match(C);if(n||a.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&P(e.name),e.inputs=g(n[2],!1),w(n[3].trim(),e),r.length>1){let i=r[1].match(C);(""!=i[1].trim()||""!=i[3].trim())&&a.throwArgumentError("unexpected tokens","value",t),e.outputs=g(i[2],!1)}else e.outputs=[];return k.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function S(t){let e=t.format();return("Error(string)"===e||"Panic(uint256)"===e)&&a.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class M extends y{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(e=>JSON.parse(e.format(t)))});let e="";return t!==d.sighash&&(e+="error "),(e+=this.name+"("+this.inputs.map(e=>e.format(t)).join(t===d.full?", ":",")+") ").trim()}static from(t){return"string"==typeof t?M.fromString(t):M.fromObject(t)}static fromObject(t){if(M.isErrorFragment(t))return t;"error"!==t.type&&a.throwArgumentError("invalid error object","value",t);let e={type:t.type,name:P(t.name),inputs:t.inputs?t.inputs.map(m.fromObject):[]};return S(new M(u,e))}static fromString(t){let e={type:"error"},r=t.match(C);return r||a.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&P(e.name),e.inputs=g(r[2],!1),S(M.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function _(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}let x=RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function P(t){return t&&t.match(x)||a.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}let C=RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},83893:function(t,e,r){"use strict";r.r(e),r.d(e,{AbiCoder:function(){return i.R},ConstructorFragment:function(){return n.Xg},ErrorFragment:function(){return n.IC},EventFragment:function(){return n.QV},FormatTypes:function(){return n.pc},Fragment:function(){return n.HY},FunctionFragment:function(){return n.YW},Indexed:function(){return o.Hk},Interface:function(){return o.vU},LogDescription:function(){return o.CC},ParamType:function(){return n._R},TransactionDescription:function(){return o.vk},checkResultErrors:function(){return s.BR},defaultAbiCoder:function(){return i.$}});var n=r(11388),i=r(84243),o=r(8198),s=r(61184)},8198:function(t,e,r){"use strict";r.d(e,{CC:function(){return p},Hk:function(){return y},vU:function(){return w},vk:function(){return m}});var n=r(19485),i=r(2593),o=r(16441),s=r(32046),a=r(38197),u=r(6881),l=r(84243),h=r(11388),c=r(1581),f=r(95851);let d=new c.Logger(f.i);class p extends u.Description{}class m extends u.Description{}class g extends u.Description{}class y extends u.Description{static isIndexed(t){return!!(t&&t._isIndexed)}}let v={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function b(t,e){let r=Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class w{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,(0,u.defineReadOnly)(this,"fragments",e.map(t=>h.HY.from(t)).filter(t=>null!=t)),(0,u.defineReadOnly)(this,"_abiCoder",(0,u.getStatic)(new.target,"getAbiCoder")()),(0,u.defineReadOnly)(this,"functions",{}),(0,u.defineReadOnly)(this,"errors",{}),(0,u.defineReadOnly)(this,"events",{}),(0,u.defineReadOnly)(this,"structs",{}),this.fragments.forEach(t=>{let e=null;switch(t.type){case"constructor":if(this.deploy){d.warn("duplicate definition - constructor");return}(0,u.defineReadOnly)(this,"deploy",t);return;case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let r=t.format();if(e[r]){d.warn("duplicate definition - "+r);return}e[r]=t}),this.deploy||(0,u.defineReadOnly)(this,"deploy",h.Xg.from({payable:!1,type:"constructor"})),(0,u.defineReadOnly)(this,"_isInterface",!0)}format(t){t||(t=h.pc.full),t===h.pc.sighash&&d.throwArgumentError("interface does not support formatting sighash","format",t);let e=this.fragments.map(e=>e.format(t));return t===h.pc.json?JSON.stringify(e.map(t=>JSON.parse(t))):e}static getAbiCoder(){return l.$}static getAddress(t){return(0,n.getAddress)(t)}static getSighash(t){return(0,o.hexDataSlice)((0,s.id)(t.format()),0,4)}static getEventTopic(t){return(0,s.id)(t.format())}getFunction(t){if((0,o.isHexString)(t)){for(let e in this.functions)if(t===this.getSighash(e))return this.functions[e];d.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){let r=t.trim(),n=Object.keys(this.functions).filter(t=>t.split("(")[0]===r);return 0===n.length?d.throwArgumentError("no matching function","name",r):n.length>1&&d.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}let i=this.functions[h.YW.fromString(t).format()];return i||d.throwArgumentError("no matching function","signature",t),i}getEvent(t){if((0,o.isHexString)(t)){let e=t.toLowerCase();for(let r in this.events)if(e===this.getEventTopic(r))return this.events[r];d.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){let n=t.trim(),i=Object.keys(this.events).filter(t=>t.split("(")[0]===n);return 0===i.length?d.throwArgumentError("no matching event","name",n):i.length>1&&d.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}let s=this.events[h.QV.fromString(t).format()];return s||d.throwArgumentError("no matching event","signature",t),s}getError(t){if((0,o.isHexString)(t)){let e=(0,u.getStatic)(this.constructor,"getSighash");for(let r in this.errors){let n=this.errors[r];if(t===e(n))return this.errors[r]}d.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){let i=t.trim(),s=Object.keys(this.errors).filter(t=>t.split("(")[0]===i);return 0===s.length?d.throwArgumentError("no matching error","name",i):s.length>1&&d.throwArgumentError("multiple matching errors","name",i),this.errors[s[0]]}let a=this.errors[h.YW.fromString(t).format()];return a||d.throwArgumentError("no matching error","signature",t),a}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(r){try{t=this.getError(t)}catch(e){throw r}}return(0,u.getStatic)(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),(0,u.getStatic)(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));let r=(0,o.arrayify)(e);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(t)&&d.throwArgumentError(`data signature does not match error ${t.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),(0,o.hexlify)((0,o.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=(0,o.arrayify)(e);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(t)&&d.throwArgumentError(`data signature does not match function ${t.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,o.hexlify)((0,o.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=(0,o.arrayify)(e),n=null,i="",s=null,a=null,u=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(l){}break;case 4:{let h=(0,o.hexlify)(r.slice(0,4)),f=v[h];if(f)s=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,u=f.signature,f.reason&&(n=s[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{let p=this.getError(h);s=this._abiCoder.decode(p.inputs,r.slice(4)),a=p.name,u=p.format()}catch(m){}}}return d.throwError("call revert exception"+i,c.Logger.errors.CALL_EXCEPTION,{method:t.format(),data:(0,o.hexlify)(e),errorArgs:s,errorName:a,errorSignature:u,reason:n})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,o.hexlify)(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&d.throwError("too many arguments for "+t.format(),c.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));let n=(t,e)=>"string"===t.type?(0,s.id)(e):"bytes"===t.type?(0,a.keccak256)((0,o.hexlify)(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=i.O$.from(e).toHexString()),"address"===t.type&&this._abiCoder.encode(["address"],[e]),(0,o.hexZeroPad)((0,o.hexlify)(e),32));for(e.forEach((e,i)=>{let o=t.inputs[i];if(!o.indexed){null!=e&&d.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e);return}null==e?r.push(null):"array"===o.baseType||"tuple"===o.baseType?d.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?r.push(e.map(t=>n(o,t))):r.push(n(o,e))});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));let r=[],n=[],i=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&d.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach((t,o)=>{let u=e[o];if(t.indexed){if("string"===t.type)r.push((0,s.id)(u));else if("bytes"===t.type)r.push((0,a.keccak256)(u));else if("tuple"===t.baseType||"array"===t.baseType)throw Error("not implemented");else r.push(this._abiCoder.encode([t.type],[u]))}else n.push(t),i.push(u)}),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){let n=this.getEventTopic(t);(0,o.isHexString)(r[0],32)&&r[0].toLowerCase()===n||d.throwError("fragment/topic mismatch",c.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}let i=[],s=[],a=[];t.inputs.forEach((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(i.push(h._R.fromObject({type:"bytes32",name:t.name})),a.push(!0)):(i.push(t),a.push(!1)):(s.push(t),a.push(!1))});let u=null!=r?this._abiCoder.decode(i,(0,o.concat)(r)):null,l=this._abiCoder.decode(s,e,!0),f=[],p=0,m=0;t.inputs.forEach((t,e)=>{if(t.indexed){if(null==u)f[e]=new y({_isIndexed:!0,hash:null});else if(a[e])f[e]=new y({_isIndexed:!0,hash:u[m++]});else try{f[e]=u[m++]}catch(r){f[e]=r}}else try{f[e]=l[p++]}catch(n){f[e]=n}if(t.name&&null==f[t.name]){let i=f[e];i instanceof Error?Object.defineProperty(f,t.name,{enumerable:!0,get(){throw b(`property ${JSON.stringify(t.name)}`,i)}}):f[t.name]=i}});for(let g=0;gnull)}),r=null,o=null,s=null;return t&&t.baseFeePerGas&&(r=t.baseFeePerGas,s=n.O$.from("1500000000"),o=t.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:r,maxFeePerGas:o,maxPriorityFeePerGas:s,gasPrice:e}},new(r||(r=Promise))(function(n,i){function s(t){try{u(o.next(t))}catch(e){i(e)}}function a(t){try{u(o.throw(t))}catch(e){i(e)}}function u(t){var e;t.done?n(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((o=o.apply(t,e||[])).next())})}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!!(t&&t._isProvider)}}},48088:function(t,e,r){"use strict";r.r(e),r.d(e,{Signer:function(){return l},VoidSigner:function(){return h}});var n=r(6881),i=r(1581),o=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let s=new i.Logger("abstract-signer/5.7.0"),a=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],u=[i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED];class l{constructor(){s.checkAbstract(new.target,l),(0,n.defineReadOnly)(this,"_isSigner",!0)}getBalance(t){return o(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)})}getTransactionCount(t){return o(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)})}estimateGas(t){return o(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let e=yield(0,n.resolveProperties)(this.checkTransaction(t));return yield this.provider.estimateGas(e)})}call(t,e){return o(this,void 0,void 0,function*(){this._checkProvider("call");let r=yield(0,n.resolveProperties)(this.checkTransaction(t));return yield this.provider.call(r,e)})}sendTransaction(t){return o(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let e=yield this.populateTransaction(t),r=yield this.signTransaction(e);return yield this.provider.sendTransaction(r)})}getChainId(){return o(this,void 0,void 0,function*(){this._checkProvider("getChainId");let t=yield this.provider.getNetwork();return t.chainId})}getGasPrice(){return o(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return o(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(t){return o(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)})}checkTransaction(t){for(let e in t)-1===a.indexOf(e)&&s.throwArgumentError("invalid transaction key: "+e,"transaction",t);let r=(0,n.shallowCopy)(t);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&s.throwArgumentError("from address mismatch","transaction",t),e[0])),r}populateTransaction(t){return o(this,void 0,void 0,function*(){let e=yield(0,n.resolveProperties)(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then(t=>o(this,void 0,void 0,function*(){if(null==t)return null;let e=yield this.resolveName(t);return null==e&&s.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})),e.to.catch(t=>{}));let r=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null!=e.gasPrice&&(2===e.type||r)?s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t):(0===e.type||1===e.type)&&r&&s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t),(2===e.type||null==e.type)&&null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)e.type=2;else if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{let a=yield this.getFeeData();if(null==e.type){if(null!=a.maxFeePerGas&&null!=a.maxPriorityFeePerGas){if(e.type=2,null!=e.gasPrice){let l=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=l,e.maxPriorityFeePerGas=l}else null==e.maxFeePerGas&&(e.maxFeePerGas=a.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=a.maxPriorityFeePerGas)}else null!=a.gasPrice?(r&&s.throwError("network does not support EIP-1559",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=a.gasPrice),e.type=0):s.throwError("failed to get consistent fee data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"})}else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=a.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch(t=>{if(u.indexOf(t.code)>=0)throw t;return s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})})),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then(e=>(0!==e[1]&&e[0]!==e[1]&&s.throwArgumentError("chainId address mismatch","transaction",t),e[0])),yield(0,n.resolveProperties)(e)})}_checkProvider(t){this.provider||s.throwError("missing provider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!!(t&&t._isSigner)}}class h extends l{constructor(t,e){super(),(0,n.defineReadOnly)(this,"address",t),(0,n.defineReadOnly)(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then(()=>{s.throwError(t,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new h(this.address,t)}}},19485:function(t,e,r){"use strict";r.r(e),r.d(e,{getAddress:function(){return m},getContractAddress:function(){return v},getCreate2Address:function(){return b},getIcapAddress:function(){return y},isAddress:function(){return g}});var n=r(16441),i=r(2593),o=r(38197),s=r(59052),a=r(1581);let u=new a.Logger("address/5.7.0");function l(t){(0,n.isHexString)(t,20)||u.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);let s=(0,n.arrayify)((0,o.keccak256)(r));for(let a=0;a<40;a+=2)s[a>>1]>>4>=8&&(e[a]=e[a].toUpperCase()),(15&s[a>>1])>=8&&(e[a+1]=e[a+1].toUpperCase());return"0x"+e.join("")}let h={};for(let c=0;c<10;c++)h[String(c)]=String(c);for(let f=0;f<26;f++)h[String.fromCharCode(65+f)]=String(10+f);let d=Math.floor(Math.log10?Math.log10(9007199254740991):Math.log(9007199254740991)/Math.LN10);function p(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map(t=>h[t]).join("");for(;e.length>=d;){let r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}function m(t){let e=null;if("string"!=typeof t&&u.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=l(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwArgumentError("bad icap checksum","address",t),e=(0,i.g$)(t.substring(4));e.length<40;)e="0"+e;e=l("0x"+e)}else u.throwArgumentError("invalid address","address",t);return e}function g(t){try{return m(t),!0}catch(e){}return!1}function y(t){let e=(0,i.t2)(m(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e}function v(t){let e=null;try{e=m(t.from)}catch(r){u.throwArgumentError("missing from address","transaction",t)}let a=(0,n.stripZeros)((0,n.arrayify)(i.O$.from(t.nonce).toHexString()));return m((0,n.hexDataSlice)((0,o.keccak256)((0,s.encode)([e,a])),12))}function b(t,e,r){return 32!==(0,n.hexDataLength)(e)&&u.throwArgumentError("salt must be 32 bytes","salt",e),32!==(0,n.hexDataLength)(r)&&u.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),m((0,n.hexDataSlice)((0,o.keccak256)((0,n.concat)(["0xff",m(t),e,r])),12))}},59567:function(t,e,r){"use strict";r.d(e,{J:function(){return i},c:function(){return o}});var n=r(16441);function i(t){t=atob(t);let e=[];for(let r=0;r0;)r.push(o%this.base),o=o/this.base|0}let a="";for(let u=0;0===e[u]&&u=0;--l)a+=this.alphabet[r[l]];return a}decode(t){if("string"!=typeof t)throw TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let r=0;r>=8;for(;o>0;)e.push(255&o),o>>=8}for(let a=0;t[a]===this._leader&&a0&&(10===arguments[0]?f||(f=!0,l.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?l.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):l.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof d)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new d(h,p(t)):t.match(/^-?[0-9]+$/)?new d(h,p(new u(t))):l.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&y("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&y("overflow","BigNumber.from",t),d.from(String(t));if("bigint"==typeof t)return d.from(t.toString());if((0,o.isBytes)(t))return d.from((0,o.hexlify)(t));if(t){if(t.toHexString){let e=t.toHexString();if("string"==typeof e)return d.from(e)}else{let r=t._hex;if(null==r&&"BigNumber"===t.type&&(r=t.hex),"string"==typeof r&&((0,o.isHexString)(r)||"-"===r[0]&&(0,o.isHexString)(r.substring(1))))return d.from(r)}}return l.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function p(t){if("string"!=typeof t)return p(t.toString(16));if("-"===t[0])return("-"===(t=t.substring(1))[0]&&l.throwArgumentError("invalid hex","value",t),"0x00"===(t=p(t)))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function m(t){return d.from(p(t))}function g(t){let e=d.from(t).toHexString();return"-"===e[0]?new u("-"+e.substring(3),16):new u(e.substring(2),16)}function y(t,e,r){let n={fault:t,operation:e};return null!=r&&(n.value=r),l.throwError(t,s.Logger.errors.NUMERIC_FAULT,n)}function v(t){return new u(t,36).toString(16)}function b(t){return new u(t,16).toString(36)}},20335:function(t,e,r){"use strict";r.d(e,{Ox:function(){return m},S5:function(){return p},xO:function(){return g},xs:function(){return y}});var n=r(16441),i=r(1581),o=r(48794),s=r(2593);let a=new i.Logger(o.i),u={},l=s.O$.from(0),h=s.O$.from(-1);function c(t,e,r,n){let o={fault:e,operation:r};return void 0!==n&&(o.value=n),a.throwError(t,i.Logger.errors.NUMERIC_FAULT,o)}let f="0";for(;f.length<256;)f+=f;function d(t){if("number"!=typeof t)try{t=s.O$.from(t).toNumber()}catch(e){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+f.substring(0,t):a.throwArgumentError("invalid decimal size","decimals",t)}function p(t,e){null==e&&(e=0);let r=d(e);t=s.O$.from(t);let n=t.lt(l);n&&(t=t.mul(h));let i=t.mod(r).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",t);let o=i[0],u=i[1];for(o||(o="0"),u||(u="0");"0"===u[u.length-1];)u=u.substring(0,u.length-1);for(u.length>r.length-1&&c("fractional component exceeds decimals","underflow","parseFixed"),""===u&&(u="0");u.lengthnull==t[e]?n:(typeof t[e]!==r&&a.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=o("signed","boolean",e),r=o("width","number",r),n=o("decimals","number",n)}return r%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new g(u,e,r,n)}}class y{constructor(t,e,r,n){t!==u&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);let e=m(this._value,this.format.decimals),r=m(t._value,t.format.decimals);return y.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);let e=m(this._value,this.format.decimals),r=m(t._value,t.format.decimals);return y.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);let e=m(this._value,this.format.decimals),r=m(t._value,t.format.decimals);return y.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);let e=m(this._value,this.format.decimals),r=m(t._value,t.format.decimals);return y.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=y.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(v.toFormat(e.format))),e}ceiling(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=y.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(v.toFormat(e.format))),e}round(t){null==t&&(t=0);let e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&a.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;let r=y.from("1"+f.substring(0,t),this.format),n=b.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&&a.throwArgumentError("invalid byte width","width",t);let e=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return(0,n.hexZeroPad)(e,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return y.fromString(this._value,t)}static fromValue(t,e,r){return null!=r||null==e||(0,s.Zm)(e)||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),y.fromString(p(t,e),g.from(r))}static fromString(t,e){null==e&&(e="fixed");let r=g.from(e),i=m(t,r.decimals);!r.signed&&i.lt(l)&&c("unsigned value cannot be negative","overflow","value",t);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=(0,n.hexZeroPad)(o,r.width/8));let s=p(i,r.decimals);return new y(u,o,s,r)}static fromBytes(t,e){null==e&&(e="fixed");let r=g.from(e);if((0,n.arrayify)(t).length>r.width/8)throw Error("overflow");let i=s.O$.from(t);r.signed&&(i=i.fromTwos(r.width));let o=i.toTwos((r.signed?0:1)+r.width).toHexString(),a=p(i,r.decimals);return new y(u,o,a,r)}static from(t,e){if("string"==typeof t)return y.fromString(t,e);if((0,n.isBytes)(t))return y.fromBytes(t,e);try{return y.fromValue(t,0,e)}catch(r){if(r.code!==i.Logger.errors.INVALID_ARGUMENT)throw r}return a.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}let v=y.from(1),b=y.from("0.5")},833:function(t,e,r){"use strict";r.r(e),r.d(e,{BigNumber:function(){return n.O$},FixedFormat:function(){return i.xO},FixedNumber:function(){return i.xs},_base16To36:function(){return n.t2},_base36To16:function(){return n.g$},formatFixed:function(){return i.S5},parseFixed:function(){return i.Ox}});var n=r(2593),i=r(20335)},83877:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{d="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(88677).Buffer}catch(s){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function l(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?t:e},o.min=function(t,e){return 0>t.cmp(e)?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[i]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(s=0,i=0;s>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var n,i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(c){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d,p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var l=1;l>>26,c=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var r,i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?p[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=m[t],h=g[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var f=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?f+r:p[l-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},d&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(d,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var e,r,n,i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&n;for(;0!==o&&s>26,this.words[s]=67108863&n;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,E=0|s[4],k=8191&E,S=E>>>13,M=0|s[5],_=8191&M,x=M>>>13,P=0|s[6],C=8191&P,O=P>>>13,R=0|s[7],N=8191&R,I=R>>>13,T=0|s[8],B=8191&T,L=T>>>13,F=0|s[9],D=8191&F,U=F>>>13,j=0|a[0],q=8191&j,K=j>>>13,G=0|a[1],H=8191&G,z=G>>>13,Q=0|a[2],W=8191&Q,J=Q>>>13,V=0|a[3],Z=8191&V,Y=V>>>13,$=0|a[4],X=8191&$,tt=$>>>13,te=0|a[5],tr=8191&te,tn=te>>>13,ti=0|a[6],to=8191&ti,ts=ti>>>13,ta=0|a[7],tu=8191&ta,tl=ta>>>13,th=0|a[8],tc=8191&th,tf=th>>>13,td=0|a[9],tp=8191&td,tm=td>>>13;r.negative=t.negative^e.negative,r.length=19;var tg=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,K))+Math.imul(f,q)|0))<<13)|0;l=((o=Math.imul(f,K))+(i>>>13)|0)+(tg>>>26)|0,tg&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,K))+Math.imul(m,q)|0,o=Math.imul(m,K);var ty=(l+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,z)|0)+Math.imul(f,H)|0))<<13)|0;l=((o=o+Math.imul(f,z)|0)+(i>>>13)|0)+(ty>>>26)|0,ty&=67108863,n=Math.imul(y,q),i=(i=Math.imul(y,K))+Math.imul(v,q)|0,o=Math.imul(v,K),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,z)|0;var tv=(l+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(f,W)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(tv>>>26)|0,tv&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,K))+Math.imul(A,q)|0,o=Math.imul(A,K),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,z)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,z)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0;var tb=(l+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(tb>>>26)|0,tb&=67108863,n=Math.imul(k,q),i=(i=Math.imul(k,K))+Math.imul(S,q)|0,o=Math.imul(S,K),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var tw=(l+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(tw>>>26)|0,tw&=67108863,n=Math.imul(_,q),i=(i=Math.imul(_,K))+Math.imul(x,q)|0,o=Math.imul(x,K),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,z)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,z)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,tt)|0;var tA=(l+(n=n+Math.imul(c,tr)|0)|0)+((8191&(i=(i=i+Math.imul(c,tn)|0)+Math.imul(f,tr)|0))<<13)|0;l=((o=o+Math.imul(f,tn)|0)+(i>>>13)|0)+(tA>>>26)|0,tA&=67108863,n=Math.imul(C,q),i=(i=Math.imul(C,K))+Math.imul(O,q)|0,o=Math.imul(O,K),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,z)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,tr)|0,i=(i=i+Math.imul(p,tn)|0)+Math.imul(m,tr)|0,o=o+Math.imul(m,tn)|0;var tE=(l+(n=n+Math.imul(c,to)|0)|0)+((8191&(i=(i=i+Math.imul(c,ts)|0)+Math.imul(f,to)|0))<<13)|0;l=((o=o+Math.imul(f,ts)|0)+(i>>>13)|0)+(tE>>>26)|0,tE&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,K))+Math.imul(I,q)|0,o=Math.imul(I,K),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,z)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(y,tr)|0,i=(i=i+Math.imul(y,tn)|0)+Math.imul(v,tr)|0,o=o+Math.imul(v,tn)|0,n=n+Math.imul(p,to)|0,i=(i=i+Math.imul(p,ts)|0)+Math.imul(m,to)|0,o=o+Math.imul(m,ts)|0;var tk=(l+(n=n+Math.imul(c,tu)|0)|0)+((8191&(i=(i=i+Math.imul(c,tl)|0)+Math.imul(f,tu)|0))<<13)|0;l=((o=o+Math.imul(f,tl)|0)+(i>>>13)|0)+(tk>>>26)|0,tk&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(L,q)|0,o=Math.imul(L,K),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,z)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,z)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,tr)|0,i=(i=i+Math.imul(w,tn)|0)+Math.imul(A,tr)|0,o=o+Math.imul(A,tn)|0,n=n+Math.imul(y,to)|0,i=(i=i+Math.imul(y,ts)|0)+Math.imul(v,to)|0,o=o+Math.imul(v,ts)|0,n=n+Math.imul(p,tu)|0,i=(i=i+Math.imul(p,tl)|0)+Math.imul(m,tu)|0,o=o+Math.imul(m,tl)|0;var tS=(l+(n=n+Math.imul(c,tc)|0)|0)+((8191&(i=(i=i+Math.imul(c,tf)|0)+Math.imul(f,tc)|0))<<13)|0;l=((o=o+Math.imul(f,tf)|0)+(i>>>13)|0)+(tS>>>26)|0,tS&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,K))+Math.imul(U,q)|0,o=Math.imul(U,K),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,z)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,z)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,tr)|0,i=(i=i+Math.imul(k,tn)|0)+Math.imul(S,tr)|0,o=o+Math.imul(S,tn)|0,n=n+Math.imul(w,to)|0,i=(i=i+Math.imul(w,ts)|0)+Math.imul(A,to)|0,o=o+Math.imul(A,ts)|0,n=n+Math.imul(y,tu)|0,i=(i=i+Math.imul(y,tl)|0)+Math.imul(v,tu)|0,o=o+Math.imul(v,tl)|0,n=n+Math.imul(p,tc)|0,i=(i=i+Math.imul(p,tf)|0)+Math.imul(m,tc)|0,o=o+Math.imul(m,tf)|0;var tM=(l+(n=n+Math.imul(c,tp)|0)|0)+((8191&(i=(i=i+Math.imul(c,tm)|0)+Math.imul(f,tp)|0))<<13)|0;l=((o=o+Math.imul(f,tm)|0)+(i>>>13)|0)+(tM>>>26)|0,tM&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(_,tr)|0,i=(i=i+Math.imul(_,tn)|0)+Math.imul(x,tr)|0,o=o+Math.imul(x,tn)|0,n=n+Math.imul(k,to)|0,i=(i=i+Math.imul(k,ts)|0)+Math.imul(S,to)|0,o=o+Math.imul(S,ts)|0,n=n+Math.imul(w,tu)|0,i=(i=i+Math.imul(w,tl)|0)+Math.imul(A,tu)|0,o=o+Math.imul(A,tl)|0,n=n+Math.imul(y,tc)|0,i=(i=i+Math.imul(y,tf)|0)+Math.imul(v,tc)|0,o=o+Math.imul(v,tf)|0;var t_=(l+(n=n+Math.imul(p,tp)|0)|0)+((8191&(i=(i=i+Math.imul(p,tm)|0)+Math.imul(m,tp)|0))<<13)|0;l=((o=o+Math.imul(m,tm)|0)+(i>>>13)|0)+(t_>>>26)|0,t_&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,J))+Math.imul(U,W)|0,o=Math.imul(U,J),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(C,tr)|0,i=(i=i+Math.imul(C,tn)|0)+Math.imul(O,tr)|0,o=o+Math.imul(O,tn)|0,n=n+Math.imul(_,to)|0,i=(i=i+Math.imul(_,ts)|0)+Math.imul(x,to)|0,o=o+Math.imul(x,ts)|0,n=n+Math.imul(k,tu)|0,i=(i=i+Math.imul(k,tl)|0)+Math.imul(S,tu)|0,o=o+Math.imul(S,tl)|0,n=n+Math.imul(w,tc)|0,i=(i=i+Math.imul(w,tf)|0)+Math.imul(A,tc)|0,o=o+Math.imul(A,tf)|0;var tx=(l+(n=n+Math.imul(y,tp)|0)|0)+((8191&(i=(i=i+Math.imul(y,tm)|0)+Math.imul(v,tp)|0))<<13)|0;l=((o=o+Math.imul(v,tm)|0)+(i>>>13)|0)+(tx>>>26)|0,tx&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(N,tr)|0,i=(i=i+Math.imul(N,tn)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,tn)|0,n=n+Math.imul(C,to)|0,i=(i=i+Math.imul(C,ts)|0)+Math.imul(O,to)|0,o=o+Math.imul(O,ts)|0,n=n+Math.imul(_,tu)|0,i=(i=i+Math.imul(_,tl)|0)+Math.imul(x,tu)|0,o=o+Math.imul(x,tl)|0,n=n+Math.imul(k,tc)|0,i=(i=i+Math.imul(k,tf)|0)+Math.imul(S,tc)|0,o=o+Math.imul(S,tf)|0;var tP=(l+(n=n+Math.imul(w,tp)|0)|0)+((8191&(i=(i=i+Math.imul(w,tm)|0)+Math.imul(A,tp)|0))<<13)|0;l=((o=o+Math.imul(A,tm)|0)+(i>>>13)|0)+(tP>>>26)|0,tP&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,tt))+Math.imul(U,X)|0,o=Math.imul(U,tt),n=n+Math.imul(B,tr)|0,i=(i=i+Math.imul(B,tn)|0)+Math.imul(L,tr)|0,o=o+Math.imul(L,tn)|0,n=n+Math.imul(N,to)|0,i=(i=i+Math.imul(N,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,n=n+Math.imul(C,tu)|0,i=(i=i+Math.imul(C,tl)|0)+Math.imul(O,tu)|0,o=o+Math.imul(O,tl)|0,n=n+Math.imul(_,tc)|0,i=(i=i+Math.imul(_,tf)|0)+Math.imul(x,tc)|0,o=o+Math.imul(x,tf)|0;var tC=(l+(n=n+Math.imul(k,tp)|0)|0)+((8191&(i=(i=i+Math.imul(k,tm)|0)+Math.imul(S,tp)|0))<<13)|0;l=((o=o+Math.imul(S,tm)|0)+(i>>>13)|0)+(tC>>>26)|0,tC&=67108863,n=Math.imul(D,tr),i=(i=Math.imul(D,tn))+Math.imul(U,tr)|0,o=Math.imul(U,tn),n=n+Math.imul(B,to)|0,i=(i=i+Math.imul(B,ts)|0)+Math.imul(L,to)|0,o=o+Math.imul(L,ts)|0,n=n+Math.imul(N,tu)|0,i=(i=i+Math.imul(N,tl)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,tl)|0,n=n+Math.imul(C,tc)|0,i=(i=i+Math.imul(C,tf)|0)+Math.imul(O,tc)|0,o=o+Math.imul(O,tf)|0;var tO=(l+(n=n+Math.imul(_,tp)|0)|0)+((8191&(i=(i=i+Math.imul(_,tm)|0)+Math.imul(x,tp)|0))<<13)|0;l=((o=o+Math.imul(x,tm)|0)+(i>>>13)|0)+(tO>>>26)|0,tO&=67108863,n=Math.imul(D,to),i=(i=Math.imul(D,ts))+Math.imul(U,to)|0,o=Math.imul(U,ts),n=n+Math.imul(B,tu)|0,i=(i=i+Math.imul(B,tl)|0)+Math.imul(L,tu)|0,o=o+Math.imul(L,tl)|0,n=n+Math.imul(N,tc)|0,i=(i=i+Math.imul(N,tf)|0)+Math.imul(I,tc)|0,o=o+Math.imul(I,tf)|0;var tR=(l+(n=n+Math.imul(C,tp)|0)|0)+((8191&(i=(i=i+Math.imul(C,tm)|0)+Math.imul(O,tp)|0))<<13)|0;l=((o=o+Math.imul(O,tm)|0)+(i>>>13)|0)+(tR>>>26)|0,tR&=67108863,n=Math.imul(D,tu),i=(i=Math.imul(D,tl))+Math.imul(U,tu)|0,o=Math.imul(U,tl),n=n+Math.imul(B,tc)|0,i=(i=i+Math.imul(B,tf)|0)+Math.imul(L,tc)|0,o=o+Math.imul(L,tf)|0;var tN=(l+(n=n+Math.imul(N,tp)|0)|0)+((8191&(i=(i=i+Math.imul(N,tm)|0)+Math.imul(I,tp)|0))<<13)|0;l=((o=o+Math.imul(I,tm)|0)+(i>>>13)|0)+(tN>>>26)|0,tN&=67108863,n=Math.imul(D,tc),i=(i=Math.imul(D,tf))+Math.imul(U,tc)|0,o=Math.imul(U,tf);var tI=(l+(n=n+Math.imul(B,tp)|0)|0)+((8191&(i=(i=i+Math.imul(B,tm)|0)+Math.imul(L,tp)|0))<<13)|0;l=((o=o+Math.imul(L,tm)|0)+(i>>>13)|0)+(tI>>>26)|0,tI&=67108863;var tT=(l+(n=Math.imul(D,tp))|0)+((8191&(i=(i=Math.imul(D,tm))+Math.imul(U,tp)|0))<<13)|0;return l=((o=Math.imul(U,tm))+(i>>>13)|0)+(tT>>>26)|0,tT&=67108863,u[0]=tg,u[1]=ty,u[2]=tv,u[3]=tb,u[4]=tw,u[5]=tA,u[6]=tE,u[7]=tk,u[8]=tS,u[9]=tM,u[10]=t_,u[11]=tx,u[12]=tP,u[13]=tC,u[14]=tO,u[15]=tR,u[16]=tN,u[17]=tI,u[18]=tT,0!==l&&(u[19]=l,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function w(t,e){this.x=t,this.y=e}Math.imul||(v=y),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,e):n<63?y(this,t,e):b(this,t,e)},w.prototype.makeRBT=function(t){for(var e=Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},w.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=(o/67108864|0)+(s>>>26),this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var i,o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return!(this.length<=r)&&!!(this.words[r]&1<=0);var e=t%26,r=(t-e)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==e&&r++,this.length=Math.min(r,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r,n=this.length-t.length,i=this.clone(),s=t,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),i.iushln(n),a=0|s.words[s.length-1]);var u=i.length-s.length;if("mod"!==e){(r=new o(null)).length=u+1,r.words=Array(r.length);for(var l=0;l=0;c--){var f=(0|i.words[s.length+c])*67108864+(0|i.words[s.length+c-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(s,f,c);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(s,1,c),i.isZero()||(i.negative^=1);r&&(r.words[c]=f)}return r&&r._strip(),i._strip(),"div"!==e&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(t,e,r){var i,s,a;return(n(!t.isZero()),this.isZero())?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e)},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=67108864%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;(e.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e,r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var s=new o(1),a=new o(0),u=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,h=1;(r.words[0]&h)==0&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,f=1;(i.words[0]&f)==0&&c<26;++c,f<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),s.isub(a)):(i.isub(r),a.isub(s))}return 0>(e=0===r.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return -1===this.cmpn(t)},o.prototype.lt=function(t){return -1===this.cmp(t)},o.prototype.lten=function(t){return 0>=this.cmpn(t)},o.prototype.lte=function(t){return 0>=this.cmp(t)},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function P(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var t=new o(null);return t.words=Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},i(k,E),k.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},k.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){var e;if(A[t])return A[t];if("k256"===t)e=new k;else if("p224"===t)e=new S;else if("p192"===t)e=new M;else if("p25519"===t)e=new _;else throw Error("Unknown prime "+t);return A[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n((t.negative|e.negative)==0,"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var l=e.words[n],h=u-1;h>=0;h--){var c=l>>h&1;if(i!==r[0]&&(i=this.sqr(i)),0===c&&0===s){a=0;continue}s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new P(t)},i(P,x),P.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},P.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},P.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},P.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},P.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},16441:function(t,e,r){"use strict";r.r(e),r.d(e,{arrayify:function(){return h},concat:function(){return c},hexConcat:function(){return b},hexDataLength:function(){return y},hexDataSlice:function(){return v},hexStripZeros:function(){return A},hexValue:function(){return w},hexZeroPad:function(){return E},hexlify:function(){return g},isBytes:function(){return l},isBytesLike:function(){return a},isHexString:function(){return p},joinSignature:function(){return S},splitSignature:function(){return k},stripZeros:function(){return f},zeroPad:function(){return d}});var n=r(1581);let i=new n.Logger("bytes/5.7.0");function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){return p(t)&&!(t.length%2)||l(t)}function u(t){return"number"==typeof t&&t==t&&t%1==0}function l(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!u(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function h(t,e){if(e||(e={}),"number"==typeof t){i.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(255&t),t=parseInt(String(t/256));return 0===r.length&&r.push(0),s(new Uint8Array(r))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),o(t)&&(t=t.toHexString()),p(t)){let n=t.substring(2);n.length%2&&("left"===e.hexPad?n="0"+n:"right"===e.hexPad?n+="0":i.throwArgumentError("hex data is odd-length","value",t));let a=[];for(let u=0;uh(t)),r=e.reduce((t,e)=>t+e.length,0),n=new Uint8Array(r);return e.reduce((t,e)=>(n.set(e,t),t+e.length),0),s(n)}function f(t){let e=h(t);if(0===e.length)return e;let r=0;for(;re&&i.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),s(r)}function p(t,e){return"string"==typeof t&&!!t.match(/^0x[0-9A-Fa-f]*$/)&&(!e||t.length===2+2*e)}let m="0123456789abcdef";function g(t,e){if(e||(e={}),"number"==typeof t){i.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=m[15&t]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),o(t))return t.toHexString();if(p(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":i.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(l(t)){let n="0x";for(let s=0;s>4]+m[15&a]}return n}return i.throwArgumentError("invalid hexlify value","value",t)}function y(t){if("string"!=typeof t)t=g(t);else if(!p(t)||t.length%2)return null;return(t.length-2)/2}function v(t,e,r){return("string"!=typeof t?t=g(t):(!p(t)||t.length%2)&&i.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r)?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function b(t){let e="0x";return t.forEach(t=>{e+=g(t).substring(2)}),e}function w(t){let e=A(g(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function A(t){"string"!=typeof t&&(t=g(t)),p(t)||i.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&i.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function k(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(t)){let r=h(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=g(r.slice(0,32)),e.s=g(r.slice(32,64))):65===r.length?(e.r=g(r.slice(0,32)),e.s=g(r.slice(32,64)),e.v=r[64]):i.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:i.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=g(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){let n=d(h(e._vs),32);e._vs=g(n);let o=n[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=o:e.recoveryParam!==o&&i.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),n[0]&=127;let s=g(n);null==e.s?e.s=s:e.s!==s&&i.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?i.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{let u=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==u&&i.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&p(e.r)?e.r=E(e.r,32):i.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&p(e.s)?e.s=E(e.s,32):i.throwArgumentError("signature missing or invalid s","signature",t);let l=h(e.s);l[0]>=128&&i.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(l[0]|=128);let c=g(l);e._vs&&(p(e._vs)||i.throwArgumentError("signature invalid _vs","signature",t),e._vs=E(e._vs,32)),null==e._vs?e._vs=c:e._vs!==c&&i.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function S(t){return g(c([(t=k(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},9279:function(t,e,r){"use strict";r.d(e,{d:function(){return n}});let n="0x0000000000000000000000000000000000000000"},21046:function(t,e,r){"use strict";r.d(e,{$B:function(){return h},Bz:function(){return l},Ce:function(){return u},PS:function(){return c},Py:function(){return a},_Y:function(){return o},fh:function(){return s},tL:function(){return i}});var n=r(2593);let i=n.O$.from(-1),o=n.O$.from(0),s=n.O$.from(1),a=n.O$.from(2),u=n.O$.from("1000000000000000000"),l=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),h=n.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),c=n.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},57218:function(t,e,r){"use strict";r.d(e,{R:function(){return n}});let n="0x0000000000000000000000000000000000000000000000000000000000000000"},21815:function(t,e,r){"use strict";r.r(e),r.d(e,{AddressZero:function(){return n.d},EtherSymbol:function(){return s},HashZero:function(){return o.R},MaxInt256:function(){return i.PS},MaxUint256:function(){return i.Bz},MinInt256:function(){return i.$B},NegativeOne:function(){return i.tL},One:function(){return i.fh},Two:function(){return i.Py},WeiPerEther:function(){return i.Ce},Zero:function(){return i._Y}});var n=r(9279),i=r(21046),o=r(57218);let s="Ξ"},64146:function(t,e,r){"use strict";r.r(e),r.d(e,{BaseContract:function(){return x},Contract:function(){return P},ContractFactory:function(){return C}});var n=r(61184),i=r(8198),o=r(81556),s=r(48088),a=r(19485),u=r(2593),l=r(16441),h=r(6881),c=r(83875),f=r(1581),d=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let p=new f.Logger("contracts/5.7.0"),m={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function g(t,e){return d(this,void 0,void 0,function*(){let r=yield e;"string"!=typeof r&&p.throwArgumentError("invalid address or ENS name","name",r);try{return(0,a.getAddress)(r)}catch(n){}t||p.throwError("a provider or signer is needed to resolve ENS names",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});let i=yield t.resolveName(r);return null==i&&p.throwArgumentError("resolver or addr is not configured for ENS name","name",r),i})}function y(t,e,r){return d(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((r,n)=>y(t,Array.isArray(e)?e[n]:e[r.name],r))):"address"===r.type?yield g(t,e):"tuple"===r.type?yield y(t,e,r.components):"array"===r.baseType?Array.isArray(e)?yield Promise.all(e.map(e=>y(t,e,r.arrayChildren))):Promise.reject(p.makeError("invalid value for array",f.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function v(t,e,r){return d(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=(0,h.shallowCopy)(r.pop())),p.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=(0,h.resolveProperties)({override:g(t.signer,n.from),signer:t.signer.getAddress()}).then(t=>d(this,void 0,void 0,function*(){return(0,a.getAddress)(t.signer)!==t.override&&p.throwError("Contract with a Signer cannot override from",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})):n.from=t.signer.getAddress():n.from&&(n.from=g(t.provider,n.from));let i=yield(0,h.resolveProperties)({args:y(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:(0,h.resolveProperties)(n)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},m=i.overrides;if(null!=m.nonce&&(s.nonce=u.O$.from(m.nonce).toNumber()),null!=m.gasLimit&&(s.gasLimit=u.O$.from(m.gasLimit)),null!=m.gasPrice&&(s.gasPrice=u.O$.from(m.gasPrice)),null!=m.maxFeePerGas&&(s.maxFeePerGas=u.O$.from(m.maxFeePerGas)),null!=m.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=u.O$.from(m.maxPriorityFeePerGas)),null!=m.from&&(s.from=m.from),null!=m.type&&(s.type=m.type),null!=m.accessList&&(s.accessList=(0,c.accessListify)(m.accessList)),null==s.gasLimit&&null!=e.gas){let v=21e3,b=(0,l.arrayify)(o);for(let w=0;wnull!=n[t]);return E.length&&p.throwError(`cannot override ${E.map(t=>JSON.stringify(t)).join(",")}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:E}),s})}function b(t,e){let r=e.wait.bind(e);e.wait=e=>r(e).then(e=>(e.events=e.logs.map(r=>{let n=(0,h.deepCopy)(r),i=null;try{i=t.interface.parseLog(r)}catch(o){}return i&&(n.args=i.args,n.decode=(e,r)=>t.interface.decodeEventLog(i.eventFragment,e,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>t.provider,n.getBlock=()=>t.provider.getBlock(e.blockHash),n.getTransaction=()=>t.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(e),n}),e))}function w(t,e,r){let n=t.signer||t.provider;return function(...i){return d(this,void 0,void 0,function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){let s=(0,h.shallowCopy)(i.pop());null!=s.blockTag&&(o=yield s.blockTag),delete s.blockTag,i.push(s)}null!=t.deployTransaction&&(yield t._deployed(o));let a=yield v(t,e,i),u=yield n.call(a,o);try{let l=t.interface.decodeFunctionResult(e,u);return r&&1===e.outputs.length&&(l=l[0]),l}catch(c){throw c.code===f.Logger.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=a),c}})}}function A(t,e,r){return e.constant?w(t,e,r):function(...r){return d(this,void 0,void 0,function*(){t.signer||p.throwError("sending a transaction requires a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());let n=yield v(t,e,r),i=yield t.signer.sendTransaction(n);return b(t,i),i})}}function E(t){return t.address&&(null==t.topics||0===t.topics.length)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(t=>Array.isArray(t)?t.join("|"):t).join(":"):"")}class k{constructor(t,e){(0,h.defineReadOnly)(this,"tag",t),(0,h.defineReadOnly)(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter(r=>!!e||r.listener!==t||(e=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(t=>t.listener)}listenerCount(){return this._listeners.length}run(t){let e=this.listenerCount();return this._listeners=this._listeners.filter(e=>{let r=t.slice();return setTimeout(()=>{e.listener.apply(this,r)},0),!e.once}),e}prepareEvent(t){}getEmit(t){return[t]}}class S extends k{constructor(){super("error",null)}}class M extends k{constructor(t,e,r,n){let i={address:t},o=e.getEventTopic(r);n?(o!==n[0]&&p.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(E(i),i),(0,h.defineReadOnly)(this,"address",t),(0,h.defineReadOnly)(this,"interface",e),(0,h.defineReadOnly)(this,"fragment",r)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){let e=(0,n.BR)(t.args);if(e.length)throw e[0].error;let r=(t.args||[]).slice();return r.push(t),r}}class _ extends k{constructor(t,e){super("*",{address:t}),(0,h.defineReadOnly)(this,"address",t),(0,h.defineReadOnly)(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{let e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,r)=>this.interface.decodeEventLog(e.eventFragment,t,r),t.args=e.args}catch(r){}}}class x{constructor(t,e,r){(0,h.defineReadOnly)(this,"interface",(0,h.getStatic)(new.target,"getInterface")(e)),null==r?((0,h.defineReadOnly)(this,"provider",null),(0,h.defineReadOnly)(this,"signer",null)):s.Signer.isSigner(r)?((0,h.defineReadOnly)(this,"provider",r.provider||null),(0,h.defineReadOnly)(this,"signer",r)):o.zt.isProvider(r)?((0,h.defineReadOnly)(this,"provider",r),(0,h.defineReadOnly)(this,"signer",null)):p.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,h.defineReadOnly)(this,"callStatic",{}),(0,h.defineReadOnly)(this,"estimateGas",{}),(0,h.defineReadOnly)(this,"functions",{}),(0,h.defineReadOnly)(this,"populateTransaction",{}),(0,h.defineReadOnly)(this,"filters",{});{let n={};Object.keys(this.interface.events).forEach(t=>{let e=this.interface.events[t];(0,h.defineReadOnly)(this.filters,t,(...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(e,t)})),n[e.name]||(n[e.name]=[]),n[e.name].push(t)}),Object.keys(n).forEach(t=>{let e=n[t];1===e.length?(0,h.defineReadOnly)(this.filters,t,this.filters[e[0]]):p.warn(`Duplicate definition of ${t} (${e.join(", ")})`)})}if((0,h.defineReadOnly)(this,"_runningEvents",{}),(0,h.defineReadOnly)(this,"_wrappedEmits",{}),null==t&&p.throwArgumentError("invalid contract address or ENS name","addressOrName",t),(0,h.defineReadOnly)(this,"address",t),this.provider)(0,h.defineReadOnly)(this,"resolvedAddress",g(this.provider,t));else try{(0,h.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,a.getAddress)(t)))}catch(i){p.throwError("provider is required to use ENS name as contract address",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(t=>{});let u={},l={};Object.keys(this.interface.functions).forEach(t=>{let e=this.interface.functions[t];if(l[t]){p.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);return}l[t]=!0;{let r=e.name;u[`%${r}`]||(u[`%${r}`]=[]),u[`%${r}`].push(t)}if(null==this[t]&&(0,h.defineReadOnly)(this,t,A(this,e,!0)),null==this.functions[t]&&(0,h.defineReadOnly)(this.functions,t,A(this,e,!1)),null==this.callStatic[t]&&(0,h.defineReadOnly)(this.callStatic,t,w(this,e,!0)),null==this.populateTransaction[t]){var n;(0,h.defineReadOnly)(this.populateTransaction,t,(n=this,function(...t){return v(n,e,t)}))}null==this.estimateGas[t]&&(0,h.defineReadOnly)(this.estimateGas,t,function(t,e){let r=t.signer||t.provider;return function(...n){return d(this,void 0,void 0,function*(){r||p.throwError("estimate require a provider or signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});let i=yield v(t,e,n);return yield r.estimateGas(i)})}}(this,e))}),Object.keys(u).forEach(t=>{let e=u[t];if(e.length>1)return;t=t.substring(1);let r=e[0];try{null==this[t]&&(0,h.defineReadOnly)(this,t,this[r])}catch(n){}null==this.functions[t]&&(0,h.defineReadOnly)(this.functions,t,this.functions[r]),null==this.callStatic[t]&&(0,h.defineReadOnly)(this.callStatic,t,this.callStatic[r]),null==this.populateTransaction[t]&&(0,h.defineReadOnly)(this.populateTransaction,t,this.populateTransaction[r]),null==this.estimateGas[t]&&(0,h.defineReadOnly)(this.estimateGas,t,this.estimateGas[r])})}static getContractAddress(t){return(0,a.getContractAddress)(t)}static getInterface(t){return i.vU.isInterface(t)?t:new i.vU(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,t).then(t=>("0x"===t&&p.throwError("contract not deployed",f.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(t){this.signer||p.throwError("sending a transactions require a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});let e=(0,h.shallowCopy)(t||{});return["from","to"].forEach(function(t){null!=e[t]&&p.throwError("cannot override "+t,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}),e.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(e))}connect(t){"string"==typeof t&&(t=new s.VoidSigner(t,this.provider));let e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&(0,h.defineReadOnly)(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return i.Hk.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new S);if("event"===t)return this._normalizeRunningEvent(new k("event",null));if("*"===t)return this._normalizeRunningEvent(new _(this.address,this.interface));let e=this.interface.getEvent(t);return this._normalizeRunningEvent(new M(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{let r=t.topics[0];if("string"!=typeof r)throw Error("invalid topic");let n=this.interface.getEvent(r);return this._normalizeRunningEvent(new M(this.address,this.interface,n,t.topics))}catch(i){}let o={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new k(E(o),o))}return this._normalizeRunningEvent(new _(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];let e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,r){let n=(0,h.deepCopy)(e);return n.removeListener=()=>{r&&(t.removeListener(r),this._checkRunningEvents(t))},n.getBlock=()=>this.provider.getBlock(e.blockHash),n.getTransaction=()=>this.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(n),n}_addEventListener(t,e,r){if(this.provider||p.throwError("events require a provider or a signer with a provider",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){let n=r=>{let n=this._wrapEvent(t,r,e);if(null==n.decodeError)try{let i=t.getEmit(n);this.emit(t.filter,...i)}catch(o){n.decodeError=o.error}null!=t.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[t.tag]=n,null!=t.filter&&this.provider.on(t.filter,n)}}queryFilter(t,e,r){let n=this._getRunningEvent(t),i=(0,h.shallowCopy)(n.filter);return"string"==typeof e&&(0,l.isHexString)(e,32)?(null!=r&&p.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then(t=>t.map(t=>this._wrapEvent(n,t,null)))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;let r=this._getRunningEvent(t),n=r.run(e)>0;return this._checkRunningEvents(r),n}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce((t,e)=>t+this._runningEvents[e].listenerCount(),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){let e=[];for(let r in this._runningEvents)this._runningEvents[r].listeners().forEach(t=>{e.push(t)});return e}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(let e in this._runningEvents){let r=this._runningEvents[e];r.removeAllListeners(),this._checkRunningEvents(r)}return this}let n=this._getRunningEvent(t);return n.removeAllListeners(),this._checkRunningEvents(n),this}off(t,e){if(!this.provider)return this;let r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}removeListener(t,e){return this.off(t,e)}}class P extends x{}class C{constructor(t,e,r){let n=null;"0x"!==(n="string"==typeof e?e:(0,l.isBytes)(e)?(0,l.hexlify)(e):e&&"string"==typeof e.object?e.object:"!").substring(0,2)&&(n="0x"+n),(!(0,l.isHexString)(n)||n.length%2)&&p.throwArgumentError("invalid bytecode","bytecode",e),r&&!s.Signer.isSigner(r)&&p.throwArgumentError("invalid signer","signer",r),(0,h.defineReadOnly)(this,"bytecode",n),(0,h.defineReadOnly)(this,"interface",(0,h.getStatic)(new.target,"getInterface")(t)),(0,h.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(...t){let e={};if(t.length===this.interface.deploy.inputs.length+1&&"object"==typeof t[t.length-1]){for(let r in e=(0,h.shallowCopy)(t.pop()))if(!m[r])throw Error("unknown transaction override "+r)}if(["data","from","to"].forEach(t=>{null!=e[t]&&p.throwError("cannot override "+t,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}),e.value){let n=u.O$.from(e.value);n.isZero()||this.interface.deploy.payable||p.throwError("non-payable constructor cannot override value",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})}return p.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=(0,l.hexlify)((0,l.concat)([this.bytecode,this.interface.encodeDeploy(t)])),e}deploy(...t){return d(this,void 0,void 0,function*(){let e={};t.length===this.interface.deploy.inputs.length+1&&(e=t.pop()),p.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor");let r=yield y(this.signer,t,this.interface.deploy.inputs);r.push(e);let n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=(0,h.getStatic)(this.constructor,"getContractAddress")(i),s=(0,h.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return b(s,i),(0,h.defineReadOnly)(s,"deployTransaction",i),s})}attach(t){return this.constructor.getContract(t,this.interface,this.signer)}connect(t){return new this.constructor(this.interface,this.bytecode,t)}static fromSolidity(t,e){null==t&&p.throwError("missing compiler output",f.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));let r=t.abi,n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}static getInterface(t){return P.getInterface(t)}static getContractAddress(t){return(0,a.getContractAddress)(t)}static getContract(t,e,r){return new P(t,e,r)}}},35644:function(t,e,r){"use strict";r.d(e,{i:function(){return n}});let n="hash/5.7.0"},32046:function(t,e,r){"use strict";r.d(e,{id:function(){return o}});var n=r(38197),i=r(29251);function o(t){return(0,n.keccak256)((0,i.Y0)(t))}},75931:function(t,e,r){"use strict";r.r(e),r.d(e,{_TypedDataEncoder:function(){return s.E},dnsEncode:function(){return i.Kn},ensNormalize:function(){return i.w3},hashMessage:function(){return o.r},id:function(){return n.id},isValidName:function(){return i.r1},messagePrefix:function(){return o.B},namehash:function(){return i.VM}});var n=r(32046),i=r(27586),o=r(93684),s=r(67827)},93684:function(t,e,r){"use strict";r.d(e,{B:function(){return s},r:function(){return a}});var n=r(16441),i=r(38197),o=r(29251);let s="\x19Ethereum Signed Message:\n";function a(t){return"string"==typeof t&&(t=(0,o.Y0)(t)),(0,i.keccak256)((0,n.concat)([(0,o.Y0)(s),(0,o.Y0)(String(t.length)),t]))}},27586:function(t,e,r){"use strict";let n,i;r.d(e,{Kn:function(){return O},w3:function(){return x},r1:function(){return P},VM:function(){return C}});var o,s=r(16441),a=r(29251),u=r(38197),l=r(1581),h=r(35644),c=r(59567);function f(t,e){null==e&&(e=1);let r=[],n=r.forEach,i=function(t,e){n.call(t,function(t){e>0&&Array.isArray(t)?i(t,e-1):r.push(t)})};return i(t,e),r}function d(t,e){let r=Array(t);for(let n=0,i=-1;ne[t]):r}function m(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;i>1:o>>1}return r})(t,r).forEach((t,e)=>n[e].push(t));return n}let g=(o=function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,o=[0,1];for(let s=1;s>--l&1}let f=0;for(let d=0;d<31;d++)f=f<<1|c();let p=[],m=0,g=2147483648;for(;;){let y=Math.floor(((f-m+1)*i-1)/g),v=0,b=n;for(;b-v>1;){let w=v+b>>>1;y{switch(e-k){case 3:return k+65792+(t[u++]<<16|t[u++]<<8|t[u++]);case 2:return k+256+(t[u++]<<8|t[u++]);case 1:return k+t[u++];default:return e-1}})}((0,c.J)("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),i=0,()=>o[i++]),y=new Set(p(g)),v=new Set(p(g)),b=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(function(t,e){let r=1+e(),n=e(),i=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return f(m(i.length,1+t,e).map((t,e)=>{let o=t[0],s=t.slice(1);return Array(i[e]).fill(void 0).map((t,e)=>{let i=e*n;return[o+e*r,s.map(t=>t+i)]})}))}(r,t))}for(;;){let n=t()-1;if(n<0)break;e.push(m(1+t(),1+n,t).map(t=>[t[0],t.slice(1)]))}return function(t){let e={};for(let r=0;rt-e),function t(){let e=[];for(;;){let r=p(g,n);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((t,e)=>e.set.size-t.set.size);let i=g(),o=i%3,s=!!(1&(i=i/3|0)),a=1==(i>>=1),u=2==i;return{branches:e,valid:o,fe0f:s,save:a,check:u}}());function A(t){return t.filter(t=>65039!=t)}function E(t){for(let e of t.split(".")){var r;let n=(r=e,(0,a.XL)(r));try{for(let i=n.lastIndexOf(95)-1;i>=0;i--)if(95!==n[i])throw Error("underscore only allowed at start");if(n.length>=4&&n.every(t=>t<128)&&45===n[2]&&45===n[3])throw Error("invalid label extension")}catch(o){throw Error(`Invalid label "${e}": ${o.message}`)}}return t}let k=new l.Logger(h.i),S=new Uint8Array(32);function M(t){if(0===t.length)throw Error("invalid ENS name; empty component");return t}function _(t){let e=(0,a.Y0)(E(function(t,e){let r=(0,a.XL)(t).reverse(),n=[];for(;r.length;){let i=function(t,e){var r;let n,i;let o=w,s=[],a=t.length;for(e&&(e.length=0);a;){let u=t[--a];if(!(o=null===(r=o.branches.find(t=>t.set.has(u)))||void 0===r?void 0:r.node))break;if(o.save)i=u;else if(o.check&&u===i)break;s.push(u),o.fe0f&&(s.push(65039),a>0&&65039==t[a-1]&&a--),o.valid&&(n=s.slice(),2==o.valid&&n.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return n}(r);if(i){n.push(...e(i));continue}let o=r.pop();if(y.has(o)){n.push(o);continue}if(v.has(o))continue;let s=b[o];if(s){n.push(...s);continue}throw Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`)}return E(String.fromCodePoint(...n).normalize("NFC"))}(t,A))),r=[];if(0===t.length)return r;let n=0;for(let i=0;i=e.length)throw Error("invalid ENS name; empty component");return r.push(M(e.slice(n))),r}function x(t){return _(t).map(t=>(0,a.ZN)(t)).join(".")}function P(t){try{return 0!==_(t).length}catch(e){}return!1}function C(t){"string"!=typeof t&&k.throwArgumentError("invalid ENS name; not a string","name",t);let e=S,r=_(t);for(;r.length;)e=(0,u.keccak256)((0,s.concat)([e,(0,u.keccak256)(r.pop())]));return(0,s.hexlify)(e)}function O(t){return(0,s.hexlify)((0,s.concat)(_(t).map(t=>{if(t.length>63)throw Error("invalid DNS encoded entry; length exceeds 63 bytes");let e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e})))+"00"}S.fill(0)},67827:function(t,e,r){"use strict";r.d(e,{E:function(){return M}});var n=r(19485),i=r(2593),o=r(16441),s=r(38197),a=r(6881),u=r(1581),l=r(35644),h=r(32046);let c=new u.Logger(l.i),f=new Uint8Array(32);f.fill(0);let d=i.O$.from(-1),p=i.O$.from(0),m=i.O$.from(1),g=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),y=(0,o.hexZeroPad)(m.toHexString(),32),v=(0,o.hexZeroPad)(p.toHexString(),32),b={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},w=["name","version","chainId","verifyingContract","salt"];function A(t){return function(e){return"string"!=typeof e&&c.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}let E={name:A("name"),version:A("version"),chainId:function(t){try{return i.O$.from(t).toString()}catch(e){}return c.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return(0,n.getAddress)(t).toLowerCase()}catch(e){}return c.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{let e=(0,o.arrayify)(t);if(32!==e.length)throw Error("bad length");return(0,o.hexlify)(e)}catch(r){}return c.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function k(t){{let e=t.match(/^(u?)int(\d*)$/);if(e){let r=""===e[1],a=parseInt(e[2]||"256");(a%8!=0||a>256||e[2]&&e[2]!==String(a))&&c.throwArgumentError("invalid numeric width","type",t);let u=g.mask(r?a-1:a),l=r?u.add(m).mul(d):p;return function(e){let r=i.O$.from(e);return(r.lt(l)||r.gt(u))&&c.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),(0,o.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{let b=t.match(/^bytes(\d+)$/);if(b){let w=parseInt(b[1]);return(0===w||w>32||b[1]!==String(w))&&c.throwArgumentError("invalid bytes width","type",t),function(e){let r=(0,o.arrayify)(e);return r.length!==w&&c.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){let e=(0,o.arrayify)(t),r=e.length%32;return r?(0,o.hexConcat)([e,f.slice(r)]):(0,o.hexlify)(e)}(e)}}}switch(t){case"address":return function(t){return(0,o.hexZeroPad)((0,n.getAddress)(t),32)};case"bool":return function(t){return t?y:v};case"bytes":return function(t){return(0,s.keccak256)(t)};case"string":return function(t){return(0,h.id)(t)}}return null}function S(t,e){return`${t}(${e.map(({name:t,type:e})=>e+" "+t).join(",")})`}class M{constructor(t){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(t))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});let e={},r={},n={};for(let i in Object.keys(t).forEach(t=>{e[t]={},r[t]=[],n[t]={}}),t){let o={};t[i].forEach(n=>{o[n.name]&&c.throwArgumentError(`duplicate variable name ${JSON.stringify(n.name)} in ${JSON.stringify(i)}`,"types",t),o[n.name]=!0;let s=n.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===i&&c.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);let a=k(s);a||(r[s]||c.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(i),e[i][s]=!0)})}let s=Object.keys(r).filter(t=>0===r[t].length);for(let u in 0===s.length?c.throwArgumentError("missing primary type","types",t):s.length>1&&c.throwArgumentError(`ambiguous primary types or unused types: ${s.map(t=>JSON.stringify(t)).join(", ")}`,"types",t),(0,a.defineReadOnly)(this,"primaryType",s[0]),!function i(o,s){s[o]&&c.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach(t=>{r[t]&&(i(t,s),Object.keys(s).forEach(e=>{n[e][t]=!0}))}),delete s[o]}(this.primaryType,{}),n){let l=Object.keys(n[u]);l.sort(),this._types[u]=S(u,t[u])+l.map(e=>S(e,t[e])).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{let e=k(t);if(e)return e}let r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){let n=r[1],i=this.getEncoder(n),a=parseInt(r[3]);return t=>{a>=0&&t.length!==a&&c.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let e=t.map(i);return this._types[n]&&(e=e.map(s.keccak256)),(0,s.keccak256)((0,o.hexConcat)(e))}}let u=this.types[t];if(u){let l=(0,h.id)(this._types[t]);return t=>{let e=u.map(({name:e,type:r})=>{let n=this.getEncoder(r)(t[e]);return this._types[r]?(0,s.keccak256)(n):n});return e.unshift(l),(0,o.hexConcat)(e)}}return c.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){let e=this._types[t];return e||c.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return(0,s.keccak256)(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){{let n=k(t);if(n)return r(t,e)}let i=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){let o=i[1],s=parseInt(i[3]);return s>=0&&e.length!==s&&c.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map(t=>this._visit(o,t,r))}let a=this.types[t];return a?a.reduce((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t),{}):c.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new M(t)}static getPrimaryType(t){return M.from(t).primaryType}static hashStruct(t,e,r){return M.from(e).hashStruct(t,r)}static hashDomain(t){let e=[];for(let r in t){let n=b[r];n||c.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort((t,e)=>w.indexOf(t.name)-w.indexOf(e.name)),M.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return(0,o.hexConcat)(["0x1901",M.hashDomain(t),M.from(e).hash(r)])}static hash(t,e,r){return(0,s.keccak256)(M.encode(t,e,r))}static resolveNames(t,e,r,n){var i,s,u,l;return i=this,s=void 0,u=void 0,l=function*(){t=(0,a.shallowCopy)(t);let i={};t.verifyingContract&&!(0,o.isHexString)(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");let s=M.from(e);for(let u in s.visit(r,(t,e)=>("address"!==t||(0,o.isHexString)(e,20)||(i[e]="0x"),e)),i)i[u]=yield n(u);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=s.visit(r,(t,e)=>"address"===t&&i[e]?i[e]:e),{domain:t,value:r}},new(u||(u=Promise))(function(t,e){function r(t){try{o(l.next(t))}catch(r){e(r)}}function n(t){try{o(l.throw(t))}catch(r){e(r)}}function o(e){var i;e.done?t(e.value):((i=e.value)instanceof u?i:new u(function(t){t(i)})).then(r,n)}o((l=l.apply(i,s||[])).next())})}static getPayload(t,e,r){M.hashDomain(t);let n={},s=[];w.forEach(e=>{let r=t[e];null!=r&&(n[e]=E[e](r),s.push({name:e,type:b[e]}))});let u=M.from(e),l=(0,a.shallowCopy)(e);return l.EIP712Domain?c.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):l.EIP712Domain=s,u.encode(r),{types:l,domain:n,primaryType:u.primaryType,message:u.visit(r,(t,e)=>{if(t.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.arrayify)(e));if(t.match(/^u?int/))return i.O$.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&c.throwArgumentError("invalid string","value",e),e}return c.throwArgumentError("unsupported type","type",t)})}}}},84178:function(t,e,r){"use strict";r.r(e),r.d(e,{HDNode:function(){return S},defaultPath:function(){return k},entropyToMnemonic:function(){return x},getAccountPath:function(){return C},isValidMnemonic:function(){return P},mnemonicToEntropy:function(){return _},mnemonicToSeed:function(){return M}});var n=r(57727),i=r(16441),o=r(2593),s=r(29251),a=r(85306),u=r(6881),l=r(67669),h=r(2006),c=r(21261),f=r(83875),d=r(10234),p=r(1581);let m=new p.Logger("hdnode/5.7.0"),g=o.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y=(0,s.Y0)("Bitcoin seed");function v(t){return(1<=256)throw Error("Depth too large!");return w((0,i.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,i.hexlify)(this.depth),this.parentFingerprint,(0,i.hexZeroPad)((0,i.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,i.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new S(E,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(t){if(t>4294967295)throw Error("invalid index - "+String(t));let e=this.path;e&&(e+="/"+(2147483647&t));let r=new Uint8Array(37);if(2147483648&t){if(!this.privateKey)throw Error("cannot derive child of neutered node");r.set((0,i.arrayify)(this.privateKey),1),e&&(e+="'")}else r.set((0,i.arrayify)(this.publicKey));for(let n=24;n>=0;n-=8)r[33+(n>>3)]=t>>24-n&255;let s=(0,i.arrayify)((0,h.Gy)(c.p.sha512,this.chainCode,r)),a=s.slice(0,32),u=s.slice(32),f=null,d=null;if(this.privateKey)f=b(o.O$.from(a).add(this.privateKey).mod(g));else{let p=new l.SigningKey((0,i.hexlify)(a));d=p._addPoint(this.publicKey)}let m=e,y=this.mnemonic;return y&&(m=Object.freeze({phrase:y.phrase,path:e,locale:y.locale||"en"})),new S(E,f,d,this.fingerprint,b(u),t,this.depth+1,m)}derivePath(t){let e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw Error("invalid path - "+t);"m"===e[0]&&e.shift();let r=this;for(let n=0;n=2147483648)throw Error("invalid path index - "+i);r=r._derive(2147483648+o)}else if(i.match(/^[0-9]+$/)){let s=parseInt(i);if(s>=2147483648)throw Error("invalid path index - "+i);r=r._derive(s)}else throw Error("invalid path component - "+i)}return r}static _fromSeed(t,e){let r=(0,i.arrayify)(t);if(r.length<16||r.length>64)throw Error("invalid seed");let n=(0,i.arrayify)((0,h.Gy)(c.p.sha512,y,r));return new S(E,b(n.slice(0,32)),null,"0x00000000",b(n.slice(32)),0,0,e)}static fromMnemonic(t,e,r){return t=x(_(t,r=A(r)),r),S._fromSeed(M(t,e),{phrase:t,path:"m",locale:r.locale})}static fromSeed(t){return S._fromSeed(t,null)}static fromExtendedKey(t){let e=n.Base58.decode(t);(82!==e.length||w(e.slice(0,78))!==t)&&m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let r=e[4],o=(0,i.hexlify)(e.slice(5,9)),s=parseInt((0,i.hexlify)(e.slice(9,13)).substring(2),16),a=(0,i.hexlify)(e.slice(13,45)),u=e.slice(45,78);switch((0,i.hexlify)(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new S(E,null,(0,i.hexlify)(u),o,a,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new S(E,(0,i.hexlify)(u.slice(1)),null,o,a,s,r,null)}return m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function M(t,e){e||(e="");let r=(0,s.Y0)("mnemonic"+e,s.Uj.NFKD);return(0,a.n)((0,s.Y0)(t,s.Uj.NFKD),r,2048,64,"sha512")}function _(t,e){e=A(e),m.checkNormalize();let r=e.split(t);if(r.length%3!=0)throw Error("invalid mnemonic");let n=(0,i.arrayify)(new Uint8Array(Math.ceil(11*r.length/8))),o=0;for(let s=0;s>3]|=1<<7-o%8),o++}let l=32*r.length/3,c=r.length/3,f=v(c),d=(0,i.arrayify)((0,h.JQ)(n.slice(0,l/8)))[0]&f;if(d!==(n[n.length-1]&f))throw Error("invalid checksum");return(0,i.hexlify)(n.slice(0,l/8))}function x(t,e){if(e=A(e),(t=(0,i.arrayify)(t)).length%4!=0||t.length<16||t.length>32)throw Error("invalid entropy");let r=[0],n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&(1<<8-n)-1),n+=3);let s=t.length/4,a=(0,i.arrayify)((0,h.JQ)(t))[0]&v(s);return r[r.length-1]<<=s,r[r.length-1]|=a>>8-s,e.join(r.map(t=>e.getWord(t)))}function P(t,e){try{return _(t,e),!0}catch(r){}return!1}function C(t){return("number"!=typeof t||t<0||t>=2147483648||t%1)&&m.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}},29816:function(t,e,r){"use strict";r.d(e,{i:function(){return n}});let n="json-wallets/5.7.0"},45659:function(t,e,r){"use strict";r.r(e),r.d(e,{decryptCrowdsale:function(){return g},decryptJsonWallet:function(){return A},decryptJsonWalletSync:function(){return E},decryptKeystore:function(){return w.pe},decryptKeystoreSync:function(){return w.hb},encryptKeystore:function(){return w.HI},getJsonWalletAddress:function(){return b},isCrowdsaleWallet:function(){return y},isKeystoreWallet:function(){return v}});var n=r(78826),i=r.n(n),o=r(19485),s=r(16441),a=r(38197),u=r(85306),l=r(29251),h=r(6881),c=r(1581),f=r(29816),d=r(97013);let p=new c.Logger(f.i);class m extends h.Description{isCrowdsaleAccount(t){return!!(t&&t._isCrowdsaleAccount)}}function g(t,e){let r=JSON.parse(t);e=(0,d.Ij)(e);let n=(0,o.getAddress)((0,d.gx)(r,"ethaddr")),h=(0,d.p3)((0,d.gx)(r,"encseed"));h&&h.length%16==0||p.throwArgumentError("invalid encseed","json",t);let c=(0,s.arrayify)((0,u.n)(e,e,2e3,32,"sha256")).slice(0,16),f=h.slice(0,16),g=h.slice(16),y=new(i()).ModeOfOperation.cbc(c,f),v=i().padding.pkcs7.strip((0,s.arrayify)(y.decrypt(g))),b="";for(let w=0;w{e=(0,u.arrayify)(e);let r=e.slice(0,16),n=e.slice(16,32),o=e.slice(32,64),s=new(i()).Counter(M),a=new(i()).ModeOfOperation.ctr(r,s),l=(0,u.arrayify)(a.encrypt(g)),c=(0,h.keccak256)((0,u.concat)([n,l])),d={address:t.address.substring(2).toLowerCase(),id:(0,m.EH)(_),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,u.hexlify)(M).substring(2)},ciphertext:(0,u.hexlify)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,u.hexlify)(S).substring(2),n:x,dklen:32,p:C,r:P},mac:c.substring(2)}};if(v){let p=(0,f.O)(16),y=new(i()).Counter(p),b=new(i()).ModeOfOperation.ctr(o,y),E=(0,u.arrayify)(b.encrypt(v)),O=new Date,R=O.getUTCFullYear()+"-"+(0,m.VP)(O.getUTCMonth()+1,2)+"-"+(0,m.VP)(O.getUTCDate(),2)+"T"+(0,m.VP)(O.getUTCHours(),2)+"-"+(0,m.VP)(O.getUTCMinutes(),2)+"-"+(0,m.VP)(O.getUTCSeconds(),2)+".0Z";d["x-ethers"]={client:k,gethFilename:"UTC--"+R+"--"+d.address,mnemonicCounter:(0,u.hexlify)(p).substring(2),mnemonicCiphertext:(0,u.hexlify)(E).substring(2),path:w,locale:A,version:"0.1"}}return JSON.stringify(d)})}},97013:function(t,e,r){"use strict";r.d(e,{EH:function(){return l},Ij:function(){return a},VP:function(){return s},gx:function(){return u},p3:function(){return o}});var n=r(16441),i=r(29251);function o(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),(0,n.arrayify)(t)}function s(t,e){for(t=String(t);t.length{try{if("test"!=="test".normalize(e))throw Error("bad normalize")}catch(r){t.push(e)}}),t.length)throw Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(e){return e.message}return null}();(o=n||(n={})).DEBUG="DEBUG",o.INFO="INFO",o.WARNING="WARNING",o.ERROR="ERROR",o.OFF="OFF",(s=i||(i={})).UNKNOWN_ERROR="UNKNOWN_ERROR",s.NOT_IMPLEMENTED="NOT_IMPLEMENTED",s.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",s.NETWORK_ERROR="NETWORK_ERROR",s.SERVER_ERROR="SERVER_ERROR",s.TIMEOUT="TIMEOUT",s.BUFFER_OVERRUN="BUFFER_OVERRUN",s.NUMERIC_FAULT="NUMERIC_FAULT",s.MISSING_NEW="MISSING_NEW",s.INVALID_ARGUMENT="INVALID_ARGUMENT",s.MISSING_ARGUMENT="MISSING_ARGUMENT",s.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",s.CALL_EXCEPTION="CALL_EXCEPTION",s.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",s.NONCE_EXPIRED="NONCE_EXPIRED",s.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",s.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",s.TRANSACTION_REPLACED="TRANSACTION_REPLACED",s.ACTION_REJECTED="ACTION_REJECTED";let d="0123456789abcdef";class p{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){let r=t.toLowerCase();null==l[r]&&this.throwArgumentError("invalid log level name","logLevel",t),h>l[r]||console.log.apply(console,e)}debug(...t){this._log(p.levels.DEBUG,t)}info(...t){this._log(p.levels.INFO,t)}warn(...t){this._log(p.levels.WARNING,t)}makeError(t,e,r){if(u)return this.makeError("censored error",e,{});e||(e=p.errors.UNKNOWN_ERROR),r||(r={});let n=[];Object.keys(r).forEach(t=>{let e=r[t];try{if(e instanceof Uint8Array){let i="";for(let o=0;o>4]+d[15&e[o]];n.push(t+"=Uint8Array(0x"+i+")")}else n.push(t+"="+JSON.stringify(e))}catch(s){n.push(t+"="+JSON.stringify(r[t].toString()))}}),n.push(`code=${e}`),n.push(`version=${this.version}`);let o=t,s="";switch(e){case i.NUMERIC_FAULT:{s="NUMERIC_FAULT";let a=t;switch(a){case"overflow":case"underflow":case"division-by-zero":s+="-"+a;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case i.CALL_EXCEPTION:case i.INSUFFICIENT_FUNDS:case i.MISSING_NEW:case i.NONCE_EXPIRED:case i.REPLACEMENT_UNDERPRICED:case i.TRANSACTION_REPLACED:case i.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(t+=" ("+n.join(", ")+")");let l=Error(t);return l.reason=o,l.code=e,Object.keys(r).forEach(function(t){l[t]=r[t]}),l}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,p.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),f&&this.throwError("platform missing String.prototype.normalize",p.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,p.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",p.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return c||(c=new p("logger/5.7.0")),c}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),a){if(!t)return;this.globalLogger().throwError("error censorship permanent",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!t,a=!!e}static setLogLevel(t){let e=l[t.toLowerCase()];if(null==e){p.globalLogger().warn("invalid log level - "+t);return}h=e}static from(t){return new p(t)}}p.errors=i,p.levels=n},45710:function(t,e,r){"use strict";r.d(e,{H:function(){return c}});var n=r(1581);let i=new n.Logger("networks/5.7.1");function o(t){let e=function(e,r){null==r&&(r={});let n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(i){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(o){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(s){}if(e.PocketProvider&&"-"!==r.pocket)try{let a=new e.PocketProvider(t,r.pocket);a.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(a.network.name)&&n.push(a)}catch(u){}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(l){}if(e.AnkrProvider&&"-"!==r.ankr)try{let h=new e.AnkrProvider(t,r.ankr);h.network&&-1===["ropsten"].indexOf(h.network.name)&&n.push(h)}catch(c){}if(0===n.length)return null;if(e.FallbackProvider){let f=1;return null!=r.quorum?f=r.quorum:"homestead"===t&&(f=2),new e.FallbackProvider(n,f)}return n[0]};return e.renetwork=function(t){return o(t)},e}function s(t,e){let r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return s(t,e)},r}let a={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:o("homestead")},u={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:o("ropsten")},l={chainId:63,name:"classicMordor",_defaultProvider:s("https://www.ethercluster.com/mordor","classicMordor")},h={unspecified:{chainId:0,name:"unspecified"},homestead:a,mainnet:a,morden:{chainId:2,name:"morden"},ropsten:u,testnet:u,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:o("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:o("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:o("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:o("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:s("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:l,classicTestnet:l,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:s("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:o("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:o("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function c(t){if(null==t)return null;if("number"==typeof t){for(let e in h){let r=h[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){let n=h[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}let o=h[t.name];if(!o)return"number"!=typeof t.chainId&&i.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==o.chainId&&i.throwArgumentError("network chainId mismatch","network",t);let s=t._defaultProvider||null;if(null==s&&o._defaultProvider){var a;s=(a=o._defaultProvider)&&"function"==typeof a.renetwork?o._defaultProvider.renetwork(t):o._defaultProvider}return{name:t.name,chainId:o.chainId,ensAddress:t.ensAddress||o.ensAddress||null,_defaultProvider:s}}},85306:function(t,e,r){"use strict";r.d(e,{n:function(){return o}});var n=r(16441),i=r(2006);function o(t,e,r,o,s){let a,u,l;t=(0,n.arrayify)(t),e=(0,n.arrayify)(e);let h=1,c=new Uint8Array(o),f=new Uint8Array(e.length+4);f.set(e);for(let d=1;d<=h;d++){f[e.length]=d>>24&255,f[e.length+1]=d>>16&255,f[e.length+2]=d>>8&255,f[e.length+3]=255&d;let p=(0,n.arrayify)((0,i.Gy)(s,t,f));a||(a=p.length,l=new Uint8Array(a),h=Math.ceil(o/a),u=o-(h-1)*a),l.set(p);for(let m=1;m{let r=t[e];return Promise.resolve(r).then(t=>({key:e,value:t}))}),r=yield Promise.all(e);return r.reduce((t,e)=>(t[e.key]=e.value,t),{})},new(n||(n=Promise))(function(t,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i.throw(t))}catch(e){o(e)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof n?r:new n(function(t){t(r)})).then(s,a)}u((i=i.apply(e,r||[])).next())})}function u(t,e){t&&"object"==typeof t||i.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||i.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function l(t){let e={};for(let r in t)e[r]=t[r];return e}let h={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function c(t){return function(t){if(function t(e){if(null==e||h[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;let r=Object.keys(e);for(let n=0;nc(t)));if("object"==typeof t){let e={};for(let r in t){let n=t[r];void 0!==n&&o(e,r,c(n))}return e}return i.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}(t)}class f{constructor(t){for(let e in t)this[e]=c(t[e])}}},34216:function(t,e,r){"use strict";r.d(e,{i:function(){return n}});let n="providers/5.7.2"},75361:function(t,e,r){"use strict";r.d(e,{H2:function(){return U},Zk:function(){return K}});var n=r(81556),i=r(59567),o=r(57727),s=r(2593),a=r(16441),u=r(57218),l=r(27586),h=r(45710),c=r(6881),f=r(2006),d=r(29251),p=r(37707),m=r(92882),g=r.n(m),y=r(1581),v=r(34216),b=r(30032),w=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let A=new y.Logger(v.i);function E(t){return null==t?"null":(32!==(0,a.hexDataLength)(t)&&A.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function k(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map(t=>{if(!Array.isArray(t))return E(t);{let e={};t.forEach(t=>{e[E(t)]=!0});let r=Object.keys(e);return r.sort(),r.join("|")}}).join("&")}function S(t){if("string"==typeof t){if(t=t.toLowerCase(),32===(0,a.hexDataLength)(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else if(Array.isArray(t))return"filter:*:"+k(t);else if(n.Sg.isForkEvent(t))throw A.warn("not implemented"),Error("not implemented");else if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+k(t.topics||[]);throw Error("invalid event - "+t)}function M(){return new Date().getTime()}function _(t){return new Promise(e=>{setTimeout(e,t)})}let x=["block","network","pending","poll"];class P{constructor(t,e,r){(0,c.defineReadOnly)(this,"tag",t),(0,c.defineReadOnly)(this,"listener",e),(0,c.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){let t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){var t;let e=this.tag.split(":");if("filter"!==e[0])return null;let r=e[1],n=""===(t=e[2])?[]:t.split(/&/g).map(t=>{if(""===t)return[];let e=t.split("|").map(t=>"null"===t?null:t);return 1===e.length?e[0]:e}),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||x.indexOf(this.tag)>=0}}let C={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function O(t){return(0,a.hexZeroPad)(s.O$.from(t).toHexString(),32)}function R(t){return o.Base58.encode((0,a.concat)([t,(0,a.hexDataSlice)((0,f.JQ)((0,f.JQ)(t)),0,4)]))}let N=RegExp("^(ipfs)://(.*)$","i"),I=[RegExp("^(https)://(.*)$","i"),RegExp("^(data):(.*)$","i"),N,RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function T(t,e){try{return(0,d.ZN)(B(t,e))}catch(r){}return null}function B(t,e){if("0x"===t)return null;let r=s.O$.from((0,a.hexDataSlice)(t,e,e+32)).toNumber(),n=s.O$.from((0,a.hexDataSlice)(t,r,r+32)).toNumber();return(0,a.hexDataSlice)(t,r+32,r+32+n)}function L(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):A.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function F(t){let e=(0,a.arrayify)(t);if(e.length>32)throw Error("internal; should not happen");let r=new Uint8Array(32);return r.set(e,32-e.length),r}function D(t){let e=[],r=0;for(let n=0;ns.O$.from(t).eq(1)).catch(t=>{if(t.code===y.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t})),this._supportsEip2544}_fetch(t,e){return w(this,void 0,void 0,function*(){let r={to:this.address,ccipReadEnabled:!0,data:(0,a.hexConcat)([t,(0,l.VM)(this.name),e||"0x"])},n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,a.hexConcat)(["0x9061b923",D([(0,l.Kn)(this.name),r.data])]));try{let i=yield this.provider.call(r);return(0,a.arrayify)(i).length%32==4&&A.throwError("resolver threw error",y.Logger.errors.CALL_EXCEPTION,{transaction:r,data:i}),n&&(i=B(i,0)),i}catch(o){if(o.code===y.Logger.errors.CALL_EXCEPTION)return null;throw o}})}_fetchBytes(t,e){return w(this,void 0,void 0,function*(){let r=yield this._fetch(t,e);return null!=r?B(r,0):null})}_getAddress(t,e){let r=C[String(t)];if(null==r&&A.throwError(`unsupported coin type: ${t}`,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);let n=(0,a.arrayify)(e);if(null!=r.p2pkh){let i=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(i){let o=parseInt(i[1],16);if(i[2].length===2*o&&o>=1&&o<=75)return R((0,a.concat)([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.p2sh){let s=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){let u=parseInt(s[1],16);if(s[2].length===2*u&&u>=1&&u<=75)return R((0,a.concat)([[r.p2sh],"0x"+s[2]]))}}if(null!=r.prefix){let l=n[1],h=n[0];if(0===h?20!==l&&32!==l&&(h=-1):h=-1,h>=0&&n.length===2+l&&l>=1&&l<=75){let c=g().toWords(n.slice(2));return c.unshift(h),g().encode(r.prefix,c)}}return null}getAddress(t){return w(this,void 0,void 0,function*(){if(null==t&&(t=60),60===t)try{let e=yield this._fetch("0x3b3b57de");if("0x"===e||e===u.R)return null;return this.provider.formatter.callAddress(e)}catch(r){if(r.code===y.Logger.errors.CALL_EXCEPTION)return null;throw r}let n=yield this._fetchBytes("0xf1cb7e06",O(t));if(null==n||"0x"===n)return null;let i=this._getAddress(t,n);return null==i&&A.throwError("invalid or unsupported coin data",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:n}),i})}getAvatar(){return w(this,void 0,void 0,function*(){let t=[{type:"name",content:this.name}];try{let e=yield this.getText("avatar");if(null==e)return null;for(let r=0;rl[t]);return"sia://"+h}return A.throwError("invalid or unsupported content hash data",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})})}getText(t){return w(this,void 0,void 0,function*(){let e=(0,d.Y0)(t);(e=(0,a.concat)([O(64),O(e.length),e])).length%32!=0&&(e=(0,a.concat)([e,(0,a.hexZeroPad)("0x",32-t.length%32)]));let r=yield this._fetchBytes("0x59d1d43c",(0,a.hexlify)(e));return null==r||"0x"===r?null:(0,d.ZN)(r)})}}let j=null,q=1;class K extends n.zt{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,c.defineReadOnly)(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch(t=>{}),this._ready().catch(t=>{});else{let e=(0,c.getStatic)(new.target,"getNetwork")(t);e?((0,c.defineReadOnly)(this,"_network",e),this.emit("network",e,null)):A.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return w(this,void 0,void 0,function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(e){}null==t&&(t=yield this.detectNetwork()),t||A.throwError("no network detected",y.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,c.defineReadOnly)(this,"_network",t),this.emit("network",t,null))}return this._network})}get ready(){return(0,p.poll)(()=>this._ready().then(t=>t,t=>{if(t.code!==y.Logger.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))}static getFormatter(){return null==j&&(j=new b.Mb),j}static getNetwork(t){return(0,h.H)(null==t?"homestead":t)}ccipReadFetch(t,e,r){return w(this,void 0,void 0,function*(){if(this.disableCcipRead||0===r.length)return null;let n=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let s=0;s=0?null:JSON.stringify({data:i,sender:n}),h=yield(0,p.fetchJson)({url:u,errorPassThrough:!0},l,(t,e)=>(t.status=e.statusCode,t));if(h.data)return h.data;let c=h.message||"unknown error";if(h.status>=400&&h.status<500)return A.throwError(`response not found during CCIP fetch: ${c}`,y.Logger.errors.SERVER_ERROR,{url:a,errorMessage:c});o.push(c)}return A.throwError(`error encountered during CCIP fetch: ${o.map(t=>JSON.stringify(t)).join(", ")}`,y.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:o})})}_getInternalBlockNumber(t){return w(this,void 0,void 0,function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){let e=this._internalBlockNumber;try{let r=yield e;if(M()-r.respTime<=t)return r.blockNumber;break}catch(n){if(this._internalBlockNumber===e)break}}let i=M(),o=(0,c.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(t=>null,t=>t)}).then(({blockNumber:t,networkError:e})=>{if(e)throw this._internalBlockNumber===o&&(this._internalBlockNumber=null),e;let r=M();return(t=s.O$.from(t).toNumber()){this._internalBlockNumber===o&&(this._internalBlockNumber=null)}),(yield o).blockNumber})}poll(){return w(this,void 0,void 0,function*(){let t=q++,e=[],r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){this.emit("error",n);return}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r===this._lastBlockNumber){this.emit("didPoll",t);return}if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)A.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",A.makeError("network block skew detected",y.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let i=this._emitted.block+1;i<=r;i++)this.emit("block",i);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(t=>{if("block"===t)return;let e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]})),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach(t=>{switch(t.type){case"tx":{let n=t.hash,i=this.getTransactionReceipt(n).then(t=>(t&&null!=t.blockNumber&&(this._emitted["t:"+n]=t.blockNumber,this.emit(n,t)),null)).catch(t=>{this.emit("error",t)});e.push(i);break}case"filter":if(!t._inflight){t._inflight=!0,-2===t._lastBlockNumber&&(t._lastBlockNumber=r-1);let o=t.filter;o.fromBlock=t._lastBlockNumber+1,o.toBlock=r;let s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);let a=this.getLogs(o).then(e=>{t._inflight=!1,0!==e.length&&e.forEach(e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(o,e)})}).catch(e=>{this.emit("error",e),t._inflight=!1});e.push(a)}}}),this._lastBlockNumber=r,Promise.all(e).then(()=>{this.emit("didPoll",t)}).catch(t=>{this.emit("error",t)})})}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return w(this,void 0,void 0,function*(){return A.throwError("provider does not support network detection",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return w(this,void 0,void 0,function*(){let t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield _(0),this._network;let r=A.makeError("underlying network changed",y.Logger.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(t=>{this._setFastBlockNumber(t)},t=>{}),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){let t=M();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then(t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(t){(null==this._fastBlockNumber||!(tthis._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return w(this,void 0,void 0,function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)})}_waitForTransaction(t,e,r,n){return w(this,void 0,void 0,function*(){let i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise((i,o)=>{let s=[],a=!1,u=function(){return!!a||(a=!0,s.forEach(t=>{t()}),!1)},l=t=>{t.confirmations{this.removeListener(t,l)}),n){let h=n.startBlock,c=null,f=r=>w(this,void 0,void 0,function*(){a||(yield _(1e3),this.getTransactionCount(n.from).then(i=>w(this,void 0,void 0,function*(){if(!a){if(i<=n.nonce)h=r;else{{let s=yield this.getTransaction(t);if(s&&null!=s.blockNumber)return}for(null==c&&(c=h-3){a||this.once("block",f)}))});if(a)return;this.once("block",f),s.push(()=>{this.removeListener("block",f)})}if("number"==typeof r&&r>0){let d=setTimeout(()=>{u()||o(A.makeError("timeout exceeded",y.Logger.errors.TIMEOUT,{timeout:r}))},r);d.unref&&d.unref(),s.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return w(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return w(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield this.perform("getGasPrice",{});try{return s.O$.from(t)}catch(e){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}})}getBalance(t,e){return w(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,c.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return s.O$.from(n)}catch(i){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:i})}})}getTransactionCount(t,e){return w(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,c.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return s.O$.from(n).toNumber()}catch(i){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:i})}})}getCode(t,e){return w(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,c.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return(0,a.hexlify)(n)}catch(i){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:i})}})}getStorageAt(t,e,r){return w(this,void 0,void 0,function*(){yield this.getNetwork();let n=yield(0,c.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then(t=>(0,a.hexValue)(t))}),i=yield this.perform("getStorageAt",n);try{return(0,a.hexlify)(i)}catch(o){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:o})}})}_wrapTransaction(t,e,r){if(null!=e&&32!==(0,a.hexDataLength)(e))throw Error("invalid response - sendTransaction");let n=t;return null!=e&&t.hash!==e&&A.throwError("Transaction hash mismatch from Provider.sendTransaction.",y.Logger.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>w(this,void 0,void 0,function*(){let i;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});let o=yield this._waitForTransaction(t.hash,e,n,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&A.throwError("transaction failed",y.Logger.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)}),n}sendTransaction(t){return w(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield Promise.resolve(t).then(t=>(0,a.hexlify)(t)),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);let n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{let i=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,i,n)}catch(o){throw o.transaction=r,o.transactionHash=r.hash,o}})}_getTransactionRequest(t){return w(this,void 0,void 0,function*(){let e=yield t,r={};return["from","to"].forEach(t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then(t=>t?this._getAddress(t):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then(t=>t?s.O$.from(t):null))}),["type"].forEach(t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then(t=>null!=t?t:null))}),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach(t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then(t=>t?(0,a.hexlify)(t):null))}),this.formatter.transactionRequest((yield(0,c.resolveProperties)(r)))})}_getFilter(t){return w(this,void 0,void 0,function*(){t=yield t;let e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach(r=>{null!=t[r]&&(e[r]=t[r])}),["fromBlock","toBlock"].forEach(r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))}),this.formatter.filter((yield(0,c.resolveProperties)(e)))})}_call(t,e,r){return w(this,void 0,void 0,function*(){r>=10&&A.throwError("CCIP read exceeded maximum redirections",y.Logger.errors.SERVER_ERROR,{redirects:r,transaction:t});let n=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===i.substring(0,10)&&(0,a.hexDataLength)(i)%32==4)try{let o=(0,a.hexDataSlice)(i,4),u=(0,a.hexDataSlice)(o,0,32);s.O$.from(u).eq(n)||A.throwError("CCIP Read sender did not match",y.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});let l=[],h=s.O$.from((0,a.hexDataSlice)(o,32,64)).toNumber(),c=s.O$.from((0,a.hexDataSlice)(o,h,h+32)).toNumber(),f=(0,a.hexDataSlice)(o,h+32);for(let d=0;dw(this,void 0,void 0,function*(){let t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let i=null;for(let o=0;othis._wrapTransaction(t)),u}return this.formatter.block(t)}),{oncePoll:this})})}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return w(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;let e={transactionHash:this.formatter.hash(t,!0)};return(0,p.poll)(()=>w(this,void 0,void 0,function*(){let r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;let n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let i=yield this._getInternalBlockNumber(100+2*this.pollingInterval),o=i-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(t){return w(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;let e={transactionHash:this.formatter.hash(t,!0)};return(0,p.poll)(()=>w(this,void 0,void 0,function*(){let r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;let n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let i=yield this._getInternalBlockNumber(100+2*this.pollingInterval),o=i-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return n}),{oncePoll:this})})}getLogs(t){return w(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield(0,c.resolveProperties)({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach(t=>{null==t.removed&&(t.removed=!1)}),b.Mb.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return w(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(t){return w(this,void 0,void 0,function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&A.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return(e+=t)<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)})}getResolver(t){return w(this,void 0,void 0,function*(){let e=t;for(;;){if(""===e||"."===e||"eth"!==t&&"eth"===e)return null;let r=yield this._getResolver(e,"getResolver");if(null!=r){let n=new U(this,r,t);if(e!==t&&!(yield n.supportsWildcard()))return null;return n}e=e.split(".").slice(1).join(".")}})}_getResolver(t,e){return w(this,void 0,void 0,function*(){null==e&&(e="ENS");let r=yield this.getNetwork();r.ensAddress||A.throwError("network does not support ENS",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{let n=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+(0,l.VM)(t).substring(2)});return this.formatter.callAddress(n)}catch(i){}return null})}resolveName(t){return w(this,void 0,void 0,function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if((0,a.isHexString)(t))throw e}"string"!=typeof t&&A.throwArgumentError("invalid ENS name","name",t);let r=yield this.getResolver(t);return r?yield r.getAddress():null})}lookupAddress(t){return w(this,void 0,void 0,function*(){t=yield t,t=this.formatter.address(t);let e=t.substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;let n=T((yield this.call({to:r,data:"0x691f3431"+(0,l.VM)(e).substring(2)})),0),i=yield this.resolveName(n);return i!=t?null:n})}getAvatar(t){return w(this,void 0,void 0,function*(){let e=null;if((0,a.isHexString)(t)){let r=this.formatter.address(t),n=r.substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(n,"getAvatar");if(!i)return null;e=new U(this,i,n);try{let o=yield e.getAvatar();if(o)return o.url}catch(s){if(s.code!==y.Logger.errors.CALL_EXCEPTION)throw s}try{let u=T((yield this.call({to:i,data:"0x691f3431"+(0,l.VM)(n).substring(2)})),0);e=yield this.getResolver(u)}catch(h){if(h.code!==y.Logger.errors.CALL_EXCEPTION)throw h;return null}}else if(!(e=yield this.getResolver(t)))return null;let c=yield e.getAvatar();return null==c?null:c.url})}perform(t,e){return A.throwError(t+" not implemented",y.Logger.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter(t=>t.pollable()).length>0}_stopEvent(t){this.polling=this._events.filter(t=>t.pollable()).length>0}_addEventListener(t,e,r){let n=new P(S(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],i=S(t);return this._events=this._events.filter(t=>t.tag!==i||(setTimeout(()=>{t.listener.apply(this,e)},0),r=!0,!t.once||(n.push(t),!1))),n.forEach(t=>{this._stopEvent(t)}),r}listenerCount(t){if(!t)return this._events.length;let e=S(t);return this._events.filter(t=>t.tag===e).length}listeners(t){if(null==t)return this._events.map(t=>t.listener);let e=S(t);return this._events.filter(t=>t.tag===e).map(t=>t.listener)}off(t,e){if(null==e)return this.removeAllListeners(t);let r=[],n=!1,i=S(t);return this._events=this._events.filter(t=>t.tag!==i||t.listener!=e||!!n||(n=!0,r.push(t),!1)),r.forEach(t=>{this._stopEvent(t)}),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{let r=S(t);this._events=this._events.filter(t=>t.tag!==r||(e.push(t),!1))}return e.forEach(t=>{this._stopEvent(t)}),this}}},51619:function(t,e,r){"use strict";r.d(e,{H:function(){return M}});var n=r(81556),i=r(2593),o=r(16441),s=r(6881),a=r(52472),u=r(37707),l=r(75361),h=r(30032),c=r(1581),f=r(34216),d=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let p=new c.Logger(f.i);function m(){return new Date().getTime()}function g(t){let e=null;for(let r=0;re?null:(n+i)/2}function v(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(i.O$.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(t=>v(t)));if("object"==typeof t){let e=Object.keys(t);return e.sort(),"{"+e.map(e=>{let r=t[e];return r="function"==typeof r?"[function]":v(r),JSON.stringify(e)+":"+r}).join(",")+"}"}throw Error("unknown value type: "+typeof t)}let b=1;function w(t){let e=null,r=null,n=new Promise(n=>{r=setTimeout(e=function(){r&&(clearTimeout(r),r=null),n()},t)}),i=t=>n=n.then(t);return{cancel:e,getPromise:function(){return n},wait:i}}let A=[c.Logger.errors.CALL_EXCEPTION,c.Logger.errors.INSUFFICIENT_FUNDS,c.Logger.errors.NONCE_EXPIRED,c.Logger.errors.REPLACEMENT_UNDERPRICED,c.Logger.errors.UNPREDICTABLE_GAS_LIMIT],E=["address","args","errorArgs","errorSignature","method","transaction"];function k(t,e){let r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function S(t,e){return d(this,void 0,void 0,function*(){let r=t.provider;return null!=r.blockNumber&&r.blockNumber>=e||-1===e?r:(0,u.poll)(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}class M extends l.Zk{constructor(t,e){0===t.length&&p.throwArgumentError("missing providers","providers",t);let r=t.map((t,e)=>{if(n.zt.isProvider(t)){let r=(0,h.Gp)(t)?2e3:750;return Object.freeze({provider:t,weight:1,stallTimeout:r,priority:1})}let i=(0,s.shallowCopy)(t);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=(0,h.Gp)(t)?2e3:750),null==i.weight&&(i.weight=1);let o=i.weight;return(o%1||o>512||o<1)&&p.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${e}].weight`,o),Object.freeze(i)}),i=r.reduce((t,e)=>t+e.weight,0);null==e?e=i/2:e>i&&p.throwArgumentError("quorum will always fail; larger than total weight","quorum",e);let o=g(r.map(t=>t.provider.network));null==o&&(o=new Promise((t,e)=>{setTimeout(()=>{this.detectNetwork().then(t,e)},0)})),super(o),(0,s.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,s.defineReadOnly)(this,"quorum",e),this._highestBlockNumber=-1}detectNetwork(){return d(this,void 0,void 0,function*(){let t=yield Promise.all(this.providerConfigs.map(t=>t.provider.getNetwork()));return g(t)})}perform(t,e){return d(this,void 0,void 0,function*(){if("sendTransaction"===t){let r=yield Promise.all(this.providerConfigs.map(t=>t.provider.sendTransaction(e.signedTransaction).then(t=>t.hash,t=>t)));for(let n=0;nt.result),n=y(e.map(t=>t.result),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){let e=t.map(t=>t.result);return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return y(t.map(t=>t.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":o=function(t){return null==t?null:((t=(0,s.shallowCopy)(t)).confirmations=-1,v(t))};break;case"getBlock":o=r.includeTransactions?function(t){return null==t?null:((t=(0,s.shallowCopy)(t)).transactions=t.transactions.map(t=>((t=(0,s.shallowCopy)(t)).confirmations=-1,t)),v(t))}:function(t){return null==t?null:v(t)};break;default:throw Error("unknown method: "+e)}return n=o,i=t.quorum,function(t){let e={};t.forEach(t=>{let r=n(t.result);e[r]||(e[r]={count:0,result:t.result}),e[r].count++});let r=Object.keys(e);for(let o=0;o=i)return s.result}}}(this,t,e),l=(0,a.y)(this.providerConfigs.map(s.shallowCopy));l.sort((t,e)=>t.priority-e.priority);let h=this._highestBlockNumber,f=0,g=!0;for(;;){let M=m(),_=l.filter(t=>t.runner&&M-t.startt+e.weight,0);for(;_{x.staller=null}),x.runner=(function(t,e,r,n){return d(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,o.isHexString)(n.blockTag)&&(i=yield S(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,o.isHexString)(n.blockTag)&&(i=yield S(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,o.isHexString)(n.blockTag)&&(i=yield S(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":if(n.blockTag&&(0,o.isHexString)(n.blockTag)&&(i=yield S(t,e)),"call"===r&&n.blockTag)return i[r](n.transaction,n.blockTag);return i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&(0,o.isHexString)(s.fromBlock)||s.toBlock&&(0,o.isHexString)(s.toBlock))&&(i=yield S(t,e)),i.getLogs(s)}}return p.throwError("unknown method error",c.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})})})(x,h,t,e).then(r=>{x.done=!0,x.result=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:P,backend:k(x,m()),request:{method:t,params:(0,s.deepCopy)(e)},provider:this})},r=>{x.done=!0,x.error=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:P,backend:k(x,m()),request:{method:t,params:(0,s.deepCopy)(e)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:P,backend:k(x,null),request:{method:t,params:(0,s.deepCopy)(e)},provider:this}),_+=x.weight}let C=[];l.forEach(t=>{!t.done&&t.runner&&(C.push(t.runner),t.staller&&C.push(t.staller.getPromise()))}),C.length&&(yield Promise.race(C));let O=l.filter(t=>t.done&&null==t.error);if(O.length>=this.quorum){let R=u(O);if(void 0!==R)return l.forEach(t=>{t.staller&&t.staller.cancel(),t.cancelled=!0}),R;g||(yield w(100).getPromise()),g=!1}let N=l.reduce((t,e)=>{if(!e.done||null==e.error)return t;let r=e.error.code;return A.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t},{});if(Object.keys(N).forEach(t=>{let e=N[t];if(e.weight{t.staller&&t.staller.cancel(),t.cancelled=!0});let r=e.error,n={};E.forEach(t=>{null!=r[t]&&(n[t]=r[t])}),p.throwError(r.reason||r.message,t,n)}),0===l.filter(t=>!t.done).length)break}return l.forEach(t=>{t.staller&&t.staller.cancel(),t.cancelled=!0}),p.throwError("failed to meet quorum",c.Logger.errors.SERVER_ERROR,{method:t,params:e,results:l.map(t=>k(t)),provider:this})})}}},30032:function(t,e,r){"use strict";r.d(e,{Ed:function(){return d},Gp:function(){return p},Mb:function(){return f},vh:function(){return g}});var n=r(19485),i=r(2593),o=r(16441),s=r(9279),a=r(6881),u=r(83875),l=r(1581),h=r(34216);let c=new l.Logger(h.i);class f{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){let t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),u=this.number.bind(this),l=this.type.bind(this),h=t=>this.data(t,!0);return t.transaction={hash:o,type:l,accessList:f.allowNull(this.accessList.bind(this),null),blockHash:f.allowNull(o,null),blockNumber:f.allowNull(u,null),transactionIndex:f.allowNull(u,null),confirmations:f.allowNull(u,null),from:e,gasPrice:f.allowNull(r),maxPriorityFeePerGas:f.allowNull(r),maxFeePerGas:f.allowNull(r),gasLimit:r,to:f.allowNull(e,null),value:r,nonce:u,data:i,r:f.allowNull(this.uint256),s:f.allowNull(this.uint256),v:f.allowNull(u),creates:f.allowNull(e,null),raw:f.allowNull(i)},t.transactionRequest={from:f.allowNull(e),nonce:f.allowNull(u),gasLimit:f.allowNull(r),gasPrice:f.allowNull(r),maxPriorityFeePerGas:f.allowNull(r),maxFeePerGas:f.allowNull(r),to:f.allowNull(e),value:f.allowNull(r),data:f.allowNull(h),type:f.allowNull(u),accessList:f.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:u,blockNumber:u,transactionHash:o,address:e,topics:f.arrayOf(o),data:i,logIndex:u,blockHash:o},t.receipt={to:f.allowNull(this.address,null),from:f.allowNull(this.address,null),contractAddress:f.allowNull(e,null),transactionIndex:u,root:f.allowNull(s),gasUsed:r,logsBloom:f.allowNull(i),blockHash:o,transactionHash:o,logs:f.arrayOf(this.receiptLog.bind(this)),blockNumber:u,confirmations:f.allowNull(u,null),cumulativeGasUsed:r,effectiveGasPrice:f.allowNull(r),status:f.allowNull(u),type:l},t.block={hash:f.allowNull(o),parentHash:o,number:u,timestamp:u,nonce:f.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:f.allowNull(e),extraData:i,transactions:f.allowNull(f.arrayOf(o)),baseFeePerGas:f.allowNull(r)},t.blockWithTransactions=(0,a.shallowCopy)(t.block),t.blockWithTransactions.transactions=f.allowNull(f.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:f.allowNull(n,void 0),toBlock:f.allowNull(n,void 0),blockHash:f.allowNull(o,void 0),address:f.allowNull(e,void 0),topics:f.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:f.allowNull(u),blockHash:f.allowNull(o),transactionIndex:u,removed:f.allowNull(this.boolean.bind(this)),address:e,data:f.allowFalsish(i,"0x"),topics:f.arrayOf(o),transactionHash:o,logIndex:u},t}accessList(t){return(0,u.accessListify)(t||[])}number(t){return"0x"===t?0:i.O$.from(t).toNumber()}type(t){return"0x"===t||null==t?0:i.O$.from(t).toNumber()}bigNumber(t){return i.O$.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),(0,o.isHexString)(t))?t.toLowerCase():c.throwArgumentError("invalid hash","value",t)}data(t,e){let r=this.hex(t,e);if(r.length%2!=0)throw Error("invalid data; odd-length - "+t);return r}address(t){return(0,n.getAddress)(t)}callAddress(t){if(!(0,o.isHexString)(t,32))return null;let e=(0,n.getAddress)((0,o.hexDataSlice)(t,12));return e===s.d?null:e}contractAddress(t){return(0,n.getContractAddress)(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if("number"==typeof t||(0,o.isHexString)(t))return(0,o.hexValue)(t);throw Error("invalid blockTag")}hash(t,e){let r=this.hex(t,e);return 32!==(0,o.hexDataLength)(r)?c.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;let e=i.O$.from(t);try{return e.toNumber()}catch(r){}return null}uint256(t){if(!(0,o.isHexString)(t))throw Error("invalid uint256");return(0,o.hexZeroPad)(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);let r=null!=t._difficulty?t._difficulty:t.difficulty,n=f.check(e,t);return n._difficulty=null==r?null:i.O$.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return f.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&i.O$.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),(1===t.type||2===t.type)&&null==t.accessList&&(t.accessList=[]);let e=f.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),e.chainId=r}else{let n=t.networkId;null==n&&null==e.v&&(n=t.chainId),(0,o.isHexString)(n)&&(n=i.O$.from(n).toNumber()),"number"!=typeof n&&null!=e.v&&((n=(e.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),e.chainId=n}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return(0,u.parse)(t)}receiptLog(t){return f.check(this.formats.receiptLog,t)}receipt(t){let e=f.check(this.formats.receipt,t);if(null!=e.root){if(e.root.length<=4){let r=i.O$.from(e.root).toNumber();0===r||1===r?(null!=e.status&&e.status!==r&&c.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=r,delete e.root):c.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&c.throwArgumentError("invalid root hash","value.root",e.root)}return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map(t=>this.topics(t)):null!=t?this.hash(t,!0):null}filter(t){return f.check(this.formats.filter,t)}filterLog(t){return f.check(this.formats.filterLog,t)}static check(t,e){let r={};for(let n in t)try{let i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(o){throw o.checkKey=n,o.checkValue=e[n],o}return r}static allowNull(t,e){return function(r){return null==r?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw Error("not an array");let r=[];return e.forEach(function(e){r.push(t(e))}),r}}}function d(t){return t&&"function"==typeof t.isCommunityResource}function p(t){return d(t)&&t.isCommunityResource()}let m=!1;function g(){m||(m=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}},5432:function(t,e,r){"use strict";r.r(e),r.d(e,{AlchemyProvider:function(){return k},AlchemyWebSocketProvider:function(){return E},AnkrProvider:function(){return _},BaseProvider:function(){return o.Zk},CloudflareProvider:function(){return P},EtherscanProvider:function(){return U},FallbackProvider:function(){return j.H},Formatter:function(){return a.Mb},InfuraProvider:function(){return z},InfuraWebSocketProvider:function(){return H},IpcProvider:function(){return q},JsonRpcBatchProvider:function(){return Q},JsonRpcProvider:function(){return l.r},JsonRpcSigner:function(){return l.C},NodesmithProvider:function(){return J},PocketProvider:function(){return Y},Provider:function(){return n.zt},Resolver:function(){return o.H2},StaticJsonRpcProvider:function(){return b.c},UrlJsonRpcProvider:function(){return b.l},Web3Provider:function(){return $.Q},WebSocketProvider:function(){return v},getDefaultProvider:function(){return tt},getNetwork:function(){return i.H},isCommunityResourcable:function(){return a.Ed},isCommunityResource:function(){return a.Gp},showThrottleMessage:function(){return a.vh}});var n=r(81556),i=r(45710),o=r(75361),s=r(6881),a=r(30032),u=r(2593),l=r(82169),h=r(1581),c=r(34216);let f=null;try{if(f=WebSocket,null==f)throw Error("inject please")}catch(p){let d=new h.Logger(c.i);f=function(){d.throwError("WebSockets not supported in this environment",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var m=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let g=new h.Logger(c.i),y=1;class v extends l.r{constructor(t,e){"any"===e&&g.throwError("WebSocketProvider does not support 'any' network yet",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),"string"==typeof t?super(t,e):super("_websocket",e),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof t?(0,s.defineReadOnly)(this,"_websocket",new f(this.connection.url)):(0,s.defineReadOnly)(this,"_websocket",t),(0,s.defineReadOnly)(this,"_requests",{}),(0,s.defineReadOnly)(this,"_subs",{}),(0,s.defineReadOnly)(this,"_subIds",{}),(0,s.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(t=>{this.websocket.send(this._requests[t].payload)})},this.websocket.onmessage=t=>{let e=t.data,r=JSON.parse(e);if(null!=r.id){let n=String(r.id),i=this._requests[n];if(delete this._requests[n],void 0!==r.result)i.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(i.payload),response:r.result,provider:this});else{let o=null;r.error?(o=Error(r.error.message||"unknown error"),(0,s.defineReadOnly)(o,"code",r.error.code||null),(0,s.defineReadOnly)(o,"response",e)):o=Error("unknown error"),i.callback(o,void 0),this.emit("debug",{action:"response",error:o,request:JSON.parse(i.payload),provider:this})}}else if("eth_subscription"===r.method){let a=this._subs[r.params.subscription];a&&a.processFunc(r.params.result)}else console.warn("this should not happen")};let r=setInterval(()=>{this.emit("poll")},1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(t){g.throwError("cannot reset events block on WebSocketProvider",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(t){g.throwError("cannot set polling interval on WebSocketProvider",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return m(this,void 0,void 0,function*(){return null})}set polling(t){t&&g.throwError("cannot set polling on WebSocketProvider",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(t,e){let r=y++;return new Promise((n,i)=>{let o=JSON.stringify({method:t,params:e,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(t,e){return t?i(t):n(e)},payload:o},this._wsReady&&this.websocket.send(o)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(t,e,r){return m(this,void 0,void 0,function*(){let n=this._subIds[t];null==n&&(n=Promise.all(e).then(t=>this.send("eth_subscribe",t)),this._subIds[t]=n);let i=yield n;this._subs[i]={tag:t,processFunc:r}})}_startEvent(t){switch(t.type){case"block":this._subscribe("block",["newHeads"],t=>{let e=u.O$.from(t.number).toNumber();this._emitted.block=e,this.emit("block",e)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],t=>{this.emit("pending",t)});break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],e=>{null==e.removed&&(e.removed=!1),this.emit(t.filter,this.formatter.filterLog(e))});break;case"tx":{let e=t=>{let e=t.hash;this.getTransactionReceipt(e).then(t=>{t&&this.emit(e,t)})};e(t),this._subscribe("tx",["newHeads"],t=>{this._events.filter(t=>"tx"===t.type).forEach(e)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}_stopEvent(t){let e=t.tag;if("tx"===t.type){if(this._events.filter(t=>"tx"===t.type).length)return;e="tx"}else if(this.listenerCount(t.event))return;let r=this._subIds[e];r&&(delete this._subIds[e],r.then(t=>{this._subs[t]&&(delete this._subs[t],this.send("eth_unsubscribe",[t]))}))}destroy(){return m(this,void 0,void 0,function*(){this.websocket.readyState===f.CONNECTING&&(yield new Promise(t=>{this.websocket.onopen=function(){t(!0)},this.websocket.onerror=function(){t(!1)}})),this.websocket.close(1e3)})}}var b=r(93901);let w=new h.Logger(c.i),A="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class E extends v{constructor(t,e){let r=new k(t,e),n=r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(n,r.network),(0,s.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===A}}class k extends b.l{static getWebSocketProvider(t,e){return new E(t,e)}static getApiKey(t){return null==t?A:(t&&"string"!=typeof t&&w.throwArgumentError("invalid apiKey","apiKey",t),t)}static getUrl(t,e){let r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:w.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:(t,r)=>(e===A&&(0,a.vh)(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===A}}let S=new h.Logger(c.i),M="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class _ extends b.l{isCommunityResource(){return this.apiKey===M}static getApiKey(t){return null==t?M:t}static getUrl(t,e){null==e&&(e=M);let r={allowGzip:!0,url:"https://"+function(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return S.throwArgumentError("unsupported network","name",t)}(t.name)+e,throttleCallback:(t,r)=>(e.apiKey===M&&(0,a.vh)(),Promise.resolve(!0))};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}let x=new h.Logger(c.i);class P extends b.l{static getApiKey(t){return null!=t&&x.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}static getUrl(t,e){let r=null;return"homestead"===t.name?r="https://cloudflare-eth.com/":x.throwArgumentError("unsupported network","network",arguments[0]),r}perform(t,e){var r,n,i,o;let s=Object.create(null,{perform:{get:()=>super.perform}});return r=this,n=void 0,i=void 0,o=function*(){if("getBlockNumber"===t){let r=yield s.perform.call(this,"getBlock",{blockTag:"latest"});return r.number}return s.perform.call(this,t,e)},new(i||(i=Promise))(function(t,e){function s(t){try{u(o.next(t))}catch(r){e(r)}}function a(t){try{u(o.throw(t))}catch(r){e(r)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof i?r:new i(function(t){t(r)})).then(s,a)}u((o=o.apply(r,n||[])).next())})}}var C=r(16441),O=r(83875),R=r(37707),N=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let I=new h.Logger(c.i);function T(t){let e={};for(let r in t){if(null==t[r])continue;let n=t[r];("type"!==r||0!==n)&&(n=({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0})[r]?(0,C.hexValue)((0,C.hexlify)(n)):"accessList"===r?"["+(0,O.accessListify)(n).map(t=>`{address:"${t.address}",storageKeys:["${t.storageKeys.join('","')}"]}`).join(",")+"]":(0,C.hexlify)(n),e[r]=n)}return e}function B(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"string"!=typeof t.message||!t.message.match(/^OK/)){let e=Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function L(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){let e=Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){let r=Error("invalid response");throw r.result=JSON.stringify(t),r}if(t.error){let n=Error(t.error.message||"unknown error");throw t.error.code&&(n.code=t.error.code),t.error.data&&(n.data=t.error.data),n}return t.result}function F(t){if("pending"===t)throw Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}function D(t,e,r){if("call"===t&&e.code===h.Logger.errors.SERVER_ERROR){let n=e.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){let i=n.data;if(i&&(i="0x"+i.replace(/^.*0x/i,"")),(0,C.isHexString)(i))return i;I.throwError("missing revert data in call exception",h.Logger.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let o=e.message;throw e.code===h.Logger.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?o=e.error.message:"string"==typeof e.body?o=e.body:"string"==typeof e.responseText&&(o=e.responseText)),(o=(o||"").toLowerCase()).match(/insufficient funds/)&&I.throwError("insufficient funds for intrinsic transaction cost",h.Logger.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&I.throwError("nonce has already been used",h.Logger.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),o.match(/another transaction with same nonce/)&&I.throwError("replacement fee too low",h.Logger.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),o.match(/execution failed due to an exception|execution reverted/)&&I.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class U extends o.Zk{constructor(t,e){super(t),(0,s.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,s.defineReadOnly)(this,"apiKey",e||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return I.throwArgumentError("unsupported network","network",this.network.name)}getUrl(t,e){let r=Object.keys(e).reduce((t,r)=>{let n=e[r];return null!=n&&(t+=`&${r}=${n}`),t},""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${t}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(t,e){return e.module=t,e.apikey=this.apiKey,e}fetch(t,e,r){return N(this,void 0,void 0,function*(){let n=r?this.getPostUrl():this.getUrl(t,e),i=r?this.getPostData(t,e):null;this.emit("debug",{action:"request",request:n,provider:this});let o={url:n,throttleSlotInterval:1e3,throttleCallback:(t,e)=>(this.isCommunityResource()&&(0,a.vh)(),Promise.resolve(!0))},u=null;i&&(o.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},u=Object.keys(i).map(t=>`${t}=${i[t]}`).join("&"));let l=yield(0,R.fetchJson)(o,u,("proxy"===t?L:B)||L);return this.emit("debug",{action:"response",request:n,response:(0,s.deepCopy)(l),provider:this}),l})}detectNetwork(){return N(this,void 0,void 0,function*(){return this.network})}perform(t,e){let r=Object.create(null,{perform:{get:()=>super.perform}});return N(this,void 0,void 0,function*(){switch(t){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(t=>D("sendTransaction",t,e.signedTransaction));case"getBlock":if(e.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});throw Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.transactionHash});case"call":{if("latest"!==e.blockTag)throw Error("EtherscanProvider does not support blockTag for call");let n=T(e.transaction);n.module="proxy",n.action="eth_call";try{return yield this.fetch("proxy",n,!0)}catch(i){return D("call",i,e.transaction)}}case"estimateGas":{let o=T(e.transaction);o.module="proxy",o.action="eth_estimateGas";try{return yield this.fetch("proxy",o,!0)}catch(s){return D("estimateGas",s,e.transaction)}}case"getLogs":{let a={action:"getLogs"};if(e.filter.fromBlock&&(a.fromBlock=F(e.filter.fromBlock)),e.filter.toBlock&&(a.toBlock=F(e.filter.toBlock)),e.filter.address&&(a.address=e.filter.address),e.filter.topics&&e.filter.topics.length>0&&(e.filter.topics.length>1&&I.throwError("unsupported topic count",h.Logger.errors.UNSUPPORTED_OPERATION,{topics:e.filter.topics}),1===e.filter.topics.length)){let u=e.filter.topics[0];("string"!=typeof u||66!==u.length)&&I.throwError("unsupported topic format",h.Logger.errors.UNSUPPORTED_OPERATION,{topic0:u}),a.topic0=u}let l=yield this.fetch("logs",a),c={};for(let f=0;f{["contractAddress","to"].forEach(function(e){""==t[e]&&delete t[e]}),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);let e=this.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e})})}isCommunityResource(){return null==this.apiKey}}var j=r(51619);let q=null,K=new h.Logger(c.i),G="84842078b09946638c03157f83405213";class H extends v{constructor(t,e){let r=new z(t,e),n=r.connection;n.password&&K.throwError("INFURA WebSocket project secrets unsupported",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});let i=n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(i,t),(0,s.defineReadOnly)(this,"apiKey",r.projectId),(0,s.defineReadOnly)(this,"projectId",r.projectId),(0,s.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===G}}class z extends b.l{static getWebSocketProvider(t,e){return new H(t,e)}static getApiKey(t){let e={apiKey:G,projectId:G,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(K.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),K.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:K.throwError("unsupported network",h.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}let n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:(t,r)=>(e.projectId===G&&(0,a.vh)(),Promise.resolve(!0))};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}isCommunityResource(){return this.projectId===G}}class Q extends l.r{send(t,e){let r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);let n={request:r,resolve:null,reject:null},i=new Promise((t,e)=>{n.resolve=t,n.reject=e});return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{let t=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;let e=t.map(t=>t.request);return this.emit("debug",{action:"requestBatch",request:(0,s.deepCopy)(e),provider:this}),(0,R.fetchJson)(this.connection,JSON.stringify(e)).then(r=>{this.emit("debug",{action:"response",request:e,response:r,provider:this}),t.forEach((t,e)=>{let n=r[e];if(n.error){let i=Error(n.error.message);i.code=n.error.code,i.data=n.error.data,t.reject(i)}else t.resolve(n.result)})},r=>{this.emit("debug",{action:"response",error:r,request:e,provider:this}),t.forEach(t=>{t.reject(r)})})},10)),i}}let W=new h.Logger(c.i);class J extends b.l{static getApiKey(t){return t&&"string"!=typeof t&&W.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}static getUrl(t,e){W.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:W.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}let V=new h.Logger(c.i),Z="62e1ad51b37b8e00394bda3b";class Y extends b.l{static getApiKey(t){let e={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==t?e.applicationId=Z:"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?(e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey):t.applicationId?e.applicationId=t.applicationId:V.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:V.throwError("unsupported network",h.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}let n=`https://${r}/v1/lb/${e.applicationId}`,i={headers:{},url:n};return null!=e.applicationSecretKey&&(i.user="",i.password=e.applicationSecretKey),i}isCommunityResource(){return this.applicationId===Z}}var $=r(241);let X=new h.Logger(c.i);function tt(t,e){if(null==t&&(t="homestead"),"string"==typeof t){let r=t.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new l.r(t);case"ws":case"wss":return new v(t);default:X.throwArgumentError("unsupported URL scheme","network",t)}}let n=(0,i.H)(t);return n&&n._defaultProvider||X.throwError("unsupported getDefaultProvider network",h.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),n._defaultProvider({FallbackProvider:j.H,AlchemyProvider:k,AnkrProvider:_,CloudflareProvider:P,EtherscanProvider:U,InfuraProvider:z,JsonRpcProvider:l.r,NodesmithProvider:J,PocketProvider:Y,Web3Provider:$.Q,IpcProvider:q},e)}},82169:function(t,e,r){"use strict";r.d(e,{C:function(){return k},r:function(){return _}});var n=r(48088),i=r(2593),o=r(16441),s=r(67827),a=r(6881),u=r(29251),l=r(83875),h=r(37707),c=r(1581),f=r(34216),d=r(75361),p=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let m=new c.Logger(f.i),g=["call","estimateGas"];function y(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){let r=(0,o.isHexString)(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"==typeof t){for(let n in t){let i=y(t[n],e);if(i)return i}return null}if("string"==typeof t)try{return y(JSON.parse(t),e)}catch(s){}return null}function v(t,e,r){let n=r.transaction||r.signedTransaction;if("call"===t){let i=y(e,!0);if(i)return i.data;m.throwError("missing revert data in call exception; Transaction reverted without a reason string",c.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let o=y(e.body,!1);null==o&&(o=y(e,!1)),o&&m.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",c.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:t,transaction:n,error:e})}let s=e.message;throw e.code===c.Logger.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?s=e.error.message:"string"==typeof e.body?s=e.body:"string"==typeof e.responseText&&(s=e.responseText),(s=(s||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&m.throwError("insufficient funds for intrinsic transaction cost",c.Logger.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),s.match(/nonce (is )?too low/i)&&m.throwError("nonce has already been used",c.Logger.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),s.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&m.throwError("replacement fee too low",c.Logger.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),s.match(/only replay-protected/i)&&m.throwError("legacy pre-eip-155 transactions not supported",c.Logger.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),g.indexOf(t)>=0&&s.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&m.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",c.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function b(t){return new Promise(function(e){setTimeout(e,t)})}function w(t){if(t.error){let e=Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function A(t){return t?t.toLowerCase():t}let E={};class k extends n.Signer{constructor(t,e,r){if(super(),t!==E)throw Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,a.defineReadOnly)(this,"provider",e),null==r&&(r=0),"string"==typeof r?((0,a.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,a.defineReadOnly)(this,"_index",null)):"number"==typeof r?((0,a.defineReadOnly)(this,"_index",r),(0,a.defineReadOnly)(this,"_address",null)):m.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return m.throwError("cannot alter JSON-RPC Signer connection",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new S(E,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(t=>(t.length<=this._index&&m.throwError("unknown account #"+this._index,c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index])))}sendUncheckedTransaction(t){t=(0,a.shallowCopy)(t);let e=this.getAddress().then(t=>(t&&(t=t.toLowerCase()),t));if(null==t.gasLimit){let r=(0,a.shallowCopy)(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then(t=>p(this,void 0,void 0,function*(){if(null==t)return null;let e=yield this.provider.resolveName(t);return null==e&&m.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))),(0,a.resolveProperties)({tx:(0,a.resolveProperties)(t),sender:e}).then(({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&m.throwArgumentError("from address mismatch","transaction",t):e.from=r;let n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then(t=>t,t=>("string"==typeof t.message&&t.message.match(/user denied/i)&&m.throwError("user rejected transaction",c.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:e}),v("sendTransaction",t,n)))})}signTransaction(t){return m.throwError("signing transactions is unsupported",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return p(this,void 0,void 0,function*(){let e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield(0,h.poll)(()=>p(this,void 0,void 0,function*(){let t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}})}signMessage(t){return p(this,void 0,void 0,function*(){let e="string"==typeof t?(0,u.Y0)(t):t,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,o.hexlify)(e),r.toLowerCase()])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&m.throwError("user rejected signing",c.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:t}),n}})}_legacySignMessage(t){return p(this,void 0,void 0,function*(){let e="string"==typeof t?(0,u.Y0)(t):t,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,o.hexlify)(e)])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&m.throwError("user rejected signing",c.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:t}),n}})}_signTypedData(t,e,r){return p(this,void 0,void 0,function*(){let n=yield s.E.resolveNames(t,e,r,t=>this.provider.resolveName(t)),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(s.E.getPayload(n.domain,e,n.value))])}catch(o){throw"string"==typeof o.message&&o.message.match(/user denied/i)&&m.throwError("user rejected signing",c.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:e,value:n.value}}),o}})}unlock(t){return p(this,void 0,void 0,function*(){let e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])})}}class S extends k{sendTransaction(t){return this.sendUncheckedTransaction(t).then(t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)}))}}let M={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class _ extends d.Zk{constructor(t,e){let r=e;null==r&&(r=new Promise((t,e)=>{setTimeout(()=>{this.detectNetwork().then(e=>{t(e)},t=>{e(t)})},0)})),super(r),t||(t=(0,a.getStatic)(this.constructor,"defaultUrl")()),"string"==typeof t?(0,a.defineReadOnly)(this,"connection",Object.freeze({url:t})):(0,a.defineReadOnly)(this,"connection",Object.freeze((0,a.shallowCopy)(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return p(this,void 0,void 0,function*(){yield b(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(r){try{t=yield this.send("net_version",[])}catch(e){}}if(null!=t){let n=(0,a.getStatic)(this.constructor,"getNetwork");try{return n(i.O$.from(t).toNumber())}catch(o){return m.throwError("could not detect network",c.Logger.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:o})}}return m.throwError("could not detect network",c.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(t){return new k(E,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(t=>t.map(t=>this.formatter.address(t)))}send(t,e){let r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,a.deepCopy)(r),provider:this});let n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];let i=(0,h.fetchJson)(this.connection,JSON.stringify(r),w).then(t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t),t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t});return n&&(this._cache[t]=i,setTimeout(()=>{this._cache[t]=null},0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[A(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[A(e.address),e.blockTag]];case"getCode":return["eth_getCode",[A(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[A(e.address),(0,o.hexZeroPad)(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":if(e.blockTag)return["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]];if(e.blockHash)return["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]];break;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":{let r=(0,a.getStatic)(this.constructor,"hexlifyTransaction");return["eth_call",[r(e.transaction,{from:!0}),e.blockTag]]}case"estimateGas":{let n=(0,a.getStatic)(this.constructor,"hexlifyTransaction");return["eth_estimateGas",[n(e.transaction,{from:!0})]]}case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=A(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return p(this,void 0,void 0,function*(){if("call"===t||"estimateGas"===t){let r=e.transaction;if(r&&null!=r.type&&i.O$.from(r.type).isZero()&&null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas){let n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((e=(0,a.shallowCopy)(e)).transaction=(0,a.shallowCopy)(r),delete e.transaction.type)}}let o=this.prepareRequest(t,e);null==o&&m.throwError(t+" not implemented",c.Logger.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(o[0],o[1])}catch(s){return v(t,s,e)}})}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;let t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then(function(r){return function n(){t.send("eth_getFilterChanges",[r]).then(function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach(function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then(function(){return t.getTransaction(e).then(function(e){return t.emit("pending",e),null})})}),n.then(function(){return b(1e3)})}).then(function(){if(t._pendingFilter!=e){t.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){n()},0),null}).catch(t=>{})}(),r}).catch(t=>{})}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){let r=(0,a.shallowCopy)(M);if(e)for(let n in e)e[n]&&(r[n]=!0);(0,a.checkProperties)(t,r);let s={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(e){if(null==t[e])return;let r=(0,o.hexValue)(i.O$.from(t[e]));"gasLimit"===e&&(e="gas"),s[e]=r}),["from","to","data"].forEach(function(e){null!=t[e]&&(s[e]=(0,o.hexlify)(t[e]))}),t.accessList&&(s.accessList=(0,l.accessListify)(t.accessList)),s}}},93901:function(t,e,r){"use strict";r.d(e,{c:function(){return u},l:function(){return l}});var n=r(6881),i=r(1581),o=r(34216),s=r(82169);let a=new i.Logger(o.i);class u extends s.r{detectNetwork(){var t,e,r,o;let s=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return t=this,e=void 0,r=void 0,o=function*(){let t=this.network;return null==t&&((t=yield s.detectNetwork.call(this))||a.throwError("no network detected",i.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,n.defineReadOnly)(this,"_network",t),this.emit("network",t,null))),t},new(r||(r=Promise))(function(n,i){function s(t){try{u(o.next(t))}catch(e){i(e)}}function a(t){try{u(o.throw(t))}catch(e){i(e)}}function u(t){var e;t.done?n(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((o=o.apply(t,e||[])).next())})}}class l extends u{constructor(t,e){a.checkAbstract(new.target,l),t=(0,n.getStatic)(new.target,"getNetwork")(t),e=(0,n.getStatic)(new.target,"getApiKey")(e);let r=(0,n.getStatic)(new.target,"getUrl")(t,e);super(r,t),"string"==typeof e?(0,n.defineReadOnly)(this,"apiKey",e):null!=e&&Object.keys(e).forEach(t=>{(0,n.defineReadOnly)(this,t,e[t])})}_startPending(){a.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(t){return a.throwError("API provider does not support signing",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(t){return t}static getUrl(t,e){return a.throwError("not implemented; sub-classes must override getUrl",i.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}},241:function(t,e,r){"use strict";r.d(e,{Q:function(){return h}});var n=r(6881),i=r(1581),o=r(34216),s=r(82169);let a=new i.Logger(o.i),u=1;function l(t,e){let r="Web3LegacyFetcher";return function(t,i){let o={method:t,params:i,id:u++,jsonrpc:"2.0"};return new Promise((t,i)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,n.deepCopy)(o),provider:this}),e(o,(e,n)=>{if(e)return this.emit("debug",{action:"response",fetcher:r,error:e,request:o,provider:this}),i(e);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:n,provider:this}),n.error){let s=Error(n.error.message);return s.code=n.error.code,s.data=n.error.data,i(s)}t(n.result)})})}}class h extends s.r{constructor(t,e){null==t&&a.throwArgumentError("missing provider","provider",t);let r=null,i=null,o=null;"function"==typeof t?(r="unknown:",i=t):(((r=t.host||t.path||"")||!t.isMetaMask||(r="metamask"),o=t,t.request)?(""===r&&(r="eip-1193:"),i=function(e,r){null==r&&(r=[]);let i={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,n.deepCopy)(i),provider:this}),t.request(i).then(t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:t,provider:this}),t),t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:t,provider:this}),t})}):t.sendAsync?i=l(t,t.sendAsync.bind(t)):t.send?i=l(t,t.send.bind(t)):a.throwArgumentError("unsupported provider","provider",t),r||(r="unknown:")),super(r,e),(0,n.defineReadOnly)(this,"jsonRpcFetchFunc",i),(0,n.defineReadOnly)(this,"provider",o)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}},22118:function(t,e,r){"use strict";r.r(e),r.d(e,{randomBytes:function(){return n.O},shuffled:function(){return i.y}});var n=r(5634),i=r(52472)},5634:function(t,e,r){"use strict";r.d(e,{O:function(){return u}});var n=r(16441),i=r(1581);let o=new i.Logger("random/5.7.0"),s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw Error("unable to locate global object")}(),a=s.crypto||s.msCrypto;function u(t){(t<=0||t>1024||t%1||t!=t)&&o.throwArgumentError("invalid length","length",t);let e=new Uint8Array(t);return a.getRandomValues(e),(0,n.arrayify)(e)}a&&a.getRandomValues||(o.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(t){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},52472:function(t,e,r){"use strict";function n(t){t=t.slice();for(let e=t.length-1;e>0;e--){let r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}r.d(e,{y:function(){return n}})},59052:function(t,e,r){"use strict";r.r(e),r.d(e,{decode:function(){return c},encode:function(){return u}});var n=r(16441),i=r(1581);let o=new i.Logger("rlp/5.7.0");function s(t){let e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function a(t,e,r){let n=0;for(let i=0;ie+1+n&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:s}}function h(t,e){if(0===t.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),t[e]>=248){let r=t[e]-247;e+1+r>t.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});let s=a(t,e+1,r);return e+1+r+s>t.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(t,e,e+1+r,r+s)}if(t[e]>=192){let u=t[e]-192;return e+1+u>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(t,e,e+1,u)}if(t[e]>=184){let h=t[e]-183;e+1+h>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});let c=a(t,e+1,h);e+1+h+c>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});let f=(0,n.hexlify)(t.slice(e+1+h,e+1+h+c));return{consumed:1+h+c,result:f}}if(t[e]>=128){let d=t[e]-128;e+1+d>t.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{});let p=(0,n.hexlify)(t.slice(e+1,e+1+d));return{consumed:1+d,result:p}}return{consumed:1,result:(0,n.hexlify)(t[e])}}function c(t){let e=(0,n.arrayify)(t),r=h(e,0);return r.consumed!==e.length&&o.throwArgumentError("invalid rlp data","data",t),r.result}},91278:function(t,e,r){"use strict";r.r(e),r.d(e,{SupportedAlgorithm:function(){return i.p},computeHmac:function(){return n.Gy},ripemd160:function(){return n.bP},sha256:function(){return n.JQ},sha512:function(){return n.o}});var n=r(2006),i=r(21261)},2006:function(t,e,r){"use strict";r.d(e,{Gy:function(){return f},bP:function(){return l},JQ:function(){return h},o:function(){return c}});var n=r(33715),i=r.n(n),o=r(16441),s=r(21261),a=r(1581);let u=new a.Logger("sha2/5.7.0");function l(t){return"0x"+i().ripemd160().update((0,o.arrayify)(t)).digest("hex")}function h(t){return"0x"+i().sha256().update((0,o.arrayify)(t)).digest("hex")}function c(t){return"0x"+i().sha512().update((0,o.arrayify)(t)).digest("hex")}function f(t,e,r){return s.p[t]||u.throwError("unsupported algorithm "+t,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+i().hmac(i()[t],(0,o.arrayify)(e)).update((0,o.arrayify)(r)).digest("hex")}},21261:function(t,e,r){"use strict";var n,i;r.d(e,{p:function(){return n}}),(i=n||(n={})).sha256="sha256",i.sha512="sha512"},67669:function(t,e,r){"use strict";r.r(e),r.d(e,{SigningKey:function(){return G},computePublicKey:function(){return z},recoverPublicKey:function(){return H}});var n=r(42500),i=r.n(n),o=r(33715),s=r.n(o);function a(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(t,null==e?r.path:e)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var u=l;function l(t,e){if(!t)throw Error(e||"Assertion failed")}l.equal=function(t,e,r){if(t!=e)throw Error(r||"Assertion failed: "+t+" != "+e)};var h=a(function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}}),c=a(function(t,e){var r=e;r.assert=u,r.toArray=h.toArray,r.zero2=h.zero2,r.toHex=h.toHex,r.encode=h.encode,r.getNAF=function(t,e,r){var n=Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o,s,a,u=t.andln(3)+n&3,l=e.andln(3)+i&3;3===u&&(u=-1),3===l&&(l=-1),s=(1&u)==0?0:(3==(o=t.andln(7)+n&7)||5===o)&&2===l?-u:u,r[0].push(s),a=(1&l)==0?0:(3==(o=e.andln(7)+i&7)||5===o)&&2===u?-l:l,r[1].push(a),2*n===s+1&&(n=1-n),2*i===a+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new(i())(t,"hex","le")}}),f=c.getNAF,d=c.getJSF,p=c.assert;function m(t,e){this.type=t,this.p=new(i())(e.p,16),this.red=e.prime?i().red(e.prime):i().mont(this.p),this.zero=new(i())(0).toRed(this.red),this.one=new(i())(1).toRed(this.red),this.two=new(i())(2).toRed(this.red),this.n=e.n&&new(i())(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function g(t,e){this.curve=t,this.type=e,this.precomputed=null}m.prototype.point=function(){throw Error("Not implemented")},m.prototype.validate=function(){throw Error("Not implemented")},m.prototype._fixedNafMul=function(t,e){p(t.precomputed);var r,n,i=t._getDoubles(),o=f(e,1,this._bitLength),s=(1<=r;u--)n=(n<<1)+o[u];a.push(n)}for(var l=this.jpoint(null,null,null),h=this.jpoint(null,null,null),c=s;c>0;c--){for(r=0;r=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var l=o[a];p(0!==l),s="affine"===t.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},m.prototype._wnafMulAdd=function(t,e,r,n,i){var o,s,a,u=this._wnafT1,l=this._wnafT2,h=this._wnafT3,c=0;for(o=0;o=1;o-=2){var m=o-1,g=o;if(1!==u[m]||1!==u[g]){h[m]=f(r[m],u[m],this._bitLength),h[g]=f(r[g],u[g],this._bitLength),c=Math.max(h[m].length,c),c=Math.max(h[g].length,c);continue}var y=[e[m],null,null,e[g]];0===e[m].y.cmp(e[g].y)?(y[1]=e[m].add(e[g]),y[2]=e[m].toJ().mixedAdd(e[g].neg())):0===e[m].y.cmp(e[g].y.redNeg())?(y[1]=e[m].toJ().mixedAdd(e[g]),y[2]=e[m].add(e[g].neg())):(y[1]=e[m].toJ().mixedAdd(e[g]),y[2]=e[m].toJ().mixedAdd(e[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=d(r[m],r[g]);for(s=0,c=Math.max(b[0].length,c),h[m]=Array(c),h[g]=Array(c);s=0;o--){for(var S=0;o>=0;){var M=!0;for(s=0;s=0&&S++,E=E.dblp(S),o<0)break;for(s=0;s0?a=l[s][_-1>>1]:_<0&&(a=l[s][-_-1>>1].neg()),E="affine"===a.type?E.mixedAdd(a):E.add(a))}}for(o=0;o=Math.ceil((t.bitLength()+1)/e.step)},g.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;io[0].cmp(o[1])?o[0]:o[1]).toRed(this.red)}if(t.lambda)r=new(i())(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],v(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return n=t.basis?t.basis.map(function(t){return{a:new(i())(t.a,16),b:new(i())(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:n}}},b.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i().mont(t),r=new(i())(2).toRed(e).redInvm(),n=r.redNeg(),o=new(i())(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},b.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,l,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=t,d=this.n.clone(),p=new(i())(1),m=new(i())(0),g=new(i())(0),y=new(i())(1),v=0;0!==f.cmpn(0);){var b=d.div(f);l=d.sub(b.mul(f)),h=g.sub(b.mul(p));var w=y.sub(b.mul(m));if(!n&&0>l.cmp(c))e=u.neg(),r=p,n=l.neg(),o=h;else if(n&&2==++v)break;u=l,d=f,f=l,g=p,p=h,y=m,m=w}s=l.neg(),a=h;var A=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(A)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},b.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),l=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(l).neg()}},b.prototype.pointFromX=function(t,e){(t=new(i())(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},b.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},b.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},w.prototype.isInfinity=function(){return this.inf},w.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},w.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},w.prototype.getX=function(){return this.x.fromRed()},w.prototype.getY=function(){return this.y.fromRed()},w.prototype.mul=function(t){return(t=new(i())(t,16),this.isInfinity())?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},w.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},w.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},w.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},w.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},w.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(A,m.BasePoint),b.prototype.jpoint=function(t,e,r){return new A(this,t,e,r)},A.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},A.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},A.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),h=l.redMul(a),c=n.redMul(l),f=u.redSqr().redIAdd(h).redISub(c).redISub(c),d=u.redMul(c.redISub(f)).redISub(o.redMul(h)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},A.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),h=r.redMul(u),c=a.redSqr().redIAdd(l).redISub(h).redISub(h),f=a.redMul(h.redISub(c)).redISub(i.redMul(l)),d=this.z.redMul(s);return this.curve.jpoint(c,f,d)},A.prototype.dblp=function(t){if(0===t||this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var e,r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},A.prototype.inspect=function(){return this.isInfinity()?"":""},A.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var E=a(function(t,e){var r=e;r.base=m,r.short=b,r.mont=null,r.edwards=null}),k=a(function(t,e){var r,n=e,i=c.assert;function o(t){"short"===t.type?this.curve=new E.short(t):"edwards"===t.type?this.curve=new E.edwards(t):this.curve=new E.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new o(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(u){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function S(t){if(!(this instanceof S))return new S(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=h.toArray(t.entropy,t.entropyEnc||"hex"),r=h.toArray(t.nonce,t.nonceEnc||"hex"),n=h.toArray(t.pers,t.persEnc||"hex");u(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}S.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},S.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=h.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var x=c.assert;function P(t,e){if(t instanceof P)return t;this._importDER(t,e)||(x(t.r&&t.s,"Signature without r or s"),this.r=new(i())(t.r,16),this.s=new(i())(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function C(){this.place=0}function O(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function R(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}P.prototype._importDER=function(t,e){t=c.toArray(t,e);var r=new C;if(48!==t[r.place++])return!1;var n=O(t,r);if(!1===n||n+r.place!==t.length||2!==t[r.place++])return!1;var o=O(t,r);if(!1===o)return!1;var s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var a=O(t,r);if(!1===a||t.length!==a+r.place)return!1;var u=t.slice(r.place,a+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new(i())(s),this.s=new(i())(u),this.recoveryParam=null,!0},P.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=R(e),r=R(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];N(n,e.length),(n=n.concat(e)).push(2),N(n,r.length);var i=n.concat(r),o=[48];return N(o,i.length),o=o.concat(i),c.encode(o,t)};var I=function(){throw Error("unsupported")},T=c.assert;function B(t){if(!(this instanceof B))return new B(t);"string"==typeof t&&(T(Object.prototype.hasOwnProperty.call(k,t),"Unknown curve "+t),t=k[t]),t instanceof k.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}B.prototype.keyPair=function(t){return new _(this,t)},B.prototype.keyFromPrivate=function(t,e){return _.fromPrivate(this,t,e)},B.prototype.keyFromPublic=function(t,e){return _.fromPublic(this,t,e)},B.prototype.genKeyPair=function(t){t||(t={});for(var e=new S({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||I(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(i())(2));;){var o=new(i())(e.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},B.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return(r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0)?t.sub(this.n):t},B.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new(i())(t,16));for(var o=this.n.byteLength(),s=e.getPrivate().toArray("be",o),a=t.toArray("be",o),u=new S({hash:this.hash,entropy:s,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new(i())(1)),h=0;;h++){var c=n.k?n.k(h):new(i())(u.generate(this.n.byteLength()));if(!(0>=(c=this._truncateToN(c,!0)).cmpn(1)||c.cmp(l)>=0)){var f=this.g.mul(c);if(!f.isInfinity()){var d=f.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var m=c.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var g=(f.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new P({r:p,s:m,recoveryParam:g})}}}}}},B.prototype.verify=function(t,e,r,n){t=this._truncateToN(new(i())(t,16)),r=this.keyFromPublic(r,n);var o,s=(e=new P(e,"hex")).r,a=e.s;if(0>s.cmpn(1)||s.cmp(this.n)>=0||0>a.cmpn(1)||a.cmp(this.n)>=0)return!1;var u=a.invm(this.n),l=u.mul(t).umod(this.n),h=u.mul(s).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(l,r.getPublic(),h)).isInfinity()&&o.eqXToP(s):!(o=this.g.mulAdd(l,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(s)},B.prototype.recoverPubKey=function(t,e,r,n){T((3&r)===r,"The recovery param is more than two bits"),e=new P(e,n);var o=this.n,s=new(i())(t),a=e.r,u=e.s,l=1&r,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var c=e.r.invm(o),f=o.sub(s).mul(c).umod(o),d=u.mul(c).umod(o);return this.g.mulAdd(f,a,d)},B.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new P(e,n)).recoveryParam)return e.recoveryParam;for(var i,o=0;o<4;o++){try{i=this.recoverPubKey(t,e,o)}catch(s){continue}if(i.eq(r))return o}throw Error("Unable to find valid recovery factor")};var L=a(function(t,e){var r=e;r.version="6.5.4",r.utils=c,r.rand=function(){throw Error("unsupported")},r.curve=E,r.curves=k,r.ec=B,r.eddsa=null}).ec,F=r(16441),D=r(6881),U=r(1581);let j=new U.Logger("signing-key/5.7.0"),q=null;function K(){return q||(q=new L("secp256k1")),q}class G{constructor(t){(0,D.defineReadOnly)(this,"curve","secp256k1"),(0,D.defineReadOnly)(this,"privateKey",(0,F.hexlify)(t)),32!==(0,F.hexDataLength)(this.privateKey)&&j.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let e=K().keyFromPrivate((0,F.arrayify)(this.privateKey));(0,D.defineReadOnly)(this,"publicKey","0x"+e.getPublic(!1,"hex")),(0,D.defineReadOnly)(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),(0,D.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(t){let e=K().keyFromPublic((0,F.arrayify)(this.publicKey)),r=K().keyFromPublic((0,F.arrayify)(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){let e=K().keyFromPrivate((0,F.arrayify)(this.privateKey)),r=(0,F.arrayify)(t);32!==r.length&&j.throwArgumentError("bad digest length","digest",t);let n=e.sign(r,{canonical:!0});return(0,F.splitSignature)({recoveryParam:n.recoveryParam,r:(0,F.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,F.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(t){let e=K().keyFromPrivate((0,F.arrayify)(this.privateKey)),r=K().keyFromPublic((0,F.arrayify)(z(t)));return(0,F.hexZeroPad)("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}}function H(t,e){let r=(0,F.splitSignature)(e),n={r:(0,F.arrayify)(r.r),s:(0,F.arrayify)(r.s)};return"0x"+K().recoverPubKey((0,F.arrayify)(t),n,r.recoveryParam).encode("hex",!1)}function z(t,e){let r=(0,F.arrayify)(t);if(32===r.length){let n=new G(r);return e?"0x"+K().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?e?(0,F.hexlify)(r):"0x"+K().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+K().keyFromPublic(r).getPublic(!0,"hex"):(0,F.hexlify)(r):j.throwArgumentError("invalid public or private key","key","[REDACTED]")}},42500:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{d="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(62808).Buffer}catch(s){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function l(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?t:e},o.min=function(t,e){return 0>t.cmp(e)?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[i]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(s=0,i=0;s>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var n,i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(c){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d,p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var l=1;l>>26,c=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var r,i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?p[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=m[t],h=g[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var f=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?f+r:p[l-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},d&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(d,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var e,r,n,i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&n;for(;0!==o&&s>26,this.words[s]=67108863&n;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,E=0|s[4],k=8191&E,S=E>>>13,M=0|s[5],_=8191&M,x=M>>>13,P=0|s[6],C=8191&P,O=P>>>13,R=0|s[7],N=8191&R,I=R>>>13,T=0|s[8],B=8191&T,L=T>>>13,F=0|s[9],D=8191&F,U=F>>>13,j=0|a[0],q=8191&j,K=j>>>13,G=0|a[1],H=8191&G,z=G>>>13,Q=0|a[2],W=8191&Q,J=Q>>>13,V=0|a[3],Z=8191&V,Y=V>>>13,$=0|a[4],X=8191&$,tt=$>>>13,te=0|a[5],tr=8191&te,tn=te>>>13,ti=0|a[6],to=8191&ti,ts=ti>>>13,ta=0|a[7],tu=8191&ta,tl=ta>>>13,th=0|a[8],tc=8191&th,tf=th>>>13,td=0|a[9],tp=8191&td,tm=td>>>13;r.negative=t.negative^e.negative,r.length=19;var tg=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,K))+Math.imul(f,q)|0))<<13)|0;l=((o=Math.imul(f,K))+(i>>>13)|0)+(tg>>>26)|0,tg&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,K))+Math.imul(m,q)|0,o=Math.imul(m,K);var ty=(l+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,z)|0)+Math.imul(f,H)|0))<<13)|0;l=((o=o+Math.imul(f,z)|0)+(i>>>13)|0)+(ty>>>26)|0,ty&=67108863,n=Math.imul(y,q),i=(i=Math.imul(y,K))+Math.imul(v,q)|0,o=Math.imul(v,K),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,z)|0;var tv=(l+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(f,W)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(tv>>>26)|0,tv&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,K))+Math.imul(A,q)|0,o=Math.imul(A,K),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,z)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,z)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0;var tb=(l+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(tb>>>26)|0,tb&=67108863,n=Math.imul(k,q),i=(i=Math.imul(k,K))+Math.imul(S,q)|0,o=Math.imul(S,K),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var tw=(l+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(tw>>>26)|0,tw&=67108863,n=Math.imul(_,q),i=(i=Math.imul(_,K))+Math.imul(x,q)|0,o=Math.imul(x,K),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,z)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,z)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,tt)|0;var tA=(l+(n=n+Math.imul(c,tr)|0)|0)+((8191&(i=(i=i+Math.imul(c,tn)|0)+Math.imul(f,tr)|0))<<13)|0;l=((o=o+Math.imul(f,tn)|0)+(i>>>13)|0)+(tA>>>26)|0,tA&=67108863,n=Math.imul(C,q),i=(i=Math.imul(C,K))+Math.imul(O,q)|0,o=Math.imul(O,K),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,z)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,tr)|0,i=(i=i+Math.imul(p,tn)|0)+Math.imul(m,tr)|0,o=o+Math.imul(m,tn)|0;var tE=(l+(n=n+Math.imul(c,to)|0)|0)+((8191&(i=(i=i+Math.imul(c,ts)|0)+Math.imul(f,to)|0))<<13)|0;l=((o=o+Math.imul(f,ts)|0)+(i>>>13)|0)+(tE>>>26)|0,tE&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,K))+Math.imul(I,q)|0,o=Math.imul(I,K),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,z)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(y,tr)|0,i=(i=i+Math.imul(y,tn)|0)+Math.imul(v,tr)|0,o=o+Math.imul(v,tn)|0,n=n+Math.imul(p,to)|0,i=(i=i+Math.imul(p,ts)|0)+Math.imul(m,to)|0,o=o+Math.imul(m,ts)|0;var tk=(l+(n=n+Math.imul(c,tu)|0)|0)+((8191&(i=(i=i+Math.imul(c,tl)|0)+Math.imul(f,tu)|0))<<13)|0;l=((o=o+Math.imul(f,tl)|0)+(i>>>13)|0)+(tk>>>26)|0,tk&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(L,q)|0,o=Math.imul(L,K),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,z)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,z)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,tr)|0,i=(i=i+Math.imul(w,tn)|0)+Math.imul(A,tr)|0,o=o+Math.imul(A,tn)|0,n=n+Math.imul(y,to)|0,i=(i=i+Math.imul(y,ts)|0)+Math.imul(v,to)|0,o=o+Math.imul(v,ts)|0,n=n+Math.imul(p,tu)|0,i=(i=i+Math.imul(p,tl)|0)+Math.imul(m,tu)|0,o=o+Math.imul(m,tl)|0;var tS=(l+(n=n+Math.imul(c,tc)|0)|0)+((8191&(i=(i=i+Math.imul(c,tf)|0)+Math.imul(f,tc)|0))<<13)|0;l=((o=o+Math.imul(f,tf)|0)+(i>>>13)|0)+(tS>>>26)|0,tS&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,K))+Math.imul(U,q)|0,o=Math.imul(U,K),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,z)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,z)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,tr)|0,i=(i=i+Math.imul(k,tn)|0)+Math.imul(S,tr)|0,o=o+Math.imul(S,tn)|0,n=n+Math.imul(w,to)|0,i=(i=i+Math.imul(w,ts)|0)+Math.imul(A,to)|0,o=o+Math.imul(A,ts)|0,n=n+Math.imul(y,tu)|0,i=(i=i+Math.imul(y,tl)|0)+Math.imul(v,tu)|0,o=o+Math.imul(v,tl)|0,n=n+Math.imul(p,tc)|0,i=(i=i+Math.imul(p,tf)|0)+Math.imul(m,tc)|0,o=o+Math.imul(m,tf)|0;var tM=(l+(n=n+Math.imul(c,tp)|0)|0)+((8191&(i=(i=i+Math.imul(c,tm)|0)+Math.imul(f,tp)|0))<<13)|0;l=((o=o+Math.imul(f,tm)|0)+(i>>>13)|0)+(tM>>>26)|0,tM&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(_,tr)|0,i=(i=i+Math.imul(_,tn)|0)+Math.imul(x,tr)|0,o=o+Math.imul(x,tn)|0,n=n+Math.imul(k,to)|0,i=(i=i+Math.imul(k,ts)|0)+Math.imul(S,to)|0,o=o+Math.imul(S,ts)|0,n=n+Math.imul(w,tu)|0,i=(i=i+Math.imul(w,tl)|0)+Math.imul(A,tu)|0,o=o+Math.imul(A,tl)|0,n=n+Math.imul(y,tc)|0,i=(i=i+Math.imul(y,tf)|0)+Math.imul(v,tc)|0,o=o+Math.imul(v,tf)|0;var t_=(l+(n=n+Math.imul(p,tp)|0)|0)+((8191&(i=(i=i+Math.imul(p,tm)|0)+Math.imul(m,tp)|0))<<13)|0;l=((o=o+Math.imul(m,tm)|0)+(i>>>13)|0)+(t_>>>26)|0,t_&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,J))+Math.imul(U,W)|0,o=Math.imul(U,J),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(C,tr)|0,i=(i=i+Math.imul(C,tn)|0)+Math.imul(O,tr)|0,o=o+Math.imul(O,tn)|0,n=n+Math.imul(_,to)|0,i=(i=i+Math.imul(_,ts)|0)+Math.imul(x,to)|0,o=o+Math.imul(x,ts)|0,n=n+Math.imul(k,tu)|0,i=(i=i+Math.imul(k,tl)|0)+Math.imul(S,tu)|0,o=o+Math.imul(S,tl)|0,n=n+Math.imul(w,tc)|0,i=(i=i+Math.imul(w,tf)|0)+Math.imul(A,tc)|0,o=o+Math.imul(A,tf)|0;var tx=(l+(n=n+Math.imul(y,tp)|0)|0)+((8191&(i=(i=i+Math.imul(y,tm)|0)+Math.imul(v,tp)|0))<<13)|0;l=((o=o+Math.imul(v,tm)|0)+(i>>>13)|0)+(tx>>>26)|0,tx&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(N,tr)|0,i=(i=i+Math.imul(N,tn)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,tn)|0,n=n+Math.imul(C,to)|0,i=(i=i+Math.imul(C,ts)|0)+Math.imul(O,to)|0,o=o+Math.imul(O,ts)|0,n=n+Math.imul(_,tu)|0,i=(i=i+Math.imul(_,tl)|0)+Math.imul(x,tu)|0,o=o+Math.imul(x,tl)|0,n=n+Math.imul(k,tc)|0,i=(i=i+Math.imul(k,tf)|0)+Math.imul(S,tc)|0,o=o+Math.imul(S,tf)|0;var tP=(l+(n=n+Math.imul(w,tp)|0)|0)+((8191&(i=(i=i+Math.imul(w,tm)|0)+Math.imul(A,tp)|0))<<13)|0;l=((o=o+Math.imul(A,tm)|0)+(i>>>13)|0)+(tP>>>26)|0,tP&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,tt))+Math.imul(U,X)|0,o=Math.imul(U,tt),n=n+Math.imul(B,tr)|0,i=(i=i+Math.imul(B,tn)|0)+Math.imul(L,tr)|0,o=o+Math.imul(L,tn)|0,n=n+Math.imul(N,to)|0,i=(i=i+Math.imul(N,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,n=n+Math.imul(C,tu)|0,i=(i=i+Math.imul(C,tl)|0)+Math.imul(O,tu)|0,o=o+Math.imul(O,tl)|0,n=n+Math.imul(_,tc)|0,i=(i=i+Math.imul(_,tf)|0)+Math.imul(x,tc)|0,o=o+Math.imul(x,tf)|0;var tC=(l+(n=n+Math.imul(k,tp)|0)|0)+((8191&(i=(i=i+Math.imul(k,tm)|0)+Math.imul(S,tp)|0))<<13)|0;l=((o=o+Math.imul(S,tm)|0)+(i>>>13)|0)+(tC>>>26)|0,tC&=67108863,n=Math.imul(D,tr),i=(i=Math.imul(D,tn))+Math.imul(U,tr)|0,o=Math.imul(U,tn),n=n+Math.imul(B,to)|0,i=(i=i+Math.imul(B,ts)|0)+Math.imul(L,to)|0,o=o+Math.imul(L,ts)|0,n=n+Math.imul(N,tu)|0,i=(i=i+Math.imul(N,tl)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,tl)|0,n=n+Math.imul(C,tc)|0,i=(i=i+Math.imul(C,tf)|0)+Math.imul(O,tc)|0,o=o+Math.imul(O,tf)|0;var tO=(l+(n=n+Math.imul(_,tp)|0)|0)+((8191&(i=(i=i+Math.imul(_,tm)|0)+Math.imul(x,tp)|0))<<13)|0;l=((o=o+Math.imul(x,tm)|0)+(i>>>13)|0)+(tO>>>26)|0,tO&=67108863,n=Math.imul(D,to),i=(i=Math.imul(D,ts))+Math.imul(U,to)|0,o=Math.imul(U,ts),n=n+Math.imul(B,tu)|0,i=(i=i+Math.imul(B,tl)|0)+Math.imul(L,tu)|0,o=o+Math.imul(L,tl)|0,n=n+Math.imul(N,tc)|0,i=(i=i+Math.imul(N,tf)|0)+Math.imul(I,tc)|0,o=o+Math.imul(I,tf)|0;var tR=(l+(n=n+Math.imul(C,tp)|0)|0)+((8191&(i=(i=i+Math.imul(C,tm)|0)+Math.imul(O,tp)|0))<<13)|0;l=((o=o+Math.imul(O,tm)|0)+(i>>>13)|0)+(tR>>>26)|0,tR&=67108863,n=Math.imul(D,tu),i=(i=Math.imul(D,tl))+Math.imul(U,tu)|0,o=Math.imul(U,tl),n=n+Math.imul(B,tc)|0,i=(i=i+Math.imul(B,tf)|0)+Math.imul(L,tc)|0,o=o+Math.imul(L,tf)|0;var tN=(l+(n=n+Math.imul(N,tp)|0)|0)+((8191&(i=(i=i+Math.imul(N,tm)|0)+Math.imul(I,tp)|0))<<13)|0;l=((o=o+Math.imul(I,tm)|0)+(i>>>13)|0)+(tN>>>26)|0,tN&=67108863,n=Math.imul(D,tc),i=(i=Math.imul(D,tf))+Math.imul(U,tc)|0,o=Math.imul(U,tf);var tI=(l+(n=n+Math.imul(B,tp)|0)|0)+((8191&(i=(i=i+Math.imul(B,tm)|0)+Math.imul(L,tp)|0))<<13)|0;l=((o=o+Math.imul(L,tm)|0)+(i>>>13)|0)+(tI>>>26)|0,tI&=67108863;var tT=(l+(n=Math.imul(D,tp))|0)+((8191&(i=(i=Math.imul(D,tm))+Math.imul(U,tp)|0))<<13)|0;return l=((o=Math.imul(U,tm))+(i>>>13)|0)+(tT>>>26)|0,tT&=67108863,u[0]=tg,u[1]=ty,u[2]=tv,u[3]=tb,u[4]=tw,u[5]=tA,u[6]=tE,u[7]=tk,u[8]=tS,u[9]=tM,u[10]=t_,u[11]=tx,u[12]=tP,u[13]=tC,u[14]=tO,u[15]=tR,u[16]=tN,u[17]=tI,u[18]=tT,0!==l&&(u[19]=l,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function w(t,e){this.x=t,this.y=e}Math.imul||(v=y),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,e):n<63?y(this,t,e):b(this,t,e)},w.prototype.makeRBT=function(t){for(var e=Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},w.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=(o/67108864|0)+(s>>>26),this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var i,o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return!(this.length<=r)&&!!(this.words[r]&1<=0);var e=t%26,r=(t-e)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==e&&r++,this.length=Math.min(r,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r,n=this.length-t.length,i=this.clone(),s=t,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),i.iushln(n),a=0|s.words[s.length-1]);var u=i.length-s.length;if("mod"!==e){(r=new o(null)).length=u+1,r.words=Array(r.length);for(var l=0;l=0;c--){var f=(0|i.words[s.length+c])*67108864+(0|i.words[s.length+c-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(s,f,c);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(s,1,c),i.isZero()||(i.negative^=1);r&&(r.words[c]=f)}return r&&r._strip(),i._strip(),"div"!==e&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(t,e,r){var i,s,a;return(n(!t.isZero()),this.isZero())?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e)},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=67108864%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;(e.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e,r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var s=new o(1),a=new o(0),u=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,h=1;(r.words[0]&h)==0&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,f=1;(i.words[0]&f)==0&&c<26;++c,f<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),s.isub(a)):(i.isub(r),a.isub(s))}return 0>(e=0===r.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return -1===this.cmpn(t)},o.prototype.lt=function(t){return -1===this.cmp(t)},o.prototype.lten=function(t){return 0>=this.cmpn(t)},o.prototype.lte=function(t){return 0>=this.cmp(t)},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function P(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var t=new o(null);return t.words=Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},i(k,E),k.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},k.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){var e;if(A[t])return A[t];if("k256"===t)e=new k;else if("p224"===t)e=new S;else if("p192"===t)e=new M;else if("p25519"===t)e=new _;else throw Error("Unknown prime "+t);return A[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n((t.negative|e.negative)==0,"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var l=e.words[n],h=u-1;h>=0;h--){var c=l>>h&1;if(i!==r[0]&&(i=this.sqr(i)),0===c&&0===s){a=0;continue}s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new P(t)},i(P,x),P.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},P.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},P.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},P.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},P.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},31886:function(t,e,r){"use strict";r.r(e),r.d(e,{keccak256:function(){return p},pack:function(){return d},sha256:function(){return m}});var n=r(2593),i=r(16441),o=r(38197),s=r(2006),a=r(29251),u=r(1581);let l=RegExp("^bytes([0-9]+)$"),h=RegExp("^(u?int)([0-9]*)$"),c=RegExp("^(.*)\\[([0-9]*)\\]$"),f=new u.Logger("solidity/5.7.0");function d(t,e){t.length!=e.length&&f.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);let r=[];return t.forEach(function(t,o){r.push(function t(e,r,o){switch(e){case"address":if(o)return(0,i.zeroPad)(r,32);return(0,i.arrayify)(r);case"string":return(0,a.Y0)(r);case"bytes":return(0,i.arrayify)(r);case"bool":if(r=r?"0x01":"0x00",o)return(0,i.zeroPad)(r,32);return(0,i.arrayify)(r)}let s=e.match(h);if(s){let u=parseInt(s[2]||"256");return(s[2]&&String(u)!==s[2]||u%8!=0||0===u||u>256)&&f.throwArgumentError("invalid number type","type",e),o&&(u=256),r=n.O$.from(r).toTwos(u),(0,i.zeroPad)(r,u/8)}if(s=e.match(l)){let d=parseInt(s[1]);return((String(d)!==s[1]||0===d||d>32)&&f.throwArgumentError("invalid bytes type","type",e),(0,i.arrayify)(r).byteLength!==d&&f.throwArgumentError(`invalid value for ${e}`,"value",r),o)?(0,i.arrayify)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((s=e.match(c))&&Array.isArray(r)){let p=s[1],m=parseInt(s[2]||String(r.length));m!=r.length&&f.throwArgumentError(`invalid array length for ${e}`,"value",r);let g=[];return r.forEach(function(e){g.push(t(p,e,!0))}),(0,i.concat)(g)}return f.throwArgumentError("invalid type","type",e)}(t,e[o]))}),(0,i.hexlify)((0,i.concat)(r))}function p(t,e){return(0,o.keccak256)(d(t,e))}function m(t,e){return(0,s.JQ)(d(t,e))}},22384:function(t,e,r){"use strict";r.r(e),r.d(e,{UnicodeNormalizationForm:function(){return o.Uj},Utf8ErrorFuncs:function(){return o.te},Utf8ErrorReason:function(){return o.Uw},_toEscapedUtf8String:function(){return o.U$},formatBytes32String:function(){return s},nameprep:function(){return v},parseBytes32String:function(){return a},toUtf8Bytes:function(){return o.Y0},toUtf8CodePoints:function(){return o.XL},toUtf8String:function(){return o.ZN}});var n=r(57218),i=r(16441),o=r(29251);function s(t){let e=(0,o.Y0)(t);if(e.length>31)throw Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([e,n.R]).slice(0,32))}function a(t){let e=(0,i.arrayify)(t);if(32!==e.length)throw Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw Error("invalid bytes32 string - no null terminator");let r=31;for(;0===e[r-1];)r--;return(0,o.ZN)(e.slice(0,r))}function u(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,n={};return t.split(",").forEach(t=>{let i=t.split(":");n[r+=parseInt(i[0],16)]=e(i[1])}),n}function l(t){let e=0;return t.split(",").map(t=>{let r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}})}function h(t,e){let r=0;for(let n=0;n=(r+=i.l)&&t<=r+i.h&&(t-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-r))continue;return i}}return null}let c=l("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),f="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),d=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],p=u("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),m=u("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),g=u("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",function(t){if(t.length%4!=0)throw Error("bad data");let e=[];for(let r=0;rf.indexOf(t)>=0||t>=65024&&t<=65039?[]:function(t){let e=h(t,d);if(e)return[t+e.s];let r=p[t];if(r)return r;let n=m[t];return n?[t+n[0]]:g[t]||null}(t)||[t]).reduce((t,e)=>(e.forEach(e=>{t.push(e)}),t),[]),(e=(0,o.XL)((0,o.uu)(e),o.Uj.NFKC)).forEach(t=>{if(h(t,y))throw Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(t=>{if(h(t,c))throw Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=(0,o.uu)(e);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw Error("invalid hyphen");return r}},29251:function(t,e,r){"use strict";r.d(e,{Uj:function(){return o},te:function(){return c},Uw:function(){return s},U$:function(){return m},uu:function(){return g},Y0:function(){return d},XL:function(){return v},ZN:function(){return y}});var n,i,o,s,a=r(16441),u=r(1581);let l=new u.Logger("strings/5.7.0");function h(t,e,r,n,i){if(t===s.BAD_PREFIX||t===s.UNEXPECTED_CONTINUE){let o=0;for(let a=e+1;a>6==2;a++)o++;return o}return t===s.OVERRUN?r.length-e-1:0}(n=o||(o={})).current="",n.NFC="NFC",n.NFD="NFD",n.NFKC="NFKC",n.NFKD="NFKD",(i=s||(s={})).UNEXPECTED_CONTINUE="unexpected continuation byte",i.BAD_PREFIX="bad codepoint prefix",i.OVERRUN="string overrun",i.MISSING_CONTINUE="missing continuation byte",i.OUT_OF_RANGE="out of UTF-8 range",i.UTF16_SURROGATE="UTF-16 surrogate",i.OVERLONG="overlong representation";let c=Object.freeze({error:function(t,e,r,n,i){return l.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:h,replace:function(t,e,r,n,i){return t===s.OVERLONG?(n.push(i),0):(n.push(65533),h(t,e,r,n,i))}});function f(t,e){null==e&&(e=c.error),t=(0,a.arrayify)(t);let r=[],n=0;for(;n>7==0){r.push(i);continue}let o=null,u=null;if((224&i)==192)o=1,u=127;else if((240&i)==224)o=2,u=2047;else if((248&i)==240)o=3,u=65535;else{(192&i)==128?n+=e(s.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(s.BAD_PREFIX,n-1,t,r);continue}if(n-1+o>=t.length){n+=e(s.OVERRUN,n-1,t,r);continue}let l=i&(1<<8-o-1)-1;for(let h=0;h1114111){n+=e(s.OUT_OF_RANGE,n-1-o,t,r,l);continue}if(l>=55296&&l<=57343){n+=e(s.UTF16_SURROGATE,n-1-o,t,r,l);continue}if(l<=u){n+=e(s.OVERLONG,n-1-o,t,r,l);continue}r.push(l)}}return r}function d(t,e=o.current){e!=o.current&&(l.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(63&i|128);else if((64512&i)==55296){n++;let s=t.charCodeAt(n);if(n>=t.length||(64512&s)!=56320)throw Error("invalid utf-8 string");let u=65536+((1023&i)<<10)+(1023&s);r.push(u>>18|240),r.push(u>>12&63|128),r.push(u>>6&63|128),r.push(63&u|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return(0,a.arrayify)(r)}function p(t){let e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function m(t,e){return'"'+f(t,e).map(t=>{if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?p(t):p(((t-=65536)>>10&1023)+55296)+p((1023&t)+56320)}).join("")+'"'}function g(t){return t.map(t=>t<=65535?String.fromCharCode(t):String.fromCharCode(((t-=65536)>>10&1023)+55296,(1023&t)+56320)).join("")}function y(t,e){return g(f(t,e))}function v(t,e=o.current){return f(d(t,e))}},83875:function(t,e,r){"use strict";r.r(e),r.d(e,{TransactionTypes:function(){return i},accessListify:function(){return k},computeAddress:function(){return b},parse:function(){return C},recoverAddress:function(){return w},serialize:function(){return x}});var n,i,o=r(19485),s=r(2593),a=r(16441),u=r(21046),l=r(38197),h=r(6881),c=r(59052),f=r(67669),d=r(1581);let p=new d.Logger("transactions/5.7.0");function m(t){return"0x"===t?null:(0,o.getAddress)(t)}function g(t){return"0x"===t?u._Y:s.O$.from(t)}(n=i||(i={}))[n.legacy=0]="legacy",n[n.eip2930=1]="eip2930",n[n.eip1559=2]="eip1559";let y=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],v={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(t){let e=(0,f.computePublicKey)(t);return(0,o.getAddress)((0,a.hexDataSlice)((0,l.keccak256)((0,a.hexDataSlice)(e,1)),12))}function w(t,e){return b((0,f.recoverPublicKey)((0,a.arrayify)(t),e))}function A(t,e){let r=(0,a.stripZeros)(s.O$.from(t).toHexString());return r.length>32&&p.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function E(t,e){return{address:(0,o.getAddress)(t),storageKeys:(e||[]).map((e,r)=>(32!==(0,a.hexDataLength)(e)&&p.throwArgumentError("invalid access list storageKey",`accessList[${t}:${r}]`,e),e.toLowerCase()))}}function k(t){if(Array.isArray(t))return t.map((t,e)=>Array.isArray(t)?(t.length>2&&p.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),E(t[0],t[1])):E(t.address,t.storageKeys));let e=Object.keys(t).map(e=>{let r=t[e].reduce((t,e)=>(t[e]=!0,t),{});return E(e,Object.keys(r).sort())});return e.sort((t,e)=>t.address.localeCompare(e.address)),e}function S(t){return k(t).map(t=>[t.address,t.storageKeys])}function M(t,e){if(null!=t.gasPrice){let r=s.O$.from(t.gasPrice),n=s.O$.from(t.maxFeePerGas||0);r.eq(n)||p.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}let i=[A(t.chainId||0,"chainId"),A(t.nonce||0,"nonce"),A(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),A(t.maxFeePerGas||0,"maxFeePerGas"),A(t.gasLimit||0,"gasLimit"),null!=t.to?(0,o.getAddress)(t.to):"0x",A(t.value||0,"value"),t.data||"0x",S(t.accessList||[])];if(e){let u=(0,a.splitSignature)(e);i.push(A(u.recoveryParam,"recoveryParam")),i.push((0,a.stripZeros)(u.r)),i.push((0,a.stripZeros)(u.s))}return(0,a.hexConcat)(["0x02",c.encode(i)])}function _(t,e){let r=[A(t.chainId||0,"chainId"),A(t.nonce||0,"nonce"),A(t.gasPrice||0,"gasPrice"),A(t.gasLimit||0,"gasLimit"),null!=t.to?(0,o.getAddress)(t.to):"0x",A(t.value||0,"value"),t.data||"0x",S(t.accessList||[])];if(e){let n=(0,a.splitSignature)(e);r.push(A(n.recoveryParam,"recoveryParam")),r.push((0,a.stripZeros)(n.r)),r.push((0,a.stripZeros)(n.s))}return(0,a.hexConcat)(["0x01",c.encode(r)])}function x(t,e){if(null==t.type||0===t.type)return null!=t.accessList&&p.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),function(t,e){(0,h.checkProperties)(t,v);let r=[];y.forEach(function(e){let n=t[e.name]||[],i={};e.numeric&&(i.hexPad="left"),n=(0,a.arrayify)((0,a.hexlify)(n,i)),e.length&&n.length!==e.length&&n.length>0&&p.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=(0,a.stripZeros)(n)).length>e.maxLength&&p.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),r.push((0,a.hexlify)(n))});let n=0;if(null!=t.chainId?"number"!=typeof(n=t.chainId)&&p.throwArgumentError("invalid transaction.chainId","transaction",t):e&&!(0,a.isBytesLike)(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),0!==n&&(r.push((0,a.hexlify)(n)),r.push("0x"),r.push("0x")),!e)return c.encode(r);let i=(0,a.splitSignature)(e),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push((0,a.hexlify)(o)),r.push((0,a.stripZeros)((0,a.arrayify)(i.r))),r.push((0,a.stripZeros)((0,a.arrayify)(i.s))),c.encode(r)}(t,e);switch(t.type){case 1:return _(t,e);case 2:return M(t,e)}return p.throwError(`unsupported transaction type: ${t.type}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function P(t,e,r){try{let n=g(e[0]).toNumber();if(0!==n&&1!==n)throw Error("bad recid");t.v=n}catch(i){p.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=(0,a.hexZeroPad)(e[1],32),t.s=(0,a.hexZeroPad)(e[2],32);try{let o=(0,l.keccak256)(r(t));t.from=w(o,{r:t.r,s:t.s,recoveryParam:t.v})}catch(s){}}function C(t){let e=(0,a.arrayify)(t);if(e[0]>127)return function(t){let e=c.decode(t);9!==e.length&&6!==e.length&&p.throwArgumentError("invalid raw transaction","rawTransaction",t);let r={nonce:g(e[0]).toNumber(),gasPrice:g(e[1]),gasLimit:g(e[2]),to:m(e[3]),value:g(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=s.O$.from(e[6]).toNumber()}catch(n){return r}if(r.r=(0,a.hexZeroPad)(e[7],32),r.s=(0,a.hexZeroPad)(e[8],32),s.O$.from(r.r).isZero()&&s.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let i=r.v-27,o=e.slice(0,6);0!==r.chainId&&(o.push((0,a.hexlify)(r.chainId)),o.push("0x"),o.push("0x"),i-=2*r.chainId+8);let u=(0,l.keccak256)(c.encode(o));try{r.from=w(u,{r:(0,a.hexlify)(r.r),s:(0,a.hexlify)(r.s),recoveryParam:i})}catch(h){}r.hash=(0,l.keccak256)(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){let e=c.decode(t.slice(1));8!==e.length&&11!==e.length&&p.throwArgumentError("invalid component count for transaction type: 1","payload",(0,a.hexlify)(t));let r={type:1,chainId:g(e[0]).toNumber(),nonce:g(e[1]).toNumber(),gasPrice:g(e[2]),gasLimit:g(e[3]),to:m(e[4]),value:g(e[5]),data:e[6],accessList:k(e[7])};return 8===e.length||(r.hash=(0,l.keccak256)(t),P(r,e.slice(8),_)),r}(e);case 2:return function(t){let e=c.decode(t.slice(1));9!==e.length&&12!==e.length&&p.throwArgumentError("invalid component count for transaction type: 2","payload",(0,a.hexlify)(t));let r=g(e[2]),n=g(e[3]),i={type:2,chainId:g(e[0]).toNumber(),nonce:g(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:g(e[4]),to:m(e[5]),value:g(e[6]),data:e[7],accessList:k(e[8])};return 9===e.length||(i.hash=(0,l.keccak256)(t),P(i,e.slice(9),M)),i}(e)}return p.throwError(`unsupported transaction type: ${e[0]}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}},61744:function(t,e,r){"use strict";r.r(e),r.d(e,{commify:function(){return a},formatEther:function(){return h},formatUnits:function(){return u},parseEther:function(){return c},parseUnits:function(){return l}});var n=r(20335),i=r(1581);let o=new i.Logger("units/5.7.0"),s=["wei","kwei","mwei","gwei","szabo","finney","ether"];function a(t){let e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&o.throwArgumentError("invalid value","value",t);let r=e[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===e.length&&(i="."+(e[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);let s=[];for(;r.length;){if(r.length<=3){s.unshift(r);break}{let a=r.length-3;s.unshift(r.substring(a)),r=r.substring(0,a)}}return n+s.join(",")+i}function u(t,e){if("string"==typeof e){let r=s.indexOf(e);-1!==r&&(e=3*r)}return(0,n.S5)(t,null!=e?e:18)}function l(t,e){if("string"!=typeof t&&o.throwArgumentError("value must be a string","value",t),"string"==typeof e){let r=s.indexOf(e);-1!==r&&(e=3*r)}return(0,n.Ox)(t,null!=e?e:18)}function h(t){return u(t,18)}function c(t){return l(t,18)}},79911:function(t,e,r){"use strict";r.r(e),r.d(e,{Wallet:function(){return w},verifyMessage:function(){return A},verifyTypedData:function(){return E}});var n=r(19485),i=r(81556),o=r(48088),s=r(16441),a=r(93684),u=r(67827),l=r(84178),h=r(38197),c=r(6881),f=r(5634),d=r(67669),p=r(81964),m=r(45659),g=r(83875),y=r(1581),v=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let b=new y.Logger("wallet/5.7.0");class w extends o.Signer{constructor(t,e){var r;if(super(),null!=(r=t)&&(0,s.isHexString)(r.privateKey,32)&&null!=r.address){let o=new d.SigningKey(t.privateKey);if((0,c.defineReadOnly)(this,"_signingKey",()=>o),(0,c.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey)),this.address!==(0,n.getAddress)(t.address)&&b.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(t){let e=t.mnemonic;return e&&e.phrase}(t)){let a=t.mnemonic;(0,c.defineReadOnly)(this,"_mnemonic",()=>({phrase:a.phrase,path:a.path||l.defaultPath,locale:a.locale||"en"}));let u=this.mnemonic,h=l.HDNode.fromMnemonic(u.phrase,null,u.locale).derivePath(u.path);(0,g.computeAddress)(h.privateKey)!==this.address&&b.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,c.defineReadOnly)(this,"_mnemonic",()=>null)}else{if(d.SigningKey.isSigningKey(t))"secp256k1"!==t.curve&&b.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,c.defineReadOnly)(this,"_signingKey",()=>t);else{"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t);let f=new d.SigningKey(t);(0,c.defineReadOnly)(this,"_signingKey",()=>f)}(0,c.defineReadOnly)(this,"_mnemonic",()=>null),(0,c.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey))}e&&!i.zt.isProvider(e)&&b.throwArgumentError("invalid provider","provider",e),(0,c.defineReadOnly)(this,"provider",e||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(t){return new w(this,t)}signTransaction(t){return(0,c.resolveProperties)(t).then(e=>{null!=e.from&&((0,n.getAddress)(e.from)!==this.address&&b.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete e.from);let r=this._signingKey().signDigest((0,h.keccak256)((0,g.serialize)(e)));return(0,g.serialize)(e,r)})}signMessage(t){return v(this,void 0,void 0,function*(){return(0,s.joinSignature)(this._signingKey().signDigest((0,a.r)(t)))})}_signTypedData(t,e,r){return v(this,void 0,void 0,function*(){let n=yield u.E.resolveNames(t,e,r,t=>(null==this.provider&&b.throwError("cannot resolve ENS names without a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:t}),this.provider.resolveName(t)));return(0,s.joinSignature)(this._signingKey().signDigest(u.E.hash(n.domain,e,n.value)))})}encrypt(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw Error("invalid callback");return e||(e={}),(0,p.HI)(this,t,e,r)}static createRandom(t){let e=(0,f.O)(16);t||(t={}),t.extraEntropy&&(e=(0,s.arrayify)((0,s.hexDataSlice)((0,h.keccak256)((0,s.concat)([e,t.extraEntropy])),0,16)));let r=(0,l.entropyToMnemonic)(e,t.locale);return w.fromMnemonic(r,t.path,t.locale)}static fromEncryptedJson(t,e,r){return(0,m.decryptJsonWallet)(t,e,r).then(t=>new w(t))}static fromEncryptedJsonSync(t,e){return new w((0,m.decryptJsonWalletSync)(t,e))}static fromMnemonic(t,e,r){return e||(e=l.defaultPath),new w(l.HDNode.fromMnemonic(t,null,r).derivePath(e))}}function A(t,e){return(0,g.recoverAddress)((0,a.r)(t),e)}function E(t,e,r,n){return(0,g.recoverAddress)(u.E.hash(t,e,r),n)}},37707:function(t,e,r){"use strict";r.r(e),r.d(e,{_fetchData:function(){return c},fetchJson:function(){return f},poll:function(){return d}});var n=r(59567),i=r(16441),o=r(6881),s=r(29251),a=r(1581);let u=new a.Logger("web/5.7.1");function l(t){return new Promise(e=>{setTimeout(e,t)})}function h(t,e){if(null==t)return null;if("string"==typeof t)return t;if((0,i.isBytesLike)(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return(0,s.ZN)(t)}catch(r){}return(0,i.hexlify)(t)}return t}function c(t,e,r){let c="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;u.assertArgument(c>0&&c%1==0,"invalid connection throttle limit","connection.throttleLimit",c);let f="object"==typeof t?t.throttleCallback:null,d="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;u.assertArgument(d>0&&d%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",d);let p="object"==typeof t&&!!t.errorPassThrough,m={},g=null,y={method:"GET"},v=!1,b=12e4;if("string"==typeof t)g=t;else if("object"==typeof t){if((null==t||null==t.url)&&u.throwArgumentError("missing URL","connection.url",t),g=t.url,"number"==typeof t.timeout&&t.timeout>0&&(b=t.timeout),t.headers)for(let w in t.headers)m[w.toLowerCase()]={key:w,value:String(t.headers[w])},["if-none-match","if-modified-since"].indexOf(w.toLowerCase())>=0&&(v=!0);if(y.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==g.substring(0,6)&&!0!==t.allowInsecureAuthentication&&u.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:t.user,password:"[REDACTED]"});let A=t.user+":"+t.password;m.authorization={key:"Authorization",value:"Basic "+(0,n.c)((0,s.Y0)(A))}}null!=t.skipFetchSetup&&(y.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(y.fetchOptions=(0,o.shallowCopy)(t.fetchOptions))}let E=RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),k=g?g.match(E):null;if(k)try{var S;let M={statusCode:200,statusMessage:"OK",headers:{"content-type":k[1]||"text/plain"},body:k[2]?(0,n.J)(k[3]):(S=k[3],(0,s.Y0)(S.replace(/%([0-9a-f][0-9a-f])/gi,(t,e)=>String.fromCharCode(parseInt(e,16)))))},_=M.body;return r&&(_=r(M.body,M)),Promise.resolve(_)}catch(x){u.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:h(k[1],k[2]),error:x,requestBody:null,requestMethod:"GET",url:g})}e&&(y.method="POST",y.body=e,null==m["content-type"]&&(m["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==m["content-length"]&&(m["content-length"]={key:"Content-Length",value:String(e.length)}));let P={};Object.keys(m).forEach(t=>{let e=m[t];P[e.key]=e.value}),y.headers=P;let C=function(){let t=null,e=new Promise(function(e,r){b&&(t=setTimeout(()=>{null!=t&&(t=null,r(u.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:h(y.body,P["content-type"]),requestMethod:y.method,timeout:b,url:g})))},b))});return{promise:e,cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),O=function(){var t,e,n,o;return t=this,e=void 0,n=void 0,o=function*(){for(let t=0;t{a[e.toLowerCase()]=t}):o.headers.keys().forEach(t=>{a[t.toLowerCase()]=o.headers.get(t)}),{headers:a,statusCode:o.status,statusMessage:o.statusText,body:(0,i.arrayify)(new Uint8Array(s))}},new(o||(o=Promise))(function(t,e){function i(t){try{u(s.next(t))}catch(r){e(r)}}function a(t){try{u(s.throw(t))}catch(r){e(r)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof o?r:new o(function(t){t(r)})).then(i,a)}u((s=s.apply(r,n||[])).next())})}(g,y),t=300)&&(C.cancel(),u.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:h(b,e.headers?e.headers["content-type"]:null),requestBody:h(y.body,P["content-type"]),requestMethod:y.method,url:g})),r)try{let w=yield r(b,e);return C.cancel(),w}catch(k){if(k.throttleRetry&&t{let n=null;if(null!=t)try{n=JSON.parse((0,s.ZN)(t))}catch(i){u.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:t,error:i})}return r&&(n=r(n,e)),n},i=null;if(null!=e){i=(0,s.Y0)(e);let l="string"==typeof t?{url:t}:(0,o.shallowCopy)(t);if(l.headers){let h=0!==Object.keys(l.headers).filter(t=>"content-type"===t.toLowerCase()).length;h||(l.headers=(0,o.shallowCopy)(l.headers),l.headers["content-type"]="application/json")}else l.headers={"content-type":"application/json"};t=l}return c(t,i,n)}function d(t,e){return e||(e={}),null==(e=(0,o.shallowCopy)(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise(function(r,n){let i=null,o=!1,s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{s()&&n(Error("timeout"))},e.timeout));let a=e.retryLimit,u=0;!function i(){return t().then(function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(++u>a){s()&&n(Error("retry limit reached"));return}let l=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));le.ceiling&&(l=e.ceiling),setTimeout(i,l)}return null},function(t){s()&&n(t)})}()})}},78435:function(t,e,r){"use strict";r.r(e),r.d(e,{Wordlist:function(){return n.D},logger:function(){return n.k},wordlists:function(){return i.E}});var n=r(48812),i=r(10234)},48812:function(t,e,r){"use strict";r.d(e,{D:function(){return a},k:function(){return s}});var n=r(32046),i=r(6881),o=r(1581);let s=new o.Logger("wordlists/5.7.0");class a{constructor(t){s.checkAbstract(new.target,a),(0,i.defineReadOnly)(this,"locale",t)}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}static check(t){let e=[];for(let r=0;r<2048;r++){let i=t.getWord(r);if(r!==t.getWordIndex(i))return"0x";e.push(i)}return(0,n.id)(e.join("\n")+"\n")}static register(t,e){e||(e=t.locale)}}},10234:function(t,e,r){"use strict";r.d(e,{E:function(){return u}});var n=r(48812);let i=null;function o(t){if(null==i&&(i="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==n.D.check(t)))throw i=null,Error("BIP39 Wordlist for en (English) FAILED")}class s extends n.D{constructor(){super("en")}getWord(t){return o(this),i[t]}getWordIndex(t){return o(this),i.indexOf(t)}}let a=new s;n.D.register(a);let u={en:a}},82775:function(t,e,r){"use strict";r.d(e,{i:function(){return u}});var n=r(97231);r(26729);var i=new WeakMap,o=new WeakMap,s=new WeakSet,a=new WeakSet;class u extends n.I{constructor(){let{chains:t,options:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={name:"MetaMask",shimDisconnect:!0,shimChainChangedDisconnect:!0,...e};super({chains:t,options:r}),(0,n._)(this,a),(0,n._)(this,s),(0,n.t)(this,"id","metaMask"),(0,n.t)(this,"ready","undefined"!=typeof window&&!!(0,n.u)(this,a,h).call(this,window.ethereum)),(0,n.v)(this,i,{writable:!0,value:void 0}),(0,n.v)(this,o,{writable:!0,value:void 0}),(0,n.w)(this,o,r.UNSTABLE_shimOnConnectSelectAccount)}async connect(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var e,r,i,s;let a=await this.getProvider();if(!a)throw new n.d;if(a.on&&(a.on("accountsChanged",this.onAccountsChanged),a.on("chainChanged",this.onChainChanged),a.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"}),(0,n.x)(this,o)&&null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&!(null!==(r=(0,n.g)().storage)&&void 0!==r&&r.getItem(this.shimDisconnectKey))){let u=await a.request({method:"eth_accounts"}).catch(()=>[]),l=!!u[0];l&&await a.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]})}let h=await this.getAccount(),c=await this.getChainId(),f=this.isChainUnsupported(c);if(t&&c!==t){let d=await this.switchChain(t);c=d.id,f=this.isChainUnsupported(c)}return null!==(i=this.options)&&void 0!==i&&i.shimDisconnect&&(null===(s=(0,n.g)().storage)||void 0===s||s.setItem(this.shimDisconnectKey,!0)),{account:h,chain:{id:c,unsupported:f},provider:a}}catch(p){if(this.isUserRejectedRequestError(p))throw new n.U(p);if(-32002===p.code)throw new n.R(p);throw p}}async getProvider(){return"undefined"!=typeof window&&(0,n.w)(this,i,(0,n.u)(this,a,h).call(this,window.ethereum)),(0,n.x)(this,i)}}function l(t){let e=!!(null!=t&&t.isMetaMask);if(e&&(!t.isBraveWallet||t._events||t._state)&&!t.isAvalanche&&!t.isKuCoinWallet&&!t.isPortal&&!t.isTokenPocket&&!t.isTokenary)return t}function h(t){return null!=t&&t.providers?t.providers.find((0,n.u)(this,s,l)):(0,n.u)(this,s,l).call(this,t)}},81226:function(t,e,r){"use strict";r.d(e,{c:function(){return M},d:function(){return _}});let n={mainnet:"https://eth-mainnet.alchemyapi.io/v2",ropsten:"https://eth-ropsten.alchemyapi.io/v2",rinkeby:"https://eth-rinkeby.alchemyapi.io/v2",goerli:"https://eth-goerli.alchemyapi.io/v2",kovan:"https://eth-kovan.alchemyapi.io/v2",optimism:"https://opt-mainnet.g.alchemy.com/v2",optimismKovan:"https://opt-kovan.g.alchemy.com/v2",optimismGoerli:"https://opt-goerli.g.alchemy.com/v2",polygon:"https://polygon-mainnet.g.alchemy.com/v2",polygonMumbai:"https://polygon-mumbai.g.alchemy.com/v2",arbitrum:"https://arb-mainnet.g.alchemy.com/v2",arbitrumRinkeby:"https://arb-rinkeby.g.alchemy.com/v2",arbitrumGoerli:"https://arb-goerli.g.alchemy.com/v2"},i={mainnet:"https://mainnet.infura.io/v3",ropsten:"https://ropsten.infura.io/v3",rinkeby:"https://rinkeby.infura.io/v3",goerli:"https://goerli.infura.io/v3",kovan:"https://kovan.infura.io/v3",sepolia:"https://sepolia.infura.io/v3",optimism:"https://optimism-mainnet.infura.io/v3",optimismKovan:"https://optimism-kovan.infura.io/v3",optimismGoerli:"https://optimism-goerli.infura.io/v3",polygon:"https://polygon-mainnet.infura.io/v3",polygonMumbai:"https://polygon-mumbai.infura.io/v3",arbitrum:"https://arbitrum-mainnet.infura.io/v3",arbitrumRinkeby:"https://arbitrum-rinkeby.infura.io/v3",arbitrumGoerli:"https://arbitrum-goerli.infura.io/v3"},o={mainnet:"https://cloudflare-eth.com",ropsten:"https://rpc.ankr.com/eth_ropsten",rinkeby:"https://rpc.ankr.com/eth_rinkeby",goerli:"https://rpc.ankr.com/eth_goerli",kovan:`${i.kovan}/84842078b09946638c03157f83405213`,sepolia:"https://rpc.sepolia.org",optimism:"https://mainnet.optimism.io",optimismKovan:"https://kovan.optimism.io",optimismGoerli:"https://goerli.optimism.io",polygon:"https://polygon-rpc.com",polygonMumbai:"https://matic-mumbai.chainstacklabs.com",arbitrum:"https://arb1.arbitrum.io/rpc",arbitrumRinkeby:"https://rinkeby.arbitrum.io/rpc",arbitrumGoerli:"https://goerli-rollup.arbitrum.io/rpc"},s={mainnet:{name:"Etherscan",url:"https://etherscan.io"},ropsten:{name:"Etherscan",url:"https://ropsten.etherscan.io"},rinkeby:{name:"Etherscan",url:"https://rinkeby.etherscan.io"},goerli:{name:"Etherscan",url:"https://goerli.etherscan.io"},kovan:{name:"Etherscan",url:"https://kovan.etherscan.io"},sepolia:{name:"Etherscan",url:"https://sepolia.etherscan.io"},optimism:{name:"Etherscan",url:"https://optimistic.etherscan.io"},optimismKovan:{name:"Etherscan",url:"https://kovan-optimistic.etherscan.io"},optimismGoerli:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},polygon:{name:"PolygonScan",url:"https://polygonscan.com"},polygonMumbai:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},arbitrum:{name:"Arbiscan",url:"https://arbiscan.io"},arbitrumRinkeby:{name:"Arbiscan",url:"https://testnet.arbiscan.io"},arbitrumGoerli:{name:"Arbiscan",url:"https://goerli.arbiscan.io"}},a={mainnet:1,ropsten:3,rinkeby:4,goerli:5,kovan:42,sepolia:11155111,optimism:10,optimismKovan:69,optimismGoerli:420,polygon:137,polygonMumbai:80001,arbitrum:42161,arbitrumRinkeby:421611,arbitrumGoerli:421613,localhost:1337,hardhat:31337,foundry:31337},u={id:a.mainnet,name:"Ethereum",network:"homestead",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.mainnet,default:o.mainnet,infura:i.mainnet,public:o.mainnet},blockExplorers:{etherscan:s.mainnet,default:s.mainnet},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}},l={id:a.ropsten,name:"Ropsten",network:"ropsten",nativeCurrency:{name:"Ropsten Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.ropsten,default:o.ropsten,infura:i.ropsten,public:o.ropsten},blockExplorers:{etherscan:s.ropsten,default:s.ropsten},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:12063863},testnet:!0},h={id:a.rinkeby,name:"Rinkeby",network:"rinkeby",nativeCurrency:{name:"Rinkeby Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.rinkeby,default:o.rinkeby,infura:i.rinkeby,public:o.rinkeby},blockExplorers:{etherscan:s.rinkeby,default:s.rinkeby},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10299530},testnet:!0},c={id:a.goerli,name:"Goerli",network:"goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.goerli,default:o.goerli,infura:i.goerli,public:o.goerli},blockExplorers:{etherscan:s.goerli,default:s.goerli},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670},testnet:!0},f={id:a.kovan,name:"Kovan",network:"kovan",nativeCurrency:{name:"Kovan Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.kovan,default:o.kovan,infura:i.kovan,public:o.kovan},blockExplorers:{etherscan:s.kovan,default:s.kovan},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:30285908},testnet:!0},d={id:a.sepolia,name:"Sepolia",network:"sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:o.sepolia,infura:i.sepolia,public:o.sepolia},blockExplorers:{etherscan:s.sepolia,default:s.sepolia},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},testnet:!0},p={id:a.optimism,name:"Optimism",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimism,default:o.optimism,infura:i.optimism,public:o.optimism},blockExplorers:{etherscan:s.optimism,default:s.optimism},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}},m={id:a.optimismKovan,name:"Optimism Kovan",network:"optimism-kovan",nativeCurrency:{name:"Kovan Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimismKovan,default:o.optimismKovan,infura:i.optimismKovan,public:o.optimismKovan},blockExplorers:{etherscan:s.optimismKovan,default:s.optimismKovan},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1418387},testnet:!0},g={id:a.optimismGoerli,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimismGoerli,default:o.optimismGoerli,infura:i.optimismGoerli,public:o.optimismGoerli},blockExplorers:{etherscan:s.optimismGoerli,default:s.optimismGoerli},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461},testnet:!0},y={id:a.polygon,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:n.polygon,default:o.polygon,infura:i.polygon,public:o.polygon},blockExplorers:{etherscan:s.polygon,default:s.polygon},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},v={id:a.polygonMumbai,name:"Polygon Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:n.polygonMumbai,default:o.polygonMumbai,infura:i.polygonMumbai,public:o.polygonMumbai},blockExplorers:{etherscan:s.polygonMumbai,default:s.polygonMumbai},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25444704},testnet:!0},b={id:a.arbitrum,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrum,default:o.arbitrum,infura:i.arbitrum,public:o.arbitrum},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://explorer.arbitrum.io"},etherscan:s.arbitrum,default:s.arbitrum},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}},w={id:a.arbitrumRinkeby,name:"Arbitrum Rinkeby",network:"arbitrum-rinkeby",nativeCurrency:{name:"Arbitrum Rinkeby Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrumRinkeby,default:o.arbitrumRinkeby,infura:i.arbitrumRinkeby,public:o.arbitrumRinkeby},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://rinkeby-explorer.arbitrum.io"},etherscan:s.arbitrumRinkeby,default:s.arbitrumRinkeby},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10228837},testnet:!0},A={id:a.arbitrumGoerli,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrumGoerli,default:o.arbitrumGoerli,infura:i.arbitrumGoerli,public:o.arbitrumGoerli},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://goerli-rollup-explorer.arbitrum.io"},etherscan:s.arbitrumGoerli,default:s.arbitrumGoerli},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114},testnet:!0},E={id:a.localhost,name:"Localhost",network:"localhost",rpcUrls:{default:"http://127.0.0.1:8545"}},k={id:a.hardhat,name:"Hardhat",network:"hardhat",rpcUrls:{default:"http://127.0.0.1:8545"}},S={id:a.foundry,name:"Foundry",network:"foundry",rpcUrls:{default:"http://127.0.0.1:8545"}},M={mainnet:u,ropsten:l,rinkeby:h,goerli:c,kovan:f,sepolia:d,optimism:p,optimismGoerli:g,optimismKovan:m,polygon:y,polygonMumbai:v,arbitrum:b,arbitrumGoerli:A,arbitrumRinkeby:w,localhost:E,hardhat:k,foundry:S},_=[u,l,h,c,f]},97231:function(t,e,r){"use strict";let n;r.d(e,{C:function(){return M},I:function(){return F},R:function(){return C},S:function(){return R},U:function(){return N},_:function(){return m},a:function(){return _},b:function(){return x},d:function(){return P},f:function(){return W},g:function(){return Q},k:function(){return z},n:function(){return I},t:function(){return y},u:function(){return w},v:function(){return g},w:function(){return A},x:function(){return b}});let i=t=>(e,r,n)=>{let i=n.subscribe;n.subscribe=(t,e,r)=>{let o=t;if(e){let s=(null==r?void 0:r.equalityFn)||Object.is,a=t(n.getState());o=r=>{let n=t(r);if(!s(a,n)){let i=a;e(a=n,i)}},(null==r?void 0:r.fireImmediately)&&e(a,a)}return i(o)};let o=t(e,r,n);return o},o=t=>e=>{try{let r=t(e);if(r instanceof Promise)return r;return{then:t=>o(t)(r),catch(t){return this}}}catch(n){return{then(t){return this},catch:t=>o(t)(n)}}},s=(t,e)=>(r,n,i)=>{let s,a,u={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},l=!1,h=new Set,c=new Set;try{s=u.getStorage()}catch(f){}if(!s)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),r(...t)},n,i);let d=o(u.serialize),p=()=>{let t;let e=u.partialize({...n()}),r=d({state:e,version:u.version}).then(t=>s.setItem(u.name,t)).catch(e=>{t=e});if(t)throw t;return r},m=i.setState;i.setState=(t,e)=>{m(t,e),p()};let g=t((...t)=>{r(...t),p()},n,i),y=()=>{var t;if(!s)return;l=!1,h.forEach(t=>t(n()));let e=(null==(t=u.onRehydrateStorage)?void 0:t.call(u,n()))||void 0;return o(s.getItem.bind(s))(u.name).then(t=>{if(t)return u.deserialize(t)}).then(t=>{if(t){if("number"!=typeof t.version||t.version===u.version)return t.state;if(u.migrate)return u.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(t=>{var e;return r(a=u.merge(t,null!=(e=n())?e:g),!0),p()}).then(()=>{null==e||e(a,void 0),l=!0,c.forEach(t=>t(a))}).catch(t=>{null==e||e(void 0,t)})};return i.persist={setOptions(t){u={...u,...t},t.getStorage&&(s=t.getStorage())},clearStorage(){null==s||s.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:t=>(h.add(t),()=>{h.delete(t)}),onFinishHydration:t=>(c.add(t),()=>{c.delete(t)})},y(),a||g},a=t=>{let e;let r=new Set,n=(t,n)=>{let i="function"==typeof t?t(e):t;if(!Object.is(i,e)){let o=e;e=(null!=n?n:"object"!=typeof i)?i:Object.assign({},e,i),r.forEach(t=>t(e,o))}},i=()=>e,o=t=>(r.add(t),()=>r.delete(t)),s=()=>r.clear(),a={setState:n,getState:i,subscribe:o,destroy:s};return e=t(n,i,a),a},u=t=>t?a(t):a;var l=r(241),h=r(56371),c=r(26729),f=r.n(c),d=r(81226);function p(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function m(t,e){p(t,e),e.add(t)}function g(t,e,r){p(t,e),e.set(t,r)}function y(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function b(t,e){var r=v(t,e,"get");return r.get?r.get.call(t):r.value}function w(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function A(t,e,r){var n=v(t,e,"set");return!function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}(t,n,r),r}class E extends Error{constructor(t,e,r,n){if(!Number.isInteger(t))throw Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw Error('"message" must be a nonempty string.');super(e),y(this,"code",void 0),y(this,"data",void 0),y(this,"internal",void 0),this.code=t,this.data=n,this.internal=r}}class k extends E{constructor(t,e,r,n){if(!(Number.isInteger(t)&&t>=1e3&&t<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r,n)}}class S extends Error{constructor(){super(...arguments),y(this,"name","AddChainError"),y(this,"message","Error adding chain")}}class M extends Error{constructor(t){let{activeChain:e,targetChain:r}=t;super(`Chain mismatch: Expected "${r}", received "${e}".`),y(this,"name","ChainMismatchError")}}class _ extends Error{constructor(t){let{chainId:e,connectorId:r}=t;super(`Chain "${e}" not configured for connector "${r}".`),y(this,"name","ChainNotConfigured")}}class x extends Error{constructor(){super(...arguments),y(this,"name","ConnectorAlreadyConnectedError"),y(this,"message","Connector already connected")}}class P extends Error{constructor(){super(...arguments),y(this,"name","ConnectorNotFoundError"),y(this,"message","Connector not found")}}class C extends E{constructor(t){super(-32002,"Resource unavailable",t),y(this,"name","ResourceUnavailable")}}class O extends k{constructor(t){super(4902,"Error switching chain",t),y(this,"name","SwitchChainError")}}class R extends Error{constructor(t){let{connector:e}=t;super(`"${e.name}" does not support programmatic chain switching.`),y(this,"name","SwitchChainNotSupportedError")}}class N extends k{constructor(t){super(4001,"User rejected request",t),y(this,"name","UserRejectedRequestError")}}function I(t){return"string"==typeof t?Number.parseInt(t,"0x"===t.trim().substring(0,2)?16:10):"bigint"==typeof t?Number(t):t}class T extends f(){constructor(t){let{chains:e=d.d,options:r}=t;super(),y(this,"id",void 0),y(this,"name",void 0),y(this,"chains",void 0),y(this,"options",void 0),y(this,"ready",void 0),this.chains=e,this.options=r}getBlockExplorerUrls(t){let{default:e,...r}=t.blockExplorers??{};if(e)return[e.url,...Object.values(r).map(t=>t.url)]}isChainUnsupported(t){return!this.chains.some(e=>e.id===t)}}var B=new WeakMap,L=new WeakMap;class F extends T{constructor(){let{chains:t,options:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={shimDisconnect:!0,shimChainChangedDisconnect:!0,...e};super({chains:t,options:r}),y(this,"id",void 0),y(this,"name",void 0),y(this,"ready","undefined"!=typeof window&&!!window.ethereum),g(this,B,{writable:!0,value:void 0}),g(this,L,{writable:!0,value:void 0}),y(this,"shimDisconnectKey","injected.shimDisconnect"),y(this,"onAccountsChanged",t=>{0===t.length?this.emit("disconnect"):this.emit("change",{account:(0,h.getAddress)(t[0])})}),y(this,"onChainChanged",t=>{let e=I(t),r=this.isChainUnsupported(e);this.emit("change",{chain:{id:e,unsupported:r}})}),y(this,"onDisconnect",()=>{var t,e,r;if(null!==(t=this.options)&&void 0!==t&&t.shimChainChangedDisconnect&&b(this,L)){A(this,L,!1);return}this.emit("disconnect"),null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&(null===(r=Q().storage)||void 0===r||r.removeItem(this.shimDisconnectKey))});let n="Injected",i=r.name;if("string"==typeof i)n=i;else if("undefined"!=typeof window){let o=function(t){var e;if(!t)return"Injected";let r=t=>t.isAvalanche?"Core Wallet":t.isBitKeep?"BitKeep":t.isBraveWallet?"Brave Wallet":t.isCoinbaseWallet?"Coinbase Wallet":t.isExodus?"Exodus":t.isFrame?"Frame":t.isKuCoinWallet?"KuCoin Wallet":t.isMathWallet?"MathWallet":t.isOneInchIOSWallet||t.isOneInchAndroidWallet?"1inch Wallet":t.isOpera?"Opera":t.isPortal?"Ripio Portal":t.isTally?"Tally":t.isTokenPocket?"TokenPocket":t.isTokenary?"Tokenary":t.isTrust||t.isTrustWallet?"Trust Wallet":t.isMetaMask?"MetaMask":void 0;if(null!==(e=t.providers)&&void 0!==e&&e.length){let n=new Set,i=1;for(let o of t.providers){let s=r(o);s||(s=`Unknown Wallet #${i}`,i+=1),n.add(s)}let a=[...n];return a.length?a:a[0]??"Injected"}return r(t)??"Injected"}(window.ethereum);n=i?i(o):"string"==typeof o?o:o[0]}this.id="injected",this.name=n}async connect(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var e,r;let n=await this.getProvider();if(!n)throw new P;n.on&&(n.on("accountsChanged",this.onAccountsChanged),n.on("chainChanged",this.onChainChanged),n.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let i=await this.getAccount(),o=await this.getChainId(),s=this.isChainUnsupported(o);if(t&&o!==t){let a=await this.switchChain(t);o=a.id,s=this.isChainUnsupported(o)}return null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&(null===(r=Q().storage)||void 0===r||r.setItem(this.shimDisconnectKey,!0)),{account:i,chain:{id:o,unsupported:s},provider:n}}catch(u){if(this.isUserRejectedRequestError(u))throw new N(u);if(-32002===u.code)throw new C(u);throw u}}async disconnect(){var t,e;let r=await this.getProvider();null!=r&&r.removeListener&&(r.removeListener("accountsChanged",this.onAccountsChanged),r.removeListener("chainChanged",this.onChainChanged),r.removeListener("disconnect",this.onDisconnect),null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&(null===(e=Q().storage)||void 0===e||e.removeItem(this.shimDisconnectKey)))}async getAccount(){let t=await this.getProvider();if(!t)throw new P;let e=await t.request({method:"eth_requestAccounts"});return(0,h.getAddress)(e[0])}async getChainId(){let t=await this.getProvider();if(!t)throw new P;return t.request({method:"eth_chainId"}).then(I)}async getProvider(){return"undefined"!=typeof window&&window.ethereum&&A(this,B,window.ethereum),b(this,B)}async getSigner(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[e,r]=await Promise.all([this.getProvider(),this.getAccount()]);return new l.Q(e,t).getSigner(r)}async isAuthorized(){try{var t,e;if(null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&!(null!==(e=Q().storage)&&void 0!==e&&e.getItem(this.shimDisconnectKey)))return!1;let r=await this.getProvider();if(!r)throw new P;let n=await r.request({method:"eth_accounts"}),i=n[0];return!!i}catch{return!1}}async switchChain(t){var e,r,n;null!==(e=this.options)&&void 0!==e&&e.shimChainChangedDisconnect&&A(this,L,!0);let i=await this.getProvider();if(!i)throw new P;let o=(0,h.hexValue)(t);try{return await i.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]}),this.chains.find(e=>e.id===t)??{id:t,name:`Chain ${o}`,network:`${o}`,rpcUrls:{default:""}}}catch(u){let s=this.chains.find(e=>e.id===t);if(!s)throw new _({chainId:t,connectorId:this.id});if(4902===u.code||(null==u?void 0:null===(r=u.data)||void 0===r?void 0:null===(n=r.originalError)||void 0===n?void 0:n.code)===4902)try{return await i.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[s.rpcUrls.public??s.rpcUrls.default],blockExplorerUrls:this.getBlockExplorerUrls(s)}]}),s}catch(a){if(this.isUserRejectedRequestError(a))throw new N(u);throw new S}if(this.isUserRejectedRequestError(u))throw new N(u);throw new O(u)}}async watchAsset(t){let{address:e,decimals:r=18,image:n,symbol:i}=t,o=await this.getProvider();if(!o)throw new P;return o.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:e,decimals:r,image:n,symbol:i}}})}isUserRejectedRequestError(t){return 4001===t.code}}let D={getItem:t=>"",setItem:(t,e)=>null,removeItem:t=>null},U="store";var j=new WeakMap,q=new WeakMap,K=new WeakSet;class G{constructor(t){let e,{autoConnect:r=!1,connectors:n=[new F],provider:o,storage:a=function(t){let{storage:e,key:r="wagmi"}=t;return{...e,getItem:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=e.getItem(`${r}.${t}`);try{return i?JSON.parse(i):n}catch(o){return console.warn(o),n}},setItem(t,n){if(null===n)e.removeItem(`${r}.${t}`);else try{e.setItem(`${r}.${t}`,JSON.stringify(n))}catch(i){console.error(i)}},removeItem:t=>e.removeItem(`${r}.${t}`)}}({storage:"undefined"!=typeof window?window.localStorage:D}),logger:l={warn:console.warn},webSocketProvider:h}=t;m(this,K),y(this,"config",void 0),y(this,"providers",new Map),y(this,"storage",void 0),y(this,"store",void 0),y(this,"webSocketProviders",new Map),g(this,j,{writable:!0,value:void 0}),g(this,q,{writable:!0,value:void 0}),this.config={autoConnect:r,connectors:n,logger:l,provider:o,storage:a,webSocketProvider:h};let c="disconnected";if(r)try{var f,d,p;let v=a.getItem(U,""),b=null===(f=JSON.parse(v||"{}"))||void 0===f?void 0:null===(d=f.state)||void 0===d?void 0:d.data;c=null!=b&&b.account?"reconnecting":"connecting",e=null==b?void 0:null===(p=b.chain)||void 0===p?void 0:p.id}catch(E){}this.store=u(i(s(()=>({connectors:"function"==typeof n?n():n,provider:this.getProvider({chainId:e}),status:c,webSocketProvider:this.getWebSocketProvider({chainId:e})}),{name:U,getStorage:()=>a,partialize(t){var e,n;return{...r&&{data:{account:null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.account,chain:null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.chain}},chains:null==t?void 0:t.chains}},version:1}))),this.storage=a,A(this,q,null==a?void 0:a.getItem("wallet")),w(this,K,H).call(this),r&&"undefined"!=typeof window&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){var t,e;return null===(t=this.data)||void 0===t?void 0:null===(e=t.chain)||void 0===e?void 0:e.id}get provider(){return this.store.getState().provider}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketProvider(){return this.store.getState().webSocketProvider}setState(t){let e="function"==typeof t?t(this.store.getState()):t;this.store.setState(e,!0)}clearState(){this.setState(t=>({...t,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var t,e;this.connector&&await (null===(t=(e=this.connector).disconnect)||void 0===t?void 0:t.call(e)),A(this,j,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(b(this,j))return;A(this,j,!0),this.setState(t=>{var e;return{...t,status:null!==(e=t.data)&&void 0!==e&&e.account?"reconnecting":"connecting"}});let t=b(this,q)?[...this.connectors].sort(t=>t.id===b(this,q)?-1:1):this.connectors,e=!1;for(let r of t){if(!r.ready||!r.isAuthorized)continue;let n=await r.isAuthorized();if(!n)continue;let i=await r.connect();this.setState(t=>({...t,connector:r,chains:null==r?void 0:r.chains,data:i,status:"connected"})),e=!0;break}return e||this.setState(t=>({...t,data:void 0,status:"disconnected"})),A(this,j,!1),this.data}getProvider(){let{bust:t,chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.providers.get(e??-1);if(r&&!t)return r;let{provider:n}=this.config;return r="function"==typeof n?n({chainId:e}):n,this.providers.set(e??-1,r),r}getWebSocketProvider(){let{bust:t,chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.webSocketProviders.get(e??-1);if(r&&!t)return r;let{webSocketProvider:n}=this.config;return(r="function"==typeof n?n({chainId:e}):n)&&this.webSocketProviders.set(e??-1,r),r}setLastUsedConnector(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===(t=this.storage)||void 0===t||t.setItem("wallet",e)}}function H(){let t=t=>{this.setState(e=>({...e,data:{...e.data,...t}}))},e=()=>{this.clearState()},r=t=>{this.setState(e=>({...e,error:t}))};this.store.subscribe(t=>{let{connector:e}=t;return e},(n,i)=>{var o,s,a,u,l,h;null==i||null===(o=i.off)||void 0===o||o.call(i,"change",t),null==i||null===(s=i.off)||void 0===s||s.call(i,"disconnect",e),null==i||null===(a=i.off)||void 0===a||a.call(i,"error",r),n&&(null===(u=n.on)||void 0===u||u.call(n,"change",t),null===(l=n.on)||void 0===l||l.call(n,"disconnect",e),null===(h=n.on)||void 0===h||h.call(n,"error",r))});let{provider:n,webSocketProvider:i}=this.config;("function"==typeof n||"function"==typeof i)&&this.store.subscribe(t=>{var e;let{data:r}=t;return null==r?void 0:null===(e=r.chain)||void 0===e?void 0:e.id},t=>{this.setState(e=>({...e,provider:this.getProvider({bust:!0,chainId:t}),webSocketProvider:this.getWebSocketProvider({bust:!0,chainId:t})}))})}function z(t){let e=new G(t);return n=e,e}function Q(){if(!n)throw Error("No wagmi client found. Ensure you have set up a client: https://wagmi.sh/docs/client");return n}function W(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Q();return t&&e.getProvider({chainId:t})||e.provider}},2984:function(t,e,r){"use strict";r.d(e,{QB:function(){return a},$j:function(){return l},vZ:function(){return function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){let n,i;if(e.constructor!==r.constructor)return!1;if(Array.isArray(e)&&Array.isArray(r)){if((n=e.length)!=r.length)return!1;for(i=n;0!=i--;)if(!t(e[i],r[i]))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();let o=Object.keys(e);if((n=o.length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){let s=o[i];if(s&&!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r}},zP:function(){return h},em:function(){return u},DG:function(){return d},D0:function(){return p},uN:function(){return c},Hy:function(){return m},xq:function(){return g},If:function(){return y},uH:function(){return v},QC:function(){return b},b0:function(){return f},rn:function(){return w}});var n=r(97231),i=r(51619),o=r(64146);function s(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(let[r,n]of t)if(!Object.is(n,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}let o=Object.keys(t);if(o.length!==Object.keys(e).length)return!1;for(let s=0;s2&&void 0!==arguments[2]?arguments[2]:{};if(!t.length)throw Error("must have at least one chain");if(o{let{id:e}=t;return e===h.id})||(a=[...a,d.chain]),u[h.id]=[...u[h.id]||[],d.provider],d.webSocketProvider&&(l[h.id]=[...l[h.id]||[],d.webSocketProvider]))}if(!c)throw Error(`Could not find valid provider configuration for chain "${h.name}". + +You may need to add \`jsonRpcProvider\` to \`configureChains\` with the chain's RPC URLs. +Read more: https://wagmi.sh/docs/providers/jsonRpc`)}return{chains:a,provider(e){let l,{chainId:h}=e,c=a.find(t=>t.id===h)??t[0],f=u[c.id];if(!f||!f[0])throw Error(`No providers configured for chain "${c.id}"`);return l=1===f.length?f[0]():function t(e,r,n,o){let{stallTimeout:s}=o;try{return new i.H(n.map((t,e)=>{let r=t();return{provider:r,priority:r.priority??e,stallTimeout:r.stallTimeout??s,weight:r.weight}}),e)}catch(u){var a;if(null!=u&&null!==(a=u.message)&&void 0!==a&&a.includes("quorum will always fail; larger than total weight")){if(e===r)throw u;return t(e-1,r,n,{stallTimeout:s})}throw u}}(o,r,f,{stallTimeout:s}),42220===c.id&&(l.formatter.formats.block={...l.formatter.formats.block,difficulty:()=>0,gasLimit:()=>0}),Object.assign(l,{chains:a,pollingInterval:n})},webSocketProvider(e){var r;let{chainId:n}=e,i=a.find(t=>t.id===n)??t[0],o=l[i.id];if(!o)return;let s=null===(r=o[0])||void 0===r?void 0:r.call(o);return s&&42220===i.id&&(s.formatter.formats.block={...s.formatter.formats.block,difficulty:()=>0,gasLimit:()=>0}),Object.assign(s||{},{chains:a})}}}r(26729);let u=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];async function l(t){let{chainId:e,connector:r}=t,i=(0,n.g)(),o=i.connector;if(r.id===(null==o?void 0:o.id))throw new n.b;try{i.setState(t=>({...t,status:"connecting"}));let s=await r.connect({chainId:e});return i.setLastUsedConnector(r.id),i.setState(t=>({...t,connector:r,chains:null==r?void 0:r.chains,data:s,status:"connected"})),i.storage.setItem("connected",!0),{...s,connector:r}}catch(a){throw i.setState(t=>({...t,status:t.connector?"connected":"disconnected"})),a}}async function h(){let t=(0,n.g)();t.connector&&await t.connector.disconnect(),t.clearState(),t.storage.removeItem("connected")}function c(t){let{address:e,abi:r,signerOrProvider:n}=t;return new o.Contract(e,r,n)}function f(t,e){let r=(0,n.g)(),i=async()=>e((0,n.f)(t)),o=r.subscribe(t=>{let{provider:e}=t;return e},i);return o}async function d(){var t,e;let{chainId:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,n.g)(),o=await (null===(t=i.connector)||void 0===t?void 0:null===(e=t.getSigner)||void 0===e?void 0:e.call(t,{chainId:r}))||null;return o}function p(){let{data:t,connector:e,status:r}=(0,n.g)();switch(r){case"connected":return{address:null==t?void 0:t.account,connector:e,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:r};case"reconnecting":return{address:null==t?void 0:t.account,connector:e,isConnected:!!(null!=t&&t.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:r};case"connecting":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:r};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:r}}}function m(){var t,e,r;let i=(0,n.g)(),o=null===(t=i.data)||void 0===t?void 0:null===(e=t.chain)||void 0===e?void 0:e.id,s=i.chains??[],a=[...i.provider.chains||[],...s].find(t=>t.id===o)??{id:o,name:`Chain ${o}`,network:`${o}`,rpcUrls:{default:""}};return{chain:o?{...a,...null===(r=i.data)||void 0===r?void 0:r.chain,id:o}:void 0,chains:s}}async function g(t){let{domain:e,types:r,value:i}=t,o=await d();if(!o)throw new n.d;let{chainId:s}=e,a=s?(0,n.n)(s):void 0;return a&&function(t){var e,r,i,o;let{chainId:s,signer:a}=t,{chain:u,chains:l}=m(),h=null==u?void 0:u.id;if(h&&s!==h)throw new n.C({activeChain:(null===(e=l.find(t=>t.id===h))||void 0===e?void 0:e.name)??`Chain ${h}`,targetChain:(null===(r=l.find(t=>t.id===s))||void 0===r?void 0:r.name)??`Chain ${s}`});if(a){let c=null===(i=a.provider)||void 0===i?void 0:null===(o=i.network)||void 0===o?void 0:o.chainId;if(c&&s!==c){let f=(0,n.g)().connector;throw new n.a({chainId:s,connectorId:(null==f?void 0:f.id)??"unknown"})}}}({chainId:a,signer:o}),o._signTypedData(e,r,i)}async function y(t){let{chainId:e}=t,{connector:r}=(0,n.g)();if(!r)throw new n.d;if(!r.switchChain)throw new n.S({connector:r});return r.switchChain(e)}function v(t){let{selector:e=t=>t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.g)(),i=()=>t(p()),o=r.subscribe(t=>{let{data:r,connector:n,status:i}=t;return e({address:null==r?void 0:r.account,connector:n,status:i})},i,{equalityFn:s});return o}function b(t){let{selector:e=t=>t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.g)(),i=()=>t(m()),o=r.subscribe(t=>{var r;let{data:n,chains:i}=t;return e({chainId:null==n?void 0:null===(r=n.chain)||void 0===r?void 0:r.id,chains:i})},i,{equalityFn:s});return o}function w(t,e){let{chainId:r}=t,i=(0,n.g)(),o=async()=>e(await d({chainId:r})),a=i.subscribe(t=>{var e;let{data:r,connector:n}=t;return{account:null==r?void 0:r.account,chainId:null==r?void 0:null===(e=r.chain)||void 0===e?void 0:e.id,connector:n}},o,{equalityFn:s});return a}},78826:function(t){"use strict";!function(e){function r(t){return parseInt(t)===t}function n(t){if(!r(t.length))return!1;for(var e=0;e255)return!1;return!0}function i(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!n(t))throw Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&n(t))return new Uint8Array(t);throw Error("unsupported array-like object")}function o(t){return new Uint8Array(t)}function s(t,e,r,n,i){(null!=n||null!=i)&&(t=t.slice?t.slice(n,i):Array.prototype.slice.call(t,n,i)),e.set(t,r)}var a,u=(a="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r>4]+a[15&n])}return e.join("")}}),l={16:10,24:12,32:14},h=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],c=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],E=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],k=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function M(t){for(var e=[],r=0;r>2,this._Ke[o][e%4]=i[e],this._Kd[t-o][e%4]=i[e];for(var o,s,a=0,u=n;u>16&255]<<24^c[s>>8&255]<<16^c[255&s]<<8^c[s>>24&255]^h[a]<<24,a+=1,8!=n)for(var e=1;e>8&255]<<8^c[s>>16&255]<<16^c[s>>24&255]<<24;for(var e=n/2+1;e>2,d=u%4,this._Ke[f][d]=i[e],this._Kd[t-f][d]=i[e++],u++}for(var f=1;f>24&255]^E[s>>16&255]^k[s>>8&255]^S[255&s]},_.prototype.encrypt=function(t){if(16!=t.length)throw Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=M(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s>24&255]^p[n[(i+1)%4]>>16&255]^m[n[(i+2)%4]>>8&255]^g[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}for(var a,u=o(16),i=0;i<4;i++)a=this._Ke[e][i],u[4*i]=(c[n[i]>>24&255]^a>>24)&255,u[4*i+1]=(c[n[(i+1)%4]>>16&255]^a>>16)&255,u[4*i+2]=(c[n[(i+2)%4]>>8&255]^a>>8)&255,u[4*i+3]=(c[255&n[(i+3)%4]]^a)&255;return u},_.prototype.decrypt=function(t){if(16!=t.length)throw Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=M(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s>24&255]^v[n[(i+3)%4]>>16&255]^b[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}for(var a,u=o(16),i=0;i<4;i++)a=this._Kd[e][i],u[4*i]=(f[n[i]>>24&255]^a>>24)&255,u[4*i+1]=(f[n[(i+3)%4]>>16&255]^a>>16)&255,u[4*i+2]=(f[n[(i+2)%4]>>8&255]^a>>8)&255,u[4*i+3]=(f[255&n[(i+1)%4]]^a)&255;return u};var x=function(t){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new _(t)};x.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=o(t.length),r=o(16),n=0;n=0;--e)this._counter[e]=t%256,t>>=8},R.prototype.setBytes=function(t){if(16!=(t=i(t,!0)).length)throw Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},R.prototype.increment=function(){for(var t=15;t>=0;t--)if(255===this._counter[t])this._counter[t]=0;else{this._counter[t]++;break}};var N=function(t,e){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof R||(e=new R(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new _(t)};N.prototype.encrypt=function(t){for(var e=i(t,!0),r=0;r191&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}}},padding:{pkcs7:{pad:function(t){var e=16-(t=i(t,!0)).length%16,r=o(t.length+e);s(t,r);for(var n=t.length;n16)throw Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function s(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=o(e)^n>>5}for(r=0,e=o(e);re)return"Exceeds length limit";var n=t.toLowerCase(),i=t.toUpperCase();if(t!==n&&t!==i)return"Mixed-case string "+t;var a=(t=n).lastIndexOf("1");if(-1===a)return"No separator character for "+t;if(0===a)return"Missing prefix for "+t;var u=t.slice(0,a),l=t.slice(a+1);if(l.length<6)return"Data too short";var h=s(u);if("string"==typeof h)return h;for(var c=[],f=0;f=l.length||c.push(p)}return 1!==h?"Invalid checksum for "+t:{prefix:u,words:c}}function u(t,e,r,n){for(var i=0,o=0,s=(1<=r;)a.push(i>>(o-=r)&s);if(n)o>0&&a.push(i<=e)return"Excess padding";if(i<n)throw TypeError("Exceeds length limit");var i=s(t=t.toLowerCase());if("string"==typeof i)throw Error(i);for(var a=t+"1",u=0;u>5!=0)throw Error("Non 5-bit word");i=o(i)^l,a+=e.charAt(l)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u){var h=i>>(5-u)*5&31;a+=e.charAt(h)}return a},toWordsUnsafe:function(t){var e=u(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=u(t,8,5,!0);if(Array.isArray(e))return e;throw Error(e)},fromWordsUnsafe:function(t){var e=u(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=u(t,5,8,!1);if(Array.isArray(e))return e;throw Error(e)}}},94184:function(t,e){var r; /*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ !function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(o=8,n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;othis.blockSize&&(t=new this.Hash().update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},26436:function(t,e,r){"use strict";var n=r(79746),i=r(35717);function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function a(t){if(7===t.length)return"0"+t;if(6===t.length)return"00"+t;if(5===t.length)return"000"+t;if(4===t.length)return"0000"+t;if(3===t.length)return"00000"+t;if(2===t.length)return"000000"+t;if(1===t.length)return"0000000"+t;else return t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t){if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):(o=t,s=i,(64512&o.charCodeAt(s))!=55296||s<0||s+1>=o.length?1:(64512&o.charCodeAt(s+1))!=56320)?(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128):(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128)}}else for(i=0;i>>0;return a},e.split32=function(t,e){for(var r=Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0;t[e]=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u,l=e;return t+r+i+s+(0+((l=l+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,l){var h,c=e;return t+r+i+s+u+(0+((c=c+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,l){return e+n+o+a+l>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},8679:function(t,e,r){"use strict";var n=r(21296),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(t){return n.isMemo(t)?s:a[t.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=s;var l=Object.defineProperty,h=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,r,n){if("string"!=typeof r){if(p){var i=d(r);i&&i!==p&&t(e,i,n)}var s=h(r);c&&(s=s.concat(c(r)));for(var a=u(e),m=u(r),g=0;g>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(t,e,r){B.call(this,t,e,r)}B.prototype.update=function(t){if(this.finalized)throw Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"===r){if(null===t)throw Error(o);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!c||!ArrayBuffer.isView(t)))throw Error(o)}else throw Error(o);e=!0}for(var n,i,s=this.blocks,a=this.byteCount,u=t.length,l=this.blockCount,h=0,f=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=s[l],n=0;n>=8,r=255&t;r>0;)i.unshift(r),t>>=8,r=255&t,++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"===r){if(null===t)throw Error(o);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!c||!ArrayBuffer.isView(t)))throw Error(o)}else throw Error(o);e=!0}var n=0,i=t.length;if(e)n=i;else for(var s=0;s=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},B.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(e=1,t[0]=t[r];e>4&15]+f[15&t]+f[t>>12&15]+f[t>>8&15]+f[t>>20&15]+f[t>>16&15]+f[t>>28&15]+f[t>>24&15];s%e==0&&(F(r),o=0)}return i&&(a+=f[(t=r[o])>>4&15]+f[15&t],i>1&&(a+=f[t>>12&15]+f[t>>8&15]),i>2&&(a+=f[t>>20&15]+f[t>>16&15])),a},B.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=new ArrayBuffer(i?n+1<<2:a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&F(n)}return o&&(t=a<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},L.prototype=new B,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var F=function(t){var e,r,n,i,o,s,a,u,l,h,c,f,d,p,g,y,v,b,w,A,E,k,S,M,_,x,P,C,O,R,N,I,T,B,L,F,D,U,j,q,K,G,H,z,Q,W,J,V,Z,Y,$,X,tt,te,tr,tn,ti,to,ts,ta,tu,tl,th;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],f=t[8]^t[18]^t[28]^t[38]^t[48],d=t[9]^t[19]^t[29]^t[39]^t[49],e=f^(s<<1|a>>>31),r=d^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|l>>>31),r=o^(l<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(h<<1|c>>>31),r=a^(c<<1|h>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(f<<1|d>>>31),r=l^(d<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=h^(i<<1|o>>>31),r=c^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],g=t[1],W=t[11]<<4|t[10]>>>28,J=t[10]<<4|t[11]>>>28,C=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ta=t[31]<<9|t[30]>>>23,tu=t[30]<<9|t[31]>>>23,G=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,B=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,N=t[32]<<13|t[33]>>>19,tl=t[42]<<2|t[43]>>>30,th=t[43]<<2|t[42]>>>30,te=t[5]<<30|t[4]>>>2,tr=t[4]<<30|t[5]>>>2,F=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Y=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,I=t[45]<<29|t[44]>>>3,T=t[44]<<29|t[45]>>>3,M=t[6]<<28|t[7]>>>4,_=t[7]<<28|t[6]>>>4,tn=t[17]<<23|t[16]>>>9,ti=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,E=t[37]<<21|t[36]>>>11,X=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,z=t[8]<<27|t[9]>>>5,Q=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,P=t[19]<<20|t[18]>>>12,to=t[29]<<7|t[28]>>>25,ts=t[28]<<7|t[29]>>>25,q=t[38]<<8|t[39]>>>24,K=t[39]<<8|t[38]>>>24,k=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=p^~y&b,t[1]=g^~v&w,t[10]=M^~x&C,t[11]=_^~P&O,t[20]=B^~F&U,t[21]=L^~D&j,t[30]=z^~W&V,t[31]=Q^~J&Z,t[40]=te^~tn&to,t[41]=tr^~ti&ts,t[2]=y^~b&A,t[3]=v^~w&E,t[12]=x^~C&R,t[13]=P^~O&N,t[22]=F^~U&q,t[23]=D^~j&K,t[32]=W^~V&Y,t[33]=J^~Z&$,t[42]=tn^~to&ta,t[43]=ti^~ts&tu,t[4]=b^~A&k,t[5]=w^~E&S,t[14]=C^~R&I,t[15]=O^~N&T,t[24]=U^~q&G,t[25]=j^~K&H,t[34]=V^~Y&X,t[35]=Z^~$&tt,t[44]=to^~ta&tl,t[45]=ts^~tu&th,t[6]=A^~k&p,t[7]=E^~S&g,t[16]=R^~I&M,t[17]=N^~T&_,t[26]=q^~G&B,t[27]=K^~H&L,t[36]=Y^~X&z,t[37]=$^~tt&Q,t[46]=ta^~tl&te,t[47]=tu^~th&tr,t[8]=k^~p&y,t[9]=S^~g&v,t[18]=I^~M&x,t[19]=T^~_&P,t[28]=G^~B&F,t[29]=H^~L&D,t[38]=X^~z&W,t[39]=tt^~Q&J,t[48]=tl^~te&tn,t[49]=th^~tr&ti,t[0]^=m[n],t[1]^=m[n+1]};if(l)t.exports=x;else{for(C=0;C{let t=new Map;for(let e of u)t.set(e.id,e);return t})(),h=[{location:"Seattle, US",name:"Thunder Gateway",value:"https://gw-seattle.crustcloud.io"}],c="https://gw.crustfiles.app",f="https://ipfs.io",d="https://ipfsgw.live"},52196:function(t,e,r){"use strict";r.d(e,{Cg:function(){return i},Kc:function(){return o},TQ:function(){return n}});let n=!0,i=!1,o=!1},36526:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return _}});var n=r(35944),i=r(29282),o=r.n(i),s=r(40924),a=r.n(s),u=r(82463),l=r.n(u),h=r(21056),c=r.n(h);r(16853);var f=r(78082),d=r(9008),p=r.n(d),m=r(2984),g=r(38109),y=r(82775),v=r(93901);r(58669);var b=r(94184),w=r.n(b);let A=[o(),a(),l(),c()].map(t=>t.variable).join(" "),E=new y.i,{provider:k,webSocketProvider:S}=(0,m.QB)(f.XL,[function(){let{priority:t,stallTimeout:e,weight:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){return n.rpcUrls.default?{chain:n,provider(){let i=new v.c(n.rpcUrls.default,{chainId:n.id,name:n.network});return Object.assign(i,{priority:t,stallTimeout:e,weight:r})}}:null}}()]),M=(0,g.eI)({autoConnect:!0,provider:k,webSocketProvider:S,connectors:[E]});function _(t){let{Component:e,pageProps:r}=t;return(0,n.BX)("div",{suppressHydrationWarning:!0,className:w()("App font-WorkSans",A),children:[(0,n.BX)(p(),{children:[(0,n.tZ)("meta",{name:"viewport",content:"width=device-width,user-scalable=no"}),(0,n.tZ)("title",{children:"Crust Cloud"})]}),(0,n.tZ)(g.eM,{client:M,children:(0,n.tZ)(e,{...r})})]})}},58669:function(){},82463:function(t){t.exports={style:{fontFamily:"'__Roboto_9e7bcd', '__Roboto_Fallback_9e7bcd'",fontWeight:400,fontStyle:"normal"},className:"__className_9e7bcd",variable:"__variable_9e7bcd"}},21056:function(t){t.exports={style:{fontFamily:"'__Roboto_Mono_f18e28', '__Roboto_Mono_Fallback_f18e28'",fontWeight:700,fontStyle:"normal"},className:"__className_f18e28",variable:"__variable_f18e28"}},29282:function(t){t.exports={style:{fontFamily:"'__Squada_One_4f93f4', '__Squada_One_Fallback_4f93f4'",fontWeight:400,fontStyle:"normal"},className:"__className_4f93f4",variable:"__variable_4f93f4"}},40924:function(t){t.exports={style:{fontFamily:"'__Work_Sans_57f497', '__Work_Sans_Fallback_57f497'",fontStyle:"normal"},className:"__className_57f497",variable:"__variable_57f497"}},16853:function(){},9008:function(t,e,r){t.exports=r(83121)},34155:function(t){var e,r,n,i=t.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(n){r=s}}();var u=[],l=!1,h=-1;function c(){l&&n&&(l=!1,n.length?u=n.concat(u):h=-1,u.length&&f())}function f(){if(!l){var t=a(c);l=!0;for(var e=u.length;e;){for(n=u,u=[];++h1)for(var r=1;r=64;){let d=r,p=n,m=i,g=o,y=s,v=a,b=u,w=l,A,E,k,S,M;for(E=0;E<16;E++)k=c+4*E,h[E]=(255&t[k])<<24|(255&t[k+1])<<16|(255&t[k+2])<<8|255&t[k+3];for(E=16;E<64;E++)S=((A=h[E-2])>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,M=((A=h[E-15])>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,h[E]=(S+h[E-7]|0)+(M+h[E-16]|0)|0;for(E=0;E<64;E++)S=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&v^~y&b)|0)+(w+(e[E]+h[E]|0)|0)|0,M=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&p^d&m^p&m)|0,w=b,b=v,v=y,y=g+S|0,g=m,m=p,p=d,d=S+M|0;r=r+d|0,n=n+p|0,i=i+m|0,o=o+g|0,s=s+y|0,a=a+v|0,u=u+b|0,l=l+w|0,c+=64,f-=64}}c(t);let f,d=t.length%64,p=t.length/536870912|0,m=t.length<<3,g=d<56?56:120,y=t.slice(t.length-d,t.length);for(y.push(128),f=d+1;f>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),c(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,l>>>24&255,l>>>16&255,l>>>8&255,l>>>0&255]}function n(t,e,n){let i;t=t.length<=64?t:r(t);let o=64+e.length+4,s=Array(o),a=Array(64),u=[];for(i=0;i<64;i++)s[i]=54;for(i=0;i=o-4;t--){if(s[t]++,s[t]<=255)return;s[t]=0}}for(;n>=32;)l(),u=u.concat(r(a.concat(r(s)))),n-=32;return n>0&&(l(),u=u.concat(r(a.concat(r(s))).slice(0,n))),u}function i(t,e,r,n,i){let u;for(a(t,(2*r-1)*16,i,0,16),u=0;u<2*r;u++)s(t,16*u,i,16),function(t,e){a(t,0,e,0,16);for(let r=8;r>0;r-=2)e[4]^=o(e[0]+e[12],7),e[8]^=o(e[4]+e[0],9),e[12]^=o(e[8]+e[4],13),e[0]^=o(e[12]+e[8],18),e[9]^=o(e[5]+e[1],7),e[13]^=o(e[9]+e[5],9),e[1]^=o(e[13]+e[9],13),e[5]^=o(e[1]+e[13],18),e[14]^=o(e[10]+e[6],7),e[2]^=o(e[14]+e[10],9),e[6]^=o(e[2]+e[14],13),e[10]^=o(e[6]+e[2],18),e[3]^=o(e[15]+e[11],7),e[7]^=o(e[3]+e[15],9),e[11]^=o(e[7]+e[3],13),e[15]^=o(e[11]+e[7],18),e[1]^=o(e[0]+e[3],7),e[2]^=o(e[1]+e[0],9),e[3]^=o(e[2]+e[1],13),e[0]^=o(e[3]+e[2],18),e[6]^=o(e[5]+e[4],7),e[7]^=o(e[6]+e[5],9),e[4]^=o(e[7]+e[6],13),e[5]^=o(e[4]+e[7],18),e[11]^=o(e[10]+e[9],7),e[8]^=o(e[11]+e[10],9),e[9]^=o(e[8]+e[11],13),e[10]^=o(e[9]+e[8],18),e[12]^=o(e[15]+e[14],7),e[13]^=o(e[12]+e[15],9),e[14]^=o(e[13]+e[12],13),e[15]^=o(e[14]+e[13],18);for(let n=0;n<16;++n)t[n]+=e[n]}(i,n),a(i,0,t,e+16*u,16);for(u=0;u>>32-e}function s(t,e,r,n){for(let i=0;i=256)return!1}return!0}function l(t,e){if("number"!=typeof t||t%1)throw Error("invalid "+e);return t}function h(t,e,r,o,h,c,f){let d;if(r=l(r,"N"),o=l(o,"r"),h=l(h,"p"),c=l(c,"dkLen"),0===r||(r&r-1)!=0)throw Error("N must be power of 2");if(r>2147483647/128/o)throw Error("N too large");if(o>2147483647/128/h)throw Error("r too large");if(!u(t))throw Error("password must be an array or buffer");if(t=Array.prototype.slice.call(t),!u(e))throw Error("salt must be an array or buffer");let p=n(t,e=Array.prototype.slice.call(e),128*h*o),m=new Uint32Array(32*h*o);for(let g=0;gO&&(e=O);for(let u=0;uO&&(e=O);for(let g=0;g>0&255),p.push(m[B]>>8&255),p.push(m[B]>>16&255),p.push(m[B]>>24&255);let L=n(t,p,c);return f&&f(null,1,L),L}f&&R(N)};if(!f)for(;;){let I=N();if(void 0!=I)return I}N()}t.exports={scrypt:function(t,e,r,n,i,o,s){return new Promise(function(a,u){let l=0;s&&s(0),h(t,e,r,n,i,o,function(t,e,r){if(t)u(t);else if(r)s&&1!==l&&s(1),a(new Uint8Array(r));else if(s&&e!==l)return l=e,s(e)})})},syncScrypt:function(t,e,r,n,i,o){return new Uint8Array(h(t,e,r,n,i,o))}}}(0)},53250:function(t,e,r){"use strict";/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ var n=r(67294),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=n.useState,s=n.useEffect,a=n.useLayoutEffect,u=n.useDebugValue;function l(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!i(t,r)}catch(n){return!0}}var h="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var r=e(),n=o({inst:{value:r,getSnapshot:e}}),i=n[0].inst,h=n[1];return a(function(){i.value=r,i.getSnapshot=e,l(i)&&h({inst:i})},[t,r,e]),s(function(){return l(i)&&h({inst:i}),t(function(){l(i)&&h({inst:i})})},[t]),u(r),r};e.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:h},50139:function(t,e,r){"use strict";/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ var n=r(67294),i=r(61688),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=i.useSyncExternalStore,a=n.useRef,u=n.useEffect,l=n.useMemo,h=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var c=a(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=l(function(){function t(t){if(!u){if(u=!0,s=t,t=n(t),void 0!==i&&f.hasValue){var e=f.value;if(i(e,t))return a=e}return a=t}if(e=a,o(s,t))return e;var r=n(t);return void 0!==i&&i(e,r)?e:(s=t,a=r)}var s,a,u=!1,l=void 0===r?null:r;return[function(){return t(e())},null===l?void 0:function(){return t(l())}]},[e,r,n,i]);var d=s(t,c[0],c[1]);return u(function(){f.hasValue=!0,f.value=d},[d]),h(d),d}},61688:function(t,e,r){"use strict";t.exports=r(53250)},52798:function(t,e,r){"use strict";t.exports=r(50139)},38109:function(t,e,r){"use strict";let n;function i(){}r.d(e,{eM:function(){return tS},eI:function(){return tA},mA:function(){return tN},$4:function(){return tB},cq:function(){return tJ},qL:function(){return tD},LN:function(){return tU},yL:function(){return tC},yw:function(){return tH},mx:function(){return tK},g0:function(){return tW}});let o="undefined"==typeof window||"Deno"in window;function s(){}function a(t){return"number"==typeof t&&t>=0&&t!==1/0}function u(t,e){return Math.max(t+(e||0)-Date.now(),0)}function l(t,e,r){return A(t)?"function"==typeof e?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function h(t,e,r){return A(t)?"function"==typeof e?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:"function"==typeof t?{...e,mutationFn:t}:{...t}}function c(t,e,r){return A(t)?[{...e,queryKey:t},r]:[t||{},e]}function f(t,e){let{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:s,stale:a}=t;if(A(s)){if(n){if(e.queryHash!==p(s,e.options))return!1}else{if(!g(e.queryKey,s))return!1}}if("all"!==r){let u=e.isActive();if("active"===r&&!u||"inactive"===r&&u)return!1}return("boolean"!=typeof a||e.isStale()===a)&&(void 0===i||i===e.state.fetchStatus)&&(!o||!!o(e))}function d(t,e){let{exact:r,fetching:n,predicate:i,mutationKey:o}=t;if(A(o)){if(!e.options.mutationKey)return!1;if(r){if(m(e.options.mutationKey)!==m(o))return!1}else{if(!g(e.options.mutationKey,o))return!1}}return("boolean"!=typeof n||"loading"===e.state.status===n)&&(!i||!!i(e))}function p(t,e){let r=(null==e?void 0:e.queryKeyHashFn)||m;return r(t)}function m(t){return JSON.stringify(t,(t,e)=>b(e)?Object.keys(e).sort().reduce((t,r)=>(t[r]=e[r],t),{}):e)}function g(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&!Object.keys(e).some(r=>!g(t[r],e[r]))}function y(t,e){if(t&&!e||e&&!t)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0}function v(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function b(t){if(!w(t))return!1;let e=t.constructor;if(void 0===e)return!0;let r=e.prototype;return!!(w(r)&&r.hasOwnProperty("isPrototypeOf"))}function w(t){return"[object Object]"===Object.prototype.toString.call(t)}function A(t){return Array.isArray(t)}function E(t){return new Promise(e=>{setTimeout(e,t)})}function k(t){E(0).then(t)}function S(t,e,r){return null!=r.isDataEqual&&r.isDataEqual(t,e)?t:"function"==typeof r.structuralSharing?r.structuralSharing(t,e):!1!==r.structuralSharing?function t(e,r){if(e===r)return e;let n=v(e)&&v(r);if(n||b(e)&&b(r)){let i=n?e.length:Object.keys(e).length,o=n?r:Object.keys(r),s=o.length,a=n?[]:{},u=0;for(let l=0;l{t()},n=t=>{t()},i=t=>{let r;e++;try{r=t()}finally{--e||a()}return r},o=n=>{e?t.push(n):k(()=>{r(n)})},s=t=>(...e)=>{o(()=>{t(...e)})},a=()=>{let e=t;t=[],e.length&&k(()=>{n(()=>{e.forEach(t=>{r(t)})})})},u=t=>{r=t},l=t=>{n=t};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:u,setBatchNotifyFunction:l}}();class x{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.push(t),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(e=>e!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}let P=new class extends x{constructor(){super(),this.setup=t=>{if(!o&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",e,!1),()=>{window.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.cleanup)||t.call(this),this.cleanup=void 0}}setEventListener(t){var e;this.setup=t,null==(e=this.cleanup)||e.call(this),this.cleanup=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}},C=new class extends x{constructor(){super(),this.setup=t=>{if(!o&&window.addEventListener){let e=()=>t();return window.addEventListener("online",e,!1),window.addEventListener("offline",e,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.cleanup)||t.call(this),this.cleanup=void 0}}setEventListener(t){var e;this.setup=t,null==(e=this.cleanup)||e.call(this),this.cleanup=t(t=>{"boolean"==typeof t?this.setOnline(t):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}};function O(t){return Math.min(1e3*2**t,3e4)}function R(t){return(null!=t?t:"online")!=="online"||C.isOnline()}class N{constructor(t){this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}}function I(t){return t instanceof N}function T(t){let e,r,n,i=!1,o=0,s=!1,a=new Promise((t,e)=>{r=t,n=e}),u=e=>{s||(d(new N(e)),null==t.abort||t.abort())},l=()=>{i=!0},h=()=>{i=!1},c=()=>!P.isFocused()||"always"!==t.networkMode&&!C.isOnline(),f=n=>{s||(s=!0,null==t.onSuccess||t.onSuccess(n),null==e||e(),r(n))},d=r=>{s||(s=!0,null==t.onError||t.onError(r),null==e||e(),n(r))},p=()=>new Promise(r=>{e=t=>{if(s||!c())return r(t)},null==t.onPause||t.onPause()}).then(()=>{e=void 0,s||null==t.onContinue||t.onContinue()}),m=()=>{let e;if(!s){try{e=t.fn()}catch(r){e=Promise.reject(r)}Promise.resolve(e).then(f).catch(e=>{var r,n;if(s)return;let a=null!=(r=t.retry)?r:3,u=null!=(n=t.retryDelay)?n:O,l="function"==typeof u?u(o,e):u,h=!0===a||"number"==typeof a&&o{if(c())return p()}).then(()=>{i?d(e):m()})})}};return R(t.networkMode)?m():p().then(m),{promise:a,cancel:u,continue(){null==e||e()},cancelRetry:l,continueRetry:h}}class B{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),a(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,null!=t?t:o?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class L extends B{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||M,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||function(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,r=void 0!==e,n=r?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(t,e){let r=S(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:null==e?void 0:e.updatedAt,manual:null==e?void 0:e.manual}),r}setState(t,e){this.dispatch({type:"setState",state:t,setStateOptions:e})}cancel(t){var e;let r=this.promise;return null==(e=this.retryer)||e.cancel(t),r?r.then(s).catch(s):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>!1!==t.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!u(this.state.dataUpdatedAt,t)}onFocus(){var t;let e=this.observers.find(t=>t.shouldFetchOnWindowFocus());e&&e.refetch({cancelRefetch:!1}),null==(t=this.retryer)||t.continue()}onOnline(){var t;let e=this.observers.find(t=>t.shouldFetchOnReconnect());e&&e.refetch({cancelRefetch:!1}),null==(t=this.retryer)||t.continue()}addObserver(t){-1===this.observers.indexOf(t)&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){-1!==this.observers.indexOf(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,e){var r,n,i,o;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=e&&e.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(t&&this.setOptions(t),!this.options.queryFn){let s=this.observers.find(t=>t.options.queryFn);s&&this.setOptions(s.options)}Array.isArray(this.options.queryKey);let a=function(){if("function"==typeof AbortController)return new AbortController}(),u={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(u);let h=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(u)):Promise.reject("Missing queryFn"),c={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:h};l(c),null==(r=this.options.behavior)||r.onFetch(c),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=c.fetchOptions)?void 0:n.meta))&&this.dispatch({type:"fetch",meta:null==(o=c.fetchOptions)?void 0:o.meta});let f=t=>{if(I(t)&&t.silent||this.dispatch({type:"error",error:t}),!I(t)){var e,r;null==(e=(r=this.cache.config).onError)||e.call(r,t,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=T({fn:c.fetchFn,abort:null==a?void 0:a.abort.bind(a),onSuccess:t=>{var e,r;if(void 0===t){f(Error("undefined"));return}this.setData(t),null==(e=(r=this.cache.config).onSuccess)||e.call(r,t,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:f,onFail:(t,e)=>{this.dispatch({type:"failed",failureCount:t,error:e})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){this.state=(e=>{var r,n;switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(r=t.meta)?r:null,fetchStatus:R(this.options.networkMode)?"fetching":"paused",...!e.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:null!=(n=t.dataUpdatedAt)?n:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=t.error;if(I(i)&&i.revert&&this.revertState)return{...this.revertState};return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),_.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}class F extends x{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,e,r){var n;let i=e.queryKey,o=null!=(n=e.queryHash)?n:p(i,e),s=this.get(o);return s||(s=new L({cache:this,logger:t.getLogger(),queryKey:i,queryHash:o,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){let e=this.queriesMap[t.queryHash];e&&(t.destroy(),this.queries=this.queries.filter(e=>e!==t),e===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){_.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,e){let[r]=c(t,e);return void 0===r.exact&&(r.exact=!0),this.queries.find(t=>f(r,t))}findAll(t,e){let[r]=c(t,e);return Object.keys(r).length>0?this.queries.filter(t=>f(r,t)):this.queries}notify(t){_.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){_.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){_.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class D extends B{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||M,this.observers=[],this.state=t.state||U(),this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){-1===this.observers.indexOf(t)&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(e=>e!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()}async execute(){var t,e,r,n,i,o,s,a,u,l,h,c,f,d,p,m;let g="loading"===this.state.status;try{if(!g){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(s=(a=this.mutationCache.config).onMutate)?void 0:s.call(a,this.state.variables,this));let y=await (null==(u=(l=this.options).onMutate)?void 0:u.call(l,this.state.variables));y!==this.state.context&&this.dispatch({type:"loading",context:y,variables:this.state.variables})}let v=await (()=>{var t;return this.retryer=T({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(t,e)=>{this.dispatch({type:"failed",failureCount:t,error:e})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(t=this.options.retry)?t:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return await (null==(t=(e=this.mutationCache.config).onSuccess)?void 0:t.call(e,v,this.state.variables,this.state.context,this)),await (null==(r=(n=this.options).onSuccess)?void 0:r.call(n,v,this.state.variables,this.state.context)),await (null==(i=(o=this.options).onSettled)?void 0:i.call(o,v,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:v}),v}catch(b){try{throw await (null==(h=(c=this.mutationCache.config).onError)?void 0:h.call(c,b,this.state.variables,this.state.context,this)),await (null==(f=(d=this.options).onError)?void 0:f.call(d,b,this.state.variables,this.state.context)),await (null==(p=(m=this.options).onSettled)?void 0:p.call(m,void 0,b,this.state.variables,this.state.context)),b}finally{this.dispatch({type:"error",error:b})}}}dispatch(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"loading":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!R(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...e,...t.state}}})(this.state),_.batch(()=>{this.observers.forEach(e=>{e.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function U(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class j extends x{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,e,r){let n=new D({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(e),state:r,defaultOptions:e.mutationKey?t.getMutationDefaults(e.mutationKey):void 0});return this.add(n),n}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(e=>e!==t),this.notify({type:"removed",mutation:t})}clear(){_.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return void 0===t.exact&&(t.exact=!0),this.mutations.find(e=>d(t,e))}findAll(t){return this.mutations.filter(e=>d(t,e))}notify(t){_.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.mutations.filter(t=>t.state.isPaused);return _.batch(()=>t.reduce((t,e)=>t.then(()=>e.continue().catch(s)),Promise.resolve()))}}function q(t,e){return null==t.getNextPageParam?void 0:t.getNextPageParam(e[e.length-1],e)}class K{constructor(t={}){this.queryCache=t.queryCache||new F,this.mutationCache=t.mutationCache||new j,this.logger=t.logger||M,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}mount(){this.unsubscribeFocus=P.subscribe(()=>{P.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=C.subscribe(()=>{C.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})}unmount(){var t,e;null==(t=this.unsubscribeFocus)||t.call(this),null==(e=this.unsubscribeOnline)||e.call(this)}isFetching(t,e){let[r]=c(t,e);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,e){var r;return null==(r=this.queryCache.find(t,e))?void 0:r.state.data}ensureQueryData(t,e,r){let n=l(t,e,r),i=this.getQueryData(n.queryKey);return i?Promise.resolve(i):this.fetchQuery(n)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:t,state:e})=>{let r=e.data;return[t,r]})}setQueryData(t,e,r){let n=this.queryCache.find(t),i=null==n?void 0:n.state.data,o="function"==typeof e?e(i):e;if(void 0===o)return;let s=l(t),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return _.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,r)]))}getQueryState(t,e){var r;return null==(r=this.queryCache.find(t,e))?void 0:r.state}removeQueries(t,e){let[r]=c(t,e),n=this.queryCache;_.batch(()=>{n.findAll(r).forEach(t=>{n.remove(t)})})}resetQueries(t,e,r){let[n,i]=c(t,e,r),o=this.queryCache,s={type:"active",...n};return _.batch(()=>(o.findAll(n).forEach(t=>{t.reset()}),this.refetchQueries(s,i)))}cancelQueries(t,e,r){let[n,i={}]=c(t,e,r);void 0===i.revert&&(i.revert=!0);let o=_.batch(()=>this.queryCache.findAll(n).map(t=>t.cancel(i)));return Promise.all(o).then(s).catch(s)}invalidateQueries(t,e,r){let[n,i]=c(t,e,r);return _.batch(()=>{var t,e;if(this.queryCache.findAll(n).forEach(t=>{t.invalidate()}),"none"===n.refetchType)return Promise.resolve();let r={...n,type:null!=(t=null!=(e=n.refetchType)?e:n.type)?t:"active"};return this.refetchQueries(r,i)})}refetchQueries(t,e,r){let[n,i]=c(t,e,r),o=_.batch(()=>this.queryCache.findAll(n).filter(t=>!t.isDisabled()).map(t=>{var e;return t.fetch(void 0,{...i,cancelRefetch:null==(e=null==i?void 0:i.cancelRefetch)||e,meta:{refetchPage:n.refetchPage}})})),a=Promise.all(o).then(s);return null!=i&&i.throwOnError||(a=a.catch(s)),a}fetchQuery(t,e,r){let n=l(t,e,r),i=this.defaultQueryOptions(n);void 0===i.retry&&(i.retry=!1);let o=this.queryCache.build(this,i);return o.isStaleByTime(i.staleTime)?o.fetch(i):Promise.resolve(o.state.data)}prefetchQuery(t,e,r){return this.fetchQuery(t,e,r).then(s).catch(s)}fetchInfiniteQuery(t,e,r){let n=l(t,e,r);return n.behavior={onFetch(t){t.fetchFn=()=>{var e,r,n,i,o,s,a;let u;let l=null==(e=t.fetchOptions)?void 0:null==(r=e.meta)?void 0:r.refetchPage,h=null==(n=t.fetchOptions)?void 0:null==(i=n.meta)?void 0:i.fetchMore,c=null==h?void 0:h.pageParam,f=(null==h?void 0:h.direction)==="forward",d=(null==h?void 0:h.direction)==="backward",p=(null==(o=t.state.data)?void 0:o.pages)||[],m=(null==(s=t.state.data)?void 0:s.pageParams)||[],g=m,y=!1,v=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get(){var e,r;return null!=(e=t.signal)&&e.aborted?y=!0:null==(r=t.signal)||r.addEventListener("abort",()=>{y=!0}),t.signal}})},b=t.options.queryFn||(()=>Promise.reject("Missing queryFn")),w=(t,e,r,n)=>(g=n?[e,...g]:[...g,e],n?[r,...t]:[...t,r]),A=(e,r,n,i)=>{if(y)return Promise.reject("Cancelled");if(void 0===n&&!r&&e.length)return Promise.resolve(e);let o={queryKey:t.queryKey,pageParam:n,meta:t.options.meta};v(o);let s=b(o),a=Promise.resolve(s).then(t=>w(e,n,t,i));return a};if(p.length){if(f){let E=void 0!==c,k=E?c:q(t.options,p);u=A(p,E,k)}else if(d){let S=void 0!==c,M=S?c:null==(a=t.options).getPreviousPageParam?void 0:a.getPreviousPageParam(p[0],p);u=A(p,S,M,!0)}else{g=[];let _=void 0===t.options.getNextPageParam,x=!l||!p[0]||l(p[0],0,p);u=x?A([],_,m[0]):Promise.resolve(w([],m[0],p[0]));for(let P=1;P{let r=!l||!p[P]||l(p[P],P,p);if(r){let n=_?m[P]:q(t.options,e);return A(e,_,n)}return Promise.resolve(w(e,m[P],p[P]))})}}else u=A([]);let C=u.then(t=>({pages:t,pageParams:g}));return C}}},this.fetchQuery(n)}prefetchInfiniteQuery(t,e,r){return this.fetchInfiniteQuery(t,e,r).then(s).catch(s)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,e){let r=this.queryDefaults.find(e=>m(t)===m(e.queryKey));r?r.defaultOptions=e:this.queryDefaults.push({queryKey:t,defaultOptions:e})}getQueryDefaults(t){if(!t)return;let e=this.queryDefaults.find(e=>g(t,e.queryKey));return null==e?void 0:e.defaultOptions}setMutationDefaults(t,e){let r=this.mutationDefaults.find(e=>m(t)===m(e.mutationKey));r?r.defaultOptions=e:this.mutationDefaults.push({mutationKey:t,defaultOptions:e})}getMutationDefaults(t){if(!t)return;let e=this.mutationDefaults.find(e=>g(t,e.mutationKey));return null==e?void 0:e.defaultOptions}defaultQueryOptions(t){if(null!=t&&t._defaulted)return t;let e={...this.defaultOptions.queries,...this.getQueryDefaults(null==t?void 0:t.queryKey),...t,_defaulted:!0};return!e.queryHash&&e.queryKey&&(e.queryHash=p(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.useErrorBoundary&&(e.useErrorBoundary=!!e.suspense),e}defaultMutationOptions(t){return null!=t&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==t?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}var G=r(67294);let H=G.createContext(void 0),z=G.createContext(!1);function Q(t,e){return t||(e&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=H),window.ReactQueryClientContext):H)}let W=({context:t}={})=>{let e=G.useContext(Q(t,G.useContext(z)));if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},J=({client:t,children:e,context:r,contextSharing:n=!1})=>{G.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);let i=Q(r,n);return G.createElement(z.Provider,{value:!r&&n},G.createElement(i.Provider,{value:t},e))},V=G.createContext(!1),Z=()=>G.useContext(V);V.Provider;let Y=G.createContext((n=!1,{clearReset(){n=!1},reset(){n=!0},isReset:()=>n})),$=()=>G.useContext(Y);var X=r(61688);let tt=X.useSyncExternalStore;class te extends x{constructor(t,e){super(),this.client=t,this.setOptions(e),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.client.defaultMutationOptions(t),y(e,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this})}onUnsubscribe(){if(!this.listeners.length){var t;null==(t=this.currentMutation)||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();let e={listeners:!0};"success"===t.type?e.onSuccess=!0:"error"===t.type&&(e.onError=!0),this.notify(e)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,e){return this.mutateOptions=e,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==t?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let t=this.currentMutation?this.currentMutation.state:U(),e={...t,isLoading:"loading"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset};this.currentResult=e}notify(t){_.batch(()=>{if(this.mutateOptions){var e,r,n,i,o,s,a,u;t.onSuccess?(null==(e=(r=this.mutateOptions).onSuccess)||e.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(i=this.mutateOptions).onSettled)||n.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):t.onError&&(null==(o=(s=this.mutateOptions).onError)||o.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(u=this.mutateOptions).onSettled)||a.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}t.listeners&&this.listeners.forEach(t=>{t(this.currentResult)})})}}function tr(){}class tn extends x{constructor(t,e){super(),this.client=t,this.options=e,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.length&&(this.currentQuery.addObserver(this),ti(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return to(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return to(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,e){let r=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),y(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();let i=this.hasListeners();i&&ts(this.currentQuery,n,this.options,r)&&this.executeFetch(),this.updateResult(e),i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();let o=this.computeRefetchInterval();i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(t){let e=this.client.getQueryCache().build(this.client,t);return this.createResult(e,t)}getCurrentResult(){return this.currentResult}trackResult(t){let e={};return Object.keys(t).forEach(r=>{Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),e}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...e}={}){return this.fetch({...e,meta:{refetchPage:t}})}fetchOptimistic(t){let e=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,e);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,e))}fetch(t){var e;return this.executeFetch({...t,cancelRefetch:null==(e=t.cancelRefetch)||e}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let e=this.currentQuery.fetch(this.options,t);return null!=t&&t.throwOnError||(e=e.catch(s)),e}updateStaleTimeout(){if(this.clearStaleTimeout(),o||this.currentResult.isStale||!a(this.options.staleTime))return;let t=u(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t+1)}computeRefetchInterval(){var t;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(t=this.options.refetchInterval)&&t}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!o&&!1!==this.options.enabled&&a(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||P.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,e){let r;let n=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,a=this.currentResultOptions,u=t!==n,l=u?t.state:this.currentQueryInitialState,h=u?this.currentResult:this.previousQueryResult,{state:c}=t,{dataUpdatedAt:f,error:d,errorUpdatedAt:p,fetchStatus:m,status:g}=c,y=!1,v=!1;if(e._optimisticResults){let b=this.hasListeners(),w=!b&&ti(t,e),A=b&&ts(t,n,e,i);(w||A)&&(m=R(t.options.networkMode)?"fetching":"paused",f||(g="loading")),"isRestoring"===e._optimisticResults&&(m="idle")}if(e.keepPreviousData&&!c.dataUpdatedAt&&null!=h&&h.isSuccess&&"error"!==g)r=h.data,f=h.dataUpdatedAt,g=h.status,y=!0;else if(e.select&&void 0!==c.data){if(o&&c.data===(null==s?void 0:s.data)&&e.select===this.selectFn)r=this.selectResult;else try{this.selectFn=e.select,r=e.select(c.data),r=S(null==o?void 0:o.data,r,e),this.selectResult=r,this.selectError=null}catch(E){this.selectError=E}}else r=c.data;if(void 0!==e.placeholderData&&void 0===r&&"loading"===g){let k;if(null!=o&&o.isPlaceholderData&&e.placeholderData===(null==a?void 0:a.placeholderData))k=o.data;else if(k="function"==typeof e.placeholderData?e.placeholderData():e.placeholderData,e.select&&void 0!==k)try{k=e.select(k),this.selectError=null}catch(M){this.selectError=M}void 0!==k&&(g="success",r=S(null==o?void 0:o.data,k,e),v=!0)}this.selectError&&(d=this.selectError,r=this.selectResult,p=Date.now(),g="error");let _="fetching"===m,x="loading"===g,P="error"===g,C={status:g,fetchStatus:m,isLoading:x,isSuccess:"success"===g,isError:P,isInitialLoading:x&&_,data:r,dataUpdatedAt:f,error:d,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:_,isRefetching:_&&!x,isLoadingError:P&&0===c.dataUpdatedAt,isPaused:"paused"===m,isPlaceholderData:v,isPreviousData:y,isRefetchError:P&&0!==c.dataUpdatedAt,isStale:ta(t,e),refetch:this.refetch,remove:this.remove};return C}updateResult(t){let e=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,y(r,e))return;this.currentResult=r;let n={cache:!0};(null==t?void 0:t.listeners)!==!1&&(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options;if("all"===t||!t&&!this.trackedProps.size)return!0;let r=new Set(null!=t?t:this.trackedProps);return this.options.useErrorBoundary&&r.add("error"),Object.keys(this.currentResult).some(t=>{let n=this.currentResult[t]!==e[t];return n&&r.has(t)})})()&&(n.listeners=!0),this.notify({...n,...t})}updateQuery(){let t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;let e=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==e||e.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){let e={};"success"===t.type?e.onSuccess=!t.manual:"error"!==t.type||I(t.error)||(e.onError=!0),this.updateResult(e),this.hasListeners()&&this.updateTimers()}notify(t){_.batch(()=>{var e,r,n,i,o,s,a,u;t.onSuccess?(null==(e=(r=this.options).onSuccess)||e.call(r,this.currentResult.data),null==(n=(i=this.options).onSettled)||n.call(i,this.currentResult.data,null)):t.onError&&(null==(o=(s=this.options).onError)||o.call(s,this.currentResult.error),null==(a=(u=this.options).onSettled)||a.call(u,void 0,this.currentResult.error)),t.listeners&&this.listeners.forEach(t=>{t(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function ti(t,e){return!1!==e.enabled&&!t.state.dataUpdatedAt&&!("error"===t.state.status&&!1===e.retryOnMount)||t.state.dataUpdatedAt>0&&to(t,e,e.refetchOnMount)}function to(t,e,r){if(!1!==e.enabled){let n="function"==typeof r?r(t):r;return"always"===n||!1!==n&&ta(t,e)}return!1}function ts(t,e,r,n){return!1!==r.enabled&&(t!==e||!1===n.enabled)&&(!r.suspense||"error"!==t.state.status)&&ta(t,r)}function ta(t,e){return t.isStaleByTime(e.staleTime)}function tu(t){return t.state.isPaused}function tl(t){return"success"===t.state.status}async function th({queryClient:t,persister:e,maxAge:r=864e5,buster:n="",hydrateOptions:i}){try{let o=await e.restoreClient();if(o){if(o.timestamp){let s=Date.now()-o.timestamp>r,a=o.buster!==n;s||a?e.removeClient():function(t,e,r){if("object"!=typeof e||null===e)return;let n=t.getMutationCache(),i=t.getQueryCache(),o=e.mutations||[],s=e.queries||[];o.forEach(e=>{var i;n.build(t,{...null==r?void 0:null==(i=r.defaultOptions)?void 0:i.mutations,mutationKey:e.mutationKey},e.state)}),s.forEach(e=>{var n;let o=i.get(e.queryHash);if(o){o.state.dataUpdatedAt{i(t)&&r.push({mutationKey:t.options.mutationKey,state:t.state})})}if(!1!==e.dehydrateQueries){let o=e.shouldDehydrateQuery||tl;t.getQueryCache().getAll().forEach(t=>{o(t)&&n.push({state:t.state,queryKey:t.queryKey,queryHash:t.queryHash})})}return{mutations:r,queries:n}}(t,n)};await e.persistClient(i)}var tf=r(97231),td=r(2984),tp=r(5151),tm=r(52798);let tg=(t,e)=>{let{find:r,replace:n}=e;return t&&r(t)?n(t):"object"!=typeof t?t:Array.isArray(t)?t.map(t=>tg(t,{find:r,replace:n})):t instanceof Object?Object.entries(t).reduce((t,e)=>{let[i,o]=e;return{...t,[i]:tg(o,{find:r,replace:n})}},{}):t};function ty(t){let e=JSON.parse(t),r=tg(e,{find:t=>"BigNumber"===t.type,replace:t=>tp.BigNumber.from(t.hex)});return r}function tv(t,e){return t.slice(0,e).join(".")||"."}function tb(t,e){let{length:r}=t;for(let n=0;n{try{t.setItem(e,n(r));return}catch(i){return i}};return{persistClient:function(t,e=100){let r=null;return function(...n){null===r&&(r=setTimeout(()=>{t(...n),r=null},e))}}(t=>{let e=t,r=a(e),n=0;for(;r&&e;)n++,(e=null==s?void 0:s({persistedClient:e,error:r,errorCount:n}))&&(r=a(e))},r),restoreClient(){let r=t.getItem(e);if(r)return o(r)},removeClient(){t.removeItem(e)}}}return{persistClient:i,restoreClient:()=>void 0,removeClient:i}}({key:"wagmi.cache",storage:window.localStorage,serialize:tw,deserialize:ty}):void 0,...n}=t,o=(0,tf.k)(n);return r&&function(t){let e;th(t).then(()=>{(function(t){let e=t.queryClient.getQueryCache().subscribe(()=>{tc(t)}),r=t.queryClient.getMutationCache().subscribe(()=>{tc(t)});()=>{e(),r()}})(t)})}({queryClient:e,persister:r,dehydrateOptions:{shouldDehydrateQuery:t=>0!==t.cacheTime&&!1!==t.queryKey[0].persist}}),Object.assign(o,{queryClient:e})}let tE=G.createContext(void 0),tk=G.createContext(void 0);function tS(t){let{children:e,client:r}=t;return G.createElement(tE.Provider,{value:r},G.createElement(J,{client:r.queryClient,context:tk},e))}function tM(){let t=G.useContext(tE);if(!t)throw Error("`useClient` must be used within `WagmiConfig`.\n\nRead more: https://wagmi.sh/docs/WagmiConfig");return t}let t_=X.useSyncExternalStore;function tx(t,e,r){let n=h(t,e,r);return function(t,e,r){var n,i;let o=h(t,void 0,void 0),s=W({context:o.context}),[a]=G.useState(()=>new te(s,o));G.useEffect(()=>{a.setOptions(o)},[a,o]);let u=tt(G.useCallback(t=>a.subscribe(_.batchCalls(t)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),l=G.useCallback((t,e)=>{a.mutate(t,e).catch(tr)},[a]);if(u.error&&(n=a.options.useErrorBoundary,i=[u.error],"function"==typeof n?n(...i):!!n))throw u.error;return{...u,mutate:l,mutateAsync:u.mutate}}({context:tk,...n})}let tP=()=>W({context:tk});function tC(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,tm.useSyncExternalStoreWithSelector)(e=>(0,td.b0)({chainId:t},e),()=>(0,tf.f)({chainId:t}),()=>(0,tf.f)({chainId:t}),t=>t,(t,e)=>t.network.chainId===e.network.chainId)}let tO=t=>"object"==typeof t&&!Array.isArray(t);function tR(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:td.vZ,i=G.useRef([]),o=(0,tm.useSyncExternalStoreWithSelector)(t,e,r,t=>t,(t,e)=>{if(tO(t)&&tO(e)){for(let r of i.current){let o=n(t[r],e[r]);if(!o)return!1}return!0}return n(t,e)});if(tO(o)){let s={...o};return Object.defineProperties(s,Object.entries(s).reduce((t,e)=>{let[r,n]=e;return{...t,[r]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(r)||i.current.push(r),n)}}},{})),s}return o}function tN(){var t,e,r;let{onConnect:n,onDisconnect:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=tR(td.uH,td.D0),s=G.useRef();return n&&(null===(t=s.current)||void 0===t?void 0:t.status)!=="connected"&&"connected"===o.status&&n({address:o.address,connector:o.connector,isReconnected:(null===(e=s.current)||void 0===e?void 0:e.status)==="reconnecting"}),i&&(null===(r=s.current)||void 0===r?void 0:r.status)=="connected"&&"disconnected"===o.status&&i(),s.current=o,o}let tI=t=>[{entity:"connect",...t}],tT=t=>{let{connector:e,chainId:r}=t;if(!e)throw Error("connector is required");return(0,td.$j)({connector:e,chainId:r})};function tB(){let{chainId:t,connector:e,onError:r,onMutate:n,onSettled:i,onSuccess:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=tM(),{data:a,error:u,isError:l,isIdle:h,isLoading:c,isSuccess:f,mutate:d,mutateAsync:p,reset:m,status:g,variables:y}=tx(tI({connector:e,chainId:t}),tT,{onError:r,onMutate:n,onSettled:i,onSuccess:o}),v=G.useCallback(r=>d({chainId:(null==r?void 0:r.chainId)??t,connector:(null==r?void 0:r.connector)??e}),[t,e,d]),b=G.useCallback(r=>p({chainId:(null==r?void 0:r.chainId)??t,connector:(null==r?void 0:r.connector)??e}),[t,e,p]);return{connect:v,connectAsync:b,connectors:s.connectors,data:a,error:u,isError:l,isIdle:h,isLoading:c,isSuccess:f,pendingConnector:null==y?void 0:y.connector,reset:m,status:g,variables:y}}let tL=[{entity:"disconnect"}],tF=()=>(0,td.zP)();function tD(){let{onError:t,onMutate:e,onSettled:r,onSuccess:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{error:i,isError:o,isIdle:s,isLoading:a,isSuccess:u,mutate:l,mutateAsync:h,reset:c,status:f}=tx(tL,tF,{...t?{onError(e,r,n){t(e,n)}}:{},onMutate:e,...r?{onSettled(t,e,n,i){r(e,i)}}:{},...n?{onSuccess(t,e,r){n(r)}}:{}});return{disconnect:l,disconnectAsync:h,error:i,isError:o,isIdle:s,isLoading:a,isSuccess:u,reset:c,status:f}}function tU(){return tR(td.QC,td.Hy)}function tj(t){let{chainId:e}=t;return[{entity:"signer",chainId:e,persist:!1}]}function tq(t){let{queryKey:[{chainId:e}]}=t;return(0,td.DG)({chainId:e})}function tK(){let{chainId:t,suspense:e,onError:r,onSettled:n,onSuccess:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=function(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=tC({chainId:t});return e.network.chainId}({chainId:t}),s=function(t,e,r){let n=Array.isArray(t)?"function"==typeof e?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t,i=function(t,e){var r,n;let i=W({context:t.context}),o=Z(),s=$(),a=i.defaultQueryOptions(t);a._optimisticResults=o?"isRestoring":"optimistic",a.onError&&(a.onError=_.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=_.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=_.batchCalls(a.onSettled)),a.suspense&&"number"!=typeof a.staleTime&&(a.staleTime=1e3),(a.suspense||a.useErrorBoundary)&&!s.isReset()&&(a.retryOnMount=!1);let[u]=G.useState(()=>new e(i,a)),l=u.getOptimisticResult(a);if(t_(G.useCallback(t=>o?()=>void 0:u.subscribe(_.batchCalls(t)),[u,o]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),G.useEffect(()=>{s.clearReset()},[s]),G.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),a.suspense&&l.isLoading&&l.isFetching&&!o)throw u.fetchOptimistic(a).then(t=>{var e,r;let{data:n}=t;null===(e=a.onSuccess)||void 0===e||e.call(a,n),null===(r=a.onSettled)||void 0===r||r.call(a,n,null)}).catch(t=>{var e,r;s.clearReset(),null===(e=a.onError)||void 0===e||e.call(a,t),null===(r=a.onSettled)||void 0===r||r.call(a,void 0,t)});if(l.isError&&!s.isReset()&&!l.isFetching&&(r=a.useErrorBoundary,n=[l.error,u.getCurrentQuery()],"function"==typeof r?r(...n):!!r))throw l.error;let h="loading"===l.status&&"idle"===l.fetchStatus?"idle":l.status,c="loading"===h&&"fetching"===l.fetchStatus;return{...l,defaultedOptions:a,isIdle:"idle"===h,isLoading:c,observer:u,status:h}}({context:tk,...n},tn),o={data:i.data,error:i.error,fetchStatus:i.fetchStatus,isError:i.isError,isFetched:i.isFetched,isFetchedAfterMount:i.isFetchedAfterMount,isFetching:i.isFetching,isIdle:i.isIdle,isLoading:i.isLoading,isRefetching:i.isRefetching,isSuccess:i.isSuccess,refetch:i.refetch,status:i.status,internal:{dataUpdatedAt:i.dataUpdatedAt,errorUpdatedAt:i.errorUpdatedAt,failureCount:i.failureCount,isFetchedAfterMount:i.isFetchedAfterMount,isLoadingError:i.isLoadingError,isPaused:i.isPaused,isPlaceholderData:i.isPlaceholderData,isPreviousData:i.isPreviousData,isRefetchError:i.isRefetchError,isStale:i.isStale,remove:i.remove}};return i.defaultedOptions.notifyOnChangeProps?o:function(t,e){let r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(e.trackedProps.add(n),t[n])})}),r}(o,i.observer)}(tj({chainId:o}),tq,{cacheTime:0,staleTime:1/0,suspense:e,onError:r,onSettled:n,onSuccess:i}),a=tP();return G.useEffect(()=>{let t=(0,td.rn)({chainId:o},t=>a.setQueryData(tj({chainId:o}),t));return t},[a,o]),s}function tG(t){let{domain:e,types:r,value:n}=t;if(!e)throw Error("domain is required");if(!r)throw Error("types is required");if(!n)throw Error("value is required");return(0,td.xq)({domain:e,types:r,value:n})}function tH(){let{domain:t,types:e,value:r,onError:n,onMutate:i,onSettled:o,onSuccess:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:a,error:u,isError:l,isIdle:h,isLoading:c,isSuccess:f,mutate:d,mutateAsync:p,reset:m,status:g,variables:y}=tx(function(t){let{domain:e,types:r,value:n}=t;return[{entity:"signTypedData",domain:e,types:r,value:n}]}({domain:t,types:e,value:r}),tG,{onError:n,onMutate:i,onSettled:o,onSuccess:s}),v=G.useCallback(n=>d({domain:(null==n?void 0:n.domain)??t,types:(null==n?void 0:n.types)??e,value:(null==n?void 0:n.value)??r}),[t,e,r,d]),b=G.useCallback(n=>p({domain:(null==n?void 0:n.domain)??t,types:(null==n?void 0:n.types)??e,value:(null==n?void 0:n.value)??r}),[t,e,r,p]);return{data:a,error:u,isError:l,isIdle:h,isLoading:c,isSuccess:f,reset:m,signTypedData:v,signTypedDataAsync:b,status:g,variables:y}}let tz=t=>[{entity:"switchNetwork",...t}],tQ=t=>{let{chainId:e}=t;if(!e)throw Error("chainId is required");return(0,td.If)({chainId:e})};function tW(){var t;let e,r;let{chainId:n,throwForSwitchChainNotSupported:i,onError:o,onMutate:s,onSettled:a,onSuccess:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=tM(),h=function(){let[,t]=G.useReducer(t=>t+1,0);return t}(),{data:c,error:f,isError:d,isIdle:p,isLoading:m,isSuccess:g,mutate:y,mutateAsync:v,reset:b,status:w,variables:A}=tx(tz({chainId:n}),tQ,{onError:o,onMutate:s,onSettled:a,onSuccess:u}),E=G.useCallback(t=>y({chainId:t??n}),[n,y]),k=G.useCallback(t=>v({chainId:t??n}),[n,v]);G.useEffect(()=>{let t=l.subscribe(t=>{let{chains:e,connector:r}=t;return{chains:e,connector:r}},h);return t},[l,h]);let S=!!(null!==(t=l.connector)&&void 0!==t&&t.switchChain);return(i||S)&&(e=E,r=k),{chains:l.chains??[],data:c,error:f,isError:d,isIdle:p,isLoading:m,isSuccess:g,pendingChainId:null==A?void 0:A.chainId,reset:b,status:w,switchNetwork:e,switchNetworkAsync:r,variables:A}}function tJ(){let{address:t,abi:e,signerOrProvider:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return G.useMemo(()=>t&&e?(0,td.uN)({address:t,abi:e,signerOrProvider:null===r?void 0:r}):null,[t,e,r])}},88677:function(){},62808:function(){}},function(t){var e=function(e){return t(t.s=e)};t.O(0,[774,179],function(){return e(6840),e(80880)}),_N_E=t.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/_app-94e5e1935a3accba.js b/_next/static/chunks/pages/_app-94e5e1935a3accba.js deleted file mode 100644 index 38f6e7a..0000000 --- a/_next/static/chunks/pages/_app-94e5e1935a3accba.js +++ /dev/null @@ -1,31 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{8417:function(t,e,r){"use strict";r.d(e,{Z:function(){return z}});var n=function(){function t(t){var e=this;this._insertTag=function(t){var r;r=0===e.tags.length?e.insertionPoint?e.insertionPoint.nextSibling:e.prepend?e.container.firstChild:e.before:e.tags[e.tags.length-1].nextSibling,e.container.insertBefore(t,r),e.tags.push(t)},this.isSpeedy=void 0===t.speedy||t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){if(this.ctr%(this.isSpeedy?65e3:1)==0){var e;this._insertTag(((e=document.createElement("style")).setAttribute("data-emotion",this.key),void 0!==this.nonce&&e.setAttribute("nonce",this.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e))}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(t){if(t.sheet)return t.sheet;for(var e=0;e0?m[A]+" "+E:a(E,/&\f/g,m[A])).trim())&&(c[w++]=k);return b(t,e,r,0===o?O:l,c,f,d)}function L(t,e,r,n){return b(t,e,r,R,h(t,0,n),h(t,n+1,-1),n)}var F=function(t,e,r){for(var n=0,i=0;n=i,i=E(),38===n&&12===i&&(e[r]=1),!k(i);)A();return h(v,t,g)},D=function(t,e){var r=-1,n=44;do switch(k(n)){case 0:38===n&&12===E()&&(e[r]=1),t[r]+=F(g-1,e,r);break;case 2:t[r]+=M(n);break;case 4:if(44===n){t[++r]=58===E()?"&\f":"",e[r]=t[r].length;break}default:t[r]+=o(n)}while(n=A());return t},U=function(t,e){var r;return r=D(S(t),e),v="",r},j=new WeakMap,q=function(t){if("rule"===t.type&&t.parent&&!(t.length<1)){for(var e=t.value,r=t.parent,n=t.column===r.column&&t.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==t.props.length||58===e.charCodeAt(0)||j.get(r))&&!n){j.set(t,!0);for(var i=[],o=U(e,i),s=r.props,a=0,u=0;a-1&&!t.return)switch(t.type){case R:t.return=function t(e,r){switch(45^l(e,0)?(((r<<2^l(e,0))<<2^l(e,1))<<2^l(e,2))<<2^l(e,3):0){case 5103:return P+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return P+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return P+e+x+e+_+e+e;case 6828:case 4268:return P+e+_+e+e;case 6165:return P+e+_+"flex-"+e+e;case 5187:return P+e+a(e,/(\w+).+(:[^]+)/,P+"box-$1$2"+_+"flex-$1$2")+e;case 5443:return P+e+_+"flex-item-"+a(e,/flex-|-self/,"")+e;case 4675:return P+e+_+"flex-line-pack"+a(e,/align-content|flex-|-self/,"")+e;case 5548:return P+e+_+a(e,"shrink","negative")+e;case 5292:return P+e+_+a(e,"basis","preferred-size")+e;case 6060:return P+"box-"+a(e,"-grow","")+P+e+_+a(e,"grow","positive")+e;case 4554:return P+a(e,/([^-])(transform)/g,"$1"+P+"$2")+e;case 6187:return a(a(a(e,/(zoom-|grab)/,P+"$1"),/(image-set)/,P+"$1"),e,"")+e;case 5495:case 3959:return a(e,/(image-set\([^]*)/,P+"$1$`$1");case 4968:return a(a(e,/(.+:)(flex-)?(.*)/,P+"box-pack:$3"+_+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+P+e+e;case 4095:case 3583:case 4068:case 2532:return a(e,/(.+)-inline(.+)/,P+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(c(e)-1-r>6)switch(l(e,r+1)){case 109:if(45!==l(e,r+4))break;case 102:return a(e,/(.+:)(.+)-([^]+)/,"$1"+P+"$2-$3$1"+x+(108==l(e,r+3)?"$3":"$2-$3"))+e;case 115:return~u(e,"stretch")?t(a(e,"stretch","fill-available"),r)+e:e}break;case 4949:if(115!==l(e,r+1))break;case 6444:switch(l(e,c(e)-3-(~u(e,"!important")&&10))){case 107:return a(e,":",":"+P)+e;case 101:return a(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+P+(45===l(e,14)?"inline-":"")+"box$3$1"+P+"$2$3$1"+_+"$2box$3")+e}break;case 5936:switch(l(e,r+11)){case 114:return P+e+_+a(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return P+e+_+a(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return P+e+_+a(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return P+e+_+e+e}return e}(t.value,t.length);break;case N:return I([w(t,{value:a(t.value,"@","@"+P)})],n);case O:if(t.length)return t.props.map(function(e){var r;switch(r=e,(r=/(::plac\w+|:read-\w+)/.exec(r))?r[0]:r){case":read-only":case":read-write":return I([w(t,{props:[a(e,/:(read-\w+)/,":"+x+"$1")]})],n);case"::placeholder":return I([w(t,{props:[a(e,/:(plac\w+)/,":"+P+"input-$1")]}),w(t,{props:[a(e,/:(plac\w+)/,":"+x+"$1")]}),w(t,{props:[a(e,/:(plac\w+)/,_+"input-$1")]})],n)}return""}).join("")}}],z=function(t){var e,r,i,s,m,w=t.key;if("css"===w){var _=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(_,function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))})}var x=t.stylisPlugins||G,P={},O=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+w+' "]'),function(t){for(var e=t.getAttribute("data-emotion").split(" "),r=1;r2||k(y)>3?"":" "}(T);break;case 92:H+=function(t,e){for(var r;--e&&A()&&!(y<48)&&!(y>102)&&(!(y>57)||!(y<65))&&(!(y>70)||!(y<97)););return r=g+(e<6&&32==E()&&32==A()),h(v,t,r)}(g-1,7);continue;case 47:switch(E()){case 42:case 47:f(b(x=function(t,e){for(;A();)if(t+y===57)break;else if(t+y===84&&47===E())break;return"/*"+h(v,e,g-1)+"*"+o(47===t?t:A())}(A(),g),r,n,C,o(y),h(x,2,-2),0),_);break;default:H+="/"}break;case 123*F:S[P++]=c(H)*U;case 125*F:case 59:case 0:switch(j){case 0:case 125:D=0;case 59+O:I>0&&c(H)-R&&f(I>32?L(H+";",i,n,R-1):L(a(H," ","")+";",i,n,R-2),_);break;case 59:H+=";";default:if(f(z=B(H,r,n,P,O,s,S,q,K=[],G=[],R),m),123===j){if(0===O)t(H,r,z,z,K,m,R,S,G);else switch(99===N&&110===l(H,3)?100:N){case 100:case 109:case 115:t(e,z,z,i&&f(B(e,z,z,0,0,s,S,q,s,K=[],R),G),s,G,R,S,i?K:G);break;default:t(H,z,z,z,[""],G,0,S,G)}}}P=O=I=0,F=U=1,q=H="",R=w;break;case 58:R=1+c(H),I=T;default:if(F<1){if(123==j)--F;else if(125==j&&0==F++&&125==(y=g>0?l(v,--g):0,p--,10===y&&(p=1,d--),y))continue}switch(H+=o(j),j*F){case 38:U=O>0?1:(H+="\f",-1);break;case 44:S[P++]=(c(H)-1)*U,U=1;break;case 64:45===E()&&(H+=M(A())),N=E(),O=R=c(q=H+=function(t){for(;!k(E());)A();return h(v,t,g)}(g)),j++;break;case 45:45===T&&2==c(H)&&(F=0)}}return m}("",null,null,null,[""],e=S(e=t),0,[0],e),v="",r),R)},F={key:w,sheet:new n({key:w,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:P,registered:{},insert:function(t,e,r,n){m=r,N(t?t+"{"+e.styles+"}":e.styles),n&&(F.inserted[e.name]=!0)}};return F.sheet.hydrate(O),F}},45042:function(t,e){"use strict";e.Z=function(t){var e=Object.create(null);return function(r){return void 0===e[r]&&(e[r]=t(r)),e[r]}}},52443:function(t,e,r){"use strict";r.d(e,{E:function(){return m},T:function(){return c},c:function(){return d},h:function(){return u},w:function(){return h}});var n=r(67294),i=r(8417),o=r(70444),s=r(48137),a=r(27278),u={}.hasOwnProperty,l=(0,n.createContext)("undefined"!=typeof HTMLElement?(0,i.Z)({key:"css"}):null);l.Provider;var h=function(t){return(0,n.forwardRef)(function(e,r){return t(e,(0,n.useContext)(l),r)})},c=(0,n.createContext)({}),f="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",d=function(t,e){var r={};for(var n in e)u.call(e,n)&&(r[n]=e[n]);return r[f]=t,r},p=function(t){var e=t.cache,r=t.serialized,n=t.isStringTag;return(0,o.hC)(e,r,n),(0,a.L)(function(){return(0,o.My)(e,r,n)}),null},m=h(function(t,e,r){var i=t.css;"string"==typeof i&&void 0!==e.registered[i]&&(i=e.registered[i]);var a=t[f],l=[i],h="";"string"==typeof t.className?h=(0,o.fp)(e.registered,l,t.className):null!=t.className&&(h=t.className+" ");var d=(0,s.O)(l,void 0,(0,n.useContext)(c));h+=e.key+"-"+d.name;var m={};for(var g in t)u.call(t,g)&&"css"!==g&&g!==f&&(m[g]=t[g]);return m.ref=r,m.className=h,(0,n.createElement)(n.Fragment,null,(0,n.createElement)(p,{cache:e,serialized:d,isStringTag:"string"==typeof a}),(0,n.createElement)(a,m))})},35944:function(t,e,r){"use strict";r.d(e,{BX:function(){return a},HY:function(){return o},tZ:function(){return s}}),r(67294),r(8417);var n=r(52443);r(8679),r(48137),r(27278);var i=r(85893),o=i.Fragment;function s(t,e,r){return n.h.call(e,"css")?(0,i.jsx)(n.E,(0,n.c)(t,e),r):(0,i.jsx)(t,e,r)}function a(t,e,r){return n.h.call(e,"css")?(0,i.jsxs)(n.E,(0,n.c)(t,e),r):(0,i.jsxs)(t,e,r)}},48137:function(t,e,r){"use strict";r.d(e,{O:function(){return m}});var n,i=function(t){for(var e,r=0,n=0,i=t.length;i>=4;++n,i-=4)e=(65535&(e=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))*1540483477+((e>>>16)*59797<<16),e^=e>>>24,r=(65535&e)*1540483477+((e>>>16)*59797<<16)^(65535&r)*1540483477+((r>>>16)*59797<<16);switch(i){case 3:r^=(255&t.charCodeAt(n+2))<<16;case 2:r^=(255&t.charCodeAt(n+1))<<8;case 1:r^=255&t.charCodeAt(n),r=(65535&r)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,(((r=(65535&r)*1540483477+((r>>>16)*59797<<16))^r>>>15)>>>0).toString(36)},o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},s=r(45042),a=/[A-Z]|^ms/g,u=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(t){return 45===t.charCodeAt(1)},h=function(t){return null!=t&&"boolean"!=typeof t},c=(0,s.Z)(function(t){return l(t)?t:t.replace(a,"-$&").toLowerCase()}),f=function(t,e){switch(t){case"animation":case"animationName":if("string"==typeof e)return e.replace(u,function(t,e,r){return n={name:e,styles:r,next:n},e})}return 1===o[t]||l(t)||"number"!=typeof e||0===e?e:e+"px"};function d(t,e,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return n={name:r.name,styles:r.styles,next:n},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)n={name:i.name,styles:i.styles,next:n},i=i.next;return r.styles+";"}return function(t,e,r){var n="";if(Array.isArray(r))for(var i=0;i{let e=t.localName;return e||c.throwError("cannot encode object for signature with missing names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]&&c.throwError("cannot encode object for signature with duplicate names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]=!0,r[e]})}else c.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&c.throwArgumentError("types/value length mismatch","tuple",r);let s=new a.QV(t.wordSize),u=new a.QV(t.wordSize),l=[];return e.forEach((t,e)=>{let r=n[e];if(t.dynamic){let i=u.length;t.encode(u,r);let o=s.writeUpdatableValue();l.push(t=>{o(t+i)})}else t.encode(s,r)}),l.forEach(t=>{t(s.length)}),t.appendWriter(s)+t.appendWriter(u)}function d(t,e){let r=[],n=t.subReader(0);e.forEach(e=>{let i=null;if(e.dynamic){let s=t.readValue(),a=n.subReader(s.toNumber());try{i=e.decode(a)}catch(u){if(u.code===o.Logger.errors.BUFFER_OVERRUN)throw u;(i=u).baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(l){if(l.code===o.Logger.errors.BUFFER_OVERRUN)throw l;(i=l).baseType=e.name,i.name=e.localName,i.type=e.type}void 0!=i&&r.push(i)});let i=e.reduce((t,e)=>{let r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t},{});e.forEach((t,e)=>{let n=t.localName;if(!n||1!==i[n]||("length"===n&&(n="_length"),null!=r[n]))return;let o=r[e];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get(){throw o}}):r[n]=o});for(let s=0;s=0?e:"")+"]",i=-1===e||t.dynamic;super("array",n,r,i),this.coder=t,this.length=e}defaultValue(){let t=this.coder.defaultValue(),e=[];for(let r=0;rt._data.length&&c.throwError("insufficient data length",o.Logger.errors.BUFFER_OVERRUN,{length:t._data.length,count:e});let r=[];for(let n=0;n{t.dynamic&&(r=!0),n.push(t.type)});let i="tuple("+n.join(",")+")";super("tuple",i,e,r),this.coders=t}defaultValue(){let t=[];this.coders.forEach(e=>{t.push(e.defaultValue())});let e=this.coders.reduce((t,e)=>{let r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t},{});return this.coders.forEach((r,n)=>{let i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))}),Object.freeze(t)}encode(t,e){return f(t,this.coders,e)}decode(t){return t.coerce(this.name,d(t,this.coders))}}var _=r(11388);let x=new o.Logger(s.i),P=RegExp(/^bytes([0-9]*)$/),C=RegExp(/^(u?int)([0-9]*)$/);class O{constructor(t){(0,i.defineReadOnly)(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new l(t.name);case"bool":return new m(t.name);case"string":return new S(t.name);case"bytes":return new y(t.name);case"array":return new p(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new M((t.components||[]).map(t=>this._getCoder(t)),t.name);case"":return new b(t.name)}let e=t.type.match(C);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&x.throwArgumentError("invalid "+e[1]+" bit length","param",t),new E(r/8,"int"===e[1],t.name)}if(e=t.type.match(P)){let n=parseInt(e[1]);return(0===n||n>32)&&x.throwArgumentError("invalid bytes length","param",t),new v(n,t.name)}return x.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new a.Ej(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new a.QV(this._getWordSize())}getDefaultValue(t){let e=t.map(t=>this._getCoder(_._R.from(t))),r=new M(e,"_");return r.defaultValue()}encode(t,e){t.length!==e.length&&x.throwError("types/values length mismatch",o.Logger.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});let r=t.map(t=>this._getCoder(_._R.from(t))),n=new M(r,"_"),i=this._getWriter();return n.encode(i,e),i.data}decode(t,e,r){let i=t.map(t=>this._getCoder(_._R.from(t))),o=new M(i,"_");return o.decode(this._getReader((0,n.arrayify)(e),r))}}let R=new O},61184:function(t,e,r){"use strict";r.d(e,{BR:function(){return l},Ej:function(){return f},QV:function(){return c},XI:function(){return h}});var n=r(16441),i=r(2593),o=r(6881),s=r(1581),a=r(95851);let u=new s.Logger(a.i);function l(t){let e=[],r=function(t,n){if(Array.isArray(n))for(let i in n){let o=t.slice();o.push(i);try{r(o,n[i])}catch(s){e.push({path:o,error:s})}}};return r([],t),e}class h{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){u.throwArgumentError(t,this.localName,e)}}class c{constructor(t){(0,o.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return(0,n.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData((0,n.concat)(t._data))}writeBytes(t){let e=(0,n.arrayify)(t),r=e.length%this.wordSize;return r&&(e=(0,n.concat)([e,this._padding.slice(r)])),this._writeData(e)}_getValue(t){let e=(0,n.arrayify)(i.O$.from(t));return e.length>this.wordSize&&u.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=(0,n.concat)([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){let t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class f{constructor(t,e,r,i){(0,o.defineReadOnly)(this,"_data",(0,n.arrayify)(t)),(0,o.defineReadOnly)(this,"wordSize",e||32),(0,o.defineReadOnly)(this,"_coerceFunc",r),(0,o.defineReadOnly)(this,"allowLoose",i),this._offset=0}get data(){return(0,n.hexlify)(this._data)}get consumed(){return this._offset}static coerce(t,e){let r=t.match("^u?int([0-9]+)$");return r&&48>=parseInt(r[1])&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):f.coerce(t,e)}_peekBytes(t,e,r){let n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:u.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new f(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}readValue(){return i.O$.from(this.readBytes(this.wordSize))}}},11388:function(t,e,r){"use strict";r.d(e,{HY:function(){return y},IC:function(){return M},QV:function(){return v},Xg:function(){return E},YW:function(){return k},_R:function(){return m},pc:function(){return d}});var n=r(2593),i=r(6881),o=r(1581),s=r(95851);let a=new o.Logger(s.i),u={},l={calldata:!0,memory:!0,storage:!0},h={calldata:!0,memory:!0};function c(t,e){if("bytes"===t||"string"===t){if(l[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&h[e])return!0;return(l[e]||"payable"===e)&&a.throwArgumentError("invalid modifier","name",e),!1}function f(t,e){for(let r in e)(0,i.defineReadOnly)(t,r,e[r])}let d=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=RegExp(/^(.*)\[([0-9]*)\]$/);class m{constructor(t,e){t!==u&&a.throwError("use fromString",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),f(this,e);let r=this.type.match(p);r?f(this,{arrayLength:parseInt(r[2]||"-1"),arrayChildren:m.fromObject({type:r[1],components:this.components}),baseType:"array"}):f(this,{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map(e=>JSON.parse(e.format(t)))),JSON.stringify(e)}let r="";return"array"===this.baseType?r+=this.arrayChildren.format(t)+"["+(this.arrayLength<0?"":String(this.arrayLength))+"]":"tuple"===this.baseType?(t!==d.sighash&&(r+=this.type),r+="("+this.components.map(e=>e.format(t)).join(t===d.full?", ":",")+")"):r+=this.type,t!==d.sighash&&(!0===this.indexed&&(r+=" indexed"),t===d.full&&this.name&&(r+=" "+this.name)),r}static from(t,e){return"string"==typeof t?m.fromString(t,e):m.fromObject(t)}static fromObject(t){return m.isParamType(t)?t:new m(u,{name:t.name||null,type:_(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(m.fromObject):null})}static fromString(t,e){var r;return r=function(t,e){let r=t;function n(e){a.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function i(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let u=0;um.fromString(t,e))}class y{constructor(t,e){t!==u&&a.throwError("use a static from method",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return y.isFragment(t)?t:"string"==typeof t?y.fromString(t):y.fromObject(t)}static fromObject(t){if(y.isFragment(t))return t;switch(t.type){case"function":return k.fromObject(t);case"event":return v.fromObject(t);case"constructor":return E.fromObject(t);case"error":return M.fromObject(t);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?v.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?k.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?E.fromString(t.trim()):"error"===t.split(" ")[0]?M.fromString(t.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!!(t&&t._isFragment)}}class v extends y{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(e=>JSON.parse(e.format(t)))});let e="";return t!==d.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map(e=>e.format(t)).join(t===d.full?", ":",")+") ",t!==d.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?v.fromString(t):v.fromObject(t)}static fromObject(t){if(v.isEventFragment(t))return t;"event"!==t.type&&a.throwArgumentError("invalid event object","value",t);let e={name:P(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(m.fromObject):[],type:"event"};return new v(u,e)}static fromString(t){let e=t.match(C);e||a.throwArgumentError("invalid event string","value",t);let r=!1;return e[3].split(" ").forEach(t=>{switch(t.trim()){case"anonymous":r=!0;break;case"":break;default:a.warn("unknown modifier: "+t)}}),v.fromObject({name:e[1].trim(),anonymous:r,inputs:g(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function b(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=n.O$.from(r[1]),r[0]):t}function w(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}})}function A(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&a.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&a.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||a.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&a.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&a.throwArgumentError("unable to determine stateMutability","value",t),e}class E extends y{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(e=>JSON.parse(e.format(t)))});t===d.sighash&&a.throwError("cannot format a constructor for sighash",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map(e=>e.format(t)).join(t===d.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?E.fromString(t):E.fromObject(t)}static fromObject(t){if(E.isConstructorFragment(t))return t;"constructor"!==t.type&&a.throwArgumentError("invalid constructor object","value",t);let e=A(t);e.constant&&a.throwArgumentError("constructor cannot be constant","value",t);let r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(m.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new E(u,r)}static fromString(t){let e={type:"constructor"},r=(t=b(t,e)).match(C);return r&&"constructor"===r[1].trim()||a.throwArgumentError("invalid constructor string","value",t),e.inputs=g(r[2].trim(),!1),w(r[3].trim(),e),E.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class k extends E{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(e=>JSON.parse(e.format(t))),outputs:this.outputs.map(e=>JSON.parse(e.format(t)))});let e="";return t!==d.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map(e=>e.format(t)).join(t===d.full?", ":",")+") ",t!==d.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map(e=>e.format(t)).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?k.fromString(t):k.fromObject(t)}static fromObject(t){if(k.isFunctionFragment(t))return t;"function"!==t.type&&a.throwArgumentError("invalid function object","value",t);let e=A(t),r={type:t.type,name:P(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(m.fromObject):[],outputs:t.outputs?t.outputs.map(m.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?n.O$.from(t.gas):null};return new k(u,r)}static fromString(t){let e={type:"function"},r=(t=b(t,e)).split(" returns ");r.length>2&&a.throwArgumentError("invalid function string","value",t);let n=r[0].match(C);if(n||a.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&P(e.name),e.inputs=g(n[2],!1),w(n[3].trim(),e),r.length>1){let i=r[1].match(C);(""!=i[1].trim()||""!=i[3].trim())&&a.throwArgumentError("unexpected tokens","value",t),e.outputs=g(i[2],!1)}else e.outputs=[];return k.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function S(t){let e=t.format();return("Error(string)"===e||"Panic(uint256)"===e)&&a.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class M extends y{format(t){if(t||(t=d.sighash),d[t]||a.throwArgumentError("invalid format type","format",t),t===d.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(e=>JSON.parse(e.format(t)))});let e="";return t!==d.sighash&&(e+="error "),(e+=this.name+"("+this.inputs.map(e=>e.format(t)).join(t===d.full?", ":",")+") ").trim()}static from(t){return"string"==typeof t?M.fromString(t):M.fromObject(t)}static fromObject(t){if(M.isErrorFragment(t))return t;"error"!==t.type&&a.throwArgumentError("invalid error object","value",t);let e={type:t.type,name:P(t.name),inputs:t.inputs?t.inputs.map(m.fromObject):[]};return S(new M(u,e))}static fromString(t){let e={type:"error"},r=t.match(C);return r||a.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&P(e.name),e.inputs=g(r[2],!1),S(M.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function _(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}let x=RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function P(t){return t&&t.match(x)||a.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}let C=RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},83893:function(t,e,r){"use strict";r.r(e),r.d(e,{AbiCoder:function(){return i.R},ConstructorFragment:function(){return n.Xg},ErrorFragment:function(){return n.IC},EventFragment:function(){return n.QV},FormatTypes:function(){return n.pc},Fragment:function(){return n.HY},FunctionFragment:function(){return n.YW},Indexed:function(){return o.Hk},Interface:function(){return o.vU},LogDescription:function(){return o.CC},ParamType:function(){return n._R},TransactionDescription:function(){return o.vk},checkResultErrors:function(){return s.BR},defaultAbiCoder:function(){return i.$}});var n=r(11388),i=r(84243),o=r(8198),s=r(61184)},8198:function(t,e,r){"use strict";r.d(e,{CC:function(){return p},Hk:function(){return y},vU:function(){return w},vk:function(){return m}});var n=r(19485),i=r(2593),o=r(16441),s=r(32046),a=r(38197),u=r(6881),l=r(84243),h=r(11388),c=r(1581),f=r(95851);let d=new c.Logger(f.i);class p extends u.Description{}class m extends u.Description{}class g extends u.Description{}class y extends u.Description{static isIndexed(t){return!!(t&&t._isIndexed)}}let v={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function b(t,e){let r=Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class w{constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,(0,u.defineReadOnly)(this,"fragments",e.map(t=>h.HY.from(t)).filter(t=>null!=t)),(0,u.defineReadOnly)(this,"_abiCoder",(0,u.getStatic)(new.target,"getAbiCoder")()),(0,u.defineReadOnly)(this,"functions",{}),(0,u.defineReadOnly)(this,"errors",{}),(0,u.defineReadOnly)(this,"events",{}),(0,u.defineReadOnly)(this,"structs",{}),this.fragments.forEach(t=>{let e=null;switch(t.type){case"constructor":if(this.deploy){d.warn("duplicate definition - constructor");return}(0,u.defineReadOnly)(this,"deploy",t);return;case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let r=t.format();if(e[r]){d.warn("duplicate definition - "+r);return}e[r]=t}),this.deploy||(0,u.defineReadOnly)(this,"deploy",h.Xg.from({payable:!1,type:"constructor"})),(0,u.defineReadOnly)(this,"_isInterface",!0)}format(t){t||(t=h.pc.full),t===h.pc.sighash&&d.throwArgumentError("interface does not support formatting sighash","format",t);let e=this.fragments.map(e=>e.format(t));return t===h.pc.json?JSON.stringify(e.map(t=>JSON.parse(t))):e}static getAbiCoder(){return l.$}static getAddress(t){return(0,n.getAddress)(t)}static getSighash(t){return(0,o.hexDataSlice)((0,s.id)(t.format()),0,4)}static getEventTopic(t){return(0,s.id)(t.format())}getFunction(t){if((0,o.isHexString)(t)){for(let e in this.functions)if(t===this.getSighash(e))return this.functions[e];d.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){let r=t.trim(),n=Object.keys(this.functions).filter(t=>t.split("(")[0]===r);return 0===n.length?d.throwArgumentError("no matching function","name",r):n.length>1&&d.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}let i=this.functions[h.YW.fromString(t).format()];return i||d.throwArgumentError("no matching function","signature",t),i}getEvent(t){if((0,o.isHexString)(t)){let e=t.toLowerCase();for(let r in this.events)if(e===this.getEventTopic(r))return this.events[r];d.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){let n=t.trim(),i=Object.keys(this.events).filter(t=>t.split("(")[0]===n);return 0===i.length?d.throwArgumentError("no matching event","name",n):i.length>1&&d.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}let s=this.events[h.QV.fromString(t).format()];return s||d.throwArgumentError("no matching event","signature",t),s}getError(t){if((0,o.isHexString)(t)){let e=(0,u.getStatic)(this.constructor,"getSighash");for(let r in this.errors){let n=this.errors[r];if(t===e(n))return this.errors[r]}d.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){let i=t.trim(),s=Object.keys(this.errors).filter(t=>t.split("(")[0]===i);return 0===s.length?d.throwArgumentError("no matching error","name",i):s.length>1&&d.throwArgumentError("multiple matching errors","name",i),this.errors[s[0]]}let a=this.errors[h.YW.fromString(t).format()];return a||d.throwArgumentError("no matching error","signature",t),a}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(r){try{t=this.getError(t)}catch(e){throw r}}return(0,u.getStatic)(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),(0,u.getStatic)(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));let r=(0,o.arrayify)(e);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(t)&&d.throwArgumentError(`data signature does not match error ${t.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),(0,o.hexlify)((0,o.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=(0,o.arrayify)(e);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(t)&&d.throwArgumentError(`data signature does not match function ${t.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,o.hexlify)((0,o.concat)([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=(0,o.arrayify)(e),n=null,i="",s=null,a=null,u=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(l){}break;case 4:{let h=(0,o.hexlify)(r.slice(0,4)),f=v[h];if(f)s=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,u=f.signature,f.reason&&(n=s[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{let p=this.getError(h);s=this._abiCoder.decode(p.inputs,r.slice(4)),a=p.name,u=p.format()}catch(m){}}}return d.throwError("call revert exception"+i,c.Logger.errors.CALL_EXCEPTION,{method:t.format(),data:(0,o.hexlify)(e),errorArgs:s,errorName:a,errorSignature:u,reason:n})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),(0,o.hexlify)(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&d.throwError("too many arguments for "+t.format(),c.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));let n=(t,e)=>"string"===t.type?(0,s.id)(e):"bytes"===t.type?(0,a.keccak256)((0,o.hexlify)(e)):("bool"===t.type&&"boolean"==typeof e&&(e=e?"0x01":"0x00"),t.type.match(/^u?int/)&&(e=i.O$.from(e).toHexString()),"address"===t.type&&this._abiCoder.encode(["address"],[e]),(0,o.hexZeroPad)((0,o.hexlify)(e),32));for(e.forEach((e,i)=>{let o=t.inputs[i];if(!o.indexed){null!=e&&d.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e);return}null==e?r.push(null):"array"===o.baseType||"tuple"===o.baseType?d.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?r.push(e.map(t=>n(o,t))):r.push(n(o,e))});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));let r=[],n=[],i=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&d.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach((t,o)=>{let u=e[o];if(t.indexed){if("string"===t.type)r.push((0,s.id)(u));else if("bytes"===t.type)r.push((0,a.keccak256)(u));else if("tuple"===t.baseType||"array"===t.baseType)throw Error("not implemented");else r.push(this._abiCoder.encode([t.type],[u]))}else n.push(t),i.push(u)}),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){let n=this.getEventTopic(t);(0,o.isHexString)(r[0],32)&&r[0].toLowerCase()===n||d.throwError("fragment/topic mismatch",c.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}let i=[],s=[],a=[];t.inputs.forEach((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(i.push(h._R.fromObject({type:"bytes32",name:t.name})),a.push(!0)):(i.push(t),a.push(!1)):(s.push(t),a.push(!1))});let u=null!=r?this._abiCoder.decode(i,(0,o.concat)(r)):null,l=this._abiCoder.decode(s,e,!0),f=[],p=0,m=0;t.inputs.forEach((t,e)=>{if(t.indexed){if(null==u)f[e]=new y({_isIndexed:!0,hash:null});else if(a[e])f[e]=new y({_isIndexed:!0,hash:u[m++]});else try{f[e]=u[m++]}catch(r){f[e]=r}}else try{f[e]=l[p++]}catch(n){f[e]=n}if(t.name&&null==f[t.name]){let i=f[e];i instanceof Error?Object.defineProperty(f,t.name,{enumerable:!0,get(){throw b(`property ${JSON.stringify(t.name)}`,i)}}):f[t.name]=i}});for(let g=0;gnull)}),r=null,o=null,s=null;return t&&t.baseFeePerGas&&(r=t.baseFeePerGas,s=n.O$.from("1500000000"),o=t.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:r,maxFeePerGas:o,maxPriorityFeePerGas:s,gasPrice:e}},new(r||(r=Promise))(function(n,i){function s(t){try{u(o.next(t))}catch(e){i(e)}}function a(t){try{u(o.throw(t))}catch(e){i(e)}}function u(t){var e;t.done?n(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((o=o.apply(t,e||[])).next())})}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!!(t&&t._isProvider)}}},48088:function(t,e,r){"use strict";r.r(e),r.d(e,{Signer:function(){return l},VoidSigner:function(){return h}});var n=r(6881),i=r(1581),o=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let s=new i.Logger("abstract-signer/5.7.0"),a=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],u=[i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED];class l{constructor(){s.checkAbstract(new.target,l),(0,n.defineReadOnly)(this,"_isSigner",!0)}getBalance(t){return o(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)})}getTransactionCount(t){return o(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)})}estimateGas(t){return o(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let e=yield(0,n.resolveProperties)(this.checkTransaction(t));return yield this.provider.estimateGas(e)})}call(t,e){return o(this,void 0,void 0,function*(){this._checkProvider("call");let r=yield(0,n.resolveProperties)(this.checkTransaction(t));return yield this.provider.call(r,e)})}sendTransaction(t){return o(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let e=yield this.populateTransaction(t),r=yield this.signTransaction(e);return yield this.provider.sendTransaction(r)})}getChainId(){return o(this,void 0,void 0,function*(){this._checkProvider("getChainId");let t=yield this.provider.getNetwork();return t.chainId})}getGasPrice(){return o(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return o(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(t){return o(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)})}checkTransaction(t){for(let e in t)-1===a.indexOf(e)&&s.throwArgumentError("invalid transaction key: "+e,"transaction",t);let r=(0,n.shallowCopy)(t);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&s.throwArgumentError("from address mismatch","transaction",t),e[0])),r}populateTransaction(t){return o(this,void 0,void 0,function*(){let e=yield(0,n.resolveProperties)(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then(t=>o(this,void 0,void 0,function*(){if(null==t)return null;let e=yield this.resolveName(t);return null==e&&s.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})),e.to.catch(t=>{}));let r=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null!=e.gasPrice&&(2===e.type||r)?s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t):(0===e.type||1===e.type)&&r&&s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t),(2===e.type||null==e.type)&&null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)e.type=2;else if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{let a=yield this.getFeeData();if(null==e.type){if(null!=a.maxFeePerGas&&null!=a.maxPriorityFeePerGas){if(e.type=2,null!=e.gasPrice){let l=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=l,e.maxPriorityFeePerGas=l}else null==e.maxFeePerGas&&(e.maxFeePerGas=a.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=a.maxPriorityFeePerGas)}else null!=a.gasPrice?(r&&s.throwError("network does not support EIP-1559",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=a.gasPrice),e.type=0):s.throwError("failed to get consistent fee data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"})}else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=a.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch(t=>{if(u.indexOf(t.code)>=0)throw t;return s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})})),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then(e=>(0!==e[1]&&e[0]!==e[1]&&s.throwArgumentError("chainId address mismatch","transaction",t),e[0])),yield(0,n.resolveProperties)(e)})}_checkProvider(t){this.provider||s.throwError("missing provider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!!(t&&t._isSigner)}}class h extends l{constructor(t,e){super(),(0,n.defineReadOnly)(this,"address",t),(0,n.defineReadOnly)(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then(()=>{s.throwError(t,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new h(this.address,t)}}},19485:function(t,e,r){"use strict";r.r(e),r.d(e,{getAddress:function(){return m},getContractAddress:function(){return v},getCreate2Address:function(){return b},getIcapAddress:function(){return y},isAddress:function(){return g}});var n=r(16441),i=r(2593),o=r(38197),s=r(59052),a=r(1581);let u=new a.Logger("address/5.7.0");function l(t){(0,n.isHexString)(t,20)||u.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);let s=(0,n.arrayify)((0,o.keccak256)(r));for(let a=0;a<40;a+=2)s[a>>1]>>4>=8&&(e[a]=e[a].toUpperCase()),(15&s[a>>1])>=8&&(e[a+1]=e[a+1].toUpperCase());return"0x"+e.join("")}let h={};for(let c=0;c<10;c++)h[String(c)]=String(c);for(let f=0;f<26;f++)h[String.fromCharCode(65+f)]=String(10+f);let d=Math.floor(Math.log10?Math.log10(9007199254740991):Math.log(9007199254740991)/Math.LN10);function p(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map(t=>h[t]).join("");for(;e.length>=d;){let r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}function m(t){let e=null;if("string"!=typeof t&&u.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=l(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwArgumentError("bad icap checksum","address",t),e=(0,i.g$)(t.substring(4));e.length<40;)e="0"+e;e=l("0x"+e)}else u.throwArgumentError("invalid address","address",t);return e}function g(t){try{return m(t),!0}catch(e){}return!1}function y(t){let e=(0,i.t2)(m(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e}function v(t){let e=null;try{e=m(t.from)}catch(r){u.throwArgumentError("missing from address","transaction",t)}let a=(0,n.stripZeros)((0,n.arrayify)(i.O$.from(t.nonce).toHexString()));return m((0,n.hexDataSlice)((0,o.keccak256)((0,s.encode)([e,a])),12))}function b(t,e,r){return 32!==(0,n.hexDataLength)(e)&&u.throwArgumentError("salt must be 32 bytes","salt",e),32!==(0,n.hexDataLength)(r)&&u.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),m((0,n.hexDataSlice)((0,o.keccak256)((0,n.concat)(["0xff",m(t),e,r])),12))}},59567:function(t,e,r){"use strict";r.d(e,{J:function(){return i},c:function(){return o}});var n=r(16441);function i(t){t=atob(t);let e=[];for(let r=0;r0;)r.push(o%this.base),o=o/this.base|0}let a="";for(let u=0;0===e[u]&&u=0;--l)a+=this.alphabet[r[l]];return a}decode(t){if("string"!=typeof t)throw TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let r=0;r>=8;for(;o>0;)e.push(255&o),o>>=8}for(let a=0;t[a]===this._leader&&a0&&(10===arguments[0]?f||(f=!0,l.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?l.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):l.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof d)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new d(h,p(t)):t.match(/^-?[0-9]+$/)?new d(h,p(new u(t))):l.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&y("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&y("overflow","BigNumber.from",t),d.from(String(t));if("bigint"==typeof t)return d.from(t.toString());if((0,o.isBytes)(t))return d.from((0,o.hexlify)(t));if(t){if(t.toHexString){let e=t.toHexString();if("string"==typeof e)return d.from(e)}else{let r=t._hex;if(null==r&&"BigNumber"===t.type&&(r=t.hex),"string"==typeof r&&((0,o.isHexString)(r)||"-"===r[0]&&(0,o.isHexString)(r.substring(1))))return d.from(r)}}return l.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function p(t){if("string"!=typeof t)return p(t.toString(16));if("-"===t[0])return("-"===(t=t.substring(1))[0]&&l.throwArgumentError("invalid hex","value",t),"0x00"===(t=p(t)))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function m(t){return d.from(p(t))}function g(t){let e=d.from(t).toHexString();return"-"===e[0]?new u("-"+e.substring(3),16):new u(e.substring(2),16)}function y(t,e,r){let n={fault:t,operation:e};return null!=r&&(n.value=r),l.throwError(t,s.Logger.errors.NUMERIC_FAULT,n)}function v(t){return new u(t,36).toString(16)}function b(t){return new u(t,16).toString(36)}},20335:function(t,e,r){"use strict";r.d(e,{Ox:function(){return m},S5:function(){return p},xO:function(){return g},xs:function(){return y}});var n=r(16441),i=r(1581),o=r(48794),s=r(2593);let a=new i.Logger(o.i),u={},l=s.O$.from(0),h=s.O$.from(-1);function c(t,e,r,n){let o={fault:e,operation:r};return void 0!==n&&(o.value=n),a.throwError(t,i.Logger.errors.NUMERIC_FAULT,o)}let f="0";for(;f.length<256;)f+=f;function d(t){if("number"!=typeof t)try{t=s.O$.from(t).toNumber()}catch(e){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+f.substring(0,t):a.throwArgumentError("invalid decimal size","decimals",t)}function p(t,e){null==e&&(e=0);let r=d(e);t=s.O$.from(t);let n=t.lt(l);n&&(t=t.mul(h));let i=t.mod(r).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",t);let o=i[0],u=i[1];for(o||(o="0"),u||(u="0");"0"===u[u.length-1];)u=u.substring(0,u.length-1);for(u.length>r.length-1&&c("fractional component exceeds decimals","underflow","parseFixed"),""===u&&(u="0");u.lengthnull==t[e]?n:(typeof t[e]!==r&&a.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=o("signed","boolean",e),r=o("width","number",r),n=o("decimals","number",n)}return r%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new g(u,e,r,n)}}class y{constructor(t,e,r,n){t!==u&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);let e=m(this._value,this.format.decimals),r=m(t._value,t.format.decimals);return y.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);let e=m(this._value,this.format.decimals),r=m(t._value,t.format.decimals);return y.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);let e=m(this._value,this.format.decimals),r=m(t._value,t.format.decimals);return y.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);let e=m(this._value,this.format.decimals),r=m(t._value,t.format.decimals);return y.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=y.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(v.toFormat(e.format))),e}ceiling(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=y.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(v.toFormat(e.format))),e}round(t){null==t&&(t=0);let e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&a.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;let r=y.from("1"+f.substring(0,t),this.format),n=b.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){if(null==t)return this._hex;t%8&&a.throwArgumentError("invalid byte width","width",t);let e=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return(0,n.hexZeroPad)(e,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return y.fromString(this._value,t)}static fromValue(t,e,r){return null!=r||null==e||(0,s.Zm)(e)||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),y.fromString(p(t,e),g.from(r))}static fromString(t,e){null==e&&(e="fixed");let r=g.from(e),i=m(t,r.decimals);!r.signed&&i.lt(l)&&c("unsigned value cannot be negative","overflow","value",t);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=(0,n.hexZeroPad)(o,r.width/8));let s=p(i,r.decimals);return new y(u,o,s,r)}static fromBytes(t,e){null==e&&(e="fixed");let r=g.from(e);if((0,n.arrayify)(t).length>r.width/8)throw Error("overflow");let i=s.O$.from(t);r.signed&&(i=i.fromTwos(r.width));let o=i.toTwos((r.signed?0:1)+r.width).toHexString(),a=p(i,r.decimals);return new y(u,o,a,r)}static from(t,e){if("string"==typeof t)return y.fromString(t,e);if((0,n.isBytes)(t))return y.fromBytes(t,e);try{return y.fromValue(t,0,e)}catch(r){if(r.code!==i.Logger.errors.INVALID_ARGUMENT)throw r}return a.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}let v=y.from(1),b=y.from("0.5")},833:function(t,e,r){"use strict";r.r(e),r.d(e,{BigNumber:function(){return n.O$},FixedFormat:function(){return i.xO},FixedNumber:function(){return i.xs},_base16To36:function(){return n.t2},_base36To16:function(){return n.g$},formatFixed:function(){return i.S5},parseFixed:function(){return i.Ox}});var n=r(2593),i=r(20335)},83877:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{d="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(88677).Buffer}catch(s){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function l(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?t:e},o.min=function(t,e){return 0>t.cmp(e)?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[i]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(s=0,i=0;s>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var n,i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(c){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d,p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var l=1;l>>26,c=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var r,i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?p[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=m[t],h=g[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var f=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?f+r:p[l-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},d&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(d,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var e,r,n,i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&n;for(;0!==o&&s>26,this.words[s]=67108863&n;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,E=0|s[4],k=8191&E,S=E>>>13,M=0|s[5],_=8191&M,x=M>>>13,P=0|s[6],C=8191&P,O=P>>>13,R=0|s[7],N=8191&R,I=R>>>13,T=0|s[8],B=8191&T,L=T>>>13,F=0|s[9],D=8191&F,U=F>>>13,j=0|a[0],q=8191&j,K=j>>>13,G=0|a[1],z=8191&G,H=G>>>13,Q=0|a[2],W=8191&Q,J=Q>>>13,V=0|a[3],Z=8191&V,Y=V>>>13,$=0|a[4],X=8191&$,tt=$>>>13,te=0|a[5],tr=8191&te,tn=te>>>13,ti=0|a[6],to=8191&ti,ts=ti>>>13,ta=0|a[7],tu=8191&ta,tl=ta>>>13,th=0|a[8],tc=8191&th,tf=th>>>13,td=0|a[9],tp=8191&td,tm=td>>>13;r.negative=t.negative^e.negative,r.length=19;var tg=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,K))+Math.imul(f,q)|0))<<13)|0;l=((o=Math.imul(f,K))+(i>>>13)|0)+(tg>>>26)|0,tg&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,K))+Math.imul(m,q)|0,o=Math.imul(m,K);var ty=(l+(n=n+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(f,z)|0))<<13)|0;l=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(ty>>>26)|0,ty&=67108863,n=Math.imul(y,q),i=(i=Math.imul(y,K))+Math.imul(v,q)|0,o=Math.imul(v,K),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,H)|0;var tv=(l+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(f,W)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(tv>>>26)|0,tv&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,K))+Math.imul(A,q)|0,o=Math.imul(A,K),n=n+Math.imul(y,z)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0;var tb=(l+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(tb>>>26)|0,tb&=67108863,n=Math.imul(k,q),i=(i=Math.imul(k,K))+Math.imul(S,q)|0,o=Math.imul(S,K),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,H)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var tw=(l+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(tw>>>26)|0,tw&=67108863,n=Math.imul(_,q),i=(i=Math.imul(_,K))+Math.imul(x,q)|0,o=Math.imul(x,K),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(S,z)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,tt)|0;var tA=(l+(n=n+Math.imul(c,tr)|0)|0)+((8191&(i=(i=i+Math.imul(c,tn)|0)+Math.imul(f,tr)|0))<<13)|0;l=((o=o+Math.imul(f,tn)|0)+(i>>>13)|0)+(tA>>>26)|0,tA&=67108863,n=Math.imul(C,q),i=(i=Math.imul(C,K))+Math.imul(O,q)|0,o=Math.imul(O,K),n=n+Math.imul(_,z)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,tr)|0,i=(i=i+Math.imul(p,tn)|0)+Math.imul(m,tr)|0,o=o+Math.imul(m,tn)|0;var tE=(l+(n=n+Math.imul(c,to)|0)|0)+((8191&(i=(i=i+Math.imul(c,ts)|0)+Math.imul(f,to)|0))<<13)|0;l=((o=o+Math.imul(f,ts)|0)+(i>>>13)|0)+(tE>>>26)|0,tE&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,K))+Math.imul(I,q)|0,o=Math.imul(I,K),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(y,tr)|0,i=(i=i+Math.imul(y,tn)|0)+Math.imul(v,tr)|0,o=o+Math.imul(v,tn)|0,n=n+Math.imul(p,to)|0,i=(i=i+Math.imul(p,ts)|0)+Math.imul(m,to)|0,o=o+Math.imul(m,ts)|0;var tk=(l+(n=n+Math.imul(c,tu)|0)|0)+((8191&(i=(i=i+Math.imul(c,tl)|0)+Math.imul(f,tu)|0))<<13)|0;l=((o=o+Math.imul(f,tl)|0)+(i>>>13)|0)+(tk>>>26)|0,tk&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(L,q)|0,o=Math.imul(L,K),n=n+Math.imul(N,z)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,tr)|0,i=(i=i+Math.imul(w,tn)|0)+Math.imul(A,tr)|0,o=o+Math.imul(A,tn)|0,n=n+Math.imul(y,to)|0,i=(i=i+Math.imul(y,ts)|0)+Math.imul(v,to)|0,o=o+Math.imul(v,ts)|0,n=n+Math.imul(p,tu)|0,i=(i=i+Math.imul(p,tl)|0)+Math.imul(m,tu)|0,o=o+Math.imul(m,tl)|0;var tS=(l+(n=n+Math.imul(c,tc)|0)|0)+((8191&(i=(i=i+Math.imul(c,tf)|0)+Math.imul(f,tc)|0))<<13)|0;l=((o=o+Math.imul(f,tf)|0)+(i>>>13)|0)+(tS>>>26)|0,tS&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,K))+Math.imul(U,q)|0,o=Math.imul(U,K),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,H)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,tr)|0,i=(i=i+Math.imul(k,tn)|0)+Math.imul(S,tr)|0,o=o+Math.imul(S,tn)|0,n=n+Math.imul(w,to)|0,i=(i=i+Math.imul(w,ts)|0)+Math.imul(A,to)|0,o=o+Math.imul(A,ts)|0,n=n+Math.imul(y,tu)|0,i=(i=i+Math.imul(y,tl)|0)+Math.imul(v,tu)|0,o=o+Math.imul(v,tl)|0,n=n+Math.imul(p,tc)|0,i=(i=i+Math.imul(p,tf)|0)+Math.imul(m,tc)|0,o=o+Math.imul(m,tf)|0;var tM=(l+(n=n+Math.imul(c,tp)|0)|0)+((8191&(i=(i=i+Math.imul(c,tm)|0)+Math.imul(f,tp)|0))<<13)|0;l=((o=o+Math.imul(f,tm)|0)+(i>>>13)|0)+(tM>>>26)|0,tM&=67108863,n=Math.imul(D,z),i=(i=Math.imul(D,H))+Math.imul(U,z)|0,o=Math.imul(U,H),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(_,tr)|0,i=(i=i+Math.imul(_,tn)|0)+Math.imul(x,tr)|0,o=o+Math.imul(x,tn)|0,n=n+Math.imul(k,to)|0,i=(i=i+Math.imul(k,ts)|0)+Math.imul(S,to)|0,o=o+Math.imul(S,ts)|0,n=n+Math.imul(w,tu)|0,i=(i=i+Math.imul(w,tl)|0)+Math.imul(A,tu)|0,o=o+Math.imul(A,tl)|0,n=n+Math.imul(y,tc)|0,i=(i=i+Math.imul(y,tf)|0)+Math.imul(v,tc)|0,o=o+Math.imul(v,tf)|0;var t_=(l+(n=n+Math.imul(p,tp)|0)|0)+((8191&(i=(i=i+Math.imul(p,tm)|0)+Math.imul(m,tp)|0))<<13)|0;l=((o=o+Math.imul(m,tm)|0)+(i>>>13)|0)+(t_>>>26)|0,t_&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,J))+Math.imul(U,W)|0,o=Math.imul(U,J),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(C,tr)|0,i=(i=i+Math.imul(C,tn)|0)+Math.imul(O,tr)|0,o=o+Math.imul(O,tn)|0,n=n+Math.imul(_,to)|0,i=(i=i+Math.imul(_,ts)|0)+Math.imul(x,to)|0,o=o+Math.imul(x,ts)|0,n=n+Math.imul(k,tu)|0,i=(i=i+Math.imul(k,tl)|0)+Math.imul(S,tu)|0,o=o+Math.imul(S,tl)|0,n=n+Math.imul(w,tc)|0,i=(i=i+Math.imul(w,tf)|0)+Math.imul(A,tc)|0,o=o+Math.imul(A,tf)|0;var tx=(l+(n=n+Math.imul(y,tp)|0)|0)+((8191&(i=(i=i+Math.imul(y,tm)|0)+Math.imul(v,tp)|0))<<13)|0;l=((o=o+Math.imul(v,tm)|0)+(i>>>13)|0)+(tx>>>26)|0,tx&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(N,tr)|0,i=(i=i+Math.imul(N,tn)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,tn)|0,n=n+Math.imul(C,to)|0,i=(i=i+Math.imul(C,ts)|0)+Math.imul(O,to)|0,o=o+Math.imul(O,ts)|0,n=n+Math.imul(_,tu)|0,i=(i=i+Math.imul(_,tl)|0)+Math.imul(x,tu)|0,o=o+Math.imul(x,tl)|0,n=n+Math.imul(k,tc)|0,i=(i=i+Math.imul(k,tf)|0)+Math.imul(S,tc)|0,o=o+Math.imul(S,tf)|0;var tP=(l+(n=n+Math.imul(w,tp)|0)|0)+((8191&(i=(i=i+Math.imul(w,tm)|0)+Math.imul(A,tp)|0))<<13)|0;l=((o=o+Math.imul(A,tm)|0)+(i>>>13)|0)+(tP>>>26)|0,tP&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,tt))+Math.imul(U,X)|0,o=Math.imul(U,tt),n=n+Math.imul(B,tr)|0,i=(i=i+Math.imul(B,tn)|0)+Math.imul(L,tr)|0,o=o+Math.imul(L,tn)|0,n=n+Math.imul(N,to)|0,i=(i=i+Math.imul(N,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,n=n+Math.imul(C,tu)|0,i=(i=i+Math.imul(C,tl)|0)+Math.imul(O,tu)|0,o=o+Math.imul(O,tl)|0,n=n+Math.imul(_,tc)|0,i=(i=i+Math.imul(_,tf)|0)+Math.imul(x,tc)|0,o=o+Math.imul(x,tf)|0;var tC=(l+(n=n+Math.imul(k,tp)|0)|0)+((8191&(i=(i=i+Math.imul(k,tm)|0)+Math.imul(S,tp)|0))<<13)|0;l=((o=o+Math.imul(S,tm)|0)+(i>>>13)|0)+(tC>>>26)|0,tC&=67108863,n=Math.imul(D,tr),i=(i=Math.imul(D,tn))+Math.imul(U,tr)|0,o=Math.imul(U,tn),n=n+Math.imul(B,to)|0,i=(i=i+Math.imul(B,ts)|0)+Math.imul(L,to)|0,o=o+Math.imul(L,ts)|0,n=n+Math.imul(N,tu)|0,i=(i=i+Math.imul(N,tl)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,tl)|0,n=n+Math.imul(C,tc)|0,i=(i=i+Math.imul(C,tf)|0)+Math.imul(O,tc)|0,o=o+Math.imul(O,tf)|0;var tO=(l+(n=n+Math.imul(_,tp)|0)|0)+((8191&(i=(i=i+Math.imul(_,tm)|0)+Math.imul(x,tp)|0))<<13)|0;l=((o=o+Math.imul(x,tm)|0)+(i>>>13)|0)+(tO>>>26)|0,tO&=67108863,n=Math.imul(D,to),i=(i=Math.imul(D,ts))+Math.imul(U,to)|0,o=Math.imul(U,ts),n=n+Math.imul(B,tu)|0,i=(i=i+Math.imul(B,tl)|0)+Math.imul(L,tu)|0,o=o+Math.imul(L,tl)|0,n=n+Math.imul(N,tc)|0,i=(i=i+Math.imul(N,tf)|0)+Math.imul(I,tc)|0,o=o+Math.imul(I,tf)|0;var tR=(l+(n=n+Math.imul(C,tp)|0)|0)+((8191&(i=(i=i+Math.imul(C,tm)|0)+Math.imul(O,tp)|0))<<13)|0;l=((o=o+Math.imul(O,tm)|0)+(i>>>13)|0)+(tR>>>26)|0,tR&=67108863,n=Math.imul(D,tu),i=(i=Math.imul(D,tl))+Math.imul(U,tu)|0,o=Math.imul(U,tl),n=n+Math.imul(B,tc)|0,i=(i=i+Math.imul(B,tf)|0)+Math.imul(L,tc)|0,o=o+Math.imul(L,tf)|0;var tN=(l+(n=n+Math.imul(N,tp)|0)|0)+((8191&(i=(i=i+Math.imul(N,tm)|0)+Math.imul(I,tp)|0))<<13)|0;l=((o=o+Math.imul(I,tm)|0)+(i>>>13)|0)+(tN>>>26)|0,tN&=67108863,n=Math.imul(D,tc),i=(i=Math.imul(D,tf))+Math.imul(U,tc)|0,o=Math.imul(U,tf);var tI=(l+(n=n+Math.imul(B,tp)|0)|0)+((8191&(i=(i=i+Math.imul(B,tm)|0)+Math.imul(L,tp)|0))<<13)|0;l=((o=o+Math.imul(L,tm)|0)+(i>>>13)|0)+(tI>>>26)|0,tI&=67108863;var tT=(l+(n=Math.imul(D,tp))|0)+((8191&(i=(i=Math.imul(D,tm))+Math.imul(U,tp)|0))<<13)|0;return l=((o=Math.imul(U,tm))+(i>>>13)|0)+(tT>>>26)|0,tT&=67108863,u[0]=tg,u[1]=ty,u[2]=tv,u[3]=tb,u[4]=tw,u[5]=tA,u[6]=tE,u[7]=tk,u[8]=tS,u[9]=tM,u[10]=t_,u[11]=tx,u[12]=tP,u[13]=tC,u[14]=tO,u[15]=tR,u[16]=tN,u[17]=tI,u[18]=tT,0!==l&&(u[19]=l,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function w(t,e){this.x=t,this.y=e}Math.imul||(v=y),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,e):n<63?y(this,t,e):b(this,t,e)},w.prototype.makeRBT=function(t){for(var e=Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},w.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=(o/67108864|0)+(s>>>26),this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var i,o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return!(this.length<=r)&&!!(this.words[r]&1<=0);var e=t%26,r=(t-e)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==e&&r++,this.length=Math.min(r,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r,n=this.length-t.length,i=this.clone(),s=t,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),i.iushln(n),a=0|s.words[s.length-1]);var u=i.length-s.length;if("mod"!==e){(r=new o(null)).length=u+1,r.words=Array(r.length);for(var l=0;l=0;c--){var f=(0|i.words[s.length+c])*67108864+(0|i.words[s.length+c-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(s,f,c);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(s,1,c),i.isZero()||(i.negative^=1);r&&(r.words[c]=f)}return r&&r._strip(),i._strip(),"div"!==e&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(t,e,r){var i,s,a;return(n(!t.isZero()),this.isZero())?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e)},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=67108864%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;(e.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e,r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var s=new o(1),a=new o(0),u=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,h=1;(r.words[0]&h)==0&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,f=1;(i.words[0]&f)==0&&c<26;++c,f<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),s.isub(a)):(i.isub(r),a.isub(s))}return 0>(e=0===r.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return -1===this.cmpn(t)},o.prototype.lt=function(t){return -1===this.cmp(t)},o.prototype.lten=function(t){return 0>=this.cmpn(t)},o.prototype.lte=function(t){return 0>=this.cmp(t)},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function P(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var t=new o(null);return t.words=Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},i(k,E),k.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},k.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){var e;if(A[t])return A[t];if("k256"===t)e=new k;else if("p224"===t)e=new S;else if("p192"===t)e=new M;else if("p25519"===t)e=new _;else throw Error("Unknown prime "+t);return A[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n((t.negative|e.negative)==0,"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var l=e.words[n],h=u-1;h>=0;h--){var c=l>>h&1;if(i!==r[0]&&(i=this.sqr(i)),0===c&&0===s){a=0;continue}s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new P(t)},i(P,x),P.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},P.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},P.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},P.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},P.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},16441:function(t,e,r){"use strict";r.r(e),r.d(e,{arrayify:function(){return h},concat:function(){return c},hexConcat:function(){return b},hexDataLength:function(){return y},hexDataSlice:function(){return v},hexStripZeros:function(){return A},hexValue:function(){return w},hexZeroPad:function(){return E},hexlify:function(){return g},isBytes:function(){return l},isBytesLike:function(){return a},isHexString:function(){return p},joinSignature:function(){return S},splitSignature:function(){return k},stripZeros:function(){return f},zeroPad:function(){return d}});var n=r(1581);let i=new n.Logger("bytes/5.7.0");function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){return p(t)&&!(t.length%2)||l(t)}function u(t){return"number"==typeof t&&t==t&&t%1==0}function l(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!u(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function h(t,e){if(e||(e={}),"number"==typeof t){i.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(255&t),t=parseInt(String(t/256));return 0===r.length&&r.push(0),s(new Uint8Array(r))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),o(t)&&(t=t.toHexString()),p(t)){let n=t.substring(2);n.length%2&&("left"===e.hexPad?n="0"+n:"right"===e.hexPad?n+="0":i.throwArgumentError("hex data is odd-length","value",t));let a=[];for(let u=0;uh(t)),r=e.reduce((t,e)=>t+e.length,0),n=new Uint8Array(r);return e.reduce((t,e)=>(n.set(e,t),t+e.length),0),s(n)}function f(t){let e=h(t);if(0===e.length)return e;let r=0;for(;re&&i.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),s(r)}function p(t,e){return"string"==typeof t&&!!t.match(/^0x[0-9A-Fa-f]*$/)&&(!e||t.length===2+2*e)}let m="0123456789abcdef";function g(t,e){if(e||(e={}),"number"==typeof t){i.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=m[15&t]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),o(t))return t.toHexString();if(p(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":i.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(l(t)){let n="0x";for(let s=0;s>4]+m[15&a]}return n}return i.throwArgumentError("invalid hexlify value","value",t)}function y(t){if("string"!=typeof t)t=g(t);else if(!p(t)||t.length%2)return null;return(t.length-2)/2}function v(t,e,r){return("string"!=typeof t?t=g(t):(!p(t)||t.length%2)&&i.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r)?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function b(t){let e="0x";return t.forEach(t=>{e+=g(t).substring(2)}),e}function w(t){let e=A(g(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function A(t){"string"!=typeof t&&(t=g(t)),p(t)||i.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&i.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function k(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(t)){let r=h(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=g(r.slice(0,32)),e.s=g(r.slice(32,64))):65===r.length?(e.r=g(r.slice(0,32)),e.s=g(r.slice(32,64)),e.v=r[64]):i.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:i.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=g(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){let n=d(h(e._vs),32);e._vs=g(n);let o=n[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=o:e.recoveryParam!==o&&i.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),n[0]&=127;let s=g(n);null==e.s?e.s=s:e.s!==s&&i.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?i.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{let u=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==u&&i.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&p(e.r)?e.r=E(e.r,32):i.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&p(e.s)?e.s=E(e.s,32):i.throwArgumentError("signature missing or invalid s","signature",t);let l=h(e.s);l[0]>=128&&i.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(l[0]|=128);let c=g(l);e._vs&&(p(e._vs)||i.throwArgumentError("signature invalid _vs","signature",t),e._vs=E(e._vs,32)),null==e._vs?e._vs=c:e._vs!==c&&i.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function S(t){return g(c([(t=k(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},9279:function(t,e,r){"use strict";r.d(e,{d:function(){return n}});let n="0x0000000000000000000000000000000000000000"},21046:function(t,e,r){"use strict";r.d(e,{$B:function(){return h},Bz:function(){return l},Ce:function(){return u},PS:function(){return c},Py:function(){return a},_Y:function(){return o},fh:function(){return s},tL:function(){return i}});var n=r(2593);let i=n.O$.from(-1),o=n.O$.from(0),s=n.O$.from(1),a=n.O$.from(2),u=n.O$.from("1000000000000000000"),l=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),h=n.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),c=n.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},57218:function(t,e,r){"use strict";r.d(e,{R:function(){return n}});let n="0x0000000000000000000000000000000000000000000000000000000000000000"},21815:function(t,e,r){"use strict";r.r(e),r.d(e,{AddressZero:function(){return n.d},EtherSymbol:function(){return s},HashZero:function(){return o.R},MaxInt256:function(){return i.PS},MaxUint256:function(){return i.Bz},MinInt256:function(){return i.$B},NegativeOne:function(){return i.tL},One:function(){return i.fh},Two:function(){return i.Py},WeiPerEther:function(){return i.Ce},Zero:function(){return i._Y}});var n=r(9279),i=r(21046),o=r(57218);let s="Ξ"},64146:function(t,e,r){"use strict";r.r(e),r.d(e,{BaseContract:function(){return x},Contract:function(){return P},ContractFactory:function(){return C}});var n=r(61184),i=r(8198),o=r(81556),s=r(48088),a=r(19485),u=r(2593),l=r(16441),h=r(6881),c=r(83875),f=r(1581),d=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let p=new f.Logger("contracts/5.7.0"),m={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function g(t,e){return d(this,void 0,void 0,function*(){let r=yield e;"string"!=typeof r&&p.throwArgumentError("invalid address or ENS name","name",r);try{return(0,a.getAddress)(r)}catch(n){}t||p.throwError("a provider or signer is needed to resolve ENS names",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});let i=yield t.resolveName(r);return null==i&&p.throwArgumentError("resolver or addr is not configured for ENS name","name",r),i})}function y(t,e,r){return d(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((r,n)=>y(t,Array.isArray(e)?e[n]:e[r.name],r))):"address"===r.type?yield g(t,e):"tuple"===r.type?yield y(t,e,r.components):"array"===r.baseType?Array.isArray(e)?yield Promise.all(e.map(e=>y(t,e,r.arrayChildren))):Promise.reject(p.makeError("invalid value for array",f.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function v(t,e,r){return d(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=(0,h.shallowCopy)(r.pop())),p.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=(0,h.resolveProperties)({override:g(t.signer,n.from),signer:t.signer.getAddress()}).then(t=>d(this,void 0,void 0,function*(){return(0,a.getAddress)(t.signer)!==t.override&&p.throwError("Contract with a Signer cannot override from",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})):n.from=t.signer.getAddress():n.from&&(n.from=g(t.provider,n.from));let i=yield(0,h.resolveProperties)({args:y(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:(0,h.resolveProperties)(n)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},m=i.overrides;if(null!=m.nonce&&(s.nonce=u.O$.from(m.nonce).toNumber()),null!=m.gasLimit&&(s.gasLimit=u.O$.from(m.gasLimit)),null!=m.gasPrice&&(s.gasPrice=u.O$.from(m.gasPrice)),null!=m.maxFeePerGas&&(s.maxFeePerGas=u.O$.from(m.maxFeePerGas)),null!=m.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=u.O$.from(m.maxPriorityFeePerGas)),null!=m.from&&(s.from=m.from),null!=m.type&&(s.type=m.type),null!=m.accessList&&(s.accessList=(0,c.accessListify)(m.accessList)),null==s.gasLimit&&null!=e.gas){let v=21e3,b=(0,l.arrayify)(o);for(let w=0;wnull!=n[t]);return E.length&&p.throwError(`cannot override ${E.map(t=>JSON.stringify(t)).join(",")}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:E}),s})}function b(t,e){let r=e.wait.bind(e);e.wait=e=>r(e).then(e=>(e.events=e.logs.map(r=>{let n=(0,h.deepCopy)(r),i=null;try{i=t.interface.parseLog(r)}catch(o){}return i&&(n.args=i.args,n.decode=(e,r)=>t.interface.decodeEventLog(i.eventFragment,e,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>t.provider,n.getBlock=()=>t.provider.getBlock(e.blockHash),n.getTransaction=()=>t.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(e),n}),e))}function w(t,e,r){let n=t.signer||t.provider;return function(...i){return d(this,void 0,void 0,function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){let s=(0,h.shallowCopy)(i.pop());null!=s.blockTag&&(o=yield s.blockTag),delete s.blockTag,i.push(s)}null!=t.deployTransaction&&(yield t._deployed(o));let a=yield v(t,e,i),u=yield n.call(a,o);try{let l=t.interface.decodeFunctionResult(e,u);return r&&1===e.outputs.length&&(l=l[0]),l}catch(c){throw c.code===f.Logger.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=a),c}})}}function A(t,e,r){return e.constant?w(t,e,r):function(...r){return d(this,void 0,void 0,function*(){t.signer||p.throwError("sending a transaction requires a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());let n=yield v(t,e,r),i=yield t.signer.sendTransaction(n);return b(t,i),i})}}function E(t){return t.address&&(null==t.topics||0===t.topics.length)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(t=>Array.isArray(t)?t.join("|"):t).join(":"):"")}class k{constructor(t,e){(0,h.defineReadOnly)(this,"tag",t),(0,h.defineReadOnly)(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter(r=>!!e||r.listener!==t||(e=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(t=>t.listener)}listenerCount(){return this._listeners.length}run(t){let e=this.listenerCount();return this._listeners=this._listeners.filter(e=>{let r=t.slice();return setTimeout(()=>{e.listener.apply(this,r)},0),!e.once}),e}prepareEvent(t){}getEmit(t){return[t]}}class S extends k{constructor(){super("error",null)}}class M extends k{constructor(t,e,r,n){let i={address:t},o=e.getEventTopic(r);n?(o!==n[0]&&p.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(E(i),i),(0,h.defineReadOnly)(this,"address",t),(0,h.defineReadOnly)(this,"interface",e),(0,h.defineReadOnly)(this,"fragment",r)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){let e=(0,n.BR)(t.args);if(e.length)throw e[0].error;let r=(t.args||[]).slice();return r.push(t),r}}class _ extends k{constructor(t,e){super("*",{address:t}),(0,h.defineReadOnly)(this,"address",t),(0,h.defineReadOnly)(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{let e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,r)=>this.interface.decodeEventLog(e.eventFragment,t,r),t.args=e.args}catch(r){}}}class x{constructor(t,e,r){(0,h.defineReadOnly)(this,"interface",(0,h.getStatic)(new.target,"getInterface")(e)),null==r?((0,h.defineReadOnly)(this,"provider",null),(0,h.defineReadOnly)(this,"signer",null)):s.Signer.isSigner(r)?((0,h.defineReadOnly)(this,"provider",r.provider||null),(0,h.defineReadOnly)(this,"signer",r)):o.zt.isProvider(r)?((0,h.defineReadOnly)(this,"provider",r),(0,h.defineReadOnly)(this,"signer",null)):p.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,h.defineReadOnly)(this,"callStatic",{}),(0,h.defineReadOnly)(this,"estimateGas",{}),(0,h.defineReadOnly)(this,"functions",{}),(0,h.defineReadOnly)(this,"populateTransaction",{}),(0,h.defineReadOnly)(this,"filters",{});{let n={};Object.keys(this.interface.events).forEach(t=>{let e=this.interface.events[t];(0,h.defineReadOnly)(this.filters,t,(...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(e,t)})),n[e.name]||(n[e.name]=[]),n[e.name].push(t)}),Object.keys(n).forEach(t=>{let e=n[t];1===e.length?(0,h.defineReadOnly)(this.filters,t,this.filters[e[0]]):p.warn(`Duplicate definition of ${t} (${e.join(", ")})`)})}if((0,h.defineReadOnly)(this,"_runningEvents",{}),(0,h.defineReadOnly)(this,"_wrappedEmits",{}),null==t&&p.throwArgumentError("invalid contract address or ENS name","addressOrName",t),(0,h.defineReadOnly)(this,"address",t),this.provider)(0,h.defineReadOnly)(this,"resolvedAddress",g(this.provider,t));else try{(0,h.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,a.getAddress)(t)))}catch(i){p.throwError("provider is required to use ENS name as contract address",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(t=>{});let u={},l={};Object.keys(this.interface.functions).forEach(t=>{let e=this.interface.functions[t];if(l[t]){p.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);return}l[t]=!0;{let r=e.name;u[`%${r}`]||(u[`%${r}`]=[]),u[`%${r}`].push(t)}if(null==this[t]&&(0,h.defineReadOnly)(this,t,A(this,e,!0)),null==this.functions[t]&&(0,h.defineReadOnly)(this.functions,t,A(this,e,!1)),null==this.callStatic[t]&&(0,h.defineReadOnly)(this.callStatic,t,w(this,e,!0)),null==this.populateTransaction[t]){var n;(0,h.defineReadOnly)(this.populateTransaction,t,(n=this,function(...t){return v(n,e,t)}))}null==this.estimateGas[t]&&(0,h.defineReadOnly)(this.estimateGas,t,function(t,e){let r=t.signer||t.provider;return function(...n){return d(this,void 0,void 0,function*(){r||p.throwError("estimate require a provider or signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});let i=yield v(t,e,n);return yield r.estimateGas(i)})}}(this,e))}),Object.keys(u).forEach(t=>{let e=u[t];if(e.length>1)return;t=t.substring(1);let r=e[0];try{null==this[t]&&(0,h.defineReadOnly)(this,t,this[r])}catch(n){}null==this.functions[t]&&(0,h.defineReadOnly)(this.functions,t,this.functions[r]),null==this.callStatic[t]&&(0,h.defineReadOnly)(this.callStatic,t,this.callStatic[r]),null==this.populateTransaction[t]&&(0,h.defineReadOnly)(this.populateTransaction,t,this.populateTransaction[r]),null==this.estimateGas[t]&&(0,h.defineReadOnly)(this.estimateGas,t,this.estimateGas[r])})}static getContractAddress(t){return(0,a.getContractAddress)(t)}static getInterface(t){return i.vU.isInterface(t)?t:new i.vU(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,t).then(t=>("0x"===t&&p.throwError("contract not deployed",f.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(t){this.signer||p.throwError("sending a transactions require a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});let e=(0,h.shallowCopy)(t||{});return["from","to"].forEach(function(t){null!=e[t]&&p.throwError("cannot override "+t,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}),e.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(e))}connect(t){"string"==typeof t&&(t=new s.VoidSigner(t,this.provider));let e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&(0,h.defineReadOnly)(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return i.Hk.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new S);if("event"===t)return this._normalizeRunningEvent(new k("event",null));if("*"===t)return this._normalizeRunningEvent(new _(this.address,this.interface));let e=this.interface.getEvent(t);return this._normalizeRunningEvent(new M(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{let r=t.topics[0];if("string"!=typeof r)throw Error("invalid topic");let n=this.interface.getEvent(r);return this._normalizeRunningEvent(new M(this.address,this.interface,n,t.topics))}catch(i){}let o={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new k(E(o),o))}return this._normalizeRunningEvent(new _(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];let e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,r){let n=(0,h.deepCopy)(e);return n.removeListener=()=>{r&&(t.removeListener(r),this._checkRunningEvents(t))},n.getBlock=()=>this.provider.getBlock(e.blockHash),n.getTransaction=()=>this.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(n),n}_addEventListener(t,e,r){if(this.provider||p.throwError("events require a provider or a signer with a provider",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){let n=r=>{let n=this._wrapEvent(t,r,e);if(null==n.decodeError)try{let i=t.getEmit(n);this.emit(t.filter,...i)}catch(o){n.decodeError=o.error}null!=t.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[t.tag]=n,null!=t.filter&&this.provider.on(t.filter,n)}}queryFilter(t,e,r){let n=this._getRunningEvent(t),i=(0,h.shallowCopy)(n.filter);return"string"==typeof e&&(0,l.isHexString)(e,32)?(null!=r&&p.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then(t=>t.map(t=>this._wrapEvent(n,t,null)))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;let r=this._getRunningEvent(t),n=r.run(e)>0;return this._checkRunningEvents(r),n}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce((t,e)=>t+this._runningEvents[e].listenerCount(),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){let e=[];for(let r in this._runningEvents)this._runningEvents[r].listeners().forEach(t=>{e.push(t)});return e}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(let e in this._runningEvents){let r=this._runningEvents[e];r.removeAllListeners(),this._checkRunningEvents(r)}return this}let n=this._getRunningEvent(t);return n.removeAllListeners(),this._checkRunningEvents(n),this}off(t,e){if(!this.provider)return this;let r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}removeListener(t,e){return this.off(t,e)}}class P extends x{}class C{constructor(t,e,r){let n=null;"0x"!==(n="string"==typeof e?e:(0,l.isBytes)(e)?(0,l.hexlify)(e):e&&"string"==typeof e.object?e.object:"!").substring(0,2)&&(n="0x"+n),(!(0,l.isHexString)(n)||n.length%2)&&p.throwArgumentError("invalid bytecode","bytecode",e),r&&!s.Signer.isSigner(r)&&p.throwArgumentError("invalid signer","signer",r),(0,h.defineReadOnly)(this,"bytecode",n),(0,h.defineReadOnly)(this,"interface",(0,h.getStatic)(new.target,"getInterface")(t)),(0,h.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(...t){let e={};if(t.length===this.interface.deploy.inputs.length+1&&"object"==typeof t[t.length-1]){for(let r in e=(0,h.shallowCopy)(t.pop()))if(!m[r])throw Error("unknown transaction override "+r)}if(["data","from","to"].forEach(t=>{null!=e[t]&&p.throwError("cannot override "+t,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}),e.value){let n=u.O$.from(e.value);n.isZero()||this.interface.deploy.payable||p.throwError("non-payable constructor cannot override value",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})}return p.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=(0,l.hexlify)((0,l.concat)([this.bytecode,this.interface.encodeDeploy(t)])),e}deploy(...t){return d(this,void 0,void 0,function*(){let e={};t.length===this.interface.deploy.inputs.length+1&&(e=t.pop()),p.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor");let r=yield y(this.signer,t,this.interface.deploy.inputs);r.push(e);let n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=(0,h.getStatic)(this.constructor,"getContractAddress")(i),s=(0,h.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return b(s,i),(0,h.defineReadOnly)(s,"deployTransaction",i),s})}attach(t){return this.constructor.getContract(t,this.interface,this.signer)}connect(t){return new this.constructor(this.interface,this.bytecode,t)}static fromSolidity(t,e){null==t&&p.throwError("missing compiler output",f.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));let r=t.abi,n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}static getInterface(t){return P.getInterface(t)}static getContractAddress(t){return(0,a.getContractAddress)(t)}static getContract(t,e,r){return new P(t,e,r)}}},35644:function(t,e,r){"use strict";r.d(e,{i:function(){return n}});let n="hash/5.7.0"},32046:function(t,e,r){"use strict";r.d(e,{id:function(){return o}});var n=r(38197),i=r(29251);function o(t){return(0,n.keccak256)((0,i.Y0)(t))}},75931:function(t,e,r){"use strict";r.r(e),r.d(e,{_TypedDataEncoder:function(){return s.E},dnsEncode:function(){return i.Kn},ensNormalize:function(){return i.w3},hashMessage:function(){return o.r},id:function(){return n.id},isValidName:function(){return i.r1},messagePrefix:function(){return o.B},namehash:function(){return i.VM}});var n=r(32046),i=r(27586),o=r(93684),s=r(67827)},93684:function(t,e,r){"use strict";r.d(e,{B:function(){return s},r:function(){return a}});var n=r(16441),i=r(38197),o=r(29251);let s="\x19Ethereum Signed Message:\n";function a(t){return"string"==typeof t&&(t=(0,o.Y0)(t)),(0,i.keccak256)((0,n.concat)([(0,o.Y0)(s),(0,o.Y0)(String(t.length)),t]))}},27586:function(t,e,r){"use strict";let n,i;r.d(e,{Kn:function(){return O},w3:function(){return x},r1:function(){return P},VM:function(){return C}});var o,s=r(16441),a=r(29251),u=r(38197),l=r(1581),h=r(35644),c=r(59567);function f(t,e){null==e&&(e=1);let r=[],n=r.forEach,i=function(t,e){n.call(t,function(t){e>0&&Array.isArray(t)?i(t,e-1):r.push(t)})};return i(t,e),r}function d(t,e){let r=Array(t);for(let n=0,i=-1;ne[t]):r}function m(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;i>1:o>>1}return r})(t,r).forEach((t,e)=>n[e].push(t));return n}let g=(o=function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,o=[0,1];for(let s=1;s>--l&1}let f=0;for(let d=0;d<31;d++)f=f<<1|c();let p=[],m=0,g=2147483648;for(;;){let y=Math.floor(((f-m+1)*i-1)/g),v=0,b=n;for(;b-v>1;){let w=v+b>>>1;y{switch(e-k){case 3:return k+65792+(t[u++]<<16|t[u++]<<8|t[u++]);case 2:return k+256+(t[u++]<<8|t[u++]);case 1:return k+t[u++];default:return e-1}})}((0,c.J)("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),i=0,()=>o[i++]),y=new Set(p(g)),v=new Set(p(g)),b=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(function(t,e){let r=1+e(),n=e(),i=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return f(m(i.length,1+t,e).map((t,e)=>{let o=t[0],s=t.slice(1);return Array(i[e]).fill(void 0).map((t,e)=>{let i=e*n;return[o+e*r,s.map(t=>t+i)]})}))}(r,t))}for(;;){let n=t()-1;if(n<0)break;e.push(m(1+t(),1+n,t).map(t=>[t[0],t.slice(1)]))}return function(t){let e={};for(let r=0;rt-e),function t(){let e=[];for(;;){let r=p(g,n);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((t,e)=>e.set.size-t.set.size);let i=g(),o=i%3,s=!!(1&(i=i/3|0)),a=1==(i>>=1),u=2==i;return{branches:e,valid:o,fe0f:s,save:a,check:u}}());function A(t){return t.filter(t=>65039!=t)}function E(t){for(let e of t.split(".")){var r;let n=(r=e,(0,a.XL)(r));try{for(let i=n.lastIndexOf(95)-1;i>=0;i--)if(95!==n[i])throw Error("underscore only allowed at start");if(n.length>=4&&n.every(t=>t<128)&&45===n[2]&&45===n[3])throw Error("invalid label extension")}catch(o){throw Error(`Invalid label "${e}": ${o.message}`)}}return t}let k=new l.Logger(h.i),S=new Uint8Array(32);function M(t){if(0===t.length)throw Error("invalid ENS name; empty component");return t}function _(t){let e=(0,a.Y0)(E(function(t,e){let r=(0,a.XL)(t).reverse(),n=[];for(;r.length;){let i=function(t,e){var r;let n,i;let o=w,s=[],a=t.length;for(e&&(e.length=0);a;){let u=t[--a];if(!(o=null===(r=o.branches.find(t=>t.set.has(u)))||void 0===r?void 0:r.node))break;if(o.save)i=u;else if(o.check&&u===i)break;s.push(u),o.fe0f&&(s.push(65039),a>0&&65039==t[a-1]&&a--),o.valid&&(n=s.slice(),2==o.valid&&n.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return n}(r);if(i){n.push(...e(i));continue}let o=r.pop();if(y.has(o)){n.push(o);continue}if(v.has(o))continue;let s=b[o];if(s){n.push(...s);continue}throw Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`)}return E(String.fromCodePoint(...n).normalize("NFC"))}(t,A))),r=[];if(0===t.length)return r;let n=0;for(let i=0;i=e.length)throw Error("invalid ENS name; empty component");return r.push(M(e.slice(n))),r}function x(t){return _(t).map(t=>(0,a.ZN)(t)).join(".")}function P(t){try{return 0!==_(t).length}catch(e){}return!1}function C(t){"string"!=typeof t&&k.throwArgumentError("invalid ENS name; not a string","name",t);let e=S,r=_(t);for(;r.length;)e=(0,u.keccak256)((0,s.concat)([e,(0,u.keccak256)(r.pop())]));return(0,s.hexlify)(e)}function O(t){return(0,s.hexlify)((0,s.concat)(_(t).map(t=>{if(t.length>63)throw Error("invalid DNS encoded entry; length exceeds 63 bytes");let e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e})))+"00"}S.fill(0)},67827:function(t,e,r){"use strict";r.d(e,{E:function(){return M}});var n=r(19485),i=r(2593),o=r(16441),s=r(38197),a=r(6881),u=r(1581),l=r(35644),h=r(32046);let c=new u.Logger(l.i),f=new Uint8Array(32);f.fill(0);let d=i.O$.from(-1),p=i.O$.from(0),m=i.O$.from(1),g=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),y=(0,o.hexZeroPad)(m.toHexString(),32),v=(0,o.hexZeroPad)(p.toHexString(),32),b={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},w=["name","version","chainId","verifyingContract","salt"];function A(t){return function(e){return"string"!=typeof e&&c.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}let E={name:A("name"),version:A("version"),chainId:function(t){try{return i.O$.from(t).toString()}catch(e){}return c.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return(0,n.getAddress)(t).toLowerCase()}catch(e){}return c.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{let e=(0,o.arrayify)(t);if(32!==e.length)throw Error("bad length");return(0,o.hexlify)(e)}catch(r){}return c.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function k(t){{let e=t.match(/^(u?)int(\d*)$/);if(e){let r=""===e[1],a=parseInt(e[2]||"256");(a%8!=0||a>256||e[2]&&e[2]!==String(a))&&c.throwArgumentError("invalid numeric width","type",t);let u=g.mask(r?a-1:a),l=r?u.add(m).mul(d):p;return function(e){let r=i.O$.from(e);return(r.lt(l)||r.gt(u))&&c.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),(0,o.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{let b=t.match(/^bytes(\d+)$/);if(b){let w=parseInt(b[1]);return(0===w||w>32||b[1]!==String(w))&&c.throwArgumentError("invalid bytes width","type",t),function(e){let r=(0,o.arrayify)(e);return r.length!==w&&c.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){let e=(0,o.arrayify)(t),r=e.length%32;return r?(0,o.hexConcat)([e,f.slice(r)]):(0,o.hexlify)(e)}(e)}}}switch(t){case"address":return function(t){return(0,o.hexZeroPad)((0,n.getAddress)(t),32)};case"bool":return function(t){return t?y:v};case"bytes":return function(t){return(0,s.keccak256)(t)};case"string":return function(t){return(0,h.id)(t)}}return null}function S(t,e){return`${t}(${e.map(({name:t,type:e})=>e+" "+t).join(",")})`}class M{constructor(t){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(t))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});let e={},r={},n={};for(let i in Object.keys(t).forEach(t=>{e[t]={},r[t]=[],n[t]={}}),t){let o={};t[i].forEach(n=>{o[n.name]&&c.throwArgumentError(`duplicate variable name ${JSON.stringify(n.name)} in ${JSON.stringify(i)}`,"types",t),o[n.name]=!0;let s=n.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===i&&c.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);let a=k(s);a||(r[s]||c.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(i),e[i][s]=!0)})}let s=Object.keys(r).filter(t=>0===r[t].length);for(let u in 0===s.length?c.throwArgumentError("missing primary type","types",t):s.length>1&&c.throwArgumentError(`ambiguous primary types or unused types: ${s.map(t=>JSON.stringify(t)).join(", ")}`,"types",t),(0,a.defineReadOnly)(this,"primaryType",s[0]),!function i(o,s){s[o]&&c.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach(t=>{r[t]&&(i(t,s),Object.keys(s).forEach(e=>{n[e][t]=!0}))}),delete s[o]}(this.primaryType,{}),n){let l=Object.keys(n[u]);l.sort(),this._types[u]=S(u,t[u])+l.map(e=>S(e,t[e])).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{let e=k(t);if(e)return e}let r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){let n=r[1],i=this.getEncoder(n),a=parseInt(r[3]);return t=>{a>=0&&t.length!==a&&c.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let e=t.map(i);return this._types[n]&&(e=e.map(s.keccak256)),(0,s.keccak256)((0,o.hexConcat)(e))}}let u=this.types[t];if(u){let l=(0,h.id)(this._types[t]);return t=>{let e=u.map(({name:e,type:r})=>{let n=this.getEncoder(r)(t[e]);return this._types[r]?(0,s.keccak256)(n):n});return e.unshift(l),(0,o.hexConcat)(e)}}return c.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){let e=this._types[t];return e||c.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return(0,s.keccak256)(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){{let n=k(t);if(n)return r(t,e)}let i=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){let o=i[1],s=parseInt(i[3]);return s>=0&&e.length!==s&&c.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map(t=>this._visit(o,t,r))}let a=this.types[t];return a?a.reduce((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t),{}):c.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new M(t)}static getPrimaryType(t){return M.from(t).primaryType}static hashStruct(t,e,r){return M.from(e).hashStruct(t,r)}static hashDomain(t){let e=[];for(let r in t){let n=b[r];n||c.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort((t,e)=>w.indexOf(t.name)-w.indexOf(e.name)),M.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return(0,o.hexConcat)(["0x1901",M.hashDomain(t),M.from(e).hash(r)])}static hash(t,e,r){return(0,s.keccak256)(M.encode(t,e,r))}static resolveNames(t,e,r,n){var i,s,u,l;return i=this,s=void 0,u=void 0,l=function*(){t=(0,a.shallowCopy)(t);let i={};t.verifyingContract&&!(0,o.isHexString)(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");let s=M.from(e);for(let u in s.visit(r,(t,e)=>("address"!==t||(0,o.isHexString)(e,20)||(i[e]="0x"),e)),i)i[u]=yield n(u);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=s.visit(r,(t,e)=>"address"===t&&i[e]?i[e]:e),{domain:t,value:r}},new(u||(u=Promise))(function(t,e){function r(t){try{o(l.next(t))}catch(r){e(r)}}function n(t){try{o(l.throw(t))}catch(r){e(r)}}function o(e){var i;e.done?t(e.value):((i=e.value)instanceof u?i:new u(function(t){t(i)})).then(r,n)}o((l=l.apply(i,s||[])).next())})}static getPayload(t,e,r){M.hashDomain(t);let n={},s=[];w.forEach(e=>{let r=t[e];null!=r&&(n[e]=E[e](r),s.push({name:e,type:b[e]}))});let u=M.from(e),l=(0,a.shallowCopy)(e);return l.EIP712Domain?c.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):l.EIP712Domain=s,u.encode(r),{types:l,domain:n,primaryType:u.primaryType,message:u.visit(r,(t,e)=>{if(t.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.arrayify)(e));if(t.match(/^u?int/))return i.O$.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&c.throwArgumentError("invalid string","value",e),e}return c.throwArgumentError("unsupported type","type",t)})}}}},84178:function(t,e,r){"use strict";r.r(e),r.d(e,{HDNode:function(){return S},defaultPath:function(){return k},entropyToMnemonic:function(){return x},getAccountPath:function(){return C},isValidMnemonic:function(){return P},mnemonicToEntropy:function(){return _},mnemonicToSeed:function(){return M}});var n=r(57727),i=r(16441),o=r(2593),s=r(29251),a=r(85306),u=r(6881),l=r(67669),h=r(2006),c=r(21261),f=r(83875),d=r(10234),p=r(1581);let m=new p.Logger("hdnode/5.7.0"),g=o.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y=(0,s.Y0)("Bitcoin seed");function v(t){return(1<=256)throw Error("Depth too large!");return w((0,i.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,i.hexlify)(this.depth),this.parentFingerprint,(0,i.hexZeroPad)((0,i.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,i.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new S(E,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(t){if(t>4294967295)throw Error("invalid index - "+String(t));let e=this.path;e&&(e+="/"+(2147483647&t));let r=new Uint8Array(37);if(2147483648&t){if(!this.privateKey)throw Error("cannot derive child of neutered node");r.set((0,i.arrayify)(this.privateKey),1),e&&(e+="'")}else r.set((0,i.arrayify)(this.publicKey));for(let n=24;n>=0;n-=8)r[33+(n>>3)]=t>>24-n&255;let s=(0,i.arrayify)((0,h.Gy)(c.p.sha512,this.chainCode,r)),a=s.slice(0,32),u=s.slice(32),f=null,d=null;if(this.privateKey)f=b(o.O$.from(a).add(this.privateKey).mod(g));else{let p=new l.SigningKey((0,i.hexlify)(a));d=p._addPoint(this.publicKey)}let m=e,y=this.mnemonic;return y&&(m=Object.freeze({phrase:y.phrase,path:e,locale:y.locale||"en"})),new S(E,f,d,this.fingerprint,b(u),t,this.depth+1,m)}derivePath(t){let e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw Error("invalid path - "+t);"m"===e[0]&&e.shift();let r=this;for(let n=0;n=2147483648)throw Error("invalid path index - "+i);r=r._derive(2147483648+o)}else if(i.match(/^[0-9]+$/)){let s=parseInt(i);if(s>=2147483648)throw Error("invalid path index - "+i);r=r._derive(s)}else throw Error("invalid path component - "+i)}return r}static _fromSeed(t,e){let r=(0,i.arrayify)(t);if(r.length<16||r.length>64)throw Error("invalid seed");let n=(0,i.arrayify)((0,h.Gy)(c.p.sha512,y,r));return new S(E,b(n.slice(0,32)),null,"0x00000000",b(n.slice(32)),0,0,e)}static fromMnemonic(t,e,r){return t=x(_(t,r=A(r)),r),S._fromSeed(M(t,e),{phrase:t,path:"m",locale:r.locale})}static fromSeed(t){return S._fromSeed(t,null)}static fromExtendedKey(t){let e=n.Base58.decode(t);(82!==e.length||w(e.slice(0,78))!==t)&&m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let r=e[4],o=(0,i.hexlify)(e.slice(5,9)),s=parseInt((0,i.hexlify)(e.slice(9,13)).substring(2),16),a=(0,i.hexlify)(e.slice(13,45)),u=e.slice(45,78);switch((0,i.hexlify)(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new S(E,null,(0,i.hexlify)(u),o,a,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new S(E,(0,i.hexlify)(u.slice(1)),null,o,a,s,r,null)}return m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function M(t,e){e||(e="");let r=(0,s.Y0)("mnemonic"+e,s.Uj.NFKD);return(0,a.n)((0,s.Y0)(t,s.Uj.NFKD),r,2048,64,"sha512")}function _(t,e){e=A(e),m.checkNormalize();let r=e.split(t);if(r.length%3!=0)throw Error("invalid mnemonic");let n=(0,i.arrayify)(new Uint8Array(Math.ceil(11*r.length/8))),o=0;for(let s=0;s>3]|=1<<7-o%8),o++}let l=32*r.length/3,c=r.length/3,f=v(c),d=(0,i.arrayify)((0,h.JQ)(n.slice(0,l/8)))[0]&f;if(d!==(n[n.length-1]&f))throw Error("invalid checksum");return(0,i.hexlify)(n.slice(0,l/8))}function x(t,e){if(e=A(e),(t=(0,i.arrayify)(t)).length%4!=0||t.length<16||t.length>32)throw Error("invalid entropy");let r=[0],n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&(1<<8-n)-1),n+=3);let s=t.length/4,a=(0,i.arrayify)((0,h.JQ)(t))[0]&v(s);return r[r.length-1]<<=s,r[r.length-1]|=a>>8-s,e.join(r.map(t=>e.getWord(t)))}function P(t,e){try{return _(t,e),!0}catch(r){}return!1}function C(t){return("number"!=typeof t||t<0||t>=2147483648||t%1)&&m.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}},29816:function(t,e,r){"use strict";r.d(e,{i:function(){return n}});let n="json-wallets/5.7.0"},45659:function(t,e,r){"use strict";r.r(e),r.d(e,{decryptCrowdsale:function(){return g},decryptJsonWallet:function(){return A},decryptJsonWalletSync:function(){return E},decryptKeystore:function(){return w.pe},decryptKeystoreSync:function(){return w.hb},encryptKeystore:function(){return w.HI},getJsonWalletAddress:function(){return b},isCrowdsaleWallet:function(){return y},isKeystoreWallet:function(){return v}});var n=r(78826),i=r.n(n),o=r(19485),s=r(16441),a=r(38197),u=r(85306),l=r(29251),h=r(6881),c=r(1581),f=r(29816),d=r(97013);let p=new c.Logger(f.i);class m extends h.Description{isCrowdsaleAccount(t){return!!(t&&t._isCrowdsaleAccount)}}function g(t,e){let r=JSON.parse(t);e=(0,d.Ij)(e);let n=(0,o.getAddress)((0,d.gx)(r,"ethaddr")),h=(0,d.p3)((0,d.gx)(r,"encseed"));h&&h.length%16==0||p.throwArgumentError("invalid encseed","json",t);let c=(0,s.arrayify)((0,u.n)(e,e,2e3,32,"sha256")).slice(0,16),f=h.slice(0,16),g=h.slice(16),y=new(i()).ModeOfOperation.cbc(c,f),v=i().padding.pkcs7.strip((0,s.arrayify)(y.decrypt(g))),b="";for(let w=0;w{e=(0,u.arrayify)(e);let r=e.slice(0,16),n=e.slice(16,32),o=e.slice(32,64),s=new(i()).Counter(M),a=new(i()).ModeOfOperation.ctr(r,s),l=(0,u.arrayify)(a.encrypt(g)),c=(0,h.keccak256)((0,u.concat)([n,l])),d={address:t.address.substring(2).toLowerCase(),id:(0,m.EH)(_),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,u.hexlify)(M).substring(2)},ciphertext:(0,u.hexlify)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,u.hexlify)(S).substring(2),n:x,dklen:32,p:C,r:P},mac:c.substring(2)}};if(v){let p=(0,f.O)(16),y=new(i()).Counter(p),b=new(i()).ModeOfOperation.ctr(o,y),E=(0,u.arrayify)(b.encrypt(v)),O=new Date,R=O.getUTCFullYear()+"-"+(0,m.VP)(O.getUTCMonth()+1,2)+"-"+(0,m.VP)(O.getUTCDate(),2)+"T"+(0,m.VP)(O.getUTCHours(),2)+"-"+(0,m.VP)(O.getUTCMinutes(),2)+"-"+(0,m.VP)(O.getUTCSeconds(),2)+".0Z";d["x-ethers"]={client:k,gethFilename:"UTC--"+R+"--"+d.address,mnemonicCounter:(0,u.hexlify)(p).substring(2),mnemonicCiphertext:(0,u.hexlify)(E).substring(2),path:w,locale:A,version:"0.1"}}return JSON.stringify(d)})}},97013:function(t,e,r){"use strict";r.d(e,{EH:function(){return l},Ij:function(){return a},VP:function(){return s},gx:function(){return u},p3:function(){return o}});var n=r(16441),i=r(29251);function o(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),(0,n.arrayify)(t)}function s(t,e){for(t=String(t);t.length{try{if("test"!=="test".normalize(e))throw Error("bad normalize")}catch(r){t.push(e)}}),t.length)throw Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(e){return e.message}return null}();(o=n||(n={})).DEBUG="DEBUG",o.INFO="INFO",o.WARNING="WARNING",o.ERROR="ERROR",o.OFF="OFF",(s=i||(i={})).UNKNOWN_ERROR="UNKNOWN_ERROR",s.NOT_IMPLEMENTED="NOT_IMPLEMENTED",s.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",s.NETWORK_ERROR="NETWORK_ERROR",s.SERVER_ERROR="SERVER_ERROR",s.TIMEOUT="TIMEOUT",s.BUFFER_OVERRUN="BUFFER_OVERRUN",s.NUMERIC_FAULT="NUMERIC_FAULT",s.MISSING_NEW="MISSING_NEW",s.INVALID_ARGUMENT="INVALID_ARGUMENT",s.MISSING_ARGUMENT="MISSING_ARGUMENT",s.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",s.CALL_EXCEPTION="CALL_EXCEPTION",s.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",s.NONCE_EXPIRED="NONCE_EXPIRED",s.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",s.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",s.TRANSACTION_REPLACED="TRANSACTION_REPLACED",s.ACTION_REJECTED="ACTION_REJECTED";let d="0123456789abcdef";class p{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){let r=t.toLowerCase();null==l[r]&&this.throwArgumentError("invalid log level name","logLevel",t),h>l[r]||console.log.apply(console,e)}debug(...t){this._log(p.levels.DEBUG,t)}info(...t){this._log(p.levels.INFO,t)}warn(...t){this._log(p.levels.WARNING,t)}makeError(t,e,r){if(u)return this.makeError("censored error",e,{});e||(e=p.errors.UNKNOWN_ERROR),r||(r={});let n=[];Object.keys(r).forEach(t=>{let e=r[t];try{if(e instanceof Uint8Array){let i="";for(let o=0;o>4]+d[15&e[o]];n.push(t+"=Uint8Array(0x"+i+")")}else n.push(t+"="+JSON.stringify(e))}catch(s){n.push(t+"="+JSON.stringify(r[t].toString()))}}),n.push(`code=${e}`),n.push(`version=${this.version}`);let o=t,s="";switch(e){case i.NUMERIC_FAULT:{s="NUMERIC_FAULT";let a=t;switch(a){case"overflow":case"underflow":case"division-by-zero":s+="-"+a;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case i.CALL_EXCEPTION:case i.INSUFFICIENT_FUNDS:case i.MISSING_NEW:case i.NONCE_EXPIRED:case i.REPLACEMENT_UNDERPRICED:case i.TRANSACTION_REPLACED:case i.UNPREDICTABLE_GAS_LIMIT:s=e}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(t+=" ("+n.join(", ")+")");let l=Error(t);return l.reason=o,l.code=e,Object.keys(r).forEach(function(t){l[t]=r[t]}),l}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,p.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),f&&this.throwError("platform missing String.prototype.normalize",p.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,p.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",p.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return c||(c=new p("logger/5.7.0")),c}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),a){if(!t)return;this.globalLogger().throwError("error censorship permanent",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!t,a=!!e}static setLogLevel(t){let e=l[t.toLowerCase()];if(null==e){p.globalLogger().warn("invalid log level - "+t);return}h=e}static from(t){return new p(t)}}p.errors=i,p.levels=n},85306:function(t,e,r){"use strict";r.d(e,{n:function(){return o}});var n=r(16441),i=r(2006);function o(t,e,r,o,s){let a,u,l;t=(0,n.arrayify)(t),e=(0,n.arrayify)(e);let h=1,c=new Uint8Array(o),f=new Uint8Array(e.length+4);f.set(e);for(let d=1;d<=h;d++){f[e.length]=d>>24&255,f[e.length+1]=d>>16&255,f[e.length+2]=d>>8&255,f[e.length+3]=255&d;let p=(0,n.arrayify)((0,i.Gy)(s,t,f));a||(a=p.length,l=new Uint8Array(a),h=Math.ceil(o/a),u=o-(h-1)*a),l.set(p);for(let m=1;m{let r=t[e];return Promise.resolve(r).then(t=>({key:e,value:t}))}),r=yield Promise.all(e);return r.reduce((t,e)=>(t[e.key]=e.value,t),{})},new(n||(n=Promise))(function(t,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i.throw(t))}catch(e){o(e)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof n?r:new n(function(t){t(r)})).then(s,a)}u((i=i.apply(e,r||[])).next())})}function u(t,e){t&&"object"==typeof t||i.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||i.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function l(t){let e={};for(let r in t)e[r]=t[r];return e}let h={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function c(t){return function(t){if(function t(e){if(null==e||h[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;let r=Object.keys(e);for(let n=0;nc(t)));if("object"==typeof t){let e={};for(let r in t){let n=t[r];void 0!==n&&o(e,r,c(n))}return e}return i.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}(t)}class f{constructor(t){for(let e in t)this[e]=c(t[e])}}},8605:function(t,e,r){"use strict";r.r(e),r.d(e,{AlchemyProvider:function(){return tN},AlchemyWebSocketProvider:function(){return tR},AnkrProvider:function(){return tB},BaseProvider:function(){return tn},CloudflareProvider:function(){return tF},EtherscanProvider:function(){return tH},FallbackProvider:function(){return t4},Formatter:function(){return O},InfuraProvider:function(){return et},InfuraWebSocketProvider:function(){return t9},IpcProvider:function(){return t5},JsonRpcBatchProvider:function(){return ee},JsonRpcProvider:function(){return tv},JsonRpcSigner:function(){return tm},NodesmithProvider:function(){return en},PocketProvider:function(){return es},Provider:function(){return n.zt},Resolver:function(){return tt},StaticJsonRpcProvider:function(){return tx},UrlJsonRpcProvider:function(){return tP},Web3Provider:function(){return eh},WebSocketProvider:function(){return tM},getDefaultProvider:function(){return ef},getNetwork:function(){return f},isCommunityResourcable:function(){return R},isCommunityResource:function(){return N},showThrottleMessage:function(){return T}});var n=r(81556),i=r(1581);let o=new i.Logger("networks/5.7.1");function s(t){let e=function(e,r){null==r&&(r={});let n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(i){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(o){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(s){}if(e.PocketProvider&&"-"!==r.pocket)try{let a=new e.PocketProvider(t,r.pocket);a.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(a.network.name)&&n.push(a)}catch(u){}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(l){}if(e.AnkrProvider&&"-"!==r.ankr)try{let h=new e.AnkrProvider(t,r.ankr);h.network&&-1===["ropsten"].indexOf(h.network.name)&&n.push(h)}catch(c){}if(0===n.length)return null;if(e.FallbackProvider){let f=1;return null!=r.quorum?f=r.quorum:"homestead"===t&&(f=2),new e.FallbackProvider(n,f)}return n[0]};return e.renetwork=function(t){return s(t)},e}function a(t,e){let r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return a(t,e)},r}let u={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:s("homestead")},l={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:s("ropsten")},h={chainId:63,name:"classicMordor",_defaultProvider:a("https://www.ethercluster.com/mordor","classicMordor")},c={unspecified:{chainId:0,name:"unspecified"},homestead:u,mainnet:u,morden:{chainId:2,name:"morden"},ropsten:l,testnet:l,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:s("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:s("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:s("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:s("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:a("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:h,classicTestnet:h,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:a("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:s("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:s("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function f(t){if(null==t)return null;if("number"==typeof t){for(let e in c){let r=c[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){let n=c[t];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}let i=c[t.name];if(!i)return"number"!=typeof t.chainId&&o.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==i.chainId&&o.throwArgumentError("network chainId mismatch","network",t);let s=t._defaultProvider||null;if(null==s&&i._defaultProvider){var a;s=(a=i._defaultProvider)&&"function"==typeof a.renetwork?i._defaultProvider.renetwork(t):i._defaultProvider}return{name:t.name,chainId:i.chainId,ensAddress:t.ensAddress||i.ensAddress||null,_defaultProvider:s}}var d=r(59567),p=r(57727),m=r(2593),g=r(16441),y=r(57218),v=r(27586),b=r(6881),w=r(2006),A=r(29251),E=r(37707),k=r(92882),S=r.n(k);let M="providers/5.7.2";var _=r(19485),x=r(9279),P=r(83875);let C=new i.Logger(M);class O{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){let t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),u=this.type.bind(this),l=t=>this.data(t,!0);return t.transaction={hash:o,type:u,accessList:O.allowNull(this.accessList.bind(this),null),blockHash:O.allowNull(o,null),blockNumber:O.allowNull(a,null),transactionIndex:O.allowNull(a,null),confirmations:O.allowNull(a,null),from:e,gasPrice:O.allowNull(r),maxPriorityFeePerGas:O.allowNull(r),maxFeePerGas:O.allowNull(r),gasLimit:r,to:O.allowNull(e,null),value:r,nonce:a,data:i,r:O.allowNull(this.uint256),s:O.allowNull(this.uint256),v:O.allowNull(a),creates:O.allowNull(e,null),raw:O.allowNull(i)},t.transactionRequest={from:O.allowNull(e),nonce:O.allowNull(a),gasLimit:O.allowNull(r),gasPrice:O.allowNull(r),maxPriorityFeePerGas:O.allowNull(r),maxFeePerGas:O.allowNull(r),to:O.allowNull(e),value:O.allowNull(r),data:O.allowNull(l),type:O.allowNull(a),accessList:O.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:O.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:O.allowNull(this.address,null),from:O.allowNull(this.address,null),contractAddress:O.allowNull(e,null),transactionIndex:a,root:O.allowNull(s),gasUsed:r,logsBloom:O.allowNull(i),blockHash:o,transactionHash:o,logs:O.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:O.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:O.allowNull(r),status:O.allowNull(a),type:u},t.block={hash:O.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:O.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:O.allowNull(e),extraData:i,transactions:O.allowNull(O.arrayOf(o)),baseFeePerGas:O.allowNull(r)},t.blockWithTransactions=(0,b.shallowCopy)(t.block),t.blockWithTransactions.transactions=O.allowNull(O.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:O.allowNull(n,void 0),toBlock:O.allowNull(n,void 0),blockHash:O.allowNull(o,void 0),address:O.allowNull(e,void 0),topics:O.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:O.allowNull(a),blockHash:O.allowNull(o),transactionIndex:a,removed:O.allowNull(this.boolean.bind(this)),address:e,data:O.allowFalsish(i,"0x"),topics:O.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return(0,P.accessListify)(t||[])}number(t){return"0x"===t?0:m.O$.from(t).toNumber()}type(t){return"0x"===t||null==t?0:m.O$.from(t).toNumber()}bigNumber(t){return m.O$.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),(0,g.isHexString)(t))?t.toLowerCase():C.throwArgumentError("invalid hash","value",t)}data(t,e){let r=this.hex(t,e);if(r.length%2!=0)throw Error("invalid data; odd-length - "+t);return r}address(t){return(0,_.getAddress)(t)}callAddress(t){if(!(0,g.isHexString)(t,32))return null;let e=(0,_.getAddress)((0,g.hexDataSlice)(t,12));return e===x.d?null:e}contractAddress(t){return(0,_.getContractAddress)(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if("number"==typeof t||(0,g.isHexString)(t))return(0,g.hexValue)(t);throw Error("invalid blockTag")}hash(t,e){let r=this.hex(t,e);return 32!==(0,g.hexDataLength)(r)?C.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;let e=m.O$.from(t);try{return e.toNumber()}catch(r){}return null}uint256(t){if(!(0,g.isHexString)(t))throw Error("invalid uint256");return(0,g.hexZeroPad)(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);let r=null!=t._difficulty?t._difficulty:t.difficulty,n=O.check(e,t);return n._difficulty=null==r?null:m.O$.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return O.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&m.O$.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),(1===t.type||2===t.type)&&null==t.accessList&&(t.accessList=[]);let e=O.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;(0,g.isHexString)(r)&&(r=m.O$.from(r).toNumber()),e.chainId=r}else{let n=t.networkId;null==n&&null==e.v&&(n=t.chainId),(0,g.isHexString)(n)&&(n=m.O$.from(n).toNumber()),"number"!=typeof n&&null!=e.v&&((n=(e.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),e.chainId=n}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return(0,P.parse)(t)}receiptLog(t){return O.check(this.formats.receiptLog,t)}receipt(t){let e=O.check(this.formats.receipt,t);if(null!=e.root){if(e.root.length<=4){let r=m.O$.from(e.root).toNumber();0===r||1===r?(null!=e.status&&e.status!==r&&C.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=r,delete e.root):C.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&C.throwArgumentError("invalid root hash","value.root",e.root)}return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map(t=>this.topics(t)):null!=t?this.hash(t,!0):null}filter(t){return O.check(this.formats.filter,t)}filterLog(t){return O.check(this.formats.filterLog,t)}static check(t,e){let r={};for(let n in t)try{let i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(o){throw o.checkKey=n,o.checkValue=e[n],o}return r}static allowNull(t,e){return function(r){return null==r?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw Error("not an array");let r=[];return e.forEach(function(e){r.push(t(e))}),r}}}function R(t){return t&&"function"==typeof t.isCommunityResource}function N(t){return R(t)&&t.isCommunityResource()}let I=!1;function T(){I||(I=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var B=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let L=new i.Logger(M);function F(t){return null==t?"null":(32!==(0,g.hexDataLength)(t)&&L.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function D(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map(t=>{if(!Array.isArray(t))return F(t);{let e={};t.forEach(t=>{e[F(t)]=!0});let r=Object.keys(e);return r.sort(),r.join("|")}}).join("&")}function U(t){if("string"==typeof t){if(t=t.toLowerCase(),32===(0,g.hexDataLength)(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else if(Array.isArray(t))return"filter:*:"+D(t);else if(n.Sg.isForkEvent(t))throw L.warn("not implemented"),Error("not implemented");else if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+D(t.topics||[]);throw Error("invalid event - "+t)}function j(){return new Date().getTime()}function q(t){return new Promise(e=>{setTimeout(e,t)})}let K=["block","network","pending","poll"];class G{constructor(t,e,r){(0,b.defineReadOnly)(this,"tag",t),(0,b.defineReadOnly)(this,"listener",e),(0,b.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){let t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){var t;let e=this.tag.split(":");if("filter"!==e[0])return null;let r=e[1],n=""===(t=e[2])?[]:t.split(/&/g).map(t=>{if(""===t)return[];let e=t.split("|").map(t=>"null"===t?null:t);return 1===e.length?e[0]:e}),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||K.indexOf(this.tag)>=0}}let z={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function H(t){return(0,g.hexZeroPad)(m.O$.from(t).toHexString(),32)}function Q(t){return p.Base58.encode((0,g.concat)([t,(0,g.hexDataSlice)((0,w.JQ)((0,w.JQ)(t)),0,4)]))}let W=RegExp("^(ipfs)://(.*)$","i"),J=[RegExp("^(https)://(.*)$","i"),RegExp("^(data):(.*)$","i"),W,RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function V(t,e){try{return(0,A.ZN)(Z(t,e))}catch(r){}return null}function Z(t,e){if("0x"===t)return null;let r=m.O$.from((0,g.hexDataSlice)(t,e,e+32)).toNumber(),n=m.O$.from((0,g.hexDataSlice)(t,r,r+32)).toNumber();return(0,g.hexDataSlice)(t,r+32,r+32+n)}function Y(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):L.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function $(t){let e=(0,g.arrayify)(t);if(e.length>32)throw Error("internal; should not happen");let r=new Uint8Array(32);return r.set(e,32-e.length),r}function X(t){let e=[],r=0;for(let n=0;nm.O$.from(t).eq(1)).catch(t=>{if(t.code===i.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t})),this._supportsEip2544}_fetch(t,e){return B(this,void 0,void 0,function*(){let r={to:this.address,ccipReadEnabled:!0,data:(0,g.hexConcat)([t,(0,v.VM)(this.name),e||"0x"])},n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,g.hexConcat)(["0x9061b923",X([(0,v.Kn)(this.name),r.data])]));try{let o=yield this.provider.call(r);return(0,g.arrayify)(o).length%32==4&&L.throwError("resolver threw error",i.Logger.errors.CALL_EXCEPTION,{transaction:r,data:o}),n&&(o=Z(o,0)),o}catch(s){if(s.code===i.Logger.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(t,e){return B(this,void 0,void 0,function*(){let r=yield this._fetch(t,e);return null!=r?Z(r,0):null})}_getAddress(t,e){let r=z[String(t)];if(null==r&&L.throwError(`unsupported coin type: ${t}`,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);let n=(0,g.arrayify)(e);if(null!=r.p2pkh){let o=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){let s=parseInt(o[1],16);if(o[2].length===2*s&&s>=1&&s<=75)return Q((0,g.concat)([[r.p2pkh],"0x"+o[2]]))}}if(null!=r.p2sh){let a=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){let u=parseInt(a[1],16);if(a[2].length===2*u&&u>=1&&u<=75)return Q((0,g.concat)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){let l=n[1],h=n[0];if(0===h?20!==l&&32!==l&&(h=-1):h=-1,h>=0&&n.length===2+l&&l>=1&&l<=75){let c=S().toWords(n.slice(2));return c.unshift(h),S().encode(r.prefix,c)}}return null}getAddress(t){return B(this,void 0,void 0,function*(){if(null==t&&(t=60),60===t)try{let e=yield this._fetch("0x3b3b57de");if("0x"===e||e===y.R)return null;return this.provider.formatter.callAddress(e)}catch(r){if(r.code===i.Logger.errors.CALL_EXCEPTION)return null;throw r}let n=yield this._fetchBytes("0xf1cb7e06",H(t));if(null==n||"0x"===n)return null;let o=this._getAddress(t,n);return null==o&&L.throwError("invalid or unsupported coin data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:n}),o})}getAvatar(){return B(this,void 0,void 0,function*(){let t=[{type:"name",content:this.name}];try{let e=yield this.getText("avatar");if(null==e)return null;for(let r=0;ru[t]);return"sia://"+l}return L.throwError("invalid or unsupported content hash data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})})}getText(t){return B(this,void 0,void 0,function*(){let e=(0,A.Y0)(t);(e=(0,g.concat)([H(64),H(e.length),e])).length%32!=0&&(e=(0,g.concat)([e,(0,g.hexZeroPad)("0x",32-t.length%32)]));let r=yield this._fetchBytes("0x59d1d43c",(0,g.hexlify)(e));return null==r||"0x"===r?null:(0,A.ZN)(r)})}}let te=null,tr=1;class tn extends n.zt{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,b.defineReadOnly)(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch(t=>{}),this._ready().catch(t=>{});else{let e=(0,b.getStatic)(new.target,"getNetwork")(t);e?((0,b.defineReadOnly)(this,"_network",e),this.emit("network",e,null)):L.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return B(this,void 0,void 0,function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(e){}null==t&&(t=yield this.detectNetwork()),t||L.throwError("no network detected",i.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,b.defineReadOnly)(this,"_network",t),this.emit("network",t,null))}return this._network})}get ready(){return(0,E.poll)(()=>this._ready().then(t=>t,t=>{if(t.code!==i.Logger.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))}static getFormatter(){return null==te&&(te=new O),te}static getNetwork(t){return f(null==t?"homestead":t)}ccipReadFetch(t,e,r){return B(this,void 0,void 0,function*(){if(this.disableCcipRead||0===r.length)return null;let n=t.to.toLowerCase(),o=e.toLowerCase(),s=[];for(let a=0;a=0?null:JSON.stringify({data:o,sender:n}),c=yield(0,E.fetchJson)({url:l,errorPassThrough:!0},h,(t,e)=>(t.status=e.statusCode,t));if(c.data)return c.data;let f=c.message||"unknown error";if(c.status>=400&&c.status<500)return L.throwError(`response not found during CCIP fetch: ${f}`,i.Logger.errors.SERVER_ERROR,{url:u,errorMessage:f});s.push(f)}return L.throwError(`error encountered during CCIP fetch: ${s.map(t=>JSON.stringify(t)).join(", ")}`,i.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:s})})}_getInternalBlockNumber(t){return B(this,void 0,void 0,function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){let e=this._internalBlockNumber;try{let r=yield e;if(j()-r.respTime<=t)return r.blockNumber;break}catch(n){if(this._internalBlockNumber===e)break}}let i=j(),o=(0,b.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(t=>null,t=>t)}).then(({blockNumber:t,networkError:e})=>{if(e)throw this._internalBlockNumber===o&&(this._internalBlockNumber=null),e;let r=j();return(t=m.O$.from(t).toNumber()){this._internalBlockNumber===o&&(this._internalBlockNumber=null)}),(yield o).blockNumber})}poll(){return B(this,void 0,void 0,function*(){let t=tr++,e=[],r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){this.emit("error",n);return}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r===this._lastBlockNumber){this.emit("didPoll",t);return}if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)L.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",L.makeError("network block skew detected",i.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let o=this._emitted.block+1;o<=r;o++)this.emit("block",o);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(t=>{if("block"===t)return;let e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]})),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach(t=>{switch(t.type){case"tx":{let n=t.hash,i=this.getTransactionReceipt(n).then(t=>(t&&null!=t.blockNumber&&(this._emitted["t:"+n]=t.blockNumber,this.emit(n,t)),null)).catch(t=>{this.emit("error",t)});e.push(i);break}case"filter":if(!t._inflight){t._inflight=!0,-2===t._lastBlockNumber&&(t._lastBlockNumber=r-1);let o=t.filter;o.fromBlock=t._lastBlockNumber+1,o.toBlock=r;let s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);let a=this.getLogs(o).then(e=>{t._inflight=!1,0!==e.length&&e.forEach(e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(o,e)})}).catch(e=>{this.emit("error",e),t._inflight=!1});e.push(a)}}}),this._lastBlockNumber=r,Promise.all(e).then(()=>{this.emit("didPoll",t)}).catch(t=>{this.emit("error",t)})})}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return B(this,void 0,void 0,function*(){return L.throwError("provider does not support network detection",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return B(this,void 0,void 0,function*(){let t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield q(0),this._network;let r=L.makeError("underlying network changed",i.Logger.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(t=>{this._setFastBlockNumber(t)},t=>{}),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){let t=j();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then(t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(t){(null==this._fastBlockNumber||!(tthis._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return B(this,void 0,void 0,function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)})}_waitForTransaction(t,e,r,n){return B(this,void 0,void 0,function*(){let o=yield this.getTransactionReceipt(t);return(o?o.confirmations:0)>=e?o:new Promise((o,s)=>{let a=[],u=!1,l=function(){return!!u||(u=!0,a.forEach(t=>{t()}),!1)},h=t=>{t.confirmations{this.removeListener(t,h)}),n){let c=n.startBlock,f=null,d=r=>B(this,void 0,void 0,function*(){u||(yield q(1e3),this.getTransactionCount(n.from).then(o=>B(this,void 0,void 0,function*(){if(!u){if(o<=n.nonce)c=r;else{{let a=yield this.getTransaction(t);if(a&&null!=a.blockNumber)return}for(null==f&&(f=c-3){u||this.once("block",d)}))});if(u)return;this.once("block",d),a.push(()=>{this.removeListener("block",d)})}if("number"==typeof r&&r>0){let p=setTimeout(()=>{l()||s(L.makeError("timeout exceeded",i.Logger.errors.TIMEOUT,{timeout:r}))},r);p.unref&&p.unref(),a.push(()=>{clearTimeout(p)})}})})}getBlockNumber(){return B(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return B(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield this.perform("getGasPrice",{});try{return m.O$.from(t)}catch(e){return L.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}})}getBalance(t,e){return B(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,b.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return m.O$.from(n)}catch(o){return L.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:o})}})}getTransactionCount(t,e){return B(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,b.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return m.O$.from(n).toNumber()}catch(o){return L.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:o})}})}getCode(t,e){return B(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,b.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return(0,g.hexlify)(n)}catch(o){return L.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:o})}})}getStorageAt(t,e,r){return B(this,void 0,void 0,function*(){yield this.getNetwork();let n=yield(0,b.resolveProperties)({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then(t=>(0,g.hexValue)(t))}),o=yield this.perform("getStorageAt",n);try{return(0,g.hexlify)(o)}catch(s){return L.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:s})}})}_wrapTransaction(t,e,r){if(null!=e&&32!==(0,g.hexDataLength)(e))throw Error("invalid response - sendTransaction");let n=t;return null!=e&&t.hash!==e&&L.throwError("Transaction hash mismatch from Provider.sendTransaction.",i.Logger.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>B(this,void 0,void 0,function*(){let o;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(o={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});let s=yield this._waitForTransaction(t.hash,e,n,o);return null==s&&0===e?null:(this._emitted["t:"+t.hash]=s.blockNumber,0===s.status&&L.throwError("transaction failed",i.Logger.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:s}),s)}),n}sendTransaction(t){return B(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield Promise.resolve(t).then(t=>(0,g.hexlify)(t)),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);let n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{let i=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,i,n)}catch(o){throw o.transaction=r,o.transactionHash=r.hash,o}})}_getTransactionRequest(t){return B(this,void 0,void 0,function*(){let e=yield t,r={};return["from","to"].forEach(t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then(t=>t?this._getAddress(t):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then(t=>t?m.O$.from(t):null))}),["type"].forEach(t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then(t=>null!=t?t:null))}),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach(t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then(t=>t?(0,g.hexlify)(t):null))}),this.formatter.transactionRequest((yield(0,b.resolveProperties)(r)))})}_getFilter(t){return B(this,void 0,void 0,function*(){t=yield t;let e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach(r=>{null!=t[r]&&(e[r]=t[r])}),["fromBlock","toBlock"].forEach(r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))}),this.formatter.filter((yield(0,b.resolveProperties)(e)))})}_call(t,e,r){return B(this,void 0,void 0,function*(){r>=10&&L.throwError("CCIP read exceeded maximum redirections",i.Logger.errors.SERVER_ERROR,{redirects:r,transaction:t});let n=t.to,o=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===o.substring(0,10)&&(0,g.hexDataLength)(o)%32==4)try{let s=(0,g.hexDataSlice)(o,4),a=(0,g.hexDataSlice)(s,0,32);m.O$.from(a).eq(n)||L.throwError("CCIP Read sender did not match",i.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:o});let u=[],l=m.O$.from((0,g.hexDataSlice)(s,32,64)).toNumber(),h=m.O$.from((0,g.hexDataSlice)(s,l,l+32)).toNumber(),c=(0,g.hexDataSlice)(s,l+32);for(let f=0;fB(this,void 0,void 0,function*(){let t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let i=null;for(let o=0;othis._wrapTransaction(t)),u}return this.formatter.block(t)}),{oncePoll:this})})}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return B(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;let e={transactionHash:this.formatter.hash(t,!0)};return(0,E.poll)(()=>B(this,void 0,void 0,function*(){let r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;let n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let i=yield this._getInternalBlockNumber(100+2*this.pollingInterval),o=i-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(t){return B(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;let e={transactionHash:this.formatter.hash(t,!0)};return(0,E.poll)(()=>B(this,void 0,void 0,function*(){let r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;let n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let i=yield this._getInternalBlockNumber(100+2*this.pollingInterval),o=i-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return n}),{oncePoll:this})})}getLogs(t){return B(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield(0,b.resolveProperties)({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach(t=>{null==t.removed&&(t.removed=!1)}),O.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return B(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(t){return B(this,void 0,void 0,function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&L.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return(e+=t)<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)})}getResolver(t){return B(this,void 0,void 0,function*(){let e=t;for(;;){if(""===e||"."===e||"eth"!==t&&"eth"===e)return null;let r=yield this._getResolver(e,"getResolver");if(null!=r){let n=new tt(this,r,t);if(e!==t&&!(yield n.supportsWildcard()))return null;return n}e=e.split(".").slice(1).join(".")}})}_getResolver(t,e){return B(this,void 0,void 0,function*(){null==e&&(e="ENS");let r=yield this.getNetwork();r.ensAddress||L.throwError("network does not support ENS",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{let n=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+(0,v.VM)(t).substring(2)});return this.formatter.callAddress(n)}catch(o){}return null})}resolveName(t){return B(this,void 0,void 0,function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if((0,g.isHexString)(t))throw e}"string"!=typeof t&&L.throwArgumentError("invalid ENS name","name",t);let r=yield this.getResolver(t);return r?yield r.getAddress():null})}lookupAddress(t){return B(this,void 0,void 0,function*(){t=yield t,t=this.formatter.address(t);let e=t.substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;let n=V((yield this.call({to:r,data:"0x691f3431"+(0,v.VM)(e).substring(2)})),0),i=yield this.resolveName(n);return i!=t?null:n})}getAvatar(t){return B(this,void 0,void 0,function*(){let e=null;if((0,g.isHexString)(t)){let r=this.formatter.address(t),n=r.substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(n,"getAvatar");if(!o)return null;e=new tt(this,o,n);try{let s=yield e.getAvatar();if(s)return s.url}catch(a){if(a.code!==i.Logger.errors.CALL_EXCEPTION)throw a}try{let u=V((yield this.call({to:o,data:"0x691f3431"+(0,v.VM)(n).substring(2)})),0);e=yield this.getResolver(u)}catch(l){if(l.code!==i.Logger.errors.CALL_EXCEPTION)throw l;return null}}else if(!(e=yield this.getResolver(t)))return null;let h=yield e.getAvatar();return null==h?null:h.url})}perform(t,e){return L.throwError(t+" not implemented",i.Logger.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter(t=>t.pollable()).length>0}_stopEvent(t){this.polling=this._events.filter(t=>t.pollable()).length>0}_addEventListener(t,e,r){let n=new G(U(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],i=U(t);return this._events=this._events.filter(t=>t.tag!==i||(setTimeout(()=>{t.listener.apply(this,e)},0),r=!0,!t.once||(n.push(t),!1))),n.forEach(t=>{this._stopEvent(t)}),r}listenerCount(t){if(!t)return this._events.length;let e=U(t);return this._events.filter(t=>t.tag===e).length}listeners(t){if(null==t)return this._events.map(t=>t.listener);let e=U(t);return this._events.filter(t=>t.tag===e).map(t=>t.listener)}off(t,e){if(null==e)return this.removeAllListeners(t);let r=[],n=!1,i=U(t);return this._events=this._events.filter(t=>t.tag!==i||t.listener!=e||!!n||(n=!0,r.push(t),!1)),r.forEach(t=>{this._stopEvent(t)}),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{let r=U(t);this._events=this._events.filter(t=>t.tag!==r||(e.push(t),!1))}return e.forEach(t=>{this._stopEvent(t)}),this}}var ti=r(48088),to=r(67827),ts=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let ta=new i.Logger(M),tu=["call","estimateGas"];function tl(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){let r=(0,g.isHexString)(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"==typeof t){for(let n in t){let i=tl(t[n],e);if(i)return i}return null}if("string"==typeof t)try{return tl(JSON.parse(t),e)}catch(o){}return null}function th(t,e,r){let n=r.transaction||r.signedTransaction;if("call"===t){let o=tl(e,!0);if(o)return o.data;ta.throwError("missing revert data in call exception; Transaction reverted without a reason string",i.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let s=tl(e.body,!1);null==s&&(s=tl(e,!1)),s&&ta.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let a=e.message;throw e.code===i.Logger.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?a=e.error.message:"string"==typeof e.body?a=e.body:"string"==typeof e.responseText&&(a=e.responseText),(a=(a||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ta.throwError("insufficient funds for intrinsic transaction cost",i.Logger.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),a.match(/nonce (is )?too low/i)&&ta.throwError("nonce has already been used",i.Logger.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ta.throwError("replacement fee too low",i.Logger.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),a.match(/only replay-protected/i)&&ta.throwError("legacy pre-eip-155 transactions not supported",i.Logger.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),tu.indexOf(t)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ta.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function tc(t){return new Promise(function(e){setTimeout(e,t)})}function tf(t){if(t.error){let e=Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function td(t){return t?t.toLowerCase():t}let tp={};class tm extends ti.Signer{constructor(t,e,r){if(super(),t!==tp)throw Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,b.defineReadOnly)(this,"provider",e),null==r&&(r=0),"string"==typeof r?((0,b.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,b.defineReadOnly)(this,"_index",null)):"number"==typeof r?((0,b.defineReadOnly)(this,"_index",r),(0,b.defineReadOnly)(this,"_address",null)):ta.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return ta.throwError("cannot alter JSON-RPC Signer connection",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new tg(tp,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(t=>(t.length<=this._index&&ta.throwError("unknown account #"+this._index,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index])))}sendUncheckedTransaction(t){t=(0,b.shallowCopy)(t);let e=this.getAddress().then(t=>(t&&(t=t.toLowerCase()),t));if(null==t.gasLimit){let r=(0,b.shallowCopy)(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then(t=>ts(this,void 0,void 0,function*(){if(null==t)return null;let e=yield this.provider.resolveName(t);return null==e&&ta.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))),(0,b.resolveProperties)({tx:(0,b.resolveProperties)(t),sender:e}).then(({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&ta.throwArgumentError("from address mismatch","transaction",t):e.from=r;let n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then(t=>t,t=>("string"==typeof t.message&&t.message.match(/user denied/i)&&ta.throwError("user rejected transaction",i.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:e}),th("sendTransaction",t,n)))})}signTransaction(t){return ta.throwError("signing transactions is unsupported",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return ts(this,void 0,void 0,function*(){let e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield(0,E.poll)(()=>ts(this,void 0,void 0,function*(){let t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}})}signMessage(t){return ts(this,void 0,void 0,function*(){let e="string"==typeof t?(0,A.Y0)(t):t,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,g.hexlify)(e),r.toLowerCase()])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&ta.throwError("user rejected signing",i.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:t}),n}})}_legacySignMessage(t){return ts(this,void 0,void 0,function*(){let e="string"==typeof t?(0,A.Y0)(t):t,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,g.hexlify)(e)])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&ta.throwError("user rejected signing",i.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:t}),n}})}_signTypedData(t,e,r){return ts(this,void 0,void 0,function*(){let n=yield to.E.resolveNames(t,e,r,t=>this.provider.resolveName(t)),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(to.E.getPayload(n.domain,e,n.value))])}catch(s){throw"string"==typeof s.message&&s.message.match(/user denied/i)&&ta.throwError("user rejected signing",i.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:e,value:n.value}}),s}})}unlock(t){return ts(this,void 0,void 0,function*(){let e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])})}}class tg extends tm{sendTransaction(t){return this.sendUncheckedTransaction(t).then(t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)}))}}let ty={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class tv extends tn{constructor(t,e){let r=e;null==r&&(r=new Promise((t,e)=>{setTimeout(()=>{this.detectNetwork().then(e=>{t(e)},t=>{e(t)})},0)})),super(r),t||(t=(0,b.getStatic)(this.constructor,"defaultUrl")()),"string"==typeof t?(0,b.defineReadOnly)(this,"connection",Object.freeze({url:t})):(0,b.defineReadOnly)(this,"connection",Object.freeze((0,b.shallowCopy)(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return ts(this,void 0,void 0,function*(){yield tc(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(r){try{t=yield this.send("net_version",[])}catch(e){}}if(null!=t){let n=(0,b.getStatic)(this.constructor,"getNetwork");try{return n(m.O$.from(t).toNumber())}catch(o){return ta.throwError("could not detect network",i.Logger.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:o})}}return ta.throwError("could not detect network",i.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(t){return new tm(tp,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(t=>t.map(t=>this.formatter.address(t)))}send(t,e){let r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,b.deepCopy)(r),provider:this});let n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];let i=(0,E.fetchJson)(this.connection,JSON.stringify(r),tf).then(t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t),t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t});return n&&(this._cache[t]=i,setTimeout(()=>{this._cache[t]=null},0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[td(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[td(e.address),e.blockTag]];case"getCode":return["eth_getCode",[td(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[td(e.address),(0,g.hexZeroPad)(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":if(e.blockTag)return["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]];if(e.blockHash)return["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]];break;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":{let r=(0,b.getStatic)(this.constructor,"hexlifyTransaction");return["eth_call",[r(e.transaction,{from:!0}),e.blockTag]]}case"estimateGas":{let n=(0,b.getStatic)(this.constructor,"hexlifyTransaction");return["eth_estimateGas",[n(e.transaction,{from:!0})]]}case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=td(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return ts(this,void 0,void 0,function*(){if("call"===t||"estimateGas"===t){let r=e.transaction;if(r&&null!=r.type&&m.O$.from(r.type).isZero()&&null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas){let n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((e=(0,b.shallowCopy)(e)).transaction=(0,b.shallowCopy)(r),delete e.transaction.type)}}let o=this.prepareRequest(t,e);null==o&&ta.throwError(t+" not implemented",i.Logger.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(o[0],o[1])}catch(s){return th(t,s,e)}})}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;let t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then(function(r){return function n(){t.send("eth_getFilterChanges",[r]).then(function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach(function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then(function(){return t.getTransaction(e).then(function(e){return t.emit("pending",e),null})})}),n.then(function(){return tc(1e3)})}).then(function(){if(t._pendingFilter!=e){t.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){n()},0),null}).catch(t=>{})}(),r}).catch(t=>{})}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){let r=(0,b.shallowCopy)(ty);if(e)for(let n in e)e[n]&&(r[n]=!0);(0,b.checkProperties)(t,r);let i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(e){if(null==t[e])return;let r=(0,g.hexValue)(m.O$.from(t[e]));"gasLimit"===e&&(e="gas"),i[e]=r}),["from","to","data"].forEach(function(e){null!=t[e]&&(i[e]=(0,g.hexlify)(t[e]))}),t.accessList&&(i.accessList=(0,P.accessListify)(t.accessList)),i}}let tb=null;try{if(tb=WebSocket,null==tb)throw Error("inject please")}catch(tA){let tw=new i.Logger(M);tb=function(){tw.throwError("WebSockets not supported in this environment",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var tE=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let tk=new i.Logger(M),tS=1;class tM extends tv{constructor(t,e){"any"===e&&tk.throwError("WebSocketProvider does not support 'any' network yet",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),"string"==typeof t?super(t,e):super("_websocket",e),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof t?(0,b.defineReadOnly)(this,"_websocket",new tb(this.connection.url)):(0,b.defineReadOnly)(this,"_websocket",t),(0,b.defineReadOnly)(this,"_requests",{}),(0,b.defineReadOnly)(this,"_subs",{}),(0,b.defineReadOnly)(this,"_subIds",{}),(0,b.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(t=>{this.websocket.send(this._requests[t].payload)})},this.websocket.onmessage=t=>{let e=t.data,r=JSON.parse(e);if(null!=r.id){let n=String(r.id),i=this._requests[n];if(delete this._requests[n],void 0!==r.result)i.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(i.payload),response:r.result,provider:this});else{let o=null;r.error?(o=Error(r.error.message||"unknown error"),(0,b.defineReadOnly)(o,"code",r.error.code||null),(0,b.defineReadOnly)(o,"response",e)):o=Error("unknown error"),i.callback(o,void 0),this.emit("debug",{action:"response",error:o,request:JSON.parse(i.payload),provider:this})}}else if("eth_subscription"===r.method){let s=this._subs[r.params.subscription];s&&s.processFunc(r.params.result)}else console.warn("this should not happen")};let r=setInterval(()=>{this.emit("poll")},1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(t){tk.throwError("cannot reset events block on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(t){tk.throwError("cannot set polling interval on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return tE(this,void 0,void 0,function*(){return null})}set polling(t){t&&tk.throwError("cannot set polling on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(t,e){let r=tS++;return new Promise((n,i)=>{let o=JSON.stringify({method:t,params:e,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(t,e){return t?i(t):n(e)},payload:o},this._wsReady&&this.websocket.send(o)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(t,e,r){return tE(this,void 0,void 0,function*(){let n=this._subIds[t];null==n&&(n=Promise.all(e).then(t=>this.send("eth_subscribe",t)),this._subIds[t]=n);let i=yield n;this._subs[i]={tag:t,processFunc:r}})}_startEvent(t){switch(t.type){case"block":this._subscribe("block",["newHeads"],t=>{let e=m.O$.from(t.number).toNumber();this._emitted.block=e,this.emit("block",e)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],t=>{this.emit("pending",t)});break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],e=>{null==e.removed&&(e.removed=!1),this.emit(t.filter,this.formatter.filterLog(e))});break;case"tx":{let e=t=>{let e=t.hash;this.getTransactionReceipt(e).then(t=>{t&&this.emit(e,t)})};e(t),this._subscribe("tx",["newHeads"],t=>{this._events.filter(t=>"tx"===t.type).forEach(e)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}_stopEvent(t){let e=t.tag;if("tx"===t.type){if(this._events.filter(t=>"tx"===t.type).length)return;e="tx"}else if(this.listenerCount(t.event))return;let r=this._subIds[e];r&&(delete this._subIds[e],r.then(t=>{this._subs[t]&&(delete this._subs[t],this.send("eth_unsubscribe",[t]))}))}destroy(){return tE(this,void 0,void 0,function*(){this.websocket.readyState===tb.CONNECTING&&(yield new Promise(t=>{this.websocket.onopen=function(){t(!0)},this.websocket.onerror=function(){t(!1)}})),this.websocket.close(1e3)})}}let t_=new i.Logger(M);class tx extends tv{detectNetwork(){var t,e,r,n;let o=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return t=this,e=void 0,r=void 0,n=function*(){let t=this.network;return null==t&&((t=yield o.detectNetwork.call(this))||t_.throwError("no network detected",i.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,b.defineReadOnly)(this,"_network",t),this.emit("network",t,null))),t},new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})}}class tP extends tx{constructor(t,e){t_.checkAbstract(new.target,tP),t=(0,b.getStatic)(new.target,"getNetwork")(t),e=(0,b.getStatic)(new.target,"getApiKey")(e);let r=(0,b.getStatic)(new.target,"getUrl")(t,e);super(r,t),"string"==typeof e?(0,b.defineReadOnly)(this,"apiKey",e):null!=e&&Object.keys(e).forEach(t=>{(0,b.defineReadOnly)(this,t,e[t])})}_startPending(){t_.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(t){return t_.throwError("API provider does not support signing",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(t){return t}static getUrl(t,e){return t_.throwError("not implemented; sub-classes must override getUrl",i.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}let tC=new i.Logger(M),tO="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class tR extends tM{constructor(t,e){let r=new tN(t,e),n=r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(n,r.network),(0,b.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===tO}}class tN extends tP{static getWebSocketProvider(t,e){return new tR(t,e)}static getApiKey(t){return null==t?tO:(t&&"string"!=typeof t&&tC.throwArgumentError("invalid apiKey","apiKey",t),t)}static getUrl(t,e){let r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:tC.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:(t,r)=>(e===tO&&T(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===tO}}let tI=new i.Logger(M),tT="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class tB extends tP{isCommunityResource(){return this.apiKey===tT}static getApiKey(t){return null==t?tT:t}static getUrl(t,e){null==e&&(e=tT);let r={allowGzip:!0,url:"https://"+function(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return tI.throwArgumentError("unsupported network","name",t)}(t.name)+e,throttleCallback:(t,r)=>(e.apiKey===tT&&T(),Promise.resolve(!0))};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}let tL=new i.Logger(M);class tF extends tP{static getApiKey(t){return null!=t&&tL.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}static getUrl(t,e){let r=null;return"homestead"===t.name?r="https://cloudflare-eth.com/":tL.throwArgumentError("unsupported network","network",arguments[0]),r}perform(t,e){var r,n,i,o;let s=Object.create(null,{perform:{get:()=>super.perform}});return r=this,n=void 0,i=void 0,o=function*(){if("getBlockNumber"===t){let r=yield s.perform.call(this,"getBlock",{blockTag:"latest"});return r.number}return s.perform.call(this,t,e)},new(i||(i=Promise))(function(t,e){function s(t){try{u(o.next(t))}catch(r){e(r)}}function a(t){try{u(o.throw(t))}catch(r){e(r)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof i?r:new i(function(t){t(r)})).then(s,a)}u((o=o.apply(r,n||[])).next())})}}var tD=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let tU=new i.Logger(M);function tj(t){let e={};for(let r in t){if(null==t[r])continue;let n=t[r];("type"!==r||0!==n)&&(n=({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0})[r]?(0,g.hexValue)((0,g.hexlify)(n)):"accessList"===r?"["+(0,P.accessListify)(n).map(t=>`{address:"${t.address}",storageKeys:["${t.storageKeys.join('","')}"]}`).join(",")+"]":(0,g.hexlify)(n),e[r]=n)}return e}function tq(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"string"!=typeof t.message||!t.message.match(/^OK/)){let e=Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function tK(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){let e=Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){let r=Error("invalid response");throw r.result=JSON.stringify(t),r}if(t.error){let n=Error(t.error.message||"unknown error");throw t.error.code&&(n.code=t.error.code),t.error.data&&(n.data=t.error.data),n}return t.result}function tG(t){if("pending"===t)throw Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}function tz(t,e,r){if("call"===t&&e.code===i.Logger.errors.SERVER_ERROR){let n=e.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){let o=n.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),(0,g.isHexString)(o))return o;tU.throwError("missing revert data in call exception",i.Logger.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let s=e.message;throw e.code===i.Logger.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?s=e.error.message:"string"==typeof e.body?s=e.body:"string"==typeof e.responseText&&(s=e.responseText)),(s=(s||"").toLowerCase()).match(/insufficient funds/)&&tU.throwError("insufficient funds for intrinsic transaction cost",i.Logger.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),s.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&tU.throwError("nonce has already been used",i.Logger.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),s.match(/another transaction with same nonce/)&&tU.throwError("replacement fee too low",i.Logger.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),s.match(/execution failed due to an exception|execution reverted/)&&tU.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class tH extends tn{constructor(t,e){super(t),(0,b.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,b.defineReadOnly)(this,"apiKey",e||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return tU.throwArgumentError("unsupported network","network",this.network.name)}getUrl(t,e){let r=Object.keys(e).reduce((t,r)=>{let n=e[r];return null!=n&&(t+=`&${r}=${n}`),t},""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${t}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(t,e){return e.module=t,e.apikey=this.apiKey,e}fetch(t,e,r){return tD(this,void 0,void 0,function*(){let n=r?this.getPostUrl():this.getUrl(t,e),i=r?this.getPostData(t,e):null;this.emit("debug",{action:"request",request:n,provider:this});let o={url:n,throttleSlotInterval:1e3,throttleCallback:(t,e)=>(this.isCommunityResource()&&T(),Promise.resolve(!0))},s=null;i&&(o.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map(t=>`${t}=${i[t]}`).join("&"));let a=yield(0,E.fetchJson)(o,s,("proxy"===t?tK:tq)||tK);return this.emit("debug",{action:"response",request:n,response:(0,b.deepCopy)(a),provider:this}),a})}detectNetwork(){return tD(this,void 0,void 0,function*(){return this.network})}perform(t,e){let r=Object.create(null,{perform:{get:()=>super.perform}});return tD(this,void 0,void 0,function*(){switch(t){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(t=>tz("sendTransaction",t,e.signedTransaction));case"getBlock":if(e.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});throw Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.transactionHash});case"call":{if("latest"!==e.blockTag)throw Error("EtherscanProvider does not support blockTag for call");let n=tj(e.transaction);n.module="proxy",n.action="eth_call";try{return yield this.fetch("proxy",n,!0)}catch(o){return tz("call",o,e.transaction)}}case"estimateGas":{let s=tj(e.transaction);s.module="proxy",s.action="eth_estimateGas";try{return yield this.fetch("proxy",s,!0)}catch(a){return tz("estimateGas",a,e.transaction)}}case"getLogs":{let u={action:"getLogs"};if(e.filter.fromBlock&&(u.fromBlock=tG(e.filter.fromBlock)),e.filter.toBlock&&(u.toBlock=tG(e.filter.toBlock)),e.filter.address&&(u.address=e.filter.address),e.filter.topics&&e.filter.topics.length>0&&(e.filter.topics.length>1&&tU.throwError("unsupported topic count",i.Logger.errors.UNSUPPORTED_OPERATION,{topics:e.filter.topics}),1===e.filter.topics.length)){let l=e.filter.topics[0];("string"!=typeof l||66!==l.length)&&tU.throwError("unsupported topic format",i.Logger.errors.UNSUPPORTED_OPERATION,{topic0:l}),u.topic0=l}let h=yield this.fetch("logs",u),c={};for(let f=0;f{["contractAddress","to"].forEach(function(e){""==t[e]&&delete t[e]}),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);let e=this.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e})})}isCommunityResource(){return null==this.apiKey}}var tQ=r(52472),tW=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let tJ=new i.Logger(M);function tV(){return new Date().getTime()}function tZ(t){let e=null;for(let r=0;re?null:(n+i)/2}function t$(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(m.O$.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(t=>t$(t)));if("object"==typeof t){let e=Object.keys(t);return e.sort(),"{"+e.map(e=>{let r=t[e];return r="function"==typeof r?"[function]":t$(r),JSON.stringify(e)+":"+r}).join(",")+"}"}throw Error("unknown value type: "+typeof t)}let tX=1;function t0(t){let e=null,r=null,n=new Promise(n=>{r=setTimeout(e=function(){r&&(clearTimeout(r),r=null),n()},t)}),i=t=>n=n.then(t);return{cancel:e,getPromise:function(){return n},wait:i}}let t1=[i.Logger.errors.CALL_EXCEPTION,i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED,i.Logger.errors.UNPREDICTABLE_GAS_LIMIT],t2=["address","args","errorArgs","errorSignature","method","transaction"];function t3(t,e){let r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function t6(t,e){return tW(this,void 0,void 0,function*(){let r=t.provider;return null!=r.blockNumber&&r.blockNumber>=e||-1===e?r:(0,E.poll)(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}class t4 extends tn{constructor(t,e){0===t.length&&tJ.throwArgumentError("missing providers","providers",t);let r=t.map((t,e)=>{if(n.zt.isProvider(t)){let r=N(t)?2e3:750;return Object.freeze({provider:t,weight:1,stallTimeout:r,priority:1})}let i=(0,b.shallowCopy)(t);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=N(t)?2e3:750),null==i.weight&&(i.weight=1);let o=i.weight;return(o%1||o>512||o<1)&&tJ.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${e}].weight`,o),Object.freeze(i)}),i=r.reduce((t,e)=>t+e.weight,0);null==e?e=i/2:e>i&&tJ.throwArgumentError("quorum will always fail; larger than total weight","quorum",e);let o=tZ(r.map(t=>t.provider.network));null==o&&(o=new Promise((t,e)=>{setTimeout(()=>{this.detectNetwork().then(t,e)},0)})),super(o),(0,b.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,b.defineReadOnly)(this,"quorum",e),this._highestBlockNumber=-1}detectNetwork(){return tW(this,void 0,void 0,function*(){let t=yield Promise.all(this.providerConfigs.map(t=>t.provider.getNetwork()));return tZ(t)})}perform(t,e){return tW(this,void 0,void 0,function*(){if("sendTransaction"===t){let r=yield Promise.all(this.providerConfigs.map(t=>t.provider.sendTransaction(e.signedTransaction).then(t=>t.hash,t=>t)));for(let n=0;nt.result),n=tY(e.map(t=>t.result),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){let e=t.map(t=>t.result);return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return tY(t.map(t=>t.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":o=function(t){return null==t?null:((t=(0,b.shallowCopy)(t)).confirmations=-1,t$(t))};break;case"getBlock":o=r.includeTransactions?function(t){return null==t?null:((t=(0,b.shallowCopy)(t)).transactions=t.transactions.map(t=>((t=(0,b.shallowCopy)(t)).confirmations=-1,t)),t$(t))}:function(t){return null==t?null:t$(t)};break;default:throw Error("unknown method: "+e)}return n=o,i=t.quorum,function(t){let e={};t.forEach(t=>{let r=n(t.result);e[r]||(e[r]={count:0,result:t.result}),e[r].count++});let r=Object.keys(e);for(let o=0;o=i)return s.result}}}(this,t,e),a=(0,tQ.y)(this.providerConfigs.map(b.shallowCopy));a.sort((t,e)=>t.priority-e.priority);let u=this._highestBlockNumber,l=0,h=!0;for(;;){let c=tV(),f=a.filter(t=>t.runner&&c-t.startt+e.weight,0);for(;f{d.staller=null}),d.runner=(function(t,e,r,n){return tW(this,void 0,void 0,function*(){let o=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return o[r]();case"getEtherPrice":if(o.getEtherPrice)return o.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,g.isHexString)(n.blockTag)&&(o=yield t6(t,e)),o[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,g.isHexString)(n.blockTag)&&(o=yield t6(t,e)),o.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,g.isHexString)(n.blockTag)&&(o=yield t6(t,e)),o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":if(n.blockTag&&(0,g.isHexString)(n.blockTag)&&(o=yield t6(t,e)),"call"===r&&n.blockTag)return o[r](n.transaction,n.blockTag);return o[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return o[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&(0,g.isHexString)(s.fromBlock)||s.toBlock&&(0,g.isHexString)(s.toBlock))&&(o=yield t6(t,e)),o.getLogs(s)}}return tJ.throwError("unknown method error",i.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})})})(d,u,t,e).then(r=>{d.done=!0,d.result=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:t3(d,tV()),request:{method:t,params:(0,b.deepCopy)(e)},provider:this})},r=>{d.done=!0,d.error=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:t3(d,tV()),request:{method:t,params:(0,b.deepCopy)(e)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:t3(d,null),request:{method:t,params:(0,b.deepCopy)(e)},provider:this}),f+=d.weight}let m=[];a.forEach(t=>{!t.done&&t.runner&&(m.push(t.runner),t.staller&&m.push(t.staller.getPromise()))}),m.length&&(yield Promise.race(m));let y=a.filter(t=>t.done&&null==t.error);if(y.length>=this.quorum){let v=s(y);if(void 0!==v)return a.forEach(t=>{t.staller&&t.staller.cancel(),t.cancelled=!0}),v;h||(yield t0(100).getPromise()),h=!1}let w=a.reduce((t,e)=>{if(!e.done||null==e.error)return t;let r=e.error.code;return t1.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t},{});if(Object.keys(w).forEach(t=>{let e=w[t];if(e.weight{t.staller&&t.staller.cancel(),t.cancelled=!0});let r=e.error,n={};t2.forEach(t=>{null!=r[t]&&(n[t]=r[t])}),tJ.throwError(r.reason||r.message,t,n)}),0===a.filter(t=>!t.done).length)break}return a.forEach(t=>{t.staller&&t.staller.cancel(),t.cancelled=!0}),tJ.throwError("failed to meet quorum",i.Logger.errors.SERVER_ERROR,{method:t,params:e,results:a.map(t=>t3(t)),provider:this})})}}let t5=null,t8=new i.Logger(M),t7="84842078b09946638c03157f83405213";class t9 extends tM{constructor(t,e){let r=new et(t,e),n=r.connection;n.password&&t8.throwError("INFURA WebSocket project secrets unsupported",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});let o=n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,t),(0,b.defineReadOnly)(this,"apiKey",r.projectId),(0,b.defineReadOnly)(this,"projectId",r.projectId),(0,b.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===t7}}class et extends tP{static getWebSocketProvider(t,e){return new t9(t,e)}static getApiKey(t){let e={apiKey:t7,projectId:t7,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(t8.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),t8.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:t8.throwError("unsupported network",i.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}let n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:(t,r)=>(e.projectId===t7&&T(),Promise.resolve(!0))};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}isCommunityResource(){return this.projectId===t7}}class ee extends tv{send(t,e){let r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);let n={request:r,resolve:null,reject:null},i=new Promise((t,e)=>{n.resolve=t,n.reject=e});return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{let t=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;let e=t.map(t=>t.request);return this.emit("debug",{action:"requestBatch",request:(0,b.deepCopy)(e),provider:this}),(0,E.fetchJson)(this.connection,JSON.stringify(e)).then(r=>{this.emit("debug",{action:"response",request:e,response:r,provider:this}),t.forEach((t,e)=>{let n=r[e];if(n.error){let i=Error(n.error.message);i.code=n.error.code,i.data=n.error.data,t.reject(i)}else t.resolve(n.result)})},r=>{this.emit("debug",{action:"response",error:r,request:e,provider:this}),t.forEach(t=>{t.reject(r)})})},10)),i}}let er=new i.Logger(M);class en extends tP{static getApiKey(t){return t&&"string"!=typeof t&&er.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}static getUrl(t,e){er.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:er.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}let ei=new i.Logger(M),eo="62e1ad51b37b8e00394bda3b";class es extends tP{static getApiKey(t){let e={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==t?e.applicationId=eo:"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?(e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey):t.applicationId?e.applicationId=t.applicationId:ei.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:ei.throwError("unsupported network",i.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:t})}let n=`https://${r}/v1/lb/${e.applicationId}`,o={headers:{},url:n};return null!=e.applicationSecretKey&&(o.user="",o.password=e.applicationSecretKey),o}isCommunityResource(){return this.applicationId===eo}}let ea=new i.Logger(M),eu=1;function el(t,e){let r="Web3LegacyFetcher";return function(t,n){let i={method:t,params:n,id:eu++,jsonrpc:"2.0"};return new Promise((t,n)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,b.deepCopy)(i),provider:this}),e(i,(e,o)=>{if(e)return this.emit("debug",{action:"response",fetcher:r,error:e,request:i,provider:this}),n(e);if(this.emit("debug",{action:"response",fetcher:r,request:i,response:o,provider:this}),o.error){let s=Error(o.error.message);return s.code=o.error.code,s.data=o.error.data,n(s)}t(o.result)})})}}class eh extends tv{constructor(t,e){null==t&&ea.throwArgumentError("missing provider","provider",t);let r=null,n=null,i=null;"function"==typeof t?(r="unknown:",n=t):(((r=t.host||t.path||"")||!t.isMetaMask||(r="metamask"),i=t,t.request)?(""===r&&(r="eip-1193:"),n=function(e,r){null==r&&(r=[]);let n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,b.deepCopy)(n),provider:this}),t.request(n).then(t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:t,provider:this}),t),t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:t,provider:this}),t})}):t.sendAsync?n=el(t,t.sendAsync.bind(t)):t.send?n=el(t,t.send.bind(t)):ea.throwArgumentError("unsupported provider","provider",t),r||(r="unknown:")),super(r,e),(0,b.defineReadOnly)(this,"jsonRpcFetchFunc",n),(0,b.defineReadOnly)(this,"provider",i)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}let ec=new i.Logger(M);function ef(t,e){if(null==t&&(t="homestead"),"string"==typeof t){let r=t.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new tv(t);case"ws":case"wss":return new tM(t);default:ec.throwArgumentError("unsupported URL scheme","network",t)}}let n=f(t);return n&&n._defaultProvider||ec.throwError("unsupported getDefaultProvider network",i.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),n._defaultProvider({FallbackProvider:t4,AlchemyProvider:tN,AnkrProvider:tB,CloudflareProvider:tF,EtherscanProvider:tH,InfuraProvider:et,JsonRpcProvider:tv,NodesmithProvider:en,PocketProvider:es,Web3Provider:eh,IpcProvider:t5},e)}},22118:function(t,e,r){"use strict";r.r(e),r.d(e,{randomBytes:function(){return n.O},shuffled:function(){return i.y}});var n=r(5634),i=r(52472)},5634:function(t,e,r){"use strict";r.d(e,{O:function(){return u}});var n=r(16441),i=r(1581);let o=new i.Logger("random/5.7.0"),s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw Error("unable to locate global object")}(),a=s.crypto||s.msCrypto;function u(t){(t<=0||t>1024||t%1||t!=t)&&o.throwArgumentError("invalid length","length",t);let e=new Uint8Array(t);return a.getRandomValues(e),(0,n.arrayify)(e)}a&&a.getRandomValues||(o.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(t){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},52472:function(t,e,r){"use strict";function n(t){t=t.slice();for(let e=t.length-1;e>0;e--){let r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}r.d(e,{y:function(){return n}})},59052:function(t,e,r){"use strict";r.r(e),r.d(e,{decode:function(){return c},encode:function(){return u}});var n=r(16441),i=r(1581);let o=new i.Logger("rlp/5.7.0");function s(t){let e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function a(t,e,r){let n=0;for(let i=0;ie+1+n&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:s}}function h(t,e){if(0===t.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),t[e]>=248){let r=t[e]-247;e+1+r>t.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});let s=a(t,e+1,r);return e+1+r+s>t.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(t,e,e+1+r,r+s)}if(t[e]>=192){let u=t[e]-192;return e+1+u>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(t,e,e+1,u)}if(t[e]>=184){let h=t[e]-183;e+1+h>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});let c=a(t,e+1,h);e+1+h+c>t.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});let f=(0,n.hexlify)(t.slice(e+1+h,e+1+h+c));return{consumed:1+h+c,result:f}}if(t[e]>=128){let d=t[e]-128;e+1+d>t.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{});let p=(0,n.hexlify)(t.slice(e+1,e+1+d));return{consumed:1+d,result:p}}return{consumed:1,result:(0,n.hexlify)(t[e])}}function c(t){let e=(0,n.arrayify)(t),r=h(e,0);return r.consumed!==e.length&&o.throwArgumentError("invalid rlp data","data",t),r.result}},91278:function(t,e,r){"use strict";r.r(e),r.d(e,{SupportedAlgorithm:function(){return i.p},computeHmac:function(){return n.Gy},ripemd160:function(){return n.bP},sha256:function(){return n.JQ},sha512:function(){return n.o}});var n=r(2006),i=r(21261)},2006:function(t,e,r){"use strict";r.d(e,{Gy:function(){return f},bP:function(){return l},JQ:function(){return h},o:function(){return c}});var n=r(33715),i=r.n(n),o=r(16441),s=r(21261),a=r(1581);let u=new a.Logger("sha2/5.7.0");function l(t){return"0x"+i().ripemd160().update((0,o.arrayify)(t)).digest("hex")}function h(t){return"0x"+i().sha256().update((0,o.arrayify)(t)).digest("hex")}function c(t){return"0x"+i().sha512().update((0,o.arrayify)(t)).digest("hex")}function f(t,e,r){return s.p[t]||u.throwError("unsupported algorithm "+t,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+i().hmac(i()[t],(0,o.arrayify)(e)).update((0,o.arrayify)(r)).digest("hex")}},21261:function(t,e,r){"use strict";var n,i;r.d(e,{p:function(){return n}}),(i=n||(n={})).sha256="sha256",i.sha512="sha512"},67669:function(t,e,r){"use strict";r.r(e),r.d(e,{SigningKey:function(){return G},computePublicKey:function(){return H},recoverPublicKey:function(){return z}});var n=r(42500),i=r.n(n),o=r(33715),s=r.n(o);function a(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(t,null==e?r.path:e)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var u=l;function l(t,e){if(!t)throw Error(e||"Assertion failed")}l.equal=function(t,e,r){if(t!=e)throw Error(r||"Assertion failed: "+t+" != "+e)};var h=a(function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}}),c=a(function(t,e){var r=e;r.assert=u,r.toArray=h.toArray,r.zero2=h.zero2,r.toHex=h.toHex,r.encode=h.encode,r.getNAF=function(t,e,r){var n=Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o,s,a,u=t.andln(3)+n&3,l=e.andln(3)+i&3;3===u&&(u=-1),3===l&&(l=-1),s=(1&u)==0?0:(3==(o=t.andln(7)+n&7)||5===o)&&2===l?-u:u,r[0].push(s),a=(1&l)==0?0:(3==(o=e.andln(7)+i&7)||5===o)&&2===u?-l:l,r[1].push(a),2*n===s+1&&(n=1-n),2*i===a+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new(i())(t,"hex","le")}}),f=c.getNAF,d=c.getJSF,p=c.assert;function m(t,e){this.type=t,this.p=new(i())(e.p,16),this.red=e.prime?i().red(e.prime):i().mont(this.p),this.zero=new(i())(0).toRed(this.red),this.one=new(i())(1).toRed(this.red),this.two=new(i())(2).toRed(this.red),this.n=e.n&&new(i())(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function g(t,e){this.curve=t,this.type=e,this.precomputed=null}m.prototype.point=function(){throw Error("Not implemented")},m.prototype.validate=function(){throw Error("Not implemented")},m.prototype._fixedNafMul=function(t,e){p(t.precomputed);var r,n,i=t._getDoubles(),o=f(e,1,this._bitLength),s=(1<=r;u--)n=(n<<1)+o[u];a.push(n)}for(var l=this.jpoint(null,null,null),h=this.jpoint(null,null,null),c=s;c>0;c--){for(r=0;r=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var l=o[a];p(0!==l),s="affine"===t.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},m.prototype._wnafMulAdd=function(t,e,r,n,i){var o,s,a,u=this._wnafT1,l=this._wnafT2,h=this._wnafT3,c=0;for(o=0;o=1;o-=2){var m=o-1,g=o;if(1!==u[m]||1!==u[g]){h[m]=f(r[m],u[m],this._bitLength),h[g]=f(r[g],u[g],this._bitLength),c=Math.max(h[m].length,c),c=Math.max(h[g].length,c);continue}var y=[e[m],null,null,e[g]];0===e[m].y.cmp(e[g].y)?(y[1]=e[m].add(e[g]),y[2]=e[m].toJ().mixedAdd(e[g].neg())):0===e[m].y.cmp(e[g].y.redNeg())?(y[1]=e[m].toJ().mixedAdd(e[g]),y[2]=e[m].add(e[g].neg())):(y[1]=e[m].toJ().mixedAdd(e[g]),y[2]=e[m].toJ().mixedAdd(e[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=d(r[m],r[g]);for(s=0,c=Math.max(b[0].length,c),h[m]=Array(c),h[g]=Array(c);s=0;o--){for(var S=0;o>=0;){var M=!0;for(s=0;s=0&&S++,E=E.dblp(S),o<0)break;for(s=0;s0?a=l[s][_-1>>1]:_<0&&(a=l[s][-_-1>>1].neg()),E="affine"===a.type?E.mixedAdd(a):E.add(a))}}for(o=0;o=Math.ceil((t.bitLength()+1)/e.step)},g.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;io[0].cmp(o[1])?o[0]:o[1]).toRed(this.red)}if(t.lambda)r=new(i())(t.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))?r=s[0]:(r=s[1],v(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return n=t.basis?t.basis.map(function(t){return{a:new(i())(t.a,16),b:new(i())(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:n}}},b.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i().mont(t),r=new(i())(2).toRed(e).redInvm(),n=r.redNeg(),o=new(i())(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},b.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,l,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=t,d=this.n.clone(),p=new(i())(1),m=new(i())(0),g=new(i())(0),y=new(i())(1),v=0;0!==f.cmpn(0);){var b=d.div(f);l=d.sub(b.mul(f)),h=g.sub(b.mul(p));var w=y.sub(b.mul(m));if(!n&&0>l.cmp(c))e=u.neg(),r=p,n=l.neg(),o=h;else if(n&&2==++v)break;u=l,d=f,f=l,g=p,p=h,y=m,m=w}s=l.neg(),a=h;var A=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(A)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},b.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),l=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(l).neg()}},b.prototype.pointFromX=function(t,e){(t=new(i())(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},b.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},b.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},w.prototype.isInfinity=function(){return this.inf},w.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},w.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},w.prototype.getX=function(){return this.x.fromRed()},w.prototype.getY=function(){return this.y.fromRed()},w.prototype.mul=function(t){return(t=new(i())(t,16),this.isInfinity())?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},w.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},w.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},w.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},w.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},w.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(A,m.BasePoint),b.prototype.jpoint=function(t,e,r){return new A(this,t,e,r)},A.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},A.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},A.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),h=l.redMul(a),c=n.redMul(l),f=u.redSqr().redIAdd(h).redISub(c).redISub(c),d=u.redMul(c.redISub(f)).redISub(o.redMul(h)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(f,d,p)},A.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),h=r.redMul(u),c=a.redSqr().redIAdd(l).redISub(h).redISub(h),f=a.redMul(h.redISub(c)).redISub(i.redMul(l)),d=this.z.redMul(s);return this.curve.jpoint(c,f,d)},A.prototype.dblp=function(t){if(0===t||this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var e,r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},A.prototype.inspect=function(){return this.isInfinity()?"":""},A.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var E=a(function(t,e){var r=e;r.base=m,r.short=b,r.mont=null,r.edwards=null}),k=a(function(t,e){var r,n=e,i=c.assert;function o(t){"short"===t.type?this.curve=new E.short(t):"edwards"===t.type?this.curve=new E.edwards(t):this.curve=new E.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new o(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(u){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function S(t){if(!(this instanceof S))return new S(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=h.toArray(t.entropy,t.entropyEnc||"hex"),r=h.toArray(t.nonce,t.nonceEnc||"hex"),n=h.toArray(t.pers,t.persEnc||"hex");u(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}S.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},S.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=h.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var x=c.assert;function P(t,e){if(t instanceof P)return t;this._importDER(t,e)||(x(t.r&&t.s,"Signature without r or s"),this.r=new(i())(t.r,16),this.s=new(i())(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function C(){this.place=0}function O(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function R(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}P.prototype._importDER=function(t,e){t=c.toArray(t,e);var r=new C;if(48!==t[r.place++])return!1;var n=O(t,r);if(!1===n||n+r.place!==t.length||2!==t[r.place++])return!1;var o=O(t,r);if(!1===o)return!1;var s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var a=O(t,r);if(!1===a||t.length!==a+r.place)return!1;var u=t.slice(r.place,a+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new(i())(s),this.s=new(i())(u),this.recoveryParam=null,!0},P.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=R(e),r=R(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];N(n,e.length),(n=n.concat(e)).push(2),N(n,r.length);var i=n.concat(r),o=[48];return N(o,i.length),o=o.concat(i),c.encode(o,t)};var I=function(){throw Error("unsupported")},T=c.assert;function B(t){if(!(this instanceof B))return new B(t);"string"==typeof t&&(T(Object.prototype.hasOwnProperty.call(k,t),"Unknown curve "+t),t=k[t]),t instanceof k.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}B.prototype.keyPair=function(t){return new _(this,t)},B.prototype.keyFromPrivate=function(t,e){return _.fromPrivate(this,t,e)},B.prototype.keyFromPublic=function(t,e){return _.fromPublic(this,t,e)},B.prototype.genKeyPair=function(t){t||(t={});for(var e=new S({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||I(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(i())(2));;){var o=new(i())(e.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},B.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return(r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0)?t.sub(this.n):t},B.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new(i())(t,16));for(var o=this.n.byteLength(),s=e.getPrivate().toArray("be",o),a=t.toArray("be",o),u=new S({hash:this.hash,entropy:s,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new(i())(1)),h=0;;h++){var c=n.k?n.k(h):new(i())(u.generate(this.n.byteLength()));if(!(0>=(c=this._truncateToN(c,!0)).cmpn(1)||c.cmp(l)>=0)){var f=this.g.mul(c);if(!f.isInfinity()){var d=f.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var m=c.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var g=(f.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new P({r:p,s:m,recoveryParam:g})}}}}}},B.prototype.verify=function(t,e,r,n){t=this._truncateToN(new(i())(t,16)),r=this.keyFromPublic(r,n);var o,s=(e=new P(e,"hex")).r,a=e.s;if(0>s.cmpn(1)||s.cmp(this.n)>=0||0>a.cmpn(1)||a.cmp(this.n)>=0)return!1;var u=a.invm(this.n),l=u.mul(t).umod(this.n),h=u.mul(s).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(l,r.getPublic(),h)).isInfinity()&&o.eqXToP(s):!(o=this.g.mulAdd(l,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(s)},B.prototype.recoverPubKey=function(t,e,r,n){T((3&r)===r,"The recovery param is more than two bits"),e=new P(e,n);var o=this.n,s=new(i())(t),a=e.r,u=e.s,l=1&r,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var c=e.r.invm(o),f=o.sub(s).mul(c).umod(o),d=u.mul(c).umod(o);return this.g.mulAdd(f,a,d)},B.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new P(e,n)).recoveryParam)return e.recoveryParam;for(var i,o=0;o<4;o++){try{i=this.recoverPubKey(t,e,o)}catch(s){continue}if(i.eq(r))return o}throw Error("Unable to find valid recovery factor")};var L=a(function(t,e){var r=e;r.version="6.5.4",r.utils=c,r.rand=function(){throw Error("unsupported")},r.curve=E,r.curves=k,r.ec=B,r.eddsa=null}).ec,F=r(16441),D=r(6881),U=r(1581);let j=new U.Logger("signing-key/5.7.0"),q=null;function K(){return q||(q=new L("secp256k1")),q}class G{constructor(t){(0,D.defineReadOnly)(this,"curve","secp256k1"),(0,D.defineReadOnly)(this,"privateKey",(0,F.hexlify)(t)),32!==(0,F.hexDataLength)(this.privateKey)&&j.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let e=K().keyFromPrivate((0,F.arrayify)(this.privateKey));(0,D.defineReadOnly)(this,"publicKey","0x"+e.getPublic(!1,"hex")),(0,D.defineReadOnly)(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),(0,D.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(t){let e=K().keyFromPublic((0,F.arrayify)(this.publicKey)),r=K().keyFromPublic((0,F.arrayify)(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){let e=K().keyFromPrivate((0,F.arrayify)(this.privateKey)),r=(0,F.arrayify)(t);32!==r.length&&j.throwArgumentError("bad digest length","digest",t);let n=e.sign(r,{canonical:!0});return(0,F.splitSignature)({recoveryParam:n.recoveryParam,r:(0,F.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,F.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(t){let e=K().keyFromPrivate((0,F.arrayify)(this.privateKey)),r=K().keyFromPublic((0,F.arrayify)(H(t)));return(0,F.hexZeroPad)("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}}function z(t,e){let r=(0,F.splitSignature)(e),n={r:(0,F.arrayify)(r.r),s:(0,F.arrayify)(r.s)};return"0x"+K().recoverPubKey((0,F.arrayify)(t),n,r.recoveryParam).encode("hex",!1)}function H(t,e){let r=(0,F.arrayify)(t);if(32===r.length){let n=new G(r);return e?"0x"+K().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?e?(0,F.hexlify)(r):"0x"+K().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+K().keyFromPublic(r).getPublic(!0,"hex"):(0,F.hexlify)(r):j.throwArgumentError("invalid public or private key","key","[REDACTED]")}},42500:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{d="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(62808).Buffer}catch(s){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function l(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?t:e},o.min=function(t,e){return 0>t.cmp(e)?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;s-=3)o=t[s]|t[s-1]<<8|t[s-2]<<16,this.words[i]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(s=0,i=0;s>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var n,i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(c){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d,p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var l=1;l>>26,c=67108863&u,f=Math.min(l,e.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[l]=0|c,u=0|h}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var r,i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?p[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=m[t],h=g[t];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var f=c.modrn(h).toString(t);r=(c=c.idivn(h)).isZero()?f+r:p[l-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},d&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(d,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var e,r,n,i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&n;for(;0!==o&&s>26,this.words[s]=67108863&n;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,E=0|s[4],k=8191&E,S=E>>>13,M=0|s[5],_=8191&M,x=M>>>13,P=0|s[6],C=8191&P,O=P>>>13,R=0|s[7],N=8191&R,I=R>>>13,T=0|s[8],B=8191&T,L=T>>>13,F=0|s[9],D=8191&F,U=F>>>13,j=0|a[0],q=8191&j,K=j>>>13,G=0|a[1],z=8191&G,H=G>>>13,Q=0|a[2],W=8191&Q,J=Q>>>13,V=0|a[3],Z=8191&V,Y=V>>>13,$=0|a[4],X=8191&$,tt=$>>>13,te=0|a[5],tr=8191&te,tn=te>>>13,ti=0|a[6],to=8191&ti,ts=ti>>>13,ta=0|a[7],tu=8191&ta,tl=ta>>>13,th=0|a[8],tc=8191&th,tf=th>>>13,td=0|a[9],tp=8191&td,tm=td>>>13;r.negative=t.negative^e.negative,r.length=19;var tg=(l+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,K))+Math.imul(f,q)|0))<<13)|0;l=((o=Math.imul(f,K))+(i>>>13)|0)+(tg>>>26)|0,tg&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,K))+Math.imul(m,q)|0,o=Math.imul(m,K);var ty=(l+(n=n+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(f,z)|0))<<13)|0;l=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(ty>>>26)|0,ty&=67108863,n=Math.imul(y,q),i=(i=Math.imul(y,K))+Math.imul(v,q)|0,o=Math.imul(v,K),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,H)|0;var tv=(l+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,J)|0)+Math.imul(f,W)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(tv>>>26)|0,tv&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,K))+Math.imul(A,q)|0,o=Math.imul(A,K),n=n+Math.imul(y,z)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0;var tb=(l+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,Y)|0)+Math.imul(f,Z)|0))<<13)|0;l=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(tb>>>26)|0,tb&=67108863,n=Math.imul(k,q),i=(i=Math.imul(k,K))+Math.imul(S,q)|0,o=Math.imul(S,K),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,H)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var tw=(l+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(tw>>>26)|0,tw&=67108863,n=Math.imul(_,q),i=(i=Math.imul(_,K))+Math.imul(x,q)|0,o=Math.imul(x,K),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(S,z)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,tt)|0;var tA=(l+(n=n+Math.imul(c,tr)|0)|0)+((8191&(i=(i=i+Math.imul(c,tn)|0)+Math.imul(f,tr)|0))<<13)|0;l=((o=o+Math.imul(f,tn)|0)+(i>>>13)|0)+(tA>>>26)|0,tA&=67108863,n=Math.imul(C,q),i=(i=Math.imul(C,K))+Math.imul(O,q)|0,o=Math.imul(O,K),n=n+Math.imul(_,z)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,tr)|0,i=(i=i+Math.imul(p,tn)|0)+Math.imul(m,tr)|0,o=o+Math.imul(m,tn)|0;var tE=(l+(n=n+Math.imul(c,to)|0)|0)+((8191&(i=(i=i+Math.imul(c,ts)|0)+Math.imul(f,to)|0))<<13)|0;l=((o=o+Math.imul(f,ts)|0)+(i>>>13)|0)+(tE>>>26)|0,tE&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,K))+Math.imul(I,q)|0,o=Math.imul(I,K),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(y,tr)|0,i=(i=i+Math.imul(y,tn)|0)+Math.imul(v,tr)|0,o=o+Math.imul(v,tn)|0,n=n+Math.imul(p,to)|0,i=(i=i+Math.imul(p,ts)|0)+Math.imul(m,to)|0,o=o+Math.imul(m,ts)|0;var tk=(l+(n=n+Math.imul(c,tu)|0)|0)+((8191&(i=(i=i+Math.imul(c,tl)|0)+Math.imul(f,tu)|0))<<13)|0;l=((o=o+Math.imul(f,tl)|0)+(i>>>13)|0)+(tk>>>26)|0,tk&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(L,q)|0,o=Math.imul(L,K),n=n+Math.imul(N,z)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(w,tr)|0,i=(i=i+Math.imul(w,tn)|0)+Math.imul(A,tr)|0,o=o+Math.imul(A,tn)|0,n=n+Math.imul(y,to)|0,i=(i=i+Math.imul(y,ts)|0)+Math.imul(v,to)|0,o=o+Math.imul(v,ts)|0,n=n+Math.imul(p,tu)|0,i=(i=i+Math.imul(p,tl)|0)+Math.imul(m,tu)|0,o=o+Math.imul(m,tl)|0;var tS=(l+(n=n+Math.imul(c,tc)|0)|0)+((8191&(i=(i=i+Math.imul(c,tf)|0)+Math.imul(f,tc)|0))<<13)|0;l=((o=o+Math.imul(f,tf)|0)+(i>>>13)|0)+(tS>>>26)|0,tS&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,K))+Math.imul(U,q)|0,o=Math.imul(U,K),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,H)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,H)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(k,tr)|0,i=(i=i+Math.imul(k,tn)|0)+Math.imul(S,tr)|0,o=o+Math.imul(S,tn)|0,n=n+Math.imul(w,to)|0,i=(i=i+Math.imul(w,ts)|0)+Math.imul(A,to)|0,o=o+Math.imul(A,ts)|0,n=n+Math.imul(y,tu)|0,i=(i=i+Math.imul(y,tl)|0)+Math.imul(v,tu)|0,o=o+Math.imul(v,tl)|0,n=n+Math.imul(p,tc)|0,i=(i=i+Math.imul(p,tf)|0)+Math.imul(m,tc)|0,o=o+Math.imul(m,tf)|0;var tM=(l+(n=n+Math.imul(c,tp)|0)|0)+((8191&(i=(i=i+Math.imul(c,tm)|0)+Math.imul(f,tp)|0))<<13)|0;l=((o=o+Math.imul(f,tm)|0)+(i>>>13)|0)+(tM>>>26)|0,tM&=67108863,n=Math.imul(D,z),i=(i=Math.imul(D,H))+Math.imul(U,z)|0,o=Math.imul(U,H),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(_,tr)|0,i=(i=i+Math.imul(_,tn)|0)+Math.imul(x,tr)|0,o=o+Math.imul(x,tn)|0,n=n+Math.imul(k,to)|0,i=(i=i+Math.imul(k,ts)|0)+Math.imul(S,to)|0,o=o+Math.imul(S,ts)|0,n=n+Math.imul(w,tu)|0,i=(i=i+Math.imul(w,tl)|0)+Math.imul(A,tu)|0,o=o+Math.imul(A,tl)|0,n=n+Math.imul(y,tc)|0,i=(i=i+Math.imul(y,tf)|0)+Math.imul(v,tc)|0,o=o+Math.imul(v,tf)|0;var t_=(l+(n=n+Math.imul(p,tp)|0)|0)+((8191&(i=(i=i+Math.imul(p,tm)|0)+Math.imul(m,tp)|0))<<13)|0;l=((o=o+Math.imul(m,tm)|0)+(i>>>13)|0)+(t_>>>26)|0,t_&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,J))+Math.imul(U,W)|0,o=Math.imul(U,J),n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(C,tr)|0,i=(i=i+Math.imul(C,tn)|0)+Math.imul(O,tr)|0,o=o+Math.imul(O,tn)|0,n=n+Math.imul(_,to)|0,i=(i=i+Math.imul(_,ts)|0)+Math.imul(x,to)|0,o=o+Math.imul(x,ts)|0,n=n+Math.imul(k,tu)|0,i=(i=i+Math.imul(k,tl)|0)+Math.imul(S,tu)|0,o=o+Math.imul(S,tl)|0,n=n+Math.imul(w,tc)|0,i=(i=i+Math.imul(w,tf)|0)+Math.imul(A,tc)|0,o=o+Math.imul(A,tf)|0;var tx=(l+(n=n+Math.imul(y,tp)|0)|0)+((8191&(i=(i=i+Math.imul(y,tm)|0)+Math.imul(v,tp)|0))<<13)|0;l=((o=o+Math.imul(v,tm)|0)+(i>>>13)|0)+(tx>>>26)|0,tx&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(N,tr)|0,i=(i=i+Math.imul(N,tn)|0)+Math.imul(I,tr)|0,o=o+Math.imul(I,tn)|0,n=n+Math.imul(C,to)|0,i=(i=i+Math.imul(C,ts)|0)+Math.imul(O,to)|0,o=o+Math.imul(O,ts)|0,n=n+Math.imul(_,tu)|0,i=(i=i+Math.imul(_,tl)|0)+Math.imul(x,tu)|0,o=o+Math.imul(x,tl)|0,n=n+Math.imul(k,tc)|0,i=(i=i+Math.imul(k,tf)|0)+Math.imul(S,tc)|0,o=o+Math.imul(S,tf)|0;var tP=(l+(n=n+Math.imul(w,tp)|0)|0)+((8191&(i=(i=i+Math.imul(w,tm)|0)+Math.imul(A,tp)|0))<<13)|0;l=((o=o+Math.imul(A,tm)|0)+(i>>>13)|0)+(tP>>>26)|0,tP&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,tt))+Math.imul(U,X)|0,o=Math.imul(U,tt),n=n+Math.imul(B,tr)|0,i=(i=i+Math.imul(B,tn)|0)+Math.imul(L,tr)|0,o=o+Math.imul(L,tn)|0,n=n+Math.imul(N,to)|0,i=(i=i+Math.imul(N,ts)|0)+Math.imul(I,to)|0,o=o+Math.imul(I,ts)|0,n=n+Math.imul(C,tu)|0,i=(i=i+Math.imul(C,tl)|0)+Math.imul(O,tu)|0,o=o+Math.imul(O,tl)|0,n=n+Math.imul(_,tc)|0,i=(i=i+Math.imul(_,tf)|0)+Math.imul(x,tc)|0,o=o+Math.imul(x,tf)|0;var tC=(l+(n=n+Math.imul(k,tp)|0)|0)+((8191&(i=(i=i+Math.imul(k,tm)|0)+Math.imul(S,tp)|0))<<13)|0;l=((o=o+Math.imul(S,tm)|0)+(i>>>13)|0)+(tC>>>26)|0,tC&=67108863,n=Math.imul(D,tr),i=(i=Math.imul(D,tn))+Math.imul(U,tr)|0,o=Math.imul(U,tn),n=n+Math.imul(B,to)|0,i=(i=i+Math.imul(B,ts)|0)+Math.imul(L,to)|0,o=o+Math.imul(L,ts)|0,n=n+Math.imul(N,tu)|0,i=(i=i+Math.imul(N,tl)|0)+Math.imul(I,tu)|0,o=o+Math.imul(I,tl)|0,n=n+Math.imul(C,tc)|0,i=(i=i+Math.imul(C,tf)|0)+Math.imul(O,tc)|0,o=o+Math.imul(O,tf)|0;var tO=(l+(n=n+Math.imul(_,tp)|0)|0)+((8191&(i=(i=i+Math.imul(_,tm)|0)+Math.imul(x,tp)|0))<<13)|0;l=((o=o+Math.imul(x,tm)|0)+(i>>>13)|0)+(tO>>>26)|0,tO&=67108863,n=Math.imul(D,to),i=(i=Math.imul(D,ts))+Math.imul(U,to)|0,o=Math.imul(U,ts),n=n+Math.imul(B,tu)|0,i=(i=i+Math.imul(B,tl)|0)+Math.imul(L,tu)|0,o=o+Math.imul(L,tl)|0,n=n+Math.imul(N,tc)|0,i=(i=i+Math.imul(N,tf)|0)+Math.imul(I,tc)|0,o=o+Math.imul(I,tf)|0;var tR=(l+(n=n+Math.imul(C,tp)|0)|0)+((8191&(i=(i=i+Math.imul(C,tm)|0)+Math.imul(O,tp)|0))<<13)|0;l=((o=o+Math.imul(O,tm)|0)+(i>>>13)|0)+(tR>>>26)|0,tR&=67108863,n=Math.imul(D,tu),i=(i=Math.imul(D,tl))+Math.imul(U,tu)|0,o=Math.imul(U,tl),n=n+Math.imul(B,tc)|0,i=(i=i+Math.imul(B,tf)|0)+Math.imul(L,tc)|0,o=o+Math.imul(L,tf)|0;var tN=(l+(n=n+Math.imul(N,tp)|0)|0)+((8191&(i=(i=i+Math.imul(N,tm)|0)+Math.imul(I,tp)|0))<<13)|0;l=((o=o+Math.imul(I,tm)|0)+(i>>>13)|0)+(tN>>>26)|0,tN&=67108863,n=Math.imul(D,tc),i=(i=Math.imul(D,tf))+Math.imul(U,tc)|0,o=Math.imul(U,tf);var tI=(l+(n=n+Math.imul(B,tp)|0)|0)+((8191&(i=(i=i+Math.imul(B,tm)|0)+Math.imul(L,tp)|0))<<13)|0;l=((o=o+Math.imul(L,tm)|0)+(i>>>13)|0)+(tI>>>26)|0,tI&=67108863;var tT=(l+(n=Math.imul(D,tp))|0)+((8191&(i=(i=Math.imul(D,tm))+Math.imul(U,tp)|0))<<13)|0;return l=((o=Math.imul(U,tm))+(i>>>13)|0)+(tT>>>26)|0,tT&=67108863,u[0]=tg,u[1]=ty,u[2]=tv,u[3]=tb,u[4]=tw,u[5]=tA,u[6]=tE,u[7]=tk,u[8]=tS,u[9]=tM,u[10]=t_,u[11]=tx,u[12]=tP,u[13]=tC,u[14]=tO,u[15]=tR,u[16]=tN,u[17]=tI,u[18]=tT,0!==l&&(u[19]=l,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function w(t,e){this.x=t,this.y=e}Math.imul||(v=y),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,e):n<63?y(this,t,e):b(this,t,e)},w.prototype.makeRBT=function(t){for(var e=Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},w.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=(o/67108864|0)+(s>>>26),this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var i,o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==h||l>=i);l--){var c=0|this.words[l];this.words[l]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return!(this.length<=r)&&!!(this.words[r]&1<=0);var e=t%26,r=(t-e)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==e&&r++,this.length=Math.min(r,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r,n=this.length-t.length,i=this.clone(),s=t,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),i.iushln(n),a=0|s.words[s.length-1]);var u=i.length-s.length;if("mod"!==e){(r=new o(null)).length=u+1,r.words=Array(r.length);for(var l=0;l=0;c--){var f=(0|i.words[s.length+c])*67108864+(0|i.words[s.length+c-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(s,f,c);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(s,1,c),i.isZero()||(i.negative^=1);r&&(r.words[c]=f)}return r&&r._strip(),i._strip(),"div"!==e&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(t,e,r){var i,s,a;return(n(!t.isZero()),this.isZero())?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e)},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=67108864%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),l=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++l;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;(e.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e,r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var s=new o(1),a=new o(0),u=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,h=1;(r.words[0]&h)==0&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,f=1;(i.words[0]&f)==0&&c<26;++c,f<<=1);if(c>0)for(i.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),s.isub(a)):(i.isub(r),a.isub(s))}return 0>(e=0===r.cmpn(1)?s:a).cmpn(0)&&e.iadd(t),e},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return -1===this.cmpn(t)},o.prototype.lt=function(t){return -1===this.cmp(t)},o.prototype.lten=function(t){return 0>=this.cmpn(t)},o.prototype.lte=function(t){return 0>=this.cmp(t)},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function P(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var t=new o(null);return t.words=Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},i(k,E),k.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},k.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){var e;if(A[t])return A[t];if("k256"===t)e=new k;else if("p224"===t)e=new S;else if("p192"===t)e=new M;else if("p25519"===t)e=new _;else throw Error("Unknown prime "+t);return A[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n((t.negative|e.negative)==0,"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,l).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var l=e.words[n],h=u-1;h>=0;h--){var c=l>>h&1;if(i!==r[0]&&(i=this.sqr(i)),0===c&&0===s){a=0;continue}s<<=1,s|=c,(4==++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new P(t)},i(P,x),P.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},P.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},P.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},P.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},P.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},31886:function(t,e,r){"use strict";r.r(e),r.d(e,{keccak256:function(){return p},pack:function(){return d},sha256:function(){return m}});var n=r(2593),i=r(16441),o=r(38197),s=r(2006),a=r(29251),u=r(1581);let l=RegExp("^bytes([0-9]+)$"),h=RegExp("^(u?int)([0-9]*)$"),c=RegExp("^(.*)\\[([0-9]*)\\]$"),f=new u.Logger("solidity/5.7.0");function d(t,e){t.length!=e.length&&f.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);let r=[];return t.forEach(function(t,o){r.push(function t(e,r,o){switch(e){case"address":if(o)return(0,i.zeroPad)(r,32);return(0,i.arrayify)(r);case"string":return(0,a.Y0)(r);case"bytes":return(0,i.arrayify)(r);case"bool":if(r=r?"0x01":"0x00",o)return(0,i.zeroPad)(r,32);return(0,i.arrayify)(r)}let s=e.match(h);if(s){let u=parseInt(s[2]||"256");return(s[2]&&String(u)!==s[2]||u%8!=0||0===u||u>256)&&f.throwArgumentError("invalid number type","type",e),o&&(u=256),r=n.O$.from(r).toTwos(u),(0,i.zeroPad)(r,u/8)}if(s=e.match(l)){let d=parseInt(s[1]);return((String(d)!==s[1]||0===d||d>32)&&f.throwArgumentError("invalid bytes type","type",e),(0,i.arrayify)(r).byteLength!==d&&f.throwArgumentError(`invalid value for ${e}`,"value",r),o)?(0,i.arrayify)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((s=e.match(c))&&Array.isArray(r)){let p=s[1],m=parseInt(s[2]||String(r.length));m!=r.length&&f.throwArgumentError(`invalid array length for ${e}`,"value",r);let g=[];return r.forEach(function(e){g.push(t(p,e,!0))}),(0,i.concat)(g)}return f.throwArgumentError("invalid type","type",e)}(t,e[o]))}),(0,i.hexlify)((0,i.concat)(r))}function p(t,e){return(0,o.keccak256)(d(t,e))}function m(t,e){return(0,s.JQ)(d(t,e))}},22384:function(t,e,r){"use strict";r.r(e),r.d(e,{UnicodeNormalizationForm:function(){return o.Uj},Utf8ErrorFuncs:function(){return o.te},Utf8ErrorReason:function(){return o.Uw},_toEscapedUtf8String:function(){return o.U$},formatBytes32String:function(){return s},nameprep:function(){return v},parseBytes32String:function(){return a},toUtf8Bytes:function(){return o.Y0},toUtf8CodePoints:function(){return o.XL},toUtf8String:function(){return o.ZN}});var n=r(57218),i=r(16441),o=r(29251);function s(t){let e=(0,o.Y0)(t);if(e.length>31)throw Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([e,n.R]).slice(0,32))}function a(t){let e=(0,i.arrayify)(t);if(32!==e.length)throw Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw Error("invalid bytes32 string - no null terminator");let r=31;for(;0===e[r-1];)r--;return(0,o.ZN)(e.slice(0,r))}function u(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,n={};return t.split(",").forEach(t=>{let i=t.split(":");n[r+=parseInt(i[0],16)]=e(i[1])}),n}function l(t){let e=0;return t.split(",").map(t=>{let r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}})}function h(t,e){let r=0;for(let n=0;n=(r+=i.l)&&t<=r+i.h&&(t-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-r))continue;return i}}return null}let c=l("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),f="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),d=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],p=u("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),m=u("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),g=u("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",function(t){if(t.length%4!=0)throw Error("bad data");let e=[];for(let r=0;rf.indexOf(t)>=0||t>=65024&&t<=65039?[]:function(t){let e=h(t,d);if(e)return[t+e.s];let r=p[t];if(r)return r;let n=m[t];return n?[t+n[0]]:g[t]||null}(t)||[t]).reduce((t,e)=>(e.forEach(e=>{t.push(e)}),t),[]),(e=(0,o.XL)((0,o.uu)(e),o.Uj.NFKC)).forEach(t=>{if(h(t,y))throw Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(t=>{if(h(t,c))throw Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=(0,o.uu)(e);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw Error("invalid hyphen");return r}},29251:function(t,e,r){"use strict";r.d(e,{Uj:function(){return o},te:function(){return c},Uw:function(){return s},U$:function(){return m},uu:function(){return g},Y0:function(){return d},XL:function(){return v},ZN:function(){return y}});var n,i,o,s,a=r(16441),u=r(1581);let l=new u.Logger("strings/5.7.0");function h(t,e,r,n,i){if(t===s.BAD_PREFIX||t===s.UNEXPECTED_CONTINUE){let o=0;for(let a=e+1;a>6==2;a++)o++;return o}return t===s.OVERRUN?r.length-e-1:0}(n=o||(o={})).current="",n.NFC="NFC",n.NFD="NFD",n.NFKC="NFKC",n.NFKD="NFKD",(i=s||(s={})).UNEXPECTED_CONTINUE="unexpected continuation byte",i.BAD_PREFIX="bad codepoint prefix",i.OVERRUN="string overrun",i.MISSING_CONTINUE="missing continuation byte",i.OUT_OF_RANGE="out of UTF-8 range",i.UTF16_SURROGATE="UTF-16 surrogate",i.OVERLONG="overlong representation";let c=Object.freeze({error:function(t,e,r,n,i){return l.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:h,replace:function(t,e,r,n,i){return t===s.OVERLONG?(n.push(i),0):(n.push(65533),h(t,e,r,n,i))}});function f(t,e){null==e&&(e=c.error),t=(0,a.arrayify)(t);let r=[],n=0;for(;n>7==0){r.push(i);continue}let o=null,u=null;if((224&i)==192)o=1,u=127;else if((240&i)==224)o=2,u=2047;else if((248&i)==240)o=3,u=65535;else{(192&i)==128?n+=e(s.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(s.BAD_PREFIX,n-1,t,r);continue}if(n-1+o>=t.length){n+=e(s.OVERRUN,n-1,t,r);continue}let l=i&(1<<8-o-1)-1;for(let h=0;h1114111){n+=e(s.OUT_OF_RANGE,n-1-o,t,r,l);continue}if(l>=55296&&l<=57343){n+=e(s.UTF16_SURROGATE,n-1-o,t,r,l);continue}if(l<=u){n+=e(s.OVERLONG,n-1-o,t,r,l);continue}r.push(l)}}return r}function d(t,e=o.current){e!=o.current&&(l.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(63&i|128);else if((64512&i)==55296){n++;let s=t.charCodeAt(n);if(n>=t.length||(64512&s)!=56320)throw Error("invalid utf-8 string");let u=65536+((1023&i)<<10)+(1023&s);r.push(u>>18|240),r.push(u>>12&63|128),r.push(u>>6&63|128),r.push(63&u|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return(0,a.arrayify)(r)}function p(t){let e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function m(t,e){return'"'+f(t,e).map(t=>{if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?p(t):p(((t-=65536)>>10&1023)+55296)+p((1023&t)+56320)}).join("")+'"'}function g(t){return t.map(t=>t<=65535?String.fromCharCode(t):String.fromCharCode(((t-=65536)>>10&1023)+55296,(1023&t)+56320)).join("")}function y(t,e){return g(f(t,e))}function v(t,e=o.current){return f(d(t,e))}},83875:function(t,e,r){"use strict";r.r(e),r.d(e,{TransactionTypes:function(){return i},accessListify:function(){return k},computeAddress:function(){return b},parse:function(){return C},recoverAddress:function(){return w},serialize:function(){return x}});var n,i,o=r(19485),s=r(2593),a=r(16441),u=r(21046),l=r(38197),h=r(6881),c=r(59052),f=r(67669),d=r(1581);let p=new d.Logger("transactions/5.7.0");function m(t){return"0x"===t?null:(0,o.getAddress)(t)}function g(t){return"0x"===t?u._Y:s.O$.from(t)}(n=i||(i={}))[n.legacy=0]="legacy",n[n.eip2930=1]="eip2930",n[n.eip1559=2]="eip1559";let y=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],v={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(t){let e=(0,f.computePublicKey)(t);return(0,o.getAddress)((0,a.hexDataSlice)((0,l.keccak256)((0,a.hexDataSlice)(e,1)),12))}function w(t,e){return b((0,f.recoverPublicKey)((0,a.arrayify)(t),e))}function A(t,e){let r=(0,a.stripZeros)(s.O$.from(t).toHexString());return r.length>32&&p.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function E(t,e){return{address:(0,o.getAddress)(t),storageKeys:(e||[]).map((e,r)=>(32!==(0,a.hexDataLength)(e)&&p.throwArgumentError("invalid access list storageKey",`accessList[${t}:${r}]`,e),e.toLowerCase()))}}function k(t){if(Array.isArray(t))return t.map((t,e)=>Array.isArray(t)?(t.length>2&&p.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),E(t[0],t[1])):E(t.address,t.storageKeys));let e=Object.keys(t).map(e=>{let r=t[e].reduce((t,e)=>(t[e]=!0,t),{});return E(e,Object.keys(r).sort())});return e.sort((t,e)=>t.address.localeCompare(e.address)),e}function S(t){return k(t).map(t=>[t.address,t.storageKeys])}function M(t,e){if(null!=t.gasPrice){let r=s.O$.from(t.gasPrice),n=s.O$.from(t.maxFeePerGas||0);r.eq(n)||p.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}let i=[A(t.chainId||0,"chainId"),A(t.nonce||0,"nonce"),A(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),A(t.maxFeePerGas||0,"maxFeePerGas"),A(t.gasLimit||0,"gasLimit"),null!=t.to?(0,o.getAddress)(t.to):"0x",A(t.value||0,"value"),t.data||"0x",S(t.accessList||[])];if(e){let u=(0,a.splitSignature)(e);i.push(A(u.recoveryParam,"recoveryParam")),i.push((0,a.stripZeros)(u.r)),i.push((0,a.stripZeros)(u.s))}return(0,a.hexConcat)(["0x02",c.encode(i)])}function _(t,e){let r=[A(t.chainId||0,"chainId"),A(t.nonce||0,"nonce"),A(t.gasPrice||0,"gasPrice"),A(t.gasLimit||0,"gasLimit"),null!=t.to?(0,o.getAddress)(t.to):"0x",A(t.value||0,"value"),t.data||"0x",S(t.accessList||[])];if(e){let n=(0,a.splitSignature)(e);r.push(A(n.recoveryParam,"recoveryParam")),r.push((0,a.stripZeros)(n.r)),r.push((0,a.stripZeros)(n.s))}return(0,a.hexConcat)(["0x01",c.encode(r)])}function x(t,e){if(null==t.type||0===t.type)return null!=t.accessList&&p.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),function(t,e){(0,h.checkProperties)(t,v);let r=[];y.forEach(function(e){let n=t[e.name]||[],i={};e.numeric&&(i.hexPad="left"),n=(0,a.arrayify)((0,a.hexlify)(n,i)),e.length&&n.length!==e.length&&n.length>0&&p.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=(0,a.stripZeros)(n)).length>e.maxLength&&p.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),r.push((0,a.hexlify)(n))});let n=0;if(null!=t.chainId?"number"!=typeof(n=t.chainId)&&p.throwArgumentError("invalid transaction.chainId","transaction",t):e&&!(0,a.isBytesLike)(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),0!==n&&(r.push((0,a.hexlify)(n)),r.push("0x"),r.push("0x")),!e)return c.encode(r);let i=(0,a.splitSignature)(e),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push((0,a.hexlify)(o)),r.push((0,a.stripZeros)((0,a.arrayify)(i.r))),r.push((0,a.stripZeros)((0,a.arrayify)(i.s))),c.encode(r)}(t,e);switch(t.type){case 1:return _(t,e);case 2:return M(t,e)}return p.throwError(`unsupported transaction type: ${t.type}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function P(t,e,r){try{let n=g(e[0]).toNumber();if(0!==n&&1!==n)throw Error("bad recid");t.v=n}catch(i){p.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=(0,a.hexZeroPad)(e[1],32),t.s=(0,a.hexZeroPad)(e[2],32);try{let o=(0,l.keccak256)(r(t));t.from=w(o,{r:t.r,s:t.s,recoveryParam:t.v})}catch(s){}}function C(t){let e=(0,a.arrayify)(t);if(e[0]>127)return function(t){let e=c.decode(t);9!==e.length&&6!==e.length&&p.throwArgumentError("invalid raw transaction","rawTransaction",t);let r={nonce:g(e[0]).toNumber(),gasPrice:g(e[1]),gasLimit:g(e[2]),to:m(e[3]),value:g(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=s.O$.from(e[6]).toNumber()}catch(n){return r}if(r.r=(0,a.hexZeroPad)(e[7],32),r.s=(0,a.hexZeroPad)(e[8],32),s.O$.from(r.r).isZero()&&s.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let i=r.v-27,o=e.slice(0,6);0!==r.chainId&&(o.push((0,a.hexlify)(r.chainId)),o.push("0x"),o.push("0x"),i-=2*r.chainId+8);let u=(0,l.keccak256)(c.encode(o));try{r.from=w(u,{r:(0,a.hexlify)(r.r),s:(0,a.hexlify)(r.s),recoveryParam:i})}catch(h){}r.hash=(0,l.keccak256)(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){let e=c.decode(t.slice(1));8!==e.length&&11!==e.length&&p.throwArgumentError("invalid component count for transaction type: 1","payload",(0,a.hexlify)(t));let r={type:1,chainId:g(e[0]).toNumber(),nonce:g(e[1]).toNumber(),gasPrice:g(e[2]),gasLimit:g(e[3]),to:m(e[4]),value:g(e[5]),data:e[6],accessList:k(e[7])};return 8===e.length||(r.hash=(0,l.keccak256)(t),P(r,e.slice(8),_)),r}(e);case 2:return function(t){let e=c.decode(t.slice(1));9!==e.length&&12!==e.length&&p.throwArgumentError("invalid component count for transaction type: 2","payload",(0,a.hexlify)(t));let r=g(e[2]),n=g(e[3]),i={type:2,chainId:g(e[0]).toNumber(),nonce:g(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:g(e[4]),to:m(e[5]),value:g(e[6]),data:e[7],accessList:k(e[8])};return 9===e.length||(i.hash=(0,l.keccak256)(t),P(i,e.slice(9),M)),i}(e)}return p.throwError(`unsupported transaction type: ${e[0]}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}},61744:function(t,e,r){"use strict";r.r(e),r.d(e,{commify:function(){return a},formatEther:function(){return h},formatUnits:function(){return u},parseEther:function(){return c},parseUnits:function(){return l}});var n=r(20335),i=r(1581);let o=new i.Logger("units/5.7.0"),s=["wei","kwei","mwei","gwei","szabo","finney","ether"];function a(t){let e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&o.throwArgumentError("invalid value","value",t);let r=e[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===e.length&&(i="."+(e[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);let s=[];for(;r.length;){if(r.length<=3){s.unshift(r);break}{let a=r.length-3;s.unshift(r.substring(a)),r=r.substring(0,a)}}return n+s.join(",")+i}function u(t,e){if("string"==typeof e){let r=s.indexOf(e);-1!==r&&(e=3*r)}return(0,n.S5)(t,null!=e?e:18)}function l(t,e){if("string"!=typeof t&&o.throwArgumentError("value must be a string","value",t),"string"==typeof e){let r=s.indexOf(e);-1!==r&&(e=3*r)}return(0,n.Ox)(t,null!=e?e:18)}function h(t){return u(t,18)}function c(t){return l(t,18)}},79911:function(t,e,r){"use strict";r.r(e),r.d(e,{Wallet:function(){return w},verifyMessage:function(){return A},verifyTypedData:function(){return E}});var n=r(19485),i=r(81556),o=r(48088),s=r(16441),a=r(93684),u=r(67827),l=r(84178),h=r(38197),c=r(6881),f=r(5634),d=r(67669),p=r(81964),m=r(45659),g=r(83875),y=r(1581),v=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}u((n=n.apply(t,e||[])).next())})};let b=new y.Logger("wallet/5.7.0");class w extends o.Signer{constructor(t,e){var r;if(super(),null!=(r=t)&&(0,s.isHexString)(r.privateKey,32)&&null!=r.address){let o=new d.SigningKey(t.privateKey);if((0,c.defineReadOnly)(this,"_signingKey",()=>o),(0,c.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey)),this.address!==(0,n.getAddress)(t.address)&&b.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(t){let e=t.mnemonic;return e&&e.phrase}(t)){let a=t.mnemonic;(0,c.defineReadOnly)(this,"_mnemonic",()=>({phrase:a.phrase,path:a.path||l.defaultPath,locale:a.locale||"en"}));let u=this.mnemonic,h=l.HDNode.fromMnemonic(u.phrase,null,u.locale).derivePath(u.path);(0,g.computeAddress)(h.privateKey)!==this.address&&b.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,c.defineReadOnly)(this,"_mnemonic",()=>null)}else{if(d.SigningKey.isSigningKey(t))"secp256k1"!==t.curve&&b.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,c.defineReadOnly)(this,"_signingKey",()=>t);else{"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t);let f=new d.SigningKey(t);(0,c.defineReadOnly)(this,"_signingKey",()=>f)}(0,c.defineReadOnly)(this,"_mnemonic",()=>null),(0,c.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey))}e&&!i.zt.isProvider(e)&&b.throwArgumentError("invalid provider","provider",e),(0,c.defineReadOnly)(this,"provider",e||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(t){return new w(this,t)}signTransaction(t){return(0,c.resolveProperties)(t).then(e=>{null!=e.from&&((0,n.getAddress)(e.from)!==this.address&&b.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete e.from);let r=this._signingKey().signDigest((0,h.keccak256)((0,g.serialize)(e)));return(0,g.serialize)(e,r)})}signMessage(t){return v(this,void 0,void 0,function*(){return(0,s.joinSignature)(this._signingKey().signDigest((0,a.r)(t)))})}_signTypedData(t,e,r){return v(this,void 0,void 0,function*(){let n=yield u.E.resolveNames(t,e,r,t=>(null==this.provider&&b.throwError("cannot resolve ENS names without a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:t}),this.provider.resolveName(t)));return(0,s.joinSignature)(this._signingKey().signDigest(u.E.hash(n.domain,e,n.value)))})}encrypt(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw Error("invalid callback");return e||(e={}),(0,p.HI)(this,t,e,r)}static createRandom(t){let e=(0,f.O)(16);t||(t={}),t.extraEntropy&&(e=(0,s.arrayify)((0,s.hexDataSlice)((0,h.keccak256)((0,s.concat)([e,t.extraEntropy])),0,16)));let r=(0,l.entropyToMnemonic)(e,t.locale);return w.fromMnemonic(r,t.path,t.locale)}static fromEncryptedJson(t,e,r){return(0,m.decryptJsonWallet)(t,e,r).then(t=>new w(t))}static fromEncryptedJsonSync(t,e){return new w((0,m.decryptJsonWalletSync)(t,e))}static fromMnemonic(t,e,r){return e||(e=l.defaultPath),new w(l.HDNode.fromMnemonic(t,null,r).derivePath(e))}}function A(t,e){return(0,g.recoverAddress)((0,a.r)(t),e)}function E(t,e,r,n){return(0,g.recoverAddress)(u.E.hash(t,e,r),n)}},37707:function(t,e,r){"use strict";r.r(e),r.d(e,{_fetchData:function(){return c},fetchJson:function(){return f},poll:function(){return d}});var n=r(59567),i=r(16441),o=r(6881),s=r(29251),a=r(1581);let u=new a.Logger("web/5.7.1");function l(t){return new Promise(e=>{setTimeout(e,t)})}function h(t,e){if(null==t)return null;if("string"==typeof t)return t;if((0,i.isBytesLike)(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return(0,s.ZN)(t)}catch(r){}return(0,i.hexlify)(t)}return t}function c(t,e,r){let c="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;u.assertArgument(c>0&&c%1==0,"invalid connection throttle limit","connection.throttleLimit",c);let f="object"==typeof t?t.throttleCallback:null,d="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;u.assertArgument(d>0&&d%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",d);let p="object"==typeof t&&!!t.errorPassThrough,m={},g=null,y={method:"GET"},v=!1,b=12e4;if("string"==typeof t)g=t;else if("object"==typeof t){if((null==t||null==t.url)&&u.throwArgumentError("missing URL","connection.url",t),g=t.url,"number"==typeof t.timeout&&t.timeout>0&&(b=t.timeout),t.headers)for(let w in t.headers)m[w.toLowerCase()]={key:w,value:String(t.headers[w])},["if-none-match","if-modified-since"].indexOf(w.toLowerCase())>=0&&(v=!0);if(y.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==g.substring(0,6)&&!0!==t.allowInsecureAuthentication&&u.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:t.user,password:"[REDACTED]"});let A=t.user+":"+t.password;m.authorization={key:"Authorization",value:"Basic "+(0,n.c)((0,s.Y0)(A))}}null!=t.skipFetchSetup&&(y.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(y.fetchOptions=(0,o.shallowCopy)(t.fetchOptions))}let E=RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),k=g?g.match(E):null;if(k)try{var S;let M={statusCode:200,statusMessage:"OK",headers:{"content-type":k[1]||"text/plain"},body:k[2]?(0,n.J)(k[3]):(S=k[3],(0,s.Y0)(S.replace(/%([0-9a-f][0-9a-f])/gi,(t,e)=>String.fromCharCode(parseInt(e,16)))))},_=M.body;return r&&(_=r(M.body,M)),Promise.resolve(_)}catch(x){u.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:h(k[1],k[2]),error:x,requestBody:null,requestMethod:"GET",url:g})}e&&(y.method="POST",y.body=e,null==m["content-type"]&&(m["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==m["content-length"]&&(m["content-length"]={key:"Content-Length",value:String(e.length)}));let P={};Object.keys(m).forEach(t=>{let e=m[t];P[e.key]=e.value}),y.headers=P;let C=function(){let t=null,e=new Promise(function(e,r){b&&(t=setTimeout(()=>{null!=t&&(t=null,r(u.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:h(y.body,P["content-type"]),requestMethod:y.method,timeout:b,url:g})))},b))});return{promise:e,cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),O=function(){var t,e,n,o;return t=this,e=void 0,n=void 0,o=function*(){for(let t=0;t{a[e.toLowerCase()]=t}):o.headers.keys().forEach(t=>{a[t.toLowerCase()]=o.headers.get(t)}),{headers:a,statusCode:o.status,statusMessage:o.statusText,body:(0,i.arrayify)(new Uint8Array(s))}},new(o||(o=Promise))(function(t,e){function i(t){try{u(s.next(t))}catch(r){e(r)}}function a(t){try{u(s.throw(t))}catch(r){e(r)}}function u(e){var r;e.done?t(e.value):((r=e.value)instanceof o?r:new o(function(t){t(r)})).then(i,a)}u((s=s.apply(r,n||[])).next())})}(g,y),t=300)&&(C.cancel(),u.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:h(b,e.headers?e.headers["content-type"]:null),requestBody:h(y.body,P["content-type"]),requestMethod:y.method,url:g})),r)try{let w=yield r(b,e);return C.cancel(),w}catch(k){if(k.throttleRetry&&t{let n=null;if(null!=t)try{n=JSON.parse((0,s.ZN)(t))}catch(i){u.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:t,error:i})}return r&&(n=r(n,e)),n},i=null;if(null!=e){i=(0,s.Y0)(e);let l="string"==typeof t?{url:t}:(0,o.shallowCopy)(t);if(l.headers){let h=0!==Object.keys(l.headers).filter(t=>"content-type"===t.toLowerCase()).length;h||(l.headers=(0,o.shallowCopy)(l.headers),l.headers["content-type"]="application/json")}else l.headers={"content-type":"application/json"};t=l}return c(t,i,n)}function d(t,e){return e||(e={}),null==(e=(0,o.shallowCopy)(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise(function(r,n){let i=null,o=!1,s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{s()&&n(Error("timeout"))},e.timeout));let a=e.retryLimit,u=0;!function i(){return t().then(function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(++u>a){s()&&n(Error("retry limit reached"));return}let l=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));le.ceiling&&(l=e.ceiling),setTimeout(i,l)}return null},function(t){s()&&n(t)})}()})}},78435:function(t,e,r){"use strict";r.r(e),r.d(e,{Wordlist:function(){return n.D},logger:function(){return n.k},wordlists:function(){return i.E}});var n=r(48812),i=r(10234)},48812:function(t,e,r){"use strict";r.d(e,{D:function(){return a},k:function(){return s}});var n=r(32046),i=r(6881),o=r(1581);let s=new o.Logger("wordlists/5.7.0");class a{constructor(t){s.checkAbstract(new.target,a),(0,i.defineReadOnly)(this,"locale",t)}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}static check(t){let e=[];for(let r=0;r<2048;r++){let i=t.getWord(r);if(r!==t.getWordIndex(i))return"0x";e.push(i)}return(0,n.id)(e.join("\n")+"\n")}static register(t,e){e||(e=t.locale)}}},10234:function(t,e,r){"use strict";r.d(e,{E:function(){return u}});var n=r(48812);let i=null;function o(t){if(null==i&&(i="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==n.D.check(t)))throw i=null,Error("BIP39 Wordlist for en (English) FAILED")}class s extends n.D{constructor(){super("en")}getWord(t){return o(this),i[t]}getWordIndex(t){return o(this),i.indexOf(t)}}let a=new s;n.D.register(a);let u={en:a}},82775:function(t,e,r){"use strict";r.d(e,{i:function(){return u}});var n=r(97231);r(26729);var i=new WeakMap,o=new WeakMap,s=new WeakSet,a=new WeakSet;class u extends n.I{constructor(){let{chains:t,options:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={name:"MetaMask",shimDisconnect:!0,shimChainChangedDisconnect:!0,...e};super({chains:t,options:r}),(0,n._)(this,a),(0,n._)(this,s),(0,n.t)(this,"id","metaMask"),(0,n.t)(this,"ready","undefined"!=typeof window&&!!(0,n.u)(this,a,h).call(this,window.ethereum)),(0,n.v)(this,i,{writable:!0,value:void 0}),(0,n.v)(this,o,{writable:!0,value:void 0}),(0,n.w)(this,o,r.UNSTABLE_shimOnConnectSelectAccount)}async connect(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var e,r,i,s;let a=await this.getProvider();if(!a)throw new n.d;if(a.on&&(a.on("accountsChanged",this.onAccountsChanged),a.on("chainChanged",this.onChainChanged),a.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"}),(0,n.x)(this,o)&&null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&!(null!==(r=(0,n.g)().storage)&&void 0!==r&&r.getItem(this.shimDisconnectKey))){let u=await a.request({method:"eth_accounts"}).catch(()=>[]),l=!!u[0];l&&await a.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]})}let h=await this.getAccount(),c=await this.getChainId(),f=this.isChainUnsupported(c);if(t&&c!==t){let d=await this.switchChain(t);c=d.id,f=this.isChainUnsupported(c)}return null!==(i=this.options)&&void 0!==i&&i.shimDisconnect&&(null===(s=(0,n.g)().storage)||void 0===s||s.setItem(this.shimDisconnectKey,!0)),{account:h,chain:{id:c,unsupported:f},provider:a}}catch(p){if(this.isUserRejectedRequestError(p))throw new n.U(p);if(-32002===p.code)throw new n.R(p);throw p}}async getProvider(){return"undefined"!=typeof window&&(0,n.w)(this,i,(0,n.u)(this,a,h).call(this,window.ethereum)),(0,n.x)(this,i)}}function l(t){let e=!!(null!=t&&t.isMetaMask);if(e&&(!t.isBraveWallet||t._events||t._state)&&!t.isAvalanche&&!t.isKuCoinWallet&&!t.isPortal&&!t.isTokenPocket&&!t.isTokenary)return t}function h(t){return null!=t&&t.providers?t.providers.find((0,n.u)(this,s,l)):(0,n.u)(this,s,l).call(this,t)}},81226:function(t,e,r){"use strict";r.d(e,{c:function(){return M},d:function(){return _}});let n={mainnet:"https://eth-mainnet.alchemyapi.io/v2",ropsten:"https://eth-ropsten.alchemyapi.io/v2",rinkeby:"https://eth-rinkeby.alchemyapi.io/v2",goerli:"https://eth-goerli.alchemyapi.io/v2",kovan:"https://eth-kovan.alchemyapi.io/v2",optimism:"https://opt-mainnet.g.alchemy.com/v2",optimismKovan:"https://opt-kovan.g.alchemy.com/v2",optimismGoerli:"https://opt-goerli.g.alchemy.com/v2",polygon:"https://polygon-mainnet.g.alchemy.com/v2",polygonMumbai:"https://polygon-mumbai.g.alchemy.com/v2",arbitrum:"https://arb-mainnet.g.alchemy.com/v2",arbitrumRinkeby:"https://arb-rinkeby.g.alchemy.com/v2",arbitrumGoerli:"https://arb-goerli.g.alchemy.com/v2"},i={mainnet:"https://mainnet.infura.io/v3",ropsten:"https://ropsten.infura.io/v3",rinkeby:"https://rinkeby.infura.io/v3",goerli:"https://goerli.infura.io/v3",kovan:"https://kovan.infura.io/v3",sepolia:"https://sepolia.infura.io/v3",optimism:"https://optimism-mainnet.infura.io/v3",optimismKovan:"https://optimism-kovan.infura.io/v3",optimismGoerli:"https://optimism-goerli.infura.io/v3",polygon:"https://polygon-mainnet.infura.io/v3",polygonMumbai:"https://polygon-mumbai.infura.io/v3",arbitrum:"https://arbitrum-mainnet.infura.io/v3",arbitrumRinkeby:"https://arbitrum-rinkeby.infura.io/v3",arbitrumGoerli:"https://arbitrum-goerli.infura.io/v3"},o={mainnet:"https://cloudflare-eth.com",ropsten:"https://rpc.ankr.com/eth_ropsten",rinkeby:"https://rpc.ankr.com/eth_rinkeby",goerli:"https://rpc.ankr.com/eth_goerli",kovan:`${i.kovan}/84842078b09946638c03157f83405213`,sepolia:"https://rpc.sepolia.org",optimism:"https://mainnet.optimism.io",optimismKovan:"https://kovan.optimism.io",optimismGoerli:"https://goerli.optimism.io",polygon:"https://polygon-rpc.com",polygonMumbai:"https://matic-mumbai.chainstacklabs.com",arbitrum:"https://arb1.arbitrum.io/rpc",arbitrumRinkeby:"https://rinkeby.arbitrum.io/rpc",arbitrumGoerli:"https://goerli-rollup.arbitrum.io/rpc"},s={mainnet:{name:"Etherscan",url:"https://etherscan.io"},ropsten:{name:"Etherscan",url:"https://ropsten.etherscan.io"},rinkeby:{name:"Etherscan",url:"https://rinkeby.etherscan.io"},goerli:{name:"Etherscan",url:"https://goerli.etherscan.io"},kovan:{name:"Etherscan",url:"https://kovan.etherscan.io"},sepolia:{name:"Etherscan",url:"https://sepolia.etherscan.io"},optimism:{name:"Etherscan",url:"https://optimistic.etherscan.io"},optimismKovan:{name:"Etherscan",url:"https://kovan-optimistic.etherscan.io"},optimismGoerli:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},polygon:{name:"PolygonScan",url:"https://polygonscan.com"},polygonMumbai:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},arbitrum:{name:"Arbiscan",url:"https://arbiscan.io"},arbitrumRinkeby:{name:"Arbiscan",url:"https://testnet.arbiscan.io"},arbitrumGoerli:{name:"Arbiscan",url:"https://goerli.arbiscan.io"}},a={mainnet:1,ropsten:3,rinkeby:4,goerli:5,kovan:42,sepolia:11155111,optimism:10,optimismKovan:69,optimismGoerli:420,polygon:137,polygonMumbai:80001,arbitrum:42161,arbitrumRinkeby:421611,arbitrumGoerli:421613,localhost:1337,hardhat:31337,foundry:31337},u={id:a.mainnet,name:"Ethereum",network:"homestead",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.mainnet,default:o.mainnet,infura:i.mainnet,public:o.mainnet},blockExplorers:{etherscan:s.mainnet,default:s.mainnet},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}},l={id:a.ropsten,name:"Ropsten",network:"ropsten",nativeCurrency:{name:"Ropsten Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.ropsten,default:o.ropsten,infura:i.ropsten,public:o.ropsten},blockExplorers:{etherscan:s.ropsten,default:s.ropsten},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:12063863},testnet:!0},h={id:a.rinkeby,name:"Rinkeby",network:"rinkeby",nativeCurrency:{name:"Rinkeby Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.rinkeby,default:o.rinkeby,infura:i.rinkeby,public:o.rinkeby},blockExplorers:{etherscan:s.rinkeby,default:s.rinkeby},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10299530},testnet:!0},c={id:a.goerli,name:"Goerli",network:"goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.goerli,default:o.goerli,infura:i.goerli,public:o.goerli},blockExplorers:{etherscan:s.goerli,default:s.goerli},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670},testnet:!0},f={id:a.kovan,name:"Kovan",network:"kovan",nativeCurrency:{name:"Kovan Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.kovan,default:o.kovan,infura:i.kovan,public:o.kovan},blockExplorers:{etherscan:s.kovan,default:s.kovan},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:30285908},testnet:!0},d={id:a.sepolia,name:"Sepolia",network:"sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:o.sepolia,infura:i.sepolia,public:o.sepolia},blockExplorers:{etherscan:s.sepolia,default:s.sepolia},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},testnet:!0},p={id:a.optimism,name:"Optimism",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimism,default:o.optimism,infura:i.optimism,public:o.optimism},blockExplorers:{etherscan:s.optimism,default:s.optimism},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}},m={id:a.optimismKovan,name:"Optimism Kovan",network:"optimism-kovan",nativeCurrency:{name:"Kovan Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimismKovan,default:o.optimismKovan,infura:i.optimismKovan,public:o.optimismKovan},blockExplorers:{etherscan:s.optimismKovan,default:s.optimismKovan},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1418387},testnet:!0},g={id:a.optimismGoerli,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimismGoerli,default:o.optimismGoerli,infura:i.optimismGoerli,public:o.optimismGoerli},blockExplorers:{etherscan:s.optimismGoerli,default:s.optimismGoerli},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461},testnet:!0},y={id:a.polygon,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:n.polygon,default:o.polygon,infura:i.polygon,public:o.polygon},blockExplorers:{etherscan:s.polygon,default:s.polygon},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},v={id:a.polygonMumbai,name:"Polygon Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:n.polygonMumbai,default:o.polygonMumbai,infura:i.polygonMumbai,public:o.polygonMumbai},blockExplorers:{etherscan:s.polygonMumbai,default:s.polygonMumbai},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25444704},testnet:!0},b={id:a.arbitrum,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrum,default:o.arbitrum,infura:i.arbitrum,public:o.arbitrum},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://explorer.arbitrum.io"},etherscan:s.arbitrum,default:s.arbitrum},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}},w={id:a.arbitrumRinkeby,name:"Arbitrum Rinkeby",network:"arbitrum-rinkeby",nativeCurrency:{name:"Arbitrum Rinkeby Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrumRinkeby,default:o.arbitrumRinkeby,infura:i.arbitrumRinkeby,public:o.arbitrumRinkeby},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://rinkeby-explorer.arbitrum.io"},etherscan:s.arbitrumRinkeby,default:s.arbitrumRinkeby},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10228837},testnet:!0},A={id:a.arbitrumGoerli,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrumGoerli,default:o.arbitrumGoerli,infura:i.arbitrumGoerli,public:o.arbitrumGoerli},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://goerli-rollup-explorer.arbitrum.io"},etherscan:s.arbitrumGoerli,default:s.arbitrumGoerli},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114},testnet:!0},E={id:a.localhost,name:"Localhost",network:"localhost",rpcUrls:{default:"http://127.0.0.1:8545"}},k={id:a.hardhat,name:"Hardhat",network:"hardhat",rpcUrls:{default:"http://127.0.0.1:8545"}},S={id:a.foundry,name:"Foundry",network:"foundry",rpcUrls:{default:"http://127.0.0.1:8545"}},M={mainnet:u,ropsten:l,rinkeby:h,goerli:c,kovan:f,sepolia:d,optimism:p,optimismGoerli:g,optimismKovan:m,polygon:y,polygonMumbai:v,arbitrum:b,arbitrumGoerli:A,arbitrumRinkeby:w,localhost:E,hardhat:k,foundry:S},_=[u,l,h,c,f]},97231:function(t,e,r){"use strict";let n;r.d(e,{C:function(){return M},I:function(){return F},R:function(){return C},S:function(){return R},U:function(){return N},_:function(){return m},a:function(){return _},b:function(){return x},d:function(){return P},f:function(){return W},g:function(){return Q},k:function(){return H},n:function(){return I},t:function(){return y},u:function(){return w},v:function(){return g},w:function(){return A},x:function(){return b}});let i=t=>(e,r,n)=>{let i=n.subscribe;n.subscribe=(t,e,r)=>{let o=t;if(e){let s=(null==r?void 0:r.equalityFn)||Object.is,a=t(n.getState());o=r=>{let n=t(r);if(!s(a,n)){let i=a;e(a=n,i)}},(null==r?void 0:r.fireImmediately)&&e(a,a)}return i(o)};let o=t(e,r,n);return o},o=t=>e=>{try{let r=t(e);if(r instanceof Promise)return r;return{then:t=>o(t)(r),catch(t){return this}}}catch(n){return{then(t){return this},catch:t=>o(t)(n)}}},s=(t,e)=>(r,n,i)=>{let s,a,u={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},l=!1,h=new Set,c=new Set;try{s=u.getStorage()}catch(f){}if(!s)return t((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),r(...t)},n,i);let d=o(u.serialize),p=()=>{let t;let e=u.partialize({...n()}),r=d({state:e,version:u.version}).then(t=>s.setItem(u.name,t)).catch(e=>{t=e});if(t)throw t;return r},m=i.setState;i.setState=(t,e)=>{m(t,e),p()};let g=t((...t)=>{r(...t),p()},n,i),y=()=>{var t;if(!s)return;l=!1,h.forEach(t=>t(n()));let e=(null==(t=u.onRehydrateStorage)?void 0:t.call(u,n()))||void 0;return o(s.getItem.bind(s))(u.name).then(t=>{if(t)return u.deserialize(t)}).then(t=>{if(t){if("number"!=typeof t.version||t.version===u.version)return t.state;if(u.migrate)return u.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(t=>{var e;return r(a=u.merge(t,null!=(e=n())?e:g),!0),p()}).then(()=>{null==e||e(a,void 0),l=!0,c.forEach(t=>t(a))}).catch(t=>{null==e||e(void 0,t)})};return i.persist={setOptions(t){u={...u,...t},t.getStorage&&(s=t.getStorage())},clearStorage(){null==s||s.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:t=>(h.add(t),()=>{h.delete(t)}),onFinishHydration:t=>(c.add(t),()=>{c.delete(t)})},y(),a||g},a=t=>{let e;let r=new Set,n=(t,n)=>{let i="function"==typeof t?t(e):t;if(!Object.is(i,e)){let o=e;e=(null!=n?n:"object"!=typeof i)?i:Object.assign({},e,i),r.forEach(t=>t(e,o))}},i=()=>e,o=t=>(r.add(t),()=>r.delete(t)),s=()=>r.clear(),a={setState:n,getState:i,subscribe:o,destroy:s};return e=t(n,i,a),a},u=t=>t?a(t):a;var l=r(8605),h=r(56371),c=r(26729),f=r.n(c),d=r(81226);function p(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function m(t,e){p(t,e),e.add(t)}function g(t,e,r){p(t,e),e.set(t,r)}function y(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function b(t,e){var r=v(t,e,"get");return r.get?r.get.call(t):r.value}function w(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function A(t,e,r){var n=v(t,e,"set");return!function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}(t,n,r),r}class E extends Error{constructor(t,e,r,n){if(!Number.isInteger(t))throw Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw Error('"message" must be a nonempty string.');super(e),y(this,"code",void 0),y(this,"data",void 0),y(this,"internal",void 0),this.code=t,this.data=n,this.internal=r}}class k extends E{constructor(t,e,r,n){if(!(Number.isInteger(t)&&t>=1e3&&t<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r,n)}}class S extends Error{constructor(){super(...arguments),y(this,"name","AddChainError"),y(this,"message","Error adding chain")}}class M extends Error{constructor(t){let{activeChain:e,targetChain:r}=t;super(`Chain mismatch: Expected "${r}", received "${e}".`),y(this,"name","ChainMismatchError")}}class _ extends Error{constructor(t){let{chainId:e,connectorId:r}=t;super(`Chain "${e}" not configured for connector "${r}".`),y(this,"name","ChainNotConfigured")}}class x extends Error{constructor(){super(...arguments),y(this,"name","ConnectorAlreadyConnectedError"),y(this,"message","Connector already connected")}}class P extends Error{constructor(){super(...arguments),y(this,"name","ConnectorNotFoundError"),y(this,"message","Connector not found")}}class C extends E{constructor(t){super(-32002,"Resource unavailable",t),y(this,"name","ResourceUnavailable")}}class O extends k{constructor(t){super(4902,"Error switching chain",t),y(this,"name","SwitchChainError")}}class R extends Error{constructor(t){let{connector:e}=t;super(`"${e.name}" does not support programmatic chain switching.`),y(this,"name","SwitchChainNotSupportedError")}}class N extends k{constructor(t){super(4001,"User rejected request",t),y(this,"name","UserRejectedRequestError")}}function I(t){return"string"==typeof t?Number.parseInt(t,"0x"===t.trim().substring(0,2)?16:10):"bigint"==typeof t?Number(t):t}class T extends f(){constructor(t){let{chains:e=d.d,options:r}=t;super(),y(this,"id",void 0),y(this,"name",void 0),y(this,"chains",void 0),y(this,"options",void 0),y(this,"ready",void 0),this.chains=e,this.options=r}getBlockExplorerUrls(t){let{default:e,...r}=t.blockExplorers??{};if(e)return[e.url,...Object.values(r).map(t=>t.url)]}isChainUnsupported(t){return!this.chains.some(e=>e.id===t)}}var B=new WeakMap,L=new WeakMap;class F extends T{constructor(){let{chains:t,options:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={shimDisconnect:!0,shimChainChangedDisconnect:!0,...e};super({chains:t,options:r}),y(this,"id",void 0),y(this,"name",void 0),y(this,"ready","undefined"!=typeof window&&!!window.ethereum),g(this,B,{writable:!0,value:void 0}),g(this,L,{writable:!0,value:void 0}),y(this,"shimDisconnectKey","injected.shimDisconnect"),y(this,"onAccountsChanged",t=>{0===t.length?this.emit("disconnect"):this.emit("change",{account:(0,h.getAddress)(t[0])})}),y(this,"onChainChanged",t=>{let e=I(t),r=this.isChainUnsupported(e);this.emit("change",{chain:{id:e,unsupported:r}})}),y(this,"onDisconnect",()=>{var t,e,r;if(null!==(t=this.options)&&void 0!==t&&t.shimChainChangedDisconnect&&b(this,L)){A(this,L,!1);return}this.emit("disconnect"),null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&(null===(r=Q().storage)||void 0===r||r.removeItem(this.shimDisconnectKey))});let n="Injected",i=r.name;if("string"==typeof i)n=i;else if("undefined"!=typeof window){let o=function(t){var e;if(!t)return"Injected";let r=t=>t.isAvalanche?"Core Wallet":t.isBitKeep?"BitKeep":t.isBraveWallet?"Brave Wallet":t.isCoinbaseWallet?"Coinbase Wallet":t.isExodus?"Exodus":t.isFrame?"Frame":t.isKuCoinWallet?"KuCoin Wallet":t.isMathWallet?"MathWallet":t.isOneInchIOSWallet||t.isOneInchAndroidWallet?"1inch Wallet":t.isOpera?"Opera":t.isPortal?"Ripio Portal":t.isTally?"Tally":t.isTokenPocket?"TokenPocket":t.isTokenary?"Tokenary":t.isTrust||t.isTrustWallet?"Trust Wallet":t.isMetaMask?"MetaMask":void 0;if(null!==(e=t.providers)&&void 0!==e&&e.length){let n=new Set,i=1;for(let o of t.providers){let s=r(o);s||(s=`Unknown Wallet #${i}`,i+=1),n.add(s)}let a=[...n];return a.length?a:a[0]??"Injected"}return r(t)??"Injected"}(window.ethereum);n=i?i(o):"string"==typeof o?o:o[0]}this.id="injected",this.name=n}async connect(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var e,r;let n=await this.getProvider();if(!n)throw new P;n.on&&(n.on("accountsChanged",this.onAccountsChanged),n.on("chainChanged",this.onChainChanged),n.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let i=await this.getAccount(),o=await this.getChainId(),s=this.isChainUnsupported(o);if(t&&o!==t){let a=await this.switchChain(t);o=a.id,s=this.isChainUnsupported(o)}return null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&(null===(r=Q().storage)||void 0===r||r.setItem(this.shimDisconnectKey,!0)),{account:i,chain:{id:o,unsupported:s},provider:n}}catch(u){if(this.isUserRejectedRequestError(u))throw new N(u);if(-32002===u.code)throw new C(u);throw u}}async disconnect(){var t,e;let r=await this.getProvider();null!=r&&r.removeListener&&(r.removeListener("accountsChanged",this.onAccountsChanged),r.removeListener("chainChanged",this.onChainChanged),r.removeListener("disconnect",this.onDisconnect),null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&(null===(e=Q().storage)||void 0===e||e.removeItem(this.shimDisconnectKey)))}async getAccount(){let t=await this.getProvider();if(!t)throw new P;let e=await t.request({method:"eth_requestAccounts"});return(0,h.getAddress)(e[0])}async getChainId(){let t=await this.getProvider();if(!t)throw new P;return t.request({method:"eth_chainId"}).then(I)}async getProvider(){return"undefined"!=typeof window&&window.ethereum&&A(this,B,window.ethereum),b(this,B)}async getSigner(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[e,r]=await Promise.all([this.getProvider(),this.getAccount()]);return new l.Web3Provider(e,t).getSigner(r)}async isAuthorized(){try{var t,e;if(null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&!(null!==(e=Q().storage)&&void 0!==e&&e.getItem(this.shimDisconnectKey)))return!1;let r=await this.getProvider();if(!r)throw new P;let n=await r.request({method:"eth_accounts"}),i=n[0];return!!i}catch{return!1}}async switchChain(t){var e,r,n;null!==(e=this.options)&&void 0!==e&&e.shimChainChangedDisconnect&&A(this,L,!0);let i=await this.getProvider();if(!i)throw new P;let o=(0,h.hexValue)(t);try{return await i.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]}),this.chains.find(e=>e.id===t)??{id:t,name:`Chain ${o}`,network:`${o}`,rpcUrls:{default:""}}}catch(u){let s=this.chains.find(e=>e.id===t);if(!s)throw new _({chainId:t,connectorId:this.id});if(4902===u.code||(null==u?void 0:null===(r=u.data)||void 0===r?void 0:null===(n=r.originalError)||void 0===n?void 0:n.code)===4902)try{return await i.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[s.rpcUrls.public??s.rpcUrls.default],blockExplorerUrls:this.getBlockExplorerUrls(s)}]}),s}catch(a){if(this.isUserRejectedRequestError(a))throw new N(u);throw new S}if(this.isUserRejectedRequestError(u))throw new N(u);throw new O(u)}}async watchAsset(t){let{address:e,decimals:r=18,image:n,symbol:i}=t,o=await this.getProvider();if(!o)throw new P;return o.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:e,decimals:r,image:n,symbol:i}}})}isUserRejectedRequestError(t){return 4001===t.code}}let D={getItem:t=>"",setItem:(t,e)=>null,removeItem:t=>null},U="store";var j=new WeakMap,q=new WeakMap,K=new WeakSet;class G{constructor(t){let e,{autoConnect:r=!1,connectors:n=[new F],provider:o,storage:a=function(t){let{storage:e,key:r="wagmi"}=t;return{...e,getItem:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=e.getItem(`${r}.${t}`);try{return i?JSON.parse(i):n}catch(o){return console.warn(o),n}},setItem(t,n){if(null===n)e.removeItem(`${r}.${t}`);else try{e.setItem(`${r}.${t}`,JSON.stringify(n))}catch(i){console.error(i)}},removeItem:t=>e.removeItem(`${r}.${t}`)}}({storage:"undefined"!=typeof window?window.localStorage:D}),logger:l={warn:console.warn},webSocketProvider:h}=t;m(this,K),y(this,"config",void 0),y(this,"providers",new Map),y(this,"storage",void 0),y(this,"store",void 0),y(this,"webSocketProviders",new Map),g(this,j,{writable:!0,value:void 0}),g(this,q,{writable:!0,value:void 0}),this.config={autoConnect:r,connectors:n,logger:l,provider:o,storage:a,webSocketProvider:h};let c="disconnected";if(r)try{var f,d,p;let v=a.getItem(U,""),b=null===(f=JSON.parse(v||"{}"))||void 0===f?void 0:null===(d=f.state)||void 0===d?void 0:d.data;c=null!=b&&b.account?"reconnecting":"connecting",e=null==b?void 0:null===(p=b.chain)||void 0===p?void 0:p.id}catch(E){}this.store=u(i(s(()=>({connectors:"function"==typeof n?n():n,provider:this.getProvider({chainId:e}),status:c,webSocketProvider:this.getWebSocketProvider({chainId:e})}),{name:U,getStorage:()=>a,partialize(t){var e,n;return{...r&&{data:{account:null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.account,chain:null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.chain}},chains:null==t?void 0:t.chains}},version:1}))),this.storage=a,A(this,q,null==a?void 0:a.getItem("wallet")),w(this,K,z).call(this),r&&"undefined"!=typeof window&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){var t,e;return null===(t=this.data)||void 0===t?void 0:null===(e=t.chain)||void 0===e?void 0:e.id}get provider(){return this.store.getState().provider}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketProvider(){return this.store.getState().webSocketProvider}setState(t){let e="function"==typeof t?t(this.store.getState()):t;this.store.setState(e,!0)}clearState(){this.setState(t=>({...t,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var t,e;this.connector&&await (null===(t=(e=this.connector).disconnect)||void 0===t?void 0:t.call(e)),A(this,j,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(b(this,j))return;A(this,j,!0),this.setState(t=>{var e;return{...t,status:null!==(e=t.data)&&void 0!==e&&e.account?"reconnecting":"connecting"}});let t=b(this,q)?[...this.connectors].sort(t=>t.id===b(this,q)?-1:1):this.connectors,e=!1;for(let r of t){if(!r.ready||!r.isAuthorized)continue;let n=await r.isAuthorized();if(!n)continue;let i=await r.connect();this.setState(t=>({...t,connector:r,chains:null==r?void 0:r.chains,data:i,status:"connected"})),e=!0;break}return e||this.setState(t=>({...t,data:void 0,status:"disconnected"})),A(this,j,!1),this.data}getProvider(){let{bust:t,chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.providers.get(e??-1);if(r&&!t)return r;let{provider:n}=this.config;return r="function"==typeof n?n({chainId:e}):n,this.providers.set(e??-1,r),r}getWebSocketProvider(){let{bust:t,chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.webSocketProviders.get(e??-1);if(r&&!t)return r;let{webSocketProvider:n}=this.config;return(r="function"==typeof n?n({chainId:e}):n)&&this.webSocketProviders.set(e??-1,r),r}setLastUsedConnector(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===(t=this.storage)||void 0===t||t.setItem("wallet",e)}}function z(){let t=t=>{this.setState(e=>({...e,data:{...e.data,...t}}))},e=()=>{this.clearState()},r=t=>{this.setState(e=>({...e,error:t}))};this.store.subscribe(t=>{let{connector:e}=t;return e},(n,i)=>{var o,s,a,u,l,h;null==i||null===(o=i.off)||void 0===o||o.call(i,"change",t),null==i||null===(s=i.off)||void 0===s||s.call(i,"disconnect",e),null==i||null===(a=i.off)||void 0===a||a.call(i,"error",r),n&&(null===(u=n.on)||void 0===u||u.call(n,"change",t),null===(l=n.on)||void 0===l||l.call(n,"disconnect",e),null===(h=n.on)||void 0===h||h.call(n,"error",r))});let{provider:n,webSocketProvider:i}=this.config;("function"==typeof n||"function"==typeof i)&&this.store.subscribe(t=>{var e;let{data:r}=t;return null==r?void 0:null===(e=r.chain)||void 0===e?void 0:e.id},t=>{this.setState(e=>({...e,provider:this.getProvider({bust:!0,chainId:t}),webSocketProvider:this.getWebSocketProvider({bust:!0,chainId:t})}))})}function H(t){let e=new G(t);return n=e,e}function Q(){if(!n)throw Error("No wagmi client found. Ensure you have set up a client: https://wagmi.sh/docs/client");return n}function W(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Q();return t&&e.getProvider({chainId:t})||e.provider}},2984:function(t,e,r){"use strict";r.d(e,{QB:function(){return a},$j:function(){return l},vZ:function(){return function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){let n,i;if(e.constructor!==r.constructor)return!1;if(Array.isArray(e)&&Array.isArray(r)){if((n=e.length)!=r.length)return!1;for(i=n;0!=i--;)if(!t(e[i],r[i]))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();let o=Object.keys(e);if((n=o.length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){let s=o[i];if(s&&!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r}},zP:function(){return h},em:function(){return u},DG:function(){return d},D0:function(){return p},uN:function(){return c},Hy:function(){return m},xq:function(){return g},If:function(){return y},uH:function(){return v},QC:function(){return b},b0:function(){return f},rn:function(){return w}});var n=r(97231),i=r(8605),o=r(64146);function s(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(let[r,n]of t)if(!Object.is(n,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}let o=Object.keys(t);if(o.length!==Object.keys(e).length)return!1;for(let s=0;s2&&void 0!==arguments[2]?arguments[2]:{};if(!t.length)throw Error("must have at least one chain");if(o{let{id:e}=t;return e===h.id})||(a=[...a,d.chain]),u[h.id]=[...u[h.id]||[],d.provider],d.webSocketProvider&&(l[h.id]=[...l[h.id]||[],d.webSocketProvider]))}if(!c)throw Error(`Could not find valid provider configuration for chain "${h.name}". - -You may need to add \`jsonRpcProvider\` to \`configureChains\` with the chain's RPC URLs. -Read more: https://wagmi.sh/docs/providers/jsonRpc`)}return{chains:a,provider(e){let l,{chainId:h}=e,c=a.find(t=>t.id===h)??t[0],f=u[c.id];if(!f||!f[0])throw Error(`No providers configured for chain "${c.id}"`);return l=1===f.length?f[0]():function t(e,r,n,o){let{stallTimeout:s}=o;try{return new i.FallbackProvider(n.map((t,e)=>{let r=t();return{provider:r,priority:r.priority??e,stallTimeout:r.stallTimeout??s,weight:r.weight}}),e)}catch(u){var a;if(null!=u&&null!==(a=u.message)&&void 0!==a&&a.includes("quorum will always fail; larger than total weight")){if(e===r)throw u;return t(e-1,r,n,{stallTimeout:s})}throw u}}(o,r,f,{stallTimeout:s}),42220===c.id&&(l.formatter.formats.block={...l.formatter.formats.block,difficulty:()=>0,gasLimit:()=>0}),Object.assign(l,{chains:a,pollingInterval:n})},webSocketProvider(e){var r;let{chainId:n}=e,i=a.find(t=>t.id===n)??t[0],o=l[i.id];if(!o)return;let s=null===(r=o[0])||void 0===r?void 0:r.call(o);return s&&42220===i.id&&(s.formatter.formats.block={...s.formatter.formats.block,difficulty:()=>0,gasLimit:()=>0}),Object.assign(s||{},{chains:a})}}}r(26729);let u=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];async function l(t){let{chainId:e,connector:r}=t,i=(0,n.g)(),o=i.connector;if(r.id===(null==o?void 0:o.id))throw new n.b;try{i.setState(t=>({...t,status:"connecting"}));let s=await r.connect({chainId:e});return i.setLastUsedConnector(r.id),i.setState(t=>({...t,connector:r,chains:null==r?void 0:r.chains,data:s,status:"connected"})),i.storage.setItem("connected",!0),{...s,connector:r}}catch(a){throw i.setState(t=>({...t,status:t.connector?"connected":"disconnected"})),a}}async function h(){let t=(0,n.g)();t.connector&&await t.connector.disconnect(),t.clearState(),t.storage.removeItem("connected")}function c(t){let{address:e,abi:r,signerOrProvider:n}=t;return new o.Contract(e,r,n)}function f(t,e){let r=(0,n.g)(),i=async()=>e((0,n.f)(t)),o=r.subscribe(t=>{let{provider:e}=t;return e},i);return o}async function d(){var t,e;let{chainId:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,n.g)(),o=await (null===(t=i.connector)||void 0===t?void 0:null===(e=t.getSigner)||void 0===e?void 0:e.call(t,{chainId:r}))||null;return o}function p(){let{data:t,connector:e,status:r}=(0,n.g)();switch(r){case"connected":return{address:null==t?void 0:t.account,connector:e,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:r};case"reconnecting":return{address:null==t?void 0:t.account,connector:e,isConnected:!!(null!=t&&t.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:r};case"connecting":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:r};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:r}}}function m(){var t,e,r;let i=(0,n.g)(),o=null===(t=i.data)||void 0===t?void 0:null===(e=t.chain)||void 0===e?void 0:e.id,s=i.chains??[],a=[...i.provider.chains||[],...s].find(t=>t.id===o)??{id:o,name:`Chain ${o}`,network:`${o}`,rpcUrls:{default:""}};return{chain:o?{...a,...null===(r=i.data)||void 0===r?void 0:r.chain,id:o}:void 0,chains:s}}async function g(t){let{domain:e,types:r,value:i}=t,o=await d();if(!o)throw new n.d;let{chainId:s}=e,a=s?(0,n.n)(s):void 0;return a&&function(t){var e,r,i,o;let{chainId:s,signer:a}=t,{chain:u,chains:l}=m(),h=null==u?void 0:u.id;if(h&&s!==h)throw new n.C({activeChain:(null===(e=l.find(t=>t.id===h))||void 0===e?void 0:e.name)??`Chain ${h}`,targetChain:(null===(r=l.find(t=>t.id===s))||void 0===r?void 0:r.name)??`Chain ${s}`});if(a){let c=null===(i=a.provider)||void 0===i?void 0:null===(o=i.network)||void 0===o?void 0:o.chainId;if(c&&s!==c){let f=(0,n.g)().connector;throw new n.a({chainId:s,connectorId:(null==f?void 0:f.id)??"unknown"})}}}({chainId:a,signer:o}),o._signTypedData(e,r,i)}async function y(t){let{chainId:e}=t,{connector:r}=(0,n.g)();if(!r)throw new n.d;if(!r.switchChain)throw new n.S({connector:r});return r.switchChain(e)}function v(t){let{selector:e=t=>t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.g)(),i=()=>t(p()),o=r.subscribe(t=>{let{data:r,connector:n,status:i}=t;return e({address:null==r?void 0:r.account,connector:n,status:i})},i,{equalityFn:s});return o}function b(t){let{selector:e=t=>t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.g)(),i=()=>t(m()),o=r.subscribe(t=>{var r;let{data:n,chains:i}=t;return e({chainId:null==n?void 0:null===(r=n.chain)||void 0===r?void 0:r.id,chains:i})},i,{equalityFn:s});return o}function w(t,e){let{chainId:r}=t,i=(0,n.g)(),o=async()=>e(await d({chainId:r})),a=i.subscribe(t=>{var e;let{data:r,connector:n}=t;return{account:null==r?void 0:r.account,chainId:null==r?void 0:null===(e=r.chain)||void 0===e?void 0:e.id,connector:n}},o,{equalityFn:s});return a}},78826:function(t){"use strict";!function(e){function r(t){return parseInt(t)===t}function n(t){if(!r(t.length))return!1;for(var e=0;e255)return!1;return!0}function i(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!n(t))throw Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&n(t))return new Uint8Array(t);throw Error("unsupported array-like object")}function o(t){return new Uint8Array(t)}function s(t,e,r,n,i){(null!=n||null!=i)&&(t=t.slice?t.slice(n,i):Array.prototype.slice.call(t,n,i)),e.set(t,r)}var a,u=(a="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r>4]+a[15&n])}return e.join("")}}),l={16:10,24:12,32:14},h=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],c=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],E=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],k=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function M(t){for(var e=[],r=0;r>2,this._Ke[o][e%4]=i[e],this._Kd[t-o][e%4]=i[e];for(var o,s,a=0,u=n;u>16&255]<<24^c[s>>8&255]<<16^c[255&s]<<8^c[s>>24&255]^h[a]<<24,a+=1,8!=n)for(var e=1;e>8&255]<<8^c[s>>16&255]<<16^c[s>>24&255]<<24;for(var e=n/2+1;e>2,d=u%4,this._Ke[f][d]=i[e],this._Kd[t-f][d]=i[e++],u++}for(var f=1;f>24&255]^E[s>>16&255]^k[s>>8&255]^S[255&s]},_.prototype.encrypt=function(t){if(16!=t.length)throw Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=M(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s>24&255]^p[n[(i+1)%4]>>16&255]^m[n[(i+2)%4]>>8&255]^g[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}for(var a,u=o(16),i=0;i<4;i++)a=this._Ke[e][i],u[4*i]=(c[n[i]>>24&255]^a>>24)&255,u[4*i+1]=(c[n[(i+1)%4]>>16&255]^a>>16)&255,u[4*i+2]=(c[n[(i+2)%4]>>8&255]^a>>8)&255,u[4*i+3]=(c[255&n[(i+3)%4]]^a)&255;return u},_.prototype.decrypt=function(t){if(16!=t.length)throw Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=M(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s>24&255]^v[n[(i+3)%4]>>16&255]^b[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}for(var a,u=o(16),i=0;i<4;i++)a=this._Kd[e][i],u[4*i]=(f[n[i]>>24&255]^a>>24)&255,u[4*i+1]=(f[n[(i+3)%4]>>16&255]^a>>16)&255,u[4*i+2]=(f[n[(i+2)%4]>>8&255]^a>>8)&255,u[4*i+3]=(f[255&n[(i+1)%4]]^a)&255;return u};var x=function(t){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new _(t)};x.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=o(t.length),r=o(16),n=0;n=0;--e)this._counter[e]=t%256,t>>=8},R.prototype.setBytes=function(t){if(16!=(t=i(t,!0)).length)throw Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},R.prototype.increment=function(){for(var t=15;t>=0;t--)if(255===this._counter[t])this._counter[t]=0;else{this._counter[t]++;break}};var N=function(t,e){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof R||(e=new R(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new _(t)};N.prototype.encrypt=function(t){for(var e=i(t,!0),r=0;r191&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}}},padding:{pkcs7:{pad:function(t){var e=16-(t=i(t,!0)).length%16,r=o(t.length+e);s(t,r);for(var n=t.length;n16)throw Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function s(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=o(e)^n>>5}for(r=0,e=o(e);re)return"Exceeds length limit";var n=t.toLowerCase(),i=t.toUpperCase();if(t!==n&&t!==i)return"Mixed-case string "+t;var a=(t=n).lastIndexOf("1");if(-1===a)return"No separator character for "+t;if(0===a)return"Missing prefix for "+t;var u=t.slice(0,a),l=t.slice(a+1);if(l.length<6)return"Data too short";var h=s(u);if("string"==typeof h)return h;for(var c=[],f=0;f=l.length||c.push(p)}return 1!==h?"Invalid checksum for "+t:{prefix:u,words:c}}function u(t,e,r,n){for(var i=0,o=0,s=(1<=r;)a.push(i>>(o-=r)&s);if(n)o>0&&a.push(i<=e)return"Excess padding";if(i<n)throw TypeError("Exceeds length limit");var i=s(t=t.toLowerCase());if("string"==typeof i)throw Error(i);for(var a=t+"1",u=0;u>5!=0)throw Error("Non 5-bit word");i=o(i)^l,a+=e.charAt(l)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u){var h=i>>(5-u)*5&31;a+=e.charAt(h)}return a},toWordsUnsafe:function(t){var e=u(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=u(t,8,5,!0);if(Array.isArray(e))return e;throw Error(e)},fromWordsUnsafe:function(t){var e=u(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=u(t,5,8,!1);if(Array.isArray(e))return e;throw Error(e)}}},94184:function(t,e){var r; /*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ !function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(o=8,n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;othis.blockSize&&(t=new this.Hash().update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},26436:function(t,e,r){"use strict";var n=r(79746),i=r(35717);function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function a(t){if(7===t.length)return"0"+t;if(6===t.length)return"00"+t;if(5===t.length)return"000"+t;if(4===t.length)return"0000"+t;if(3===t.length)return"00000"+t;if(2===t.length)return"000000"+t;if(1===t.length)return"0000000"+t;else return t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t){if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):(o=t,s=i,(64512&o.charCodeAt(s))!=55296||s<0||s+1>=o.length?1:(64512&o.charCodeAt(s+1))!=56320)?(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128):(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128)}}else for(i=0;i>>0;return a},e.split32=function(t,e){for(var r=Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0;t[e]=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u,l=e;return t+r+i+s+(0+((l=l+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,l){var h,c=e;return t+r+i+s+u+(0+((c=c+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,l){return e+n+o+a+l>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},8679:function(t,e,r){"use strict";var n=r(21296),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(t){return n.isMemo(t)?s:a[t.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=s;var l=Object.defineProperty,h=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,r,n){if("string"!=typeof r){if(p){var i=d(r);i&&i!==p&&t(e,i,n)}var s=h(r);c&&(s=s.concat(c(r)));for(var a=u(e),m=u(r),g=0;g>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(t,e,r){B.call(this,t,e,r)}B.prototype.update=function(t){if(this.finalized)throw Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"===r){if(null===t)throw Error(o);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!c||!ArrayBuffer.isView(t)))throw Error(o)}else throw Error(o);e=!0}for(var n,i,s=this.blocks,a=this.byteCount,u=t.length,l=this.blockCount,h=0,f=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=s[l],n=0;n>=8,r=255&t;r>0;)i.unshift(r),t>>=8,r=255&t,++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"===r){if(null===t)throw Error(o);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!c||!ArrayBuffer.isView(t)))throw Error(o)}else throw Error(o);e=!0}var n=0,i=t.length;if(e)n=i;else for(var s=0;s=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},B.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(e=1,t[0]=t[r];e>4&15]+f[15&t]+f[t>>12&15]+f[t>>8&15]+f[t>>20&15]+f[t>>16&15]+f[t>>28&15]+f[t>>24&15];s%e==0&&(F(r),o=0)}return i&&(a+=f[(t=r[o])>>4&15]+f[15&t],i>1&&(a+=f[t>>12&15]+f[t>>8&15]),i>2&&(a+=f[t>>20&15]+f[t>>16&15])),a},B.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=new ArrayBuffer(i?n+1<<2:a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&F(n)}return o&&(t=a<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},L.prototype=new B,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var F=function(t){var e,r,n,i,o,s,a,u,l,h,c,f,d,p,g,y,v,b,w,A,E,k,S,M,_,x,P,C,O,R,N,I,T,B,L,F,D,U,j,q,K,G,z,H,Q,W,J,V,Z,Y,$,X,tt,te,tr,tn,ti,to,ts,ta,tu,tl,th;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],f=t[8]^t[18]^t[28]^t[38]^t[48],d=t[9]^t[19]^t[29]^t[39]^t[49],e=f^(s<<1|a>>>31),r=d^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|l>>>31),r=o^(l<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(h<<1|c>>>31),r=a^(c<<1|h>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(f<<1|d>>>31),r=l^(d<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=h^(i<<1|o>>>31),r=c^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],g=t[1],W=t[11]<<4|t[10]>>>28,J=t[10]<<4|t[11]>>>28,C=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ta=t[31]<<9|t[30]>>>23,tu=t[30]<<9|t[31]>>>23,G=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,B=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,N=t[32]<<13|t[33]>>>19,tl=t[42]<<2|t[43]>>>30,th=t[43]<<2|t[42]>>>30,te=t[5]<<30|t[4]>>>2,tr=t[4]<<30|t[5]>>>2,F=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Y=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,I=t[45]<<29|t[44]>>>3,T=t[44]<<29|t[45]>>>3,M=t[6]<<28|t[7]>>>4,_=t[7]<<28|t[6]>>>4,tn=t[17]<<23|t[16]>>>9,ti=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,E=t[37]<<21|t[36]>>>11,X=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,H=t[8]<<27|t[9]>>>5,Q=t[9]<<27|t[8]>>>5,x=t[18]<<20|t[19]>>>12,P=t[19]<<20|t[18]>>>12,to=t[29]<<7|t[28]>>>25,ts=t[28]<<7|t[29]>>>25,q=t[38]<<8|t[39]>>>24,K=t[39]<<8|t[38]>>>24,k=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=p^~y&b,t[1]=g^~v&w,t[10]=M^~x&C,t[11]=_^~P&O,t[20]=B^~F&U,t[21]=L^~D&j,t[30]=H^~W&V,t[31]=Q^~J&Z,t[40]=te^~tn&to,t[41]=tr^~ti&ts,t[2]=y^~b&A,t[3]=v^~w&E,t[12]=x^~C&R,t[13]=P^~O&N,t[22]=F^~U&q,t[23]=D^~j&K,t[32]=W^~V&Y,t[33]=J^~Z&$,t[42]=tn^~to&ta,t[43]=ti^~ts&tu,t[4]=b^~A&k,t[5]=w^~E&S,t[14]=C^~R&I,t[15]=O^~N&T,t[24]=U^~q&G,t[25]=j^~K&z,t[34]=V^~Y&X,t[35]=Z^~$&tt,t[44]=to^~ta&tl,t[45]=ts^~tu&th,t[6]=A^~k&p,t[7]=E^~S&g,t[16]=R^~I&M,t[17]=N^~T&_,t[26]=q^~G&B,t[27]=K^~z&L,t[36]=Y^~X&H,t[37]=$^~tt&Q,t[46]=ta^~tl&te,t[47]=tu^~th&tr,t[8]=k^~p&y,t[9]=S^~g&v,t[18]=I^~M&x,t[19]=T^~_&P,t[28]=G^~B&F,t[29]=z^~L&D,t[38]=X^~H&W,t[39]=tt^~Q&J,t[48]=tl^~te&tn,t[49]=th^~tr&ti,t[0]^=m[n],t[1]^=m[n+1]};if(l)t.exports=x;else{for(C=0;C{let t=new Map;for(let e of u)t.set(e.id,e);return t})(),h=[{location:"Seattle, US",name:"Thunder Gateway",value:"https://gw-seattle.crustcloud.io"}],c="https://gw.crustfiles.app",f="https://ipfs.io",d="https://ipfsgw.live"},52196:function(t,e,r){"use strict";r.d(e,{Cg:function(){return i},Kc:function(){return o},TQ:function(){return n}});let n=!0,i=!1,o=!1},36526:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return _}});var n=r(35944),i=r(29282),o=r.n(i),s=r(40924),a=r.n(s),u=r(82463),l=r.n(u),h=r(21056),c=r.n(h);r(16853);var f=r(78082),d=r(9008),p=r.n(d),m=r(2984),g=r(38109),y=r(82775),v=r(8605);r(58669);var b=r(94184),w=r.n(b);let A=[o(),a(),l(),c()].map(t=>t.variable).join(" "),E=new y.i,{provider:k,webSocketProvider:S}=(0,m.QB)(f.XL,[function(){let{priority:t,stallTimeout:e,weight:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){return n.rpcUrls.default?{chain:n,provider(){let i=new v.StaticJsonRpcProvider(n.rpcUrls.default,{chainId:n.id,name:n.network});return Object.assign(i,{priority:t,stallTimeout:e,weight:r})}}:null}}()]),M=(0,g.eI)({autoConnect:!0,provider:k,webSocketProvider:S,connectors:[E]});function _(t){let{Component:e,pageProps:r}=t;return(0,n.BX)("div",{suppressHydrationWarning:!0,className:w()("App font-WorkSans",A),children:[(0,n.BX)(p(),{children:[(0,n.tZ)("meta",{name:"viewport",content:"width=device-width,user-scalable=no"}),(0,n.tZ)("title",{children:"Crust Cloud"})]}),(0,n.tZ)(g.eM,{client:M,children:(0,n.tZ)(e,{...r})})]})}},58669:function(){},82463:function(t){t.exports={style:{fontFamily:"'__Roboto_9e7bcd', '__Roboto_Fallback_9e7bcd'",fontWeight:400,fontStyle:"normal"},className:"__className_9e7bcd",variable:"__variable_9e7bcd"}},21056:function(t){t.exports={style:{fontFamily:"'__Roboto_Mono_f18e28', '__Roboto_Mono_Fallback_f18e28'",fontWeight:700,fontStyle:"normal"},className:"__className_f18e28",variable:"__variable_f18e28"}},29282:function(t){t.exports={style:{fontFamily:"'__Squada_One_4f93f4', '__Squada_One_Fallback_4f93f4'",fontWeight:400,fontStyle:"normal"},className:"__className_4f93f4",variable:"__variable_4f93f4"}},40924:function(t){t.exports={style:{fontFamily:"'__Work_Sans_57f497', '__Work_Sans_Fallback_57f497'",fontStyle:"normal"},className:"__className_57f497",variable:"__variable_57f497"}},16853:function(){},9008:function(t,e,r){t.exports=r(83121)},34155:function(t){var e,r,n,i=t.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(n){r=s}}();var u=[],l=!1,h=-1;function c(){l&&n&&(l=!1,n.length?u=n.concat(u):h=-1,u.length&&f())}function f(){if(!l){var t=a(c);l=!0;for(var e=u.length;e;){for(n=u,u=[];++h1)for(var r=1;r=64;){let d=r,p=n,m=i,g=o,y=s,v=a,b=u,w=l,A,E,k,S,M;for(E=0;E<16;E++)k=c+4*E,h[E]=(255&t[k])<<24|(255&t[k+1])<<16|(255&t[k+2])<<8|255&t[k+3];for(E=16;E<64;E++)S=((A=h[E-2])>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,M=((A=h[E-15])>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,h[E]=(S+h[E-7]|0)+(M+h[E-16]|0)|0;for(E=0;E<64;E++)S=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&v^~y&b)|0)+(w+(e[E]+h[E]|0)|0)|0,M=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&p^d&m^p&m)|0,w=b,b=v,v=y,y=g+S|0,g=m,m=p,p=d,d=S+M|0;r=r+d|0,n=n+p|0,i=i+m|0,o=o+g|0,s=s+y|0,a=a+v|0,u=u+b|0,l=l+w|0,c+=64,f-=64}}c(t);let f,d=t.length%64,p=t.length/536870912|0,m=t.length<<3,g=d<56?56:120,y=t.slice(t.length-d,t.length);for(y.push(128),f=d+1;f>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),c(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,l>>>24&255,l>>>16&255,l>>>8&255,l>>>0&255]}function n(t,e,n){let i;t=t.length<=64?t:r(t);let o=64+e.length+4,s=Array(o),a=Array(64),u=[];for(i=0;i<64;i++)s[i]=54;for(i=0;i=o-4;t--){if(s[t]++,s[t]<=255)return;s[t]=0}}for(;n>=32;)l(),u=u.concat(r(a.concat(r(s)))),n-=32;return n>0&&(l(),u=u.concat(r(a.concat(r(s))).slice(0,n))),u}function i(t,e,r,n,i){let u;for(a(t,(2*r-1)*16,i,0,16),u=0;u<2*r;u++)s(t,16*u,i,16),function(t,e){a(t,0,e,0,16);for(let r=8;r>0;r-=2)e[4]^=o(e[0]+e[12],7),e[8]^=o(e[4]+e[0],9),e[12]^=o(e[8]+e[4],13),e[0]^=o(e[12]+e[8],18),e[9]^=o(e[5]+e[1],7),e[13]^=o(e[9]+e[5],9),e[1]^=o(e[13]+e[9],13),e[5]^=o(e[1]+e[13],18),e[14]^=o(e[10]+e[6],7),e[2]^=o(e[14]+e[10],9),e[6]^=o(e[2]+e[14],13),e[10]^=o(e[6]+e[2],18),e[3]^=o(e[15]+e[11],7),e[7]^=o(e[3]+e[15],9),e[11]^=o(e[7]+e[3],13),e[15]^=o(e[11]+e[7],18),e[1]^=o(e[0]+e[3],7),e[2]^=o(e[1]+e[0],9),e[3]^=o(e[2]+e[1],13),e[0]^=o(e[3]+e[2],18),e[6]^=o(e[5]+e[4],7),e[7]^=o(e[6]+e[5],9),e[4]^=o(e[7]+e[6],13),e[5]^=o(e[4]+e[7],18),e[11]^=o(e[10]+e[9],7),e[8]^=o(e[11]+e[10],9),e[9]^=o(e[8]+e[11],13),e[10]^=o(e[9]+e[8],18),e[12]^=o(e[15]+e[14],7),e[13]^=o(e[12]+e[15],9),e[14]^=o(e[13]+e[12],13),e[15]^=o(e[14]+e[13],18);for(let n=0;n<16;++n)t[n]+=e[n]}(i,n),a(i,0,t,e+16*u,16);for(u=0;u>>32-e}function s(t,e,r,n){for(let i=0;i=256)return!1}return!0}function l(t,e){if("number"!=typeof t||t%1)throw Error("invalid "+e);return t}function h(t,e,r,o,h,c,f){let d;if(r=l(r,"N"),o=l(o,"r"),h=l(h,"p"),c=l(c,"dkLen"),0===r||(r&r-1)!=0)throw Error("N must be power of 2");if(r>2147483647/128/o)throw Error("N too large");if(o>2147483647/128/h)throw Error("r too large");if(!u(t))throw Error("password must be an array or buffer");if(t=Array.prototype.slice.call(t),!u(e))throw Error("salt must be an array or buffer");let p=n(t,e=Array.prototype.slice.call(e),128*h*o),m=new Uint32Array(32*h*o);for(let g=0;gO&&(e=O);for(let u=0;uO&&(e=O);for(let g=0;g>0&255),p.push(m[B]>>8&255),p.push(m[B]>>16&255),p.push(m[B]>>24&255);let L=n(t,p,c);return f&&f(null,1,L),L}f&&R(N)};if(!f)for(;;){let I=N();if(void 0!=I)return I}N()}t.exports={scrypt:function(t,e,r,n,i,o,s){return new Promise(function(a,u){let l=0;s&&s(0),h(t,e,r,n,i,o,function(t,e,r){if(t)u(t);else if(r)s&&1!==l&&s(1),a(new Uint8Array(r));else if(s&&e!==l)return l=e,s(e)})})},syncScrypt:function(t,e,r,n,i,o){return new Uint8Array(h(t,e,r,n,i,o))}}}(0)},53250:function(t,e,r){"use strict";/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ var n=r(67294),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=n.useState,s=n.useEffect,a=n.useLayoutEffect,u=n.useDebugValue;function l(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!i(t,r)}catch(n){return!0}}var h="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var r=e(),n=o({inst:{value:r,getSnapshot:e}}),i=n[0].inst,h=n[1];return a(function(){i.value=r,i.getSnapshot=e,l(i)&&h({inst:i})},[t,r,e]),s(function(){return l(i)&&h({inst:i}),t(function(){l(i)&&h({inst:i})})},[t]),u(r),r};e.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:h},50139:function(t,e,r){"use strict";/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ var n=r(67294),i=r(61688),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=i.useSyncExternalStore,a=n.useRef,u=n.useEffect,l=n.useMemo,h=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var c=a(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=l(function(){function t(t){if(!u){if(u=!0,s=t,t=n(t),void 0!==i&&f.hasValue){var e=f.value;if(i(e,t))return a=e}return a=t}if(e=a,o(s,t))return e;var r=n(t);return void 0!==i&&i(e,r)?e:(s=t,a=r)}var s,a,u=!1,l=void 0===r?null:r;return[function(){return t(e())},null===l?void 0:function(){return t(l())}]},[e,r,n,i]);var d=s(t,c[0],c[1]);return u(function(){f.hasValue=!0,f.value=d},[d]),h(d),d}},61688:function(t,e,r){"use strict";t.exports=r(53250)},52798:function(t,e,r){"use strict";t.exports=r(50139)},38109:function(t,e,r){"use strict";let n;function i(){}r.d(e,{eM:function(){return tS},eI:function(){return tA},mA:function(){return tN},$4:function(){return tB},cq:function(){return tJ},qL:function(){return tD},LN:function(){return tU},yL:function(){return tC},yw:function(){return tz},mx:function(){return tK},g0:function(){return tW}});let o="undefined"==typeof window||"Deno"in window;function s(){}function a(t){return"number"==typeof t&&t>=0&&t!==1/0}function u(t,e){return Math.max(t+(e||0)-Date.now(),0)}function l(t,e,r){return A(t)?"function"==typeof e?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function h(t,e,r){return A(t)?"function"==typeof e?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:"function"==typeof t?{...e,mutationFn:t}:{...t}}function c(t,e,r){return A(t)?[{...e,queryKey:t},r]:[t||{},e]}function f(t,e){let{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:s,stale:a}=t;if(A(s)){if(n){if(e.queryHash!==p(s,e.options))return!1}else{if(!g(e.queryKey,s))return!1}}if("all"!==r){let u=e.isActive();if("active"===r&&!u||"inactive"===r&&u)return!1}return("boolean"!=typeof a||e.isStale()===a)&&(void 0===i||i===e.state.fetchStatus)&&(!o||!!o(e))}function d(t,e){let{exact:r,fetching:n,predicate:i,mutationKey:o}=t;if(A(o)){if(!e.options.mutationKey)return!1;if(r){if(m(e.options.mutationKey)!==m(o))return!1}else{if(!g(e.options.mutationKey,o))return!1}}return("boolean"!=typeof n||"loading"===e.state.status===n)&&(!i||!!i(e))}function p(t,e){let r=(null==e?void 0:e.queryKeyHashFn)||m;return r(t)}function m(t){return JSON.stringify(t,(t,e)=>b(e)?Object.keys(e).sort().reduce((t,r)=>(t[r]=e[r],t),{}):e)}function g(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&!Object.keys(e).some(r=>!g(t[r],e[r]))}function y(t,e){if(t&&!e||e&&!t)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0}function v(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function b(t){if(!w(t))return!1;let e=t.constructor;if(void 0===e)return!0;let r=e.prototype;return!!(w(r)&&r.hasOwnProperty("isPrototypeOf"))}function w(t){return"[object Object]"===Object.prototype.toString.call(t)}function A(t){return Array.isArray(t)}function E(t){return new Promise(e=>{setTimeout(e,t)})}function k(t){E(0).then(t)}function S(t,e,r){return null!=r.isDataEqual&&r.isDataEqual(t,e)?t:"function"==typeof r.structuralSharing?r.structuralSharing(t,e):!1!==r.structuralSharing?function t(e,r){if(e===r)return e;let n=v(e)&&v(r);if(n||b(e)&&b(r)){let i=n?e.length:Object.keys(e).length,o=n?r:Object.keys(r),s=o.length,a=n?[]:{},u=0;for(let l=0;l{t()},n=t=>{t()},i=t=>{let r;e++;try{r=t()}finally{--e||a()}return r},o=n=>{e?t.push(n):k(()=>{r(n)})},s=t=>(...e)=>{o(()=>{t(...e)})},a=()=>{let e=t;t=[],e.length&&k(()=>{n(()=>{e.forEach(t=>{r(t)})})})},u=t=>{r=t},l=t=>{n=t};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:u,setBatchNotifyFunction:l}}();class x{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.push(t),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(e=>e!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}let P=new class extends x{constructor(){super(),this.setup=t=>{if(!o&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",e,!1),()=>{window.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.cleanup)||t.call(this),this.cleanup=void 0}}setEventListener(t){var e;this.setup=t,null==(e=this.cleanup)||e.call(this),this.cleanup=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}},C=new class extends x{constructor(){super(),this.setup=t=>{if(!o&&window.addEventListener){let e=()=>t();return window.addEventListener("online",e,!1),window.addEventListener("offline",e,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.cleanup)||t.call(this),this.cleanup=void 0}}setEventListener(t){var e;this.setup=t,null==(e=this.cleanup)||e.call(this),this.cleanup=t(t=>{"boolean"==typeof t?this.setOnline(t):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}};function O(t){return Math.min(1e3*2**t,3e4)}function R(t){return(null!=t?t:"online")!=="online"||C.isOnline()}class N{constructor(t){this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}}function I(t){return t instanceof N}function T(t){let e,r,n,i=!1,o=0,s=!1,a=new Promise((t,e)=>{r=t,n=e}),u=e=>{s||(d(new N(e)),null==t.abort||t.abort())},l=()=>{i=!0},h=()=>{i=!1},c=()=>!P.isFocused()||"always"!==t.networkMode&&!C.isOnline(),f=n=>{s||(s=!0,null==t.onSuccess||t.onSuccess(n),null==e||e(),r(n))},d=r=>{s||(s=!0,null==t.onError||t.onError(r),null==e||e(),n(r))},p=()=>new Promise(r=>{e=t=>{if(s||!c())return r(t)},null==t.onPause||t.onPause()}).then(()=>{e=void 0,s||null==t.onContinue||t.onContinue()}),m=()=>{let e;if(!s){try{e=t.fn()}catch(r){e=Promise.reject(r)}Promise.resolve(e).then(f).catch(e=>{var r,n;if(s)return;let a=null!=(r=t.retry)?r:3,u=null!=(n=t.retryDelay)?n:O,l="function"==typeof u?u(o,e):u,h=!0===a||"number"==typeof a&&o{if(c())return p()}).then(()=>{i?d(e):m()})})}};return R(t.networkMode)?m():p().then(m),{promise:a,cancel:u,continue(){null==e||e()},cancelRetry:l,continueRetry:h}}class B{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),a(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,null!=t?t:o?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class L extends B{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||M,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||function(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,r=void 0!==e,n=r?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(t,e){let r=S(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:null==e?void 0:e.updatedAt,manual:null==e?void 0:e.manual}),r}setState(t,e){this.dispatch({type:"setState",state:t,setStateOptions:e})}cancel(t){var e;let r=this.promise;return null==(e=this.retryer)||e.cancel(t),r?r.then(s).catch(s):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>!1!==t.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!u(this.state.dataUpdatedAt,t)}onFocus(){var t;let e=this.observers.find(t=>t.shouldFetchOnWindowFocus());e&&e.refetch({cancelRefetch:!1}),null==(t=this.retryer)||t.continue()}onOnline(){var t;let e=this.observers.find(t=>t.shouldFetchOnReconnect());e&&e.refetch({cancelRefetch:!1}),null==(t=this.retryer)||t.continue()}addObserver(t){-1===this.observers.indexOf(t)&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){-1!==this.observers.indexOf(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,e){var r,n,i,o;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=e&&e.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(t&&this.setOptions(t),!this.options.queryFn){let s=this.observers.find(t=>t.options.queryFn);s&&this.setOptions(s.options)}Array.isArray(this.options.queryKey);let a=function(){if("function"==typeof AbortController)return new AbortController}(),u={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(u);let h=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(u)):Promise.reject("Missing queryFn"),c={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:h};l(c),null==(r=this.options.behavior)||r.onFetch(c),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=c.fetchOptions)?void 0:n.meta))&&this.dispatch({type:"fetch",meta:null==(o=c.fetchOptions)?void 0:o.meta});let f=t=>{if(I(t)&&t.silent||this.dispatch({type:"error",error:t}),!I(t)){var e,r;null==(e=(r=this.cache.config).onError)||e.call(r,t,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=T({fn:c.fetchFn,abort:null==a?void 0:a.abort.bind(a),onSuccess:t=>{var e,r;if(void 0===t){f(Error("undefined"));return}this.setData(t),null==(e=(r=this.cache.config).onSuccess)||e.call(r,t,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:f,onFail:(t,e)=>{this.dispatch({type:"failed",failureCount:t,error:e})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){this.state=(e=>{var r,n;switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(r=t.meta)?r:null,fetchStatus:R(this.options.networkMode)?"fetching":"paused",...!e.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:null!=(n=t.dataUpdatedAt)?n:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=t.error;if(I(i)&&i.revert&&this.revertState)return{...this.revertState};return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),_.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}class F extends x{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,e,r){var n;let i=e.queryKey,o=null!=(n=e.queryHash)?n:p(i,e),s=this.get(o);return s||(s=new L({cache:this,logger:t.getLogger(),queryKey:i,queryHash:o,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){let e=this.queriesMap[t.queryHash];e&&(t.destroy(),this.queries=this.queries.filter(e=>e!==t),e===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){_.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,e){let[r]=c(t,e);return void 0===r.exact&&(r.exact=!0),this.queries.find(t=>f(r,t))}findAll(t,e){let[r]=c(t,e);return Object.keys(r).length>0?this.queries.filter(t=>f(r,t)):this.queries}notify(t){_.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){_.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){_.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class D extends B{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||M,this.observers=[],this.state=t.state||U(),this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){-1===this.observers.indexOf(t)&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(e=>e!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()}async execute(){var t,e,r,n,i,o,s,a,u,l,h,c,f,d,p,m;let g="loading"===this.state.status;try{if(!g){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(s=(a=this.mutationCache.config).onMutate)?void 0:s.call(a,this.state.variables,this));let y=await (null==(u=(l=this.options).onMutate)?void 0:u.call(l,this.state.variables));y!==this.state.context&&this.dispatch({type:"loading",context:y,variables:this.state.variables})}let v=await (()=>{var t;return this.retryer=T({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(t,e)=>{this.dispatch({type:"failed",failureCount:t,error:e})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(t=this.options.retry)?t:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return await (null==(t=(e=this.mutationCache.config).onSuccess)?void 0:t.call(e,v,this.state.variables,this.state.context,this)),await (null==(r=(n=this.options).onSuccess)?void 0:r.call(n,v,this.state.variables,this.state.context)),await (null==(i=(o=this.options).onSettled)?void 0:i.call(o,v,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:v}),v}catch(b){try{throw await (null==(h=(c=this.mutationCache.config).onError)?void 0:h.call(c,b,this.state.variables,this.state.context,this)),await (null==(f=(d=this.options).onError)?void 0:f.call(d,b,this.state.variables,this.state.context)),await (null==(p=(m=this.options).onSettled)?void 0:p.call(m,void 0,b,this.state.variables,this.state.context)),b}finally{this.dispatch({type:"error",error:b})}}}dispatch(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"loading":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!R(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...e,...t.state}}})(this.state),_.batch(()=>{this.observers.forEach(e=>{e.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function U(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class j extends x{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,e,r){let n=new D({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(e),state:r,defaultOptions:e.mutationKey?t.getMutationDefaults(e.mutationKey):void 0});return this.add(n),n}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(e=>e!==t),this.notify({type:"removed",mutation:t})}clear(){_.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return void 0===t.exact&&(t.exact=!0),this.mutations.find(e=>d(t,e))}findAll(t){return this.mutations.filter(e=>d(t,e))}notify(t){_.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.mutations.filter(t=>t.state.isPaused);return _.batch(()=>t.reduce((t,e)=>t.then(()=>e.continue().catch(s)),Promise.resolve()))}}function q(t,e){return null==t.getNextPageParam?void 0:t.getNextPageParam(e[e.length-1],e)}class K{constructor(t={}){this.queryCache=t.queryCache||new F,this.mutationCache=t.mutationCache||new j,this.logger=t.logger||M,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}mount(){this.unsubscribeFocus=P.subscribe(()=>{P.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=C.subscribe(()=>{C.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})}unmount(){var t,e;null==(t=this.unsubscribeFocus)||t.call(this),null==(e=this.unsubscribeOnline)||e.call(this)}isFetching(t,e){let[r]=c(t,e);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,e){var r;return null==(r=this.queryCache.find(t,e))?void 0:r.state.data}ensureQueryData(t,e,r){let n=l(t,e,r),i=this.getQueryData(n.queryKey);return i?Promise.resolve(i):this.fetchQuery(n)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:t,state:e})=>{let r=e.data;return[t,r]})}setQueryData(t,e,r){let n=this.queryCache.find(t),i=null==n?void 0:n.state.data,o="function"==typeof e?e(i):e;if(void 0===o)return;let s=l(t),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return _.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,r)]))}getQueryState(t,e){var r;return null==(r=this.queryCache.find(t,e))?void 0:r.state}removeQueries(t,e){let[r]=c(t,e),n=this.queryCache;_.batch(()=>{n.findAll(r).forEach(t=>{n.remove(t)})})}resetQueries(t,e,r){let[n,i]=c(t,e,r),o=this.queryCache,s={type:"active",...n};return _.batch(()=>(o.findAll(n).forEach(t=>{t.reset()}),this.refetchQueries(s,i)))}cancelQueries(t,e,r){let[n,i={}]=c(t,e,r);void 0===i.revert&&(i.revert=!0);let o=_.batch(()=>this.queryCache.findAll(n).map(t=>t.cancel(i)));return Promise.all(o).then(s).catch(s)}invalidateQueries(t,e,r){let[n,i]=c(t,e,r);return _.batch(()=>{var t,e;if(this.queryCache.findAll(n).forEach(t=>{t.invalidate()}),"none"===n.refetchType)return Promise.resolve();let r={...n,type:null!=(t=null!=(e=n.refetchType)?e:n.type)?t:"active"};return this.refetchQueries(r,i)})}refetchQueries(t,e,r){let[n,i]=c(t,e,r),o=_.batch(()=>this.queryCache.findAll(n).filter(t=>!t.isDisabled()).map(t=>{var e;return t.fetch(void 0,{...i,cancelRefetch:null==(e=null==i?void 0:i.cancelRefetch)||e,meta:{refetchPage:n.refetchPage}})})),a=Promise.all(o).then(s);return null!=i&&i.throwOnError||(a=a.catch(s)),a}fetchQuery(t,e,r){let n=l(t,e,r),i=this.defaultQueryOptions(n);void 0===i.retry&&(i.retry=!1);let o=this.queryCache.build(this,i);return o.isStaleByTime(i.staleTime)?o.fetch(i):Promise.resolve(o.state.data)}prefetchQuery(t,e,r){return this.fetchQuery(t,e,r).then(s).catch(s)}fetchInfiniteQuery(t,e,r){let n=l(t,e,r);return n.behavior={onFetch(t){t.fetchFn=()=>{var e,r,n,i,o,s,a;let u;let l=null==(e=t.fetchOptions)?void 0:null==(r=e.meta)?void 0:r.refetchPage,h=null==(n=t.fetchOptions)?void 0:null==(i=n.meta)?void 0:i.fetchMore,c=null==h?void 0:h.pageParam,f=(null==h?void 0:h.direction)==="forward",d=(null==h?void 0:h.direction)==="backward",p=(null==(o=t.state.data)?void 0:o.pages)||[],m=(null==(s=t.state.data)?void 0:s.pageParams)||[],g=m,y=!1,v=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get(){var e,r;return null!=(e=t.signal)&&e.aborted?y=!0:null==(r=t.signal)||r.addEventListener("abort",()=>{y=!0}),t.signal}})},b=t.options.queryFn||(()=>Promise.reject("Missing queryFn")),w=(t,e,r,n)=>(g=n?[e,...g]:[...g,e],n?[r,...t]:[...t,r]),A=(e,r,n,i)=>{if(y)return Promise.reject("Cancelled");if(void 0===n&&!r&&e.length)return Promise.resolve(e);let o={queryKey:t.queryKey,pageParam:n,meta:t.options.meta};v(o);let s=b(o),a=Promise.resolve(s).then(t=>w(e,n,t,i));return a};if(p.length){if(f){let E=void 0!==c,k=E?c:q(t.options,p);u=A(p,E,k)}else if(d){let S=void 0!==c,M=S?c:null==(a=t.options).getPreviousPageParam?void 0:a.getPreviousPageParam(p[0],p);u=A(p,S,M,!0)}else{g=[];let _=void 0===t.options.getNextPageParam,x=!l||!p[0]||l(p[0],0,p);u=x?A([],_,m[0]):Promise.resolve(w([],m[0],p[0]));for(let P=1;P{let r=!l||!p[P]||l(p[P],P,p);if(r){let n=_?m[P]:q(t.options,e);return A(e,_,n)}return Promise.resolve(w(e,m[P],p[P]))})}}else u=A([]);let C=u.then(t=>({pages:t,pageParams:g}));return C}}},this.fetchQuery(n)}prefetchInfiniteQuery(t,e,r){return this.fetchInfiniteQuery(t,e,r).then(s).catch(s)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,e){let r=this.queryDefaults.find(e=>m(t)===m(e.queryKey));r?r.defaultOptions=e:this.queryDefaults.push({queryKey:t,defaultOptions:e})}getQueryDefaults(t){if(!t)return;let e=this.queryDefaults.find(e=>g(t,e.queryKey));return null==e?void 0:e.defaultOptions}setMutationDefaults(t,e){let r=this.mutationDefaults.find(e=>m(t)===m(e.mutationKey));r?r.defaultOptions=e:this.mutationDefaults.push({mutationKey:t,defaultOptions:e})}getMutationDefaults(t){if(!t)return;let e=this.mutationDefaults.find(e=>g(t,e.mutationKey));return null==e?void 0:e.defaultOptions}defaultQueryOptions(t){if(null!=t&&t._defaulted)return t;let e={...this.defaultOptions.queries,...this.getQueryDefaults(null==t?void 0:t.queryKey),...t,_defaulted:!0};return!e.queryHash&&e.queryKey&&(e.queryHash=p(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.useErrorBoundary&&(e.useErrorBoundary=!!e.suspense),e}defaultMutationOptions(t){return null!=t&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==t?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}var G=r(67294);let z=G.createContext(void 0),H=G.createContext(!1);function Q(t,e){return t||(e&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=z),window.ReactQueryClientContext):z)}let W=({context:t}={})=>{let e=G.useContext(Q(t,G.useContext(H)));if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},J=({client:t,children:e,context:r,contextSharing:n=!1})=>{G.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);let i=Q(r,n);return G.createElement(H.Provider,{value:!r&&n},G.createElement(i.Provider,{value:t},e))},V=G.createContext(!1),Z=()=>G.useContext(V);V.Provider;let Y=G.createContext((n=!1,{clearReset(){n=!1},reset(){n=!0},isReset:()=>n})),$=()=>G.useContext(Y);var X=r(61688);let tt=X.useSyncExternalStore;class te extends x{constructor(t,e){super(),this.client=t,this.setOptions(e),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.client.defaultMutationOptions(t),y(e,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this})}onUnsubscribe(){if(!this.listeners.length){var t;null==(t=this.currentMutation)||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();let e={listeners:!0};"success"===t.type?e.onSuccess=!0:"error"===t.type&&(e.onError=!0),this.notify(e)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,e){return this.mutateOptions=e,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==t?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let t=this.currentMutation?this.currentMutation.state:U(),e={...t,isLoading:"loading"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset};this.currentResult=e}notify(t){_.batch(()=>{if(this.mutateOptions){var e,r,n,i,o,s,a,u;t.onSuccess?(null==(e=(r=this.mutateOptions).onSuccess)||e.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(i=this.mutateOptions).onSettled)||n.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):t.onError&&(null==(o=(s=this.mutateOptions).onError)||o.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(u=this.mutateOptions).onSettled)||a.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}t.listeners&&this.listeners.forEach(t=>{t(this.currentResult)})})}}function tr(){}class tn extends x{constructor(t,e){super(),this.client=t,this.options=e,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.length&&(this.currentQuery.addObserver(this),ti(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return to(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return to(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,e){let r=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),y(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();let i=this.hasListeners();i&&ts(this.currentQuery,n,this.options,r)&&this.executeFetch(),this.updateResult(e),i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();let o=this.computeRefetchInterval();i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(t){let e=this.client.getQueryCache().build(this.client,t);return this.createResult(e,t)}getCurrentResult(){return this.currentResult}trackResult(t){let e={};return Object.keys(t).forEach(r=>{Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),e}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...e}={}){return this.fetch({...e,meta:{refetchPage:t}})}fetchOptimistic(t){let e=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,e);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,e))}fetch(t){var e;return this.executeFetch({...t,cancelRefetch:null==(e=t.cancelRefetch)||e}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let e=this.currentQuery.fetch(this.options,t);return null!=t&&t.throwOnError||(e=e.catch(s)),e}updateStaleTimeout(){if(this.clearStaleTimeout(),o||this.currentResult.isStale||!a(this.options.staleTime))return;let t=u(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t+1)}computeRefetchInterval(){var t;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(t=this.options.refetchInterval)&&t}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!o&&!1!==this.options.enabled&&a(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||P.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,e){let r;let n=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,a=this.currentResultOptions,u=t!==n,l=u?t.state:this.currentQueryInitialState,h=u?this.currentResult:this.previousQueryResult,{state:c}=t,{dataUpdatedAt:f,error:d,errorUpdatedAt:p,fetchStatus:m,status:g}=c,y=!1,v=!1;if(e._optimisticResults){let b=this.hasListeners(),w=!b&&ti(t,e),A=b&&ts(t,n,e,i);(w||A)&&(m=R(t.options.networkMode)?"fetching":"paused",f||(g="loading")),"isRestoring"===e._optimisticResults&&(m="idle")}if(e.keepPreviousData&&!c.dataUpdatedAt&&null!=h&&h.isSuccess&&"error"!==g)r=h.data,f=h.dataUpdatedAt,g=h.status,y=!0;else if(e.select&&void 0!==c.data){if(o&&c.data===(null==s?void 0:s.data)&&e.select===this.selectFn)r=this.selectResult;else try{this.selectFn=e.select,r=e.select(c.data),r=S(null==o?void 0:o.data,r,e),this.selectResult=r,this.selectError=null}catch(E){this.selectError=E}}else r=c.data;if(void 0!==e.placeholderData&&void 0===r&&"loading"===g){let k;if(null!=o&&o.isPlaceholderData&&e.placeholderData===(null==a?void 0:a.placeholderData))k=o.data;else if(k="function"==typeof e.placeholderData?e.placeholderData():e.placeholderData,e.select&&void 0!==k)try{k=e.select(k),this.selectError=null}catch(M){this.selectError=M}void 0!==k&&(g="success",r=S(null==o?void 0:o.data,k,e),v=!0)}this.selectError&&(d=this.selectError,r=this.selectResult,p=Date.now(),g="error");let _="fetching"===m,x="loading"===g,P="error"===g,C={status:g,fetchStatus:m,isLoading:x,isSuccess:"success"===g,isError:P,isInitialLoading:x&&_,data:r,dataUpdatedAt:f,error:d,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:_,isRefetching:_&&!x,isLoadingError:P&&0===c.dataUpdatedAt,isPaused:"paused"===m,isPlaceholderData:v,isPreviousData:y,isRefetchError:P&&0!==c.dataUpdatedAt,isStale:ta(t,e),refetch:this.refetch,remove:this.remove};return C}updateResult(t){let e=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,y(r,e))return;this.currentResult=r;let n={cache:!0};(null==t?void 0:t.listeners)!==!1&&(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options;if("all"===t||!t&&!this.trackedProps.size)return!0;let r=new Set(null!=t?t:this.trackedProps);return this.options.useErrorBoundary&&r.add("error"),Object.keys(this.currentResult).some(t=>{let n=this.currentResult[t]!==e[t];return n&&r.has(t)})})()&&(n.listeners=!0),this.notify({...n,...t})}updateQuery(){let t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;let e=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==e||e.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){let e={};"success"===t.type?e.onSuccess=!t.manual:"error"!==t.type||I(t.error)||(e.onError=!0),this.updateResult(e),this.hasListeners()&&this.updateTimers()}notify(t){_.batch(()=>{var e,r,n,i,o,s,a,u;t.onSuccess?(null==(e=(r=this.options).onSuccess)||e.call(r,this.currentResult.data),null==(n=(i=this.options).onSettled)||n.call(i,this.currentResult.data,null)):t.onError&&(null==(o=(s=this.options).onError)||o.call(s,this.currentResult.error),null==(a=(u=this.options).onSettled)||a.call(u,void 0,this.currentResult.error)),t.listeners&&this.listeners.forEach(t=>{t(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function ti(t,e){return!1!==e.enabled&&!t.state.dataUpdatedAt&&!("error"===t.state.status&&!1===e.retryOnMount)||t.state.dataUpdatedAt>0&&to(t,e,e.refetchOnMount)}function to(t,e,r){if(!1!==e.enabled){let n="function"==typeof r?r(t):r;return"always"===n||!1!==n&&ta(t,e)}return!1}function ts(t,e,r,n){return!1!==r.enabled&&(t!==e||!1===n.enabled)&&(!r.suspense||"error"!==t.state.status)&&ta(t,r)}function ta(t,e){return t.isStaleByTime(e.staleTime)}function tu(t){return t.state.isPaused}function tl(t){return"success"===t.state.status}async function th({queryClient:t,persister:e,maxAge:r=864e5,buster:n="",hydrateOptions:i}){try{let o=await e.restoreClient();if(o){if(o.timestamp){let s=Date.now()-o.timestamp>r,a=o.buster!==n;s||a?e.removeClient():function(t,e,r){if("object"!=typeof e||null===e)return;let n=t.getMutationCache(),i=t.getQueryCache(),o=e.mutations||[],s=e.queries||[];o.forEach(e=>{var i;n.build(t,{...null==r?void 0:null==(i=r.defaultOptions)?void 0:i.mutations,mutationKey:e.mutationKey},e.state)}),s.forEach(e=>{var n;let o=i.get(e.queryHash);if(o){o.state.dataUpdatedAt{i(t)&&r.push({mutationKey:t.options.mutationKey,state:t.state})})}if(!1!==e.dehydrateQueries){let o=e.shouldDehydrateQuery||tl;t.getQueryCache().getAll().forEach(t=>{o(t)&&n.push({state:t.state,queryKey:t.queryKey,queryHash:t.queryHash})})}return{mutations:r,queries:n}}(t,n)};await e.persistClient(i)}var tf=r(97231),td=r(2984),tp=r(5151),tm=r(52798);let tg=(t,e)=>{let{find:r,replace:n}=e;return t&&r(t)?n(t):"object"!=typeof t?t:Array.isArray(t)?t.map(t=>tg(t,{find:r,replace:n})):t instanceof Object?Object.entries(t).reduce((t,e)=>{let[i,o]=e;return{...t,[i]:tg(o,{find:r,replace:n})}},{}):t};function ty(t){let e=JSON.parse(t),r=tg(e,{find:t=>"BigNumber"===t.type,replace:t=>tp.BigNumber.from(t.hex)});return r}function tv(t,e){return t.slice(0,e).join(".")||"."}function tb(t,e){let{length:r}=t;for(let n=0;n{try{t.setItem(e,n(r));return}catch(i){return i}};return{persistClient:function(t,e=100){let r=null;return function(...n){null===r&&(r=setTimeout(()=>{t(...n),r=null},e))}}(t=>{let e=t,r=a(e),n=0;for(;r&&e;)n++,(e=null==s?void 0:s({persistedClient:e,error:r,errorCount:n}))&&(r=a(e))},r),restoreClient(){let r=t.getItem(e);if(r)return o(r)},removeClient(){t.removeItem(e)}}}return{persistClient:i,restoreClient:()=>void 0,removeClient:i}}({key:"wagmi.cache",storage:window.localStorage,serialize:tw,deserialize:ty}):void 0,...n}=t,o=(0,tf.k)(n);return r&&function(t){let e;th(t).then(()=>{(function(t){let e=t.queryClient.getQueryCache().subscribe(()=>{tc(t)}),r=t.queryClient.getMutationCache().subscribe(()=>{tc(t)});()=>{e(),r()}})(t)})}({queryClient:e,persister:r,dehydrateOptions:{shouldDehydrateQuery:t=>0!==t.cacheTime&&!1!==t.queryKey[0].persist}}),Object.assign(o,{queryClient:e})}let tE=G.createContext(void 0),tk=G.createContext(void 0);function tS(t){let{children:e,client:r}=t;return G.createElement(tE.Provider,{value:r},G.createElement(J,{client:r.queryClient,context:tk},e))}function tM(){let t=G.useContext(tE);if(!t)throw Error("`useClient` must be used within `WagmiConfig`.\n\nRead more: https://wagmi.sh/docs/WagmiConfig");return t}let t_=X.useSyncExternalStore;function tx(t,e,r){let n=h(t,e,r);return function(t,e,r){var n,i;let o=h(t,void 0,void 0),s=W({context:o.context}),[a]=G.useState(()=>new te(s,o));G.useEffect(()=>{a.setOptions(o)},[a,o]);let u=tt(G.useCallback(t=>a.subscribe(_.batchCalls(t)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),l=G.useCallback((t,e)=>{a.mutate(t,e).catch(tr)},[a]);if(u.error&&(n=a.options.useErrorBoundary,i=[u.error],"function"==typeof n?n(...i):!!n))throw u.error;return{...u,mutate:l,mutateAsync:u.mutate}}({context:tk,...n})}let tP=()=>W({context:tk});function tC(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,tm.useSyncExternalStoreWithSelector)(e=>(0,td.b0)({chainId:t},e),()=>(0,tf.f)({chainId:t}),()=>(0,tf.f)({chainId:t}),t=>t,(t,e)=>t.network.chainId===e.network.chainId)}let tO=t=>"object"==typeof t&&!Array.isArray(t);function tR(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:td.vZ,i=G.useRef([]),o=(0,tm.useSyncExternalStoreWithSelector)(t,e,r,t=>t,(t,e)=>{if(tO(t)&&tO(e)){for(let r of i.current){let o=n(t[r],e[r]);if(!o)return!1}return!0}return n(t,e)});if(tO(o)){let s={...o};return Object.defineProperties(s,Object.entries(s).reduce((t,e)=>{let[r,n]=e;return{...t,[r]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(r)||i.current.push(r),n)}}},{})),s}return o}function tN(){var t,e,r;let{onConnect:n,onDisconnect:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=tR(td.uH,td.D0),s=G.useRef();return n&&(null===(t=s.current)||void 0===t?void 0:t.status)!=="connected"&&"connected"===o.status&&n({address:o.address,connector:o.connector,isReconnected:(null===(e=s.current)||void 0===e?void 0:e.status)==="reconnecting"}),i&&(null===(r=s.current)||void 0===r?void 0:r.status)=="connected"&&"disconnected"===o.status&&i(),s.current=o,o}let tI=t=>[{entity:"connect",...t}],tT=t=>{let{connector:e,chainId:r}=t;if(!e)throw Error("connector is required");return(0,td.$j)({connector:e,chainId:r})};function tB(){let{chainId:t,connector:e,onError:r,onMutate:n,onSettled:i,onSuccess:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=tM(),{data:a,error:u,isError:l,isIdle:h,isLoading:c,isSuccess:f,mutate:d,mutateAsync:p,reset:m,status:g,variables:y}=tx(tI({connector:e,chainId:t}),tT,{onError:r,onMutate:n,onSettled:i,onSuccess:o}),v=G.useCallback(r=>d({chainId:(null==r?void 0:r.chainId)??t,connector:(null==r?void 0:r.connector)??e}),[t,e,d]),b=G.useCallback(r=>p({chainId:(null==r?void 0:r.chainId)??t,connector:(null==r?void 0:r.connector)??e}),[t,e,p]);return{connect:v,connectAsync:b,connectors:s.connectors,data:a,error:u,isError:l,isIdle:h,isLoading:c,isSuccess:f,pendingConnector:null==y?void 0:y.connector,reset:m,status:g,variables:y}}let tL=[{entity:"disconnect"}],tF=()=>(0,td.zP)();function tD(){let{onError:t,onMutate:e,onSettled:r,onSuccess:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{error:i,isError:o,isIdle:s,isLoading:a,isSuccess:u,mutate:l,mutateAsync:h,reset:c,status:f}=tx(tL,tF,{...t?{onError(e,r,n){t(e,n)}}:{},onMutate:e,...r?{onSettled(t,e,n,i){r(e,i)}}:{},...n?{onSuccess(t,e,r){n(r)}}:{}});return{disconnect:l,disconnectAsync:h,error:i,isError:o,isIdle:s,isLoading:a,isSuccess:u,reset:c,status:f}}function tU(){return tR(td.QC,td.Hy)}function tj(t){let{chainId:e}=t;return[{entity:"signer",chainId:e,persist:!1}]}function tq(t){let{queryKey:[{chainId:e}]}=t;return(0,td.DG)({chainId:e})}function tK(){let{chainId:t,suspense:e,onError:r,onSettled:n,onSuccess:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=function(){let{chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=tC({chainId:t});return e.network.chainId}({chainId:t}),s=function(t,e,r){let n=Array.isArray(t)?"function"==typeof e?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t,i=function(t,e){var r,n;let i=W({context:t.context}),o=Z(),s=$(),a=i.defaultQueryOptions(t);a._optimisticResults=o?"isRestoring":"optimistic",a.onError&&(a.onError=_.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=_.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=_.batchCalls(a.onSettled)),a.suspense&&"number"!=typeof a.staleTime&&(a.staleTime=1e3),(a.suspense||a.useErrorBoundary)&&!s.isReset()&&(a.retryOnMount=!1);let[u]=G.useState(()=>new e(i,a)),l=u.getOptimisticResult(a);if(t_(G.useCallback(t=>o?()=>void 0:u.subscribe(_.batchCalls(t)),[u,o]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),G.useEffect(()=>{s.clearReset()},[s]),G.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),a.suspense&&l.isLoading&&l.isFetching&&!o)throw u.fetchOptimistic(a).then(t=>{var e,r;let{data:n}=t;null===(e=a.onSuccess)||void 0===e||e.call(a,n),null===(r=a.onSettled)||void 0===r||r.call(a,n,null)}).catch(t=>{var e,r;s.clearReset(),null===(e=a.onError)||void 0===e||e.call(a,t),null===(r=a.onSettled)||void 0===r||r.call(a,void 0,t)});if(l.isError&&!s.isReset()&&!l.isFetching&&(r=a.useErrorBoundary,n=[l.error,u.getCurrentQuery()],"function"==typeof r?r(...n):!!r))throw l.error;let h="loading"===l.status&&"idle"===l.fetchStatus?"idle":l.status,c="loading"===h&&"fetching"===l.fetchStatus;return{...l,defaultedOptions:a,isIdle:"idle"===h,isLoading:c,observer:u,status:h}}({context:tk,...n},tn),o={data:i.data,error:i.error,fetchStatus:i.fetchStatus,isError:i.isError,isFetched:i.isFetched,isFetchedAfterMount:i.isFetchedAfterMount,isFetching:i.isFetching,isIdle:i.isIdle,isLoading:i.isLoading,isRefetching:i.isRefetching,isSuccess:i.isSuccess,refetch:i.refetch,status:i.status,internal:{dataUpdatedAt:i.dataUpdatedAt,errorUpdatedAt:i.errorUpdatedAt,failureCount:i.failureCount,isFetchedAfterMount:i.isFetchedAfterMount,isLoadingError:i.isLoadingError,isPaused:i.isPaused,isPlaceholderData:i.isPlaceholderData,isPreviousData:i.isPreviousData,isRefetchError:i.isRefetchError,isStale:i.isStale,remove:i.remove}};return i.defaultedOptions.notifyOnChangeProps?o:function(t,e){let r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(e.trackedProps.add(n),t[n])})}),r}(o,i.observer)}(tj({chainId:o}),tq,{cacheTime:0,staleTime:1/0,suspense:e,onError:r,onSettled:n,onSuccess:i}),a=tP();return G.useEffect(()=>{let t=(0,td.rn)({chainId:o},t=>a.setQueryData(tj({chainId:o}),t));return t},[a,o]),s}function tG(t){let{domain:e,types:r,value:n}=t;if(!e)throw Error("domain is required");if(!r)throw Error("types is required");if(!n)throw Error("value is required");return(0,td.xq)({domain:e,types:r,value:n})}function tz(){let{domain:t,types:e,value:r,onError:n,onMutate:i,onSettled:o,onSuccess:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:a,error:u,isError:l,isIdle:h,isLoading:c,isSuccess:f,mutate:d,mutateAsync:p,reset:m,status:g,variables:y}=tx(function(t){let{domain:e,types:r,value:n}=t;return[{entity:"signTypedData",domain:e,types:r,value:n}]}({domain:t,types:e,value:r}),tG,{onError:n,onMutate:i,onSettled:o,onSuccess:s}),v=G.useCallback(n=>d({domain:(null==n?void 0:n.domain)??t,types:(null==n?void 0:n.types)??e,value:(null==n?void 0:n.value)??r}),[t,e,r,d]),b=G.useCallback(n=>p({domain:(null==n?void 0:n.domain)??t,types:(null==n?void 0:n.types)??e,value:(null==n?void 0:n.value)??r}),[t,e,r,p]);return{data:a,error:u,isError:l,isIdle:h,isLoading:c,isSuccess:f,reset:m,signTypedData:v,signTypedDataAsync:b,status:g,variables:y}}let tH=t=>[{entity:"switchNetwork",...t}],tQ=t=>{let{chainId:e}=t;if(!e)throw Error("chainId is required");return(0,td.If)({chainId:e})};function tW(){var t;let e,r;let{chainId:n,throwForSwitchChainNotSupported:i,onError:o,onMutate:s,onSettled:a,onSuccess:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=tM(),h=function(){let[,t]=G.useReducer(t=>t+1,0);return t}(),{data:c,error:f,isError:d,isIdle:p,isLoading:m,isSuccess:g,mutate:y,mutateAsync:v,reset:b,status:w,variables:A}=tx(tH({chainId:n}),tQ,{onError:o,onMutate:s,onSettled:a,onSuccess:u}),E=G.useCallback(t=>y({chainId:t??n}),[n,y]),k=G.useCallback(t=>v({chainId:t??n}),[n,v]);G.useEffect(()=>{let t=l.subscribe(t=>{let{chains:e,connector:r}=t;return{chains:e,connector:r}},h);return t},[l,h]);let S=!!(null!==(t=l.connector)&&void 0!==t&&t.switchChain);return(i||S)&&(e=E,r=k),{chains:l.chains??[],data:c,error:f,isError:d,isIdle:p,isLoading:m,isSuccess:g,pendingChainId:null==A?void 0:A.chainId,reset:b,status:w,switchNetwork:e,switchNetworkAsync:r,variables:A}}function tJ(){let{address:t,abi:e,signerOrProvider:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return G.useMemo(()=>t&&e?(0,td.uN)({address:t,abi:e,signerOrProvider:null===r?void 0:r}):null,[t,e,r])}},88677:function(){},62808:function(){}},function(t){var e=function(e){return t(t.s=e)};t.O(0,[774,179],function(){return e(6840),e(80880)}),_N_E=t.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/webpack-7d61d74f1f5d72ed.js b/_next/static/chunks/webpack-0ea05f6bb1c8223f.js similarity index 97% rename from _next/static/chunks/webpack-7d61d74f1f5d72ed.js rename to _next/static/chunks/webpack-0ea05f6bb1c8223f.js index 53ac700..4063ad8 100644 --- a/_next/static/chunks/webpack-7d61d74f1f5d72ed.js +++ b/_next/static/chunks/webpack-0ea05f6bb1c8223f.js @@ -1 +1 @@ -!function(){"use strict";var e,t,n,r,o,u,i,a,f,c,d,l,s={},p={};function b(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={id:e,loaded:!1,exports:{}},r=!0;try{s[e].call(n.exports,n,n.exports,b),r=!1}finally{r&&delete p[e]}return n.loaded=!0,n.exports}b.m=s,b.amdO={},e=[],b.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(b.O).every(function(e){return b.O[e](n[f])})?n.splice(f--,1):(a=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var i=1/0,u=0;u=o&&Object.keys(b.O).every(function(e){return b.O[e](n[f])})?n.splice(f--,1):(a=!1,oCrust Cloud
\ No newline at end of file +Crust Cloud
\ No newline at end of file