From a1836dd3c05e0b8c090db05c9600bcf973da96d0 Mon Sep 17 00:00:00 2001 From: BOB450 Date: Fri, 19 Dec 2025 12:32:02 -0700 Subject: [PATCH] Updated the block explorer. *Changed the bits, nonce and version fields to hex. *Removed the elision by default to hashes, now elides based on how large the window is. *Widened the default content container *Improved the reactivity of header and search bar. *Increased size of search bar --- console/embedded/explore_css.cpp | 5 +- console/embedded/explore_ecma.cpp | 179 +++++++++++++++--------------- 2 files changed, 93 insertions(+), 91 deletions(-) diff --git a/console/embedded/explore_css.cpp b/console/embedded/explore_css.cpp index 43e53ee0..541f925f 100644 --- a/console/embedded/explore_css.cpp +++ b/console/embedded/explore_css.cpp @@ -25,8 +25,9 @@ namespace server { DEFINE_EMBEDDED_PAGE(explore_pages, char, css, R"DELIM(*,: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: }*,: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]:where(:not([hidden=until-found])){display:none}[type=text],input:where(:not([type])),[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:n)DELIM" R"DELIM(one;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,input:where(:not([type])):focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--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)}[type=checkbox]:checked,[type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media (forced-colors: active){[type=checkbox]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media (forced-colors: active){[type=radio]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:checked:hover,[type=checkbox]:checked:focus,[type=radio]:checked:hover,[type=radio]:checked:focus{border-color:transparent;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}@media (forced-colors: active){[type=checkbox]:indeterminate{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background)DELIM" - R"DELIM(:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}.visible{visibility:visible}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.ml-auto{margin-left:auto}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.\!block{display:block!important}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-2{height:.5rem}.h-4{height:1rem}.h-full{height:100%}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:.5rem}.w-4{width:1rem}.w-52{width:13rem}.w-fit{width:-moz-fit-content;width:fit-content}.min-w-full{min-width:100%}.max-w-6xl{max-width:72rem}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * 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))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-accentSecondary\/30>:not([hidden])~:not([hidden]){border-color:#c856374d}.place-self-start{place-self:start}.overflow-hidden{overflow:hidden}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-accent{--tw-border-opacity: 1;border-color:rgb(255 160 34 / var(--tw-border-opacity, 1))}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/30{border-color:#c856374d}.border-amber-500\/50{border-color:#f59e0b80}.border-emerald-500\/50{border-color:#10b98180}.border-rose-500\/50{border-color:#f43f5e80}.border-slate-500\/50{border-color:#64748b80}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500\/20{background-color:#f59e0b33}.bg-background{--tw-bg-opacity: 1;background-color:rgb(39 40 34 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-current{background-color:currentColor}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/20{background-color:#10b98133}.bg-rose-400{--tw-bg-opacity: 1;background-color:rgb(251 113 133 / var(--tw-bg-opacity, 1))}.bg-rose-500\/20{background-color:#f43f5e33}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-500\/20{background-color:#64748b33}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-transparent{background-color:transparent}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10)DELIM" - R"DELIM(px}.text-\[11px\]{font-size:11px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-accent{--tw-text-opacity: 1;color:rgb(255 160 34 / var(--tw-text-opacity, 1))}.text-accentSecondary{--tw-text-opacity: 1;color:rgb(200 86 55 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-rose-300{--tw-text-opacity: 1;color:rgb(253 164 175 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-textMuted{--tw-text-opacity: 1;color:rgb(207 207 207 / var(--tw-text-opacity, 1))}.text-textPrimary{--tw-text-opacity: 1;color:rgb(237 237 237 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 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)}.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)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{color-scheme:dark}body{--tw-bg-opacity: 1;background-color:rgb(39 40 34 / var(--tw-bg-opacity, 1));font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";--tw-text-opacity: 1;color:rgb(237 237 237 / var(--tw-text-opacity, 1))}::-moz-selection{--tw-bg-opacity: 1;background-color:rgb(255 160 34 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(39 40 34 / var(--tw-text-opacity, 1))}::selection{--tw-bg-opacity: 1;background-color:rgb(255 160 34 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(39 40 34 / var(--tw-text-opacity, 1))}.placeholder\:text-textMuted::-moz-placeholder{--tw-text-opacity: 1;color:rgb(207 207 207 / var(--tw-text-opacity, 1))}.placeholder\:text-textMuted::placeholder{--tw-text-opacity: 1;color:rgb(207 207 207 / var(--tw-text-opacity, 1))}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(255 160 34 / var(--tw-border-opacity, 1))}.hover\:border-accentSecondary:hover{--tw-border-opacity: 1;border-color:rgb(200 86 55 / var(--tw-border-opacity, 1))}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:text-accent:hover{--tw-text-opacity: 1;color:rgb(255 160 34 / var(--tw-text-opacity, 1))}.hover\:text-accentSecondary:hover{--tw-text-opacity: 1;color:rgb(200 86 55 / var(--tw-text-opacity, 1))}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(255 160 34 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-accent:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 160 34 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media (min-width: 768px){.md\:flex{display:flex}}@media (min-width: 1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}} + R"DELIM(:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}.visible{visibility:visible}.order-1{order:1}.order-2{order:2}.order-3{order:3}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.\!block{display:block!important}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-2{height:.5rem}.h-4{height:1rem}.h-full{height:100%}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:.5rem}.w-4{width:1rem}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.max-w-7xl{max-width:80rem}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * 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))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-accentSecondary\/30>:not([hidden])~:not([hidden]){border-color:#c856374d}.place-self-start{place-self:start}.overflow-hidden{overflow:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-accent{--tw-border-opacity: 1;border-color:rgb(255 160 34 / var(--tw-border-opacity, 1))}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/30{border-color:#c856374d}.border-amber-500\/50{border-color:#f59e0b80}.border-emerald-500\/50{border-color:#10b98180}.border-rose-500\/50{border-color:#f43f5e80}.border-slate-500\/50{border-color:#64748b80}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500\/20{background-color:#f59e0b33}.bg-background{--tw-bg-opacity: 1;background-color:rgb(39 40 34 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-current{background-color:currentColor}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/20{background-color:#10b98133}.bg-rose-400{--tw-bg-opacity: 1;background-color:rgb(251 113 133 / var(--tw-bg-opacity, 1))}.bg-rose-500\/20{background-color:#f43f5e33}.bg-slate-400{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity, 1))}.bg-slate-500\/20{background-color:#64748b33}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-transparent{background-color:transparent}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Mona)DELIM" + R"DELIM(co,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-accent{--tw-text-opacity: 1;color:rgb(255 160 34 / var(--tw-text-opacity, 1))}.text-accentSecondary{--tw-text-opacity: 1;color:rgb(200 86 55 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-rose-300{--tw-text-opacity: 1;color:rgb(253 164 175 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-textMuted{--tw-text-opacity: 1;color:rgb(207 207 207 / var(--tw-text-opacity, 1))}.text-textPrimary{--tw-text-opacity: 1;color:rgb(237 237 237 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 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)}.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)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{color-scheme:dark}body{--tw-bg-opacity: 1;background-color:rgb(39 40 34 / var(--tw-bg-opacity, 1));font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";--tw-text-opacity: 1;color:rgb(237 237 237 / var(--tw-text-opacity, 1))}::-moz-selection{--tw-bg-opacity: 1;background-color:rgb(255 160 34 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(39 40 34 / var(--tw-text-opacity, 1))}::selection{--tw-bg-opacity: 1;background-color:rgb(255 160 34 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(39 40 34 / var(--tw-text-opacity, 1))}.placeholder\:text-textMuted::-moz-placeholder{--tw-text-opacity: 1;color:rgb(207 207 207 / var(--tw-text-opacity, 1))}.placeholder\:text-textMuted::placeholder{--tw-text-opacity: 1;color:rgb(207 207 207 / var(--tw-text-opacity, 1))}.hover\:border-accent:hover{--tw-border-opacity: 1;border-color:rgb(255 160 34 / var(--tw-border-opacity, 1))}.hover\:border-accentSecondary:hover{--tw-border-opacity: 1;border-color:rgb(200 86 55 / var(--tw-border-opacity, 1))}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:text-accent:hover{--tw-text-opacity: 1;color:rgb(255 160 34 / var(--tw-text-opacity, 1))}.hover\:text-accentSecondary:hover{--tw-text-opacity: 1;color:rgb(200 86 55 / var(--tw-text-opacity, 1))}.focus\:border-accent:focus{--tw-border-opacity: 1;border-color:rgb(255 160 34 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-accent:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 160 34 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}@media (min-width: 640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media (min-width: 768px){.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:inline{display:inline}.md\:flex{display:flex}.md\:hidden{display:none}.md\:w-72{width:18rem}.md\:w-auto{width:auto}.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media (min-width: 1024px){.lg\:grid-co)DELIM" + R"DELIM(ls-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}} )DELIM" ) diff --git a/console/embedded/explore_ecma.cpp b/console/embedded/explore_ecma.cpp index f717871f..12e7e121 100644 --- a/console/embedded/explore_ecma.cpp +++ b/console/embedded/explore_ecma.cpp @@ -23,7 +23,7 @@ namespace server { // Simple test ecma script for embedded page. DEFINE_EMBEDDED_PAGE(explore_pages, char, ecma, - R"DELIM(var Xf=e=>{throw TypeError(e)};var uu=(e,t,n)=>t.has(e)||Xf("Cannot "+n);var _=(e,t,n)=>(uu(e,t,"read from private field"),n?n.call(e):t.get(e)),ne=(e,t,n)=>t.has(e)?Xf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),H=(e,t,n,r)=>(uu(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),fe=(e,t,n)=>(uu(e,t,"access private method"),n);var so=(e,t,n,r)=>({set _(i){H(e,t,i,n)},get _(){return _(e,t,r)}});function Rm(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var S0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jm={exports:{}},Ol={},Mm={exports:{}},de={};/** + R"DELIM(var Jf=e=>{throw TypeError(e)};var uu=(e,t,n)=>t.has(e)||Jf("Cannot "+n);var _=(e,t,n)=>(uu(e,t,"read from private field"),n?n.call(e):t.get(e)),ne=(e,t,n)=>t.has(e)?Jf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),H=(e,t,n,r)=>(uu(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),fe=(e,t,n)=>(uu(e,t,"access private method"),n);var so=(e,t,n,r)=>({set _(i){H(e,t,i,n)},get _(){return _(e,t,r)}});function jm(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var E0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mm={exports:{}},Ol={},Lm={exports:{}},de={};/** * @license React * react.production.min.js * @@ -31,8 +31,8 @@ DEFINE_EMBEDDED_PAGE(explore_pages, char, ecma, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ua=Symbol.for("react.element"),E0=Symbol.for("react.portal"),C0=Symbol.for("react.fragment"),T0=Symbol.for("react.strict_mode"),b0=Symbol.for("react.profiler"),P0=Symbol.for("react.provider"),N0=Symbol.for("react.context"),R0=Symbol.for("react.forward_ref"),j0=Symbol.for("react.suspense"),M0=Symbol.for("react.memo"),L0=Symbol.for("react.lazy"),Jf=Symbol.iterator;function O0(e){return e===null||typeof e!="object"?null:(e=Jf&&e[Jf]||e["@@iterator"],typeof e=="function"?e:null)}var Lm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Om=Object.assign,Dm={};function Cs(e,t,n){this.props=e,this.context=t,this.refs=Dm,this.updater=n||Lm}Cs.prototype.isReactComponent={};Cs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Cs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Am(){}Am.prototype=Cs.prototype;function wd(e,t,n){this.props=e,this.context=t,this.refs=Dm,this.updater=n||Lm}var kd=wd.prototype=new Am;kd.constructor=wd;Om(kd,Cs.prototype);kd.isPureReactComponent=!0;var eh=Array.isArray,Im=Object.prototype.hasOwnProperty,_d={current:null},$m={key:!0,ref:!0,__self:!0,__source:!0};function Fm(e,t,n){var r,i={},s=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)Im.call(t,r)&&!$m.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1>>1,re=b[ee];if(0>>1;eei(Te,I))Iei(Ve,Te)?(b[ee]=Ve,b[Ie]=I,ee=Ie):(b[ee]=Te,b[_e]=I,ee=_e);else if(Iei(Ve,I))b[ee]=Ve,b[Ie]=I,ee=Ie;else break e}}return D}function i(b,D){var I=b.sortIndex-D.sortIndex;return I!==0?I:b.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,c=null,f=3,m=!1,g=!1,x=!1,T=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(b){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=b)r(u),D.sortIndex=D.expirationTime,t(l,D);else break;D=n(u)}}function S(b){if(x=!1,y(b),!g)if(n(l)!==null)g=!0,$(R);else{var D=n(u);D!==null&&K(S,D.startTime-b)}}function R(b,D){g=!1,x&&(x=!1,v(j),j=-1),m=!0;var I=f;try{for(y(D),c=n(l);c!==null&&(!(c.expirationTime>D)||b&&!B());){var ee=c.callback;if(typeof ee=="function"){c.callback=null,f=c.priorityLevel;var re=ee(c.expirationTime<=D);D=e.unstable_now(),typeof re=="function"?c.callback=re:c===n(l)&&r(l),y(D)}else r(l);c=n(l)}if(c!==null)var ke=!0;else{var _e=n(u);_e!==null&&K(S,_e.startTime-D),ke=!1}return ke}finally{c=null,f=I,m=!1}}var L=!1,k=null,j=-1,W=5,N=-1;function B(){return!(e.unstable_now()-Nb||125ee?(b.sortIndex=I,t(u,b),n(l)===null&&b===n(u)&&(x?(v(j),j=-1):x=!0,K(S,I-ee))):(b.sortIndex=re,t(l,b),g||m||(g=!0,$(R))),b},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(b){var D=f;return function(){var I=f;f=D;try{return b.apply(this,arguments)}finally{f=I}}}})(Qm);Vm.exports=Qm;var W0=Vm.exports;/** + R"DELIM(unction r(b){if(b.length===0)return null;var D=b[0],I=b.pop();if(I!==D){b[0]=I;e:for(var ee=0,re=b.length,ke=re>>>1;eei(Te,I))Iei(Ve,Te)?(b[ee]=Ve,b[Ie]=I,ee=Ie):(b[ee]=Te,b[_e]=I,ee=_e);else if(Iei(Ve,I))b[ee]=Ve,b[Ie]=I,ee=Ie;else break e}}return D}function i(b,D){var I=b.sortIndex-D.sortIndex;return I!==0?I:b.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,c=null,f=3,m=!1,g=!1,x=!1,T=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(b){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=b)r(u),D.sortIndex=D.expirationTime,t(l,D);else break;D=n(u)}}function S(b){if(x=!1,y(b),!g)if(n(l)!==null)g=!0,$(R);else{var D=n(u);D!==null&&K(S,D.startTime-b)}}function R(b,D){g=!1,x&&(x=!1,v(j),j=-1),m=!0;var I=f;try{for(y(D),c=n(l);c!==null&&(!(c.expirationTime>D)||b&&!B());){var ee=c.callback;if(typeof ee=="function"){c.callback=null,f=c.priorityLevel;var re=ee(c.expirationTime<=D);D=e.unstable_now(),typeof re=="function"?c.callback=re:c===n(l)&&r(l),y(D)}else r(l);c=n(l)}if(c!==null)var ke=!0;else{var _e=n(u);_e!==null&&K(S,_e.startTime-D),ke=!1}return ke}finally{c=null,f=I,m=!1}}var L=!1,k=null,j=-1,W=5,P=-1;function B(){return!(e.unstable_now()-Pb||125ee?(b.sortIndex=I,t(u,b),n(l)===null&&b===n(u)&&(x?(v(j),j=-1):x=!0,K(S,I-ee))):(b.sortIndex=re,t(l,b),g||m||(g=!0,$(R))),b},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(b){var D=f;return function(){var I=f;f=D;try{return b.apply(this,arguments)}finally{f=I}}}})(Wm);Qm.exports=Wm;var Z0=Qm.exports;/** * @license React * react-dom.production.min.js * @@ -57,67 +57,67 @@ DEFINE_EMBEDDED_PAGE(explore_pages, char, ecma, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Z0=C,Dt=W0;function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=Object.prototype.hasOwnProperty,K0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,nh={},rh={};function G0(e){return Gu.call(rh,e)?!0:Gu.call(nh,e)?!1:K0.test(e)?rh[e]=!0:(nh[)DELIM" - R"DELIM(e]=!0,!1)}function q0(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Y0(e,t,n,r){if(t===null||typeof t>"u"||q0(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function kt(e,t,n,r,i,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new kt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new kt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new kt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new kt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ut[e]=new kt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new kt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new kt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new kt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new kt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ed=/[\-:]([a-z])/g;function Cd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ed,Cd);ut[t]=new kt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ed,Cd);ut[t]=new kt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ed,Cd);ut[t]=new kt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new kt(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new kt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Td(e,t,n,r){var i=ut.hasOwnProperty(t)?ut[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qu=Object.prototype.hasOwnProperty,G0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,rh={},ih={};function q0(e){return qu.call(ih,e)?!0:qu.call(rh,e)?!1:G0.test(e)?ih[e]=!0:(rh[)DELIM" + R"DELIM(e]=!0,!1)}function Y0(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function X0(e,t,n,r){if(t===null||typeof t>"u"||Y0(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function kt(e,t,n,r,i,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new kt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new kt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new kt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new kt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ut[e]=new kt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new kt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new kt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new kt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new kt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Cd=/[\-:]([a-z])/g;function Td(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Cd,Td);ut[t]=new kt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Cd,Td);ut[t]=new kt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Cd,Td);ut[t]=new kt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new kt(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new kt(e,1,!1,e.toLowerCase(),null,!0,!0)});function bd(e,t,n,r){var i=ut.hasOwnProperty(t)?ut[t]:null;(i!==null?i.type!==0:r||!(2o||i[a]!==s[o]){var l=` -`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{fu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Zs(e):""}function X0(e){switch(e.tag){case 5:return Zs(e.type);case 16:return Zs("Lazy");case 13:return Zs("Suspense");case 19:return Zs("SuspenseList");case 0:case 2:case 15:return e=hu(e.type,!1),e;case 11:return e=hu(e.type.render,!1),e;case 1:return e=hu(e.type,!0),e;default:return""}}function Ju(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ai:return"Fragment";case Di:return"Portal";case qu:return"Profiler";case bd:return"StrictMode";case Yu:return"Suspense";case Xu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Km:return(e.displayName||"Context")+".Consumer";case Zm:return(e._context.displayName||"Context")+".Provider";case Pd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nd:return t=e.displayName||null,t!==null?t:Ju(e.type)||"Memo";case or:t=e._payload,e=e._init;try{return Ju(e(t))}catch{}}return null}function J0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ju(t);case 8:return t===bd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Dr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ex(e){var t=qm(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lo(e){e._valueTracker||(e._valueTracker=ex(e))}function Ym(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function qo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ec(e,t){var n=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function sh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Dr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xm(e,t){t=t.checked,t!=null&&Td(e,"checked",t,!1)}function tc(e,t){Xm(e,t);var n=Dr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?nc(e,t.type,n):t.hasOwnProperty("defaultValue")&&nc(e,t.type,Dr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ah(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperStat)DELIM" -R"DELIM(e.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function nc(e,t,n){(t!=="number"||qo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ks=Array.isArray;function Zi(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=uo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ta={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tx=["Webkit","ms","Moz","O"];Object.keys(ta).forEach(function(e){tx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ta[t]=ta[e]})});function nv(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ta.hasOwnProperty(e)&&ta[e]?(""+t).trim():t+"px"}function rv(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=nv(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var nx=Ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sc(e,t){if(t){if(nx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function ac(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var oc=null;function Rd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var lc=null,Ki=null,Gi=null;function uh(e){if(e=Qa(e)){if(typeof lc!="function")throw Error(O(280));var t=e.stateNode;t&&(t=Fl(t),lc(e.stateNode,e.type,t))}}function iv(e){Ki?Gi?Gi.push(e):Gi=[e]:Ki=e}function sv(){if(Ki){var e=Ki,t=Gi;if(Gi=Ki=null,uh(e),t)for(e=0;e>>=0,e===0?32:31-(hx(e)/px|0)|0}var co=64,fo=4194304;function Gs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function el(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Gs(o):(s&=a,s!==0&&(r=Gs(s)))}else a=n&~i,a!==0?r=Gs(a):s!==0&&(r=Gs(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ha(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-cn(t),e[t]=n}function gx(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ra),gh=" ",xh=!1;function Cv(e,t){switch(e){case"keyup":return Wx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ii=!1;function Kx(e,t){switch(e){case"compositionend":return Tv(t);case"keypress":return t.which!==32?null:(xh=!0,gh);case"textInput":return e=t.data,e===gh&&xh?null:e;default:return null}}function Gx(e,t){if(Ii)return e==="compositionend"||!$d&&Cv(e,t)?(e=Sv(),Ao=Dd=wr=null,Ii=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&)DELIM" -R"DELIM(&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Sh(n)}}function Rv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jv(){for(var e=window,t=qo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=qo(e.document)}return t}function Fd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function i1(e){var t=jv(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Rv(n.ownerDocument.documentElement,n)){if(r!==null&&Fd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Eh(n,s);var a=Eh(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,$i=null,pc=null,sa=null,mc=!1;function Ch(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mc||$i==null||$i!==qo(r)||(r=$i,"selectionStart"in r&&Fd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),sa&&ga(sa,r)||(sa=r,r=rl(pc,"onSelect"),0Bi||(e.current=kc[Bi],kc[Bi]=null,Bi--)}function Ne(e,t){Bi++,kc[Bi]=e.current,e.current=t}var Ar={},pt=zr(Ar),Pt=zr(!1),yi=Ar;function hs(e,t){var n=e.type.contextTypes;if(!n)return Ar;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Nt(e){return e=e.childContextTypes,e!=null}function sl(){je(Pt),je(pt)}function Mh(e,t,n){if(pt.current!==Ar)throw Error(O(168));Ne(pt,t),Ne(Pt,n)}function zv(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(O(108,J0(e)||"Unknown",i));return Ae({},n,r)}function al(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ar,yi=pt.current,Ne(pt,e),Ne(Pt,Pt.current),!0}function Lh(e,t,n){var r=e.stateNode;if(!r)throw Error(O(169));n?(e=zv(e,t,yi),r.__reactInternalMemoizedMergedChildContext=e,je(Pt),je(pt),Ne(pt,e)):je(Pt),Ne(Pt,n)}var An=null,zl=!1,bu=!1;function Bv(e){An===null?An=[e]:An.push(e)}function v1(e){zl=!0,Bv(e)}function Br(){if(!bu&&An!==null){bu=!0;var e=0,t=Ce;try{var n=An;for(Ce=1;e>=a,i-=a,Fn=1<<32-cn(t)+i|n<j?(W=k,k=null):W=k.sibling;var N=f(v,k,y[j],S);if(N===null){k===null&&(k=W);break}e&&k&&N.alternate===null&&t(v,k),p=s(N,p,j),L===null?R=N:L.sibling=N,L=N,k=W}if(j===y.length)return n(v,k),Le&&Gr(v,j),R;if(k===null){for(;jj?(W=k,k=null):W=k.sibling;var B=f(v,k,N.value,S);if(B===null){k===null&&(k=W);break}e&&k&&B.alternate===null&&t(v,k),p=s(B,p,j),L===null?R=B:L.sibling=B,L=B,k=W}if(N.done)return n(v,k),Le&&Gr(v,j),R;if(k===null){for(;!N.done;j++,N=y.next())N=c(v,N.value,S),N!==null&&(p=s(N,p,j),L===null?R=N:L.sibling=N,L=N);return Le&&Gr(v,j),R}for(k=r(v,k);!N.done;j++,N=y.next())N=m(k,v,j,N.value,S),N!==null&&(e&&N.alternate!==null&&k.delete(N.key===null?j:N.key),p=s(N,p,j),L===null?R=N:L.sibling=N,L=N);return e&&k.forEach(function(ue){return t(v,ue)}),Le&&Gr(v,j),R}function T(v,p,y,S){if(typeof y=="object"&&y!==null&&y.type===Ai&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case oo:e:{for(var R=y.key,L=p;L!==null;){if(L.key===R){if(R=y.type,R===Ai){if(L.tag===7){n(v,L.sibling),p=i(L,y.props.children),p.return=v,v=p;break e}}else if(L.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===or&&Ah(R)===L.type){n(v,L.sibling),p=i(L,y.props),p.ref=$s(v,L,y),p.return=v,v=p;break e}n(v,L);break}else t(v,L);L=L.sibling}y.type===Ai?(p=pi(y.props.children,v.mode,S,y.key),p.return=v,v=p):(S=Vo(y.type,y.key,y.props,null,v.mode,S),S.ref=$s(v,p,y),S.return=v,v=S)}return a(v);case Di:e:{for(L=y.key;p!==null;){if(p.key===L)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){n(v,p.sibling),p=i(p,y.children||[]),p.return=v,v=p;break e}else{n(v,p);break}else t(v,p);p=p.sibling}p=Du(y,v.mode,S),p.return=v,v=p}return a(v);case or:return L=y._init,T(v,p,L(y._payload),S)}if(Ks(y))return g(v,p,y,S);if(Ls(y))return x(v,p,y,S);xo(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(n(v,p.sibling),p=i(p,y),p.return=v,v=p):(n(v,p),p=Ou(y,v.mode,S),p.return=v,v=p),a(v)):n(v,p)}return T}var ms=Qv(!0),Wv=Qv(!1),ul=zr(null),cl=null,Vi=null,Hd=null;function Vd(){Hd=Vi=cl=null}function Qd(e){var t=ul.current;je(ul),e._currentValu)DELIM" -R"DELIM(e=t}function Ec(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Yi(e,t){cl=e,Hd=Vi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(bt=!0),e.firstContext=null)}function qt(e){var t=e._currentValue;if(Hd!==e)if(e={context:e,memoizedValue:t,next:null},Vi===null){if(cl===null)throw Error(O(308));Vi=e,cl.dependencies={lanes:0,firstContext:e}}else Vi=Vi.next=e;return t}var ei=null;function Wd(e){ei===null?ei=[e]:ei.push(e)}function Zv(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Wd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Qn(e,r)}function Qn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var lr=!1;function Zd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ve&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Qn(e,n)}return i=r.interleaved,i===null?(t.next=t,Wd(r)):(t.next=i.next,i.next=t),r.interleaved=t,Qn(e,n)}function $o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Md(e,n)}}function Ih(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function dl(e,t,n,r){var i=e.updateQueue;lr=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?s=u:a.next=u,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(s!==null){var c=i.baseState;a=0,d=u=l=null,o=s;do{var f=o.lane,m=o.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=e,x=o;switch(f=t,m=n,x.tag){case 1:if(g=x.payload,typeof g=="function"){c=g.call(m,c,f);break e}c=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=x.payload,f=typeof g=="function"?g.call(m,c,f):g,f==null)break e;c=Ae({},c,f);break e;case 2:lr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=m,l=c):d=d.next=m,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);wi|=a,e.lanes=a,e.memoizedState=c}}function $h(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Nu.transition;Nu.transition={};try{e(!1),t()}finally{Ce=n,Nu.transition=r}}function dy(){return Yt().)DELIM" -R"DELIM(memoizedState}function w1(e,t,n){var r=Rr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fy(e))hy(t,n);else if(n=Zv(e,t,n,r),n!==null){var i=xt();dn(n,e,r,i),py(n,t,r)}}function k1(e,t,n){var r=Rr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fy(e))hy(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,fn(o,a)){var l=t.interleaved;l===null?(i.next=i,Wd(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Zv(e,t,i,r),n!==null&&(i=xt(),dn(n,e,r,i),py(n,t,r))}}function fy(e){var t=e.alternate;return e===De||t!==null&&t===De}function hy(e,t){aa=hl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function py(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Md(e,n)}}var pl={readContext:qt,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},_1={readContext:qt,useCallback:function(e,t){return gn().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:zh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zo(4194308,4,ay.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return zo(4,2,e,t)},useMemo:function(e,t){var n=gn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=gn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=w1.bind(null,De,e),[r.memoizedState,e]},useRef:function(e){var t=gn();return e={current:e},t.memoizedState=e},useState:Fh,useDebugValue:tf,useDeferredValue:function(e){return gn().memoizedState=e},useTransition:function(){var e=Fh(!1),t=e[0];return e=x1.bind(null,e[1]),gn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=De,i=gn();if(Le){if(n===void 0)throw Error(O(407));n=n()}else{if(n=t(),nt===null)throw Error(O(349));xi&30||Xv(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,zh(ey.bind(null,r,s,e),[e]),r.flags|=2048,Ta(9,Jv.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=gn(),t=nt.identifierPrefix;if(Le){var n=zn,r=Fn;n=(r&~(1<<32-cn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ea++,0")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{fu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Zs(e):""}function J0(e){switch(e.tag){case 5:return Zs(e.type);case 16:return Zs("Lazy");case 13:return Zs("Suspense");case 19:return Zs("SuspenseList");case 0:case 2:case 15:return e=hu(e.type,!1),e;case 11:return e=hu(e.type.render,!1),e;case 1:return e=hu(e.type,!0),e;default:return""}}function ec(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ai:return"Fragment";case Di:return"Portal";case Yu:return"Profiler";case Nd:return"StrictMode";case Xu:return"Suspense";case Ju:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Gm:return(e.displayName||"Context")+".Consumer";case Km:return(e._context.displayName||"Context")+".Provider";case Pd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rd:return t=e.displayName||null,t!==null?t:ec(e.type)||"Memo";case or:t=e._payload,e=e._init;try{return ec(e(t))}catch{}}return null}function ex(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ec(t);case 8:return t===Nd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Dr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ym(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function tx(e){var t=Ym(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lo(e){e._valueTracker||(e._valueTracker=tx(e))}function Xm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ym(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function qo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tc(e,t){var n=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ah(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Dr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Jm(e,t){t=t.checked,t!=null&&bd(e,"checked",t,!1)}function nc(e,t){Jm(e,t);var n=Dr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?rc(e,t.type,n):t.hasOwnProperty("defaultValue")&&rc(e,t.type,Dr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function oh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperStat)DELIM" +R"DELIM(e.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function rc(e,t,n){(t!=="number"||qo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ks=Array.isArray;function Zi(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=uo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ta={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nx=["Webkit","ms","Moz","O"];Object.keys(ta).forEach(function(e){nx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ta[t]=ta[e]})});function rv(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ta.hasOwnProperty(e)&&ta[e]?(""+t).trim():t+"px"}function iv(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=rv(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var rx=Ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ac(e,t){if(t){if(rx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function oc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lc=null;function jd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var uc=null,Ki=null,Gi=null;function ch(e){if(e=Qa(e)){if(typeof uc!="function")throw Error(O(280));var t=e.stateNode;t&&(t=Fl(t),uc(e.stateNode,e.type,t))}}function sv(e){Ki?Gi?Gi.push(e):Gi=[e]:Ki=e}function av(){if(Ki){var e=Ki,t=Gi;if(Gi=Ki=null,ch(e),t)for(e=0;e>>=0,e===0?32:31-(px(e)/mx|0)|0}var co=64,fo=4194304;function Gs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function el(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Gs(o):(s&=a,s!==0&&(r=Gs(s)))}else a=n&~i,a!==0?r=Gs(a):s!==0&&(r=Gs(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ha(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-cn(t),e[t]=n}function xx(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ra),xh=" ",wh=!1;function Tv(e,t){switch(e){case"keyup":return Zx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ii=!1;function Gx(e,t){switch(e){case"compositionend":return bv(t);case"keypress":return t.which!==32?null:(wh=!0,xh);case"textInput":return e=t.data,e===xh&&wh?null:e;default:return null}}function qx(e,t){if(Ii)return e==="compositionend"||!Fd&&Tv(e,t)?(e=Ev(),Ao=Ad=wr=null,Ii=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&)DELIM" +R"DELIM(&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Eh(n)}}function jv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mv(){for(var e=window,t=qo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=qo(e.document)}return t}function zd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function s1(e){var t=Mv(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&jv(n.ownerDocument.documentElement,n)){if(r!==null&&zd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Ch(n,s);var a=Ch(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,$i=null,mc=null,sa=null,vc=!1;function Th(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vc||$i==null||$i!==qo(r)||(r=$i,"selectionStart"in r&&zd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),sa&&ga(sa,r)||(sa=r,r=rl(mc,"onSelect"),0Bi||(e.current=_c[Bi],_c[Bi]=null,Bi--)}function Pe(e,t){Bi++,_c[Bi]=e.current,e.current=t}var Ar={},pt=zr(Ar),Nt=zr(!1),yi=Ar;function hs(e,t){var n=e.type.contextTypes;if(!n)return Ar;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Pt(e){return e=e.childContextTypes,e!=null}function sl(){je(Nt),je(pt)}function Lh(e,t,n){if(pt.current!==Ar)throw Error(O(168));Pe(pt,t),Pe(Nt,n)}function Bv(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(O(108,ex(e)||"Unknown",i));return Ae({},n,r)}function al(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ar,yi=pt.current,Pe(pt,e),Pe(Nt,Nt.current),!0}function Oh(e,t,n){var r=e.stateNode;if(!r)throw Error(O(169));n?(e=Bv(e,t,yi),r.__reactInternalMemoizedMergedChildContext=e,je(Nt),je(pt),Pe(pt,e)):je(Nt),Pe(Nt,n)}var An=null,zl=!1,bu=!1;function Uv(e){An===null?An=[e]:An.push(e)}function y1(e){zl=!0,Uv(e)}function Br(){if(!bu&&An!==null){bu=!0;var e=0,t=Ce;try{var n=An;for(Ce=1;e>=a,i-=a,Fn=1<<32-cn(t)+i|n<j?(W=k,k=null):W=k.sibling;var P=f(v,k,y[j],S);if(P===null){k===null&&(k=W);break}e&&k&&P.alternate===null&&t(v,k),p=s(P,p,j),L===null?R=P:L.sibling=P,L=P,k=W}if(j===y.length)return n(v,k),Le&&Gr(v,j),R;if(k===null){for(;jj?(W=k,k=null):W=k.sibling;var B=f(v,k,P.value,S);if(B===null){k===null&&(k=W);break}e&&k&&B.alternate===null&&t(v,k),p=s(B,p,j),L===null?R=B:L.sibling=B,L=B,k=W}if(P.done)return n(v,k),Le&&Gr(v,j),R;if(k===null){for(;!P.done;j++,P=y.next())P=c(v,P.value,S),P!==null&&(p=s(P,p,j),L===null?R=P:L.sibling=P,L=P);return Le&&Gr(v,j),R}for(k=r(v,k);!P.done;j++,P=y.next())P=m(k,v,j,P.value,S),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?j:P.key),p=s(P,p,j),L===null?R=P:L.sibling=P,L=P);return e&&k.forEach(function(ue){return t(v,ue)}),Le&&Gr(v,j),R}function T(v,p,y,S){if(typeof y=="object"&&y!==null&&y.type===Ai&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case oo:e:{for(var R=y.key,L=p;L!==null;){if(L.key===R){if(R=y.type,R===Ai){if(L.tag===7){n(v,L.sibling),p=i(L,y.props.children),p.return=v,v=p;break e}}else if(L.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===or&&Ih(R)===L.type){n(v,L.sibling),p=i(L,y.props),p.ref=$s(v,L,y),p.return=v,v=p;break e}n(v,L);break}else t(v,L);L=L.sibling}y.type===Ai?(p=pi(y.props.children,v.mode,S,y.key),p.return=v,v=p):(S=Vo(y.type,y.key,y.props,null,v.mode,S),S.ref=$s(v,p,y),S.return=v,v=S)}return a(v);case Di:e:{for(L=y.key;p!==null;){if(p.key===L)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){n(v,p.sibling),p=i(p,y.children||[]),p.return=v,v=p;break e}else{n(v,p);break}else t(v,p);p=p.sibling}p=Du(y,v.mode,S),p.return=v,v=p}return a(v);case or:return L=y._init,T(v,p,L(y._payload),S)}if(Ks(y))return g(v,p,y,S);if(Ls(y))return x(v,p,y,S);xo(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(n(v,p.sibling),p=i(p,y),p.return=v,v=p):(n(v,p),p=Ou(y,v.mode,S),p.return=v,v=p),a(v)):n(v,p)}return T}var ms=Wv(!0),Zv=Wv(!1),ul=zr(null),cl=null,Vi=null,Vd=null;function Qd(){Vd=Vi=cl=null}function Wd(e){var t=ul.current;je(ul),e._currentValu)DELIM" +R"DELIM(e=t}function Cc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Yi(e,t){cl=e,Vd=Vi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(bt=!0),e.firstContext=null)}function qt(e){var t=e._currentValue;if(Vd!==e)if(e={context:e,memoizedValue:t,next:null},Vi===null){if(cl===null)throw Error(O(308));Vi=e,cl.dependencies={lanes:0,firstContext:e}}else Vi=Vi.next=e;return t}var ei=null;function Zd(e){ei===null?ei=[e]:ei.push(e)}function Kv(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Zd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Qn(e,r)}function Qn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var lr=!1;function Kd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Nr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ve&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Qn(e,n)}return i=r.interleaved,i===null?(t.next=t,Zd(r)):(t.next=i.next,i.next=t),r.interleaved=t,Qn(e,n)}function $o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ld(e,n)}}function $h(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function dl(e,t,n,r){var i=e.updateQueue;lr=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?s=u:a.next=u,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(s!==null){var c=i.baseState;a=0,d=u=l=null,o=s;do{var f=o.lane,m=o.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=e,x=o;switch(f=t,m=n,x.tag){case 1:if(g=x.payload,typeof g=="function"){c=g.call(m,c,f);break e}c=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=x.payload,f=typeof g=="function"?g.call(m,c,f):g,f==null)break e;c=Ae({},c,f);break e;case 2:lr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=m,l=c):d=d.next=m,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);wi|=a,e.lanes=a,e.memoizedState=c}}function Fh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Pu.transition;Pu.transition={};try{e(!1),t()}finally{Ce=n,Pu.transition=r}}function fy(){return Yt().)DELIM" +R"DELIM(memoizedState}function k1(e,t,n){var r=Rr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hy(e))py(t,n);else if(n=Kv(e,t,n,r),n!==null){var i=xt();dn(n,e,r,i),my(n,t,r)}}function _1(e,t,n){var r=Rr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hy(e))py(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,fn(o,a)){var l=t.interleaved;l===null?(i.next=i,Zd(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Kv(e,t,i,r),n!==null&&(i=xt(),dn(n,e,r,i),my(n,t,r))}}function hy(e){var t=e.alternate;return e===De||t!==null&&t===De}function py(e,t){aa=hl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function my(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ld(e,n)}}var pl={readContext:qt,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},S1={readContext:qt,useCallback:function(e,t){return gn().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:Bh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zo(4194308,4,oy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return zo(4,2,e,t)},useMemo:function(e,t){var n=gn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=gn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=k1.bind(null,De,e),[r.memoizedState,e]},useRef:function(e){var t=gn();return e={current:e},t.memoizedState=e},useState:zh,useDebugValue:nf,useDeferredValue:function(e){return gn().memoizedState=e},useTransition:function(){var e=zh(!1),t=e[0];return e=w1.bind(null,e[1]),gn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=De,i=gn();if(Le){if(n===void 0)throw Error(O(407));n=n()}else{if(n=t(),nt===null)throw Error(O(349));xi&30||Jv(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Bh(ty.bind(null,r,s,e),[e]),r.flags|=2048,Ta(9,ey.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=gn(),t=nt.identifierPrefix;if(Le){var n=zn,r=Fn;n=(r&~(1<<32-cn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ea++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[_n]=t,e[ka]=r,Ey(e,t,!1,!1),t.stateNode=e;e:{switch(a=ac(n,r),n){case"dialog":Re("cancel",e),Re("close",e),i=r;break;case"iframe":case"object":case"embed":Re("load",e),i=r;break;case"video":case"audio":for(i=0;igs&&(t.flags|=128,r=!0,Fs(s,!1),t.lanes=4194304)}else{if(!r)if(e=fl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Le)return ft(t),null}else 2*He()-s.renderingStartTime>gs&&n!==1073741824&&(t.flags|=128,r=!0,Fs(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=He(),t.sibling=null,n=Oe.current,Ne(Oe,r?n&1|2:n&1),t):(ft(t),null);case 22:case 23:return lf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?jt&1073741824&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function R1(e,t){switch(Bd(t),t.tag){case 1:return Nt(t.type)&&sl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vs(),je(Pt),je(pt),qd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gd(t),null;case 13:if(je(Oe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));ps()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Oe),null;case 4:return vs(),null;case 10:return Qd(t.type._context),null;case 22:case 23:return lf(),null;case 24:return null;default:return null}}var ko=!1,ht=!1,j1=typeof WeakSet=="function"?WeakSet:Set,V=null;function Qi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Be(e,t,r)}else n.current=null}function Lc(e,t,n){try{n()}catch(r){Be(e,t,r)}}var Yh=!1;function M1(e,t){if(vc=tl,e=jv(),Fd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var m;c!==n||i!==0&&c.nodeType!==3||(o=a+i),c!==s||r!==0&&c.nodeType!==3||(l=a+r),c.nodeType===3&&(a+=c.nodeValue.length),(m=c.firstChild)!==null;)f=c,c=m;for(;;){if(c===e)break t;if(f===n&&++u===i&&(o=a),f===s&&++d===r&&(l=a),(m=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=m}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(yc={focusedElem:e,selectionRange:n},tl=!1,V=t;V!==null;)if(t=V,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var x=g.memoizedProps,T=g.memoizedState,v=t.stateNode,p=v.getSnapshotBeforeUpdate(t.elementType===t.type?x:nn(t.type,x),T);v.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChil)DELIM" -R"DELIM(d(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(S){Be(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return g=Yh,Yh=!1,g}function oa(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Lc(t,n,s)}i=i.next}while(i!==r)}}function Hl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Oc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function by(e){var t=e.alternate;t!==null&&(e.alternate=null,by(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_n],delete t[ka],delete t[wc],delete t[p1],delete t[m1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Py(e){return e.tag===5||e.tag===3||e.tag===4}function Xh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Py(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Dc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=il));else if(r!==4&&(e=e.child,e!==null))for(Dc(e,t,n),e=e.sibling;e!==null;)Dc(e,t,n),e=e.sibling}function Ac(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ac(e,t,n),e=e.sibling;e!==null;)Ac(e,t,n),e=e.sibling}var st=null,an=!1;function er(e,t,n){for(n=n.child;n!==null;)Ny(e,t,n),n=n.sibling}function Ny(e,t,n){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(Dl,n)}catch{}switch(n.tag){case 5:ht||Qi(n,t);case 6:var r=st,i=an;st=null,er(e,t,n),st=r,an=i,st!==null&&(an?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(an?(e=st,n=n.stateNode,e.nodeType===8?Tu(e.parentNode,n):e.nodeType===1&&Tu(e,n),va(e)):Tu(st,n.stateNode));break;case 4:r=st,i=an,st=n.stateNode.containerInfo,an=!0,er(e,t,n),st=r,an=i;break;case 0:case 11:case 14:case 15:if(!ht&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&Lc(n,t,a),i=i.next}while(i!==r)}er(e,t,n);break;case 1:if(!ht&&(Qi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Be(n,t,o)}er(e,t,n);break;case 21:er(e,t,n);break;case 22:n.mode&1?(ht=(r=ht)||n.memoizedState!==null,er(e,t,n),ht=r):er(e,t,n);break;default:er(e,t,n)}}function Jh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new j1),t.forEach(function(r){var i=B1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function en(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~s}if(r=i,r=He()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*O1(r/1960))-r,10e?16:e,kr===null)var r=!1;else{if(e=kr,kr=null,yl=0,ve&6)throw Error(O(331));var i=ve;for(ve|=4,V=e.current;V!==null;){var s=V,a=s.child;if(V.flags&16){var o=s.deletions;if(o!==null){for(var l=0;lHe()-af?hi(e,0):sf|=n),Rt(e,t)}function Iy(e,t){t===0&&(e.mode&1?(t=fo,fo<<=1,!(fo&130023424)&&(fo=4194304)):t=1);var n=xt();e=Qn(e,t),e!==null&&(Ha(e,t,n),Rt(e,n))}function z1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Iy(e,n)}function B1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(O(314))}r!==null&&r.delete(t),Iy(e,n)}var $y;$y=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)bt=!0;e)DELIM" -R"DELIM(lse{if(!(e.lanes&n)&&!(t.flags&128))return bt=!1,P1(e,t,n);bt=!!(e.flags&131072)}else bt=!1,Le&&t.flags&1048576&&Uv(t,ll,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Bo(e,t),e=t.pendingProps;var i=hs(t,pt.current);Yi(t,n),i=Xd(null,t,r,e,i,n);var s=Jd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Nt(r)?(s=!0,al(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Zd(t),i.updater=Ul,t.stateNode=i,i._reactInternals=t,Tc(t,r,e,n),t=Nc(null,t,r,!0,s,n)):(t.tag=0,Le&&s&&zd(t),yt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Bo(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=H1(r),e=nn(r,e),i){case 0:t=Pc(null,t,r,e,n);break e;case 1:t=Kh(null,t,r,e,n);break e;case 11:t=Wh(null,t,r,e,n);break e;case 14:t=Zh(null,t,r,nn(r.type,e),n);break e}throw Error(O(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nn(r,i),Pc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nn(r,i),Kh(e,t,r,i,n);case 3:e:{if(ky(t),e===null)throw Error(O(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Kv(e,t),dl(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=ys(Error(O(423)),t),t=Gh(e,t,r,n,i);break e}else if(r!==i){i=ys(Error(O(424)),t),t=Gh(e,t,r,n,i);break e}else for(Lt=br(t.stateNode.containerInfo.firstChild),Ot=t,Le=!0,ln=null,n=Wv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ps(),r===i){t=Wn(e,t,n);break e}yt(e,t,r,n)}t=t.child}return t;case 5:return Gv(t),e===null&&Sc(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,gc(r,i)?a=null:s!==null&&gc(r,s)&&(t.flags|=32),wy(e,t),yt(e,t,a,n),t.child;case 6:return e===null&&Sc(t),null;case 13:return _y(e,t,n);case 4:return Kd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ms(t,null,r,n):yt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nn(r,i),Wh(e,t,r,i,n);case 7:return yt(e,t,t.pendingProps,n),t.child;case 8:return yt(e,t,t.pendingProps.children,n),t.child;case 12:return yt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,Ne(ul,r._currentValue),r._currentValue=a,s!==null)if(fn(s.value,a)){if(s.children===i.children&&!Pt.current){t=Wn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Bn(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ec(s.return,n,t),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(O(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Ec(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}yt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Yi(t,n),i=qt(i),r=r(i),t.flags|=1,yt(e,t,r,n),t.child;case 14:return r=t.type,i=nn(r,t.pendingProps),i=nn(r.type,i),Zh(e,t,r,i,n);case 15:return gy(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nn(r,i),Bo(e,t),t.tag=1,Nt(r)?(e=!0,al(t)):e=!1,Yi(t,n),my(t,r,i),Tc(t,r,i,n),Nc(null,t,r,!0,e,n);case 19:return Sy(e,t,n);case 22:return xy(e,t,n)}throw Error(O(156,t.tag))};function Fy(e,t){return fv(e,t)}function U1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(e,t,n,r){return new U1(e,t,n,r)}function cf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function H1(e){if(typeof e=="function")return cf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pd)return 11;if(e===Nd)return 14}return 2}function jr(e,t){var n=e.alternate;return n===null?(n=Kt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.ind)DELIM" -R"DELIM(ex,n.ref=e.ref,n}function Vo(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")cf(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ai:return pi(n.children,i,s,t);case bd:a=8,i|=8;break;case qu:return e=Kt(12,n,t,i|2),e.elementType=qu,e.lanes=s,e;case Yu:return e=Kt(13,n,t,i),e.elementType=Yu,e.lanes=s,e;case Xu:return e=Kt(19,n,t,i),e.elementType=Xu,e.lanes=s,e;case Gm:return Ql(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zm:a=10;break e;case Km:a=9;break e;case Pd:a=11;break e;case Nd:a=14;break e;case or:a=16,r=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=Kt(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function pi(e,t,n,r){return e=Kt(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kt(22,e,r,t),e.elementType=Gm,e.lanes=n,e.stateNode={isHidden:!1},e}function Ou(e,t,n){return e=Kt(6,e,null,t),e.lanes=n,e}function Du(e,t,n){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function V1(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mu(0),this.expirationTimes=mu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function df(e,t,n,r,i,s,a,o,l){return e=new V1(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Kt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zd(s),e}function Q1(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hy)}catch(e){console.error(e)}}Hy(),Hm.exports=It;var mf=Hm.exports;const q1=Ll(mf),Y1=Rm({__proto__:null,default:q1},[mf]);var op=mf;Ku.createRoot=op.createRoot,Ku.hydrateRoot=op.hydrateRoot;var Za=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},X1={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fr,xd,xm,J1=(xm=class{constructor(){ne(this,fr,X1);ne(this,xd,!1)}setTimeoutProvider(e){H(this,fr,e)}setTimeout(e,t){return _(this,fr).setTimeout(e,t)}clearTimeout(e){_(this,fr).clearTimeout(e)}setInterval(e,t){return _(this,fr).setInterval(e,t)}clearInterval(e){_(this,fr).clearInterval(e)}},fr=new WeakMap,xd=new WeakMap,xm),ni=new J1;function ew(e){setTimeout(e,0)}var _i=typeof window>"u"||"Deno"in globalThis;function Et(){}function tw(e,t){return typeof e=="function"?e(t):e}function Bc(e){return typeof e=="number"&&e>=0&&e!==1/0}function Vy(e,t){return Math.max(e+(t||0)-Date.no)DELIM" -R"DELIM(w(),0)}function Mr(e,t){return typeof e=="function"?e(t):e}function Vt(e,t){return typeof e=="function"?e(t):e}function lp(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==vf(a,t.options))return!1}else if(!Na(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||s&&!s(t))}function up(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Pa(t.options.mutationKey)!==Pa(s))return!1}else if(!Na(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function vf(e,t){return((t==null?void 0:t.queryKeyHashFn)||Pa)(e)}function Pa(e){return JSON.stringify(e,(t,n)=>Hc(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Na(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Na(e[n],t[n])):!1}var nw=Object.prototype.hasOwnProperty;function Qy(e,t){if(e===t)return e;const n=cp(e)&&cp(t);if(!n&&!(Hc(e)&&Hc(t)))return t;const i=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),a=s.length,o=n?new Array(a):{};let l=0;for(let u=0;u{ni.setTimeout(t,e)})}function Vc(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Qy(e,t):t}function iw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function sw(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var yf=Symbol();function Wy(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===yf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function aw(e,t){return typeof e=="function"?e(...t):!!e}var ii,hr,es,wm,ow=(wm=class extends Za{constructor(){super();ne(this,ii);ne(this,hr);ne(this,es);H(this,es,t=>{if(!_i&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,hr)||this.setEventListener(_(this,es))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,hr))==null||t.call(this),H(this,hr,void 0))}setEventListener(t){var n;H(this,es,t),(n=_(this,hr))==null||n.call(this),H(this,hr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,ii)!==t&&(H(this,ii,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,ii)=="boolean"?_(this,ii):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ii=new WeakMap,hr=new WeakMap,es=new WeakMap,wm),gf=new ow;function Qc(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var lw=ew;function uw(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=lw;const s=o=>{t?e.push(o):i(()=>{n(o)})},a=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var ot=uw(),ts,pr,ns,km,cw=(km=class extends Za{constructor(){super();ne(this,ts,!0);ne(this,pr);ne(this,ns);H(this,ns,t=>{if(!_i&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,pr)||this.setEventListener(_(this,ns))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,pr))==null||t.call(this),H(this,pr,void 0))}setEventListener(t){var n;H(this,ns,t),(n=_(this,pr))==null||n.call(this),H(this,pr,t(this.setOnline.bind(this)))}setOnline(t){_(this,ts)!==t&&(H(this,ts,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,ts)}},ts=new WeakMap,pr=new WeakMap,ns=new WeakMap,km),wl=new cw;function dw(e){return Math.min(1e3*2**e,3e4)}function Zy(e){return(e??"online")==="online"?wl.)DELIM" -R"DELIM(isOnline():!0}var Wc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ky(e){let t=!1,n=0,r;const i=Qc(),s=()=>i.status!=="pending",a=x=>{var T;if(!s()){const v=new Wc(x);f(v),(T=e.onCancel)==null||T.call(e,v)}},o=()=>{t=!0},l=()=>{t=!1},u=()=>gf.isFocused()&&(e.networkMode==="always"||wl.isOnline())&&e.canRun(),d=()=>Zy(e.networkMode)&&e.canRun(),c=x=>{s()||(r==null||r(),i.resolve(x))},f=x=>{s()||(r==null||r(),i.reject(x))},m=()=>new Promise(x=>{var T;r=v=>{(s()||u())&&x(v)},(T=e.onPause)==null||T.call(e)}).then(()=>{var x;r=void 0,s()||(x=e.onContinue)==null||x.call(e)}),g=()=>{if(s())return;let x;const T=n===0?e.initialPromise:void 0;try{x=T??e.fn()}catch(v){x=Promise.reject(v)}Promise.resolve(x).then(c).catch(v=>{var L;if(s())return;const p=e.retry??(_i?0:3),y=e.retryDelay??dw,S=typeof y=="function"?y(n,v):y,R=p===!0||typeof p=="number"&&nu()?void 0:m()).then(()=>{t?f(v):g()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r==null||r(),i),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?g():m().then(g),i)}}var si,_m,Gy=(_m=class{constructor(){ne(this,si)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bc(this.gcTime)&&H(this,si,ni.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_i?1/0:5*60*1e3))}clearGcTimeout(){_(this,si)&&(ni.clearTimeout(_(this,si)),H(this,si,void 0))}},si=new WeakMap,_m),ai,rs,Ut,oi,et,Ia,li,rn,Ln,Sm,fw=(Sm=class extends Gy{constructor(t){super();ne(this,rn);ne(this,ai);ne(this,rs);ne(this,Ut);ne(this,oi);ne(this,et);ne(this,Ia);ne(this,li);H(this,li,!1),H(this,Ia,t.defaultOptions),this.setOptions(t.options),this.observers=[],H(this,oi,t.client),H(this,Ut,_(this,oi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,H(this,ai,hp(this.options)),this.state=t.state??_(this,ai),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,et))==null?void 0:t.promise}setOptions(t){if(this.options={..._(this,Ia),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=hp(this.options);n.data!==void 0&&(this.setState(fp(n.data,n.dataUpdatedAt)),H(this,ai,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Ut).remove(this)}setData(t,n){const r=Vc(this.state.data,t,this.options);return fe(this,rn,Ln).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){fe(this,rn,Ln).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=_(this,et))==null?void 0:r.promise;return(i=_(this,et))==null||i.cancel(t),n?n.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,ai))}isActive(){return this.observers.some(t=>Vt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Mr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Vy(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,et))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,et))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,et)&&(_(this,li)?_(this,et).cancel({revert:!0}):_(this,et).cancelRetry()),this.scheduleGc()),_(this,Ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||fe(this,rn,Ln).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,d,c,f,m,g,x,T,v,p,y;if(this.state.fetchStatus!=="idle"&&((l=_(this,et))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,et))return _(this,et).continueRetry(),_(this,et).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(R=>R.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,i=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:)DELIM" -R"DELIM(()=>(H(this,li,!0),r.signal)})},s=()=>{const S=Wy(this.options,n),L=(()=>{const k={client:_(this,oi),queryKey:this.queryKey,meta:this.meta};return i(k),k})();return H(this,li,!1),this.options.persister?this.options.persister(S,L,this):S(L)},o=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,oi),state:this.state,fetchFn:s};return i(S),S})();(u=this.options.behavior)==null||u.onFetch(o,this),H(this,rs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&fe(this,rn,Ln).call(this,{type:"fetch",meta:(c=o.fetchOptions)==null?void 0:c.meta}),H(this,et,Ky({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:S=>{S instanceof Wc&&S.revert&&this.setState({..._(this,rs),fetchStatus:"idle"}),r.abort()},onFail:(S,R)=>{fe(this,rn,Ln).call(this,{type:"failed",failureCount:S,error:R})},onPause:()=>{fe(this,rn,Ln).call(this,{type:"pause"})},onContinue:()=>{fe(this,rn,Ln).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const S=await _(this,et).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(m=(f=_(this,Ut).config).onSuccess)==null||m.call(f,S,this),(x=(g=_(this,Ut).config).onSettled)==null||x.call(g,S,this.state.error,this),S}catch(S){if(S instanceof Wc){if(S.silent)return _(this,et).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw fe(this,rn,Ln).call(this,{type:"error",error:S}),(v=(T=_(this,Ut).config).onError)==null||v.call(T,S,this),(y=(p=_(this,Ut).config).onSettled)==null||y.call(p,this.state.data,S,this),S}finally{this.scheduleGc()}}},ai=new WeakMap,rs=new WeakMap,Ut=new WeakMap,oi=new WeakMap,et=new WeakMap,Ia=new WeakMap,li=new WeakMap,rn=new WeakSet,Ln=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...qy(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...fp(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return H(this,rs,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ot.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Ut).notify({query:this,type:"updated",action:t})})},Sm);function qy(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Zy(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fp(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function hp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var _t,he,$a,mt,ui,is,In,mr,Fa,ss,as,ci,di,vr,os,Se,Ys,Zc,Kc,Gc,qc,Yc,Xc,Jc,Yy,Em,hw=(Em=class extends Za{constructor(t,n){super();ne(this,Se);ne(this,_t);ne(this,he);ne(this,$a);ne(this,mt);ne(this,ui);ne(this,is);ne(this,In);ne(this,mr);ne(this,Fa);ne(this,ss);ne(this,as);ne(this,ci);ne(this,di);ne(this,vr);ne(this,os,new Set);this.options=n,H(this,_t,t),H(this,mr,null),H(this,In,Qc()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,he).addObserver(this),pp(_(this,he),this.options)?fe(this,Se,Ys).call(this):this.updateResult(),fe(this,Se,qc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ed(_(this,he),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ed(_(this,he),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,fe(this,Se,Yc).call(this),fe(this,Se,Xc).call(this),_(this,he).removeObserver(this)}setOptions(t){const n=this.options,r=_(this,he);if(this.options=_(this,_t).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Vt(this.options.enabled,_(this,he))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");fe(this,Se,Jc).call(this),_(this,he).setOptions(this.options),n._defaulted&&!Uc(this.options,n)&&_(this,_t).getQueryCac)DELIM" -R"DELIM(he().notify({type:"observerOptionsUpdated",query:_(this,he),observer:this});const i=this.hasListeners();i&&mp(_(this,he),r,this.options,n)&&fe(this,Se,Ys).call(this),this.updateResult(),i&&(_(this,he)!==r||Vt(this.options.enabled,_(this,he))!==Vt(n.enabled,_(this,he))||Mr(this.options.staleTime,_(this,he))!==Mr(n.staleTime,_(this,he)))&&fe(this,Se,Zc).call(this);const s=fe(this,Se,Kc).call(this);i&&(_(this,he)!==r||Vt(this.options.enabled,_(this,he))!==Vt(n.enabled,_(this,he))||s!==_(this,vr))&&fe(this,Se,Gc).call(this,s)}getOptimisticResult(t){const n=_(this,_t).getQueryCache().build(_(this,_t),t),r=this.createResult(n,t);return mw(this,r)&&(H(this,mt,r),H(this,is,this.options),H(this,ui,_(this,he).state)),r}getCurrentResult(){return _(this,mt)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,In).status==="pending"&&_(this,In).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){_(this,os).add(t)}getCurrentQuery(){return _(this,he)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,_t).defaultQueryOptions(t),r=_(this,_t).getQueryCache().build(_(this,_t),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return fe(this,Se,Ys).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,mt)))}createResult(t,n){var W;const r=_(this,he),i=this.options,s=_(this,mt),a=_(this,ui),o=_(this,is),u=t!==r?t.state:_(this,$a),{state:d}=t;let c={...d},f=!1,m;if(n._optimisticResults){const N=this.hasListeners(),B=!N&&pp(t,n),ue=N&&mp(t,r,n,i);(B||ue)&&(c={...c,...qy(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:g,errorUpdatedAt:x,status:T}=c;m=c.data;let v=!1;if(n.placeholderData!==void 0&&m===void 0&&T==="pending"){let N;s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(N=s.data,v=!0):N=typeof n.placeholderData=="function"?n.placeholderData((W=_(this,as))==null?void 0:W.state.data,_(this,as)):n.placeholderData,N!==void 0&&(T="success",m=Vc(s==null?void 0:s.data,N,n),f=!0)}if(n.select&&m!==void 0&&!v)if(s&&m===(a==null?void 0:a.data)&&n.select===_(this,Fa))m=_(this,ss);else try{H(this,Fa,n.select),m=n.select(m),m=Vc(s==null?void 0:s.data,m,n),H(this,ss,m),H(this,mr,null)}catch(N){H(this,mr,N)}_(this,mr)&&(g=_(this,mr),m=_(this,ss),x=Date.now(),T="error");const p=c.fetchStatus==="fetching",y=T==="pending",S=T==="error",R=y&&p,L=m!==void 0,j={status:T,fetchStatus:c.fetchStatus,isPending:y,isSuccess:T==="success",isError:S,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:c.dataUpdatedAt,error:g,errorUpdatedAt:x,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:p,isRefetching:p&&!y,isLoadingError:S&&!L,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&L,isStale:xf(t,n),refetch:this.refetch,promise:_(this,In),isEnabled:Vt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const N=be=>{j.status==="error"?be.reject(j.error):j.data!==void 0&&be.resolve(j.data)},B=()=>{const be=H(this,In,j.promise=Qc());N(be)},ue=_(this,In);switch(ue.status){case"pending":t.queryHash===r.queryHash&&N(ue);break;case"fulfilled":(j.status==="error"||j.data!==ue.value)&&B();break;case"rejected":(j.status!=="error"||j.error!==ue.reason)&&B();break}}return j}updateResult(){const t=_(this,mt),n=this.createResult(_(this,he),this.options);if(H(this,ui,_(this,he).state),H(this,is,this.options),_(this,ui).data!==void 0&&H(this,as,_(this,he)),Uc(n,t))return;H(this,mt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!_(this,os).size)return!0;const a=new Set(s??_(this,os));return this.options.throwOnError&&a.add("error"),Object.keys(_(this,mt)).some(o=>{const l=o;return _(this,mt)[l]!==t[l]&&a.has(l)})};fe(this,Se,Yy).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&fe(this,Se,qc).call(this)}},_t=new WeakMap,he=new WeakMap,$a=new WeakMap,mt=new WeakMap,ui=new WeakMap,is=new WeakMap,In=new WeakMap,mr=new WeakMap,Fa=new WeakMap,ss=new WeakMap,as=new WeakMap,ci=new WeakMap,di=new WeakMap,vr=new WeakMap,os=new WeakMap,Se=new WeakSet,Ys=function(t){fe(this,Se,Jc).call(this);let n=_(this,he).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Et)),n},Zc=function(){fe(this,Se,Yc).call(this);const t=Mr(this.options.staleTime,_(this,he));if(_i||_(this,mt).isStale||!Bc(t))return;const r=Vy(_(this,mt).dataUpdatedAt,t)+1;H(this,ci,ni.setTimeout(()=>{_(this,mt).isStale||this.updateResult()},r))},Kc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchIn)DELIM" -R"DELIM(terval(_(this,he)):this.options.refetchInterval)??!1},Gc=function(t){fe(this,Se,Xc).call(this),H(this,vr,t),!(_i||Vt(this.options.enabled,_(this,he))===!1||!Bc(_(this,vr))||_(this,vr)===0)&&H(this,di,ni.setInterval(()=>{(this.options.refetchIntervalInBackground||gf.isFocused())&&fe(this,Se,Ys).call(this)},_(this,vr)))},qc=function(){fe(this,Se,Zc).call(this),fe(this,Se,Gc).call(this,fe(this,Se,Kc).call(this))},Yc=function(){_(this,ci)&&(ni.clearTimeout(_(this,ci)),H(this,ci,void 0))},Xc=function(){_(this,di)&&(ni.clearInterval(_(this,di)),H(this,di,void 0))},Jc=function(){const t=_(this,_t).getQueryCache().build(_(this,_t),this.options);if(t===_(this,he))return;const n=_(this,he);H(this,he,t),H(this,$a,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Yy=function(t){ot.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,mt))}),_(this,_t).getQueryCache().notify({query:_(this,he),type:"observerResultsUpdated"})})},Em);function pw(e,t){return Vt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function pp(e,t){return pw(e,t)||e.state.data!==void 0&&ed(e,t,t.refetchOnMount)}function ed(e,t,n){if(Vt(t.enabled,e)!==!1&&Mr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&xf(e,t)}return!1}function mp(e,t,n,r){return(e!==t||Vt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&xf(e,n)}function xf(e,t){return Vt(t.enabled,e)!==!1&&e.isStaleByTime(Mr(t.staleTime,e))}function mw(e,t){return!Uc(e.getCurrentResult(),t)}function vp(e){return{onFetch:(t,n)=>{var d,c,f,m,g;const r=t.options,i=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],a=((g=t.state.data)==null?void 0:g.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let x=!1;const T=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},v=Wy(t.options,t.fetchOptions),p=async(y,S,R)=>{if(x)return Promise.reject();if(S==null&&y.pages.length)return Promise.resolve(y);const k=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:S,direction:R?"backward":"forward",meta:t.options.meta};return T(B),B})(),j=await v(k),{maxPages:W}=t.options,N=R?sw:iw;return{pages:N(y.pages,j,W),pageParams:N(y.pageParams,S,W)}};if(i&&s.length){const y=i==="backward",S=y?vw:yp,R={pages:s,pageParams:a},L=S(r,R);o=await p(R,L,y)}else{const y=e??s.length;do{const S=l===0?a[0]??r.initialPageParam:yp(r,o);if(l>0&&S==null)break;o=await p(o,S),l++}while(l{var x,T;return(T=(x=t.options).persister)==null?void 0:T.call(x,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function yp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function vw(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var za,xn,vt,fi,wn,sr,Cm,yw=(Cm=class extends Gy{constructor(t){super();ne(this,wn);ne(this,za);ne(this,xn);ne(this,vt);ne(this,fi);H(this,za,t.client),this.mutationId=t.mutationId,H(this,vt,t.mutationCache),H(this,xn,[]),this.state=t.state||gw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,xn).includes(t)||(_(this,xn).push(t),this.clearGcTimeout(),_(this,vt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){H(this,xn,_(this,xn).filter(n=>n!==t)),this.scheduleGc(),_(this,vt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,xn).length||(this.state.status==="pending"?this.scheduleGc():_(this,vt).remove(this))}continue(){var t;return((t=_(this,fi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,u,d,c,f,m,g,x,T,v,p,y,S,R,L,k,j,W;const n=()=>{fe(this,wn,sr).call(this,{type:"continue"})},r={client:_(this,za),meta:this.options.meta,mutationKey:this.options.mutationKey};H(this,fi,Ky({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(N,B)=>{fe(this,wn,sr).call(this,{type:"failed",failureCount:N,error:B})},onPause:()=>{fe(this,wn,sr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,vt).canRun(this)}));const i=this.state.status==="pending",s=!_(this,fi).canStart();try{if(i)n();else{fe(this,wn,sr).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=_(this,vt).config).onMutate)==null?void 0:o.call(a,t,this,r));const B=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,r));B!==this.state.context&&fe(this,wn,sr).call(this,{type:"pending",context:B,variables:t,isPa)DELIM" -R"DELIM(used:s})}const N=await _(this,fi).start();return await((c=(d=_(this,vt).config).onSuccess)==null?void 0:c.call(d,N,t,this.state.context,this,r)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,N,t,this.state.context,r)),await((x=(g=_(this,vt).config).onSettled)==null?void 0:x.call(g,N,null,this.state.variables,this.state.context,this,r)),await((v=(T=this.options).onSettled)==null?void 0:v.call(T,N,null,t,this.state.context,r)),fe(this,wn,sr).call(this,{type:"success",data:N}),N}catch(N){try{throw await((y=(p=_(this,vt).config).onError)==null?void 0:y.call(p,N,t,this.state.context,this,r)),await((R=(S=this.options).onError)==null?void 0:R.call(S,N,t,this.state.context,r)),await((k=(L=_(this,vt).config).onSettled)==null?void 0:k.call(L,void 0,N,this.state.variables,this.state.context,this,r)),await((W=(j=this.options).onSettled)==null?void 0:W.call(j,void 0,N,t,this.state.context,r)),N}finally{fe(this,wn,sr).call(this,{type:"error",error:N})}}finally{_(this,vt).runNext(this)}}},za=new WeakMap,xn=new WeakMap,vt=new WeakMap,fi=new WeakMap,wn=new WeakSet,sr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ot.batch(()=>{_(this,xn).forEach(r=>{r.onMutationUpdate(t)}),_(this,vt).notify({mutation:this,type:"updated",action:t})})},Cm);function gw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $n,sn,Ba,Tm,xw=(Tm=class extends Za{constructor(t={}){super();ne(this,$n);ne(this,sn);ne(this,Ba);this.config=t,H(this,$n,new Set),H(this,sn,new Map),H(this,Ba,0)}build(t,n,r){const i=new yw({client:t,mutationCache:this,mutationId:++so(this,Ba)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){_(this,$n).add(t);const n=Eo(t);if(typeof n=="string"){const r=_(this,sn).get(n);r?r.push(t):_(this,sn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,$n).delete(t)){const n=Eo(t);if(typeof n=="string"){const r=_(this,sn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&_(this,sn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Eo(t);if(typeof n=="string"){const r=_(this,sn).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Eo(t);if(typeof n=="string"){const i=(r=_(this,sn).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ot.batch(()=>{_(this,$n).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,$n).clear(),_(this,sn).clear()})}getAll(){return Array.from(_(this,$n))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>up(n,r))}findAll(t={}){return this.getAll().filter(n=>up(t,n))}notify(t){ot.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ot.batch(()=>Promise.all(t.map(n=>n.continue().catch(Et))))}},$n=new WeakMap,sn=new WeakMap,Ba=new WeakMap,Tm);function Eo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var kn,bm,ww=(bm=class extends Za{constructor(t={}){super();ne(this,kn);this.config=t,H(this,kn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??vf(i,n);let a=this.get(s);return a||(a=new fw({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){_(this,kn).has(t.queryHash)||(_(this,kn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,kn).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,kn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ot.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,kn).get(t)}getAll(){return[..._(this,kn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>lp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>lp(t,r)):n}notify(t){ot.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ot.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ot.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},kn=new WeakMap,bm),ze,yr,gr,ls,us,xr,cs,ds,Pm,kw=(Pm=class{constructor(e={}){ne(this,ze);ne(this,yr);ne(this,gr);ne(this,ls);ne(this,us);ne(this,xr);ne(this,cs);ne(this,ds);H(this,ze,e.queryCache||new ww),H(this,yr,e.mutationCache|)DELIM" -R"DELIM(|new xw),H(this,gr,e.defaultOptions||{}),H(this,ls,new Map),H(this,us,new Map),H(this,xr,0)}mount(){so(this,xr)._++,_(this,xr)===1&&(H(this,cs,gf.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ze).onFocus())})),H(this,ds,wl.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ze).onOnline())})))}unmount(){var e,t;so(this,xr)._--,_(this,xr)===0&&((e=_(this,cs))==null||e.call(this),H(this,cs,void 0),(t=_(this,ds))==null||t.call(this),H(this,ds,void 0))}isFetching(e){return _(this,ze).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,yr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ze).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=_(this,ze).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Mr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return _(this,ze).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=_(this,ze).get(r.queryHash),s=i==null?void 0:i.state.data,a=tw(t,s);if(a!==void 0)return _(this,ze).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ot.batch(()=>_(this,ze).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ze).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,ze);ot.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,ze);return ot.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ot.batch(()=>_(this,ze).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Et).catch(Et)}invalidateQueries(e,t={}){return ot.batch(()=>(_(this,ze).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ot.batch(()=>_(this,ze).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Et)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Et)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,ze).build(this,t);return n.isStaleByTime(Mr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Et).catch(Et)}fetchInfiniteQuery(e){return e.behavior=vp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Et).catch(Et)}ensureInfiniteQueryData(e){return e.behavior=vp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return wl.isOnline()?_(this,yr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,ze)}getMutationCache(){return _(this,yr)}getDefaultOptions(){return _(this,gr)}setDefaultOptions(e){H(this,gr,e)}setQueryDefaults(e,t){_(this,ls).set(Pa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,ls).values()],n={};return t.forEach(r=>{Na(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,us).set(Pa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,us).values()],n={};return t.forEach(r=>{Na(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,gr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===yf&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,gr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,ze).clear(),_(this,yr).clear()}},ze=new WeakMap,yr=new WeakMap,gr=new WeakMap,ls=new WeakMap,us=new WeakMap,xr=new WeakMap,cs=new WeakMap,ds=new WeakMap,Pm),Xy=C.createContext(void 0),Jy=e=>{const t=C.useContext(Xy);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_w=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(Xy.Provider,{value:e,children:t})),eg=C.createContext(!1),Sw=()=>C.useContext(eg);eg.Provider;function Ew(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Cw=C.createContext(Ew()),Tw=()=>C.useContext(Cw),bw=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount)DELIM" -R"DELIM(=!1))},Pw=e=>{C.useEffect(()=>{e.clearReset()},[e])},Nw=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||aw(n,[e.error,r])),Rw=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},jw=(e,t)=>e.isLoading&&e.isFetching&&!t,Mw=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,gp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Lw(e,t,n){var c,f,m,g,x;const r=Sw(),i=Tw(),s=Jy(),a=s.defaultQueryOptions(e);(f=(c=s.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||f.call(c,a),a._optimisticResults=r?"isRestoring":"optimistic",Rw(a),bw(a,i),Pw(i);const o=!s.getQueryCache().get(a.queryHash),[l]=C.useState(()=>new t(s,a)),u=l.getOptimisticResult(a),d=!r&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(T=>{const v=d?l.subscribe(ot.batchCalls(T)):Et;return l.updateResult(),v},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),C.useEffect(()=>{l.setOptions(a)},[a,l]),Mw(a,u))throw gp(a,l,i);if(Nw({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((g=(m=s.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||g.call(m,a,u),a.experimental_prefetchInRender&&!_i&&jw(u,r)){const T=o?gp(a,l,i):(x=s.getQueryCache().get(a.queryHash))==null?void 0:x.promise;T==null||T.catch(Et).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function ql(e,t){return Lw(e,hw)}const Ow="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let xp=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Ow[n[e]&63];return t};var tg={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(S0,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",a="second",o="minute",l="hour",u="day",d="week",c="month",f="quarter",m="year",g="date",x="Invalid Date",T=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var F=["th","st","nd","rd"],$=Z%100;return"["+Z+(F[($-20)%10]||F[$]||F[0])+"]"}},y=function(Z,F,$){var K=String(Z);return!K||K.length>=F?Z:""+Array(F+1-K.length).join($)+Z},S={s:y,z:function(Z){var F=-Z.utcOffset(),$=Math.abs(F),K=Math.floor($/60),b=$%60;return(F<=0?"+":"-")+y(K,2,"0")+":"+y(b,2,"0")},m:function Z(F,$){if(F.date()<$.date())return-Z($,F);var K=12*($.year()-F.year())+($.month()-F.month()),b=F.clone().add(K,c),D=$-b<0,I=F.clone().add(K+(D?-1:1),c);return+(-(K+($-b)/(D?b-I:I-b))||0)},a:function(Z){return Z<0?Math.ceil(Z)||0:Math.floor(Z)},p:function(Z){return{M:c,y:m,w:d,d:u,D:g,h:l,m:o,s:a,ms:s,Q:f}[Z]||String(Z||"").toLowerCase().replace(/s$/,"")},u:function(Z){return Z===void 0}},R="en",L={};L[R]=p;var k="$isDayjsObject",j=function(Z){return Z instanceof ue||!(!Z||!Z[k])},W=function Z(F,$,K){var b;if(!F)return R;if(typeof F=="string"){var D=F.toLowerCase();L[D]&&(b=D),$&&(L[D]=$,b=D);var I=F.split("-");if(!b&&I.length>1)return Z(I[0])}else{var ee=F.name;L[ee]=F,b=ee}return!K&&b&&(R=b),b||!K&&R},N=function(Z,F){if(j(Z))return Z.clone();var $=typeof F=="object"?F:{};return $.date=Z,$.args=arguments,new ue($)},B=S;B.l=W,B.i=j,B.w=function(Z,F){return N(Z,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var ue=function(){function Z($){this.$L=W($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[k]=!0}var F=Z.prototype;return F.parse=function($){this.$d=function(K){var b=K.date,D=K.utc;if(b===null)return new Date(NaN);if(B.u(b))return new Date;if(b instanceof Date)return new Date(b);if(typeof b=="string"&&!/Z$/i.test(b)){var I=b.match(T);if(I){var ee=I[2]-1||0,re=(I[7]||"0").substring(0,3);return D?new Date(Date.UTC(I[1],ee,I[3]||1,I[4]||0,I[5]||0,I[6]||0,re)):new Date(I[1],ee,I[3]||1,I[4]||0,I[5]||0,I[6]||0,re)}}return new Date(b)}($),this.init()},F.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},F.$utils=function(){return B},F.isValid=function(){return this.$d.toString()!==x},F.isSame=function($,K){var b=N($);return this.startOf(K)<=b&&b<=this.endOf(K)},F.isAfter=function($,K){return N($)-1&&e%1==0&&e0?t[qw(0,n-1)]:void 0}function ek(e){return nk(e)&&wf.call(e,"callee")&&(!Vw.call(e,"callee")||ig.call(e)==Aw)}var tk=Array.isArray;function kf(e){return e!=null&&ik(e.length)&&!rk(e)}function nk(e){return ak(e)&&kf(e)}function rk(e){var t=sk(e)?ig.call(e):"";return t==Iw||t==$w}function ik(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=rg}function sk(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ak(e){return!!e&&typeof e=="object"}function ok(e){return kf(e)?Kw(e):Gw(e)}function lk(e){return e?Uw(e,ok(e)):[]}var uk=Jw;const ck=Ll(uk);function Xl(e){if(!e)return;const t=e.toLowerCase(),n=t.indexOf("1");if(n>0){const i=t.slice(0,n);if(["bc","tb","bcrt","ltc","sb"].some(s=>i===s)){const s=t.slice(n+1),a=s.charAt(0);return a==="p"?"p2tr":a==="q"?s.length===39||s.length===40||e.length===42?"p2wpkh":s.length===59||s.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}switch(t[0]){case"1":case"m":case"n":return"p2pkh";case"3":case"2":return"p2sh";default:return}}const Xs=new Set;let Au=0;function wp(e){Xs.forEach(t=>t(e))}const sg=ng().subtract(2,"hour").unix(),Ka=Array.from({length:20}).map((e,t)=>{const n=`mock-tx-${t.toString().padStart(4,"0")}`,r=[{index:0,address:`bcrt1qmock${t}`,valueSats:1e6+t*1234,scriptType:"p2wpkh",spent:!1,script:{hex:`0014mockoutput${t}`,mnemonic:"OP_0 mock-output-pubkey"}}];return{txid:n,hash:n,status:"confirmed",confirmations:10-Math.floor(t/2),blockHeight:8e5-t,blockHash:`mock-block-${Math.floor(t/2)}`,receivedTime:sg+t*60,feeSats:250+t,feeRate:12+t*.1,size:225+t,weight:900+t*4,version:2,locktime:0,totalInput:1005e3,totalOutput:r.reduce((i,s)=>i+s.valueSats,0),inputs:[{index:0,prevTxId:`mock-prev-${t}`,prevOutputIndex:0,address:`bcrt1qprev${t}`,valueSats:1005e3,scriptType:"p2wpkh",script:{hex:`160014mockinputscriptsig${t}`,mnemonic:"OP_PUSHBYTES_22 mock-input-scriptsig"},witness:["3045022100cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafe","02deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbe"],sequence:4294967293}],outputs:r}}),gt=[];var Nm;for(let e=0;e<6;e+=1){const t=8e5+e,n=`mock-block-${t}`,r=Ka.slice(e*3,e*3+3);gt.push({hash:n,height:t,timestamp:sg+e*600,txCount:r.length,size:12e5,weight:4e6,difficulty:5e10,previousBlockHash:e===0?null:(Nm=gt[e-1])==null?void 0:Nm.hash,merkleRoot:`mock-merkle-${e}`,nonce:1e3+e,bits:486604799,version:2,nextBlockHash:null,transactions:r}),e>0&&(gt[e-1].nextBlockHash=n)}const dk={bcrt1qmock0:{address:"bcrt1qmock0",addressType:Xl("bcrt1qmock0"),balance:2345678,totalReceived:5e6,totalSent:2654322,txCount:5,utxoCount:3,transactions:Ka.slice(0,5).map(e=>{var t;return{txid:e.txid,timestamp:e.receivedTime,valueChange:((t=e.outputs[0])==null?void 0:t.valueSats)??0,blockHeight:e.blockHeight}})}};function Iu(){return{metadata:{id:"mock",label:"Mock data (offline)",type:"mock",connectionState:"connected",supportsWebsocket:!0,description:"Generates synthetic blockchain data for development."},async getLatestBlocks(e=10){return gt.slice().reverse().slice(0,e).map(t=>({hash:t.hash,height:t.height,timestamp:t.timestamp,txCount:t.txCount,size:t.size,weight:t.weight,difficulty:t.difficulty,previousBlockHash:t.previousBlockHash}))},async getBlock(e){if(e==="latest")return gt[gt.length-1];const t=gt.find(n=>n.hash===e||n.height.toString()===e);if(!t)throw new Error("Block not found");return t},async getBlocksBefore(e,t=10){return gt.filter(r=>r.height<=e).slice().reverse().slice(0,t).map(r=>({hash:r.hash,height:r.height,timestamp:r.timestamp,txCount:r.txCount,size:r.size,weight:r.weight,difficulty:r.difficulty,previousBlockHash:r.previousBlockHash}))},async getBlockTransactions(e,t=0){return(await this.getBlock(e)).transactions.slice(t,t+25)},async getTransaction(e){const t=Ka.find(n=>n.txid===e||n.hash===e);if(!t)throw new Error("Transaction not found");return t},async getAddress(e){return dk[e]??{address:e,addressType:Xl(e),balance:0,totalReceived:0,totalSent:0,txCount:0,utxoCount:0,transactions:[]}},async getAddressTransactions(e,t){const n=await this.getAddress(e),r=10,i=t?n.transactions.findIndex(s=>s.txid===t)+1:0;return i<=0&&t?[]:n.transactions.slice(i,i+r)},subscribeToEvents(e){return Xs.add(e),Xs.size===1&&fk(),()=>{Xs.delete(e),Xs.size===0&&hk()}}}}let ca=null;function fk(){ca||(ca=setInterval(()=>{const e=mk();gt.push(e),wp({type:"block.new",payload:pk(e)});const t=ck(Ka);t&&wp({type:"tx.new",payload:t})},15e3))}function hk(){ca&&(clearInterval(ca),ca=null)}function pk(e){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:e.txCount,size:e.size,weight:e.weight,difficulty:e.difficulty,previousBlockHash:e.previousBlockHash}}function mk(){Au+=1;const e=gt[gt.length-1].height+1,t=`mock-block-${e}-${xp(6)}`,n=ng().unix(),r=Ka.slice(0,2).map(a=>({...a,blockHash:t,blockHeight:e})),i={hash:t,height:e,timestamp:n,txCount:r.length,size:1)DELIM" -R"DELIM(2e5+Au*1e3,weight:4e6,difficulty:5e10,previousBlockHash:gt[gt.length-1].hash,merkleRoot:`mock-merkle-${xp(10)}`,nonce:1e3+Au,bits:486604799,version:2,nextBlockHash:null,transactions:r},s=gt[gt.length-1];return s.nextBlockHash=t,i}var xe;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},e.find=(i,s)=>{for(const a of i)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(xe||(xe={}));var kp;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(kp||(kp={}));const q=xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ur=e=>{switch(typeof e){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(e)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(e)?q.array:e===null?q.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?q.promise:typeof Map<"u"&&e instanceof Map?q.map:typeof Set<"u"&&e instanceof Set?q.set:typeof Date<"u"&&e instanceof Date?q.date:q.object;default:return q.unknown}},A=xe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Zn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,l=0;for(;ln.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Zn.create=e=>new Zn(e);const td=(e,t)=>{let n;switch(e.code){case A.invalid_type:e.received===q.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case A.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,xe.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:n=`Unrecognized key(s) in object: ${xe.joinValues(e.keys,", ")}`;break;case A.invalid_union:n="Invalid input";break;case A.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${xe.joinValues(e.options)}`;break;case A.invalid_enum_value:n=`Invalid enum value. Expected ${xe.joinValues(e.options)}, received '${e.received}'`;break;case A.invalid_arguments:n="Invalid function arguments";break;case A.invalid_return_type:n="Invalid function return type";break;case A.invalid_date:n="Invalid date";break;case A.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:xe.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case A.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.in)DELIM" -R"DELIM(clusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case A.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case A.custom:n="Invalid input";break;case A.invalid_intersection_types:n="Intersection results could not be merged";break;case A.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case A.not_finite:n="Number must be finite";break;default:n=t.defaultError,xe.assertNever(e)}return{message:n}};let vk=td;function yk(){return vk}const gk=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)o=u(a,{data:t,defaultError:o}).message;return{...i,path:s,message:o}};function U(e,t){const n=yk(),r=gk({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===td?void 0:td].filter(i=>!!i)});e.common.issues.push(r)}class At{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return se;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return At.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return se;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:t.value,value:r}}}const se=Object.freeze({status:"aborted"}),Js=e=>({status:"dirty",value:e}),Xt=e=>({status:"valid",value:e}),_p=e=>e.status==="aborted",Sp=e=>e.status==="dirty",xs=e=>e.status==="valid",kl=e=>typeof Promise<"u"&&e instanceof Promise;var X;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(X||(X={}));class Ir{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ep=(e,t)=>{if(xs(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Zn(e.common.issues);return this._error=n,this._error}}};function ce(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,o)=>{const{message:l}=e;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}class ye{get description(){return this._def.description}_getType(t){return ur(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ur(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new At,ctx:{common:t.parent.common,data:t.data,parsedType:ur(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(kl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safePar)DELIM" -R"DELIM(se(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ur(t)},i=this._parseSync({data:t,path:r.path,parent:r});return Ep(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ur(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:n});return xs(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(i=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(s=>xs(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ur(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(kl(i)?i:Promise.resolve(i));return Ep(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=t(i),o=()=>s.addIssue({code:A.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new _s({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Lr.create(this,this._def)}nullable(){return Ss.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bn.create(this)}promise(){return Cl.create(this,this._def)}or(t){return Sl.create([this,t],this._def)}and(t){return El.create(this,t,this._def)}transform(t){return new _s({...ce(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new id({...ce(this._def),innerType:this,defaultValue:n,typeName:ae.ZodDefault})}brand(){return new Bk({typeName:ae.ZodBranded,type:this,...ce(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new sd({...ce(this._def),innerType:this,catchValue:n,typeName:ae.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return _f.create(this,t)}readonly(){return ad.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xk=/^c[^\s-]{8,}$/i,wk=/^[0-9a-z]+$/,kk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_k=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Sk=/^[a-z0-9_-]{21}$/i,Ek=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ck=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Tk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $u;const Pk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Nk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Rk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([)DELIM" -R"DELIM(0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Lk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ag="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ok=new RegExp(`^${ag}$`);function og(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Dk(e){return new RegExp(`^${og(e)}$`)}function Ak(e){let t=`${ag}T${og(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ik(e,t){return!!((t==="v4"||!t)&&Pk.test(e)||(t==="v6"||!t)&&Rk.test(e))}function $k(e,t){if(!Ek.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function Fk(e,t){return!!((t==="v4"||!t)&&Nk.test(e)||(t==="v6"||!t)&&jk.test(e))}class _r extends ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==q.string){const s=this._getOrReturnCtx(t);return U(s,{code:A.invalid_type,expected:q.string,received:s.parsedType}),se}const r=new At;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(i=this._getOrReturnCtx(t,i),U(i,{code:A.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=t.data.length>s.value,o=t.data.lengtht.test(i),{validation:n,code:A.invalid_string,...X.errToObj(r)})}_addCheck(t){return new _r({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...X.errToObj(t)})}url(t){return this._addCheck({kind:"url",...X.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...X.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...X.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...X.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...X.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...X.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...X.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...X.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...X.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...X.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...X.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...X.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...X.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...X.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...X.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...X.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...X.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...X.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...X.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...X.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...X.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...X.errToObj(n)})}nonempty(t){return this.min(1,X.errToObj(t))}trim(){return new _r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2())DELIM" -R"DELIM({return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew _r({checks:[],typeName:ae.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ce(e)});function zk(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return s%a/10**i}class ws extends ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==q.number){const s=this._getOrReturnCtx(t);return U(s,{code:A.invalid_type,expected:q.number,received:s.parsedType}),se}let r;const i=new At;for(const s of this._def.checks)s.kind==="int"?xe.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),U(r,{code:A.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),U(r,{code:A.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?zk(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),U(r,{code:A.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),U(r,{code:A.not_finite,message:s.message}),i.dirty()):xe.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,X.toString(n))}gt(t,n){return this.setLimit("min",t,!1,X.toString(n))}lte(t,n){return this.setLimit("max",t,!0,X.toString(n))}lt(t,n){return this.setLimit("max",t,!1,X.toString(n))}setLimit(t,n,r,i){return new ws({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:X.toString(i)}]})}_addCheck(t){return new ws({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:X.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:X.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:X.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:X.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:X.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:X.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:X.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:X.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:X.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&xe.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew ws({checks:[],typeName:ae.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ce(e)});class Ra extends ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==q.bigint)return this._getInvalidInput(t);let r;const i=new At;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),U(r,{code:A.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),U(r,{code:A.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):xe.as)DELIM" -R"DELIM(sertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return U(n,{code:A.invalid_type,expected:q.bigint,received:n.parsedType}),se}gte(t,n){return this.setLimit("min",t,!0,X.toString(n))}gt(t,n){return this.setLimit("min",t,!1,X.toString(n))}lte(t,n){return this.setLimit("max",t,!0,X.toString(n))}lt(t,n){return this.setLimit("max",t,!1,X.toString(n))}setLimit(t,n,r,i){return new Ra({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:X.toString(i)}]})}_addCheck(t){return new Ra({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:X.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:X.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:X.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:X.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:X.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Ra({checks:[],typeName:ae.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ce(e)});class nd extends ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==q.boolean){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.boolean,received:r.parsedType}),se}return Xt(t.data)}}nd.create=e=>new nd({typeName:ae.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ce(e)});class _l extends ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==q.date){const s=this._getOrReturnCtx(t);return U(s,{code:A.invalid_type,expected:q.date,received:s.parsedType}),se}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return U(s,{code:A.invalid_date}),se}const r=new At;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(i=this._getOrReturnCtx(t,i),U(i,{code:A.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):xe.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new _l({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:X.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:X.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew _l({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ae.ZodDate,...ce(e)});class Cp extends ye{_parse(t){if(this._getType(t)!==q.symbol){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.symbol,received:r.parsedType}),se}return Xt(t.data)}}Cp.create=e=>new Cp({typeName:ae.ZodSymbol,...ce(e)});class Tp extends ye{_parse(t){if(this._getType(t)!==q.undefined){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.undefined,received:r.parsedType}),se}return Xt(t.data)}}Tp.create=e=>new Tp({typeName:ae.ZodUndefined,...ce(e)});class bp extends ye{_parse(t){if(this._getType(t)!==q.null){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.null,received:r.parsedType}),se}return Xt(t.data)}}bp.create=e=>new bp({typeName:ae.ZodNull,...ce(e)});class Pp extends ye{constructor(){super(...arguments),this._any=!0}_parse(t){return Xt(t.data)}}Pp.create=e=>new Pp({typeName:ae.ZodAny,...ce(e)});class Np extends ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xt(t.data)}}Np.create=e=>new Np({typeName:ae.ZodUnknown,...ce(e)});class $r extends ye{_parse(t){const n=this._getOrReturnCtx(t);return U(n,{code:A.invalid_type,expected:q.never,received:n.parsedType}),se}}$r.create=e=>new $r({typeName:ae.ZodNever,...ce(e)});class Rp extends ye{_parse(t){if(this._getType(t)!==q.undefined){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.void,received:r.parsedType}),se}return Xt(t.data)}}Rp.create=e=>new Rp({typeName:ae.ZodVoid,...ce(e)});class bn extends ye{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==q.array)return U(n,{code:A.invalid_type,expected:q.array,received:n.parsedType}),se;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,o=n.data.lengthi.maxLength.value&&(U(n,{code:A.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>i.type._parseAsync(new Ir(n,a,n.path,o)))).then(a=>At.mergeArray(r,a));const s=[...n.data].map((a,o)=>i.type._parseSync(new Ir(n,a,n.path,o)));return At.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new bn({...this._def,minLength:{value:t,message:X.toString(n)}})}max(t,n){return new bn({...this._def,maxLength:{value:t,message:X.toString(n)}})}length(t,n){return new bn({...this._def,exactLength:{value:t,message:X.toString(n)}})}nonempty(t){return this.min(1,t)}}bn.create=(e,t)=>new bn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...ce(t)});function Oi(e){if(e instanceof Ze){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Lr.create(Oi(r))}return new Ze({...e._def,shape:()=>t})}else return e instanceof bn?new bn({...e._def,type:Oi(e.element)}):e instanceof Lr?Lr.create(Oi(e.unwrap())):e instanceof Ss?Ss.create(Oi(e.unwrap())):e instanceof Si?Si.create(e.items.map(t=>Oi(t))):e}class Ze extends ye{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=xe.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==q.object){const u=this._getOrReturnCtx(t);return U(u,{code:A.invalid_type,expected:q.object,received:u.parsedType}),se}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof $r&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||o.push(u);const l=[];for(const u of a){const d=s[u],c=i.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Ir(i,c,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof $r){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")o.length>0&&(U(i,{code:A.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const c=i.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Ir(i,c,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const c=await d.key,f=await d.value;u.push({key:c,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>At.mergeObjectSync(r,u)):At.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return X.errToObj,new Ze({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,a;const i=((a=(s=this._def).errorMap)==null?void 0:a.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:X.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new Ze({...this._def,unknownKeys:"strip"})}passthrough(){return new Ze({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ze({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ze({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ae.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ze({...this._def,catchall:t})}pick(t){const n={};for(const r of xe.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Ze({...this._def,shape:()=>n})}omit(t){const n={};for(const r of xe.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Ze({...this._def,shape:()=>n})}deepPartial(){return Oi(this)}partial(t){const n={};for(const r of xe.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new Ze({...this._def,shape:()=>n})}required(t){const n={};for(const r of xe.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Lr;)s=s._def.innerType;n[r]=s}return new Ze({...this._def,shape:()=>n})}keyof(){return lg(xe.objectKeys(this.shape))}}Ze.create=(e,t)=>new Ze({shape:()=>e,unknownKeys:"strip",catchall:$r.create(),typeName:ae.ZodObject,...ce(t)});Ze.strictCreate=(e,t)=>new Ze({shape:()=>e,unknownKeys:"strict",catchall:$r.create(),typeName:ae.ZodObject,...ce(t)});Ze.lazycreate=(e,t)=>new Ze({shape:e,unknownKeys:"strip",catchall:$r.create(),typeName:ae.ZodObject,...ce(t)});class Sl extends ye{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const o of s)i)DELIM" -R"DELIM(f(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new Zn(o.ctx.common.issues));return U(n,{code:A.invalid_union,unionErrors:a}),se}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(l=>new Zn(l));return U(n,{code:A.invalid_union,unionErrors:o}),se}}get options(){return this._def.options}}Sl.create=(e,t)=>new Sl({options:e,typeName:ae.ZodUnion,...ce(t)});function rd(e,t){const n=ur(e),r=ur(t);if(e===t)return{valid:!0,data:e};if(n===q.object&&r===q.object){const i=xe.objectKeys(t),s=xe.objectKeys(e).filter(o=>i.indexOf(o)!==-1),a={...e,...t};for(const o of s){const l=rd(e[o],t[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===q.array&&r===q.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s{if(_p(s)||_p(a))return se;const o=rd(s.value,a.value);return o.valid?((Sp(s)||Sp(a))&&n.dirty(),{status:n.value,value:o.data}):(U(r,{code:A.invalid_intersection_types}),se)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}El.create=(e,t,n)=>new El({left:e,right:t,typeName:ae.ZodIntersection,...ce(n)});class Si extends ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==q.array)return U(r,{code:A.invalid_type,expected:q.array,received:r.parsedType}),se;if(r.data.lengththis._def.items.length&&(U(r,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new Ir(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>At.mergeArray(n,a)):At.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Si({...this._def,rest:t})}}Si.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Si({items:e,typeName:ae.ZodTuple,rest:null,...ce(t)})};class jp extends ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==q.map)return U(r,{code:A.invalid_type,expected:q.map,received:r.parsedType}),se;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],u)=>({key:i._parse(new Ir(r,o,r.path,[u,"key"])),value:s._parse(new Ir(r,l,r.path,[u,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return se;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of a){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return se;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.value,value:o}}}}jp.create=(e,t,n)=>new jp({valueType:t,keyType:e,typeName:ae.ZodMap,...ce(n)});class ja extends ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==q.set)return U(r,{code:A.invalid_type,expected:q.set,received:r.parsedType}),se;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(U(r,{code:A.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(l){const u=new Set;for(const d of l){if(d.status==="aborted")return se;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const o=[...r.data.values()].map((l,u)=>s._parse(new Ir(r,l,r.path,u)));retur)DELIM" -R"DELIM(n r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(t,n){return new ja({...this._def,minSize:{value:t,message:X.toString(n)}})}max(t,n){return new ja({...this._def,maxSize:{value:t,message:X.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ja.create=(e,t)=>new ja({valueType:e,minSize:null,maxSize:null,typeName:ae.ZodSet,...ce(t)});class Mp extends ye{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Mp.create=(e,t)=>new Mp({getter:e,typeName:ae.ZodLazy,...ce(t)});class Lp extends ye{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return U(n,{received:n.data,code:A.invalid_literal,expected:this._def.value}),se}return{status:"valid",value:t.data}}get value(){return this._def.value}}Lp.create=(e,t)=>new Lp({value:e,typeName:ae.ZodLiteral,...ce(t)});function lg(e,t){return new ks({values:e,typeName:ae.ZodEnum,...ce(t)})}class ks extends ye{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return U(n,{expected:xe.joinValues(r),received:n.parsedType,code:A.invalid_type}),se}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return U(n,{received:n.data,code:A.invalid_enum_value,options:r}),se}return Xt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ks.create(t,{...this._def,...n})}exclude(t,n=this._def){return ks.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ks.create=lg;class Op extends ye{_parse(t){const n=xe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==q.string&&r.parsedType!==q.number){const i=xe.objectValues(n);return U(r,{expected:xe.joinValues(i),received:r.parsedType,code:A.invalid_type}),se}if(this._cache||(this._cache=new Set(xe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=xe.objectValues(n);return U(r,{received:r.data,code:A.invalid_enum_value,options:i}),se}return Xt(t.data)}get enum(){return this._def.values}}Op.create=(e,t)=>new Op({values:e,typeName:ae.ZodNativeEnum,...ce(t)});class Cl extends ye{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==q.promise&&n.common.async===!1)return U(n,{code:A.invalid_type,expected:q.promise,received:n.parsedType}),se;const r=n.parsedType===q.promise?n.data:Promise.resolve(n.data);return Xt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cl.create=(e,t)=>new Cl({type:e,typeName:ae.ZodPromise,...ce(t)});class _s extends ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:a=>{U(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);if(r.common.async)return Promise.resolve(a).then(async o=>{if(n.value==="aborted")return se;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?se:l.status==="dirty"||n.value==="dirty"?Js(l.value):l});{if(n.value==="aborted")return se;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?se:o.status==="dirty"||n.value==="dirty"?Js(o.value):o}}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?se:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?se:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!xs(a))return se;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>xs(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:n.value,value:o})):se);xe.assertNever(i)}}_s.create=(e,t,n)=>new _s({schema:e,typeName:ae.ZodEffects,effe)DELIM" -R"DELIM(ct:t,...ce(n)});_s.createWithPreprocess=(e,t,n)=>new _s({schema:t,effect:{type:"preprocess",transform:e},typeName:ae.ZodEffects,...ce(n)});class Lr extends ye{_parse(t){return this._getType(t)===q.undefined?Xt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Lr.create=(e,t)=>new Lr({innerType:e,typeName:ae.ZodOptional,...ce(t)});class Ss extends ye{_parse(t){return this._getType(t)===q.null?Xt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ss.create=(e,t)=>new Ss({innerType:e,typeName:ae.ZodNullable,...ce(t)});class id extends ye{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===q.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}id.create=(e,t)=>new id({innerType:e,typeName:ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ce(t)});class sd extends ye{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return kl(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}sd.create=(e,t)=>new sd({innerType:e,typeName:ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ce(t)});class Dp extends ye{_parse(t){if(this._getType(t)!==q.nan){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.nan,received:r.parsedType}),se}return{status:"valid",value:t.data}}}Dp.create=e=>new Dp({typeName:ae.ZodNaN,...ce(e)});class Bk extends ye{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class _f extends ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?se:s.status==="dirty"?(n.dirty(),Js(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?se:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new _f({in:t,out:n,typeName:ae.ZodPipeline})}}class ad extends ye{_parse(t){const n=this._def.innerType._parse(t),r=i=>(xs(i)&&(i.value=Object.freeze(i.value)),i);return kl(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}ad.create=(e,t)=>new ad({innerType:e,typeName:ae.ZodReadonly,...ce(t)});var ae;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ae||(ae={}));const Ke=_r.create,me=ws.create,Sf=nd.create;$r.create;const Ma=bn.create,Pn=Ze.create;Sl.create;El.create;Si.create;ks.create;Cl.create;Lr.create;Ss.create;class Ef extends Error{constructor(t,n){super(t),this.status=n}}const ug=Pn({id:Ke(),height:me(),timestamp:me().optional(),mediantime:me().optional(),tx_count:me().optional(),size:me().optional(),weight:me().optional(),difficulty:me().optional(),bits:me().optional(),merkle_root:Ke().optional(),previousblockhash:Ke().nullable().optional(),nonce:me().optional(),version:me().optional()}).passthrough(),Uk=Pn({confirmed:Sf(),block_height:me().optional(),block_hash:Ke().optional(),block_time:me().optional()}),Hk=Pn({txid:Ke().optional().nullable(),vout:me().optional().nullable(),sequence:me().optional(),scriptsig:Ke().optional().nullable(),scriptsig_asm:Ke().optional().nullable(),witness:Ma(Ke()).optional(),is_coinbase:Sf().optional(),prevout:Pn({scriptpubkey_type:Ke().optional(),scriptpubkey_address:Ke().optional(),scriptpubkey:Ke().optional(),scriptpubkey_asm:Ke().optional(),value:me().optional()}).partial().nullable().optional()}).passthrough(),Vk=Pn({scriptpubkey_type:Ke().optional(),scriptpubke)DELIM" -R"DELIM(y_address:Ke().optional(),scriptpubkey:Ke().optional(),scriptpubkey_asm:Ke().optional(),value:me(),n:me().optional()}).passthrough(),cg=Pn({txid:Ke(),hash:Ke().optional(),fee:me().optional(),version:me(),locktime:me(),vin:Ma(Hk),vout:Ma(Vk),size:me(),weight:me(),status:Uk}).passthrough(),Qo=Ma(ug),Tl=Ma(cg),Qk=Pn({in_best_chain:Sf(),next_best:Ke().optional(),height:me().optional()}),Wk=Pn({address:Ke(),chain_stats:Pn({funded_txo_count:me().optional(),funded_txo_sum:me().optional(),spent_txo_count:me().optional(),spent_txo_sum:me().optional(),tx_count:me().optional()}),mempool_stats:Pn({funded_txo_count:me().optional(),funded_txo_sum:me().optional(),spent_txo_count:me().optional(),spent_txo_sum:me().optional(),tx_count:me().optional()})});let Co=null,Ct=null;async function Ht(e,t,n){const r=t.startsWith("/")?t:`/${t}`,i=await fetch(`${e}${r}`);if(!i.ok)throw new Ef(`Request to ${t} failed with status ${i.status}`,i.status);const s=await i.json();return n.parse(s)}async function Ap(e){const t=await fetch(`${e}/blocks/tip/height`);if(!t.ok)throw new Ef("Unable to fetch tip height",t.status);const n=Number((await t.text()).trim());if(!Number.isFinite(n))throw new Error("Invalid tip height response");return Ct=n,n}async function Bs(e,t){if(Ct===null){await Ap(e);return}typeof t=="number"&&Cts.scriptpubkey_address===e?i+s.value:i,0),r=t.vin.reduce((i,s)=>{const a=s.prevout;return(a==null?void 0:a.scriptpubkey_address)===e&&typeof a.value=="number"?i+a.value:i},0);return n-r}async function Ip(e,t){if(t==="latest"||t==="tip"){const[n]=await Ht(e,"/blocks",Qo);if(!n)throw new Error("No blocks returned from API");return n.id}if(/^\d+$/.test(t)){const n=await fetch(`${e}/block-height/${t}`);if(!n.ok)throw new Ef("Unable to resolve block height",n.status);return(await n.text()).trim()}return t}async function Kk(e,t){if(Ct==null||t>=Ct)return null;const n=t+1;try{const r=await fetch(`${e}/block-height/${n}`);return r.ok&&(await r.text()).trim()||null}catch(r){return console.warn(`Failed to resolve hash for height ${n}`,r),null}}function To(e){return{hash:e.id,height:e.height,timestamp:e.timestamp??e.mediantime??0,txCount:e.tx_count??0,size:e.size??0,weight:e.weight??0,difficulty:e.difficulty,previousBlockHash:e.previousblockhash??null}}function Fu(e){const t=e.status.confirmed?"confirmed":"unconfirmed",n=e.vin.map((o,l)=>{var d,c,f;const u=o.is_coinbase||o.txid==null?void 0:typeof o.vout=="number"&&o.vout!==4294967295?o.vout:void 0;return{index:l,prevTxId:o.txid??void 0,prevOutputIndex:u,address:((d=o.prevout)==null?void 0:d.scriptpubkey_address)??void 0,valueSats:(c=o.prevout)==null?void 0:c.value,scriptType:(f=o.prevout)==null?void 0:f.scriptpubkey_type,isCoinbase:o.is_coinbase??!1,script:o.scriptsig||o.scriptsig_asm?{hex:o.scriptsig??void 0,mnemonic:o.scriptsig_asm??void 0}:void 0,witness:o.witness??void 0,sequence:o.sequence}}),r=e.vout.map((o,l)=>({index:l,address:o.scriptpubkey_address??void 0,valueSats:o.value,scriptType:o.scriptpubkey_type,spent:void 0,script:o.scriptpubkey||o.scriptpubkey_asm?{hex:o.scriptpubkey??void 0,mnemonic:o.scriptpubkey_asm??void 0}:void 0})),i=r.reduce((o,l)=>o+l.valueSats,0),s=Ct;let a=0;return e.status.block_height&&t==="confirmed"&&(s&&s>=e.status.block_height?a=s-e.status.block_height+1:a=1),{txid:e.txid,hash:e.hash??e.txid,status:t,confirmations:a,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:i,inputs:n,outputs:r}}function Gk(e,t){const n=e.chain_stats,r=e.mempool_stats,i=(n.funded_txo_sum??0)-(n.spent_txo_sum??0),s=dg(e.address,t.slice(0,25));return{address:e.address,addressType:Xl(e.address),balance:i,totalReceived:(n.funded_txo_sum??0)+(r.funded_txo_sum??0),totalSent:(n.spent_txo_sum??0)+(r.spent_txo_sum??0),txCount:(n.tx_count??0)+(r.tx_count??0),utxoCount:(n.funded_txo_count??0)-(n.spent_txo_count??0),transactions:s}}function dg(e,t){return t.map(n=>({txid:n.txid,timestamp:n.status.block_time,valueChange:Zk(e,n),blockHeight:n.status.block_height}))}async function $p(e,t,n=0){const r=n>0?`/block/${t}/txs/${n}`:`/block/${t}/txs`;return Ht(e,r,Tl)}async function qk(e,t,n){return n?Ht(e,`/address/${t}/txs/chain/${n}`,Tl):Ht(e,`/address/${t}/txs`,Tl)}function fg({baseUrl:e}){const t=new Set;let n=null;async function r(){n||t.size===0||(n=setInterval(async()=>{try{const[s]=await Ht(e,"/blocks",Qo);if(!s)return;if(s.id!==Co){Co=s.id,Ct=Math.max(s.height,Ct??0);const a=To(s);t.forEach(o=>o({type:"block.new",payload:a}))}}catch(s){console.warn("Block polling failed",s)}},15e3))}function i(){n&&(clearInterval(n),n=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,description:"Read-only adapter using Blockstream public REST API."},async getLatestBlock)DELIM" -R"DELIM(s(s=10){const a=await Ht(e,"/blocks",Qo);return a.length>0&&(Co=a[0].id,Ct=Math.max(a[0].height,Ct??0)),a.slice(0,s).map(To)},async getBlocksBefore(s,a=10){const o=Math.max(s,0),l=await Ht(e,`/blocks/${o}`,Qo);return l.length>0&&(Ct=Math.max(l[0].height,Ct??0)),l.slice(0,a).map(To)},async getBlock(s){const a=await Ip(e,s);await Bs(e);const o=await Ht(e,`/block/${a}`,ug),[l,u]=await Promise.allSettled([$p(e,a),Ht(e,`/block/${a}/status`,Qk)]);l.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",l.reason),u.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",u.reason);const d=To(o);Co=d.hash,Ct=Math.max(d.height,Ct??d.height);const c=l.status==="fulfilled"?l.value:[],f=u.status==="fulfilled"?u.value:null;let m=(f==null?void 0:f.next_best)??null;return m||(m=await Kk(e,d.height)),{...d,merkleRoot:o.merkle_root,nonce:o.nonce,bits:o.bits,version:o.version,nextBlockHash:m,transactions:c.map(Fu)}},async getBlockTransactions(s,a=0){const o=await Ip(e,s),l=await $p(e,o,a),u=l.reduce((d,c)=>c.status.block_height?d===null?c.status.block_height:Math.max(d,c.status.block_height):d,null);return typeof u=="number"?await Bs(e,u):await Bs(e),l.map(Fu)},async getTransaction(s){const a=await Ht(e,`/tx/${s}`,cg);return a.status.block_height?await Bs(e,a.status.block_height):await Bs(e),Fu(a)},async getAddress(s){const a=await Ht(e,`/address/${s}`,Wk),o=await Ht(e,`/address/${s}/txs`,Tl);return Gk(a,o)},async getAddressTransactions(s,a){const o=await qk(e,s,a);return dg(s,o)},subscribeToEvents(s){return t.add(s),r(),()=>{t.delete(s),t.size===0&&i()}}}}function Yk({baseUrl:e}){const t=fg({baseUrl:e});return{...t,metadata:{...t.metadata,id:"mempool",label:"mempool.space",description:"Adapter backed by mempool.space REST API."}}}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function La(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function hg(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(n=>typeof n=="string"):t.every(n=>Number.isSafeInteger(n)):!1}function pg(e){if(typeof e!="function")throw new Error("function expected");return!0}function Oa(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function Ga(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function bl(e){if(!Array.isArray(e))throw new Error("array expected")}function mg(e,t){if(!hg(!0,t))throw new Error(`${e}: array of strings expected`)}function Cf(e,t){if(!hg(!1,t))throw new Error(`${e}: array of numbers expected`)}function Tf(...e){const t=s=>s,n=(s,a)=>o=>s(a(o)),r=e.map(s=>s.encode).reduceRight(n,t),i=e.map(s=>s.decode).reduce(n,t);return{encode:r,decode:i}}function vg(e){const t=typeof e=="string"?e.split(""):e,n=t.length;mg("alphabet",t);const r=new Map(t.map((i,s)=>[i,s]));return{encode:i=>(bl(i),i.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return t[s]})),decode:i=>(bl(i),i.map(s=>{Oa("alphabet.decode",s);const a=r.get(s);if(a===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return a}))}}function yg(e=""){return Oa("join",e),{encode:t=>(mg("join.decode",t),t.join(e)),decode:t=>(Oa("join.decode",t),t.split(e))}}function Fp(e,t,n){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(bl(e),!e.length)return[];let r=0;const i=[],s=Array.from(e,o=>{if(Ga(o),o<0||o>=t)throw new Error(`invalid integer: ${o}`);return o}),a=s.length;for(;;){let o=0,l=!0;for(let u=r;ut===0?e:gg(t,e%t),Pl=(e,t)=>e+(t-gg(e,t)),Wo=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function od(e,t,n,r){if(bl(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(Pl(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${Pl(t,n)}`);let i=0,s=0;const a=Wo[t],o=Wo[n]-1,l=[];for(const u of e){if(Ga(u),u>=a)throw new Error(`convertRadix2: invalid data word=${u} from=${t}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=n;s-=n)l.push((i>>s-n&o)>>>0);const d=Wo[s];if(d===void 0)throw new Error("invalid carry");i&=d-1}if(i=i<=t)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&s>0&&l.push(i>>>0),l}function Xk(e){Ga(e);const t=2**8;return{encode:n=>{if(!La(n))throw )DELIM" -R"DELIM(new Error("radix.encode input should be Uint8Array");return Fp(Array.from(n),t,e)},decode:n=>(Cf("radix.decode",n),Uint8Array.from(Fp(n,e,t)))}}function Jk(e,t=!1){if(Ga(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Pl(8,e)>32||Pl(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!La(n))throw new Error("radix2.encode input should be Uint8Array");return od(Array.from(n),8,e,!t)},decode:n=>(Cf("radix2.decode",n),Uint8Array.from(od(n,e,8,t)))}}function zp(e){return pg(e),function(...t){try{return e.apply(null,t)}catch{}}}function e_(e,t){return Ga(e),pg(t),{encode(n){if(!La(n))throw new Error("checksum.encode: input should be Uint8Array");const r=t(n).slice(0,e),i=new Uint8Array(n.length+e);return i.set(n),i.set(r,n.length),i},decode(n){if(!La(n))throw new Error("checksum.decode: input should be Uint8Array");const r=n.slice(0,-e),i=n.slice(-e),s=t(r).slice(0,e);for(let a=0;aTf(Xk(58),vg(e),yg("")),n_=t_("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),r_=e=>Tf(e_(4,t=>e(e(t))),n_),i_=r_,ld=Tf(vg("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),yg("")),Bp=[996825010,642813549,513874426,1027748829,705979059];function Us(e){const t=e>>25;let n=(e&33554431)<<5;for(let r=0;r>r&1)===1&&(n^=Bp[r]);return n}function Up(e,t,n=1){const r=e.length;let i=1;for(let s=0;s126)throw new Error(`Invalid prefix (${e})`);i=Us(i)^a>>5}i=Us(i);for(let s=0;sm)throw new TypeError(`Length ${x} exceeds limit ${m}`);const T=c.toLowerCase(),v=Up(T,f,t);return`${T}1${ld.encode(f)}${v}`}function o(c,f=90){Oa("bech32.decode input",c);const m=c.length;if(m<8||f!==!1&&m>f)throw new TypeError(`invalid string length: ${m} (${c}). Expected (8..${f})`);const g=c.toLowerCase();if(c!==g&&c!==c.toUpperCase())throw new Error("String must be lowercase or uppercase");const x=g.lastIndexOf("1");if(x===0||x===-1)throw new Error('Letter "1" must be present between prefix and data only');const T=g.slice(0,x),v=g.slice(x+1);if(v.length<6)throw new Error("Data must be at least 6 characters long");const p=ld.decode(v).slice(0,-6),y=Up(T,p,t);if(!v.endsWith(y))throw new Error(`Invalid checksum in ${c}: expected "${y}"`);return{prefix:T,words:p}}const l=zp(o);function u(c){const{prefix:f,words:m}=o(c,!1);return{prefix:f,words:m,bytes:r(m)}}function d(c,f){return a(c,i(f))}return{encode:a,decode:o,encodeFromBytes:d,decodeToBytes:u,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:s,toWords:i}}const ud=xg("bech32"),wg=xg("bech32m");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function s_(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Jl(e,...t){if(!s_(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Hp(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 a_(e,t){Jl(e);const n=t.outputLen;if(e.length>>t}const o_=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",l_=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function dd(e){if(Jl(e),o_)return e.toHex();let t="";for(let n=0;ne().update(kg(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function f_(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const i=BigInt(32),s=BigInt(4294967295),a=Number(n>>i&s),o=Number(n&s),l=r?4:0,u=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+u,o,r)}function h_(e,t,n){return e&t^~e&n}function p_(e,t,n){return e&t^e&n^t&n}class m_ extends c_{constructor(t,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=zu(this.buffer)}update(t){Hp(this),t=kg(t),Jl(t);const{view:n,buffer:r,bl)DELIM" -R"DELIM(ockLen:i}=this,s=t.length;for(let a=0;ai-a&&(this.process(r,0),a=0);for(let c=a;cd.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;c>>3,x=yn(m,17)^yn(m,19)^m>>>10;nr[c]=x+nr[c-7]+g+nr[c-16]|0}let{A:r,B:i,C:s,D:a,E:o,F:l,G:u,H:d}=this;for(let c=0;c<64;c++){const f=yn(o,6)^yn(o,11)^yn(o,25),m=d+f+h_(o,l,u)+v_[c]+nr[c]|0,x=(yn(r,2)^yn(r,13)^yn(r,22))+p_(r,i,s)|0;d=u,u=l,l=o,o=a+m|0,a=s,s=i,i=r,r=m+x|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,i,s,a,o,l,u,d)}roundClean(){cd(nr)}destroy(){this.set(0,0,0,0,0,0,0,0),cd(this.buffer)}}const g_=d_(()=>new y_),_g=g_,Sg=i_(_g),x_=BigInt("0x00000000FFFF0000000000000000000000000000000000000000000000000000"),Vp=5e3,Bu=new Map;async function Zt(e,t,n){const r=t.startsWith("/")?t:`/${t}`;let i=r.includes("?")?`${e}${r}`:`${e}${r}?format=json`;n&&(i+=i.includes("?")?"&turbo=true":"?turbo=true");const s=await fetch(i);if(!s.ok){const o=await s.text().catch(()=>"");throw new Error(`Request failed ${s.status}: ${o||s.statusText}`)}const a=await s.text();try{return JSON.parse(a)}catch{return a}}async function bo(e,t,n){try{return await Zt(e,t,n)}catch{return null}}function bf(e){if(e.length%2!==0)throw new Error("Invalid hex string");const t=new Uint8Array(e.length/2);for(let n=0;n>>24,n=e&8388607;if(n===0||t<3)return;const r=BigInt(n)*(1n<n[1]).filter(Boolean);return t.length?t:[e]}function Pf(e){const t=e.toLowerCase();if(t.includes("dup hash160")&&t.includes("equalverify checksig"))return"p2pkh";if(t.startsWith("hash160")&&t.includes("equal"))return"p2sh";if(t.startsWith("zero [")){const n=t.match(/zero \[([0-9a-f]+)\]/),r=(n==null?void 0:n[1])??"";return r.length===40?"p2wpkh":r.length===64?"p2wsh":"segwit"}if(t.startsWith("1 ["))return"p2tr"}function __(){return"mainnet"}function S_(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function Qp(e,t){const n=new Uint8Array(t.length/2+1);return n[0]=e,n.set(bf(t),1),Sg.encode(n)}function Uu(e,t,n){const r=bf(n),i=ud.toWords(r);return i.unshift(t),(t===0?ud:wg).encode(e,i)}function Eg(e,t){const n=e.toLowerCase(),r=n.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(r)return{address:Qp(t.p2pkh,r[1]),type:"p2pkh"};const i=n.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(i)return{addr)DELIM" -R"DELIM(ess:Qp(t.p2sh,i[1]),type:"p2sh"};const s=n.match(/^zero \[([0-9a-f]{40})\]/);if(s)return{address:Uu(t.hrp,0,s[1]),type:"p2wpkh"};const a=n.match(/^zero \[([0-9a-f]{64})\]/);if(a)return{address:Uu(t.hrp,0,a[1]),type:"p2wsh"};const o=n.match(/^1 \[([0-9a-f]{64})\]/);return o?{address:Uu(t.hrp,1,o[1]),type:"p2tr"}:{type:Pf(e)}}function E_(e,t){try{const i=Sg.decode(e),s=i[0],a=dd(i.slice(1));if(a.length===40&&s===t.p2pkh)return{scriptHex:`76a914${a}88ac`,type:"p2pkh"};if(a.length===40&&s===t.p2sh)return{scriptHex:`a914${a}87`,type:"p2sh"}}catch{}const n=e.toLowerCase();if(n.indexOf("1")>0){const i=n,s=i.startsWith(`${t.hrp}1`)?ud:wg;try{const{prefix:a,words:o}=s.decode(i,90);if(a!==t.hrp)throw new Error("wrong hrp");const l=o[0],u=s.fromWords(o.slice(1)),d=dd(u),c=u.length.toString(16).padStart(2,"0");if(l===0&&(u.length===20||u.length===32))return{scriptHex:`00${c}${d}`,type:u.length===20?"p2wpkh":"p2wsh"};if(l===1&&u.length===32)return{scriptHex:`51${c}${d}`,type:"p2tr"}}catch{}}return null}function Wp(e,t){const n=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(n))return{hash:n,type:"script-hash"};const r=E_(e,t);if(!r)return null;const i=_g(bf(r.scriptHex)),s=Uint8Array.from(i).reverse();return{hash:dd(s),type:r.type}}async function fd(e,t){const n=await Zt(e,"/v1/top?format=json",t),r=typeof n=="number"?n:Number(n);if(!Number.isFinite(r))throw new Error("Invalid top height");return r}async function Zo(e,t){const n=Date.now(),r=`${e}|${t?"1":"0"}`,i=Bu.get(r);if(i&&i.expiresAt>n)return i.promise;const s=fd(e,t).then(a=>(Bu.set(r,{promise:s,value:a,expiresAt:Date.now()+Vp}),a));return Bu.set(r,{promise:s,value:(i==null?void 0:i.value)??null,expiresAt:n+Vp}),s}async function Zp(e,t,n){if(t==="latest"||t==="tip"){const r=await Zo(e,n);return{path:`/v1/block/height/${r}`,height:r}}return/^\d+$/u.test(t)?{path:`/v1/block/height/${t}`}:{path:`/v1/block/hash/${t}`}}function Po(e,t){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:t,size:void 0,weight:void 0,difficulty:w_(e.bits),previousBlockHash:e.previous??null}}function C_(e){const t=k_(e);return t&&t.length>0?t:void 0}function T_(e,t,n,r){const i=/^0{64}$/u.test(e.point.hash),s=t?Eg(t.script,n):{address:void 0,type:void 0};return{index:r,prevTxId:i?void 0:e.point.hash,prevOutputIndex:i?void 0:e.point.index,address:s.address,valueSats:t==null?void 0:t.value,scriptType:s.type??Pf((t==null?void 0:t.script)??e.script),isCoinbase:i,script:e.script?{mnemonic:e.script}:void 0,witness:C_(e.witness),sequence:e.sequence}}function b_(e,t,n){const r=Eg(e.script,n);return{index:t,address:r.address,valueSats:e.value,scriptType:r.type??Pf(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function P_(e,t){return typeof e!="number"||typeof t!="number"?0:Math.max(0,e-t+1)}async function N_(e,t){const n=new Map;return(r,i)=>{const s=`${r}:${i}`;if(n.has(s))return n.get(s);const a=Zt(e,`/v1/output/${r}/${i}?format=json`,t).catch(()=>{});return n.set(s,a),a}}async function Hu(e,t,n,r,i){const s=r?await Promise.all(e.inputs.map(c=>/^0{64}$/u.test(c.point.hash)?Promise.resolve(void 0):r(c.point.hash,c.point.index).catch(()=>{}))):[],a=e.outputs.map((c,f)=>b_(c,f,t)),o=a.reduce((c,f)=>c+f.valueSats,0),l=s.reduce((c,f)=>(f==null?void 0:f.value)===void 0?c:(c??0)+f.value,null),u=P_(n.tipHeight,n.blockHeight),d=typeof n.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:d,confirmations:u,blockHeight:n.blockHeight,blockHash:n.blockHash,receivedTime:n.timestamp,feeSats:Number.isFinite(i)?i:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:l,totalOutput:o,inputs:e.inputs.map((c,f)=>T_(c,s[f],t,f)),outputs:a}}async function R_(e,t,n){return Zt(e,`${t}/txs?format=json`,n)}async function j_(e,t,n,r){return Zt(e,`${t}/tx/${n}?format=json`,r)}async function M_(e,t,n){return await Zt(e,`${t}?format=json`,n)}async function Kp(e,t,n){return await Zt(e,`/v1/address/${t}?format=json`,n).catch(()=>[])}function L_({baseUrl:e,pollIntervalMs:t=15e3,turbo:n=!1}){const r=new Set;let i=null,s=null;const a=S_(__());async function o(){i||(i=setInterval(async()=>{try{const u=await fd(e,n);if(s===null){s=u;return}if(u>s){const d=await Zt(e,`/v1/block/height/${u}/header?format=json`,n),c=Po(d);r.forEach(f=>f({type:"block.new",payload:c})),s=u}}catch(u){console.warn("Libbitcoin poller failed",u)}},t))}function l(){i&&(clearInterval(i),i=null)}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:!1,description:"Adapter for the libbitcoin embedded REST API."},async getLatestBlocks(u=10){const d=await Zo(e,n);s=d;const c=Array.from({length:u},(m,g)=>d-g).filter(m=>m>=0);return(await Promise.all(c.map(m=>Zt(e,`/v1/block/height/${m}/header?format=json`,n)))).map(m=>Po(m))},async getBlocksBefore(u,d=10){const c=Array.from({length:d},(m,g)=>u-g).filter(m=>m>=0);return(await Promise.all(c.map(m=>Zt(e,`/v1/block/height/${m}/header?format=json`,n)))).map(m=>Po(m)))DELIM" -R"DELIM(},async getBlock(u){var v;const{path:d}=await Zp(e,u,n),[c,f]=await Promise.all([M_(e,d,n),Zo(e,n)]);s=Math.max(s??0,f);let m=null;if(c.header.heightHu(p,a,{blockHeight:c.header.height,blockHash:c.header.hash,tipHeight:f,timestamp:c.header.timestamp})));return{...x,merkleRoot:c.header.merkle_root,nonce:c.header.nonce,bits:c.header.bits,version:c.header.version,nextBlockHash:m,transactions:T}},async getBlockTransactions(u,d=0){const{path:c}=await Zp(e,u,n),f=await Zt(e,`${c}/header?format=json`,n),[m,g]=await Promise.all([R_(e,c,n),Zo(e,n)]);s=Math.max(s??0,g);const x=m.slice(d);return await Promise.all(x.map((v,p)=>j_(e,c,d+p,n).then(y=>Hu(y,a,{blockHeight:f.height,blockHash:f.hash,tipHeight:g,timestamp:f.timestamp}))))},async getTransaction(u){const d=await Zt(e,`/v1/tx/${u}?format=json`,n),[c,f,m]=await Promise.all([bo(e,`/v1/tx/${u}/header?format=json`,n),fd(e,n).catch(()=>null),bo(e,`/v1/tx/${u}/fee?format=json`,n)]),g=await N_(e,n),x=typeof m=="number"?m:Number(m);return Hu(d,a,{blockHeight:c==null?void 0:c.height,blockHash:c==null?void 0:c.hash,tipHeight:typeof f=="number"?f:void 0,timestamp:c==null?void 0:c.timestamp},g,Number.isFinite(x)?x:void 0)},async getAddress(u){const d=Wp(u,a);if(!d)throw new Error("Unsupported address format for libbitcoin adapter");const[c,f]=await Promise.all([bo(e,`/v1/address/${d.hash}/balance?format=json`,n),Kp(e,d.hash,n)]),m=typeof c=="number"?c:Number(c);let g=0;for(const v of f)g+=v.value??0;const x=Number.isFinite(m)?m:g,T=f.map(v=>({txid:v.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:v.value}));return{address:u,addressType:d.type,balance:x,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:void 0,transactions:T}},async getAddressTransactions(u){const d=Wp(u,a);return d?(await Kp(e,d.hash,n)).map(f=>({txid:f.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:f.value})):[]},subscribeToEvents(u){return r.add(u),o(),()=>{r.delete(u),r.size===0&&l()}}}}const Cg=C.createContext(null),Tg=C.createContext(null),bg=C.createContext(null);function O_({children:e,client:t}){return h.jsx(Cg.Provider,{value:t,children:e})}function D_({children:e,provider:t,setProvider:n,availableProviders:r}){return h.jsx(Tg.Provider,{value:{provider:t,setProvider:n,availableProviders:r},children:e})}function A_({children:e,turbo:t,setTurbo:n}){return h.jsx(bg.Provider,{value:{turbo:t,setTurbo:n},children:e})}function qn(){const e=C.useContext(Cg);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function I_(){return qn().metadata}function $_(){const e=C.useContext(Tg);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function F_(){const e=C.useContext(bg);if(!e)throw new Error("TurboProvider missing in component tree");return e}function z_(){var e;return typeof window<"u"&&((e=window.location)!=null&&e.origin)?window.location.origin:"http://localhost:8080"}function B_(e){return Pg("libbitcoin",e)}function Pg(e,t){if(e==="blockstream")return fg({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return Yk({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const n=z_();return L_({baseUrl:n,turbo:t==null?void 0:t.turboEnabled})}return e==="external"?(console.warn("No external API URL provided, falling back to mock client"),Iu()):(e==="mock"||console.warn(`Unknown provider "${e}", falling back to mock`),Iu())}function U_(){const e=new Set;return e.add("libbitcoin"),e.add("blockstream"),e.add("mempool"),Array.from(e)}const Gp=new kw({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}});function H_({children:e}){const t="libbitcoin",[n,r]=C.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("turboEnabled")==="true"),[i,s]=C.useState(t),[a,o]=C.useState(()=>B_({turboEnabled:n})),l=C.useRef(!0);return C.useEffect(()=>{typeof window<"u"&&window.localStorage.setItem("turboEnabled",n?"true":"false")},[n]),C.useEffect(()=>{if(l.current){l.current=!1;return}o(Pg(i,{turboEnabled:n})),Gp.clear()},[i,n]),h.jsx(D_,{provider:i,setProvider:s,availableProviders:U_(),children:h.jsx(A_,{turbo:n,setTurbo:r,children:h.jsx(O_,{client:a,children:h.jsxs(_w,{client:Gp,children:[e,null]})})})})}/** +`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Mu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Nc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var T1=typeof WeakMap=="function"?WeakMap:Map;function yy(e,t,n){n=Bn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){vl||(vl=!0,$c=r),Nc(e,t)},n}function gy(e,t,n){n=Bn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Nc(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Nc(e,t),typeof r!="function"&&(Pr===null?Pr=new Set([this]):Pr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Vh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new T1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=z1.bind(null,e,t,n),t.then(e,e))}function Qh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Wh(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bn(-1,1),t.tag=2,Nr(n,t,1))),n.lanes|=1),e)}var b1=Gn.ReactCurrentOwner,bt=!1;function yt(e,t,n,r){t.child=e===null?Zv(t,null,n,r):ms(t,e.child,n,r)}function Zh(e,t,n,r,i){n=n.render;var s=t.ref;return Yi(t,i),r=Jd(e,t,n,r,s,i),n=ef(),e!==null&&!bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wn(e,t,i)):(Le&&n&&Bd(t),t.flags|=1,yt(e,t,r,i),t.child)}function Kh(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!df(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,xy(e,t,s,r,i)):(e=Vo(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:ga,n(a,r)&&e.ref===t.ref)return Wn(e,t,i)}return t.flags|=1,e=jr(s,r),e.ref=t.ref,e.return=t,t.child=e}function xy(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ga(s,r)&&e.ref===t.ref)if(bt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(bt=!0);else return t.lanes=e.lanes,Wn(e,t,i)}return Pc(e,t,n,r,i)}function wy(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(Wi,jt),jt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pe(Wi,jt),jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Pe(Wi,jt),jt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Pe(Wi,jt),jt|=r;return yt(e,t,i,n),t.child}function ky(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Pc(e,t,n,r,i){var s=Pt(n)?yi:pt.current;return s=hs(t,s),Yi(t,i),n=Jd(e,t,n,r,s,i),r=ef(),e!==null&&!bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wn(e,t,i)):(Le&&r&&Bd(t),t.flags|=1,yt(e,t,n,i),t.child)}function Gh(e,t,n,r,i){if(Pt(n)){var s=!0;al(t)}else s=!1;if(Yi(t,i),t.stateNode===null)Bo(e,t),vy(t,n,r),bc(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=qt(u):(u=Pt(n)?yi:pt.current,u=hs(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";c||typeof a.UNSAFE_componentWillReceiveProps!="fun)DELIM" +R"DELIM(ction"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==u)&&Hh(t,a,r,u),lr=!1;var f=t.memoizedState;a.state=f,dl(t,r,a,i),l=t.memoizedState,o!==r||f!==l||Nt.current||lr?(typeof d=="function"&&(Tc(t,n,d,r),l=t.memoizedState),(o=lr||Uh(t,n,o,r,f,l,u))?(c||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Gv(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:nn(t.type,o),a.props=u,c=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=qt(l):(l=Pt(n)?yi:pt.current,l=hs(t,l));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==c||f!==l)&&Hh(t,a,r,l),lr=!1,f=t.memoizedState,a.state=f,dl(t,r,a,i);var g=t.memoizedState;o!==c||f!==g||Nt.current||lr?(typeof m=="function"&&(Tc(t,n,m,r),g=t.memoizedState),(u=lr||Uh(t,n,u,r,f,g,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,g,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,g,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Rc(e,t,n,r,s,i)}function Rc(e,t,n,r,i,s){ky(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&Oh(t,n,!1),Wn(e,t,s);r=t.stateNode,b1.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=ms(t,e.child,null,s),t.child=ms(t,null,o,s)):yt(e,t,o,s),t.memoizedState=r.state,i&&Oh(t,n,!0),t.child}function _y(e){var t=e.stateNode;t.pendingContext?Lh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Lh(e,t.context,!1),Gd(e,t.containerInfo)}function qh(e,t,n,r,i){return ps(),Hd(i),t.flags|=256,yt(e,t,n,r),t.child}var jc={dehydrated:null,treeContext:null,retryLane:0};function Mc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sy(e,t,n){var r=t.pendingProps,i=Oe.current,s=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Pe(Oe,i&1),e===null)return Ec(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=Ql(a,r,0,null),e=pi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Mc(n),t.memoizedState=jc,e):rf(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return N1(e,t,a,r,o,i,n);if(s){s=r.fallback,a=t.mode,i=e.child,o=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=jr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=jr(o,s):(s=pi(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?Mc(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=jc,r}return s=e.child,e=s.sibling,r=jr(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function rf(e,t){return t=Ql({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function wo(e,t,n,r){return r!==null&&Hd(r),ms(t,e.child,null,n),e=rf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function N1(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=Mu(Error(O(422))),wo(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Ql({mode:"visible",children:r.children},i,0,null),s=pi(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&ms(t,e.child,null,a),t.child.memoizedState=Mc(a),t.memo)DELIM" +R"DELIM(izedState=jc,s);if(!(t.mode&1))return wo(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(O(419)),r=Mu(s,r,void 0),wo(e,t,a,r)}if(o=(a&e.childLanes)!==0,bt||o){if(r=nt,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Qn(e,i),dn(r,e,i,-1))}return cf(),r=Mu(Error(O(421))),wo(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=B1.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Lt=br(i.nextSibling),Ot=t,Le=!0,ln=null,e!==null&&(Qt[Wt++]=Fn,Qt[Wt++]=zn,Qt[Wt++]=gi,Fn=e.id,zn=e.overflow,gi=t),t=rf(t,r.children),t.flags|=4096,t)}function Yh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Cc(e.return,t,n)}function Lu(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Ey(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(yt(e,t,r.children,n),r=Oe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yh(e,n,t);else if(e.tag===19)Yh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Pe(Oe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Lu(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Lu(t,!0,n,null,s);break;case"together":Lu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),wi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,n=jr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=jr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function P1(e,t,n){switch(t.tag){case 3:_y(t),ps();break;case 5:qv(t);break;case 1:Pt(t.type)&&al(t);break;case 4:Gd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Pe(ul,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Pe(Oe,Oe.current&1),t.flags|=128,null):n&t.child.childLanes?Sy(e,t,n):(Pe(Oe,Oe.current&1),e=Wn(e,t,n),e!==null?e.sibling:null);Pe(Oe,Oe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ey(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Pe(Oe,Oe.current),r)break;return null;case 22:case 23:return t.lanes=0,wy(e,t,n)}return Wn(e,t,n)}var Cy,Lc,Ty,by;Cy=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Lc=function(){};Ty=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ti(Tn.current);var s=null;switch(n){case"input":i=tc(e,i),r=tc(e,r),s=[];break;case"select":i=Ae({},i,{value:void 0}),r=Ae({},r,{value:void 0}),s=[];break;case"textarea":i=ic(e,i),r=ic(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=il)}ac(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(da.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="su)DELIM" +R"DELIM(ppressHydrationWarning"&&(da.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Re("scroll",e),s||o===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};by=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fs(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function R1(e,t,n){var r=t.pendingProps;switch(Ud(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return Pt(t.type)&&sl(),ft(t),null;case 3:return r=t.stateNode,vs(),je(Nt),je(pt),Yd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(go(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ln!==null&&(Bc(ln),ln=null))),Lc(e,t),ft(t),null;case 5:qd(t);var i=ti(Sa.current);if(n=t.type,e!==null&&t.stateNode!=null)Ty(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(O(166));return ft(t),null}if(e=ti(Tn.current),go(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[_n]=t,r[ka]=s,e=(t.mode&1)!==0,n){case"dialog":Re("cancel",r),Re("close",r);break;case"iframe":case"object":case"embed":Re("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[_n]=t,e[ka]=r,Cy(e,t,!1,!1),t.stateNode=e;e:{switch(a=oc(n,r),n){case"dialog":Re("cancel",e),Re("close",e),i=r;break;case"iframe":case"object":case"embed":Re("load",e),i=r;break;case"video":case"audio":for(i=0;igs&&(t.flags|=128,r=!0,Fs(s,!1),t.lanes=4194304)}else{if(!r)if(e=fl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Le)return ft(t),null}else 2*He()-s.renderingStartTime>gs&&n!==1073741824&&(t.flags|=128,r=!0,Fs(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=He(),t.sibling=null,n=Oe.current,Pe(Oe,r?n&1|2:n&1),t):(ft(t),null);case 22:case 23:return uf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?jt&1073741824&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function j1(e,t){switch(Ud(t),t.tag){case 1:return Pt(t.type)&&sl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vs(),je(Nt),je(pt),Yd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qd(t),null;case 13:if(je(Oe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));ps()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Oe),null;case 4:return vs(),null;case 10:return Wd(t.type._context),null;case 22:case 23:return uf(),null;case 24:return null;default:return null}}var ko=!1,ht=!1,M1=typeof WeakSet=="function"?WeakSet:Set,V=null;function Qi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Be(e,t,r)}else n.current=null}function Oc(e,t,n){try{n()}catch(r){Be(e,t,r)}}var Xh=!1;function L1(e,t){if(yc=tl,e=Mv(),zd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var m;c!==n||i!==0&&c.nodeType!==3||(o=a+i),c!==s||r!==0&&c.nodeType!==3||(l=a+r),c.nodeType===3&&(a+=c.nodeValue.length),(m=c.firstChild)!==null;)f=c,c=m;for(;;){if(c===e)break t;if(f===n&&++u===i&&(o=a),f===s&&++d===r&&(l=a),(m=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=m}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(gc={focusedElem:e,selectionRange:n},tl=!1,V=t;V!==null;)if(t=V,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var x=g.memoizedProps,T=g.memoizedState,v=t.stateNode,p=v.getSnapshotBeforeUpdate(t.elementType===t.type?x:nn(t.type,x),T);v.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChil)DELIM" +R"DELIM(d(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(S){Be(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return g=Xh,Xh=!1,g}function oa(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Oc(t,n,s)}i=i.next}while(i!==r)}}function Hl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Dc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ny(e){var t=e.alternate;t!==null&&(e.alternate=null,Ny(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_n],delete t[ka],delete t[kc],delete t[m1],delete t[v1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Py(e){return e.tag===5||e.tag===3||e.tag===4}function Jh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Py(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ac(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=il));else if(r!==4&&(e=e.child,e!==null))for(Ac(e,t,n),e=e.sibling;e!==null;)Ac(e,t,n),e=e.sibling}function Ic(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ic(e,t,n),e=e.sibling;e!==null;)Ic(e,t,n),e=e.sibling}var st=null,an=!1;function er(e,t,n){for(n=n.child;n!==null;)Ry(e,t,n),n=n.sibling}function Ry(e,t,n){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(Dl,n)}catch{}switch(n.tag){case 5:ht||Qi(n,t);case 6:var r=st,i=an;st=null,er(e,t,n),st=r,an=i,st!==null&&(an?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(an?(e=st,n=n.stateNode,e.nodeType===8?Tu(e.parentNode,n):e.nodeType===1&&Tu(e,n),va(e)):Tu(st,n.stateNode));break;case 4:r=st,i=an,st=n.stateNode.containerInfo,an=!0,er(e,t,n),st=r,an=i;break;case 0:case 11:case 14:case 15:if(!ht&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&Oc(n,t,a),i=i.next}while(i!==r)}er(e,t,n);break;case 1:if(!ht&&(Qi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Be(n,t,o)}er(e,t,n);break;case 21:er(e,t,n);break;case 22:n.mode&1?(ht=(r=ht)||n.memoizedState!==null,er(e,t,n),ht=r):er(e,t,n);break;default:er(e,t,n)}}function ep(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new M1),t.forEach(function(r){var i=U1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function en(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~s}if(r=i,r=He()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*D1(r/1960))-r,10e?16:e,kr===null)var r=!1;else{if(e=kr,kr=null,yl=0,ve&6)throw Error(O(331));var i=ve;for(ve|=4,V=e.current;V!==null;){var s=V,a=s.child;if(V.flags&16){var o=s.deletions;if(o!==null){for(var l=0;lHe()-of?hi(e,0):af|=n),Rt(e,t)}function $y(e,t){t===0&&(e.mode&1?(t=fo,fo<<=1,!(fo&130023424)&&(fo=4194304)):t=1);var n=xt();e=Qn(e,t),e!==null&&(Ha(e,t,n),Rt(e,n))}function B1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$y(e,n)}function U1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(O(314))}r!==null&&r.delete(t),$y(e,n)}var Fy;Fy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nt.current)bt=!0;e)DELIM" +R"DELIM(lse{if(!(e.lanes&n)&&!(t.flags&128))return bt=!1,P1(e,t,n);bt=!!(e.flags&131072)}else bt=!1,Le&&t.flags&1048576&&Hv(t,ll,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Bo(e,t),e=t.pendingProps;var i=hs(t,pt.current);Yi(t,n),i=Jd(null,t,r,e,i,n);var s=ef();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Pt(r)?(s=!0,al(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Kd(t),i.updater=Ul,t.stateNode=i,i._reactInternals=t,bc(t,r,e,n),t=Rc(null,t,r,!0,s,n)):(t.tag=0,Le&&s&&Bd(t),yt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Bo(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=V1(r),e=nn(r,e),i){case 0:t=Pc(null,t,r,e,n);break e;case 1:t=Gh(null,t,r,e,n);break e;case 11:t=Zh(null,t,r,e,n);break e;case 14:t=Kh(null,t,r,nn(r.type,e),n);break e}throw Error(O(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nn(r,i),Pc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nn(r,i),Gh(e,t,r,i,n);case 3:e:{if(_y(t),e===null)throw Error(O(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Gv(e,t),dl(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=ys(Error(O(423)),t),t=qh(e,t,r,n,i);break e}else if(r!==i){i=ys(Error(O(424)),t),t=qh(e,t,r,n,i);break e}else for(Lt=br(t.stateNode.containerInfo.firstChild),Ot=t,Le=!0,ln=null,n=Zv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ps(),r===i){t=Wn(e,t,n);break e}yt(e,t,r,n)}t=t.child}return t;case 5:return qv(t),e===null&&Ec(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,xc(r,i)?a=null:s!==null&&xc(r,s)&&(t.flags|=32),ky(e,t),yt(e,t,a,n),t.child;case 6:return e===null&&Ec(t),null;case 13:return Sy(e,t,n);case 4:return Gd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ms(t,null,r,n):yt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nn(r,i),Zh(e,t,r,i,n);case 7:return yt(e,t,t.pendingProps,n),t.child;case 8:return yt(e,t,t.pendingProps.children,n),t.child;case 12:return yt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,Pe(ul,r._currentValue),r._currentValue=a,s!==null)if(fn(s.value,a)){if(s.children===i.children&&!Nt.current){t=Wn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Bn(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Cc(s.return,n,t),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(O(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Cc(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}yt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Yi(t,n),i=qt(i),r=r(i),t.flags|=1,yt(e,t,r,n),t.child;case 14:return r=t.type,i=nn(r,t.pendingProps),i=nn(r.type,i),Kh(e,t,r,i,n);case 15:return xy(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:nn(r,i),Bo(e,t),t.tag=1,Pt(r)?(e=!0,al(t)):e=!1,Yi(t,n),vy(t,r,i),bc(t,r,i,n),Rc(null,t,r,!0,e,n);case 19:return Ey(e,t,n);case 22:return wy(e,t,n)}throw Error(O(156,t.tag))};function zy(e,t){return hv(e,t)}function H1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(e,t,n,r){return new H1(e,t,n,r)}function df(e){return e=e.prototype,!(!e||!e.isReactComponent)}function V1(e){if(typeof e=="function")return df(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pd)return 11;if(e===Rd)return 14}return 2}function jr(e,t){var n=e.alternate;return n===null?(n=Kt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.ind)DELIM" +R"DELIM(ex,n.ref=e.ref,n}function Vo(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")df(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ai:return pi(n.children,i,s,t);case Nd:a=8,i|=8;break;case Yu:return e=Kt(12,n,t,i|2),e.elementType=Yu,e.lanes=s,e;case Xu:return e=Kt(13,n,t,i),e.elementType=Xu,e.lanes=s,e;case Ju:return e=Kt(19,n,t,i),e.elementType=Ju,e.lanes=s,e;case qm:return Ql(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Km:a=10;break e;case Gm:a=9;break e;case Pd:a=11;break e;case Rd:a=14;break e;case or:a=16,r=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=Kt(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function pi(e,t,n,r){return e=Kt(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kt(22,e,r,t),e.elementType=qm,e.lanes=n,e.stateNode={isHidden:!1},e}function Ou(e,t,n){return e=Kt(6,e,null,t),e.lanes=n,e}function Du(e,t,n){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Q1(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mu(0),this.expirationTimes=mu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ff(e,t,n,r,i,s,a,o,l){return e=new Q1(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Kt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Kd(s),e}function W1(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vy)}catch(e){console.error(e)}}Vy(),Vm.exports=It;var vf=Vm.exports;const Y1=Ll(vf),X1=jm({__proto__:null,default:Y1},[vf]);var lp=vf;Gu.createRoot=lp.createRoot,Gu.hydrateRoot=lp.hydrateRoot;var Za=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},J1={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fr,wd,wm,ew=(wm=class{constructor(){ne(this,fr,J1);ne(this,wd,!1)}setTimeoutProvider(e){H(this,fr,e)}setTimeout(e,t){return _(this,fr).setTimeout(e,t)}clearTimeout(e){_(this,fr).clearTimeout(e)}setInterval(e,t){return _(this,fr).setInterval(e,t)}clearInterval(e){_(this,fr).clearInterval(e)}},fr=new WeakMap,wd=new WeakMap,wm),ni=new ew;function tw(e){setTimeout(e,0)}var _i=typeof window>"u"||"Deno"in globalThis;function Et(){}function nw(e,t){return typeof e=="function"?e(t):e}function Uc(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qy(e,t){return Math.max(e+(t||0)-Date.no)DELIM" +R"DELIM(w(),0)}function Mr(e,t){return typeof e=="function"?e(t):e}function Vt(e,t){return typeof e=="function"?e(t):e}function up(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==yf(a,t.options))return!1}else if(!Pa(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||s&&!s(t))}function cp(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Na(t.options.mutationKey)!==Na(s))return!1}else if(!Pa(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function yf(e,t){return((t==null?void 0:t.queryKeyHashFn)||Na)(e)}function Na(e){return JSON.stringify(e,(t,n)=>Vc(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Pa(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Pa(e[n],t[n])):!1}var rw=Object.prototype.hasOwnProperty;function Wy(e,t){if(e===t)return e;const n=dp(e)&&dp(t);if(!n&&!(Vc(e)&&Vc(t)))return t;const i=(n?e:Object.keys(e)).length,s=n?t:Object.keys(t),a=s.length,o=n?new Array(a):{};let l=0;for(let u=0;u{ni.setTimeout(t,e)})}function Qc(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Wy(e,t):t}function sw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function aw(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var gf=Symbol();function Zy(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===gf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ow(e,t){return typeof e=="function"?e(...t):!!e}var ii,hr,es,km,lw=(km=class extends Za{constructor(){super();ne(this,ii);ne(this,hr);ne(this,es);H(this,es,t=>{if(!_i&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,hr)||this.setEventListener(_(this,es))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,hr))==null||t.call(this),H(this,hr,void 0))}setEventListener(t){var n;H(this,es,t),(n=_(this,hr))==null||n.call(this),H(this,hr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,ii)!==t&&(H(this,ii,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,ii)=="boolean"?_(this,ii):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ii=new WeakMap,hr=new WeakMap,es=new WeakMap,km),xf=new lw;function Wc(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var uw=tw;function cw(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=uw;const s=o=>{t?e.push(o):i(()=>{n(o)})},a=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var ot=cw(),ts,pr,ns,_m,dw=(_m=class extends Za{constructor(){super();ne(this,ts,!0);ne(this,pr);ne(this,ns);H(this,ns,t=>{if(!_i&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,pr)||this.setEventListener(_(this,ns))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,pr))==null||t.call(this),H(this,pr,void 0))}setEventListener(t){var n;H(this,ns,t),(n=_(this,pr))==null||n.call(this),H(this,pr,t(this.setOnline.bind(this)))}setOnline(t){_(this,ts)!==t&&(H(this,ts,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,ts)}},ts=new WeakMap,pr=new WeakMap,ns=new WeakMap,_m),wl=new dw;function fw(e){return Math.min(1e3*2**e,3e4)}function Ky(e){return(e??"online")==="online"?wl.)DELIM" +R"DELIM(isOnline():!0}var Zc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Gy(e){let t=!1,n=0,r;const i=Wc(),s=()=>i.status!=="pending",a=x=>{var T;if(!s()){const v=new Zc(x);f(v),(T=e.onCancel)==null||T.call(e,v)}},o=()=>{t=!0},l=()=>{t=!1},u=()=>xf.isFocused()&&(e.networkMode==="always"||wl.isOnline())&&e.canRun(),d=()=>Ky(e.networkMode)&&e.canRun(),c=x=>{s()||(r==null||r(),i.resolve(x))},f=x=>{s()||(r==null||r(),i.reject(x))},m=()=>new Promise(x=>{var T;r=v=>{(s()||u())&&x(v)},(T=e.onPause)==null||T.call(e)}).then(()=>{var x;r=void 0,s()||(x=e.onContinue)==null||x.call(e)}),g=()=>{if(s())return;let x;const T=n===0?e.initialPromise:void 0;try{x=T??e.fn()}catch(v){x=Promise.reject(v)}Promise.resolve(x).then(c).catch(v=>{var L;if(s())return;const p=e.retry??(_i?0:3),y=e.retryDelay??fw,S=typeof y=="function"?y(n,v):y,R=p===!0||typeof p=="number"&&nu()?void 0:m()).then(()=>{t?f(v):g()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r==null||r(),i),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?g():m().then(g),i)}}var si,Sm,qy=(Sm=class{constructor(){ne(this,si)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uc(this.gcTime)&&H(this,si,ni.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_i?1/0:5*60*1e3))}clearGcTimeout(){_(this,si)&&(ni.clearTimeout(_(this,si)),H(this,si,void 0))}},si=new WeakMap,Sm),ai,rs,Ut,oi,et,Ia,li,rn,Ln,Em,hw=(Em=class extends qy{constructor(t){super();ne(this,rn);ne(this,ai);ne(this,rs);ne(this,Ut);ne(this,oi);ne(this,et);ne(this,Ia);ne(this,li);H(this,li,!1),H(this,Ia,t.defaultOptions),this.setOptions(t.options),this.observers=[],H(this,oi,t.client),H(this,Ut,_(this,oi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,H(this,ai,pp(this.options)),this.state=t.state??_(this,ai),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,et))==null?void 0:t.promise}setOptions(t){if(this.options={..._(this,Ia),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=pp(this.options);n.data!==void 0&&(this.setState(hp(n.data,n.dataUpdatedAt)),H(this,ai,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Ut).remove(this)}setData(t,n){const r=Qc(this.state.data,t,this.options);return fe(this,rn,Ln).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){fe(this,rn,Ln).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=_(this,et))==null?void 0:r.promise;return(i=_(this,et))==null||i.cancel(t),n?n.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,ai))}isActive(){return this.observers.some(t=>Vt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Mr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Qy(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,et))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,et))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,et)&&(_(this,li)?_(this,et).cancel({revert:!0}):_(this,et).cancelRetry()),this.scheduleGc()),_(this,Ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||fe(this,rn,Ln).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,d,c,f,m,g,x,T,v,p,y;if(this.state.fetchStatus!=="idle"&&((l=_(this,et))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,et))return _(this,et).continueRetry(),_(this,et).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(R=>R.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,i=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:)DELIM" +R"DELIM(()=>(H(this,li,!0),r.signal)})},s=()=>{const S=Zy(this.options,n),L=(()=>{const k={client:_(this,oi),queryKey:this.queryKey,meta:this.meta};return i(k),k})();return H(this,li,!1),this.options.persister?this.options.persister(S,L,this):S(L)},o=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,oi),state:this.state,fetchFn:s};return i(S),S})();(u=this.options.behavior)==null||u.onFetch(o,this),H(this,rs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&fe(this,rn,Ln).call(this,{type:"fetch",meta:(c=o.fetchOptions)==null?void 0:c.meta}),H(this,et,Gy({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:S=>{S instanceof Zc&&S.revert&&this.setState({..._(this,rs),fetchStatus:"idle"}),r.abort()},onFail:(S,R)=>{fe(this,rn,Ln).call(this,{type:"failed",failureCount:S,error:R})},onPause:()=>{fe(this,rn,Ln).call(this,{type:"pause"})},onContinue:()=>{fe(this,rn,Ln).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const S=await _(this,et).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(m=(f=_(this,Ut).config).onSuccess)==null||m.call(f,S,this),(x=(g=_(this,Ut).config).onSettled)==null||x.call(g,S,this.state.error,this),S}catch(S){if(S instanceof Zc){if(S.silent)return _(this,et).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw fe(this,rn,Ln).call(this,{type:"error",error:S}),(v=(T=_(this,Ut).config).onError)==null||v.call(T,S,this),(y=(p=_(this,Ut).config).onSettled)==null||y.call(p,this.state.data,S,this),S}finally{this.scheduleGc()}}},ai=new WeakMap,rs=new WeakMap,Ut=new WeakMap,oi=new WeakMap,et=new WeakMap,Ia=new WeakMap,li=new WeakMap,rn=new WeakSet,Ln=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Yy(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...hp(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return H(this,rs,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ot.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Ut).notify({query:this,type:"updated",action:t})})},Em);function Yy(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ky(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function hp(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var _t,he,$a,mt,ui,is,In,mr,Fa,ss,as,ci,di,vr,os,Se,Ys,Kc,Gc,qc,Yc,Xc,Jc,ed,Xy,Cm,pw=(Cm=class extends Za{constructor(t,n){super();ne(this,Se);ne(this,_t);ne(this,he);ne(this,$a);ne(this,mt);ne(this,ui);ne(this,is);ne(this,In);ne(this,mr);ne(this,Fa);ne(this,ss);ne(this,as);ne(this,ci);ne(this,di);ne(this,vr);ne(this,os,new Set);this.options=n,H(this,_t,t),H(this,mr,null),H(this,In,Wc()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,he).addObserver(this),mp(_(this,he),this.options)?fe(this,Se,Ys).call(this):this.updateResult(),fe(this,Se,Yc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return td(_(this,he),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return td(_(this,he),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,fe(this,Se,Xc).call(this),fe(this,Se,Jc).call(this),_(this,he).removeObserver(this)}setOptions(t){const n=this.options,r=_(this,he);if(this.options=_(this,_t).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Vt(this.options.enabled,_(this,he))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");fe(this,Se,ed).call(this),_(this,he).setOptions(this.options),n._defaulted&&!Hc(this.options,n)&&_(this,_t).getQueryCac)DELIM" +R"DELIM(he().notify({type:"observerOptionsUpdated",query:_(this,he),observer:this});const i=this.hasListeners();i&&vp(_(this,he),r,this.options,n)&&fe(this,Se,Ys).call(this),this.updateResult(),i&&(_(this,he)!==r||Vt(this.options.enabled,_(this,he))!==Vt(n.enabled,_(this,he))||Mr(this.options.staleTime,_(this,he))!==Mr(n.staleTime,_(this,he)))&&fe(this,Se,Kc).call(this);const s=fe(this,Se,Gc).call(this);i&&(_(this,he)!==r||Vt(this.options.enabled,_(this,he))!==Vt(n.enabled,_(this,he))||s!==_(this,vr))&&fe(this,Se,qc).call(this,s)}getOptimisticResult(t){const n=_(this,_t).getQueryCache().build(_(this,_t),t),r=this.createResult(n,t);return vw(this,r)&&(H(this,mt,r),H(this,is,this.options),H(this,ui,_(this,he).state)),r}getCurrentResult(){return _(this,mt)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,In).status==="pending"&&_(this,In).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){_(this,os).add(t)}getCurrentQuery(){return _(this,he)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,_t).defaultQueryOptions(t),r=_(this,_t).getQueryCache().build(_(this,_t),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return fe(this,Se,Ys).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,mt)))}createResult(t,n){var W;const r=_(this,he),i=this.options,s=_(this,mt),a=_(this,ui),o=_(this,is),u=t!==r?t.state:_(this,$a),{state:d}=t;let c={...d},f=!1,m;if(n._optimisticResults){const P=this.hasListeners(),B=!P&&mp(t,n),ue=P&&vp(t,r,n,i);(B||ue)&&(c={...c,...Yy(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:g,errorUpdatedAt:x,status:T}=c;m=c.data;let v=!1;if(n.placeholderData!==void 0&&m===void 0&&T==="pending"){let P;s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(P=s.data,v=!0):P=typeof n.placeholderData=="function"?n.placeholderData((W=_(this,as))==null?void 0:W.state.data,_(this,as)):n.placeholderData,P!==void 0&&(T="success",m=Qc(s==null?void 0:s.data,P,n),f=!0)}if(n.select&&m!==void 0&&!v)if(s&&m===(a==null?void 0:a.data)&&n.select===_(this,Fa))m=_(this,ss);else try{H(this,Fa,n.select),m=n.select(m),m=Qc(s==null?void 0:s.data,m,n),H(this,ss,m),H(this,mr,null)}catch(P){H(this,mr,P)}_(this,mr)&&(g=_(this,mr),m=_(this,ss),x=Date.now(),T="error");const p=c.fetchStatus==="fetching",y=T==="pending",S=T==="error",R=y&&p,L=m!==void 0,j={status:T,fetchStatus:c.fetchStatus,isPending:y,isSuccess:T==="success",isError:S,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:c.dataUpdatedAt,error:g,errorUpdatedAt:x,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:p,isRefetching:p&&!y,isLoadingError:S&&!L,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&L,isStale:wf(t,n),refetch:this.refetch,promise:_(this,In),isEnabled:Vt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=be=>{j.status==="error"?be.reject(j.error):j.data!==void 0&&be.resolve(j.data)},B=()=>{const be=H(this,In,j.promise=Wc());P(be)},ue=_(this,In);switch(ue.status){case"pending":t.queryHash===r.queryHash&&P(ue);break;case"fulfilled":(j.status==="error"||j.data!==ue.value)&&B();break;case"rejected":(j.status!=="error"||j.error!==ue.reason)&&B();break}}return j}updateResult(){const t=_(this,mt),n=this.createResult(_(this,he),this.options);if(H(this,ui,_(this,he).state),H(this,is,this.options),_(this,ui).data!==void 0&&H(this,as,_(this,he)),Hc(n,t))return;H(this,mt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!_(this,os).size)return!0;const a=new Set(s??_(this,os));return this.options.throwOnError&&a.add("error"),Object.keys(_(this,mt)).some(o=>{const l=o;return _(this,mt)[l]!==t[l]&&a.has(l)})};fe(this,Se,Xy).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&fe(this,Se,Yc).call(this)}},_t=new WeakMap,he=new WeakMap,$a=new WeakMap,mt=new WeakMap,ui=new WeakMap,is=new WeakMap,In=new WeakMap,mr=new WeakMap,Fa=new WeakMap,ss=new WeakMap,as=new WeakMap,ci=new WeakMap,di=new WeakMap,vr=new WeakMap,os=new WeakMap,Se=new WeakSet,Ys=function(t){fe(this,Se,ed).call(this);let n=_(this,he).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Et)),n},Kc=function(){fe(this,Se,Xc).call(this);const t=Mr(this.options.staleTime,_(this,he));if(_i||_(this,mt).isStale||!Uc(t))return;const r=Qy(_(this,mt).dataUpdatedAt,t)+1;H(this,ci,ni.setTimeout(()=>{_(this,mt).isStale||this.updateResult()},r))},Gc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchIn)DELIM" +R"DELIM(terval(_(this,he)):this.options.refetchInterval)??!1},qc=function(t){fe(this,Se,Jc).call(this),H(this,vr,t),!(_i||Vt(this.options.enabled,_(this,he))===!1||!Uc(_(this,vr))||_(this,vr)===0)&&H(this,di,ni.setInterval(()=>{(this.options.refetchIntervalInBackground||xf.isFocused())&&fe(this,Se,Ys).call(this)},_(this,vr)))},Yc=function(){fe(this,Se,Kc).call(this),fe(this,Se,qc).call(this,fe(this,Se,Gc).call(this))},Xc=function(){_(this,ci)&&(ni.clearTimeout(_(this,ci)),H(this,ci,void 0))},Jc=function(){_(this,di)&&(ni.clearInterval(_(this,di)),H(this,di,void 0))},ed=function(){const t=_(this,_t).getQueryCache().build(_(this,_t),this.options);if(t===_(this,he))return;const n=_(this,he);H(this,he,t),H(this,$a,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Xy=function(t){ot.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,mt))}),_(this,_t).getQueryCache().notify({query:_(this,he),type:"observerResultsUpdated"})})},Cm);function mw(e,t){return Vt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mp(e,t){return mw(e,t)||e.state.data!==void 0&&td(e,t,t.refetchOnMount)}function td(e,t,n){if(Vt(t.enabled,e)!==!1&&Mr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&wf(e,t)}return!1}function vp(e,t,n,r){return(e!==t||Vt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&wf(e,n)}function wf(e,t){return Vt(t.enabled,e)!==!1&&e.isStaleByTime(Mr(t.staleTime,e))}function vw(e,t){return!Hc(e.getCurrentResult(),t)}function yp(e){return{onFetch:(t,n)=>{var d,c,f,m,g;const r=t.options,i=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],a=((g=t.state.data)==null?void 0:g.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let x=!1;const T=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},v=Zy(t.options,t.fetchOptions),p=async(y,S,R)=>{if(x)return Promise.reject();if(S==null&&y.pages.length)return Promise.resolve(y);const k=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:S,direction:R?"backward":"forward",meta:t.options.meta};return T(B),B})(),j=await v(k),{maxPages:W}=t.options,P=R?aw:sw;return{pages:P(y.pages,j,W),pageParams:P(y.pageParams,S,W)}};if(i&&s.length){const y=i==="backward",S=y?yw:gp,R={pages:s,pageParams:a},L=S(r,R);o=await p(R,L,y)}else{const y=e??s.length;do{const S=l===0?a[0]??r.initialPageParam:gp(r,o);if(l>0&&S==null)break;o=await p(o,S),l++}while(l{var x,T;return(T=(x=t.options).persister)==null?void 0:T.call(x,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function gp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function yw(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var za,xn,vt,fi,wn,sr,Tm,gw=(Tm=class extends qy{constructor(t){super();ne(this,wn);ne(this,za);ne(this,xn);ne(this,vt);ne(this,fi);H(this,za,t.client),this.mutationId=t.mutationId,H(this,vt,t.mutationCache),H(this,xn,[]),this.state=t.state||xw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,xn).includes(t)||(_(this,xn).push(t),this.clearGcTimeout(),_(this,vt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){H(this,xn,_(this,xn).filter(n=>n!==t)),this.scheduleGc(),_(this,vt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,xn).length||(this.state.status==="pending"?this.scheduleGc():_(this,vt).remove(this))}continue(){var t;return((t=_(this,fi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,u,d,c,f,m,g,x,T,v,p,y,S,R,L,k,j,W;const n=()=>{fe(this,wn,sr).call(this,{type:"continue"})},r={client:_(this,za),meta:this.options.meta,mutationKey:this.options.mutationKey};H(this,fi,Gy({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,B)=>{fe(this,wn,sr).call(this,{type:"failed",failureCount:P,error:B})},onPause:()=>{fe(this,wn,sr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,vt).canRun(this)}));const i=this.state.status==="pending",s=!_(this,fi).canStart();try{if(i)n();else{fe(this,wn,sr).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=_(this,vt).config).onMutate)==null?void 0:o.call(a,t,this,r));const B=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,r));B!==this.state.context&&fe(this,wn,sr).call(this,{type:"pending",context:B,variables:t,isPa)DELIM" +R"DELIM(used:s})}const P=await _(this,fi).start();return await((c=(d=_(this,vt).config).onSuccess)==null?void 0:c.call(d,P,t,this.state.context,this,r)),await((m=(f=this.options).onSuccess)==null?void 0:m.call(f,P,t,this.state.context,r)),await((x=(g=_(this,vt).config).onSettled)==null?void 0:x.call(g,P,null,this.state.variables,this.state.context,this,r)),await((v=(T=this.options).onSettled)==null?void 0:v.call(T,P,null,t,this.state.context,r)),fe(this,wn,sr).call(this,{type:"success",data:P}),P}catch(P){try{throw await((y=(p=_(this,vt).config).onError)==null?void 0:y.call(p,P,t,this.state.context,this,r)),await((R=(S=this.options).onError)==null?void 0:R.call(S,P,t,this.state.context,r)),await((k=(L=_(this,vt).config).onSettled)==null?void 0:k.call(L,void 0,P,this.state.variables,this.state.context,this,r)),await((W=(j=this.options).onSettled)==null?void 0:W.call(j,void 0,P,t,this.state.context,r)),P}finally{fe(this,wn,sr).call(this,{type:"error",error:P})}}finally{_(this,vt).runNext(this)}}},za=new WeakMap,xn=new WeakMap,vt=new WeakMap,fi=new WeakMap,wn=new WeakSet,sr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ot.batch(()=>{_(this,xn).forEach(r=>{r.onMutationUpdate(t)}),_(this,vt).notify({mutation:this,type:"updated",action:t})})},Tm);function xw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $n,sn,Ba,bm,ww=(bm=class extends Za{constructor(t={}){super();ne(this,$n);ne(this,sn);ne(this,Ba);this.config=t,H(this,$n,new Set),H(this,sn,new Map),H(this,Ba,0)}build(t,n,r){const i=new gw({client:t,mutationCache:this,mutationId:++so(this,Ba)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){_(this,$n).add(t);const n=Eo(t);if(typeof n=="string"){const r=_(this,sn).get(n);r?r.push(t):_(this,sn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,$n).delete(t)){const n=Eo(t);if(typeof n=="string"){const r=_(this,sn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&_(this,sn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Eo(t);if(typeof n=="string"){const r=_(this,sn).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Eo(t);if(typeof n=="string"){const i=(r=_(this,sn).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ot.batch(()=>{_(this,$n).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,$n).clear(),_(this,sn).clear()})}getAll(){return Array.from(_(this,$n))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cp(n,r))}findAll(t={}){return this.getAll().filter(n=>cp(t,n))}notify(t){ot.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ot.batch(()=>Promise.all(t.map(n=>n.continue().catch(Et))))}},$n=new WeakMap,sn=new WeakMap,Ba=new WeakMap,bm);function Eo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var kn,Nm,kw=(Nm=class extends Za{constructor(t={}){super();ne(this,kn);this.config=t,H(this,kn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??yf(i,n);let a=this.get(s);return a||(a=new hw({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){_(this,kn).has(t.queryHash)||(_(this,kn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,kn).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,kn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ot.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,kn).get(t)}getAll(){return[..._(this,kn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>up(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>up(t,r)):n}notify(t){ot.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ot.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ot.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},kn=new WeakMap,Nm),ze,yr,gr,ls,us,xr,cs,ds,Pm,_w=(Pm=class{constructor(e={}){ne(this,ze);ne(this,yr);ne(this,gr);ne(this,ls);ne(this,us);ne(this,xr);ne(this,cs);ne(this,ds);H(this,ze,e.queryCache||new kw),H(this,yr,e.mutationCache|)DELIM" +R"DELIM(|new ww),H(this,gr,e.defaultOptions||{}),H(this,ls,new Map),H(this,us,new Map),H(this,xr,0)}mount(){so(this,xr)._++,_(this,xr)===1&&(H(this,cs,xf.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ze).onFocus())})),H(this,ds,wl.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ze).onOnline())})))}unmount(){var e,t;so(this,xr)._--,_(this,xr)===0&&((e=_(this,cs))==null||e.call(this),H(this,cs,void 0),(t=_(this,ds))==null||t.call(this),H(this,ds,void 0))}isFetching(e){return _(this,ze).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,yr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ze).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=_(this,ze).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Mr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return _(this,ze).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=_(this,ze).get(r.queryHash),s=i==null?void 0:i.state.data,a=nw(t,s);if(a!==void 0)return _(this,ze).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ot.batch(()=>_(this,ze).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ze).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,ze);ot.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,ze);return ot.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ot.batch(()=>_(this,ze).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Et).catch(Et)}invalidateQueries(e,t={}){return ot.batch(()=>(_(this,ze).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ot.batch(()=>_(this,ze).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Et)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Et)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,ze).build(this,t);return n.isStaleByTime(Mr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Et).catch(Et)}fetchInfiniteQuery(e){return e.behavior=yp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Et).catch(Et)}ensureInfiniteQueryData(e){return e.behavior=yp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return wl.isOnline()?_(this,yr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,ze)}getMutationCache(){return _(this,yr)}getDefaultOptions(){return _(this,gr)}setDefaultOptions(e){H(this,gr,e)}setQueryDefaults(e,t){_(this,ls).set(Na(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,ls).values()],n={};return t.forEach(r=>{Pa(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,us).set(Na(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,us).values()],n={};return t.forEach(r=>{Pa(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,gr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=yf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===gf&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,gr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,ze).clear(),_(this,yr).clear()}},ze=new WeakMap,yr=new WeakMap,gr=new WeakMap,ls=new WeakMap,us=new WeakMap,xr=new WeakMap,cs=new WeakMap,ds=new WeakMap,Pm),Jy=C.createContext(void 0),eg=e=>{const t=C.useContext(Jy);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Sw=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(Jy.Provider,{value:e,children:t})),tg=C.createContext(!1),Ew=()=>C.useContext(tg);tg.Provider;function Cw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Tw=C.createContext(Cw()),bw=()=>C.useContext(Tw),Nw=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount)DELIM" +R"DELIM(=!1))},Pw=e=>{C.useEffect(()=>{e.clearReset()},[e])},Rw=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ow(n,[e.error,r])),jw=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Mw=(e,t)=>e.isLoading&&e.isFetching&&!t,Lw=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,xp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ow(e,t,n){var c,f,m,g,x;const r=Ew(),i=bw(),s=eg(),a=s.defaultQueryOptions(e);(f=(c=s.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||f.call(c,a),a._optimisticResults=r?"isRestoring":"optimistic",jw(a),Nw(a,i),Pw(i);const o=!s.getQueryCache().get(a.queryHash),[l]=C.useState(()=>new t(s,a)),u=l.getOptimisticResult(a),d=!r&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(T=>{const v=d?l.subscribe(ot.batchCalls(T)):Et;return l.updateResult(),v},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),C.useEffect(()=>{l.setOptions(a)},[a,l]),Lw(a,u))throw xp(a,l,i);if(Rw({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((g=(m=s.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||g.call(m,a,u),a.experimental_prefetchInRender&&!_i&&Mw(u,r)){const T=o?xp(a,l,i):(x=s.getQueryCache().get(a.queryHash))==null?void 0:x.promise;T==null||T.catch(Et).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function ql(e,t){return Ow(e,pw)}const Dw="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let wp=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Dw[n[e]&63];return t};var ng={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(E0,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",a="second",o="minute",l="hour",u="day",d="week",c="month",f="quarter",m="year",g="date",x="Invalid Date",T=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Z){var F=["th","st","nd","rd"],$=Z%100;return"["+Z+(F[($-20)%10]||F[$]||F[0])+"]"}},y=function(Z,F,$){var K=String(Z);return!K||K.length>=F?Z:""+Array(F+1-K.length).join($)+Z},S={s:y,z:function(Z){var F=-Z.utcOffset(),$=Math.abs(F),K=Math.floor($/60),b=$%60;return(F<=0?"+":"-")+y(K,2,"0")+":"+y(b,2,"0")},m:function Z(F,$){if(F.date()<$.date())return-Z($,F);var K=12*($.year()-F.year())+($.month()-F.month()),b=F.clone().add(K,c),D=$-b<0,I=F.clone().add(K+(D?-1:1),c);return+(-(K+($-b)/(D?b-I:I-b))||0)},a:function(Z){return Z<0?Math.ceil(Z)||0:Math.floor(Z)},p:function(Z){return{M:c,y:m,w:d,d:u,D:g,h:l,m:o,s:a,ms:s,Q:f}[Z]||String(Z||"").toLowerCase().replace(/s$/,"")},u:function(Z){return Z===void 0}},R="en",L={};L[R]=p;var k="$isDayjsObject",j=function(Z){return Z instanceof ue||!(!Z||!Z[k])},W=function Z(F,$,K){var b;if(!F)return R;if(typeof F=="string"){var D=F.toLowerCase();L[D]&&(b=D),$&&(L[D]=$,b=D);var I=F.split("-");if(!b&&I.length>1)return Z(I[0])}else{var ee=F.name;L[ee]=F,b=ee}return!K&&b&&(R=b),b||!K&&R},P=function(Z,F){if(j(Z))return Z.clone();var $=typeof F=="object"?F:{};return $.date=Z,$.args=arguments,new ue($)},B=S;B.l=W,B.i=j,B.w=function(Z,F){return P(Z,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var ue=function(){function Z($){this.$L=W($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[k]=!0}var F=Z.prototype;return F.parse=function($){this.$d=function(K){var b=K.date,D=K.utc;if(b===null)return new Date(NaN);if(B.u(b))return new Date;if(b instanceof Date)return new Date(b);if(typeof b=="string"&&!/Z$/i.test(b)){var I=b.match(T);if(I){var ee=I[2]-1||0,re=(I[7]||"0").substring(0,3);return D?new Date(Date.UTC(I[1],ee,I[3]||1,I[4]||0,I[5]||0,I[6]||0,re)):new Date(I[1],ee,I[3]||1,I[4]||0,I[5]||0,I[6]||0,re)}}return new Date(b)}($),this.init()},F.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},F.$utils=function(){return B},F.isValid=function(){return this.$d.toString()!==x},F.isSame=function($,K){var b=P($);return this.startOf(K)<=b&&b<=this.endOf(K)},F.isAfter=function($,K){return P($)-1&&e%1==0&&e0?t[Yw(0,n-1)]:void 0}function tk(e){return rk(e)&&kf.call(e,"callee")&&(!Qw.call(e,"callee")||sg.call(e)==Iw)}var nk=Array.isArray;function _f(e){return e!=null&&sk(e.length)&&!ik(e)}function rk(e){return ok(e)&&_f(e)}function ik(e){var t=ak(e)?sg.call(e):"";return t==$w||t==Fw}function sk(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ig}function ak(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ok(e){return!!e&&typeof e=="object"}function lk(e){return _f(e)?Gw(e):qw(e)}function uk(e){return e?Hw(e,lk(e)):[]}var ck=ek;const dk=Ll(ck);function Xl(e){if(!e)return;const t=e.toLowerCase(),n=t.indexOf("1");if(n>0){const i=t.slice(0,n);if(["bc","tb","bcrt","ltc","sb"].some(s=>i===s)){const s=t.slice(n+1),a=s.charAt(0);return a==="p"?"p2tr":a==="q"?s.length===39||s.length===40||e.length===42?"p2wpkh":s.length===59||s.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}switch(t[0]){case"1":case"m":case"n":return"p2pkh";case"3":case"2":return"p2sh";default:return}}const Xs=new Set;let Au=0;function kp(e){Xs.forEach(t=>t(e))}const ag=rg().subtract(2,"hour").unix(),Ka=Array.from({length:20}).map((e,t)=>{const n=`mock-tx-${t.toString().padStart(4,"0")}`,r=[{index:0,address:`bcrt1qmock${t}`,valueSats:1e6+t*1234,scriptType:"p2wpkh",spent:!1,script:{hex:`0014mockoutput${t}`,mnemonic:"OP_0 mock-output-pubkey"}}];return{txid:n,hash:n,status:"confirmed",confirmations:10-Math.floor(t/2),blockHeight:8e5-t,blockHash:`mock-block-${Math.floor(t/2)}`,receivedTime:ag+t*60,feeSats:250+t,feeRate:12+t*.1,size:225+t,weight:900+t*4,version:2,locktime:0,totalInput:1005e3,totalOutput:r.reduce((i,s)=>i+s.valueSats,0),inputs:[{index:0,prevTxId:`mock-prev-${t}`,prevOutputIndex:0,address:`bcrt1qprev${t}`,valueSats:1005e3,scriptType:"p2wpkh",script:{hex:`160014mockinputscriptsig${t}`,mnemonic:"OP_PUSHBYTES_22 mock-input-scriptsig"},witness:["3045022100cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafe","02deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbe"],sequence:4294967293}],outputs:r}}),gt=[];var Rm;for(let e=0;e<6;e+=1){const t=8e5+e,n=`mock-block-${t}`,r=Ka.slice(e*3,e*3+3);gt.push({hash:n,height:t,timestamp:ag+e*600,txCount:r.length,size:12e5,weight:4e6,difficulty:5e10,previousBlockHash:e===0?null:(Rm=gt[e-1])==null?void 0:Rm.hash,merkleRoot:`mock-merkle-${e}`,nonce:1e3+e,bits:486604799,version:2,nextBlockHash:null,transactions:r}),e>0&&(gt[e-1].nextBlockHash=n)}const fk={bcrt1qmock0:{address:"bcrt1qmock0",addressType:Xl("bcrt1qmock0"),balance:2345678,totalReceived:5e6,totalSent:2654322,txCount:5,utxoCount:3,transactions:Ka.slice(0,5).map(e=>{var t;return{txid:e.txid,timestamp:e.receivedTime,valueChange:((t=e.outputs[0])==null?void 0:t.valueSats)??0,blockHeight:e.blockHeight}})}};function Iu(){return{metadata:{id:"mock",label:"Mock data (offline)",type:"mock",connectionState:"connected",supportsWebsocket:!0,description:"Generates synthetic blockchain data for development."},async getLatestBlocks(e=10){return gt.slice().reverse().slice(0,e).map(t=>({hash:t.hash,height:t.height,timestamp:t.timestamp,txCount:t.txCount,size:t.size,weight:t.weight,difficulty:t.difficulty,previousBlockHash:t.previousBlockHash}))},async getBlock(e){if(e==="latest")return gt[gt.length-1];const t=gt.find(n=>n.hash===e||n.height.toString()===e);if(!t)throw new Error("Block not found");return t},async getBlocksBefore(e,t=10){return gt.filter(r=>r.height<=e).slice().reverse().slice(0,t).map(r=>({hash:r.hash,height:r.height,timestamp:r.timestamp,txCount:r.txCount,size:r.size,weight:r.weight,difficulty:r.difficulty,previousBlockHash:r.previousBlockHash}))},async getBlockTransactions(e,t=0){return(await this.getBlock(e)).transactions.slice(t,t+25)},async getTransaction(e){const t=Ka.find(n=>n.txid===e||n.hash===e);if(!t)throw new Error("Transaction not found");return t},async getAddress(e){return fk[e]??{address:e,addressType:Xl(e),balance:0,totalReceived:0,totalSent:0,txCount:0,utxoCount:0,transactions:[]}},async getAddressTransactions(e,t){const n=await this.getAddress(e),r=10,i=t?n.transactions.findIndex(s=>s.txid===t)+1:0;return i<=0&&t?[]:n.transactions.slice(i,i+r)},subscribeToEvents(e){return Xs.add(e),Xs.size===1&&hk(),()=>{Xs.delete(e),Xs.size===0&&pk()}}}}let ca=null;function hk(){ca||(ca=setInterval(()=>{const e=vk();gt.push(e),kp({type:"block.new",payload:mk(e)});const t=dk(Ka);t&&kp({type:"tx.new",payload:t})},15e3))}function pk(){ca&&(clearInterval(ca),ca=null)}function mk(e){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:e.txCount,size:e.size,weight:e.weight,difficulty:e.difficulty,previousBlockHash:e.previousBlockHash}}function vk(){Au+=1;const e=gt[gt.length-1].height+1,t=`mock-block-${e}-${wp(6)}`,n=rg().unix(),r=Ka.slice(0,2).map(a=>({...a,blockHash:t,blockHeight:e})),i={hash:t,height:e,timestamp:n,txCount:r.length,size:1)DELIM" +R"DELIM(2e5+Au*1e3,weight:4e6,difficulty:5e10,previousBlockHash:gt[gt.length-1].hash,merkleRoot:`mock-merkle-${wp(10)}`,nonce:1e3+Au,bits:486604799,version:2,nextBlockHash:null,transactions:r},s=gt[gt.length-1];return s.nextBlockHash=t,i}var xe;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},e.find=(i,s)=>{for(const a of i)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(xe||(xe={}));var _p;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(_p||(_p={}));const q=xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ur=e=>{switch(typeof e){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(e)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(e)?q.array:e===null?q.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?q.promise:typeof Map<"u"&&e instanceof Map?q.map:typeof Set<"u"&&e instanceof Set?q.set:typeof Date<"u"&&e instanceof Date?q.date:q.object;default:return q.unknown}},A=xe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Zn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,l=0;for(;ln.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Zn.create=e=>new Zn(e);const nd=(e,t)=>{let n;switch(e.code){case A.invalid_type:e.received===q.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case A.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,xe.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:n=`Unrecognized key(s) in object: ${xe.joinValues(e.keys,", ")}`;break;case A.invalid_union:n="Invalid input";break;case A.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${xe.joinValues(e.options)}`;break;case A.invalid_enum_value:n=`Invalid enum value. Expected ${xe.joinValues(e.options)}, received '${e.received}'`;break;case A.invalid_arguments:n="Invalid function arguments";break;case A.invalid_return_type:n="Invalid function return type";break;case A.invalid_date:n="Invalid date";break;case A.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:xe.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case A.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.in)DELIM" +R"DELIM(clusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case A.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case A.custom:n="Invalid input";break;case A.invalid_intersection_types:n="Intersection results could not be merged";break;case A.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case A.not_finite:n="Number must be finite";break;default:n=t.defaultError,xe.assertNever(e)}return{message:n}};let yk=nd;function gk(){return yk}const xk=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)o=u(a,{data:t,defaultError:o}).message;return{...i,path:s,message:o}};function U(e,t){const n=gk(),r=xk({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===nd?void 0:nd].filter(i=>!!i)});e.common.issues.push(r)}class At{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return se;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return At.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return se;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:t.value,value:r}}}const se=Object.freeze({status:"aborted"}),Js=e=>({status:"dirty",value:e}),Xt=e=>({status:"valid",value:e}),Sp=e=>e.status==="aborted",Ep=e=>e.status==="dirty",xs=e=>e.status==="valid",kl=e=>typeof Promise<"u"&&e instanceof Promise;var X;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(X||(X={}));class Ir{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Cp=(e,t)=>{if(xs(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Zn(e.common.issues);return this._error=n,this._error}}};function ce(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,o)=>{const{message:l}=e;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}class ye{get description(){return this._def.description}_getType(t){return ur(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ur(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new At,ctx:{common:t.parent.common,data:t.data,parsedType:ur(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(kl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safePar)DELIM" +R"DELIM(se(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ur(t)},i=this._parseSync({data:t,path:r.path,parent:r});return Cp(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ur(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:n});return xs(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(i=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(s=>xs(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ur(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(kl(i)?i:Promise.resolve(i));return Cp(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=t(i),o=()=>s.addIssue({code:A.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new _s({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Lr.create(this,this._def)}nullable(){return Ss.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bn.create(this)}promise(){return Cl.create(this,this._def)}or(t){return Sl.create([this,t],this._def)}and(t){return El.create(this,t,this._def)}transform(t){return new _s({...ce(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new sd({...ce(this._def),innerType:this,defaultValue:n,typeName:ae.ZodDefault})}brand(){return new Uk({typeName:ae.ZodBranded,type:this,...ce(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new ad({...ce(this._def),innerType:this,catchValue:n,typeName:ae.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Sf.create(this,t)}readonly(){return od.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wk=/^c[^\s-]{8,}$/i,kk=/^[0-9a-z]+$/,_k=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Sk=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ek=/^[a-z0-9_-]{21}$/i,Ck=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Nk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $u;const Pk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,jk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([)DELIM" +R"DELIM(0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Mk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ok=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,og="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Dk=new RegExp(`^${og}$`);function lg(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Ak(e){return new RegExp(`^${lg(e)}$`)}function Ik(e){let t=`${og}T${lg(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function $k(e,t){return!!((t==="v4"||!t)&&Pk.test(e)||(t==="v6"||!t)&&jk.test(e))}function Fk(e,t){if(!Ck.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function zk(e,t){return!!((t==="v4"||!t)&&Rk.test(e)||(t==="v6"||!t)&&Mk.test(e))}class _r extends ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==q.string){const s=this._getOrReturnCtx(t);return U(s,{code:A.invalid_type,expected:q.string,received:s.parsedType}),se}const r=new At;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(i=this._getOrReturnCtx(t,i),U(i,{code:A.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=t.data.length>s.value,o=t.data.lengtht.test(i),{validation:n,code:A.invalid_string,...X.errToObj(r)})}_addCheck(t){return new _r({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...X.errToObj(t)})}url(t){return this._addCheck({kind:"url",...X.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...X.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...X.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...X.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...X.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...X.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...X.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...X.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...X.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...X.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...X.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...X.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...X.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...X.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...X.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...X.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...X.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...X.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...X.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...X.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...X.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...X.errToObj(n)})}nonempty(t){return this.min(1,X.errToObj(t))}trim(){return new _r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2())DELIM" +R"DELIM({return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew _r({checks:[],typeName:ae.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...ce(e)});function Bk(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return s%a/10**i}class ws extends ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==q.number){const s=this._getOrReturnCtx(t);return U(s,{code:A.invalid_type,expected:q.number,received:s.parsedType}),se}let r;const i=new At;for(const s of this._def.checks)s.kind==="int"?xe.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),U(r,{code:A.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),U(r,{code:A.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Bk(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),U(r,{code:A.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),U(r,{code:A.not_finite,message:s.message}),i.dirty()):xe.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,X.toString(n))}gt(t,n){return this.setLimit("min",t,!1,X.toString(n))}lte(t,n){return this.setLimit("max",t,!0,X.toString(n))}lt(t,n){return this.setLimit("max",t,!1,X.toString(n))}setLimit(t,n,r,i){return new ws({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:X.toString(i)}]})}_addCheck(t){return new ws({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:X.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:X.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:X.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:X.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:X.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:X.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:X.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:X.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:X.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&xe.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew ws({checks:[],typeName:ae.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ce(e)});class Ra extends ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==q.bigint)return this._getInvalidInput(t);let r;const i=new At;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),U(r,{code:A.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),U(r,{code:A.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):xe.as)DELIM" +R"DELIM(sertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return U(n,{code:A.invalid_type,expected:q.bigint,received:n.parsedType}),se}gte(t,n){return this.setLimit("min",t,!0,X.toString(n))}gt(t,n){return this.setLimit("min",t,!1,X.toString(n))}lte(t,n){return this.setLimit("max",t,!0,X.toString(n))}lt(t,n){return this.setLimit("max",t,!1,X.toString(n))}setLimit(t,n,r,i){return new Ra({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:X.toString(i)}]})}_addCheck(t){return new Ra({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:X.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:X.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:X.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:X.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:X.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Ra({checks:[],typeName:ae.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...ce(e)});class rd extends ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==q.boolean){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.boolean,received:r.parsedType}),se}return Xt(t.data)}}rd.create=e=>new rd({typeName:ae.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ce(e)});class _l extends ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==q.date){const s=this._getOrReturnCtx(t);return U(s,{code:A.invalid_type,expected:q.date,received:s.parsedType}),se}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return U(s,{code:A.invalid_date}),se}const r=new At;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(i=this._getOrReturnCtx(t,i),U(i,{code:A.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):xe.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new _l({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:X.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:X.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew _l({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ae.ZodDate,...ce(e)});class Tp extends ye{_parse(t){if(this._getType(t)!==q.symbol){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.symbol,received:r.parsedType}),se}return Xt(t.data)}}Tp.create=e=>new Tp({typeName:ae.ZodSymbol,...ce(e)});class bp extends ye{_parse(t){if(this._getType(t)!==q.undefined){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.undefined,received:r.parsedType}),se}return Xt(t.data)}}bp.create=e=>new bp({typeName:ae.ZodUndefined,...ce(e)});class Np extends ye{_parse(t){if(this._getType(t)!==q.null){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.null,received:r.parsedType}),se}return Xt(t.data)}}Np.create=e=>new Np({typeName:ae.ZodNull,...ce(e)});class Pp extends ye{constructor(){super(...arguments),this._any=!0}_parse(t){return Xt(t.data)}}Pp.create=e=>new Pp({typeName:ae.ZodAny,...ce(e)});class Rp extends ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xt(t.data)}}Rp.create=e=>new Rp({typeName:ae.ZodUnknown,...ce(e)});class $r extends ye{_parse(t){const n=this._getOrReturnCtx(t);return U(n,{code:A.invalid_type,expected:q.never,received:n.parsedType}),se}}$r.create=e=>new $r({typeName:ae.ZodNever,...ce(e)});class jp extends ye{_parse(t){if(this._getType(t)!==q.undefined){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.void,received:r.parsedType}),se}return Xt(t.data)}}jp.create=e=>new jp({typeName:ae.ZodVoid,...ce(e)});class bn extends ye{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==q.array)return U(n,{code:A.invalid_type,expected:q.array,received:n.parsedType}),se;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,o=n.data.lengthi.maxLength.value&&(U(n,{code:A.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>i.type._parseAsync(new Ir(n,a,n.path,o)))).then(a=>At.mergeArray(r,a));const s=[...n.data].map((a,o)=>i.type._parseSync(new Ir(n,a,n.path,o)));return At.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new bn({...this._def,minLength:{value:t,message:X.toString(n)}})}max(t,n){return new bn({...this._def,maxLength:{value:t,message:X.toString(n)}})}length(t,n){return new bn({...this._def,exactLength:{value:t,message:X.toString(n)}})}nonempty(t){return this.min(1,t)}}bn.create=(e,t)=>new bn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...ce(t)});function Oi(e){if(e instanceof Ze){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Lr.create(Oi(r))}return new Ze({...e._def,shape:()=>t})}else return e instanceof bn?new bn({...e._def,type:Oi(e.element)}):e instanceof Lr?Lr.create(Oi(e.unwrap())):e instanceof Ss?Ss.create(Oi(e.unwrap())):e instanceof Si?Si.create(e.items.map(t=>Oi(t))):e}class Ze extends ye{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=xe.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==q.object){const u=this._getOrReturnCtx(t);return U(u,{code:A.invalid_type,expected:q.object,received:u.parsedType}),se}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof $r&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||o.push(u);const l=[];for(const u of a){const d=s[u],c=i.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Ir(i,c,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof $r){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")o.length>0&&(U(i,{code:A.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const c=i.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Ir(i,c,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const c=await d.key,f=await d.value;u.push({key:c,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>At.mergeObjectSync(r,u)):At.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return X.errToObj,new Ze({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,a;const i=((a=(s=this._def).errorMap)==null?void 0:a.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:X.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new Ze({...this._def,unknownKeys:"strip"})}passthrough(){return new Ze({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ze({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ze({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ae.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ze({...this._def,catchall:t})}pick(t){const n={};for(const r of xe.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Ze({...this._def,shape:()=>n})}omit(t){const n={};for(const r of xe.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Ze({...this._def,shape:()=>n})}deepPartial(){return Oi(this)}partial(t){const n={};for(const r of xe.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new Ze({...this._def,shape:()=>n})}required(t){const n={};for(const r of xe.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Lr;)s=s._def.innerType;n[r]=s}return new Ze({...this._def,shape:()=>n})}keyof(){return ug(xe.objectKeys(this.shape))}}Ze.create=(e,t)=>new Ze({shape:()=>e,unknownKeys:"strip",catchall:$r.create(),typeName:ae.ZodObject,...ce(t)});Ze.strictCreate=(e,t)=>new Ze({shape:()=>e,unknownKeys:"strict",catchall:$r.create(),typeName:ae.ZodObject,...ce(t)});Ze.lazycreate=(e,t)=>new Ze({shape:e,unknownKeys:"strip",catchall:$r.create(),typeName:ae.ZodObject,...ce(t)});class Sl extends ye{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const o of s)i)DELIM" +R"DELIM(f(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new Zn(o.ctx.common.issues));return U(n,{code:A.invalid_union,unionErrors:a}),se}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(l=>new Zn(l));return U(n,{code:A.invalid_union,unionErrors:o}),se}}get options(){return this._def.options}}Sl.create=(e,t)=>new Sl({options:e,typeName:ae.ZodUnion,...ce(t)});function id(e,t){const n=ur(e),r=ur(t);if(e===t)return{valid:!0,data:e};if(n===q.object&&r===q.object){const i=xe.objectKeys(t),s=xe.objectKeys(e).filter(o=>i.indexOf(o)!==-1),a={...e,...t};for(const o of s){const l=id(e[o],t[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===q.array&&r===q.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s{if(Sp(s)||Sp(a))return se;const o=id(s.value,a.value);return o.valid?((Ep(s)||Ep(a))&&n.dirty(),{status:n.value,value:o.data}):(U(r,{code:A.invalid_intersection_types}),se)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}El.create=(e,t,n)=>new El({left:e,right:t,typeName:ae.ZodIntersection,...ce(n)});class Si extends ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==q.array)return U(r,{code:A.invalid_type,expected:q.array,received:r.parsedType}),se;if(r.data.lengththis._def.items.length&&(U(r,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new Ir(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>At.mergeArray(n,a)):At.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Si({...this._def,rest:t})}}Si.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Si({items:e,typeName:ae.ZodTuple,rest:null,...ce(t)})};class Mp extends ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==q.map)return U(r,{code:A.invalid_type,expected:q.map,received:r.parsedType}),se;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],u)=>({key:i._parse(new Ir(r,o,r.path,[u,"key"])),value:s._parse(new Ir(r,l,r.path,[u,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return se;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of a){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return se;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.value,value:o}}}}Mp.create=(e,t,n)=>new Mp({valueType:t,keyType:e,typeName:ae.ZodMap,...ce(n)});class ja extends ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==q.set)return U(r,{code:A.invalid_type,expected:q.set,received:r.parsedType}),se;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(U(r,{code:A.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(l){const u=new Set;for(const d of l){if(d.status==="aborted")return se;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const o=[...r.data.values()].map((l,u)=>s._parse(new Ir(r,l,r.path,u)));retur)DELIM" +R"DELIM(n r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(t,n){return new ja({...this._def,minSize:{value:t,message:X.toString(n)}})}max(t,n){return new ja({...this._def,maxSize:{value:t,message:X.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ja.create=(e,t)=>new ja({valueType:e,minSize:null,maxSize:null,typeName:ae.ZodSet,...ce(t)});class Lp extends ye{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Lp.create=(e,t)=>new Lp({getter:e,typeName:ae.ZodLazy,...ce(t)});class Op extends ye{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return U(n,{received:n.data,code:A.invalid_literal,expected:this._def.value}),se}return{status:"valid",value:t.data}}get value(){return this._def.value}}Op.create=(e,t)=>new Op({value:e,typeName:ae.ZodLiteral,...ce(t)});function ug(e,t){return new ks({values:e,typeName:ae.ZodEnum,...ce(t)})}class ks extends ye{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return U(n,{expected:xe.joinValues(r),received:n.parsedType,code:A.invalid_type}),se}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return U(n,{received:n.data,code:A.invalid_enum_value,options:r}),se}return Xt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ks.create(t,{...this._def,...n})}exclude(t,n=this._def){return ks.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ks.create=ug;class Dp extends ye{_parse(t){const n=xe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==q.string&&r.parsedType!==q.number){const i=xe.objectValues(n);return U(r,{expected:xe.joinValues(i),received:r.parsedType,code:A.invalid_type}),se}if(this._cache||(this._cache=new Set(xe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=xe.objectValues(n);return U(r,{received:r.data,code:A.invalid_enum_value,options:i}),se}return Xt(t.data)}get enum(){return this._def.values}}Dp.create=(e,t)=>new Dp({values:e,typeName:ae.ZodNativeEnum,...ce(t)});class Cl extends ye{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==q.promise&&n.common.async===!1)return U(n,{code:A.invalid_type,expected:q.promise,received:n.parsedType}),se;const r=n.parsedType===q.promise?n.data:Promise.resolve(n.data);return Xt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cl.create=(e,t)=>new Cl({type:e,typeName:ae.ZodPromise,...ce(t)});class _s extends ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:a=>{U(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);if(r.common.async)return Promise.resolve(a).then(async o=>{if(n.value==="aborted")return se;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?se:l.status==="dirty"||n.value==="dirty"?Js(l.value):l});{if(n.value==="aborted")return se;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?se:o.status==="dirty"||n.value==="dirty"?Js(o.value):o}}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?se:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?se:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!xs(a))return se;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>xs(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:n.value,value:o})):se);xe.assertNever(i)}}_s.create=(e,t,n)=>new _s({schema:e,typeName:ae.ZodEffects,effe)DELIM" +R"DELIM(ct:t,...ce(n)});_s.createWithPreprocess=(e,t,n)=>new _s({schema:t,effect:{type:"preprocess",transform:e},typeName:ae.ZodEffects,...ce(n)});class Lr extends ye{_parse(t){return this._getType(t)===q.undefined?Xt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Lr.create=(e,t)=>new Lr({innerType:e,typeName:ae.ZodOptional,...ce(t)});class Ss extends ye{_parse(t){return this._getType(t)===q.null?Xt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ss.create=(e,t)=>new Ss({innerType:e,typeName:ae.ZodNullable,...ce(t)});class sd extends ye{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===q.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}sd.create=(e,t)=>new sd({innerType:e,typeName:ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ce(t)});class ad extends ye{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return kl(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ad.create=(e,t)=>new ad({innerType:e,typeName:ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ce(t)});class Ap extends ye{_parse(t){if(this._getType(t)!==q.nan){const r=this._getOrReturnCtx(t);return U(r,{code:A.invalid_type,expected:q.nan,received:r.parsedType}),se}return{status:"valid",value:t.data}}}Ap.create=e=>new Ap({typeName:ae.ZodNaN,...ce(e)});class Uk extends ye{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Sf extends ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?se:s.status==="dirty"?(n.dirty(),Js(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?se:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Sf({in:t,out:n,typeName:ae.ZodPipeline})}}class od extends ye{_parse(t){const n=this._def.innerType._parse(t),r=i=>(xs(i)&&(i.value=Object.freeze(i.value)),i);return kl(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}od.create=(e,t)=>new od({innerType:e,typeName:ae.ZodReadonly,...ce(t)});var ae;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ae||(ae={}));const Ke=_r.create,me=ws.create,Ef=rd.create;$r.create;const Ma=bn.create,Nn=Ze.create;Sl.create;El.create;Si.create;ks.create;Cl.create;Lr.create;Ss.create;class Cf extends Error{constructor(t,n){super(t),this.status=n}}const cg=Nn({id:Ke(),height:me(),timestamp:me().optional(),mediantime:me().optional(),tx_count:me().optional(),size:me().optional(),weight:me().optional(),difficulty:me().optional(),bits:me().optional(),merkle_root:Ke().optional(),previousblockhash:Ke().nullable().optional(),nonce:me().optional(),version:me().optional()}).passthrough(),Hk=Nn({confirmed:Ef(),block_height:me().optional(),block_hash:Ke().optional(),block_time:me().optional()}),Vk=Nn({txid:Ke().optional().nullable(),vout:me().optional().nullable(),sequence:me().optional(),scriptsig:Ke().optional().nullable(),scriptsig_asm:Ke().optional().nullable(),witness:Ma(Ke()).optional(),is_coinbase:Ef().optional(),prevout:Nn({scriptpubkey_type:Ke().optional(),scriptpubkey_address:Ke().optional(),scriptpubkey:Ke().optional(),scriptpubkey_asm:Ke().optional(),value:me().optional()}).partial().nullable().optional()}).passthrough(),Qk=Nn({scriptpubkey_type:Ke().optional(),scriptpubke)DELIM" +R"DELIM(y_address:Ke().optional(),scriptpubkey:Ke().optional(),scriptpubkey_asm:Ke().optional(),value:me(),n:me().optional()}).passthrough(),dg=Nn({txid:Ke(),hash:Ke().optional(),fee:me().optional(),version:me(),locktime:me(),vin:Ma(Vk),vout:Ma(Qk),size:me(),weight:me(),status:Hk}).passthrough(),Qo=Ma(cg),Tl=Ma(dg),Wk=Nn({in_best_chain:Ef(),next_best:Ke().optional(),height:me().optional()}),Zk=Nn({address:Ke(),chain_stats:Nn({funded_txo_count:me().optional(),funded_txo_sum:me().optional(),spent_txo_count:me().optional(),spent_txo_sum:me().optional(),tx_count:me().optional()}),mempool_stats:Nn({funded_txo_count:me().optional(),funded_txo_sum:me().optional(),spent_txo_count:me().optional(),spent_txo_sum:me().optional(),tx_count:me().optional()})});let Co=null,Ct=null;async function Ht(e,t,n){const r=t.startsWith("/")?t:`/${t}`,i=await fetch(`${e}${r}`);if(!i.ok)throw new Cf(`Request to ${t} failed with status ${i.status}`,i.status);const s=await i.json();return n.parse(s)}async function Ip(e){const t=await fetch(`${e}/blocks/tip/height`);if(!t.ok)throw new Cf("Unable to fetch tip height",t.status);const n=Number((await t.text()).trim());if(!Number.isFinite(n))throw new Error("Invalid tip height response");return Ct=n,n}async function Bs(e,t){if(Ct===null){await Ip(e);return}typeof t=="number"&&Cts.scriptpubkey_address===e?i+s.value:i,0),r=t.vin.reduce((i,s)=>{const a=s.prevout;return(a==null?void 0:a.scriptpubkey_address)===e&&typeof a.value=="number"?i+a.value:i},0);return n-r}async function $p(e,t){if(t==="latest"||t==="tip"){const[n]=await Ht(e,"/blocks",Qo);if(!n)throw new Error("No blocks returned from API");return n.id}if(/^\d+$/.test(t)){const n=await fetch(`${e}/block-height/${t}`);if(!n.ok)throw new Cf("Unable to resolve block height",n.status);return(await n.text()).trim()}return t}async function Gk(e,t){if(Ct==null||t>=Ct)return null;const n=t+1;try{const r=await fetch(`${e}/block-height/${n}`);return r.ok&&(await r.text()).trim()||null}catch(r){return console.warn(`Failed to resolve hash for height ${n}`,r),null}}function To(e){return{hash:e.id,height:e.height,timestamp:e.timestamp??e.mediantime??0,txCount:e.tx_count??0,size:e.size??0,weight:e.weight??0,difficulty:e.difficulty,previousBlockHash:e.previousblockhash??null}}function Fu(e){const t=e.status.confirmed?"confirmed":"unconfirmed",n=e.vin.map((o,l)=>{var d,c,f;const u=o.is_coinbase||o.txid==null?void 0:typeof o.vout=="number"&&o.vout!==4294967295?o.vout:void 0;return{index:l,prevTxId:o.txid??void 0,prevOutputIndex:u,address:((d=o.prevout)==null?void 0:d.scriptpubkey_address)??void 0,valueSats:(c=o.prevout)==null?void 0:c.value,scriptType:(f=o.prevout)==null?void 0:f.scriptpubkey_type,isCoinbase:o.is_coinbase??!1,script:o.scriptsig||o.scriptsig_asm?{hex:o.scriptsig??void 0,mnemonic:o.scriptsig_asm??void 0}:void 0,witness:o.witness??void 0,sequence:o.sequence}}),r=e.vout.map((o,l)=>({index:l,address:o.scriptpubkey_address??void 0,valueSats:o.value,scriptType:o.scriptpubkey_type,spent:void 0,script:o.scriptpubkey||o.scriptpubkey_asm?{hex:o.scriptpubkey??void 0,mnemonic:o.scriptpubkey_asm??void 0}:void 0})),i=r.reduce((o,l)=>o+l.valueSats,0),s=Ct;let a=0;return e.status.block_height&&t==="confirmed"&&(s&&s>=e.status.block_height?a=s-e.status.block_height+1:a=1),{txid:e.txid,hash:e.hash??e.txid,status:t,confirmations:a,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:i,inputs:n,outputs:r}}function qk(e,t){const n=e.chain_stats,r=e.mempool_stats,i=(n.funded_txo_sum??0)-(n.spent_txo_sum??0),s=fg(e.address,t.slice(0,25));return{address:e.address,addressType:Xl(e.address),balance:i,totalReceived:(n.funded_txo_sum??0)+(r.funded_txo_sum??0),totalSent:(n.spent_txo_sum??0)+(r.spent_txo_sum??0),txCount:(n.tx_count??0)+(r.tx_count??0),utxoCount:(n.funded_txo_count??0)-(n.spent_txo_count??0),transactions:s}}function fg(e,t){return t.map(n=>({txid:n.txid,timestamp:n.status.block_time,valueChange:Kk(e,n),blockHeight:n.status.block_height}))}async function Fp(e,t,n=0){const r=n>0?`/block/${t}/txs/${n}`:`/block/${t}/txs`;return Ht(e,r,Tl)}async function Yk(e,t,n){return n?Ht(e,`/address/${t}/txs/chain/${n}`,Tl):Ht(e,`/address/${t}/txs`,Tl)}function hg({baseUrl:e}){const t=new Set;let n=null;async function r(){n||t.size===0||(n=setInterval(async()=>{try{const[s]=await Ht(e,"/blocks",Qo);if(!s)return;if(s.id!==Co){Co=s.id,Ct=Math.max(s.height,Ct??0);const a=To(s);t.forEach(o=>o({type:"block.new",payload:a}))}}catch(s){console.warn("Block polling failed",s)}},15e3))}function i(){n&&(clearInterval(n),n=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,description:"Read-only adapter using Blockstream public REST API."},async getLatestBlock)DELIM" +R"DELIM(s(s=10){const a=await Ht(e,"/blocks",Qo);return a.length>0&&(Co=a[0].id,Ct=Math.max(a[0].height,Ct??0)),a.slice(0,s).map(To)},async getBlocksBefore(s,a=10){const o=Math.max(s,0),l=await Ht(e,`/blocks/${o}`,Qo);return l.length>0&&(Ct=Math.max(l[0].height,Ct??0)),l.slice(0,a).map(To)},async getBlock(s){const a=await $p(e,s);await Bs(e);const o=await Ht(e,`/block/${a}`,cg),[l,u]=await Promise.allSettled([Fp(e,a),Ht(e,`/block/${a}/status`,Wk)]);l.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",l.reason),u.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",u.reason);const d=To(o);Co=d.hash,Ct=Math.max(d.height,Ct??d.height);const c=l.status==="fulfilled"?l.value:[],f=u.status==="fulfilled"?u.value:null;let m=(f==null?void 0:f.next_best)??null;return m||(m=await Gk(e,d.height)),{...d,merkleRoot:o.merkle_root,nonce:o.nonce,bits:o.bits,version:o.version,nextBlockHash:m,transactions:c.map(Fu)}},async getBlockTransactions(s,a=0){const o=await $p(e,s),l=await Fp(e,o,a),u=l.reduce((d,c)=>c.status.block_height?d===null?c.status.block_height:Math.max(d,c.status.block_height):d,null);return typeof u=="number"?await Bs(e,u):await Bs(e),l.map(Fu)},async getTransaction(s){const a=await Ht(e,`/tx/${s}`,dg);return a.status.block_height?await Bs(e,a.status.block_height):await Bs(e),Fu(a)},async getAddress(s){const a=await Ht(e,`/address/${s}`,Zk),o=await Ht(e,`/address/${s}/txs`,Tl);return qk(a,o)},async getAddressTransactions(s,a){const o=await Yk(e,s,a);return fg(s,o)},subscribeToEvents(s){return t.add(s),r(),()=>{t.delete(s),t.size===0&&i()}}}}function Xk({baseUrl:e}){const t=hg({baseUrl:e});return{...t,metadata:{...t.metadata,id:"mempool",label:"mempool.space",description:"Adapter backed by mempool.space REST API."}}}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function La(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function pg(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(n=>typeof n=="string"):t.every(n=>Number.isSafeInteger(n)):!1}function mg(e){if(typeof e!="function")throw new Error("function expected");return!0}function Oa(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function Ga(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function bl(e){if(!Array.isArray(e))throw new Error("array expected")}function vg(e,t){if(!pg(!0,t))throw new Error(`${e}: array of strings expected`)}function Tf(e,t){if(!pg(!1,t))throw new Error(`${e}: array of numbers expected`)}function bf(...e){const t=s=>s,n=(s,a)=>o=>s(a(o)),r=e.map(s=>s.encode).reduceRight(n,t),i=e.map(s=>s.decode).reduce(n,t);return{encode:r,decode:i}}function yg(e){const t=typeof e=="string"?e.split(""):e,n=t.length;vg("alphabet",t);const r=new Map(t.map((i,s)=>[i,s]));return{encode:i=>(bl(i),i.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return t[s]})),decode:i=>(bl(i),i.map(s=>{Oa("alphabet.decode",s);const a=r.get(s);if(a===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return a}))}}function gg(e=""){return Oa("join",e),{encode:t=>(vg("join.decode",t),t.join(e)),decode:t=>(Oa("join.decode",t),t.split(e))}}function zp(e,t,n){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(bl(e),!e.length)return[];let r=0;const i=[],s=Array.from(e,o=>{if(Ga(o),o<0||o>=t)throw new Error(`invalid integer: ${o}`);return o}),a=s.length;for(;;){let o=0,l=!0;for(let u=r;ut===0?e:xg(t,e%t),Nl=(e,t)=>e+(t-xg(e,t)),Wo=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function ld(e,t,n,r){if(bl(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(Nl(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${Nl(t,n)}`);let i=0,s=0;const a=Wo[t],o=Wo[n]-1,l=[];for(const u of e){if(Ga(u),u>=a)throw new Error(`convertRadix2: invalid data word=${u} from=${t}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=n;s-=n)l.push((i>>s-n&o)>>>0);const d=Wo[s];if(d===void 0)throw new Error("invalid carry");i&=d-1}if(i=i<=t)throw new Error("Excess padding");if(!r&&i>0)throw new Error(`Non-zero padding: ${i}`);return r&&s>0&&l.push(i>>>0),l}function Jk(e){Ga(e);const t=2**8;return{encode:n=>{if(!La(n))throw )DELIM" +R"DELIM(new Error("radix.encode input should be Uint8Array");return zp(Array.from(n),t,e)},decode:n=>(Tf("radix.decode",n),Uint8Array.from(zp(n,e,t)))}}function e_(e,t=!1){if(Ga(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Nl(8,e)>32||Nl(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!La(n))throw new Error("radix2.encode input should be Uint8Array");return ld(Array.from(n),8,e,!t)},decode:n=>(Tf("radix2.decode",n),Uint8Array.from(ld(n,e,8,t)))}}function Bp(e){return mg(e),function(...t){try{return e.apply(null,t)}catch{}}}function t_(e,t){return Ga(e),mg(t),{encode(n){if(!La(n))throw new Error("checksum.encode: input should be Uint8Array");const r=t(n).slice(0,e),i=new Uint8Array(n.length+e);return i.set(n),i.set(r,n.length),i},decode(n){if(!La(n))throw new Error("checksum.decode: input should be Uint8Array");const r=n.slice(0,-e),i=n.slice(-e),s=t(r).slice(0,e);for(let a=0;abf(Jk(58),yg(e),gg("")),r_=n_("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),i_=e=>bf(t_(4,t=>e(e(t))),r_),s_=i_,ud=bf(yg("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),gg("")),Up=[996825010,642813549,513874426,1027748829,705979059];function Us(e){const t=e>>25;let n=(e&33554431)<<5;for(let r=0;r>r&1)===1&&(n^=Up[r]);return n}function Hp(e,t,n=1){const r=e.length;let i=1;for(let s=0;s126)throw new Error(`Invalid prefix (${e})`);i=Us(i)^a>>5}i=Us(i);for(let s=0;sm)throw new TypeError(`Length ${x} exceeds limit ${m}`);const T=c.toLowerCase(),v=Hp(T,f,t);return`${T}1${ud.encode(f)}${v}`}function o(c,f=90){Oa("bech32.decode input",c);const m=c.length;if(m<8||f!==!1&&m>f)throw new TypeError(`invalid string length: ${m} (${c}). Expected (8..${f})`);const g=c.toLowerCase();if(c!==g&&c!==c.toUpperCase())throw new Error("String must be lowercase or uppercase");const x=g.lastIndexOf("1");if(x===0||x===-1)throw new Error('Letter "1" must be present between prefix and data only');const T=g.slice(0,x),v=g.slice(x+1);if(v.length<6)throw new Error("Data must be at least 6 characters long");const p=ud.decode(v).slice(0,-6),y=Hp(T,p,t);if(!v.endsWith(y))throw new Error(`Invalid checksum in ${c}: expected "${y}"`);return{prefix:T,words:p}}const l=Bp(o);function u(c){const{prefix:f,words:m}=o(c,!1);return{prefix:f,words:m,bytes:r(m)}}function d(c,f){return a(c,i(f))}return{encode:a,decode:o,encodeFromBytes:d,decodeToBytes:u,decodeUnsafe:l,fromWords:r,fromWordsUnsafe:s,toWords:i}}const cd=wg("bech32"),kg=wg("bech32m");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function a_(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Jl(e,...t){if(!a_(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Vp(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 o_(e,t){Jl(e);const n=t.outputLen;if(e.length>>t}const l_=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",u_=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function fd(e){if(Jl(e),l_)return e.toHex();let t="";for(let n=0;ne().update(_g(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function h_(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const i=BigInt(32),s=BigInt(4294967295),a=Number(n>>i&s),o=Number(n&s),l=r?4:0,u=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+u,o,r)}function p_(e,t,n){return e&t^~e&n}function m_(e,t,n){return e&t^e&n^t&n}class v_ extends d_{constructor(t,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=zu(this.buffer)}update(t){Vp(this),t=_g(t),Jl(t);const{view:n,buffer:r,bl)DELIM" +R"DELIM(ockLen:i}=this,s=t.length;for(let a=0;ai-a&&(this.process(r,0),a=0);for(let c=a;cd.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;c>>3,x=yn(m,17)^yn(m,19)^m>>>10;nr[c]=x+nr[c-7]+g+nr[c-16]|0}let{A:r,B:i,C:s,D:a,E:o,F:l,G:u,H:d}=this;for(let c=0;c<64;c++){const f=yn(o,6)^yn(o,11)^yn(o,25),m=d+f+p_(o,l,u)+y_[c]+nr[c]|0,x=(yn(r,2)^yn(r,13)^yn(r,22))+m_(r,i,s)|0;d=u,u=l,l=o,o=a+m|0,a=s,s=i,i=r,r=m+x|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,i,s,a,o,l,u,d)}roundClean(){dd(nr)}destroy(){this.set(0,0,0,0,0,0,0,0),dd(this.buffer)}}const x_=f_(()=>new g_),Sg=x_,Eg=s_(Sg),w_=BigInt("0x00000000FFFF0000000000000000000000000000000000000000000000000000"),Qp=5e3,Bu=new Map;async function Zt(e,t,n){const r=t.startsWith("/")?t:`/${t}`;let i=r.includes("?")?`${e}${r}`:`${e}${r}?format=json`;n&&(i+=i.includes("?")?"&turbo=true":"?turbo=true");const s=await fetch(i);if(!s.ok){const o=await s.text().catch(()=>"");throw new Error(`Request failed ${s.status}: ${o||s.statusText}`)}const a=await s.text();try{return JSON.parse(a)}catch{return a}}async function bo(e,t,n){try{return await Zt(e,t,n)}catch{return null}}function Nf(e){if(e.length%2!==0)throw new Error("Invalid hex string");const t=new Uint8Array(e.length/2);for(let n=0;n>>24,n=e&8388607;if(n===0||t<3)return;const r=BigInt(n)*(1n<n[1]).filter(Boolean);return t.length?t:[e]}function Pf(e){const t=e.toLowerCase();if(t.includes("dup hash160")&&t.includes("equalverify checksig"))return"p2pkh";if(t.startsWith("hash160")&&t.includes("equal"))return"p2sh";if(t.startsWith("zero [")){const n=t.match(/zero \[([0-9a-f]+)\]/),r=(n==null?void 0:n[1])??"";return r.length===40?"p2wpkh":r.length===64?"p2wsh":"segwit"}if(t.startsWith("1 ["))return"p2tr"}function S_(){return"mainnet"}function E_(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function Wp(e,t){const n=new Uint8Array(t.length/2+1);return n[0]=e,n.set(Nf(t),1),Eg.encode(n)}function Uu(e,t,n){const r=Nf(n),i=cd.toWords(r);return i.unshift(t),(t===0?cd:kg).encode(e,i)}function Cg(e,t){const n=e.toLowerCase(),r=n.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(r)return{address:Wp(t.p2pkh,r[1]),type:"p2pkh"};const i=n.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(i)return{addr)DELIM" +R"DELIM(ess:Wp(t.p2sh,i[1]),type:"p2sh"};const s=n.match(/^zero \[([0-9a-f]{40})\]/);if(s)return{address:Uu(t.hrp,0,s[1]),type:"p2wpkh"};const a=n.match(/^zero \[([0-9a-f]{64})\]/);if(a)return{address:Uu(t.hrp,0,a[1]),type:"p2wsh"};const o=n.match(/^1 \[([0-9a-f]{64})\]/);return o?{address:Uu(t.hrp,1,o[1]),type:"p2tr"}:{type:Pf(e)}}function C_(e,t){try{const i=Eg.decode(e),s=i[0],a=fd(i.slice(1));if(a.length===40&&s===t.p2pkh)return{scriptHex:`76a914${a}88ac`,type:"p2pkh"};if(a.length===40&&s===t.p2sh)return{scriptHex:`a914${a}87`,type:"p2sh"}}catch{}const n=e.toLowerCase();if(n.indexOf("1")>0){const i=n,s=i.startsWith(`${t.hrp}1`)?cd:kg;try{const{prefix:a,words:o}=s.decode(i,90);if(a!==t.hrp)throw new Error("wrong hrp");const l=o[0],u=s.fromWords(o.slice(1)),d=fd(u),c=u.length.toString(16).padStart(2,"0");if(l===0&&(u.length===20||u.length===32))return{scriptHex:`00${c}${d}`,type:u.length===20?"p2wpkh":"p2wsh"};if(l===1&&u.length===32)return{scriptHex:`51${c}${d}`,type:"p2tr"}}catch{}}return null}function Zp(e,t){const n=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(n))return{hash:n,type:"script-hash"};const r=C_(e,t);if(!r)return null;const i=Sg(Nf(r.scriptHex)),s=Uint8Array.from(i).reverse();return{hash:fd(s),type:r.type}}async function hd(e,t){const n=await Zt(e,"/v1/top?format=json",t),r=typeof n=="number"?n:Number(n);if(!Number.isFinite(r))throw new Error("Invalid top height");return r}async function Zo(e,t){const n=Date.now(),r=`${e}|${t?"1":"0"}`,i=Bu.get(r);if(i&&i.expiresAt>n)return i.promise;const s=hd(e,t).then(a=>(Bu.set(r,{promise:s,value:a,expiresAt:Date.now()+Qp}),a));return Bu.set(r,{promise:s,value:(i==null?void 0:i.value)??null,expiresAt:n+Qp}),s}async function Kp(e,t,n){if(t==="latest"||t==="tip"){const r=await Zo(e,n);return{path:`/v1/block/height/${r}`,height:r}}return/^\d+$/u.test(t)?{path:`/v1/block/height/${t}`}:{path:`/v1/block/hash/${t}`}}function No(e,t){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:t,size:void 0,weight:void 0,difficulty:k_(e.bits),previousBlockHash:e.previous??null}}function T_(e){const t=__(e);return t&&t.length>0?t:void 0}function b_(e,t,n,r){const i=/^0{64}$/u.test(e.point.hash),s=t?Cg(t.script,n):{address:void 0,type:void 0};return{index:r,prevTxId:i?void 0:e.point.hash,prevOutputIndex:i?void 0:e.point.index,address:s.address,valueSats:t==null?void 0:t.value,scriptType:s.type??Pf((t==null?void 0:t.script)??e.script),isCoinbase:i,script:e.script?{mnemonic:e.script}:void 0,witness:T_(e.witness),sequence:e.sequence}}function N_(e,t,n){const r=Cg(e.script,n);return{index:t,address:r.address,valueSats:e.value,scriptType:r.type??Pf(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function P_(e,t){return typeof e!="number"||typeof t!="number"?0:Math.max(0,e-t+1)}async function R_(e,t){const n=new Map;return(r,i)=>{const s=`${r}:${i}`;if(n.has(s))return n.get(s);const a=Zt(e,`/v1/output/${r}/${i}?format=json`,t).catch(()=>{});return n.set(s,a),a}}async function Hu(e,t,n,r,i){const s=r?await Promise.all(e.inputs.map(c=>/^0{64}$/u.test(c.point.hash)?Promise.resolve(void 0):r(c.point.hash,c.point.index).catch(()=>{}))):[],a=e.outputs.map((c,f)=>N_(c,f,t)),o=a.reduce((c,f)=>c+f.valueSats,0),l=s.reduce((c,f)=>(f==null?void 0:f.value)===void 0?c:(c??0)+f.value,null),u=P_(n.tipHeight,n.blockHeight),d=typeof n.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:d,confirmations:u,blockHeight:n.blockHeight,blockHash:n.blockHash,receivedTime:n.timestamp,feeSats:Number.isFinite(i)?i:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:l,totalOutput:o,inputs:e.inputs.map((c,f)=>b_(c,s[f],t,f)),outputs:a}}async function j_(e,t,n){return Zt(e,`${t}/txs?format=json`,n)}async function M_(e,t,n,r){return Zt(e,`${t}/tx/${n}?format=json`,r)}async function L_(e,t,n){return await Zt(e,`${t}?format=json`,n)}async function Gp(e,t,n){return await Zt(e,`/v1/address/${t}?format=json`,n).catch(()=>[])}function O_({baseUrl:e,pollIntervalMs:t=15e3,turbo:n=!1}){const r=new Set;let i=null,s=null;const a=E_(S_());async function o(){i||(i=setInterval(async()=>{try{const u=await hd(e,n);if(s===null){s=u;return}if(u>s){const d=await Zt(e,`/v1/block/height/${u}/header?format=json`,n),c=No(d);r.forEach(f=>f({type:"block.new",payload:c})),s=u}}catch(u){console.warn("Libbitcoin poller failed",u)}},t))}function l(){i&&(clearInterval(i),i=null)}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:!1,description:"Adapter for the libbitcoin embedded REST API."},async getLatestBlocks(u=10){const d=await Zo(e,n);s=d;const c=Array.from({length:u},(m,g)=>d-g).filter(m=>m>=0);return(await Promise.all(c.map(m=>Zt(e,`/v1/block/height/${m}/header?format=json`,n)))).map(m=>No(m))},async getBlocksBefore(u,d=10){const c=Array.from({length:d},(m,g)=>u-g).filter(m=>m>=0);return(await Promise.all(c.map(m=>Zt(e,`/v1/block/height/${m}/header?format=json`,n)))).map(m=>No(m)))DELIM" +R"DELIM(},async getBlock(u){var v;const{path:d}=await Kp(e,u,n),[c,f]=await Promise.all([L_(e,d,n),Zo(e,n)]);s=Math.max(s??0,f);let m=null;if(c.header.heightHu(p,a,{blockHeight:c.header.height,blockHash:c.header.hash,tipHeight:f,timestamp:c.header.timestamp})));return{...x,merkleRoot:c.header.merkle_root,nonce:c.header.nonce,bits:c.header.bits,version:c.header.version,nextBlockHash:m,transactions:T}},async getBlockTransactions(u,d=0){const{path:c}=await Kp(e,u,n),f=await Zt(e,`${c}/header?format=json`,n),[m,g]=await Promise.all([j_(e,c,n),Zo(e,n)]);s=Math.max(s??0,g);const x=m.slice(d);return await Promise.all(x.map((v,p)=>M_(e,c,d+p,n).then(y=>Hu(y,a,{blockHeight:f.height,blockHash:f.hash,tipHeight:g,timestamp:f.timestamp}))))},async getTransaction(u){const d=await Zt(e,`/v1/tx/${u}?format=json`,n),[c,f,m]=await Promise.all([bo(e,`/v1/tx/${u}/header?format=json`,n),hd(e,n).catch(()=>null),bo(e,`/v1/tx/${u}/fee?format=json`,n)]),g=await R_(e,n),x=typeof m=="number"?m:Number(m);return Hu(d,a,{blockHeight:c==null?void 0:c.height,blockHash:c==null?void 0:c.hash,tipHeight:typeof f=="number"?f:void 0,timestamp:c==null?void 0:c.timestamp},g,Number.isFinite(x)?x:void 0)},async getAddress(u){const d=Zp(u,a);if(!d)throw new Error("Unsupported address format for libbitcoin adapter");const[c,f]=await Promise.all([bo(e,`/v1/address/${d.hash}/balance?format=json`,n),Gp(e,d.hash,n)]),m=typeof c=="number"?c:Number(c);let g=0;for(const v of f)g+=v.value??0;const x=Number.isFinite(m)?m:g,T=f.map(v=>({txid:v.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:v.value}));return{address:u,addressType:d.type,balance:x,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:void 0,transactions:T}},async getAddressTransactions(u){const d=Zp(u,a);return d?(await Gp(e,d.hash,n)).map(f=>({txid:f.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:f.value})):[]},subscribeToEvents(u){return r.add(u),o(),()=>{r.delete(u),r.size===0&&l()}}}}const Tg=C.createContext(null),bg=C.createContext(null),Ng=C.createContext(null);function D_({children:e,client:t}){return h.jsx(Tg.Provider,{value:t,children:e})}function A_({children:e,provider:t,setProvider:n,availableProviders:r}){return h.jsx(bg.Provider,{value:{provider:t,setProvider:n,availableProviders:r},children:e})}function I_({children:e,turbo:t,setTurbo:n}){return h.jsx(Ng.Provider,{value:{turbo:t,setTurbo:n},children:e})}function qn(){const e=C.useContext(Tg);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function $_(){return qn().metadata}function F_(){const e=C.useContext(bg);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function z_(){const e=C.useContext(Ng);if(!e)throw new Error("TurboProvider missing in component tree");return e}function B_(){var e;return typeof window<"u"&&((e=window.location)!=null&&e.origin)?window.location.origin:"http://localhost:8080"}function U_(e){return Pg("libbitcoin",e)}function Pg(e,t){if(e==="blockstream")return hg({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return Xk({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const n=B_();return O_({baseUrl:n,turbo:t==null?void 0:t.turboEnabled})}return e==="external"?(console.warn("No external API URL provided, falling back to mock client"),Iu()):(e==="mock"||console.warn(`Unknown provider "${e}", falling back to mock`),Iu())}function H_(){const e=new Set;return e.add("libbitcoin"),e.add("blockstream"),e.add("mempool"),Array.from(e)}const qp=new _w({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}});function V_({children:e}){const t="libbitcoin",[n,r]=C.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("turboEnabled")==="true"),[i,s]=C.useState(t),[a,o]=C.useState(()=>U_({turboEnabled:n})),l=C.useRef(!0);return C.useEffect(()=>{typeof window<"u"&&window.localStorage.setItem("turboEnabled",n?"true":"false")},[n]),C.useEffect(()=>{if(l.current){l.current=!1;return}o(Pg(i,{turboEnabled:n})),qp.clear()},[i,n]),h.jsx(A_,{provider:i,setProvider:s,availableProviders:H_(),children:h.jsx(I_,{turbo:n,setTurbo:r,children:h.jsx(D_,{client:a,children:h.jsxs(Sw,{client:qp,children:[e,null]})})})})}/** * @remix-run/router v1.23.1 * * Copyright (c) Remix Software Inc. @@ -126,18 +126,18 @@ R"DELIM(},async getBlock(u){var v;const{path:d}=await Zp(e,u,n),[c,f]=await Prom * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Me(){return Me=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ei(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Q_(){return Math.random().toString(36).substr(2,8)}function Yp(e,t){return{usr:e.state,key:e.key,idx:t}}function Da(e,t,n,r){return n===void 0&&(n=null),Me({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ur(t):t,{state:n,key:t&&t.key||r||Q_()})}function Ci(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ur(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function W_(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o=We.Pop,l=null,u=d();u==null&&(u=0,a.replaceState(Me({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function c(){o=We.Pop;let T=d(),v=T==null?null:T-u;u=T,l&&l({action:o,location:x.location,delta:v})}function f(T,v){o=We.Push;let p=Da(x.location,T,v);u=d()+1;let y=Yp(p,u),S=x.createHref(p);try{a.pushState(y,"",S)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;i.location.assign(S)}s&&l&&l({action:o,location:x.location,delta:1})}function m(T,v){o=We.Replace;let p=Da(x.location,T,v);u=d();let y=Yp(p,u),S=x.createHref(p);a.replaceState(y,"",S),s&&l&&l({action:o,location:x.location,delta:0})}function g(T){let v=i.location.origin!=="null"?i.location.origin:i.location.href,p=typeof T=="string"?T:Ci(T);return p=p.replace(/ $/,"%20"),le(v,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,v)}let x={get action(){return o},get location(){return e(i,a)},listen(T){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(qp,c),l=T,()=>{i.removeEventListener(qp,c),l=null}},createHref(T){return t(i,T)},createURL:g,encodeLocation(T){let v=g(T);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:m,go(T){return a.go(T)}};return x}var Ee;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ee||(Ee={}));const Z_=new Set(["lazy","caseSensitive","path","id","index","children"]);function K_(e){return e.index===!0}function Nl(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,s)=>{let a=[...n,String(s)],o=typeof i.id=="string"?i.id:a.join("-");if(le(i.index!==!0||!i.children,"Cannot specify children on an index route"),le(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),K_(i)){let l=Me({},i,t(i),{id:o});return r[o]=l,l}else{let l=Me({},i,t(i),{id:o,children:void 0});return r[o]=l,i.children&&(l.children=Nl(i.children,t,a,r)),l}})}function Yr(e,t,n){return n===void 0&&(n="/"),Ko(e,t,n,!1)}function Ko(e,t,n,r){let i=typeof t=="string"?Ur(t):t,s=Kn(i.pathname||"/",n);if(s==null)return null;let a=Ng(e);q_(a);let o=null;for(let l=0;o==null&&l{let l={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};l.relativePath.startsWith("/")&&(le(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Un([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(le(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Ng(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:rS(u,s.index),routesMeta:d})};return e.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let l of Rg(s.path))i(s,a,l)}),t}function Rg(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=Rg(r.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),i&&o.push(...a),o.map(l=>e.startsWith("/")&&l===""?"/":l)}function q_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:iS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Y_=/^:[\w-]+$/,X_=3,J_=2,eS=1,tS=10,nS=-2,Xp=e=>e==="*";function rS(e,t){let n=e.split("/"),r=n.length;return n.some(Xp)DELIM" - R"DELIM()&&(r+=nS),t&&(r+=J_),n.filter(i=>!Xp(i)).reduce((i,s)=>i+(Y_.test(s)?X_:s===""?eS:tS),r)}function iS(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function sS(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},s="/",a=[];for(let o=0;o{let{paramName:f,isOptional:m}=d;if(f==="*"){let x=o[c]||"";a=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const g=o[c];return m&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:e}}function aS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ei(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function oS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ei(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Kn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const lS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uS=e=>lS.test(e);function cS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ur(e):e,s;if(n)if(uS(n))s=n;else{if(n.includes("//")){let a=n;n=n.replace(/\/\/+/g,"/"),Ei(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?s=Jp(n.substring(1),"/"):s=Jp(n,t)}else s=t;return{pathname:s,search:fS(r),hash:hS(i)}}function Jp(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Vu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function jg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Nf(e,t){let n=jg(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Rf(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ur(e):(i=Me({},e),le(!i.pathname||!i.pathname.includes("?"),Vu("?","pathname","search",i)),le(!i.pathname||!i.pathname.includes("#"),Vu("#","pathname","hash",i)),le(!i.search||!i.search.includes("#"),Vu("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=n;else{let c=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),c-=1;i.pathname=f.join("/")}o=c>=0?t[c]:"/"}let l=cS(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(s||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Un=e=>e.join("/").replace(/\/\/+/g,"/"),dS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),fS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class jl{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Aa(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Mg=["post","put","patch","delete"],pS=new Set(Mg),mS=["get",...Mg],vS=new Set(mS),yS=new Set([301,302,303,307,308]),gS=new Set([307,308]),Qu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},xS={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formDat)DELIM" - R"DELIM(a:void 0,json:void 0,text:void 0},Hs={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},jf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wS=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Lg="remix-router-transitions";function kS(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;le(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let w=e.detectErrorBoundary;i=E=>({hasErrorBoundary:w(E)})}else i=wS;let s={},a=Nl(e.routes,i,void 0,s),o,l=e.basename||"/",u=e.dataStrategy||CS,d=e.patchRoutesOnNavigation,c=Me({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,m=new Set,g=null,x=null,T=null,v=e.hydrationData!=null,p=Yr(a,e.history.location,l),y=!1,S=null;if(p==null&&!d){let w=St(404,{pathname:e.history.location.pathname}),{matches:E,route:P}=cm(a);p=E,S={[P.id]:w}}p&&!e.hydrationData&&to(p,a,e.history.location.pathname).active&&(p=null);let R;if(p)if(p.some(w=>w.route.lazy))R=!1;else if(!p.some(w=>w.route.loader))R=!0;else if(c.v7_partialHydration){let w=e.hydrationData?e.hydrationData.loaderData:null,E=e.hydrationData?e.hydrationData.errors:null;if(E){let P=p.findIndex(M=>E[M.route.id]!==void 0);R=p.slice(0,P+1).every(M=>!pd(M.route,w,E))}else R=p.every(P=>!pd(P.route,w,E))}else R=e.hydrationData!=null;else if(R=!1,p=[],c.v7_partialHydration){let w=to(null,a,e.history.location.pathname);w.active&&w.matches&&(y=!0,p=w.matches)}let L,k={historyAction:e.history.action,location:e.history.location,matches:p,initialized:R,navigation:Qu,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},j=We.Pop,W=!1,N,B=!1,ue=new Map,be=null,Z=!1,F=!1,$=[],K=new Set,b=new Map,D=0,I=-1,ee=new Map,re=new Set,ke=new Map,_e=new Map,Te=new Set,Ie=new Map,Ve=new Map,hn;function Nn(){if(f=e.history.listen(w=>{let{action:E,location:P,delta:M}=w;if(hn){hn(),hn=void 0;return}Ei(Ve.size===0||M!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let z=Kf({currentLocation:k.location,nextLocation:P,historyAction:E});if(z&&M!=null){let te=new Promise(ie=>{hn=ie});e.history.go(M*-1),eo(z,{state:"blocked",location:P,proceed(){eo(z,{state:"proceeding",proceed:void 0,reset:void 0,location:P}),te.then(()=>e.history.go(M))},reset(){let ie=new Map(k.blockers);ie.set(z,Hs),Ue({blockers:ie})}});return}return Qr(E,P)}),n){FS(t,ue);let w=()=>zS(t,ue);t.addEventListener("pagehide",w),be=()=>t.removeEventListener("pagehide",w)}return k.initialized||Qr(We.Pop,k.location,{initialHydration:!0}),L}function ct(){f&&f(),be&&be(),m.clear(),N&&N.abort(),k.fetchers.forEach((w,E)=>Ja(E)),k.blockers.forEach((w,E)=>Zf(E))}function pn(w){return m.add(w),()=>m.delete(w)}function Ue(w,E){E===void 0&&(E={}),k=Me({},k,w);let P=[],M=[];c.v7_fetcherPersist&&k.fetchers.forEach((z,te)=>{z.state==="idle"&&(Te.has(te)?M.push(te):P.push(te))}),Te.forEach(z=>{!k.fetchers.has(z)&&!b.has(z)&&M.push(z)}),[...m].forEach(z=>z(k,{deletedFetchers:M,viewTransitionOpts:E.viewTransitionOpts,flushSync:E.flushSync===!0})),c.v7_fetcherPersist?(P.forEach(z=>k.fetchers.delete(z)),M.forEach(z=>Ja(z))):M.forEach(z=>Te.delete(z))}function Jt(w,E,P){var M,z;let{flushSync:te}=P===void 0?{}:P,ie=k.actionData!=null&&k.navigation.formMethod!=null&&on(k.navigation.formMethod)&&k.navigation.state==="loading"&&((M=w.state)==null?void 0:M._isRedirect)!==!0,G;E.actionData?Object.keys(E.actionData).length>0?G=E.actionData:G=null:ie?G=k.actionData:G=null;let Y=E.loaderData?lm(k.loaderData,E.loaderData,E.matches||[],E.errors):k.loaderData,Q=k.blockers;Q.size>0&&(Q=new Map(Q),Q.forEach((pe,rt)=>Q.set(rt,Hs)));let J=W===!0||k.navigation.formMethod!=null&&on(k.navigation.formMethod)&&((z=w.state)==null?void 0:z._isRedirect)!==!0;o&&(a=o,o=void 0),Z||j===We.Pop||(j===We.Push?e.history.push(w,w.state):j===We.Replace&&e.history.replace(w,w.state));let oe;if(j===We.Pop){let pe=ue.get(k.location.pathname);pe&&pe.has(w.pathname)?oe={currentLocation:k.location,nextLocation:w}:ue.has(w.pathname)&&(oe={currentLocation:w,nextLocation:k.location})}else if(B){let pe=ue.get(k.location.pathname);pe?pe.add(w.pathname):(pe=new Set([w.pathname]),ue.set(k.location.pathname,pe)),oe={currentLocation:k.location,nextLocation:w}}Ue(Me({},E,{)DELIM" - R"DELIM(actionData:G,loaderData:Y,historyAction:j,location:w,initialized:!0,navigation:Qu,revalidation:"idle",restoreScrollPosition:qf(w,E.matches||k.matches),preventScrollReset:J,blockers:Q}),{viewTransitionOpts:oe,flushSync:te===!0}),j=We.Pop,W=!1,B=!1,Z=!1,F=!1,$=[]}async function zf(w,E){if(typeof w=="number"){e.history.go(w);return}let P=hd(k.location,k.matches,l,c.v7_prependBasename,w,c.v7_relativeSplatPath,E==null?void 0:E.fromRouteId,E==null?void 0:E.relative),{path:M,submission:z,error:te}=em(c.v7_normalizeFormMethod,!1,P,E),ie=k.location,G=Da(k.location,M,E&&E.state);G=Me({},G,e.history.encodeLocation(G));let Y=E&&E.replace!=null?E.replace:void 0,Q=We.Push;Y===!0?Q=We.Replace:Y===!1||z!=null&&on(z.formMethod)&&z.formAction===k.location.pathname+k.location.search&&(Q=We.Replace);let J=E&&"preventScrollReset"in E?E.preventScrollReset===!0:void 0,oe=(E&&E.flushSync)===!0,pe=Kf({currentLocation:ie,nextLocation:G,historyAction:Q});if(pe){eo(pe,{state:"blocked",location:G,proceed(){eo(pe,{state:"proceeding",proceed:void 0,reset:void 0,location:G}),zf(w,E)},reset(){let rt=new Map(k.blockers);rt.set(pe,Hs),Ue({blockers:rt})}});return}return await Qr(Q,G,{submission:z,pendingError:te,preventScrollReset:J,replace:E&&E.replace,enableViewTransition:E&&E.viewTransition,flushSync:oe})}function u0(){if(su(),Ue({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){Qr(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}Qr(j||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:B===!0})}}async function Qr(w,E,P){N&&N.abort(),N=null,j=w,Z=(P&&P.startUninterruptedRevalidation)===!0,x0(k.location,k.matches),W=(P&&P.preventScrollReset)===!0,B=(P&&P.enableViewTransition)===!0;let M=o||a,z=P&&P.overrideNavigation,te=P!=null&&P.initialHydration&&k.matches&&k.matches.length>0&&!y?k.matches:Yr(M,E,l),ie=(P&&P.flushSync)===!0;if(te&&k.initialized&&!F&&jS(k.location,E)&&!(P&&P.submission&&on(P.submission.formMethod))){Jt(E,{matches:te},{flushSync:ie});return}let G=to(te,M,E.pathname);if(G.active&&G.matches&&(te=G.matches),!te){let{error:Pe,notFoundMatches:we,route:$e}=au(E.pathname);Jt(E,{matches:we,loaderData:{},errors:{[$e.id]:Pe}},{flushSync:ie});return}N=new AbortController;let Y=Mi(e.history,E,N.signal,P&&P.submission),Q;if(P&&P.pendingError)Q=[Xr(te).route.id,{type:Ee.error,error:P.pendingError}];else if(P&&P.submission&&on(P.submission.formMethod)){let Pe=await c0(Y,E,P.submission,te,G.active,{replace:P.replace,flushSync:ie});if(Pe.shortCircuited)return;if(Pe.pendingActionResult){let[we,$e]=Pe.pendingActionResult;if(Mt($e)&&Aa($e.error)&&$e.error.status===404){N=null,Jt(E,{matches:Pe.matches,loaderData:{},errors:{[we]:$e.error}});return}}te=Pe.matches||te,Q=Pe.pendingActionResult,z=Wu(E,P.submission),ie=!1,G.active=!1,Y=Mi(e.history,Y.url,Y.signal)}let{shortCircuited:J,matches:oe,loaderData:pe,errors:rt}=await d0(Y,E,te,G.active,z,P&&P.submission,P&&P.fetcherSubmission,P&&P.replace,P&&P.initialHydration===!0,ie,Q);J||(N=null,Jt(E,Me({matches:oe||te},um(Q),{loaderData:pe,errors:rt})))}async function c0(w,E,P,M,z,te){te===void 0&&(te={}),su();let ie=IS(E,P);if(Ue({navigation:ie},{flushSync:te.flushSync===!0}),z){let Q=await no(M,E.pathname,w.signal);if(Q.type==="aborted")return{shortCircuited:!0};if(Q.type==="error"){let J=Xr(Q.partialMatches).route.id;return{matches:Q.partialMatches,pendingActionResult:[J,{type:Ee.error,error:Q.error}]}}else if(Q.matches)M=Q.matches;else{let{notFoundMatches:J,error:oe,route:pe}=au(E.pathname);return{matches:J,pendingActionResult:[pe.id,{type:Ee.error,error:oe}]}}}let G,Y=ea(M,E);if(!Y.route.action&&!Y.route.lazy)G={type:Ee.error,error:St(405,{method:w.method,pathname:E.pathname,routeId:Y.route.id})};else if(G=(await Ns("action",k,w,[Y],M,null))[Y.route.id],w.signal.aborted)return{shortCircuited:!0};if(ri(G)){let Q;return te&&te.replace!=null?Q=te.replace:Q=sm(G.response.headers.get("Location"),new URL(w.url),l)===k.location.pathname+k.location.search,await Wr(w,G,!0,{submission:P,replace:Q}),{shortCircuited:!0}}if(Sr(G))throw St(400,{type:"defer-action"});if(Mt(G)){let Q=Xr(M,Y.route.id);return(te&&te.replace)!==!0&&(j=We.Push),{matches:M,pendingActionResult:[Q.route.id,G]}}return{matches:M,pendingActionResult:[Y.route.id,G]}}async function d0(w,E,P,M,z,te,ie,G,Y,Q,J){let oe=z||Wu(E,te),pe=te||ie||fm(oe),rt=!Z&&(!c.v7_partialHydration||!Y);if(M){if(rt){let Fe=Bf(J);Ue(Me({navigation:oe},Fe!==void 0?{actionData:Fe}:{}),{flushSync:Q})}let ge=await no(P,E.pathname,w.signal);if(ge.type==="aborted")return{shortCircuited:!0};if(ge.type==="error"){let Fe=Xr(ge.partialMatches).route.id;return{matches:ge.partialMatches,loaderData:{},errors:{[Fe]:ge.error}}}else if(ge.matches)P=ge.matches;else{let{error:Fe,notFoundMatches:Ni,route:Ms}=au(E.pathname);return{matches:Ni,loaderData:{},errors:{[Ms.id]:Fe}}}}let Pe=o||a,[we,$e]=nm(e.history,k,P,pe,E,c.v7_partialHydration&&Y===!0,c.v7_skipActionErrorRevalidation,F,$)DELIM" - R"DELIM(,K,Te,ke,re,Pe,l,J);if(ou(ge=>!(P&&P.some(Fe=>Fe.route.id===ge))||we&&we.some(Fe=>Fe.route.id===ge)),I=++D,we.length===0&&$e.length===0){let ge=Qf();return Jt(E,Me({matches:P,loaderData:{},errors:J&&Mt(J[1])?{[J[0]]:J[1].error}:null},um(J),ge?{fetchers:new Map(k.fetchers)}:{}),{flushSync:Q}),{shortCircuited:!0}}if(rt){let ge={};if(!M){ge.navigation=oe;let Fe=Bf(J);Fe!==void 0&&(ge.actionData=Fe)}$e.length>0&&(ge.fetchers=f0($e)),Ue(ge,{flushSync:Q})}$e.forEach(ge=>{Jn(ge.key),ge.controller&&b.set(ge.key,ge.controller)});let Pi=()=>$e.forEach(ge=>Jn(ge.key));N&&N.signal.addEventListener("abort",Pi);let{loaderResults:Rs,fetcherResults:jn}=await Uf(k,P,we,$e,w);if(w.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",Pi),$e.forEach(ge=>b.delete(ge.key));let mn=No(Rs);if(mn)return await Wr(w,mn.result,!0,{replace:G}),{shortCircuited:!0};if(mn=No(jn),mn)return re.add(mn.key),await Wr(w,mn.result,!0,{replace:G}),{shortCircuited:!0};let{loaderData:lu,errors:js}=om(k,P,Rs,J,$e,jn,Ie);Ie.forEach((ge,Fe)=>{ge.subscribe(Ni=>{(Ni||ge.done)&&Ie.delete(Fe)})}),c.v7_partialHydration&&Y&&k.errors&&(js=Me({},k.errors,js));let Zr=Qf(),ro=Wf(I),io=Zr||ro||$e.length>0;return Me({matches:P,loaderData:lu,errors:js},io?{fetchers:new Map(k.fetchers)}:{})}function Bf(w){if(w&&!Mt(w[1]))return{[w[0]]:w[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function f0(w){return w.forEach(E=>{let P=k.fetchers.get(E.key),M=Vs(void 0,P?P.data:void 0);k.fetchers.set(E.key,M)}),new Map(k.fetchers)}function h0(w,E,P,M){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Jn(w);let z=(M&&M.flushSync)===!0,te=o||a,ie=hd(k.location,k.matches,l,c.v7_prependBasename,P,c.v7_relativeSplatPath,E,M==null?void 0:M.relative),G=Yr(te,ie,l),Y=to(G,te,ie);if(Y.active&&Y.matches&&(G=Y.matches),!G){Rn(w,E,St(404,{pathname:ie}),{flushSync:z});return}let{path:Q,submission:J,error:oe}=em(c.v7_normalizeFormMethod,!0,ie,M);if(oe){Rn(w,E,oe,{flushSync:z});return}let pe=ea(G,Q),rt=(M&&M.preventScrollReset)===!0;if(J&&on(J.formMethod)){p0(w,E,Q,pe,G,Y.active,z,rt,J);return}ke.set(w,{routeId:E,path:Q}),m0(w,E,Q,pe,G,Y.active,z,rt,J)}async function p0(w,E,P,M,z,te,ie,G,Y){su(),ke.delete(w);function Q(Qe){if(!Qe.route.action&&!Qe.route.lazy){let Ri=St(405,{method:Y.formMethod,pathname:P,routeId:E});return Rn(w,E,Ri,{flushSync:ie}),!0}return!1}if(!te&&Q(M))return;let J=k.fetchers.get(w);Xn(w,$S(Y,J),{flushSync:ie});let oe=new AbortController,pe=Mi(e.history,P,oe.signal,Y);if(te){let Qe=await no(z,new URL(pe.url).pathname,pe.signal,w);if(Qe.type==="aborted")return;if(Qe.type==="error"){Rn(w,E,Qe.error,{flushSync:ie});return}else if(Qe.matches){if(z=Qe.matches,M=ea(z,P),Q(M))return}else{Rn(w,E,St(404,{pathname:P}),{flushSync:ie});return}}b.set(w,oe);let rt=D,we=(await Ns("action",k,pe,[M],z,w))[M.route.id];if(pe.signal.aborted){b.get(w)===oe&&b.delete(w);return}if(c.v7_fetcherPersist&&Te.has(w)){if(ri(we)||Mt(we)){Xn(w,ar(void 0));return}}else{if(ri(we))if(b.delete(w),I>rt){Xn(w,ar(void 0));return}else return re.add(w),Xn(w,Vs(Y)),Wr(pe,we,!1,{fetcherSubmission:Y,preventScrollReset:G});if(Mt(we)){Rn(w,E,we.error);return}}if(Sr(we))throw St(400,{type:"defer-action"});let $e=k.navigation.location||k.location,Pi=Mi(e.history,$e,oe.signal),Rs=o||a,jn=k.navigation.state!=="idle"?Yr(Rs,k.navigation.location,l):k.matches;le(jn,"Didn't find any matches after fetcher action");let mn=++D;ee.set(w,mn);let lu=Vs(Y,we.data);k.fetchers.set(w,lu);let[js,Zr]=nm(e.history,k,jn,Y,$e,!1,c.v7_skipActionErrorRevalidation,F,$,K,Te,ke,re,Rs,l,[M.route.id,we]);Zr.filter(Qe=>Qe.key!==w).forEach(Qe=>{let Ri=Qe.key,Yf=k.fetchers.get(Ri),_0=Vs(void 0,Yf?Yf.data:void 0);k.fetchers.set(Ri,_0),Jn(Ri),Qe.controller&&b.set(Ri,Qe.controller)}),Ue({fetchers:new Map(k.fetchers)});let ro=()=>Zr.forEach(Qe=>Jn(Qe.key));oe.signal.addEventListener("abort",ro);let{loaderResults:io,fetcherResults:ge}=await Uf(k,jn,js,Zr,Pi);if(oe.signal.aborted)return;oe.signal.removeEventListener("abort",ro),ee.delete(w),b.delete(w),Zr.forEach(Qe=>b.delete(Qe.key));let Fe=No(io);if(Fe)return Wr(Pi,Fe.result,!1,{preventScrollReset:G});if(Fe=No(ge),Fe)return re.add(Fe.key),Wr(Pi,Fe.result,!1,{preventScrollReset:G});let{loaderData:Ni,errors:Ms}=om(k,jn,io,void 0,Zr,ge,Ie);if(k.fetchers.has(w)){let Qe=ar(we.data);k.fetchers.set(w,Qe)}Wf(mn),k.navigation.state==="loading"&&mn>I?(le(j,"Expected pending action"),N&&N.abort(),Jt(k.navigation.location,{matches:jn,loaderData:Ni,errors:Ms,fetchers:new Map(k.fetchers)})):(Ue({errors:Ms,loaderData:lm(k.loaderData,Ni,jn,Ms),fetchers:new Map(k.fetchers)}),F=!1)}async function m0(w,E,P,M,z,te,ie,G,Y){let Q=k.fetchers.get(w);Xn(w,Vs(Y,Q?Q.data:void 0),{flushSync:ie});let J=new AbortController,oe=Mi(e.history,P,J.signal);if(te){let we=await no(z,new URL(oe.url).pathname,o)DELIM" - R"DELIM(e.signal,w);if(we.type==="aborted")return;if(we.type==="error"){Rn(w,E,we.error,{flushSync:ie});return}else if(we.matches)z=we.matches,M=ea(z,P);else{Rn(w,E,St(404,{pathname:P}),{flushSync:ie});return}}b.set(w,J);let pe=D,Pe=(await Ns("loader",k,oe,[M],z,w))[M.route.id];if(Sr(Pe)&&(Pe=await Mf(Pe,oe.signal,!0)||Pe),b.get(w)===J&&b.delete(w),!oe.signal.aborted){if(Te.has(w)){Xn(w,ar(void 0));return}if(ri(Pe))if(I>pe){Xn(w,ar(void 0));return}else{re.add(w),await Wr(oe,Pe,!1,{preventScrollReset:G});return}if(Mt(Pe)){Rn(w,E,Pe.error);return}le(!Sr(Pe),"Unhandled fetcher deferred data"),Xn(w,ar(Pe.data))}}async function Wr(w,E,P,M){let{submission:z,fetcherSubmission:te,preventScrollReset:ie,replace:G}=M===void 0?{}:M;E.response.headers.has("X-Remix-Revalidate")&&(F=!0);let Y=E.response.headers.get("Location");le(Y,"Expected a Location header on the redirect Response"),Y=sm(Y,new URL(w.url),l);let Q=Da(k.location,Y,{_isRedirect:!0});if(n){let we=!1;if(E.response.headers.has("X-Remix-Reload-Document"))we=!0;else if(jf.test(Y)){const $e=e.history.createURL(Y);we=$e.origin!==t.location.origin||Kn($e.pathname,l)==null}if(we){G?t.location.replace(Y):t.location.assign(Y);return}}N=null;let J=G===!0||E.response.headers.has("X-Remix-Replace")?We.Replace:We.Push,{formMethod:oe,formAction:pe,formEncType:rt}=k.navigation;!z&&!te&&oe&&pe&&rt&&(z=fm(k.navigation));let Pe=z||te;if(gS.has(E.response.status)&&Pe&&on(Pe.formMethod))await Qr(J,Q,{submission:Me({},Pe,{formAction:Y}),preventScrollReset:ie||W,enableViewTransition:P?B:void 0});else{let we=Wu(Q,z);await Qr(J,Q,{overrideNavigation:we,fetcherSubmission:te,preventScrollReset:ie||W,enableViewTransition:P?B:void 0})}}async function Ns(w,E,P,M,z,te){let ie,G={};try{ie=await TS(u,w,E,P,M,z,te,s,i)}catch(Y){return M.forEach(Q=>{G[Q.route.id]={type:Ee.error,error:Y}}),G}for(let[Y,Q]of Object.entries(ie))if(MS(Q)){let J=Q.result;G[Y]={type:Ee.redirect,response:NS(J,P,Y,z,l,c.v7_relativeSplatPath)}}else G[Y]=await PS(Q);return G}async function Uf(w,E,P,M,z){let te=w.matches,ie=Ns("loader",w,z,P,E,null),G=Promise.all(M.map(async J=>{if(J.matches&&J.match&&J.controller){let pe=(await Ns("loader",w,Mi(e.history,J.path,J.controller.signal),[J.match],J.matches,J.key))[J.match.route.id];return{[J.key]:pe}}else return Promise.resolve({[J.key]:{type:Ee.error,error:St(404,{pathname:J.path})}})})),Y=await ie,Q=(await G).reduce((J,oe)=>Object.assign(J,oe),{});return await Promise.all([DS(E,Y,z.signal,te,w.loaderData),AS(E,Q,M)]),{loaderResults:Y,fetcherResults:Q}}function su(){F=!0,$.push(...ou()),ke.forEach((w,E)=>{b.has(E)&&K.add(E),Jn(E)})}function Xn(w,E,P){P===void 0&&(P={}),k.fetchers.set(w,E),Ue({fetchers:new Map(k.fetchers)},{flushSync:(P&&P.flushSync)===!0})}function Rn(w,E,P,M){M===void 0&&(M={});let z=Xr(k.matches,E);Ja(w),Ue({errors:{[z.route.id]:P},fetchers:new Map(k.fetchers)},{flushSync:(M&&M.flushSync)===!0})}function Hf(w){return _e.set(w,(_e.get(w)||0)+1),Te.has(w)&&Te.delete(w),k.fetchers.get(w)||xS}function Ja(w){let E=k.fetchers.get(w);b.has(w)&&!(E&&E.state==="loading"&&ee.has(w))&&Jn(w),ke.delete(w),ee.delete(w),re.delete(w),c.v7_fetcherPersist&&Te.delete(w),K.delete(w),k.fetchers.delete(w)}function v0(w){let E=(_e.get(w)||0)-1;E<=0?(_e.delete(w),Te.add(w),c.v7_fetcherPersist||Ja(w)):_e.set(w,E),Ue({fetchers:new Map(k.fetchers)})}function Jn(w){let E=b.get(w);E&&(E.abort(),b.delete(w))}function Vf(w){for(let E of w){let P=Hf(E),M=ar(P.data);k.fetchers.set(E,M)}}function Qf(){let w=[],E=!1;for(let P of re){let M=k.fetchers.get(P);le(M,"Expected fetcher: "+P),M.state==="loading"&&(re.delete(P),w.push(P),E=!0)}return Vf(w),E}function Wf(w){let E=[];for(let[P,M]of ee)if(M0}function y0(w,E){let P=k.blockers.get(w)||Hs;return Ve.get(w)!==E&&Ve.set(w,E),P}function Zf(w){k.blockers.delete(w),Ve.delete(w)}function eo(w,E){let P=k.blockers.get(w)||Hs;le(P.state==="unblocked"&&E.state==="blocked"||P.state==="blocked"&&E.state==="blocked"||P.state==="blocked"&&E.state==="proceeding"||P.state==="blocked"&&E.state==="unblocked"||P.state==="proceeding"&&E.state==="unblocked","Invalid blocker state transition: "+P.state+" -> "+E.state);let M=new Map(k.blockers);M.set(w,E),Ue({blockers:M})}function Kf(w){let{currentLocation:E,nextLocation:P,historyAction:M}=w;if(Ve.size===0)return;Ve.size>1&&Ei(!1,"A router only supports one blocker at a time");let z=Array.from(Ve.entries()),[te,ie]=z[z.length-1],G=k.blockers.get(te);if(!(G&&G.state==="proceeding")&&ie({currentLocation:E,nextLocation:P,historyAction:M}))return te}function au(w){let E=St(404,{pathname:w}),P=o||a,{matches:M,route:z}=cm(P);return ou(),{notFoundMatches:M,route:z,error:E}}function ou(w){let E=[];return Ie.forEach((P,M)=>{(!w||w(M))&&(P.cancel(),E.push(M),Ie.delete(M))}),E}function g0(w,E,P){if(g=w,T=E,x=P||null,!v&&k.navigation===Qu){v=!0;let M=qf(k.location,k.matches);M!=null&&Ue({restoreScrol)DELIM" - R"DELIM(lPosition:M})}return()=>{g=null,T=null,x=null}}function Gf(w,E){return x&&x(w,E.map(M=>G_(M,k.loaderData)))||w.key}function x0(w,E){if(g&&T){let P=Gf(w,E);g[P]=T()}}function qf(w,E){if(g){let P=Gf(w,E),M=g[P];if(typeof M=="number")return M}return null}function to(w,E,P){if(d)if(w){if(Object.keys(w[0].params).length>0)return{active:!0,matches:Ko(E,P,l,!0)}}else return{active:!0,matches:Ko(E,P,l,!0)||[]};return{active:!1,matches:null}}async function no(w,E,P,M){if(!d)return{type:"success",matches:w};let z=w;for(;;){let te=o==null,ie=o||a,G=s;try{await d({signal:P,path:E,matches:z,fetcherKey:M,patch:(J,oe)=>{P.aborted||im(J,oe,ie,G,i)}})}catch(J){return{type:"error",error:J,partialMatches:z}}finally{te&&!P.aborted&&(a=[...a])}if(P.aborted)return{type:"aborted"};let Y=Yr(ie,E,l);if(Y)return{type:"success",matches:Y};let Q=Ko(ie,E,l,!0);if(!Q||z.length===Q.length&&z.every((J,oe)=>J.route.id===Q[oe].route.id))return{type:"success",matches:null};z=Q}}function w0(w){s={},o=Nl(w,i,void 0,s)}function k0(w,E){let P=o==null;im(w,E,o||a,s,i),P&&(a=[...a],Ue({}))}return L={get basename(){return l},get future(){return c},get state(){return k},get routes(){return a},get window(){return t},initialize:Nn,subscribe:pn,enableScrollRestoration:g0,navigate:zf,fetch:h0,revalidate:u0,createHref:w=>e.history.createHref(w),encodeLocation:w=>e.history.encodeLocation(w),getFetcher:Hf,deleteFetcher:v0,dispose:ct,getBlocker:y0,deleteBlocker:Zf,patchRoutes:k0,_internalFetchControllers:b,_internalActiveDeferreds:Ie,_internalSetRoutes:w0},L}function _S(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function hd(e,t,n,r,i,s,a,o){let l,u;if(a){l=[];for(let c of t)if(l.push(c),c.route.id===a){u=c;break}}else l=t,u=t[t.length-1];let d=Rf(i||".",Nf(l,s),Kn(e.pathname,n)||e.pathname,o==="path");if(i==null&&(d.search=e.search,d.hash=e.hash),(i==null||i===""||i===".")&&u){let c=Lf(d.search);if(u.route.index&&!c)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&c){let f=new URLSearchParams(d.search),m=f.getAll("index");f.delete("index"),m.filter(x=>x).forEach(x=>f.append("index",x));let g=f.toString();d.search=g?"?"+g:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Un([n,d.pathname])),Ci(d)}function em(e,t,n,r){if(!r||!_S(r))return{path:n};if(r.formMethod&&!OS(r.formMethod))return{path:n,error:St(405,{method:r.formMethod})};let i=()=>({path:n,error:St(400,{type:"invalid-body"})}),s=r.formMethod||"get",a=e?s.toUpperCase():s.toLowerCase(),o=Ag(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!on(a))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,g)=>{let[x,T]=g;return""+m+x+"="+T+` -`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!on(a))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}le(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=md(r.formData),u=r.formData;else if(r.body instanceof FormData)l=md(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=am(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=am(l)}catch{return i()}let d={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(on(d.formMethod))return{path:n,submission:d};let c=Ur(n);return t&&c.search&&Lf(c.search)&&l.append("index",""),c.search="?"+l,{path:Ci(c),submission:d}}function tm(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function nm(e,t,n,r,i,s,a,o,l,u,d,c,f,m,g,x){let T=x?Mt(x[1])?x[1].error:x[1].data:void 0,v=e.createURL(t.location),p=e.createURL(i),y=n;s&&t.errors?y=tm(n,Object.keys(t.errors)[0],!0):x&&Mt(x[1])&&(y=tm(n,x[0]));let S=x?x[1].statusCode:void 0,R=a&&S&&S>=400,L=y.filter((j,W)=>{let{route:N}=j;if(N.lazy)return!0;if(N.loader==null)return!1;if(s)return pd(N,t.loaderData,t.errors);if(SS(t.loaderData,t.matches[W],j)||l.some(be=>be===j.route.id))return!0;let B=t.matches[W],ue=j;return rm(j,Me({currentUrl:v,currentParams:B.params,nextUrl:p,nextParams:ue.params},r,{actionResult:T,actionStatus:S,defaultShouldRevalidate:R?!1:o||v.pathname+v.search===p.pathname+p.search||v.search!==p.search||Og(B,ue)}))}),k=[];return c.forEach((j,W)=>{if(s||!n.some(Z=>Z.route.id===j.routeId)||d.has(W))return;let N=Yr(m,j.path,g);if(!N){k.push({key:W,routeId:j.routeId,path:j.path,matches:null,match:null,controller:null});return}let B=t.fetchers.get(W),ue=ea(N,j.path),be=!1;f.has(W)?be=!1:u.has(W)?(u.delete(W),be=!0):B&&B.state!=="idle"&&B.data===void 0?be=o:be=rm(ue,Me({curren)DELIM" -R"DELIM(tUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:p,nextParams:n[n.length-1].params},r,{actionResult:T,actionStatus:S,defaultShouldRevalidate:R?!1:o})),be&&k.push({key:W,routeId:j.routeId,path:j.path,matches:N,match:ue,controller:new AbortController})}),[L,k]}function pd(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function SS(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Og(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function rm(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function im(e,t,n,r,i){var s;let a;if(e){let u=r[e];le(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),a=u.children}else a=n;let o=t.filter(u=>!a.some(d=>Dg(u,d))),l=Nl(o,i,[e||"_","patch",String(((s=a)==null?void 0:s.length)||"0")],r);a.push(...l)}function Dg(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(s=>Dg(n,s))}):!1}async function ES(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];le(i,"No route found in manifest");let s={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";Ei(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!Z_.has(a)&&(s[a]=r[a])}Object.assign(i,s),Object.assign(i,Me({},t(i),{lazy:void 0}))}async function CS(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,s,a)=>Object.assign(i,{[n[a].route.id]:s}),{})}async function TS(e,t,n,r,i,s,a,o,l,u){let d=s.map(m=>m.route.lazy?ES(m.route,l,o):void 0),c=s.map((m,g)=>{let x=d[g],T=i.some(p=>p.route.id===m.route.id);return Me({},m,{shouldLoad:T,resolve:async p=>(p&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(T=!0),T?bS(t,r,m,x,p,u):Promise.resolve({type:Ee.data,result:void 0}))})}),f=await e({matches:c,request:r,params:s[0].params,fetcherKey:a,context:u});try{await Promise.all(d)}catch{}return f}async function bS(e,t,n,r,i,s){let a,o,l=u=>{let d,c=new Promise((g,x)=>d=x);o=()=>d(),t.signal.addEventListener("abort",o);let f=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:s},...g!==void 0?[g]:[]),m=(async()=>{try{return{type:"data",result:await(i?i(x=>f(x)):f())}}catch(g){return{type:"error",result:g}}})();return Promise.race([m,c])};try{let u=n.route[e];if(r)if(u){let d,[c]=await Promise.all([l(u).catch(f=>{d=f}),r]);if(d!==void 0)throw d;a=c}else if(await r,u=n.route[e],u)a=await l(u);else if(e==="action"){let d=new URL(t.url),c=d.pathname+d.search;throw St(405,{method:t.method,pathname:c,routeId:n.route.id})}else return{type:Ee.data,result:void 0};else if(u)a=await l(u);else{let d=new URL(t.url),c=d.pathname+d.search;throw St(404,{pathname:c})}le(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:Ee.error,result:u}}finally{o&&t.signal.removeEventListener("abort",o)}return a}async function PS(e){let{result:t,type:n}=e;if(Ig(t)){let c;try{let f=t.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(f){return{type:Ee.error,error:f}}return n===Ee.error?{type:Ee.error,error:new jl(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:Ee.data,data:c,statusCode:t.status,headers:t.headers}}if(n===Ee.error){if(dm(t)){var r,i;if(t.data instanceof Error){var s,a;return{type:Ee.error,error:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:Ee.error,error:new jl(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:Aa(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:Ee.error,error:t,statusCode:Aa(t)?t.status:void 0}}if(LS(t)){var o,l;return{type:Ee.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(dm(t)){var u,d;return{type:Ee.data,data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}}return{type:Ee.data,data:t}}function NS(e,t,n,r,i,s){let a=e.hea)DELIM" -R"DELIM(ders.get("Location");if(le(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!jf.test(a)){let o=r.slice(0,r.findIndex(l=>l.route.id===n)+1);a=hd(new URL(t.url),o,i,!0,a,s),e.headers.set("Location",a)}return e}function sm(e,t,n){if(jf.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=Kn(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function Mi(e,t,n,r){let i=e.createURL(Ag(t)).toString(),s={signal:n};if(r&&on(r.formMethod)){let{formMethod:a,formEncType:o}=r;s.method=a.toUpperCase(),o==="application/json"?(s.headers=new Headers({"Content-Type":o}),s.body=JSON.stringify(r.json)):o==="text/plain"?s.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?s.body=md(r.formData):s.body=r.formData}return new Request(i,s)}function md(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function am(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function RS(e,t,n,r,i){let s={},a=null,o,l=!1,u={},d=n&&Mt(n[1])?n[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let f=c.route.id,m=t[f];if(le(!ri(m),"Cannot handle redirect results in processLoaderData"),Mt(m)){let g=m.error;d!==void 0&&(g=d,d=void 0),a=a||{};{let x=Xr(e,f);a[x.route.id]==null&&(a[x.route.id]=g)}s[f]=void 0,l||(l=!0,o=Aa(m.error)?m.error.status:500),m.headers&&(u[f]=m.headers)}else Sr(m)?(r.set(f,m.deferredData),s[f]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!l&&(o=m.statusCode),m.headers&&(u[f]=m.headers)):(s[f]=m.data,m.statusCode&&m.statusCode!==200&&!l&&(o=m.statusCode),m.headers&&(u[f]=m.headers))}),d!==void 0&&n&&(a={[n[0]]:d},s[n[0]]=void 0),{loaderData:s,errors:a,statusCode:o||200,loaderHeaders:u}}function om(e,t,n,r,i,s,a){let{loaderData:o,errors:l}=RS(t,n,r,a);return i.forEach(u=>{let{key:d,match:c,controller:f}=u,m=s[d];if(le(m,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Mt(m)){let g=Xr(e.matches,c==null?void 0:c.route.id);l&&l[g.route.id]||(l=Me({},l,{[g.route.id]:m.error})),e.fetchers.delete(d)}else if(ri(m))le(!1,"Unhandled fetcher revalidation redirect");else if(Sr(m))le(!1,"Unhandled fetcher deferred data");else{let g=ar(m.data);e.fetchers.set(d,g)}}),{loaderData:o,errors:l}}function lm(e,t,n,r){let i=Me({},t);for(let s of n){let a=s.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&s.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function um(e){return e?Mt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Xr(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function cm(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function St(e,t){let{pathname:n,routeId:r,method:i,type:s,message:a}=t===void 0?{}:t,o="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?l="defer() is not supported in actions":s==="invalid-body"&&(l="Unable to encode submission body")):e===403?(o="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",l='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new jl(e||500,o,new Error(l),!0)}function No(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(ri(i))return{key:r,result:i}}}function Ag(e){let t=typeof e=="string"?Ur(e):e;return Ci(Me({},t,{hash:""}))}function jS(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function MS(e){return Ig(e.result)&&yS.has(e.result.status)}function Sr(e){return e.type===Ee.deferred}function Mt(e){return e.type===Ee.error}function ri(e){return(e&&e.type)===Ee.redirect}function dm(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function LS(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Ig(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function OS(e){return vS.has(e.toLowerCase())}function on(e){return pS.has(e.toLowerCase())}async function DS(e,t,n,r,i){let s=Object.entries(t);for(let a=0;a(f==null?void 0:f.route.id)===o);if(!u)continue;let d=r.find(f=>f.route.id===u.route.id)DELIM" -R"DELIM(),c=d!=null&&!Og(d,u)&&(i&&i[u.route.id])!==void 0;Sr(l)&&c&&await Mf(l,n,!1).then(f=>{f&&(t[o]=f)})}}async function AS(e,t,n){for(let r=0;r(u==null?void 0:u.route.id)===s)&&Sr(o)&&(le(a,"Expected an AbortController for revalidating fetcher deferred result"),await Mf(o,a.signal,!0).then(u=>{u&&(t[i]=u)}))}}async function Mf(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Ee.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Ee.error,error:i}}return{type:Ee.data,data:e.deferredData.data}}}function Lf(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ea(e,t){let n=typeof t=="string"?Ur(t).search:t.search;if(e[e.length-1].route.index&&Lf(n||""))return e[e.length-1];let r=jg(e);return r[r.length-1]}function fm(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Wu(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function IS(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Vs(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function $S(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ar(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function FS(e,t){try{let n=e.sessionStorage.getItem(Lg);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function zS(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Lg,JSON.stringify(n))}catch(r){Ei(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + */function Me(){return Me=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ei(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function W_(){return Math.random().toString(36).substr(2,8)}function Xp(e,t){return{usr:e.state,key:e.key,idx:t}}function Da(e,t,n,r){return n===void 0&&(n=null),Me({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ur(t):t,{state:n,key:t&&t.key||r||W_()})}function Ci(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ur(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Z_(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o=We.Pop,l=null,u=d();u==null&&(u=0,a.replaceState(Me({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function c(){o=We.Pop;let T=d(),v=T==null?null:T-u;u=T,l&&l({action:o,location:x.location,delta:v})}function f(T,v){o=We.Push;let p=Da(x.location,T,v);u=d()+1;let y=Xp(p,u),S=x.createHref(p);try{a.pushState(y,"",S)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;i.location.assign(S)}s&&l&&l({action:o,location:x.location,delta:1})}function m(T,v){o=We.Replace;let p=Da(x.location,T,v);u=d();let y=Xp(p,u),S=x.createHref(p);a.replaceState(y,"",S),s&&l&&l({action:o,location:x.location,delta:0})}function g(T){let v=i.location.origin!=="null"?i.location.origin:i.location.href,p=typeof T=="string"?T:Ci(T);return p=p.replace(/ $/,"%20"),le(v,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,v)}let x={get action(){return o},get location(){return e(i,a)},listen(T){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Yp,c),l=T,()=>{i.removeEventListener(Yp,c),l=null}},createHref(T){return t(i,T)},createURL:g,encodeLocation(T){let v=g(T);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:m,go(T){return a.go(T)}};return x}var Ee;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ee||(Ee={}));const K_=new Set(["lazy","caseSensitive","path","id","index","children"]);function G_(e){return e.index===!0}function Pl(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,s)=>{let a=[...n,String(s)],o=typeof i.id=="string"?i.id:a.join("-");if(le(i.index!==!0||!i.children,"Cannot specify children on an index route"),le(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),G_(i)){let l=Me({},i,t(i),{id:o});return r[o]=l,l}else{let l=Me({},i,t(i),{id:o,children:void 0});return r[o]=l,i.children&&(l.children=Pl(i.children,t,a,r)),l}})}function Yr(e,t,n){return n===void 0&&(n="/"),Ko(e,t,n,!1)}function Ko(e,t,n,r){let i=typeof t=="string"?Ur(t):t,s=Kn(i.pathname||"/",n);if(s==null)return null;let a=Rg(e);Y_(a);let o=null;for(let l=0;o==null&&l{let l={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};l.relativePath.startsWith("/")&&(le(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Un([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(le(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Rg(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:iS(u,s.index),routesMeta:d})};return e.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let l of jg(s.path))i(s,a,l)}),t}function jg(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=jg(r.join("/")),o=[];return o.push(...a.map(l=>l===""?s:[s,l].join("/"))),i&&o.push(...a),o.map(l=>e.startsWith("/")&&l===""?"/":l)}function Y_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:sS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const X_=/^:[\w-]+$/,J_=3,eS=2,tS=1,nS=10,rS=-2,Jp=e=>e==="*";function iS(e,t){let n=e.split("/"),r=n.length;return n.some(Jp)DELIM" + R"DELIM()&&(r+=rS),t&&(r+=eS),n.filter(i=>!Jp(i)).reduce((i,s)=>i+(X_.test(s)?J_:s===""?tS:nS),r)}function sS(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function aS(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},s="/",a=[];for(let o=0;o{let{paramName:f,isOptional:m}=d;if(f==="*"){let x=o[c]||"";a=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const g=o[c];return m&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:e}}function oS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ei(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function lS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ei(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Kn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const uS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cS=e=>uS.test(e);function dS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ur(e):e,s;if(n)if(cS(n))s=n;else{if(n.includes("//")){let a=n;n=n.replace(/\/\/+/g,"/"),Ei(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?s=em(n.substring(1),"/"):s=em(n,t)}else s=t;return{pathname:s,search:hS(r),hash:pS(i)}}function em(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Vu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Mg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Rf(e,t){let n=Mg(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function jf(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ur(e):(i=Me({},e),le(!i.pathname||!i.pathname.includes("?"),Vu("?","pathname","search",i)),le(!i.pathname||!i.pathname.includes("#"),Vu("#","pathname","hash",i)),le(!i.search||!i.search.includes("#"),Vu("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=n;else{let c=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),c-=1;i.pathname=f.join("/")}o=c>=0?t[c]:"/"}let l=dS(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(s||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Un=e=>e.join("/").replace(/\/\/+/g,"/"),fS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,pS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class jl{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Aa(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Lg=["post","put","patch","delete"],mS=new Set(Lg),vS=["get",...Lg],yS=new Set(vS),gS=new Set([301,302,303,307,308]),xS=new Set([307,308]),Qu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},wS={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formDat)DELIM" + R"DELIM(a:void 0,json:void 0,text:void 0},Hs={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Mf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kS=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Og="remix-router-transitions";function _S(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;le(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let w=e.detectErrorBoundary;i=E=>({hasErrorBoundary:w(E)})}else i=kS;let s={},a=Pl(e.routes,i,void 0,s),o,l=e.basename||"/",u=e.dataStrategy||TS,d=e.patchRoutesOnNavigation,c=Me({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,m=new Set,g=null,x=null,T=null,v=e.hydrationData!=null,p=Yr(a,e.history.location,l),y=!1,S=null;if(p==null&&!d){let w=St(404,{pathname:e.history.location.pathname}),{matches:E,route:N}=dm(a);p=E,S={[N.id]:w}}p&&!e.hydrationData&&to(p,a,e.history.location.pathname).active&&(p=null);let R;if(p)if(p.some(w=>w.route.lazy))R=!1;else if(!p.some(w=>w.route.loader))R=!0;else if(c.v7_partialHydration){let w=e.hydrationData?e.hydrationData.loaderData:null,E=e.hydrationData?e.hydrationData.errors:null;if(E){let N=p.findIndex(M=>E[M.route.id]!==void 0);R=p.slice(0,N+1).every(M=>!md(M.route,w,E))}else R=p.every(N=>!md(N.route,w,E))}else R=e.hydrationData!=null;else if(R=!1,p=[],c.v7_partialHydration){let w=to(null,a,e.history.location.pathname);w.active&&w.matches&&(y=!0,p=w.matches)}let L,k={historyAction:e.history.action,location:e.history.location,matches:p,initialized:R,navigation:Qu,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},j=We.Pop,W=!1,P,B=!1,ue=new Map,be=null,Z=!1,F=!1,$=[],K=new Set,b=new Map,D=0,I=-1,ee=new Map,re=new Set,ke=new Map,_e=new Map,Te=new Set,Ie=new Map,Ve=new Map,hn;function Pn(){if(f=e.history.listen(w=>{let{action:E,location:N,delta:M}=w;if(hn){hn(),hn=void 0;return}Ei(Ve.size===0||M!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let z=Gf({currentLocation:k.location,nextLocation:N,historyAction:E});if(z&&M!=null){let te=new Promise(ie=>{hn=ie});e.history.go(M*-1),eo(z,{state:"blocked",location:N,proceed(){eo(z,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),te.then(()=>e.history.go(M))},reset(){let ie=new Map(k.blockers);ie.set(z,Hs),Ue({blockers:ie})}});return}return Qr(E,N)}),n){zS(t,ue);let w=()=>BS(t,ue);t.addEventListener("pagehide",w),be=()=>t.removeEventListener("pagehide",w)}return k.initialized||Qr(We.Pop,k.location,{initialHydration:!0}),L}function ct(){f&&f(),be&&be(),m.clear(),P&&P.abort(),k.fetchers.forEach((w,E)=>Ja(E)),k.blockers.forEach((w,E)=>Kf(E))}function pn(w){return m.add(w),()=>m.delete(w)}function Ue(w,E){E===void 0&&(E={}),k=Me({},k,w);let N=[],M=[];c.v7_fetcherPersist&&k.fetchers.forEach((z,te)=>{z.state==="idle"&&(Te.has(te)?M.push(te):N.push(te))}),Te.forEach(z=>{!k.fetchers.has(z)&&!b.has(z)&&M.push(z)}),[...m].forEach(z=>z(k,{deletedFetchers:M,viewTransitionOpts:E.viewTransitionOpts,flushSync:E.flushSync===!0})),c.v7_fetcherPersist?(N.forEach(z=>k.fetchers.delete(z)),M.forEach(z=>Ja(z))):M.forEach(z=>Te.delete(z))}function Jt(w,E,N){var M,z;let{flushSync:te}=N===void 0?{}:N,ie=k.actionData!=null&&k.navigation.formMethod!=null&&on(k.navigation.formMethod)&&k.navigation.state==="loading"&&((M=w.state)==null?void 0:M._isRedirect)!==!0,G;E.actionData?Object.keys(E.actionData).length>0?G=E.actionData:G=null:ie?G=k.actionData:G=null;let Y=E.loaderData?um(k.loaderData,E.loaderData,E.matches||[],E.errors):k.loaderData,Q=k.blockers;Q.size>0&&(Q=new Map(Q),Q.forEach((pe,rt)=>Q.set(rt,Hs)));let J=W===!0||k.navigation.formMethod!=null&&on(k.navigation.formMethod)&&((z=w.state)==null?void 0:z._isRedirect)!==!0;o&&(a=o,o=void 0),Z||j===We.Pop||(j===We.Push?e.history.push(w,w.state):j===We.Replace&&e.history.replace(w,w.state));let oe;if(j===We.Pop){let pe=ue.get(k.location.pathname);pe&&pe.has(w.pathname)?oe={currentLocation:k.location,nextLocation:w}:ue.has(w.pathname)&&(oe={currentLocation:w,nextLocation:k.location})}else if(B){let pe=ue.get(k.location.pathname);pe?pe.add(w.pathname):(pe=new Set([w.pathname]),ue.set(k.location.pathname,pe)),oe={currentLocation:k.location,nextLocation:w}}Ue(Me({},E,{)DELIM" + R"DELIM(actionData:G,loaderData:Y,historyAction:j,location:w,initialized:!0,navigation:Qu,revalidation:"idle",restoreScrollPosition:Yf(w,E.matches||k.matches),preventScrollReset:J,blockers:Q}),{viewTransitionOpts:oe,flushSync:te===!0}),j=We.Pop,W=!1,B=!1,Z=!1,F=!1,$=[]}async function Bf(w,E){if(typeof w=="number"){e.history.go(w);return}let N=pd(k.location,k.matches,l,c.v7_prependBasename,w,c.v7_relativeSplatPath,E==null?void 0:E.fromRouteId,E==null?void 0:E.relative),{path:M,submission:z,error:te}=tm(c.v7_normalizeFormMethod,!1,N,E),ie=k.location,G=Da(k.location,M,E&&E.state);G=Me({},G,e.history.encodeLocation(G));let Y=E&&E.replace!=null?E.replace:void 0,Q=We.Push;Y===!0?Q=We.Replace:Y===!1||z!=null&&on(z.formMethod)&&z.formAction===k.location.pathname+k.location.search&&(Q=We.Replace);let J=E&&"preventScrollReset"in E?E.preventScrollReset===!0:void 0,oe=(E&&E.flushSync)===!0,pe=Gf({currentLocation:ie,nextLocation:G,historyAction:Q});if(pe){eo(pe,{state:"blocked",location:G,proceed(){eo(pe,{state:"proceeding",proceed:void 0,reset:void 0,location:G}),Bf(w,E)},reset(){let rt=new Map(k.blockers);rt.set(pe,Hs),Ue({blockers:rt})}});return}return await Qr(Q,G,{submission:z,pendingError:te,preventScrollReset:J,replace:E&&E.replace,enableViewTransition:E&&E.viewTransition,flushSync:oe})}function c0(){if(su(),Ue({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){Qr(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}Qr(j||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:B===!0})}}async function Qr(w,E,N){P&&P.abort(),P=null,j=w,Z=(N&&N.startUninterruptedRevalidation)===!0,w0(k.location,k.matches),W=(N&&N.preventScrollReset)===!0,B=(N&&N.enableViewTransition)===!0;let M=o||a,z=N&&N.overrideNavigation,te=N!=null&&N.initialHydration&&k.matches&&k.matches.length>0&&!y?k.matches:Yr(M,E,l),ie=(N&&N.flushSync)===!0;if(te&&k.initialized&&!F&&MS(k.location,E)&&!(N&&N.submission&&on(N.submission.formMethod))){Jt(E,{matches:te},{flushSync:ie});return}let G=to(te,M,E.pathname);if(G.active&&G.matches&&(te=G.matches),!te){let{error:Ne,notFoundMatches:we,route:$e}=au(E.pathname);Jt(E,{matches:we,loaderData:{},errors:{[$e.id]:Ne}},{flushSync:ie});return}P=new AbortController;let Y=Mi(e.history,E,P.signal,N&&N.submission),Q;if(N&&N.pendingError)Q=[Xr(te).route.id,{type:Ee.error,error:N.pendingError}];else if(N&&N.submission&&on(N.submission.formMethod)){let Ne=await d0(Y,E,N.submission,te,G.active,{replace:N.replace,flushSync:ie});if(Ne.shortCircuited)return;if(Ne.pendingActionResult){let[we,$e]=Ne.pendingActionResult;if(Mt($e)&&Aa($e.error)&&$e.error.status===404){P=null,Jt(E,{matches:Ne.matches,loaderData:{},errors:{[we]:$e.error}});return}}te=Ne.matches||te,Q=Ne.pendingActionResult,z=Wu(E,N.submission),ie=!1,G.active=!1,Y=Mi(e.history,Y.url,Y.signal)}let{shortCircuited:J,matches:oe,loaderData:pe,errors:rt}=await f0(Y,E,te,G.active,z,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,N&&N.initialHydration===!0,ie,Q);J||(P=null,Jt(E,Me({matches:oe||te},cm(Q),{loaderData:pe,errors:rt})))}async function d0(w,E,N,M,z,te){te===void 0&&(te={}),su();let ie=$S(E,N);if(Ue({navigation:ie},{flushSync:te.flushSync===!0}),z){let Q=await no(M,E.pathname,w.signal);if(Q.type==="aborted")return{shortCircuited:!0};if(Q.type==="error"){let J=Xr(Q.partialMatches).route.id;return{matches:Q.partialMatches,pendingActionResult:[J,{type:Ee.error,error:Q.error}]}}else if(Q.matches)M=Q.matches;else{let{notFoundMatches:J,error:oe,route:pe}=au(E.pathname);return{matches:J,pendingActionResult:[pe.id,{type:Ee.error,error:oe}]}}}let G,Y=ea(M,E);if(!Y.route.action&&!Y.route.lazy)G={type:Ee.error,error:St(405,{method:w.method,pathname:E.pathname,routeId:Y.route.id})};else if(G=(await Ps("action",k,w,[Y],M,null))[Y.route.id],w.signal.aborted)return{shortCircuited:!0};if(ri(G)){let Q;return te&&te.replace!=null?Q=te.replace:Q=am(G.response.headers.get("Location"),new URL(w.url),l)===k.location.pathname+k.location.search,await Wr(w,G,!0,{submission:N,replace:Q}),{shortCircuited:!0}}if(Sr(G))throw St(400,{type:"defer-action"});if(Mt(G)){let Q=Xr(M,Y.route.id);return(te&&te.replace)!==!0&&(j=We.Push),{matches:M,pendingActionResult:[Q.route.id,G]}}return{matches:M,pendingActionResult:[Y.route.id,G]}}async function f0(w,E,N,M,z,te,ie,G,Y,Q,J){let oe=z||Wu(E,te),pe=te||ie||hm(oe),rt=!Z&&(!c.v7_partialHydration||!Y);if(M){if(rt){let Fe=Uf(J);Ue(Me({navigation:oe},Fe!==void 0?{actionData:Fe}:{}),{flushSync:Q})}let ge=await no(N,E.pathname,w.signal);if(ge.type==="aborted")return{shortCircuited:!0};if(ge.type==="error"){let Fe=Xr(ge.partialMatches).route.id;return{matches:ge.partialMatches,loaderData:{},errors:{[Fe]:ge.error}}}else if(ge.matches)N=ge.matches;else{let{error:Fe,notFoundMatches:Pi,route:Ms}=au(E.pathname);return{matches:Pi,loaderData:{},errors:{[Ms.id]:Fe}}}}let Ne=o||a,[we,$e]=rm(e.history,k,N,pe,E,c.v7_partialHydration&&Y===!0,c.v7_skipActionErrorRevalidation,F,$)DELIM" + R"DELIM(,K,Te,ke,re,Ne,l,J);if(ou(ge=>!(N&&N.some(Fe=>Fe.route.id===ge))||we&&we.some(Fe=>Fe.route.id===ge)),I=++D,we.length===0&&$e.length===0){let ge=Wf();return Jt(E,Me({matches:N,loaderData:{},errors:J&&Mt(J[1])?{[J[0]]:J[1].error}:null},cm(J),ge?{fetchers:new Map(k.fetchers)}:{}),{flushSync:Q}),{shortCircuited:!0}}if(rt){let ge={};if(!M){ge.navigation=oe;let Fe=Uf(J);Fe!==void 0&&(ge.actionData=Fe)}$e.length>0&&(ge.fetchers=h0($e)),Ue(ge,{flushSync:Q})}$e.forEach(ge=>{Jn(ge.key),ge.controller&&b.set(ge.key,ge.controller)});let Ni=()=>$e.forEach(ge=>Jn(ge.key));P&&P.signal.addEventListener("abort",Ni);let{loaderResults:Rs,fetcherResults:jn}=await Hf(k,N,we,$e,w);if(w.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",Ni),$e.forEach(ge=>b.delete(ge.key));let mn=Po(Rs);if(mn)return await Wr(w,mn.result,!0,{replace:G}),{shortCircuited:!0};if(mn=Po(jn),mn)return re.add(mn.key),await Wr(w,mn.result,!0,{replace:G}),{shortCircuited:!0};let{loaderData:lu,errors:js}=lm(k,N,Rs,J,$e,jn,Ie);Ie.forEach((ge,Fe)=>{ge.subscribe(Pi=>{(Pi||ge.done)&&Ie.delete(Fe)})}),c.v7_partialHydration&&Y&&k.errors&&(js=Me({},k.errors,js));let Zr=Wf(),ro=Zf(I),io=Zr||ro||$e.length>0;return Me({matches:N,loaderData:lu,errors:js},io?{fetchers:new Map(k.fetchers)}:{})}function Uf(w){if(w&&!Mt(w[1]))return{[w[0]]:w[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function h0(w){return w.forEach(E=>{let N=k.fetchers.get(E.key),M=Vs(void 0,N?N.data:void 0);k.fetchers.set(E.key,M)}),new Map(k.fetchers)}function p0(w,E,N,M){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Jn(w);let z=(M&&M.flushSync)===!0,te=o||a,ie=pd(k.location,k.matches,l,c.v7_prependBasename,N,c.v7_relativeSplatPath,E,M==null?void 0:M.relative),G=Yr(te,ie,l),Y=to(G,te,ie);if(Y.active&&Y.matches&&(G=Y.matches),!G){Rn(w,E,St(404,{pathname:ie}),{flushSync:z});return}let{path:Q,submission:J,error:oe}=tm(c.v7_normalizeFormMethod,!0,ie,M);if(oe){Rn(w,E,oe,{flushSync:z});return}let pe=ea(G,Q),rt=(M&&M.preventScrollReset)===!0;if(J&&on(J.formMethod)){m0(w,E,Q,pe,G,Y.active,z,rt,J);return}ke.set(w,{routeId:E,path:Q}),v0(w,E,Q,pe,G,Y.active,z,rt,J)}async function m0(w,E,N,M,z,te,ie,G,Y){su(),ke.delete(w);function Q(Qe){if(!Qe.route.action&&!Qe.route.lazy){let Ri=St(405,{method:Y.formMethod,pathname:N,routeId:E});return Rn(w,E,Ri,{flushSync:ie}),!0}return!1}if(!te&&Q(M))return;let J=k.fetchers.get(w);Xn(w,FS(Y,J),{flushSync:ie});let oe=new AbortController,pe=Mi(e.history,N,oe.signal,Y);if(te){let Qe=await no(z,new URL(pe.url).pathname,pe.signal,w);if(Qe.type==="aborted")return;if(Qe.type==="error"){Rn(w,E,Qe.error,{flushSync:ie});return}else if(Qe.matches){if(z=Qe.matches,M=ea(z,N),Q(M))return}else{Rn(w,E,St(404,{pathname:N}),{flushSync:ie});return}}b.set(w,oe);let rt=D,we=(await Ps("action",k,pe,[M],z,w))[M.route.id];if(pe.signal.aborted){b.get(w)===oe&&b.delete(w);return}if(c.v7_fetcherPersist&&Te.has(w)){if(ri(we)||Mt(we)){Xn(w,ar(void 0));return}}else{if(ri(we))if(b.delete(w),I>rt){Xn(w,ar(void 0));return}else return re.add(w),Xn(w,Vs(Y)),Wr(pe,we,!1,{fetcherSubmission:Y,preventScrollReset:G});if(Mt(we)){Rn(w,E,we.error);return}}if(Sr(we))throw St(400,{type:"defer-action"});let $e=k.navigation.location||k.location,Ni=Mi(e.history,$e,oe.signal),Rs=o||a,jn=k.navigation.state!=="idle"?Yr(Rs,k.navigation.location,l):k.matches;le(jn,"Didn't find any matches after fetcher action");let mn=++D;ee.set(w,mn);let lu=Vs(Y,we.data);k.fetchers.set(w,lu);let[js,Zr]=rm(e.history,k,jn,Y,$e,!1,c.v7_skipActionErrorRevalidation,F,$,K,Te,ke,re,Rs,l,[M.route.id,we]);Zr.filter(Qe=>Qe.key!==w).forEach(Qe=>{let Ri=Qe.key,Xf=k.fetchers.get(Ri),S0=Vs(void 0,Xf?Xf.data:void 0);k.fetchers.set(Ri,S0),Jn(Ri),Qe.controller&&b.set(Ri,Qe.controller)}),Ue({fetchers:new Map(k.fetchers)});let ro=()=>Zr.forEach(Qe=>Jn(Qe.key));oe.signal.addEventListener("abort",ro);let{loaderResults:io,fetcherResults:ge}=await Hf(k,jn,js,Zr,Ni);if(oe.signal.aborted)return;oe.signal.removeEventListener("abort",ro),ee.delete(w),b.delete(w),Zr.forEach(Qe=>b.delete(Qe.key));let Fe=Po(io);if(Fe)return Wr(Ni,Fe.result,!1,{preventScrollReset:G});if(Fe=Po(ge),Fe)return re.add(Fe.key),Wr(Ni,Fe.result,!1,{preventScrollReset:G});let{loaderData:Pi,errors:Ms}=lm(k,jn,io,void 0,Zr,ge,Ie);if(k.fetchers.has(w)){let Qe=ar(we.data);k.fetchers.set(w,Qe)}Zf(mn),k.navigation.state==="loading"&&mn>I?(le(j,"Expected pending action"),P&&P.abort(),Jt(k.navigation.location,{matches:jn,loaderData:Pi,errors:Ms,fetchers:new Map(k.fetchers)})):(Ue({errors:Ms,loaderData:um(k.loaderData,Pi,jn,Ms),fetchers:new Map(k.fetchers)}),F=!1)}async function v0(w,E,N,M,z,te,ie,G,Y){let Q=k.fetchers.get(w);Xn(w,Vs(Y,Q?Q.data:void 0),{flushSync:ie});let J=new AbortController,oe=Mi(e.history,N,J.signal);if(te){let we=await no(z,new URL(oe.url).pathname,o)DELIM" + R"DELIM(e.signal,w);if(we.type==="aborted")return;if(we.type==="error"){Rn(w,E,we.error,{flushSync:ie});return}else if(we.matches)z=we.matches,M=ea(z,N);else{Rn(w,E,St(404,{pathname:N}),{flushSync:ie});return}}b.set(w,J);let pe=D,Ne=(await Ps("loader",k,oe,[M],z,w))[M.route.id];if(Sr(Ne)&&(Ne=await Lf(Ne,oe.signal,!0)||Ne),b.get(w)===J&&b.delete(w),!oe.signal.aborted){if(Te.has(w)){Xn(w,ar(void 0));return}if(ri(Ne))if(I>pe){Xn(w,ar(void 0));return}else{re.add(w),await Wr(oe,Ne,!1,{preventScrollReset:G});return}if(Mt(Ne)){Rn(w,E,Ne.error);return}le(!Sr(Ne),"Unhandled fetcher deferred data"),Xn(w,ar(Ne.data))}}async function Wr(w,E,N,M){let{submission:z,fetcherSubmission:te,preventScrollReset:ie,replace:G}=M===void 0?{}:M;E.response.headers.has("X-Remix-Revalidate")&&(F=!0);let Y=E.response.headers.get("Location");le(Y,"Expected a Location header on the redirect Response"),Y=am(Y,new URL(w.url),l);let Q=Da(k.location,Y,{_isRedirect:!0});if(n){let we=!1;if(E.response.headers.has("X-Remix-Reload-Document"))we=!0;else if(Mf.test(Y)){const $e=e.history.createURL(Y);we=$e.origin!==t.location.origin||Kn($e.pathname,l)==null}if(we){G?t.location.replace(Y):t.location.assign(Y);return}}P=null;let J=G===!0||E.response.headers.has("X-Remix-Replace")?We.Replace:We.Push,{formMethod:oe,formAction:pe,formEncType:rt}=k.navigation;!z&&!te&&oe&&pe&&rt&&(z=hm(k.navigation));let Ne=z||te;if(xS.has(E.response.status)&&Ne&&on(Ne.formMethod))await Qr(J,Q,{submission:Me({},Ne,{formAction:Y}),preventScrollReset:ie||W,enableViewTransition:N?B:void 0});else{let we=Wu(Q,z);await Qr(J,Q,{overrideNavigation:we,fetcherSubmission:te,preventScrollReset:ie||W,enableViewTransition:N?B:void 0})}}async function Ps(w,E,N,M,z,te){let ie,G={};try{ie=await bS(u,w,E,N,M,z,te,s,i)}catch(Y){return M.forEach(Q=>{G[Q.route.id]={type:Ee.error,error:Y}}),G}for(let[Y,Q]of Object.entries(ie))if(LS(Q)){let J=Q.result;G[Y]={type:Ee.redirect,response:RS(J,N,Y,z,l,c.v7_relativeSplatPath)}}else G[Y]=await PS(Q);return G}async function Hf(w,E,N,M,z){let te=w.matches,ie=Ps("loader",w,z,N,E,null),G=Promise.all(M.map(async J=>{if(J.matches&&J.match&&J.controller){let pe=(await Ps("loader",w,Mi(e.history,J.path,J.controller.signal),[J.match],J.matches,J.key))[J.match.route.id];return{[J.key]:pe}}else return Promise.resolve({[J.key]:{type:Ee.error,error:St(404,{pathname:J.path})}})})),Y=await ie,Q=(await G).reduce((J,oe)=>Object.assign(J,oe),{});return await Promise.all([AS(E,Y,z.signal,te,w.loaderData),IS(E,Q,M)]),{loaderResults:Y,fetcherResults:Q}}function su(){F=!0,$.push(...ou()),ke.forEach((w,E)=>{b.has(E)&&K.add(E),Jn(E)})}function Xn(w,E,N){N===void 0&&(N={}),k.fetchers.set(w,E),Ue({fetchers:new Map(k.fetchers)},{flushSync:(N&&N.flushSync)===!0})}function Rn(w,E,N,M){M===void 0&&(M={});let z=Xr(k.matches,E);Ja(w),Ue({errors:{[z.route.id]:N},fetchers:new Map(k.fetchers)},{flushSync:(M&&M.flushSync)===!0})}function Vf(w){return _e.set(w,(_e.get(w)||0)+1),Te.has(w)&&Te.delete(w),k.fetchers.get(w)||wS}function Ja(w){let E=k.fetchers.get(w);b.has(w)&&!(E&&E.state==="loading"&&ee.has(w))&&Jn(w),ke.delete(w),ee.delete(w),re.delete(w),c.v7_fetcherPersist&&Te.delete(w),K.delete(w),k.fetchers.delete(w)}function y0(w){let E=(_e.get(w)||0)-1;E<=0?(_e.delete(w),Te.add(w),c.v7_fetcherPersist||Ja(w)):_e.set(w,E),Ue({fetchers:new Map(k.fetchers)})}function Jn(w){let E=b.get(w);E&&(E.abort(),b.delete(w))}function Qf(w){for(let E of w){let N=Vf(E),M=ar(N.data);k.fetchers.set(E,M)}}function Wf(){let w=[],E=!1;for(let N of re){let M=k.fetchers.get(N);le(M,"Expected fetcher: "+N),M.state==="loading"&&(re.delete(N),w.push(N),E=!0)}return Qf(w),E}function Zf(w){let E=[];for(let[N,M]of ee)if(M0}function g0(w,E){let N=k.blockers.get(w)||Hs;return Ve.get(w)!==E&&Ve.set(w,E),N}function Kf(w){k.blockers.delete(w),Ve.delete(w)}function eo(w,E){let N=k.blockers.get(w)||Hs;le(N.state==="unblocked"&&E.state==="blocked"||N.state==="blocked"&&E.state==="blocked"||N.state==="blocked"&&E.state==="proceeding"||N.state==="blocked"&&E.state==="unblocked"||N.state==="proceeding"&&E.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+E.state);let M=new Map(k.blockers);M.set(w,E),Ue({blockers:M})}function Gf(w){let{currentLocation:E,nextLocation:N,historyAction:M}=w;if(Ve.size===0)return;Ve.size>1&&Ei(!1,"A router only supports one blocker at a time");let z=Array.from(Ve.entries()),[te,ie]=z[z.length-1],G=k.blockers.get(te);if(!(G&&G.state==="proceeding")&&ie({currentLocation:E,nextLocation:N,historyAction:M}))return te}function au(w){let E=St(404,{pathname:w}),N=o||a,{matches:M,route:z}=dm(N);return ou(),{notFoundMatches:M,route:z,error:E}}function ou(w){let E=[];return Ie.forEach((N,M)=>{(!w||w(M))&&(N.cancel(),E.push(M),Ie.delete(M))}),E}function x0(w,E,N){if(g=w,T=E,x=N||null,!v&&k.navigation===Qu){v=!0;let M=Yf(k.location,k.matches);M!=null&&Ue({restoreScrol)DELIM" + R"DELIM(lPosition:M})}return()=>{g=null,T=null,x=null}}function qf(w,E){return x&&x(w,E.map(M=>q_(M,k.loaderData)))||w.key}function w0(w,E){if(g&&T){let N=qf(w,E);g[N]=T()}}function Yf(w,E){if(g){let N=qf(w,E),M=g[N];if(typeof M=="number")return M}return null}function to(w,E,N){if(d)if(w){if(Object.keys(w[0].params).length>0)return{active:!0,matches:Ko(E,N,l,!0)}}else return{active:!0,matches:Ko(E,N,l,!0)||[]};return{active:!1,matches:null}}async function no(w,E,N,M){if(!d)return{type:"success",matches:w};let z=w;for(;;){let te=o==null,ie=o||a,G=s;try{await d({signal:N,path:E,matches:z,fetcherKey:M,patch:(J,oe)=>{N.aborted||sm(J,oe,ie,G,i)}})}catch(J){return{type:"error",error:J,partialMatches:z}}finally{te&&!N.aborted&&(a=[...a])}if(N.aborted)return{type:"aborted"};let Y=Yr(ie,E,l);if(Y)return{type:"success",matches:Y};let Q=Ko(ie,E,l,!0);if(!Q||z.length===Q.length&&z.every((J,oe)=>J.route.id===Q[oe].route.id))return{type:"success",matches:null};z=Q}}function k0(w){s={},o=Pl(w,i,void 0,s)}function _0(w,E){let N=o==null;sm(w,E,o||a,s,i),N&&(a=[...a],Ue({}))}return L={get basename(){return l},get future(){return c},get state(){return k},get routes(){return a},get window(){return t},initialize:Pn,subscribe:pn,enableScrollRestoration:x0,navigate:Bf,fetch:p0,revalidate:c0,createHref:w=>e.history.createHref(w),encodeLocation:w=>e.history.encodeLocation(w),getFetcher:Vf,deleteFetcher:y0,dispose:ct,getBlocker:g0,deleteBlocker:Kf,patchRoutes:_0,_internalFetchControllers:b,_internalActiveDeferreds:Ie,_internalSetRoutes:k0},L}function SS(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function pd(e,t,n,r,i,s,a,o){let l,u;if(a){l=[];for(let c of t)if(l.push(c),c.route.id===a){u=c;break}}else l=t,u=t[t.length-1];let d=jf(i||".",Rf(l,s),Kn(e.pathname,n)||e.pathname,o==="path");if(i==null&&(d.search=e.search,d.hash=e.hash),(i==null||i===""||i===".")&&u){let c=Of(d.search);if(u.route.index&&!c)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&c){let f=new URLSearchParams(d.search),m=f.getAll("index");f.delete("index"),m.filter(x=>x).forEach(x=>f.append("index",x));let g=f.toString();d.search=g?"?"+g:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Un([n,d.pathname])),Ci(d)}function tm(e,t,n,r){if(!r||!SS(r))return{path:n};if(r.formMethod&&!DS(r.formMethod))return{path:n,error:St(405,{method:r.formMethod})};let i=()=>({path:n,error:St(400,{type:"invalid-body"})}),s=r.formMethod||"get",a=e?s.toUpperCase():s.toLowerCase(),o=Ig(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!on(a))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,g)=>{let[x,T]=g;return""+m+x+"="+T+` +`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!on(a))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}le(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=vd(r.formData),u=r.formData;else if(r.body instanceof FormData)l=vd(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=om(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=om(l)}catch{return i()}let d={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(on(d.formMethod))return{path:n,submission:d};let c=Ur(n);return t&&c.search&&Of(c.search)&&l.append("index",""),c.search="?"+l,{path:Ci(c),submission:d}}function nm(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function rm(e,t,n,r,i,s,a,o,l,u,d,c,f,m,g,x){let T=x?Mt(x[1])?x[1].error:x[1].data:void 0,v=e.createURL(t.location),p=e.createURL(i),y=n;s&&t.errors?y=nm(n,Object.keys(t.errors)[0],!0):x&&Mt(x[1])&&(y=nm(n,x[0]));let S=x?x[1].statusCode:void 0,R=a&&S&&S>=400,L=y.filter((j,W)=>{let{route:P}=j;if(P.lazy)return!0;if(P.loader==null)return!1;if(s)return md(P,t.loaderData,t.errors);if(ES(t.loaderData,t.matches[W],j)||l.some(be=>be===j.route.id))return!0;let B=t.matches[W],ue=j;return im(j,Me({currentUrl:v,currentParams:B.params,nextUrl:p,nextParams:ue.params},r,{actionResult:T,actionStatus:S,defaultShouldRevalidate:R?!1:o||v.pathname+v.search===p.pathname+p.search||v.search!==p.search||Dg(B,ue)}))}),k=[];return c.forEach((j,W)=>{if(s||!n.some(Z=>Z.route.id===j.routeId)||d.has(W))return;let P=Yr(m,j.path,g);if(!P){k.push({key:W,routeId:j.routeId,path:j.path,matches:null,match:null,controller:null});return}let B=t.fetchers.get(W),ue=ea(P,j.path),be=!1;f.has(W)?be=!1:u.has(W)?(u.delete(W),be=!0):B&&B.state!=="idle"&&B.data===void 0?be=o:be=im(ue,Me({curren)DELIM" +R"DELIM(tUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:p,nextParams:n[n.length-1].params},r,{actionResult:T,actionStatus:S,defaultShouldRevalidate:R?!1:o})),be&&k.push({key:W,routeId:j.routeId,path:j.path,matches:P,match:ue,controller:new AbortController})}),[L,k]}function md(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function ES(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Dg(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function im(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function sm(e,t,n,r,i){var s;let a;if(e){let u=r[e];le(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),a=u.children}else a=n;let o=t.filter(u=>!a.some(d=>Ag(u,d))),l=Pl(o,i,[e||"_","patch",String(((s=a)==null?void 0:s.length)||"0")],r);a.push(...l)}function Ag(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(s=>Ag(n,s))}):!1}async function CS(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];le(i,"No route found in manifest");let s={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";Ei(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!K_.has(a)&&(s[a]=r[a])}Object.assign(i,s),Object.assign(i,Me({},t(i),{lazy:void 0}))}async function TS(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,s,a)=>Object.assign(i,{[n[a].route.id]:s}),{})}async function bS(e,t,n,r,i,s,a,o,l,u){let d=s.map(m=>m.route.lazy?CS(m.route,l,o):void 0),c=s.map((m,g)=>{let x=d[g],T=i.some(p=>p.route.id===m.route.id);return Me({},m,{shouldLoad:T,resolve:async p=>(p&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(T=!0),T?NS(t,r,m,x,p,u):Promise.resolve({type:Ee.data,result:void 0}))})}),f=await e({matches:c,request:r,params:s[0].params,fetcherKey:a,context:u});try{await Promise.all(d)}catch{}return f}async function NS(e,t,n,r,i,s){let a,o,l=u=>{let d,c=new Promise((g,x)=>d=x);o=()=>d(),t.signal.addEventListener("abort",o);let f=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:s},...g!==void 0?[g]:[]),m=(async()=>{try{return{type:"data",result:await(i?i(x=>f(x)):f())}}catch(g){return{type:"error",result:g}}})();return Promise.race([m,c])};try{let u=n.route[e];if(r)if(u){let d,[c]=await Promise.all([l(u).catch(f=>{d=f}),r]);if(d!==void 0)throw d;a=c}else if(await r,u=n.route[e],u)a=await l(u);else if(e==="action"){let d=new URL(t.url),c=d.pathname+d.search;throw St(405,{method:t.method,pathname:c,routeId:n.route.id})}else return{type:Ee.data,result:void 0};else if(u)a=await l(u);else{let d=new URL(t.url),c=d.pathname+d.search;throw St(404,{pathname:c})}le(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:Ee.error,result:u}}finally{o&&t.signal.removeEventListener("abort",o)}return a}async function PS(e){let{result:t,type:n}=e;if($g(t)){let c;try{let f=t.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(f){return{type:Ee.error,error:f}}return n===Ee.error?{type:Ee.error,error:new jl(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:Ee.data,data:c,statusCode:t.status,headers:t.headers}}if(n===Ee.error){if(fm(t)){var r,i;if(t.data instanceof Error){var s,a;return{type:Ee.error,error:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:Ee.error,error:new jl(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:Aa(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:Ee.error,error:t,statusCode:Aa(t)?t.status:void 0}}if(OS(t)){var o,l;return{type:Ee.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(fm(t)){var u,d;return{type:Ee.data,data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}}return{type:Ee.data,data:t}}function RS(e,t,n,r,i,s){let a=e.hea)DELIM" +R"DELIM(ders.get("Location");if(le(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Mf.test(a)){let o=r.slice(0,r.findIndex(l=>l.route.id===n)+1);a=pd(new URL(t.url),o,i,!0,a,s),e.headers.set("Location",a)}return e}function am(e,t,n){if(Mf.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=Kn(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function Mi(e,t,n,r){let i=e.createURL(Ig(t)).toString(),s={signal:n};if(r&&on(r.formMethod)){let{formMethod:a,formEncType:o}=r;s.method=a.toUpperCase(),o==="application/json"?(s.headers=new Headers({"Content-Type":o}),s.body=JSON.stringify(r.json)):o==="text/plain"?s.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?s.body=vd(r.formData):s.body=r.formData}return new Request(i,s)}function vd(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function om(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function jS(e,t,n,r,i){let s={},a=null,o,l=!1,u={},d=n&&Mt(n[1])?n[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let f=c.route.id,m=t[f];if(le(!ri(m),"Cannot handle redirect results in processLoaderData"),Mt(m)){let g=m.error;d!==void 0&&(g=d,d=void 0),a=a||{};{let x=Xr(e,f);a[x.route.id]==null&&(a[x.route.id]=g)}s[f]=void 0,l||(l=!0,o=Aa(m.error)?m.error.status:500),m.headers&&(u[f]=m.headers)}else Sr(m)?(r.set(f,m.deferredData),s[f]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!l&&(o=m.statusCode),m.headers&&(u[f]=m.headers)):(s[f]=m.data,m.statusCode&&m.statusCode!==200&&!l&&(o=m.statusCode),m.headers&&(u[f]=m.headers))}),d!==void 0&&n&&(a={[n[0]]:d},s[n[0]]=void 0),{loaderData:s,errors:a,statusCode:o||200,loaderHeaders:u}}function lm(e,t,n,r,i,s,a){let{loaderData:o,errors:l}=jS(t,n,r,a);return i.forEach(u=>{let{key:d,match:c,controller:f}=u,m=s[d];if(le(m,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Mt(m)){let g=Xr(e.matches,c==null?void 0:c.route.id);l&&l[g.route.id]||(l=Me({},l,{[g.route.id]:m.error})),e.fetchers.delete(d)}else if(ri(m))le(!1,"Unhandled fetcher revalidation redirect");else if(Sr(m))le(!1,"Unhandled fetcher deferred data");else{let g=ar(m.data);e.fetchers.set(d,g)}}),{loaderData:o,errors:l}}function um(e,t,n,r){let i=Me({},t);for(let s of n){let a=s.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&s.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function cm(e){return e?Mt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Xr(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function dm(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function St(e,t){let{pathname:n,routeId:r,method:i,type:s,message:a}=t===void 0?{}:t,o="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?l="defer() is not supported in actions":s==="invalid-body"&&(l="Unable to encode submission body")):e===403?(o="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",l='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new jl(e||500,o,new Error(l),!0)}function Po(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(ri(i))return{key:r,result:i}}}function Ig(e){let t=typeof e=="string"?Ur(e):e;return Ci(Me({},t,{hash:""}))}function MS(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function LS(e){return $g(e.result)&&gS.has(e.result.status)}function Sr(e){return e.type===Ee.deferred}function Mt(e){return e.type===Ee.error}function ri(e){return(e&&e.type)===Ee.redirect}function fm(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function OS(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function $g(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function DS(e){return yS.has(e.toLowerCase())}function on(e){return mS.has(e.toLowerCase())}async function AS(e,t,n,r,i){let s=Object.entries(t);for(let a=0;a(f==null?void 0:f.route.id)===o);if(!u)continue;let d=r.find(f=>f.route.id===u.route.id)DELIM" +R"DELIM(),c=d!=null&&!Dg(d,u)&&(i&&i[u.route.id])!==void 0;Sr(l)&&c&&await Lf(l,n,!1).then(f=>{f&&(t[o]=f)})}}async function IS(e,t,n){for(let r=0;r(u==null?void 0:u.route.id)===s)&&Sr(o)&&(le(a,"Expected an AbortController for revalidating fetcher deferred result"),await Lf(o,a.signal,!0).then(u=>{u&&(t[i]=u)}))}}async function Lf(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Ee.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Ee.error,error:i}}return{type:Ee.data,data:e.deferredData.data}}}function Of(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ea(e,t){let n=typeof t=="string"?Ur(t).search:t.search;if(e[e.length-1].route.index&&Of(n||""))return e[e.length-1];let r=Mg(e);return r[r.length-1]}function hm(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Wu(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function $S(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Vs(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function FS(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ar(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function zS(e,t){try{let n=e.sessionStorage.getItem(Og);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function BS(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Og,JSON.stringify(n))}catch(r){Ei(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** * React Router v6.30.2 * * Copyright (c) Remix Software Inc. @@ -146,9 +146,9 @@ R"DELIM(),c=d!=null&&!Og(d,u)&&(i&&i[u.route.id])!==void 0;Sr(l)&&c&&await Mf(l, * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.current=!0}),C.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let c=Rf(u,JSON.parse(a),s,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Un([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,a,s,e])}const HS=C.createContext(null);function VS(e){let t=C.useContext(Yn).outlet;return t&&C.createElement(HS.Provider,{value:e},t)}function Af(){let{matches:e}=C.useContext(Yn),t=e[e.length-1];return t?t.params:{}}function tu(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=C.useContext(Hr),{matches:i}=C.useContext(Yn),{pathname:s}=Ps(),a=JSON.stringify(Nf(i,r.v7_relativeSplatPath));return C.useMemo(()=>Rf(e,JSON.parse(a),s,n==="path"),[e,a,s,n])}function QS(e,t,n,r){Ya()||le(!1);let{navigator:i}=C.useContext(Hr),{matches:s}=C.useContext(Yn),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=Ps(),d;d=u;let c=d.pathname||)DELIM" - R"DELIM("/",f=c;if(l!=="/"){let x=l.replace(/^\//,"").split("/");f="/"+c.replace(/^\//,"").split("/").slice(x.length).join("/")}let m=Yr(e,{pathname:f});return qS(m&&m.map(x=>Object.assign({},x,{params:Object.assign({},o,x.params),pathname:Un([l,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:Un([l,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),s,n,r)}function WS(){let e=Hg(),t=Aa(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:i},n):null,null)}const ZS=C.createElement(WS,null);class KS extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(Yn.Provider,{value:this.props.routeContext},C.createElement($g.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function GS(e){let{routeContext:t,match:n,children:r}=e,i=C.useContext(qa);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(Yn.Provider,{value:t},r)}function qS(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let d=a.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);d>=0||le(!1),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,c,f)=>{let m,g=!1,x=null,T=null;n&&(m=o&&c.route.id?o[c.route.id]:void 0,x=c.route.errorElement||ZS,l&&(u<0&&f===0?(t2("route-fallback"),g=!0,T=null):u===f&&(g=!0,T=c.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,f+1)),p=()=>{let y;return m?y=x:g?y=T:c.route.Component?y=C.createElement(c.route.Component,null):c.route.element?y=c.route.element:y=d,C.createElement(GS,{match:c,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:y})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?C.createElement(KS,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:p(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):p()},null)}var zg=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(zg||{}),Bg=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bg||{});function YS(e){let t=C.useContext(qa);return t||le(!1),t}function XS(e){let t=C.useContext(Of);return t||le(!1),t}function JS(e){let t=C.useContext(Yn);return t||le(!1),t}function Ug(e){let t=JS(),n=t.matches[t.matches.length-1];return n.route.id||le(!1),n.route.id}function Hg(){var e;let t=C.useContext($g),n=XS(Bg.UseRouteError),r=Ug();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function e2(){let{router:e}=YS(zg.UseNavigateStable),t=Ug(),n=C.useRef(!1);return Fg(()=>{n.current=!0}),C.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ml({fromRouteId:t},s)))},[e,t])}const hm={};function t2(e,t,n){hm[e]||(hm[e]=!0)}function n2(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function r2(e){return VS(e.context)}function On(e){le(!1)}function i2(e){let{basename:t="/",children:n=null,location:r,navigationType:i=We.Pop,navigator:s,static:a=!1,future:o}=e;Ya()&&le(!1);let l=t.replace(/^\/*/,"/"),u=C.u)DELIM" - R"DELIM(seMemo(()=>({basename:l,navigator:s,static:a,future:Ml({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof r=="string"&&(r=Ur(r));let{pathname:d="/",search:c="",hash:f="",state:m=null,key:g="default"}=r,x=C.useMemo(()=>{let T=Kn(d,l);return T==null?null:{location:{pathname:T,search:c,hash:f,state:m,key:g},navigationType:i}},[l,d,c,f,m,g,i]);return x==null?null:C.createElement(Hr.Provider,{value:u},C.createElement(Df.Provider,{children:n,value:x}))}new Promise(()=>{});function vd(e,t){t===void 0&&(t=[]);let n=[];return C.Children.forEach(e,(r,i)=>{if(!C.isValidElement(r))return;let s=[...t,i];if(r.type===C.Fragment){n.push.apply(n,vd(r.props.children,s));return}r.type!==On&&le(!1),!r.props.index||!r.props.children||le(!1);let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=vd(r.props.children,s)),n.push(a)}),n}function s2(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:C.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:C.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:C.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + */function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.current=!0}),C.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let c=jf(u,JSON.parse(a),s,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Un([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,a,s,e])}const VS=C.createContext(null);function QS(e){let t=C.useContext(Yn).outlet;return t&&C.createElement(VS.Provider,{value:e},t)}function If(){let{matches:e}=C.useContext(Yn),t=e[e.length-1];return t?t.params:{}}function tu(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=C.useContext(Hr),{matches:i}=C.useContext(Yn),{pathname:s}=Ns(),a=JSON.stringify(Rf(i,r.v7_relativeSplatPath));return C.useMemo(()=>jf(e,JSON.parse(a),s,n==="path"),[e,a,s,n])}function WS(e,t,n,r){Ya()||le(!1);let{navigator:i}=C.useContext(Hr),{matches:s}=C.useContext(Yn),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=Ns(),d;d=u;let c=d.pathname||)DELIM" + R"DELIM("/",f=c;if(l!=="/"){let x=l.replace(/^\//,"").split("/");f="/"+c.replace(/^\//,"").split("/").slice(x.length).join("/")}let m=Yr(e,{pathname:f});return YS(m&&m.map(x=>Object.assign({},x,{params:Object.assign({},o,x.params),pathname:Un([l,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:Un([l,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),s,n,r)}function ZS(){let e=Vg(),t=Aa(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:i},n):null,null)}const KS=C.createElement(ZS,null);class GS extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(Yn.Provider,{value:this.props.routeContext},C.createElement(Fg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function qS(e){let{routeContext:t,match:n,children:r}=e,i=C.useContext(qa);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(Yn.Provider,{value:t},r)}function YS(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let d=a.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);d>=0||le(!1),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,c,f)=>{let m,g=!1,x=null,T=null;n&&(m=o&&c.route.id?o[c.route.id]:void 0,x=c.route.errorElement||KS,l&&(u<0&&f===0?(n2("route-fallback"),g=!0,T=null):u===f&&(g=!0,T=c.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,f+1)),p=()=>{let y;return m?y=x:g?y=T:c.route.Component?y=C.createElement(c.route.Component,null):c.route.element?y=c.route.element:y=d,C.createElement(qS,{match:c,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:y})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?C.createElement(GS,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:p(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):p()},null)}var Bg=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Bg||{}),Ug=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ug||{});function XS(e){let t=C.useContext(qa);return t||le(!1),t}function JS(e){let t=C.useContext(Df);return t||le(!1),t}function e2(e){let t=C.useContext(Yn);return t||le(!1),t}function Hg(e){let t=e2(),n=t.matches[t.matches.length-1];return n.route.id||le(!1),n.route.id}function Vg(){var e;let t=C.useContext(Fg),n=JS(Ug.UseRouteError),r=Hg();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function t2(){let{router:e}=XS(Bg.UseNavigateStable),t=Hg(),n=C.useRef(!1);return zg(()=>{n.current=!0}),C.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ml({fromRouteId:t},s)))},[e,t])}const pm={};function n2(e,t,n){pm[e]||(pm[e]=!0)}function r2(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function i2(e){return QS(e.context)}function On(e){le(!1)}function s2(e){let{basename:t="/",children:n=null,location:r,navigationType:i=We.Pop,navigator:s,static:a=!1,future:o}=e;Ya()&&le(!1);let l=t.replace(/^\/*/,"/"),u=C.u)DELIM" + R"DELIM(seMemo(()=>({basename:l,navigator:s,static:a,future:Ml({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof r=="string"&&(r=Ur(r));let{pathname:d="/",search:c="",hash:f="",state:m=null,key:g="default"}=r,x=C.useMemo(()=>{let T=Kn(d,l);return T==null?null:{location:{pathname:T,search:c,hash:f,state:m,key:g},navigationType:i}},[l,d,c,f,m,g,i]);return x==null?null:C.createElement(Hr.Provider,{value:u},C.createElement(Af.Provider,{children:n,value:x}))}new Promise(()=>{});function yd(e,t){t===void 0&&(t=[]);let n=[];return C.Children.forEach(e,(r,i)=>{if(!C.isValidElement(r))return;let s=[...t,i];if(r.type===C.Fragment){n.push.apply(n,yd(r.props.children,s));return}r.type!==On&&le(!1),!r.props.index||!r.props.children||le(!1);let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=yd(r.props.children,s)),n.push(a)}),n}function a2(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:C.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:C.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:C.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.30.2 * * Copyright (c) Remix Software Inc. @@ -157,22 +157,23 @@ R"DELIM(),c=d!=null&&!Og(d,u)&&(i&&i[u.route.id])!==void 0;Sr(l)&&c&&await Mf(l, * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Es(){return Es=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function a2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function o2(e,t){return e.button===0&&(!t||t==="_self")&&!a2(e)}function yd(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function l2(e,t){let n=yd(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const u2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],c2=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],d2="6";try{window.__reactRouterVersion=d2}catch{}function f2(e,t){return kS({basename:void 0,future:Es({},void 0,{v7_prependBasename:!0}),history:V_({window:void 0}),hydrationData:h2(),routes:e,mapRouteProperties:s2,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function h2(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Es({},t,{errors:p2(t.errors)})),t}function p2(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new jl(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let a=new s(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}const Qg=C.createContext({isTransitioning:!1}),m2=C.createContext(new Map),v2="startTransition",pm=F0[v2],y2="flushSync",mm=Y1[y2];function g2(e){pm?pm(e):e()}function Qs(e){mm?mm(e):e()}class x2{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function w2(e){let{fallbackElement:t,router:n,future:r}=e,[i,s]=C.useState(n.state),[a,o]=C.useState(),[l,u]=C.useState({isTransitioning:!1}),[d,c]=C.useState(),[f,m]=C.useState(),[g,x]=C.useState(),T=C.useRef(new Map),{v7_startTransition:v}=r||{},p=C.useCallback(j=>{v?g2(j):j()},[v]),y=C.useCallback((j,W)=>{let{deletedFetchers:N,flushSync:B,viewTransitionOpts:ue}=W;j.fetchers.forEach((Z,F)=>{Z.data!==void 0&&T.current.set(F,Z.data)}),N.forEach(Z=>T.current.delete(Z));let be=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!ue||be){B?Qs(()=>s(j)):p(()=>s(j));return}if(B){Qs(()=>{f&&(d&&d.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:ue.currentLocation,nextLocation:ue.nextLocation})});let Z=n.window.document.startViewTransition(()=>{Qs(()DELIM" - R"DELIM()=>s(j))});Z.finished.finally(()=>{Qs(()=>{c(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),Qs(()=>m(Z));return}f?(d&&d.resolve(),f.skipTransition(),x({state:j,currentLocation:ue.currentLocation,nextLocation:ue.nextLocation})):(o(j),u({isTransitioning:!0,flushSync:!1,currentLocation:ue.currentLocation,nextLocation:ue.nextLocation}))},[n.window,f,d,T,p]);C.useLayoutEffect(()=>n.subscribe(y),[n,y]),C.useEffect(()=>{l.isTransitioning&&!l.flushSync&&c(new x2)},[l]),C.useEffect(()=>{if(d&&a&&n.window){let j=a,W=d.promise,N=n.window.document.startViewTransition(async()=>{p(()=>s(j)),await W});N.finished.finally(()=>{c(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(N)}},[p,a,d,n.window]),C.useEffect(()=>{d&&a&&i.location.key===a.location.key&&d.resolve()},[d,f,i.location,a]),C.useEffect(()=>{!l.isTransitioning&&g&&(o(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),x(void 0))},[l.isTransitioning,g]),C.useEffect(()=>{},[]);let S=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:j=>n.navigate(j),push:(j,W,N)=>n.navigate(j,{state:W,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(j,W,N)=>n.navigate(j,{replace:!0,state:W,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[n]),R=n.basename||"/",L=C.useMemo(()=>({router:n,navigator:S,static:!1,basename:R}),[n,S,R]),k=C.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return C.useEffect(()=>n2(r,n.future),[r,n.future]),C.createElement(C.Fragment,null,C.createElement(qa.Provider,{value:L},C.createElement(Of.Provider,{value:i},C.createElement(m2.Provider,{value:T.current},C.createElement(Qg.Provider,{value:l},C.createElement(i2,{basename:R,location:i.location,navigationType:i.historyAction,navigator:S,future:k},i.initialized||n.future.v7_partialHydration?C.createElement(k2,{routes:n.routes,future:n.future,state:i}):t))))),null)}const k2=C.memo(_2);function _2(e){let{routes:t,future:n,state:r}=e;return QS(t,void 0,r,n)}const S2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",E2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xe=C.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:o,target:l,to:u,preventScrollReset:d,viewTransition:c}=t,f=Vg(t,u2),{basename:m}=C.useContext(Hr),g,x=!1;if(typeof u=="string"&&E2.test(u)&&(g=u,S2))try{let y=new URL(window.location.href),S=u.startsWith("//")?new URL(y.protocol+u):new URL(u),R=Kn(S.pathname,m);S.origin===y.origin&&R!=null?u=R+S.search+S.hash:x=!0}catch{}let T=BS(u,{relative:i}),v=T2(u,{replace:a,state:o,target:l,preventScrollReset:d,relative:i,viewTransition:c});function p(y){r&&r(y),y.defaultPrevented||v(y)}return C.createElement("a",Es({},f,{href:g||T,onClick:x||s?r:p,ref:n,target:l}))}),Zu=C.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:a=!1,style:o,to:l,viewTransition:u,children:d}=t,c=Vg(t,c2),f=tu(l,{relative:c.relative}),m=Ps(),g=C.useContext(Of),{navigator:x,basename:T}=C.useContext(Hr),v=g!=null&&P2(f)&&u===!0,p=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,y=m.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(y=y.toLowerCase(),S=S?S.toLowerCase():null,p=p.toLowerCase()),S&&T&&(S=Kn(S,T)||S);const R=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let L=y===p||!a&&y.startsWith(p)&&y.charAt(R)==="/",k=S!=null&&(S===p||!a&&S.startsWith(p)&&S.charAt(p.length)==="/"),j={isActive:L,isPending:k,isTransitioning:v},W=L?r:void 0,N;typeof s=="function"?N=s(j):N=[s,L?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(j):o;return C.createElement(Xe,Es({},c,{"aria-current":W,className:N,ref:n,style:B,to:l,viewTransition:u}),typeof d=="function"?d(j):d)});var gd;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gd||(gd={}));var vm;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(vm||(vm={}));function C2(e){let t=C.useContext(qa);return t||le(!1),t}function T2(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:o}=t===void 0?{}:t,l=eu(),u=Ps(),d=tu(e,{relative:a});return C.useCallback(c=>{if(o2(c,n)){c.preventDefault();let f=r!==void 0?r:Ci(u)===Ci(d);l(e,{replace:f,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[u,l,d,r,i,n,e,s,a,o])}function b2(e){let t=C.useRef(yd(e)),n=C.useRef(!1),r=Ps(),i=C.useMemo(()=>l2(r.search,n.current?null:t.current),[r.search]),s=eu(),a=C.useCallback((o,l)=>{const u=yd(typeof o=="function"?o(i):o);n.current=!0,s("?"+u,l)},[s,i]);return[i,a]}function P2(e,t){t===void 0&&(t={});let n=C.useContext(Qg);n==null&&le(!1);let{basename:r}=C2(gd.useViewTransitionState),i=tu(e,{relativ)DELIM" - R"DELIM(e:t.relative});if(!n.isTransitioning)return!1;let s=Kn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Kn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Rl(i.pathname,a)!=null||Rl(i.pathname,s)!=null}function N2({title:e,titleId:t,...n},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?C.createElement("title",{id:t},e):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const R2=C.forwardRef(N2);function j2(){const[e,t]=C.useState(""),n=eu(),r=i=>{i.preventDefault();const s=e.trim();s&&n({pathname:"/search",search:`?q=${encodeURIComponent(s)}`})};return h.jsxs("form",{onSubmit:r,className:"flex items-center gap-2 rounded-xl border border-accent/30 bg-surface/80 px-3 py-2 text-sm shadow-inner",children:[h.jsx(R2,{className:"h-4 w-4 text-accent","aria-hidden":"true"}),h.jsx("input",{type:"search",placeholder:"Search blocks, transactions, addresses",className:"w-52 bg-transparent text-textPrimary placeholder:text-textMuted focus:outline-none",value:e,onChange:i=>t(i.target.value)})]})}const M2={connected:"bg-emerald-500/20 text-emerald-300 border-emerald-500/50",degraded:"bg-amber-500/20 text-amber-300 border-amber-500/50",offline:"bg-rose-500/20 text-rose-300 border-rose-500/50",unknown:"bg-slate-500/20 text-slate-300 border-slate-500/50"},L2={connected:"bg-emerald-400",degraded:"bg-amber-400",offline:"bg-rose-400",unknown:"bg-slate-400"};function O2({status:e,label:t,title:n}){return h.jsxs("span",{title:n,className:`flex items-center gap-2 rounded-full border px-3 py-1 text-xs font-medium uppercase tracking-wide ${M2[e]}`,children:[h.jsx("span",{className:`h-2 w-2 rounded-full ${L2[e]}`,"aria-hidden":"true"}),t]})}function D2(){const e=I_(),{provider:t,setProvider:n,availableProviders:r}=$_(),{turbo:i,setTurbo:s}=F_();return h.jsxs("div",{className:"min-h-screen bg-background text-textPrimary",children:[h.jsx("header",{className:"border-b border-accent/30 bg-surface/90 backdrop-blur",children:h.jsxs("div",{className:"mx-auto flex max-w-6xl items-center gap-4 px-4 py-4",children:[h.jsx(Zu,{to:"/",className:"text-lg font-semibold tracking-tight text-accent",children:"libbitcoin Explorer"}),h.jsxs("nav",{className:"hidden items-center gap-3 text-sm text-textMuted md:flex",children:[h.jsx(Zu,{to:"/",className:({isActive:a})=>`rounded-md px-3 py-1 transition text-textMuted hover:text-accent ${a?"bg-accentSecondary/20 text-accent":""}`,end:!0,children:"Dashboard"}),h.jsx(Zu,{to:"/block",className:({isActive:a})=>`rounded-md px-3 py-1 transition text-textMuted hover:text-accent ${a?"bg-accentSecondary/20 text-accent":""}`,children:"Blocks"})]}),h.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[h.jsx(O2,{label:e.label,status:e.connectionState,title:e.description}),h.jsxs("label",{className:"flex items-center gap-2 text-xs uppercase tracking-wide text-textMuted",children:[h.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-accent/50 bg-surface/80 text-accent focus:ring-accent",checked:i,onChange:a=>s(a.target.checked)}),"Turbo"]}),h.jsx("select",{value:t,onChange:a=>n(a.target.value),className:"rounded-md border border-accent/40 bg-surface/80 px-2 py-1 text-xs uppercase tracking-wide text-textPrimary hover:border-accent focus:border-accent focus:outline-none",title:"Switch data provider",children:r.map(a=>{const o=a==="libbitcoin"?"server":a;return h.jsx("option",{value:a,children:o},a)})}),h.jsx(j2,{})]})]})}),h.jsx("main",{className:"mx-auto min-h-[calc(100vh-4rem)] max-w-6xl px-4 py-8",children:h.jsx(r2,{})})]})}function A2(e=10){const t=qn();return ql({queryKey:["blocks","latest",{limit:e}],queryFn:()=>t.getLatestBlocks(e)})}function Wg(e){const t=qn();return ql({queryKey:["block",e],queryFn:()=>t.getBlock(e)})}function I2(e){const t=qn();return ql({queryKey:["transaction",e],queryFn:()=>t.getTransaction(e)})}function $2(e){const t=qn();return ql({queryKey:["address",e],queryFn:()=>t.getAddress(e)})}function F2(e){const t=qn();C.useEffect(()=>{const n=t.subscribeToEvents(e);return()=>n()},[t,e])}function z2(e=10){const t=Jy(),{data:n,...r}=A2(e);C.useEffect(()=>{t.getQueryData(["transactions","recent"])||t.setQueryData(["transactions","recent"],[])},[t]);const i=C.useCallback(a=>{a.type==="block.new"&&t.setQueryData(["blocks","latest",{limit:e}],(o=[])=>[a.payload,...o.filter(u=>u.hash!==a.payload.hash)].slice(0,e)),a.type==="tx.new"&&t.setQueryData(["transactions","recent"],(o=[])=>[a.payload,...o.filter(u=>u.txid!==a.payload.txid)].slice(0,e*2))},[e,t]);F2(i);const s=t.getQueryData(["transactions","recent"]);return{data:n,recentTransactions:s,...r}}function Ge(e,t={}){return e==null?"—":new Intl.NumberFormat("en-US",{maximumFractionDigits:2,...t}).format(e)}function Or(e,t=8){retu)DELIM" - R"DELIM(rn e?e.length<=t*2?e:`${e.slice(0,t)}…${e.slice(-t)}`:"—"}function mi(e){if(e!=null)return e/1e8}function Ji(e){return e==null?"—":`${Ge(e)} sats`}function vi(e){return e==null?"—":`${Ge(e,{minimumFractionDigits:8,maximumFractionDigits:8})} BTC`}function If(e){return e?new Date(e*1e3).toLocaleString():"—"}function nu(e){if(!e)return"—";const t=new Intl.RelativeTimeFormat("en",{numeric:"auto"}),n=Date.now(),r=Math.round((e*1e3-n)/1e3);if(Math.abs(r)<60)return t.format(r,"second");const s=Math.round(r/60);if(Math.abs(s)<60)return t.format(s,"minute");const a=Math.round(s/60);if(Math.abs(a)<24)return t.format(a,"hour");const o=Math.round(a/24);return t.format(o,"day")}function B2(){const{data:e,isLoading:t,recentTransactions:n}=z2(8),{data:r,isLoading:i}=Wg("latest"),s=C.useMemo(()=>{var a;return n!=null&&n.length?n.slice(0,10):(a=r==null?void 0:r.transactions)!=null&&a.length?r.transactions.slice(0,10):[]},[r,n]);return h.jsxs("div",{className:"flex flex-col gap-10",children:[h.jsxs("section",{children:[h.jsx("header",{className:"mb-4 flex items-center justify-between",children:h.jsx("h2",{className:"text-lg font-semibold text-accent",children:"Latest Blocks"})}),h.jsx("div",{className:"overflow-hidden rounded-xl border border-accent/30",children:h.jsxs("table",{className:"min-w-full divide-y divide-accentSecondary/30 text-sm",children:[h.jsx("thead",{className:"bg-accentSecondary/20 text-xs uppercase text-textMuted",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-4 py-3 text-left",children:"Height"}),h.jsx("th",{className:"px-4 py-3 text-left",children:"Hash"}),h.jsx("th",{className:"px-4 py-3 text-left",children:"Age"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Tx"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Size"})]})}),h.jsxs("tbody",{children:[t&&h.jsx("tr",{children:h.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-textMuted",children:"Loading latest blocks…"})}),!t&&(e==null?void 0:e.length)===0&&h.jsx("tr",{children:h.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-textMuted",children:"No blocks available."})}),!t&&(e==null?void 0:e.map(a=>h.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Xe,{to:`/block/${a.hash}`,className:"font-medium text-accent hover:text-accentSecondary",children:Ge(a.height,{maximumFractionDigits:0})})}),h.jsx("td",{className:"px-4 py-3 text-textPrimary",children:h.jsx("span",{className:"font-mono",children:Or(a.hash)})}),h.jsx("td",{className:"px-4 py-3 text-textMuted",children:nu(a.timestamp)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Ge(a.txCount)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:a.size?`${Ge(a.size/1e6,{maximumFractionDigits:2})} MB`:"—"})]},a.hash)))]})]})})]}),h.jsxs("section",{children:[h.jsx("header",{className:"mb-4 flex items-center justify-between",children:h.jsx("h2",{className:"text-lg font-semibold text-accent",children:"Recent Transactions"})}),h.jsx("div",{className:"overflow-hidden rounded-xl border border-accent/30",children:h.jsxs("table",{className:"min-w-full divide-y divide-accentSecondary/30 text-sm",children:[h.jsx("thead",{className:"bg-accentSecondary/20 text-xs uppercase text-textMuted",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-4 py-3 text-left",children:"TxID"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Output"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Fee"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Weight"})]})}),h.jsxs("tbody",{children:[i&&h.jsx("tr",{children:h.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-textMuted",children:"Loading transactions…"})}),!i&&s.length===0&&h.jsx("tr",{children:h.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-textMuted",children:"No transactions available."})}),!i&&s.map(a=>h.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Xe,{to:`/tx/${a.txid}`,className:"font-mono text-accent hover:text-accentSecondary",children:Or(a.txid,10)})}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:vi(mi(a.totalOutput))}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Ji(a.feeSats)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Ge(a.weight)})]},a.txid))]})]})})]})]})}function U2(){const{hash:e}=Af(),t=e??"latest",{data:n,isLoading:r,error:i}=Wg(t),s=qn(),[a,o]=C.useState([]),[l,u]=C.useState(!1),[d,c]=C.useState(!1);C.useEffect(()=>{n&&(o(n.transactions??[]),c(!1))},[n]);const f=n?!d&&a.length<(n.txCount??a.length):!1,m=async()=>{if(!(!n||!f||l)){u(!0);try{const g=await s.getBlockTransactions(n.hash,a.length);if(g.length===0){c(!0);return}o(x=>{const T=new Set(x.map(p=>p.txid)),v=[...x];return g.forEach(p=>{T.has(p.txid)||v.push(p)}),v.length===x.length?(c(!0),x):v})}finally{u(!1)}}};return r?h.jsx("div",{className:"py-10 text-textMuted",ch)DELIM" - R"DELIM(ildren:"Loading block details…"}):i||!n?h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Block not found"}),h.jsxs("p",{className:"text-textMuted",children:["We could not find a block matching identifier “",t,"”."]}),h.jsx(Xe,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Return to dashboard"})]}):h.jsxs("div",{className:"space-y-8",children:[h.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm uppercase tracking-wide text-accentSecondary",children:"Block"}),h.jsxs("h1",{className:"text-3xl font-semibold text-accent",children:["#",n.height]}),h.jsx("p",{className:"mt-2 font-mono text-xs text-textPrimary break-all",children:n.hash}),h.jsxs("p",{className:"text-sm text-textMuted",children:[nu(n.timestamp)," · ",If(n.timestamp)]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[n.previousBlockHash&&h.jsx(Xe,{to:`/block/${n.previousBlockHash}`,className:"rounded-md border border-accent/40 px-3 py-2 text-sm text-textPrimary hover:border-accent hover:text-accent",children:"← Previous"}),n.nextBlockHash&&h.jsx(Xe,{to:`/block/${n.nextBlockHash}`,className:"rounded-md border border-accent/40 px-3 py-2 text-sm text-textPrimary hover:border-accent hover:text-accent",children:"Next →"})]})]}),h.jsxs("section",{className:"grid gap-4 rounded-xl border border-accent/30 bg-surface/80 p-6 text-sm sm:grid-cols-2 lg:grid-cols-3",children:[h.jsx(rr,{label:"Transactions",value:Ge(n.txCount,{maximumFractionDigits:0})}),h.jsx(rr,{label:"Size",value:n.size?`${Ge(n.size/1e6,{maximumFractionDigits:2})} MB`:"—"}),h.jsx(rr,{label:"Weight units",value:n.weight?`${Ge(n.weight,{maximumFractionDigits:0})} WU`:"—"}),h.jsx(rr,{label:"Difficulty",value:Ge(n.difficulty??void 0)}),h.jsx(rr,{label:"Nonce",value:Ge(n.nonce??void 0)}),h.jsx(rr,{label:"Bits",value:n.bits??"—"}),h.jsx(rr,{label:"Version",value:n.version??"—"}),h.jsx(rr,{label:"Merkle root",value:h.jsx("span",{className:"font-mono text-xs text-textPrimary break-all",children:n.merkleRoot??"—"})})]}),h.jsxs("section",{children:[h.jsxs("header",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h2",{className:"text-lg font-semibold text-accent",children:"Transactions"}),h.jsxs("p",{className:"text-sm text-textMuted",children:["Showing ",a.length," transactions"]})]}),h.jsx("div",{className:"overflow-hidden rounded-xl border border-accent/30",children:h.jsxs("table",{className:"min-w-full divide-y divide-accentSecondary/30 text-sm",children:[h.jsx("thead",{className:"bg-accentSecondary/20 text-xs uppercase text-textMuted",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-4 py-3 text-left",children:"TxID"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Outputs"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Fee"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Size"})]})}),h.jsx("tbody",{children:a.map(g=>h.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Xe,{to:`/tx/${g.txid}`,className:"font-mono text-accent hover:text-accentSecondary",children:Or(g.txid,12)})}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:vi(mi(g.totalOutput))}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Ji(g.feeSats)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:g.size?`${Ge(g.size)} bytes`:"—"})]},g.txid))})]})}),f&&h.jsx("div",{className:"mt-4 flex justify-center",children:h.jsx("button",{type:"button",onClick:m,disabled:l,className:"rounded-md border border-accent px-4 py-2 text-sm font-medium text-accent hover:border-accentSecondary hover:text-accentSecondary disabled:cursor-not-allowed disabled:opacity-60",children:l?"Loading more…":"Load more transactions"})})]})]})}function rr({label:e,value:t}){return h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-xs uppercase tracking-wide text-accentSecondary",children:e}),h.jsx("p",{className:"text-sm text-textPrimary",children:t})]})}function H2(){const{txid:e}=Af(),t=e??"",{data:n,isLoading:r,error:i}=I2(t),[s,a]=C.useState({}),[o,l]=C.useState({});if(C.useEffect(()=>{a({}),l({})},[n==null?void 0:n.txid]),!e)return h.jsxs("div",{className:"py-10 text-textPrimary",children:[h.jsx("p",{className:"text-textMuted",children:"Transaction ID missing."}),h.jsx(Xe,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Go back"})]});if(r)return h.jsx("div",{className:"py-10 text-textMuted",children:"Loading transaction…"});if(i||!n)return h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Transaction not found"}),h.jsxs("p",{className:"text-textMuted",children:["We could not find a transaction with ID “",t,"”."]}),h.jsx(Xe,{to:"/",className:"text-accent h)DELIM" - R"DELIM(over:text-accentSecondary",children:"Return to dashboard"})]});const u=vi(mi(n.totalOutput)),d=n.totalInput?vi(mi(n.totalInput)):"—",c=n.feeRate?`${Ge(n.feeRate,{maximumFractionDigits:2})} sat/vB`:"—";return h.jsxs("div",{className:"space-y-8",children:[h.jsxs("header",{className:"space-y-2",children:[h.jsx("p",{className:"text-sm uppercase tracking-wide text-accentSecondary",children:"Transaction"}),h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsx("h1",{className:"text-3xl font-semibold text-accent",children:Or(n.txid,24)}),h.jsx("button",{type:"button",onClick:()=>navigator.clipboard.writeText(n.txid),className:"inline-flex items-center gap-2 rounded-md border border-accent/40 px-3 py-1 text-xs font-medium uppercase tracking-wide text-accent hover:border-accent hover:text-accentSecondary",children:"Copy TxID"})]}),h.jsx("p",{className:"text-sm text-textMuted",children:n.receivedTime?`${nu(n.receivedTime)} · ${If(n.receivedTime)}`:"Pending"}),h.jsxs("span",{className:`inline-flex w-fit items-center gap-2 rounded-full px-3 py-1 text-xs font-medium uppercase tracking-wide ${n.status==="confirmed"?"bg-emerald-500/20 text-emerald-300":"bg-amber-500/20 text-amber-300"}`,children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-current","aria-hidden":!0}),n.status]})]}),h.jsxs("section",{className:"grid gap-4 rounded-xl border border-accent/30 bg-surface/80 p-6 text-sm sm:grid-cols-2 lg:grid-cols-3",children:[h.jsx(tn,{label:"Confirmations",value:n.confirmations??0}),h.jsx(tn,{label:"Block height",value:n.blockHeight??"—"}),h.jsx(tn,{label:"Block hash",value:n.blockHash?h.jsx(Xe,{to:`/block/${n.blockHash}`,children:Or(n.blockHash)}):"—"}),h.jsx(tn,{label:"Total output",value:u}),h.jsx(tn,{label:"Total input",value:d}),h.jsx(tn,{label:"Fee",value:Ji(n.feeSats)}),h.jsx(tn,{label:"Fee rate",value:c}),h.jsx(tn,{label:"Size",value:n.size?`${Ge(n.size)} bytes`:"—"}),h.jsx(tn,{label:"Weight units",value:`${Ge(n.weight,{maximumFractionDigits:0})} WU`}),h.jsx(tn,{label:"Version",value:n.version}),h.jsx(tn,{label:"Locktime",value:n.locktime})]}),h.jsxs("section",{className:"grid gap-6 lg:grid-cols-2",children:[h.jsxs("div",{className:"rounded-xl border border-accent/30",children:[h.jsx("header",{className:"border-b border-accentSecondary/30 px-4 py-3",children:h.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-accent",children:"Inputs"})}),h.jsxs("div",{className:"divide-y divide-accentSecondary/30",children:[n.inputs.length===0&&h.jsx("p",{className:"px-4 py-4 text-sm text-textMuted",children:"No inputs (coinbase transaction)"}),n.inputs.map(f=>{var T,v;const m=V2(f),g=W2(f),x=!!s[m];return h.jsxs("div",{className:"px-4 py-3 text-sm",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsx("p",{className:"font-mono text-xs text-textPrimary",children:f.isCoinbase?"Coinbase":f.prevTxId?h.jsx(Xe,{to:`/tx/${f.prevTxId}`,className:"text-accent hover:text-accentSecondary",children:Or(f.prevTxId,16)}):"—"}),g&&h.jsx("button",{type:"button",onClick:()=>a(p=>({...p,[m]:!p[m]})),className:"inline-flex items-center gap-1 rounded-md border border-accent/40 px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-accent hover:border-accent hover:text-accentSecondary",children:x?"Hide details":"Show details"})]}),h.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-3 text-xs text-textMuted",children:[h.jsxs("span",{children:["Input #",f.index]}),typeof f.prevOutputIndex=="number"&&h.jsxs("span",{children:["Prevout ",f.prevOutputIndex]}),f.address&&h.jsx(Xe,{to:`/address/${f.address}`,className:"text-accent hover:text-accentSecondary",children:f.address}),f.valueSats&&h.jsx("span",{children:Ji(f.valueSats)}),f.scriptType&&h.jsx("span",{children:f.scriptType})]}),x&&h.jsxs("div",{className:"mt-3 space-y-3 rounded-lg border border-accent/20 bg-surface/60 p-3 text-xs",children:[((T=f.script)==null?void 0:T.hex)&&h.jsx(Ws,{label:"Script (hex)",value:f.script.hex}),((v=f.script)==null?void 0:v.mnemonic)&&h.jsx(Ws,{label:"Script (mnemonic)",value:f.script.mnemonic}),f.witness&&f.witness.length>0&&h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-wide text-accentSecondary",children:"Witness"}),h.jsx("div",{className:"space-y-1",children:f.witness.map((p,y)=>h.jsx("code",{className:"block break-all rounded bg-black/30 px-2 py-1 font-mono text-[11px] text-textMuted",children:p},`${m}-witness-${y}`))})]}),typeof f.sequence=="number"&&h.jsx(Ws,{label:"Sequence",value:`0x${f.sequence.toString(16).toUpperCase()}`})]})]},m)})]})]}),h.jsxs("div",{className:"rounded-xl border border-accent/30",children:[h.jsx("header",{className:"border-b border-accentSecondary/30 px-4 py-3",children:h.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-accent",children:"Outputs"})}),h.jsx("div",{className:"divide-y divide-accentSecondary/30",children:n.outputs.map(f=>{var T,v;const m=Q2(f),g=Z2(f),x=!)DELIM" - R"DELIM(!o[m];return h.jsxs("div",{className:"px-4 py-3 text-sm",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsx("p",{className:"text-xs text-textMuted",children:f.address?h.jsx(Xe,{to:`/address/${f.address}`,className:"text-accent hover:text-accentSecondary",children:f.address}):"Unknown"}),h.jsx("p",{className:"font-medium text-textPrimary",children:Ji(f.valueSats)})]}),h.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-3 text-xs text-textMuted",children:[h.jsxs("span",{children:["Index ",f.index]}),f.scriptType&&h.jsx("span",{children:f.scriptType}),typeof f.spent=="boolean"&&h.jsx("span",{children:f.spent?"Spent":"Unspent"})]}),g&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>l(p=>({...p,[m]:!p[m]})),className:"mt-3 inline-flex items-center gap-1 rounded-md border border-accent/40 px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-accent hover:border-accent hover:text-accentSecondary",children:x?"Hide details":"Show details"}),x&&h.jsxs("div",{className:"mt-3 space-y-3 rounded-lg border border-accent/20 bg-surface/60 p-3 text-xs",children:[((T=f.script)==null?void 0:T.hex)&&h.jsx(Ws,{label:"Script (hex)",value:f.script.hex}),((v=f.script)==null?void 0:v.mnemonic)&&h.jsx(Ws,{label:"Script (mnemonic)",value:f.script.mnemonic})]})]})]},m)})})]})]})]})}function tn({label:e,value:t}){return h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-xs uppercase tracking-wide text-accentSecondary",children:e}),h.jsx("p",{className:"text-sm text-textPrimary",children:t})]})}function V2(e){return`${e.prevTxId??"coinbase"}-${e.index}`}function Q2(e){return`output-${e.index}`}function W2(e){return!!(e.script&&(e.script.hex||e.script.mnemonic)||e.witness&&e.witness.length>0||typeof e.sequence=="number")}function Z2(e){return!!(e.script&&(e.script.hex||e.script.mnemonic))}function Ws({label:e,value:t}){return h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-wide text-accentSecondary",children:e}),h.jsx("code",{className:"block break-all rounded bg-black/30 px-2 py-1 font-mono text-[11px] text-textMuted",children:t})]})}var ru={},Zg={exports:{}},K2="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",G2=K2,q2=G2;function Kg(){}function Gg(){}Gg.resetWarningCache=Kg;var Y2=function(){function e(r,i,s,a,o,l){if(l!==q2){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Gg,resetWarningCache:Kg};return n.PropTypes=n,n};Zg.exports=Y2();var qg=Zg.exports,Yg={L:1,M:0,Q:3,H:2},Xg={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},X2=Xg;function Jg(e){this.mode=X2.MODE_8BIT_BYTE,this.data=e}Jg.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t>>7-e%8&1)==1},put:function(e,t){for(var n=0;n>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var t4=e0,un={glog:function(e){if(e<1)throw new Error("glog("+e+")");return un.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return un.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var at=0;at<8;at++)un.EXP_TABLE[at]=1<=0;)t^=it.G15<=0;)t^=it.G18<>>=1;return t},getPatternPosition:function(e){return it.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case ir.PATTERN000:return(t+n)%2==0;case ir.PATTERN001:return t%2==0;case ir.PATTERN010:return n%3==0;case ir.PATTERN011:return(t+n)%3==0;case ir.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case ir.PATTERN101:return t*n%2+t*n%3==0;case ir.PATTERN110:return(t*n%2+t*n%3)%2==0;case ir.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error(")DELIM" - R"DELIM(bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new ym([1],0),n=0;n5&&(n+=3+s-5)}for(var r=0;r=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=En.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)};Ft.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[e+n][t+r]=!0:this.modules[e+n][t+r]=!1)};Ft.getBestMaskPattern=function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=Vr.getLostPoint(this);(n==0||e>r)&&(e=r,t=n)}return t};Ft.createMovieClip=function(e,t,n){var r=e.createEmptyMovieClip(t,n),i=1;this.make();for(var s=0;s>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!e&&(t>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}};Ft.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=Vr.getBCHTypeInfo(n),i=0;i<15;i++){var s=!e&&(r>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(r>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[)DELIM" - R"DELIM(8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e};Ft.mapData=function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var o=0;o<2;o++)if(this.modules[r][a-o]==null){var l=!1;s>>i&1)==1);var u=Vr.getMask(t,r,a-o);u&&(l=!l),this.modules[r][a-o]=l,i--,i==-1&&(s++,i=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}};En.PAD0=236;En.PAD1=17;En.createData=function(e,t,n){for(var r=r0.getRSBlocks(e,t),i=new i0,s=0;so*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+o*8+")");for(i.getLengthInBits()+4<=o*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=o*8||(i.put(En.PAD0,8),i.getLengthInBits()>=o*8));)i.put(En.PAD1,8);return En.createBytes(i,r)};En.createBytes=function(e,t){for(var n=0,r=0,i=0,s=new Array(t.length),a=new Array(t.length),o=0;o=0?m.get(g):0}}for(var x=0,d=0;d=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var c4={bgColor:Bt.default.oneOfType([Bt.default.object,Bt.default.string]).isRequired,bgD:Bt.default.string.isRequired,fgColor:Bt.default.oneOfType([Bt.default.object,Bt.default.string]).isRequired,fgD:Bt.default.string.isRequired,size:Bt.default.number.isRequired,title:Bt.default.string,viewBoxSize:Bt.default.number.isRequired,xmlns:Bt.default.string},Ff=(0,s0.forwardRef)(function(e,t){var n=e.bgColor,r=e.bgD,i=e.fgD,s=e.fgColor,a=e.size,o=e.title,l=e.viewBoxSize,u=e.xmlns,d=u===void 0?"http://www.w3.org/2000/svg":u,c=u4(e,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return jo.default.createElement("svg",o4({},c,{height:a,ref:t,viewBox:"0 0 "+l+" "+l,width:a,xmlns:d}),o?jo.default.createElement("title",null,o):null,jo.default.createElement("path",{d:r,fill:n}),jo.default.createElement("path",{d:i,fill:s}))});Ff.displayName="QRCodeSvg";Ff.propTypes=c4;$f.default=Ff;Object.defineProperty(ru,"__esModule",{value:!0});ru.QRCode=void 0;var d4=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var k4={bgColor:Mn.default.oneOfType([Mn.default.object,Mn.default.string]),fgColor:Mn.default.oneOfType([Mn.default.object,Mn.default.string]),level:Mn.default.string,size:Mn.default.number,value:Mn.default.string.isRequired},iu=(0,o0.forwardRef)(function(e,t){var n=e.bgColor,r=n===void 0?"#FFFFFF":n,i=e.fgColor,s=i===void 0?"#000000":i,a=e.level,o=a===void 0?"L":a,l=e.size,u=l===void 0?256:l,d=e.value,c=w4(e,["bgColor","fgColor","level","size","value"]),f=new v4.default(-1,p4.default[o]);f.addData(d),f.make();var m=f.modules;return y4.default.createElement(x4.default,d4({},c,{bgColor:r,bgD:m.map(function(g,x){return g.map(function(T,v){return T?"":"M "+v+" "+x+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:s,fgD:m.map(function(g,x){return g.map(function(T,v){return T?"M "+v+" "+x+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:t,size:u,viewBoxSize:m.length}))});ru.QRCode=iu;iu.displayName="QRCode";iu.propTypes=k4;var _4=ru.default=iu;function S4({value:e,size:t=128}){return e.trim()?h.jsx("div",{className:"rounded-xl border border-accent/30 bg-surface/60 p-4 shadow-sm",children:h.jsx(_4,{value:e,size:t,style:{height:"auto",maxWidth:"100%",width:"100%"},bgColor:"transparent",fgColor:"#ffa022",level:"Q"})}):null}function E4(){const{address:e}=Af(),t=e??"",{data:n,isLoading:r,error:i}=$2(t),s=qn(),[a,o]=C.useState([]),[l,u]=C.useState(null),[d,c]=C.useState(!1),[f,m]=C.useState(!1);C.useEffect(()=>{if(n){o(n.transactions);const p=n.transactions[n.transa)DELIM" - R"DELIM(ctions.length-1];u(p?p.txid:null),m(n.transactions.length<(n.txCount??n.transactions.length))}},[n]);const g=async()=>{if(!(!e||!f||d||!n)){if(!l){m(!1);return}c(!0);try{const p=await s.getAddressTransactions(e,l);if(p.length===0){m(!1);return}o(y=>{const S=new Set(y.map(k=>k.txid)),R=[...y];if(p.forEach(k=>{S.has(k.txid)||R.push(k)}),R.length===y.length)return m(!1),y;const L=R[R.length-1];return u(L?L.txid:null),m(R.length<((n==null?void 0:n.txCount)??R.length)),R})}finally{c(!1)}}};if(!e)return h.jsxs("div",{className:"py-10 text-textPrimary",children:[h.jsx("p",{className:"text-textMuted",children:"Address missing."}),h.jsx(Xe,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Go back"})]});if(r)return h.jsx("div",{className:"py-10 text-textMuted",children:"Loading address…"});if(i||!n)return h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Address not found"}),h.jsxs("p",{className:"text-textMuted",children:["We could not find data for address “",t,"”."]}),h.jsx(Xe,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Return to dashboard"})]});const x=vi(mi(n.balance)),T=vi(mi(n.totalReceived)),v=vi(mi(n.totalSent));return h.jsxs("div",{className:"space-y-8",children:[h.jsxs("header",{className:"space-y-3",children:[h.jsx("p",{className:"text-sm uppercase tracking-wide text-accentSecondary",children:"Address"}),h.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[h.jsx("h1",{className:"break-all text-2xl font-semibold text-accent",children:n.address}),h.jsx("button",{type:"button",onClick:()=>navigator.clipboard.writeText(n.address),className:"inline-flex items-center gap-2 rounded-md border border-accent/40 px-3 py-1 text-xs font-medium uppercase tracking-wide text-accent hover:border-accent hover:text-accentSecondary",children:"Copy address"})]})]}),h.jsxs("section",{className:"grid gap-6 lg:grid-cols-[minmax(0,1fr)_auto]",children:[h.jsxs("div",{className:"grid gap-4 rounded-xl border border-accent/30 bg-surface/80 p-6 text-sm sm:grid-cols-2 lg:grid-cols-3",children:[h.jsx(Li,{label:"Balance",value:x}),h.jsx(Li,{label:"Total received",value:T}),h.jsx(Li,{label:"Total sent",value:v}),h.jsx(Li,{label:"Transaction count",value:Ge(n.txCount,{maximumFractionDigits:0})}),h.jsx(Li,{label:"UTXO count",value:Ge(n.utxoCount??void 0,{maximumFractionDigits:0})}),h.jsx(Li,{label:"Address type",value:n.addressType??"—"})]}),h.jsx("div",{className:"place-self-start",children:h.jsx(S4,{value:n.address})})]}),h.jsxs("section",{children:[h.jsxs("header",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h2",{className:"text-lg font-semibold text-accent",children:"Recent Transactions"}),h.jsxs("p",{className:"text-sm text-textMuted",children:["Showing ",a.length," entries"]})]}),h.jsx("div",{className:"overflow-hidden rounded-xl border border-accent/30",children:h.jsxs("table",{className:"min-w-full divide-y divide-accentSecondary/30 text-sm",children:[h.jsx("thead",{className:"bg-accentSecondary/20 text-xs uppercase text-textMuted",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-4 py-3 text-left",children:"TxID"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Value change"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Block height"}),h.jsx("th",{className:"px-4 py-3 text-left",children:"Timestamp"})]})}),h.jsxs("tbody",{children:[a.length===0&&h.jsx("tr",{children:h.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-textMuted",children:"No transactions recorded."})}),a.map(p=>h.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Xe,{to:`/tx/${p.txid}`,className:"font-mono text-accent hover:text-accentSecondary",children:Or(p.txid,12)})}),h.jsxs("td",{className:"px-4 py-3 text-right text-textPrimary",children:[p.valueChange>=0?"+":"-",Ji(Math.abs(p.valueChange))]}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:p.blockHeight??"Unconfirmed"}),h.jsx("td",{className:"px-4 py-3 text-textPrimary",children:p.timestamp?If(p.timestamp):"—"})]},`${p.txid}-${p.blockHeight??"mempool"}`))]})]})}),f&&h.jsx("div",{className:"mt-4 flex justify-center",children:h.jsx("button",{type:"button",onClick:g,disabled:d,className:"rounded-md border border-accent px-4 py-2 text-sm font-medium text-accent hover:border-accentSecondary hover:text-accentSecondary disabled:cursor-not-allowed disabled:opacity-60",children:d?"Loading more…":"Load more transactions"})})]})]})}function Li({label:e,value:t}){return h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-xs uppercase tracking-wide text-accentSecondary",children:e}),h.jsx("p",{className:"text-sm text-textPrimary",children:t})]})}const C4=/^[0-9a-f]+$/,T4=/^[0-9a-fA-F]+$/;function b4(e){var r,i;const t=e.trim();if(!t)return{type:"unknown"};if(/^\d+$/.test(t))return{type)DELIM" - R"DELIM(:"block-height",value:t.replace(/^0+/,"")||"0"};if(t.length===64&&T4.test(t)){const s=t.toLowerCase();return(((i=(r=s.match(/^0+/))==null?void 0:r[0])==null?void 0:i.length)??0)>=8&&C4.test(s)?{type:"block-hash",value:s}:{type:"txid",value:s}}return Xl(t)?{type:"address",value:t}:{type:"unknown"}}function P4(){const[e]=b2(),t=e.get("q")??"",n=t.trim(),r=eu(),i=C.useMemo(()=>b4(n),[n]);return C.useEffect(()=>{if(!n||!i||i.type==="unknown")return;const s=i.type==="block-height"?`/block/${i.value}`:i.type==="block-hash"?`/block/${i.value}`:i.type==="txid"?`/tx/${i.value}`:`/address/${i.value}`;r(s,{replace:!0})},[i,r,n]),n?i.type==="unknown"?h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Unrecognized query"}),h.jsxs("p",{className:"text-textMuted",children:["We couldn’t determine whether “",t,"” is a block, transaction, or address."]}),h.jsx("p",{className:"text-sm text-textMuted",children:"Try entering a block height (digits only), a 64-character hash, or a valid base58/bech32 address."}),h.jsx(Xe,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Return to dashboard"})]}):h.jsx("div",{className:"py-10 text-textMuted",children:"Redirecting…"}):h.jsx("div",{className:"py-10 text-textPrimary",children:h.jsx("p",{className:"text-textMuted",children:"Enter a block hash, transaction ID, or address in the search bar."})})}function gm(){const e=Hg(),t=(e==null?void 0:e.message)??"This page could not be found.";return h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Page not found"}),h.jsx("p",{className:"text-textMuted",children:t}),h.jsx(Xe,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Return to dashboard"})]})}const Mo=10;function N4(){const e=qn(),[t,n]=C.useState([]),[r,i]=C.useState(!0),[s,a]=C.useState(!1),[o,l]=C.useState(null),[u,d]=C.useState(!0),[c,f]=C.useState(null);C.useEffect(()=>{let g=!0;return(async()=>{i(!0);try{f(null);const T=await e.getLatestBlocks(Mo);if(!g)return;if(n(T),T.length){const v=T[T.length-1].height;l(v-1),d(T.length===Mo)}else d(!1)}catch(T){if(!g)return;f(T instanceof Error?T.message:"Failed to load blocks")}finally{g&&i(!1)}})(),()=>{g=!1}},[e]);const m=async()=>{if(!(s||!u||o===null)){a(!0);try{f(null);const g=await e.getBlocksBefore(o,Mo);if(g.length===0){d(!1);return}n(T=>{const v=new Set(T.map(y=>y.hash)),p=[...T];return g.forEach(y=>{v.has(y.hash)||p.push(y)}),p});const x=g[g.length-1].height;l(x-1),g.lengthh.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Xe,{to:`/block/${g.hash}`,className:"font-medium text-accent hover:text-accentSecondary",children:Ge(g.height,{maximumFractionDigits:0})})}),h.jsx("td",{className:"px-4 py-3 text-textPrimary",children:h.jsx("span",{className:"font-mono",children:Or(g.hash)})}),h.jsx("td",{className:"px-4 py-3 text-textMuted",children:nu(g.timestamp)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Ge(g.txCount)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:g.size?`${Ge(g.size/1e6,{maximumFractionDigits:2})} MB`:"—"})]},g.hash))]})]})}),u&&!r&&!c&&h.jsx("div",{className:"flex justify-center",children:h.jsx("button",{type:"button",onClick:m,disabled:s,className:"rounded-md border border-accent px-4 py-2 text-sm font-medium text-accent hover:border-accentSecondary)DELIM" - R"DELIM( hover:text-accentSecondary disabled:cursor-not-allowed disabled:opacity-60",children:s?"Loading more…":"Load more blocks"})})]})}const R4=f2(vd(h.jsxs(On,{element:h.jsx(D2,{}),errorElement:h.jsx(gm,{}),children:[h.jsx(On,{index:!0,element:h.jsx(B2,{})}),h.jsx(On,{path:"block",element:h.jsx(N4,{})}),h.jsx(On,{path:"block/:hash",element:h.jsx(U2,{})}),h.jsx(On,{path:"tx/:txid",element:h.jsx(H2,{})}),h.jsx(On,{path:"address/:address",element:h.jsx(E4,{})}),h.jsx(On,{path:"search",element:h.jsx(P4,{})}),h.jsx(On,{path:"*",element:h.jsx(gm,{})})]})));function j4(){return h.jsx(C.Suspense,{fallback:h.jsx("div",{className:"p-6",children:"Loading…"}),children:h.jsx(w2,{router:R4})})}const l0=document.getElementById("root");if(!l0)throw new Error("Root element not found");Ku.createRoot(l0).render(h.jsx(Bm.StrictMode,{children:h.jsx(H_,{children:h.jsx(j4,{})})})); + */function Es(){return Es=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function o2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function l2(e,t){return e.button===0&&(!t||t==="_self")&&!o2(e)}function gd(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function u2(e,t){let n=gd(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const c2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],d2=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],f2="6";try{window.__reactRouterVersion=f2}catch{}function h2(e,t){return _S({basename:void 0,future:Es({},void 0,{v7_prependBasename:!0}),history:Q_({window:void 0}),hydrationData:p2(),routes:e,mapRouteProperties:a2,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function p2(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Es({},t,{errors:m2(t.errors)})),t}function m2(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new jl(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let a=new s(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}const Wg=C.createContext({isTransitioning:!1}),v2=C.createContext(new Map),y2="startTransition",mm=z0[y2],g2="flushSync",vm=X1[g2];function x2(e){mm?mm(e):e()}function Qs(e){vm?vm(e):e()}class w2{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function k2(e){let{fallbackElement:t,router:n,future:r}=e,[i,s]=C.useState(n.state),[a,o]=C.useState(),[l,u]=C.useState({isTransitioning:!1}),[d,c]=C.useState(),[f,m]=C.useState(),[g,x]=C.useState(),T=C.useRef(new Map),{v7_startTransition:v}=r||{},p=C.useCallback(j=>{v?x2(j):j()},[v]),y=C.useCallback((j,W)=>{let{deletedFetchers:P,flushSync:B,viewTransitionOpts:ue}=W;j.fetchers.forEach((Z,F)=>{Z.data!==void 0&&T.current.set(F,Z.data)}),P.forEach(Z=>T.current.delete(Z));let be=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!ue||be){B?Qs(()=>s(j)):p(()=>s(j));return}if(B){Qs(()=>{f&&(d&&d.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:ue.currentLocation,nextLocation:ue.nextLocation})});let Z=n.window.document.startViewTransition(()=>{Qs(()DELIM" + R"DELIM()=>s(j))});Z.finished.finally(()=>{Qs(()=>{c(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),Qs(()=>m(Z));return}f?(d&&d.resolve(),f.skipTransition(),x({state:j,currentLocation:ue.currentLocation,nextLocation:ue.nextLocation})):(o(j),u({isTransitioning:!0,flushSync:!1,currentLocation:ue.currentLocation,nextLocation:ue.nextLocation}))},[n.window,f,d,T,p]);C.useLayoutEffect(()=>n.subscribe(y),[n,y]),C.useEffect(()=>{l.isTransitioning&&!l.flushSync&&c(new w2)},[l]),C.useEffect(()=>{if(d&&a&&n.window){let j=a,W=d.promise,P=n.window.document.startViewTransition(async()=>{p(()=>s(j)),await W});P.finished.finally(()=>{c(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(P)}},[p,a,d,n.window]),C.useEffect(()=>{d&&a&&i.location.key===a.location.key&&d.resolve()},[d,f,i.location,a]),C.useEffect(()=>{!l.isTransitioning&&g&&(o(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),x(void 0))},[l.isTransitioning,g]),C.useEffect(()=>{},[]);let S=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:j=>n.navigate(j),push:(j,W,P)=>n.navigate(j,{state:W,preventScrollReset:P==null?void 0:P.preventScrollReset}),replace:(j,W,P)=>n.navigate(j,{replace:!0,state:W,preventScrollReset:P==null?void 0:P.preventScrollReset})}),[n]),R=n.basename||"/",L=C.useMemo(()=>({router:n,navigator:S,static:!1,basename:R}),[n,S,R]),k=C.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return C.useEffect(()=>r2(r,n.future),[r,n.future]),C.createElement(C.Fragment,null,C.createElement(qa.Provider,{value:L},C.createElement(Df.Provider,{value:i},C.createElement(v2.Provider,{value:T.current},C.createElement(Wg.Provider,{value:l},C.createElement(s2,{basename:R,location:i.location,navigationType:i.historyAction,navigator:S,future:k},i.initialized||n.future.v7_partialHydration?C.createElement(_2,{routes:n.routes,future:n.future,state:i}):t))))),null)}const _2=C.memo(S2);function S2(e){let{routes:t,future:n,state:r}=e;return WS(t,void 0,r,n)}const E2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",C2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ye=C.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:o,target:l,to:u,preventScrollReset:d,viewTransition:c}=t,f=Qg(t,c2),{basename:m}=C.useContext(Hr),g,x=!1;if(typeof u=="string"&&C2.test(u)&&(g=u,E2))try{let y=new URL(window.location.href),S=u.startsWith("//")?new URL(y.protocol+u):new URL(u),R=Kn(S.pathname,m);S.origin===y.origin&&R!=null?u=R+S.search+S.hash:x=!0}catch{}let T=US(u,{relative:i}),v=b2(u,{replace:a,state:o,target:l,preventScrollReset:d,relative:i,viewTransition:c});function p(y){r&&r(y),y.defaultPrevented||v(y)}return C.createElement("a",Es({},f,{href:g||T,onClick:x||s?r:p,ref:n,target:l}))}),Zu=C.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:a=!1,style:o,to:l,viewTransition:u,children:d}=t,c=Qg(t,d2),f=tu(l,{relative:c.relative}),m=Ns(),g=C.useContext(Df),{navigator:x,basename:T}=C.useContext(Hr),v=g!=null&&P2(f)&&u===!0,p=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,y=m.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(y=y.toLowerCase(),S=S?S.toLowerCase():null,p=p.toLowerCase()),S&&T&&(S=Kn(S,T)||S);const R=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let L=y===p||!a&&y.startsWith(p)&&y.charAt(R)==="/",k=S!=null&&(S===p||!a&&S.startsWith(p)&&S.charAt(p.length)==="/"),j={isActive:L,isPending:k,isTransitioning:v},W=L?r:void 0,P;typeof s=="function"?P=s(j):P=[s,L?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(j):o;return C.createElement(Ye,Es({},c,{"aria-current":W,className:P,ref:n,style:B,to:l,viewTransition:u}),typeof d=="function"?d(j):d)});var xd;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(xd||(xd={}));var ym;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ym||(ym={}));function T2(e){let t=C.useContext(qa);return t||le(!1),t}function b2(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:o}=t===void 0?{}:t,l=eu(),u=Ns(),d=tu(e,{relative:a});return C.useCallback(c=>{if(l2(c,n)){c.preventDefault();let f=r!==void 0?r:Ci(u)===Ci(d);l(e,{replace:f,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[u,l,d,r,i,n,e,s,a,o])}function N2(e){let t=C.useRef(gd(e)),n=C.useRef(!1),r=Ns(),i=C.useMemo(()=>u2(r.search,n.current?null:t.current),[r.search]),s=eu(),a=C.useCallback((o,l)=>{const u=gd(typeof o=="function"?o(i):o);n.current=!0,s("?"+u,l)},[s,i]);return[i,a]}function P2(e,t){t===void 0&&(t={});let n=C.useContext(Wg);n==null&&le(!1);let{basename:r}=T2(xd.useViewTransitionState),i=tu(e,{relativ)DELIM" + R"DELIM(e:t.relative});if(!n.isTransitioning)return!1;let s=Kn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Kn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Rl(i.pathname,a)!=null||Rl(i.pathname,s)!=null}function R2({title:e,titleId:t,...n},r){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?C.createElement("title",{id:t},e):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const j2=C.forwardRef(R2);function M2(){const[e,t]=C.useState(""),n=eu(),r=i=>{i.preventDefault();const s=e.trim();s&&n({pathname:"/search",search:`?q=${encodeURIComponent(s)}`})};return h.jsxs("form",{onSubmit:r,className:"flex w-full items-center gap-2 rounded-xl border border-accent/30 bg-surface/80 px-3 py-2 text-sm shadow-inner md:w-auto",children:[h.jsx(j2,{className:"h-4 w-4 text-accent","aria-hidden":"true"}),h.jsx("input",{type:"search",placeholder:"Search blocks, transactions, addresses",className:"w-full bg-transparent text-textPrimary placeholder:text-textMuted focus:outline-none md:w-72",value:e,onChange:i=>t(i.target.value)})]})}const L2={connected:"bg-emerald-500/20 text-emerald-300 border-emerald-500/50",degraded:"bg-amber-500/20 text-amber-300 border-amber-500/50",offline:"bg-rose-500/20 text-rose-300 border-rose-500/50",unknown:"bg-slate-500/20 text-slate-300 border-slate-500/50"},O2={connected:"bg-emerald-400",degraded:"bg-amber-400",offline:"bg-rose-400",unknown:"bg-slate-400"};function D2({status:e,label:t,title:n}){return h.jsxs("span",{title:n,className:`flex items-center gap-2 rounded-full border px-3 py-1 text-xs font-medium uppercase tracking-wide ${L2[e]}`,children:[h.jsx("span",{className:`h-2 w-2 rounded-full ${O2[e]}`,"aria-hidden":"true"}),t]})}function A2(){const e=$_(),{provider:t,setProvider:n,availableProviders:r}=F_(),{turbo:i,setTurbo:s}=z_();return h.jsxs("div",{className:"min-h-screen bg-background text-textPrimary",children:[h.jsx("header",{className:"border-b border-accent/30 bg-surface/90 backdrop-blur",children:h.jsx("div",{className:"mx-auto max-w-7xl px-4 py-4",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[h.jsx(Zu,{to:"/",className:"order-1 text-lg font-semibold tracking-tight text-accent",children:"libbitcoin Explorer"}),h.jsxs("nav",{className:"order-2 hidden items-center gap-3 text-sm text-textMuted md:flex",children:[h.jsx(Zu,{to:"/",className:({isActive:a})=>`rounded-md px-3 py-1 transition text-textMuted hover:text-accent ${a?"bg-accentSecondary/20 text-accent":""}`,end:!0,children:"Dashboard"}),h.jsx(Zu,{to:"/block",className:({isActive:a})=>`rounded-md px-3 py-1 transition text-textMuted hover:text-accent ${a?"bg-accentSecondary/20 text-accent":""}`,children:"Blocks"})]}),h.jsx("div",{className:"order-2 flex-1 min-w-[12rem] md:order-4 md:flex-none",children:h.jsx(M2,{})}),h.jsxs("div",{className:"order-3 flex w-full flex-wrap items-center gap-3 md:order-3 md:w-auto md:flex-nowrap md:ml-auto",children:[h.jsx(D2,{label:e.label,status:e.connectionState,title:e.description}),t==="libbitcoin"&&h.jsxs("label",{className:"flex items-center gap-2 text-xs uppercase tracking-wide text-textMuted",children:[h.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-accent/50 bg-surface/80 text-accent focus:ring-accent",checked:i,onChange:a=>s(a.target.checked)}),"Turbo"]}),h.jsx("select",{value:t,onChange:a=>n(a.target.value),className:"rounded-md border border-accent/40 bg-surface/80 px-2 py-1 text-xs uppercase tracking-wide text-textPrimary hover:border-accent focus:border-accent focus:outline-none",title:"Switch data provider",children:r.map(a=>{const o=a==="libbitcoin"?"server":a;return h.jsx("option",{value:a,children:o},a)})})]})]})})}),h.jsx("main",{className:"mx-auto min-h-[calc(100vh-4rem)] max-w-7xl px-4 py-8",children:h.jsx(i2,{})})]})}function I2(e=10){const t=qn();return ql({queryKey:["blocks","latest",{limit:e}],queryFn:()=>t.getLatestBlocks(e)})}function Zg(e){const t=qn();return ql({queryKey:["block",e],queryFn:()=>t.getBlock(e)})}function $2(e){const t=qn();return ql({queryKey:["transaction",e],queryFn:()=>t.getTransaction(e)})}function F2(e){const t=qn();return ql({queryKey:["address",e],queryFn:()=>t.getAddress(e)})}function z2(e){const t=qn();C.useEffect(()=>{const n=t.subscribeToEvents(e);return()=>n()},[t,e])}function B2(e=10){const t=eg(),{data:n,...r}=I2(e);C.useEffect(()=>{t.getQueryData(["transactions","recent"])||t.setQueryData(["transactions","recent"],[])},[t]);const i=C.useCallback(a=>{a.type==="block.new"&&t.setQueryData(["blocks","latest",{limit:e}],(o=[])=>[a.payload,...o.filter(u=>u.hash!==a.payload.hash)].slice(0,e)),a.type==="tx.new"&&t.setQueryData(["transactions","recent"],(o=[])=>[a.payload,...o.filter(u=>u.txid!==a.payload.)DELIM" + R"DELIM(txid)].slice(0,e*2))},[e,t]);z2(i);const s=t.getQueryData(["transactions","recent"]);return{data:n,recentTransactions:s,...r}}function Xe(e,t={}){return e==null?"—":new Intl.NumberFormat("en-US",{maximumFractionDigits:2,...t}).format(e)}function U2(e,t=8){return e?e.length<=t*2?e:`${e.slice(0,t)}…${e.slice(-t)}`:"—"}function mi(e){if(e!=null)return e/1e8}function Ji(e){return e==null?"—":`${Xe(e)} sats`}function vi(e){return e==null?"—":`${Xe(e,{minimumFractionDigits:8,maximumFractionDigits:8})} BTC`}function $f(e){return e?new Date(e*1e3).toLocaleString():"—"}function nu(e){if(!e)return"—";const t=new Intl.RelativeTimeFormat("en",{numeric:"auto"}),n=Date.now(),r=Math.round((e*1e3-n)/1e3);if(Math.abs(r)<60)return t.format(r,"second");const s=Math.round(r/60);if(Math.abs(s)<60)return t.format(s,"minute");const a=Math.round(s/60);if(Math.abs(a)<24)return t.format(a,"hour");const o=Math.round(a/24);return t.format(o,"day")}function Ku(e){return e==null?"—":`0x${e.toString(16)}`}function Or({value:e,truncate:t=8,className:n}){return h.jsxs("span",{className:n,children:[h.jsx("span",{className:"inline md:hidden",children:U2(e,t)}),h.jsx("span",{className:"hidden md:inline break-all",children:e})]})}function H2(){const{data:e,isLoading:t,recentTransactions:n}=B2(8),{data:r,isLoading:i}=Zg("latest"),s=C.useMemo(()=>{var a;return n!=null&&n.length?n.slice(0,10):(a=r==null?void 0:r.transactions)!=null&&a.length?r.transactions.slice(0,10):[]},[r,n]);return h.jsxs("div",{className:"flex flex-col gap-10",children:[h.jsxs("section",{children:[h.jsx("header",{className:"mb-4 flex items-center justify-between",children:h.jsx("h2",{className:"text-lg font-semibold text-accent",children:"Latest Blocks"})}),h.jsx("div",{className:"overflow-hidden rounded-xl border border-accent/30",children:h.jsxs("table",{className:"min-w-full divide-y divide-accentSecondary/30 text-sm",children:[h.jsx("thead",{className:"bg-accentSecondary/20 text-xs uppercase text-textMuted",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-4 py-3 text-left",children:"Height"}),h.jsx("th",{className:"px-4 py-3 text-left",children:"Hash"}),h.jsx("th",{className:"px-4 py-3 text-left",children:"Age"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Tx"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Size"})]})}),h.jsxs("tbody",{children:[t&&h.jsx("tr",{children:h.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-textMuted",children:"Loading latest blocks…"})}),!t&&(e==null?void 0:e.length)===0&&h.jsx("tr",{children:h.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-textMuted",children:"No blocks available."})}),!t&&(e==null?void 0:e.map(a=>h.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Ye,{to:`/block/${a.hash}`,className:"font-medium text-accent hover:text-accentSecondary",children:Xe(a.height,{maximumFractionDigits:0})})}),h.jsx("td",{className:"px-4 py-3 text-textPrimary",children:h.jsx(Or,{value:a.hash,className:"font-mono"})}),h.jsx("td",{className:"px-4 py-3 text-textMuted",children:nu(a.timestamp)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Xe(a.txCount)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:a.size?`${Xe(a.size/1e6,{maximumFractionDigits:2})} MB`:"—"})]},a.hash)))]})]})})]}),h.jsxs("section",{children:[h.jsx("header",{className:"mb-4 flex items-center justify-between",children:h.jsx("h2",{className:"text-lg font-semibold text-accent",children:"Recent Transactions"})}),h.jsx("div",{className:"overflow-hidden rounded-xl border border-accent/30",children:h.jsxs("table",{className:"min-w-full divide-y divide-accentSecondary/30 text-sm",children:[h.jsx("thead",{className:"bg-accentSecondary/20 text-xs uppercase text-textMuted",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-4 py-3 text-left",children:"TxID"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Output"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Fee"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Weight"})]})}),h.jsxs("tbody",{children:[i&&h.jsx("tr",{children:h.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-textMuted",children:"Loading transactions…"})}),!i&&s.length===0&&h.jsx("tr",{children:h.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-textMuted",children:"No transactions available."})}),!i&&s.map(a=>h.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Ye,{to:`/tx/${a.txid}`,className:"font-mono text-accent hover:text-accentSecondary",children:h.jsx(Or,{value:a.txid,truncate:10})})}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:vi(mi(a.totalOutput))}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Ji(a.feeSats)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Xe(a.weight)})]},a.txid))]})]})})]})]})}function V2(){const{hash:e}=If(),)DELIM" + R"DELIM(t=e??"latest",{data:n,isLoading:r,error:i}=Zg(t),s=qn(),[a,o]=C.useState([]),[l,u]=C.useState(!1),[d,c]=C.useState(!1);C.useEffect(()=>{n&&(o(n.transactions??[]),c(!1))},[n]);const f=n?!d&&a.length<(n.txCount??a.length):!1,m=async()=>{if(!(!n||!f||l)){u(!0);try{const g=await s.getBlockTransactions(n.hash,a.length);if(g.length===0){c(!0);return}o(x=>{const T=new Set(x.map(p=>p.txid)),v=[...x];return g.forEach(p=>{T.has(p.txid)||v.push(p)}),v.length===x.length?(c(!0),x):v})}finally{u(!1)}}};return r?h.jsx("div",{className:"py-10 text-textMuted",children:"Loading block details…"}):i||!n?h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Block not found"}),h.jsxs("p",{className:"text-textMuted",children:["We could not find a block matching identifier “",t,"”."]}),h.jsx(Ye,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Return to dashboard"})]}):h.jsxs("div",{className:"space-y-8",children:[h.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm uppercase tracking-wide text-accentSecondary",children:"Block"}),h.jsxs("h1",{className:"text-3xl font-semibold text-accent",children:["#",n.height]}),h.jsx("p",{className:"mt-2 font-mono text-xs text-textPrimary break-all",children:n.hash}),h.jsxs("p",{className:"text-sm text-textMuted",children:[nu(n.timestamp)," · ",$f(n.timestamp)]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[n.previousBlockHash&&h.jsx(Ye,{to:`/block/${n.previousBlockHash}`,className:"rounded-md border border-accent/40 px-3 py-2 text-sm text-textPrimary hover:border-accent hover:text-accent",children:"← Previous"}),n.nextBlockHash&&h.jsx(Ye,{to:`/block/${n.nextBlockHash}`,className:"rounded-md border border-accent/40 px-3 py-2 text-sm text-textPrimary hover:border-accent hover:text-accent",children:"Next →"})]})]}),h.jsxs("section",{className:"grid gap-4 rounded-xl border border-accent/30 bg-surface/80 p-6 text-sm sm:grid-cols-2 lg:grid-cols-3",children:[h.jsx(rr,{label:"Transactions",value:Xe(n.txCount,{maximumFractionDigits:0})}),h.jsx(rr,{label:"Size",value:n.size?`${Xe(n.size/1e6,{maximumFractionDigits:2})} MB`:"—"}),h.jsx(rr,{label:"Weight units",value:n.weight?`${Xe(n.weight,{maximumFractionDigits:0})} WU`:"—"}),h.jsx(rr,{label:"Difficulty",value:Xe(n.difficulty??void 0)}),h.jsx(rr,{label:"Nonce",value:Ku(n.nonce)}),h.jsx(rr,{label:"Bits",value:Ku(n.bits)}),h.jsx(rr,{label:"Version",value:Ku(n.version)}),h.jsx(rr,{label:"Merkle root",value:h.jsx("span",{className:"font-mono text-xs text-textPrimary break-all",children:n.merkleRoot??"—"})})]}),h.jsxs("section",{children:[h.jsxs("header",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h2",{className:"text-lg font-semibold text-accent",children:"Transactions"}),h.jsxs("p",{className:"text-sm text-textMuted",children:["Showing ",a.length," transactions"]})]}),h.jsx("div",{className:"overflow-hidden rounded-xl border border-accent/30",children:h.jsxs("table",{className:"min-w-full divide-y divide-accentSecondary/30 text-sm",children:[h.jsx("thead",{className:"bg-accentSecondary/20 text-xs uppercase text-textMuted",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-4 py-3 text-left",children:"TxID"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Outputs"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Fee"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Size"})]})}),h.jsx("tbody",{children:a.map(g=>h.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Ye,{to:`/tx/${g.txid}`,className:"font-mono text-accent hover:text-accentSecondary",children:h.jsx(Or,{value:g.txid,truncate:12})})}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:vi(mi(g.totalOutput))}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Ji(g.feeSats)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:g.size?`${Xe(g.size)} bytes`:"—"})]},g.txid))})]})}),f&&h.jsx("div",{className:"mt-4 flex justify-center",children:h.jsx("button",{type:"button",onClick:m,disabled:l,className:"rounded-md border border-accent px-4 py-2 text-sm font-medium text-accent hover:border-accentSecondary hover:text-accentSecondary disabled:cursor-not-allowed disabled:opacity-60",children:l?"Loading more…":"Load more transactions"})})]})]})}function rr({label:e,value:t}){return h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-xs uppercase tracking-wide text-accentSecondary",children:e}),h.jsx("p",{className:"text-sm text-textPrimary",children:t})]})}function Q2(){const{txid:e}=If(),t=e??"",{data:n,isLoading:r,error:i}=$2(t),[s,a]=C.useState({}),[o,l]=C.useState({});if(C.useEffect(()=>{a({}),l({})},[n==null?void 0:n.txid]),!e)return h.jsxs("div",{className:"py-10 text-textPrimary",children:[h.jsx("p",{classNa)DELIM" + R"DELIM(me:"text-textMuted",children:"Transaction ID missing."}),h.jsx(Ye,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Go back"})]});if(r)return h.jsx("div",{className:"py-10 text-textMuted",children:"Loading transaction…"});if(i||!n)return h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Transaction not found"}),h.jsxs("p",{className:"text-textMuted",children:["We could not find a transaction with ID “",t,"”."]}),h.jsx(Ye,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Return to dashboard"})]});const u=vi(mi(n.totalOutput)),d=n.totalInput?vi(mi(n.totalInput)):"—",c=n.feeRate?`${Xe(n.feeRate,{maximumFractionDigits:2})} sat/vB`:"—";return h.jsxs("div",{className:"space-y-8",children:[h.jsxs("header",{className:"space-y-2",children:[h.jsx("p",{className:"text-sm uppercase tracking-wide text-accentSecondary",children:"Transaction"}),h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsx("h1",{className:"text-3xl font-semibold text-accent",children:h.jsx(Or,{value:n.txid,truncate:24})}),h.jsx("button",{type:"button",onClick:()=>navigator.clipboard.writeText(n.txid),className:"inline-flex items-center gap-2 rounded-md border border-accent/40 px-3 py-1 text-xs font-medium uppercase tracking-wide text-accent hover:border-accent hover:text-accentSecondary",children:"Copy TxID"})]}),h.jsx("p",{className:"text-sm text-textMuted",children:n.receivedTime?`${nu(n.receivedTime)} · ${$f(n.receivedTime)}`:"Pending"}),h.jsxs("span",{className:`inline-flex w-fit items-center gap-2 rounded-full px-3 py-1 text-xs font-medium uppercase tracking-wide ${n.status==="confirmed"?"bg-emerald-500/20 text-emerald-300":"bg-amber-500/20 text-amber-300"}`,children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-current","aria-hidden":!0}),n.status]})]}),h.jsxs("section",{className:"grid gap-4 rounded-xl border border-accent/30 bg-surface/80 p-6 text-sm sm:grid-cols-2 lg:grid-cols-3",children:[h.jsx(tn,{label:"Confirmations",value:n.confirmations??0}),h.jsx(tn,{label:"Block height",value:n.blockHeight??"—"}),h.jsx(tn,{label:"Block hash",value:n.blockHash?h.jsx(Ye,{to:`/block/${n.blockHash}`,children:h.jsx(Or,{value:n.blockHash})}):"—"}),h.jsx(tn,{label:"Total output",value:u}),h.jsx(tn,{label:"Total input",value:d}),h.jsx(tn,{label:"Fee",value:Ji(n.feeSats)}),h.jsx(tn,{label:"Fee rate",value:c}),h.jsx(tn,{label:"Size",value:n.size?`${Xe(n.size)} bytes`:"—"}),h.jsx(tn,{label:"Weight units",value:`${Xe(n.weight,{maximumFractionDigits:0})} WU`}),h.jsx(tn,{label:"Version",value:n.version}),h.jsx(tn,{label:"Locktime",value:n.locktime})]}),h.jsxs("section",{className:"grid gap-6 lg:grid-cols-2",children:[h.jsxs("div",{className:"rounded-xl border border-accent/30",children:[h.jsx("header",{className:"border-b border-accentSecondary/30 px-4 py-3",children:h.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-accent",children:"Inputs"})}),h.jsxs("div",{className:"divide-y divide-accentSecondary/30",children:[n.inputs.length===0&&h.jsx("p",{className:"px-4 py-4 text-sm text-textMuted",children:"No inputs (coinbase transaction)"}),n.inputs.map(f=>{var T,v;const m=W2(f),g=K2(f),x=!!s[m];return h.jsxs("div",{className:"px-4 py-3 text-sm",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsx("p",{className:"font-mono text-xs text-textPrimary",children:f.isCoinbase?"Coinbase":f.prevTxId?h.jsx(Ye,{to:`/tx/${f.prevTxId}`,className:"text-accent hover:text-accentSecondary",children:h.jsx(Or,{value:f.prevTxId,truncate:16})}):"—"}),g&&h.jsx("button",{type:"button",onClick:()=>a(p=>({...p,[m]:!p[m]})),className:"inline-flex items-center gap-1 rounded-md border border-accent/40 px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-accent hover:border-accent hover:text-accentSecondary",children:x?"Hide details":"Show details"})]}),h.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-3 text-xs text-textMuted",children:[h.jsxs("span",{children:["Input #",f.index]}),typeof f.prevOutputIndex=="number"&&h.jsxs("span",{children:["Prevout ",f.prevOutputIndex]}),f.address&&h.jsx(Ye,{to:`/address/${f.address}`,className:"text-accent hover:text-accentSecondary",children:f.address}),f.valueSats&&h.jsx("span",{children:Ji(f.valueSats)}),f.scriptType&&h.jsx("span",{children:f.scriptType})]}),x&&h.jsxs("div",{className:"mt-3 space-y-3 rounded-lg border border-accent/20 bg-surface/60 p-3 text-xs",children:[((T=f.script)==null?void 0:T.hex)&&h.jsx(Ws,{label:"Script (hex)",value:f.script.hex}),((v=f.script)==null?void 0:v.mnemonic)&&h.jsx(Ws,{label:"Script (mnemonic)",value:f.script.mnemonic}),f.witness&&f.witness.length>0&&h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-wide text-accentSecondary",children:"Witness"}),h.jsx("div",{className:"space-y-1",children:f.witness.map((p,y)=>h.jsx("code",{className:"bl)DELIM" + R"DELIM(ock break-all rounded bg-black/30 px-2 py-1 font-mono text-[11px] text-textMuted",children:p},`${m}-witness-${y}`))})]}),typeof f.sequence=="number"&&h.jsx(Ws,{label:"Sequence",value:`0x${f.sequence.toString(16).toUpperCase()}`})]})]},m)})]})]}),h.jsxs("div",{className:"rounded-xl border border-accent/30",children:[h.jsx("header",{className:"border-b border-accentSecondary/30 px-4 py-3",children:h.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-accent",children:"Outputs"})}),h.jsx("div",{className:"divide-y divide-accentSecondary/30",children:n.outputs.map(f=>{var T,v;const m=Z2(f),g=G2(f),x=!!o[m];return h.jsxs("div",{className:"px-4 py-3 text-sm",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsx("p",{className:"text-xs text-textMuted",children:f.address?h.jsx(Ye,{to:`/address/${f.address}`,className:"text-accent hover:text-accentSecondary",children:f.address}):"Unknown"}),h.jsx("p",{className:"font-medium text-textPrimary",children:Ji(f.valueSats)})]}),h.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-3 text-xs text-textMuted",children:[h.jsxs("span",{children:["Index ",f.index]}),f.scriptType&&h.jsx("span",{children:f.scriptType}),typeof f.spent=="boolean"&&h.jsx("span",{children:f.spent?"Spent":"Unspent"})]}),g&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>l(p=>({...p,[m]:!p[m]})),className:"mt-3 inline-flex items-center gap-1 rounded-md border border-accent/40 px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-accent hover:border-accent hover:text-accentSecondary",children:x?"Hide details":"Show details"}),x&&h.jsxs("div",{className:"mt-3 space-y-3 rounded-lg border border-accent/20 bg-surface/60 p-3 text-xs",children:[((T=f.script)==null?void 0:T.hex)&&h.jsx(Ws,{label:"Script (hex)",value:f.script.hex}),((v=f.script)==null?void 0:v.mnemonic)&&h.jsx(Ws,{label:"Script (mnemonic)",value:f.script.mnemonic})]})]})]},m)})})]})]})]})}function tn({label:e,value:t}){return h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-xs uppercase tracking-wide text-accentSecondary",children:e}),h.jsx("p",{className:"text-sm text-textPrimary",children:t})]})}function W2(e){return`${e.prevTxId??"coinbase"}-${e.index}`}function Z2(e){return`output-${e.index}`}function K2(e){return!!(e.script&&(e.script.hex||e.script.mnemonic)||e.witness&&e.witness.length>0||typeof e.sequence=="number")}function G2(e){return!!(e.script&&(e.script.hex||e.script.mnemonic))}function Ws({label:e,value:t}){return h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-wide text-accentSecondary",children:e}),h.jsx("code",{className:"block break-all rounded bg-black/30 px-2 py-1 font-mono text-[11px] text-textMuted",children:t})]})}var ru={},Kg={exports:{}},q2="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Y2=q2,X2=Y2;function Gg(){}function qg(){}qg.resetWarningCache=Gg;var J2=function(){function e(r,i,s,a,o,l){if(l!==X2){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:qg,resetWarningCache:Gg};return n.PropTypes=n,n};Kg.exports=J2();var Yg=Kg.exports,Xg={L:1,M:0,Q:3,H:2},Jg={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},e4=Jg;function e0(e){this.mode=e4.MODE_8BIT_BYTE,this.data=e}e0.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t>>7-e%8&1)==1},put:function(e,t){for(var n=0;n>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var r4=t0,un={glog:function(e){if(e<1)throw new Error("glog("+e+")");return un.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return un.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var at=0;at<8;at++)un.EXP_TABLE[at]=1<=0;)t^=it.G15<=0;)t^=it.G18<>>=1;return t},getPatternPosition:function(e){return it.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case ir.PATTERN000:return(t+n)%2==0;case ir.PATTERN001:return t%2==0;case ir.PATTERN010:return n%3==0;case ir.PATTERN011:return(t+n)%3==0;case ir.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case ir.PATTERN101:return t*n%2+t*n%3==0;case ir.PATTERN110:return(t*n%2+t*n%3)%2==0;case ir.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new gm([1],0),n=0;n5&&(n+=3+s-5)}for(var r=0;r=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=En.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)};Ft.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[e+n][t+r]=!0:this.modules[e+n][t+r]=!1)};Ft.getBestMaskPattern=function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=Vr.getLostPoint(this);(n==0||e>r)&&(e=r,t=n)}return t};Ft.createMovieClip=function(e,t,n){var r=e.createEmptyMovieClip(t,n),i=1;this.make();for(var s=0;s>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!e&&(t>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}};Ft.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=Vr.getBCHTypeInfo(n),i=0;i<15;i++){var s=!e&&(r>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(r>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e};Ft.mapData=function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var o=0;o<2;o++)if(this.modules[r][a-o]==null){var l=!1;s>>i&1)==1);var u=Vr.getMask(t,r,a-o);u&&(l=!l),this.modules[r][a-o]=l,i--,i==-1&&(s++,i=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}};En.PAD0=236;En.PAD1=17;En.createData=function(e,t,n){for(var r=i0.getRSBlocks(e,t),i=new s0,s=0;so*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+o*8+")");for(i.getLengthInBits()+4<=o*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=o*8||(i.put(En.PAD0,8),i.getLengthInBits()>=o*8));)i.put(En.PAD1,8);return En.createBytes(i,r)};En.createBytes=function(e,t){for(var n=0,r=0,i=0,s=new Array(t.length),a=new Array(t.length),o=0;o=0?m.get(g):0}}for(var x=0,d=0;d=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var f4={bgColor:Bt.default.oneOfType([Bt.default.object,Bt.default.string]).isRequired,bgD:Bt.default.string.isRequired,fgColor:Bt.default.oneOfType([Bt.default.object,Bt.default.string]).isRequired,fgD:Bt.default.string.isRequired,size:Bt.default.number.isRequired,title:Bt.default.string,viewBoxSize:Bt.default.number.isRequired,xmlns:Bt.default.string},zf=(0,a0.forwardRef)(function(e,t){var n=e.bgColor,r=e.bgD,i=e.fgD,s=e.fgColor,a=e.size,o=e.title,l=e.viewBoxSize,u=e.xmlns,d=u===void 0?"http://www.w3.org/2000/svg":u,c=d4(e,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return jo.default.createElement("svg",u4({},c,{height:a,ref:t,viewBox:"0 0 "+l+" "+l,width:a,xmlns:d}),o?jo.default.createElement("title",null,o):null,jo.default.createElement("path",{d:r,fill:n}),jo.default.createElement("path",{d:i,fill:s}))});zf.displayName="QRCodeSvg";zf.propTypes=f4;Ff.default=zf;Object.defineProperty(ru,"__esModule",{value:!0});ru.QRCode=void 0;var h4=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var S4={bgColor:Mn.default.oneOfType([Mn.default.object,Mn.default.string]),fgColor:Mn.default.oneOfType([Mn.default.object,Mn.default.string]),level:Mn.default.string,size:Mn.default.number,value:Mn.default.string.isRequired},iu=(0,l0.forwardRef)(function(e,t){var n=e.bgColor,r=n===void 0?"#FFFFFF":n,i=e.fgColor,s=i===void 0?"#000000":i,a=e.level,o=a===void 0?"L":a,l=e.size,u=l===void 0?256:l,d=e.value,c=_4(e,["bgColor","fgColor","level","size","value"]),f=new g4.default(-1,v4.default[o]);f.addData(d),f.make();var m=f.modules;return x4.default.createElement(k4.default,h4({},c,{bgColor:r,bgD:m.map(function(g,x){return g.map(function(T,v){return T?"":"M "+v+" "+x+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:s,fgD:m.map(function(g,x){return g.map(function(T,v){return T?"M "+v+" "+x+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:t,size:u,vi)DELIM" + R"DELIM(ewBoxSize:m.length}))});ru.QRCode=iu;iu.displayName="QRCode";iu.propTypes=S4;var E4=ru.default=iu;function C4({value:e,size:t=128}){return e.trim()?h.jsx("div",{className:"rounded-xl border border-accent/30 bg-surface/60 p-4 shadow-sm",children:h.jsx(E4,{value:e,size:t,style:{height:"auto",maxWidth:"100%",width:"100%"},bgColor:"transparent",fgColor:"#ffa022",level:"Q"})}):null}function T4(){const{address:e}=If(),t=e??"",{data:n,isLoading:r,error:i}=F2(t),s=qn(),[a,o]=C.useState([]),[l,u]=C.useState(null),[d,c]=C.useState(!1),[f,m]=C.useState(!1);C.useEffect(()=>{if(n){o(n.transactions);const p=n.transactions[n.transactions.length-1];u(p?p.txid:null),m(n.transactions.length<(n.txCount??n.transactions.length))}},[n]);const g=async()=>{if(!(!e||!f||d||!n)){if(!l){m(!1);return}c(!0);try{const p=await s.getAddressTransactions(e,l);if(p.length===0){m(!1);return}o(y=>{const S=new Set(y.map(k=>k.txid)),R=[...y];if(p.forEach(k=>{S.has(k.txid)||R.push(k)}),R.length===y.length)return m(!1),y;const L=R[R.length-1];return u(L?L.txid:null),m(R.length<((n==null?void 0:n.txCount)??R.length)),R})}finally{c(!1)}}};if(!e)return h.jsxs("div",{className:"py-10 text-textPrimary",children:[h.jsx("p",{className:"text-textMuted",children:"Address missing."}),h.jsx(Ye,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Go back"})]});if(r)return h.jsx("div",{className:"py-10 text-textMuted",children:"Loading address…"});if(i||!n)return h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Address not found"}),h.jsxs("p",{className:"text-textMuted",children:["We could not find data for address “",t,"”."]}),h.jsx(Ye,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Return to dashboard"})]});const x=vi(mi(n.balance)),T=vi(mi(n.totalReceived)),v=vi(mi(n.totalSent));return h.jsxs("div",{className:"space-y-8",children:[h.jsxs("header",{className:"space-y-3",children:[h.jsx("p",{className:"text-sm uppercase tracking-wide text-accentSecondary",children:"Address"}),h.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[h.jsx("h1",{className:"break-all text-2xl font-semibold text-accent",children:n.address}),h.jsx("button",{type:"button",onClick:()=>navigator.clipboard.writeText(n.address),className:"inline-flex items-center gap-2 rounded-md border border-accent/40 px-3 py-1 text-xs font-medium uppercase tracking-wide text-accent hover:border-accent hover:text-accentSecondary",children:"Copy address"})]})]}),h.jsxs("section",{className:"grid gap-6 lg:grid-cols-[minmax(0,1fr)_auto]",children:[h.jsxs("div",{className:"grid gap-4 rounded-xl border border-accent/30 bg-surface/80 p-6 text-sm sm:grid-cols-2 lg:grid-cols-3",children:[h.jsx(Li,{label:"Balance",value:x}),h.jsx(Li,{label:"Total received",value:T}),h.jsx(Li,{label:"Total sent",value:v}),h.jsx(Li,{label:"Transaction count",value:Xe(n.txCount,{maximumFractionDigits:0})}),h.jsx(Li,{label:"UTXO count",value:Xe(n.utxoCount??void 0,{maximumFractionDigits:0})}),h.jsx(Li,{label:"Address type",value:n.addressType??"—"})]}),h.jsx("div",{className:"place-self-start",children:h.jsx(C4,{value:n.address})})]}),h.jsxs("section",{children:[h.jsxs("header",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h2",{className:"text-lg font-semibold text-accent",children:"Recent Transactions"}),h.jsxs("p",{className:"text-sm text-textMuted",children:["Showing ",a.length," entries"]})]}),h.jsx("div",{className:"overflow-hidden rounded-xl border border-accent/30",children:h.jsxs("table",{className:"min-w-full divide-y divide-accentSecondary/30 text-sm",children:[h.jsx("thead",{className:"bg-accentSecondary/20 text-xs uppercase text-textMuted",children:h.jsxs("tr",{children:[h.jsx("th",{className:"px-4 py-3 text-left",children:"TxID"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Value change"}),h.jsx("th",{className:"px-4 py-3 text-right",children:"Block height"}),h.jsx("th",{className:"px-4 py-3 text-left",children:"Timestamp"})]})}),h.jsxs("tbody",{children:[a.length===0&&h.jsx("tr",{children:h.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-textMuted",children:"No transactions recorded."})}),a.map(p=>h.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Ye,{to:`/tx/${p.txid}`,className:"font-mono text-accent hover:text-accentSecondary",children:h.jsx(Or,{value:p.txid,truncate:12})})}),h.jsxs("td",{className:"px-4 py-3 text-right text-textPrimary",children:[p.valueChange>=0?"+":"-",Ji(Math.abs(p.valueChange))]}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:p.blockHeight??"Unconfirmed"}),h.jsx("td",{className:"px-4 py-3 text-textPrimary",children:p.timestamp?$f(p.timestamp):"—"})]},`${p.txid}-${p.blockHeight??"mempool"}`))]})]})}),f&&h.jsx("div",{className:"mt-4 flex justify-center",children:h.jsx("button",{type:"button",onCli)DELIM" + R"DELIM(ck:g,disabled:d,className:"rounded-md border border-accent px-4 py-2 text-sm font-medium text-accent hover:border-accentSecondary hover:text-accentSecondary disabled:cursor-not-allowed disabled:opacity-60",children:d?"Loading more…":"Load more transactions"})})]})]})}function Li({label:e,value:t}){return h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-xs uppercase tracking-wide text-accentSecondary",children:e}),h.jsx("p",{className:"text-sm text-textPrimary",children:t})]})}const b4=/^[0-9a-f]+$/,N4=/^[0-9a-fA-F]+$/;function P4(e){var r,i;const t=e.trim();if(!t)return{type:"unknown"};if(/^\d+$/.test(t))return{type:"block-height",value:t.replace(/^0+/,"")||"0"};if(t.length===64&&N4.test(t)){const s=t.toLowerCase();return(((i=(r=s.match(/^0+/))==null?void 0:r[0])==null?void 0:i.length)??0)>=8&&b4.test(s)?{type:"block-hash",value:s}:{type:"txid",value:s}}return Xl(t)?{type:"address",value:t}:{type:"unknown"}}function R4(){const[e]=N2(),t=e.get("q")??"",n=t.trim(),r=eu(),i=C.useMemo(()=>P4(n),[n]);return C.useEffect(()=>{if(!n||!i||i.type==="unknown")return;const s=i.type==="block-height"?`/block/${i.value}`:i.type==="block-hash"?`/block/${i.value}`:i.type==="txid"?`/tx/${i.value}`:`/address/${i.value}`;r(s,{replace:!0})},[i,r,n]),n?i.type==="unknown"?h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Unrecognized query"}),h.jsxs("p",{className:"text-textMuted",children:["We couldn’t determine whether “",t,"” is a block, transaction, or address."]}),h.jsx("p",{className:"text-sm text-textMuted",children:"Try entering a block height (digits only), a 64-character hash, or a valid base58/bech32 address."}),h.jsx(Ye,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Return to dashboard"})]}):h.jsx("div",{className:"py-10 text-textMuted",children:"Redirecting…"}):h.jsx("div",{className:"py-10 text-textPrimary",children:h.jsx("p",{className:"text-textMuted",children:"Enter a block hash, transaction ID, or address in the search bar."})})}function xm(){const e=Vg(),t=(e==null?void 0:e.message)??"This page could not be found.";return h.jsxs("div",{className:"space-y-4 py-10 text-textPrimary",children:[h.jsx("h1",{className:"text-2xl font-semibold text-accent",children:"Page not found"}),h.jsx("p",{className:"text-textMuted",children:t}),h.jsx(Ye,{to:"/",className:"text-accent hover:text-accentSecondary",children:"Return to dashboard"})]})}const Mo=10;function j4(){const e=qn(),[t,n]=C.useState([]),[r,i]=C.useState(!0),[s,a]=C.useState(!1),[o,l]=C.useState(null),[u,d]=C.useState(!0),[c,f]=C.useState(null);C.useEffect(()=>{let g=!0;return(async()=>{i(!0);try{f(null);const T=await e.getLatestBlocks(Mo);if(!g)return;if(n(T),T.length){const v=T[T.length-1].height;l(v-1),d(T.length===Mo)}else d(!1)}catch(T){if(!g)return;f(T instanceof Error?T.message:"Failed to load blocks")}finally{g&&i(!1)}})(),()=>{g=!1}},[e]);const m=async()=>{if(!(s||!u||o===null)){a(!0);try{f(null);const g=await e.getBlocksBefore(o,Mo);if(g.length===0){d(!1);return}n(T=>{const v=new Set(T.map(y=>y.hash)),p=[...T];return g.forEach(y=>{v.has(y.hash)||p.push(y)}),p});const x=g[g.length-1].height;l(x-1),g.lengthh.jsxs("tr",{className:"hover:bg-accentSecondary/10",children:[h.jsx("td",{className:"px-4 py-3",children:h.jsx(Ye,{to:`/block/${g.hash}`,className:"font-medium text-accent hover:text-accentSecondary",children:Xe(g.height,{maximumFractionDigits:0})})}),h.jsx("td",{class)DELIM" + R"DELIM(Name:"px-4 py-3 text-textPrimary",children:h.jsx(Or,{value:g.hash,className:"font-mono"})}),h.jsx("td",{className:"px-4 py-3 text-textMuted",children:nu(g.timestamp)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:Xe(g.txCount)}),h.jsx("td",{className:"px-4 py-3 text-right text-textPrimary",children:g.size?`${Xe(g.size/1e6,{maximumFractionDigits:2})} MB`:"—"})]},g.hash))]})]})}),u&&!r&&!c&&h.jsx("div",{className:"flex justify-center",children:h.jsx("button",{type:"button",onClick:m,disabled:s,className:"rounded-md border border-accent px-4 py-2 text-sm font-medium text-accent hover:border-accentSecondary hover:text-accentSecondary disabled:cursor-not-allowed disabled:opacity-60",children:s?"Loading more…":"Load more blocks"})})]})}const M4=h2(yd(h.jsxs(On,{element:h.jsx(A2,{}),errorElement:h.jsx(xm,{}),children:[h.jsx(On,{index:!0,element:h.jsx(H2,{})}),h.jsx(On,{path:"block",element:h.jsx(j4,{})}),h.jsx(On,{path:"block/:hash",element:h.jsx(V2,{})}),h.jsx(On,{path:"tx/:txid",element:h.jsx(Q2,{})}),h.jsx(On,{path:"address/:address",element:h.jsx(T4,{})}),h.jsx(On,{path:"search",element:h.jsx(R4,{})}),h.jsx(On,{path:"*",element:h.jsx(xm,{})})]})));function L4(){return h.jsx(C.Suspense,{fallback:h.jsx("div",{className:"p-6",children:"Loading…"}),children:h.jsx(k2,{router:M4})})}const u0=document.getElementById("root");if(!u0)throw new Error("Root element not found");Gu.createRoot(u0).render(h.jsx(Um.StrictMode,{children:h.jsx(V_,{children:h.jsx(L4,{})})})); )DELIM" + ) } // namespace server