From f0bcd0b2765a3acb3511ec3d01c60b447fe6d471 Mon Sep 17 00:00:00 2001 From: Nikos Kontakis Date: Mon, 19 Aug 2024 17:30:09 +0200 Subject: [PATCH] Fix the deploy --- build/assets/index-CNEnG0qc.css | 1 + build/assets/index-Zdx1howR.css | 1 - .../assets/{index-DWlyYl-p.js => index-eE1c8fa1.js} | 4 ++-- build/index.html | 7 +++---- index.html | 3 +-- src/consts.ts | 13 ++++++------- 6 files changed, 13 insertions(+), 16 deletions(-) create mode 100644 build/assets/index-CNEnG0qc.css delete mode 100644 build/assets/index-Zdx1howR.css rename build/assets/{index-DWlyYl-p.js => index-eE1c8fa1.js} (87%) diff --git a/build/assets/index-CNEnG0qc.css b/build/assets/index-CNEnG0qc.css new file mode 100644 index 0000000..6f66c96 --- /dev/null +++ b/build/assets/index-CNEnG0qc.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}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,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;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{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-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,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}@font-face{font-family:Unbounded;font-style:normal;font-weight:400;font-display:swap;src:local("Unbounded"),url(/dashboard/assets/Unbounded-Regular-BjnQqn8k.ttf) format("ttf")}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--primary: 328 100% 45%;--primary-foreground: 355.7 100% 97.3%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 328 100% 45%;--radius: .5rem;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%}.dark{--background: 20 14.3% 4.1%;--foreground: 0 0% 95%;--card: 24 9.8% 10%;--card-foreground: 0 0% 95%;--popover: 0 0% 9%;--popover-foreground: 0 0% 95%;--primary: 328 100% 45%;--primary-foreground: 355.7 100% 97.3%;--secondary: 240 3.7% 15.9%;--secondary-foreground: 0 0% 98%;--muted: 0 0% 15%;--muted-foreground: 240 5% 64.9%;--accent: 12 6.5% 15.1%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 85.7% 97.3%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--ring: 328 100% 45%;--chart-1: 220 70% 50%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:before,:after{--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: rgb(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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: rgb(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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.left-0{left:0}.left-2{left:.5rem}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.z-10{z-index:10}.z-30{z-index:30}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-0{margin-left:0;margin-right:0}.my-1{margin-top:.25rem;margin-bottom:.25rem}.ml-auto{margin-left:auto}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-9{height:2.25rem}.h-\[1\.2rem\]{height:1.2rem}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:24rem}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-72{width:18rem}.w-9{width:2.25rem}.w-\[1\.2rem\]{width:1.2rem}.w-full{width:100%}.min-w-\[12rem\]{min-width:12rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.rotate-0{--tw-rotate: 0deg;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-90{--tw-rotate: 90deg;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-0{--tw-scale-x: 0;--tw-scale-y: 0;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-100{--tw-scale-x: 1;--tw-scale-y: 1;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))}.cursor-default{cursor:default}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-input{border-color:hsl(var(--input))}.border-transparent{border-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-black\/80{background-color:#000c}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/40{background-color:hsl(var(--muted) / .4)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.fill-current{fill:currentColor}.p-1{padding:.25rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pt-0{padding-top:0}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-unbounded{font-family:Unbounded,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.invert{--tw-invert: invert(100%);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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2: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(2px + 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\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2: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(2px + 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-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;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))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;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))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;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))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;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))}.data-\[state\=on\]\:bg-accent[data-state=on],.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=on\]\:text-accent-foreground[data-state=on],.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.dark\:-rotate-90:is(.dark *){--tw-rotate: -90deg;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))}.dark\:rotate-0:is(.dark *){--tw-rotate: 0deg;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))}.dark\:scale-0:is(.dark *){--tw-scale-x: 0;--tw-scale-y: 0;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))}.dark\:scale-100:is(.dark *){--tw-scale-x: 1;--tw-scale-y: 1;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))}@media (min-width: 640px){.sm\:sticky{position:sticky}.sm\:mx-\[5\%\]{margin-left:5%;margin-right:5%}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-auto{height:auto}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-xs{max-width:20rem}.sm\:grow-0{flex-grow:0}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:gap-4{gap:1rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:border-0{border-width:0px}.sm\:bg-transparent{background-color:transparent}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-0{padding-top:0;padding-bottom:0}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}.sm\:pl-14{padding-left:3.5rem}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:h-8{height:2rem}.md\:w-8{width:2rem}.md\:gap-8{gap:2rem}}@media (min-width: 1280px){.xl\:mx-\[20\%\]{margin-left:20%;margin-right:20%}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px} diff --git a/build/assets/index-Zdx1howR.css b/build/assets/index-Zdx1howR.css deleted file mode 100644 index f2710d2..0000000 --- a/build/assets/index-Zdx1howR.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}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,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;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{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-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,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}@font-face{font-family:Unbounded;font-style:normal;font-weight:400;font-display:swap;src:local("Unbounded"),url(/assets/Unbounded-Regular-BjnQqn8k.ttf) format("ttf")}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--primary: 328 100% 45%;--primary-foreground: 355.7 100% 97.3%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--ring: 328 100% 45%;--radius: .5rem;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%}.dark{--background: 20 14.3% 4.1%;--foreground: 0 0% 95%;--card: 24 9.8% 10%;--card-foreground: 0 0% 95%;--popover: 0 0% 9%;--popover-foreground: 0 0% 95%;--primary: 328 100% 45%;--primary-foreground: 355.7 100% 97.3%;--secondary: 240 3.7% 15.9%;--secondary-foreground: 0 0% 98%;--muted: 0 0% 15%;--muted-foreground: 240 5% 64.9%;--accent: 12 6.5% 15.1%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 85.7% 97.3%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--ring: 328 100% 45%;--chart-1: 220 70% 50%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:before,:after{--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: rgb(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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::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: rgb(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: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.left-0{left:0}.left-2{left:.5rem}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.z-10{z-index:10}.z-30{z-index:30}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-0{margin-left:0;margin-right:0}.my-1{margin-top:.25rem;margin-bottom:.25rem}.ml-auto{margin-left:auto}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-9{height:2.25rem}.h-\[1\.2rem\]{height:1.2rem}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:24rem}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-72{width:18rem}.w-9{width:2.25rem}.w-\[1\.2rem\]{width:1.2rem}.w-full{width:100%}.min-w-\[12rem\]{min-width:12rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.rotate-0{--tw-rotate: 0deg;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-90{--tw-rotate: 90deg;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-0{--tw-scale-x: 0;--tw-scale-y: 0;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-100{--tw-scale-x: 1;--tw-scale-y: 1;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))}.cursor-default{cursor:default}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-input{border-color:hsl(var(--input))}.border-transparent{border-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-black\/80{background-color:#000c}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/40{background-color:hsl(var(--muted) / .4)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.fill-current{fill:currentColor}.p-1{padding:.25rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pt-0{padding-top:0}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-unbounded{font-family:Unbounded,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.invert{--tw-invert: invert(100%);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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2: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(2px + 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\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2: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(2px + 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-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;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))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;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))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;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))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;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))}.data-\[state\=on\]\:bg-accent[data-state=on],.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=on\]\:text-accent-foreground[data-state=on],.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:hsl(var(--accent-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.dark\:-rotate-90:is(.dark *){--tw-rotate: -90deg;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))}.dark\:rotate-0:is(.dark *){--tw-rotate: 0deg;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))}.dark\:scale-0:is(.dark *){--tw-scale-x: 0;--tw-scale-y: 0;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))}.dark\:scale-100:is(.dark *){--tw-scale-x: 1;--tw-scale-y: 1;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))}@media (min-width: 640px){.sm\:sticky{position:sticky}.sm\:mx-\[5\%\]{margin-left:5%;margin-right:5%}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-auto{height:auto}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-xs{max-width:20rem}.sm\:grow-0{flex-grow:0}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:gap-4{gap:1rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:border-0{border-width:0px}.sm\:bg-transparent{background-color:transparent}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-0{padding-top:0;padding-bottom:0}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}.sm\:pl-14{padding-left:3.5rem}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:h-8{height:2rem}.md\:w-8{width:2rem}.md\:gap-8{gap:2rem}}@media (min-width: 1280px){.xl\:mx-\[20\%\]{margin-left:20%;margin-right:20%}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px} diff --git a/build/assets/index-DWlyYl-p.js b/build/assets/index-eE1c8fa1.js similarity index 87% rename from build/assets/index-DWlyYl-p.js rename to build/assets/index-eE1c8fa1.js index fecfeb0..f3e5081 100644 --- a/build/assets/index-DWlyYl-p.js +++ b/build/assets/index-eE1c8fa1.js @@ -184,9 +184,9 @@ Error generating stack: `+i.message+` If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aA="DialogDescriptionWarning",lA=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${px(aA).contentName}}.`;return y.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},cA=J1,uA=tx,dA=rx,hx=ox,mx=ix,vx=ax,gx=cx,fA=dx;const pA=cA,hA=uA,mA=dA,yx=y.forwardRef(({className:e,...t},n)=>E.jsx(hx,{className:be("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));yx.displayName=hx.displayName;const vA=vw("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),wx=y.forwardRef(({side:e="right",className:t,children:n,...r},o)=>E.jsxs(mA,{children:[E.jsx(yx,{}),E.jsxs(mx,{ref:o,className:be(vA({side:e}),t),...r,children:[n,E.jsxs(fA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[E.jsx(xR,{className:"h-4 w-4"}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wx.displayName=mx.displayName;const gA=y.forwardRef(({className:e,...t},n)=>E.jsx(vx,{ref:n,className:be("text-lg font-semibold text-foreground",e),...t}));gA.displayName=vx.displayName;const yA=y.forwardRef(({className:e,...t},n)=>E.jsx(gx,{ref:n,className:be("text-sm text-muted-foreground",e),...t}));yA.displayName=gx.displayName;var bc="Menubar",[Vd,wA,xA]=pp(bc),[xx,kL]=Lr(bc,[xA,gc]),ht=gp(),bx=gc(),[bA,Ap]=xx(bc),Ex=y.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:o,defaultValue:i,loop:s=!0,dir:a,...l}=e,c=hp(a),d=bx(n),[f="",u]=$s({prop:r,onChange:o,defaultProp:i}),[p,h]=y.useState(null);return E.jsx(bA,{scope:n,value:f,onMenuOpen:y.useCallback(m=>{u(m),h(m)},[u]),onMenuClose:y.useCallback(()=>u(""),[u]),onMenuToggle:y.useCallback(m=>{u(w=>w?"":m),h(m)},[u]),dir:c,loop:s,children:E.jsx(Vd.Provider,{scope:n,children:E.jsx(Vd.Slot,{scope:n,children:E.jsx(Tw,{asChild:!0,...d,orientation:"horizontal",loop:s,dir:c,currentTabStopId:p,onCurrentTabStopIdChange:h,children:E.jsx(ke.div,{role:"menubar",...l,ref:t})})})})})});Ex.displayName=bc;var Tp="MenubarMenu",[EA,Sx]=xx(Tp),kx=e=>{const{__scopeMenubar:t,value:n,...r}=e,o=wn(),i=n||o||"LEGACY_REACT_AUTO_VALUE",s=Ap(Tp,t),a=ht(t),l=y.useRef(null),c=y.useRef(!1),d=s.value===i;return y.useEffect(()=>{d||(c.current=!1)},[d]),E.jsx(EA,{scope:t,value:i,triggerId:wn(),triggerRef:l,contentId:wn(),wasKeyboardTriggerOpenRef:c,children:E.jsx(d1,{...a,open:d,onOpenChange:f=>{f||s.onMenuClose()},modal:!1,dir:s.dir,...r})})};kx.displayName=Tp;var Hd="MenubarTrigger",Cx=y.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...o}=e,i=bx(n),s=ht(n),a=Ap(Hd,n),l=Sx(Hd,n),c=y.useRef(null),d=Oe(t,c,l.triggerRef),[f,u]=y.useState(!1),p=a.value===l.value;return E.jsx(Vd.ItemSlot,{scope:n,value:l.value,disabled:r,children:E.jsx(Mw,{asChild:!0,...i,focusable:!r,tabStopId:l.value,children:E.jsx(f1,{asChild:!0,...s,children:E.jsx(ke.button,{type:"button",role:"menuitem",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":p,"aria-controls":p?l.contentId:void 0,"data-highlighted":f?"":void 0,"data-state":p?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:d,onPointerDown:K(e.onPointerDown,h=>{!r&&h.button===0&&h.ctrlKey===!1&&(a.onMenuOpen(l.value),p||h.preventDefault())}),onPointerEnter:K(e.onPointerEnter,()=>{var m;!!a.value&&!p&&(a.onMenuOpen(l.value),(m=c.current)==null||m.focus())}),onKeyDown:K(e.onKeyDown,h=>{r||(["Enter"," "].includes(h.key)&&a.onMenuToggle(l.value),h.key==="ArrowDown"&&a.onMenuOpen(l.value),["Enter"," ","ArrowDown"].includes(h.key)&&(l.wasKeyboardTriggerOpenRef.current=!0,h.preventDefault()))}),onFocus:K(e.onFocus,()=>u(!0)),onBlur:K(e.onBlur,()=>u(!1))})})})})});Cx.displayName=Hd;var SA="MenubarPortal",_x=e=>{const{__scopeMenubar:t,...n}=e,r=ht(t);return E.jsx(p1,{...r,...n})};_x.displayName=SA;var Gd="MenubarContent",Rx=y.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...o}=e,i=ht(n),s=Ap(Gd,n),a=Sx(Gd,n),l=wA(n),c=y.useRef(!1);return E.jsx(h1,{id:a.contentId,"aria-labelledby":a.triggerId,"data-radix-menubar-content":"",...i,...o,ref:t,align:r,onCloseAutoFocus:K(e.onCloseAutoFocus,d=>{var u;!!!s.value&&!c.current&&((u=a.triggerRef.current)==null||u.focus()),c.current=!1,d.preventDefault()}),onFocusOutside:K(e.onFocusOutside,d=>{const f=d.target;l().some(p=>{var h;return(h=p.ref.current)==null?void 0:h.contains(f)})&&d.preventDefault()}),onInteractOutside:K(e.onInteractOutside,()=>{c.current=!0}),onEntryFocus:d=>{a.wasKeyboardTriggerOpenRef.current||d.preventDefault()},onKeyDown:K(e.onKeyDown,d=>{if(["ArrowRight","ArrowLeft"].includes(d.key)){const f=d.target,u=f.hasAttribute("data-radix-menubar-subtrigger"),p=f.closest("[data-radix-menubar-content]")!==d.currentTarget,m=(s.dir==="rtl"?"ArrowRight":"ArrowLeft")===d.key;if(!m&&u||p&&m)return;let g=l().filter(S=>!S.disabled).map(S=>S.value);m&&g.reverse();const x=g.indexOf(a.value);g=s.loop?DA(g,x+1):g.slice(x+1);const[b]=g;b&&s.onMenuOpen(b)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});Rx.displayName=Gd;var kA="MenubarGroup",CA=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(m1,{...o,...r,ref:t})});CA.displayName=kA;var _A="MenubarLabel",Px=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(v1,{...o,...r,ref:t})});Px.displayName=_A;var RA="MenubarItem",Ix=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(g1,{...o,...r,ref:t})});Ix.displayName=RA;var PA="MenubarCheckboxItem",Ax=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(y1,{...o,...r,ref:t})});Ax.displayName=PA;var IA="MenubarRadioGroup",AA=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(w1,{...o,...r,ref:t})});AA.displayName=IA;var TA="MenubarRadioItem",Tx=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(x1,{...o,...r,ref:t})});Tx.displayName=TA;var MA="MenubarItemIndicator",Mx=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(b1,{...o,...r,ref:t})});Mx.displayName=MA;var OA="MenubarSeparator",Ox=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(E1,{...o,...r,ref:t})});Ox.displayName=OA;var NA="MenubarArrow",LA=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(S1,{...o,...r,ref:t})});LA.displayName=NA;var jA="MenubarSubTrigger",Nx=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(k1,{"data-radix-menubar-subtrigger":"",...o,...r,ref:t})});Nx.displayName=jA;var $A="MenubarSubContent",Lx=y.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=ht(n);return E.jsx(C1,{...o,"data-radix-menubar-content":"",...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});Lx.displayName=$A;function DA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jx=Ex,BA=kx,$x=Cx,zA=_x,Dx=Rx,Bx=Px,zx=Ix,Fx=Ax,Ux=Tx,Wx=Mx,Vx=Ox,Hx=Nx,Gx=Lx;const FA=BA,Kx=y.forwardRef(({className:e,...t},n)=>E.jsx(jx,{ref:n,className:be("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",e),...t}));Kx.displayName=jx.displayName;const Yx=y.forwardRef(({className:e,...t},n)=>E.jsx($x,{ref:n,className:be("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e),...t}));Yx.displayName=$x.displayName;const UA=y.forwardRef(({className:e,inset:t,children:n,...r},o)=>E.jsxs(Hx,{ref:o,className:be("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,E.jsx(aw,{className:"ml-auto h-4 w-4"})]}));UA.displayName=Hx.displayName;const WA=y.forwardRef(({className:e,...t},n)=>E.jsx(Gx,{ref:n,className:be("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));WA.displayName=Gx.displayName;const Xx=y.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,...o},i)=>E.jsx(zA,{children:E.jsx(Dx,{ref:i,align:t,alignOffset:n,sideOffset:r,className:be("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Xx.displayName=Dx.displayName;const Fi=y.forwardRef(({className:e,inset:t,...n},r)=>E.jsx(zx,{ref:r,className:be("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Fi.displayName=zx.displayName;const VA=y.forwardRef(({className:e,children:t,checked:n,...r},o)=>E.jsxs(Fx,{ref:o,className:be("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[E.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:E.jsx(Wx,{children:E.jsx(sw,{className:"h-4 w-4"})})}),t]}));VA.displayName=Fx.displayName;const HA=y.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(Ux,{ref:r,className:be("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[E.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:E.jsx(Wx,{children:E.jsx(lw,{className:"h-2 w-2 fill-current"})})}),t]}));HA.displayName=Ux.displayName;const GA=y.forwardRef(({className:e,inset:t,...n},r)=>E.jsx(Bx,{ref:r,className:be("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));GA.displayName=Bx.displayName;const Kd=y.forwardRef(({className:e,...t},n)=>E.jsx(Vx,{ref:n,className:be("-mx-1 my-1 h-px bg-muted",e),...t}));Kd.displayName=Vx.displayName;const Qx=({className:e,...t})=>E.jsx("span",{className:be("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Qx.displayname="MenubarShortcut";const KA=()=>E.jsxs("header",{className:"sticky top-0 z-30 flex h-14 items-center gap-4 border-b bg-background px-4 sm:sticky sm:h-auto sm:border-0 sm:bg-transparent sm:px-6",children:[E.jsxs(pA,{children:[E.jsx(hA,{asChild:!0,children:E.jsxs(Ss,{size:"icon",variant:"outline",className:"sm:hidden",children:[E.jsx(vR,{className:"h-5 w-5"}),E.jsx("span",{className:"sr-only",children:"Toggle Menu"})]})}),E.jsx(wx,{side:"left",className:"sm:max-w-xs",children:E.jsxs("nav",{className:"grid gap-6 text-lg font-medium",children:[hw.map(e=>E.jsxs("a",{href:`/${e.link||""}`,className:"flex items-center gap-4 px-2.5 text-muted-foreground hover:text-foreground",children:[E.jsx(e.icon,{className:"h-5 w-5"}),e.name]},e.name)),E.jsxs("a",{href:"#",className:"flex items-center gap-4 px-2.5 text-muted-foreground hover:text-foreground",children:[E.jsx(gR,{className:"h-5 w-5"}),"Settings"]})]})})]}),E.jsxs("div",{className:"flex justify-between w-full",children:[E.jsx("div",{children:E.jsx(Kx,{children:E.jsxs(FA,{children:[E.jsx(Yx,{children:"File"}),E.jsxs(Xx,{children:[E.jsxs(Fi,{children:["New Tab ",E.jsx(Qx,{children:"⌘T"})]}),E.jsx(Fi,{children:"New Window"}),E.jsx(Kd,{}),E.jsx(Fi,{children:"Share"}),E.jsx(Kd,{}),E.jsx(Fi,{children:"Print"})]})]})})}),E.jsx("div",{className:"",children:E.jsxs(XI,{children:[E.jsx(QI,{asChild:!0,children:E.jsx(Ss,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full",children:E.jsx(QP,{copy:!0,size:36,address:"5CoZdwD8KpAaax4oD5bKgHy23wkVKpwuaf9Gb2HTeZQaDijr"})})}),E.jsxs(Q1,{align:"end",children:[E.jsx(q1,{children:"My Account"}),E.jsx(Wd,{}),E.jsx(Ka,{children:"Settings"}),E.jsx(Ka,{children:"Support"}),E.jsx(Wd,{}),E.jsx(Ka,{children:"Logout"})]})]})})]})]});var rv=["light","dark"],YA="(prefers-color-scheme: dark)",XA=y.createContext(void 0),QA={setTheme:e=>{},themes:[]},qA=()=>{var e;return(e=y.useContext(XA))!=null?e:QA};y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:s,attrs:a,nonce:l})=>{let c=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(h=>`'${h}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=o?rv.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",u=(h,m=!1,w=!0)=>{let v=s?s[h]:h,g=m?h+"|| ''":`'${v}'`,x="";return o&&w&&!m&&rv.includes(h)&&(x+=`d.style.colorScheme = '${h}';`),n==="class"?m||v?x+=`c.add(${g})`:x+="null":v&&(x+=`d[s](n,${g})`),x},p=e?`!function(){${d}${u(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${YA}',m=window.matchMedia(t);if(m.media!==t||m.matches){${u("dark")}}else{${u("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${u(s?"x[e]":"e",!0)}}${c?"":"else{"+u(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${u(s?"x[e]":"e",!0)}}else{${u(i,!1,!1)};}${f}}catch(t){}}();`;return y.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var ZA=e=>{switch(e){case"success":return tT;case"info":return rT;case"warning":return nT;case"error":return oT;default:return null}},JA=Array(12).fill(0),eT=({visible:e})=>N.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},N.createElement("div",{className:"sonner-spinner"},JA.map((t,n)=>N.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),tT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),nT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},N.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),rT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),oT=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),iT=()=>{let[e,t]=N.useState(document.hidden);return N.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Yd=1,sT=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Yd++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(async i=>{if(lT(i)&&!i.ok){o=!1;let s=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:s,description:a})}else if(t.success!==void 0){o=!1;let s=typeof t.success=="function"?await t.success(i):t.success,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:s,description:a})}}).catch(async i=>{if(t.error!==void 0){o=!1;let s=typeof t.error=="function"?await t.error(i):t.error,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:s,description:a})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Yd++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Rt=new sT,aT=(e,t)=>{let n=(t==null?void 0:t.id)||Yd++;return Rt.addToast({title:e,...t,id:n}),n},lT=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",cT=aT,uT=()=>Rt.toasts,dT=Object.assign(cT,{success:Rt.success,info:Rt.info,warning:Rt.warning,error:Rt.error,custom:Rt.custom,message:Rt.message,promise:Rt.promise,dismiss:Rt.dismiss,loading:Rt.loading},{getHistory:uT});function fT(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}fT(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);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;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function Ea(e){return e.label!==void 0}var pT=3,hT="32px",mT=4e3,vT=356,gT=14,yT=20,wT=200;function xT(...e){return e.filter(Boolean).join(" ")}var bT=e=>{var t,n,r,o,i,s,a,l,c,d;let{invert:f,toast:u,unstyled:p,interacting:h,setHeights:m,visibleToasts:w,heights:v,index:g,toasts:x,expanded:b,removeToast:S,defaultRichColors:C,closeButton:k,style:_,cancelButtonStyle:A,actionButtonStyle:I,className:O="",descriptionClassName:D="",duration:Y,position:Q,gap:H,loadingIcon:F,expandByDefault:G,classNames:R,icons:P,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:L,cn:W}=e,[ne,T]=N.useState(!1),[V,U]=N.useState(!1),[q,ve]=N.useState(!1),[ce,fe]=N.useState(!1),[je,jt]=N.useState(0),[Cn,wi]=N.useState(0),Hs=N.useRef(null),Xn=N.useRef(null),Mc=g===0,Oc=g+1<=w,He=u.type,wo=u.dismissible!==!1,Z2=u.className||"",J2=u.descriptionClassName||"",Gs=N.useMemo(()=>v.findIndex(Z=>Z.toastId===u.id)||0,[v,u.id]),eE=N.useMemo(()=>{var Z;return(Z=u.closeButton)!=null?Z:k},[u.closeButton,k]),oh=N.useMemo(()=>u.duration||Y||mT,[u.duration,Y]),Nc=N.useRef(0),xo=N.useRef(0),ih=N.useRef(0),bo=N.useRef(null),[sh,tE]=Q.split("-"),ah=N.useMemo(()=>v.reduce((Z,ge,he)=>he>=Gs?Z:Z+ge.height,0),[v,Gs]),lh=iT(),nE=u.invert||f,Lc=He==="loading";xo.current=N.useMemo(()=>Gs*H+ah,[Gs,ah]),N.useEffect(()=>{T(!0)},[]),N.useLayoutEffect(()=>{if(!ne)return;let Z=Xn.current,ge=Z.style.height;Z.style.height="auto";let he=Z.getBoundingClientRect().height;Z.style.height=ge,wi(he),m(cn=>cn.find(un=>un.toastId===u.id)?cn.map(un=>un.toastId===u.id?{...un,height:he}:un):[{toastId:u.id,height:he,position:u.position},...cn])},[ne,u.title,u.description,m,u.id]);let Qn=N.useCallback(()=>{U(!0),jt(xo.current),m(Z=>Z.filter(ge=>ge.toastId!==u.id)),setTimeout(()=>{S(u)},wT)},[u,S,m,xo]);N.useEffect(()=>{if(u.promise&&He==="loading"||u.duration===1/0||u.type==="loading")return;let Z,ge=oh;return b||h||L&&lh?(()=>{if(ih.current{var he;(he=u.onAutoClose)==null||he.call(u,u),Qn()},ge)),()=>clearTimeout(Z)},[b,h,G,u,oh,Qn,u.promise,He,L,lh]),N.useEffect(()=>{let Z=Xn.current;if(Z){let ge=Z.getBoundingClientRect().height;return wi(ge),m(he=>[{toastId:u.id,height:ge,position:u.position},...he]),()=>m(he=>he.filter(cn=>cn.toastId!==u.id))}},[m,u.id]),N.useEffect(()=>{u.delete&&Qn()},[Qn,u.delete]);function rE(){return P!=null&&P.loading?N.createElement("div",{className:"sonner-loader","data-visible":He==="loading"},P.loading):F?N.createElement("div",{className:"sonner-loader","data-visible":He==="loading"},F):N.createElement(eT,{visible:He==="loading"})}return N.createElement("li",{"aria-live":u.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Xn,className:W(O,Z2,R==null?void 0:R.toast,(t=u==null?void 0:u.classNames)==null?void 0:t.toast,R==null?void 0:R.default,R==null?void 0:R[He],(n=u==null?void 0:u.classNames)==null?void 0:n[He]),"data-sonner-toast":"","data-rich-colors":(r=u.richColors)!=null?r:C,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":ne,"data-promise":!!u.promise,"data-removed":V,"data-visible":Oc,"data-y-position":sh,"data-x-position":tE,"data-index":g,"data-front":Mc,"data-swiping":q,"data-dismissible":wo,"data-type":He,"data-invert":nE,"data-swipe-out":ce,"data-expanded":!!(b||G&&ne),style:{"--index":g,"--toasts-before":g,"--z-index":x.length-g,"--offset":`${V?je:xo.current}px`,"--initial-height":G?"auto":`${Cn}px`,..._,...u.style},onPointerDown:Z=>{Lc||!wo||(Hs.current=new Date,jt(xo.current),Z.target.setPointerCapture(Z.pointerId),Z.target.tagName!=="BUTTON"&&(ve(!0),bo.current={x:Z.clientX,y:Z.clientY}))},onPointerUp:()=>{var Z,ge,he,cn;if(ce||!wo)return;bo.current=null;let un=Number(((Z=Xn.current)==null?void 0:Z.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Ks=new Date().getTime()-((ge=Hs.current)==null?void 0:ge.getTime()),oE=Math.abs(un)/Ks;if(Math.abs(un)>=yT||oE>.11){jt(xo.current),(he=u.onDismiss)==null||he.call(u,u),Qn(),fe(!0);return}(cn=Xn.current)==null||cn.style.setProperty("--swipe-amount","0px"),ve(!1)},onPointerMove:Z=>{var ge;if(!bo.current||!wo)return;let he=Z.clientY-bo.current.y,cn=Z.clientX-bo.current.x,un=(sh==="top"?Math.min:Math.max)(0,he),Ks=Z.pointerType==="touch"?10:2;Math.abs(un)>Ks?(ge=Xn.current)==null||ge.style.setProperty("--swipe-amount",`${he}px`):Math.abs(cn)>Ks&&(bo.current=null)}},eE&&!u.jsx?N.createElement("button",{"aria-label":B,"data-disabled":Lc,"data-close-button":!0,onClick:Lc||!wo?()=>{}:()=>{var Z;Qn(),(Z=u.onDismiss)==null||Z.call(u,u)},className:W(R==null?void 0:R.closeButton,(o=u==null?void 0:u.classNames)==null?void 0:o.closeButton)},N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},N.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),N.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,u.jsx||N.isValidElement(u.title)?u.jsx||u.title:N.createElement(N.Fragment,null,He||u.icon||u.promise?N.createElement("div",{"data-icon":"",className:W(R==null?void 0:R.icon,(i=u==null?void 0:u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||rE():null,u.type!=="loading"?u.icon||(P==null?void 0:P[He])||ZA(He):null):null,N.createElement("div",{"data-content":"",className:W(R==null?void 0:R.content,(s=u==null?void 0:u.classNames)==null?void 0:s.content)},N.createElement("div",{"data-title":"",className:W(R==null?void 0:R.title,(a=u==null?void 0:u.classNames)==null?void 0:a.title)},u.title),u.description?N.createElement("div",{"data-description":"",className:W(D,J2,R==null?void 0:R.description,(l=u==null?void 0:u.classNames)==null?void 0:l.description)},u.description):null),N.isValidElement(u.cancel)?u.cancel:u.cancel&&Ea(u.cancel)?N.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:Z=>{var ge,he;Ea(u.cancel)&&wo&&((he=(ge=u.cancel).onClick)==null||he.call(ge,Z),Qn())},className:W(R==null?void 0:R.cancelButton,(c=u==null?void 0:u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,N.isValidElement(u.action)?u.action:u.action&&Ea(u.action)?N.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||I,onClick:Z=>{var ge,he;Ea(u.action)&&(Z.defaultPrevented||((he=(ge=u.action).onClick)==null||he.call(ge,Z),Qn()))},className:W(R==null?void 0:R.actionButton,(d=u==null?void 0:u.classNames)==null?void 0:d.actionButton)},u.action.label):null))};function ov(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var ET=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:d,style:f,visibleToasts:u=pT,toastOptions:p,dir:h=ov(),gap:m=gT,loadingIcon:w,icons:v,containerAriaLabel:g="Notifications",pauseWhenPageIsHidden:x,cn:b=xT}=e,[S,C]=N.useState([]),k=N.useMemo(()=>Array.from(new Set([n].concat(S.filter(L=>L.position).map(L=>L.position)))),[S,n]),[_,A]=N.useState([]),[I,O]=N.useState(!1),[D,Y]=N.useState(!1),[Q,H]=N.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=N.useRef(null),G=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=N.useRef(null),P=N.useRef(!1),B=N.useCallback(L=>{var W;(W=S.find(ne=>ne.id===L.id))!=null&&W.delete||Rt.dismiss(L.id),C(ne=>ne.filter(({id:T})=>T!==L.id))},[S]);return N.useEffect(()=>Rt.subscribe(L=>{if(L.dismiss){C(W=>W.map(ne=>ne.id===L.id?{...ne,delete:!0}:ne));return}setTimeout(()=>{d0.flushSync(()=>{C(W=>{let ne=W.findIndex(T=>T.id===L.id);return ne!==-1?[...W.slice(0,ne),{...W[ne],...L},...W.slice(ne+1)]:[L,...W]})})})}),[]),N.useEffect(()=>{if(l!=="system"){H(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:L})=>{H(L?"dark":"light")})},[l]),N.useEffect(()=>{S.length<=1&&O(!1)},[S]),N.useEffect(()=>{let L=W=>{var ne,T;r.every(V=>W[V]||W.code===V)&&(O(!0),(ne=F.current)==null||ne.focus()),W.code==="Escape"&&(document.activeElement===F.current||(T=F.current)!=null&&T.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[r]),N.useEffect(()=>{if(F.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,P.current=!1)}},[F.current]),S.length?N.createElement("section",{"aria-label":`${g} ${G}`,tabIndex:-1},k.map((L,W)=>{var ne;let[T,V]=L.split("-");return N.createElement("ol",{key:L,dir:h==="auto"?ov():h,tabIndex:-1,ref:F,className:s,"data-sonner-toaster":!0,"data-theme":Q,"data-y-position":T,"data-x-position":V,style:{"--front-toast-height":`${((ne=_[0])==null?void 0:ne.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||hT,"--width":`${vT}px`,"--gap":`${m}px`,...f},onBlur:U=>{P.current&&!U.currentTarget.contains(U.relatedTarget)&&(P.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||P.current||(P.current=!0,R.current=U.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{D||O(!1)},onPointerDown:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},S.filter(U=>!U.position&&W===0||U.position===L).map((U,q)=>{var ve,ce;return N.createElement(bT,{key:U.id,icons:v,index:q,toast:U,defaultRichColors:c,duration:(ve=p==null?void 0:p.duration)!=null?ve:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:u,closeButton:(ce=p==null?void 0:p.closeButton)!=null?ce:i,interacting:D,position:L,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:B,toasts:S.filter(fe=>fe.position==U.position),heights:_.filter(fe=>fe.position==U.position),setHeights:A,expandByDefault:o,gap:m,loadingIcon:w,expanded:I,pauseWhenPageIsHidden:x,cn:b})}))})):null};const ST=({...e})=>{const{theme:t="system"}=qA();return E.jsx(ET,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},kT=e=>{window.open(e,"_blank","noopener,noreferrer")},CT=({lcStatus:e})=>(console.log("Light client status:",e),E.jsxs("main",{className:"grid flex-1 items-start gap-4 p-4 sm:mx-[5%] xl:mx-[20%] mx-0 sm:px-6 sm:py-0 md:gap-8",children:[E.jsx("h1",{className:"font-unbounded text-primary flex-1 shrink-0 whitespace-nowrap text-xl font-semibold tracking-tight sm:grow-0",children:"Title"}),E.jsxs("div",{className:"pageTop",children:[E.jsx("p",{children:"text"}),E.jsx(Ss,{className:"mt-6",onClick:()=>kT(""),children:"ClickButton"})]}),E.jsx("div",{style:{paddingTop:"2rem"}})]})),_T="modulepreload",RT=function(e){return"/"+e},iv={},vi=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),s=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.all(n.map(a=>{if(a=RT(a),a in iv)return;iv[a]=!0;const l=a.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":_T,l||(d.as="script",d.crossOrigin=""),d.href=a,s&&d.setAttribute("nonce",s),document.head.appendChild(d),l)return new Promise((f,u)=>{d.addEventListener("load",f),d.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${a}`)))})}))}return o.then(()=>t()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};var PT=Object.defineProperty,IT=(e,t,n)=>t in e?PT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sv=(e,t,n)=>(IT(e,typeof t!="symbol"?t+"":t,n),n),wu={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function AT(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,o=new Uint8Array(r);t&&(o[0]=0|wu[e[2]]);for(let i=0;it=>e(t instanceof av?t:new av(t instanceof Uint8Array?t.buffer:typeof t=="string"?AT(t).buffer:t)),xn=e=>{const t=e.length;let n=0;for(let o=0;o{const n=[e,t];return n.enc=e,n.dec=t,n},zs=(e,t)=>n=>e(t(n)),Ec=(e,t)=>n=>t(e(n)),gi=([e,t],n,r)=>pe(zs(e,n),Ec(t,r));function TT(e,t){return Yt(n=>{const r=n.v[t](n.i,!0);return n.i+=e,r})}function MT(e,t){return n=>{const r=new Uint8Array(e);return new DataView(r.buffer)[t](0,n,!0),r}}function jr(e,t,n){return pe(MT(e,n),TT(e,t))}var Ne=jr(1,"getUint8","setUint8"),ao=jr(2,"getUint16","setUint16"),Kt=jr(4,"getUint32","setUint32"),Fs=jr(8,"getBigUint64","setBigUint64"),OT=jr(1,"getInt8","setInt8"),NT=jr(2,"getInt16","setInt16"),LT=jr(4,"getInt32","setInt32"),jT=jr(8,"getBigInt64","setBigInt64"),qx=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),t},Zx=e=>Yt(t=>{const{v:n,i:r}=t,o=n.getBigUint64(r,!0),i=n[e](r+8,!0);return t.i+=16,i<<64n|o}),Jx=pe(qx,Zx("getBigUint64")),$T=pe(qx,Zx("getBigInt64")),eb=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),n.setBigInt64(16,e>>128n,!0),n.setBigInt64(24,e>>192n,!0),t},tb=e=>Yt(t=>{let n=t.v.getBigUint64(t.i,!0);return t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<64n,t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<128n,t.i+=8,n|=t.v[e](t.i,!0)<<192n,t.i+=8,n}),DT=pe(eb,tb("getBigUint64")),BT=pe(eb,tb("getBigInt64")),Op=gi(Ne,e=>e?1:0,Boolean),zT=[Ne[1],ao[1],Kt[1]],FT=Yt(e=>{const t=e[e.i],n=t&3;if(n<3)return zT[n](e)>>>2;const r=(t>>>2)+4;e.i++;let o=0n;const i=r/8|0;let s=0n;for(let l=0;l3&&(o=BigInt(Kt[1](e))<1&&(o=BigInt(ao[1](e))<{if(e<0)throw new Error(`Wrong compact input (${e})`);const t=Number(e)<<2;if(e=UT;)n.push(Fs[0](r)),r>>=64n;r>=WT&&(n.push(Kt[0](Number(r&HT))),r>>=32n);let o=Number(r);o>=VT&&(n.push(ao[0](o)),o>>=16),o&&n.push(Ne[0](o));const i=xn(n);return i[0]=i.length-5<<2|3,i},Te=pe(XT,FT),QT=new TextEncoder,qT=e=>{const t=QT.encode(e);return xn([Te.enc(t.length),t])},ZT=new TextDecoder,JT=Yt(e=>{let t=Te.dec(e);const n=new DataView(e.buffer,e.i,t);return e.i+=t,ZT.decode(n)}),Ye=pe(qT,JT),eM=()=>{},tM=new Uint8Array(0),se=pe(()=>tM,eM),nb=e=>e===void 0?t=>xn([Te.enc(t.length),t]):t=>t.length===e?t:t.slice(0,e),rb=e=>Yt(t=>{const n=e===void 0?Te.dec(t):e!==1/0?e:t.byteLength-t.i,r=new Uint8Array(t.buffer.slice(t.i,t.i+n));return t.i+=n,r}),Qe=e=>pe(nb(e),rb(e));Qe.enc=nb;Qe.dec=rb;var ob=(e,t)=>{const n=Object.keys(e),r=new Map((t==null?void 0:t.map((i,s)=>[n[s],i]))??n.map((i,s)=>[i,s])),o=i=>r.get(i);return({tag:i,value:s})=>xn([Ne.enc(o(i)),e[i](s)])},ib=(e,t)=>{const n=Object.keys(e),r=new Map((t==null?void 0:t.map((o,i)=>[o,n[i]]))??n.map((o,i)=>[i,o]));return Yt(o=>{const i=Ne.dec(o),s=r.get(i),a=e[s];return{tag:s,value:a(o)}})},kn=(e,...t)=>pe(ob(Ol(e,([n])=>n),...t),ib(Ol(e,([,n])=>n),...t));kn.enc=ob;kn.dec=ib;var sb=e=>Yt(t=>{const n=Ne.dec(t);if(n!==0)return e===Op[1]?n===1:e(t)}),ab=e=>t=>{const n=new Uint8Array(1);return t===void 0?(n[0]=0,n):(n[0]=1,e===Op[0]?(n[0]=t?1:2,n):xn([n,e(t)]))},ut=e=>pe(ab(e[0]),sb(e[1]));ut.enc=ab;ut.dec=sb;var lb=(e,t)=>Yt(n=>{const r=Ne[1](n)===0,i=(r?e:t)(n);return{success:r,value:i}}),cb=(e,t)=>({success:n,value:r})=>xn([Ne[0](n?0:1),(n?e:t)(r)]),Sc=(e,t)=>pe(cb(e[0],t[0]),lb(e[1],t[1]));Sc.dec=lb;Sc.enc=cb;var ub=(...e)=>Yt(t=>e.map(n=>n(t))),db=(...e)=>t=>xn(e.map((n,r)=>n(t[r]))),St=(...e)=>pe(db(...e.map(([t])=>t)),ub(...e.map(([,t])=>t)));St.enc=db;St.dec=ub;var fb=e=>{const t=Object.keys(e);return zs(St.enc(...Object.values(e)),n=>t.map(r=>n[r]))},pb=e=>{const t=Object.keys(e);return Ec(St.dec(...Object.values(e)),n=>Object.fromEntries(n.map((r,o)=>[t[o],r])))},re=e=>pe(fb(Ol(e,t=>t[0])),pb(Ol(e,t=>t[1])));re.enc=fb;re.dec=pb;var hb=(e,t)=>t>=0?n=>xn(n.map(e)):n=>xn([Te.enc(n.length),xn(n.map(e))]),mb=(e,t)=>Yt(n=>{const r=t>=0?t:Te.dec(n),o=new Array(r);for(let i=0;ipe(hb(e[0],t),mb(e[1],t));le.enc=hb;le.dec=mb;/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function nM(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function rM(...e){const t=i=>i,n=(i,s)=>a=>i(s(a)),r=e.map(i=>i.encode).reduceRight(n,t),o=e.map(i=>i.decode).reduce(n,t);return{encode:r,decode:o}}function oM(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function iM(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function lv(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const o=[],i=Array.from(e);for(i.forEach(s=>{if(s<0||s>=t)throw new Error(`Wrong integer: ${s}`)});;){let s=0,a=!0;for(let l=r;l{if(!nM(t))throw new Error("radix.encode input should be Uint8Array");return lv(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(lv(t,e,2**8))}}}const aM=e=>rM(sM(58),oM(e),iM("")),vb=aM("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function qr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function lM(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function kc(e,...t){if(!lM(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function _s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Np(e,t){kc(e);const n=t.outputLen;if(e.lengthnew Uint8Array(e.buffer,e.byteOffset,e.byteLength),lo=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Nl=(e,t)=>e<<32-t|e>>>t,lt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,gb=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,In=lt?e=>e:e=>gb(e);function st(e){for(let t=0;te().update(Ln(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function fM(e){const t=(r,o)=>e(o).update(Ln(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}function pM(e){const t=(r,o)=>e(o).update(Ln(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}const hM=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class wb extends yb{constructor(t,n,r={},o,i,s){if(super(),this.blockLen=t,this.outputLen=n,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,qr(t),qr(n),qr(o),n<0||n>o)throw new Error("outputLen bigger than keyLen");if(r.key!==void 0&&(r.key.length<1||r.key.length>o))throw new Error(`key must be up 1..${o} byte long or undefined`);if(r.salt!==void 0&&r.salt.length!==i)throw new Error(`salt must be ${i} byte long or undefined`);if(r.personalization!==void 0&&r.personalization.length!==s)throw new Error(`personalization must be ${s} byte long or undefined`);this.buffer32=lo(this.buffer=new Uint8Array(t))}update(t){_s(this);const{blockLen:n,buffer:r,buffer32:o}=this;t=Ln(t);const i=t.length,s=t.byteOffset,a=t.buffer;for(let l=0;lo[s]=In(i))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:o,destroyed:i,outputLen:s,pos:a}=this;return t||(t=new this.constructor({dkLen:s})),t.set(...this.get()),t.length=r,t.finished=o,t.destroyed=i,t.outputLen=s,t.buffer.set(n),t.pos=a,t}}const Sa=BigInt(2**32-1),Xd=BigInt(32);function Ll(e,t=!1){return t?{h:Number(e&Sa),l:Number(e>>Xd&Sa)}:{h:Number(e>>Xd&Sa)|0,l:Number(e&Sa)|0}}function xb(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),vM=(e,t,n)=>e>>>n,gM=(e,t,n)=>e<<32-n|t>>>n,yM=(e,t,n)=>e>>>n|t<<32-n,wM=(e,t,n)=>e<<32-n|t>>>n,xM=(e,t,n)=>e<<64-n|t>>>n-32,bM=(e,t,n)=>e>>>n-32|t<<64-n,EM=(e,t)=>t,SM=(e,t)=>e,bb=(e,t,n)=>e<>>32-n,Eb=(e,t,n)=>t<>>32-n,Sb=(e,t,n)=>t<>>64-n,kb=(e,t,n)=>e<>>64-n;function kM(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}const CM=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),_M=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,RM=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),PM=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,IM=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0),AM=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,at={fromBig:Ll,split:xb,toBig:mM,shrSH:vM,shrSL:gM,rotrSH:yM,rotrSL:wM,rotrBH:xM,rotrBL:bM,rotr32H:EM,rotr32L:SM,rotlSH:bb,rotlSL:Eb,rotlBH:Sb,rotlBL:kb,add:kM,add3L:CM,add3H:_M,add4L:RM,add4H:PM,add5H:AM,add5L:IM},De=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),$=new Uint32Array(32);function nr(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=$[2*e],c=$[2*e+1],d=$[2*t],f=$[2*t+1],u=$[2*n],p=$[2*n+1],h=$[2*r],m=$[2*r+1],w=at.add3L(l,d,s);c=at.add3H(w,c,f,a),l=w|0,{Dh:m,Dl:h}={Dh:m^c,Dl:h^l},{Dh:m,Dl:h}={Dh:at.rotr32H(m,h),Dl:at.rotr32L(m,h)},{h:p,l:u}=at.add(p,u,m,h),{Bh:f,Bl:d}={Bh:f^p,Bl:d^u},{Bh:f,Bl:d}={Bh:at.rotrSH(f,d,24),Bl:at.rotrSL(f,d,24)},$[2*e]=l,$[2*e+1]=c,$[2*t]=d,$[2*t+1]=f,$[2*n]=u,$[2*n+1]=p,$[2*r]=h,$[2*r+1]=m}function rr(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=$[2*e],c=$[2*e+1],d=$[2*t],f=$[2*t+1],u=$[2*n],p=$[2*n+1],h=$[2*r],m=$[2*r+1],w=at.add3L(l,d,s);c=at.add3H(w,c,f,a),l=w|0,{Dh:m,Dl:h}={Dh:m^c,Dl:h^l},{Dh:m,Dl:h}={Dh:at.rotrSH(m,h,16),Dl:at.rotrSL(m,h,16)},{h:p,l:u}=at.add(p,u,m,h),{Bh:f,Bl:d}={Bh:f^p,Bl:d^u},{Bh:f,Bl:d}={Bh:at.rotrBH(f,d,63),Bl:at.rotrBL(f,d,63)},$[2*e]=l,$[2*e+1]=c,$[2*t]=d,$[2*t+1]=f,$[2*n]=u,$[2*n+1]=p,$[2*r]=h,$[2*r+1]=m}class TM extends wb{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=De[0]|0,this.v0h=De[1]|0,this.v1l=De[2]|0,this.v1h=De[3]|0,this.v2l=De[4]|0,this.v2h=De[5]|0,this.v3l=De[6]|0,this.v3h=De[7]|0,this.v4l=De[8]|0,this.v4h=De[9]|0,this.v5l=De[10]|0,this.v5h=De[11]|0,this.v6l=De[12]|0,this.v6h=De[13]|0,this.v7l=De[14]|0,this.v7h=De[15]|0;const n=t.key?t.key.length:0;if(this.v0l^=this.outputLen|n<<8|65536|1<<24,t.salt){const r=lo(Ln(t.salt));this.v4l^=In(r[0]),this.v4h^=In(r[1]),this.v5l^=In(r[2]),this.v5h^=In(r[3])}if(t.personalization){const r=lo(Ln(t.personalization));this.v6l^=In(r[0]),this.v6h^=In(r[1]),this.v7l^=In(r[2]),this.v7h^=In(r[3])}if(t.key){const r=new Uint8Array(this.blockLen);r.set(Ln(t.key)),this.update(r)}}get(){let{v0l:t,v0h:n,v1l:r,v1h:o,v2l:i,v2h:s,v3l:a,v3h:l,v4l:c,v4h:d,v5l:f,v5h:u,v6l:p,v6h:h,v7l:m,v7h:w}=this;return[t,n,r,o,i,s,a,l,c,d,f,u,p,h,m,w]}set(t,n,r,o,i,s,a,l,c,d,f,u,p,h,m,w){this.v0l=t|0,this.v0h=n|0,this.v1l=r|0,this.v1h=o|0,this.v2l=i|0,this.v2h=s|0,this.v3l=a|0,this.v3h=l|0,this.v4l=c|0,this.v4h=d|0,this.v5l=f|0,this.v5h=u|0,this.v6l=p|0,this.v6h=h|0,this.v7l=m|0,this.v7h=w|0}compress(t,n,r){this.get().forEach((l,c)=>$[c]=l),$.set(De,16);let{h:o,l:i}=at.fromBig(BigInt(this.length));$[24]=De[8]^i,$[25]=De[9]^o,r&&($[28]=~$[28],$[29]=~$[29]);let s=0;const a=hM;for(let l=0;l<12;l++)nr(0,4,8,12,t,n+2*a[s++]),rr(0,4,8,12,t,n+2*a[s++]),nr(1,5,9,13,t,n+2*a[s++]),rr(1,5,9,13,t,n+2*a[s++]),nr(2,6,10,14,t,n+2*a[s++]),rr(2,6,10,14,t,n+2*a[s++]),nr(3,7,11,15,t,n+2*a[s++]),rr(3,7,11,15,t,n+2*a[s++]),nr(0,5,10,15,t,n+2*a[s++]),rr(0,5,10,15,t,n+2*a[s++]),nr(1,6,11,12,t,n+2*a[s++]),rr(1,6,11,12,t,n+2*a[s++]),nr(2,7,8,13,t,n+2*a[s++]),rr(2,7,8,13,t,n+2*a[s++]),nr(3,4,9,14,t,n+2*a[s++]),rr(3,4,9,14,t,n+2*a[s++]);this.v0l^=$[0]^$[16],this.v0h^=$[1]^$[17],this.v1l^=$[2]^$[18],this.v1h^=$[3]^$[19],this.v2l^=$[4]^$[20],this.v2h^=$[5]^$[21],this.v3l^=$[6]^$[22],this.v3h^=$[7]^$[23],this.v4l^=$[8]^$[24],this.v4h^=$[9]^$[25],this.v5l^=$[10]^$[26],this.v5h^=$[11]^$[27],this.v6l^=$[12]^$[28],this.v6h^=$[13]^$[29],this.v7l^=$[14]^$[30],this.v7h^=$[15]^$[31],$.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Cc=fM(e=>new TM(e)),Cb=new TextEncoder().encode("SS58PRE"),Qd=2,_b=e=>{try{const t=vb.decode(e),n=t.subarray(0,t[0]&64?2:1),r=t.subarray(n.length,t.length-Qd),o=t.subarray(n.length+r.length),i=Cc(Uint8Array.of(...Cb,...n,...r),{dkLen:64}).subarray(0,Qd);return o[0]===i[0]&&o[1]===i[1]?{isValid:!0,ss58Format:MM(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},MM=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)},Rb=e=>{const t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return n=>{const r=Cc(Uint8Array.of(...Cb,...t,...n),{dkLen:64}).subarray(0,Qd);return vb.encode(Uint8Array.of(...t,...n,...r))}};function OM(e,t){return n=>{const r=_b(n);if(!r.isValid)throw new Error("Invalid checksum");const{publicKey:o}=r;if(o.length!==e)throw new Error("Invalid public key length");return o}}const Rs=(e=42,t=32)=>gi(Qe(t),OM(t),Rb(e)),cv="0123456789abcdef";function kt(e){const t=new Array(e.length+1);t[0]="0x";for(let n=0;n>4]+cv[r&15]}return t.join("")}const xu={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function Sn(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,o=new Uint8Array(r);t&&(o[0]=0|xu[e[2]]);for(let i=0;i[n,t(r,n)]))}const Ft=(...e)=>{const t=e.reduce((r,o)=>r+o.byteLength,0),n=new Uint8Array(t);for(let r=0,o=0;r{throw TypeError(e)},LM=(e,t,n)=>t in e?NM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bu=(e,t,n)=>LM(e,typeof t!="symbol"?t+"":t,n),Ab=(e,t,n)=>t.has(e)||Ib("Cannot "+n),Dr=(e,t,n)=>(Ab(e,t,"read from private field"),n?n.call(e):t.get(e)),Eu=(e,t,n)=>t.has(e)?Ib("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Su=(e,t,n,r)=>(Ab(e,t,"write to private field"),t.set(e,n),n),Po,Ui,Wi;const jM=new TextEncoder,$M=new TextDecoder;class mo{constructor(t){Eu(this,Po),Eu(this,Ui,null),Eu(this,Wi,null),bu(this,"asText",()=>Dr(this,Wi)===null?Su(this,Wi,$M.decode(Dr(this,Po))):Dr(this,Wi)),bu(this,"asHex",()=>Dr(this,Ui)===null?Su(this,Ui,kt(Dr(this,Po))):Dr(this,Ui)),bu(this,"asBytes",()=>Dr(this,Po)),Su(this,Po,t)}static fromText(t){return new this(jM.encode(t))}static fromHex(t){return new this(Sn(t))}static fromBytes(t){return new this(t)}}Po=new WeakMap;Ui=new WeakMap;Wi=new WeakMap;class Tb extends mo{constructor(t){super(t)}static fromArray(t){return new this(new Uint8Array(t))}}const Mb=e=>{const t=Qe.enc(e);return n=>t(n.asBytes())},Ob=e=>{const t=Qe.dec(e),n=e==null?mo:Tb;return r=>n.fromBytes(t(r))},Us=e=>pe(Mb(e),Ob(e));Us.enc=Mb;Us.dec=Ob;const ee=Te,Nb=Te,DM=Mp(e=>{const t=ee.dec(e),n=Math.ceil(t/8);return{bytes:Qe(n).dec(e),bitsLen:t}}),BM=e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);const t=ee.enc(e.bitsLen),n=new Uint8Array(e.bytes.length+t.length);return n.set(t,0),n.set(e.bytes,t.length),n},Lb=pe(BM,DM),zM=gi(Ne,e=>e.charCodeAt(0),String.fromCharCode),jb=e=>{const t=Qe.enc(e);return n=>t(Sn(n))},$b=e=>{const t=Qe.dec(e);return n=>kt(t(n))},$r=e=>pe(jb(e),$b(e));$r.enc=jb;$r.dec=$b;const FM=new TextEncoder,UM=new TextDecoder,WM=e=>gi(Qe(e),t=>FM.encode(t),t=>UM.decode(t)),Db=e=>{let t=n=>{const r=e();return t=r,r(n)};return n=>t(n)},Bb=e=>{let t=n=>{const r=e(),o=r;return t=r,o(n)};return n=>t(n)},Lp=e=>pe(Db(()=>e().enc),Bb(()=>e().dec)),VM={is(e,t){return e.type===t},as(e,t){if(t!==e.type)throw new Error(`Enum.as(enum, ${t}) used with actual type ${e.type}`);return e}},_c=Object.assign((e,t)=>({type:e,value:t}),VM),HM=new Proxy({},{get(e,t){return n=>_c(t,n)}}),zb=(...e)=>{const t=kn.enc(...e);return n=>t({tag:n.type,value:n.value})},Fb=(...e)=>{const t=kn.dec(...e);return n=>{const{tag:r,value:o}=t(n);return _c(r,o)}},Wn=(e,...t)=>pe(zb(qd(e,([n])=>n),...t),Fb(qd(e,([,n])=>n),...t));Wn.enc=zb;Wn.dec=Fb;const Ub=[],Wb=[],Vb=[],GM=BigInt(0),Ai=BigInt(1),KM=BigInt(2),YM=BigInt(7),XM=BigInt(256),QM=BigInt(113);for(let e=0,t=Ai,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Ub.push(2*(5*r+n)),Wb.push((e+1)*(e+2)/2%64);let o=GM;for(let i=0;i<7;i++)t=(t<>YM)*QM)%XM,t&KM&&(o^=Ai<<(Ai<n>32?Sb(e,t,n):bb(e,t,n),dv=(e,t,n)=>n>32?kb(e,t,n):Eb(e,t,n);function JM(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){const a=(s+8)%10,l=(s+2)%10,c=n[l],d=n[l+1],f=uv(c,d,1)^n[a],u=dv(c,d,1)^n[a+1];for(let p=0;p<50;p+=10)e[s+p]^=f,e[s+p+1]^=u}let o=e[2],i=e[3];for(let s=0;s<24;s++){const a=Wb[s],l=uv(o,i,a),c=dv(o,i,a),d=Ub[s];o=e[d],i=e[d+1],e[d]=l,e[d+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=qM[r],e[1]^=ZM[r]}n.fill(0)}class jp extends yb{constructor(t,n,r,o=!1,i=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,qr(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=lo(this.state)}keccak(){lt||st(this.state32),JM(this.state32,this.rounds),lt||st(this.state32),this.posOut=0,this.pos=0}update(t){_s(this);const{blockLen:n,state:r}=this;t=Ln(t);const o=t.length;for(let i=0;i=r&&this.keccak();const s=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return qr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Np(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new jp(n,r,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}}const e4=(e,t,n)=>dM(()=>new jp(t,e,n)),t4=e4(1,136,256/8),fv=e=>{const t=e.slice(2),n=kt(t4(t)).slice(2),r=new Array(40);for(let o=0;o<40;o++){const i=parseInt(n[o],16),s=t[o];r[o]=i>7?s.toUpperCase():s}return`0x${r.join("")}`},n4=Qe(20)[1],Hb=pe(e=>{const t=Sn(e);if(t.length!==20)throw new Error(`Invalid length found on EthAddress(${e})`);const n=kt(t);if(e===n||e===n.toUpperCase())return t;if(fv(n)!==e)throw new Error(`Invalid checksum found on EthAddress(${e})`);return t},Mp(e=>fv(kt(n4(e))))),pv=new TextEncoder,hv=new TextDecoder,r4=gi(Qe(4),pv.encode.bind(pv),hv.decode.bind(hv)),ku=re({engine:r4,payload:$r()}),o4=Wn({consensus:ku,seal:ku,preRuntime:ku,runtimeUpdated:se},[4,5,6,8]),Cu=$r(32),Gb=re({parentHash:Cu,number:ee,stateRoot:Cu,extrinsicRoot:Cu,digests:le(o4)}),Vn=le(Ye),mv=ut(Ye),i4=kn({bool:se,char:se,str:se,u8:se,u16:se,u32:se,u64:se,u128:se,u256:se,i8:se,i16:se,i32:se,i64:se,i128:se,i256:se}),Kb=le(re({name:mv,type:ee,typeName:mv,docs:Vn})),s4=re({len:Kt,type:ee}),a4=re({bitStoreType:ee,bitOrderType:ee}),l4=le(re({name:Ye,fields:Kb,index:Ne,docs:Vn})),c4=kn({composite:Kb,variant:l4,sequence:ee,array:s4,tuple:le(ee),primitive:i4,compact:ee,bitSequence:a4}),u4=re({name:Ye,type:ut(ee)}),d4=le(u4),f4=re({id:ee,path:Vn,params:d4,def:c4,docs:Vn}),Yb=le(f4),p4=kn({Blake2128:se,Blake2256:se,Blake2128Concat:se,Twox128:se,Twox256:se,Twox64Concat:se,Identity:se}),h4=le(p4),m4=re({hashers:h4,key:ee,value:ee}),v4=re({name:Ye,modifier:Ne,type:kn({plain:ee,map:m4}),fallback:$r(),docs:Vn}),g4=ut(re({prefix:Ye,items:le(v4)})),Xb={name:Ye,storage:g4,calls:ut(ee),events:ut(ee),constants:le(re({name:Ye,type:ee,value:$r(),docs:Vn})),errors:ut(ee),index:Ne},y4={...Xb,docs:Vn},w4=re({name:Ye,methods:le(re({name:Ye,inputs:le(re({name:Ye,type:ee})),output:ee,docs:Vn})),docs:Vn}),x4=re({version:Ne,address:ee,call:ee,signature:ee,extra:ee,signedExtensions:le(re({identifier:Ye,type:ee,additionalSigned:ee}))}),Qb=re({lookup:Yb,pallets:le(re(y4)),extrinsic:x4,type:ee,apis:le(w4),outerEnums:re({call:ee,event:ee,error:ee}),custom:le(St(Ye,re({type:ee,value:$r()})))}),b4=new Uint8Array,vv=e=>pe(()=>b4,()=>e),E4=re({type:ee,version:Ne,signedExtensions:le(re({identifier:Ye,type:ee,additionalSigned:ee}))}),qb=re({lookup:Yb,pallets:le(re({...Xb,docs:vv([])})),extrinsic:E4,type:ee,apis:vv([])}),gv=()=>{throw new Error("Unsupported metadata version!")},mt=pe(gv,gv),jl=re({magicNumber:Kt,metadata:kn({v0:mt,v1:mt,v2:mt,v3:mt,v4:mt,v5:mt,v6:mt,v7:mt,v8:mt,v9:mt,v10:mt,v11:mt,v12:mt,v13:mt,v14:qb,v15:Qb})}),S4={dkLen:32},$p=e=>Cc(e,S4),k4={dkLen:16},Zb=e=>Cc(e,k4),Jb=e=>Ft(Zb(e),e),Rn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function or(e,t,n,r,o){return e=e+t+o|0,r=Nl(r^e,16),n=n+r|0,t=Nl(t^n,12),{a:e,b:t,c:n,d:r}}function ir(e,t,n,r,o){return e=e+t+o|0,r=Nl(r^e,8),n=n+r|0,t=Nl(t^n,7),{a:e,b:t,c:n,d:r}}function yv(e,t,n,r,o,i,s,a,l,c,d,f,u,p,h,m,w,v,g,x){let b=0;for(let S=0;S{const e=Array.from({length:16},(r,o)=>o),t=r=>[2,6,3,10,7,0,4,13,1,11,12,5,9,14,15,8].map(o=>r[o]),n=[];for(let r=0,o=e;r<7;r++,o=t(o))n.push(...o);return Uint8Array.from(n)})();class Dp extends wb{constructor(t={},n=0){if(super(64,t.dkLen===void 0?32:t.dkLen,{},Number.MAX_SAFE_INTEGER,0,0),this.flags=0,this.chunkPos=0,this.chunksDone=0,this.stack=[],this.posOut=0,this.bufferOut32=new Uint32Array(16),this.chunkOut=0,this.enableXOF=!0,this.outputLen=t.dkLen===void 0?32:t.dkLen,qr(this.outputLen),t.key!==void 0&&t.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(t.key!==void 0){const r=Ln(t.key).slice();if(r.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=lo(r),lt||st(this.IV),this.flags=n|16}else if(t.context!==void 0){const r=new Dp({dkLen:32},32).update(t.context).digest();this.IV=lo(r),lt||st(this.IV),this.flags=n|64}else this.IV=Rn.slice(),this.flags=n;this.state=this.IV.slice(),this.bufferOut=cM(this.bufferOut32)}get(){return[]}set(){}b2Compress(t,n,r,o=0){const{state:i,pos:s}=this,{h:a,l}=Ll(BigInt(t),!0),{v0:c,v1:d,v2:f,v3:u,v4:p,v5:h,v6:m,v7:w,v8:v,v9:g,v10:x,v11:b,v12:S,v13:C,v14:k,v15:_}=yv(wv,o,r,7,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],Rn[0],Rn[1],Rn[2],Rn[3],a,l,s,n);i[0]=c^v,i[1]=d^g,i[2]=f^x,i[3]=u^b,i[4]=p^S,i[5]=h^C,i[6]=m^k,i[7]=w^_}compress(t,n=0,r=!1){let o=this.flags;if(this.chunkPos||(o|=1),(this.chunkPos===15||r)&&(o|=2),r||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,o,t,n),this.chunkPos+=1,this.chunkPos===16||r){let i=this.state;this.state=this.IV.slice();for(let s,a=this.chunksDone+1;(r||!(a&1))&&(s=this.stack.pop());a>>=1)this.buffer32.set(s,0),this.buffer32.set(i,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|4,this.buffer32,0),i=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(i)}this.pos=0}_cloneInto(t){t=super._cloneInto(t);const{IV:n,flags:r,state:o,chunkPos:i,posOut:s,chunkOut:a,stack:l,chunksDone:c}=this;return t.state.set(o.slice()),t.stack=l.map(d=>Uint32Array.from(d)),t.IV.set(n),t.flags=r,t.chunkPos=i,t.chunksDone=c,t.posOut=s,t.chunkOut=a,t.enableXOF=this.enableXOF,t.bufferOut32.set(this.bufferOut32),t}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let t of this.stack)t.fill(0)}b2CompressOut(){const{state:t,pos:n,flags:r,buffer32:o,bufferOut32:i}=this,{h:s,l:a}=Ll(BigInt(this.chunkOut++));lt||st(o);const{v0:l,v1:c,v2:d,v3:f,v4:u,v5:p,v6:h,v7:m,v8:w,v9:v,v10:g,v11:x,v12:b,v13:S,v14:C,v15:k}=yv(wv,0,o,7,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],Rn[0],Rn[1],Rn[2],Rn[3],a,s,n,r);i[0]=l^w,i[1]=c^v,i[2]=d^g,i[3]=f^x,i[4]=u^b,i[5]=p^S,i[6]=h^C,i[7]=m^k,i[8]=t[0]^w,i[9]=t[1]^v,i[10]=t[2]^g,i[11]=t[3]^x,i[12]=t[4]^b,i[13]=t[5]^S,i[14]=t[6]^C,i[15]=t[7]^k,lt||(st(o),st(i)),this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let t=this.flags|8;this.stack.length?(t|=4,lt||st(this.buffer32),this.compress(this.buffer32,0,!0),lt||st(this.buffer32),this.chunksDone=0,this.pos=this.blockLen):t|=(this.chunkPos?0:1)|2,this.flags=t,this.b2CompressOut()}writeInto(t){_s(this,!1),kc(t),this.finish();const{blockLen:n,bufferOut:r}=this;for(let o=0,i=t.length;o=n&&this.b2CompressOut();const s=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible after digest call");return this.writeInto(t)}xof(t){return qr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Np(t,this),this.finished)throw new Error("digest() was already called");return this.enableXOF=!1,this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}}const C4=pM(e=>new Dp(e)),_4={dkLen:32},e2=e=>C4(e,_4),R4=e=>Ft(e2(e),e),t2=e=>e,Br=(e,t,n,r)=>new DataView(new Uint16Array([e,t,n,r]).buffer).getBigUint64(0,!0),Bp=2n**64n-1n,et=(e,t)=>e<>64n-t,ue=(e,t)=>e*t&Bp,Fe=(e,t)=>e+t&Bp,Ue=11400714785074694791n,_t=14029467366897019727n,xv=1609587929392839161n,Ti=9650029242287828579n,bv=2870177450012600261n;function hr(e,t=0n){let n=Fe(Fe(t,Ue),_t),r=Fe(t,_t),o=t,i=t-Ue,s=e.length,a=0,l=null;(function(){let p=0,h=p+s;if(s){if(l=new Uint8Array(32),s<32){l.set(e.subarray(0,s),a),a+=s;return}if(p<=h-32){const m=h-32;do{let w;w=Br(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]),n=ue(et(Fe(n,ue(w,_t)),31n),Ue),p+=8,w=Br(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]),r=ue(et(Fe(r,ue(w,_t)),31n),Ue),p+=8,w=Br(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]),o=ue(et(Fe(o,ue(w,_t)),31n),Ue),p+=8,w=Br(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]),i=ue(et(Fe(i,ue(w,_t)),31n),Ue),p+=8}while(p<=m)}p=32?(c=et(n,1n),c=Fe(c,et(r,7n)),c=Fe(c,et(o,12n)),c=Fe(c,et(i,18n)),n=ue(et(ue(n,_t),31n),Ue),c=c^n,c=Fe(ue(c,Ue),Ti),r=ue(et(ue(r,_t),31n),Ue),c=c^r,c=Fe(ue(c,Ue),Ti),o=ue(et(ue(o,_t),31n),Ue),c=c^o,c=Fe(ue(c,Ue),Ti),i=ue(et(ue(i,_t),31n),Ue),c=c^i,c=Fe(ue(c,Ue),Ti)):c=Fe(t,bv),c=Fe(c,BigInt(s));d<=a-8;){let u=Br(e[d+1]<<8|e[d],e[d+3]<<8|e[d+2],e[d+5]<<8|e[d+4],e[d+7]<<8|e[d+6]);u=ue(et(ue(u,_t),31n),Ue),c=Fe(ue(et(c^u,27n),Ue),Ti),d+=8}if(d+4<=a){let u=ue(Br(e[d+1]<<8|e[d],e[d+3]<<8|e[d+2],0,0),Ue);c=Fe(ue(et(c^u,23n),_t),xv),d+=4}for(;d>33n;return c=ue(c^f,_t),f=c>>29n,c=ue(c^f,xv),f=c>>32n,c^=f,c}const Zd=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigUint64(0,hr(e),!0),n.setBigUint64(8,hr(e,1n),!0),t},P4=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigUint64(0,hr(e),!0),n.setBigUint64(8,hr(e,1n),!0),n.setBigUint64(16,hr(e,2n),!0),n.setBigUint64(24,hr(e,3n),!0),t},zp=e=>Ft(Fs.enc(hr(e)),e),Ev=new TextEncoder,Fp=e=>{const t=Zd(Ev.encode(e));return(n,r,...o)=>{const i=Ft(t,Zd(Ev.encode(n))),s=kt(i),a=o.map(f=>f[1]).map(f=>{switch(f){case t2:return 0;case zp:return 8;case Jb:return 16;default:return null}}).filter(f=>f!==null),l=f=>{if(!f.startsWith(s))throw new Error(`key does not match this storage (${e}.${n})`);if(a.length!==o.length)throw new Error("Impossible to decode this key");if(o.length===0)return[];const u=f.slice(s.length),p=new Array(o.length);for(let h=0,m=0;hp=>u(f(p)));return{enc:(...f)=>kt(Ft(i,...f.map((u,p)=>c[p](u)))),dec:r,keyDecoder:l}}},n2=Object.freeze(Object.defineProperty({__proto__:null,AccountId:Rs,Bin:Us,Binary:mo,Blake2128:Zb,Blake2128Concat:Jb,Blake2256:$p,Blake3256:e2,Blake3256Concat:R4,Bytes:Qe,Enum:_c,FixedSizeBinary:Tb,Hex:$r,Identity:t2,Option:ut,Result:Sc,ScaleEnum:kn,Self:Lp,Storage:Fp,Struct:re,Tuple:St,Twox128:Zd,Twox256:P4,Twox64Concat:zp,Variant:Wn,Vector:le,_Enum:HM,_void:se,bitSequence:Lb,blockHeader:Gb,bool:Op,char:zM,compact:Te,compactBn:Nb,compactNumber:ee,createCodec:pe,createDecoder:Mp,enhanceCodec:gi,enhanceDecoder:Ec,enhanceEncoder:zs,ethAccount:Hb,fixedStr:WM,fromBufferToBase58:Rb,getSs58AddressInfo:_b,h64:hr,i128:$T,i16:NT,i256:BT,i32:LT,i64:jT,i8:OT,metadata:jl,selfDecoder:Bb,selfEncoder:Db,str:Ye,u128:Jx,u16:ao,u256:DT,u32:Kt,u64:Fs,u8:Ne,v14:qb,v15:Qb},Symbol.toStringTag,{value:"Module"})),co=Te,I4=le(St(Ye,co)),ae={bool:"boolean",str:"string",num:"number",big:"bigint",numeric:"numeric",bits:"bitseq",void:"void"},A4=Wn(Object.fromEntries(Object.values(ae).map(e=>[e,se]))),T4=le(St(Ye,ut(Lp(()=>Up)))),M4=le(co),O4=re({typeRef:co,length:ut(co)}),N4=ut(Te),L4=co,j4=re({ok:co,ko:co}),Up=Wn({struct:I4,terminal:A4,enum:T4,tuple:M4,array:O4,binary:N4,option:L4,result:j4}),$4={i256:ae.big,i128:ae.big,i64:ae.big,i32:ae.num,i16:ae.num,i8:ae.num,u256:ae.big,u128:ae.big,u64:ae.big,u32:ae.num,u16:ae.num,u8:ae.num,bool:ae.bool,char:ae.str,str:ae.str},Mi=e=>({type:"terminal",value:{type:e}});function Ps(e,t=()=>{}){switch(e.type){case"AccountId20":case"AccountId32":return Mi(ae.str);case"array":return e.value.type==="primitive"&&e.value.value==="u8"?{type:"binary",value:e.len}:(t(e.value.id),{type:"array",value:{typeRef:e.value.id,length:e.len}});case"bitSequence":return Mi(ae.bits);case"compact":return Mi(e.isBig===null?ae.numeric:e.isBig?ae.big:ae.num);case"enum":return{type:"enum",value:Object.entries(e.value).map(([n,r])=>[n,(r.type==="lookupEntry"?Ps(r.value,t):Ps(r,t))??void 0])};case"struct":{const n=Object.entries(e.value).map(([r,o])=>[r,o.id]);return n.forEach(([,r])=>t(r)),{type:"struct",value:n}}case"tuple":{const n=e.value.map(r=>r.id);return n.forEach(t),{type:"tuple",value:n}}case"option":return t(e.value.id),{type:"option",value:e.value.id};case"primitive":return Mi($4[e.value]);case"result":return t(e.value.ok.id),t(e.value.ko.id),{type:"result",value:{ok:e.value.ok.id,ko:e.value.ko.id}};case"sequence":return e.value.type==="primitive"&&e.value.value==="u8"?{type:"binary",value:void 0}:(t(e.value.id),{type:"array",value:{typeRef:e.value.id}});case"void":return Mi(ae.void)}}function Wp(e,t,n){if(t.type==="option"&&e==null)return!0;const r=(i,s)=>Wp(i,s,n),o=i=>{switch(i.value.type){case ae.str:case ae.big:case ae.bool:case ae.num:return typeof e===i.value.type;case ae.bits:return typeof e=="object"&&e!=null&&typeof e.bitsLen=="number"&&e.bytes instanceof Uint8Array;case ae.numeric:return typeof e=="number"||typeof e=="bigint";case ae.void:return!0}};switch(t.type){case"terminal":return o(t);case"binary":return e instanceof mo&&(t.value==null||e.asBytes().length>=t.value);case"array":if(!Array.isArray(e))return!1;const i=e;return t.value.length!=null&&i.lengthr(c,n(t.value.typeRef)));case"enum":if(!e)return!1;const s=e,a=Object.fromEntries(t.value);if(!(s.type in a))return!1;const l=a[s.type];return l==null?!0:r(s.value,l);case"option":return e==null?!0:r(e,n(t.value));case"struct":return e?t.value.every(([c,d])=>r(e[c],n(d))):!1;case"tuple":return e?t.value.every((c,d)=>r(e[d],n(c))):!1;case"result":return"success"in e&&"value"in e?r(e.value,n(e.success?t.value.ok:t.value.ko)):!1}}var D4=Object.defineProperty,B4=(e,t,n)=>t in e?D4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z4=(e,t,n)=>B4(e,t+"",n);class r2{constructor(t=[]){z4(this,"value",new Map),t.forEach(([n,r])=>this.add(n,r))}has(t,n){var r;return((r=this.value.get(t))==null?void 0:r.has(n))??!1}add(t,n){this.value.has(t)||this.value.set(t,new Set),this.value.get(t).add(n)}addAll(t){t.forEach(([n,r])=>this.add(n,r))}delete(t,n){if(!this.value.has(t))return;const r=this.value.get(t);r.delete(n),r.size||this.value.delete(t)}isEmpty(){return!this.value.size}get values(){return Array.from(this.value).flatMap(([t,n])=>Array.from(n).map(r=>[t,r]))}}var Vr=(e=>(e[e.Incompatible=0]="Incompatible",e[e.Partial=1]="Partial",e[e.BackwardsCompatible=2]="BackwardsCompatible",e[e.Identical=3]="Identical",e))(Vr||{});function Jd(e,t,n,r,o){if(!n&&!e)return gt(3);if(!n)return gt(2);if(!e)return gt(n.type==="option"?2:0);o.has(n)||o.set(n,new Map);const i=o.get(n);if(i.has(e)){const a=i.get(e);return a===null?{level:3,assumptions:new r2([[e,n]])}:gt(a)}i.set(e,null);const s=F4(e,n,(a,l)=>Jd(typeof a=="number"?t(a):a,t,typeof l=="number"?r(l):l,r,o));return s.assumptions.delete(e,n),s.assumptions.isEmpty()||s.level===0?i.set(e,s.level):i.delete(e),s}function F4(e,t,n){if(e.type!==t.type)return t.type==="option"?ka(n(e,t.value),2):e.type==="option"?ka(n(e.value,t),1):gt(0);switch(t.type){case"terminal":return gt(t.value.type===e.value.type?3:0);case"binary":return gt(kv(e.value,t.value));case"array":const o=e,i=gt(kv(o.value.length,t.value.length));return _u([i,()=>n(o.value.typeRef,t.value.typeRef)]);case"enum":{const d=e,f=Object.fromEntries(t.value),u=d.value.length===t.value.length?3:2;return ka(Sv(d.value.map(([p,h])=>()=>p in f?n(h,f[p]):gt(0))),u)}case"option":return n(e.value,t.value);case"struct":const s=e,a=Object.fromEntries(s.value),l=s.value.length===t.value.length?3:2;return ka(_u(t.value.map(([d,f])=>()=>n(a[d],f))),l);case"tuple":{const d=e,f=gt(W4(d.value,t.value));return _u([f,...t.value.map((u,p)=>()=>n(d.value[p],u))])}case"result":const c=e;return Sv([n(c.value.ok,t.value.ok),n(c.value.ko,t.value.ko)])}}const ka=(e,t)=>({...e,level:Math.min(e.level,t)}),U4=new r2,gt=e=>({level:e,assumptions:U4}),_u=e=>{let t=gt(3);for(const n of e){const r=typeof n=="function"?n():n;if(r.level===0)return r;t.assumptions.addAll(r.assumptions.values),t.level=Math.min(t.level,r.level)}return t},Sv=e=>{if(!e.length)return gt(3);let t=!1,n=gt(3);for(const r of e){const o=typeof r=="function"?r():r;if(o.level===0){n.level=Math.min(n.level,1);continue}t=!0,n.assumptions.addAll(o.assumptions.values),n.level=Math.min(n.level,o.level)}return t?n:gt(0)},W4=(e,t)=>t.length===e.length?3:e.length>=t.length?2:0,kv=(e,t)=>t===e?3:t==null||e>=t?2:e==null?1:0,Cv=Wn({lookup:Te,typedef:Up}),Zo=e=>({type:"lookup",value:e}),Vp=e=>({type:"typedef",value:e}),$l=Vp({type:"terminal",value:{type:ae.void}}),V4=re({args:Cv,values:Cv});function H4(e){if(e.type.tag==="plain")return{args:$l,values:Zo(e.type.value)};const{key:t,value:n}=e.type.value;return{args:Zo(t),values:Zo(n)}}function G4(e){return{args:Vp({type:"tuple",value:e.inputs.map(t=>t.type)}),values:Zo(e.output)}}function K4(e){return e.type==="lookupEntry"?Zo(e.value.id):Vp(Ps(e))}function Y4(e){return{args:$l,values:Zo(e)}}function X4(e,t,n,r,o){const i=(s,a)=>s.type==="lookup"?a(s.value):s.value;return{args:Jd(i(e.args,t),t,i(n.args,r),r,o).level,values:Jd(i(n.values,r),r,i(e.values,t),t,o).level}}function _v(e,t,n){const r=e.type==="lookup"?t(e.value):e.value;return Wp(n,r,t)}const Fo=()=>{},Ut={body:"",call:"",continue:"",follow:"",header:"",stopOperation:"",storage:"",unfollow:"",unpin:"",followEvent:""},Ya={chainName:"",genesisHash:"",properties:""},ef={broadcast:"",stop:""};Object.entries({chainHead:Ut,chainSpec:Ya,transaction:ef}).forEach(([e,t])=>{Object.keys(t).forEach(n=>{t[n]=`${e}_v1_${n}`})});const Q4=e=>(t,n)=>{let r=e(ef.broadcast,[t],{onSuccess:o=>{r=o===null?Fo:()=>{e(ef.stop,[o])},o===null&&n(new Error("Max # of broadcasted transactions has been reached"))},onError:n});return()=>{r()}};class o2 extends Error{constructor(){super("ChainHead stopped"),this.name="StopError"}}class Xa extends Error{constructor(){super("ChainHead disjointed"),this.name="DisjointError"}}class Rc extends Error{constructor(){super("ChainHead operations limit reached"),this.name="OperationLimitError"}}class i2 extends Error{constructor(t){super(t),this.name="OperationError"}}class Hp extends Error{constructor(){super("ChainHead operation inaccessible"),this.name="OperationInaccessibleError"}}function q4(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),res:e,rej:t}}const s2=()=>{const e=new Map;return{has:e.has.bind(e),subscribe(t,n){e.set(t,n)},unsubscribe(t){e.delete(t)},next(t,n){var r;(r=e.get(t))==null||r.next(n)},error(t,n){const r=e.get(t);r&&(e.delete(t),r.error(n))},errorAll(t){const n=[...e.values()];e.clear(),n.forEach(r=>{r.error(t)})}}},Pc=e=>(...t)=>new Promise((n,r)=>{let o=ns;const[i,s]=t[t.length-1]instanceof AbortSignal?[t.slice(0,t.length-1),t[t.length-1]]:[t],a=()=>{o(),r(new Pb)};s==null||s.addEventListener("abort",a,{once:!0});const l=c=>d=>{o=ns,s==null||s.removeEventListener("abort",a),c(d)};o=e(l(n),l(r),...i)}),a2=(e,t)=>n=>Pc((r,o,...i)=>{let s=!0,a=()=>{s=!1};const[l,c]=t(...i);return n(e,l,{onSuccess:(d,f)=>{if(d.result==="limitReached")return o(new Rc);const{operationId:u}=d,p=()=>{n(Ut.stopOperation,[u])};if(!s)return p();let h=Fo;const m=v=>{s=!1,h(),r(v)},w=v=>{s=!1,h(),o(v)};h=f(u,{next:v=>{const g=v;g.event==="operationError"?o(new i2(g.error)):g.event==="operationInaccessible"?o(new Hp):c(v,m,w)},error:w}),a=()=>{s&&(h(),p())}},onError:o}),()=>{a()}}),Z4=a2(Ut.body,e=>[[e],(t,n)=>{n(t.value)}]),J4=a2(Ut.call,(e,t,n)=>[[e,t,n],(r,o)=>{o(r.output)}]),eO=e=>t=>new Promise((n,r)=>{e(Ut.header,[t],{onSuccess:n,onError:r})}),l2=e=>(t,n,r,o,i,s,a)=>{if(n.length===0)return s(),ns;let l=!0,c=()=>{l=!1};return e(Ut.storage,[t,n,r],{onSuccess:(d,f)=>{if(d.result==="limitReached"||d.discardedItems===n.length)return i(new Rc);const{operationId:u}=d,p=()=>{e(Ut.stopOperation,[u])};if(!l)return p();const h=f(d.operationId,{next:v=>{switch(v.event){case"operationStorageItems":{o(v.items);break}case"operationStorageDone":{w();break}case"operationError":{m(new i2(v.error));break}case"operationInaccessible":{m(new Hp);break}default:e(Ut.continue,[v.operationId])}},error:i});c=()=>{h(),e(Ut.stopOperation,[d.operationId])};const m=v=>{c=ns,h(),i(v)},w=()=>{c=ns,h(),s()};a(d.discardedItems)},onError:i}),()=>{c()}},tO=e=>{const t=l2(e);return Pc((n,r,o,i,s,a)=>{const l=i.startsWith("descendants");let c=l?[]:null;const f=t(o,[{key:s,type:i}],a??null,l?u=>{c.push(u)}:u=>{var p;c=(p=u[0])==null?void 0:p[i]},r,()=>{try{n(l?c.flat():c)}catch(u){r(u)}},u=>{u>0&&(f(),r(new Rc))});return f})},nO=e=>t=>t.length>0?new Promise((n,r)=>{e(Ut.unpin,[t],{onSuccess(){n()},onError:r})}):Promise.resolve();class Dl extends Error{constructor(){super("Client destroyed"),this.name="DestroyedError"}}function rO(e){return e.operationId!==void 0}function oO(e){return(t,n,r)=>{const o=s2(),i=new Set,s=q4();let a=s.promise;const l=h=>{if(rO(h))return o.has(h.operationId)||console.warn("Uknown operationId on",h),o.next(h.operationId,h);if(h.event!=="stop"){if(h.event==="initialized")return n({type:h.event,finalizedBlockHashes:h.finalizedBlockHashes,finalizedBlockRuntime:h.finalizedBlockRuntime});const{event:m,...w}=h;return n({type:m,...w})}r(new o2),u(!1)},c=h=>{r(h),u(!(h instanceof Dl))},d=(h,m)=>{const w=m(h,{next:l,error:c});u=(v=!0)=>{a=null,u=Fo,w(),v&&e(Ut.unfollow,[h]),o.errorAll(new Xa),i.forEach(g=>{g()}),i.clear()},a=h,s.res(h)},f=h=>{h instanceof Dl?u(!1):r(h),a=null,s.res(h)};let u=e(Ut.follow,[t],{onSuccess:d,onError:f});const p=(h,m,w)=>{const v=()=>{w==null||w.onError(new Xa)};if(a===null)return v(),Fo;const g=b=>{if(!w)return e(h,[b,...m]);i.add(v);const S=(k,_)=>a===null?(_.error(new Xa),Fo):(o.subscribe(k,_),()=>{o.unsubscribe(k)}),C=e(h,[b,...m],{onSuccess:k=>{i.delete(v),w.onSuccess(k,S)},onError:k=>{i.delete(v),w.onError(k)}});return()=>{i.delete(v),C()}};if(typeof a=="string")return g(a);let x=Fo;return a.then(b=>{if(b instanceof Error)return v();a&&(x=g(b))}),()=>{x()}};return{unfollow(){u(),a=null},body:Z4(p),call:J4(p),header:eO(p),storage:tO(p),storageSubscription:l2(p),unpin:nO(p),_request:p}}}var iO=Object.defineProperty,sO=(e,t,n)=>t in e?iO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rv=(e,t,n)=>sO(e,typeof t!="symbol"?t+"":t,n);class Pv extends Error{constructor(t){super(t.message),Rv(this,"code"),Rv(this,"data"),this.code=t.code,this.data=t.data,this.name="RpcError"}}let aO=1;const lO=e=>{let t=aO++;const n=new Map,r=s2();let o=null;const i=(d,f,u)=>{o.send(JSON.stringify({jsonrpc:"2.0",id:d,method:f,params:u}))};function s(d){try{let f,u,p,h,m;if({id:f,result:u,error:p,params:h}=JSON.parse(d),f){const g=n.get(f);return g?(n.delete(f),p?g.onError(new Pv(p)):g.onSuccess(u,(x,b)=>{const S=x;return r.subscribe(S,b),()=>{r.unsubscribe(S)}})):void 0}if({subscription:m,result:u,error:p}=h,!m||!p&&!Object.hasOwn(h,"result"))throw 0;const v=m;p?r.error(v,new Pv(p)):r.next(v,u)}catch(f){console.warn("Error parsing incomming message: "+d),console.error(f)}}o=e(s);const a=()=>{o==null||o.disconnect(),o=null,r.errorAll(new Dl),n.forEach(d=>d.onError(new Dl)),n.clear()};let l=1;return{request:(d,f,u)=>{if(!o)throw new Error("Not connected");const p=`${t}-${l++}`;return u&&n.set(p,u),i(p,d,f),()=>{n.delete(p)}},disconnect:a}},cO=e=>{const t=Pc((r,o,i,s)=>e(i,s,{onSuccess:r,onError:o}));let n=null;return async()=>n||(n=Promise.all([t(Ya.chainName,[]),t(Ya.genesisHash,[]),t(Ya.properties,[])]).then(([r,o,i])=>({name:r,genesisHash:o,properties:i})))},uO=e=>{const{request:t,disconnect:n}=lO(e);return{chainHead:oO(t),transaction:Q4(t),getChainSpecData:cO(t),destroy:n,request:Pc((r,o,i,s)=>t(i,s,{onSuccess:r,onError:o})),_request:t}};function Re(e){return typeof e=="function"}function Gp(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ru=Gp(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription: +`);function Ea(e){return e.label!==void 0}var pT=3,hT="32px",mT=4e3,vT=356,gT=14,yT=20,wT=200;function xT(...e){return e.filter(Boolean).join(" ")}var bT=e=>{var t,n,r,o,i,s,a,l,c,d;let{invert:f,toast:u,unstyled:p,interacting:h,setHeights:m,visibleToasts:w,heights:v,index:g,toasts:x,expanded:b,removeToast:S,defaultRichColors:C,closeButton:k,style:_,cancelButtonStyle:A,actionButtonStyle:I,className:O="",descriptionClassName:D="",duration:Y,position:Q,gap:H,loadingIcon:F,expandByDefault:G,classNames:R,icons:P,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:L,cn:W}=e,[ne,T]=N.useState(!1),[V,U]=N.useState(!1),[q,ve]=N.useState(!1),[ce,fe]=N.useState(!1),[je,jt]=N.useState(0),[Cn,wi]=N.useState(0),Hs=N.useRef(null),Xn=N.useRef(null),Mc=g===0,Oc=g+1<=w,He=u.type,wo=u.dismissible!==!1,Z2=u.className||"",J2=u.descriptionClassName||"",Gs=N.useMemo(()=>v.findIndex(Z=>Z.toastId===u.id)||0,[v,u.id]),eE=N.useMemo(()=>{var Z;return(Z=u.closeButton)!=null?Z:k},[u.closeButton,k]),oh=N.useMemo(()=>u.duration||Y||mT,[u.duration,Y]),Nc=N.useRef(0),xo=N.useRef(0),ih=N.useRef(0),bo=N.useRef(null),[sh,tE]=Q.split("-"),ah=N.useMemo(()=>v.reduce((Z,ge,he)=>he>=Gs?Z:Z+ge.height,0),[v,Gs]),lh=iT(),nE=u.invert||f,Lc=He==="loading";xo.current=N.useMemo(()=>Gs*H+ah,[Gs,ah]),N.useEffect(()=>{T(!0)},[]),N.useLayoutEffect(()=>{if(!ne)return;let Z=Xn.current,ge=Z.style.height;Z.style.height="auto";let he=Z.getBoundingClientRect().height;Z.style.height=ge,wi(he),m(cn=>cn.find(un=>un.toastId===u.id)?cn.map(un=>un.toastId===u.id?{...un,height:he}:un):[{toastId:u.id,height:he,position:u.position},...cn])},[ne,u.title,u.description,m,u.id]);let Qn=N.useCallback(()=>{U(!0),jt(xo.current),m(Z=>Z.filter(ge=>ge.toastId!==u.id)),setTimeout(()=>{S(u)},wT)},[u,S,m,xo]);N.useEffect(()=>{if(u.promise&&He==="loading"||u.duration===1/0||u.type==="loading")return;let Z,ge=oh;return b||h||L&&lh?(()=>{if(ih.current{var he;(he=u.onAutoClose)==null||he.call(u,u),Qn()},ge)),()=>clearTimeout(Z)},[b,h,G,u,oh,Qn,u.promise,He,L,lh]),N.useEffect(()=>{let Z=Xn.current;if(Z){let ge=Z.getBoundingClientRect().height;return wi(ge),m(he=>[{toastId:u.id,height:ge,position:u.position},...he]),()=>m(he=>he.filter(cn=>cn.toastId!==u.id))}},[m,u.id]),N.useEffect(()=>{u.delete&&Qn()},[Qn,u.delete]);function rE(){return P!=null&&P.loading?N.createElement("div",{className:"sonner-loader","data-visible":He==="loading"},P.loading):F?N.createElement("div",{className:"sonner-loader","data-visible":He==="loading"},F):N.createElement(eT,{visible:He==="loading"})}return N.createElement("li",{"aria-live":u.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Xn,className:W(O,Z2,R==null?void 0:R.toast,(t=u==null?void 0:u.classNames)==null?void 0:t.toast,R==null?void 0:R.default,R==null?void 0:R[He],(n=u==null?void 0:u.classNames)==null?void 0:n[He]),"data-sonner-toast":"","data-rich-colors":(r=u.richColors)!=null?r:C,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":ne,"data-promise":!!u.promise,"data-removed":V,"data-visible":Oc,"data-y-position":sh,"data-x-position":tE,"data-index":g,"data-front":Mc,"data-swiping":q,"data-dismissible":wo,"data-type":He,"data-invert":nE,"data-swipe-out":ce,"data-expanded":!!(b||G&&ne),style:{"--index":g,"--toasts-before":g,"--z-index":x.length-g,"--offset":`${V?je:xo.current}px`,"--initial-height":G?"auto":`${Cn}px`,..._,...u.style},onPointerDown:Z=>{Lc||!wo||(Hs.current=new Date,jt(xo.current),Z.target.setPointerCapture(Z.pointerId),Z.target.tagName!=="BUTTON"&&(ve(!0),bo.current={x:Z.clientX,y:Z.clientY}))},onPointerUp:()=>{var Z,ge,he,cn;if(ce||!wo)return;bo.current=null;let un=Number(((Z=Xn.current)==null?void 0:Z.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Ks=new Date().getTime()-((ge=Hs.current)==null?void 0:ge.getTime()),oE=Math.abs(un)/Ks;if(Math.abs(un)>=yT||oE>.11){jt(xo.current),(he=u.onDismiss)==null||he.call(u,u),Qn(),fe(!0);return}(cn=Xn.current)==null||cn.style.setProperty("--swipe-amount","0px"),ve(!1)},onPointerMove:Z=>{var ge;if(!bo.current||!wo)return;let he=Z.clientY-bo.current.y,cn=Z.clientX-bo.current.x,un=(sh==="top"?Math.min:Math.max)(0,he),Ks=Z.pointerType==="touch"?10:2;Math.abs(un)>Ks?(ge=Xn.current)==null||ge.style.setProperty("--swipe-amount",`${he}px`):Math.abs(cn)>Ks&&(bo.current=null)}},eE&&!u.jsx?N.createElement("button",{"aria-label":B,"data-disabled":Lc,"data-close-button":!0,onClick:Lc||!wo?()=>{}:()=>{var Z;Qn(),(Z=u.onDismiss)==null||Z.call(u,u)},className:W(R==null?void 0:R.closeButton,(o=u==null?void 0:u.classNames)==null?void 0:o.closeButton)},N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},N.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),N.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,u.jsx||N.isValidElement(u.title)?u.jsx||u.title:N.createElement(N.Fragment,null,He||u.icon||u.promise?N.createElement("div",{"data-icon":"",className:W(R==null?void 0:R.icon,(i=u==null?void 0:u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||rE():null,u.type!=="loading"?u.icon||(P==null?void 0:P[He])||ZA(He):null):null,N.createElement("div",{"data-content":"",className:W(R==null?void 0:R.content,(s=u==null?void 0:u.classNames)==null?void 0:s.content)},N.createElement("div",{"data-title":"",className:W(R==null?void 0:R.title,(a=u==null?void 0:u.classNames)==null?void 0:a.title)},u.title),u.description?N.createElement("div",{"data-description":"",className:W(D,J2,R==null?void 0:R.description,(l=u==null?void 0:u.classNames)==null?void 0:l.description)},u.description):null),N.isValidElement(u.cancel)?u.cancel:u.cancel&&Ea(u.cancel)?N.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:Z=>{var ge,he;Ea(u.cancel)&&wo&&((he=(ge=u.cancel).onClick)==null||he.call(ge,Z),Qn())},className:W(R==null?void 0:R.cancelButton,(c=u==null?void 0:u.classNames)==null?void 0:c.cancelButton)},u.cancel.label):null,N.isValidElement(u.action)?u.action:u.action&&Ea(u.action)?N.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||I,onClick:Z=>{var ge,he;Ea(u.action)&&(Z.defaultPrevented||((he=(ge=u.action).onClick)==null||he.call(ge,Z),Qn()))},className:W(R==null?void 0:R.actionButton,(d=u==null?void 0:u.classNames)==null?void 0:d.actionButton)},u.action.label):null))};function ov(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var ET=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:d,style:f,visibleToasts:u=pT,toastOptions:p,dir:h=ov(),gap:m=gT,loadingIcon:w,icons:v,containerAriaLabel:g="Notifications",pauseWhenPageIsHidden:x,cn:b=xT}=e,[S,C]=N.useState([]),k=N.useMemo(()=>Array.from(new Set([n].concat(S.filter(L=>L.position).map(L=>L.position)))),[S,n]),[_,A]=N.useState([]),[I,O]=N.useState(!1),[D,Y]=N.useState(!1),[Q,H]=N.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=N.useRef(null),G=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=N.useRef(null),P=N.useRef(!1),B=N.useCallback(L=>{var W;(W=S.find(ne=>ne.id===L.id))!=null&&W.delete||Rt.dismiss(L.id),C(ne=>ne.filter(({id:T})=>T!==L.id))},[S]);return N.useEffect(()=>Rt.subscribe(L=>{if(L.dismiss){C(W=>W.map(ne=>ne.id===L.id?{...ne,delete:!0}:ne));return}setTimeout(()=>{d0.flushSync(()=>{C(W=>{let ne=W.findIndex(T=>T.id===L.id);return ne!==-1?[...W.slice(0,ne),{...W[ne],...L},...W.slice(ne+1)]:[L,...W]})})})}),[]),N.useEffect(()=>{if(l!=="system"){H(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:L})=>{H(L?"dark":"light")})},[l]),N.useEffect(()=>{S.length<=1&&O(!1)},[S]),N.useEffect(()=>{let L=W=>{var ne,T;r.every(V=>W[V]||W.code===V)&&(O(!0),(ne=F.current)==null||ne.focus()),W.code==="Escape"&&(document.activeElement===F.current||(T=F.current)!=null&&T.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[r]),N.useEffect(()=>{if(F.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,P.current=!1)}},[F.current]),S.length?N.createElement("section",{"aria-label":`${g} ${G}`,tabIndex:-1},k.map((L,W)=>{var ne;let[T,V]=L.split("-");return N.createElement("ol",{key:L,dir:h==="auto"?ov():h,tabIndex:-1,ref:F,className:s,"data-sonner-toaster":!0,"data-theme":Q,"data-y-position":T,"data-x-position":V,style:{"--front-toast-height":`${((ne=_[0])==null?void 0:ne.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||hT,"--width":`${vT}px`,"--gap":`${m}px`,...f},onBlur:U=>{P.current&&!U.currentTarget.contains(U.relatedTarget)&&(P.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||P.current||(P.current=!0,R.current=U.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{D||O(!1)},onPointerDown:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},S.filter(U=>!U.position&&W===0||U.position===L).map((U,q)=>{var ve,ce;return N.createElement(bT,{key:U.id,icons:v,index:q,toast:U,defaultRichColors:c,duration:(ve=p==null?void 0:p.duration)!=null?ve:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:u,closeButton:(ce=p==null?void 0:p.closeButton)!=null?ce:i,interacting:D,position:L,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:B,toasts:S.filter(fe=>fe.position==U.position),heights:_.filter(fe=>fe.position==U.position),setHeights:A,expandByDefault:o,gap:m,loadingIcon:w,expanded:I,pauseWhenPageIsHidden:x,cn:b})}))})):null};const ST=({...e})=>{const{theme:t="system"}=qA();return E.jsx(ET,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},kT=e=>{window.open(e,"_blank","noopener,noreferrer")},CT=({lcStatus:e})=>(console.log("Light client status:",e),E.jsxs("main",{className:"grid flex-1 items-start gap-4 p-4 sm:mx-[5%] xl:mx-[20%] mx-0 sm:px-6 sm:py-0 md:gap-8",children:[E.jsx("h1",{className:"font-unbounded text-primary flex-1 shrink-0 whitespace-nowrap text-xl font-semibold tracking-tight sm:grow-0",children:"Title"}),E.jsxs("div",{className:"pageTop",children:[E.jsx("p",{children:"text"}),E.jsx(Ss,{className:"mt-6",onClick:()=>kT(""),children:"ClickButton"})]}),E.jsx("div",{style:{paddingTop:"2rem"}})]})),_T="modulepreload",RT=function(e){return"/dashboard/"+e},iv={},vi=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),s=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.all(n.map(a=>{if(a=RT(a),a in iv)return;iv[a]=!0;const l=a.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const d=document.createElement("link");if(d.rel=l?"stylesheet":_T,l||(d.as="script",d.crossOrigin=""),d.href=a,s&&d.setAttribute("nonce",s),document.head.appendChild(d),l)return new Promise((f,u)=>{d.addEventListener("load",f),d.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${a}`)))})}))}return o.then(()=>t()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};var PT=Object.defineProperty,IT=(e,t,n)=>t in e?PT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sv=(e,t,n)=>(IT(e,typeof t!="symbol"?t+"":t,n),n),wu={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function AT(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,o=new Uint8Array(r);t&&(o[0]=0|wu[e[2]]);for(let i=0;it=>e(t instanceof av?t:new av(t instanceof Uint8Array?t.buffer:typeof t=="string"?AT(t).buffer:t)),xn=e=>{const t=e.length;let n=0;for(let o=0;o{const n=[e,t];return n.enc=e,n.dec=t,n},zs=(e,t)=>n=>e(t(n)),Ec=(e,t)=>n=>t(e(n)),gi=([e,t],n,r)=>pe(zs(e,n),Ec(t,r));function TT(e,t){return Yt(n=>{const r=n.v[t](n.i,!0);return n.i+=e,r})}function MT(e,t){return n=>{const r=new Uint8Array(e);return new DataView(r.buffer)[t](0,n,!0),r}}function jr(e,t,n){return pe(MT(e,n),TT(e,t))}var Ne=jr(1,"getUint8","setUint8"),ao=jr(2,"getUint16","setUint16"),Kt=jr(4,"getUint32","setUint32"),Fs=jr(8,"getBigUint64","setBigUint64"),OT=jr(1,"getInt8","setInt8"),NT=jr(2,"getInt16","setInt16"),LT=jr(4,"getInt32","setInt32"),jT=jr(8,"getBigInt64","setBigInt64"),qx=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),t},Zx=e=>Yt(t=>{const{v:n,i:r}=t,o=n.getBigUint64(r,!0),i=n[e](r+8,!0);return t.i+=16,i<<64n|o}),Jx=pe(qx,Zx("getBigUint64")),$T=pe(qx,Zx("getBigInt64")),eb=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigInt64(0,e,!0),n.setBigInt64(8,e>>64n,!0),n.setBigInt64(16,e>>128n,!0),n.setBigInt64(24,e>>192n,!0),t},tb=e=>Yt(t=>{let n=t.v.getBigUint64(t.i,!0);return t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<64n,t.i+=8,n|=t.v.getBigUint64(t.i,!0)<<128n,t.i+=8,n|=t.v[e](t.i,!0)<<192n,t.i+=8,n}),DT=pe(eb,tb("getBigUint64")),BT=pe(eb,tb("getBigInt64")),Op=gi(Ne,e=>e?1:0,Boolean),zT=[Ne[1],ao[1],Kt[1]],FT=Yt(e=>{const t=e[e.i],n=t&3;if(n<3)return zT[n](e)>>>2;const r=(t>>>2)+4;e.i++;let o=0n;const i=r/8|0;let s=0n;for(let l=0;l3&&(o=BigInt(Kt[1](e))<1&&(o=BigInt(ao[1](e))<{if(e<0)throw new Error(`Wrong compact input (${e})`);const t=Number(e)<<2;if(e=UT;)n.push(Fs[0](r)),r>>=64n;r>=WT&&(n.push(Kt[0](Number(r&HT))),r>>=32n);let o=Number(r);o>=VT&&(n.push(ao[0](o)),o>>=16),o&&n.push(Ne[0](o));const i=xn(n);return i[0]=i.length-5<<2|3,i},Te=pe(XT,FT),QT=new TextEncoder,qT=e=>{const t=QT.encode(e);return xn([Te.enc(t.length),t])},ZT=new TextDecoder,JT=Yt(e=>{let t=Te.dec(e);const n=new DataView(e.buffer,e.i,t);return e.i+=t,ZT.decode(n)}),Ye=pe(qT,JT),eM=()=>{},tM=new Uint8Array(0),se=pe(()=>tM,eM),nb=e=>e===void 0?t=>xn([Te.enc(t.length),t]):t=>t.length===e?t:t.slice(0,e),rb=e=>Yt(t=>{const n=e===void 0?Te.dec(t):e!==1/0?e:t.byteLength-t.i,r=new Uint8Array(t.buffer.slice(t.i,t.i+n));return t.i+=n,r}),Qe=e=>pe(nb(e),rb(e));Qe.enc=nb;Qe.dec=rb;var ob=(e,t)=>{const n=Object.keys(e),r=new Map((t==null?void 0:t.map((i,s)=>[n[s],i]))??n.map((i,s)=>[i,s])),o=i=>r.get(i);return({tag:i,value:s})=>xn([Ne.enc(o(i)),e[i](s)])},ib=(e,t)=>{const n=Object.keys(e),r=new Map((t==null?void 0:t.map((o,i)=>[o,n[i]]))??n.map((o,i)=>[i,o]));return Yt(o=>{const i=Ne.dec(o),s=r.get(i),a=e[s];return{tag:s,value:a(o)}})},kn=(e,...t)=>pe(ob(Ol(e,([n])=>n),...t),ib(Ol(e,([,n])=>n),...t));kn.enc=ob;kn.dec=ib;var sb=e=>Yt(t=>{const n=Ne.dec(t);if(n!==0)return e===Op[1]?n===1:e(t)}),ab=e=>t=>{const n=new Uint8Array(1);return t===void 0?(n[0]=0,n):(n[0]=1,e===Op[0]?(n[0]=t?1:2,n):xn([n,e(t)]))},ut=e=>pe(ab(e[0]),sb(e[1]));ut.enc=ab;ut.dec=sb;var lb=(e,t)=>Yt(n=>{const r=Ne[1](n)===0,i=(r?e:t)(n);return{success:r,value:i}}),cb=(e,t)=>({success:n,value:r})=>xn([Ne[0](n?0:1),(n?e:t)(r)]),Sc=(e,t)=>pe(cb(e[0],t[0]),lb(e[1],t[1]));Sc.dec=lb;Sc.enc=cb;var ub=(...e)=>Yt(t=>e.map(n=>n(t))),db=(...e)=>t=>xn(e.map((n,r)=>n(t[r]))),St=(...e)=>pe(db(...e.map(([t])=>t)),ub(...e.map(([,t])=>t)));St.enc=db;St.dec=ub;var fb=e=>{const t=Object.keys(e);return zs(St.enc(...Object.values(e)),n=>t.map(r=>n[r]))},pb=e=>{const t=Object.keys(e);return Ec(St.dec(...Object.values(e)),n=>Object.fromEntries(n.map((r,o)=>[t[o],r])))},re=e=>pe(fb(Ol(e,t=>t[0])),pb(Ol(e,t=>t[1])));re.enc=fb;re.dec=pb;var hb=(e,t)=>t>=0?n=>xn(n.map(e)):n=>xn([Te.enc(n.length),xn(n.map(e))]),mb=(e,t)=>Yt(n=>{const r=t>=0?t:Te.dec(n),o=new Array(r);for(let i=0;ipe(hb(e[0],t),mb(e[1],t));le.enc=hb;le.dec=mb;/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function nM(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function rM(...e){const t=i=>i,n=(i,s)=>a=>i(s(a)),r=e.map(i=>i.encode).reduceRight(n,t),o=e.map(i=>i.decode).reduce(n,t);return{encode:r,decode:o}}function oM(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function iM(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function lv(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const o=[],i=Array.from(e);for(i.forEach(s=>{if(s<0||s>=t)throw new Error(`Wrong integer: ${s}`)});;){let s=0,a=!0;for(let l=r;l{if(!nM(t))throw new Error("radix.encode input should be Uint8Array");return lv(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(lv(t,e,2**8))}}}const aM=e=>rM(sM(58),oM(e),iM("")),vb=aM("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function qr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function lM(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function kc(e,...t){if(!lM(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function _s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Np(e,t){kc(e);const n=t.outputLen;if(e.lengthnew Uint8Array(e.buffer,e.byteOffset,e.byteLength),lo=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Nl=(e,t)=>e<<32-t|e>>>t,lt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,gb=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,In=lt?e=>e:e=>gb(e);function st(e){for(let t=0;te().update(Ln(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function fM(e){const t=(r,o)=>e(o).update(Ln(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}function pM(e){const t=(r,o)=>e(o).update(Ln(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}const hM=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class wb extends yb{constructor(t,n,r={},o,i,s){if(super(),this.blockLen=t,this.outputLen=n,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,qr(t),qr(n),qr(o),n<0||n>o)throw new Error("outputLen bigger than keyLen");if(r.key!==void 0&&(r.key.length<1||r.key.length>o))throw new Error(`key must be up 1..${o} byte long or undefined`);if(r.salt!==void 0&&r.salt.length!==i)throw new Error(`salt must be ${i} byte long or undefined`);if(r.personalization!==void 0&&r.personalization.length!==s)throw new Error(`personalization must be ${s} byte long or undefined`);this.buffer32=lo(this.buffer=new Uint8Array(t))}update(t){_s(this);const{blockLen:n,buffer:r,buffer32:o}=this;t=Ln(t);const i=t.length,s=t.byteOffset,a=t.buffer;for(let l=0;lo[s]=In(i))}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:o,destroyed:i,outputLen:s,pos:a}=this;return t||(t=new this.constructor({dkLen:s})),t.set(...this.get()),t.length=r,t.finished=o,t.destroyed=i,t.outputLen=s,t.buffer.set(n),t.pos=a,t}}const Sa=BigInt(2**32-1),Xd=BigInt(32);function Ll(e,t=!1){return t?{h:Number(e&Sa),l:Number(e>>Xd&Sa)}:{h:Number(e>>Xd&Sa)|0,l:Number(e&Sa)|0}}function xb(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),vM=(e,t,n)=>e>>>n,gM=(e,t,n)=>e<<32-n|t>>>n,yM=(e,t,n)=>e>>>n|t<<32-n,wM=(e,t,n)=>e<<32-n|t>>>n,xM=(e,t,n)=>e<<64-n|t>>>n-32,bM=(e,t,n)=>e>>>n-32|t<<64-n,EM=(e,t)=>t,SM=(e,t)=>e,bb=(e,t,n)=>e<>>32-n,Eb=(e,t,n)=>t<>>32-n,Sb=(e,t,n)=>t<>>64-n,kb=(e,t,n)=>e<>>64-n;function kM(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}const CM=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),_M=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,RM=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),PM=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,IM=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0),AM=(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,at={fromBig:Ll,split:xb,toBig:mM,shrSH:vM,shrSL:gM,rotrSH:yM,rotrSL:wM,rotrBH:xM,rotrBL:bM,rotr32H:EM,rotr32L:SM,rotlSH:bb,rotlSL:Eb,rotlBH:Sb,rotlBL:kb,add:kM,add3L:CM,add3H:_M,add4L:RM,add4H:PM,add5H:AM,add5L:IM},De=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),$=new Uint32Array(32);function nr(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=$[2*e],c=$[2*e+1],d=$[2*t],f=$[2*t+1],u=$[2*n],p=$[2*n+1],h=$[2*r],m=$[2*r+1],w=at.add3L(l,d,s);c=at.add3H(w,c,f,a),l=w|0,{Dh:m,Dl:h}={Dh:m^c,Dl:h^l},{Dh:m,Dl:h}={Dh:at.rotr32H(m,h),Dl:at.rotr32L(m,h)},{h:p,l:u}=at.add(p,u,m,h),{Bh:f,Bl:d}={Bh:f^p,Bl:d^u},{Bh:f,Bl:d}={Bh:at.rotrSH(f,d,24),Bl:at.rotrSL(f,d,24)},$[2*e]=l,$[2*e+1]=c,$[2*t]=d,$[2*t+1]=f,$[2*n]=u,$[2*n+1]=p,$[2*r]=h,$[2*r+1]=m}function rr(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=$[2*e],c=$[2*e+1],d=$[2*t],f=$[2*t+1],u=$[2*n],p=$[2*n+1],h=$[2*r],m=$[2*r+1],w=at.add3L(l,d,s);c=at.add3H(w,c,f,a),l=w|0,{Dh:m,Dl:h}={Dh:m^c,Dl:h^l},{Dh:m,Dl:h}={Dh:at.rotrSH(m,h,16),Dl:at.rotrSL(m,h,16)},{h:p,l:u}=at.add(p,u,m,h),{Bh:f,Bl:d}={Bh:f^p,Bl:d^u},{Bh:f,Bl:d}={Bh:at.rotrBH(f,d,63),Bl:at.rotrBL(f,d,63)},$[2*e]=l,$[2*e+1]=c,$[2*t]=d,$[2*t+1]=f,$[2*n]=u,$[2*n+1]=p,$[2*r]=h,$[2*r+1]=m}class TM extends wb{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=De[0]|0,this.v0h=De[1]|0,this.v1l=De[2]|0,this.v1h=De[3]|0,this.v2l=De[4]|0,this.v2h=De[5]|0,this.v3l=De[6]|0,this.v3h=De[7]|0,this.v4l=De[8]|0,this.v4h=De[9]|0,this.v5l=De[10]|0,this.v5h=De[11]|0,this.v6l=De[12]|0,this.v6h=De[13]|0,this.v7l=De[14]|0,this.v7h=De[15]|0;const n=t.key?t.key.length:0;if(this.v0l^=this.outputLen|n<<8|65536|1<<24,t.salt){const r=lo(Ln(t.salt));this.v4l^=In(r[0]),this.v4h^=In(r[1]),this.v5l^=In(r[2]),this.v5h^=In(r[3])}if(t.personalization){const r=lo(Ln(t.personalization));this.v6l^=In(r[0]),this.v6h^=In(r[1]),this.v7l^=In(r[2]),this.v7h^=In(r[3])}if(t.key){const r=new Uint8Array(this.blockLen);r.set(Ln(t.key)),this.update(r)}}get(){let{v0l:t,v0h:n,v1l:r,v1h:o,v2l:i,v2h:s,v3l:a,v3h:l,v4l:c,v4h:d,v5l:f,v5h:u,v6l:p,v6h:h,v7l:m,v7h:w}=this;return[t,n,r,o,i,s,a,l,c,d,f,u,p,h,m,w]}set(t,n,r,o,i,s,a,l,c,d,f,u,p,h,m,w){this.v0l=t|0,this.v0h=n|0,this.v1l=r|0,this.v1h=o|0,this.v2l=i|0,this.v2h=s|0,this.v3l=a|0,this.v3h=l|0,this.v4l=c|0,this.v4h=d|0,this.v5l=f|0,this.v5h=u|0,this.v6l=p|0,this.v6h=h|0,this.v7l=m|0,this.v7h=w|0}compress(t,n,r){this.get().forEach((l,c)=>$[c]=l),$.set(De,16);let{h:o,l:i}=at.fromBig(BigInt(this.length));$[24]=De[8]^i,$[25]=De[9]^o,r&&($[28]=~$[28],$[29]=~$[29]);let s=0;const a=hM;for(let l=0;l<12;l++)nr(0,4,8,12,t,n+2*a[s++]),rr(0,4,8,12,t,n+2*a[s++]),nr(1,5,9,13,t,n+2*a[s++]),rr(1,5,9,13,t,n+2*a[s++]),nr(2,6,10,14,t,n+2*a[s++]),rr(2,6,10,14,t,n+2*a[s++]),nr(3,7,11,15,t,n+2*a[s++]),rr(3,7,11,15,t,n+2*a[s++]),nr(0,5,10,15,t,n+2*a[s++]),rr(0,5,10,15,t,n+2*a[s++]),nr(1,6,11,12,t,n+2*a[s++]),rr(1,6,11,12,t,n+2*a[s++]),nr(2,7,8,13,t,n+2*a[s++]),rr(2,7,8,13,t,n+2*a[s++]),nr(3,4,9,14,t,n+2*a[s++]),rr(3,4,9,14,t,n+2*a[s++]);this.v0l^=$[0]^$[16],this.v0h^=$[1]^$[17],this.v1l^=$[2]^$[18],this.v1h^=$[3]^$[19],this.v2l^=$[4]^$[20],this.v2h^=$[5]^$[21],this.v3l^=$[6]^$[22],this.v3h^=$[7]^$[23],this.v4l^=$[8]^$[24],this.v4h^=$[9]^$[25],this.v5l^=$[10]^$[26],this.v5h^=$[11]^$[27],this.v6l^=$[12]^$[28],this.v6h^=$[13]^$[29],this.v7l^=$[14]^$[30],this.v7h^=$[15]^$[31],$.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Cc=fM(e=>new TM(e)),Cb=new TextEncoder().encode("SS58PRE"),Qd=2,_b=e=>{try{const t=vb.decode(e),n=t.subarray(0,t[0]&64?2:1),r=t.subarray(n.length,t.length-Qd),o=t.subarray(n.length+r.length),i=Cc(Uint8Array.of(...Cb,...n,...r),{dkLen:64}).subarray(0,Qd);return o[0]===i[0]&&o[1]===i[1]?{isValid:!0,ss58Format:MM(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},MM=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.byteLength===1?t.getUint8(0):t.getUint16(0)},Rb=e=>{const t=e<64?Uint8Array.of(e):Uint8Array.of((e&252)>>2|64,e>>8|(e&3)<<6);return n=>{const r=Cc(Uint8Array.of(...Cb,...t,...n),{dkLen:64}).subarray(0,Qd);return vb.encode(Uint8Array.of(...t,...n,...r))}};function OM(e,t){return n=>{const r=_b(n);if(!r.isValid)throw new Error("Invalid checksum");const{publicKey:o}=r;if(o.length!==e)throw new Error("Invalid public key length");return o}}const Rs=(e=42,t=32)=>gi(Qe(t),OM(t),Rb(e)),cv="0123456789abcdef";function kt(e){const t=new Array(e.length+1);t[0]="0x";for(let n=0;n>4]+cv[r&15]}return t.join("")}const xu={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function Sn(e){const t=e.length%2,n=(e[1]==="x"?2:0)+t,r=(e.length-n)/2+t,o=new Uint8Array(r);t&&(o[0]=0|xu[e[2]]);for(let i=0;i[n,t(r,n)]))}const Ft=(...e)=>{const t=e.reduce((r,o)=>r+o.byteLength,0),n=new Uint8Array(t);for(let r=0,o=0;r{throw TypeError(e)},LM=(e,t,n)=>t in e?NM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bu=(e,t,n)=>LM(e,typeof t!="symbol"?t+"":t,n),Ab=(e,t,n)=>t.has(e)||Ib("Cannot "+n),Dr=(e,t,n)=>(Ab(e,t,"read from private field"),n?n.call(e):t.get(e)),Eu=(e,t,n)=>t.has(e)?Ib("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Su=(e,t,n,r)=>(Ab(e,t,"write to private field"),t.set(e,n),n),Po,Ui,Wi;const jM=new TextEncoder,$M=new TextDecoder;class mo{constructor(t){Eu(this,Po),Eu(this,Ui,null),Eu(this,Wi,null),bu(this,"asText",()=>Dr(this,Wi)===null?Su(this,Wi,$M.decode(Dr(this,Po))):Dr(this,Wi)),bu(this,"asHex",()=>Dr(this,Ui)===null?Su(this,Ui,kt(Dr(this,Po))):Dr(this,Ui)),bu(this,"asBytes",()=>Dr(this,Po)),Su(this,Po,t)}static fromText(t){return new this(jM.encode(t))}static fromHex(t){return new this(Sn(t))}static fromBytes(t){return new this(t)}}Po=new WeakMap;Ui=new WeakMap;Wi=new WeakMap;class Tb extends mo{constructor(t){super(t)}static fromArray(t){return new this(new Uint8Array(t))}}const Mb=e=>{const t=Qe.enc(e);return n=>t(n.asBytes())},Ob=e=>{const t=Qe.dec(e),n=e==null?mo:Tb;return r=>n.fromBytes(t(r))},Us=e=>pe(Mb(e),Ob(e));Us.enc=Mb;Us.dec=Ob;const ee=Te,Nb=Te,DM=Mp(e=>{const t=ee.dec(e),n=Math.ceil(t/8);return{bytes:Qe(n).dec(e),bitsLen:t}}),BM=e=>{if(e.bitsLen>e.bytes.length*8)throw new Error(`Not enough bytes. (bitsLen:${e.bitsLen}, bytesLen:${e.bytes.length})`);const t=ee.enc(e.bitsLen),n=new Uint8Array(e.bytes.length+t.length);return n.set(t,0),n.set(e.bytes,t.length),n},Lb=pe(BM,DM),zM=gi(Ne,e=>e.charCodeAt(0),String.fromCharCode),jb=e=>{const t=Qe.enc(e);return n=>t(Sn(n))},$b=e=>{const t=Qe.dec(e);return n=>kt(t(n))},$r=e=>pe(jb(e),$b(e));$r.enc=jb;$r.dec=$b;const FM=new TextEncoder,UM=new TextDecoder,WM=e=>gi(Qe(e),t=>FM.encode(t),t=>UM.decode(t)),Db=e=>{let t=n=>{const r=e();return t=r,r(n)};return n=>t(n)},Bb=e=>{let t=n=>{const r=e(),o=r;return t=r,o(n)};return n=>t(n)},Lp=e=>pe(Db(()=>e().enc),Bb(()=>e().dec)),VM={is(e,t){return e.type===t},as(e,t){if(t!==e.type)throw new Error(`Enum.as(enum, ${t}) used with actual type ${e.type}`);return e}},_c=Object.assign((e,t)=>({type:e,value:t}),VM),HM=new Proxy({},{get(e,t){return n=>_c(t,n)}}),zb=(...e)=>{const t=kn.enc(...e);return n=>t({tag:n.type,value:n.value})},Fb=(...e)=>{const t=kn.dec(...e);return n=>{const{tag:r,value:o}=t(n);return _c(r,o)}},Wn=(e,...t)=>pe(zb(qd(e,([n])=>n),...t),Fb(qd(e,([,n])=>n),...t));Wn.enc=zb;Wn.dec=Fb;const Ub=[],Wb=[],Vb=[],GM=BigInt(0),Ai=BigInt(1),KM=BigInt(2),YM=BigInt(7),XM=BigInt(256),QM=BigInt(113);for(let e=0,t=Ai,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Ub.push(2*(5*r+n)),Wb.push((e+1)*(e+2)/2%64);let o=GM;for(let i=0;i<7;i++)t=(t<>YM)*QM)%XM,t&KM&&(o^=Ai<<(Ai<n>32?Sb(e,t,n):bb(e,t,n),dv=(e,t,n)=>n>32?kb(e,t,n):Eb(e,t,n);function JM(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){const a=(s+8)%10,l=(s+2)%10,c=n[l],d=n[l+1],f=uv(c,d,1)^n[a],u=dv(c,d,1)^n[a+1];for(let p=0;p<50;p+=10)e[s+p]^=f,e[s+p+1]^=u}let o=e[2],i=e[3];for(let s=0;s<24;s++){const a=Wb[s],l=uv(o,i,a),c=dv(o,i,a),d=Ub[s];o=e[d],i=e[d+1],e[d]=l,e[d+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=qM[r],e[1]^=ZM[r]}n.fill(0)}class jp extends yb{constructor(t,n,r,o=!1,i=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,qr(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=lo(this.state)}keccak(){lt||st(this.state32),JM(this.state32,this.rounds),lt||st(this.state32),this.posOut=0,this.pos=0}update(t){_s(this);const{blockLen:n,state:r}=this;t=Ln(t);const o=t.length;for(let i=0;i=r&&this.keccak();const s=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return qr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Np(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new jp(n,r,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}}const e4=(e,t,n)=>dM(()=>new jp(t,e,n)),t4=e4(1,136,256/8),fv=e=>{const t=e.slice(2),n=kt(t4(t)).slice(2),r=new Array(40);for(let o=0;o<40;o++){const i=parseInt(n[o],16),s=t[o];r[o]=i>7?s.toUpperCase():s}return`0x${r.join("")}`},n4=Qe(20)[1],Hb=pe(e=>{const t=Sn(e);if(t.length!==20)throw new Error(`Invalid length found on EthAddress(${e})`);const n=kt(t);if(e===n||e===n.toUpperCase())return t;if(fv(n)!==e)throw new Error(`Invalid checksum found on EthAddress(${e})`);return t},Mp(e=>fv(kt(n4(e))))),pv=new TextEncoder,hv=new TextDecoder,r4=gi(Qe(4),pv.encode.bind(pv),hv.decode.bind(hv)),ku=re({engine:r4,payload:$r()}),o4=Wn({consensus:ku,seal:ku,preRuntime:ku,runtimeUpdated:se},[4,5,6,8]),Cu=$r(32),Gb=re({parentHash:Cu,number:ee,stateRoot:Cu,extrinsicRoot:Cu,digests:le(o4)}),Vn=le(Ye),mv=ut(Ye),i4=kn({bool:se,char:se,str:se,u8:se,u16:se,u32:se,u64:se,u128:se,u256:se,i8:se,i16:se,i32:se,i64:se,i128:se,i256:se}),Kb=le(re({name:mv,type:ee,typeName:mv,docs:Vn})),s4=re({len:Kt,type:ee}),a4=re({bitStoreType:ee,bitOrderType:ee}),l4=le(re({name:Ye,fields:Kb,index:Ne,docs:Vn})),c4=kn({composite:Kb,variant:l4,sequence:ee,array:s4,tuple:le(ee),primitive:i4,compact:ee,bitSequence:a4}),u4=re({name:Ye,type:ut(ee)}),d4=le(u4),f4=re({id:ee,path:Vn,params:d4,def:c4,docs:Vn}),Yb=le(f4),p4=kn({Blake2128:se,Blake2256:se,Blake2128Concat:se,Twox128:se,Twox256:se,Twox64Concat:se,Identity:se}),h4=le(p4),m4=re({hashers:h4,key:ee,value:ee}),v4=re({name:Ye,modifier:Ne,type:kn({plain:ee,map:m4}),fallback:$r(),docs:Vn}),g4=ut(re({prefix:Ye,items:le(v4)})),Xb={name:Ye,storage:g4,calls:ut(ee),events:ut(ee),constants:le(re({name:Ye,type:ee,value:$r(),docs:Vn})),errors:ut(ee),index:Ne},y4={...Xb,docs:Vn},w4=re({name:Ye,methods:le(re({name:Ye,inputs:le(re({name:Ye,type:ee})),output:ee,docs:Vn})),docs:Vn}),x4=re({version:Ne,address:ee,call:ee,signature:ee,extra:ee,signedExtensions:le(re({identifier:Ye,type:ee,additionalSigned:ee}))}),Qb=re({lookup:Yb,pallets:le(re(y4)),extrinsic:x4,type:ee,apis:le(w4),outerEnums:re({call:ee,event:ee,error:ee}),custom:le(St(Ye,re({type:ee,value:$r()})))}),b4=new Uint8Array,vv=e=>pe(()=>b4,()=>e),E4=re({type:ee,version:Ne,signedExtensions:le(re({identifier:Ye,type:ee,additionalSigned:ee}))}),qb=re({lookup:Yb,pallets:le(re({...Xb,docs:vv([])})),extrinsic:E4,type:ee,apis:vv([])}),gv=()=>{throw new Error("Unsupported metadata version!")},mt=pe(gv,gv),jl=re({magicNumber:Kt,metadata:kn({v0:mt,v1:mt,v2:mt,v3:mt,v4:mt,v5:mt,v6:mt,v7:mt,v8:mt,v9:mt,v10:mt,v11:mt,v12:mt,v13:mt,v14:qb,v15:Qb})}),S4={dkLen:32},$p=e=>Cc(e,S4),k4={dkLen:16},Zb=e=>Cc(e,k4),Jb=e=>Ft(Zb(e),e),Rn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function or(e,t,n,r,o){return e=e+t+o|0,r=Nl(r^e,16),n=n+r|0,t=Nl(t^n,12),{a:e,b:t,c:n,d:r}}function ir(e,t,n,r,o){return e=e+t+o|0,r=Nl(r^e,8),n=n+r|0,t=Nl(t^n,7),{a:e,b:t,c:n,d:r}}function yv(e,t,n,r,o,i,s,a,l,c,d,f,u,p,h,m,w,v,g,x){let b=0;for(let S=0;S{const e=Array.from({length:16},(r,o)=>o),t=r=>[2,6,3,10,7,0,4,13,1,11,12,5,9,14,15,8].map(o=>r[o]),n=[];for(let r=0,o=e;r<7;r++,o=t(o))n.push(...o);return Uint8Array.from(n)})();class Dp extends wb{constructor(t={},n=0){if(super(64,t.dkLen===void 0?32:t.dkLen,{},Number.MAX_SAFE_INTEGER,0,0),this.flags=0,this.chunkPos=0,this.chunksDone=0,this.stack=[],this.posOut=0,this.bufferOut32=new Uint32Array(16),this.chunkOut=0,this.enableXOF=!0,this.outputLen=t.dkLen===void 0?32:t.dkLen,qr(this.outputLen),t.key!==void 0&&t.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(t.key!==void 0){const r=Ln(t.key).slice();if(r.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=lo(r),lt||st(this.IV),this.flags=n|16}else if(t.context!==void 0){const r=new Dp({dkLen:32},32).update(t.context).digest();this.IV=lo(r),lt||st(this.IV),this.flags=n|64}else this.IV=Rn.slice(),this.flags=n;this.state=this.IV.slice(),this.bufferOut=cM(this.bufferOut32)}get(){return[]}set(){}b2Compress(t,n,r,o=0){const{state:i,pos:s}=this,{h:a,l}=Ll(BigInt(t),!0),{v0:c,v1:d,v2:f,v3:u,v4:p,v5:h,v6:m,v7:w,v8:v,v9:g,v10:x,v11:b,v12:S,v13:C,v14:k,v15:_}=yv(wv,o,r,7,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],Rn[0],Rn[1],Rn[2],Rn[3],a,l,s,n);i[0]=c^v,i[1]=d^g,i[2]=f^x,i[3]=u^b,i[4]=p^S,i[5]=h^C,i[6]=m^k,i[7]=w^_}compress(t,n=0,r=!1){let o=this.flags;if(this.chunkPos||(o|=1),(this.chunkPos===15||r)&&(o|=2),r||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,o,t,n),this.chunkPos+=1,this.chunkPos===16||r){let i=this.state;this.state=this.IV.slice();for(let s,a=this.chunksDone+1;(r||!(a&1))&&(s=this.stack.pop());a>>=1)this.buffer32.set(s,0),this.buffer32.set(i,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|4,this.buffer32,0),i=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(i)}this.pos=0}_cloneInto(t){t=super._cloneInto(t);const{IV:n,flags:r,state:o,chunkPos:i,posOut:s,chunkOut:a,stack:l,chunksDone:c}=this;return t.state.set(o.slice()),t.stack=l.map(d=>Uint32Array.from(d)),t.IV.set(n),t.flags=r,t.chunkPos=i,t.chunksDone=c,t.posOut=s,t.chunkOut=a,t.enableXOF=this.enableXOF,t.bufferOut32.set(this.bufferOut32),t}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let t of this.stack)t.fill(0)}b2CompressOut(){const{state:t,pos:n,flags:r,buffer32:o,bufferOut32:i}=this,{h:s,l:a}=Ll(BigInt(this.chunkOut++));lt||st(o);const{v0:l,v1:c,v2:d,v3:f,v4:u,v5:p,v6:h,v7:m,v8:w,v9:v,v10:g,v11:x,v12:b,v13:S,v14:C,v15:k}=yv(wv,0,o,7,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],Rn[0],Rn[1],Rn[2],Rn[3],a,s,n,r);i[0]=l^w,i[1]=c^v,i[2]=d^g,i[3]=f^x,i[4]=u^b,i[5]=p^S,i[6]=h^C,i[7]=m^k,i[8]=t[0]^w,i[9]=t[1]^v,i[10]=t[2]^g,i[11]=t[3]^x,i[12]=t[4]^b,i[13]=t[5]^S,i[14]=t[6]^C,i[15]=t[7]^k,lt||(st(o),st(i)),this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let t=this.flags|8;this.stack.length?(t|=4,lt||st(this.buffer32),this.compress(this.buffer32,0,!0),lt||st(this.buffer32),this.chunksDone=0,this.pos=this.blockLen):t|=(this.chunkPos?0:1)|2,this.flags=t,this.b2CompressOut()}writeInto(t){_s(this,!1),kc(t),this.finish();const{blockLen:n,bufferOut:r}=this;for(let o=0,i=t.length;o=n&&this.b2CompressOut();const s=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible after digest call");return this.writeInto(t)}xof(t){return qr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Np(t,this),this.finished)throw new Error("digest() was already called");return this.enableXOF=!1,this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}}const C4=pM(e=>new Dp(e)),_4={dkLen:32},e2=e=>C4(e,_4),R4=e=>Ft(e2(e),e),t2=e=>e,Br=(e,t,n,r)=>new DataView(new Uint16Array([e,t,n,r]).buffer).getBigUint64(0,!0),Bp=2n**64n-1n,et=(e,t)=>e<>64n-t,ue=(e,t)=>e*t&Bp,Fe=(e,t)=>e+t&Bp,Ue=11400714785074694791n,_t=14029467366897019727n,xv=1609587929392839161n,Ti=9650029242287828579n,bv=2870177450012600261n;function hr(e,t=0n){let n=Fe(Fe(t,Ue),_t),r=Fe(t,_t),o=t,i=t-Ue,s=e.length,a=0,l=null;(function(){let p=0,h=p+s;if(s){if(l=new Uint8Array(32),s<32){l.set(e.subarray(0,s),a),a+=s;return}if(p<=h-32){const m=h-32;do{let w;w=Br(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]),n=ue(et(Fe(n,ue(w,_t)),31n),Ue),p+=8,w=Br(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]),r=ue(et(Fe(r,ue(w,_t)),31n),Ue),p+=8,w=Br(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]),o=ue(et(Fe(o,ue(w,_t)),31n),Ue),p+=8,w=Br(e[p+1]<<8|e[p],e[p+3]<<8|e[p+2],e[p+5]<<8|e[p+4],e[p+7]<<8|e[p+6]),i=ue(et(Fe(i,ue(w,_t)),31n),Ue),p+=8}while(p<=m)}p=32?(c=et(n,1n),c=Fe(c,et(r,7n)),c=Fe(c,et(o,12n)),c=Fe(c,et(i,18n)),n=ue(et(ue(n,_t),31n),Ue),c=c^n,c=Fe(ue(c,Ue),Ti),r=ue(et(ue(r,_t),31n),Ue),c=c^r,c=Fe(ue(c,Ue),Ti),o=ue(et(ue(o,_t),31n),Ue),c=c^o,c=Fe(ue(c,Ue),Ti),i=ue(et(ue(i,_t),31n),Ue),c=c^i,c=Fe(ue(c,Ue),Ti)):c=Fe(t,bv),c=Fe(c,BigInt(s));d<=a-8;){let u=Br(e[d+1]<<8|e[d],e[d+3]<<8|e[d+2],e[d+5]<<8|e[d+4],e[d+7]<<8|e[d+6]);u=ue(et(ue(u,_t),31n),Ue),c=Fe(ue(et(c^u,27n),Ue),Ti),d+=8}if(d+4<=a){let u=ue(Br(e[d+1]<<8|e[d],e[d+3]<<8|e[d+2],0,0),Ue);c=Fe(ue(et(c^u,23n),_t),xv),d+=4}for(;d>33n;return c=ue(c^f,_t),f=c>>29n,c=ue(c^f,xv),f=c>>32n,c^=f,c}const Zd=e=>{const t=new Uint8Array(16),n=new DataView(t.buffer);return n.setBigUint64(0,hr(e),!0),n.setBigUint64(8,hr(e,1n),!0),t},P4=e=>{const t=new Uint8Array(32),n=new DataView(t.buffer);return n.setBigUint64(0,hr(e),!0),n.setBigUint64(8,hr(e,1n),!0),n.setBigUint64(16,hr(e,2n),!0),n.setBigUint64(24,hr(e,3n),!0),t},zp=e=>Ft(Fs.enc(hr(e)),e),Ev=new TextEncoder,Fp=e=>{const t=Zd(Ev.encode(e));return(n,r,...o)=>{const i=Ft(t,Zd(Ev.encode(n))),s=kt(i),a=o.map(f=>f[1]).map(f=>{switch(f){case t2:return 0;case zp:return 8;case Jb:return 16;default:return null}}).filter(f=>f!==null),l=f=>{if(!f.startsWith(s))throw new Error(`key does not match this storage (${e}.${n})`);if(a.length!==o.length)throw new Error("Impossible to decode this key");if(o.length===0)return[];const u=f.slice(s.length),p=new Array(o.length);for(let h=0,m=0;hp=>u(f(p)));return{enc:(...f)=>kt(Ft(i,...f.map((u,p)=>c[p](u)))),dec:r,keyDecoder:l}}},n2=Object.freeze(Object.defineProperty({__proto__:null,AccountId:Rs,Bin:Us,Binary:mo,Blake2128:Zb,Blake2128Concat:Jb,Blake2256:$p,Blake3256:e2,Blake3256Concat:R4,Bytes:Qe,Enum:_c,FixedSizeBinary:Tb,Hex:$r,Identity:t2,Option:ut,Result:Sc,ScaleEnum:kn,Self:Lp,Storage:Fp,Struct:re,Tuple:St,Twox128:Zd,Twox256:P4,Twox64Concat:zp,Variant:Wn,Vector:le,_Enum:HM,_void:se,bitSequence:Lb,blockHeader:Gb,bool:Op,char:zM,compact:Te,compactBn:Nb,compactNumber:ee,createCodec:pe,createDecoder:Mp,enhanceCodec:gi,enhanceDecoder:Ec,enhanceEncoder:zs,ethAccount:Hb,fixedStr:WM,fromBufferToBase58:Rb,getSs58AddressInfo:_b,h64:hr,i128:$T,i16:NT,i256:BT,i32:LT,i64:jT,i8:OT,metadata:jl,selfDecoder:Bb,selfEncoder:Db,str:Ye,u128:Jx,u16:ao,u256:DT,u32:Kt,u64:Fs,u8:Ne,v14:qb,v15:Qb},Symbol.toStringTag,{value:"Module"})),co=Te,I4=le(St(Ye,co)),ae={bool:"boolean",str:"string",num:"number",big:"bigint",numeric:"numeric",bits:"bitseq",void:"void"},A4=Wn(Object.fromEntries(Object.values(ae).map(e=>[e,se]))),T4=le(St(Ye,ut(Lp(()=>Up)))),M4=le(co),O4=re({typeRef:co,length:ut(co)}),N4=ut(Te),L4=co,j4=re({ok:co,ko:co}),Up=Wn({struct:I4,terminal:A4,enum:T4,tuple:M4,array:O4,binary:N4,option:L4,result:j4}),$4={i256:ae.big,i128:ae.big,i64:ae.big,i32:ae.num,i16:ae.num,i8:ae.num,u256:ae.big,u128:ae.big,u64:ae.big,u32:ae.num,u16:ae.num,u8:ae.num,bool:ae.bool,char:ae.str,str:ae.str},Mi=e=>({type:"terminal",value:{type:e}});function Ps(e,t=()=>{}){switch(e.type){case"AccountId20":case"AccountId32":return Mi(ae.str);case"array":return e.value.type==="primitive"&&e.value.value==="u8"?{type:"binary",value:e.len}:(t(e.value.id),{type:"array",value:{typeRef:e.value.id,length:e.len}});case"bitSequence":return Mi(ae.bits);case"compact":return Mi(e.isBig===null?ae.numeric:e.isBig?ae.big:ae.num);case"enum":return{type:"enum",value:Object.entries(e.value).map(([n,r])=>[n,(r.type==="lookupEntry"?Ps(r.value,t):Ps(r,t))??void 0])};case"struct":{const n=Object.entries(e.value).map(([r,o])=>[r,o.id]);return n.forEach(([,r])=>t(r)),{type:"struct",value:n}}case"tuple":{const n=e.value.map(r=>r.id);return n.forEach(t),{type:"tuple",value:n}}case"option":return t(e.value.id),{type:"option",value:e.value.id};case"primitive":return Mi($4[e.value]);case"result":return t(e.value.ok.id),t(e.value.ko.id),{type:"result",value:{ok:e.value.ok.id,ko:e.value.ko.id}};case"sequence":return e.value.type==="primitive"&&e.value.value==="u8"?{type:"binary",value:void 0}:(t(e.value.id),{type:"array",value:{typeRef:e.value.id}});case"void":return Mi(ae.void)}}function Wp(e,t,n){if(t.type==="option"&&e==null)return!0;const r=(i,s)=>Wp(i,s,n),o=i=>{switch(i.value.type){case ae.str:case ae.big:case ae.bool:case ae.num:return typeof e===i.value.type;case ae.bits:return typeof e=="object"&&e!=null&&typeof e.bitsLen=="number"&&e.bytes instanceof Uint8Array;case ae.numeric:return typeof e=="number"||typeof e=="bigint";case ae.void:return!0}};switch(t.type){case"terminal":return o(t);case"binary":return e instanceof mo&&(t.value==null||e.asBytes().length>=t.value);case"array":if(!Array.isArray(e))return!1;const i=e;return t.value.length!=null&&i.lengthr(c,n(t.value.typeRef)));case"enum":if(!e)return!1;const s=e,a=Object.fromEntries(t.value);if(!(s.type in a))return!1;const l=a[s.type];return l==null?!0:r(s.value,l);case"option":return e==null?!0:r(e,n(t.value));case"struct":return e?t.value.every(([c,d])=>r(e[c],n(d))):!1;case"tuple":return e?t.value.every((c,d)=>r(e[d],n(c))):!1;case"result":return"success"in e&&"value"in e?r(e.value,n(e.success?t.value.ok:t.value.ko)):!1}}var D4=Object.defineProperty,B4=(e,t,n)=>t in e?D4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z4=(e,t,n)=>B4(e,t+"",n);class r2{constructor(t=[]){z4(this,"value",new Map),t.forEach(([n,r])=>this.add(n,r))}has(t,n){var r;return((r=this.value.get(t))==null?void 0:r.has(n))??!1}add(t,n){this.value.has(t)||this.value.set(t,new Set),this.value.get(t).add(n)}addAll(t){t.forEach(([n,r])=>this.add(n,r))}delete(t,n){if(!this.value.has(t))return;const r=this.value.get(t);r.delete(n),r.size||this.value.delete(t)}isEmpty(){return!this.value.size}get values(){return Array.from(this.value).flatMap(([t,n])=>Array.from(n).map(r=>[t,r]))}}var Vr=(e=>(e[e.Incompatible=0]="Incompatible",e[e.Partial=1]="Partial",e[e.BackwardsCompatible=2]="BackwardsCompatible",e[e.Identical=3]="Identical",e))(Vr||{});function Jd(e,t,n,r,o){if(!n&&!e)return gt(3);if(!n)return gt(2);if(!e)return gt(n.type==="option"?2:0);o.has(n)||o.set(n,new Map);const i=o.get(n);if(i.has(e)){const a=i.get(e);return a===null?{level:3,assumptions:new r2([[e,n]])}:gt(a)}i.set(e,null);const s=F4(e,n,(a,l)=>Jd(typeof a=="number"?t(a):a,t,typeof l=="number"?r(l):l,r,o));return s.assumptions.delete(e,n),s.assumptions.isEmpty()||s.level===0?i.set(e,s.level):i.delete(e),s}function F4(e,t,n){if(e.type!==t.type)return t.type==="option"?ka(n(e,t.value),2):e.type==="option"?ka(n(e.value,t),1):gt(0);switch(t.type){case"terminal":return gt(t.value.type===e.value.type?3:0);case"binary":return gt(kv(e.value,t.value));case"array":const o=e,i=gt(kv(o.value.length,t.value.length));return _u([i,()=>n(o.value.typeRef,t.value.typeRef)]);case"enum":{const d=e,f=Object.fromEntries(t.value),u=d.value.length===t.value.length?3:2;return ka(Sv(d.value.map(([p,h])=>()=>p in f?n(h,f[p]):gt(0))),u)}case"option":return n(e.value,t.value);case"struct":const s=e,a=Object.fromEntries(s.value),l=s.value.length===t.value.length?3:2;return ka(_u(t.value.map(([d,f])=>()=>n(a[d],f))),l);case"tuple":{const d=e,f=gt(W4(d.value,t.value));return _u([f,...t.value.map((u,p)=>()=>n(d.value[p],u))])}case"result":const c=e;return Sv([n(c.value.ok,t.value.ok),n(c.value.ko,t.value.ko)])}}const ka=(e,t)=>({...e,level:Math.min(e.level,t)}),U4=new r2,gt=e=>({level:e,assumptions:U4}),_u=e=>{let t=gt(3);for(const n of e){const r=typeof n=="function"?n():n;if(r.level===0)return r;t.assumptions.addAll(r.assumptions.values),t.level=Math.min(t.level,r.level)}return t},Sv=e=>{if(!e.length)return gt(3);let t=!1,n=gt(3);for(const r of e){const o=typeof r=="function"?r():r;if(o.level===0){n.level=Math.min(n.level,1);continue}t=!0,n.assumptions.addAll(o.assumptions.values),n.level=Math.min(n.level,o.level)}return t?n:gt(0)},W4=(e,t)=>t.length===e.length?3:e.length>=t.length?2:0,kv=(e,t)=>t===e?3:t==null||e>=t?2:e==null?1:0,Cv=Wn({lookup:Te,typedef:Up}),Zo=e=>({type:"lookup",value:e}),Vp=e=>({type:"typedef",value:e}),$l=Vp({type:"terminal",value:{type:ae.void}}),V4=re({args:Cv,values:Cv});function H4(e){if(e.type.tag==="plain")return{args:$l,values:Zo(e.type.value)};const{key:t,value:n}=e.type.value;return{args:Zo(t),values:Zo(n)}}function G4(e){return{args:Vp({type:"tuple",value:e.inputs.map(t=>t.type)}),values:Zo(e.output)}}function K4(e){return e.type==="lookupEntry"?Zo(e.value.id):Vp(Ps(e))}function Y4(e){return{args:$l,values:Zo(e)}}function X4(e,t,n,r,o){const i=(s,a)=>s.type==="lookup"?a(s.value):s.value;return{args:Jd(i(e.args,t),t,i(n.args,r),r,o).level,values:Jd(i(n.values,r),r,i(e.values,t),t,o).level}}function _v(e,t,n){const r=e.type==="lookup"?t(e.value):e.value;return Wp(n,r,t)}const Fo=()=>{},Ut={body:"",call:"",continue:"",follow:"",header:"",stopOperation:"",storage:"",unfollow:"",unpin:"",followEvent:""},Ya={chainName:"",genesisHash:"",properties:""},ef={broadcast:"",stop:""};Object.entries({chainHead:Ut,chainSpec:Ya,transaction:ef}).forEach(([e,t])=>{Object.keys(t).forEach(n=>{t[n]=`${e}_v1_${n}`})});const Q4=e=>(t,n)=>{let r=e(ef.broadcast,[t],{onSuccess:o=>{r=o===null?Fo:()=>{e(ef.stop,[o])},o===null&&n(new Error("Max # of broadcasted transactions has been reached"))},onError:n});return()=>{r()}};class o2 extends Error{constructor(){super("ChainHead stopped"),this.name="StopError"}}class Xa extends Error{constructor(){super("ChainHead disjointed"),this.name="DisjointError"}}class Rc extends Error{constructor(){super("ChainHead operations limit reached"),this.name="OperationLimitError"}}class i2 extends Error{constructor(t){super(t),this.name="OperationError"}}class Hp extends Error{constructor(){super("ChainHead operation inaccessible"),this.name="OperationInaccessibleError"}}function q4(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),res:e,rej:t}}const s2=()=>{const e=new Map;return{has:e.has.bind(e),subscribe(t,n){e.set(t,n)},unsubscribe(t){e.delete(t)},next(t,n){var r;(r=e.get(t))==null||r.next(n)},error(t,n){const r=e.get(t);r&&(e.delete(t),r.error(n))},errorAll(t){const n=[...e.values()];e.clear(),n.forEach(r=>{r.error(t)})}}},Pc=e=>(...t)=>new Promise((n,r)=>{let o=ns;const[i,s]=t[t.length-1]instanceof AbortSignal?[t.slice(0,t.length-1),t[t.length-1]]:[t],a=()=>{o(),r(new Pb)};s==null||s.addEventListener("abort",a,{once:!0});const l=c=>d=>{o=ns,s==null||s.removeEventListener("abort",a),c(d)};o=e(l(n),l(r),...i)}),a2=(e,t)=>n=>Pc((r,o,...i)=>{let s=!0,a=()=>{s=!1};const[l,c]=t(...i);return n(e,l,{onSuccess:(d,f)=>{if(d.result==="limitReached")return o(new Rc);const{operationId:u}=d,p=()=>{n(Ut.stopOperation,[u])};if(!s)return p();let h=Fo;const m=v=>{s=!1,h(),r(v)},w=v=>{s=!1,h(),o(v)};h=f(u,{next:v=>{const g=v;g.event==="operationError"?o(new i2(g.error)):g.event==="operationInaccessible"?o(new Hp):c(v,m,w)},error:w}),a=()=>{s&&(h(),p())}},onError:o}),()=>{a()}}),Z4=a2(Ut.body,e=>[[e],(t,n)=>{n(t.value)}]),J4=a2(Ut.call,(e,t,n)=>[[e,t,n],(r,o)=>{o(r.output)}]),eO=e=>t=>new Promise((n,r)=>{e(Ut.header,[t],{onSuccess:n,onError:r})}),l2=e=>(t,n,r,o,i,s,a)=>{if(n.length===0)return s(),ns;let l=!0,c=()=>{l=!1};return e(Ut.storage,[t,n,r],{onSuccess:(d,f)=>{if(d.result==="limitReached"||d.discardedItems===n.length)return i(new Rc);const{operationId:u}=d,p=()=>{e(Ut.stopOperation,[u])};if(!l)return p();const h=f(d.operationId,{next:v=>{switch(v.event){case"operationStorageItems":{o(v.items);break}case"operationStorageDone":{w();break}case"operationError":{m(new i2(v.error));break}case"operationInaccessible":{m(new Hp);break}default:e(Ut.continue,[v.operationId])}},error:i});c=()=>{h(),e(Ut.stopOperation,[d.operationId])};const m=v=>{c=ns,h(),i(v)},w=()=>{c=ns,h(),s()};a(d.discardedItems)},onError:i}),()=>{c()}},tO=e=>{const t=l2(e);return Pc((n,r,o,i,s,a)=>{const l=i.startsWith("descendants");let c=l?[]:null;const f=t(o,[{key:s,type:i}],a??null,l?u=>{c.push(u)}:u=>{var p;c=(p=u[0])==null?void 0:p[i]},r,()=>{try{n(l?c.flat():c)}catch(u){r(u)}},u=>{u>0&&(f(),r(new Rc))});return f})},nO=e=>t=>t.length>0?new Promise((n,r)=>{e(Ut.unpin,[t],{onSuccess(){n()},onError:r})}):Promise.resolve();class Dl extends Error{constructor(){super("Client destroyed"),this.name="DestroyedError"}}function rO(e){return e.operationId!==void 0}function oO(e){return(t,n,r)=>{const o=s2(),i=new Set,s=q4();let a=s.promise;const l=h=>{if(rO(h))return o.has(h.operationId)||console.warn("Uknown operationId on",h),o.next(h.operationId,h);if(h.event!=="stop"){if(h.event==="initialized")return n({type:h.event,finalizedBlockHashes:h.finalizedBlockHashes,finalizedBlockRuntime:h.finalizedBlockRuntime});const{event:m,...w}=h;return n({type:m,...w})}r(new o2),u(!1)},c=h=>{r(h),u(!(h instanceof Dl))},d=(h,m)=>{const w=m(h,{next:l,error:c});u=(v=!0)=>{a=null,u=Fo,w(),v&&e(Ut.unfollow,[h]),o.errorAll(new Xa),i.forEach(g=>{g()}),i.clear()},a=h,s.res(h)},f=h=>{h instanceof Dl?u(!1):r(h),a=null,s.res(h)};let u=e(Ut.follow,[t],{onSuccess:d,onError:f});const p=(h,m,w)=>{const v=()=>{w==null||w.onError(new Xa)};if(a===null)return v(),Fo;const g=b=>{if(!w)return e(h,[b,...m]);i.add(v);const S=(k,_)=>a===null?(_.error(new Xa),Fo):(o.subscribe(k,_),()=>{o.unsubscribe(k)}),C=e(h,[b,...m],{onSuccess:k=>{i.delete(v),w.onSuccess(k,S)},onError:k=>{i.delete(v),w.onError(k)}});return()=>{i.delete(v),C()}};if(typeof a=="string")return g(a);let x=Fo;return a.then(b=>{if(b instanceof Error)return v();a&&(x=g(b))}),()=>{x()}};return{unfollow(){u(),a=null},body:Z4(p),call:J4(p),header:eO(p),storage:tO(p),storageSubscription:l2(p),unpin:nO(p),_request:p}}}var iO=Object.defineProperty,sO=(e,t,n)=>t in e?iO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rv=(e,t,n)=>sO(e,typeof t!="symbol"?t+"":t,n);class Pv extends Error{constructor(t){super(t.message),Rv(this,"code"),Rv(this,"data"),this.code=t.code,this.data=t.data,this.name="RpcError"}}let aO=1;const lO=e=>{let t=aO++;const n=new Map,r=s2();let o=null;const i=(d,f,u)=>{o.send(JSON.stringify({jsonrpc:"2.0",id:d,method:f,params:u}))};function s(d){try{let f,u,p,h,m;if({id:f,result:u,error:p,params:h}=JSON.parse(d),f){const g=n.get(f);return g?(n.delete(f),p?g.onError(new Pv(p)):g.onSuccess(u,(x,b)=>{const S=x;return r.subscribe(S,b),()=>{r.unsubscribe(S)}})):void 0}if({subscription:m,result:u,error:p}=h,!m||!p&&!Object.hasOwn(h,"result"))throw 0;const v=m;p?r.error(v,new Pv(p)):r.next(v,u)}catch(f){console.warn("Error parsing incomming message: "+d),console.error(f)}}o=e(s);const a=()=>{o==null||o.disconnect(),o=null,r.errorAll(new Dl),n.forEach(d=>d.onError(new Dl)),n.clear()};let l=1;return{request:(d,f,u)=>{if(!o)throw new Error("Not connected");const p=`${t}-${l++}`;return u&&n.set(p,u),i(p,d,f),()=>{n.delete(p)}},disconnect:a}},cO=e=>{const t=Pc((r,o,i,s)=>e(i,s,{onSuccess:r,onError:o}));let n=null;return async()=>n||(n=Promise.all([t(Ya.chainName,[]),t(Ya.genesisHash,[]),t(Ya.properties,[])]).then(([r,o,i])=>({name:r,genesisHash:o,properties:i})))},uO=e=>{const{request:t,disconnect:n}=lO(e);return{chainHead:oO(t),transaction:Q4(t),getChainSpecData:cO(t),destroy:n,request:Pc((r,o,i,s)=>t(i,s,{onSuccess:r,onError:o})),_request:t}};function Re(e){return typeof e=="function"}function Gp(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ru=Gp(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription: `+n.map(function(r,o){return o+1+") "+r.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=n}});function Bl(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var vo=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=li(s),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(m){t={error:m}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else s.remove(this);var d=this.initialTeardown;if(Re(d))try{d()}catch(m){i=m instanceof Ru?m.errors:[m]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=li(f),p=u.next();!p.done;p=u.next()){var h=p.value;try{Iv(h)}catch(m){i=i??[],m instanceof Ru?i=Un(Un([],Ir(i)),Ir(m.errors)):i.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}if(i)throw new Ru(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Iv(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&Bl(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Bl(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),c2=vo.EMPTY;function u2(e){return e instanceof vo||e&&"closed"in e&&Re(e.remove)&&Re(e.add)&&Re(e.unsubscribe)}function Iv(e){Re(e)?e():e.unsubscribe()}var d2={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},f2={setTimeout:function(e,t){for(var n=[],r=2;r0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?c2:(this.currentObservers=null,a.push(n),new vo(function(){r.currentObservers=null,Bl(a,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,o=r.hasError,i=r.thrownError,s=r.isStopped;o?n.error(i):s&&n.complete()},t.prototype.asObservable=function(){var n=new ie;return n.source=this,n},t.create=function(n,r){return new Tv(n,r)},t}(ie),Tv=function(e){Yn(t,e);function t(n,r){var o=e.call(this)||this;return o.destination=n,o.source=r,o}return t.prototype.next=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.next)===null||o===void 0||o.call(r,n)},t.prototype.error=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.error)===null||o===void 0||o.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,o;return(o=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&o!==void 0?o:c2},t}(Ic),Xp={now:function(){return(Xp.delegate||Date).now()},delegate:void 0},Ac=function(e){Yn(t,e);function t(n,r,o){n===void 0&&(n=1/0),r===void 0&&(r=1/0),o===void 0&&(o=Xp);var i=e.call(this)||this;return i._bufferSize=n,i._windowTime=r,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,n),i._windowTime=Math.max(1,r),i}return t.prototype.next=function(n){var r=this,o=r.isStopped,i=r._buffer,s=r._infiniteTimeWindow,a=r._timestampProvider,l=r._windowTime;o||(i.push(n),!s&&i.push(a.now()+l)),this._trimBuffer(),e.prototype.next.call(this,n)},t.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),o=this,i=o._infiniteTimeWindow,s=o._buffer,a=s.slice(),l=0;l=2,!0))}function Vs(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new Ic}:t,r=e.resetOnError,o=r===void 0?!0:r,i=e.resetOnComplete,s=i===void 0?!0:i,a=e.resetOnRefCountZero,l=a===void 0?!0:a;return function(c){var d,f,u,p=0,h=!1,m=!1,w=function(){f==null||f.unsubscribe(),f=void 0},v=function(){w(),d=u=void 0,h=m=!1},g=function(){var x=d;v(),x==null||x.unsubscribe()};return qe(function(x,b){p++,!m&&!h&&w();var S=u=u??n();b.add(function(){p--,p===0&&!m&&!h&&(f=Iu(g,l))}),S.subscribe(b),!d&&p>0&&(d=new ci({next:function(C){return S.next(C)},error:function(C){m=!0,w(),f=Iu(v,o,C),S.error(C)},complete:function(){h=!0,w(),f=Iu(v,s),S.complete()}}),Ct(x).subscribe(d))})(c)}}function Iu(e,t){for(var n=[],r=2;rt in e?dN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lv=(e,t,n)=>fN(e,typeof t!="symbol"?t+"":t,n);class pN{constructor(){Lv(this,"first"),Lv(this,"last")}getRemoveFn(t){return()=>{t.prev?t.prev.next=t.next:this.first=t.next,t.next?t.next.prev=t.prev:this.last=t.prev,delete t.prev,delete t.next}}push(t){const n={value:t};return this.last===void 0?this.last=this.first=n:(this.last.next=n,n.prev=this.last,this.last=n),this.getRemoveFn(n)}unshift(t){return this.first={value:t,next:this.first},this.first.next&&(this.first.next.prev=this.first),this.last||(this.last=this.first),this.getRemoveFn(this.first)}pop(){var n,r;const t=(n=this.first)==null?void 0:n.value;return this.first&&(this.first=this.first.next,this.first?((r=this.first.prev)==null||delete r.next,delete this.first.prev):this.last=void 0),t}isEmpty(){return!this.first}}const hN=()=>{const e=new Map,t=(u,p)=>{e.set(u,()=>{e.delete(u),p()})},n=u=>{var p;(p=e.get(u))==null||p()},r=new pN,o=r.unshift.bind(r),i=r.push.bind(r),s=(u,p)=>{const h=p?o:i;t(u.source$,h(u))},a=()=>{const u=r.pop();u&&(e.delete(u.source$),l(u))},l=u=>{const{source$:p,observer:h}=u;let m=!1;const w=p.subscribe({next(v){h.next(v)},error(v){(m=v instanceof Rc)?s(u,!0):h.error(v)},complete(){h.complete()}});w.closed?m||a():t(p,()=>{w.unsubscribe(),a()})},c=(u=!1)=>p=>new ie(h=>{const m={observer:h,source$:p};return r.isEmpty()?l(m):s(m,u),()=>{n(p)}}),d=c();return{withRecovery:c,withRecoveryFn:u=>(...p)=>d(u(...p))}},mN=(e,t)=>n=>(r,...o)=>(r===null||r==="finalized"?e:r==="best"?t:nt(r)).pipe(bn(1),Se(s=>n(s,...o))),jv=e=>(...t)=>new ie(n=>{let r=new AbortController;return e(...t,r.signal).then(o=>{n.next(o),n.complete()},o=>{n.error(o)}),()=>{n.unsubscribe(),r.abort(),r=void 0}}),vN=e=>t=>(...n)=>e()[t](...n);class th extends Error{constructor(){super("Block is not pinned"),this.name="BlockNotPinnedError"}}class gN extends Error{constructor(){super("Block pruned"),this.name="BlockPrunedError"}}class N2 extends Error{constructor(){super("Block is not best block or finalized"),this.name="NotBestBlockError"}}const yN=(e,t)=>e.pipe(Nv(n=>n.blocks.has(t)),Jt((n,r)=>n.finalized===r.finalized&&n.best===r.best),yo(n=>n.blocks.get(n.best).number>=n.blocks.get(t).number),X(n=>{const{number:r}=n.blocks.get(t);let o=n.blocks.get(n.best),i=n.finalized===o.hash;for(;o.number>r;)o=n.blocks.get(o.parent),i=i||n.finalized===o.hash;return i?"finalized":o.hash===t?"best":null}),Jt(),Nv(n=>n!=="finalized",!0)),wN=e=>{let t=null,n=Ar;const r=new ie(o=>{t=e(!0,i=>{o.next(i)},i=>{t=null,o.error(i)}),n=()=>{o.complete(),t==null||t.unfollow()}}).pipe(Vs());return{getFollower:()=>{if(!t)throw new Error("Missing chainHead subscription");return t},unfollow:()=>{n()},follow$:r}},L2=()=>e=>new ie(t=>{const n=new vo,r=()=>e.subscribe({next:o=>t.next(o),error:o=>{o instanceof o2?(t.next({type:"stop-error"}),n.add(r())):t.error(o)},complete:()=>t.complete()});return n.add(r()),n});function xN(e,t,n){return(r,o,...i)=>(o?mO(EN(r,t.pipe(L2(),yo(a=>a.type==="finalized"),Se(a=>a.prunedBlockHashes))),bN(r,e)):a=>a)(n(r,...i))}const bN=(e,t)=>n=>yN(t,e).pipe(bn(1),eh(r=>r?n:qp(()=>new N2))),EN=(e,t)=>n=>new ie(r=>{const o=t.pipe(yo(s=>s===e)).subscribe(()=>{r.error(new gN)}),i=n.subscribe(r);return()=>{o.unsubscribe(),i.unsubscribe()}});function qa(e,t){return(n,...r)=>{const o=t(n,...r);return new ie(i=>{let s=null,a=!1;const l=()=>{a||(a=!0,s=o.subscribe({next:f=>i.next(f),error:f=>i.error(f),complete:()=>i.complete()}),s.add(()=>{a=!1,s=null}))};let c=!1;const d=e.subscribe({next:f=>{const u=f.blocks.get(n);u?u.recovering?s==null||s.unsubscribe():l():c&&i.error(new th),c=f.recovering},error:f=>i.error(f)});return()=>{d.unsubscribe(),s==null||s.unsubscribe()}})}}const SN=e=>{const t=e.pipe(Fl(n=>n instanceof Hp?nN(750).pipe(M2(()=>t)):qp(()=>n)));return t},Au=e=>(...t)=>SN(e(...t)),kN=(e,t)=>{const n=(r,o,i,s)=>new ie(a=>e().storageSubscription(r,o,i??null,l=>{a.next(l)},l=>{a.error(l)},()=>{a.complete()},l=>{l!==0&&a.next(n(r,o.slice(-l),i,!0))})).pipe(Zp(),t(s));return n},$v=(e,t)=>e.type==="array"&&e.len===t&&e.value.type==="primitive"&&e.value.value==="u8",zr={type:"void"},CN=e=>{const t=e.lookup,n=new Map,r=new Set,o=f=>u=>{let p=n.get(u);if(p)return p;if(r.has(u)){const m={id:u};return n.set(u,m),m}r.add(u);const h=f(u);return p=n.get(u),p?Object.assign(p,h):(p={id:u,...h},n.set(u,p)),r.delete(u),p};let i=!0,s=!0;const a=o(f=>{const{def:u,path:p,params:h}=t[f];if(u.tag==="composite"){if(u.value.length===0)return zr;if(u.value.length===1){const w=a(u.value[0].type);return i&&p.at(-1)==="AccountId32"&&$v(w,32)?(i=!1,{type:"AccountId32"}):s&&p.at(-1)==="AccountId20"&&$v(w,20)?(s=!1,{type:"AccountId20"}):w}const m=l(u);return m?{type:"enum",innerDocs:{},value:Object.fromEntries(e.pallets.map(w=>[w.name,w.errors==null?{...zr,idx:w.index}:{type:"lookupEntry",value:a(w.errors),idx:w.index}])),byteLength:m}:c(u.value)}if(u.tag==="variant"){if(p.length===1&&p[0]==="Option"&&h.length===1&&h[0].name==="T"){const v=a(h[0].type);return v.type==="void"?{type:"primitive",value:"bool"}:{type:"option",value:v}}if(p.length===1&&p[0]==="Result"&&h.length===2&&h[0].name==="T"&&h[1].name==="E")return{type:"result",value:{ok:a(h[0].type),ko:a(h[1].type)}};if(u.value.length===0)return zr;const m={},w={};return u.value.forEach(v=>{const g=v.name;if(w[g]=v.docs,v.fields.length===0){m[g]={...zr,idx:v.index};return}if(v.fields.length===1&&!v.fields[0].name){m[g]={type:"lookupEntry",value:a(v.fields[0].type),idx:v.index};return}m[g]={...c(v.fields),idx:v.index}}),{type:"enum",value:m,innerDocs:w}}if(u.tag==="sequence")return{type:"sequence",value:a(u.value)};if(u.tag==="array"){const{len:m}=u.value,w=a(u.value.type);return!m||w.type==="void"?zr:m>0?{type:"array",value:w,len:u.value.len}:w}if(u.tag==="tuple")return u.value.length===0?zr:u.value.length>1?d(u.value.map(m=>a(m)),u.value.map(m=>t[m].docs)):a(u.value[0]);if(u.tag==="primitive")return{type:"primitive",value:u.value.tag};if(u.tag==="compact"){const m=a(u.value);return m.type==="void"?{type:"compact",isBig:null}:{type:"compact",isBig:Number(m.value.slice(1))>32}}return{type:u.tag}});function l(f){if(!(f.value.length===2&&f.value[0].name==="index"&&f.value[1].name==="error"))return null;const p=a(f.value[0].type),h=a(f.value[1].type);return p.type==="primitive"&&p.value==="u8"&&h.type==="array"&&h.value.type==="primitive"&&h.value.value==="u8"?1+h.len:null}const c=f=>{let u=!0;const p={},h={};return f.forEach((m,w)=>{u=u&&!!m.name;const v=m.name||w,g=a(m.type);g.type!=="void"&&(p[v]=g,h[v]=m.docs)}),u?{type:"struct",value:p,innerDocs:h}:d(Object.values(p),Object.values(h))},d=(f,u)=>{if(f.every(p=>p.id===f[0].id)&&u.every(p=>!p.length)){const[p]=f;return p.type==="void"?zr:{type:"array",value:f[0],len:f.length}}return{type:"tuple",value:f,innerDocs:u}};return Object.assign(a,{metadata:e})},_N=(e,t,n)=>(r,o,i,...s)=>{const{id:a}=r;if(o.has(a))return o.get(a);if(i.has(a)){const c=t(()=>o.get(a),r,...s);return o.set(a,c),c}i.add(a);let l=e(r,o,i,...s);return i.delete(a),o.has(a)&&(l=n(l,o.get(a),r,...s)),o.set(a,l),l},RN=Us(),PN=pe(Te[0],Ec(Te[1],BigInt)),IN=(e,t,n,r)=>{if(e.type==="primitive")return n2[e.value];if(e.type==="void")return se;if(e.type==="AccountId32")return r;if(e.type==="AccountId20")return Hb;if(e.type==="compact")return e.isBig?PN:Te;if(e.type==="bitSequence")return Lb;const o=p=>j2(p,t,n,r),i=(p,h)=>{const m=o(p);return h?le(m,h):le(m)},s=p=>St(...p.map(o)),a=p=>{const h=Object.fromEntries(Object.entries(p).map(([m,w])=>[m,o(w)]));return re(h)};if(e.type==="sequence"&&e.value.type==="primitive"&&e.value.value==="u8")return RN;if(e.type==="array")return e.value.type==="primitive"&&e.value.value==="u8"?Us(e.len):i(e.value,e.len);if(e.type==="sequence")return i(e.value);if(e.type==="tuple")return s(e.value);if(e.type==="struct")return a(e.value);if(e.type==="option")return ut(o(e.value));if(e.type==="result")return Sc(o(e.value.ok),o(e.value.ko));const l=Object.values(e.value).map(p=>{switch(p.type){case"void":return se;case"lookupEntry":return o(p.value);case"tuple":return s(p.value);case"struct":return a(p.value);case"array":return i(p.value,p.len)}}),c=Object.fromEntries(Object.keys(e.value).map((p,h)=>[p,l[h]])),d=Object.values(e.value).map(p=>p.idx),u=d.every((p,h)=>p===h)?Wn(c):Wn(c,d);return e.byteLength?AN(u,e.byteLength):u},j2=_N(IN,Lp,e=>e),$2=e=>{var p;const{metadata:t}=e;let n=Rs();const r=new Map,o=h=>j2(e(h),r,new Set,n),i=(p=t.pallets.find(h=>h.name==="System"))==null?void 0:p.constants.find(h=>h.name==="SS58Prefix");let s;if(i)try{const h=o(i.type).dec(i.value);typeof h=="number"&&(s=h,n=Rs(h))}catch{}const a=new Map,l=(h,m)=>{let w=a.get(h);w||a.set(h,w=Fp(h));const v=t.pallets.find(A=>A.name===h).storage.items.find(A=>A.name===m),g=(A,...I)=>{const O=w(...I);return{...O,len:A,fallback:v.modifier===1?O.dec(v.fallback):void 0}};if(v.type.tag==="plain")return g(0,m,o(v.type.value).dec);const{key:x,value:b,hashers:S}=v.type.value,C=o(b),k=S.map(A=>n2[A.tag]),_=(()=>{if(k.length===1)return[[o(x),k[0]]];const A=e(x);switch(A.type){case"array":return k.map(I=>[o(A.value.id),I]);case"tuple":return A.value.map((I,O)=>[o(I.id),k[O]]);default:throw new Error("Invalid key type")}})();return g(k.length,m,C.dec,..._)},c=h=>{switch(h.type){case"void":return se;case"lookupEntry":return o(h.value.id);case"tuple":return St(...Object.values(h.value).map(m=>o(m.id)));case"struct":return re(qd(h.value,m=>o(m.id)));case"array":return le(o(h.value.id),h.len)}},d=(h,m)=>{const w=t.pallets.find(v=>v.name===h).constants.find(v=>v.name===m);return o(w.type)},f=h=>(m,w)=>{const v=t.pallets.find(b=>b.name===m),g=e(v[h]);if(g.type!=="enum")throw null;const x=g.value[w];return{location:[v.index,x.idx],codec:c(g.value[w])}},u=(h,m)=>{var v;const w=(v=t.apis.find(g=>g.name===h))==null?void 0:v.methods.find(g=>g.name===m);if(!w)throw null;return{args:St(...w.inputs.map(g=>o(g.type))),value:o(w.output)}};return{buildDefinition:o,buildStorage:l,buildEvent:f("events"),buildError:f("errors"),buildRuntimeCall:u,buildCall:f("calls"),buildConstant:d,ss58Prefix:s}},AN=(e,t)=>{const n=Qe(t);return pe(r=>n.enc(e.enc(r)),r=>e.dec(n.dec(r)))},TN=kt(Kt.enc(15)),MN=St(Te,Qe()),ON=ut(Qe()),NN=le(Kt).dec,LN=(e,t)=>{const n=r=>{const o=(l,c,d)=>e(l,c,d).pipe(Fl(f=>{if(f instanceof th)return t.pipe(bn(1),eh(u=>o(u,c,d)));throw f})),i=o(r,"Metadata_metadata_versions","").pipe(X(NN)),s=o(r,"Metadata_metadata","").pipe(X(l=>{const[,c]=MN.dec(l);return{metadata:jl.dec(c).metadata.value,metadataRaw:c}})),a=o(r,"Metadata_metadata_at_version",TN).pipe(X(l=>{const c=ON.dec(l);return{metadata:jl.dec(c).metadata.value,metadataRaw:c}}));return i.pipe(Fl(()=>nt([14])),Se(l=>l.includes(15)?a:s))};return r=>{const o=new Set([r]),i=n(r).pipe(X(({metadata:a,metadataRaw:l})=>{const c=CN(a),d=$2(c),f=d.buildStorage("System","Events"),u=a.extrinsic.signedExtensions.find(h=>h.identifier==="ChargeAssetTxPayment");let p=null;if(u){const h=c(u.type);if(h.type==="struct"){const m=h.value.asset_id;m.type==="option"&&(p=m.value.id)}}return{assetId:p,metadataRaw:l,lookup:c,dynamicBuilder:d,events:{key:f.enc(),dec:f.dec},accountId:Rs(d.ss58Prefix)}}),aN(1)),s={at:r,runtime:i,addBlock:a=>(o.add(a),s),deleteBlocks:a=>(a.forEach(l=>{o.delete(l)}),o.size),usages:o};return i.subscribe(),s}},Vi=Vs({connector:()=>new Ac(1),resetOnError:!0,resetOnComplete:!0,resetOnRefCountZero:!0}),D2=(e,t)=>{var n;(n=e.get(e.get(t).parent))==null||n.children.delete(t),e.delete(t)},jN=(e,t)=>{const n=[...t];let r=e.blocks.get(e.blocks.get(e.finalized).parent);const o=[];for(;r;)o.push(r.hash),r.refCount===0&&!r.unpinned&&(n.push(r.hash),r.unpinned=!0),r=e.blocks.get(r.parent);const i=[...t];for(let s=o.length-1;s>=0;s--){if(r=e.blocks.get(o[s]),!r.unpinned)return n;i.push(r.hash)}return i.forEach(s=>{D2(e.blocks,s)}),Object.entries(e.runtimes).map(([s,a])=>({key:s,usages:a.deleteBlocks(i)})).filter(s=>s.usages===0).map(s=>s.key).forEach(s=>{delete e.runtimes[s]}),n},$N=(e,t,n,r,o)=>{const i=T2(r,e.pipe(DN(t),L2())).pipe(O2((a,l)=>{switch(l.type){case"initialized":a.recovering&&(l.finalizedBlockHashes.some(p=>a.blocks.has(p))||(a=Dv()));const[c]=l.finalizedBlockHashes.slice(-1);a.finalized=a.best=c;const d=l.finalizedBlockHashes.length-1;l.finalizedBlockHashes.forEach((u,p)=>{a.blocks.has(u)?a.blocks.get(u).recovering=!1:a.blocks.set(u,{hash:u,parent:p===0?l.parentHash:l.finalizedBlockHashes[p-1],children:new Set(p===d?[]:[l.finalizedBlockHashes[p+1]]),runtime:u,refCount:0,number:l.number+p,recovering:!1})});const f=Object.values(a.runtimes).find(u=>u.usages.has(c));return a.finalizedRuntime=f??(a.runtimes[c]=s(c)),a;case"stop-error":for(const u of a.blocks.values())u.recovering=!0;return a.recovering=!0,a;case"newBlock":{const{parentBlockHash:u,blockHash:p}=l;if(a.blocks.has(p))a.blocks.get(p).recovering=!1;else{const h=a.blocks.get(u);h.children.add(p),l.newRuntime&&(a.runtimes[p]=s(p),a.runtimes[p].runtime.subscribe());const m={hash:p,number:h.number+1,parent:u,children:new Set,runtime:l.newRuntime?p:h.runtime,refCount:0,recovering:!1};a.blocks.set(p,m),a.runtimes[m.runtime].addBlock(p)}return a}case"bestBlockChanged":{if(a.recovering){for(const[u,p]of a.blocks)p.recovering&&D2(a.blocks,u);a.recovering=!1}return a.best=l.bestBlockHash,a}case"finalized":{a.finalized=l.finalizedBlockHashes.slice(-1)[0];const{blocks:u}=a;return u.get(a.best).number!!a.finalizedRuntime.runtime),X(a=>({...a})),Vi),s=LN(qa(i,n),i.pipe(X(a=>a.finalized)));return i},Dv=()=>({best:"",finalized:"",runtimes:{},blocks:new Map,finalizedRuntime:{},recovering:!1}),DN=e=>t=>t.pipe(M2(n=>n.type!=="initialized"?nt(n):e(n.finalizedBlockHashes[0]).then(r=>({...n,number:r.number,parentHash:r.parentHash})))),Bv=(e,t,n,r)=>{const o=a=>lN(e.pipe(yo(({blocks:l})=>!l.has(a)))),i=(a,l,c)=>{if(c)return nt({hash:a,found:{type:!1,validity:null}});const d=o(a);return t(a).pipe(Se(f=>{const u=f.indexOf(l);return u>-1?d(r(a)).pipe(X(p=>({hash:a,found:{type:!0,index:u,events:p}}))):n(a,l).pipe(X(p=>({hash:a,found:{type:!1,validity:p}})))}),d)},s=(a,l,c)=>i(a,l,c.has(a)).pipe(Se(d=>{var u;const{found:f}=d;return f.type||((u=f.validity)==null?void 0:u.success)===!1?nt(d):e.pipe(o(a),Se(p=>p.blocks.get(a).children),iN(),Se(p=>s(p,l,c)))}));return a=>e.pipe(bn(1),Se(l=>s(l.finalized,a,new Set(l.blocks.keys()))))},BN=new Uint8Array([2]),zN=(e,t)=>kt(Ft(BN,Sn(e),Sn(t))),zv="TaggedTransactionQueue",Fv="validate_transaction",FN=(e,t)=>(n,r)=>{const o=t(n).pipe(X(i=>i.dynamicBuilder.buildRuntimeCall(zv,Fv).value[1]));return e(n,`${zv}_${Fv}`,zN(r,n)).pipe(uN(o),X(([i,s])=>s(i)))},UN=e=>t=>new ie(n=>{let r=!1;const o=t.subscribe({next(i){r=!0,n.next(i)},error(i){n.error(i)},complete(){n.complete()}});return r||n.next(e),o}),WN=(e,t=1/0)=>n=>new ie(r=>{let o;const i=new Map,s=new Map,a=new Map;let l=0,c=0,d=0;const f=()=>{const u=i.get(c);if(!u){s.size===0&&(typeof o>"u"||o.closed)&&r.complete();return}const p=c++;i.delete(p),d!==p&&a.set(p,[]),s.set(p,u.subscribe({next(h){d===p?r.next(h):a.get(p).push(h)},complete(){if(s.delete(p),p===d)for(d++;a.has(d)&&(a.get(d).forEach(h=>r.next(h)),a.delete(d),!s.has(d));)d++;f()},error(h){r.error(h)}}))};return o=n.subscribe({next(u){const p=l++;i.set(p,Jp(()=>e(u,p))),s.size{s.forEach(u=>u.unsubscribe()),o.unsubscribe(),i.clear(),a.clear()}}),Tu=({hash:e,number:t,parent:n})=>({hash:e,number:t,parent:n}),VN=e=>{const{getFollower:t,unfollow:n,follow$:r}=wN(e),o=vN(t),{withRecovery:i,withRecoveryFn:s}=hN(),a=new Ic,l=T=>(V,...U)=>new ie(q=>{a.next({type:"blockUsage",value:{type:"hold",hash:V}});const ve=T(V,...U).subscribe(q);return()=>{setTimeout(()=>{a.next({type:"blockUsage",value:{type:"release",hash:V}})},0),ve.unsubscribe()}}),c=T=>(V,...U)=>new ie(q=>{let ve=!1;return w.pipe(bn(1)).subscribe(ce=>{const fe=ce.blocks.get(V);ve=!!fe&&!fe.unpinned}),ve?T(V,...U).subscribe(q):q.error(new th)}),d=T=>t().header(T).then(Gb.dec),f=T=>t().unpin(T).catch(V=>{if(!(V instanceof Xa))throw V}),u=T=>c(l((U=>xN(w,r,U))(qa(w,Au(s(jv(T))))))),p=(T,V=!0)=>(U,...q)=>T(U,V,...q),h=Au(s(jv(o("call")))),m=new Map,w=$N(r,d,l(h),a,T=>{f(T),T.forEach(V=>{m.delete(V)})}),v=l(T=>w.pipe(bn(1),Se(V=>V.runtimes[V.blocks.get(T).runtime].runtime))),g=T=>V=>V.pipe(WN(U=>v(T(U)).pipe(X(q=>[U,q])))),x=(T,V,U)=>{const q=m.get(T)??new Map,ve=q.get(V);if(ve)return ve;m.set(T,q);const ce=new Ac,fe=U.pipe(Vs({connector:()=>ce}),cN({complete(){q.set(V,ce)}}));return q.set(V,fe),fe},b=w.pipe(Jt((T,V)=>T.finalized===V.finalized),X(T=>Tu(T.blocks.get(T.finalized))),Vi),S=w.pipe(Jt((T,V)=>T.best===V.best),X(T=>Tu(T.blocks.get(T.best))),Vi),C=w.pipe(Jt((T,V)=>T.finalized===V.finalized&&T.best===V.best),O2((T,V)=>{const U=je=>T.get(je)||Tu(V.blocks.get(je)),q=U(V.best),ve=U(V.finalized),ce=q.number-ve.number+1,fe=new Array(ce);for(let je=0,jt=q.hash;je[je.hash,je]))},new Map),X(T=>[...T.values()]),Vi),k=w.pipe(Jt((T,V)=>T.finalizedRuntime===V.finalizedRuntime),eh(({finalizedRuntime:{runtime:T}})=>T.pipe(UN(null))),Vi),_=k.pipe(X(T=>(T==null?void 0:T.lookup.metadata)??null)),A=mN(b.pipe(X(T=>T.hash)),S.pipe(X(T=>T.hash))),I=u(o("body")),O=T=>x(T,"body",I(T,!0)),D=u(o("storage")),Y=A((T,V,U,q,ve=null,ce)=>w.pipe(bn(1),Se(fe=>fe.runtimes[fe.blocks.get(T).runtime].runtime),Se(fe=>{const je=q(fe),jt=x(T,`storage-${U}-${je}-${ve??""}`,D(T,V,U,je,ve));return ce?x(T,`storage-${U}-${je}-${ve??""}-dec`,jt.pipe(X(Cn=>ce(Cn,fe)))):jt}))),Q=kN(t,i),H=Au(A(l(qa(w,(T,V,U)=>Q(T,V,U??null,!1))))),F=A(l(qa(w,T=>Jp(()=>d(T)))));T2(k,C).subscribe();const G=(T,V=!1)=>Y(T,V,"value",U=>U.events.key,null,(U,q)=>q.events.dec(U)),R=u(o("call")),P=A((T,V,U,q)=>x(T,`call-${U}-${q}`,R(T,V,U,q))),B=FN(p(P,!1),v),L=T=>x(T,"body",I(T,!1)),W=Bv(w,L,B,G),ne=Bv(w,L,B,()=>nt());return{follow$:r,finalized$:b,best$:S,bestBlocks$:C,runtime$:k,metadata$:_,header$:F,body$:O,call$:p(P),storage$:p(Y),storageQueries$:H,eventsAt$:p(G),trackTx$:W,trackTxWithoutEvents$:ne,validateTx$:B,pinnedBlocks$:w,withRuntime:g,getRuntimeContext$:A(v),unfollow:n}};var HN=e=>t=>new ie(n=>e(t,r=>{n.error(r)}));const GN=({chainHead:e,transaction:t,destroy:n})=>({chainHead$:()=>VN(e),broadcastTx$:HN(t),destroy:n});class B2{constructor(){}_phantom(t){}}const Ul=new WeakMap,z2=e=>Ul.get(e);var Hi=(e=>(e.Storage="storage",e.Tx="tx",e.Event="events",e.Error="errors",e.Const="constants",e))(Hi||{});const KN=le(V4),YN=le(Up),XN=St(KN,YN),QN=(e,t)=>{const n=new Promise(async o=>{const i=t.runtime$.pipe(yo(a=>a!=null));let s=await vn(i);i.subscribe(a=>s=a),o(()=>s)});return Promise.all([e.metadataTypes.then(XN.dec),e.descriptors,n]).then(([[o,i],s,a])=>{const l=new B2;return Ul.set(l,{runtime:a,getPalletEntryPoint(c,d,f){return o[s[c][d][f]]},getApiEntryPoint(c,d){return o[s.apis[c][d]]},typedefNodes:i}),l})},Mu=new WeakMap,Uv=e=>(Mu.has(e.metadataRaw)||Mu.set(e.metadataRaw,{compat:new Map,lookup:e.lookup,typeNodes:[]}),Mu.get(e.metadataRaw)),Oi=(e,t,n)=>{const r=(u,p)=>{var h;const m=Uv(u);return(h=m.typeNodes)[p]||(h[p]=Ps(m.lookup(p)))};function o(u,p){const h=Ul.get(u);p||(p=h.runtime());const m=t(h),w=n(p),v=h.typedefNodes,g=Uv(p);return X4(m,x=>v[x],w,x=>r(p,x),g.compat)}const i=Wv(e,u=>F2(o(u))),s=Wv(e,(u,p)=>i(p)>=u),a=()=>e;return{isCompatible:s,getCompatibilityLevel:i,getCompatibilityLevels:o,waitDescriptors:a,withCompatibleRuntime:(u,p)=>h=>nf([h.pipe(u.withRuntime(p)),a()]).pipe(X(([[m,w],v])=>[m,v,w])),compatibleRuntime$:(u,p)=>nf([a(),u.getRuntimeContext$(p)]),argsAreCompatible:(u,p,h)=>{const m=o(u,p);if(m.args===Vr.Incompatible)return!1;if(m.args>Vr.Partial)return!0;if(m.values===Vr.Incompatible)return!1;const w=n(p);return _v(w.args,v=>r(p,v),h)},valuesAreCompatible:(u,p,h)=>{const m=o(u,p).values;if(m===Vr.Incompatible)return!1;if(m>Vr.Partial)return!0;const w=Ul.get(u),v=t(w);return _v(v.values,g=>w.typedefNodes[g],h)},getRuntimeTypedef:r}},F2=e=>Math.min(e.args,e.values),Wv=(e,t)=>(...n)=>n.at(-1)instanceof B2?t(...n):e.then(o=>t(...n,o)),qN=(e,t,{valuesAreCompatible:n,waitDescriptors:r,isCompatible:o,getCompatibilityLevel:i})=>{const s=new WeakMap,a=c=>{if(s.has(c))return s.get(c);const d=c.lookup.metadata.pallets.find(p=>p.name===e),f=d==null?void 0:d.constants.find(p=>p.name===t),u=c.dynamicBuilder.buildConstant(e,t).dec(f.value);return s.set(c,u),u},l=c=>{if(c){const d=z2(c).runtime(),f=a(d);if(!n(c,d,f))throw new Error(`Incompatible runtime entry Constant(${e}.${t})`);return f}return r().then(l)};return Object.assign(l,{isCompatible:o,getCompatibilityLevel:i})},ZN=Vs({connector:()=>new Ac(1),resetOnError:!0,resetOnComplete:!0,resetOnRefCountZero:!0}),JN=(e,t=1/0)=>n=>new ie(r=>{let o;const i=new Map,s=new Map,a=new Map;let l=0,c=0,d=0;const f=()=>{const u=i.get(c);if(!u){s.size===0&&(typeof o>"u"||o.closed)&&r.complete();return}const p=c++;i.delete(p),d!==p&&a.set(p,[]),s.set(p,u.subscribe({next(h){d===p?r.next(h):a.get(p).push(h)},complete(){if(s.delete(p),p===d)for(d++;a.has(d)&&(a.get(d).forEach(h=>r.next(h)),a.delete(d),!s.has(d));)d++;f()},error(h){r.error(h)}}))};return o=n.subscribe({next(u){const p=l++;i.set(p,Jp(()=>e(u,p))),s.size{s.forEach(u=>u.unsubscribe()),o.unsubscribe(),i.clear(),a.clear()}}),e5=(e,t,n,{isCompatible:r,getCompatibilityLevel:o,withCompatibleRuntime:i,argsAreCompatible:s,valuesAreCompatible:a})=>{const l=()=>new Error(`Incompatible runtime entry Event(${e}.${t})`),c=n.finalized$.pipe(i(n,p=>p.hash),X(([p,h,m])=>{if(!s(h,m,null))throw l();return[p,h,m]}),JN(([p,h,m])=>n.eventsAt$(p.hash).pipe(X(w=>w.filter(g=>g.event.type===e&&g.event.value.type===t).map(g=>{if(!a(h,m,g.event.value.value))throw l();return{meta:{phase:g.phase,block:p},payload:g.event.value.value}})))),ZN);return{watch:p=>c.pipe(Se(h=>p?h.filter(m=>p(m.payload)):h)),pull:()=>vn(c),filter:p=>p.filter(h=>h.type===e&&h.value.type===t).map(h=>h.value.value),getCompatibilityLevel:o,isCompatible:r}};function rf(e,t){return new Promise((n,r)=>{let o=null,i=!1;const s=t?()=>{o==null||o.unsubscribe(),r(new Pb)}:Ar;o=e.subscribe({next:a=>{n(a),o==null||o.unsubscribe(),i=!0},error:a=>{t==null||t.removeEventListener("abort",s),r(a)},complete:()=>{t==null||t.removeEventListener("abort",s),r(new Error("Observable completed without emitting"))}}),i||t==null||t.addEventListener("abort",s)})}const of=e=>typeof e=="object"&&e!==null&&Object.entries(e).every(([t,n])=>t==="at"&&(n===void 0||typeof n=="string")||t==="signal"&&(n===void 0||n instanceof AbortSignal)),t5=(e,t,n,{isCompatible:r,getCompatibilityLevel:o,compatibleRuntime$:i,argsAreCompatible:s,valuesAreCompatible:a})=>{const l=`${e}_${t}`,c=()=>new Error(`Incompatible runtime entry RuntimeCall(${l})`);return Object.assign((...f)=>{const u=f[f.length-1],p=of(u),{signal:h,at:m}=p?u:{},w=m??null,v=i(n,w).pipe(Se(([g,x])=>{if(!s(g,x,f))throw c();const b=x.dynamicBuilder.buildRuntimeCall(e,t);return n.call$(w,l,kt(b.args.enc(f))).pipe(X(b.value.dec),X(S=>{if(!a(g,x,S))throw c();return S}))}));return rf(v,h)},{getCompatibilityLevel:o,isCompatible:r})},n5=(e,t)=>n=>new ie(r=>{let o=new Array,i=!1;const s=l=>{const c=new vo;o.push(c),o.length>t&&(o[0].unsubscribe(),o=o.slice(1));const d=e(l).subscribe({next(f){const u=o.indexOf(c);o.slice(0,u).forEach(p=>p.unsubscribe()),o=o.slice(u),r.next(f)},error(f){r.error(f)},complete(){const f=o.indexOf(c);o.splice(f,1),o.length===0&&i&&r.complete()}});c.add(d)},a=n.subscribe({next(l){s(l)},error(l){r.error(l)},complete(){o.length===0&&r.complete(),i=!0}});return()=>{a.unsubscribe(),o.forEach(l=>l.unsubscribe())}}),r5=(e,t,n,{isCompatible:r,getCompatibilityLevel:o,getCompatibilityLevels:i,waitDescriptors:s,withCompatibleRuntime:a,argsAreCompatible:l,valuesAreCompatible:c})=>{const d=e==="System"&&t==="Number",f=()=>new Error(`Incompatible runtime entry Storage(${e}.${t})`),u=v=>new Error(`Invalid Arguments calling ${e}.${t}(${v})`),p=(...v)=>{const g=v[v.length-1],x=g==="best"||g==="finalized"?v.slice(0,-1):v;return d?n.bestBlocks$.pipe(X(b=>b.at(g==="best"?0:-1).number),Jt()):n[g==="best"?"best$":"finalized$"].pipe(oN(0),a(n,b=>b.hash),n5(([b,S,C])=>{if(!l(S,C,x))throw f();const k=C.dynamicBuilder.buildStorage(e,t);return n.storage$(b.hash,"value",()=>k.enc(...x)).pipe(X(_=>{if(!c(S,C,_))throw f();return{val:_,codecs:k}}))},4),Jt((b,S)=>b.val===S.val),X(({val:b,codecs:S})=>b===null?S.fallback:S.dec(b)))},h=async(...v)=>{const g=v[v.length-1],x=of(g),{signal:b,at:S}=x?g:{},C=S??null;let k;if(d)k=n.bestBlocks$.pipe(X(_=>C==="finalized"||!C?_.at(-1):C==="best"?_.at(0):_.find(A=>A.hash===C)),X(_=>{if(!_)throw new N2;return _.number}),Jt());else{const _=await s();k=n.storage$(C,"value",A=>{const I=A.dynamicBuilder.buildStorage(e,t),O=v.length===I.len?v:v.slice(0,-1);if(v!==O&&!x)throw u(v);if(!l(_,A,O))throw f();return I.enc(...O)},null,(A,I)=>{const O=I.dynamicBuilder.buildStorage(e,t),D=A===null?O.fallback:O.dec(A);if(!c(_,I,D))throw f();return D})}return rf(k,b)};return{isCompatible:r,getCompatibilityLevel:o,getValue:h,getValues:(v,g)=>Promise.all(v.map(x=>h(...g?[...x,g]:x))),getEntries:async(...v)=>{const g=v[v.length-1],x=of(g),{signal:b,at:S}=x?g:{},C=S??null,k=await s(),_=n.storage$(C,"descendantsValues",A=>{if(F2(i(k,A))===Vr.Incompatible)throw f();const I=A.dynamicBuilder.buildStorage(e,t);if(v.length>I.len)throw u(v);const O=v.length>0&&x?v.slice(0,-1):v;if(v.length===I.len&&O===v)throw u(v);return I.enc(...O)},null,(A,I)=>{const O=I.dynamicBuilder.buildStorage(e,t);if(A.some(({value:D})=>!c(k,I,D)))throw f();return A.map(({key:D,value:Y})=>({keyArgs:O.keyDecoder(D),value:O.dec(Y)}))});return rf(_,b)},watchValue:p}},o5=zs(Ne.enc,e=>+!!e.signed<<7|e.version),i5={Ed25519:0,Sr25519:1,Ecdsa:2},[_a,Ni]=["",""].map(e=>mo.fromText(e).asBytes());function s5(e,t,n){return{publicKey:e,signTx:async(i,s,a,l,c=$p)=>{let d;try{const v=jl.dec(a);if(v.metadata.tag!=="v15")throw null;d=v.metadata.value}catch{throw new Error("Unsupported metadata version")}const{version:f}=d.extrinsic,u=[],p=[];d.extrinsic.signedExtensions.map(({identifier:v})=>{const g=s[v];if(!g)throw new Error(`Missing ${v} signed extension`);u.push(g.value),p.push(g.additionalSigned)});const h=Ft(i,...u,...p),m=await n(h.length>256?c(h):h),w=Ft(o5({signed:!0,version:f}),new Uint8Array([0,...e]),new Uint8Array([i5[t],...m]),...u,i);return Ft(Te.enc(w.length),w)},signBytes:async i=>{let s=!0,a;for(a=0;s&&a<_a.length;a++)s=_a[a]===i[a];s=s&&a===_a.length;const l=i.length-Ni.length;for(a=0;s&&ae.chainHead.storage$(e.at,"value",()=>a5,null).pipe(X(t=>Sn(t))),W2=(e,t)=>{const n=$2(t),r=t.metadata.pallets.find(a=>a.name==="System").constants.find(a=>a.name==="Version"),o=t(r.type),i=n.buildDefinition(r.type).dec;if(o.type!=="struct")throw new Error("not a struct");const s=n.buildDefinition(o.value[e].id).enc;return nt(s(i(r.value)[e]))},l5=e=>nt({value:Nb.enc(e),additionalSigned:Tr});function c5(e){let t=0;for(;!(e&1);)t++,e>>=1;return t}const u5=zs(Qe(2).enc,e=>{const t=Math.max(e.period>>12,1),n=Math.min(Math.max(c5(e.period)-1,1),15),r=e.phase/t<<4;return ao.enc(n|r)}),d5=new Uint8Array([0]),f5=(e,t)=>{if(!e)return U2(t).pipe(X(o=>({additionalSigned:o,value:d5})));const{period:n,blockNumber:r}=e;return nt({additionalSigned:Sn(t.at),value:u5({period:n,phase:r%n})})},p5=re({tip:Te,asset:ut(Qe(1/0))}).enc,h5=(e,t)=>nt({value:p5({tip:e,asset:t}),additionalSigned:Tr}),m5=e=>U2(e).pipe(X(t=>({value:Tr,additionalSigned:t}))),v5=()=>nt({value:Uint8Array.from([0]),additionalSigned:Uint8Array.from([0])}),Vv="AccountNonceApi_account_nonce",g5={1:Ne.dec,2:ao.dec,4:Kt.dec,8:Fs.dec},nh=e=>nt({value:Te.enc(e),additionalSigned:Tr}),y5=e=>e.chainHead.call$(e.at,Vv,kt(e.from)).pipe(Se(t=>{const n=Sn(t),r=g5[n.length];if(!r)throw new Error(`${Vv} retrieved wrong data`);return nh(r(n))})),w5=({lookupFn:e})=>W2("spec_version",e).pipe(X(t=>({additionalSigned:t,value:Tr}))),x5=({lookupFn:e})=>W2("transaction_version",e).pipe(X(t=>({additionalSigned:t,value:Tr}))),b5=Object.freeze(Object.defineProperty({__proto__:null,CheckGenesis:m5,CheckMetadataHash:v5,CheckNonce:y5,CheckSpecVersion:w5,CheckTxVersion:x5,getNonce:nh},Symbol.toStringTag,{value:"Module"})),E5=(e,t,n,r,o={})=>e.getRuntimeContext$(r.hash).pipe(bn(1),Se(i=>{const s={lookupFn:i.lookup,chainHead:e,callData:n,at:r.hash,from:t.publicKey},a=o.mortality?o.mortality.mortal?{period:o.mortality.period,blockNumber:r.number}:void 0:{period:64,blockNumber:r.number};return nf(i.lookup.metadata.extrinsic.signedExtensions.map(({identifier:l,type:c,additionalSigned:d})=>{if(l==="CheckMortality")return f5(a,s);if(l==="ChargeTransactionPayment")return l5(o.tip??0n);if(l==="ChargeAssetTxPayment")return h5(o.tip??0n,o.asset);if(l==="CheckNonce"&&"nonce"in o)return nh(o.nonce);const f=b5[l];if(!f){if(i.dynamicBuilder.buildDefinition(c)===se&&i.dynamicBuilder.buildDefinition(d)===se)return nt({value:Tr,additionalSigned:Tr});throw new Error(`Unsupported signed-extension: ${l}`)}return f(s)})).pipe(Se(l=>t.signTx(n,Object.fromEntries(i.lookup.metadata.extrinsic.signedExtensions.map(({identifier:c},d)=>[c,{identifier:c,...l[d]}])),i.metadataRaw,r.number)))}));let Hv={};const S5=e=>t=>new ie(n=>{let r=Hv,o=t.subscribe({next(i){n.next(r=i)},error(i){n.error(i)},complete(){r===Hv?n.complete():o=e(r).subscribe(n)}});return()=>{o.unsubscribe()}});var k5=Object.defineProperty,C5=(e,t,n)=>t in e?k5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_5=(e,t,n)=>C5(e,t+"",n);const R5=e=>kt($p(Sn(e))),P5=(e,t)=>new ie(n=>{const r=new Map;let o,i;const s=()=>{var p;let l=o.best,c=r.get(l),d=o.blocks.get(l).number;for(;!c;){const h=o.blocks.get(l);if(!h)break;c=r.get(l=h.parent),d--}if(!c)return;const f=d<=o.blocks.get(o.finalized).number,u=c.found.type;if(u&&(i!=null&&i.found)&&i.hash===c.hash){f&&n.complete();return}n.next(i=c.found.type?{found:u,hash:c.hash,number:d,index:c.found.index,events:c.found.events}:{found:u,validity:c.found.validity}),f&&(u?n.complete():((p=c.found.validity)==null?void 0:p.success)===!1&&n.error(new V2(c.found.validity.value)))},a=t.pipe(Jt((l,c)=>l.finalized===c.finalized&&l.best===c.best)).subscribe({next:l=>{o=l,r.size!==0&&s()},error(l){n.error(l)}});return a.add(e.subscribe({next:l=>{r.set(l.hash,l),s()},error(l){n.error(l)}})),a}).pipe(Jt((n,r)=>n===r)),I5=(e,t)=>{const n=e.filter(o=>o.phase.type==="ApplyExtrinsic"&&o.phase.value===t).map(o=>o.event),r=n[n.length-1];return r.type==="System"&&r.value.type==="ExtrinsicFailed"?{ok:!1,events:n,dispatchError:r.value.value.dispatch_error}:{ok:!0,events:n}};class V2 extends Error{constructor(t){super(JSON.stringify(t,(n,r)=>typeof r=="bigint"?r.toString():r instanceof mo?r.asHex():r,2)),_5(this,"error"),this.name="InvalidTxError",this.error=t}}const rh=(e,t,n,r,o=!1)=>{const i=R5(n),s=(f,u)=>({type:f,txHash:i,...u}),l=e.pinnedBlocks$.pipe(bn(1),X(f=>{var u;return((u=f.blocks.get(r))==null?void 0:u.hash)??f.finalized})).pipe(Se(f=>e.validateTx$(f,n).pipe(yo(u=>!u.success),X(u=>{throw new V2(u.value)})))),c=new ie(f=>{const u=e.trackTx$(n).subscribe(f);return u.add(t(n).subscribe({error(p){f.error(p)}})),u}),d=P5(c,e.pinnedBlocks$).pipe(X(f=>{var u;return f.found?s("txBestBlocksState",{found:!0,block:{index:f.index,number:f.number,hash:f.hash},...I5(f.events,f.index)}):s("txBestBlocksState",{found:!1,isValid:((u=f.validity)==null?void 0:u.success)!==!1})}));return tN(o?nt(s("signed",{})):zl,l,nt(s("broadcasted",{})),d.pipe(S5(({found:f,type:u,...p})=>f?nt(s("finalized",p)):zl)))},H2=async(e,t,n,r)=>zO(rh(e,t,n,r)).then(o=>{if(o.type!=="finalized")throw null;const i={...o};return delete i.type,i}),A5=Rs().enc,T5=St(Te,Te,Ne,Jx).dec,M5=e=>T5(e)[3],O5=new Uint8Array(64),N5=()=>O5,L5=(e,t,n,r,{isCompatible:o,getCompatibilityLevel:i,compatibleRuntime$:s,argsAreCompatible:a,getRuntimeTypedef:l})=>Object.assign(d=>{const f=(b,S,C={})=>{const k=z2(b).runtime();if(!a(b,k,S))throw new Error(`Incompatible runtime entry Tx(${e}.${t})`);const{dynamicBuilder:_,assetId:A,lookup:I}=k;let O=C;if(C.asset){if(A==null||!Wp(C.asset,Ps(I(A)),Q=>l(k,Q)))throw new Error("Incompatible runtime asset");O={...C,asset:_.buildDefinition(A).enc(C.asset)}}const{location:D,codec:Y}=_.buildCall(e,t);return{callData:mo.fromBytes(Ft(new Uint8Array(D),Y.enc(S))),options:O}},u=(b,S={})=>s(n,null).pipe(X(([C])=>f(C,b,S))),p=b=>b?f(b,d).callData:vn(u(d).pipe(X(S=>S.callData))),h=(b,{...S},C)=>u(d,S).pipe(Se(({callData:k,options:_})=>E5(n,b,k.asBytes(),C,_))),m=(b,{at:S,...C}={})=>(!S||S==="finalized"?n.finalized$:S==="best"?n.best$:n.bestBlocks$.pipe(X(k=>k.find(_=>_.hash===S)))).pipe(bn(1),Se(k=>k?h(b,C,k).pipe(X(_=>({tx:kt(_),block:k}))):qp(()=>new Error(`Uknown block ${S}`)))),w=(b,S)=>vn(m(b,S)).then(C=>C.tx),v=(b,S)=>vn(m(b,S)).then(({tx:C,block:k})=>H2(n,r,C,k.hash)),g=(b,S)=>m(b,S).pipe(Se(({tx:C,block:k})=>rh(n,r,C,k.hash,!0)));return{getEstimatedFees:async(b,S)=>{const C=s5(b instanceof Uint8Array?b:A5(b),"Sr25519",N5),k=Sn(await w(C,S)),_=kt(Ft(k,Kt.enc(k.length)));return vn(n.call$(null,"TransactionPaymentApi_query_info",_).pipe(X(M5)))},decodedCall:{type:e,value:_c(t,d)},getEncodedData:p,sign:w,signSubmitAndWatch:g,signAndSubmit:v}},{getCompatibilityLevel:i,isCompatible:o}),j5=(e,t,n)=>{const r={},o=p=>new Proxy(r,{get(h,m){return p(m)}}),i=p=>{const h={};return o(m=>(h[m]||(h[m]={}),o(w=>(h[m][w]||(h[m][w]=p(m,w)),h[m][w]))))},s=(p,h)=>p.lookup.metadata.pallets.find(m=>m.name===h),a=i((p,h)=>r5(p,h,t,Oi(e,m=>m.getPalletEntryPoint(Hi.Storage,p,h),m=>H4(s(m,p).storage.items.find(w=>w.name===h))))),l=(p,h,m,w)=>{const v=p.lookup(m);if(v.type!=="enum")throw new Error("Expected enum");const g=K4(v.value[w]);return{args:h==="args"?g:$l,values:h==="args"?$l:g}},c=i((p,h)=>L5(p,h,t,n,Oi(e,m=>m.getPalletEntryPoint(Hi.Tx,p,h),m=>l(m,"args",s(m,p).calls,h)))),d=i((p,h)=>e5(p,h,t,Oi(e,m=>m.getPalletEntryPoint(Hi.Event,p,h),m=>l(m,"values",s(m,p).events,h)))),f=i((p,h)=>qN(p,h,Oi(e,m=>m.getPalletEntryPoint(Hi.Const,p,h),m=>Y4(s(m,p).constants.find(w=>w.name===h).type)))),u=i((p,h)=>t5(p,h,t,Oi(e,m=>m.getApiEntryPoint(p,h),m=>G4(m.lookup.metadata.apis.find(w=>w.name===p).methods.find(w=>w.name===h)))));return{query:a,tx:c,event:d,apis:u,constants:f,compatibilityToken:e}};function G2(e){const t=uO(e),n=GN(t),r=n.chainHead$(),{getChainSpecData:o}=t,i=t.request,s=new WeakMap,a=c=>{const d=s.get(c)||QN(c,r);return s.set(c,d),d},{broadcastTx$:l}=n;return{getChainSpecData:o,finalizedBlock$:r.finalized$,getFinalizedBlock:()=>vn(r.finalized$),bestBlocks$:r.bestBlocks$,getBestBlocks:()=>vn(r.bestBlocks$),watchBlockBody:r.body$,getBlockBody:c=>vn(r.body$(c)),getBlockHeader:c=>vn(r.header$(c??null)),submit:(...c)=>H2(r,l,...c),submitAndWatch:(...c)=>rh(r,l,...c),getTypedApi:c=>j5(a(c),r,l),destroy:()=>{r.unfollow(),n.destroy()},_request:i}}var rs=(e=>(e[e.subscribe=0]="subscribe",e[e.unsubscribe=1]="unsubscribe",e[e.end=2]="end",e))(rs||{});const K2=e=>JSON.stringify({jsonrpc:"2.0",...e}),[$5,D5,B5]=["follow","unfollow","followEvent"].map(e=>new Set(["v1","unstable"].map(t=>`chainHead_${t}_${e}`))),Gv="stop",z5=e=>{let t="";return{onSent(n){return $5.has(n.method)?(t=n.method+"Event",{type:rs.subscribe,id:n.id,onRes:r=>r.id===n.id?{id:r.result}:null}):D5.has(n.method)?{type:rs.unsubscribe,id:Object.values(n.params)[0]}:null},onNotification(n){return B5.has(n.method)&&n.params.result.event===Gv?{type:rs.end,id:n.params.subscription}:null},onAbort:n=>{e(K2({method:t,params:{subscription:n,result:{event:Gv}}}))}}},F5=({onSent:e,onNotification:t,onAbort:n})=>{const r=new Map,o=new Set,i=()=>{r.clear(),o.clear()};return{onSent(s){const a=e(s);a&&(a.type===rs.subscribe?r.set(a.id,a.onRes):o.delete(a.id))},onResponse(s){var l;const a=(l=r.get(s.id))==null?void 0:l(s);a&&(r.delete(s.id),o.add(a.id))},onNotifiaction(s){const a=t(s);a&&o.delete(a.id)},onDisconnect:i,onAbort(){const s=[...o];i(),s.forEach(n)}}},U5=e=>F5(z5(e)),W5=e=>t=>{let n,r=[];const o=new Set,i=U5(t),s=f=>{let u;try{u=JSON.parse(f)}catch{console.error(`Unable to parse incoming message: ${f}`);return}u.id!==void 0?(o.delete(u.id),i.onResponse(u)):i.onNotifiaction(u),t(f)},a=f=>{if(!n)return;const u=JSON.parse(f);i.onSent(u),u.id&&o.add(u.id),n instanceof Promise?r.push(f):n.send(f)},l=()=>{r=[];const f=[...o];if(o.clear(),!n)throw null;const u=c();return i.onAbort(),f.forEach(p=>{t(K2({error:{code:-32603,message:"Internal error"},id:p}))}),u},c=()=>{const f=u=>{let p=!0;const w=u(v=>{p&&s(v)},()=>{p&&(p=!1,l())});return r.forEach(v=>{w.send(v)}),r=[],n=w};return n=e().then(f,V5(l)),n},d=()=>{if(!n)return;const f=u=>{i.onDisconnect(),o.clear(),n=null,u==null||u.disconnect()};n instanceof Promise?(n.then(f,f),n=null):f(n)};return c(),{send:a,disconnect:d}},V5=e=>(...t)=>new Promise(n=>setTimeout(n,0)).then(()=>e(...t));let Ra;const Y2=e=>W5(async()=>{for(;Ra;)await Ra;let t;return e instanceof Promise?(Ra=e,t=await e,Ra=null):t=e,(n,r)=>{let o=!0;return(async()=>{do{let i="";try{i=await t.nextJsonRpcResponse()}catch{o&&r();return}if(!o)break;n(i)}while(o)})(),{send(i){t.sendJsonRpc(i)},disconnect(){o=!1,t.remove()}}}});function H5(e){return new Worker("/assets/smoldot_worker-kK54kzUU.js",{name:e==null?void 0:e.name})}class Pa extends Error{constructor(t){super(t),this.name="AddChainError"}}class Ia extends Error{constructor(){super(),this.name="AlreadyDestroyedError"}}class Kv extends Error{constructor(){super(),this.name="JsonRpcDisabledError"}}class G5 extends Error{constructor(t){super(t)}}class K5 extends Error{constructor(){super("JSON-RPC requests queue is full")}}function $t(e,t,n){return yi(e,t,n),new TextDecoder().decode(e.slice(t,t+n))}function Y5(e,t){return yi(e,t,1),e[t]}function Ro(e,t){return yi(e,t,2),e[t]<<8|e[t+1]}function Aa(e,t){return yi(e,t,4),(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function X5(e,t,n){yi(e,t,1),e[t]=n&255}function Q5(e,t,n){yi(e,t,4),e[t+3]=n>>>24&255,e[t+2]=n>>>16&255,e[t+1]=n>>>8&255,e[t]=n&255}function yi(e,t,n){if(!Number.isInteger(t)||t<0)throw new RangeError;if(t+n>e.length)throw new RangeError}var Yv=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(f){s(f)}}function l(d){try{c(r.throw(d))}catch(f){s(f)}}function c(d){d.done?i(d.value):o(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};function q5(e,t,n){return Yv(this,void 0,void 0,function*(){const r={instance:null,currentTask:null,bufferIndices:new Array,advanceExecutionPromise:null,onShutdownExecutorOrWasmPanic:()=>{}},o={panic:(a,l)=>{const c=r.instance;r.instance=null,a>>>=0,l>>>=0;const d=$t(new Uint8Array(c.exports.memory.buffer),a,l);throw n({ty:"wasm-panic",message:d,currentTask:r.currentTask}),r.onShutdownExecutorOrWasmPanic(),r.onShutdownExecutorOrWasmPanic=()=>{},new Error},chain_initialized:(a,l,c)=>{const d=r.instance,f=new Uint8Array(d.exports.memory.buffer);if(l>>>=0,c>>>=0,l===0)n({ty:"add-chain-result",chainId:a,success:!0});else{const u=$t(f,l,c);n({ty:"add-chain-result",chainId:a,success:!1,error:u})}},random_get:(a,l)=>{const c=r.instance;a>>>=0,l>>>=0;const d=new Uint8Array(c.exports.memory.buffer).subarray(a,a+l);for(let f=0;f{const a=Math.floor(Date.now());if(a<0)throw new Error("UNIX timestamp inferior to 0");return BigInt(a)*BigInt(1e3)},monotonic_clock_us:()=>{const a=e.performanceNow(),l=Math.floor(a);return BigInt(l)*BigInt(1e3)+BigInt(Math.floor((a-l)*1e3))},buffer_size:a=>r.bufferIndices[a].byteLength,buffer_copy:(a,l)=>{const c=r.instance;l=l>>>0;const d=r.bufferIndices[a];new Uint8Array(c.exports.memory.buffer).set(d,l)},advance_execution_ready:()=>{r.advanceExecutionPromise&&r.advanceExecutionPromise(),r.advanceExecutionPromise=null},json_rpc_responses_non_empty:a=>{n({ty:"json-rpc-responses-non-empty",chainId:a})},log:(a,l,c,d,f)=>{const u=r.instance;l>>>=0,c>>>=0,d>>>=0,f>>>=0;const p=new Uint8Array(u.exports.memory.buffer);let h=$t(p,l,c),m=$t(p,d,f);n({ty:"log",level:a,message:m,target:h})},start_timer:a=>{const l=r.instance;a>2147483647&&(a=2147483647),a<1&&typeof setImmediate=="function"?setImmediate(()=>{if(r.instance)try{l.exports.timer_finished()}catch{}}):setTimeout(()=>{if(r.instance)try{l.exports.timer_finished()}catch{}},a)},connection_type_supported:a=>{switch(a){case 0:case 1:case 2:return e.forbidTcp?0:1;case 4:case 5:case 6:return e.forbidWs||e.forbidNonLocalWs?0:1;case 7:return e.forbidWs?0:1;case 14:return e.forbidWss?0:1;case 16:case 17:return e.forbidWebRtc?0:1;default:throw new Error("Invalid connection type passed to `connection_type_supported`")}},connection_new:(a,l,c)=>{const d=r.instance,f=new Uint8Array(d.exports.memory.buffer);l>>>=0,c>>>=0;let u;switch(Y5(f,l)){case 0:case 1:case 2:{const p=Ro(f,l+1),h=$t(f,l+3,c-3);u={ty:"tcp",port:p,hostname:h};break}case 4:case 6:{const p=Ro(f,l+1);u={ty:"websocket",url:"ws://"+$t(f,l+3,c-3)+":"+p};break}case 5:{const p=Ro(f,l+1);u={ty:"websocket",url:"ws://["+$t(f,l+3,c-3)+"]:"+p};break}case 14:{const p=Ro(f,l+1);u={ty:"websocket",url:"wss://"+$t(f,l+3,c-3)+":"+p};break}case 16:{const p=Ro(f,l+1),h=f.slice(l+3,l+35),m=$t(f,l+35,c-35);u={ty:"webrtc",ipVersion:"4",remoteTlsCertificateSha256:h,targetIp:m,targetPort:p};break}case 17:{const p=Ro(f,l+1),h=f.slice(l+3,l+35),m=$t(f,l+35,c-35);u={ty:"webrtc",ipVersion:"6",remoteTlsCertificateSha256:h,targetIp:m,targetPort:p};break}default:throw new Error("Invalid encoded address passed to `connection_new`")}n({ty:"new-connection",connectionId:a,address:u})},reset_connection:a=>{n({ty:"connection-reset",connectionId:a})},connection_stream_open:a=>{n({ty:"connection-stream-open",connectionId:a})},connection_stream_reset:(a,l)=>{n({ty:"connection-stream-reset",connectionId:a,streamId:l})},stream_send:(a,l,c,d)=>{const f=r.instance,u=new Uint8Array(f.exports.memory.buffer);c>>>=0,d>>>=0;const p=new Array;for(let h=0;h{n({ty:"stream-send-close",connectionId:a,streamId:l})},current_task_entered:(a,l)=>{a>>>=0,l>>>=0;const c=$t(new Uint8Array(r.instance.exports.memory.buffer),a,l);r.currentTask=c},current_task_exit:()=>{r.currentTask=null}},i=yield WebAssembly.instantiate(t,{smoldot:o});r.instance=i,r.instance.exports.init(e.maxLogLevel);const s=new Promise(a=>r.onShutdownExecutorOrWasmPanic=()=>a("stop"));return Yv(this,void 0,void 0,function*(){const a=e.cpuRateLimit;let l=0,c=e.performanceNow();for(;;){const d=new Promise(m=>r.advanceExecutionPromise=()=>m("ready"));if(!r.instance)break;r.instance.exports.advance_execution();const f=e.performanceNow(),u=f-c;c=f;const p=u*(1/a-1);if(l+=p,l>5){l>2147483646&&(l=2147483646);const m=new Promise(w=>setTimeout(()=>w("timeout"),l));if((yield Promise.race([m,s]))==="stop")break}if((yield Promise.race([d,s]))==="stop")break;const h=e.performanceNow();l-=h-c,l<-1e4&&(l=-1e4),c=h}r.instance&&n({ty:"executor-shutdown"})}),{request:(a,l)=>r.instance?(r.bufferIndices[0]=new TextEncoder().encode(a),r.instance.exports.json_rpc_send(0,l)>>>0):1,peekJsonRpcResponse:a=>{if(!r.instance)return null;const l=new Uint8Array(r.instance.exports.memory.buffer),c=r.instance.exports.json_rpc_responses_peek(a)>>>0,d=Aa(l,c)>>>0,f=Aa(l,c+4)>>>0;if(f!==0){const u=$t(l,d,f);return r.instance.exports.json_rpc_responses_pop(a),u}else return null},addChain:(a,l,c,d,f,u)=>{if(!r.instance){n({ty:"add-chain-id-allocated",chainId:0}),n({ty:"add-chain-result",chainId:0,success:!1,error:"Smoldot has crashed"});return}console.assert(d||f!=0,"invalid jsonRpcMaxPendingRequests value passed to local-instance::addChain"),r.bufferIndices[0]=new TextEncoder().encode(a),r.bufferIndices[1]=new TextEncoder().encode(l);const p=new Uint8Array(c.length*4);for(let m=0;m{r.instance&&r.instance.exports.remove_chain(a)},shutdownExecutor:()=>{if(!r.instance)return;const a=r.onShutdownExecutorOrWasmPanic;r.onShutdownExecutorOrWasmPanic=()=>{},a()},connectionMultiStreamSetHandshakeInfo:(a,l)=>{if(!r.instance)return;const c=new Uint8Array(1+l.localTlsCertificateSha256.length);X5(c,0,0),c.set(l.localTlsCertificateSha256,1),r.bufferIndices[0]=c,r.instance.exports.connection_multi_stream_set_handshake_info(a,0),delete r.bufferIndices[0]},connectionReset:(a,l)=>{r.instance&&(r.bufferIndices[0]=new TextEncoder().encode(l),r.instance.exports.connection_reset(a,0),delete r.bufferIndices[0])},streamWritableBytes:(a,l,c)=>{r.instance&&r.instance.exports.stream_writable_bytes(a,c||0,l)},streamMessage:(a,l,c)=>{r.instance&&(r.bufferIndices[0]=l,r.instance.exports.stream_message(a,c||0,0),delete r.bufferIndices[0])},streamOpened:(a,l,c)=>{r.instance&&r.instance.exports.connection_stream_opened(a,l,c==="outbound"?1:0)},streamReset:(a,l,c)=>{r.instance&&(r.bufferIndices[0]=new TextEncoder().encode(c),r.instance.exports.stream_reset(a,l,0),delete r.bufferIndices[0])}}})}var Xv=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(f){s(f)}}function l(d){try{c(r.throw(d))}catch(f){s(f)}}function c(d){d.done?i(d.value):o(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};function Z5(e){return Xv(this,void 0,void 0,function*(){const{port1:t,port2:n}=new MessageChannel,r=e.portToServer,o={wasmModule:yield e.wasmModule,serverToClient:n,maxLogLevel:e.maxLogLevel,cpuRateLimit:e.cpuRateLimit,forbidWs:e.forbidWs,forbidWss:e.forbidWss,forbidNonLocalWs:e.forbidNonLocalWs,forbidTcp:e.forbidTcp,forbidWebRtc:e.forbidWebRtc};r.postMessage(o,[n]);const i={jsonRpcResponses:new Map,connections:new Map};return t.onmessage=s=>{const a=s.data;switch(a.ty){case"wasm-panic":case"executor-shutdown":{t.close(),r.close();break}case"add-chain-result":{if(a.success){i.jsonRpcResponses.set(a.chainId,new Array);const l={ty:"accept-more-json-rpc-answers",chainId:a.chainId};for(let c=0;c<10;++c)t.postMessage(l)}break}case"new-connection":{i.connections.set(a.connectionId,new Set);break}case"connection-reset":{if(!i.connections.has(a.connectionId))return;i.connections.delete(a.connectionId);break}case"connection-stream-open":{if(!i.connections.has(a.connectionId))return;break}case"connection-stream-reset":{if(!i.connections.has(a.connectionId)||!i.connections.get(a.connectionId).has(a.streamId))return;break}case"stream-send":{if(!i.connections.has(a.connectionId)||a.streamId&&!i.connections.get(a.connectionId).has(a.streamId))return;break}case"stream-send-close":{if(!i.connections.has(a.connectionId)||a.streamId&&!i.connections.get(a.connectionId).has(a.streamId))return;break}case"json-rpc-response":{const l=i.jsonRpcResponses.get(a.chainId);l&&(l.push(a.response),e.eventCallback({ty:"json-rpc-responses-non-empty",chainId:a.chainId}));return}}e.eventCallback(a)},{addChain(s,a,l,c,d,f){return Xv(this,void 0,void 0,function*(){const u={ty:"add-chain",chainSpec:s,databaseContent:a,potentialRelayChains:l,disableJsonRpc:c,jsonRpcMaxPendingRequests:d,jsonRpcMaxSubscriptions:f};t.postMessage(u)})},removeChain(s){i.jsonRpcResponses.delete(s);const a={ty:"remove-chain",chainId:s};t.postMessage(a)},request(s,a){const l={ty:"request",chainId:a,request:s};return t.postMessage(l),0},peekJsonRpcResponse(s){const a=i.jsonRpcResponses.get(s).shift();if(!a)return null;const l={ty:"accept-more-json-rpc-answers",chainId:s};return t.postMessage(l),a},shutdownExecutor(){const s={ty:"shutdown"};t.postMessage(s)},connectionReset(s,a){i.connections.delete(s);const l={ty:"connection-reset",connectionId:s,message:a};t.postMessage(l)},connectionMultiStreamSetHandshakeInfo(s,a){const l={ty:"connection-multistream-set-info",connectionId:s,info:a};t.postMessage(l)},streamMessage(s,a,l){const c={ty:"stream-message",connectionId:s,message:a,streamId:l};t.postMessage(c)},streamOpened(s,a,l){i.connections.get(s).add(a);const c={ty:"stream-opened",connectionId:s,streamId:a,direction:l};t.postMessage(c)},streamWritableBytes(s,a,l){const c={ty:"stream-writable-bytes",connectionId:s,numExtra:a,streamId:l};t.postMessage(c)},streamReset(s,a,l){i.connections.get(s).delete(a);const c={ty:"stream-reset",connectionId:s,streamId:a,message:l};t.postMessage(c)}}})}var Ta=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(f){s(f)}}function l(d){try{c(r.throw(d))}catch(f){s(f)}}function c(d){d.done?i(d.value):o(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};function J5(e,t,n){const r=e.logCallback||((l,c,d)=>{l<=1?console.error("[%s] %s",c,d):l==2?console.warn("[%s] %s",c,d):l==3?console.info("[%s] %s",c,d):l==4?console.debug("[%s] %s",c,d):console.trace("[%s] %s",c,d)});t instanceof Promise||(t=Promise.resolve(t));let o=e.cpuRateLimit||1;isNaN(o)&&(o=1),o>1&&(o=1),o<0&&(o=0);const i={instance:{status:"not-created"},chainIds:new WeakMap,connections:new Map,addChainIdAllocations:[],addChainResults:new Map,onExecutorShutdownOrWasmPanic:()=>{},chains:new Map},s=l=>{switch(l.ty){case"wasm-panic":{console.error("Smoldot has panicked"+(l.currentTask?" while executing task `"+l.currentTask+"`":"")+`. This is a bug in smoldot. Please open an issue at https://github.com/smol-dot/smoldot/issues with the following message: + `):"",this.name="UnsubscriptionError",this.errors=n}});function Bl(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var vo=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=li(s),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(m){t={error:m}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else s.remove(this);var d=this.initialTeardown;if(Re(d))try{d()}catch(m){i=m instanceof Ru?m.errors:[m]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=li(f),p=u.next();!p.done;p=u.next()){var h=p.value;try{Iv(h)}catch(m){i=i??[],m instanceof Ru?i=Un(Un([],Ir(i)),Ir(m.errors)):i.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}if(i)throw new Ru(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Iv(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&Bl(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Bl(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),c2=vo.EMPTY;function u2(e){return e instanceof vo||e&&"closed"in e&&Re(e.remove)&&Re(e.add)&&Re(e.unsubscribe)}function Iv(e){Re(e)?e():e.unsubscribe()}var d2={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},f2={setTimeout:function(e,t){for(var n=[],r=2;r0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?c2:(this.currentObservers=null,a.push(n),new vo(function(){r.currentObservers=null,Bl(a,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,o=r.hasError,i=r.thrownError,s=r.isStopped;o?n.error(i):s&&n.complete()},t.prototype.asObservable=function(){var n=new ie;return n.source=this,n},t.create=function(n,r){return new Tv(n,r)},t}(ie),Tv=function(e){Yn(t,e);function t(n,r){var o=e.call(this)||this;return o.destination=n,o.source=r,o}return t.prototype.next=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.next)===null||o===void 0||o.call(r,n)},t.prototype.error=function(n){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.error)===null||o===void 0||o.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,o;return(o=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&o!==void 0?o:c2},t}(Ic),Xp={now:function(){return(Xp.delegate||Date).now()},delegate:void 0},Ac=function(e){Yn(t,e);function t(n,r,o){n===void 0&&(n=1/0),r===void 0&&(r=1/0),o===void 0&&(o=Xp);var i=e.call(this)||this;return i._bufferSize=n,i._windowTime=r,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,n),i._windowTime=Math.max(1,r),i}return t.prototype.next=function(n){var r=this,o=r.isStopped,i=r._buffer,s=r._infiniteTimeWindow,a=r._timestampProvider,l=r._windowTime;o||(i.push(n),!s&&i.push(a.now()+l)),this._trimBuffer(),e.prototype.next.call(this,n)},t.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),o=this,i=o._infiniteTimeWindow,s=o._buffer,a=s.slice(),l=0;l=2,!0))}function Vs(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new Ic}:t,r=e.resetOnError,o=r===void 0?!0:r,i=e.resetOnComplete,s=i===void 0?!0:i,a=e.resetOnRefCountZero,l=a===void 0?!0:a;return function(c){var d,f,u,p=0,h=!1,m=!1,w=function(){f==null||f.unsubscribe(),f=void 0},v=function(){w(),d=u=void 0,h=m=!1},g=function(){var x=d;v(),x==null||x.unsubscribe()};return qe(function(x,b){p++,!m&&!h&&w();var S=u=u??n();b.add(function(){p--,p===0&&!m&&!h&&(f=Iu(g,l))}),S.subscribe(b),!d&&p>0&&(d=new ci({next:function(C){return S.next(C)},error:function(C){m=!0,w(),f=Iu(v,o,C),S.error(C)},complete:function(){h=!0,w(),f=Iu(v,s),S.complete()}}),Ct(x).subscribe(d))})(c)}}function Iu(e,t){for(var n=[],r=2;rt in e?dN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lv=(e,t,n)=>fN(e,typeof t!="symbol"?t+"":t,n);class pN{constructor(){Lv(this,"first"),Lv(this,"last")}getRemoveFn(t){return()=>{t.prev?t.prev.next=t.next:this.first=t.next,t.next?t.next.prev=t.prev:this.last=t.prev,delete t.prev,delete t.next}}push(t){const n={value:t};return this.last===void 0?this.last=this.first=n:(this.last.next=n,n.prev=this.last,this.last=n),this.getRemoveFn(n)}unshift(t){return this.first={value:t,next:this.first},this.first.next&&(this.first.next.prev=this.first),this.last||(this.last=this.first),this.getRemoveFn(this.first)}pop(){var n,r;const t=(n=this.first)==null?void 0:n.value;return this.first&&(this.first=this.first.next,this.first?((r=this.first.prev)==null||delete r.next,delete this.first.prev):this.last=void 0),t}isEmpty(){return!this.first}}const hN=()=>{const e=new Map,t=(u,p)=>{e.set(u,()=>{e.delete(u),p()})},n=u=>{var p;(p=e.get(u))==null||p()},r=new pN,o=r.unshift.bind(r),i=r.push.bind(r),s=(u,p)=>{const h=p?o:i;t(u.source$,h(u))},a=()=>{const u=r.pop();u&&(e.delete(u.source$),l(u))},l=u=>{const{source$:p,observer:h}=u;let m=!1;const w=p.subscribe({next(v){h.next(v)},error(v){(m=v instanceof Rc)?s(u,!0):h.error(v)},complete(){h.complete()}});w.closed?m||a():t(p,()=>{w.unsubscribe(),a()})},c=(u=!1)=>p=>new ie(h=>{const m={observer:h,source$:p};return r.isEmpty()?l(m):s(m,u),()=>{n(p)}}),d=c();return{withRecovery:c,withRecoveryFn:u=>(...p)=>d(u(...p))}},mN=(e,t)=>n=>(r,...o)=>(r===null||r==="finalized"?e:r==="best"?t:nt(r)).pipe(bn(1),Se(s=>n(s,...o))),jv=e=>(...t)=>new ie(n=>{let r=new AbortController;return e(...t,r.signal).then(o=>{n.next(o),n.complete()},o=>{n.error(o)}),()=>{n.unsubscribe(),r.abort(),r=void 0}}),vN=e=>t=>(...n)=>e()[t](...n);class th extends Error{constructor(){super("Block is not pinned"),this.name="BlockNotPinnedError"}}class gN extends Error{constructor(){super("Block pruned"),this.name="BlockPrunedError"}}class N2 extends Error{constructor(){super("Block is not best block or finalized"),this.name="NotBestBlockError"}}const yN=(e,t)=>e.pipe(Nv(n=>n.blocks.has(t)),Jt((n,r)=>n.finalized===r.finalized&&n.best===r.best),yo(n=>n.blocks.get(n.best).number>=n.blocks.get(t).number),X(n=>{const{number:r}=n.blocks.get(t);let o=n.blocks.get(n.best),i=n.finalized===o.hash;for(;o.number>r;)o=n.blocks.get(o.parent),i=i||n.finalized===o.hash;return i?"finalized":o.hash===t?"best":null}),Jt(),Nv(n=>n!=="finalized",!0)),wN=e=>{let t=null,n=Ar;const r=new ie(o=>{t=e(!0,i=>{o.next(i)},i=>{t=null,o.error(i)}),n=()=>{o.complete(),t==null||t.unfollow()}}).pipe(Vs());return{getFollower:()=>{if(!t)throw new Error("Missing chainHead subscription");return t},unfollow:()=>{n()},follow$:r}},L2=()=>e=>new ie(t=>{const n=new vo,r=()=>e.subscribe({next:o=>t.next(o),error:o=>{o instanceof o2?(t.next({type:"stop-error"}),n.add(r())):t.error(o)},complete:()=>t.complete()});return n.add(r()),n});function xN(e,t,n){return(r,o,...i)=>(o?mO(EN(r,t.pipe(L2(),yo(a=>a.type==="finalized"),Se(a=>a.prunedBlockHashes))),bN(r,e)):a=>a)(n(r,...i))}const bN=(e,t)=>n=>yN(t,e).pipe(bn(1),eh(r=>r?n:qp(()=>new N2))),EN=(e,t)=>n=>new ie(r=>{const o=t.pipe(yo(s=>s===e)).subscribe(()=>{r.error(new gN)}),i=n.subscribe(r);return()=>{o.unsubscribe(),i.unsubscribe()}});function qa(e,t){return(n,...r)=>{const o=t(n,...r);return new ie(i=>{let s=null,a=!1;const l=()=>{a||(a=!0,s=o.subscribe({next:f=>i.next(f),error:f=>i.error(f),complete:()=>i.complete()}),s.add(()=>{a=!1,s=null}))};let c=!1;const d=e.subscribe({next:f=>{const u=f.blocks.get(n);u?u.recovering?s==null||s.unsubscribe():l():c&&i.error(new th),c=f.recovering},error:f=>i.error(f)});return()=>{d.unsubscribe(),s==null||s.unsubscribe()}})}}const SN=e=>{const t=e.pipe(Fl(n=>n instanceof Hp?nN(750).pipe(M2(()=>t)):qp(()=>n)));return t},Au=e=>(...t)=>SN(e(...t)),kN=(e,t)=>{const n=(r,o,i,s)=>new ie(a=>e().storageSubscription(r,o,i??null,l=>{a.next(l)},l=>{a.error(l)},()=>{a.complete()},l=>{l!==0&&a.next(n(r,o.slice(-l),i,!0))})).pipe(Zp(),t(s));return n},$v=(e,t)=>e.type==="array"&&e.len===t&&e.value.type==="primitive"&&e.value.value==="u8",zr={type:"void"},CN=e=>{const t=e.lookup,n=new Map,r=new Set,o=f=>u=>{let p=n.get(u);if(p)return p;if(r.has(u)){const m={id:u};return n.set(u,m),m}r.add(u);const h=f(u);return p=n.get(u),p?Object.assign(p,h):(p={id:u,...h},n.set(u,p)),r.delete(u),p};let i=!0,s=!0;const a=o(f=>{const{def:u,path:p,params:h}=t[f];if(u.tag==="composite"){if(u.value.length===0)return zr;if(u.value.length===1){const w=a(u.value[0].type);return i&&p.at(-1)==="AccountId32"&&$v(w,32)?(i=!1,{type:"AccountId32"}):s&&p.at(-1)==="AccountId20"&&$v(w,20)?(s=!1,{type:"AccountId20"}):w}const m=l(u);return m?{type:"enum",innerDocs:{},value:Object.fromEntries(e.pallets.map(w=>[w.name,w.errors==null?{...zr,idx:w.index}:{type:"lookupEntry",value:a(w.errors),idx:w.index}])),byteLength:m}:c(u.value)}if(u.tag==="variant"){if(p.length===1&&p[0]==="Option"&&h.length===1&&h[0].name==="T"){const v=a(h[0].type);return v.type==="void"?{type:"primitive",value:"bool"}:{type:"option",value:v}}if(p.length===1&&p[0]==="Result"&&h.length===2&&h[0].name==="T"&&h[1].name==="E")return{type:"result",value:{ok:a(h[0].type),ko:a(h[1].type)}};if(u.value.length===0)return zr;const m={},w={};return u.value.forEach(v=>{const g=v.name;if(w[g]=v.docs,v.fields.length===0){m[g]={...zr,idx:v.index};return}if(v.fields.length===1&&!v.fields[0].name){m[g]={type:"lookupEntry",value:a(v.fields[0].type),idx:v.index};return}m[g]={...c(v.fields),idx:v.index}}),{type:"enum",value:m,innerDocs:w}}if(u.tag==="sequence")return{type:"sequence",value:a(u.value)};if(u.tag==="array"){const{len:m}=u.value,w=a(u.value.type);return!m||w.type==="void"?zr:m>0?{type:"array",value:w,len:u.value.len}:w}if(u.tag==="tuple")return u.value.length===0?zr:u.value.length>1?d(u.value.map(m=>a(m)),u.value.map(m=>t[m].docs)):a(u.value[0]);if(u.tag==="primitive")return{type:"primitive",value:u.value.tag};if(u.tag==="compact"){const m=a(u.value);return m.type==="void"?{type:"compact",isBig:null}:{type:"compact",isBig:Number(m.value.slice(1))>32}}return{type:u.tag}});function l(f){if(!(f.value.length===2&&f.value[0].name==="index"&&f.value[1].name==="error"))return null;const p=a(f.value[0].type),h=a(f.value[1].type);return p.type==="primitive"&&p.value==="u8"&&h.type==="array"&&h.value.type==="primitive"&&h.value.value==="u8"?1+h.len:null}const c=f=>{let u=!0;const p={},h={};return f.forEach((m,w)=>{u=u&&!!m.name;const v=m.name||w,g=a(m.type);g.type!=="void"&&(p[v]=g,h[v]=m.docs)}),u?{type:"struct",value:p,innerDocs:h}:d(Object.values(p),Object.values(h))},d=(f,u)=>{if(f.every(p=>p.id===f[0].id)&&u.every(p=>!p.length)){const[p]=f;return p.type==="void"?zr:{type:"array",value:f[0],len:f.length}}return{type:"tuple",value:f,innerDocs:u}};return Object.assign(a,{metadata:e})},_N=(e,t,n)=>(r,o,i,...s)=>{const{id:a}=r;if(o.has(a))return o.get(a);if(i.has(a)){const c=t(()=>o.get(a),r,...s);return o.set(a,c),c}i.add(a);let l=e(r,o,i,...s);return i.delete(a),o.has(a)&&(l=n(l,o.get(a),r,...s)),o.set(a,l),l},RN=Us(),PN=pe(Te[0],Ec(Te[1],BigInt)),IN=(e,t,n,r)=>{if(e.type==="primitive")return n2[e.value];if(e.type==="void")return se;if(e.type==="AccountId32")return r;if(e.type==="AccountId20")return Hb;if(e.type==="compact")return e.isBig?PN:Te;if(e.type==="bitSequence")return Lb;const o=p=>j2(p,t,n,r),i=(p,h)=>{const m=o(p);return h?le(m,h):le(m)},s=p=>St(...p.map(o)),a=p=>{const h=Object.fromEntries(Object.entries(p).map(([m,w])=>[m,o(w)]));return re(h)};if(e.type==="sequence"&&e.value.type==="primitive"&&e.value.value==="u8")return RN;if(e.type==="array")return e.value.type==="primitive"&&e.value.value==="u8"?Us(e.len):i(e.value,e.len);if(e.type==="sequence")return i(e.value);if(e.type==="tuple")return s(e.value);if(e.type==="struct")return a(e.value);if(e.type==="option")return ut(o(e.value));if(e.type==="result")return Sc(o(e.value.ok),o(e.value.ko));const l=Object.values(e.value).map(p=>{switch(p.type){case"void":return se;case"lookupEntry":return o(p.value);case"tuple":return s(p.value);case"struct":return a(p.value);case"array":return i(p.value,p.len)}}),c=Object.fromEntries(Object.keys(e.value).map((p,h)=>[p,l[h]])),d=Object.values(e.value).map(p=>p.idx),u=d.every((p,h)=>p===h)?Wn(c):Wn(c,d);return e.byteLength?AN(u,e.byteLength):u},j2=_N(IN,Lp,e=>e),$2=e=>{var p;const{metadata:t}=e;let n=Rs();const r=new Map,o=h=>j2(e(h),r,new Set,n),i=(p=t.pallets.find(h=>h.name==="System"))==null?void 0:p.constants.find(h=>h.name==="SS58Prefix");let s;if(i)try{const h=o(i.type).dec(i.value);typeof h=="number"&&(s=h,n=Rs(h))}catch{}const a=new Map,l=(h,m)=>{let w=a.get(h);w||a.set(h,w=Fp(h));const v=t.pallets.find(A=>A.name===h).storage.items.find(A=>A.name===m),g=(A,...I)=>{const O=w(...I);return{...O,len:A,fallback:v.modifier===1?O.dec(v.fallback):void 0}};if(v.type.tag==="plain")return g(0,m,o(v.type.value).dec);const{key:x,value:b,hashers:S}=v.type.value,C=o(b),k=S.map(A=>n2[A.tag]),_=(()=>{if(k.length===1)return[[o(x),k[0]]];const A=e(x);switch(A.type){case"array":return k.map(I=>[o(A.value.id),I]);case"tuple":return A.value.map((I,O)=>[o(I.id),k[O]]);default:throw new Error("Invalid key type")}})();return g(k.length,m,C.dec,..._)},c=h=>{switch(h.type){case"void":return se;case"lookupEntry":return o(h.value.id);case"tuple":return St(...Object.values(h.value).map(m=>o(m.id)));case"struct":return re(qd(h.value,m=>o(m.id)));case"array":return le(o(h.value.id),h.len)}},d=(h,m)=>{const w=t.pallets.find(v=>v.name===h).constants.find(v=>v.name===m);return o(w.type)},f=h=>(m,w)=>{const v=t.pallets.find(b=>b.name===m),g=e(v[h]);if(g.type!=="enum")throw null;const x=g.value[w];return{location:[v.index,x.idx],codec:c(g.value[w])}},u=(h,m)=>{var v;const w=(v=t.apis.find(g=>g.name===h))==null?void 0:v.methods.find(g=>g.name===m);if(!w)throw null;return{args:St(...w.inputs.map(g=>o(g.type))),value:o(w.output)}};return{buildDefinition:o,buildStorage:l,buildEvent:f("events"),buildError:f("errors"),buildRuntimeCall:u,buildCall:f("calls"),buildConstant:d,ss58Prefix:s}},AN=(e,t)=>{const n=Qe(t);return pe(r=>n.enc(e.enc(r)),r=>e.dec(n.dec(r)))},TN=kt(Kt.enc(15)),MN=St(Te,Qe()),ON=ut(Qe()),NN=le(Kt).dec,LN=(e,t)=>{const n=r=>{const o=(l,c,d)=>e(l,c,d).pipe(Fl(f=>{if(f instanceof th)return t.pipe(bn(1),eh(u=>o(u,c,d)));throw f})),i=o(r,"Metadata_metadata_versions","").pipe(X(NN)),s=o(r,"Metadata_metadata","").pipe(X(l=>{const[,c]=MN.dec(l);return{metadata:jl.dec(c).metadata.value,metadataRaw:c}})),a=o(r,"Metadata_metadata_at_version",TN).pipe(X(l=>{const c=ON.dec(l);return{metadata:jl.dec(c).metadata.value,metadataRaw:c}}));return i.pipe(Fl(()=>nt([14])),Se(l=>l.includes(15)?a:s))};return r=>{const o=new Set([r]),i=n(r).pipe(X(({metadata:a,metadataRaw:l})=>{const c=CN(a),d=$2(c),f=d.buildStorage("System","Events"),u=a.extrinsic.signedExtensions.find(h=>h.identifier==="ChargeAssetTxPayment");let p=null;if(u){const h=c(u.type);if(h.type==="struct"){const m=h.value.asset_id;m.type==="option"&&(p=m.value.id)}}return{assetId:p,metadataRaw:l,lookup:c,dynamicBuilder:d,events:{key:f.enc(),dec:f.dec},accountId:Rs(d.ss58Prefix)}}),aN(1)),s={at:r,runtime:i,addBlock:a=>(o.add(a),s),deleteBlocks:a=>(a.forEach(l=>{o.delete(l)}),o.size),usages:o};return i.subscribe(),s}},Vi=Vs({connector:()=>new Ac(1),resetOnError:!0,resetOnComplete:!0,resetOnRefCountZero:!0}),D2=(e,t)=>{var n;(n=e.get(e.get(t).parent))==null||n.children.delete(t),e.delete(t)},jN=(e,t)=>{const n=[...t];let r=e.blocks.get(e.blocks.get(e.finalized).parent);const o=[];for(;r;)o.push(r.hash),r.refCount===0&&!r.unpinned&&(n.push(r.hash),r.unpinned=!0),r=e.blocks.get(r.parent);const i=[...t];for(let s=o.length-1;s>=0;s--){if(r=e.blocks.get(o[s]),!r.unpinned)return n;i.push(r.hash)}return i.forEach(s=>{D2(e.blocks,s)}),Object.entries(e.runtimes).map(([s,a])=>({key:s,usages:a.deleteBlocks(i)})).filter(s=>s.usages===0).map(s=>s.key).forEach(s=>{delete e.runtimes[s]}),n},$N=(e,t,n,r,o)=>{const i=T2(r,e.pipe(DN(t),L2())).pipe(O2((a,l)=>{switch(l.type){case"initialized":a.recovering&&(l.finalizedBlockHashes.some(p=>a.blocks.has(p))||(a=Dv()));const[c]=l.finalizedBlockHashes.slice(-1);a.finalized=a.best=c;const d=l.finalizedBlockHashes.length-1;l.finalizedBlockHashes.forEach((u,p)=>{a.blocks.has(u)?a.blocks.get(u).recovering=!1:a.blocks.set(u,{hash:u,parent:p===0?l.parentHash:l.finalizedBlockHashes[p-1],children:new Set(p===d?[]:[l.finalizedBlockHashes[p+1]]),runtime:u,refCount:0,number:l.number+p,recovering:!1})});const f=Object.values(a.runtimes).find(u=>u.usages.has(c));return a.finalizedRuntime=f??(a.runtimes[c]=s(c)),a;case"stop-error":for(const u of a.blocks.values())u.recovering=!0;return a.recovering=!0,a;case"newBlock":{const{parentBlockHash:u,blockHash:p}=l;if(a.blocks.has(p))a.blocks.get(p).recovering=!1;else{const h=a.blocks.get(u);h.children.add(p),l.newRuntime&&(a.runtimes[p]=s(p),a.runtimes[p].runtime.subscribe());const m={hash:p,number:h.number+1,parent:u,children:new Set,runtime:l.newRuntime?p:h.runtime,refCount:0,recovering:!1};a.blocks.set(p,m),a.runtimes[m.runtime].addBlock(p)}return a}case"bestBlockChanged":{if(a.recovering){for(const[u,p]of a.blocks)p.recovering&&D2(a.blocks,u);a.recovering=!1}return a.best=l.bestBlockHash,a}case"finalized":{a.finalized=l.finalizedBlockHashes.slice(-1)[0];const{blocks:u}=a;return u.get(a.best).number!!a.finalizedRuntime.runtime),X(a=>({...a})),Vi),s=LN(qa(i,n),i.pipe(X(a=>a.finalized)));return i},Dv=()=>({best:"",finalized:"",runtimes:{},blocks:new Map,finalizedRuntime:{},recovering:!1}),DN=e=>t=>t.pipe(M2(n=>n.type!=="initialized"?nt(n):e(n.finalizedBlockHashes[0]).then(r=>({...n,number:r.number,parentHash:r.parentHash})))),Bv=(e,t,n,r)=>{const o=a=>lN(e.pipe(yo(({blocks:l})=>!l.has(a)))),i=(a,l,c)=>{if(c)return nt({hash:a,found:{type:!1,validity:null}});const d=o(a);return t(a).pipe(Se(f=>{const u=f.indexOf(l);return u>-1?d(r(a)).pipe(X(p=>({hash:a,found:{type:!0,index:u,events:p}}))):n(a,l).pipe(X(p=>({hash:a,found:{type:!1,validity:p}})))}),d)},s=(a,l,c)=>i(a,l,c.has(a)).pipe(Se(d=>{var u;const{found:f}=d;return f.type||((u=f.validity)==null?void 0:u.success)===!1?nt(d):e.pipe(o(a),Se(p=>p.blocks.get(a).children),iN(),Se(p=>s(p,l,c)))}));return a=>e.pipe(bn(1),Se(l=>s(l.finalized,a,new Set(l.blocks.keys()))))},BN=new Uint8Array([2]),zN=(e,t)=>kt(Ft(BN,Sn(e),Sn(t))),zv="TaggedTransactionQueue",Fv="validate_transaction",FN=(e,t)=>(n,r)=>{const o=t(n).pipe(X(i=>i.dynamicBuilder.buildRuntimeCall(zv,Fv).value[1]));return e(n,`${zv}_${Fv}`,zN(r,n)).pipe(uN(o),X(([i,s])=>s(i)))},UN=e=>t=>new ie(n=>{let r=!1;const o=t.subscribe({next(i){r=!0,n.next(i)},error(i){n.error(i)},complete(){n.complete()}});return r||n.next(e),o}),WN=(e,t=1/0)=>n=>new ie(r=>{let o;const i=new Map,s=new Map,a=new Map;let l=0,c=0,d=0;const f=()=>{const u=i.get(c);if(!u){s.size===0&&(typeof o>"u"||o.closed)&&r.complete();return}const p=c++;i.delete(p),d!==p&&a.set(p,[]),s.set(p,u.subscribe({next(h){d===p?r.next(h):a.get(p).push(h)},complete(){if(s.delete(p),p===d)for(d++;a.has(d)&&(a.get(d).forEach(h=>r.next(h)),a.delete(d),!s.has(d));)d++;f()},error(h){r.error(h)}}))};return o=n.subscribe({next(u){const p=l++;i.set(p,Jp(()=>e(u,p))),s.size{s.forEach(u=>u.unsubscribe()),o.unsubscribe(),i.clear(),a.clear()}}),Tu=({hash:e,number:t,parent:n})=>({hash:e,number:t,parent:n}),VN=e=>{const{getFollower:t,unfollow:n,follow$:r}=wN(e),o=vN(t),{withRecovery:i,withRecoveryFn:s}=hN(),a=new Ic,l=T=>(V,...U)=>new ie(q=>{a.next({type:"blockUsage",value:{type:"hold",hash:V}});const ve=T(V,...U).subscribe(q);return()=>{setTimeout(()=>{a.next({type:"blockUsage",value:{type:"release",hash:V}})},0),ve.unsubscribe()}}),c=T=>(V,...U)=>new ie(q=>{let ve=!1;return w.pipe(bn(1)).subscribe(ce=>{const fe=ce.blocks.get(V);ve=!!fe&&!fe.unpinned}),ve?T(V,...U).subscribe(q):q.error(new th)}),d=T=>t().header(T).then(Gb.dec),f=T=>t().unpin(T).catch(V=>{if(!(V instanceof Xa))throw V}),u=T=>c(l((U=>xN(w,r,U))(qa(w,Au(s(jv(T))))))),p=(T,V=!0)=>(U,...q)=>T(U,V,...q),h=Au(s(jv(o("call")))),m=new Map,w=$N(r,d,l(h),a,T=>{f(T),T.forEach(V=>{m.delete(V)})}),v=l(T=>w.pipe(bn(1),Se(V=>V.runtimes[V.blocks.get(T).runtime].runtime))),g=T=>V=>V.pipe(WN(U=>v(T(U)).pipe(X(q=>[U,q])))),x=(T,V,U)=>{const q=m.get(T)??new Map,ve=q.get(V);if(ve)return ve;m.set(T,q);const ce=new Ac,fe=U.pipe(Vs({connector:()=>ce}),cN({complete(){q.set(V,ce)}}));return q.set(V,fe),fe},b=w.pipe(Jt((T,V)=>T.finalized===V.finalized),X(T=>Tu(T.blocks.get(T.finalized))),Vi),S=w.pipe(Jt((T,V)=>T.best===V.best),X(T=>Tu(T.blocks.get(T.best))),Vi),C=w.pipe(Jt((T,V)=>T.finalized===V.finalized&&T.best===V.best),O2((T,V)=>{const U=je=>T.get(je)||Tu(V.blocks.get(je)),q=U(V.best),ve=U(V.finalized),ce=q.number-ve.number+1,fe=new Array(ce);for(let je=0,jt=q.hash;je[je.hash,je]))},new Map),X(T=>[...T.values()]),Vi),k=w.pipe(Jt((T,V)=>T.finalizedRuntime===V.finalizedRuntime),eh(({finalizedRuntime:{runtime:T}})=>T.pipe(UN(null))),Vi),_=k.pipe(X(T=>(T==null?void 0:T.lookup.metadata)??null)),A=mN(b.pipe(X(T=>T.hash)),S.pipe(X(T=>T.hash))),I=u(o("body")),O=T=>x(T,"body",I(T,!0)),D=u(o("storage")),Y=A((T,V,U,q,ve=null,ce)=>w.pipe(bn(1),Se(fe=>fe.runtimes[fe.blocks.get(T).runtime].runtime),Se(fe=>{const je=q(fe),jt=x(T,`storage-${U}-${je}-${ve??""}`,D(T,V,U,je,ve));return ce?x(T,`storage-${U}-${je}-${ve??""}-dec`,jt.pipe(X(Cn=>ce(Cn,fe)))):jt}))),Q=kN(t,i),H=Au(A(l(qa(w,(T,V,U)=>Q(T,V,U??null,!1))))),F=A(l(qa(w,T=>Jp(()=>d(T)))));T2(k,C).subscribe();const G=(T,V=!1)=>Y(T,V,"value",U=>U.events.key,null,(U,q)=>q.events.dec(U)),R=u(o("call")),P=A((T,V,U,q)=>x(T,`call-${U}-${q}`,R(T,V,U,q))),B=FN(p(P,!1),v),L=T=>x(T,"body",I(T,!1)),W=Bv(w,L,B,G),ne=Bv(w,L,B,()=>nt());return{follow$:r,finalized$:b,best$:S,bestBlocks$:C,runtime$:k,metadata$:_,header$:F,body$:O,call$:p(P),storage$:p(Y),storageQueries$:H,eventsAt$:p(G),trackTx$:W,trackTxWithoutEvents$:ne,validateTx$:B,pinnedBlocks$:w,withRuntime:g,getRuntimeContext$:A(v),unfollow:n}};var HN=e=>t=>new ie(n=>e(t,r=>{n.error(r)}));const GN=({chainHead:e,transaction:t,destroy:n})=>({chainHead$:()=>VN(e),broadcastTx$:HN(t),destroy:n});class B2{constructor(){}_phantom(t){}}const Ul=new WeakMap,z2=e=>Ul.get(e);var Hi=(e=>(e.Storage="storage",e.Tx="tx",e.Event="events",e.Error="errors",e.Const="constants",e))(Hi||{});const KN=le(V4),YN=le(Up),XN=St(KN,YN),QN=(e,t)=>{const n=new Promise(async o=>{const i=t.runtime$.pipe(yo(a=>a!=null));let s=await vn(i);i.subscribe(a=>s=a),o(()=>s)});return Promise.all([e.metadataTypes.then(XN.dec),e.descriptors,n]).then(([[o,i],s,a])=>{const l=new B2;return Ul.set(l,{runtime:a,getPalletEntryPoint(c,d,f){return o[s[c][d][f]]},getApiEntryPoint(c,d){return o[s.apis[c][d]]},typedefNodes:i}),l})},Mu=new WeakMap,Uv=e=>(Mu.has(e.metadataRaw)||Mu.set(e.metadataRaw,{compat:new Map,lookup:e.lookup,typeNodes:[]}),Mu.get(e.metadataRaw)),Oi=(e,t,n)=>{const r=(u,p)=>{var h;const m=Uv(u);return(h=m.typeNodes)[p]||(h[p]=Ps(m.lookup(p)))};function o(u,p){const h=Ul.get(u);p||(p=h.runtime());const m=t(h),w=n(p),v=h.typedefNodes,g=Uv(p);return X4(m,x=>v[x],w,x=>r(p,x),g.compat)}const i=Wv(e,u=>F2(o(u))),s=Wv(e,(u,p)=>i(p)>=u),a=()=>e;return{isCompatible:s,getCompatibilityLevel:i,getCompatibilityLevels:o,waitDescriptors:a,withCompatibleRuntime:(u,p)=>h=>nf([h.pipe(u.withRuntime(p)),a()]).pipe(X(([[m,w],v])=>[m,v,w])),compatibleRuntime$:(u,p)=>nf([a(),u.getRuntimeContext$(p)]),argsAreCompatible:(u,p,h)=>{const m=o(u,p);if(m.args===Vr.Incompatible)return!1;if(m.args>Vr.Partial)return!0;if(m.values===Vr.Incompatible)return!1;const w=n(p);return _v(w.args,v=>r(p,v),h)},valuesAreCompatible:(u,p,h)=>{const m=o(u,p).values;if(m===Vr.Incompatible)return!1;if(m>Vr.Partial)return!0;const w=Ul.get(u),v=t(w);return _v(v.values,g=>w.typedefNodes[g],h)},getRuntimeTypedef:r}},F2=e=>Math.min(e.args,e.values),Wv=(e,t)=>(...n)=>n.at(-1)instanceof B2?t(...n):e.then(o=>t(...n,o)),qN=(e,t,{valuesAreCompatible:n,waitDescriptors:r,isCompatible:o,getCompatibilityLevel:i})=>{const s=new WeakMap,a=c=>{if(s.has(c))return s.get(c);const d=c.lookup.metadata.pallets.find(p=>p.name===e),f=d==null?void 0:d.constants.find(p=>p.name===t),u=c.dynamicBuilder.buildConstant(e,t).dec(f.value);return s.set(c,u),u},l=c=>{if(c){const d=z2(c).runtime(),f=a(d);if(!n(c,d,f))throw new Error(`Incompatible runtime entry Constant(${e}.${t})`);return f}return r().then(l)};return Object.assign(l,{isCompatible:o,getCompatibilityLevel:i})},ZN=Vs({connector:()=>new Ac(1),resetOnError:!0,resetOnComplete:!0,resetOnRefCountZero:!0}),JN=(e,t=1/0)=>n=>new ie(r=>{let o;const i=new Map,s=new Map,a=new Map;let l=0,c=0,d=0;const f=()=>{const u=i.get(c);if(!u){s.size===0&&(typeof o>"u"||o.closed)&&r.complete();return}const p=c++;i.delete(p),d!==p&&a.set(p,[]),s.set(p,u.subscribe({next(h){d===p?r.next(h):a.get(p).push(h)},complete(){if(s.delete(p),p===d)for(d++;a.has(d)&&(a.get(d).forEach(h=>r.next(h)),a.delete(d),!s.has(d));)d++;f()},error(h){r.error(h)}}))};return o=n.subscribe({next(u){const p=l++;i.set(p,Jp(()=>e(u,p))),s.size{s.forEach(u=>u.unsubscribe()),o.unsubscribe(),i.clear(),a.clear()}}),e5=(e,t,n,{isCompatible:r,getCompatibilityLevel:o,withCompatibleRuntime:i,argsAreCompatible:s,valuesAreCompatible:a})=>{const l=()=>new Error(`Incompatible runtime entry Event(${e}.${t})`),c=n.finalized$.pipe(i(n,p=>p.hash),X(([p,h,m])=>{if(!s(h,m,null))throw l();return[p,h,m]}),JN(([p,h,m])=>n.eventsAt$(p.hash).pipe(X(w=>w.filter(g=>g.event.type===e&&g.event.value.type===t).map(g=>{if(!a(h,m,g.event.value.value))throw l();return{meta:{phase:g.phase,block:p},payload:g.event.value.value}})))),ZN);return{watch:p=>c.pipe(Se(h=>p?h.filter(m=>p(m.payload)):h)),pull:()=>vn(c),filter:p=>p.filter(h=>h.type===e&&h.value.type===t).map(h=>h.value.value),getCompatibilityLevel:o,isCompatible:r}};function rf(e,t){return new Promise((n,r)=>{let o=null,i=!1;const s=t?()=>{o==null||o.unsubscribe(),r(new Pb)}:Ar;o=e.subscribe({next:a=>{n(a),o==null||o.unsubscribe(),i=!0},error:a=>{t==null||t.removeEventListener("abort",s),r(a)},complete:()=>{t==null||t.removeEventListener("abort",s),r(new Error("Observable completed without emitting"))}}),i||t==null||t.addEventListener("abort",s)})}const of=e=>typeof e=="object"&&e!==null&&Object.entries(e).every(([t,n])=>t==="at"&&(n===void 0||typeof n=="string")||t==="signal"&&(n===void 0||n instanceof AbortSignal)),t5=(e,t,n,{isCompatible:r,getCompatibilityLevel:o,compatibleRuntime$:i,argsAreCompatible:s,valuesAreCompatible:a})=>{const l=`${e}_${t}`,c=()=>new Error(`Incompatible runtime entry RuntimeCall(${l})`);return Object.assign((...f)=>{const u=f[f.length-1],p=of(u),{signal:h,at:m}=p?u:{},w=m??null,v=i(n,w).pipe(Se(([g,x])=>{if(!s(g,x,f))throw c();const b=x.dynamicBuilder.buildRuntimeCall(e,t);return n.call$(w,l,kt(b.args.enc(f))).pipe(X(b.value.dec),X(S=>{if(!a(g,x,S))throw c();return S}))}));return rf(v,h)},{getCompatibilityLevel:o,isCompatible:r})},n5=(e,t)=>n=>new ie(r=>{let o=new Array,i=!1;const s=l=>{const c=new vo;o.push(c),o.length>t&&(o[0].unsubscribe(),o=o.slice(1));const d=e(l).subscribe({next(f){const u=o.indexOf(c);o.slice(0,u).forEach(p=>p.unsubscribe()),o=o.slice(u),r.next(f)},error(f){r.error(f)},complete(){const f=o.indexOf(c);o.splice(f,1),o.length===0&&i&&r.complete()}});c.add(d)},a=n.subscribe({next(l){s(l)},error(l){r.error(l)},complete(){o.length===0&&r.complete(),i=!0}});return()=>{a.unsubscribe(),o.forEach(l=>l.unsubscribe())}}),r5=(e,t,n,{isCompatible:r,getCompatibilityLevel:o,getCompatibilityLevels:i,waitDescriptors:s,withCompatibleRuntime:a,argsAreCompatible:l,valuesAreCompatible:c})=>{const d=e==="System"&&t==="Number",f=()=>new Error(`Incompatible runtime entry Storage(${e}.${t})`),u=v=>new Error(`Invalid Arguments calling ${e}.${t}(${v})`),p=(...v)=>{const g=v[v.length-1],x=g==="best"||g==="finalized"?v.slice(0,-1):v;return d?n.bestBlocks$.pipe(X(b=>b.at(g==="best"?0:-1).number),Jt()):n[g==="best"?"best$":"finalized$"].pipe(oN(0),a(n,b=>b.hash),n5(([b,S,C])=>{if(!l(S,C,x))throw f();const k=C.dynamicBuilder.buildStorage(e,t);return n.storage$(b.hash,"value",()=>k.enc(...x)).pipe(X(_=>{if(!c(S,C,_))throw f();return{val:_,codecs:k}}))},4),Jt((b,S)=>b.val===S.val),X(({val:b,codecs:S})=>b===null?S.fallback:S.dec(b)))},h=async(...v)=>{const g=v[v.length-1],x=of(g),{signal:b,at:S}=x?g:{},C=S??null;let k;if(d)k=n.bestBlocks$.pipe(X(_=>C==="finalized"||!C?_.at(-1):C==="best"?_.at(0):_.find(A=>A.hash===C)),X(_=>{if(!_)throw new N2;return _.number}),Jt());else{const _=await s();k=n.storage$(C,"value",A=>{const I=A.dynamicBuilder.buildStorage(e,t),O=v.length===I.len?v:v.slice(0,-1);if(v!==O&&!x)throw u(v);if(!l(_,A,O))throw f();return I.enc(...O)},null,(A,I)=>{const O=I.dynamicBuilder.buildStorage(e,t),D=A===null?O.fallback:O.dec(A);if(!c(_,I,D))throw f();return D})}return rf(k,b)};return{isCompatible:r,getCompatibilityLevel:o,getValue:h,getValues:(v,g)=>Promise.all(v.map(x=>h(...g?[...x,g]:x))),getEntries:async(...v)=>{const g=v[v.length-1],x=of(g),{signal:b,at:S}=x?g:{},C=S??null,k=await s(),_=n.storage$(C,"descendantsValues",A=>{if(F2(i(k,A))===Vr.Incompatible)throw f();const I=A.dynamicBuilder.buildStorage(e,t);if(v.length>I.len)throw u(v);const O=v.length>0&&x?v.slice(0,-1):v;if(v.length===I.len&&O===v)throw u(v);return I.enc(...O)},null,(A,I)=>{const O=I.dynamicBuilder.buildStorage(e,t);if(A.some(({value:D})=>!c(k,I,D)))throw f();return A.map(({key:D,value:Y})=>({keyArgs:O.keyDecoder(D),value:O.dec(Y)}))});return rf(_,b)},watchValue:p}},o5=zs(Ne.enc,e=>+!!e.signed<<7|e.version),i5={Ed25519:0,Sr25519:1,Ecdsa:2},[_a,Ni]=["",""].map(e=>mo.fromText(e).asBytes());function s5(e,t,n){return{publicKey:e,signTx:async(i,s,a,l,c=$p)=>{let d;try{const v=jl.dec(a);if(v.metadata.tag!=="v15")throw null;d=v.metadata.value}catch{throw new Error("Unsupported metadata version")}const{version:f}=d.extrinsic,u=[],p=[];d.extrinsic.signedExtensions.map(({identifier:v})=>{const g=s[v];if(!g)throw new Error(`Missing ${v} signed extension`);u.push(g.value),p.push(g.additionalSigned)});const h=Ft(i,...u,...p),m=await n(h.length>256?c(h):h),w=Ft(o5({signed:!0,version:f}),new Uint8Array([0,...e]),new Uint8Array([i5[t],...m]),...u,i);return Ft(Te.enc(w.length),w)},signBytes:async i=>{let s=!0,a;for(a=0;s&&a<_a.length;a++)s=_a[a]===i[a];s=s&&a===_a.length;const l=i.length-Ni.length;for(a=0;s&&ae.chainHead.storage$(e.at,"value",()=>a5,null).pipe(X(t=>Sn(t))),W2=(e,t)=>{const n=$2(t),r=t.metadata.pallets.find(a=>a.name==="System").constants.find(a=>a.name==="Version"),o=t(r.type),i=n.buildDefinition(r.type).dec;if(o.type!=="struct")throw new Error("not a struct");const s=n.buildDefinition(o.value[e].id).enc;return nt(s(i(r.value)[e]))},l5=e=>nt({value:Nb.enc(e),additionalSigned:Tr});function c5(e){let t=0;for(;!(e&1);)t++,e>>=1;return t}const u5=zs(Qe(2).enc,e=>{const t=Math.max(e.period>>12,1),n=Math.min(Math.max(c5(e.period)-1,1),15),r=e.phase/t<<4;return ao.enc(n|r)}),d5=new Uint8Array([0]),f5=(e,t)=>{if(!e)return U2(t).pipe(X(o=>({additionalSigned:o,value:d5})));const{period:n,blockNumber:r}=e;return nt({additionalSigned:Sn(t.at),value:u5({period:n,phase:r%n})})},p5=re({tip:Te,asset:ut(Qe(1/0))}).enc,h5=(e,t)=>nt({value:p5({tip:e,asset:t}),additionalSigned:Tr}),m5=e=>U2(e).pipe(X(t=>({value:Tr,additionalSigned:t}))),v5=()=>nt({value:Uint8Array.from([0]),additionalSigned:Uint8Array.from([0])}),Vv="AccountNonceApi_account_nonce",g5={1:Ne.dec,2:ao.dec,4:Kt.dec,8:Fs.dec},nh=e=>nt({value:Te.enc(e),additionalSigned:Tr}),y5=e=>e.chainHead.call$(e.at,Vv,kt(e.from)).pipe(Se(t=>{const n=Sn(t),r=g5[n.length];if(!r)throw new Error(`${Vv} retrieved wrong data`);return nh(r(n))})),w5=({lookupFn:e})=>W2("spec_version",e).pipe(X(t=>({additionalSigned:t,value:Tr}))),x5=({lookupFn:e})=>W2("transaction_version",e).pipe(X(t=>({additionalSigned:t,value:Tr}))),b5=Object.freeze(Object.defineProperty({__proto__:null,CheckGenesis:m5,CheckMetadataHash:v5,CheckNonce:y5,CheckSpecVersion:w5,CheckTxVersion:x5,getNonce:nh},Symbol.toStringTag,{value:"Module"})),E5=(e,t,n,r,o={})=>e.getRuntimeContext$(r.hash).pipe(bn(1),Se(i=>{const s={lookupFn:i.lookup,chainHead:e,callData:n,at:r.hash,from:t.publicKey},a=o.mortality?o.mortality.mortal?{period:o.mortality.period,blockNumber:r.number}:void 0:{period:64,blockNumber:r.number};return nf(i.lookup.metadata.extrinsic.signedExtensions.map(({identifier:l,type:c,additionalSigned:d})=>{if(l==="CheckMortality")return f5(a,s);if(l==="ChargeTransactionPayment")return l5(o.tip??0n);if(l==="ChargeAssetTxPayment")return h5(o.tip??0n,o.asset);if(l==="CheckNonce"&&"nonce"in o)return nh(o.nonce);const f=b5[l];if(!f){if(i.dynamicBuilder.buildDefinition(c)===se&&i.dynamicBuilder.buildDefinition(d)===se)return nt({value:Tr,additionalSigned:Tr});throw new Error(`Unsupported signed-extension: ${l}`)}return f(s)})).pipe(Se(l=>t.signTx(n,Object.fromEntries(i.lookup.metadata.extrinsic.signedExtensions.map(({identifier:c},d)=>[c,{identifier:c,...l[d]}])),i.metadataRaw,r.number)))}));let Hv={};const S5=e=>t=>new ie(n=>{let r=Hv,o=t.subscribe({next(i){n.next(r=i)},error(i){n.error(i)},complete(){r===Hv?n.complete():o=e(r).subscribe(n)}});return()=>{o.unsubscribe()}});var k5=Object.defineProperty,C5=(e,t,n)=>t in e?k5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_5=(e,t,n)=>C5(e,t+"",n);const R5=e=>kt($p(Sn(e))),P5=(e,t)=>new ie(n=>{const r=new Map;let o,i;const s=()=>{var p;let l=o.best,c=r.get(l),d=o.blocks.get(l).number;for(;!c;){const h=o.blocks.get(l);if(!h)break;c=r.get(l=h.parent),d--}if(!c)return;const f=d<=o.blocks.get(o.finalized).number,u=c.found.type;if(u&&(i!=null&&i.found)&&i.hash===c.hash){f&&n.complete();return}n.next(i=c.found.type?{found:u,hash:c.hash,number:d,index:c.found.index,events:c.found.events}:{found:u,validity:c.found.validity}),f&&(u?n.complete():((p=c.found.validity)==null?void 0:p.success)===!1&&n.error(new V2(c.found.validity.value)))},a=t.pipe(Jt((l,c)=>l.finalized===c.finalized&&l.best===c.best)).subscribe({next:l=>{o=l,r.size!==0&&s()},error(l){n.error(l)}});return a.add(e.subscribe({next:l=>{r.set(l.hash,l),s()},error(l){n.error(l)}})),a}).pipe(Jt((n,r)=>n===r)),I5=(e,t)=>{const n=e.filter(o=>o.phase.type==="ApplyExtrinsic"&&o.phase.value===t).map(o=>o.event),r=n[n.length-1];return r.type==="System"&&r.value.type==="ExtrinsicFailed"?{ok:!1,events:n,dispatchError:r.value.value.dispatch_error}:{ok:!0,events:n}};class V2 extends Error{constructor(t){super(JSON.stringify(t,(n,r)=>typeof r=="bigint"?r.toString():r instanceof mo?r.asHex():r,2)),_5(this,"error"),this.name="InvalidTxError",this.error=t}}const rh=(e,t,n,r,o=!1)=>{const i=R5(n),s=(f,u)=>({type:f,txHash:i,...u}),l=e.pinnedBlocks$.pipe(bn(1),X(f=>{var u;return((u=f.blocks.get(r))==null?void 0:u.hash)??f.finalized})).pipe(Se(f=>e.validateTx$(f,n).pipe(yo(u=>!u.success),X(u=>{throw new V2(u.value)})))),c=new ie(f=>{const u=e.trackTx$(n).subscribe(f);return u.add(t(n).subscribe({error(p){f.error(p)}})),u}),d=P5(c,e.pinnedBlocks$).pipe(X(f=>{var u;return f.found?s("txBestBlocksState",{found:!0,block:{index:f.index,number:f.number,hash:f.hash},...I5(f.events,f.index)}):s("txBestBlocksState",{found:!1,isValid:((u=f.validity)==null?void 0:u.success)!==!1})}));return tN(o?nt(s("signed",{})):zl,l,nt(s("broadcasted",{})),d.pipe(S5(({found:f,type:u,...p})=>f?nt(s("finalized",p)):zl)))},H2=async(e,t,n,r)=>zO(rh(e,t,n,r)).then(o=>{if(o.type!=="finalized")throw null;const i={...o};return delete i.type,i}),A5=Rs().enc,T5=St(Te,Te,Ne,Jx).dec,M5=e=>T5(e)[3],O5=new Uint8Array(64),N5=()=>O5,L5=(e,t,n,r,{isCompatible:o,getCompatibilityLevel:i,compatibleRuntime$:s,argsAreCompatible:a,getRuntimeTypedef:l})=>Object.assign(d=>{const f=(b,S,C={})=>{const k=z2(b).runtime();if(!a(b,k,S))throw new Error(`Incompatible runtime entry Tx(${e}.${t})`);const{dynamicBuilder:_,assetId:A,lookup:I}=k;let O=C;if(C.asset){if(A==null||!Wp(C.asset,Ps(I(A)),Q=>l(k,Q)))throw new Error("Incompatible runtime asset");O={...C,asset:_.buildDefinition(A).enc(C.asset)}}const{location:D,codec:Y}=_.buildCall(e,t);return{callData:mo.fromBytes(Ft(new Uint8Array(D),Y.enc(S))),options:O}},u=(b,S={})=>s(n,null).pipe(X(([C])=>f(C,b,S))),p=b=>b?f(b,d).callData:vn(u(d).pipe(X(S=>S.callData))),h=(b,{...S},C)=>u(d,S).pipe(Se(({callData:k,options:_})=>E5(n,b,k.asBytes(),C,_))),m=(b,{at:S,...C}={})=>(!S||S==="finalized"?n.finalized$:S==="best"?n.best$:n.bestBlocks$.pipe(X(k=>k.find(_=>_.hash===S)))).pipe(bn(1),Se(k=>k?h(b,C,k).pipe(X(_=>({tx:kt(_),block:k}))):qp(()=>new Error(`Uknown block ${S}`)))),w=(b,S)=>vn(m(b,S)).then(C=>C.tx),v=(b,S)=>vn(m(b,S)).then(({tx:C,block:k})=>H2(n,r,C,k.hash)),g=(b,S)=>m(b,S).pipe(Se(({tx:C,block:k})=>rh(n,r,C,k.hash,!0)));return{getEstimatedFees:async(b,S)=>{const C=s5(b instanceof Uint8Array?b:A5(b),"Sr25519",N5),k=Sn(await w(C,S)),_=kt(Ft(k,Kt.enc(k.length)));return vn(n.call$(null,"TransactionPaymentApi_query_info",_).pipe(X(M5)))},decodedCall:{type:e,value:_c(t,d)},getEncodedData:p,sign:w,signSubmitAndWatch:g,signAndSubmit:v}},{getCompatibilityLevel:i,isCompatible:o}),j5=(e,t,n)=>{const r={},o=p=>new Proxy(r,{get(h,m){return p(m)}}),i=p=>{const h={};return o(m=>(h[m]||(h[m]={}),o(w=>(h[m][w]||(h[m][w]=p(m,w)),h[m][w]))))},s=(p,h)=>p.lookup.metadata.pallets.find(m=>m.name===h),a=i((p,h)=>r5(p,h,t,Oi(e,m=>m.getPalletEntryPoint(Hi.Storage,p,h),m=>H4(s(m,p).storage.items.find(w=>w.name===h))))),l=(p,h,m,w)=>{const v=p.lookup(m);if(v.type!=="enum")throw new Error("Expected enum");const g=K4(v.value[w]);return{args:h==="args"?g:$l,values:h==="args"?$l:g}},c=i((p,h)=>L5(p,h,t,n,Oi(e,m=>m.getPalletEntryPoint(Hi.Tx,p,h),m=>l(m,"args",s(m,p).calls,h)))),d=i((p,h)=>e5(p,h,t,Oi(e,m=>m.getPalletEntryPoint(Hi.Event,p,h),m=>l(m,"values",s(m,p).events,h)))),f=i((p,h)=>qN(p,h,Oi(e,m=>m.getPalletEntryPoint(Hi.Const,p,h),m=>Y4(s(m,p).constants.find(w=>w.name===h).type)))),u=i((p,h)=>t5(p,h,t,Oi(e,m=>m.getApiEntryPoint(p,h),m=>G4(m.lookup.metadata.apis.find(w=>w.name===p).methods.find(w=>w.name===h)))));return{query:a,tx:c,event:d,apis:u,constants:f,compatibilityToken:e}};function G2(e){const t=uO(e),n=GN(t),r=n.chainHead$(),{getChainSpecData:o}=t,i=t.request,s=new WeakMap,a=c=>{const d=s.get(c)||QN(c,r);return s.set(c,d),d},{broadcastTx$:l}=n;return{getChainSpecData:o,finalizedBlock$:r.finalized$,getFinalizedBlock:()=>vn(r.finalized$),bestBlocks$:r.bestBlocks$,getBestBlocks:()=>vn(r.bestBlocks$),watchBlockBody:r.body$,getBlockBody:c=>vn(r.body$(c)),getBlockHeader:c=>vn(r.header$(c??null)),submit:(...c)=>H2(r,l,...c),submitAndWatch:(...c)=>rh(r,l,...c),getTypedApi:c=>j5(a(c),r,l),destroy:()=>{r.unfollow(),n.destroy()},_request:i}}var rs=(e=>(e[e.subscribe=0]="subscribe",e[e.unsubscribe=1]="unsubscribe",e[e.end=2]="end",e))(rs||{});const K2=e=>JSON.stringify({jsonrpc:"2.0",...e}),[$5,D5,B5]=["follow","unfollow","followEvent"].map(e=>new Set(["v1","unstable"].map(t=>`chainHead_${t}_${e}`))),Gv="stop",z5=e=>{let t="";return{onSent(n){return $5.has(n.method)?(t=n.method+"Event",{type:rs.subscribe,id:n.id,onRes:r=>r.id===n.id?{id:r.result}:null}):D5.has(n.method)?{type:rs.unsubscribe,id:Object.values(n.params)[0]}:null},onNotification(n){return B5.has(n.method)&&n.params.result.event===Gv?{type:rs.end,id:n.params.subscription}:null},onAbort:n=>{e(K2({method:t,params:{subscription:n,result:{event:Gv}}}))}}},F5=({onSent:e,onNotification:t,onAbort:n})=>{const r=new Map,o=new Set,i=()=>{r.clear(),o.clear()};return{onSent(s){const a=e(s);a&&(a.type===rs.subscribe?r.set(a.id,a.onRes):o.delete(a.id))},onResponse(s){var l;const a=(l=r.get(s.id))==null?void 0:l(s);a&&(r.delete(s.id),o.add(a.id))},onNotifiaction(s){const a=t(s);a&&o.delete(a.id)},onDisconnect:i,onAbort(){const s=[...o];i(),s.forEach(n)}}},U5=e=>F5(z5(e)),W5=e=>t=>{let n,r=[];const o=new Set,i=U5(t),s=f=>{let u;try{u=JSON.parse(f)}catch{console.error(`Unable to parse incoming message: ${f}`);return}u.id!==void 0?(o.delete(u.id),i.onResponse(u)):i.onNotifiaction(u),t(f)},a=f=>{if(!n)return;const u=JSON.parse(f);i.onSent(u),u.id&&o.add(u.id),n instanceof Promise?r.push(f):n.send(f)},l=()=>{r=[];const f=[...o];if(o.clear(),!n)throw null;const u=c();return i.onAbort(),f.forEach(p=>{t(K2({error:{code:-32603,message:"Internal error"},id:p}))}),u},c=()=>{const f=u=>{let p=!0;const w=u(v=>{p&&s(v)},()=>{p&&(p=!1,l())});return r.forEach(v=>{w.send(v)}),r=[],n=w};return n=e().then(f,V5(l)),n},d=()=>{if(!n)return;const f=u=>{i.onDisconnect(),o.clear(),n=null,u==null||u.disconnect()};n instanceof Promise?(n.then(f,f),n=null):f(n)};return c(),{send:a,disconnect:d}},V5=e=>(...t)=>new Promise(n=>setTimeout(n,0)).then(()=>e(...t));let Ra;const Y2=e=>W5(async()=>{for(;Ra;)await Ra;let t;return e instanceof Promise?(Ra=e,t=await e,Ra=null):t=e,(n,r)=>{let o=!0;return(async()=>{do{let i="";try{i=await t.nextJsonRpcResponse()}catch{o&&r();return}if(!o)break;n(i)}while(o)})(),{send(i){t.sendJsonRpc(i)},disconnect(){o=!1,t.remove()}}}});function H5(e){return new Worker("/dashboard/assets/smoldot_worker-kK54kzUU.js",{name:e==null?void 0:e.name})}class Pa extends Error{constructor(t){super(t),this.name="AddChainError"}}class Ia extends Error{constructor(){super(),this.name="AlreadyDestroyedError"}}class Kv extends Error{constructor(){super(),this.name="JsonRpcDisabledError"}}class G5 extends Error{constructor(t){super(t)}}class K5 extends Error{constructor(){super("JSON-RPC requests queue is full")}}function $t(e,t,n){return yi(e,t,n),new TextDecoder().decode(e.slice(t,t+n))}function Y5(e,t){return yi(e,t,1),e[t]}function Ro(e,t){return yi(e,t,2),e[t]<<8|e[t+1]}function Aa(e,t){return yi(e,t,4),(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function X5(e,t,n){yi(e,t,1),e[t]=n&255}function Q5(e,t,n){yi(e,t,4),e[t+3]=n>>>24&255,e[t+2]=n>>>16&255,e[t+1]=n>>>8&255,e[t]=n&255}function yi(e,t,n){if(!Number.isInteger(t)||t<0)throw new RangeError;if(t+n>e.length)throw new RangeError}var Yv=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(f){s(f)}}function l(d){try{c(r.throw(d))}catch(f){s(f)}}function c(d){d.done?i(d.value):o(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};function q5(e,t,n){return Yv(this,void 0,void 0,function*(){const r={instance:null,currentTask:null,bufferIndices:new Array,advanceExecutionPromise:null,onShutdownExecutorOrWasmPanic:()=>{}},o={panic:(a,l)=>{const c=r.instance;r.instance=null,a>>>=0,l>>>=0;const d=$t(new Uint8Array(c.exports.memory.buffer),a,l);throw n({ty:"wasm-panic",message:d,currentTask:r.currentTask}),r.onShutdownExecutorOrWasmPanic(),r.onShutdownExecutorOrWasmPanic=()=>{},new Error},chain_initialized:(a,l,c)=>{const d=r.instance,f=new Uint8Array(d.exports.memory.buffer);if(l>>>=0,c>>>=0,l===0)n({ty:"add-chain-result",chainId:a,success:!0});else{const u=$t(f,l,c);n({ty:"add-chain-result",chainId:a,success:!1,error:u})}},random_get:(a,l)=>{const c=r.instance;a>>>=0,l>>>=0;const d=new Uint8Array(c.exports.memory.buffer).subarray(a,a+l);for(let f=0;f{const a=Math.floor(Date.now());if(a<0)throw new Error("UNIX timestamp inferior to 0");return BigInt(a)*BigInt(1e3)},monotonic_clock_us:()=>{const a=e.performanceNow(),l=Math.floor(a);return BigInt(l)*BigInt(1e3)+BigInt(Math.floor((a-l)*1e3))},buffer_size:a=>r.bufferIndices[a].byteLength,buffer_copy:(a,l)=>{const c=r.instance;l=l>>>0;const d=r.bufferIndices[a];new Uint8Array(c.exports.memory.buffer).set(d,l)},advance_execution_ready:()=>{r.advanceExecutionPromise&&r.advanceExecutionPromise(),r.advanceExecutionPromise=null},json_rpc_responses_non_empty:a=>{n({ty:"json-rpc-responses-non-empty",chainId:a})},log:(a,l,c,d,f)=>{const u=r.instance;l>>>=0,c>>>=0,d>>>=0,f>>>=0;const p=new Uint8Array(u.exports.memory.buffer);let h=$t(p,l,c),m=$t(p,d,f);n({ty:"log",level:a,message:m,target:h})},start_timer:a=>{const l=r.instance;a>2147483647&&(a=2147483647),a<1&&typeof setImmediate=="function"?setImmediate(()=>{if(r.instance)try{l.exports.timer_finished()}catch{}}):setTimeout(()=>{if(r.instance)try{l.exports.timer_finished()}catch{}},a)},connection_type_supported:a=>{switch(a){case 0:case 1:case 2:return e.forbidTcp?0:1;case 4:case 5:case 6:return e.forbidWs||e.forbidNonLocalWs?0:1;case 7:return e.forbidWs?0:1;case 14:return e.forbidWss?0:1;case 16:case 17:return e.forbidWebRtc?0:1;default:throw new Error("Invalid connection type passed to `connection_type_supported`")}},connection_new:(a,l,c)=>{const d=r.instance,f=new Uint8Array(d.exports.memory.buffer);l>>>=0,c>>>=0;let u;switch(Y5(f,l)){case 0:case 1:case 2:{const p=Ro(f,l+1),h=$t(f,l+3,c-3);u={ty:"tcp",port:p,hostname:h};break}case 4:case 6:{const p=Ro(f,l+1);u={ty:"websocket",url:"ws://"+$t(f,l+3,c-3)+":"+p};break}case 5:{const p=Ro(f,l+1);u={ty:"websocket",url:"ws://["+$t(f,l+3,c-3)+"]:"+p};break}case 14:{const p=Ro(f,l+1);u={ty:"websocket",url:"wss://"+$t(f,l+3,c-3)+":"+p};break}case 16:{const p=Ro(f,l+1),h=f.slice(l+3,l+35),m=$t(f,l+35,c-35);u={ty:"webrtc",ipVersion:"4",remoteTlsCertificateSha256:h,targetIp:m,targetPort:p};break}case 17:{const p=Ro(f,l+1),h=f.slice(l+3,l+35),m=$t(f,l+35,c-35);u={ty:"webrtc",ipVersion:"6",remoteTlsCertificateSha256:h,targetIp:m,targetPort:p};break}default:throw new Error("Invalid encoded address passed to `connection_new`")}n({ty:"new-connection",connectionId:a,address:u})},reset_connection:a=>{n({ty:"connection-reset",connectionId:a})},connection_stream_open:a=>{n({ty:"connection-stream-open",connectionId:a})},connection_stream_reset:(a,l)=>{n({ty:"connection-stream-reset",connectionId:a,streamId:l})},stream_send:(a,l,c,d)=>{const f=r.instance,u=new Uint8Array(f.exports.memory.buffer);c>>>=0,d>>>=0;const p=new Array;for(let h=0;h{n({ty:"stream-send-close",connectionId:a,streamId:l})},current_task_entered:(a,l)=>{a>>>=0,l>>>=0;const c=$t(new Uint8Array(r.instance.exports.memory.buffer),a,l);r.currentTask=c},current_task_exit:()=>{r.currentTask=null}},i=yield WebAssembly.instantiate(t,{smoldot:o});r.instance=i,r.instance.exports.init(e.maxLogLevel);const s=new Promise(a=>r.onShutdownExecutorOrWasmPanic=()=>a("stop"));return Yv(this,void 0,void 0,function*(){const a=e.cpuRateLimit;let l=0,c=e.performanceNow();for(;;){const d=new Promise(m=>r.advanceExecutionPromise=()=>m("ready"));if(!r.instance)break;r.instance.exports.advance_execution();const f=e.performanceNow(),u=f-c;c=f;const p=u*(1/a-1);if(l+=p,l>5){l>2147483646&&(l=2147483646);const m=new Promise(w=>setTimeout(()=>w("timeout"),l));if((yield Promise.race([m,s]))==="stop")break}if((yield Promise.race([d,s]))==="stop")break;const h=e.performanceNow();l-=h-c,l<-1e4&&(l=-1e4),c=h}r.instance&&n({ty:"executor-shutdown"})}),{request:(a,l)=>r.instance?(r.bufferIndices[0]=new TextEncoder().encode(a),r.instance.exports.json_rpc_send(0,l)>>>0):1,peekJsonRpcResponse:a=>{if(!r.instance)return null;const l=new Uint8Array(r.instance.exports.memory.buffer),c=r.instance.exports.json_rpc_responses_peek(a)>>>0,d=Aa(l,c)>>>0,f=Aa(l,c+4)>>>0;if(f!==0){const u=$t(l,d,f);return r.instance.exports.json_rpc_responses_pop(a),u}else return null},addChain:(a,l,c,d,f,u)=>{if(!r.instance){n({ty:"add-chain-id-allocated",chainId:0}),n({ty:"add-chain-result",chainId:0,success:!1,error:"Smoldot has crashed"});return}console.assert(d||f!=0,"invalid jsonRpcMaxPendingRequests value passed to local-instance::addChain"),r.bufferIndices[0]=new TextEncoder().encode(a),r.bufferIndices[1]=new TextEncoder().encode(l);const p=new Uint8Array(c.length*4);for(let m=0;m{r.instance&&r.instance.exports.remove_chain(a)},shutdownExecutor:()=>{if(!r.instance)return;const a=r.onShutdownExecutorOrWasmPanic;r.onShutdownExecutorOrWasmPanic=()=>{},a()},connectionMultiStreamSetHandshakeInfo:(a,l)=>{if(!r.instance)return;const c=new Uint8Array(1+l.localTlsCertificateSha256.length);X5(c,0,0),c.set(l.localTlsCertificateSha256,1),r.bufferIndices[0]=c,r.instance.exports.connection_multi_stream_set_handshake_info(a,0),delete r.bufferIndices[0]},connectionReset:(a,l)=>{r.instance&&(r.bufferIndices[0]=new TextEncoder().encode(l),r.instance.exports.connection_reset(a,0),delete r.bufferIndices[0])},streamWritableBytes:(a,l,c)=>{r.instance&&r.instance.exports.stream_writable_bytes(a,c||0,l)},streamMessage:(a,l,c)=>{r.instance&&(r.bufferIndices[0]=l,r.instance.exports.stream_message(a,c||0,0),delete r.bufferIndices[0])},streamOpened:(a,l,c)=>{r.instance&&r.instance.exports.connection_stream_opened(a,l,c==="outbound"?1:0)},streamReset:(a,l,c)=>{r.instance&&(r.bufferIndices[0]=new TextEncoder().encode(c),r.instance.exports.stream_reset(a,l,0),delete r.bufferIndices[0])}}})}var Xv=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(f){s(f)}}function l(d){try{c(r.throw(d))}catch(f){s(f)}}function c(d){d.done?i(d.value):o(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};function Z5(e){return Xv(this,void 0,void 0,function*(){const{port1:t,port2:n}=new MessageChannel,r=e.portToServer,o={wasmModule:yield e.wasmModule,serverToClient:n,maxLogLevel:e.maxLogLevel,cpuRateLimit:e.cpuRateLimit,forbidWs:e.forbidWs,forbidWss:e.forbidWss,forbidNonLocalWs:e.forbidNonLocalWs,forbidTcp:e.forbidTcp,forbidWebRtc:e.forbidWebRtc};r.postMessage(o,[n]);const i={jsonRpcResponses:new Map,connections:new Map};return t.onmessage=s=>{const a=s.data;switch(a.ty){case"wasm-panic":case"executor-shutdown":{t.close(),r.close();break}case"add-chain-result":{if(a.success){i.jsonRpcResponses.set(a.chainId,new Array);const l={ty:"accept-more-json-rpc-answers",chainId:a.chainId};for(let c=0;c<10;++c)t.postMessage(l)}break}case"new-connection":{i.connections.set(a.connectionId,new Set);break}case"connection-reset":{if(!i.connections.has(a.connectionId))return;i.connections.delete(a.connectionId);break}case"connection-stream-open":{if(!i.connections.has(a.connectionId))return;break}case"connection-stream-reset":{if(!i.connections.has(a.connectionId)||!i.connections.get(a.connectionId).has(a.streamId))return;break}case"stream-send":{if(!i.connections.has(a.connectionId)||a.streamId&&!i.connections.get(a.connectionId).has(a.streamId))return;break}case"stream-send-close":{if(!i.connections.has(a.connectionId)||a.streamId&&!i.connections.get(a.connectionId).has(a.streamId))return;break}case"json-rpc-response":{const l=i.jsonRpcResponses.get(a.chainId);l&&(l.push(a.response),e.eventCallback({ty:"json-rpc-responses-non-empty",chainId:a.chainId}));return}}e.eventCallback(a)},{addChain(s,a,l,c,d,f){return Xv(this,void 0,void 0,function*(){const u={ty:"add-chain",chainSpec:s,databaseContent:a,potentialRelayChains:l,disableJsonRpc:c,jsonRpcMaxPendingRequests:d,jsonRpcMaxSubscriptions:f};t.postMessage(u)})},removeChain(s){i.jsonRpcResponses.delete(s);const a={ty:"remove-chain",chainId:s};t.postMessage(a)},request(s,a){const l={ty:"request",chainId:a,request:s};return t.postMessage(l),0},peekJsonRpcResponse(s){const a=i.jsonRpcResponses.get(s).shift();if(!a)return null;const l={ty:"accept-more-json-rpc-answers",chainId:s};return t.postMessage(l),a},shutdownExecutor(){const s={ty:"shutdown"};t.postMessage(s)},connectionReset(s,a){i.connections.delete(s);const l={ty:"connection-reset",connectionId:s,message:a};t.postMessage(l)},connectionMultiStreamSetHandshakeInfo(s,a){const l={ty:"connection-multistream-set-info",connectionId:s,info:a};t.postMessage(l)},streamMessage(s,a,l){const c={ty:"stream-message",connectionId:s,message:a,streamId:l};t.postMessage(c)},streamOpened(s,a,l){i.connections.get(s).add(a);const c={ty:"stream-opened",connectionId:s,streamId:a,direction:l};t.postMessage(c)},streamWritableBytes(s,a,l){const c={ty:"stream-writable-bytes",connectionId:s,numExtra:a,streamId:l};t.postMessage(c)},streamReset(s,a,l){i.connections.get(s).delete(a);const c={ty:"stream-reset",connectionId:s,streamId:a,message:l};t.postMessage(c)}}})}var Ta=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(f){s(f)}}function l(d){try{c(r.throw(d))}catch(f){s(f)}}function c(d){d.done?i(d.value):o(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};function J5(e,t,n){const r=e.logCallback||((l,c,d)=>{l<=1?console.error("[%s] %s",c,d):l==2?console.warn("[%s] %s",c,d):l==3?console.info("[%s] %s",c,d):l==4?console.debug("[%s] %s",c,d):console.trace("[%s] %s",c,d)});t instanceof Promise||(t=Promise.resolve(t));let o=e.cpuRateLimit||1;isNaN(o)&&(o=1),o>1&&(o=1),o<0&&(o=0);const i={instance:{status:"not-created"},chainIds:new WeakMap,connections:new Map,addChainIdAllocations:[],addChainResults:new Map,onExecutorShutdownOrWasmPanic:()=>{},chains:new Map},s=l=>{switch(l.ty){case"wasm-panic":{console.error("Smoldot has panicked"+(l.currentTask?" while executing task `"+l.currentTask+"`":"")+`. This is a bug in smoldot. Please open an issue at https://github.com/smol-dot/smoldot/issues with the following message: `+l.message),i.instance={status:"destroyed",error:new G5(l.message)},i.connections.forEach(d=>d.reset()),i.connections.clear();for(const d of i.addChainIdAllocations)d({success:!1,error:"Smoldot has crashed"});i.addChainIdAllocations=[],i.addChainResults.forEach(d=>{d({success:!1,error:"Smoldot has crashed"})}),i.addChainResults.clear();for(const d of Array.from(i.chains.values())){for(const f of d.jsonRpcResponsesPromises)f();d.jsonRpcResponsesPromises=[]}i.chains.clear();const c=i.onExecutorShutdownOrWasmPanic;i.onExecutorShutdownOrWasmPanic=()=>{},c();break}case"executor-shutdown":{const c=i.onExecutorShutdownOrWasmPanic;i.onExecutorShutdownOrWasmPanic=()=>{},c();break}case"log":{r(l.level,l.target,l.message);break}case"add-chain-id-allocated":{const c=i.addChainIdAllocations.shift();i.addChainResults.set(l.chainId,c);break}case"add-chain-result":{i.addChainResults.get(l.chainId)(l),i.addChainResults.delete(l.chainId);break}case"json-rpc-responses-non-empty":{const c=i.chains.get(l.chainId).jsonRpcResponsesPromises;for(;c.length!==0;)c.shift()();break}case"new-connection":{const c=l.connectionId;i.connections.set(c,n.connect({address:l.address,onConnectionReset(d){if(i.instance.status!=="ready")throw new Error;i.connections.delete(c),i.instance.instance.connectionReset(c,d)},onMessage(d,f){if(i.instance.status!=="ready")throw new Error;i.instance.instance.streamMessage(c,d,f)},onStreamOpened(d,f){if(i.instance.status!=="ready")throw new Error;i.instance.instance.streamOpened(c,d,f)},onMultistreamHandshakeInfo(d){if(i.instance.status!=="ready")throw new Error;i.instance.instance.connectionMultiStreamSetHandshakeInfo(c,d)},onWritableBytes(d,f){if(i.instance.status!=="ready")throw new Error;i.instance.instance.streamWritableBytes(c,d,f)},onStreamReset(d,f){if(i.instance.status!=="ready")throw new Error;i.instance.instance.streamReset(c,d,f)}}));break}case"connection-reset":{i.connections.get(l.connectionId).reset(),i.connections.delete(l.connectionId);break}case"connection-stream-open":{i.connections.get(l.connectionId).openOutSubstream();break}case"connection-stream-reset":{i.connections.get(l.connectionId).reset(l.streamId);break}case"stream-send":{i.connections.get(l.connectionId).send(l.data,l.streamId);break}case"stream-send-close":{i.connections.get(l.connectionId).closeSend(l.streamId);break}}},a=e.portToWorker;return a?i.instance={status:"not-ready",whenReady:Z5({wasmModule:t.then(l=>l.wasm),forbidTcp:e.forbidTcp||!1,forbidWs:e.forbidWs||!1,forbidNonLocalWs:e.forbidNonLocalWs||!1,forbidWss:e.forbidWss||!1,forbidWebRtc:e.forbidWebRtc||!1,maxLogLevel:e.maxLogLevel||3,cpuRateLimit:o,portToServer:a,eventCallback:s}).then(l=>{i.instance.status!=="destroyed"&&(i.instance={status:"ready",instance:l})})}:i.instance={status:"not-ready",whenReady:t.then(l=>q5({forbidTcp:e.forbidTcp||!1,forbidWs:e.forbidWs||!1,forbidNonLocalWs:e.forbidNonLocalWs||!1,forbidWss:e.forbidWss||!1,forbidWebRtc:e.forbidWebRtc||!1,maxLogLevel:e.maxLogLevel||3,cpuRateLimit:o,envVars:[],performanceNow:n.performanceNow,getRandomValues:n.getRandomValues},l.wasm,s)).then(l=>{i.instance.status!=="destroyed"&&(i.instance={status:"ready",instance:l})})},{addChain:l=>Ta(this,void 0,void 0,function*(){if(i.instance.status==="not-ready"&&(yield i.instance.whenReady),i.instance.status==="destroyed")throw i.instance.error;if(i.instance.status==="not-created"||i.instance.status==="not-ready")throw new Error;if(typeof l.chainSpec!="string")throw new Error("Chain specification must be a string");let c=[];if(l.potentialRelayChains)for(const w of l.potentialRelayChains){const v=i.chainIds.get(w);v!==void 0&&c.push(v)}let d=l.jsonRpcMaxPendingRequests===void 0?1/0:l.jsonRpcMaxPendingRequests;if(d=Math.floor(d),d<=0||isNaN(d))throw new Pa("Invalid value for `jsonRpcMaxPendingRequests`");d>4294967295&&(d=4294967295);let f=l.jsonRpcMaxSubscriptions===void 0?1/0:l.jsonRpcMaxSubscriptions;if(f=Math.floor(f),f<0||isNaN(f))throw new Pa("Invalid value for `jsonRpcMaxSubscriptions`");if(f>4294967295&&(f=4294967295),l.databaseContent!==void 0&&typeof l.databaseContent!="string")throw new Pa("`databaseContent` is not a string");const u=new Promise(w=>i.addChainIdAllocations.push(w));i.instance.instance.addChain(l.chainSpec,l.databaseContent||"",c,!!l.disableJsonRpc,d,f);const p=yield u;if(!p.success)throw new Pa(p.error);const h=p.chainId;i.chains.set(h,{jsonRpcResponsesPromises:new Array});const m={sendJsonRpc:w=>{if(i.instance.status==="destroyed")throw i.instance.error;if(i.instance.status!=="ready")throw new Error;if(!i.chains.has(h))throw new Ia;if(l.disableJsonRpc)throw new Kv;const v=i.instance.instance.request(w,h);switch(v){case 0:break;case 1:throw new K5;default:throw new Error("Internal error: unknown json_rpc_send error code: "+v)}},jsonRpcResponses:{next:()=>Ta(this,void 0,void 0,function*(){for(;;){if(!i.chains.has(h))return{done:!0,value:void 0};if(l.disableJsonRpc)throw new Kv;if(i.instance.status==="destroyed")throw i.instance.error;if(i.instance.status!=="ready")throw new Error;const w=i.instance.instance.peekJsonRpcResponse(h);if(w)return{done:!1,value:w};yield new Promise(v=>{i.chains.get(h).jsonRpcResponsesPromises.push(v)})}}),[Symbol.asyncIterator](){return this}},nextJsonRpcResponse:()=>Ta(this,void 0,void 0,function*(){const w=yield m.jsonRpcResponses.next();if(w.done)throw new Ia;return w.value}),remove:()=>{if(i.instance.status==="destroyed")throw i.instance.error;if(i.instance.status!=="ready")throw new Error;if(!i.chains.has(h))throw new Ia;console.assert(i.chainIds.has(m)),i.chainIds.delete(m);for(const w of i.chains.get(h).jsonRpcResponsesPromises)w();i.chains.delete(h),i.instance.instance.removeChain(h)}};return i.chainIds.set(m,h),m}),terminate:()=>Ta(this,void 0,void 0,function*(){if(i.instance.status==="not-ready"&&(yield i.instance.whenReady),i.instance.status==="destroyed")throw i.instance.error;if(i.instance.status!=="ready")throw new Error;i.instance.instance.shutdownExecutor(),yield new Promise(l=>i.onExecutorShutdownOrWasmPanic=l),i.instance.status==="ready"&&(i.instance={status:"destroyed",error:new Ia}),i.connections.forEach(l=>l.reset()),i.connections.clear();for(const l of i.addChainIdAllocations)l({success:!1,error:"Client.terminate() has been called"});i.addChainIdAllocations=[],i.addChainResults.forEach(l=>{l({success:!1,error:"Client.terminate() has been called"})}),i.addChainResults.clear();for(const l of Array.from(i.chains.values())){for(const c of l.jsonRpcResponsesPromises)c();l.jsonRpcResponsesPromises=[]}i.chains.clear()})}}var Qv=function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(d){try{c(r.next(d))}catch(f){s(f)}}function l(d){try{c(r.throw(d))}catch(f){s(f)}}function c(d){d.done?i(d.value):o(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};function eL(e){if(e.forbidTcp=!0,typeof isSecureContext=="boolean"&&isSecureContext&&typeof location!==void 0){const t=location.toString();t.indexOf("localhost")!==-1&&t.indexOf("127.0.0.1")!==-1&&t.indexOf("::1")!==-1&&(e.forbidNonLocalWs=!0)}return J5(e,e.bytecode,{performanceNow:()=>performance.now(),getRandomValues:t=>{const n=globalThis.crypto;if(!n)throw new Error("randomness not available");if(t.buffer instanceof ArrayBuffer)n.getRandomValues(t);else{const r=new Uint8Array(t.length);n.getRandomValues(r),t.set(r)}},connect:t=>tL(t)})}function tL(e){if(e.address.ty==="websocket"){let t;try{t=new WebSocket(e.address.url)}catch(o){t=o instanceof Error?o.toString():"Exception thrown by new WebSocket"}const n={quenedUnreportedBytes:0,nextTimeout:10},r=()=>{if(!(t instanceof WebSocket)||t.readyState!=1)return;const o=t.bufferedAmount;let i=n.quenedUnreportedBytes-o;i<0&&(i=0),n.quenedUnreportedBytes-=i,n.quenedUnreportedBytes!=0&&(setTimeout(r,n.nextTimeout),n.nextTimeout*=2,n.nextTimeout>500&&(n.nextTimeout=500)),i!=0&&e.onWritableBytes(i)};return t instanceof WebSocket?(t.binaryType="arraybuffer",t.onopen=()=>{e.onWritableBytes(1024*1024)},t.onclose=o=>{const i="Error code "+o.code+(o.reason?": "+o.reason:"");e.onConnectionReset(i)},t.onmessage=o=>{e.onMessage(new Uint8Array(o.data))}):setTimeout(()=>{t&&!(t instanceof WebSocket)&&(e.onConnectionReset(t),t=null)},1),{reset:()=>{t instanceof WebSocket&&(t.onopen=null,t.onclose=null,t.onmessage=null,t.onerror=null,t.readyState==WebSocket.OPEN&&t.close()),t=null},send:o=>{n.quenedUnreportedBytes==0&&(n.nextTimeout=10,setTimeout(r,10));for(const i of o)n.quenedUnreportedBytes+=i.length;t.send(new Blob(o))},closeSend:()=>{throw new Error("Wrong connection type")},openOutSubstream:()=>{throw new Error("Wrong connection type")}}}else if(e.address.ty==="webrtc"){const{targetPort:t,ipVersion:n,targetIp:r,remoteTlsCertificateSha256:o}=e.address,i={pc:void 0,dataChannels:new Map,nextStreamId:0,isFirstOutSubstream:!0},s=()=>{if(!i.pc){console.assert(i.dataChannels.size===0,"substreams exist while pc is undef"),i.pc=null;return}i.pc.onconnectionstatechange=null,i.pc.onnegotiationneeded=null,i.pc.ondatachannel=null;for(const l of Array.from(i.dataChannels.values()))l.channel.onopen=null,l.channel.onerror=null,l.channel.onclose=null,l.channel.onbufferedamountlow=null,l.channel.onmessage=null;i.dataChannels.clear(),i.pc.close()},a=(l,c)=>{const d=i.nextStreamId;i.nextStreamId+=1,l.binaryType="arraybuffer";let f={value:!1};l.onopen=()=>{console.assert(!f.value,"substream opened twice"),f.value=!0,e.onStreamOpened(d,c),e.onWritableBytes(65536,d)},l.onerror=l.onclose=u=>{const p=u instanceof RTCErrorEvent?u.error.toString():"RTCDataChannel closed";f.value?(l.onopen=null,l.onerror=null,l.onclose=null,l.onbufferedamountlow=null,l.onmessage=null,i.dataChannels.delete(d),e.onStreamReset(d,p)):(s(),e.onConnectionReset("data channel failed to open: "+p))},l.onbufferedamountlow=()=>{const u=i.dataChannels.get(d),p=u.bufferedBytes;u.bufferedBytes=0,e.onWritableBytes(p,d)},l.onmessage=u=>{e.onMessage(new Uint8Array(u.data),d)},i.dataChannels.set(d,{channel:l,bufferedBytes:0})};return RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256",hash:"SHA-256"}).then(l=>Qv(this,void 0,void 0,function*(){if(i.pc===null)return;if((r=="localhost"||r=="127.0.0.1"||r=="::1")&&navigator.userAgent.indexOf("Firefox")!==-1){s(),e.onConnectionReset("Firefox can't connect to a localhost WebRTC server");return}i.pc=new RTCPeerConnection({certificates:[l]});let c;if(l.getFingerprints){for(const{algorithm:f,value:u}of l.getFingerprints())if(f==="sha-256"){c=u;break}}else{const u=(yield i.pc.createOffer()).sdp.match(/a(\s*)=(\s*)fingerprint:(\s*)(sha|SHA)-256(\s*)(([a-fA-F0-9]{2}(:)*){32})/);u&&(c=u[6])}if(c===void 0){e.onConnectionReset("Failed to obtain the browser certificate fingerprint");return}let d=new Uint8Array(32);d.set(c.split(":").map(f=>parseInt(f,16)),0),i.pc.onconnectionstatechange=f=>{(i.pc.connectionState=="closed"||i.pc.connectionState=="disconnected"||i.pc.connectionState=="failed")&&(s(),e.onConnectionReset("WebRTC state transitioned to "+i.pc.connectionState))},i.pc.onnegotiationneeded=f=>Qv(this,void 0,void 0,function*(){var u;let p=(yield i.pc.createOffer()).sdp;p.match(/^m=application(\s+)(\d+)(\s+)UDP\/DTLS\/SCTP(\s+)webrtc-datachannel$/m)===null&&console.error("Local offer doesn't contain UDP data channel. WebRTC connections will likely fail. Please report this issue.");const h=(u=p.match(/^a=ice-pwd:(.+)$/m))===null||u===void 0?void 0:u.at(1);h===void 0&&console.error("Failed to set ufrag to pwd. WebRTC connections will likely fail. Please report this issue.");const m="libp2p+webrtc+v1/"+h;p=p.replace(/^a=ice-ufrag.*$/m,"a=ice-ufrag:"+m),p=p.replace(/^a=ice-pwd.*$/m,"a=ice-pwd:"+m),yield i.pc.setLocalDescription({type:"offer",sdp:p});const w=Array.from(o).map(g=>("0"+g.toString(16)).slice(-2).toUpperCase()).join(":"),v=`v=0 o=- 0 0 IN IP`+n+" "+r+` s=- diff --git a/build/index.html b/build/index.html index 59ec03a..37fee10 100644 --- a/build/index.html +++ b/build/index.html @@ -2,11 +2,10 @@ - - Polkadot UI | Dashboard - - + DelegIt | Dashboard + +
diff --git a/index.html b/index.html index f736bc7..b9acfee 100644 --- a/index.html +++ b/index.html @@ -2,9 +2,8 @@ - - Polkadot UI | Dashboard + DelegIt | Dashboard
diff --git a/src/consts.ts b/src/consts.ts index f6d98f2..f389645 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -2,12 +2,11 @@ * Global Constants */ const AppVersion = '0.1.1' -const DappName = 'Polkadot Technical Fellowship Dashboard' -const PolkadotUrl = 'https://polkadot-fellows.github.io/dashboard' +const DappName = 'Polkadot DelegIt Dashboard' +const PolkadotUrl = 'https://delegit-xyz.github.io/dashboard' -const GithubOwner = 'polkadot-fellows' -const GithubRfc = 'RFCs' -const GithubApiUrl = `https://api.github.com/repos/${GithubOwner}/${GithubRfc}` +const GithubOwner = 'delegit-xyz' +// const GithubApiUrl = `https://api.github.com/repos/${GithubOwner}/${GithubRfc}` const SideMenuMaximisedWidth = 185 const SideMenuMinimisedWidth = 75 @@ -157,8 +156,8 @@ export { DappName, PolkadotUrl, GithubOwner, - GithubRfc, - GithubApiUrl, + // GithubRfc, + // GithubApiUrl, SideMenuMaximisedWidth, SideMenuMinimisedWidth, SideMenuStickyThreshold,