diff --git a/docs/assets/index-a746e231.css b/docs/assets/index-a746e231.css new file mode 100644 index 0000000..c988617 --- /dev/null +++ b/docs/assets/index-a746e231.css @@ -0,0 +1 @@ +/*! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-left-2{left:-.5rem}.-left-\[50\%\]{left:-50%}.-right-2{right:-.5rem}.-top-\[150\%\]{top:-150%}.bottom-4{bottom:1rem}.left-0{left:0}.left-6{left:1.5rem}.right-0{right:0}.right-6{right:1.5rem}.start-3{inset-inline-start:.75rem}.top-0{top:0}.top-1\/2{top:50%}.top-3{top:.75rem}.col-span-2{grid-column:span 2/span 2}.-my-3{margin-bottom:-.75rem;margin-top:-.75rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-3{margin-bottom:.75rem}.mb-5{margin-bottom:1.25rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.h-0{height:0}.h-0\.5{height:.125rem}.h-4{height:1rem}.h-8{height:2rem}.min-h-screen{min-height:100vh}.w-4{width:1rem}.w-full{width:100%}.max-w-3xl{max-width:48rem}.max-w-6xl{max-width:72rem}.max-w-none{max-width:none}.-translate-x-3\/4{--tw-translate-x:-75%}.-translate-x-3\/4,.-translate-y-1\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%}.translate-x-1\/4{--tw-translate-x:25%}.rotate-180,.translate-x-1\/4{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.rotate-45{--tw-rotate:45deg}.-scale-x-100,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-scale-x-100{--tw-scale-x:-1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-left-width:calc(1px*(1 - var(--tw-divide-x-reverse)));border-right-width:calc(1px*var(--tw-divide-x-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(243 244 246/var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-none{border-style:none}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-indigo-600{--tw-border-opacity:1;border-color:rgb(79 70 229/var(--tw-border-opacity))}.bg-\[\#060213\]{--tw-bg-opacity:1;background-color:rgb(6 2 19/var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-indigo-500{--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity))}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgb(79 70 229/var(--tw-bg-opacity))}.bg-slate-700{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-slate-200\/60{--tw-gradient-from:rgba(226,232,240,.6) var(--tw-gradient-from-position);--tw-gradient-to:rgba(226,232,240,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.via-slate-200{--tw-gradient-to:rgba(226,232,240,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),#e2e8f0 var(--tw-gradient-via-position),var(--tw-gradient-to)}.to-slate-200\/60{--tw-gradient-to:rgba(226,232,240,.6) var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-0{padding:0}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-12{padding-left:3rem;padding-right:3rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-2\.5{padding-bottom:.625rem;padding-top:.625rem}.py-24{padding-bottom:6rem;padding-top:6rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pt-3{padding-top:.75rem}.text-center{text-align:center}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.leading-none{line-height:1}.tracking-normal{letter-spacing:0}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-indigo-300{--tw-text-opacity:1;color:rgb(165 180 252/var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity))}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-transparent::-moz-placeholder{color:transparent}.placeholder-transparent::placeholder{color:transparent}.opacity-70{opacity:.7}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.shadow-sm,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.shadow-indigo-950\/10{--tw-shadow-color:rgba(30,27,75,.1);--tw-shadow:var(--tw-shadow-colored)}.blur-3xl{--tw-blur:blur(64px)}.blur-3xl,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,fill,stroke,-webkit-text-decoration-color;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,-webkit-text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-transform{transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.focus-within\:border-blue-600:focus-within{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity))}.focus-within\:ring-1:focus-within{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-within\:ring-blue-600:focus-within{--tw-ring-opacity:1;--tw-ring-color:rgb(37 99 235/var(--tw-ring-opacity))}.hover\:bg-indigo-600:hover{--tw-bg-opacity:1;background-color:rgb(79 70 229/var(--tw-bg-opacity))}.hover\:bg-slate-600:hover{--tw-bg-opacity:1;background-color:rgb(71 85 105/var(--tw-bg-opacity))}.hover\:bg-transparent:hover{background-color:transparent}.hover\:text-indigo-600:hover{--tw-text-opacity:1;color:rgb(79 70 229/var(--tw-text-opacity))}.hover\:underline:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-0:focus,.focus\:ring:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-0:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-indigo-300:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(165 180 252/var(--tw-ring-opacity))}.active\:text-indigo-500:active{--tw-text-opacity:1;color:rgb(99 102 241/var(--tw-text-opacity))}.group:hover .group-hover\:translate-x-0{--tw-translate-x:0px}.group:hover .group-hover\:translate-x-0,.group:hover .group-hover\:translate-x-0\.5{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:translate-x-0\.5{--tw-translate-x:.125rem}.peer:-moz-placeholder-shown~.peer-placeholder-shown\:top-1\/2{top:50%}.peer:placeholder-shown~.peer-placeholder-shown\:top-1\/2{top:50%}.peer:-moz-placeholder-shown~.peer-placeholder-shown\:text-sm{font-size:.875rem;line-height:1.25rem}.peer:placeholder-shown~.peer-placeholder-shown\:text-sm{font-size:.875rem;line-height:1.25rem}.peer:focus~.peer-focus\:top-3{top:.75rem}.peer:focus~.peer-focus\:text-xs{font-size:.75rem;line-height:1rem}:is([dir=ltr] .ltr\:border-b-0){border-bottom-width:0}:is([dir=ltr] .ltr\:border-s-0){border-inline-start-width:0}:is([dir=ltr] .ltr\:bg-gray-50){--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}:is([dir=ltr] .ltr\:bg-white){--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}:is([dir=rtl] .rtl\:border-e-0){border-inline-end-width:0}:is([dir=rtl] .rtl\:border-t-0){border-top-width:0}:is([dir=rtl] .rtl\:bg-gray-50){--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}:is([dir=rtl] .rtl\:bg-white){--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}@media (prefers-color-scheme:dark){.dark\:focus-visible\:ring-slate-600:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(71 85 105/var(--tw-ring-opacity))}}@media (min-width:480px){.min-\[480px\]\:flex{display:flex}}@media (min-width:640px){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:block{display:block}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:gap-4{gap:1rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:768px){.md\:bottom-8{bottom:2rem}.md\:left-12{left:3rem}.md\:right-auto{right:auto}.md\:px-6{padding-left:1.5rem;padding-right:1.5rem}.md\:text-left{text-align:left}.md\:text-6xl{font-size:3.75rem;line-height:1}}p.svelte-1k7zgyl{color:#000}li.svelte-1k7zgyl,span.svelte-1k7zgyl{background-color:#fff}li.selected.svelte-1k7zgyl{background-color:#cfccff;color:#6b7280}.lds-spinner.svelte-og331j.svelte-og331j{color:official;display:inline-block;height:80px;position:relative;width:80px}.lds-spinner.svelte-og331j div.svelte-og331j{animation:svelte-og331j-lds-spinner 1.2s linear infinite;transform-origin:40px 40px}.lds-spinner.svelte-og331j div.svelte-og331j:after{background:#060213;border-radius:20%;content:" ";display:block;height:18px;left:37px;position:absolute;top:3px;width:6px}.lds-spinner.svelte-og331j div.svelte-og331j:first-child{animation-delay:-1.1s;transform:rotate(0)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(2){animation-delay:-1s;transform:rotate(30deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(3){animation-delay:-.9s;transform:rotate(60deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(4){animation-delay:-.8s;transform:rotate(90deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(5){animation-delay:-.7s;transform:rotate(120deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(6){animation-delay:-.6s;transform:rotate(150deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(7){animation-delay:-.5s;transform:rotate(180deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(8){animation-delay:-.4s;transform:rotate(210deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(9){animation-delay:-.3s;transform:rotate(240deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(10){animation-delay:-.2s;transform:rotate(270deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(11){animation-delay:-.1s;transform:rotate(300deg)}.lds-spinner.svelte-og331j div.svelte-og331j:nth-child(12){animation-delay:0s;transform:rotate(330deg)}@keyframes svelte-og331j-lds-spinner{0%{opacity:1}to{opacity:0}} diff --git a/docs/assets/index-bcd8fc04.js b/docs/assets/index-bcd8fc04.js new file mode 100644 index 0000000..a985c26 --- /dev/null +++ b/docs/assets/index-bcd8fc04.js @@ -0,0 +1,22 @@ +var Vl=Object.defineProperty;var Kl=(n,e,t)=>e in n?Vl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>(Kl(n,typeof e!="symbol"?e+"":e,t),t),Ks=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var d=(n,e,t)=>(Ks(n,e,"read from private field"),t?t.call(n):e.get(n)),I=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},m=(n,e,t,f)=>(Ks(n,e,"write to private field"),f?f.call(n,t):e.set(n,t),t);var q0=(n,e,t,f)=>({set _(r){m(n,e,r,t)},get _(){return d(n,e,f)}}),G=(n,e,t)=>(Ks(n,e,"access private method"),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))f(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&f(i)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function f(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function J(){}function jl(n,e){for(const t in e)n[t]=e[t];return n}function za(n){return n()}function go(){return Object.create(null)}function Cn(n){n.forEach(za)}function Va(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}function Wl(n){return Object.keys(n).length===0}function ql(n,...e){if(n==null)return J;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function K(n,e,t){n.$$.on_destroy.push(ql(e,t))}function Tn(n,e,t,f){if(n){const r=Ka(n,e,t,f);return n[0](r)}}function Ka(n,e,t,f){return n[1]&&f?jl(t.ctx.slice(),n[1](f(e))):t.ctx}function In(n,e,t,f){if(n[2]&&f){const r=n[2](f(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],i=Math.max(e.dirty.length,r.length);for(let o=0;o32){const e=[],t=n.ctx.length/32;for(let f=0;fn.removeEventListener(e,t,f)}function ja(n){return function(e){return e.preventDefault(),n.call(this,e)}}function S(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Zl(n){return Array.from(n.childNodes)}function Ne(n,e){e=""+e,n.data!==e&&(n.data=e)}function mo(n,e,t){for(let f=0;ff.call(this,e))}const $n=[],yo=[];let Zn=[];const wo=[],Xl=Promise.resolve();let ui=!1;function eu(){ui||(ui=!0,Xl.then(Za))}function as(n){Zn.push(n)}const js=new Set;let Fn=0;function Za(){if(Fn!==0)return;const n=ur;do{try{for(;Fn<$n.length;){const e=$n[Fn];Fn++,ir(e),tu(e.$$)}}catch(e){throw $n.length=0,Fn=0,e}for(ir(null),$n.length=0,Fn=0;yo.length;)yo.pop()();for(let e=0;en.indexOf(f)===-1?e.push(f):t.push(f)),t.forEach(f=>f()),Zn=e}const Yr=new Set;let Kf;function de(){Kf={r:0,c:[],p:Kf}}function he(){Kf.r||Cn(Kf.c),Kf=Kf.p}function O(n,e){n&&n.i&&(Yr.delete(n),n.i(e))}function R(n,e,t,f){if(n&&n.o){if(Yr.has(n))return;Yr.add(n),Kf.c.push(()=>{Yr.delete(n),f&&(t&&n.d(1),f())}),n.o(e)}else f&&f()}function X(n){n&&n.c()}function Z(n,e,t,f){const{fragment:r,after_update:s}=n.$$;r&&r.m(e,t),f||as(()=>{const i=n.$$.on_mount.map(za).filter(Va);n.$$.on_destroy?n.$$.on_destroy.push(...i):Cn(i),n.$$.on_mount=[]}),s.forEach(as)}function Y(n,e){const t=n.$$;t.fragment!==null&&(fu(t.after_update),Cn(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function nu(n,e){n.$$.dirty[0]===-1&&($n.push(n),eu(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const b=p.length?p[0]:h;return c.ctx&&r(c.ctx[u],c.ctx[u]=b)&&(!c.skip_bound&&c.bound[u]&&c.bound[u](b),l&&nu(n,u)),h}):[],c.update(),l=!0,Cn(c.before_update),c.fragment=f?f(c.ctx):!1,e.target){if(e.hydrate){const u=Zl(e.target);c.fragment&&c.fragment.l(u),u.forEach(B)}else c.fragment&&c.fragment.c();e.intro&&O(n.$$.fragment),Z(n,e.target,e.anchor,e.customElement),Za()}ir(a)}class ve{$destroy(){Y(this,1),this.$destroy=J}$on(e,t){if(!Va(t))return J;const f=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return f.push(t),()=>{const r=f.indexOf(t);r!==-1&&f.splice(r,1)}}$set(e){this.$$set&&!Wl(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Un=[];function mf(n,e=J){let t;const f=new Set;function r(o){if(me(n,o)&&(n=o,t)){const a=!Un.length;for(const c of f)c[1](),Un.push(c,n);if(a){for(let c=0;c{f.delete(c),f.size===0&&t&&(t(),t=null)}}return{set:r,update:s,subscribe:i}}const dr=mf(null),Ue=mf(null),df=mf(null),Jt=mf(null),ft=mf(null),At=mf(null),ge=mf(null),pe=mf(null),X0=mf(0);const ru="6.8.0";function su(n,e,t){const f=e.split("|").map(s=>s.trim());for(let s=0;sPromise.resolve(n[f])))).reduce((f,r,s)=>(f[e[s]]=r,f),{})}function q(n,e,t){for(let f in e){let r=e[f];const s=t?t[f]:null;s&&su(r,s,f),Object.defineProperty(n,f,{enumerable:!0,value:r,writable:!1})}}function Jn(n){if(n==null)return"null";if(Array.isArray(n))return"[ "+n.map(Jn).join(", ")+" ]";if(n instanceof Uint8Array){const e="0123456789abcdef";let t="0x";for(let f=0;f>4],t+=e[n[f]&15];return t}if(typeof n=="object"&&typeof n.toJSON=="function")return Jn(n.toJSON());switch(typeof n){case"boolean":case"symbol":return n.toString();case"bigint":return BigInt(n).toString();case"number":return n.toString();case"string":return JSON.stringify(n);case"object":{const e=Object.keys(n);return e.sort(),"{ "+e.map(t=>`${Jn(t)}: ${Jn(n[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Et(n,e){return n&&n.code===e}function Qi(n){return Et(n,"CALL_EXCEPTION")}function Ie(n,e,t){let f=n;{const s=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${Jn(t)}`);for(const i in t){if(i==="shortMessage")continue;const o=t[i];s.push(i+"="+Jn(o))}}s.push(`code=${e}`),s.push(`version=${ru}`),s.length&&(n+=" ("+s.join(", ")+")")}let r;switch(e){case"INVALID_ARGUMENT":r=new TypeError(n);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(n);break;default:r=new Error(n)}return q(r,{code:e}),t&&Object.assign(r,t),r.shortMessage==null&&q(r,{shortMessage:f}),r}function D(n,e,t,f){if(!n)throw Ie(e,t,f)}function A(n,e,t,f){D(n,e,"INVALID_ARGUMENT",{argument:t,value:f})}function Ya(n,e,t){t==null&&(t=""),t&&(t=": "+t),D(n>=e,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:n,expectedCount:e}),D(n<=e,"too many arguemnts"+t,"UNEXPECTED_ARGUMENT",{count:n,expectedCount:e})}const iu=["NFD","NFC","NFKD","NFKC"].reduce((n,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const t=String.fromCharCode(233).normalize("NFD"),f=String.fromCharCode(101,769);if(t!==f)throw new Error("broken")}n.push(e)}catch{}return n},[]);function ou(n){D(iu.indexOf(n)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:n}})}function Ss(n,e,t){if(t==null&&(t=""),n!==e){let f=t,r="new";t&&(f+=".",r+=" "+t),D(!1,`private constructor; use ${f}from* methods`,"UNSUPPORTED_OPERATION",{operation:r})}}function Xa(n,e,t){if(n instanceof Uint8Array)return t?new Uint8Array(n):n;if(typeof n=="string"&&n.match(/^0x([0-9a-f][0-9a-f])*$/i)){const f=new Uint8Array((n.length-2)/2);let r=2;for(let s=0;s>4]+Ao[r&15]}return t}function _e(n){return"0x"+n.map(e=>j(e).substring(2)).join("")}function Yn(n){return Ee(n,!0)?(n.length-2)/2:ue(n).length}function Ce(n,e,t){const f=ue(n);return t!=null&&t>f.length&&D(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:f,length:f.length,offset:t}),j(f.slice(e??0,t??f.length))}function ec(n,e,t){const f=ue(n);D(e>=f.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(f),length:e,offset:e+1});const r=new Uint8Array(e);return r.fill(0),t?r.set(f,e-f.length):r.set(f,0),j(r)}function An(n,e){return ec(n,e,!0)}function cu(n,e){return ec(n,e,!1)}const Rs=BigInt(0),Pt=BigInt(1),zn=9007199254740991;function lu(n,e){const t=Bs(n,"value"),f=BigInt(oe(e,"width"));if(D(t>>f===Rs,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:n}),t>>f-Pt){const r=(Pt<=-zn&&n<=zn,"overflow",e||"value",n),BigInt(n);case"string":try{if(n==="")throw new Error("empty string");return n[0]==="-"&&n[1]!=="-"?-BigInt(n.substring(1)):BigInt(n)}catch(t){A(!1,`invalid BigNumberish string: ${t.message}`,e||"value",n)}}A(!1,"invalid BigNumberish value",e||"value",n)}function Bs(n,e){const t=W(n,e);return D(t>=Rs,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:n}),t}const Eo="0123456789abcdef";function Hi(n){if(n instanceof Uint8Array){let e="0x0";for(const t of n)e+=Eo[t>>4],e+=Eo[t&15];return BigInt(e)}return W(n)}function oe(n,e){switch(typeof n){case"bigint":return A(n>=-zn&&n<=zn,"overflow",e||"value",n),Number(n);case"number":return A(Number.isInteger(n),"underflow",e||"value",n),A(n>=-zn&&n<=zn,"overflow",e||"value",n),n;case"string":try{if(n==="")throw new Error("empty string");return oe(BigInt(n),e)}catch(t){A(!1,`invalid numeric string: ${t.message}`,e||"value",n)}}A(!1,"invalid numeric value",e||"value",n)}function uu(n){return oe(Hi(n))}function Qf(n,e){let f=Bs(n,"value").toString(16);if(e==null)f.length%2&&(f="0"+f);else{const r=oe(e,"width");for(D(r*2>=f.length,`value exceeds width (${r} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:n});f.length>6===2;i++)s++;return s}return n==="OVERRUN"?t.length-e-1:0}function mu(n,e,t,f,r){return n==="OVERLONG"?(A(typeof r=="number","invalid bad code point for replacement","badCodepoint",r),f.push(r),0):(f.push(65533),nc(n,e,t))}const yu=Object.freeze({error:gu,ignore:nc,replace:mu});function wu(n,e){e==null&&(e=yu.error);const t=ue(n,"bytes"),f=[];let r=0;for(;r>7)){f.push(s);continue}let i=null,o=null;if((s&224)===192)i=1,o=127;else if((s&240)===224)i=2,o=2047;else if((s&248)===240)i=3,o=65535;else{(s&192)===128?r+=e("UNEXPECTED_CONTINUE",r-1,t,f):r+=e("BAD_PREFIX",r-1,t,f);continue}if(r-1+i>=t.length){r+=e("OVERRUN",r-1,t,f);continue}let a=s&(1<<8-i-1)-1;for(let c=0;c1114111){r+=e("OUT_OF_RANGE",r-1-i,t,f,a);continue}if(a>=55296&&a<=57343){r+=e("UTF16_SURROGATE",r-1-i,t,f,a);continue}if(a<=o){r+=e("OVERLONG",r-1-i,t,f,a);continue}f.push(a)}}return f}function hf(n,e){e!=null&&(ou(e),n=n.normalize(e));let t=[];for(let f=0;f>6|192),t.push(r&63|128);else if((r&64512)==55296){f++;const s=n.charCodeAt(f);A(f>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(i&63|128)}else t.push(r>>12|224),t.push(r>>6&63|128),t.push(r&63|128)}return new Uint8Array(t)}function Au(n){return n.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Ji(n,e){return Au(wu(n,e))}function rc(n){async function e(t,f){const r=t.url.split(":")[0].toLowerCase();D(r==="http"||r==="https",`unsupported protocol ${r}`,"UNSUPPORTED_OPERATION",{info:{protocol:r},operation:"request"}),D(r==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s;if(f){const u=new AbortController;s=u.signal,f.addListener(()=>{u.abort()})}const i={method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:s},o=await fetch(t.url,i),a={};o.headers.forEach((u,h)=>{a[h.toLowerCase()]=u});const c=await o.arrayBuffer(),l=c==null?null:new Uint8Array(c);return{statusCode:o.status,statusMessage:o.statusText,headers:a,body:l}}return e}const Eu=12,ku=250;let vo=rc();const vu=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),xu=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Ws=!1;async function sc(n,e){try{const t=n.match(vu);if(!t)throw new Error("invalid data");return new Gf(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?pu(t[3]):Tu(t[3]))}catch{return new Gf(599,"BAD REQUEST (invalid data: URI)",{},null,new bf(n))}}function ic(n){async function e(t,f){try{const r=t.match(xu);if(!r)throw new Error("invalid link");return new bf(`${n}${r[2]}`)}catch{return new Gf(599,"BAD REQUEST (invalid IPFS URI)",{},null,new bf(t))}}return e}const Jr={data:sc,ipfs:ic("https://gateway.ipfs.io/ipfs/")},oc=new WeakMap;var Zf,Tf;class Cu{constructor(e){I(this,Zf,void 0);I(this,Tf,void 0);m(this,Zf,[]),m(this,Tf,!1),oc.set(e,()=>{if(!d(this,Tf)){m(this,Tf,!0);for(const t of d(this,Zf))setTimeout(()=>{t()},0);m(this,Zf,[])}})}addListener(e){D(!d(this,Tf),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),d(this,Zf).push(e)}get cancelled(){return d(this,Tf)}checkSignal(){D(!this.cancelled,"cancelled","CANCELLED",{})}}Zf=new WeakMap,Tf=new WeakMap;function zr(n){if(n==null)throw new Error("missing signal; should not happen");return n.checkSignal(),n}var t0,f0,Tt,Wt,n0,r0,Pe,ot,qt,Yf,Xf,en,Ft,Zt,If,tn,tr;const vs=class vs{constructor(e){I(this,tn);I(this,t0,void 0);I(this,f0,void 0);I(this,Tt,void 0);I(this,Wt,void 0);I(this,n0,void 0);I(this,r0,void 0);I(this,Pe,void 0);I(this,ot,void 0);I(this,qt,void 0);I(this,Yf,void 0);I(this,Xf,void 0);I(this,en,void 0);I(this,Ft,void 0);I(this,Zt,void 0);I(this,If,void 0);m(this,r0,String(e)),m(this,t0,!1),m(this,f0,!0),m(this,Tt,{}),m(this,Wt,""),m(this,n0,3e5),m(this,Zt,{slotInterval:ku,maxAttempts:Eu}),m(this,If,null)}get url(){return d(this,r0)}set url(e){m(this,r0,String(e))}get body(){return d(this,Pe)==null?null:new Uint8Array(d(this,Pe))}set body(e){if(e==null)m(this,Pe,void 0),m(this,ot,void 0);else if(typeof e=="string")m(this,Pe,hf(e)),m(this,ot,"text/plain");else if(e instanceof Uint8Array)m(this,Pe,e),m(this,ot,"application/octet-stream");else if(typeof e=="object")m(this,Pe,hf(JSON.stringify(e))),m(this,ot,"application/json");else throw new Error("invalid body")}hasBody(){return d(this,Pe)!=null}get method(){return d(this,Wt)?d(this,Wt):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),m(this,Wt,String(e).toUpperCase())}get headers(){const e=Object.assign({},d(this,Tt));return d(this,qt)&&(e.authorization=`Basic ${bu(hf(d(this,qt)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&d(this,ot)&&(e["content-type"]=d(this,ot)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){d(this,Tt)[String(e).toLowerCase()]=String(t)}clearHeaders(){m(this,Tt,{})}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let f=0;return{next:()=>{if(f=0,"timeout must be non-zero","timeout",e),m(this,n0,e)}get preflightFunc(){return d(this,Yf)||null}set preflightFunc(e){m(this,Yf,e)}get processFunc(){return d(this,Xf)||null}set processFunc(e){m(this,Xf,e)}get retryFunc(){return d(this,en)||null}set retryFunc(e){m(this,en,e)}get getUrlFunc(){return d(this,If)||vo}set getUrlFunc(e){m(this,If,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(d(this,Zt).slotInterval=e.slotInterval),e.maxAttempts!=null&&(d(this,Zt).maxAttempts=e.maxAttempts)}send(){return D(d(this,Ft)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),m(this,Ft,new Cu(this)),G(this,tn,tr).call(this,0,xo()+this.timeout,0,this,new Gf(0,"",{},null,this))}cancel(){D(d(this,Ft)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=oc.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),f=e.split(":")[0].toLowerCase();D(this.method==="GET"&&(t!=="https"||f!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const r=new vs(e);return r.method="GET",r.allowGzip=this.allowGzip,r.timeout=this.timeout,m(r,Tt,Object.assign({},d(this,Tt))),d(this,Pe)&&m(r,Pe,new Uint8Array(d(this,Pe))),m(r,ot,d(this,ot)),r}clone(){const e=new vs(this.url);return m(e,Wt,d(this,Wt)),d(this,Pe)&&m(e,Pe,d(this,Pe)),m(e,ot,d(this,ot)),m(e,Tt,Object.assign({},d(this,Tt))),m(e,qt,d(this,qt)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),m(e,Yf,d(this,Yf)),m(e,Xf,d(this,Xf)),m(e,en,d(this,en)),m(e,If,d(this,If)),e}static lockConfig(){Ws=!0}static getGateway(e){return Jr[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Ws)throw new Error("gateways locked");Jr[e]=t}static registerGetUrl(e){if(Ws)throw new Error("gateways locked");vo=e}static createGetUrlFunc(e){return rc()}static createDataGateway(){return sc}static createIpfsGatewayFunc(e){return ic(e)}};t0=new WeakMap,f0=new WeakMap,Tt=new WeakMap,Wt=new WeakMap,n0=new WeakMap,r0=new WeakMap,Pe=new WeakMap,ot=new WeakMap,qt=new WeakMap,Yf=new WeakMap,Xf=new WeakMap,en=new WeakMap,Ft=new WeakMap,Zt=new WeakMap,If=new WeakMap,tn=new WeakSet,tr=async function(e,t,f,r,s){var l,u,h;if(e>=d(this,Zt).maxAttempts)return s.makeServerError("exceeded maximum retry limit");D(xo()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:r}),f>0&&await Iu(f);let i=this.clone();const o=(i.url.split(":")[0]||"").toLowerCase();if(o in Jr){const p=await Jr[o](i.url,zr(d(r,Ft)));if(p instanceof Gf){let b=p;if(this.processFunc){zr(d(r,Ft));try{b=await this.processFunc(i,b)}catch(g){(g.throttle==null||typeof g.stall!="number")&&b.makeServerError("error in post-processing function",g).assertOk()}}return b}i=p}this.preflightFunc&&(i=await this.preflightFunc(i));const a=await this.getUrlFunc(i,zr(d(r,Ft)));let c=new Gf(a.statusCode,a.statusMessage,a.headers,a.body,r);if(c.statusCode===301||c.statusCode===302){try{const p=c.headers.location||"";return G(l=i.redirect(p),tn,tr).call(l,e+1,t,0,r,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(i,c,e))){const p=c.headers["retry-after"];let b=d(this,Zt).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof p=="string"&&p.match(/^[1-9][0-9]*$/)&&(b=parseInt(p)),G(u=i.clone(),tn,tr).call(u,e+1,t,b,r,c)}if(this.processFunc){zr(d(r,Ft));try{c=await this.processFunc(i,c)}catch(p){(p.throttle==null||typeof p.stall!="number")&&c.makeServerError("error in post-processing function",p).assertOk();let b=d(this,Zt).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return p.stall>=0&&(b=p.stall),G(h=i.clone(),tn,tr).call(h,e+1,t,b,r,c)}}return c};let bf=vs;var vr,xr,Cr,It,s0,fn;const co=class co{constructor(e,t,f,r,s){I(this,vr,void 0);I(this,xr,void 0);I(this,Cr,void 0);I(this,It,void 0);I(this,s0,void 0);I(this,fn,void 0);m(this,vr,e),m(this,xr,t),m(this,Cr,Object.keys(f).reduce((i,o)=>(i[o.toLowerCase()]=String(f[o]),i),{})),m(this,It,r==null?null:new Uint8Array(r)),m(this,s0,s||null),m(this,fn,{message:""})}toString(){return``}get statusCode(){return d(this,vr)}get statusMessage(){return d(this,xr)}get headers(){return Object.assign({},d(this,Cr))}get body(){return d(this,It)==null?null:new Uint8Array(d(this,It))}get bodyText(){try{return d(this,It)==null?"":Ji(d(this,It))}catch{D(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{D(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let f=0;return{next:()=>{if(f=0,"invalid stall timeout","stall",t);const f=new Error(e||"throttling requests");throw q(f,{stall:t,throttle:!0}),f}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return d(this,It)!=null}get request(){return d(this,s0)}ok(){return d(this,fn).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=d(this,fn);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),D(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t})}};vr=new WeakMap,xr=new WeakMap,Cr=new WeakMap,It=new WeakMap,s0=new WeakMap,fn=new WeakMap;let Gf=co;function xo(){return new Date().getTime()}function Tu(n){return hf(n.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function Iu(n){return new Promise(e=>setTimeout(e,n))}function _u(n){let e=n.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Co(n,e,t){let f=0;for(let r=0;r{D(f<=n.length,"data short segment too short","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:f})};if(n[e]>=248){const f=n[e]-247;t(e+1+f);const r=Co(n,e+1,f);return t(e+1+f+r),To(n,e,e+1+f,f+r)}else if(n[e]>=192){const f=n[e]-192;return t(e+1+f),To(n,e,e+1,f)}else if(n[e]>=184){const f=n[e]-183;t(e+1+f);const r=Co(n,e+1,f);t(e+1+f+r);const s=j(n.slice(e+1+f,e+1+f+r));return{consumed:1+f+r,result:s}}else if(n[e]>=128){const f=n[e]-128;t(e+1+f);const r=j(n.slice(e+1,e+1+f));return{consumed:1+f,result:r}}return{consumed:1,result:_u(n[e])}}function zi(n){const e=ue(n,"data"),t=ac(e,0);return A(t.consumed===e.length,"unexpected junk after rlp payload","data",n),t.result}function Io(n){const e=[];for(;n;)e.unshift(n&255),n>>=8;return e}function cc(n){if(Array.isArray(n)){let f=[];if(n.forEach(function(s){f=f.concat(cc(s))}),f.length<=55)return f.unshift(192+f.length),f;const r=Io(f.length);return r.unshift(247+r.length),r.concat(f)}const e=Array.prototype.slice.call(ue(n,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=Io(e.length);return t.unshift(183+t.length),t.concat(e)}const _o="0123456789abcdef";function hr(n){let e="0x";for(const t of cc(n))e+=_o[t>>4],e+=_o[t&15];return e}const ze=32,di=new Uint8Array(ze),Nu=["then"],Vr={};function Z0(n,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${n}`);throw t.error=e,t}var _f;const cr=class cr extends Array{constructor(...t){const f=t[0];let r=t[1],s=(t[2]||[]).slice(),i=!0;f!==Vr&&(r=t,s=[],i=!1);super(r.length);I(this,_f,void 0);r.forEach((a,c)=>{this[c]=a});const o=s.reduce((a,c)=>(typeof c=="string"&&a.set(c,(a.get(c)||0)+1),a),new Map);if(m(this,_f,Object.freeze(r.map((a,c)=>{const l=s[c];return l!=null&&o.get(l)===1?l:null}))),!!i)return Object.freeze(this),new Proxy(this,{get:(a,c,l)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=oe(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const p=a[h];return p instanceof Error&&Z0(`index ${h}`,p),p}if(Nu.indexOf(c)>=0)return Reflect.get(a,c,l);const u=a[c];if(u instanceof Function)return function(...h){return u.apply(this===l?a:this,h)};if(!(c in a))return a.getValue.apply(this===l?a:this,[c])}return Reflect.get(a,c,l)}})}toArray(){const t=[];return this.forEach((f,r)=>{f instanceof Error&&Z0(`index ${r}`,f),t.push(f)}),t}toObject(){return d(this,_f).reduce((t,f,r)=>(D(f!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),f in t||(t[f]=this.getValue(f)),t),{})}slice(t,f){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),f==null&&(f=this.length),f<0&&(f+=this.length,f<0&&(f=0)),f>this.length&&(f=this.length);const r=[],s=[];for(let i=t;i{d(this,Yt)[e]=No(t)}}}Yt=new WeakMap,nn=new WeakMap,i0=new WeakSet,Xr=function(e){return d(this,Yt).push(e),m(this,nn,d(this,nn)+e.length),e.length};var at,bt,xs,lc;const lo=class lo{constructor(e,t){I(this,xs);C(this,"allowLoose");I(this,at,void 0);I(this,bt,void 0);q(this,{allowLoose:!!t}),m(this,at,tt(e)),m(this,bt,0)}get data(){return j(d(this,at))}get dataLength(){return d(this,at).length}get consumed(){return d(this,bt)}get bytes(){return new Uint8Array(d(this,at))}subReader(e){return new lo(d(this,at).slice(d(this,bt)+e),this.allowLoose)}readBytes(e,t){let f=G(this,xs,lc).call(this,0,e,!!t);return m(this,bt,d(this,bt)+f.length),f.slice(0,e)}readValue(){return Hi(this.readBytes(ze))}readIndex(){return uu(this.readBytes(ze))}};at=new WeakMap,bt=new WeakMap,xs=new WeakSet,lc=function(e,t,f){let r=Math.ceil(t/ze)*ze;return d(this,bt)+r>d(this,at).length&&(this.allowLoose&&f&&d(this,bt)+t<=d(this,at).length?r=t:D(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:tt(d(this,at)),length:d(this,at).length,offset:d(this,bt)+r})),d(this,at).slice(d(this,bt),d(this,bt)+r)};let pi=lo;function ls(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function Vi(n,...e){if(!(n instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(n.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${n.length}`)}function Pu(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ls(n.outputLen),ls(n.blockLen)}function $0(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function uc(n,e){Vi(n);const t=e.outputLen;if(n.lengthn instanceof Uint8Array,Ou=n=>new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4)),Zs=n=>new DataView(n.buffer,n.byteOffset,n.byteLength),Bt=(n,e)=>n<<32-e|n>>>e,Su=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Su)throw new Error("Non little-endian hardware is not supported");function Ru(n){if(typeof n!="string")throw new Error(`utf8ToBytes expected string, got ${typeof n}`);return new Uint8Array(new TextEncoder().encode(n))}function Fs(n){if(typeof n=="string"&&(n=Ru(n)),!dc(n))throw new Error(`expected Uint8Array, got ${typeof n}`);return n}function Bu(...n){const e=new Uint8Array(n.reduce((f,r)=>f+r.length,0));let t=0;return n.forEach(f=>{if(!dc(f))throw new Error("Uint8Array expected");e.set(f,t),t+=f.length}),e}class Ki{clone(){return this._cloneInto()}}function hc(n){const e=f=>n().update(Fs(f)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function Fu(n=32){if(qs&&typeof qs.getRandomValues=="function")return qs.getRandomValues(new Uint8Array(n));throw new Error("crypto.getRandomValues must be defined")}class pc extends Ki{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Pu(e);const f=Fs(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(f.length>r?e.create().update(f).digest():f);for(let i=0;inew pc(n,e).update(t).digest();bc.create=(n,e)=>new pc(n,e);function Uu(n,e,t,f){if(typeof n.setBigUint64=="function")return n.setBigUint64(e,t,f);const r=BigInt(32),s=BigInt(4294967295),i=Number(t>>r&s),o=Number(t&s),a=f?4:0,c=f?0:4;n.setUint32(e+a,i,f),n.setUint32(e+c,o,f)}class Du extends Ki{constructor(e,t,f,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=f,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Zs(this.buffer)}update(e){$0(this);const{view:t,buffer:f,blockLen:r}=this;e=Fs(e);const s=e.length;for(let i=0;ir-i&&(this.process(f,0),i=0);for(let u=i;ul.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;un&e^~n&t,Mu=(n,e,t)=>n&e^n&t^e&t,$u=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),kf=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),vf=new Uint32Array(64);class Gu extends Du{constructor(){super(64,32,8,!1),this.A=kf[0]|0,this.B=kf[1]|0,this.C=kf[2]|0,this.D=kf[3]|0,this.E=kf[4]|0,this.F=kf[5]|0,this.G=kf[6]|0,this.H=kf[7]|0}get(){const{A:e,B:t,C:f,D:r,E:s,F:i,G:o,H:a}=this;return[e,t,f,r,s,i,o,a]}set(e,t,f,r,s,i,o,a){this.A=e|0,this.B=t|0,this.C=f|0,this.D=r|0,this.E=s|0,this.F=i|0,this.G=o|0,this.H=a|0}process(e,t){for(let u=0;u<16;u++,t+=4)vf[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){const h=vf[u-15],p=vf[u-2],b=Bt(h,7)^Bt(h,18)^h>>>3,g=Bt(p,17)^Bt(p,19)^p>>>10;vf[u]=g+vf[u-7]+b+vf[u-16]|0}let{A:f,B:r,C:s,D:i,E:o,F:a,G:c,H:l}=this;for(let u=0;u<64;u++){const h=Bt(o,6)^Bt(o,11)^Bt(o,25),p=l+h+Lu(o,a,c)+$u[u]+vf[u]|0,g=(Bt(f,2)^Bt(f,13)^Bt(f,22))+Mu(f,r,s)|0;l=c,c=a,a=o,o=i+p|0,i=s,s=r,r=f,f=p+g|0}f=f+this.A|0,r=r+this.B|0,s=s+this.C|0,i=i+this.D|0,o=o+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(f,r,s,i,o,a,c,l)}roundClean(){vf.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Qu=hc(()=>new Gu),Kr=BigInt(2**32-1),Po=BigInt(32);function Hu(n,e=!1){return e?{h:Number(n&Kr),l:Number(n>>Po&Kr)}:{h:Number(n>>Po&Kr)|0,l:Number(n&Kr)|0}}function Ju(n,e=!1){let t=new Uint32Array(n.length),f=new Uint32Array(n.length);for(let r=0;rn<>>32-t,Vu=(n,e,t)=>e<>>32-t,Ku=(n,e,t)=>e<>>64-t,ju=(n,e,t)=>n<>>64-t,[gc,mc,yc]=[[],[],[]],Wu=BigInt(0),Y0=BigInt(1),qu=BigInt(2),Zu=BigInt(7),Yu=BigInt(256),Xu=BigInt(113);for(let n=0,e=Y0,t=1,f=0;n<24;n++){[t,f]=[f,(2*t+3*f)%5],gc.push(2*(5*f+t)),mc.push((n+1)*(n+2)/2%64);let r=Wu;for(let s=0;s<7;s++)e=(e<>Zu)*Xu)%Yu,e&qu&&(r^=Y0<<(Y0<t>32?Ku(n,e,t):zu(n,e,t),So=(n,e,t)=>t>32?ju(n,e,t):Vu(n,e,t);function f1(n,e=24){const t=new Uint32Array(10);for(let f=24-e;f<24;f++){for(let i=0;i<10;i++)t[i]=n[i]^n[i+10]^n[i+20]^n[i+30]^n[i+40];for(let i=0;i<10;i+=2){const o=(i+8)%10,a=(i+2)%10,c=t[a],l=t[a+1],u=Oo(c,l,1)^t[o],h=So(c,l,1)^t[o+1];for(let p=0;p<50;p+=10)n[i+p]^=u,n[i+p+1]^=h}let r=n[2],s=n[3];for(let i=0;i<24;i++){const o=mc[i],a=Oo(r,s,o),c=So(r,s,o),l=gc[i];r=n[l],s=n[l+1],n[l]=a,n[l+1]=c}for(let i=0;i<50;i+=10){for(let o=0;o<10;o++)t[o]=n[i+o];for(let o=0;o<10;o++)n[i+o]^=~t[(o+2)%10]&t[(o+4)%10]}n[0]^=e1[f],n[1]^=t1[f]}t.fill(0)}class ji extends Ki{constructor(e,t,f,r=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=f,this.enableXOF=r,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ls(f),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Ou(this.state)}keccak(){f1(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){$0(this);const{blockLen:t,state:f}=this;e=Fs(e);const r=e.length;for(let s=0;s=f&&this.keccak();const i=Math.min(f-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ls(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(uc(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:f,outputLen:r,rounds:s,enableXOF:i}=this;return e||(e=new ji(t,f,r,i,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=f,e.outputLen=r,e.enableXOF=i,e.destroyed=this.destroyed,e}}const n1=(n,e,t)=>hc(()=>new ji(e,n,t)),r1=n1(1,136,256/8);let wc=!1;const Ac=function(n){return r1(n)};let Ec=Ac;function Ae(n){const e=ue(n,"data");return j(Ec(e))}Ae._=Ac;Ae.lock=function(){wc=!0};Ae.register=function(n){if(wc)throw new TypeError("keccak256 is locked");Ec=n};Object.freeze(Ae);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kc=BigInt(0),Us=BigInt(1),s1=BigInt(2),Ds=n=>n instanceof Uint8Array,i1=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));function G0(n){if(!Ds(n))throw new Error("Uint8Array expected");let e="";for(let t=0;tf+r.length,0));let t=0;return n.forEach(f=>{if(!Ds(f))throw new Error("Uint8Array expected");e.set(f,t),t+=f.length}),e}function a1(n,e){if(n.length!==e.length)return!1;for(let t=0;tkc;n>>=Us,e+=1);return e}function u1(n,e){return n>>BigInt(e)&Us}const d1=(n,e,t)=>n|(t?Us:kc)<(s1<new Uint8Array(n),Ro=n=>Uint8Array.from(n);function xc(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let f=Ys(n),r=Ys(n),s=0;const i=()=>{f.fill(1),r.fill(0),s=0},o=(...u)=>t(r,f,...u),a=(u=Ys())=>{r=o(Ro([0]),u),f=o(),u.length!==0&&(r=o(Ro([1]),u),f=o())},c=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const h=[];for(;u{i(),a(u);let p;for(;!(p=h(c()));)a();return i(),p}}const h1={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||n instanceof Uint8Array,isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)};function $r(n,e,t={}){const f=(r,s,i)=>{const o=h1[s];if(typeof o!="function")throw new Error(`Invalid validator "${s}", expected function`);const a=n[r];if(!(i&&a===void 0)&&!o(a,n))throw new Error(`Invalid param ${String(r)}=${a} (${typeof a}), expected ${s}`)};for(const[r,s]of Object.entries(e))f(r,s,!1);for(const[r,s]of Object.entries(t))f(r,s,!0);return n}const p1=Object.freeze(Object.defineProperty({__proto__:null,bitGet:u1,bitLen:l1,bitMask:Yi,bitSet:d1,bytesToHex:G0,bytesToNumberBE:yn,bytesToNumberLE:qi,concatBytes:pr,createHmacDrbg:xc,ensureBytes:Ct,equalBytes:a1,hexToBytes:Q0,hexToNumber:Wi,numberToBytesBE:H0,numberToBytesLE:Zi,numberToHexUnpadded:vc,numberToVarBytesBE:o1,utf8ToBytes:c1,validateObject:$r},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Se=BigInt(0),Te=BigInt(1),zf=BigInt(2),b1=BigInt(3),bi=BigInt(4),Bo=BigInt(5),Fo=BigInt(8);BigInt(9);BigInt(16);function Ze(n,e){const t=n%e;return t>=Se?t:e+t}function g1(n,e,t){if(t<=Se||e 0");if(t===Te)return Se;let f=Te;for(;e>Se;)e&Te&&(f=f*n%t),n=n*n%t,e>>=Te;return f}function ut(n,e,t){let f=n;for(;e-- >Se;)f*=f,f%=t;return f}function gi(n,e){if(n===Se||e<=Se)throw new Error(`invert: expected positive integers, got n=${n} mod=${e}`);let t=Ze(n,e),f=e,r=Se,s=Te;for(;t!==Se;){const o=f/t,a=f%t,c=r-s*o;f=t,t=a,r=s,s=c}if(f!==Te)throw new Error("invert: does not exist");return Ze(r,e)}function m1(n){const e=(n-Te)/zf;let t,f,r;for(t=n-Te,f=0;t%zf===Se;t/=zf,f++);for(r=zf;r(f[r]="function",f),e);return $r(n,t)}function E1(n,e,t){if(t 0");if(t===Se)return n.ONE;if(t===Te)return e;let f=n.ONE,r=e;for(;t>Se;)t&Te&&(f=n.mul(f,r)),r=n.sqr(r),t>>=Te;return f}function k1(n,e){const t=new Array(e.length),f=e.reduce((s,i,o)=>n.is0(i)?s:(t[o]=s,n.mul(s,i)),n.ONE),r=n.inv(f);return e.reduceRight((s,i,o)=>n.is0(i)?s:(t[o]=n.mul(s,t[o]),n.mul(s,i)),r),t}function Cc(n,e){const t=e!==void 0?e:n.toString(2).length,f=Math.ceil(t/8);return{nBitLength:t,nByteLength:f}}function v1(n,e,t=!1,f={}){if(n<=Se)throw new Error(`Expected Field ORDER > 0, got ${n}`);const{nBitLength:r,nByteLength:s}=Cc(n,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const i=y1(n),o=Object.freeze({ORDER:n,BITS:r,BYTES:s,MASK:Yi(r),ZERO:Se,ONE:Te,create:a=>Ze(a,n),isValid:a=>{if(typeof a!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof a}`);return Se<=a&&aa===Se,isOdd:a=>(a&Te)===Te,neg:a=>Ze(-a,n),eql:(a,c)=>a===c,sqr:a=>Ze(a*a,n),add:(a,c)=>Ze(a+c,n),sub:(a,c)=>Ze(a-c,n),mul:(a,c)=>Ze(a*c,n),pow:(a,c)=>E1(o,a,c),div:(a,c)=>Ze(a*gi(c,n),n),sqrN:a=>a*a,addN:(a,c)=>a+c,subN:(a,c)=>a-c,mulN:(a,c)=>a*c,inv:a=>gi(a,n),sqrt:f.sqrt||(a=>i(o,a)),invertBatch:a=>k1(o,a),cmov:(a,c,l)=>l?c:a,toBytes:a=>t?Zi(a,s):H0(a,s),fromBytes:a=>{if(a.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${a.length}`);return t?qi(a):yn(a)}});return Object.freeze(o)}function Tc(n){if(typeof n!="bigint")throw new Error("field order must be bigint");const e=n.toString(2).length;return Math.ceil(e/8)}function Ic(n){const e=Tc(n);return e+Math.ceil(e/2)}function x1(n,e,t=!1){const f=n.length,r=Tc(e),s=Ic(e);if(f<16||f1024)throw new Error(`expected ${s}-1024 bytes of input, got ${f}`);const i=t?yn(n):qi(n),o=Ze(i,e-Te)+Te;return t?Zi(o,r):H0(o,r)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const C1=BigInt(0),Xs=BigInt(1);function T1(n,e){const t=(r,s)=>{const i=s.negate();return r?i:s},f=r=>{const s=Math.ceil(e/r)+1,i=2**(r-1);return{windows:s,windowSize:i}};return{constTimeNegate:t,unsafeLadder(r,s){let i=n.ZERO,o=r;for(;s>C1;)s&Xs&&(i=i.add(o)),o=o.double(),s>>=Xs;return i},precomputeWindow(r,s){const{windows:i,windowSize:o}=f(s),a=[];let c=r,l=c;for(let u=0;u>=p,y>a&&(y-=h,i+=Xs);const w=g,_=g+Math.abs(y)-1,U=b%2!==0,M=y<0;y===0?l=l.add(t(U,s[w])):c=c.add(t(M,s[_]))}return{p:c,f:l}},wNAFCached(r,s,i,o){const a=r._WINDOW_SIZE||1;let c=s.get(r);return c||(c=this.precomputeWindow(r,a),a!==1&&s.set(r,o(c))),this.wNAF(a,c,i)}}}function _c(n){return A1(n.Fp),$r(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Cc(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function I1(n){const e=_c(n);$r(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:f,a:r}=e;if(t){if(!f.eql(r,f.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:_1,hexToBytes:N1}=p1,jf={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(n){const{Err:e}=jf;if(n.length<2||n[0]!==2)throw new e("Invalid signature integer tag");const t=n[1],f=n.subarray(2,t+2);if(!t||f.length!==t)throw new e("Invalid signature integer: wrong length");if(f[0]&128)throw new e("Invalid signature integer: negative");if(f[0]===0&&!(f[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:_1(f),l:n.subarray(t+2)}},toSig(n){const{Err:e}=jf,t=typeof n=="string"?N1(n):n;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let f=t.length;if(f<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==f-2)throw new e("Invalid signature: incorrect length");const{d:r,l:s}=jf._parseInt(t.subarray(2)),{d:i,l:o}=jf._parseInt(s);if(o.length)throw new e("Invalid signature: left bytes after parsing");return{r,s:i}},hexFromSig(n){const e=c=>Number.parseInt(c[0],16)&8?"00"+c:c,t=c=>{const l=c.toString(16);return l.length&1?`0${l}`:l},f=e(t(n.s)),r=e(t(n.r)),s=f.length/2,i=r.length/2,o=t(s),a=t(i);return`30${t(i+s+4)}02${a}${r}02${o}${f}`}},cf=BigInt(0),wt=BigInt(1);BigInt(2);const Uo=BigInt(3);BigInt(4);function P1(n){const e=I1(n),{Fp:t}=e,f=e.toBytes||((b,g,y)=>{const w=g.toAffine();return pr(Uint8Array.from([4]),t.toBytes(w.x),t.toBytes(w.y))}),r=e.fromBytes||(b=>{const g=b.subarray(1),y=t.fromBytes(g.subarray(0,t.BYTES)),w=t.fromBytes(g.subarray(t.BYTES,2*t.BYTES));return{x:y,y:w}});function s(b){const{a:g,b:y}=e,w=t.sqr(b),_=t.mul(w,b);return t.add(t.add(_,t.mul(b,g)),y)}if(!t.eql(t.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function i(b){return typeof b=="bigint"&&cft.eql(U,t.ZERO);return _(y)&&_(w)?u.ZERO:new u(y,w,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(g){const y=t.invertBatch(g.map(w=>w.pz));return g.map((w,_)=>w.toAffine(y[_])).map(u.fromAffine)}static fromHex(g){const y=u.fromAffine(r(Ct("pointHex",g)));return y.assertValidity(),y}static fromPrivateKey(g){return u.BASE.multiply(a(g))}_setWindowSize(g){this._WINDOW_SIZE=g,c.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:g,y}=this.toAffine();if(!t.isValid(g)||!t.isValid(y))throw new Error("bad point: x or y not FE");const w=t.sqr(y),_=s(g);if(!t.eql(w,_))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:g}=this.toAffine();if(t.isOdd)return!t.isOdd(g);throw new Error("Field doesn't support isOdd")}equals(g){l(g);const{px:y,py:w,pz:_}=this,{px:U,py:M,pz:k}=g,v=t.eql(t.mul(y,k),t.mul(U,_)),x=t.eql(t.mul(w,k),t.mul(M,_));return v&&x}negate(){return new u(this.px,t.neg(this.py),this.pz)}double(){const{a:g,b:y}=e,w=t.mul(y,Uo),{px:_,py:U,pz:M}=this;let k=t.ZERO,v=t.ZERO,x=t.ZERO,N=t.mul(_,_),z=t.mul(U,U),V=t.mul(M,M),fe=t.mul(_,U);return fe=t.add(fe,fe),x=t.mul(_,M),x=t.add(x,x),k=t.mul(g,x),v=t.mul(w,V),v=t.add(k,v),k=t.sub(z,v),v=t.add(z,v),v=t.mul(k,v),k=t.mul(fe,k),x=t.mul(w,x),V=t.mul(g,V),fe=t.sub(N,V),fe=t.mul(g,fe),fe=t.add(fe,x),x=t.add(N,N),N=t.add(x,N),N=t.add(N,V),N=t.mul(N,fe),v=t.add(v,N),V=t.mul(U,M),V=t.add(V,V),N=t.mul(V,fe),k=t.sub(k,N),x=t.mul(V,z),x=t.add(x,x),x=t.add(x,x),new u(k,v,x)}add(g){l(g);const{px:y,py:w,pz:_}=this,{px:U,py:M,pz:k}=g;let v=t.ZERO,x=t.ZERO,N=t.ZERO;const z=e.a,V=t.mul(e.b,Uo);let fe=t.mul(y,U),ee=t.mul(w,M),be=t.mul(_,k),je=t.add(y,w),P=t.add(U,M);je=t.mul(je,P),P=t.add(fe,ee),je=t.sub(je,P),P=t.add(y,_);let $=t.add(U,k);return P=t.mul(P,$),$=t.add(fe,be),P=t.sub(P,$),$=t.add(w,_),v=t.add(M,k),$=t.mul($,v),v=t.add(ee,be),$=t.sub($,v),N=t.mul(z,P),v=t.mul(V,be),N=t.add(v,N),v=t.sub(ee,N),N=t.add(ee,N),x=t.mul(v,N),ee=t.add(fe,fe),ee=t.add(ee,fe),be=t.mul(z,be),P=t.mul(V,P),ee=t.add(ee,be),be=t.sub(fe,be),be=t.mul(z,be),P=t.add(P,be),fe=t.mul(ee,P),x=t.add(x,fe),fe=t.mul($,P),v=t.mul(je,v),v=t.sub(v,fe),fe=t.mul(je,ee),N=t.mul($,N),N=t.add(N,fe),new u(v,x,N)}subtract(g){return this.add(g.negate())}is0(){return this.equals(u.ZERO)}wNAF(g){return p.wNAFCached(this,c,g,y=>{const w=t.invertBatch(y.map(_=>_.pz));return y.map((_,U)=>_.toAffine(w[U])).map(u.fromAffine)})}multiplyUnsafe(g){const y=u.ZERO;if(g===cf)return y;if(o(g),g===wt)return this;const{endo:w}=e;if(!w)return p.unsafeLadder(this,g);let{k1neg:_,k1:U,k2neg:M,k2:k}=w.splitScalar(g),v=y,x=y,N=this;for(;U>cf||k>cf;)U&wt&&(v=v.add(N)),k&wt&&(x=x.add(N)),N=N.double(),U>>=wt,k>>=wt;return _&&(v=v.negate()),M&&(x=x.negate()),x=new u(t.mul(x.px,w.beta),x.py,x.pz),v.add(x)}multiply(g){o(g);let y=g,w,_;const{endo:U}=e;if(U){const{k1neg:M,k1:k,k2neg:v,k2:x}=U.splitScalar(y);let{p:N,f:z}=this.wNAF(k),{p:V,f:fe}=this.wNAF(x);N=p.constTimeNegate(M,N),V=p.constTimeNegate(v,V),V=new u(t.mul(V.px,U.beta),V.py,V.pz),w=N.add(V),_=z.add(fe)}else{const{p:M,f:k}=this.wNAF(y);w=M,_=k}return u.normalizeZ([w,_])[0]}multiplyAndAddUnsafe(g,y,w){const _=u.BASE,U=(k,v)=>v===cf||v===wt||!k.equals(_)?k.multiplyUnsafe(v):k.multiply(v),M=U(this,y).add(U(g,w));return M.is0()?void 0:M}toAffine(g){const{px:y,py:w,pz:_}=this,U=this.is0();g==null&&(g=U?t.ONE:t.inv(_));const M=t.mul(y,g),k=t.mul(w,g),v=t.mul(_,g);if(U)return{x:t.ZERO,y:t.ZERO};if(!t.eql(v,t.ONE))throw new Error("invZ was invalid");return{x:M,y:k}}isTorsionFree(){const{h:g,isTorsionFree:y}=e;if(g===wt)return!0;if(y)return y(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:g,clearCofactor:y}=e;return g===wt?this:y?y(u,this):this.multiplyUnsafe(e.h)}toRawBytes(g=!0){return this.assertValidity(),f(u,this,g)}toHex(g=!0){return G0(this.toRawBytes(g))}}u.BASE=new u(e.Gx,e.Gy,t.ONE),u.ZERO=new u(t.ZERO,t.ONE,t.ZERO);const h=e.nBitLength,p=T1(u,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:u,normPrivateKeyToScalar:a,weierstrassEquation:s,isWithinCurveOrder:i}}function O1(n){const e=_c(n);return $r(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function S1(n){const e=O1(n),{Fp:t,n:f}=e,r=t.BYTES+1,s=2*t.BYTES+1;function i(P){return cfG0(H0(P,e.nByteLength));function b(P){const $=f>>wt;return P>$}function g(P){return b(P)?o(-P):P}const y=(P,$,L)=>yn(P.slice($,L));class w{constructor($,L,re){this.r=$,this.s=L,this.recovery=re,this.assertValidity()}static fromCompact($){const L=e.nByteLength;return $=Ct("compactSignature",$,L*2),new w(y($,0,L),y($,L,2*L))}static fromDER($){const{r:L,s:re}=jf.toSig(Ct("DER",$));return new w(L,re)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit($){return new w(this.r,this.s,$)}recoverPublicKey($){const{r:L,s:re,recovery:ce}=this,xe=x(Ct("msgHash",$));if(ce==null||![0,1,2,3].includes(ce))throw new Error("recovery id invalid");const rt=ce===2||ce===3?L+e.n:L;if(rt>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const st=ce&1?"03":"02",wf=c.fromHex(st+p(rt)),Af=a(rt),On=o(-xe*Af),W0=o(re*Af),Ef=c.BASE.multiplyAndAddUnsafe(wf,On,W0);if(!Ef)throw new Error("point at infinify");return Ef.assertValidity(),Ef}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new w(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Q0(this.toDERHex())}toDERHex(){return jf.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Q0(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const _={isValidPrivateKey(P){try{return l(P),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{const P=Ic(e.n);return x1(e.randomBytes(P),e.n)},precompute(P=8,$=c.BASE){return $._setWindowSize(P),$.multiply(BigInt(3)),$}};function U(P,$=!0){return c.fromPrivateKey(P).toRawBytes($)}function M(P){const $=P instanceof Uint8Array,L=typeof P=="string",re=($||L)&&P.length;return $?re===r||re===s:L?re===2*r||re===2*s:P instanceof c}function k(P,$,L=!0){if(M(P))throw new Error("first arg must be private key");if(!M($))throw new Error("second arg must be public key");return c.fromHex($).multiply(l(P)).toRawBytes(L)}const v=e.bits2int||function(P){const $=yn(P),L=P.length*8-e.nBitLength;return L>0?$>>BigInt(L):$},x=e.bits2int_modN||function(P){return o(v(P))},N=Yi(e.nBitLength);function z(P){if(typeof P!="bigint")throw new Error("bigint expected");if(!(cf<=P&&PJf in L))throw new Error("sign() legacy options not supported");const{hash:re,randomBytes:ce}=e;let{lowS:xe,prehash:rt,extraEntropy:st}=L;xe==null&&(xe=!0),P=Ct("msgHash",P),rt&&(P=Ct("prehashed msgHash",re(P)));const wf=x(P),Af=l($),On=[z(Af),z(wf)];if(st!=null){const Jf=st===!0?ce(t.BYTES):st;On.push(Ct("extraEntropy",Jf))}const W0=pr(...On),Ef=wf;function Vs(Jf){const Sn=v(Jf);if(!h(Sn))return;const ho=a(Sn),Rn=c.BASE.multiply(Sn).toAffine(),vt=o(Rn.x);if(vt===cf)return;const Bn=o(ho*o(Ef+vt*Af));if(Bn===cf)return;let po=(Rn.x===vt?0:2)|Number(Rn.y&wt),bo=Bn;return xe&&b(Bn)&&(bo=g(Bn),po^=1),new w(vt,bo,po)}return{seed:W0,k2sig:Vs}}const fe={lowS:e.lowS,prehash:!1},ee={lowS:e.lowS,prehash:!1};function be(P,$,L=fe){const{seed:re,k2sig:ce}=V(P,$,L),xe=e;return xc(xe.hash.outputLen,xe.nByteLength,xe.hmac)(re,ce)}c.BASE._setWindowSize(8);function je(P,$,L,re=ee){var Rn;const ce=P;if($=Ct("msgHash",$),L=Ct("publicKey",L),"strict"in re)throw new Error("options.strict was renamed to lowS");const{lowS:xe,prehash:rt}=re;let st,wf;try{if(typeof ce=="string"||ce instanceof Uint8Array)try{st=w.fromDER(ce)}catch(vt){if(!(vt instanceof jf.Err))throw vt;st=w.fromCompact(ce)}else if(typeof ce=="object"&&typeof ce.r=="bigint"&&typeof ce.s=="bigint"){const{r:vt,s:Bn}=ce;st=new w(vt,Bn)}else throw new Error("PARSE");wf=c.fromHex(L)}catch(vt){if(vt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(xe&&st.hasHighS())return!1;rt&&($=e.hash($));const{r:Af,s:On}=st,W0=x($),Ef=a(On),Vs=o(W0*Ef),Jf=o(Af*Ef),Sn=(Rn=c.BASE.multiplyAndAddUnsafe(wf,Vs,Jf))==null?void 0:Rn.toAffine();return Sn?o(Sn.x)===Af:!1}return{CURVE:e,getPublicKey:U,getSharedSecret:k,sign:be,verify:je,ProjectivePoint:c,Signature:w,utils:_}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function R1(n){return{hash:n,hmac:(e,...t)=>bc(n,e,Bu(...t)),randomBytes:Fu}}function B1(n,e){const t=f=>S1({...n,...R1(f)});return Object.freeze({...t(e),create:t})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Nc=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Do=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),F1=BigInt(1),mi=BigInt(2),Lo=(n,e)=>(n+e/mi)/e;function U1(n){const e=Nc,t=BigInt(3),f=BigInt(6),r=BigInt(11),s=BigInt(22),i=BigInt(23),o=BigInt(44),a=BigInt(88),c=n*n*n%e,l=c*c*n%e,u=ut(l,t,e)*l%e,h=ut(u,t,e)*l%e,p=ut(h,mi,e)*c%e,b=ut(p,r,e)*p%e,g=ut(b,s,e)*b%e,y=ut(g,o,e)*g%e,w=ut(y,a,e)*y%e,_=ut(w,o,e)*g%e,U=ut(_,t,e)*l%e,M=ut(U,i,e)*b%e,k=ut(M,f,e)*c%e,v=ut(k,mi,e);if(!yi.eql(yi.sqr(v),n))throw new Error("Cannot find square root");return v}const yi=v1(Nc,void 0,void 0,{sqrt:U1}),xf=B1({a:BigInt(0),b:BigInt(7),Fp:yi,n:Do,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:n=>{const e=Do,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),f=-F1*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),r=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=t,i=BigInt("0x100000000000000000000000000000000"),o=Lo(s*n,e),a=Lo(-f*n,e);let c=Ze(n-o*t-a*r,e),l=Ze(-o*f-a*s,e);const u=c>i,h=l>i;if(u&&(c=e-c),h&&(l=e-l),c>i||l>i)throw new Error("splitScalar: Endomorphism failed, k="+n);return{k1neg:u,k1:c,k2neg:h,k2:l}}}},Qu);BigInt(0);xf.ProjectivePoint;const wi="0x0000000000000000000000000000000000000000",Mo="0x0000000000000000000000000000000000000000000000000000000000000000",$o=BigInt(0),Go=BigInt(1),Qo=BigInt(2),Ho=BigInt(27),Jo=BigInt(28),jr=BigInt(35),Dn={};function zo(n){return An(lt(n),32)}var o0,a0,c0,rn;const xt=class xt{constructor(e,t,f,r){I(this,o0,void 0);I(this,a0,void 0);I(this,c0,void 0);I(this,rn,void 0);Ss(e,Dn,"Signature"),m(this,o0,t),m(this,a0,f),m(this,c0,r),m(this,rn,null)}get r(){return d(this,o0)}set r(e){A(Yn(e)===32,"invalid r","value",e),m(this,o0,j(e))}get s(){return d(this,a0)}set s(e){A(Yn(e)===32,"invalid s","value",e);const t=j(e);A(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),m(this,a0,t)}get v(){return d(this,c0)}set v(e){const t=oe(e,"value");A(t===27||t===28,"invalid v","v",e),m(this,c0,t)}get networkV(){return d(this,rn)}get legacyChainId(){const e=this.networkV;return e==null?null:xt.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=ue(this.s);return this.yParity&&(e[0]|=128),j(e)}get compactSerialized(){return _e([this.r,this.yParityAndS])}get serialized(){return _e([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new xt(Dn,this.r,this.s,this.v);return this.networkV&&m(e,rn,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const t=W(e,"v");return t==Ho||t==Jo?$o:(A(t>=jr,"invalid EIP-155 v","v",e),(t-jr)/Qo)}static getChainIdV(e,t){return W(e)*Qo+BigInt(35+t-27)}static getNormalizedV(e){const t=W(e);return t===$o||t===Ho?27:t===Go||t===Jo?28:(A(t>=jr,"invalid v","v",e),t&Go?27:28)}static from(e){function t(c,l){A(c,l,"signature",e)}if(e==null)return new xt(Dn,Mo,Mo,27);if(typeof e=="string"){const c=ue(e,"signature");if(c.length===64){const l=j(c.slice(0,32)),u=c.slice(32,64),h=u[0]&128?28:27;return u[0]&=127,new xt(Dn,l,j(u),h)}if(c.length===65){const l=j(c.slice(0,32)),u=c.slice(32,64);t((u[0]&128)===0,"non-canonical s");const h=xt.getNormalizedV(c[64]);return new xt(Dn,l,j(u),h)}t(!1,"invalid raw signature length")}if(e instanceof xt)return e.clone();const f=e.r;t(f!=null,"missing r");const r=zo(f),s=function(c,l){if(c!=null)return zo(c);if(l!=null){t(Ee(l,32),"invalid yParityAndS");const u=ue(l);return u[0]&=127,j(u)}t(!1,"missing s")}(e.s,e.yParityAndS);t((ue(s)[0]&128)==0,"non-canonical s");const{networkV:i,v:o}=function(c,l,u){if(c!=null){const h=W(c);return{networkV:h>=jr?h:void 0,v:xt.getNormalizedV(h)}}if(l!=null)return t(Ee(l,32),"invalid yParityAndS"),{v:ue(l)[0]&128?28:27};if(u!=null){switch(oe(u,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),a=new xt(Dn,r,s,o);return i&&m(a,rn,i),t(e.yParity==null||oe(e.yParity,"sig.yParity")===a.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===a.yParityAndS,"yParityAndS mismatch"),a}};o0=new WeakMap,a0=new WeakMap,c0=new WeakMap,rn=new WeakMap;let Ot=xt;var Xt;const Vf=class Vf{constructor(e){I(this,Xt,void 0);A(Yn(e)===32,"invalid private key","privateKey","[REDACTED]"),m(this,Xt,j(e))}get privateKey(){return d(this,Xt)}get publicKey(){return Vf.computePublicKey(d(this,Xt))}get compressedPublicKey(){return Vf.computePublicKey(d(this,Xt),!0)}sign(e){A(Yn(e)===32,"invalid digest length","digest",e);const t=xf.sign(tt(e),tt(d(this,Xt)),{lowS:!0});return Ot.from({r:Qf(t.r,32),s:Qf(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=Vf.computePublicKey(e);return j(xf.getSharedSecret(tt(d(this,Xt)),ue(t),!1))}static computePublicKey(e,t){let f=ue(e,"key");if(f.length===32){const s=xf.getPublicKey(f,!!t);return j(s)}if(f.length===64){const s=new Uint8Array(65);s[0]=4,s.set(f,1),f=s}const r=xf.ProjectivePoint.fromHex(f);return j(r.toRawBytes(t))}static recoverPublicKey(e,t){A(Yn(e)===32,"invalid digest length","digest",e);const f=Ot.from(t);let r=xf.Signature.fromCompact(tt(_e([f.r,f.s])));r=r.addRecoveryBit(f.yParity);const s=r.recoverPublicKey(tt(e));return A(s!=null,"invalid signautre for digest","signature",t),"0x"+s.toHex(!1)}static addPoints(e,t,f){const r=xf.ProjectivePoint.fromHex(Vf.computePublicKey(e).substring(2)),s=xf.ProjectivePoint.fromHex(Vf.computePublicKey(t).substring(2));return"0x"+r.add(s).toHex(!!f)}};Xt=new WeakMap;let br=Vf;const D1=BigInt(0),L1=BigInt(36);function Vo(n){n=n.toLowerCase();const e=n.substring(2).split(""),t=new Uint8Array(40);for(let r=0;r<40;r++)t[r]=e[r].charCodeAt(0);const f=ue(Ae(t));for(let r=0;r<40;r+=2)f[r>>1]>>4>=8&&(e[r]=e[r].toUpperCase()),(f[r>>1]&15)>=8&&(e[r+1]=e[r+1].toUpperCase());return"0x"+e.join("")}const Xi={};for(let n=0;n<10;n++)Xi[String(n)]=String(n);for(let n=0;n<26;n++)Xi[String.fromCharCode(65+n)]=String(10+n);const Ko=15;function M1(n){n=n.toUpperCase(),n=n.substring(4)+n.substring(0,2)+"00";let e=n.split("").map(f=>Xi[f]).join("");for(;e.length>=Ko;){let f=e.substring(0,Ko);e=parseInt(f,10)%97+e.substring(f.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const $1=function(){const n={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];n[t]=BigInt(e)}return n}();function G1(n){n=n.toLowerCase();let e=D1;for(let t=0;te.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return d(this,sn)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return d(this,sn)===!0?-1:d(this,sn)===!1?this.value.length:null}static from(e,t){return new Kt(Vt,e,t)}static uint8(e){return H(e,8)}static uint16(e){return H(e,16)}static uint24(e){return H(e,24)}static uint32(e){return H(e,32)}static uint40(e){return H(e,40)}static uint48(e){return H(e,48)}static uint56(e){return H(e,56)}static uint64(e){return H(e,64)}static uint72(e){return H(e,72)}static uint80(e){return H(e,80)}static uint88(e){return H(e,88)}static uint96(e){return H(e,96)}static uint104(e){return H(e,104)}static uint112(e){return H(e,112)}static uint120(e){return H(e,120)}static uint128(e){return H(e,128)}static uint136(e){return H(e,136)}static uint144(e){return H(e,144)}static uint152(e){return H(e,152)}static uint160(e){return H(e,160)}static uint168(e){return H(e,168)}static uint176(e){return H(e,176)}static uint184(e){return H(e,184)}static uint192(e){return H(e,192)}static uint200(e){return H(e,200)}static uint208(e){return H(e,208)}static uint216(e){return H(e,216)}static uint224(e){return H(e,224)}static uint232(e){return H(e,232)}static uint240(e){return H(e,240)}static uint248(e){return H(e,248)}static uint256(e){return H(e,256)}static uint(e){return H(e,256)}static int8(e){return H(e,-8)}static int16(e){return H(e,-16)}static int24(e){return H(e,-24)}static int32(e){return H(e,-32)}static int40(e){return H(e,-40)}static int48(e){return H(e,-48)}static int56(e){return H(e,-56)}static int64(e){return H(e,-64)}static int72(e){return H(e,-72)}static int80(e){return H(e,-80)}static int88(e){return H(e,-88)}static int96(e){return H(e,-96)}static int104(e){return H(e,-104)}static int112(e){return H(e,-112)}static int120(e){return H(e,-120)}static int128(e){return H(e,-128)}static int136(e){return H(e,-136)}static int144(e){return H(e,-144)}static int152(e){return H(e,-152)}static int160(e){return H(e,-160)}static int168(e){return H(e,-168)}static int176(e){return H(e,-176)}static int184(e){return H(e,-184)}static int192(e){return H(e,-192)}static int200(e){return H(e,-200)}static int208(e){return H(e,-208)}static int216(e){return H(e,-216)}static int224(e){return H(e,-224)}static int232(e){return H(e,-232)}static int240(e){return H(e,-240)}static int248(e){return H(e,-248)}static int256(e){return H(e,-256)}static int(e){return H(e,-256)}static bytes1(e){return ae(e,1)}static bytes2(e){return ae(e,2)}static bytes3(e){return ae(e,3)}static bytes4(e){return ae(e,4)}static bytes5(e){return ae(e,5)}static bytes6(e){return ae(e,6)}static bytes7(e){return ae(e,7)}static bytes8(e){return ae(e,8)}static bytes9(e){return ae(e,9)}static bytes10(e){return ae(e,10)}static bytes11(e){return ae(e,11)}static bytes12(e){return ae(e,12)}static bytes13(e){return ae(e,13)}static bytes14(e){return ae(e,14)}static bytes15(e){return ae(e,15)}static bytes16(e){return ae(e,16)}static bytes17(e){return ae(e,17)}static bytes18(e){return ae(e,18)}static bytes19(e){return ae(e,19)}static bytes20(e){return ae(e,20)}static bytes21(e){return ae(e,21)}static bytes22(e){return ae(e,22)}static bytes23(e){return ae(e,23)}static bytes24(e){return ae(e,24)}static bytes25(e){return ae(e,25)}static bytes26(e){return ae(e,26)}static bytes27(e){return ae(e,27)}static bytes28(e){return ae(e,28)}static bytes29(e){return ae(e,29)}static bytes30(e){return ae(e,30)}static bytes31(e){return ae(e,31)}static bytes32(e){return ae(e,32)}static address(e){return new Kt(Vt,"address",e)}static bool(e){return new Kt(Vt,"bool",!!e)}static bytes(e){return new Kt(Vt,"bytes",e)}static string(e){return new Kt(Vt,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Kt(Vt,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===jo}static dereference(e,t){if(Kt.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}};sn=new WeakMap;let Qe=Kt;class H1 extends yf{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let f=Qe.dereference(t,"string");try{f=le(f)}catch(r){return this._throwError(r.message,t)}return e.writeValue(f)}decode(e){return le(Qf(e.readValue(),20))}}class J1 extends yf{constructor(t){super(t.name,t.type,"_",t.dynamic);C(this,"coder");this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,f){return this.coder.encode(t,f)}decode(t){return this.coder.decode(t)}}function Oc(n,e,t){let f=[];if(Array.isArray(t))f=t;else if(t&&typeof t=="object"){let a={};f=e.map(c=>{const l=c.localName;return D(l,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:t}),D(!a[l],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:t}),a[l]=!0,t[l]})}else A(!1,"invalid tuple value","tuple",t);A(e.length===f.length,"types/value length mismatch","tuple",t);let r=new hi,s=new hi,i=[];e.forEach((a,c)=>{let l=f[c];if(a.dynamic){let u=s.length;a.encode(s,l);let h=r.writeUpdatableValue();i.push(p=>{h(p+u)})}else a.encode(r,l)}),i.forEach(a=>{a(r.length)});let o=n.appendWriter(r);return o+=n.appendWriter(s),o}function Sc(n,e){let t=[],f=[],r=n.subReader(0);return e.forEach(s=>{let i=null;if(s.dynamic){let o=n.readIndex(),a=r.subReader(o);try{i=s.decode(a)}catch(c){if(Et(c,"BUFFER_OVERRUN"))throw c;i=c,i.baseType=s.name,i.name=s.localName,i.type=s.type}}else try{i=s.decode(n)}catch(o){if(Et(o,"BUFFER_OVERRUN"))throw o;i=o,i.baseType=s.name,i.name=s.localName,i.type=s.type}if(i==null)throw new Error("investigate");t.push(i),f.push(s.localName||null)}),cs.fromItems(t,f)}class z1 extends yf{constructor(t,f,r){const s=t.type+"["+(f>=0?f:"")+"]",i=f===-1||t.dynamic;super("array",s,r,i);C(this,"coder");C(this,"length");q(this,{coder:t,length:f})}defaultValue(){const t=this.coder.defaultValue(),f=[];for(let r=0;ri||r<-(i+Y1))&&this._throwError("value out-of-bounds",f),r=tc(r,8*ze)}else(rer(s,this.size*8))&&this._throwError("value out-of-bounds",f);return t.writeValue(r)}decode(t){let f=er(t.readValue(),this.size*8);return this.signed&&(f=lu(f,this.size*8)),f}}class t6 extends Rc{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,hf(Qe.dereference(t,"string")))}decode(e){return Ji(super.decode(e))}}class Wr extends yf{constructor(t,f){let r=!1;const s=[];t.forEach(o=>{o.dynamic&&(r=!0),s.push(o.type)});const i="tuple("+s.join(",")+")";super("tuple",i,f,r);C(this,"coders");q(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach(r=>{t.push(r.defaultValue())});const f=this.coders.reduce((r,s)=>{const i=s.localName;return i&&(r[i]||(r[i]=0),r[i]++),r},{});return this.coders.forEach((r,s)=>{let i=r.localName;!i||f[i]!==1||(i==="length"&&(i="_length"),t[i]==null&&(t[i]=t[s]))}),Object.freeze(t)}encode(t,f){const r=Qe.dereference(f,"tuple");return Oc(t,this.coders,r)}decode(t){return Sc(t,this.coders)}}function En(n){return Ae(hf(n))}var f6="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";const Wo=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),qo=4;function n6(n){let e=0;function t(){return n[e++]<<8|n[e++]}let f=t(),r=1,s=[0,1];for(let k=1;k>--a&1}const u=31,h=2**u,p=h>>>1,b=p>>1,g=h-1;let y=0;for(let k=0;k1;){let V=v+x>>>1;k>>1|l(),N=N<<1^p,z=(z^p)<<1|p|1;_=N,U=1+z-N}let M=f-4;return w.map(k=>{switch(k-M){case 3:return M+65792+(n[o++]<<16|n[o++]<<8|n[o++]);case 2:return M+256+(n[o++]<<8|n[o++]);case 1:return M+n[o++];default:return k-1}})}function r6(n){let e=0;return()=>n[e++]}function Bc(n){return r6(n6(s6(n)))}function s6(n){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((r,s)=>e[r.charCodeAt(0)]=s);let t=n.length,f=new Uint8Array(6*t>>3);for(let r=0,s=0,i=0,o=0;r=8&&(f[s++]=o>>(i-=8));return f}function i6(n){return n&1?~n>>1:n>>1}function o6(n,e){let t=Array(n);for(let f=0,r=0;f{let e=gr(n);if(e.length)return e})}function Uc(n){let e=[];for(;;){let t=n();if(t==0)break;e.push(a6(t,n))}for(;;){let t=n()-1;if(t<0)break;e.push(c6(t,n))}return e.flat()}function mr(n){let e=[];for(;;){let t=n(e.length);if(!t)break;e.push(t)}return e}function Dc(n,e,t){let f=Array(n).fill().map(()=>[]);for(let r=0;rf[i].push(s));return f}function a6(n,e){let t=1+e(),f=e(),r=mr(e);return Dc(r.length,1+n,e).flatMap((i,o)=>{let[a,...c]=i;return Array(r[o]).fill().map((l,u)=>{let h=u*f;return[a+u*t,c.map(p=>p+h)]})})}function c6(n,e){let t=1+e();return Dc(t,1+n,e).map(r=>[r[0],r.slice(1)])}function l6(n){let e=[],t=gr(n);return r(f([]),[]),e;function f(s){let i=n(),o=mr(()=>{let a=gr(n).map(c=>t[c]);if(a.length)return f(a)});return{S:i,B:o,Q:s}}function r({S:s,B:i},o,a){if(!(s&4&&a===o[o.length-1])){s&2&&(a=o[o.length-1]),s&1&&e.push(o);for(let c of i)for(let l of c.Q)r(c,[...o,l],a)}}}function u6(n){return n.toString(16).toUpperCase().padStart(2,"0")}function Lc(n){return`{${u6(n)}}`}function d6(n){let e=[];for(let t=0,f=n.length;t>24&255}function Gc(n){return n&16777215}let Ai,Zo,Ei,es;function A6(){let n=Bc(p6);Ai=new Map(Fc(n).flatMap((e,t)=>e.map(f=>[f,t+1<<24]))),Zo=new Set(gr(n)),Ei=new Map,es=new Map;for(let[e,t]of Uc(n)){if(!Zo.has(e)&&t.length==2){let[f,r]=t,s=es.get(f);s||(s=new Map,es.set(f,s)),s.set(r,e)}Ei.set(e,t.reverse())}}function Qc(n){return n>=yr&&n=us&&n=ds&&ehs&&e0&&r(hs+c)}else{let i=Ei.get(s);i?t.push(...i):r(s)}if(!t.length)break;s=t.pop()}if(f&&e.length>1){let s=fr(e[0]);for(let i=1;i0&&r>=i)i==0?(e.push(f,...t),t.length=0,f=o):t.push(o),r=i;else{let a=E6(f,o);a>=0?f=a:r==0&&i==0?(e.push(f),f=o):(t.push(o),r=i)}}return f>=0&&e.push(f,...t),e}function Jc(n){return Hc(n).map(Gc)}function v6(n){return k6(Hc(n))}const Yo=45,zc=".",Vc=65039,Kc=1,Kn=n=>Array.from(n);function wr(n,e){return n.P.has(e)||n.Q.has(e)}class x6 extends Array{get is_emoji(){return!0}}let ki,jc,Wf,vi,Wc,Xn,ti,Gn,qc,Xo,xi;function eo(){if(ki)return;let n=Bc(f6);const e=()=>gr(n),t=()=>new Set(e());ki=new Map(Uc(n)),jc=t(),Wf=e(),vi=new Set(e().map(l=>Wf[l])),Wf=new Set(Wf),Wc=t(),t();let f=Fc(n),r=n();const s=()=>new Set(e().flatMap(l=>f[l]).concat(e()));Xn=mr(l=>{let u=mr(n).map(h=>h+96);if(u.length){let h=l>=r;u[0]-=32,u=J0(u),h&&(u=`Restricted[${u}]`);let p=s(),b=s(),g=!n();return{N:u,P:p,Q:b,M:g,R:h}}}),ti=t(),Gn=new Map;let i=e().concat(Kn(ti)).sort((l,u)=>l-u);i.forEach((l,u)=>{let h=n(),p=i[u]=h?i[u-h]:{V:[],M:new Map};p.V.push(l),ti.has(l)||Gn.set(l,p)});for(let{V:l,M:u}of new Set(Gn.values())){let h=[];for(let b of l){let g=Xn.filter(w=>wr(w,b)),y=h.find(({G:w})=>g.some(_=>w.has(_)));y||(y={G:new Set,V:[]},h.push(y)),y.V.push(b),g.forEach(w=>y.G.add(w))}let p=h.flatMap(b=>Kn(b.G));for(let{G:b,V:g}of h){let y=new Set(p.filter(w=>!b.has(w)));for(let w of g)u.set(w,y)}}let o=new Set,a=new Set;const c=l=>o.has(l)?a.add(l):o.add(l);for(let l of Xn){for(let u of l.P)c(u);for(let u of l.Q)c(u)}for(let l of o)!Gn.has(l)&&!a.has(l)&&Gn.set(l,Kc);qc=new Set(Kn(o).concat(Kn(Jc(o)))),Xo=l6(n).map(l=>x6.from(l)).sort(h6),xi=new Map;for(let l of Xo){let u=[xi];for(let h of l){let p=u.map(b=>{let g=b.get(h);return g||(g=new Map,b.set(h,g)),g});h===Vc?u.push(...p):u=p}for(let h of u)h.V=l}}function to(n){return(Zc(n)?"":`${fo(Ls([n]))} `)+Lc(n)}function fo(n){return`"${n}"‎`}function C6(n){if(n.length>=4&&n[2]==Yo&&n[3]==Yo)throw new Error(`invalid label extension: "${J0(n.slice(0,4))}"`)}function T6(n){for(let t=n.lastIndexOf(95);t>0;)if(n[--t]!==95)throw new Error("underscore allowed only at start")}function I6(n){let e=n[0],t=Wo.get(e);if(t)throw or(`leading ${t}`);let f=n.length,r=-1;for(let s=1;s{let s=d6(r),i={input:s,offset:f};f+=s.length+1;try{let o=i.tokens=F6(s,e,t),a=o.length,c;if(!a)throw new Error("empty label");let l=i.output=o.flat();if(T6(l),!(i.emoji=a>1||o[0].is_emoji)&&l.every(h=>h<128))C6(l),c="ASCII";else{let h=o.flatMap(p=>p.is_emoji?[]:p);if(!h.length)c="Emoji";else{if(Wf.has(l[0]))throw or("leading combining mark");for(let g=1;gi.has(o)):Kn(i),!t.length)return}else f.push(r)}if(t){for(let r of t)if(f.every(s=>wr(r,s)))throw new Error(`whole-script confusable: ${n.N}/${r.N}`)}}function S6(n){let e=Xn;for(let t of n){let f=e.filter(r=>wr(r,t));if(!f.length)throw Xn.some(r=>wr(r,t))?Xc(e[0],t):Yc(t);if(e=f,f.length==1)break}return e}function R6(n){return n.map(({input:e,error:t,output:f})=>{if(t){let r=t.message;throw new Error(n.length==1?r:`Invalid label ${fo(Ls(e))}: ${r}`)}return J0(f)}).join(zc)}function Yc(n){return new Error(`disallowed character: ${to(n)}`)}function Xc(n,e){let t=to(e),f=Xn.find(r=>r.P.has(e));return f&&(t=`${f.N} ${t}`),new Error(`illegal mixture: ${n.N} + ${t}`)}function or(n){return new Error(`illegal placement: ${n}`)}function B6(n,e){for(let t of e)if(!wr(n,t))throw Xc(n,t);if(n.M){let t=Jc(e);for(let f=1,r=t.length;fqo)throw new Error(`excessive non-spacing marks: ${fo(Ls(t.slice(f-1,s)))} (${s-f}/${qo})`);f=s}}}function F6(n,e,t){let f=[],r=[];for(n=n.slice().reverse();n.length;){let s=D6(n);if(s)r.length&&(f.push(e(r)),r=[]),f.push(t(s));else{let i=n.pop();if(qc.has(i))r.push(i);else{let o=ki.get(i);if(o)r.push(...o);else if(!jc.has(i))throw Yc(i)}}}return r.length&&f.push(e(r)),f}function U6(n){return n.filter(e=>e!=Vc)}function D6(n,e){let t=xi,f,r=n.length;for(;r&&(t=t.get(n[--r]),!!t);){let{V:s}=t;s&&(f=s,e&&e.push(...n.slice(r).reverse()),n.length=r)}return f}const el=new Uint8Array(32);el.fill(0);function ea(n){return A(n.length!==0,"invalid ENS name; empty component","comp",n),n}function tl(n){const e=hf(L6(n)),t=[];if(n.length===0)return t;let f=0;for(let r=0;r{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"}function fi(n,e){return{address:le(n),storageKeys:e.map((t,f)=>(A(Ee(t,32),"invalid slot",`storageKeys[${f}]`,t),t.toLowerCase()))}}function Pn(n){if(Array.isArray(n))return n.map((t,f)=>Array.isArray(t)?(A(t.length===2,"invalid slot set",`value[${f}]`,t),fi(t[0],t[1])):(A(t!=null&&typeof t=="object","invalid address-slot set","value",n),fi(t.address,t.storageKeys)));A(n!=null&&typeof n=="object","invalid access list","value",n);const e=Object.keys(n).map(t=>{const f=n[t].reduce((r,s)=>(r[s]=!0,r),{});return fi(t,Object.keys(f).sort())});return e.sort((t,f)=>t.address.localeCompare(f.address)),e}function $6(n){let e;return typeof n=="string"?e=br.computePublicKey(n,!1):e=n.publicKey,le(Ae("0x"+e.substring(4)).substring(26))}function G6(n,e){return $6(br.recoverPublicKey(n,e))}const Ye=BigInt(0),Q6=BigInt(2),H6=BigInt(27),J6=BigInt(28),z6=BigInt(35),V6=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function no(n){return n==="0x"?null:le(n)}function fl(n,e){try{return Pn(n)}catch(t){A(!1,t.message,e,n)}}function Ms(n,e){return n==="0x"?0:oe(n,e)}function Je(n,e){if(n==="0x")return Ye;const t=W(n,e);return A(t<=V6,"value exceeds uint size",e,t),t}function Be(n,e){const t=W(n,"value"),f=lt(t);return A(f.length<=32,"value too large",`tx.${e}`,t),f}function nl(n){return Pn(n).map(e=>[e.address,e.storageKeys])}function K6(n){const e=zi(n);A(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",n);const t={type:0,nonce:Ms(e[0],"nonce"),gasPrice:Je(e[1],"gasPrice"),gasLimit:Je(e[2],"gasLimit"),to:no(e[3]),value:Je(e[4],"value"),data:j(e[5]),chainId:Ye};if(e.length===6)return t;const f=Je(e[6],"v"),r=Je(e[7],"r"),s=Je(e[8],"s");if(r===Ye&&s===Ye)t.chainId=f;else{let i=(f-z6)/Q6;i=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),D(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),D(this.type!==0||!f,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const r=[];return this.type!=null?r.push(this.type):t?r.push(2):e?(r.push(1),f||r.push(0)):f?(r.push(1),r.push(2)):(r.push(0),r.push(1),r.push(2)),r.sort(),r}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Cf.from(this)}toJSON(){const e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Cf;if(typeof e=="string"){const f=ue(e);if(f[0]>=127)return Cf.from(K6(f));switch(f[0]){case 1:return Cf.from(W6(f));case 2:return Cf.from(j6(f))}D(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new Cf;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=Ot.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.hash!=null&&(A(t.isSigned(),"unsigned transaction cannot define hash","tx",e),A(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(A(t.isSigned(),"unsigned transaction cannot define from","tx",e),A(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}};ef=new WeakMap,l0=new WeakMap,u0=new WeakMap,d0=new WeakMap,h0=new WeakMap,p0=new WeakMap,b0=new WeakMap,g0=new WeakMap,m0=new WeakMap,y0=new WeakMap,w0=new WeakMap,A0=new WeakMap;let bs=Cf;const sl=new Uint8Array(32);sl.fill(0);const q6=BigInt(-1),il=BigInt(0),ol=BigInt(1),Z6=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Y6(n){const e=ue(n),t=e.length%32;return t?_e([e,sl.slice(t)]):j(e)}const X6=Qf(ol,32),e5=Qf(il,32),ra={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},ni=["name","version","chainId","verifyingContract","salt"];function sa(n){return function(e){return A(typeof e=="string",`invalid domain value for ${JSON.stringify(n)}`,`domain.${n}`,e),e}}const t5={name:sa("name"),version:sa("version"),chainId:function(n){const e=W(n,"domain.chainId");return A(e>=0,"invalid chain ID","domain.chainId",n),Number.isSafeInteger(e)?Number(e):Vn(e)},verifyingContract:function(n){try{return le(n).toLowerCase()}catch{}A(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",n)},salt:function(n){const e=ue(n,"domain.salt");return A(e.length===32,'invalid domain value "salt"',"domain.salt",n),j(e)}};function ri(n){{const e=n.match(/^(u?)int(\d*)$/);if(e){const t=e[1]==="",f=parseInt(e[2]||"256");A(f%8===0&&f!==0&&f<=256&&(e[2]==null||e[2]===String(f)),"invalid numeric width","type",n);const r=er(Z6,t?f-1:f),s=t?(r+ol)*q6:il;return function(i){const o=W(i,"value");return A(o>=s&&o<=r,`value out-of-bounds for ${n}`,"value",o),Qf(t?tc(o,256):o,32)}}}{const e=n.match(/^bytes(\d+)$/);if(e){const t=parseInt(e[1]);return A(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",n),function(f){const r=ue(f);return A(r.length===t,`invalid length for ${n}`,"value",f),Y6(f)}}}switch(n){case"address":return function(e){return An(le(e),32)};case"bool":return function(e){return e?X6:e5};case"bytes":return function(e){return Ae(e)};case"string":return function(e){return En(e)}}return null}function ia(n,e){return`${n}(${e.map(({name:t,type:f})=>f+" "+t).join(",")})`}var Tr,tf,E0,Cs,al;const ht=class ht{constructor(e){I(this,Cs);C(this,"primaryType");I(this,Tr,void 0);I(this,tf,void 0);I(this,E0,void 0);m(this,Tr,JSON.stringify(e)),m(this,tf,new Map),m(this,E0,new Map);const t=new Map,f=new Map,r=new Map;Object.keys(e).forEach(o=>{t.set(o,new Set),f.set(o,[]),r.set(o,new Set)});for(const o in e){const a=new Set;for(const c of e[o]){A(!a.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(o)}`,"types",e),a.add(c.name);const l=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;A(l!==o,`circular type reference to ${JSON.stringify(l)}`,"types",e),!ri(l)&&(A(f.has(l),`unknown type ${JSON.stringify(l)}`,"types",e),f.get(l).push(o),t.get(o).add(l))}}const s=Array.from(f.keys()).filter(o=>f.get(o).length===0);A(s.length!==0,"missing primary type","types",e),A(s.length===1,`ambiguous primary types or unused types: ${s.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),q(this,{primaryType:s[0]});function i(o,a){A(!a.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",e),a.add(o);for(const c of t.get(o))if(f.has(c)){i(c,a);for(const l of a)r.get(l).add(c)}a.delete(o)}i(this.primaryType,new Set);for(const[o,a]of r){const c=Array.from(a);c.sort(),d(this,tf).set(o,ia(o,e[o])+c.map(l=>ia(l,e[l])).join(""))}}get types(){return JSON.parse(d(this,Tr))}getEncoder(e){let t=d(this,E0).get(e);return t||(t=G(this,Cs,al).call(this,e),d(this,E0).set(e,t)),t}encodeType(e){const t=d(this,tf).get(e);return A(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Ae(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,f){if(ri(e))return f(e,t);const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r)return A(!r[3]||parseInt(r[3])===t.length,`array length mismatch; expected length ${parseInt(r[3])}`,"value",t),t.map(i=>this._visit(r[1],i,f));const s=this.types[e];if(s)return s.reduce((i,{name:o,type:a})=>(i[o]=this._visit(a,t[o],f),i),{});A(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new ht(e)}static getPrimaryType(e){return ht.from(e).primaryType}static hashStruct(e,t,f){return ht.from(t).hashStruct(e,f)}static hashDomain(e){const t=[];for(const f in e){if(e[f]==null)continue;const r=ra[f];A(r,`invalid typed-data domain key: ${JSON.stringify(f)}`,"domain",e),t.push({name:f,type:r})}return t.sort((f,r)=>ni.indexOf(f.name)-ni.indexOf(r.name)),ht.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,f){return _e(["0x1901",ht.hashDomain(e),ht.from(t).hash(f)])}static hash(e,t,f){return Ae(ht.encode(e,t,f))}static async resolveNames(e,t,f,r){e=Object.assign({},e);for(const o in e)e[o]==null&&delete e[o];const s={};e.verifyingContract&&!Ee(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const i=ht.from(t);i.visit(f,(o,a)=>(o==="address"&&!Ee(a,20)&&(s[a]="0x"),a));for(const o in s)s[o]=await r(o);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),f=i.visit(f,(o,a)=>o==="address"&&s[a]?s[a]:a),{domain:e,value:f}}static getPayload(e,t,f){ht.hashDomain(e);const r={},s=[];ni.forEach(a=>{const c=e[a];c!=null&&(r[a]=t5[a](c),s.push({name:a,type:ra[a]}))});const i=ht.from(t),o=Object.assign({},t);return A(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=s,i.encode(f),{types:o,domain:r,primaryType:i.primaryType,message:i.visit(f,(a,c)=>{if(a.match(/^bytes(\d*)/))return j(ue(c));if(a.match(/^u?int/))return W(c).toString();switch(a){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return A(typeof c=="string","invalid string","value",c),c}A(!1,"unsupported type","type",a)})}}};Tr=new WeakMap,tf=new WeakMap,E0=new WeakMap,Cs=new WeakSet,al=function(e){{const r=ri(e);if(r)return r}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const r=t[1],s=this.getEncoder(r);return i=>{A(!t[3]||parseInt(t[3])===i.length,`array length mismatch; expected length ${parseInt(t[3])}`,"value",i);let o=i.map(s);return d(this,tf).has(r)&&(o=o.map(Ae)),Ae(_e(o))}}const f=this.types[e];if(f){const r=En(d(this,tf).get(e));return s=>{const i=f.map(({name:o,type:a})=>{const c=this.getEncoder(a)(s[o]);return d(this,tf).has(a)?Ae(c):c});return i.unshift(r),_e(i)}}A(!1,`unknown type: ${e}`,"type",e)};let gs=ht;function Ke(n){const e=new Set;return n.forEach(t=>e.add(t)),Object.freeze(e)}const f5="external public payable",n5=Ke(f5.split(" ")),cl="constant external internal payable private public pure view",r5=Ke(cl.split(" ")),ll="constructor error event fallback function receive struct",ul=Ke(ll.split(" ")),dl="calldata memory storage payable indexed",s5=Ke(dl.split(" ")),i5="tuple returns",o5=[ll,dl,i5,cl].join(" "),a5=Ke(o5.split(" ")),c5={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},l5=new RegExp("^(\\s*)"),u5=new RegExp("^([0-9]+)"),d5=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),hl=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),pl=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Re,_t,Ir,Ti;const Ts=class Ts{constructor(e){I(this,Ir);I(this,Re,void 0);I(this,_t,void 0);m(this,Re,0),m(this,_t,e.slice())}get offset(){return d(this,Re)}get length(){return d(this,_t).length-d(this,Re)}clone(){return new Ts(d(this,_t))}reset(){m(this,Re,0)}popKeyword(e){const t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=G(this,Ir,Ti).call(this,d(this,Re)+1,e.match+1);return m(this,Re,e.match+1),t}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=[];for(;d(this,Re)=d(this,_t).length)throw new Error("out-of-bounds");return d(this,_t)[d(this,Re)]}peekKeyword(e){const t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return q0(this,Re)._++,e}toString(){const e=[];for(let t=d(this,Re);t`}};Re=new WeakMap,_t=new WeakMap,Ir=new WeakSet,Ti=function(e=0,t=0){return new Ts(d(this,_t).slice(e,t).map(f=>Object.freeze(Object.assign({},f,{match:f.match-e,linkBack:f.linkBack-e,linkNext:f.linkNext-e}))))};let St=Ts;function Hf(n){const e=[],t=i=>{const o=s0&&e[e.length-1].type==="NUMBER"){const u=e.pop().text;l=u+l,e[e.length-1].value=oe(u)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=l}continue}if(o=i.match(d5),o){if(a.text=o[1],s+=a.text.length,a5.has(a.text)){a.type="KEYWORD";continue}if(a.text.match(pl)){a.type="TYPE";continue}a.type="ID";continue}if(o=i.match(u5),o){a.text=o[1],a.type="NUMBER",s+=a.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(i[0])} at position ${s}`)}return new St(e.map(i=>Object.freeze(i)))}function oa(n,e){let t=[];for(const f in e.keys())n.has(f)&&t.push(f);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function $s(n,e){if(e.peekKeyword(ul)){const t=e.pop().text;if(t!==n)throw new Error(`expected ${n}, got ${t}`)}return e.popType("ID")}function gf(n,e){const t=new Set;for(;;){const f=n.peekType("KEYWORD");if(f==null||e&&!e.has(f))break;if(n.pop(),t.has(f))throw new Error(`duplicate keywords: ${JSON.stringify(f)}`);t.add(f)}return Object.freeze(t)}function bl(n){let e=gf(n,r5);return oa(e,Ke("constant payable nonpayable".split(" "))),oa(e,Ke("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function pf(n,e){return n.popParams().map(t=>Fe.from(t,e))}function gl(n){if(n.peekType("AT")){if(n.pop(),n.peekType("NUMBER"))return W(n.pop().text);throw new Error("invalid gas")}return null}function kn(n){if(n.length)throw new Error(`unexpected tokens: ${n.toString()}`)}const h5=new RegExp(/^(.*)\[([0-9]*)\]$/);function aa(n){const e=n.match(pl);if(A(e,"invalid type","type",n),n==="uint")return"uint256";if(n==="int")return"int256";if(e[2]){const t=parseInt(e[2]);A(t!==0&&t<=32,"invalid bytes length","type",n)}else if(e[3]){const t=parseInt(e[3]);A(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",n)}return n}const we={},nt=Symbol.for("_ethers_internal"),ca="_ParamTypeInternal",la="_ErrorInternal",ua="_EventInternal",da="_ConstructorInternal",ha="_FallbackInternal",pa="_FunctionInternal",ba="_StructInternal";var k0,ts;const pt=class pt{constructor(e,t,f,r,s,i,o,a){I(this,k0);C(this,"name");C(this,"type");C(this,"baseType");C(this,"indexed");C(this,"components");C(this,"arrayLength");C(this,"arrayChildren");if(Ss(e,we,"ParamType"),Object.defineProperty(this,nt,{value:ca}),i&&(i=Object.freeze(i.slice())),r==="array"){if(o==null||a==null)throw new Error("")}else if(o!=null||a!=null)throw new Error("");if(r==="tuple"){if(i==null)throw new Error("")}else if(i!=null)throw new Error("");q(this,{name:t,type:f,baseType:r,indexed:s,components:i,arrayLength:o,arrayChildren:a})}format(e){if(e==null&&(e="sighash"),e==="json"){const f=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=f,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const r={type:this.baseType==="tuple"?"tuple":this.type,name:f};return typeof this.indexed=="boolean"&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(r)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(t+=this.type),t+="("+this.components.map(f=>f.format(e)).join(e==="full"?", ":",")+")"):t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const f=this;return e.map(r=>f.arrayChildren.walk(r,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const f=this;return e.map((r,s)=>f.components[s].walk(r,t))}return t(this.type,e)}async walkAsync(e,t){const f=[],r=[e];return G(this,k0,ts).call(this,f,e,t,s=>{r[0]=s}),f.length&&await Promise.all(f),r[0]}static from(e,t){if(pt.isParamType(e))return e;if(typeof e=="string")try{return pt.from(Hf(e),t)}catch{A(!1,"invalid param type","obj",e)}else if(e instanceof St){let o="",a="",c=null;gf(e,Ke(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(a="tuple",c=e.popParams().map(g=>pt.from(g)),o=`tuple(${c.map(g=>g.format()).join(",")})`):(o=aa(e.popType("TYPE")),a=o);let l=null,u=null;for(;e.length&&e.peekType("BRACKET");){const g=e.pop();l=new pt(we,"",o,a,null,c,u,l),u=g.value,o+=g.text,a="array",c=null}let h=null;if(gf(e,s5).has("indexed")){if(!t)throw new Error("");h=!0}const b=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new pt(we,b,o,a,h,c,u,l)}const f=e.name;A(!f||typeof f=="string"&&f.match(hl),"invalid name","obj.name",f);let r=e.indexed;r!=null&&(A(t,"parameter cannot be indexed","obj.indexed",e.indexed),r=!!r);let s=e.type,i=s.match(h5);if(i){const o=parseInt(i[2]||"-1"),a=pt.from({type:i[1],components:e.components});return new pt(we,f||"",s,"array",r,null,o,a)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const o=e.components!=null?e.components.map(c=>pt.from(c)):null;return new pt(we,f||"",s,"tuple",r,o,null,null)}return s=aa(e.type),new pt(we,f||"",s,s,r,null,null,null)}static isParamType(e){return e&&e[nt]===ca}};k0=new WeakSet,ts=function(e,t,f,r){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,o=t.slice();o.forEach((a,c)=>{var l;G(l=i,k0,ts).call(l,e,a,f,u=>{o[c]=u})}),r(o);return}if(this.isTuple()){const i=this.components;let o;if(Array.isArray(t))o=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");o=i.map(a=>{if(!a.name)throw new Error("cannot use object value with unnamed components");if(!(a.name in t))throw new Error(`missing value for component ${a.name}`);return t[a.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((a,c)=>{var l;G(l=i[c],k0,ts).call(l,e,a,f,u=>{o[c]=u})}),r(o);return}const s=f(this.type,t);s.then?e.push(async function(){r(await s)}()):r(s)};let Fe=pt;class vn{constructor(e,t,f){C(this,"type");C(this,"inputs");Ss(e,we,"Fragment"),f=Object.freeze(f.slice()),q(this,{type:t,inputs:f})}static from(e){if(typeof e=="string"){try{vn.from(JSON.parse(e))}catch{}return vn.from(Hf(e))}if(e instanceof St)switch(e.peekKeyword(ul)){case"constructor":return lf.from(e);case"error":return Xe.from(e);case"event":return Qt.from(e);case"fallback":case"receive":return jt.from(e);case"function":return Ht.from(e);case"struct":return wn.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return lf.from(e);case"error":return Xe.from(e);case"event":return Qt.from(e);case"fallback":case"receive":return jt.from(e);case"function":return Ht.from(e);case"struct":return wn.from(e)}D(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}A(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return lf.isFragment(e)}static isError(e){return Xe.isFragment(e)}static isEvent(e){return Qt.isFragment(e)}static isFunction(e){return Ht.isFragment(e)}static isStruct(e){return wn.isFragment(e)}}class Gs extends vn{constructor(t,f,r,s){super(t,f,s);C(this,"name");A(typeof r=="string"&&r.match(hl),"invalid identifier","name",r),s=Object.freeze(s.slice()),q(this,{name:r})}}function Ar(n,e){return"("+e.map(t=>t.format(n)).join(n==="full"?", ":",")+")"}class Xe extends Gs{constructor(e,t,f){super(e,"error",t,f),Object.defineProperty(this,nt,{value:la})}get selector(){return En(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(f=>JSON.parse(f.format(e)))});const t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Ar(e,this.inputs)),t.join(" ")}static from(e){if(Xe.isFragment(e))return e;if(typeof e=="string")return Xe.from(Hf(e));if(e instanceof St){const t=$s("error",e),f=pf(e);return kn(e),new Xe(we,t,f)}return new Xe(we,e.name,e.inputs?e.inputs.map(Fe.from):[])}static isFragment(e){return e&&e[nt]===la}}class Qt extends Gs{constructor(t,f,r,s){super(t,"event",f,r);C(this,"anonymous");Object.defineProperty(this,nt,{value:ua}),q(this,{anonymous:s})}get topicHash(){return En(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const f=[];return t!=="sighash"&&f.push("event"),f.push(this.name+Ar(t,this.inputs)),t!=="sighash"&&this.anonymous&&f.push("anonymous"),f.join(" ")}static getTopicHash(t,f){return f=(f||[]).map(s=>Fe.from(s)),new Qt(we,t,f,!1).topicHash}static from(t){if(Qt.isFragment(t))return t;if(typeof t=="string")try{return Qt.from(Hf(t))}catch{A(!1,"invalid event fragment","obj",t)}else if(t instanceof St){const f=$s("event",t),r=pf(t,!0),s=!!gf(t,Ke(["anonymous"])).has("anonymous");return kn(t),new Qt(we,f,r,s)}return new Qt(we,t.name,t.inputs?t.inputs.map(f=>Fe.from(f,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[nt]===ua}}class lf extends vn{constructor(t,f,r,s,i){super(t,f,r);C(this,"payable");C(this,"gas");Object.defineProperty(this,nt,{value:da}),q(this,{payable:s,gas:i})}format(t){if(D(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});const f=[`constructor${Ar(t,this.inputs)}`];return f.push(this.payable?"payable":"nonpayable"),this.gas!=null&&f.push(`@${this.gas.toString()}`),f.join(" ")}static from(t){if(lf.isFragment(t))return t;if(typeof t=="string")try{return lf.from(Hf(t))}catch{A(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof St){gf(t,Ke(["constructor"]));const f=pf(t),r=!!gf(t,n5).has("payable"),s=gl(t);return kn(t),new lf(we,"constructor",f,r,s)}return new lf(we,"constructor",t.inputs?t.inputs.map(Fe.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[nt]===da}}class jt extends vn{constructor(t,f,r){super(t,"fallback",f);C(this,"payable");Object.defineProperty(this,nt,{value:ha}),q(this,{payable:r})}format(t){const f=this.inputs.length===0?"receive":"fallback";if(t==="json"){const r=this.payable?"payable":"nonpayable";return JSON.stringify({type:f,stateMutability:r})}return`${f}()${this.payable?" payable":""}`}static from(t){if(jt.isFragment(t))return t;if(typeof t=="string")try{return jt.from(Hf(t))}catch{A(!1,"invalid fallback fragment","obj",t)}else if(t instanceof St){const f=t.toString(),r=t.peekKeyword(Ke(["fallback","receive"]));if(A(r,"type must be fallback or receive","obj",f),t.popKeyword(Ke(["fallback","receive"]))==="receive"){const a=pf(t);return A(a.length===0,"receive cannot have arguments","obj.inputs",a),gf(t,Ke(["payable"])),kn(t),new jt(we,[],!0)}let i=pf(t);i.length?A(i.length===1&&i[0].type==="bytes","invalid fallback inputs","obj.inputs",i.map(a=>a.format("minimal")).join(", ")):i=[Fe.from("bytes")];const o=bl(t);if(A(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),gf(t,Ke(["returns"])).has("returns")){const a=pf(t);A(a.length===1&&a[0].type==="bytes","invalid fallback outputs","obj.outputs",a.map(c=>c.format("minimal")).join(", "))}return kn(t),new jt(we,i,o==="payable")}if(t.type==="receive")return new jt(we,[],!0);if(t.type==="fallback"){const f=[Fe.from("bytes")],r=t.stateMutability==="payable";return new jt(we,f,r)}A(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[nt]===ha}}class Ht extends Gs{constructor(t,f,r,s,i,o){super(t,"function",f,s);C(this,"constant");C(this,"outputs");C(this,"stateMutability");C(this,"payable");C(this,"gas");Object.defineProperty(this,nt,{value:pa}),i=Object.freeze(i.slice()),q(this,{constant:r==="view"||r==="pure",gas:o,outputs:i,payable:r==="payable",stateMutability:r})}get selector(){return En(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t))),outputs:this.outputs.map(r=>JSON.parse(r.format(t)))});const f=[];return t!=="sighash"&&f.push("function"),f.push(this.name+Ar(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&f.push(this.stateMutability),this.outputs&&this.outputs.length&&(f.push("returns"),f.push(Ar(t,this.outputs))),this.gas!=null&&f.push(`@${this.gas.toString()}`)),f.join(" ")}static getSelector(t,f){return f=(f||[]).map(s=>Fe.from(s)),new Ht(we,t,"view",f,[],null).selector}static from(t){if(Ht.isFragment(t))return t;if(typeof t=="string")try{return Ht.from(Hf(t))}catch{A(!1,"invalid function fragment","obj",t)}else if(t instanceof St){const r=$s("function",t),s=pf(t),i=bl(t);let o=[];gf(t,Ke(["returns"])).has("returns")&&(o=pf(t));const a=gl(t);return kn(t),new Ht(we,r,i,s,o,a)}let f=t.stateMutability;return f==null&&(f="payable",typeof t.constant=="boolean"?(f="view",t.constant||(f="payable",typeof t.payable=="boolean"&&!t.payable&&(f="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(f="nonpayable")),new Ht(we,t.name,f,t.inputs?t.inputs.map(Fe.from):[],t.outputs?t.outputs.map(Fe.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[nt]===pa}}class wn extends Gs{constructor(e,t,f){super(e,"struct",t,f),Object.defineProperty(this,nt,{value:ba})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return wn.from(Hf(e))}catch{A(!1,"invalid struct fragment","obj",e)}else if(e instanceof St){const t=$s("struct",e),f=pf(e);return kn(e),new wn(we,t,f)}return new wn(we,e.name,e.inputs?e.inputs.map(Fe.from):[])}static isFragment(e){return e&&e[nt]===ba}}const Rt=new Map;Rt.set(0,"GENERIC_PANIC");Rt.set(1,"ASSERT_FALSE");Rt.set(17,"OVERFLOW");Rt.set(18,"DIVIDE_BY_ZERO");Rt.set(33,"ENUM_RANGE_ERROR");Rt.set(34,"BAD_STORAGE_DATA");Rt.set(49,"STACK_UNDERFLOW");Rt.set(50,"ARRAY_RANGE_ERROR");Rt.set(65,"OUT_OF_MEMORY");Rt.set(81,"UNINITIALIZED_FUNCTION_CALL");const p5=new RegExp(/^bytes([0-9]*)$/),b5=new RegExp(/^(u?int)([0-9]*)$/);let si=null;function g5(n,e,t,f){let r="missing revert data",s=null;const i=null;let o=null;if(t){r="execution reverted";const c=ue(t);if(t=j(t),c.length===0)r+=" (no data present; likely require(false) occurred",s="require(false)";else if(c.length%32!==4)r+=" (could not decode reason; invalid data length)";else if(j(c.slice(0,4))==="0x08c379a0")try{s=f.decode(["string"],c.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[s]},r+=`: ${JSON.stringify(s)}`}catch{r+=" (could not decode reason; invalid string data)"}else if(j(c.slice(0,4))==="0x4e487b71")try{const l=Number(f.decode(["uint256"],c.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[l]},s=`Panic due to ${Rt.get(l)||"UNKNOWN"}(${l})`,r+=`: ${s}`}catch{r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const a={to:e.to?le(e.to):null,data:e.data||"0x"};return e.from&&(a.from=le(e.from)),Ie(r,"CALL_EXCEPTION",{action:n,data:t,reason:s,transaction:a,invocation:i,revert:o})}var Nf,Qn;const Is=class Is{constructor(){I(this,Nf)}getDefaultValue(e){const t=e.map(r=>G(this,Nf,Qn).call(this,Fe.from(r)));return new Wr(t,"_").defaultValue()}encode(e,t){Ya(t.length,e.length,"types/values length mismatch");const f=e.map(i=>G(this,Nf,Qn).call(this,Fe.from(i))),r=new Wr(f,"_"),s=new hi;return r.encode(s,t),s.data}decode(e,t,f){const r=e.map(i=>G(this,Nf,Qn).call(this,Fe.from(i)));return new Wr(r,"_").decode(new pi(t,f))}static defaultAbiCoder(){return si==null&&(si=new Is),si}static getBuiltinCallException(e,t,f){return g5(e,t,f,Is.defaultAbiCoder())}};Nf=new WeakSet,Qn=function(e){if(e.isArray())return new z1(G(this,Nf,Qn).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Wr(e.components.map(f=>G(this,Nf,Qn).call(this,f)),e.name);switch(e.baseType){case"address":return new H1(e.name);case"bool":return new V1(e.name);case"string":return new t6(e.name);case"bytes":return new K1(e.name);case"":return new q1(e.name)}let t=e.type.match(b5);if(t){let f=parseInt(t[2]||"256");return A(f!==0&&f<=256&&f%8===0,"invalid "+t[1]+" bit length","param",e),new e6(f/8,t[1]==="int",e.name)}if(t=e.type.match(p5),t){let f=parseInt(t[1]);return A(f!==0&&f<=32,"invalid bytes length","param",e),new j1(f,e.name)}A(!1,"invalid type","type",e.type)};let Er=Is;class m5{constructor(e,t,f){C(this,"fragment");C(this,"name");C(this,"signature");C(this,"topic");C(this,"args");const r=e.name,s=e.format();q(this,{fragment:e,name:r,signature:s,topic:t,args:f})}}class y5{constructor(e,t,f,r){C(this,"fragment");C(this,"name");C(this,"args");C(this,"signature");C(this,"selector");C(this,"value");const s=e.name,i=e.format();q(this,{fragment:e,name:s,args:f,signature:i,selector:t,value:r})}}class w5{constructor(e,t,f){C(this,"fragment");C(this,"name");C(this,"args");C(this,"signature");C(this,"selector");const r=e.name,s=e.format();q(this,{fragment:e,name:r,args:f,signature:s,selector:t})}}class ga{constructor(e){C(this,"hash");C(this,"_isIndexed");q(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const ma={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},ya={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:n=>`reverted with reason string ${JSON.stringify(n)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:n=>{let e="unknown panic code";return n>=0&&n<=255&&ma[n.toString()]&&(e=ma[n.toString()]),`reverted with panic code 0x${n.toString(16)} (${e})`}}};var Ut,Dt,Lt,Le,v0,fs,x0,ns;const jn=class jn{constructor(e){I(this,v0);I(this,x0);C(this,"fragments");C(this,"deploy");C(this,"fallback");C(this,"receive");I(this,Ut,void 0);I(this,Dt,void 0);I(this,Lt,void 0);I(this,Le,void 0);let t=[];typeof e=="string"?t=JSON.parse(e):t=e,m(this,Lt,new Map),m(this,Ut,new Map),m(this,Dt,new Map);const f=[];for(const i of t)try{f.push(vn.from(i))}catch(o){console.log("EE",o)}q(this,{fragments:Object.freeze(f)});let r=null,s=!1;m(this,Le,this.getAbiCoder()),this.fragments.forEach((i,o)=>{let a;switch(i.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}q(this,{deploy:i});return;case"fallback":i.inputs.length===0?s=!0:(A(!r||i.payable!==r.payable,"conflicting fallback fragments",`fragments[${o}]`,i),r=i,s=r.payable);return;case"function":a=d(this,Lt);break;case"event":a=d(this,Dt);break;case"error":a=d(this,Ut);break;default:return}const c=i.format();a.has(c)||a.set(c,i)}),this.deploy||q(this,{deploy:lf.from("constructor()")}),q(this,{fallback:r,receive:s})}format(e){const t=e?"minimal":"full";return this.fragments.map(r=>r.format(t))}formatJson(){const e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return Er.defaultAbiCoder()}getFunctionName(e){const t=G(this,v0,fs).call(this,e,null,!1);return A(t,"no matching function","key",e),t.name}hasFunction(e){return!!G(this,v0,fs).call(this,e,null,!1)}getFunction(e,t){return G(this,v0,fs).call(this,e,t||null,!0)}forEachFunction(e){const t=Array.from(d(this,Lt).keys());t.sort((f,r)=>f.localeCompare(r));for(let f=0;ff.localeCompare(r));for(let f=0;f1){const s=r.map(i=>JSON.stringify(i.format())).join(", ");A(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return r[0]}if(e=Xe.from(e).format(),e==="Error(string)")return Xe.from("error Error(string)");if(e==="Panic(uint256)")return Xe.from("error Panic(uint256)");const f=d(this,Ut).get(e);return f||null}forEachError(e){const t=Array.from(d(this,Ut).keys());t.sort((f,r)=>f.localeCompare(r));for(let f=0;fs.type==="string"?En(i):s.type==="bytes"?Ae(j(i)):(s.type==="bool"&&typeof i=="boolean"?i=i?"0x01":"0x00":s.type.match(/^u?int/)?i=Qf(i):s.type.match(/^bytes/)?i=cu(i,32):s.type==="address"&&d(this,Le).encode(["address"],[i]),An(j(i),32));for(t.forEach((s,i)=>{const o=e.inputs[i];if(!o.indexed){A(s==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,s);return}s==null?f.push(null):o.baseType==="array"||o.baseType==="tuple"?A(!1,"filtering with tuples or arrays not supported","contract."+o.name,s):Array.isArray(s)?f.push(s.map(a=>r(o,a))):f.push(r(o,s))});f.length&&f[f.length-1]===null;)f.pop();return f}encodeEventLog(e,t){if(typeof e=="string"){const i=this.getEvent(e);A(i,"unknown event","eventFragment",e),e=i}const f=[],r=[],s=[];return e.anonymous||f.push(e.topicHash),A(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((i,o)=>{const a=t[o];if(i.indexed)if(i.type==="string")f.push(En(a));else if(i.type==="bytes")f.push(Ae(a));else{if(i.baseType==="tuple"||i.baseType==="array")throw new Error("not implemented");f.push(d(this,Le).encode([i.type],[a]))}else r.push(i),s.push(a)}),{data:d(this,Le).encode(r,s),topics:f}}decodeEventLog(e,t,f){if(typeof e=="string"){const p=this.getEvent(e);A(p,"unknown event","eventFragment",e),e=p}if(f!=null&&!e.anonymous){const p=e.topicHash;A(Ee(f[0],32)&&f[0].toLowerCase()===p,"fragment/topic mismatch","topics[0]",f[0]),f=f.slice(1)}const r=[],s=[],i=[];e.inputs.forEach((p,b)=>{p.indexed?p.type==="string"||p.type==="bytes"||p.baseType==="tuple"||p.baseType==="array"?(r.push(Fe.from({type:"bytes32",name:p.name})),i.push(!0)):(r.push(p),i.push(!1)):(s.push(p),i.push(!1))});const o=f!=null?d(this,Le).decode(r,_e(f)):null,a=d(this,Le).decode(s,t,!0),c=[],l=[];let u=0,h=0;return e.inputs.forEach((p,b)=>{let g=null;if(p.indexed)if(o==null)g=new ga(null);else if(i[b])g=new ga(o[h++]);else try{g=o[h++]}catch(y){g=y}else try{g=a[u++]}catch(y){g=y}c.push(g),l.push(p.name||null)}),cs.fromItems(c,l)}parseTransaction(e){const t=ue(e.data,"tx.data"),f=W(e.value!=null?e.value:0,"tx.value"),r=this.getFunction(j(t.slice(0,4)));if(!r)return null;const s=d(this,Le).decode(r.inputs,t.slice(4));return new y5(r,r.selector,s,f)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new m5(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=j(e),f=this.getError(Ce(t,0,4));if(!f)return null;const r=d(this,Le).decode(f.inputs,Ce(t,4));return new w5(f,f.selector,r)}static from(e){return e instanceof jn?e:typeof e=="string"?new jn(JSON.parse(e)):typeof e.format=="function"?new jn(e.format("json")):new jn(e)}};Ut=new WeakMap,Dt=new WeakMap,Lt=new WeakMap,Le=new WeakMap,v0=new WeakSet,fs=function(e,t,f){if(Ee(e)){const s=e.toLowerCase();for(const i of d(this,Lt).values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){const s=[];for(const[i,o]of d(this,Lt))i.split("(")[0]===e&&s.push(o);if(t){const i=t.length>0?t[t.length-1]:null;let o=t.length,a=!0;Qe.isTyped(i)&&i.type==="overrides"&&(a=!1,o--);for(let c=s.length-1;c>=0;c--){const l=s[c].inputs.length;l!==o&&(!a||l!==o-1)&&s.splice(c,1)}for(let c=s.length-1;c>=0;c--){const l=s[c].inputs;for(let u=0;u=l.length){if(t[u].type==="overrides")continue;s.splice(c,1);break}if(t[u].type!==l[u].baseType){s.splice(c,1);break}}}}if(s.length===1&&t&&t.length!==s[0].inputs.length){const i=t[t.length-1];(i==null||Array.isArray(i)||typeof i!="object")&&s.splice(0,1)}if(s.length===0)return null;if(s.length>1&&f){const i=s.map(o=>JSON.stringify(o.format())).join(", ");A(!1,`ambiguous function description (i.e. matches ${i})`,"key",e)}return s[0]}const r=d(this,Lt).get(Ht.from(e).format());return r||null},x0=new WeakSet,ns=function(e,t,f){if(Ee(e)){const s=e.toLowerCase();for(const i of d(this,Dt).values())if(s===i.topicHash)return i;return null}if(e.indexOf("(")===-1){const s=[];for(const[i,o]of d(this,Dt))i.split("(")[0]===e&&s.push(o);if(t){for(let i=s.length-1;i>=0;i--)s[i].inputs.length=0;i--){const o=s[i].inputs;for(let a=0;a1&&f){const i=s.map(o=>JSON.stringify(o.format())).join(", ");A(!1,`ambiguous event description (i.e. matches ${i})`,"key",e)}return s[0]}const r=d(this,Dt).get(Qt.from(e).format());return r||null};let Ii=jn;const ml=BigInt(0);function ar(n){return n??null}function Ge(n){return n==null?null:n.toString()}class wa{constructor(e,t,f){C(this,"gasPrice");C(this,"maxFeePerGas");C(this,"maxPriorityFeePerGas");q(this,{gasPrice:ar(e),maxFeePerGas:ar(t),maxPriorityFeePerGas:ar(f)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:f}=this;return{_type:"FeeData",gasPrice:Ge(e),maxFeePerGas:Ge(t),maxPriorityFeePerGas:Ge(f)}}}function ms(n){const e={};n.to&&(e.to=n.to),n.from&&(e.from=n.from),n.data&&(e.data=j(n.data));const t="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const r of t)!(r in n)||n[r]==null||(e[r]=W(n[r],`request.${r}`));const f="type,nonce".split(/,/);for(const r of f)!(r in n)||n[r]==null||(e[r]=oe(n[r],`request.${r}`));return n.accessList&&(e.accessList=Pn(n.accessList)),"blockTag"in n&&(e.blockTag=n.blockTag),"enableCcipRead"in n&&(e.enableCcipRead=!!n.enableCcipRead),"customData"in n&&(e.customData=n.customData),e}var ff;class A5{constructor(e,t){C(this,"provider");C(this,"number");C(this,"hash");C(this,"timestamp");C(this,"parentHash");C(this,"nonce");C(this,"difficulty");C(this,"gasLimit");C(this,"gasUsed");C(this,"miner");C(this,"extraData");C(this,"baseFeePerGas");I(this,ff,void 0);m(this,ff,e.transactions.map(f=>typeof f!="string"?new kr(f,t):f)),q(this,{provider:t,hash:ar(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:ar(e.baseFeePerGas)})}get transactions(){return d(this,ff).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=d(this,ff).slice();return e.length===0?[]:(D(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:f,gasLimit:r,gasUsed:s,hash:i,miner:o,nonce:a,number:c,parentHash:l,timestamp:u,transactions:h}=this;return{_type:"Block",baseFeePerGas:Ge(e),difficulty:Ge(t),extraData:f,gasLimit:Ge(r),gasUsed:Ge(s),hash:i,miner:o,nonce:a,number:c,parentHash:l,timestamp:u,transactions:h}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>enew Gr(r,t))));let f=ml;e.effectiveGasPrice!=null?f=e.effectiveGasPrice:e.gasPrice!=null&&(f=e.gasPrice),q(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:f,type:e.type,status:e.status,root:e.root})}get logs(){return d(this,_r)}toJSON(){const{to:e,from:t,contractAddress:f,hash:r,index:s,blockHash:i,blockNumber:o,logsBloom:a,logs:c,status:l,root:u}=this;return{_type:"TransactionReceipt",blockHash:i,blockNumber:o,contractAddress:f,cumulativeGasUsed:Ge(this.cumulativeGasUsed),from:t,gasPrice:Ge(this.gasPrice),gasUsed:Ge(this.gasUsed),hash:r,index:s,logs:c,logsBloom:a,root:u,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(o)return null;const{blockNumber:h,nonce:p}=await He({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(p{if(h==null||h.status!==0)return h;D(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},l=await this.provider.getTransactionReceipt(this.hash);if(f===0)return c(l);if(l){if(await l.confirmations()>=f)return c(l)}else if(await a(),f===0)return null;return await new Promise((h,p)=>{const b=[],g=()=>{b.forEach(w=>w())};if(b.push(()=>{o=!0}),r>0){const w=setTimeout(()=>{g(),p(Ie("wait for transaction timeout","TIMEOUT"))},r);b.push(()=>{clearTimeout(w)})}const y=async w=>{if(await w.confirmations()>=f){g();try{h(c(w))}catch(_){p(_)}}};if(b.push(()=>{this.provider.off(this.hash,y)}),this.provider.on(this.hash,y),s>=0){const w=async()=>{try{await a()}catch(_){if(Et(_,"TRANSACTION_REPLACED")){g(),p(_);return}}o||this.provider.once("block",w)};b.push(()=>{this.provider.off("block",w)}),this.provider.once("block",w)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return D(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Al(this)}reorderedEvent(e){return D(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),D(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),wl(this,e)}replaceableTransaction(e){A(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new uo(this,this.provider);return m(t,Pf,e),t}};Pf=new WeakMap;let kr=uo;function E5(n){return{orphan:"drop-block",hash:n.hash,number:n.number}}function wl(n,e){return{orphan:"reorder-transaction",tx:n,other:e}}function Al(n){return{orphan:"drop-transaction",tx:n}}function k5(n){return{orphan:"drop-log",log:{transactionHash:n.transactionHash,blockHash:n.blockHash,blockNumber:n.blockNumber,address:n.address,data:n.data,topics:Object.freeze(n.topics.slice()),index:n.index}}}class ro extends Gr{constructor(t,f,r){super(t,t.provider);C(this,"interface");C(this,"fragment");C(this,"args");const s=f.decodeEventLog(r,t.data,t.topics);q(this,{args:s,fragment:r,interface:f})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class El extends Gr{constructor(t,f){super(t,t.provider);C(this,"error");q(this,{error:f})}}var C0;class v5 extends yl{constructor(t,f,r){super(r,f);I(this,C0,void 0);m(this,C0,t)}get logs(){return super.logs.map(t=>{const f=t.topics.length?d(this,C0).getEvent(t.topics[0]):null;if(f)try{return new ro(t,d(this,C0),f)}catch(r){return new El(t,r)}return t})}}C0=new WeakMap;var Nr;class so extends kr{constructor(t,f,r){super(r,f);I(this,Nr,void 0);m(this,Nr,t)}async wait(t){const f=await super.wait(t);return f==null?null:new v5(d(this,Nr),this.provider,f)}}Nr=new WeakMap;class kl extends fc{constructor(t,f,r,s){super(t,f,r);C(this,"log");q(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class x5 extends kl{constructor(e,t,f,r,s){super(e,t,f,new ro(s,e.interface,r));const i=e.interface.decodeEventLog(r,this.log.data,this.log.topics);q(this,{args:i,fragment:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const Aa=BigInt(0);function vl(n){return n&&typeof n.call=="function"}function xl(n){return n&&typeof n.estimateGas=="function"}function Qs(n){return n&&typeof n.resolveName=="function"}function Cl(n){return n&&typeof n.sendTransaction=="function"}function Tl(n){if(n!=null){if(Qs(n))return n;if(n.provider)return n.provider}}var Pr;class C5{constructor(e,t,f){I(this,Pr,void 0);C(this,"fragment");if(q(this,{fragment:t}),t.inputs.lengthf[a]==null?null:o.walkAsync(f[a],(l,u)=>l==="address"?Array.isArray(u)?Promise.all(u.map(h=>Ve(h,s))):Ve(u,s):u)));return e.interface.encodeFilterTopics(t,i)}())}getTopicFilter(){return d(this,Pr)}}Pr=new WeakMap;function xn(n,e){return n==null?null:typeof n[e]=="function"?n:n.provider&&typeof n.provider[e]=="function"?n.provider:null}function qf(n){return n==null?null:n.provider||null}async function Il(n,e){const t=Qe.dereference(n,"overrides");A(typeof t=="object","invalid overrides parameter","overrides",n);const f=ms(t);return A(f.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",f.to),A(f.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",f.data),f.from&&(f.from=f.from),f}async function T5(n,e,t){const f=xn(n,"resolveName"),r=Qs(f)?f:null;return await Promise.all(e.map((s,i)=>s.walkAsync(t[i],(o,a)=>(a=Qe.dereference(a,o),o==="address"?Ve(a,r):a))))}function I5(n){const e=async function(i){const o=await Il(i,["data"]);o.to=await n.getAddress(),o.from&&(o.from=await Ve(o.from,Tl(n.runner)));const a=n.interface,c=W(o.value||Aa,"overrides.value")===Aa,l=(o.data||"0x")==="0x";a.fallback&&!a.fallback.payable&&a.receive&&!l&&!c&&A(!1,"cannot send data to receive or send value to non-payable fallback","overrides",i),A(a.fallback||l,"cannot send data to receive-only contract","overrides.data",o.data);const u=a.receive||a.fallback&&a.fallback.payable;return A(u||c,"cannot send value to non-payable fallback","overrides.value",o.value),A(a.fallback||l,"cannot send data to receive-only contract","overrides.data",o.data),o},t=async function(i){const o=xn(n.runner,"call");D(vl(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const a=await e(i);try{return await o.call(a)}catch(c){throw Qi(c)&&c.data?n.interface.makeError(c.data,a):c}},f=async function(i){const o=n.runner;D(Cl(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const a=await o.sendTransaction(await e(i)),c=qf(n.runner);return new so(n.interface,c,a)},r=async function(i){const o=xn(n.runner,"estimateGas");return D(xl(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(i))},s=async i=>await f(i);return q(s,{_contract:n,estimateGas:r,populateTransaction:e,send:f,staticCall:t}),s}function _5(n,e){const t=function(...c){const l=n.interface.getFunction(e,c);return D(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),l},f=async function(...c){const l=t(...c);let u={};if(l.inputs.length+1===c.length&&(u=await Il(c.pop()),u.from&&(u.from=await Ve(u.from,Tl(n.runner)))),l.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await T5(n.runner,l.inputs,c);return Object.assign({},u,await He({to:n.getAddress(),data:n.interface.encodeFunctionData(l,h)}))},r=async function(...c){const l=await o(...c);return l.length===1?l[0]:l},s=async function(...c){const l=n.runner;D(Cl(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await l.sendTransaction(await f(...c)),h=qf(n.runner);return new so(n.interface,h,u)},i=async function(...c){const l=xn(n.runner,"estimateGas");return D(xl(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await f(...c))},o=async function(...c){const l=xn(n.runner,"call");D(vl(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await f(...c);let h="0x";try{h=await l.call(u)}catch(b){throw Qi(b)&&b.data?n.interface.makeError(b.data,u):b}const p=t(...c);return n.interface.decodeFunctionResult(p,h)},a=async(...c)=>t(...c).constant?await r(...c):await s(...c);return q(a,{name:n.interface.getFunctionName(e),_contract:n,_key:e,getFragment:t,estimateGas:i,populateTransaction:f,send:s,staticCall:r,staticCallResult:o}),Object.defineProperty(a,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=n.interface.getFunction(e);return D(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),a}function N5(n,e){const t=function(...r){const s=n.interface.getEvent(e,r);return D(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:r}}),s},f=function(...r){return new C5(n,t(...r),r)};return q(f,{name:n.interface.getEventName(e),_contract:n,_key:e,getFragment:t}),Object.defineProperty(f,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=n.interface.getEvent(e);return D(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),r}}),f}const ys=Symbol.for("_ethersInternal_contract"),_l=new WeakMap;function P5(n,e){_l.set(n[ys],e)}function it(n){return _l.get(n[ys])}function O5(n){return n&&typeof n=="object"&&"getTopicFilter"in n&&typeof n.getTopicFilter=="function"&&n.fragment}async function io(n,e){let t,f=null;if(Array.isArray(e)){const s=function(i){if(Ee(i,32))return i;const o=n.interface.getEvent(i);return A(o,"unknown fragment","name",i),o.topicHash};t=e.map(i=>i==null?null:Array.isArray(i)?i.map(s):s(i))}else e==="*"?t=[null]:typeof e=="string"?Ee(e,32)?t=[e]:(f=n.interface.getEvent(e),A(f,"unknown fragment","event",e),t=[f.topicHash]):O5(e)?t=await e.getTopicFilter():"fragment"in e?(f=e.fragment,t=[f.topicHash]):A(!1,"unknown event name","event",e);t=t.map(s=>{if(s==null)return null;if(Array.isArray(s)){const i=Array.from(new Set(s.map(o=>o.toLowerCase())).values());return i.length===1?i[0]:(i.sort(),i)}return s.toLowerCase()});const r=t.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:f,tag:r,topics:t}}async function nr(n,e){const{subs:t}=it(n);return t.get((await io(n,e)).tag)||null}async function Ea(n,e,t){const f=qf(n.runner);D(f,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:r,tag:s,topics:i}=await io(n,t),{addr:o,subs:a}=it(n);let c=a.get(s);if(!c){const u={address:o||n,topics:i},h=y=>{let w=r;if(w==null)try{w=n.interface.getEvent(y.topics[0])}catch{}if(w){const _=w,U=r?n.interface.decodeEventLog(r,y.data,y.topics):[];Ni(n,t,U,M=>new x5(n,M,t,_,y))}else Ni(n,t,[],_=>new kl(n,_,t,y))};let p=[];c={tag:s,listeners:[],start:()=>{p.length||p.push(f.on(u,h))},stop:async()=>{if(p.length==0)return;let y=p;p=[],await Promise.all(y),f.off(u,h)}},a.set(s,c)}return c}let _i=Promise.resolve();async function S5(n,e,t,f){await _i;const r=await nr(n,e);if(!r)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:i,once:o})=>{const a=Array.from(t);f&&a.push(f(o?null:i));try{i.call(n,...a)}catch{}return!o}),r.listeners.length===0&&(r.stop(),it(n).subs.delete(r.tag)),s>0}async function Ni(n,e,t,f){try{await _i}catch{}const r=S5(n,e,t,f);return _i=r,await r}const qr=["then"];var Zp;const lr=class lr{constructor(e,t,f,r){C(this,"target");C(this,"interface");C(this,"runner");C(this,"filters");C(this,Zp);C(this,"fallback");A(typeof e=="string"||Pc(e),"invalid value for Contract target","target",e),f==null&&(f=null);const s=Ii.from(t);q(this,{target:e,runner:f,interface:s}),Object.defineProperty(this,ys,{value:{}});let i,o=null,a=null;if(r){const u=qf(f);a=new so(this.interface,u,r)}let c=new Map;if(typeof e=="string")if(Ee(e))o=e,i=Promise.resolve(e);else{const u=xn(f,"resolveName");if(!Qs(u))throw Ie("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});i=u.resolveName(e).then(h=>{if(h==null)throw Ie("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return it(this).addr=h,h})}else i=e.getAddress().then(u=>{if(u==null)throw new Error("TODO");return it(this).addr=u,u});P5(this,{addrPromise:i,addr:o,deployTx:a,subs:c});const l=new Proxy({},{get:(u,h,p)=>{if(typeof h=="symbol"||qr.indexOf(h)>=0)return Reflect.get(u,h,p);try{return this.getEvent(h)}catch(b){if(!Et(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(u,h)=>qr.indexOf(h)>=0?Reflect.has(u,h):Reflect.has(u,h)||this.interface.hasEvent(String(h))});return q(this,{filters:l}),q(this,{fallback:s.receive||s.fallback?I5(this):null}),new Proxy(this,{get:(u,h,p)=>{if(typeof h=="symbol"||h in u||qr.indexOf(h)>=0)return Reflect.get(u,h,p);try{return u.getFunction(h)}catch(b){if(!Et(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(u,h)=>typeof h=="symbol"||h in u||qr.indexOf(h)>=0?Reflect.has(u,h):u.interface.hasFunction(h)})}connect(e){return new lr(this.target,this.interface,e)}attach(e){return new lr(e,this.interface,this.runner)}async getAddress(){return await it(this).addrPromise}async getDeployedCode(){const e=qf(this.runner);D(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const f=qf(this.runner);return D(f!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((r,s)=>{const i=async()=>{try{if(await this.getDeployedCode()!=null)return r(this);f.once("block",i)}catch(o){s(o)}};i()})}deploymentTransaction(){return it(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),_5(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),N5(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,f){t==null&&(t=0),f==null&&(f="latest");const{addr:r,addrPromise:s}=it(this),i=r||await s,{fragment:o,topics:a}=await io(this,e),c={address:i,topics:a,fromBlock:t,toBlock:f},l=qf(this.runner);return D(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(c)).map(u=>{let h=o;if(h==null)try{h=this.interface.getEvent(u.topics[0])}catch{}if(h)try{return new ro(u,this.interface,h)}catch(p){return new El(u,p)}return new Gr(u,l)})}async on(e,t){const f=await Ea(this,"on",e);return f.listeners.push({listener:t,once:!1}),f.start(),this}async once(e,t){const f=await Ea(this,"once",e);return f.listeners.push({listener:t,once:!0}),f.start(),this}async emit(e,...t){return await Ni(this,e,t,null)}async listenerCount(e){if(e){const r=await nr(this,e);return r?r.listeners.length:0}const{subs:t}=it(this);let f=0;for(const{listeners:r}of t.values())f+=r.length;return f}async listeners(e){if(e){const r=await nr(this,e);return r?r.listeners.map(({listener:s})=>s):[]}const{subs:t}=it(this);let f=[];for(const{listeners:r}of t.values())f=f.concat(r.map(({listener:s})=>s));return f}async off(e,t){const f=await nr(this,e);if(!f)return this;if(t){const r=f.listeners.map(({listener:s})=>s).indexOf(t);r>=0&&f.listeners.splice(r,1)}return(t==null||f.listeners.length===0)&&(f.stop(),it(this).subs.delete(f.tag)),this}async removeAllListeners(e){if(e){const t=await nr(this,e);if(!t)return this;t.stop(),it(this).subs.delete(t.tag)}else{const{subs:t}=it(this);for(const{tag:f,stop:r}of t.values())r(),t.delete(f)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends lr{constructor(r,s=null){super(r,e,s)}}return t}static from(e,t,f){return f==null&&(f=null),new this(e,t,f)}};Zp=ys;let Pi=lr;function R5(){return Pi}class Oe extends R5(){}function ii(n){return n.match(/^ipfs:\/\/ipfs\//i)?n=n.substring(12):n.match(/^ipfs:\/\//i)?n=n.substring(7):A(!1,"unsupported IPFS format","link",n),`https://gateway.ipfs.io/ipfs/${n}`}class B5{constructor(e){C(this,"name");q(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const Nl=new RegExp("^(ipfs)://(.*)$","i"),ka=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Nl,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Of,on,Sf,Hn,_s,Pl;const Wn=class Wn{constructor(e,t,f){I(this,Sf);C(this,"provider");C(this,"address");C(this,"name");I(this,Of,void 0);I(this,on,void 0);q(this,{provider:e,address:t,name:f}),m(this,Of,null),m(this,on,new Oe(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return d(this,Of)==null&&m(this,Of,(async()=>{try{return await d(this,on).supportsInterface("0x9061b923")}catch(e){if(Et(e,"CALL_EXCEPTION"))return!1;throw m(this,Of,null),e}})()),await d(this,Of)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await G(this,Sf,Hn).call(this,"addr(bytes32)");return s==null||s===wi?null:s}catch(s){if(Et(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const i=await G(this,Sf,Hn).call(this,"addr(bytes32,uint)",[s]);if(Ee(i,20))return le(i)}let t=null;for(const s of this.provider.plugins)if(s instanceof B5&&s.supportsCoinType(e)){t=s;break}if(t==null)return null;const f=await G(this,Sf,Hn).call(this,"addr(bytes32,uint)",[e]);if(f==null||f==="0x")return null;const r=await t.decodeAddress(e,f);if(r!=null)return r;D(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:f}})}async getText(e){const t=await G(this,Sf,Hn).call(this,"text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){const e=await G(this,Sf,Hn).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const r=t[1]==="e3010170"?"ipfs":"ipns",s=parseInt(t[4],16);if(t[5].length===s*2)return`${r}://${hu("0x"+t[2])}`}const f=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(f&&f[1].length===64)return`bzz://${f[1]}`;D(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let f=0;f{if(!Array.isArray(e))throw new Error("not an array");return e.map(t=>n(t))}}function Qr(n,e){return t=>{const f={};for(const r in n){let s=r;if(e&&r in e&&!(s in t)){for(const i of e[r])if(i in t){s=i;break}}try{const i=n[r](t[s]);i!==void 0&&(f[r]=i)}catch(i){const o=i instanceof Error?i.message:"not-an-error";D(!1,`invalid value for value.${r} (${o})`,"BAD_DATA",{value:t})}}return f}}function F5(n){switch(n){case!0:case"true":return!0;case!1:case"false":return!1}A(!1,`invalid boolean; ${JSON.stringify(n)}`,"value",n)}function V0(n){return A(Ee(n,!0),"invalid data","value",n),n}function kt(n){return A(Ee(n,32),"invalid hash","value",n),n}const U5=Qr({address:le,blockHash:kt,blockNumber:oe,data:V0,index:oe,removed:ye(F5,!1),topics:oo(kt),transactionHash:kt,transactionIndex:oe},{index:["logIndex"]});function D5(n){return U5(n)}const L5=Qr({hash:ye(kt),parentHash:kt,number:oe,timestamp:oe,nonce:ye(V0),difficulty:W,gasLimit:W,gasUsed:W,miner:ye(le),extraData:V0,baseFeePerGas:ye(W)});function M5(n){const e=L5(n);return e.transactions=n.transactions.map(t=>typeof t=="string"?t:Ol(t)),e}const $5=Qr({transactionIndex:oe,blockNumber:oe,transactionHash:kt,address:le,topics:oo(kt),data:V0,index:oe,blockHash:kt},{index:["logIndex"]});function G5(n){return $5(n)}const Q5=Qr({to:ye(le,null),from:ye(le,null),contractAddress:ye(le,null),index:oe,root:ye(j),gasUsed:W,logsBloom:ye(V0),blockHash:kt,hash:kt,logs:oo(G5),blockNumber:oe,cumulativeGasUsed:W,effectiveGasPrice:ye(W),status:ye(oe),type:ye(oe,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function H5(n){return Q5(n)}function Ol(n){n.to&&W(n.to)===va&&(n.to="0x0000000000000000000000000000000000000000");const e=Qr({hash:kt,type:t=>t==="0x"||t==null?0:oe(t),accessList:ye(Pn,null),blockHash:ye(kt,null),blockNumber:ye(oe,null),transactionIndex:ye(oe,null),from:le,gasPrice:ye(W),maxPriorityFeePerGas:ye(W),maxFeePerGas:ye(W),gasLimit:W,to:ye(le,null),value:W,nonce:oe,data:V0,creates:ye(le,null),chainId:ye(W,null)},{data:["input"],gasLimit:["gas"]})(n);if(e.to==null&&e.creates==null&&(e.creates=Q1(e)),(n.type===1||n.type===2)&&n.accessList==null&&(e.accessList=[]),n.signature?e.signature=Ot.from(n.signature):e.signature=Ot.from(n),e.chainId==null){const t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&W(e.blockHash)===va&&(e.blockHash=null),e}const J5="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Hr{constructor(e){C(this,"name");q(this,{name:e})}clone(){return new Hr(this.name)}}class Hs extends Hr{constructor(t,f){t==null&&(t=0);super(`org.ethers.network.plugins.GasCost#${t||0}`);C(this,"effectiveBlock");C(this,"txBase");C(this,"txCreate");C(this,"txDataZero");C(this,"txDataNonzero");C(this,"txAccessListStorageKey");C(this,"txAccessListAddress");const r={effectiveBlock:t};function s(i,o){let a=(f||{})[i];a==null&&(a=o),A(typeof a=="number",`invalud value for ${i}`,"costs",f),r[i]=a}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),q(this,r)}clone(){return new Hs(this.effectiveBlock,this)}}class Js extends Hr{constructor(t,f){super("org.ethers.plugins.network.Ens");C(this,"address");C(this,"targetNetwork");q(this,{address:t||J5,targetNetwork:f??1})}clone(){return new Js(this.address,this.targetNetwork)}}var Or,Sr;class Sl extends Hr{constructor(t,f){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");I(this,Or,void 0);I(this,Sr,void 0);m(this,Or,t),m(this,Sr,f)}get url(){return d(this,Or)}get processFunc(){return d(this,Sr)}clone(){return this}}Or=new WeakMap,Sr=new WeakMap;const oi=new Map;var T0,I0,Rf;const qn=class qn{constructor(e,t){I(this,T0,void 0);I(this,I0,void 0);I(this,Rf,void 0);m(this,T0,e),m(this,I0,W(t)),m(this,Rf,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return d(this,T0)}set name(e){m(this,T0,e)}get chainId(){return d(this,I0)}set chainId(e){m(this,I0,W(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===W(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===W(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===W(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(d(this,Rf).values())}attachPlugin(e){if(d(this,Rf).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return d(this,Rf).set(e.name,e.clone()),this}getPlugin(e){return d(this,Rf).get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new qn(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new Hs;let f=t.txBase;if(e.to==null&&(f+=t.txCreate),e.data)for(let r=2;r9){let r=BigInt(f[1].substring(0,9));f[1].substring(9).match(/^0+$/)||r++,f[1]=r.toString()}return BigInt(f[0]+f[1])}function Ca(n){return new Sl(n,async(e,t,f)=>{f.setHeader("User-Agent","ethers");let r;try{const[s,i]=await Promise.all([f.send(),e()]);r=s;const o=r.bodyJson.standard;return{gasPrice:i.gasPrice,maxFeePerGas:xa(o.maxFee,9),maxPriorityFeePerGas:xa(o.maxPriorityFee,9)}}catch(s){D(!1,`error encountered with polygon gas station (${JSON.stringify(f.url)})`,"SERVER_ERROR",{request:f,response:r,error:s})}})}function z5(n){return new Sl("data:",async(e,t,f)=>{const r=await e();if(r.maxFeePerGas==null||r.maxPriorityFeePerGas==null)return r;const s=r.maxFeePerGas-r.maxPriorityFeePerGas;return{gasPrice:r.gasPrice,maxFeePerGas:s+n,maxPriorityFeePerGas:n}})}let Ta=!1;function V5(){if(Ta)return;Ta=!0;function n(e,t,f){const r=function(){const s=new uf(e,t);return f.ensNetwork!=null&&s.attachPlugin(new Js(null,f.ensNetwork)),s.attachPlugin(new Hs),(f.plugins||[]).forEach(i=>{s.attachPlugin(i)}),s};uf.register(e,r),uf.register(t,r),f.altNames&&f.altNames.forEach(s=>{uf.register(s,r)})}n("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),n("ropsten",3,{ensNetwork:3}),n("rinkeby",4,{ensNetwork:4}),n("goerli",5,{ensNetwork:5}),n("kovan",42,{ensNetwork:42}),n("sepolia",11155111,{}),n("classic",61,{}),n("classicKotti",6,{}),n("arbitrum",42161,{ensNetwork:1}),n("arbitrum-goerli",421613,{}),n("bnb",56,{ensNetwork:1}),n("bnbt",97,{}),n("linea",59144,{ensNetwork:1}),n("linea-goerli",59140,{}),n("matic",137,{ensNetwork:1,plugins:[Ca("https://gasstation.polygon.technology/v2")]}),n("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Ca("https://gasstation-testnet.polygon.technology/v2")]}),n("optimism",10,{ensNetwork:1,plugins:[z5(BigInt("1000000"))]}),n("optimism-goerli",420,{}),n("xdai",100,{ensNetwork:1})}function Oi(n){return JSON.parse(JSON.stringify(n))}var nf,gt,Bf,Mt,_0,rs;class K5{constructor(e){I(this,_0);I(this,nf,void 0);I(this,gt,void 0);I(this,Bf,void 0);I(this,Mt,void 0);m(this,nf,e),m(this,gt,null),m(this,Bf,4e3),m(this,Mt,-2)}get pollingInterval(){return d(this,Bf)}set pollingInterval(e){m(this,Bf,e)}start(){d(this,gt)||(m(this,gt,d(this,nf)._setTimeout(G(this,_0,rs).bind(this),d(this,Bf))),G(this,_0,rs).call(this))}stop(){d(this,gt)&&(d(this,nf)._clearTimeout(d(this,gt)),m(this,gt,null))}pause(e){this.stop(),e&&m(this,Mt,-2)}resume(){this.start()}}nf=new WeakMap,gt=new WeakMap,Bf=new WeakMap,Mt=new WeakMap,_0=new WeakSet,rs=async function(){try{const e=await d(this,nf).getBlockNumber();if(d(this,Mt)===-2){m(this,Mt,e);return}if(e!==d(this,Mt)){for(let t=d(this,Mt)+1;t<=e;t++){if(d(this,gt)==null)return;await d(this,nf).emit("block",t)}m(this,Mt,e)}}catch{}d(this,gt)!=null&&m(this,gt,d(this,nf)._setTimeout(G(this,_0,rs).bind(this),d(this,Bf)))};var an,cn,Ff;class Rl{constructor(e){I(this,an,void 0);I(this,cn,void 0);I(this,Ff,void 0);m(this,an,e),m(this,Ff,!1),m(this,cn,t=>{this._poll(t,d(this,an))})}async _poll(e,t){throw new Error("sub-classes must override this")}start(){d(this,Ff)||(m(this,Ff,!0),d(this,cn).call(this,-2),d(this,an).on("block",d(this,cn)))}stop(){d(this,Ff)&&(m(this,Ff,!1),d(this,an).off("block",d(this,cn)))}pause(e){this.stop()}resume(){this.start()}}an=new WeakMap,cn=new WeakMap,Ff=new WeakMap;var Ns;class j5 extends Rl{constructor(t,f){super(t);I(this,Ns,void 0);m(this,Ns,Oi(f))}async _poll(t,f){throw new Error("@TODO")}}Ns=new WeakMap;var N0;class W5 extends Rl{constructor(t,f){super(t);I(this,N0,void 0);m(this,N0,f)}async _poll(t,f){const r=await f.getTransactionReceipt(d(this,N0));r&&f.emit(d(this,N0),r)}}N0=new WeakMap;var rf,P0,O0,Uf,mt,Ps,Bl;class ao{constructor(e,t){I(this,Ps);I(this,rf,void 0);I(this,P0,void 0);I(this,O0,void 0);I(this,Uf,void 0);I(this,mt,void 0);m(this,rf,e),m(this,P0,Oi(t)),m(this,O0,G(this,Ps,Bl).bind(this)),m(this,Uf,!1),m(this,mt,-2)}start(){d(this,Uf)||(m(this,Uf,!0),d(this,mt)===-2&&d(this,rf).getBlockNumber().then(e=>{m(this,mt,e)}),d(this,rf).on("block",d(this,O0)))}stop(){d(this,Uf)&&(m(this,Uf,!1),d(this,rf).off("block",d(this,O0)))}pause(e){this.stop(),e&&m(this,mt,-2)}resume(){this.start()}}rf=new WeakMap,P0=new WeakMap,O0=new WeakMap,Uf=new WeakMap,mt=new WeakMap,Ps=new WeakSet,Bl=async function(e){if(d(this,mt)===-2)return;const t=Oi(d(this,P0));t.fromBlock=d(this,mt)+1,t.toBlock=e;const f=await d(this,rf).getLogs(t);if(f.length===0){d(this,mt){if(f==null)return"null";if(typeof f=="bigint")return`bigint:${f.toString()}`;if(typeof f=="string")return f.toLowerCase();if(typeof f=="object"&&!Array.isArray(f)){const r=Object.keys(f);return r.sort(),r.reduce((s,i)=>(s[i]=f[i],s),{})}return f})}class Fl{constructor(e){C(this,"name");q(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function Y5(n){return JSON.parse(JSON.stringify(n))}function Si(n){return n=Array.from(new Set(n).values()),n.sort(),n}async function ai(n,e){if(n==null)throw new Error("invalid event");if(Array.isArray(n)&&(n={topics:n}),typeof n=="string")switch(n){case"block":case"pending":case"debug":case"error":case"network":return{type:n,tag:n}}if(Ee(n,32)){const t=n.toLowerCase();return{type:"transaction",tag:ss("tx",{hash:t}),hash:t}}if(n.orphan){const t=n;return{type:"orphan",tag:ss("orphan",t),filter:Y5(t)}}if(n.address||n.topics){const t=n,f={topics:(t.topics||[]).map(r=>r==null?null:Array.isArray(r)?Si(r.map(s=>s.toLowerCase())):r.toLowerCase())};if(t.address){const r=[],s=[],i=o=>{Ee(o)?r.push(o):s.push((async()=>{r.push(await Ve(o,e))})())};Array.isArray(t.address)?t.address.forEach(i):i(t.address),s.length&&await Promise.all(s),f.address=Si(r.map(o=>o.toLowerCase()))}return{filter:f,tag:ss("event",f),type:"event"}}A(!1,"unknown ProviderEvent","event",n)}function ci(){return new Date().getTime()}const X5={cacheTimeout:250,pollingInterval:4e3};var Me,Df,$e,S0,ct,ln,Lf,sf,Rr,yt,R0,B0,We,dt,Br,Ri,Fr,Bi,un,rr,Ur,Fi,dn,sr,F0,is;class ed{constructor(e,t){I(this,We);I(this,Br);I(this,Fr);I(this,un);I(this,Ur);I(this,dn);I(this,F0);I(this,Me,void 0);I(this,Df,void 0);I(this,$e,void 0);I(this,S0,void 0);I(this,ct,void 0);I(this,ln,void 0);I(this,Lf,void 0);I(this,sf,void 0);I(this,Rr,void 0);I(this,yt,void 0);I(this,R0,void 0);I(this,B0,void 0);if(m(this,B0,Object.assign({},X5,t||{})),e==="any")m(this,ln,!0),m(this,ct,null);else if(e){const f=uf.from(e);m(this,ln,!1),m(this,ct,Promise.resolve(f)),setTimeout(()=>{this.emit("network",f,null)},0)}else m(this,ln,!1),m(this,ct,null);m(this,sf,-1),m(this,Lf,new Map),m(this,Me,new Map),m(this,Df,new Map),m(this,$e,null),m(this,S0,!1),m(this,Rr,1),m(this,yt,new Map),m(this,R0,!1)}get pollingInterval(){return d(this,B0).pollingInterval}get provider(){return this}get plugins(){return Array.from(d(this,Df).values())}attachPlugin(e){if(d(this,Df).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return d(this,Df).set(e.name,e.connect(this)),this}getPlugin(e){return d(this,Df).get(e)||null}get disableCcipRead(){return d(this,R0)}set disableCcipRead(e){m(this,R0,!!e)}async ccipReadFetch(e,t,f){if(this.disableCcipRead||f.length===0||e.to==null)return null;const r=e.to.toLowerCase(),s=t.toLowerCase(),i=[];for(let o=0;o=500,`response not found during CCIP fetch: ${u}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:a,errorMessage:u}}),i.push(u)}D(!1,`error encountered during CCIP fetch: ${i.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:f,errorMessages:i}})}_wrapBlock(e,t){return new A5(M5(e),this)}_wrapLog(e,t){return new Gr(D5(e),this)}_wrapTransactionReceipt(e,t){return new yl(H5(e),this)}_wrapTransactionResponse(e,t){return new kr(Ol(e),this)}_detectNetwork(){D(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){D(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=oe(await G(this,We,dt).call(this,{method:"getBlockNumber"}),"%response");return d(this,sf)>=0&&m(this,sf,e),e}_getAddress(e){return Ve(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(Ee(e))return Ee(e,32)?e:Vn(e);if(typeof e=="bigint"&&(e=oe(e,"blockTag")),typeof e=="number")return e>=0?Vn(e):d(this,sf)>=0?Vn(d(this,sf)+e):this.getBlockNumber().then(t=>Vn(t+e));A(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const t=(e.topics||[]).map(a=>a==null?null:Array.isArray(a)?Si(a.map(c=>c.toLowerCase())):a.toLowerCase()),f="blockHash"in e?e.blockHash:void 0,r=(a,c,l)=>{let u;switch(a.length){case 0:break;case 1:u=a[0];break;default:a.sort(),u=a}if(f&&(c!=null||l!=null))throw new Error("invalid filter");const h={};return u&&(h.address=u),t.length&&(h.topics=t),c&&(h.fromBlock=c),l&&(h.toBlock=l),f&&(h.blockHash=f),h};let s=[];if(e.address)if(Array.isArray(e.address))for(const a of e.address)s.push(this._getAddress(a));else s.push(this._getAddress(e.address));let i;"fromBlock"in e&&(i=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),s.filter(a=>typeof a!="string").length||i!=null&&typeof i!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(s),i,o]).then(a=>r(a[0],a[1],a[2])):r(s,i,o)}_getTransactionRequest(e){const t=ms(e),f=[];if(["to","from"].forEach(r=>{if(t[r]==null)return;const s=Ve(t[r],this);Zr(s)?f.push(async function(){t[r]=await s}()):t[r]=s}),t.blockTag!=null){const r=this._getBlockTag(t.blockTag);Zr(r)?f.push(async function(){t.blockTag=await r}()):t.blockTag=r}return f.length?async function(){return await Promise.all(f),t}():t}async getNetwork(){if(d(this,ct)==null){const r=this._detectNetwork().then(s=>(this.emit("network",s,null),s),s=>{throw d(this,ct)===r&&m(this,ct,null),s});return m(this,ct,r),(await r).clone()}const e=d(this,ct),[t,f]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==f.chainId&&(d(this,ln)?(this.emit("network",f,t),d(this,ct)===e&&m(this,ct,Promise.resolve(f))):D(!1,`network changed: ${t.chainId} => ${f.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:r,gasPrice:s}=await He({_block:G(this,Ur,Fi).call(this,"latest",!1),gasPrice:(async()=>{try{const c=await G(this,We,dt).call(this,{method:"getGasPrice"});return W(c,"%response")}catch{}return null})()});let i=null,o=null;const a=this._wrapBlock(r,e);return a&&a.baseFeePerGas&&(o=BigInt("1000000000"),i=a.baseFeePerGas*q5+o),new wa(s,i,o)},f=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(f){const r=new bf(f.url),s=await f.processFunc(t,this,r);return new wa(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Zr(t)&&(t=await t),W(await G(this,We,dt).call(this,{method:"estimateGas",transaction:t}),"%response")}async call(e){const{tx:t,blockTag:f}=await He({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await G(this,Fr,Bi).call(this,G(this,Br,Ri).call(this,t,f,e.enableCcipRead?0:-1))}async getBalance(e,t){return W(await G(this,un,rr).call(this,{method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return oe(await G(this,un,rr).call(this,{method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return j(await G(this,un,rr).call(this,{method:"getCode"},e,t))}async getStorage(e,t,f){const r=W(t,"position");return j(await G(this,un,rr).call(this,{method:"getStorage",position:r},e,f))}async broadcastTransaction(e){const{blockNumber:t,hash:f,network:r}=await He({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=bs.from(e);if(s.hash!==f)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,r).replaceableTransaction(t)}async getBlock(e,t){const{network:f,params:r}=await He({network:this.getNetwork(),params:G(this,Ur,Fi).call(this,e,!!t)});return r==null?null:this._wrapBlock(r,f)}async getTransaction(e){const{network:t,params:f}=await He({network:this.getNetwork(),params:G(this,We,dt).call(this,{method:"getTransaction",hash:e})});return f==null?null:this._wrapTransactionResponse(f,t)}async getTransactionReceipt(e){const{network:t,params:f}=await He({network:this.getNetwork(),params:G(this,We,dt).call(this,{method:"getTransactionReceipt",hash:e})});if(f==null)return null;if(f.gasPrice==null&&f.effectiveGasPrice==null){const r=await G(this,We,dt).call(this,{method:"getTransaction",hash:e});if(r==null)throw new Error("report this; could not find tx or effectiveGasPrice");f.effectiveGasPrice=r.gasPrice}return this._wrapTransactionReceipt(f,t)}async getTransactionResult(e){const{result:t}=await He({network:this.getNetwork(),result:G(this,We,dt).call(this,{method:"getTransactionResult",hash:e})});return t==null?null:j(t)}async getLogs(e){let t=this._getFilter(e);Zr(t)&&(t=await t);const{network:f,params:r}=await He({network:this.getNetwork(),params:G(this,We,dt).call(this,{method:"getLogs",filter:t})});return r.map(s=>this._wrapLog(s,f))}_getProvider(e){D(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await ws.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=le(e);const t=Ci(e.substring(2).toLowerCase()+".addr.reverse");try{const f=await ws.getEnsAddress(this),s=await new Oe(f,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(s==null||s===wi)return null;const o=await new Oe(s,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(o)!==e?null:o}catch(f){if(Et(f,"BAD_DATA")&&f.value==="0x"||Et(f,"CALL_EXCEPTION"))return null;throw f}return null}async waitForTransaction(e,t,f){const r=t??1;return r===0?this.getTransactionReceipt(e):new Promise(async(s,i)=>{let o=null;const a=async c=>{try{const l=await this.getTransactionReceipt(e);if(l!=null&&c-l.blockNumber+1>=r){s(l),o&&(clearTimeout(o),o=null);return}}catch(l){console.log("EEE",l)}this.once("block",a)};f!=null&&(o=setTimeout(()=>{o!=null&&(o=null,this.off("block",a),i(Ie("timeout","TIMEOUT",{reason:"timeout"})))},f)),a(await this.getBlockNumber())})}async waitForBlock(e){D(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=d(this,yt).get(e);t&&(t.timer&&clearTimeout(t.timer),d(this,yt).delete(e))}_setTimeout(e,t){t==null&&(t=0);const f=q0(this,Rr)._++,r=()=>{d(this,yt).delete(f),e()};if(this.paused)d(this,yt).set(f,{timer:null,func:r,time:t});else{const s=setTimeout(r,t);d(this,yt).set(f,{timer:s,func:r,time:ci()})}return f}_forEachSubscriber(e){for(const t of d(this,Me).values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Fl(e.type);case"block":{const t=new K5(this);return t.pollingInterval=this.pollingInterval,t}case"event":return new ao(this,e.filter);case"transaction":return new W5(this,e.hash);case"orphan":return new j5(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const f of d(this,Me).values())if(f.subscriber===e){f.started&&f.subscriber.stop(),f.subscriber=t,f.started&&t.start(),d(this,$e)!=null&&t.pause(d(this,$e));break}}async on(e,t){const f=await G(this,F0,is).call(this,e);return f.listeners.push({listener:t,once:!1}),f.started||(f.subscriber.start(),f.started=!0,d(this,$e)!=null&&f.subscriber.pause(d(this,$e))),this}async once(e,t){const f=await G(this,F0,is).call(this,e);return f.listeners.push({listener:t,once:!0}),f.started||(f.subscriber.start(),f.started=!0,d(this,$e)!=null&&f.subscriber.pause(d(this,$e))),this}async emit(e,...t){const f=await G(this,dn,sr).call(this,e,t);if(!f||f.listeners.length===0)return!1;const r=f.listeners.length;return f.listeners=f.listeners.filter(({listener:s,once:i})=>{const o=new fc(this,i?null:s,e);try{s.call(this,...t,o)}catch{}return!i}),f.listeners.length===0&&(f.started&&f.subscriber.stop(),d(this,Me).delete(f.tag)),r>0}async listenerCount(e){if(e){const f=await G(this,dn,sr).call(this,e);return f?f.listeners.length:0}let t=0;for(const{listeners:f}of d(this,Me).values())t+=f.length;return t}async listeners(e){if(e){const f=await G(this,dn,sr).call(this,e);return f?f.listeners.map(({listener:r})=>r):[]}let t=[];for(const{listeners:f}of d(this,Me).values())t=t.concat(f.map(({listener:r})=>r));return t}async off(e,t){const f=await G(this,dn,sr).call(this,e);if(!f)return this;if(t){const r=f.listeners.map(({listener:s})=>s).indexOf(t);r>=0&&f.listeners.splice(r,1)}return(!t||f.listeners.length===0)&&(f.started&&f.subscriber.stop(),d(this,Me).delete(f.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:f,subscriber:r}=await G(this,F0,is).call(this,e);f&&r.stop(),d(this,Me).delete(t)}else for(const[t,{started:f,subscriber:r}]of d(this,Me))f&&r.stop(),d(this,Me).delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return d(this,S0)}destroy(){this.removeAllListeners();for(const e of d(this,yt).keys())this._clearTimeout(e);m(this,S0,!0)}get paused(){return d(this,$e)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(m(this,sf,-1),d(this,$e)!=null){if(d(this,$e)==!!e)return;D(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),m(this,$e,!!e);for(const t of d(this,yt).values())t.timer&&clearTimeout(t.timer),t.time=ci()-t.time}resume(){if(d(this,$e)!=null){this._forEachSubscriber(e=>e.resume()),m(this,$e,null);for(const e of d(this,yt).values()){let t=e.time;t<0&&(t=0),e.time=ci(),setTimeout(e.func,t)}}}}Me=new WeakMap,Df=new WeakMap,$e=new WeakMap,S0=new WeakMap,ct=new WeakMap,ln=new WeakMap,Lf=new WeakMap,sf=new WeakMap,Rr=new WeakMap,yt=new WeakMap,R0=new WeakMap,B0=new WeakMap,We=new WeakSet,dt=async function(e){const t=d(this,B0).cacheTimeout;if(t<0)return await this._perform(e);const f=ss(e.method,e);let r=d(this,Lf).get(f);return r||(r=this._perform(e),d(this,Lf).set(f,r),setTimeout(()=>{d(this,Lf).get(f)===r&&d(this,Lf).delete(f)},t)),await r},Br=new WeakSet,Ri=async function(e,t,f){D(f=0&&t==="latest"&&r.to!=null&&Ce(s.data,0,4)==="0x556f1830"){const i=s.data,o=await Ve(r.to,this);let a;try{a=sd(Ce(s.data,4))}catch(u){D(!1,u.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:r,info:{data:i}})}D(a.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:i,reason:"OffchainLookup",transaction:r,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:a.errorArgs}});const c=await this.ccipReadFetch(r,a.calldata,a.urls);D(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:r,info:{data:s.data,errorArgs:a.errorArgs}});const l={to:o,data:_e([a.selector,rd([c,a.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{const u=await G(this,Br,Ri).call(this,l,t,f+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:u}),u}catch(u){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:u}),u}}throw s}},Fr=new WeakSet,Bi=async function(e){const{value:t}=await He({network:this.getNetwork(),value:e});return t},un=new WeakSet,rr=async function(e,t,f){let r=this._getAddress(t),s=this._getBlockTag(f);return(typeof r!="string"||typeof s!="string")&&([r,s]=await Promise.all([r,s])),await G(this,Fr,Bi).call(this,G(this,We,dt).call(this,Object.assign(e,{address:r,blockTag:s})))},Ur=new WeakSet,Fi=async function(e,t){if(Ee(e,32))return await G(this,We,dt).call(this,{method:"getBlock",blockHash:e,includeTransactions:t});let f=this._getBlockTag(e);return typeof f!="string"&&(f=await f),await G(this,We,dt).call(this,{method:"getBlock",blockTag:f,includeTransactions:t})},dn=new WeakSet,sr=async function(e,t){let f=await ai(e,this);return f.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(f=await ai({orphan:"drop-log",log:t[0]},this)),d(this,Me).get(f.tag)||null},F0=new WeakSet,is=async function(e){const t=await ai(e,this),f=t.tag;let r=d(this,Me).get(f);return r||(r={subscriber:this._getSubscriber(t),tag:f,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},d(this,Me).set(f,r)),r};function td(n,e){try{const t=Ui(n,e);if(t)return Ji(t)}catch{}return null}function Ui(n,e){if(n==="0x")return null;try{const t=oe(Ce(n,e,e+32)),f=oe(Ce(n,t,t+32));return Ce(n,t+32,t+32+f)}catch{}return null}function Ia(n){const e=lt(n);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function fd(n){if(n.length%32===0)return n;const e=new Uint8Array(Math.ceil(n.length/32)*32);return e.set(n),e}const nd=new Uint8Array([]);function rd(n){const e=[];let t=0;for(let f=0;f=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=Ce(n,0,32);D(Ce(t,0,12)===Ce(_a,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Ce(t,12);try{const f=[],r=oe(Ce(n,32,64)),s=oe(Ce(n,r,r+32)),i=Ce(n,r+32);for(let o=0;oe[f]),e}function Ln(n,e){if(n.provider)return n.provider;D(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function Na(n,e){let t=ms(e);if(t.to!=null&&(t.to=Ve(t.to,n)),t.from!=null){const f=t.from;t.from=Promise.all([n.getAddress(),Ve(f,n)]).then(([r,s])=>(A(r.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),r))}else t.from=n.getAddress();return await He(t)}class id{constructor(e){C(this,"provider");q(this,{provider:e||null})}async getNonce(e){return Ln(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Na(this,e)}async populateTransaction(e){const t=Ln(this,"populateTransaction"),f=await Na(this,e);f.nonce==null&&(f.nonce=await this.getNonce("pending")),f.gasLimit==null&&(f.gasLimit=await this.estimateGas(f));const r=await this.provider.getNetwork();if(f.chainId!=null){const i=W(f.chainId);A(i===r.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else f.chainId=r.chainId;const s=f.maxFeePerGas!=null||f.maxPriorityFeePerGas!=null;if(f.gasPrice!=null&&(f.type===2||s)?A(!1,"eip-1559 transaction do not support gasPrice","tx",e):(f.type===0||f.type===1)&&s&&A(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(f.type===2||f.type==null)&&f.maxFeePerGas!=null&&f.maxPriorityFeePerGas!=null)f.type=2;else if(f.type===0||f.type===1){const i=await t.getFeeData();D(i.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),f.gasPrice==null&&(f.gasPrice=i.gasPrice)}else{const i=await t.getFeeData();if(f.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(f.type=2,f.gasPrice!=null){const o=f.gasPrice;delete f.gasPrice,f.maxFeePerGas=o,f.maxPriorityFeePerGas=o}else f.maxFeePerGas==null&&(f.maxFeePerGas=i.maxFeePerGas),f.maxPriorityFeePerGas==null&&(f.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(D(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),f.gasPrice==null&&(f.gasPrice=i.gasPrice),f.type=0):D(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else f.type===2&&(f.maxFeePerGas==null&&(f.maxFeePerGas=i.maxFeePerGas),f.maxPriorityFeePerGas==null&&(f.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return await He(f)}async estimateGas(e){return Ln(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Ln(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Ln(this,"resolveName").resolveName(e)}async sendTransaction(e){const t=Ln(this,"sendTransaction"),f=await this.populateTransaction(e);delete f.from;const r=bs.from(f);return await t.broadcastTransaction(await this.signTransaction(r))}}function od(n){return JSON.parse(JSON.stringify(n))}var qe,$t,hn,Mf,pn,U0,Dr,Di,Lr,Li;class Ul{constructor(e){I(this,Dr);I(this,Lr);I(this,qe,void 0);I(this,$t,void 0);I(this,hn,void 0);I(this,Mf,void 0);I(this,pn,void 0);I(this,U0,void 0);m(this,qe,e),m(this,$t,null),m(this,hn,G(this,Dr,Di).bind(this)),m(this,Mf,!1),m(this,pn,null),m(this,U0,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){d(this,Mf)||(m(this,Mf,!0),G(this,Dr,Di).call(this,-2))}stop(){d(this,Mf)&&(m(this,Mf,!1),m(this,U0,!0),G(this,Lr,Li).call(this),d(this,qe).off("block",d(this,hn)))}pause(e){e&&G(this,Lr,Li).call(this),d(this,qe).off("block",d(this,hn))}resume(){this.start()}}qe=new WeakMap,$t=new WeakMap,hn=new WeakMap,Mf=new WeakMap,pn=new WeakMap,U0=new WeakMap,Dr=new WeakSet,Di=async function(e){try{d(this,$t)==null&&m(this,$t,this._subscribe(d(this,qe)));let t=null;try{t=await d(this,$t)}catch(s){if(!Et(s,"UNSUPPORTED_OPERATION")||s.operation!=="eth_newFilter")throw s}if(t==null){m(this,$t,null),d(this,qe)._recoverSubscriber(this,this._recover(d(this,qe)));return}const f=await d(this,qe).getNetwork();if(d(this,pn)||m(this,pn,f),d(this,pn).chainId!==f.chainId)throw new Error("chaid changed");if(d(this,U0))return;const r=await d(this,qe).send("eth_getFilterChanges",[t]);await this._emitResults(d(this,qe),r)}catch(t){console.log("@TODO",t)}d(this,qe).once("block",d(this,hn))},Lr=new WeakSet,Li=function(){const e=d(this,$t);e&&(m(this,$t,null),e.then(t=>{d(this,qe).send("eth_uninstallFilter",[t])}))};var bn;class ad extends Ul{constructor(t,f){super(t);I(this,bn,void 0);m(this,bn,od(f))}_recover(t){return new ao(t,d(this,bn))}async _subscribe(t){return await t.send("eth_newFilter",[d(this,bn)])}async _emitResults(t,f){for(const r of f)t.emit(d(this,bn),t._wrapLog(r,t._network))}}bn=new WeakMap;class cd extends Ul{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const f of t)e.emit("pending",f)}}const ld="bigint,boolean,function,number,string,symbol".split(/,/g);function os(n){if(n==null||ld.indexOf(typeof n)>=0||typeof n.getAddress=="function")return n;if(Array.isArray(n))return n.map(os);if(typeof n=="object")return Object.keys(n).reduce((e,t)=>(e[t]=n[t],e),{});throw new Error(`should not happen: ${n} (${typeof n})`)}function ud(n){return new Promise(e=>{setTimeout(e,n)})}function Mn(n){return n&&n.toLowerCase()}function Pa(n){return n&&typeof n.pollingInterval=="number"}const dd={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class li extends id{constructor(t,f){super(t);C(this,"address");f=le(f),q(this,{address:f})}connect(t){D(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(t){return await this.populateCall(t)}async sendUncheckedTransaction(t){const f=os(t),r=[];if(f.from){const i=f.from;r.push((async()=>{const o=await Ve(i,this.provider);A(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),f.from=o})())}else f.from=this.address;if(f.gasLimit==null&&r.push((async()=>{f.gasLimit=await this.provider.estimateGas({...f,from:this.address})})()),f.to!=null){const i=f.to;r.push((async()=>{f.to=await Ve(i,this.provider)})())}r.length&&await Promise.all(r);const s=this.provider.getRpcTransaction(f);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(t){const f=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(t);return await new Promise((s,i)=>{const o=[1e3,100],a=async()=>{const c=await this.provider.getTransaction(r);if(c!=null){s(c.replaceableTransaction(f));return}this.provider._setTimeout(()=>{a()},o.pop()||4e3)};a()})}async signTransaction(t){const f=os(t);if(f.from){const s=await Ve(f.from,this.provider);A(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),f.from=s}else f.from=this.address;const r=this.provider.getRpcTransaction(f);return await this.provider.send("eth_signTransaction",[r])}async signMessage(t){const f=typeof t=="string"?hf(t):t;return await this.provider.send("personal_sign",[j(f),this.address.toLowerCase()])}async signTypedData(t,f,r){const s=os(r),i=await gs.resolveNames(t,f,s,async o=>{const a=await Ve(o);return A(a!=null,"TypedData does not support null address","value",o),a});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(gs.getPayload(i.domain,f,i.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(t){const f=typeof t=="string"?hf(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),j(f)])}}var gn,D0,of,Gt,Nt,af,Mr,Mi;class hd extends ed{constructor(t,f){super(t,f);I(this,Mr);I(this,gn,void 0);I(this,D0,void 0);I(this,of,void 0);I(this,Gt,void 0);I(this,Nt,void 0);I(this,af,void 0);m(this,D0,1),m(this,gn,Object.assign({},dd,f||{})),m(this,of,[]),m(this,Gt,null),m(this,af,null);{let s=null;const i=new Promise(o=>{s=o});m(this,Nt,{promise:i,resolve:s})}const r=this._getOption("staticNetwork");r&&(A(t==null||r.matches(t),"staticNetwork MUST match network object","options",f),m(this,af,r))}_getOption(t){return d(this,gn)[t]}get _network(){return D(d(this,af),"network is not available yet","NETWORK_ERROR"),d(this,af)}async _perform(t){if(t.method==="call"||t.method==="estimateGas"){let r=t.transaction;if(r&&r.type!=null&&W(r.type)&&r.maxFeePerGas==null&&r.maxPriorityFeePerGas==null){const s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(t=Object.assign({},t,{transaction:Object.assign({},r,{type:void 0})}))}}const f=this.getRpcRequest(t);return f!=null?await this.send(f.method,f.args):super._perform(t)}async _detectNetwork(){const t=this._getOption("staticNetwork");if(t)return t;if(this.ready)return uf.from(W(await this.send("eth_chainId",[])));const f={id:q0(this,D0)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:f});let r;try{r=(await this._send(f))[0]}catch(s){throw this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:r}),"result"in r)return uf.from(W(r.result));throw this.getRpcError(f,r)}_start(){d(this,Nt)==null||d(this,Nt).resolve==null||(d(this,Nt).resolve(),m(this,Nt,null),(async()=>{for(;d(this,af)==null&&!this.destroyed;)try{m(this,af,await this._detectNetwork())}catch(t){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Ie("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:t}})),await ud(1e3)}G(this,Mr,Mi).call(this)})())}async _waitUntilReady(){if(d(this,Nt)!=null)return await d(this,Nt).promise}_getSubscriber(t){return t.type==="pending"?new cd(this):t.type==="event"?this._getOption("polling")?new ao(this,t.filter):new ad(this,t.filter):t.type==="orphan"&&t.filter.orphan==="drop-log"?new Fl("orphan"):super._getSubscriber(t)}get ready(){return d(this,Nt)==null}getRpcTransaction(t){const f={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(r=>{if(t[r]==null)return;let s=r;r==="gasLimit"&&(s="gas"),f[s]=Vn(W(t[r],`tx.${r}`))}),["from","to","data"].forEach(r=>{t[r]!=null&&(f[r]=j(t[r]))}),t.accessList&&(f.accessList=Pn(t.accessList)),f}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Mn(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Mn(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[Mn(t.address),t.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Mn(t.address),"0x"+t.position.toString(16),t.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&t.filter.address!=null&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(Mn):t.filter.address=Mn(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,f){const{method:r}=t,{error:s}=f;if(r==="eth_estimateGas"&&s.message){const a=s.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return Ie("insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.params[0],info:{payload:t,error:s}})}if(r==="eth_call"||r==="eth_estimateGas"){const a=$i(s),c=Er.getBuiltinCallException(r==="eth_call"?"call":"estimateGas",t.params[0],a?a.data:null);return c.info={error:s,payload:t},c}const i=JSON.stringify(bd(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i))return Ie("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[r]||"unknown",reason:"rejected",info:{payload:t,error:s}});if(r==="eth_sendRawTransaction"||r==="eth_sendTransaction"){const a=t.params[0];if(i.match(/insufficient funds|base fee exceeds gas limit/i))return Ie("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:s}});if(i.match(/nonce/i)&&i.match(/too low/i))return Ie("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:s}});if(i.match(/replacement transaction/i)&&i.match(/underpriced/i))return Ie("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:s}});if(i.match(/only replay-protected/i))return Ie("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:a,info:{error:s}}})}let o=!!i.match(/the method .* does not exist/i);return o||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(o=!0),o?Ie("unsupported operation","UNSUPPORTED_OPERATION",{operation:t.method,info:{error:s,payload:t}}):Ie("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:t})}send(t,f){if(this.destroyed)return Promise.reject(Ie("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t}));const r=q0(this,D0)._++,s=new Promise((i,o)=>{d(this,of).push({resolve:i,reject:o,payload:{method:t,params:f,id:r,jsonrpc:"2.0"}})});return G(this,Mr,Mi).call(this),s}async getSigner(t){t==null&&(t=0);const f=this.send("eth_accounts",[]);if(typeof t=="number"){const s=await f;if(t>=s.length)throw new Error("no such account");return new li(this,s[t])}const{accounts:r}=await He({network:this.getNetwork(),accounts:f});t=le(t);for(const s of r)if(le(s)===t)return new li(this,t);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(f=>new li(this,f))}destroy(){d(this,Gt)&&(clearTimeout(d(this,Gt)),m(this,Gt,null));for(const{payload:t,reject:f}of d(this,of))f(Ie("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t.method}));m(this,of,[]),super.destroy()}}gn=new WeakMap,D0=new WeakMap,of=new WeakMap,Gt=new WeakMap,Nt=new WeakMap,af=new WeakMap,Mr=new WeakSet,Mi=function(){if(d(this,Gt))return;const t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");m(this,Gt,setTimeout(()=>{m(this,Gt,null);const f=d(this,of);for(m(this,of,[]);f.length;){const r=[f.shift()];for(;f.length&&r.length!==d(this,gn).batchMaxCount;)if(r.push(f.shift()),JSON.stringify(r.map(i=>i.payload)).length>d(this,gn).batchMaxSize){f.unshift(r.pop());break}(async()=>{const s=r.length===1?r[0].payload:r.map(i=>i.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{const i=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:i});for(const{resolve:o,reject:a,payload:c}of r){if(this.destroyed){a(Ie("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const l=i.filter(u=>u.id===c.id)[0];if(l==null){const u=Ie("missing response for request","BAD_DATA",{value:i,info:{payload:c}});this.emit("error",u),a(u);continue}if("error"in l){a(this.getRpcError(c,l));continue}o(l.result)}}catch(i){this.emit("debug",{action:"receiveRpcError",error:i});for(const{reject:o}of r)o(i)}})()}},t))};var $f;class Dl extends hd{constructor(t,f){super(t,f);I(this,$f,void 0);m(this,$f,4e3)}_getSubscriber(t){const f=super._getSubscriber(t);return Pa(f)&&(f.pollingInterval=d(this,$f)),f}get pollingInterval(){return d(this,$f)}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");m(this,$f,t),this._forEachSubscriber(f=>{Pa(f)&&(f.pollingInterval=d(this,$f))})}}$f=new WeakMap;var L0;class pd extends Dl{constructor(t,f,r){t==null&&(t="http://localhost:8545");super(f,r);I(this,L0,void 0);typeof t=="string"?m(this,L0,new bf(t)):m(this,L0,t.clone())}_getConnection(){return d(this,L0).clone()}async send(t,f){return await this._start(),await super.send(t,f)}async _send(t){const f=this._getConnection();f.body=JSON.stringify(t),f.setHeader("content-type","application/json");const r=await f.send();r.assertOk();let s=r.bodyJson;return Array.isArray(s)||(s=[s]),s}}L0=new WeakMap;function $i(n){if(n==null)return null;if(typeof n.message=="string"&&n.message.match(/revert/i)&&Ee(n.data))return{message:n.message,data:n.data};if(typeof n=="object"){for(const e in n){const t=$i(n[e]);if(t)return t}return null}if(typeof n=="string")try{return $i(JSON.parse(n))}catch{}return null}function Gi(n,e){if(n!=null){if(typeof n.message=="string"&&e.push(n.message),typeof n=="object")for(const t in n)Gi(n[t],e);if(typeof n=="string")try{return Gi(JSON.parse(n),e)}catch{}}}function bd(n){const e=[];return Gi(n,e),e}var M0;class gd extends Dl{constructor(t,f){super(f,{batchMaxCount:1});I(this,M0,void 0);m(this,M0,async(r,s)=>{const i={method:r,params:s};this.emit("debug",{action:"sendEip1193Request",payload:i});try{const o=await t.request(i);return this.emit("debug",{action:"receiveEip1193Result",result:o}),o}catch(o){const a=new Error(o.message);throw a.code=o.code,a.data=o.data,a.payload=i,this.emit("debug",{action:"receiveEip1193Error",error:a}),a}})}async send(t,f){return await this._start(),await super.send(t,f)}async _send(t){A(!Array.isArray(t),"EIP-1193 does not support batch request","payload",t);try{const f=await d(this,M0).call(this,t.method,t.params||[]);return[{id:t.id,result:f}]}catch(f){return[{id:t.id,error:{code:f.code,data:f.data,message:f.message}}]}}getRpcError(t,f){switch(f=JSON.parse(JSON.stringify(f)),f.error.code||-1){case 4001:f.error.message=`ethers-user-denied: ${f.error.message}`;break;case 4200:f.error.message=`ethers-unsupported: ${f.error.message}`;break}return super.getRpcError(t,f)}async hasSigner(t){t==null&&(t=0);const f=await this.send("eth_accounts",[]);return typeof t=="number"?f.length>t:(t=t.toLowerCase(),f.filter(r=>r.toLowerCase()===t).length!==0)}async getSigner(t){if(t==null&&(t=0),!await this.hasSigner(t))try{await d(this,M0).call(this,"eth_requestAccounts",[])}catch(f){const r=f.payload;throw this.getRpcError(r,{id:r.id,error:f})}return await super.getSigner(t)}}M0=new WeakMap;var et=(n=>(n[n.Unlogged=0]="Unlogged",n[n.MetamaskConnectec=1]="MetamaskConnectec",n[n.CreatingOrder=2]="CreatingOrder",n[n.JoiningOrder=3]="JoiningOrder",n[n.ReturningToOrder=4]="ReturningToOrder",n[n.OrderCreated=5]="OrderCreated",n[n.OrderJoined=6]="OrderJoined",n))(et||{}),se=(n=>(n[n.WaitingForPartnerJoin=0]="WaitingForPartnerJoin",n[n.AllowingAutonomousSwap=1]="AllowingAutonomousSwap",n[n.WaitingPartnerAllowance=2]="WaitingPartnerAllowance",n[n.SendingTokens=3]="SendingTokens",n[n.WaitingPartnersTransfer=4]="WaitingPartnersTransfer",n[n.Completed=5]="Completed",n))(se||{}),ie=(n=>(n[n.WaitingFirstConfirmation=0]="WaitingFirstConfirmation",n[n.AllowingAutonomousSwap=1]="AllowingAutonomousSwap",n[n.WaitingCreatorAllowance=2]="WaitingCreatorAllowance",n[n.WaitingCreatorsFunding=3]="WaitingCreatorsFunding",n[n.SendingTokens=4]="SendingTokens",n[n.Completed=5]="Completed",n))(ie||{});function md(n){let e,t,f,r,s,i,o,a,c,l,u,h,p,b;const g=n[1].default,y=Tn(g,n,n[0],null);return{c(){e=T("main"),t=T("div"),f=T("main"),r=T("div"),s=T("div"),i=T("div"),i.innerHTML='Illustration',o=Q(),a=T("div"),a.innerHTML='Illustration',c=Q(),l=T("div"),l.innerHTML='',u=Q(),y&&y.c(),h=Q(),p=T("footer"),p.innerHTML='Made by Thiagodeev - 2023',S(i,"class","absolute top-0 left-0 rotate-180 -translate-x-3/4 -scale-x-100 blur-3xl opacity-70 pointer-events-none"),S(i,"aria-hidden","true"),S(a,"class","absolute top-0 right-0 -translate-y-1/2 translate-x-1/4 blur-3xl opacity-70 pointer-events-none"),S(a,"aria-hidden","true"),S(l,"class","absolute inset-0 pointer-events-none"),S(l,"aria-hidden","true"),S(s,"class","text-center"),S(r,"class","w-full max-w-6xl mx-auto px-4 md:px-6 py-24"),S(f,"class","relative min-h-screen flex flex-col justify-center bg-[#060213] overflow-hidden"),S(p,"class","absolute left-6 right-6 md:left-12 md:right-auto bottom-4 md:bottom-8 text-center md:text-left"),S(t,"class","relative font-inter antialiased")},m(w,_){F(w,e,_),E(e,t),E(t,f),E(f,r),E(r,s),E(s,i),E(s,o),E(s,a),E(s,c),E(s,l),E(s,u),y&&y.m(s,null),E(t,h),E(t,p),b=!0},p(w,[_]){y&&y.p&&(!b||_&1)&&_n(y,g,w,w[0],b?In(g,w[0],_,null):Nn(w[0]),null)},i(w){b||(O(y,w),b=!0)},o(w){R(y,w),b=!1},d(w){w&&B(e),y&&y.d(w)}}}function yd(n,e,t){let{$$slots:f={},$$scope:r}=e;class s{constructor(o,{quantity:a=30,staticity:c=50,ease:l=50}={}){this.canvas=o,this.canvas&&(this.canvasContainer=this.canvas.parentElement,this.context=this.canvas.getContext("2d"),this.dpr=window.devicePixelRatio||1,this.settings={quantity:a,staticity:c,ease:l},this.circles=[],this.mouse={x:0,y:0},this.canvasSize={w:0,h:0},this.onMouseMove=this.onMouseMove.bind(this),this.initCanvas=this.initCanvas.bind(this),this.resizeCanvas=this.resizeCanvas.bind(this),this.drawCircle=this.drawCircle.bind(this),this.drawParticles=this.drawParticles.bind(this),this.remapValue=this.remapValue.bind(this),this.animate=this.animate.bind(this),this.init())}init(){this.initCanvas(),this.animate(),window.addEventListener("resize",this.initCanvas),window.addEventListener("mousemove",this.onMouseMove)}initCanvas(){this.resizeCanvas(),this.drawParticles()}onMouseMove(o){const{clientX:a,clientY:c}=o,l=this.canvas.getBoundingClientRect(),{w:u,h}=this.canvasSize,p=a-l.left-u/2,b=c-l.top-h/2;p-(u/2)&&b-(h/2)&&(this.mouse.x=p,this.mouse.y=b)}resizeCanvas(){this.circles.length=0,this.canvasSize.w=this.canvasContainer.offsetWidth,this.canvasSize.h=this.canvasContainer.offsetHeight,this.canvas.width=this.canvasSize.w*this.dpr,this.canvas.height=this.canvasSize.h*this.dpr,this.canvas.style.width=this.canvasSize.w+"px",this.canvas.style.height=this.canvasSize.h+"px",this.context.scale(this.dpr,this.dpr)}circleParams(){const o=Math.floor(Math.random()*this.canvasSize.w),a=Math.floor(Math.random()*this.canvasSize.h),c=0,l=0,u=Math.floor(Math.random()*2)+3,h=0,p=parseFloat((Math.random()*.6+.1).toFixed(1)),b=(Math.random()-.5)*.2,g=(Math.random()-.5)*.2,y=.1+Math.random()*4;return{x:o,y:a,translateX:c,translateY:l,size:u,alpha:h,targetAlpha:p,dx:b,dy:g,magnetism:y}}drawCircle(o,a=!1){const{x:c,y:l,translateX:u,translateY:h,size:p,alpha:b}=o;this.context.translate(u,h),this.context.beginPath(),this.context.arc(c,l,p,0,2*Math.PI),this.context.fillStyle=`rgba(255, 255, 255, ${b})`,this.context.fill(),this.context.setTransform(this.dpr,0,0,this.dpr,0,0),a||this.circles.push(o)}clearContext(){this.context.clearRect(0,0,this.canvasSize.w,this.canvasSize.h)}drawParticles(){this.clearContext();const o=this.settings.quantity;for(let a=0;a0?h:0}animate(){this.clearContext(),this.circles.forEach((o,a)=>{const l=[o.x+o.translateX-o.size,this.canvasSize.w-o.x-o.translateX-o.size,o.y+o.translateY-o.size,this.canvasSize.h-o.y-o.translateY-o.size].reduce((h,p)=>Math.min(h,p)),u=this.remapValue(l,0,20,0,1).toFixed(2);if(u>1?(o.alpha+=.02,o.alpha>o.targetAlpha&&(o.alpha=o.targetAlpha)):o.alpha=o.targetAlpha*u,o.x+=o.dx,o.y+=o.dy,o.translateX+=(this.mouse.x/(this.settings.staticity/o.magnetism)-o.translateX)/this.settings.ease,o.translateY+=(this.mouse.y/(this.settings.staticity/o.magnetism)-o.translateY)/this.settings.ease,o.x<-o.size||o.x>this.canvasSize.w+o.size||o.y<-o.size||o.y>this.canvasSize.h+o.size){this.circles.splice(a,1);const h=this.circleParams();this.drawCircle(h)}else this.drawCircle({...o,x:o.x,y:o.y,translateX:o.translateX,translateY:o.translateY,alpha:o.alpha},!0)}),window.requestAnimationFrame(this.animate)}}return qa(()=>{document.querySelectorAll("[data-particle-animation]").forEach(o=>{const a={quantity:o.dataset.particleQuantity,staticity:o.dataset.particleStaticity,ease:o.dataset.particleEase};new s(o,a)})}),n.$$set=i=>{"$$scope"in i&&t(0,r=i.$$scope)},[r,f]}class wd extends ve{constructor(e){super(),ke(this,e,yd,md,me,{})}}function Ad(n){let e,t,f,r,s,i;const o=n[2].default,a=Tn(o,n,n[1],null);return{c(){e=T("div"),t=T("a"),a&&a.c(),S(t,"class",f="inline-flex justify-center whitespace-nowrap rounded-lg bg-indigo-500 px-3.5 py-2.5 text-sm font-medium text-white shadow-sm shadow-indigo-950/10 hover:bg-indigo-600 focus-visible:outline-none focus-visible:ring focus-visible:ring-indigo-300 dark:focus-visible:ring-slate-600 transition-colors duration-150 group "+(n[0]?"relative -left-[50%] mt-3":"")),S(t,"href","#0")},m(c,l){F(c,e,l),E(e,t),a&&a.m(t,null),r=!0,s||(i=mn(e,"click",n[3]),s=!0)},p(c,[l]){a&&a.p&&(!r||l&2)&&_n(a,o,c,c[1],r?In(o,c[1],l,null):Nn(c[1]),null),(!r||l&1&&f!==(f="inline-flex justify-center whitespace-nowrap rounded-lg bg-indigo-500 px-3.5 py-2.5 text-sm font-medium text-white shadow-sm shadow-indigo-950/10 hover:bg-indigo-600 focus-visible:outline-none focus-visible:ring focus-visible:ring-indigo-300 dark:focus-visible:ring-slate-600 transition-colors duration-150 group "+(c[0]?"relative -left-[50%] mt-3":"")))&&S(t,"class",f)},i(c){r||(O(a,c),r=!0)},o(c){R(a,c),r=!1},d(c){c&&B(e),a&&a.d(c),s=!1,i()}}}function Ed(n,e,t){let{$$slots:f={},$$scope:r}=e,{isStep:s=!1}=e;function i(o){Os.call(this,n,o)}return n.$$set=o=>{"isStep"in o&&t(0,s=o.isStep),"$$scope"in o&&t(1,r=o.$$scope)},[s,r,f,i]}class zt extends ve{constructor(e){super(),ke(this,e,Ed,Ad,me,{isStep:0})}}function kd(n){let e,t,f,r,s,i,o,a,c,l;return{c(){e=T("div"),t=T("a"),t.innerHTML='Create a new Swap Order !!',f=Q(),r=T("div"),s=T("a"),s.textContent="Return to existing order",i=Q(),o=T("div"),a=T("a"),a.textContent="Join an existing swap",S(t,"class","inline-flex justify-center whitespace-nowrap rounded-lg bg-indigo-500 px-3.5 py-2.5 text-sm font-medium text-white shadow-sm shadow-indigo-950/10 hover:bg-indigo-600 focus-visible:outline-none focus-visible:ring focus-visible:ring-indigo-300 dark:focus-visible:ring-slate-600 transition-colors duration-150 group"),S(t,"href","#0"),S(s,"class","inline-flex justify-center whitespace-nowrap rounded-lg bg-slate-700 px-3.5 py-2.5 text-sm font-medium text-white shadow-sm shadow-indigo-950/10 hover:bg-slate-600 focus-visible:outline-none focus-visible:ring focus-visible:ring-indigo-300 dark:focus-visible:ring-slate-600 transition-colors duration-150"),S(s,"href","#0"),S(a,"class","inline-flex justify-center whitespace-nowrap rounded-lg bg-indigo-500 px-3.5 py-2.5 text-sm font-medium text-white shadow-sm shadow-indigo-950/10 hover:bg-indigo-600 focus-visible:outline-none focus-visible:ring focus-visible:ring-indigo-300 dark:focus-visible:ring-slate-600 transition-colors duration-150 group"),S(a,"href","#0")},m(u,h){F(u,e,h),E(e,t),F(u,f,h),F(u,r,h),E(r,s),F(u,i,h),F(u,o,h),E(o,a),c||(l=[mn(t,"click",n[4]),mn(s,"click",n[5]),mn(a,"click",n[6])],c=!0)},p:J,i:J,o:J,d(u){u&&B(e),u&&B(f),u&&B(r),u&&B(i),u&&B(o),c=!1,Cn(l)}}}function vd(n){let e,t;return e=new zt({props:{$$slots:{default:[xd]},$$scope:{ctx:n}}}),e.$on("click",n[3]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,r){const s={};r&256&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function xd(n){let e;return{c(){e=ne("Connect with Metamask")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function Cd(n){let e,t,f,r,s,i,o,a,c;const l=[vd,kd],u=[];function h(p,b){return p[0]==null?0:1}return o=h(n),a=u[o]=l[o](n),{c(){e=T("div"),t=T("h1"),t.innerHTML=`Autonomous + Swap`,f=Q(),r=T("div"),r.innerHTML='

An autonomous/decentralized swap app for tokens transfer between 2 parties without third-party intermediation :D

',s=Q(),i=T("div"),a.c(),S(t,"class","inline-flex font-extrabold text-5xl md:text-6xl bg-clip-text text-transparent bg-gradient-to-r from-slate-200/60 via-slate-200 to-slate-200/60 pb-4 justify-center flex-wrap"),S(r,"class","max-w-3xl mx-auto mb-8"),S(i,"class","inline-flex justify-center space-x-4"),S(e,"class","relative")},m(p,b){F(p,e,b),E(e,t),E(e,f),E(e,r),E(e,s),E(e,i),u[o].m(i,null),c=!0},p(p,[b]){let g=o;o=h(p),o===g?u[o].p(p,b):(de(),R(u[g],1,1,()=>{u[g]=null}),he(),a=u[o],a?a.p(p,b):(a=u[o]=l[o](p),a.c()),O(a,1),a.m(i,null))},i(p){c||(O(a),c=!0)},o(p){R(a),c=!1},d(p){p&&B(e),u[o].d()}}}function Td(n,e,t){let f,r,s;K(n,ft,u=>t(7,f=u)),K(n,dr,u=>t(0,r=u)),K(n,At,u=>t(1,s=u));async function i(){const h=await new gd(window.ethereum).getSigner();return console.log("Account:",await h.getAddress()),console.log("Token erc20:","0x2E6dd9771E607259F9F52AcD2A99Ba7A6483952d"),ft.update(p=>p.connect(h)),console.log(f),h}return[r,s,i,async()=>te(dr,r=await i(),r),()=>te(At,s=et.CreatingOrder,s),()=>te(At,s=et.ReturningToOrder,s),()=>te(At,s=et.JoiningOrder,s)]}class Id extends ve{constructor(e){super(),ke(this,e,Td,Cd,me,{})}}function _d(n){let e,t,f;const r=n[1].default,s=Tn(r,n,n[0],null);return{c(){e=T("div"),t=T("section"),s&&s.c(),S(t,"class","w-full bg-white rounded-2xl shadow-xl min-[480px]:flex items-stretch focus-visible:outline-none focus-visible:ring focus-visible:ring-indigo-300 p-5 flex-col"),S(e,"class","w-full max-w-6xl mx-auto px-4 md:px-6 py-24")},m(i,o){F(i,e,o),E(e,t),s&&s.m(t,null),f=!0},p(i,[o]){s&&s.p&&(!f||o&1)&&_n(s,r,i,i[0],f?In(r,i[0],o,null):Nn(i[0]),null)},i(i){f||(O(s,i),f=!0)},o(i){R(s,i),f=!1},d(i){i&&B(e),s&&s.d(i)}}}function Nd(n,e,t){let{$$slots:f={},$$scope:r}=e;return n.$$set=s=>{"$$scope"in s&&t(0,r=s.$$scope)},[r,f]}class zs extends ve{constructor(e){super(),ke(this,e,Nd,_d,me,{})}}function Oa(n){let e;return{c(){e=T("div"),e.innerHTML=``,S(e,"class","relative mb-3")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function Sa(n){let e;return{c(){e=T("div"),e.innerHTML=``,S(e,"class","relative mb-3")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function Ra(n){let e;return{c(){e=T("div"),e.innerHTML=``,S(e,"class","relative mb-3")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function Pd(n){let e,t,f,r,s,i,o,a,c,l,u,h,p,b,g,y,w,_,U,M,k,v=(n[1]==n[2].ERC721||n[1]==n[2].ERC1155)&&Oa(),x=(n[1]==n[2].ERC20||n[1]==n[2].ERC1155)&&Sa(),N=n[0]&&Ra();return{c(){e=T("div"),t=T("form"),f=T("div"),r=T("label"),r.textContent="Select the token type:",s=Q(),i=T("select"),o=T("option"),a=ne("ERC20"),c=T("option"),l=ne("ERC721"),u=T("option"),h=ne("ERC1155"),p=Q(),b=T("div"),b.innerHTML=``,g=Q(),v&&v.c(),y=Q(),x&&x.c(),w=Q(),N&&N.c(),_=Q(),U=T("button"),U.textContent="Submit",S(r,"for","HeadlineAct"),S(r,"class","block text-sm font-medium text-gray-900"),o.__value=n[2].ERC20,o.value=o.__value,c.__value=n[2].ERC721,c.value=c.__value,u.__value=n[2].ERC1155,u.value=u.__value,S(i,"name","HeadlineAct"),S(i,"id","HeadlineAct"),n[1]===void 0&&as(()=>n[4].call(i)),S(b,"class","relative mb-3 mt-3"),S(f,"class","relative mb-12"),S(U,"type","submit"),S(U,"class","inline-block rounded border border-indigo-600 bg-indigo-600 px-12 py-3 text-sm font-medium text-white hover:bg-transparent hover:text-indigo-600 focus:outline-none focus:ring active:text-indigo-500")},m(z,V){F(z,e,V),E(e,t),E(t,f),E(f,r),E(f,s),E(f,i),E(i,o),E(o,a),E(i,c),E(c,l),E(i,u),E(u,h),mo(i,n[1],!0),E(f,p),E(f,b),E(f,g),v&&v.m(f,null),E(f,y),x&&x.m(f,null),E(f,w),N&&N.m(f,null),E(t,_),E(t,U),M||(k=[mn(i,"change",n[4]),mn(t,"submit",ja(n[3]))],M=!0)},p(z,[V]){V&6&&mo(i,z[1]),z[1]==z[2].ERC721||z[1]==z[2].ERC1155?v||(v=Oa(),v.c(),v.m(f,y)):v&&(v.d(1),v=null),z[1]==z[2].ERC20||z[1]==z[2].ERC1155?x||(x=Sa(),x.c(),x.m(f,w)):x&&(x.d(1),x=null),z[0]?N||(N=Ra(),N.c(),N.m(f,null)):N&&(N.d(1),N=null)},i:J,o:J,d(z){z&&B(e),v&&v.d(),x&&x.d(),N&&N.d(),M=!1,Cn(k)}}}function Od(n,e,t){let{isJoining:f=!1}=e,r,s={ERC20:"0xec20ec20",ERC721:"0x80ac58cd",ERC1155:"0xd9b67a26"};function i(a){Os.call(this,n,a)}function o(){r=Yl(this),t(1,r),t(2,s)}return n.$$set=a=>{"isJoining"in a&&t(0,f=a.isJoining)},[f,r,s,i,o]}class Ll extends ve{constructor(e){super(),ke(this,e,Od,Pd,me,{isJoining:0})}}function Sd(n){let e,t,f,r;return f=new Ll({}),f.$on("submit",n[0]),{c(){e=T("h1"),e.textContent="Order creation",t=Q(),X(f.$$.fragment),S(e,"class","text-4xl font-bold text-slate-900 mb-8")},m(s,i){F(s,e,i),F(s,t,i),Z(f,s,i),r=!0},p:J,i(s){r||(O(f.$$.fragment,s),r=!0)},o(s){R(f.$$.fragment,s),r=!1},d(s){s&&B(e),s&&B(t),Y(f,s)}}}function Rd(n){let e,t;return e=new zs({props:{$$slots:{default:[Sd]},$$scope:{ctx:n}}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,[r]){const s={};r&64&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Bd(n,e,t){let f,r;K(n,At,c=>t(2,f=c)),K(n,ge,c=>t(3,r=c));let s;const i=ft.subscribe(c=>{s=c});K0(i);let o={ERC20:"0xec20ec20",ERC721:"0x80ac58cd",ERC1155:"0xd9b67a26"};async function a(c){const l=c.target.elements,u=l[0].value;let h=l[1].value,p=0,b=0;u==o.ERC20?b=l[2].value:u==o.ERC721?p=l[2].value:(p=l[2].value,b=l[3].value);let g;g=[h,p,b];const _=(await(await s.createOrder(...g)).wait()).logs[0],U={topics:[..._.topics],data:_.data},M=s.interface.parseLog(U).args;console.log(M),Ue.update(()=>({orderId:M.orderId,creator:M.who,isActive:!0,isCreator:!0})),df.update(()=>({token:h,interfaceID:u,tokenId:p,quantity:b,individualStatus:M.newStatus})),te(ge,r=se.WaitingForPartnerJoin,r),te(At,f=et.OrderCreated,f)}return[a]}class Fd extends ve{constructor(e){super(),ke(this,e,Bd,Rd,me,{})}}const Ud="hh-sol-artifact-1",Dd="AutonomousSwap",Ld="contracts/AutonomousSwap_flattened.sol",Md=[{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC1155InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"owner",type:"address"}],name:"ERC1155MissingApprovalForAll",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"allowance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientAllowance",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"owner",type:"address"}],name:"ERC721IncorrectOwner",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC721InsufficientApproval",type:"error"},{inputs:[{internalType:"address",name:"who",type:"address"},{internalType:"enum AutonomousSwap.Status",name:"current",type:"uint8"},{internalType:"enum AutonomousSwap.Status",name:"needed",type:"uint8"}],name:"InvalidCurrentStatus",type:"error"},{inputs:[{internalType:"address",name:"tokenAddress",type:"address"}],name:"InvalidToken",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"},{internalType:"address",name:"creator",type:"address"}],name:"MustBeTheCreator",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"},{internalType:"address",name:"creator",type:"address"}],name:"MustBeThePartner",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"orderId",type:"bytes32"},{indexed:!0,internalType:"address",name:"who",type:"address"},{indexed:!0,internalType:"enum AutonomousSwap.Status",name:"newStatus",type:"uint8"}],name:"StepCompleted",type:"event"},{inputs:[{internalType:"bytes32",name:"orderId",type:"bytes32"}],name:"cancelOrder",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"createOrder",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"orderId",type:"bytes32"}],name:"getOrderMembersById",outputs:[{internalType:"address",name:"creator",type:"address"},{internalType:"address",name:"partner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"bytes32",name:"orderId",type:"bytes32"}],name:"getSubOrderByUser",outputs:[{components:[{internalType:"address",name:"token",type:"address"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"enum AutonomousSwap.Status",name:"individualStatus",type:"uint8"}],internalType:"struct AutonomousSwap.SubOrder",name:"subOrder",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderId",type:"bytes32"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"joinsOrder",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderId",type:"bytes32"}],name:"transferFundsToSwap",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"orderId",type:"bytes32"}],name:"validateAndCompleteTheSwap",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],$d="0x608060405234801561001057600080fd5b506133f4806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063acfee8ed11610071578063acfee8ed1461019e578063b6d3115c146101ce578063bc197c81146101ff578063d90429c21461022f578063e3faa9061461025f578063f23a6e611461028f576100a9565b806301ffc9a7146100ae578063150b7a02146100de578063574ad5d01461010e5780637489ec231461013e5780637e7e5fcb1461016e575b600080fd5b6100c860048036038101906100c3919061264c565b6102bf565b6040516100d59190612694565b60405180910390f35b6100f860048036038101906100f39190612889565b610339565b604051610105919061291b565b60405180910390f35b6101286004803603810190610123919061296c565b61034d565b6040516101359190612694565b60405180910390f35b610158600480360381019061015391906129d3565b6106f0565b6040516101659190612694565b60405180910390f35b610188600480360381019061018391906129d3565b610a04565b6040516101959190612694565b60405180910390f35b6101b860048036038101906101b39190612a00565b610fe4565b6040516101c59190612694565b60405180910390f35b6101e860048036038101906101e391906129d3565b61128f565b6040516101f6929190612a62565b60405180910390f35b61021960048036038101906102149190612b53565b611307565b604051610226919061291b565b60405180910390f35b610249600480360381019061024491906129d3565b61131c565b6040516102569190612694565b60405180910390f35b61027960048036038101906102749190612c22565b61185e565b6040516102869190612d6e565b60405180910390f35b6102a960048036038101906102a49190612d89565b6119c3565b6040516102b6919061291b565b60405180910390f35b60007f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806103325750610331826119d8565b5b9050919050565b600063150b7a0260e01b9050949350505050565b6000846001151560008083815260200190815260200160002060010160149054906101000a900460ff161515146103b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103b090612e7d565b60405180910390fd5b6000806103c58861128f565b91509150600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610438576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042f90612f0f565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049d90612fa1565b60405180910390fd5b60006104b188611a42565b90506104c233898989856000611b8e565b50336000808b815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040518060a001604052808973ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018881526020018781526020016001600481111561058357610582612c8f565b5b815250600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008b815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908360e01c0217905550604082015181600101556060820151816002015560808201518160030160006101000a81548160ff021916908360048111156106805761067f612c8f565b5b02179055509050506001600481111561069c5761069b612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff168a7f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a46001945050505050949350505050565b6000816001151560008083815260200190815260200160002060010160149054906101000a900460ff1615151461075c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075390612e7d565b60405180910390fd5b6000610767846120da565b90503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db5733816040517f785238870000000000000000000000000000000000000000000000000000000081526004016107d2929190612a62565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff16600481111561091c5761091b612c8f565b5b600481111561092e5761092d612c8f565b5b8152505090506002600481111561094857610947612c8f565b5b8160800151600481111561095f5761095e612c8f565b5b03610973576109718130336000612119565b505b600080600087815260200190815260200160002060010160146101000a81548160ff0219169083151502179055506004808111156109b4576109b3612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff16867f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a460019350505050919050565b6000816001151560008083815260200190815260200160002060010160149054906101000a900460ff16151514610a70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6790612e7d565b60405180910390fd5b600080610a7c8561128f565b915091503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610af25733826040517f78523887000000000000000000000000000000000000000000000000000000008152600401610ae9929190612a62565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008781526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff166004811115610c3357610c32612c8f565b5b6004811115610c4557610c44612c8f565b5b81525050905060016004811115610c5f57610c5e612c8f565b5b81608001516004811115610c7657610c75612c8f565b5b14610cc15781816080015160016040517f7bfd2d90000000000000000000000000000000000000000000000000000000008152600401610cb893929190612fd0565b60405180910390fd5b6000610ce28383600001518460400151856060015186602001516001611b8e565b905080610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b90613079565b60405180910390fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008981526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff166004811115610e6557610e64612c8f565b5b6004811115610e7757610e76612c8f565b5b81525050905060016004811115610e9157610e90612c8f565b5b81608001516004811115610ea857610ea7612c8f565b5b14610ef35733816080015160016040517f7bfd2d90000000000000000000000000000000000000000000000000000000008152600401610eea93929190612fd0565b60405180910390fd5b610f008133306001612119565b506002600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060030160006101000a81548160ff02191690836004811115610f7857610f77612c8f565b5b021790555060026004811115610f9157610f90612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff16897f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a460019650505050505050919050565b600080610ff085611a42565b905061100133868686856000611b8e565b506000428686863a3360405160200161101f969594939291906130a8565b6040516020818303038152906040528051906020012090503360008083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160008083815260200190815260200160002060010160146101000a81548160ff0219169083151502179055506040518060a001604052808773ffffffffffffffffffffffffffffffffffffffff168152602001837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018681526020018581526020016001600481111561112557611124612c8f565b5b815250600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908360e01c0217905550604082015181600101556060820151816002015560808201518160030160006101000a81548160ff0219169083600481111561122257611221612c8f565b5b02179055509050506001600481111561123e5761123d612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff16827f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a46001925050509392505050565b60008060008084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008085815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691509150915091565b600063bc197c8160e01b905095945050505050565b6000816001151560008083815260200190815260200160002060010160149054906101000a900460ff16151514611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612e7d565b60405180910390fd5b6000806113948561128f565b915091503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461140a5733816040517fefbd129a000000000000000000000000000000000000000000000000000000008152600401611401929190612a62565b60405180910390fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008781526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff16600481111561154b5761154a612c8f565b5b600481111561155d5761155c612c8f565b5b8152505090506002600481111561157757611576612c8f565b5b8160800151600481111561158e5761158d612c8f565b5b146115d95782816080015160026040517f7bfd2d900000000000000000000000000000000000000000000000000000000081526004016115d093929190612fd0565b60405180910390fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008881526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff16600481111561171a57611719612c8f565b5b600481111561172c5761172b612c8f565b5b81525050905061173f8133866001612119565b5061174d8230336000612119565b506003600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600089815260200190815260200160002060030160006101000a81548160ff021916908360048111156117c5576117c4612c8f565b5b0217905550600080600089815260200190815260200160002060010160146101000a81548160ff0219169083151502179055506003600481111561180c5761180b612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff16887f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a4600195505050505050919050565b61186661256a565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff1660048111156119a5576119a4612c8f565b5b60048111156119b7576119b6612c8f565b5b81525050905092915050565b600063f23a6e6160e01b905095945050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600080611a4e836123e3565b611a8f57826040517f961c9a4f000000000000000000000000000000000000000000000000000000008152600401611a869190613109565b60405180910390fd5b611a98836123fc565b15611b2a57611aae836380ac58cd60e01b612449565b15611ac2576380ac58cd60e01b9050611b25565b611ad38363d9b67a2660e01b612449565b15611ae75763d9b67a2660e01b9050611b24565b826040517f961c9a4f000000000000000000000000000000000000000000000000000000008152600401611b1b9190613109565b60405180910390fd5b5b611b85565b611b33836124e8565b15611b475763ec20ec2060e01b9050611b84565b826040517f961c9a4f000000000000000000000000000000000000000000000000000000008152600401611b7b9190613109565b60405180910390fd5b5b80915050919050565b600080600063ec20ec2060e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603611d4f578315611c80578773ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e8a306040518363ffffffff1660e01b8152600401611c20929190612a62565b602060405180830381865afa158015611c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c619190613139565b9150858210611c75576001925050506120d0565b6000925050506120d0565b8773ffffffffffffffffffffffffffffffffffffffff166370a082318a6040518263ffffffff1660e01b8152600401611cb99190613109565b602060405180830381865afa158015611cd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfa9190613139565b9150858210611d0e576001925050506120d0565b8882876040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401611d4693929190613166565b60405180910390fd5b6380ac58cd60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603611f61578315611e66578773ffffffffffffffffffffffffffffffffffffffff1663081812fc886040518263ffffffff1660e01b8152600401611dda919061319d565b602060405180830381865afa158015611df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1b91906131cd565b90508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611e5b576001925050506120d0565b6000925050506120d0565b8773ffffffffffffffffffffffffffffffffffffffff16636352211e886040518263ffffffff1660e01b8152600401611e9f919061319d565b602060405180830381865afa158015611ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee091906131cd565b90508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611f20576001925050506120d0565b8887826040517f64283d7b000000000000000000000000000000000000000000000000000000008152600401611f58939291906131fa565b60405180910390fd5b8315611ffe578773ffffffffffffffffffffffffffffffffffffffff1663e985e9c58a306040518363ffffffff1660e01b8152600401611fa2929190612a62565b602060405180830381865afa158015611fbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe3919061325d565b15611ff3576001925050506120d0565b6000925050506120d0565b8773ffffffffffffffffffffffffffffffffffffffff1662fdd58e8a896040518363ffffffff1660e01b815260040161203892919061328a565b602060405180830381865afa158015612055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120799190613139565b915085821061208d576001925050506120d0565b888287896040517f03dee4c50000000000000000000000000000000000000000000000000000000081526004016120c794939291906132b3565b60405180910390fd5b9695505050505050565b600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600063ec20ec2060e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191685602001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361228c5781156121ff57846000015173ffffffffffffffffffffffffffffffffffffffff166323b872dd858588606001516040518463ffffffff1660e01b81526004016121b6939291906132f8565b6020604051808303816000875af11580156121d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f9919061325d565b50612287565b846000015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8487606001516040518363ffffffff1660e01b815260040161224292919061328a565b6020604051808303816000875af1158015612261573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612285919061325d565b505b6123d7565b6380ac58cd60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191685602001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361235857846000015173ffffffffffffffffffffffffffffffffffffffff166342842e0e858588604001516040518463ffffffff1660e01b8152600401612321939291906132f8565b600060405180830381600087803b15801561233b57600080fd5b505af115801561234f573d6000803e3d6000fd5b505050506123d6565b846000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a8585886040015189606001516040518563ffffffff1660e01b81526004016123a39493929190613366565b600060405180830381600087803b1580156123bd57600080fd5b505af11580156123d1573d6000803e3d6000fd5b505050505b5b60019050949350505050565b600080823b905060008163ffffffff1611915050919050565b6000612428827f01ffc9a700000000000000000000000000000000000000000000000000000000612449565b801561244257506124408263ffffffff60e01b612449565b155b9050919050565b6000808260405160240161245d919061291b565b6040516020818303038152906040526301ffc9a760e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000806000602060008551602087018a617530fa92503d915060005190508280156124d0575060208210155b80156124dc5750600081115b94505050505092915050565b60008173ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561255257506040513d601f19601f8201168201806040525081019061254f9190613139565b60015b61255f5760009050612565565b60019150505b919050565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020016000815260200160008152602001600060048111156125da576125d9612c8f565b5b81525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612629816125f4565b811461263457600080fd5b50565b60008135905061264681612620565b92915050565b600060208284031215612662576126616125ea565b5b600061267084828501612637565b91505092915050565b60008115159050919050565b61268e81612679565b82525050565b60006020820190506126a96000830184612685565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006126da826126af565b9050919050565b6126ea816126cf565b81146126f557600080fd5b50565b600081359050612707816126e1565b92915050565b6000819050919050565b6127208161270d565b811461272b57600080fd5b50565b60008135905061273d81612717565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6127968261274d565b810181811067ffffffffffffffff821117156127b5576127b461275e565b5b80604052505050565b60006127c86125e0565b90506127d4828261278d565b919050565b600067ffffffffffffffff8211156127f4576127f361275e565b5b6127fd8261274d565b9050602081019050919050565b82818337600083830152505050565b600061282c612827846127d9565b6127be565b90508281526020810184848401111561284857612847612748565b5b61285384828561280a565b509392505050565b600082601f8301126128705761286f612743565b5b8135612880848260208601612819565b91505092915050565b600080600080608085870312156128a3576128a26125ea565b5b60006128b1878288016126f8565b94505060206128c2878288016126f8565b93505060406128d38782880161272e565b925050606085013567ffffffffffffffff8111156128f4576128f36125ef565b5b6129008782880161285b565b91505092959194509250565b612915816125f4565b82525050565b6000602082019050612930600083018461290c565b92915050565b6000819050919050565b61294981612936565b811461295457600080fd5b50565b60008135905061296681612940565b92915050565b60008060008060808587031215612986576129856125ea565b5b600061299487828801612957565b94505060206129a5878288016126f8565b93505060406129b68782880161272e565b92505060606129c78782880161272e565b91505092959194509250565b6000602082840312156129e9576129e86125ea565b5b60006129f784828501612957565b91505092915050565b600080600060608486031215612a1957612a186125ea565b5b6000612a27868287016126f8565b9350506020612a388682870161272e565b9250506040612a498682870161272e565b9150509250925092565b612a5c816126cf565b82525050565b6000604082019050612a776000830185612a53565b612a846020830184612a53565b9392505050565b600067ffffffffffffffff821115612aa657612aa561275e565b5b602082029050602081019050919050565b600080fd5b6000612acf612aca84612a8b565b6127be565b90508083825260208201905060208402830185811115612af257612af1612ab7565b5b835b81811015612b1b5780612b07888261272e565b845260208401935050602081019050612af4565b5050509392505050565b600082601f830112612b3a57612b39612743565b5b8135612b4a848260208601612abc565b91505092915050565b600080600080600060a08688031215612b6f57612b6e6125ea565b5b6000612b7d888289016126f8565b9550506020612b8e888289016126f8565b945050604086013567ffffffffffffffff811115612baf57612bae6125ef565b5b612bbb88828901612b25565b935050606086013567ffffffffffffffff811115612bdc57612bdb6125ef565b5b612be888828901612b25565b925050608086013567ffffffffffffffff811115612c0957612c086125ef565b5b612c158882890161285b565b9150509295509295909350565b60008060408385031215612c3957612c386125ea565b5b6000612c47858286016126f8565b9250506020612c5885828601612957565b9150509250929050565b612c6b816126cf565b82525050565b612c7a816125f4565b82525050565b612c898161270d565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60058110612ccf57612cce612c8f565b5b50565b6000819050612ce082612cbe565b919050565b6000612cf082612cd2565b9050919050565b612d0081612ce5565b82525050565b60a082016000820151612d1c6000850182612c62565b506020820151612d2f6020850182612c71565b506040820151612d426040850182612c80565b506060820151612d556060850182612c80565b506080820151612d686080850182612cf7565b50505050565b600060a082019050612d836000830184612d06565b92915050565b600080600080600060a08688031215612da557612da46125ea565b5b6000612db3888289016126f8565b9550506020612dc4888289016126f8565b9450506040612dd58882890161272e565b9350506060612de68882890161272e565b925050608086013567ffffffffffffffff811115612e0757612e066125ef565b5b612e138882890161285b565b9150509295509295909350565b600082825260208201905092915050565b7f54686973206f72646572206973206e6f74206163746976652e00000000000000600082015250565b6000612e67601983612e20565b9150612e7282612e31565b602082019050919050565b60006020820190508181036000830152612e9681612e5a565b9050919050565b7f416e206164647265737320616c7265616479206a6f696e65642074686973206f60008201527f726465722e000000000000000000000000000000000000000000000000000000602082015250565b6000612ef9602583612e20565b9150612f0482612e9d565b604082019050919050565b60006020820190508181036000830152612f2881612eec565b9050919050565b7f596f752061726520616c7265616479207468652063726561746f72206f66207460008201527f6865206f726465722e0000000000000000000000000000000000000000000000602082015250565b6000612f8b602983612e20565b9150612f9682612f2f565b604082019050919050565b60006020820190508181036000830152612fba81612f7e565b9050919050565b612fca81612ce5565b82525050565b6000606082019050612fe56000830186612a53565b612ff26020830185612fc1565b612fff6040830184612fc1565b949350505050565b7f54686520706172746e657220646964206e6f7420616c6c6f772074686520626160008201527f6c616e63652e0000000000000000000000000000000000000000000000000000602082015250565b6000613063602683612e20565b915061306e82613007565b604082019050919050565b6000602082019050818103600083015261309281613056565b9050919050565b6130a28161270d565b82525050565b600060c0820190506130bd6000830189613099565b6130ca6020830188612a53565b6130d76040830187613099565b6130e46060830186613099565b6130f16080830185613099565b6130fe60a0830184612a53565b979650505050505050565b600060208201905061311e6000830184612a53565b92915050565b60008151905061313381612717565b92915050565b60006020828403121561314f5761314e6125ea565b5b600061315d84828501613124565b91505092915050565b600060608201905061317b6000830186612a53565b6131886020830185613099565b6131956040830184613099565b949350505050565b60006020820190506131b26000830184613099565b92915050565b6000815190506131c7816126e1565b92915050565b6000602082840312156131e3576131e26125ea565b5b60006131f1848285016131b8565b91505092915050565b600060608201905061320f6000830186612a53565b61321c6020830185613099565b6132296040830184612a53565b949350505050565b61323a81612679565b811461324557600080fd5b50565b60008151905061325781613231565b92915050565b600060208284031215613273576132726125ea565b5b600061328184828501613248565b91505092915050565b600060408201905061329f6000830185612a53565b6132ac6020830184613099565b9392505050565b60006080820190506132c86000830187612a53565b6132d56020830186613099565b6132e26040830185613099565b6132ef6060830184613099565b95945050505050565b600060608201905061330d6000830186612a53565b61331a6020830185612a53565b6133276040830184613099565b949350505050565b600082825260208201905092915050565b50565b600061335060008361332f565b915061335b82613340565b600082019050919050565b600060a08201905061337b6000830187612a53565b6133886020830186612a53565b6133956040830185613099565b6133a26060830184613099565b81810360808301526133b381613343565b90509594505050505056fea26469706673582212206be570ce3f43e6e93659568472e548988fdee62050b37f8467c92ae5954b80d964736f6c63430008140033",Gd="0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063acfee8ed11610071578063acfee8ed1461019e578063b6d3115c146101ce578063bc197c81146101ff578063d90429c21461022f578063e3faa9061461025f578063f23a6e611461028f576100a9565b806301ffc9a7146100ae578063150b7a02146100de578063574ad5d01461010e5780637489ec231461013e5780637e7e5fcb1461016e575b600080fd5b6100c860048036038101906100c3919061264c565b6102bf565b6040516100d59190612694565b60405180910390f35b6100f860048036038101906100f39190612889565b610339565b604051610105919061291b565b60405180910390f35b6101286004803603810190610123919061296c565b61034d565b6040516101359190612694565b60405180910390f35b610158600480360381019061015391906129d3565b6106f0565b6040516101659190612694565b60405180910390f35b610188600480360381019061018391906129d3565b610a04565b6040516101959190612694565b60405180910390f35b6101b860048036038101906101b39190612a00565b610fe4565b6040516101c59190612694565b60405180910390f35b6101e860048036038101906101e391906129d3565b61128f565b6040516101f6929190612a62565b60405180910390f35b61021960048036038101906102149190612b53565b611307565b604051610226919061291b565b60405180910390f35b610249600480360381019061024491906129d3565b61131c565b6040516102569190612694565b60405180910390f35b61027960048036038101906102749190612c22565b61185e565b6040516102869190612d6e565b60405180910390f35b6102a960048036038101906102a49190612d89565b6119c3565b6040516102b6919061291b565b60405180910390f35b60007f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806103325750610331826119d8565b5b9050919050565b600063150b7a0260e01b9050949350505050565b6000846001151560008083815260200190815260200160002060010160149054906101000a900460ff161515146103b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103b090612e7d565b60405180910390fd5b6000806103c58861128f565b91509150600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610438576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042f90612f0f565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049d90612fa1565b60405180910390fd5b60006104b188611a42565b90506104c233898989856000611b8e565b50336000808b815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040518060a001604052808973ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018881526020018781526020016001600481111561058357610582612c8f565b5b815250600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008b815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908360e01c0217905550604082015181600101556060820151816002015560808201518160030160006101000a81548160ff021916908360048111156106805761067f612c8f565b5b02179055509050506001600481111561069c5761069b612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff168a7f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a46001945050505050949350505050565b6000816001151560008083815260200190815260200160002060010160149054906101000a900460ff1615151461075c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075390612e7d565b60405180910390fd5b6000610767846120da565b90503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107db5733816040517f785238870000000000000000000000000000000000000000000000000000000081526004016107d2929190612a62565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff16600481111561091c5761091b612c8f565b5b600481111561092e5761092d612c8f565b5b8152505090506002600481111561094857610947612c8f565b5b8160800151600481111561095f5761095e612c8f565b5b03610973576109718130336000612119565b505b600080600087815260200190815260200160002060010160146101000a81548160ff0219169083151502179055506004808111156109b4576109b3612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff16867f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a460019350505050919050565b6000816001151560008083815260200190815260200160002060010160149054906101000a900460ff16151514610a70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6790612e7d565b60405180910390fd5b600080610a7c8561128f565b915091503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610af25733826040517f78523887000000000000000000000000000000000000000000000000000000008152600401610ae9929190612a62565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008781526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff166004811115610c3357610c32612c8f565b5b6004811115610c4557610c44612c8f565b5b81525050905060016004811115610c5f57610c5e612c8f565b5b81608001516004811115610c7657610c75612c8f565b5b14610cc15781816080015160016040517f7bfd2d90000000000000000000000000000000000000000000000000000000008152600401610cb893929190612fd0565b60405180910390fd5b6000610ce28383600001518460400151856060015186602001516001611b8e565b905080610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b90613079565b60405180910390fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008981526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff166004811115610e6557610e64612c8f565b5b6004811115610e7757610e76612c8f565b5b81525050905060016004811115610e9157610e90612c8f565b5b81608001516004811115610ea857610ea7612c8f565b5b14610ef35733816080015160016040517f7bfd2d90000000000000000000000000000000000000000000000000000000008152600401610eea93929190612fd0565b60405180910390fd5b610f008133306001612119565b506002600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a815260200190815260200160002060030160006101000a81548160ff02191690836004811115610f7857610f77612c8f565b5b021790555060026004811115610f9157610f90612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff16897f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a460019650505050505050919050565b600080610ff085611a42565b905061100133868686856000611b8e565b506000428686863a3360405160200161101f969594939291906130a8565b6040516020818303038152906040528051906020012090503360008083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160008083815260200190815260200160002060010160146101000a81548160ff0219169083151502179055506040518060a001604052808773ffffffffffffffffffffffffffffffffffffffff168152602001837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018681526020018581526020016001600481111561112557611124612c8f565b5b815250600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548163ffffffff021916908360e01c0217905550604082015181600101556060820151816002015560808201518160030160006101000a81548160ff0219169083600481111561122257611221612c8f565b5b02179055509050506001600481111561123e5761123d612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff16827f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a46001925050509392505050565b60008060008084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008085815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691509150915091565b600063bc197c8160e01b905095945050505050565b6000816001151560008083815260200190815260200160002060010160149054906101000a900460ff16151514611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612e7d565b60405180910390fd5b6000806113948561128f565b915091503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461140a5733816040517fefbd129a000000000000000000000000000000000000000000000000000000008152600401611401929190612a62565b60405180910390fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008781526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff16600481111561154b5761154a612c8f565b5b600481111561155d5761155c612c8f565b5b8152505090506002600481111561157757611576612c8f565b5b8160800151600481111561158e5761158d612c8f565b5b146115d95782816080015160026040517f7bfd2d900000000000000000000000000000000000000000000000000000000081526004016115d093929190612fd0565b60405180910390fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008881526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff16600481111561171a57611719612c8f565b5b600481111561172c5761172b612c8f565b5b81525050905061173f8133866001612119565b5061174d8230336000612119565b506003600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600089815260200190815260200160002060030160006101000a81548160ff021916908360048111156117c5576117c4612c8f565b5b0217905550600080600089815260200190815260200160002060010160146101000a81548160ff0219169083151502179055506003600481111561180c5761180b612c8f565b5b3373ffffffffffffffffffffffffffffffffffffffff16887f57959618905156d60d1a9626b5d330d279a14310d8dfdd56aefc56bbca539e2760405160405180910390a4600195505050505050919050565b61186661256a565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a900460e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff1660048111156119a5576119a4612c8f565b5b60048111156119b7576119b6612c8f565b5b81525050905092915050565b600063f23a6e6160e01b905095945050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600080611a4e836123e3565b611a8f57826040517f961c9a4f000000000000000000000000000000000000000000000000000000008152600401611a869190613109565b60405180910390fd5b611a98836123fc565b15611b2a57611aae836380ac58cd60e01b612449565b15611ac2576380ac58cd60e01b9050611b25565b611ad38363d9b67a2660e01b612449565b15611ae75763d9b67a2660e01b9050611b24565b826040517f961c9a4f000000000000000000000000000000000000000000000000000000008152600401611b1b9190613109565b60405180910390fd5b5b611b85565b611b33836124e8565b15611b475763ec20ec2060e01b9050611b84565b826040517f961c9a4f000000000000000000000000000000000000000000000000000000008152600401611b7b9190613109565b60405180910390fd5b5b80915050919050565b600080600063ec20ec2060e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603611d4f578315611c80578773ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e8a306040518363ffffffff1660e01b8152600401611c20929190612a62565b602060405180830381865afa158015611c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c619190613139565b9150858210611c75576001925050506120d0565b6000925050506120d0565b8773ffffffffffffffffffffffffffffffffffffffff166370a082318a6040518263ffffffff1660e01b8152600401611cb99190613109565b602060405180830381865afa158015611cd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cfa9190613139565b9150858210611d0e576001925050506120d0565b8882876040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401611d4693929190613166565b60405180910390fd5b6380ac58cd60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916857bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191603611f61578315611e66578773ffffffffffffffffffffffffffffffffffffffff1663081812fc886040518263ffffffff1660e01b8152600401611dda919061319d565b602060405180830381865afa158015611df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1b91906131cd565b90508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611e5b576001925050506120d0565b6000925050506120d0565b8773ffffffffffffffffffffffffffffffffffffffff16636352211e886040518263ffffffff1660e01b8152600401611e9f919061319d565b602060405180830381865afa158015611ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee091906131cd565b90508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611f20576001925050506120d0565b8887826040517f64283d7b000000000000000000000000000000000000000000000000000000008152600401611f58939291906131fa565b60405180910390fd5b8315611ffe578773ffffffffffffffffffffffffffffffffffffffff1663e985e9c58a306040518363ffffffff1660e01b8152600401611fa2929190612a62565b602060405180830381865afa158015611fbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe3919061325d565b15611ff3576001925050506120d0565b6000925050506120d0565b8773ffffffffffffffffffffffffffffffffffffffff1662fdd58e8a896040518363ffffffff1660e01b815260040161203892919061328a565b602060405180830381865afa158015612055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120799190613139565b915085821061208d576001925050506120d0565b888287896040517f03dee4c50000000000000000000000000000000000000000000000000000000081526004016120c794939291906132b3565b60405180910390fd5b9695505050505050565b600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600063ec20ec2060e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191685602001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361228c5781156121ff57846000015173ffffffffffffffffffffffffffffffffffffffff166323b872dd858588606001516040518463ffffffff1660e01b81526004016121b6939291906132f8565b6020604051808303816000875af11580156121d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f9919061325d565b50612287565b846000015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8487606001516040518363ffffffff1660e01b815260040161224292919061328a565b6020604051808303816000875af1158015612261573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612285919061325d565b505b6123d7565b6380ac58cd60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191685602001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19160361235857846000015173ffffffffffffffffffffffffffffffffffffffff166342842e0e858588604001516040518463ffffffff1660e01b8152600401612321939291906132f8565b600060405180830381600087803b15801561233b57600080fd5b505af115801561234f573d6000803e3d6000fd5b505050506123d6565b846000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a8585886040015189606001516040518563ffffffff1660e01b81526004016123a39493929190613366565b600060405180830381600087803b1580156123bd57600080fd5b505af11580156123d1573d6000803e3d6000fd5b505050505b5b60019050949350505050565b600080823b905060008163ffffffff1611915050919050565b6000612428827f01ffc9a700000000000000000000000000000000000000000000000000000000612449565b801561244257506124408263ffffffff60e01b612449565b155b9050919050565b6000808260405160240161245d919061291b565b6040516020818303038152906040526301ffc9a760e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090506000806000602060008551602087018a617530fa92503d915060005190508280156124d0575060208210155b80156124dc5750600081115b94505050505092915050565b60008173ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561255257506040513d601f19601f8201168201806040525081019061254f9190613139565b60015b61255f5760009050612565565b60019150505b919050565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020016000815260200160008152602001600060048111156125da576125d9612c8f565b5b81525090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612629816125f4565b811461263457600080fd5b50565b60008135905061264681612620565b92915050565b600060208284031215612662576126616125ea565b5b600061267084828501612637565b91505092915050565b60008115159050919050565b61268e81612679565b82525050565b60006020820190506126a96000830184612685565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006126da826126af565b9050919050565b6126ea816126cf565b81146126f557600080fd5b50565b600081359050612707816126e1565b92915050565b6000819050919050565b6127208161270d565b811461272b57600080fd5b50565b60008135905061273d81612717565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6127968261274d565b810181811067ffffffffffffffff821117156127b5576127b461275e565b5b80604052505050565b60006127c86125e0565b90506127d4828261278d565b919050565b600067ffffffffffffffff8211156127f4576127f361275e565b5b6127fd8261274d565b9050602081019050919050565b82818337600083830152505050565b600061282c612827846127d9565b6127be565b90508281526020810184848401111561284857612847612748565b5b61285384828561280a565b509392505050565b600082601f8301126128705761286f612743565b5b8135612880848260208601612819565b91505092915050565b600080600080608085870312156128a3576128a26125ea565b5b60006128b1878288016126f8565b94505060206128c2878288016126f8565b93505060406128d38782880161272e565b925050606085013567ffffffffffffffff8111156128f4576128f36125ef565b5b6129008782880161285b565b91505092959194509250565b612915816125f4565b82525050565b6000602082019050612930600083018461290c565b92915050565b6000819050919050565b61294981612936565b811461295457600080fd5b50565b60008135905061296681612940565b92915050565b60008060008060808587031215612986576129856125ea565b5b600061299487828801612957565b94505060206129a5878288016126f8565b93505060406129b68782880161272e565b92505060606129c78782880161272e565b91505092959194509250565b6000602082840312156129e9576129e86125ea565b5b60006129f784828501612957565b91505092915050565b600080600060608486031215612a1957612a186125ea565b5b6000612a27868287016126f8565b9350506020612a388682870161272e565b9250506040612a498682870161272e565b9150509250925092565b612a5c816126cf565b82525050565b6000604082019050612a776000830185612a53565b612a846020830184612a53565b9392505050565b600067ffffffffffffffff821115612aa657612aa561275e565b5b602082029050602081019050919050565b600080fd5b6000612acf612aca84612a8b565b6127be565b90508083825260208201905060208402830185811115612af257612af1612ab7565b5b835b81811015612b1b5780612b07888261272e565b845260208401935050602081019050612af4565b5050509392505050565b600082601f830112612b3a57612b39612743565b5b8135612b4a848260208601612abc565b91505092915050565b600080600080600060a08688031215612b6f57612b6e6125ea565b5b6000612b7d888289016126f8565b9550506020612b8e888289016126f8565b945050604086013567ffffffffffffffff811115612baf57612bae6125ef565b5b612bbb88828901612b25565b935050606086013567ffffffffffffffff811115612bdc57612bdb6125ef565b5b612be888828901612b25565b925050608086013567ffffffffffffffff811115612c0957612c086125ef565b5b612c158882890161285b565b9150509295509295909350565b60008060408385031215612c3957612c386125ea565b5b6000612c47858286016126f8565b9250506020612c5885828601612957565b9150509250929050565b612c6b816126cf565b82525050565b612c7a816125f4565b82525050565b612c898161270d565b82525050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60058110612ccf57612cce612c8f565b5b50565b6000819050612ce082612cbe565b919050565b6000612cf082612cd2565b9050919050565b612d0081612ce5565b82525050565b60a082016000820151612d1c6000850182612c62565b506020820151612d2f6020850182612c71565b506040820151612d426040850182612c80565b506060820151612d556060850182612c80565b506080820151612d686080850182612cf7565b50505050565b600060a082019050612d836000830184612d06565b92915050565b600080600080600060a08688031215612da557612da46125ea565b5b6000612db3888289016126f8565b9550506020612dc4888289016126f8565b9450506040612dd58882890161272e565b9350506060612de68882890161272e565b925050608086013567ffffffffffffffff811115612e0757612e066125ef565b5b612e138882890161285b565b9150509295509295909350565b600082825260208201905092915050565b7f54686973206f72646572206973206e6f74206163746976652e00000000000000600082015250565b6000612e67601983612e20565b9150612e7282612e31565b602082019050919050565b60006020820190508181036000830152612e9681612e5a565b9050919050565b7f416e206164647265737320616c7265616479206a6f696e65642074686973206f60008201527f726465722e000000000000000000000000000000000000000000000000000000602082015250565b6000612ef9602583612e20565b9150612f0482612e9d565b604082019050919050565b60006020820190508181036000830152612f2881612eec565b9050919050565b7f596f752061726520616c7265616479207468652063726561746f72206f66207460008201527f6865206f726465722e0000000000000000000000000000000000000000000000602082015250565b6000612f8b602983612e20565b9150612f9682612f2f565b604082019050919050565b60006020820190508181036000830152612fba81612f7e565b9050919050565b612fca81612ce5565b82525050565b6000606082019050612fe56000830186612a53565b612ff26020830185612fc1565b612fff6040830184612fc1565b949350505050565b7f54686520706172746e657220646964206e6f7420616c6c6f772074686520626160008201527f6c616e63652e0000000000000000000000000000000000000000000000000000602082015250565b6000613063602683612e20565b915061306e82613007565b604082019050919050565b6000602082019050818103600083015261309281613056565b9050919050565b6130a28161270d565b82525050565b600060c0820190506130bd6000830189613099565b6130ca6020830188612a53565b6130d76040830187613099565b6130e46060830186613099565b6130f16080830185613099565b6130fe60a0830184612a53565b979650505050505050565b600060208201905061311e6000830184612a53565b92915050565b60008151905061313381612717565b92915050565b60006020828403121561314f5761314e6125ea565b5b600061315d84828501613124565b91505092915050565b600060608201905061317b6000830186612a53565b6131886020830185613099565b6131956040830184613099565b949350505050565b60006020820190506131b26000830184613099565b92915050565b6000815190506131c7816126e1565b92915050565b6000602082840312156131e3576131e26125ea565b5b60006131f1848285016131b8565b91505092915050565b600060608201905061320f6000830186612a53565b61321c6020830185613099565b6132296040830184612a53565b949350505050565b61323a81612679565b811461324557600080fd5b50565b60008151905061325781613231565b92915050565b600060208284031215613273576132726125ea565b5b600061328184828501613248565b91505092915050565b600060408201905061329f6000830185612a53565b6132ac6020830184613099565b9392505050565b60006080820190506132c86000830187612a53565b6132d56020830186613099565b6132e26040830185613099565b6132ef6060830184613099565b95945050505050565b600060608201905061330d6000830186612a53565b61331a6020830185612a53565b6133276040830184613099565b949350505050565b600082825260208201905092915050565b50565b600061335060008361332f565b915061335b82613340565b600082019050919050565b600060a08201905061337b6000830187612a53565b6133886020830186612a53565b6133956040830185613099565b6133a26060830184613099565b81810360808301526133b381613343565b90509594505050505056fea26469706673582212206be570ce3f43e6e93659568472e548988fdee62050b37f8467c92ae5954b80d964736f6c63430008140033",Qd={},Hd={},Jd={_format:Ud,contractName:Dd,sourceName:Ld,abi:Md,bytecode:$d,deployedBytecode:Gd,linkReferences:Qd,deployedLinkReferences:Hd};function zd(n){let e,t,f,r;return f=new Ll({props:{isJoining:!0}}),f.$on("submit",n[0]),{c(){e=T("h1"),e.textContent="Joining Order",t=Q(),X(f.$$.fragment),S(e,"class","text-4xl font-bold text-slate-900 mb-8")},m(s,i){F(s,e,i),F(s,t,i),Z(f,s,i),r=!0},p:J,i(s){r||(O(f.$$.fragment,s),r=!0)},o(s){R(f.$$.fragment,s),r=!1},d(s){s&&B(e),s&&B(t),Y(f,s)}}}function Vd(n){let e,t;return e=new zs({props:{$$slots:{default:[zd]},$$scope:{ctx:n}}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,[r]){const s={};r&64&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Kd(n,e,t){let f,r,s;K(n,At,c=>t(2,f=c)),K(n,pe,c=>t(3,r=c)),K(n,ge,c=>t(4,s=c));let i;ft.subscribe(c=>{i=c});let o={ERC20:"0xec20ec20",ERC721:"0x80ac58cd",ERC1155:"0xd9b67a26"};async function a(c){const l=c.target.elements;let u=0,h=0,p;const b=l[0].value;let g=l[1].value;b==o.ERC20?(h=l[2].value,p=l[3].value):b==o.ERC721?(u=l[2].value,p=l[3].value):(u=l[2].value,h=l[3].value,p=l[4].value);let y;y=[p,g,u,h];const U=(await(await i.joinsOrder(...y)).wait()).logs[0],M={topics:[...U.topics],data:U.data},k=i.interface.parseLog(M).args;let{creator:v}=await i.getOrderMembersById(k.orderId),x=await i.getSubOrderByUser(v,p);df.update(()=>({token:x.token,interfaceID:x.interfaceID,tokenId:x.tokenId,quantity:x.quantity,individualStatus:x.individualStatus})),Ue.update(()=>({orderId:k.orderId,creator:v,partner:k.who,isActive:!0,isCreator:!1})),Jt.update(()=>({token:g,interfaceID:b,tokenId:u,quantity:h,individualStatus:k.newStatus})),te(ge,s=se.WaitingForPartnerJoin,s),te(pe,r=ie.WaitingFirstConfirmation,r),te(At,f=et.OrderJoined,f)}return[a]}class jd extends ve{constructor(e){super(),ke(this,e,Kd,Vd,me,{})}}function Wd(n){let e,t,f,r,s=n[1].tokenId+"",i,o,a,c,l,u,h=n[1].quantity+"",p;return{c(){e=T("div"),t=T("dt"),t.textContent="Token ID:",f=Q(),r=T("dd"),i=ne(s),o=Q(),a=T("div"),c=T("dt"),c.textContent="Quantity:",l=Q(),u=T("dd"),p=ne(h),S(t,"class","font-medium text-gray-900"),S(r,"class","text-gray-700 sm:col-span-2"),S(e,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4"),S(c,"class","font-medium text-gray-900"),S(u,"class","text-gray-700 sm:col-span-2"),S(a,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4")},m(b,g){F(b,e,g),E(e,t),E(e,f),E(e,r),E(r,i),E(e,o),F(b,a,g),E(a,c),E(a,l),E(a,u),E(u,p)},p(b,g){g&2&&s!==(s=b[1].tokenId+"")&&Ne(i,s),g&2&&h!==(h=b[1].quantity+"")&&Ne(p,h)},d(b){b&&B(e),b&&B(a)}}}function qd(n){let e,t,f,r,s=n[1].tokenId+"",i;return{c(){e=T("div"),t=T("dt"),t.textContent="Token ID:",f=Q(),r=T("dd"),i=ne(s),S(t,"class","font-medium text-gray-900"),S(r,"class","text-gray-700 sm:col-span-2"),S(e,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4")},m(o,a){F(o,e,a),E(e,t),E(e,f),E(e,r),E(r,i)},p(o,a){a&2&&s!==(s=o[1].tokenId+"")&&Ne(i,s)},d(o){o&&B(e)}}}function Zd(n){let e,t,f,r,s=n[1].quantity+"",i;return{c(){e=T("div"),t=T("dt"),t.textContent="Quantity:",f=Q(),r=T("dd"),i=ne(s),S(t,"class","font-medium text-gray-900"),S(r,"class","text-gray-700 sm:col-span-2"),S(e,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4")},m(o,a){F(o,e,a),E(e,t),E(e,f),E(e,r),E(r,i)},p(o,a){a&2&&s!==(s=o[1].quantity+"")&&Ne(i,s)},d(o){o&&B(e)}}}function Ba(n){let e,t;return e=new zt({props:{isStep:!0,$$slots:{default:[Yd]},$$scope:{ctx:n}}}),e.$on("click",n[7]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Yd(n){let e;return{c(){e=ne("Next Step")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function Xd(n){let e,t,f,r,s,i,o=n[1].token+"",a,c,l,u,h,p,b,g,y,w,_;function U(x,N){return x[3]==x[4].ERC20?Zd:x[3]==x[4].ERC721?qd:Wd}let M=U(n),k=M(n),v=!n[0]&&Ba(n);return{c(){e=T("div"),t=T("dl"),f=T("div"),r=T("dt"),r.textContent="Token address:",s=Q(),i=T("dd"),a=ne(o),c=Q(),l=T("div"),u=T("dt"),u.textContent="Token type:",h=Q(),p=T("dd"),b=ne(n[2]),g=Q(),k.c(),y=Q(),v&&v.c(),w=De(),S(r,"class","font-medium text-gray-900"),S(i,"class","text-gray-700 sm:col-span-2"),S(f,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4"),S(u,"class","font-medium text-gray-900"),S(p,"class","text-gray-700 sm:col-span-2"),S(l,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4"),S(t,"class","-my-3 divide-y divide-gray-100 text-sm"),S(e,"class","flow-root")},m(x,N){F(x,e,N),E(e,t),E(t,f),E(f,r),E(f,s),E(f,i),E(i,a),E(f,c),E(t,l),E(l,u),E(l,h),E(l,p),E(p,b),E(l,g),k.m(t,null),F(x,y,N),v&&v.m(x,N),F(x,w,N),_=!0},p(x,[N]){(!_||N&2)&&o!==(o=x[1].token+"")&&Ne(a,o),(!_||N&4)&&Ne(b,x[2]),M===(M=U(x))&&k?k.p(x,N):(k.d(1),k=M(x),k&&(k.c(),k.m(t,null))),x[0]?v&&(de(),R(v,1,1,()=>{v=null}),he()):v?N&1&&O(v,1):(v=Ba(x),v.c(),O(v,1),v.m(w.parentNode,w))},i(x){_||(O(v),_=!0)},o(x){R(v),_=!1},d(x){x&&B(e),k.d(),x&&B(y),v&&v.d(x),x&&B(w)}}}function eh(n,e,t){let f,r;K(n,Jt,u=>t(5,f=u)),K(n,df,u=>t(6,r=u));let{isCreator:s=!1}=e,i={ERC20:"0xec20ec20",ERC721:"0x80ac58cd",ERC1155:"0xd9b67a26"},o,a,c;function l(u){Os.call(this,n,u)}return n.$$set=u=>{"isCreator"in u&&t(0,s=u.isCreator)},n.$$.update=()=>{n.$$.dirty&99&&(s?(t(2,[o,a]=Object.entries(i).find(u=>u[1]==r.interfaceID),o,(t(3,a),t(0,s),t(4,i),t(6,r),t(1,c),t(5,f))),t(1,c={token:r.token,quantity:r.quantity,tokenId:r.tokenId}),console.log(c)):(t(2,[o,a]=Object.entries(i).find(u=>u[1]==f.interfaceID),o,(t(3,a),t(0,s),t(4,i),t(6,r),t(1,c),t(5,f))),t(1,c={token:f.token,quantity:f.quantity,tokenId:f.tokenId}),console.log(c)))},[s,c,o,a,i,f,r,l]}let Ml=class extends ve{constructor(e){super(),ke(this,e,eh,Xd,me,{isCreator:0})}};function th(n){let e,t,f,r,s,i,o,a,c,l,u,h,p,b,g,y,w,_,U,M;return{c(){e=T("div"),t=T("h2"),t.textContent="Steps",f=Q(),r=T("div"),s=T("ol"),i=T("li"),o=T("p"),o.innerHTML=`Details + Some info about you.`,c=Q(),l=T("li"),u=T("span"),h=Q(),p=T("span"),b=Q(),g=T("p"),g.innerHTML=`Address + Where we sending it?`,w=Q(),_=T("li"),U=T("p"),U.innerHTML=`Payment + Show us the money.`,S(t,"class","sr-only"),S(o,"class","leading-none svelte-1k7zgyl"),S(i,"class",a="flex items-center justify-center gap-2 p-4 selected "+(n[0]>=1?"selected":"")+" svelte-1k7zgyl"),S(u,"class","absolute -left-2 top-1/2 hidden h-4 w-4 -translate-y-1/2 rotate-45 border border-gray-100 ltr:border-b-0 ltr:border-s-0 ltr:bg-white rtl:border-e-0 rtl:border-t-0 rtl:bg-gray-50 sm:block svelte-1k7zgyl"),S(p,"class","absolute -right-2 top-1/2 hidden h-4 w-4 -translate-y-1/2 rotate-45 border border-gray-100 ltr:border-b-0 ltr:border-s-0 ltr:bg-gray-50 rtl:border-e-0 rtl:border-t-0 rtl:bg-white sm:block svelte-1k7zgyl"),S(g,"class","leading-none svelte-1k7zgyl"),S(l,"class",y="relative flex items-center justify-center gap-2 p-4 "+(n[0]>=2?"selected":"")+" svelte-1k7zgyl"),S(U,"class","leading-none svelte-1k7zgyl"),S(_,"class",M="flex items-center justify-center gap-2 p-4 "+(n[0]>=3?"selected":"")+" svelte-1k7zgyl"),S(s,"class","grid grid-cols-1 divide-x divide-gray-100 overflow-hidden rounded-lg border border-gray-100 text-sm text-gray-500 sm:grid-cols-3")},m(k,v){F(k,e,v),E(e,t),E(e,f),E(e,r),E(r,s),E(s,i),E(i,o),E(s,c),E(s,l),E(l,u),E(l,h),E(l,p),E(l,b),E(l,g),E(s,w),E(s,_),E(_,U)},p(k,[v]){v&1&&a!==(a="flex items-center justify-center gap-2 p-4 selected "+(k[0]>=1?"selected":"")+" svelte-1k7zgyl")&&S(i,"class",a),v&1&&y!==(y="relative flex items-center justify-center gap-2 p-4 "+(k[0]>=2?"selected":"")+" svelte-1k7zgyl")&&S(l,"class",y),v&1&&M!==(M="flex items-center justify-center gap-2 p-4 "+(k[0]>=3?"selected":"")+" svelte-1k7zgyl")&&S(_,"class",M)},i:J,o:J,d(k){k&&B(e)}}}function fh(n,e,t){let f;return K(n,X0,r=>t(0,f=r)),[f]}class nh extends ve{constructor(e){super(),ke(this,e,fh,th,me,{})}}function Fa(n){let e,t;return e=new nh({}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function rh(n){let e,t,f,r=n[2].orderId+"",s,i,o,a;const c=n[3].default,l=Tn(c,n,n[4],null);return{c(){e=T("div"),t=T("h1"),f=ne("Order Id: "),s=ne(r),i=Q(),o=T("div"),l&&l.c(),S(t,"class","mb-10 font-bold text-lg"),S(o,"class","grid grid-cols-1 sm:grid-cols-2")},m(u,h){F(u,e,h),E(e,t),E(t,f),E(t,s),E(e,i),E(e,o),l&&l.m(o,null),a=!0},p(u,h){(!a||h&4)&&r!==(r=u[2].orderId+"")&&Ne(s,r),l&&l.p&&(!a||h&16)&&_n(l,c,u,u[4],a?In(c,u[4],h,null):Nn(u[4]),null)},i(u){a||(O(l,u),a=!0)},o(u){R(l,u),a=!1},d(u){u&&B(e),l&&l.d(u)}}}function sh(n){let e,t,f,r=!(n[0]==ie.Completed&&n[1]==se.Completed)&&Fa();return t=new zs({props:{$$slots:{default:[rh]},$$scope:{ctx:n}}}),{c(){r&&r.c(),e=Q(),X(t.$$.fragment)},m(s,i){r&&r.m(s,i),F(s,e,i),Z(t,s,i),f=!0},p(s,[i]){s[0]==ie.Completed&&s[1]==se.Completed?r&&(de(),R(r,1,1,()=>{r=null}),he()):r?i&3&&O(r,1):(r=Fa(),r.c(),O(r,1),r.m(e.parentNode,e));const o={};i&20&&(o.$$scope={dirty:i,ctx:s}),t.$set(o)},i(s){f||(O(r),O(t.$$.fragment,s),f=!0)},o(s){R(r),R(t.$$.fragment,s),f=!1},d(s){r&&r.d(s),s&&B(e),Y(t,s)}}}function ih(n,e,t){let f,r,s,i;K(n,X0,c=>t(5,f=c)),K(n,pe,c=>t(0,r=c)),K(n,ge,c=>t(1,s=c)),K(n,Ue,c=>t(2,i=c));let{$$slots:o={},$$scope:a}=e;return n.$$set=c=>{"$$scope"in c&&t(4,a=c.$$scope)},n.$$.update=()=>{n.$$.dirty&3&&(s==se.WaitingForPartnerJoin||r==ie.WaitingFirstConfirmation?te(X0,f=1,f):s==se.AllowingAutonomousSwap||r==ie.AllowingAutonomousSwap?te(X0,f=2,f):(s==se.SendingTokens||r==ie.WaitingCreatorsFunding)&&te(X0,f=3,f))},[r,s,i,o,a]}class $l extends ve{constructor(e){super(),ke(this,e,ih,sh,me,{})}}function oh(n){let e,t,f,r;const s=n[1].default,i=Tn(s,n,n[0],null);return{c(){e=T("div"),i&&i.c(),t=Q(),f=T("div"),f.innerHTML='
',S(f,"class","lds-spinner svelte-og331j"),S(e,"class","p-4 mt-6 ")},m(o,a){F(o,e,a),i&&i.m(e,null),E(e,t),E(e,f),r=!0},p(o,[a]){i&&i.p&&(!r||a&1)&&_n(i,s,o,o[0],r?In(s,o[0],a,null):Nn(o[0]),null)},i(o){r||(O(i,o),r=!0)},o(o){R(i,o),r=!1},d(o){o&&B(e),i&&i.d(o)}}}function ah(n,e,t){let{$$slots:f={},$$scope:r}=e;return n.$$set=s=>{"$$scope"in s&&t(0,r=s.$$scope)},[r,f]}class j0 extends ve{constructor(e){super(),ke(this,e,ah,oh,me,{})}}function ch(n){let e,t,f,r;const s=n[0].default,i=Tn(s,n,n[1],null);return{c(){e=T("div"),t=T("p"),t.textContent="Waiting the",f=Q(),i&&i.c()},m(o,a){F(o,e,a),E(e,t),E(e,f),i&&i.m(e,null),r=!0},p(o,a){i&&i.p&&(!r||a&2)&&_n(i,s,o,o[1],r?In(s,o[1],a,null):Nn(o[1]),null)},i(o){r||(O(i,o),r=!0)},o(o){R(i,o),r=!1},d(o){o&&B(e),i&&i.d(o)}}}function lh(n){let e,t,f;return t=new j0({props:{$$slots:{default:[ch]},$$scope:{ctx:n}}}),{c(){e=T("div"),X(t.$$.fragment),S(e,"class","relative flex flex-col")},m(r,s){F(r,e,s),Z(t,e,null),f=!0},p(r,[s]){const i={};s&2&&(i.$$scope={dirty:s,ctx:r}),t.$set(i)},i(r){f||(O(t.$$.fragment,r),f=!0)},o(r){R(t.$$.fragment,r),f=!1},d(r){r&&B(e),Y(t)}}}function uh(n,e,t){let f,r;K(n,Ue,c=>t(3,f=c)),K(n,pe,c=>t(4,r=c));let{$$slots:s={},$$scope:i}=e,o;const a=ft.subscribe(c=>{o=c});return K0(a),o.on("StepCompleted",async(c,l,u,h)=>{if(c==f.orderId&&l!=f.creator){let p=await o.getSubOrderByUser(l,c);Jt.update(()=>({token:p.token,interfaceID:p.interfaceID,tokenId:p.tokenId,quantity:p.quantity,individualStatus:u})),o.removeAllListeners(),te(pe,r=ie.WaitingFirstConfirmation,r),te(Ue,f.partner=l,f)}}),n.$$set=c=>{"$$scope"in c&&t(1,i=c.$$scope)},[s,i]}let dh=class extends ve{constructor(e){super(),ke(this,e,uh,lh,me,{})}};const As=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],Es=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{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:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"operator",type:"address"}],stateMutability:"view",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:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",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:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],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"}],ks=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",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:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"}];function hh(n){let e,t,f;return t=new j0({}),{c(){e=ne(`Awaiting Allowance ... + `),X(t.$$.fragment)},m(r,s){F(r,e,s),Z(t,r,s),f=!0},p:J,i(r){f||(O(t.$$.fragment,r),f=!0)},o(r){R(t.$$.fragment,r),f=!1},d(r){r&&B(e),Y(t,r)}}}function ph(n){let e;return{c(){e=T("p"),e.textContent="Allowance approved!"},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function bh(n){let e,t,f,r;const s=[mh,gh],i=[];function o(a,c){return a[1]?0:1}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,c){let l=e;e=o(a),e===l?i[e].p(a,c):(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t?t.p(a,c):(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function gh(n){let e,t;return e=new zt({props:{$$slots:{default:[yh]},$$scope:{ctx:n}}}),e.$on("click",n[5]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,r){const s={};r&262144&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function mh(n){let e;return{c(){e=T("p"),e.textContent="Allowance approved!"},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function yh(n){let e;return{c(){e=ne("Give Allowance")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function wh(n){let e,t,f,r;const s=[bh,ph,hh],i=[];function o(a,c){return a[0]?0:a[2]?1:2}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,[c]){let l=e;e=o(a),e===l?i[e].p(a,c):(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t?t.p(a,c):(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function Ah(n,e,t){let f,r,s,i,o,a,c;K(n,df,k=>t(3,f=k)),K(n,ft,k=>t(7,r=k)),K(n,dr,k=>t(8,s=k)),K(n,pe,k=>t(9,i=k)),K(n,Jt,k=>t(10,o=k)),K(n,Ue,k=>t(11,a=k)),K(n,ge,k=>t(12,c=k));let{isCreator:l=!1}=e,u=!1,h=!1,p={ERC20:"0xec20ec20",ERC721:"0x80ac58cd",ERC1155:"0xd9b67a26"},b;l?(b=f.interfaceID,g()):(b=o.interfaceID,y());async function g(){if(u)return;let k=await w(f.token,a.creator,b,f.quantity,f.tokenId);console.log(k),k&&(t(1,u=!0),te(ge,c=se.WaitingPartnerAllowance,c)),console.log(h),setTimeout(g,1e3)}async function y(){if(h)return;let k=await w(o.token,a.partner,b,o.quantity,o.tokenId);console.log(k),k&&(t(2,h=!0),te(pe,i=ie.WaitingCreatorAllowance,i)),console.log(h),setTimeout(y,1e3)}async function w(k,v,x,N,z){console.log(k,x,N,z);let V,fe=await r.getAddress(),ee;return x==p.ERC20?(V=new Oe(k,As,s),ee=await V.allowance(v,fe),console.log(ee),ee>=N):x==p.ERC721?(V=new Oe(k,Es,s),ee=await V.getApproved(z),console.log(ee),ee==fe):(V=new Oe(k,ks,s),ee=await V.isApprovedForAll(v,fe),console.log(ee),!!ee)}function _(k,v){return v==p.ERC20?new Oe(k,As,s):v==p.ERC721?new Oe(k,Es,s):new Oe(k,ks,s)}async function U(k){let v=await r.getAddress(),x,N=_(k,b);b==p.ERC20?x=await N.approve(v,f.quantity):b==p.ERC721?x=await N.approve(v,f.tokenId):x=await N.setApprovalForAll(v,!0),(await x.wait()).status==1&&t(1,u=!0)}const M=()=>U(f.token);return n.$$set=k=>{"isCreator"in k&&t(0,l=k.isCreator)},n.$$.update=()=>{n.$$.dirty&6&&console.log(u,h)},[l,u,h,f,U,M]}let Gl=class extends ve{constructor(e){super(),ke(this,e,Ah,wh,me,{isCreator:0})}};function Eh(n){let e,t,f;return t=new j0({}),{c(){e=ne(`Awaiting transaction ... + `),X(t.$$.fragment)},m(r,s){F(r,e,s),Z(t,r,s),f=!0},p:J,i(r){f||(O(t.$$.fragment,r),f=!0)},o(r){R(t.$$.fragment,r),f=!1},d(r){r&&B(e),Y(t,r)}}}function kh(n){let e;return{c(){e=T("p"),e.textContent="Finished!"},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function vh(n){let e,t,f,r;const s=[Ch,xh],i=[];function o(a,c){return a[1]?0:1}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,c){let l=e;e=o(a),e===l?i[e].p(a,c):(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t?t.p(a,c):(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function xh(n){let e,t;return e=new zt({props:{$$slots:{default:[Th]},$$scope:{ctx:n}}}),e.$on("click",n[4]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,r){const s={};r&1024&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Ch(n){let e;return{c(){e=T("p"),e.textContent="Finished! Now, just await for the partner."},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function Th(n){let e;return{c(){e=ne("Send Funds")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function Ih(n){let e,t,f,r;const s=[vh,kh,Eh],i=[];function o(a,c){return a[0]?0:a[2]?1:2}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,[c]){let l=e;e=o(a),e===l?i[e].p(a,c):(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t?t.p(a,c):(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function _h(n,e,t){let f,r,s;K(n,Ue,p=>t(6,f=p)),K(n,ge,p=>t(7,r=p)),K(n,pe,p=>t(8,s=p));let i;const o=ft.subscribe(p=>{i=p});K0(o);let{isCreator:a=!1}=e,c=!1,l=!1;a&&i.on("StepCompleted",async(p,b,g,y)=>{p==f.orderId&&b==f.partner&&g==3&&(console.log(y),te(pe,s=ie.Completed,s),te(ge,r=se.Completed,r),t(2,l=!0),i.removeAllListeners())});async function u(){(await(await i.transferFundsToSwap(f.orderId)).wait()).status==1&&t(1,c=!0)}const h=()=>u();return n.$$set=p=>{"isCreator"in p&&t(0,a=p.isCreator)},[a,c,l,u,h]}let Ql=class extends ve{constructor(e){super(),ke(this,e,_h,Ih,me,{isCreator:0})}};function Nh(n){let e=n[0]?"Cancelled!!":"Cancel",t;return{c(){t=ne(e)},m(f,r){F(f,t,r)},p(f,r){r&1&&e!==(e=f[0]?"Cancelled!!":"Cancel")&&Ne(t,e)},d(f){f&&B(t)}}}function Ph(n){let e,t,f;return t=new zt({props:{$$slots:{default:[Nh]},$$scope:{ctx:n}}}),t.$on("click",n[1]),{c(){e=T("div"),X(t.$$.fragment),S(e,"class","absolute -top-[150%]")},m(r,s){F(r,e,s),Z(t,e,null),f=!0},p(r,[s]){const i={};s&33&&(i.$$scope={dirty:s,ctx:r}),t.$set(i)},i(r){f||(O(t.$$.fragment,r),f=!0)},o(r){R(t.$$.fragment,r),f=!1},d(r){r&&B(e),Y(t)}}}function Oh(n,e,t){let f;K(n,Ue,a=>t(3,f=a));let r=!1,s;const i=ft.subscribe(a=>{s=a});K0(i);async function o(){(await(await s.cancelOrder(f.orderId)).wait()).status==1&&t(0,r=!0)}return[r,o]}class Sh extends ve{constructor(e){super(),ke(this,e,Oh,Ph,me,{})}}function Rh(n){let e;return{c(){e=T("div"),e.innerHTML='

Order Completed!!!

',S(e,"class","col-span-2 ")},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function Bh(n){let e,t,f,r,s,i,o=n[2].creator+"",a,c,l,u,h,p,b,g,y,w,_,U=(n[2].partner!="0x0000000000000000000000000000000000000000"&&n[2].partner?n[2].partner:"waiting...")+"",M,k,v,x,N,z,V;f=new Sh({});const fe=[Mh,Lh,Dh,Uh,Fh],ee=[];function be(L,re){return L[1]==se.WaitingForPartnerJoin?0:L[1]==se.AllowingAutonomousSwap||L[1]==se.WaitingPartnerAllowance?1:L[1]==se.SendingTokens?2:L[1]==se.WaitingPartnersTransfer?3:L[1]==se.Completed?4:-1}~(h=be(n))&&(p=ee[h]=fe[h](n));const je=[Jh,Hh,Qh,Gh,$h],P=[];function $(L,re){return L[0]==null?0:L[0]==ie.WaitingFirstConfirmation?1:L[0]==ie.AllowingAutonomousSwap||L[0]==ie.WaitingCreatorAllowance?2:L[0]==ie.WaitingCreatorsFunding?3:L[0]==ie.Completed?4:-1}return~(N=$(n))&&(z=P[N]=je[N](n)),{c(){e=T("div"),t=T("h1"),X(f.$$.fragment),r=Q(),s=T("strong"),s.textContent="Creator:",i=Q(),a=ne(o),c=Q(),l=T("hr"),u=Q(),p&&p.c(),b=Q(),g=T("div"),y=T("h1"),w=T("strong"),w.textContent="Partner:",_=Q(),M=ne(U),k=Q(),v=T("hr"),x=Q(),z&&z.c(),S(s,"class","ml-1"),S(t,"class","pb-5 relative"),S(l,"class","mb-5 h-0.5 bg-black"),S(y,"class","pb-5"),S(v,"class","mb-5 h-0.5 bg-black")},m(L,re){F(L,e,re),E(e,t),Z(f,t,null),E(t,r),E(t,s),E(t,i),E(t,a),E(e,c),E(e,l),E(e,u),~h&&ee[h].m(e,null),F(L,b,re),F(L,g,re),E(g,y),E(y,w),E(y,_),E(y,M),E(g,k),E(g,v),E(g,x),~N&&P[N].m(g,null),V=!0},p(L,re){(!V||re&4)&&o!==(o=L[2].creator+"")&&Ne(a,o);let ce=h;h=be(L),h!==ce&&(p&&(de(),R(ee[ce],1,1,()=>{ee[ce]=null}),he()),~h?(p=ee[h],p||(p=ee[h]=fe[h](L),p.c()),O(p,1),p.m(e,null)):p=null),(!V||re&4)&&U!==(U=(L[2].partner!="0x0000000000000000000000000000000000000000"&&L[2].partner?L[2].partner:"waiting...")+"")&&Ne(M,U);let xe=N;N=$(L),N===xe?~N&&P[N].p(L,re):(z&&(de(),R(P[xe],1,1,()=>{P[xe]=null}),he()),~N?(z=P[N],z?z.p(L,re):(z=P[N]=je[N](L),z.c()),O(z,1),z.m(g,null)):z=null)},i(L){V||(O(f.$$.fragment,L),O(p),O(z),V=!0)},o(L){R(f.$$.fragment,L),R(p),R(z),V=!1},d(L){L&&B(e),Y(f),~h&&ee[h].d(),L&&B(b),L&&B(g),~N&&P[N].d()}}}function Fh(n){let e;return{c(){e=T("p"),e.textContent="Finished!"},m(t,f){F(t,e,f)},i:J,o:J,d(t){t&&B(e)}}}function Uh(n){let e;return{c(){e=T("p"),e.textContent="Finished! Now, just await for the partner."},m(t,f){F(t,e,f)},i:J,o:J,d(t){t&&B(e)}}}function Dh(n){let e,t;return e=new Ql({props:{isCreator:!0}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Lh(n){let e,t;return e=new Gl({props:{isCreator:!0}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Mh(n){let e,t;return e=new Ml({props:{isCreator:!0}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function $h(n){let e;return{c(){e=T("p"),e.textContent="Finished!"},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function Gh(n){let e,t;return e=new Ql({}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p:J,i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Qh(n){let e,t,f,r;e=new Gl({});let s=n[1]==se.WaitingPartnerAllowance&&n[0]==ie.WaitingCreatorAllowance&&Ua(n);return{c(){X(e.$$.fragment),t=Q(),s&&s.c(),f=De()},m(i,o){Z(e,i,o),F(i,t,o),s&&s.m(i,o),F(i,f,o),r=!0},p(i,o){i[1]==se.WaitingPartnerAllowance&&i[0]==ie.WaitingCreatorAllowance?s?(s.p(i,o),o&3&&O(s,1)):(s=Ua(i),s.c(),O(s,1),s.m(f.parentNode,f)):s&&(de(),R(s,1,1,()=>{s=null}),he())},i(i){r||(O(e.$$.fragment,i),O(s),r=!0)},o(i){R(e.$$.fragment,i),R(s),r=!1},d(i){Y(e,i),i&&B(t),s&&s.d(i),i&&B(f)}}}function Hh(n){let e,t;return e=new Ml({}),e.$on("click",n[3]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p:J,i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Jh(n){let e,t;return e=new dh({props:{$$slots:{default:[Vh]},$$scope:{ctx:n}}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,r){const s={};r&32&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Ua(n){let e,t;return e=new zt({props:{isStep:!0,$$slots:{default:[zh]},$$scope:{ctx:n}}}),e.$on("click",n[4]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,r){const s={};r&32&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function zh(n){let e;return{c(){e=ne("Next Step")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function Vh(n){let e;return{c(){e=ne("partner.")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function Kh(n){let e,t,f,r;const s=[Bh,Rh],i=[];function o(a,c){return a[0]==ie.Completed&&a[1]==se.Completed?1:0}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,c){let l=e;e=o(a),e===l?i[e].p(a,c):(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t?t.p(a,c):(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function jh(n){let e,t;return e=new $l({props:{$$slots:{default:[Kh]},$$scope:{ctx:n}}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,[r]){const s={};r&39&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Wh(n,e,t){let f,r,s;return K(n,pe,a=>t(0,f=a)),K(n,ge,a=>t(1,r=a)),K(n,Ue,a=>t(2,s=a)),[f,r,s,()=>{te(ge,r=se.AllowingAutonomousSwap,r),te(pe,f=ie.AllowingAutonomousSwap,f)},()=>{te(ge,r=se.SendingTokens,r),te(pe,f=ie.WaitingCreatorsFunding,f)}]}class qh extends ve{constructor(e){super(),ke(this,e,Wh,jh,me,{})}}function Da(n){let e,t,f;return{c(){e=T("p"),t=ne("INVALID ORDER: "),f=ne(n[0])},m(r,s){F(r,e,s),E(e,t),E(e,f)},p(r,s){s&1&&Ne(f,r[0])},d(r){r&&B(e)}}}function Zh(n){let e,t,f,r,s,i,o,a=n[0]!=null&&Da(n);return{c(){e=T("h1"),e.textContent="Joining Order",t=Q(),f=T("form"),f.innerHTML=`
+ + + `,r=Q(),a&&a.c(),s=De(),S(e,"class","text-4xl font-bold text-slate-900 mb-8")},m(c,l){F(c,e,l),F(c,t,l),F(c,f,l),F(c,r,l),a&&a.m(c,l),F(c,s,l),i||(o=mn(f,"submit",ja(n[1])),i=!0)},p(c,l){c[0]!=null?a?a.p(c,l):(a=Da(c),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},d(c){c&&B(e),c&&B(t),c&&B(f),c&&B(r),a&&a.d(c),c&&B(s),i=!1,o()}}}function Yh(n){let e,t;return e=new zs({props:{$$slots:{default:[Zh]},$$scope:{ctx:n}}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,[r]){const s={};r&1025&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Xh(n,e,t){let f,r,s,i,o,a;K(n,At,h=>t(3,f=h)),K(n,pe,h=>t(4,r=h)),K(n,ge,h=>t(5,s=h)),K(n,Jt,h=>t(6,i=h)),K(n,df,h=>t(7,o=h)),K(n,dr,h=>t(8,a=h));let c;ft.subscribe(h=>{c=h});let l=null;async function u(h){const b=h.target.elements[0].value;let g=await a.getAddress(),{creator:y,partner:w}=await c.getOrderMembersById(b);if(y==g){let _=await c.getSubOrderByUser(y,b),U=await c.getSubOrderByUser(w,b);console.log(_),console.log(U),df.update(()=>({token:_.token,interfaceID:_.interfaceID,tokenId:_.tokenId,quantity:_.quantity,individualStatus:_.individualStatus})),Jt.update(()=>({token:U.token,interfaceID:U.interfaceID,tokenId:U.tokenId,quantity:U.quantity,individualStatus:U.individualStatus})),Ue.update(()=>({orderId:b,creator:g,partner:w,isActive:!0,isCreator:!0})),o.individualStatus==1?i.individualStatus==0?te(ge,s=se.WaitingForPartnerJoin,s):(te(ge,s=se.AllowingAutonomousSwap,s),te(pe,r=ie.AllowingAutonomousSwap,r)):o.individualStatus==2&&(i.individualStatus==3?(te(ge,s=se.Completed,s),te(pe,r=ie.Completed,r)):(te(ge,s=se.WaitingPartnersTransfer,s),te(pe,r=ie.WaitingCreatorsFunding,r))),te(At,f=et.OrderCreated,f)}else if(w==g){let _=await c.getSubOrderByUser(y,b),U=await c.getSubOrderByUser(w,b);df.update(()=>({token:_.token,interfaceID:_.interfaceID,tokenId:_.tokenId,quantity:_.quantity,individualStatus:_.individualStatus})),Jt.update(()=>({token:U.token,interfaceID:U.interfaceID,tokenId:U.tokenId,quantity:U.quantity,individualStatus:U.individualStatus})),Ue.update(()=>({orderId:b,creator:y,partner:g,isActive:!0,isCreator:!1})),i.individualStatus==1&&(te(ge,s=se.AllowingAutonomousSwap,s),te(pe,r=ie.AllowingAutonomousSwap,r)),te(At,f=et.OrderJoined,f)}else throw t(0,l="Invalid orderId"),console.log(l),new Error(l)}return[l,u]}class ep extends ve{constructor(e){super(),ke(this,e,Xh,Yh,me,{})}}function tp(n){let e,t,f,r,s=n[1].tokenId+"",i,o,a,c,l,u,h=n[1].quantity+"",p;return{c(){e=T("div"),t=T("dt"),t.textContent="Token ID:",f=Q(),r=T("dd"),i=ne(s),o=Q(),a=T("div"),c=T("dt"),c.textContent="Quantity:",l=Q(),u=T("dd"),p=ne(h),S(t,"class","font-medium text-gray-900"),S(r,"class","text-gray-700 sm:col-span-2"),S(e,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4"),S(c,"class","font-medium text-gray-900"),S(u,"class","text-gray-700 sm:col-span-2"),S(a,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4")},m(b,g){F(b,e,g),E(e,t),E(e,f),E(e,r),E(r,i),E(e,o),F(b,a,g),E(a,c),E(a,l),E(a,u),E(u,p)},p(b,g){g&2&&s!==(s=b[1].tokenId+"")&&Ne(i,s),g&2&&h!==(h=b[1].quantity+"")&&Ne(p,h)},d(b){b&&B(e),b&&B(a)}}}function fp(n){let e,t,f,r,s=n[1].tokenId+"",i;return{c(){e=T("div"),t=T("dt"),t.textContent="Token ID:",f=Q(),r=T("dd"),i=ne(s),S(t,"class","font-medium text-gray-900"),S(r,"class","text-gray-700 sm:col-span-2"),S(e,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4")},m(o,a){F(o,e,a),E(e,t),E(e,f),E(e,r),E(r,i)},p(o,a){a&2&&s!==(s=o[1].tokenId+"")&&Ne(i,s)},d(o){o&&B(e)}}}function np(n){let e,t,f,r,s=n[1].quantity+"",i;return{c(){e=T("div"),t=T("dt"),t.textContent="Quantity:",f=Q(),r=T("dd"),i=ne(s),S(t,"class","font-medium text-gray-900"),S(r,"class","text-gray-700 sm:col-span-2"),S(e,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4")},m(o,a){F(o,e,a),E(e,t),E(e,f),E(e,r),E(r,i)},p(o,a){a&2&&s!==(s=o[1].quantity+"")&&Ne(i,s)},d(o){o&&B(e)}}}function La(n){let e,t;return e=new zt({props:{isStep:!0,$$slots:{default:[rp]},$$scope:{ctx:n}}}),e.$on("click",n[7]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function rp(n){let e;return{c(){e=ne("Next Step")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function sp(n){let e,t,f,r,s,i,o=n[1].token+"",a,c,l,u,h,p,b,g,y,w,_;function U(x,N){return x[3]==x[4].ERC20?np:x[3]==x[4].ERC721?fp:tp}let M=U(n),k=M(n),v=!n[0]&&La(n);return{c(){e=T("div"),t=T("dl"),f=T("div"),r=T("dt"),r.textContent="Token address:",s=Q(),i=T("dd"),a=ne(o),c=Q(),l=T("div"),u=T("dt"),u.textContent="Token type:",h=Q(),p=T("dd"),b=ne(n[2]),g=Q(),k.c(),y=Q(),v&&v.c(),w=De(),S(r,"class","font-medium text-gray-900"),S(i,"class","text-gray-700 sm:col-span-2"),S(f,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4"),S(u,"class","font-medium text-gray-900"),S(p,"class","text-gray-700 sm:col-span-2"),S(l,"class","grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4"),S(t,"class","-my-3 divide-y divide-gray-100 text-sm"),S(e,"class","flow-root")},m(x,N){F(x,e,N),E(e,t),E(t,f),E(f,r),E(f,s),E(f,i),E(i,a),E(f,c),E(t,l),E(l,u),E(l,h),E(l,p),E(p,b),E(l,g),k.m(t,null),F(x,y,N),v&&v.m(x,N),F(x,w,N),_=!0},p(x,[N]){(!_||N&2)&&o!==(o=x[1].token+"")&&Ne(a,o),(!_||N&4)&&Ne(b,x[2]),M===(M=U(x))&&k?k.p(x,N):(k.d(1),k=M(x),k&&(k.c(),k.m(t,null))),x[0]?v&&(de(),R(v,1,1,()=>{v=null}),he()):v?N&1&&O(v,1):(v=La(x),v.c(),O(v,1),v.m(w.parentNode,w))},i(x){_||(O(v),_=!0)},o(x){R(v),_=!1},d(x){x&&B(e),k.d(),x&&B(y),v&&v.d(x),x&&B(w)}}}function ip(n,e,t){let f,r;K(n,Jt,u=>t(5,f=u)),K(n,df,u=>t(6,r=u));let{isCreator:s=!1}=e,i={ERC20:"0xec20ec20",ERC721:"0x80ac58cd",ERC1155:"0xd9b67a26"},o,a,c;function l(u){Os.call(this,n,u)}return n.$$set=u=>{"isCreator"in u&&t(0,s=u.isCreator)},n.$$.update=()=>{n.$$.dirty&99&&(s?(t(2,[o,a]=Object.entries(i).find(u=>u[1]==r.interfaceID),o,(t(3,a),t(0,s),t(4,i),t(6,r),t(1,c),t(5,f))),t(1,c={token:r.token,quantity:r.quantity,tokenId:r.tokenId}),console.log(c)):(t(2,[o,a]=Object.entries(i).find(u=>u[1]==f.interfaceID),o,(t(3,a),t(0,s),t(4,i),t(6,r),t(1,c),t(5,f))),t(1,c={token:f.token,quantity:f.quantity,tokenId:f.tokenId}),console.log(c)))},[s,c,o,a,i,f,r,l]}class Hl extends ve{constructor(e){super(),ke(this,e,ip,sp,me,{isCreator:0})}}function op(n){let e,t,f,r;const s=n[0].default,i=Tn(s,n,n[1],null);return{c(){e=T("div"),t=T("p"),t.textContent="Waiting the",f=Q(),i&&i.c()},m(o,a){F(o,e,a),E(e,t),E(e,f),i&&i.m(e,null),r=!0},p(o,a){i&&i.p&&(!r||a&2)&&_n(i,s,o,o[1],r?In(s,o[1],a,null):Nn(o[1]),null)},i(o){r||(O(i,o),r=!0)},o(o){R(i,o),r=!1},d(o){o&&B(e),i&&i.d(o)}}}function ap(n){let e,t,f;return t=new j0({props:{$$slots:{default:[op]},$$scope:{ctx:n}}}),{c(){e=T("div"),X(t.$$.fragment),S(e,"class","relative flex flex-col")},m(r,s){F(r,e,s),Z(t,e,null),f=!0},p(r,[s]){const i={};s&2&&(i.$$scope={dirty:s,ctx:r}),t.$set(i)},i(r){f||(O(t.$$.fragment,r),f=!0)},o(r){R(t.$$.fragment,r),f=!1},d(r){r&&B(e),Y(t)}}}function cp(n,e,t){let f,r;K(n,Ue,c=>t(3,f=c)),K(n,pe,c=>t(4,r=c));let{$$slots:s={},$$scope:i}=e,o;const a=ft.subscribe(c=>{o=c});return K0(a),o.on("StepCompleted",async(c,l,u,h)=>{if(c==f.orderId&&l!=f.creator){let p=await o.getSubOrderByUser(l,c);Jt.update(()=>({token:p.token,interfaceID:p.interfaceID,tokenId:p.tokenId,quantity:p.quantity,individualStatus:u})),o.removeAllListeners(),te(pe,r=ie.WaitingFirstConfirmation,r),te(Ue,f.partner=l,f)}}),n.$$set=c=>{"$$scope"in c&&t(1,i=c.$$scope)},[s,i]}class lp extends ve{constructor(e){super(),ke(this,e,cp,ap,me,{})}}function up(n){let e,t;return e=new zt({props:{$$slots:{default:[pp]},$$scope:{ctx:n}}}),e.$on("click",n[5]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,r){const s={};r&262144&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function dp(n){let e;return{c(){e=T("p"),e.textContent="Allowance approved!"},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function hp(n){let e,t,f,r;const s=[gp,bp],i=[];function o(a,c){return a[1]?0:1}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,c){let l=e;e=o(a),e!==l&&(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t||(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function pp(n){let e;return{c(){e=ne("Give Allowance")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function bp(n){let e,t,f;return t=new j0({}),{c(){e=ne(`Awaiting Allowance ... + `),X(t.$$.fragment)},m(r,s){F(r,e,s),Z(t,r,s),f=!0},i(r){f||(O(t.$$.fragment,r),f=!0)},o(r){R(t.$$.fragment,r),f=!1},d(r){r&&B(e),Y(t,r)}}}function gp(n){let e;return{c(){e=T("p"),e.textContent="Allowance approved!"},m(t,f){F(t,e,f)},i:J,o:J,d(t){t&&B(e)}}}function mp(n){let e,t,f,r;const s=[hp,dp,up],i=[];function o(a,c){return a[0]?0:a[2]?1:2}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,[c]){let l=e;e=o(a),e===l?i[e].p(a,c):(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t?t.p(a,c):(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function yp(n,e,t){let f,r,s,i,o,a,c;K(n,df,k=>t(7,f=k)),K(n,ft,k=>t(8,r=k)),K(n,dr,k=>t(9,s=k)),K(n,pe,k=>t(10,i=k)),K(n,Jt,k=>t(3,o=k)),K(n,Ue,k=>t(11,a=k)),K(n,ge,k=>t(12,c=k));let{isCreator:l=!1}=e,u=!1,h=!1,p={ERC20:"0xec20ec20",ERC721:"0x80ac58cd",ERC1155:"0xd9b67a26"},b;l?(b=f.interfaceID,g()):(b=o.interfaceID,y());async function g(){if(u)return;let k=await w(f.token,a.creator,b,f.quantity,f.tokenId);console.log(k),k&&(t(1,u=!0),te(ge,c=se.WaitingPartnerAllowance,c)),console.log(h),setTimeout(g,1e3)}async function y(){if(h)return;let k=await w(o.token,a.partner,b,o.quantity,o.tokenId);console.log(k),k&&(t(2,h=!0),te(pe,i=ie.WaitingCreatorAllowance,i)),console.log(h),setTimeout(y,1e3)}async function w(k,v,x,N,z){console.log(k,x,N,z);let V,fe=await r.getAddress(),ee;return x==p.ERC20?(V=new Oe(k,As,s),ee=await V.allowance(v,fe),console.log(ee),ee>=N):x==p.ERC721?(V=new Oe(k,Es,s),ee=await V.getApproved(z),console.log(ee),ee==fe):(V=new Oe(k,ks,s),ee=await V.isApprovedForAll(v,fe),console.log(ee),!!ee)}function _(k,v){return v==p.ERC20?new Oe(k,As,s):v==p.ERC721?new Oe(k,Es,s):new Oe(k,ks,s)}async function U(k){let v=await r.getAddress(),x,N=_(k,b);b==p.ERC20?x=await N.approve(v,f.quantity):b==p.ERC721?x=await N.approve(v,f.tokenId):x=await N.setApprovalForAll(v,!0),(await x.wait()).status==1&&t(1,u=!0)}const M=()=>U(o.token);return n.$$set=k=>{"isCreator"in k&&t(0,l=k.isCreator)},n.$$.update=()=>{n.$$.dirty&6&&console.log(u,h)},[l,u,h,o,U,M]}class Jl extends ve{constructor(e){super(),ke(this,e,yp,mp,me,{isCreator:0})}}function wp(n){let e,t;return e=new zt({props:{$$slots:{default:[kp]},$$scope:{ctx:n}}}),e.$on("click",n[4]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,r){const s={};r&1024&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Ap(n){let e;return{c(){e=T("p"),e.textContent="Finished!"},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function Ep(n){let e,t,f,r;const s=[xp,vp],i=[];function o(a,c){return a[1]?0:1}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,c){let l=e;e=o(a),e!==l&&(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t||(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function kp(n){let e;return{c(){e=ne("Finish swap.")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function vp(n){let e,t,f;return t=new j0({}),{c(){e=ne(`Awaiting transaction ... + `),X(t.$$.fragment)},m(r,s){F(r,e,s),Z(t,r,s),f=!0},i(r){f||(O(t.$$.fragment,r),f=!0)},o(r){R(t.$$.fragment,r),f=!1},d(r){r&&B(e),Y(t,r)}}}function xp(n){let e;return{c(){e=T("p"),e.textContent="Finished! Now, just await for the creator."},m(t,f){F(t,e,f)},i:J,o:J,d(t){t&&B(e)}}}function Cp(n){let e,t,f,r;const s=[Ep,Ap,wp],i=[];function o(a,c){return a[0]?0:a[2]?1:2}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,[c]){let l=e;e=o(a),e===l?i[e].p(a,c):(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t?t.p(a,c):(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function Tp(n,e,t){let f,r,s;K(n,Ue,p=>t(6,f=p)),K(n,ge,p=>t(7,r=p)),K(n,pe,p=>t(8,s=p));let i;const o=ft.subscribe(p=>{i=p});K0(o);let{isCreator:a=!1}=e,c=!1,l=!1;a&&i.on("StepCompleted",async(p,b,g,y)=>{p==f.orderId&&b==f.creator&&g==2&&(console.log(y),te(pe,s=ie.Completed,s),te(ge,r=se.Completed,r),t(2,l=!0),i.removeAllListeners())});async function u(){(await(await i.validateAndCompleteTheSwap(f.orderId)).wait()).status==1&&t(1,c=!0)}const h=()=>u();return n.$$set=p=>{"isCreator"in p&&t(0,a=p.isCreator)},[a,c,l,u,h]}class zl extends ve{constructor(e){super(),ke(this,e,Tp,Cp,me,{isCreator:0})}}function Ip(n){let e;return{c(){e=T("div"),e.innerHTML='

Order Completed!!!

',S(e,"class","col-span-2 ")},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function _p(n){let e,t,f,r,s=n[2].creator+"",i,o,a,c,l,u,h,p,b,g,y,w=(n[2].partner!="0x0000000000000000000000000000000000000000"&&n[2].partner?n[2].partner:"waiting...")+"",_,U,M,k,v,x,N;const z=[Rp,Sp,Op,Pp,Np],V=[];function fe(P,$){return P[1]==se.WaitingForPartnerJoin?0:P[1]==se.AllowingAutonomousSwap||P[1]==se.WaitingPartnerAllowance?1:P[1]==se.SendingTokens?2:P[1]==se.WaitingPartnersTransfer?3:P[1]==se.Completed?4:-1}~(l=fe(n))&&(u=V[l]=z[l](n));const ee=[Lp,Dp,Up,Fp,Bp],be=[];function je(P,$){return P[0]==null?0:P[0]==ie.WaitingFirstConfirmation?1:P[0]==ie.AllowingAutonomousSwap||P[0]==ie.WaitingCreatorAllowance?2:P[0]==ie.WaitingCreatorsFunding?3:P[0]==ie.Completed?4:-1}return~(v=je(n))&&(x=be[v]=ee[v](n)),{c(){e=T("div"),t=T("h1"),f=T("strong"),f.textContent="Creator:",r=Q(),i=ne(s),o=Q(),a=T("hr"),c=Q(),u&&u.c(),h=Q(),p=T("div"),b=T("h1"),g=T("strong"),g.textContent="Partner:",y=Q(),_=ne(w),U=Q(),M=T("hr"),k=Q(),x&&x.c(),S(t,"class","pb-5"),S(a,"class","mb-5 h-0.5 bg-black"),S(b,"class","pb-5"),S(M,"class","mb-5 h-0.5 bg-black")},m(P,$){F(P,e,$),E(e,t),E(t,f),E(t,r),E(t,i),E(e,o),E(e,a),E(e,c),~l&&V[l].m(e,null),F(P,h,$),F(P,p,$),E(p,b),E(b,g),E(b,y),E(b,_),E(p,U),E(p,M),E(p,k),~v&&be[v].m(p,null),N=!0},p(P,$){(!N||$&4)&&s!==(s=P[2].creator+"")&&Ne(i,s);let L=l;l=fe(P),l!==L&&(u&&(de(),R(V[L],1,1,()=>{V[L]=null}),he()),~l?(u=V[l],u||(u=V[l]=z[l](P),u.c()),O(u,1),u.m(e,null)):u=null),(!N||$&4)&&w!==(w=(P[2].partner!="0x0000000000000000000000000000000000000000"&&P[2].partner?P[2].partner:"waiting...")+"")&&Ne(_,w);let re=v;v=je(P),v===re?~v&&be[v].p(P,$):(x&&(de(),R(be[re],1,1,()=>{be[re]=null}),he()),~v?(x=be[v],x?x.p(P,$):(x=be[v]=ee[v](P),x.c()),O(x,1),x.m(p,null)):x=null)},i(P){N||(O(u),O(x),N=!0)},o(P){R(u),R(x),N=!1},d(P){P&&B(e),~l&&V[l].d(),P&&B(h),P&&B(p),~v&&be[v].d()}}}function Np(n){let e;return{c(){e=T("p"),e.textContent="Finished!"},m(t,f){F(t,e,f)},i:J,o:J,d(t){t&&B(e)}}}function Pp(n){let e;return{c(){e=T("p"),e.textContent="Finished! Now, just await for the partner."},m(t,f){F(t,e,f)},i:J,o:J,d(t){t&&B(e)}}}function Op(n){let e,t;return e=new zl({props:{isCreator:!0}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Sp(n){let e,t;return e=new Jl({props:{isCreator:!0}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Rp(n){let e,t;return e=new Hl({props:{isCreator:!0}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Bp(n){let e;return{c(){e=T("p"),e.textContent="Finished!"},m(t,f){F(t,e,f)},p:J,i:J,o:J,d(t){t&&B(e)}}}function Fp(n){let e,t;return e=new zl({}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p:J,i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Up(n){let e,t,f,r;e=new Jl({});let s=n[1]==se.WaitingPartnerAllowance&&n[0]==ie.WaitingCreatorAllowance&&Ma(n);return{c(){X(e.$$.fragment),t=Q(),s&&s.c(),f=De()},m(i,o){Z(e,i,o),F(i,t,o),s&&s.m(i,o),F(i,f,o),r=!0},p(i,o){i[1]==se.WaitingPartnerAllowance&&i[0]==ie.WaitingCreatorAllowance?s?(s.p(i,o),o&3&&O(s,1)):(s=Ma(i),s.c(),O(s,1),s.m(f.parentNode,f)):s&&(de(),R(s,1,1,()=>{s=null}),he())},i(i){r||(O(e.$$.fragment,i),O(s),r=!0)},o(i){R(e.$$.fragment,i),R(s),r=!1},d(i){Y(e,i),i&&B(t),s&&s.d(i),i&&B(f)}}}function Dp(n){let e,t;return e=new Hl({}),e.$on("click",n[3]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p:J,i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Lp(n){let e,t;return e=new lp({props:{$$slots:{default:[$p]},$$scope:{ctx:n}}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,r){const s={};r&32&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Ma(n){let e,t;return e=new zt({props:{isStep:!0,$$slots:{default:[Mp]},$$scope:{ctx:n}}}),e.$on("click",n[4]),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,r){const s={};r&32&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Mp(n){let e;return{c(){e=ne("Next Step")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function $p(n){let e;return{c(){e=ne("partner.")},m(t,f){F(t,e,f)},d(t){t&&B(e)}}}function Gp(n){let e,t,f,r;const s=[_p,Ip],i=[];function o(a,c){return a[0]==ie.Completed&&a[1]==se.Completed?1:0}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,c){let l=e;e=o(a),e===l?i[e].p(a,c):(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t?t.p(a,c):(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function Qp(n){let e,t;return e=new $l({props:{$$slots:{default:[Gp]},$$scope:{ctx:n}}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,[r]){const s={};r&39&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Hp(n,e,t){let f,r,s;return K(n,pe,a=>t(0,f=a)),K(n,ge,a=>t(1,r=a)),K(n,Ue,a=>t(2,s=a)),[f,r,s,()=>{te(ge,r=se.AllowingAutonomousSwap,r),te(pe,f=ie.AllowingAutonomousSwap,f)},()=>{te(ge,r=se.SendingTokens,r),te(pe,f=ie.WaitingCreatorsFunding,f)}]}class Jp extends ve{constructor(e){super(),ke(this,e,Hp,Qp,me,{})}}function $a(n){let e,t;return e=new Id({}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Ga(n){let e,t;return e=new Fd({}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Qa(n){let e,t;return e=new ep({}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Ha(n){let e,t;return e=new jd({}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Ja(n){let e,t,f,r;const s=[Vp,zp],i=[];function o(a,c){return a[1].isCreator?0:1}return e=o(n),t=i[e]=s[e](n),{c(){t.c(),f=De()},m(a,c){i[e].m(a,c),F(a,f,c),r=!0},p(a,c){let l=e;e=o(a),e!==l&&(de(),R(i[l],1,1,()=>{i[l]=null}),he(),t=i[e],t||(t=i[e]=s[e](a),t.c()),O(t,1),t.m(f.parentNode,f))},i(a){r||(O(t),r=!0)},o(a){R(t),r=!1},d(a){i[e].d(a),a&&B(f)}}}function zp(n){let e,t;return e=new Jp({}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Vp(n){let e,t;return e=new qh({}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Kp(n){let e,t,f,r,s,i,o=n[0]<=1&&$a(),a=n[0]==et.CreatingOrder&&Ga(),c=n[0]==et.ReturningToOrder&&Qa(),l=n[0]==et.JoiningOrder&&Ha(),u=n[1]!=null&&Ja(n);return{c(){o&&o.c(),e=Q(),a&&a.c(),t=Q(),c&&c.c(),f=Q(),l&&l.c(),r=Q(),u&&u.c(),s=De()},m(h,p){o&&o.m(h,p),F(h,e,p),a&&a.m(h,p),F(h,t,p),c&&c.m(h,p),F(h,f,p),l&&l.m(h,p),F(h,r,p),u&&u.m(h,p),F(h,s,p),i=!0},p(h,p){h[0]<=1?o?p&1&&O(o,1):(o=$a(),o.c(),O(o,1),o.m(e.parentNode,e)):o&&(de(),R(o,1,1,()=>{o=null}),he()),h[0]==et.CreatingOrder?a?p&1&&O(a,1):(a=Ga(),a.c(),O(a,1),a.m(t.parentNode,t)):a&&(de(),R(a,1,1,()=>{a=null}),he()),h[0]==et.ReturningToOrder?c?p&1&&O(c,1):(c=Qa(),c.c(),O(c,1),c.m(f.parentNode,f)):c&&(de(),R(c,1,1,()=>{c=null}),he()),h[0]==et.JoiningOrder?l?p&1&&O(l,1):(l=Ha(),l.c(),O(l,1),l.m(r.parentNode,r)):l&&(de(),R(l,1,1,()=>{l=null}),he()),h[1]!=null?u?(u.p(h,p),p&2&&O(u,1)):(u=Ja(h),u.c(),O(u,1),u.m(s.parentNode,s)):u&&(de(),R(u,1,1,()=>{u=null}),he())},i(h){i||(O(o),O(a),O(c),O(l),O(u),i=!0)},o(h){R(o),R(a),R(c),R(l),R(u),i=!1},d(h){o&&o.d(h),h&&B(e),a&&a.d(h),h&&B(t),c&&c.d(h),h&&B(f),l&&l.d(h),h&&B(r),u&&u.d(h),h&&B(s)}}}function jp(n){let e,t;return e=new wd({props:{$$slots:{default:[Kp]},$$scope:{ctx:n}}}),{c(){X(e.$$.fragment)},m(f,r){Z(e,f,r),t=!0},p(f,[r]){const s={};r&11&&(s.$$scope={dirty:r,ctx:f}),e.$set(s)},i(f){t||(O(e.$$.fragment,f),t=!0)},o(f){R(e.$$.fragment,f),t=!1},d(f){Y(e,f)}}}function Wp(n,e,t){let f,r,s;return K(n,ft,i=>t(2,f=i)),K(n,At,i=>t(0,r=i)),K(n,Ue,i=>t(1,s=i)),qa(async()=>{const i="https://ethereum-sepolia.publicnode.com",o="0x9a642b656ea04452AbA6e85e11f669a782E5B226",a=new pd(i),c=new Oe(o,Jd.abi,a);te(ft,f=c,f)}),[r,s]}class qp extends ve{constructor(e){super(),ke(this,e,Wp,jp,me,{})}}new qp({target:document.body}); diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 0000000..d75d248 Binary files /dev/null and b/docs/favicon.ico differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..272819a --- /dev/null +++ b/docs/index.html @@ -0,0 +1,19 @@ + + + + + + + + + + + AutonomousSwap + + + + +
+ + +