diff --git a/console/embedded/explore_css.cpp b/console/embedded/explore_css.cpp index 541f925f..3f83f122 100644 --- a/console/embedded/explore_css.cpp +++ b/console/embedded/explore_css.cpp @@ -23,13 +23,15 @@ namespace server { // Simple test css for embedded page, links in font. 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}.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}} + R"DELIM(@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-400:oklch(70.4% .191 22.216);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-out:cubic-bezier(0,0,.2,1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,curr)DELIM" + R"DELIM(entcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--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:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-date-and-time-value{text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;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='oklch(55.1%25 0.027 264.364)' 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}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--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);outline:2px solid #0000}input:where([type=checkbox]):checked,input:whe)DELIM" + R"DELIM(re([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([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){input:where([type=checkbox]):checked{appearance:auto}}input:where([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){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;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");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.relative{position:relative}.static{position:static}.order-1{order:1}.order-2{order:2}.order-3{order:3}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing)*2)}.h-4{height:calc(var(--spacing)*4)}.h-full{height:100%}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing)*2)}.w-4{width:calc(var(--spacing)*4)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-0{max-width:calc(var(--spacing)*0)}.max-w-7xl{max-width:var(--container-7xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing)*0)}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-10{gap:calc(var(--spacing)*10)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-st)DELIM" + R"DELIM(yle);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:#c856374d}.place-self-start{place-self:start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-accent{border-color:#ffa022}.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-accentSecondary\/40{border-color:#c8563766}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500)50%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500)50%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500)50%,transparent)}}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-background{background-color:#272822}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500)20%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500)20%,transparent)}}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-transparent{background-color:#0000}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--)DELIM" + R"DELIM(color-emerald-300)}.text-red-400{color:var(--color-red-400)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-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,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:max-w-\[18rem\]:is(:where(.group):focus-within *){max-width:18rem}.group-focus-within\:translate-x-0:is(:where(.group):focus-within *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:max-w-\[18rem\]:is(:where(.group):hover *){max-width:18rem}.group-hover\:translate-x-0:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-textMuted::placeholder{color:#cfcfcf}.focus-within\:justify-start:focus-within{justify-content:flex-start}.focus-within\:gap-2:focus-within{gap:calc(var(--spacing)*2)}.focus-within\:px-3:focus-within{padding-inline:calc(var(--spacing)*3)}@media(hover:hover){.hover\:justify-start:hover{justify-content:flex-start}.hover\:gap-2:hover{gap:calc(var(--spacing)*2)}.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:px-3:hover{padding-inline:calc(var(--spacing)*3)}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-60:disabled{opacity:.6}@media(prefers-reduced-motion:no-preference){.motion-safe\:-translate-x-1{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.motion-safe\:transition-\[max-width\,opacity\,transform\]{transition-property:max-width,opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:transition-\[padding\,gap\]{transition-property:padding,gap;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}.motion-safe\:ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@media(min-width:40rem){.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:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-72{width:calc(var(--spacing)*72)}.md\:w-auto{width:auto}.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0)DELIM" + R"DELIM(,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}}}:root{color-scheme:dark}body{font-family:var(--font-sans);color:#ededed;background-color:#272822}::selection{color:#272822;background-color:#ffa022}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false} )DELIM" + ) } // namespace server diff --git a/console/embedded/explore_ecma.cpp b/console/embedded/explore_ecma.cpp index 12e7e121..2af1c0fc 100644 --- a/console/embedded/explore_ecma.cpp +++ b/console/embedded/explore_ecma.cpp @@ -23,156 +23,136 @@ namespace server { // Simple test ecma script for embedded page. DEFINE_EMBEDDED_PAGE(explore_pages, char, ecma, - 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 - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ua=Symbol.for("react.element"),C0=Symbol.for("react.portal"),T0=Symbol.for("react.fragment"),b0=Symbol.for("react.strict_mode"),N0=Symbol.for("react.profiler"),P0=Symbol.for("react.provider"),R0=Symbol.for("react.context"),j0=Symbol.for("react.forward_ref"),M0=Symbol.for("react.suspense"),L0=Symbol.for("react.memo"),O0=Symbol.for("react.lazy"),eh=Symbol.iterator;function D0(e){return e===null||typeof e!="object"?null:(e=eh&&e[eh]||e["@@iterator"],typeof e=="function"?e:null)}var Om={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dm=Object.assign,Am={};function Cs(e,t,n){this.props=e,this.context=t,this.refs=Am,this.updater=n||Om}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 Im(){}Im.prototype=Cs.prototype;function kd(e,t,n){this.props=e,this.context=t,this.refs=Am,this.updater=n||Om}var _d=kd.prototype=new Im;_d.constructor=kd;Dm(_d,Cs.prototype);_d.isPureReactComponent=!0;var th=Array.isArray,$m=Object.prototype.hasOwnProperty,Sd={current:null},Fm={key:!0,ref:!0,__self:!0,__source:!0};function zm(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)$m.call(t,r)&&!Fm.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,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 - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var K0=C,Dt=Z0;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"),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 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,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. - * - * This source code is licensed under the MIT license found in the - * 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 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. - * - * This source code is licensed under the MIT license found in the - * 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=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. - * - * This source code is licensed under the MIT license found in the - * 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 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" + R"DELIM(function jx(t,a){for(var i=0;io[u]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(u){if(u.ep)return;u.ep=!0;const c=i(u);fetch(u.href,c)}})();function Jl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Sf={exports:{}},zl={};var Yy;function kx(){if(Yy)return zl;Yy=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(o,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var h in u)h!=="key"&&(c[h]=u[h])}else c=u;return u=c.ref,{$$typeof:t,type:o,key:d,ref:u!==void 0?u:null,props:c}}return zl.Fragment=a,zl.jsx=i,zl.jsxs=i,zl}var Gy;function Lx(){return Gy||(Gy=1,Sf.exports=kx()),Sf.exports}var S=Lx(),_f={exports:{}},ze={};var Py;function Bx(){if(Py)return ze;Py=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function _(T){return T===null||typeof T!="object"?null:(T=b&&T[b]||T["@@iterator"],typeof T=="function"?T:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,B={};function D(T,Z,W){this.props=T,this.context=Z,this.refs=B,this.updater=W||E}D.prototype.isReactComponent={},D.prototype.setState=function(T,Z){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,Z,"setState")},D.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function Q(){}Q.prototype=D.prototype;function X(T,Z,W){this.props=T,this.context=Z,this.refs=B,this.updater=W||E}var se=X.prototype=new Q;se.constructor=X,A(se,D.prototype),se.isPureReactComponent=!0;var ue=Array.isArray;function me(){}var C={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function ie(T,Z,W){var re=W.ref;return{$$typeof:t,type:T,key:Z,ref:re!==void 0?re:null,props:W}}function V(T,Z){return ie(T.type,Z,T.props)}function ee(T){return typeof T=="object"&&T!==null&&T.$$typeof===t}function _e(T){var Z={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(W){return Z[W]})}var Oe=/\/+/g;function ne(T,Z){return typeof T=="object"&&T!==null&&T.key!=null?_e(""+T.key):Z.toString(36)}function J(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(me,me):(T.status="pending",T.then(function(Z){T.status==="pending"&&(T.status="fulfilled",T.value=Z)},function(Z){T.status==="pending"&&(T.status="rejected",T.reason=Z)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function w(T,Z,W,re,he){var we=typeof T;(we==="undefined"||we==="boolean")&&(T=null);var Re=!1;if(T===null)Re=!0;else switch(we){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(T.$$typeof){case t:case a:Re=!0;break;case g:return Re=T._init,w(Re(T._payload),Z,W,re,he)}}if(Re)return he=he(T),Re=re===""?"."+ne(T,0):re,ue(he)?(W="",Re!=null&&(W=Re.replace(Oe,"$&/")+"/"),w(he,Z,W,"",function(ct){return ct})):he!=null&&(ee(he)&&(he=V(he,W+(he.key==null||T&&T.key===he.key?"":(""+he.key).replace(Oe,"$&/")+"/")+Re)),Z.push(he)),1;Re=0;var Ie=re===""?".":re+":";if(ue(T))for(var Ge=0;Ge>>1,le=w[ae];if(0>>1;aeu(W,L))reu(he,W)?(w[ae]=he,w[)DELIM" + R"DELIM(re]=L,ae=re):(w[ae]=W,w[Z]=L,ae=Z);else if(reu(he,L))w[ae]=he,w[re]=L,ae=re;else break e}}return k}function u(w,k){var L=w.sortIndex-k.sortIndex;return L!==0?L:w.id-k.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();t.unstable_now=function(){return d.now()-h}}var p=[],m=[],g=1,v=null,b=3,_=!1,E=!1,A=!1,B=!1,D=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function se(w){for(var k=i(m);k!==null;){if(k.callback===null)o(m);else if(k.startTime<=w)o(m),k.sortIndex=k.expirationTime,a(p,k);else break;k=i(m)}}function ue(w){if(A=!1,se(w),!E)if(i(p)!==null)E=!0,me||(me=!0,_e());else{var k=i(m);k!==null&&J(ue,k.startTime-w)}}var me=!1,C=-1,I=5,ie=-1;function V(){return B?!0:!(t.unstable_now()-iew&&V());){var ae=v.callback;if(typeof ae=="function"){v.callback=null,b=v.priorityLevel;var le=ae(v.expirationTime<=w);if(w=t.unstable_now(),typeof le=="function"){v.callback=le,se(w),k=!0;break t}v===i(p)&&o(p),se(w)}else o(p);v=i(p)}if(v!==null)k=!0;else{var T=i(m);T!==null&&J(ue,T.startTime-w),k=!1}}break e}finally{v=null,b=L,_=!1}k=void 0}}finally{k?_e():me=!1}}}var _e;if(typeof X=="function")_e=function(){X(ee)};else if(typeof MessageChannel<"u"){var Oe=new MessageChannel,ne=Oe.port2;Oe.port1.onmessage=ee,_e=function(){ne.postMessage(null)}}else _e=function(){D(ee,0)};function J(w,k){C=D(function(){w(t.unstable_now())},k)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(w){w.callback=null},t.unstable_forceFrameRate=function(w){0>w||125ae?(w.sortIndex=L,a(m,w),i(p)===null&&w===i(m)&&(A?(Q(C),C=-1):A=!0,J(ue,L-ae))):(w.sortIndex=le,a(p,w),E||_||(E=!0,me||(me=!0,_e()))),w},t.unstable_shouldYield=V,t.unstable_wrapCallback=function(w){var k=b;return function(){var L=b;b=k;try{return w.apply(this,arguments)}finally{b=L}}}})(Tf)),Tf}var Ky;function $x(){return Ky||(Ky=1,Ef.exports=Hx()),Ef.exports}var zf={exports:{}},$t={};var Fy;function Zx(){if(Fy)return $t;Fy=1;var t=Il();function a(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),zf.exports=Zx(),zf.exports}var Iy;function qx(){if(Iy)return Rl;Iy=1;var t=$x(),a=Il(),i=$g();function o(e){var n="https://react.dev/errors/"+e;if(1le||(e.current=ae[le],ae[le]=null,le--)}function W(e,n){le++,ae[le]=e.current,e.current=n}var re=T(null),he=T(null),we=T(null),Re=T(null);function Ie(e,n){switch(W(we,n),W(he,e),W(re,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?hy(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=hy(n),e=my(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Z(re),W(re,e)}function Ge(){Z(re),Z(he),Z(we)}function ct(e){e.memoizedState!==null&&W(Re,e);var n=re.current,r=my(n,e.type);n!==r&&(W(he,e),W(re,r))}function qt(e){he.current===e&&(Z(re),Z(he)),Re.current===e&&(Z(Re),_l._currentValue=L)}var et,Pt;function Zn(e){if(et===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);et=n&&n[1]||"",Pt=-1)":-1s||R[l]!==H[s]){var G=` +`+R[l].replace(" at new "," at ");return e.displayName&&G.includes("")&&(G=G.replace("",e.displayName)),G}while(1<=l&&0<=s);break}}}finally{Ni=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Zn(r):""}function us(e,n){switch(e.tag){case 26:case 27:case 5:return Zn(e.type);case 16:return Zn("Lazy");case 13:return e.child!==n&&n!==null?Zn("Suspense Fallback"):Zn("Suspense");case 19:return Zn("SuspenseList");case 0:case 15:return Mn(e.type,!1);case 11:return Mn(e.type.render,!1);case 1:return Mn(e.type,!0);case 31:return Zn("Activity");default:return""}}function uo(e){try{var n="",r=null;do n+=us(e,r),r=e,e=e.return;while(e);return n}catch(l){return` +Error generating stack: `+l.message+` +`+l.stack}}var Hr=Object.prototype.hasOwnProperty,Di=t.unstable_scheduleCallback,ji=t.unstable_cancelCallback,ss=t.unstable_shouldYield,cs=t.unstable_requestPaint,yt=t.unstable_now,rr=t.unstable_getCurrentPriorityLevel,ki=t.unstable_ImmediatePriority,$r=t.unstable_UserBlockingPriority,Vt=t.unstable_NormalPriority,Cn=t.unstable_LowPriority,Li=t.unstable_IdlePriority,fs=t.log,Bi=t.unstable_setDisableYieldValue,ir=null,ot=null;function Nn(e){if(typeof fs=="function"&&Bi(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(ir,e)}catch{}}var Ht=Math.clz32?Math.clz32:co,so=Math.log,ds=Math.LN2;function co(e){return e>>>=0,e===0?32:31-(so(e)/ds|0)|0}var Jn=256,lr=262144,Sa=4194304;function In(e){var n=e&42;if(n!==0)return n;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function or(e,n,r){var l=e.pendingLanes;if(l===0)return 0;var s=0,f=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~f,l!==0?s=In(l):(y&=x,y!==0?s=In(y):r||(r=x&~e,r!==0&&(s=In(r))))):(x=l&~f,x!==0?s=In(x):y!==0?s=In(y):r||(r=l&~e,r!==0&&(s=In(r)))),s===0?0:n!==0&&n!==s&&(n&f)===0&&(f=s&-s,r=n&-n,f)DELIM" +R"DELIM(>=r||f===32&&(r&4194048)!==0)?n:s}function ur(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function fo(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sr(){var e=Sa;return Sa<<=1,(Sa&62914560)===0&&(Sa=4194304),e}function _a(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function wa(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function hs(e,n,r,l,s,f){var y=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var x=e.entanglements,R=e.expirationTimes,H=e.hiddenUpdates;for(r=y&~r;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ob=/[\n"\\]/g;function yn(e){return e.replace(Ob,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ms(e,n,r,l,s,f,y,x){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),n!=null?y==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+He(n)):e.value!==""+He(n)&&(e.value=""+He(n)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),n!=null?ps(e,y,He(n)):r!=null?ps(e,y,He(r)):l!=null&&e.removeAttribute("value"),s==null&&f!=null&&(e.defaultChecked=!!f),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+He(x):e.removeAttribute("name")}function oh(e,n,r,l,s,f,y,x){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),n!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||n!=null)){Ui(e);return}r=r!=null?""+He(r):"",n=n!=null?""+He(n):r,x||n===e.value||(e.value=n),e.defaultValue=n}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),Ui(e)}function ps(e,n,r){n==="number"&&po(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Zr(e,n,r,l){if(e=e.options,n){n={};for(var s=0;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xs=!1;if(ta)try{var $i={};Object.defineProperty($i,"passive",{get:function(){xs=!0}}),window.addEventListener("test",$i,$i),window.removeEventListener("test",$i,$i)}catch{xs=!1}var Ea=null,Ss=null,vo=null;function mh(){if(vo)return vo;var e,n=Ss,r=n.length,l,s="value"in Ea?Ea.value:Ea.textContent,f=s.length;for(e=0;e=Qi),xh=" ",Sh=!1;function _h(e,n){switch(e){case"keyup":return n1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gr=!1;function r1(e,n){switch(e){case"compositionend":return wh(n);case"keypress":return n.which!==32?null:(Sh=!0,xh);case"textInput":return e=n.data,e===xh&&Sh?null:e;default:return null}}function i1(e,n){if(Gr)return e==="compositionend"||!zs&&_h(e,n)?(e=mh(),vo=Ss=Ea=null,Gr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ch(r)}}function Dh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Dh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function jh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=po(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=po(e.document)}return n}function As(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var h1=ta&&"documentMode"in document&&11>=document.documentMode,Pr=null,Ms=null,Vi=null,Cs=!1;function kh(e,n,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cs||Pr==null||Pr!==po(l)||(l=Pr,"selectionStart"in l&&As(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Vi&&Pi(Vi,l)||(Vi=l,l=cu(Ms,"onSelect"),0>=y,s-=y,qn=1<<32-Ht(n)+s|r<Me?(ke=ye,ye=null):ke=ye.sibling;var Ye=$(N,ye,U[Me],P);if(Ye===null){ye===null&&(ye=ke);break}e&&ye&&Ye.alternate===null&&n(N,ye),M=f(Ye,M,Me),Qe===null?xe=Ye:Qe.sibling=Ye,Qe=Ye,ye=ke}if(Me===U.length)return r(N,ye),$e&&aa(N,Me),xe;if(ye===null){for(;MeMe?(ke=ye,ye=null):ke=ye.sibling;var Pa=$(N,ye,Ye.value,P);if(Pa===null){ye===null&&(ye=ke);break}e&&ye&&Pa.alternate===null&&n(N,)DELIM" +R"DELIM(ye),M=f(Pa,M,Me),Qe===null?xe=Pa:Qe.sibling=Pa,Qe=Pa,ye=ke}if(Ye.done)return r(N,ye),$e&&aa(N,Me),xe;if(ye===null){for(;!Ye.done;Me++,Ye=U.next())Ye=K(N,Ye.value,P),Ye!==null&&(M=f(Ye,M,Me),Qe===null?xe=Ye:Qe.sibling=Ye,Qe=Ye);return $e&&aa(N,Me),xe}for(ye=l(ye);!Ye.done;Me++,Ye=U.next())Ye=Y(ye,N,Me,Ye.value,P),Ye!==null&&(e&&Ye.alternate!==null&&ye.delete(Ye.key===null?Me:Ye.key),M=f(Ye,M,Me),Qe===null?xe=Ye:Qe.sibling=Ye,Qe=Ye);return e&&ye.forEach(function(Dx){return n(N,Dx)}),$e&&aa(N,Me),xe}function Je(N,M,U,P){if(typeof U=="object"&&U!==null&&U.type===A&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case _:e:{for(var xe=U.key;M!==null;){if(M.key===xe){if(xe=U.type,xe===A){if(M.tag===7){r(N,M.sibling),P=s(M,U.props.children),P.return=N,N=P;break e}}else if(M.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===I&&_r(xe)===M.type){r(N,M.sibling),P=s(M,U.props),Wi(P,U),P.return=N,N=P;break e}r(N,M);break}else n(N,M);M=M.sibling}U.type===A?(P=vr(U.props.children,N.mode,P,U.key),P.return=N,N=P):(P=Ro(U.type,U.key,U.props,null,N.mode,P),Wi(P,U),P.return=N,N=P)}return y(N);case E:e:{for(xe=U.key;M!==null;){if(M.key===xe)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){r(N,M.sibling),P=s(M,U.children||[]),P.return=N,N=P;break e}else{r(N,M);break}else n(N,M);M=M.sibling}P=Us(U,N.mode,P),P.return=N,N=P}return y(N);case I:return U=_r(U),Je(N,M,U,P)}if(J(U))return pe(N,M,U,P);if(_e(U)){if(xe=_e(U),typeof xe!="function")throw Error(o(150));return U=xe.call(U),Te(N,M,U,P)}if(typeof U.then=="function")return Je(N,M,jo(U),P);if(U.$$typeof===X)return Je(N,M,Mo(N,U),P);ko(N,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,M!==null&&M.tag===6?(r(N,M.sibling),P=s(M,U),P.return=N,N=P):(r(N,M),P=Bs(U,N.mode,P),P.return=N,N=P),y(N)):r(N,M)}return function(N,M,U,P){try{Ii=0;var xe=Je(N,M,U,P);return ai=null,xe}catch(ye){if(ye===ni||ye===No)throw ye;var Qe=un(29,ye,null,N.mode);return Qe.lanes=P,Qe.return=N,Qe}}}var Er=rm(!0),im=rm(!1),Aa=!1;function Fs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Js(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ca(e,n,r){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Pe&2)!==0){var s=l.pending;return s===null?n.next=n:(n.next=s.next,s.next=n),l.pending=n,n=zo(e),qh(e,null,r),n}return To(e,l,n,r),zo(e)}function el(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,r|=l,n.lanes=r,z(e,r)}}function Is(e,n){var r=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var s=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};f===null?s=f=y:f=f.next=y,r=r.next}while(r!==null);f===null?s=f=n:f=f.next=n}else s=f=n;r={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:f,shared:l.shared,callbacks:l.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var Ws=!1;function tl(){if(Ws){var e=ti;if(e!==null)throw e}}function nl(e,n,r,l){Ws=!1;var s=e.updateQueue;Aa=!1;var f=s.firstBaseUpdate,y=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var R=x,H=R.next;R.next=null,y===null?f=H:y.next=H,y=R;var G=e.alternate;G!==null&&(G=G.updateQueue,x=G.lastBaseUpdate,x!==y&&(x===null?G.firstBaseUpdate=H:x.next=H,G.lastBaseUpdate=R))}if(f!==null){var K=s.baseState;y=0,G=H=R=null,x=f;do{var $=x.lane&-536870913,Y=$!==x.lane;if(Y?(je&$)===$:(l&$)===$){$!==0&&$===ei&&(Ws=!0),G!==null&&(G=G.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var pe=e,Te=x;$=n;var Je=r;switch(Te.tag){case 1:if(pe=Te.payload,typeof pe=="function"){K=pe.call(Je,K,$);break e}K=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Te.payload,$=typeof pe=="function"?pe.call(Je,K,$):pe,$==null)break e;K=v({},K,$);break e;case 2:Aa=!0}}$=x.callback,$!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=s.callbacks,Y===null?s.callbacks=[$]:Y.push($))}else Y={lane:$,tag:x.tag,payload:x.payload,callback:x.callback,next:null},G===null?(H=G=Y,R=K):G=G.next=Y,y|=$;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;Y=x,x=Y.next,Y.next=null,s.lastBaseUpdate=Y,s.shared.pending=null}}while(!0);G===null&&(R=K),s.baseState=R,s.firstBaseUpdate=H,s.lastBaseUpdate=G,f===null&&(s.shared.lanes=0),La|=y,e.lanes=y,e.memoizedState=K}}function lm(e,n){if(typeof e!="function")throw Error(o(191,e));e.call(n)}function om(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;ef?f:8;var y=w.T,x={};w.T=x,gc(e,!1,n,r);try{var R=s(),H=w.S;if(H!==null&&H(x,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var G=_1(R,l);il(e,n,G,hn(e))}else il(e,n,l,hn(e))}catch(K){il(e,n,{then:function(){},status:"rejected",reason:K},hn())}finally{k.p=f,y!==null&&x.types!==null&&(y.types=x.types),w.T=y}}function O1(){}function yc(e,n,r,l){if(e.tag!==5)throw Error(o(476));var s=Hm(e).queue;Um(e,s,n,L,r===null?O1:function(){return $m(e),r(l)})}function Hm(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:L},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function $m(e){var n=Hm(e);n.next===null&&(n=e.alternate.memoizedState),il(e,n.next.queue,{},hn())}function vc(){return jt(_l)}function Zm(){return bt().memoizedState}function qm(){return bt().memoizedState}function A1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=hn();e=Ma(r);var l=Ca(n,e,r);l!==null&&(en(l,n,r),el(l,n,r)),n={cache:Ps()},e.payload=n;return}n=n.return}}function M1(e,n,r){var l=hn();r={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Go(e)?Ym(n,r):(r=ks(e,n,r,l),r!==null&&(en(r,e,l),Gm(r,n,l)))}function Qm(e,n,r){var l=hn();il(e,n,r,l)}function il(e,n,r,l){var s={lane:l,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Go(e))Ym(n,s);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var y=n.lastRenderedState,x=f(y,r);if(s.hasEagerState=!0,s.eagerState=x,on(x,y))return To(e,n,s,0),We===null&&Eo(),!1}catch{}if(r=ks(e,n,s,l),r!==null)return en(r,e,l),Gm(r,n,l),!0}return!1}function gc(e,n,r,l){if(l={lane:2,revertLane:Fc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Go(e)){if(n)throw Error(o(479))}else n=ks(e,r,l,2),n!==null&&en(n,e,2)}function Go(e){var n=e.alternate;return e===Ae||n!==null&&n===Ae}function Ym(e,n){ii=Uo=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Gm(e,n,r){if((r&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,r|=l,n.lanes=r,z(e,r)}}var ll={readContext:jt,use:Zo,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};ll.useEffectEvent=ht;var Pm={readContext:jt,use:Zo,useCallback:function(e,n){return Qt().memoizedState=[e,n===void 0?null:n],e},useContext:jt,useEffect:Am,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Qo(4194308,4,Dm.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Qo(4194308,4,e,n)},useInsertionEffect:function(e,n){Qo(4,2,e,n)},useMemo:function(e,n){var r=Qt();n=n===void 0?null:n;var l=e();if(Tr){Nn(!0);try{e()}finally{Nn(!1)}}return r.memoizedState=[l,n],l},useReducer:function(e,n,r){var l=Qt();if(r!==void 0){var s=r(n);if(Tr){Nn(!0);try{r(n)}finally{Nn(!1)}}}else s=n;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=M1.bind(null,Ae,e),[l.memoizedState,e]},useRef:function(e){var n=Qt();return e={current:e},n.memoizedState=e},useState:function(e){e=fc(e);var n=e.queue,r=Qm.bind(null,Ae,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:mc,useDeferredValue:function(e,n){var r=Qt();return pc(r,e,n)},useTransition:function(){var e=fc(!1);return e=Um.bind(null,Ae,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var l=Ae,s=Qt();if($e){if(r===void 0)throw Error(o(407));r=r()}else{if(r=n(),We===null)throw Error(o(349));(je&127)!==0||hm(l,n,r)}s.memoizedState=r;var f={value:r,getSnapshot:n};return s.queue=f,Am(pm.bind(null,l,f,e),[e]),l.flags|=2048,oi(9,{destroy:void 0},mm.bind)DELIM" +R"DELIM((null,l,f,r,n),null),r},useId:function(){var e=Qt(),n=We.identifierPrefix;if($e){var r=Qn,l=qn;r=(l&~(1<<32-Ht(l)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ho++,0<\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof l.is=="string"?y.createElement("select",{is:l.is}):y.createElement("select"),l.multiple?f.multiple=!0:l.size&&(f.size=l.size);break;default:f=typeof l.is=="string"?y.createElement(s,{is:l.is}):y.createElement(s)}}f[ce]=n,f[de]=l;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)f.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===n)break e;for(;y.sibling===null;){if(y.return===null||y.return===n)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}n.stateNode=f;e:switch(Lt(f,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&sa(n)}}return at(n),Nc(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&sa(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(o(166));if(e=we.current,Ir(n)){if(e=n.stateNode,r=n.memoizedProps,l=null,s=Dt,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[ce]=n,e=!!(e.nodeValue===r||l!==null&&l.suppressHydrationWarning===!0||fy(e.nodeValue,r)),e||Ra(n,!0)}else e=fu(e).createTextNode(l),e[ce]=n,n.stateNode=e}return at(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(l=Ir(n),r!==null){if(e===null){if(!l)throw Error(o(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ce]=n}else gr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;at(n),e=!1}else r=qs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(cn(n),n):(cn(n),null);if((n.flags&128)!==0)throw Error(o(558))}return at(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ir(n),l!==null&&l.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=n.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[ce]=n}else gr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;at(n),s=!1}else s=qs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return n.flags&256?(cn(n),n):(cn(n),null)}return cn(n),(n.flags&128)!==0?(n.lanes=r,n):(r=l!==null,e=e!==null&&e.memoizedState!==null,r&&(l=n.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),f=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),f!==s&&(l.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),Fo(n,n.updateQueue),at(n),null);case 4:return Ge(),e===null&&ef(n.stateNode.containerInfo),at(n),null;case 10:return ia(n.type),at(n),null;case 19:if(Z(gt),l=n.memoizedState,l===null)return at(n),null;if(s=(n.flags&128)!==0,f=l.rendering,f===null)if(s)ul(l,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=Bo(e),f!==null){for(n.flags|=128,ul(l,!1),e=f.updateQueue,n.updateQueue=e,Fo(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)Qh(r,e),r=r.sibling;return W(gt,gt.current&1|2),$e&&aa(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&yt()>tu&&(n.flags|=128,s=!0,ul(l,!1),n.lanes=4194304)}else{if(!s)if(e=Bo(f),e!==null){if(n.flags|=128,s=!0,e=e.updateQueue,n.updateQueue=e,Fo(n,e),ul(l,!0),l.tail===null&&l.tailMode==="hidden"&&!f.alternate&&!$e)return at(n),null}else 2*yt()-l.renderingStartTime>tu&&r!==536870912&&(n.flags|=128,s=!0,ul(l,!1),n.lanes=4194304);l.isBackwards?(f.sibling=n.child,n.child=f):(e=l.last,e!==null?e.sibling=f:n.child=f,l.last=f)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=yt(),e.sibling=null,r=gt.current,W(gt,s?r&1|2:r&1),$e&&aa(n,l.treeForkCount),e):(at(n),null);case 22:case 23:return cn(n),tc(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(r&536870912)!==0&&(n.flags&128)===0&&(at(n),n.subtreeFlags&6&&(n.flags|=8192)):at(n),r=n.updateQueue,r!==null&&Fo(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==r&&(n.flags|=2048),e!==null&&Z(Sr),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),ia(St),at(n),null;case 25:return null;case 30:return null}throw Error(o(156,n.tag))}function k1(e,n){switch($s(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ia(St),Ge(),e=)DELIM" +R"DELIM(n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return qt(n),null;case 31:if(n.memoizedState!==null){if(cn(n),n.alternate===null)throw Error(o(340));gr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(cn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));gr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Z(gt),null;case 4:return Ge(),null;case 10:return ia(n.type),null;case 22:case 23:return cn(n),tc(),e!==null&&Z(Sr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return ia(St),null;case 25:return null;default:return null}}function yp(e,n){switch($s(n),n.tag){case 3:ia(St),Ge();break;case 26:case 27:case 5:qt(n);break;case 4:Ge();break;case 31:n.memoizedState!==null&&cn(n);break;case 13:cn(n);break;case 19:Z(gt);break;case 10:ia(n.type);break;case 22:case 23:cn(n),tc(),e!==null&&Z(Sr);break;case 24:ia(St)}}function sl(e,n){try{var r=n.updateQueue,l=r!==null?r.lastEffect:null;if(l!==null){var s=l.next;r=s;do{if((r.tag&e)===e){l=void 0;var f=r.create,y=r.inst;l=f(),y.destroy=l}r=r.next}while(r!==s)}}catch(x){Xe(n,n.return,x)}}function ja(e,n,r){try{var l=n.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var f=s.next;l=f;do{if((l.tag&e)===e){var y=l.inst,x=y.destroy;if(x!==void 0){y.destroy=void 0,s=n;var R=r,H=x;try{H()}catch(G){Xe(s,R,G)}}}l=l.next}while(l!==f)}}catch(G){Xe(n,n.return,G)}}function vp(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{om(n,r)}catch(l){Xe(e,e.return,l)}}}function gp(e,n,r){r.props=zr(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(l){Xe(e,n,l)}}function cl(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof r=="function"?e.refCleanup=r(l):r.current=l}}catch(s){Xe(e,n,s)}}function Yn(e,n){var r=e.ref,l=e.refCleanup;if(r!==null)if(typeof l=="function")try{l()}catch(s){Xe(e,n,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(s){Xe(e,n,s)}else r.current=null}function bp(e){var n=e.type,r=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&l.focus();break e;case"img":r.src?l.src=r.src:r.srcSet&&(l.srcset=r.srcSet)}}catch(s){Xe(e,e.return,s)}}function Dc(e,n,r){try{var l=e.stateNode;ax(l,e.type,r,n),l[de]=n}catch(s){Xe(e,e.return,s)}}function xp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Za(e.type)||e.tag===4}function jc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xp(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.tag===27&&Za(e.type)||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 kc(e,n,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ea));else if(l!==4&&(l===27&&Za(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(kc(e,n,r),e=e.sibling;e!==null;)kc(e,n,r),e=e.sibling}function Jo(e,n,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(l!==4&&(l===27&&Za(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Jo(e,n,r),e=e.sibling;e!==null;)Jo(e,n,r),e=e.sibling}function Sp(e){var n=e.stateNode,r=e.memoizedProps;try{for(var l=e.type,s=n.attributes;s.length;)n.removeAttributeNode(s[0]);Lt(n,l,r),n[ce]=e,n[de]=r}catch(f){Xe(e,e.return,f)}}var ca=!1,Et=!1,Lc=!1,_p=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function L1(e,n){if(e=e.containerInfo,af=gu,e=jh(e),As(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var s=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var y=0,x=-1,R=-1,H=0,G=0,K=e,$=null;t:for(;;){for(var Y;K!==r||s!==0&&K.nodeType!==3||(x=y+s),K!==f||l!==0&&K.nodeType!==3||(R=y+l),K.nodeType===3&&(y+=K.nodeValue.length),(Y=K.firstChild)!==null;)$=K,K=Y;for(;;){if(K===e)break t;if($===r&&++H===s&&(x=y),$===f&&++G===l&&(R=y),(Y=K.nextSibling)!==null)break;K=$,$=K.parentNode}K=Y}r=x===-1||R===-1?null:{start:x,end:R}}else r=null}r=r||{start:0,end:0}}else r=null;for(rf={focusedElem:e,selectionRange:r},gu=!1,Mt=n;Mt!==null;)if(n=Mt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Mt=e;else for(;Mt!==null;){switch(n=Mt,f=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r title"))),Lt(f,l,r),f[ce]=e,rt(f),l=f;break e;case"link":var y=Oy("link","href",s).get(l+(r.href||""));if(y){for(var x=0;xJe&&(y=Je,Je=Te,Te=y);var N=Nh(x,Te),M=Nh(x,Je);if(N&&M&&(Y.rangeCount!==1||Y.anchorNode!==N.node||Y.anchorOffset!==N.offset||Y.focusNode!==M.node||Y.focusOffset!==M.offset)){var U=K.createRange();U.setStart(N.node,N.offset),Y.removeAllRanges(),Te>Je?(Y.addRange(U),Y.extend(M.node,M.offset)):(U.setEnd(M.node,M.offset),Y.addRange(U))}}}}for(K=[],Y=x;Y=Y.parentNode;)Y.nodeType===1&&K.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;xr?32:r,w.T=null,r=Qc,Qc=null;var f=Ua,y=pa;if(Rt=0,di=Ua=null,pa=0,(Pe&6)!==0)throw Error(o(331));var x=Pe;if(Pe|=4,Dp(f.current),Mp(f,f.current,y,r),Pe=x,yl(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(ir,f)}catch{}return!0}finally{k.p=s,w.T=l,Jp(e,n)}}function Wp(e,n,r){n=gn(r,n),n=_c(e.stateNode,n,2),e=Ca(e,n,2),e!==null&&(wa(e,2),Gn(e))}function Xe(e,n,r){if(e.tag===3)Wp(e,e,r);else for(;n!==null;){if(n.tag===3){Wp(n,e,r);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ba===null||!Ba.has(l))){e=gn)DELIM" +R"DELIM((r,e),r=ep(2),l=Ca(n,r,2),l!==null&&(tp(r,l,n,e),wa(l,2),Gn(l));break}}n=n.return}}function Vc(e,n,r){var l=e.pingCache;if(l===null){l=e.pingCache=new H1;var s=new Set;l.set(n,s)}else s=l.get(n),s===void 0&&(s=new Set,l.set(n,s));s.has(r)||(Hc=!0,s.add(r),e=Y1.bind(null,e,n,r),n.then(e,e))}function Y1(e,n,r){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,We===e&&(je&r)===r&&(mt===4||mt===3&&(je&62914560)===je&&300>yt()-eu?(Pe&2)===0&&hi(e,0):$c|=r,fi===je&&(fi=0)),Gn(e)}function ey(e,n){n===0&&(n=sr()),e=yr(e,n),e!==null&&(wa(e,n),Gn(e))}function G1(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),ey(e,r)}function P1(e,n){var r=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(n),ey(e,r)}function V1(e,n){return Di(e,n)}var ou=null,pi=null,Xc=!1,uu=!1,Kc=!1,$a=0;function Gn(e){e!==pi&&e.next===null&&(pi===null?ou=pi=e:pi=pi.next=e),uu=!0,Xc||(Xc=!0,K1())}function yl(e,n){if(!Kc&&uu){Kc=!0;do for(var r=!1,l=ou;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var f=0;else{var y=l.suspendedLanes,x=l.pingedLanes;f=(1<<31-Ht(42|e)+1)-1,f&=s&~(y&~x),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(r=!0,ry(l,f))}else f=je,f=or(l,l===We?f:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(f&3)===0||ur(l,f)||(r=!0,ry(l,f));l=l.next}while(r);Kc=!1}}function X1(){ty()}function ty(){uu=Xc=!1;var e=0;$a!==0&&ix()&&(e=$a);for(var n=yt(),r=null,l=ou;l!==null;){var s=l.next,f=ny(l,n);f===0?(l.next=null,r===null?ou=s:r.next=s,s===null&&(pi=r)):(r=l,(e!==0||(f&3)!==0)&&(uu=!0)),l=s}Rt!==0&&Rt!==5||yl(e),$a!==0&&($a=0)}function ny(e,n){for(var r=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,f=e.pendingLanes&-62914561;0x)break;var G=R.transferSize,K=R.initiatorType;G&&dy(K)&&(R=R.responseEnd,y+=G*(R"u"?null:document;function Ey(e,n,r){var l=yi;if(l&&typeof n=="string"&&n){var s=yn(n);s='link[rel="'+e+'"][href="'+s+'"]',typeof r=="string"&&(s+='[crossorigin="'+r+'"]'),wy.has(s)||(wy.add(s),e={rel:e,crossOrigin:r,href:n},l.querySelector(s)===null&&(n=l.createElement("link"),Lt(n,"link",e),rt(n),l.head.appendChild(n)))}}function mx(e){ya.D(e),Ey("dns-prefetch",e,null)}function px(e,n){ya.C(e,n),Ey("preconnect",e,n)}function yx(e,n,r){ya.L(e,n,r);var l=yi;if(l&&e&&n){var s='link[rel="preload"][as="'+yn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(s+='[imagesrcset="'+yn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(s+='[imagesizes="'+yn(r.imageSizes)+'"]')):s+='[href="'+yn(e)+'"]';var f=s;switch(n){case"style":f=vi(e);break;case"script":f=gi(e)}En.has(f)||(e=v({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),En.set(f,e),l.querySelector(s)!==null||n==="style"&&l.querySelector(xl(f))||n==="script"&&l.querySelector(Sl(f))||(n=l.createElement("link"),Lt(n,"link",e),rt(n),l.head.appendChild(n)))}}function vx(e,n){ya.m(e,n);var r=yi;if(r&&e){var l=n&&typeof n.as=="string"?n.as:"script",s='link[rel="modulepreload"][as="'+yn(l)+'"][href="'+yn(e)+'"]',f=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":)DELIM" +R"DELIM(f=gi(e)}if(!En.has(f)&&(e=v({rel:"modulepreload",href:e},n),En.set(f,e),r.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Sl(f)))return}l=r.createElement("link"),Lt(l,"link",e),rt(l),r.head.appendChild(l)}}}function gx(e,n,r){ya.S(e,n,r);var l=yi;if(l&&e){var s=Xt(l).hoistableStyles,f=vi(e);n=n||"default";var y=s.get(f);if(!y){var x={loading:0,preload:null};if(y=l.querySelector(xl(f)))x.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},r),(r=En.get(f))&&df(e,r);var R=y=l.createElement("link");rt(R),Lt(R,"link",e),R._p=new Promise(function(H,G){R.onload=H,R.onerror=G}),R.addEventListener("load",function(){x.loading|=1}),R.addEventListener("error",function(){x.loading|=2}),x.loading|=4,hu(y,n,l)}y={type:"stylesheet",instance:y,count:1,state:x},s.set(f,y)}}}function bx(e,n){ya.X(e,n);var r=yi;if(r&&e){var l=Xt(r).hoistableScripts,s=gi(e),f=l.get(s);f||(f=r.querySelector(Sl(s)),f||(e=v({src:e,async:!0},n),(n=En.get(s))&&hf(e,n),f=r.createElement("script"),rt(f),Lt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(s,f))}}function xx(e,n){ya.M(e,n);var r=yi;if(r&&e){var l=Xt(r).hoistableScripts,s=gi(e),f=l.get(s);f||(f=r.querySelector(Sl(s)),f||(e=v({src:e,async:!0,type:"module"},n),(n=En.get(s))&&hf(e,n),f=r.createElement("script"),rt(f),Lt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(s,f))}}function Ty(e,n,r,l){var s=(s=we.current)?du(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=vi(r.href),r=Xt(s).hoistableStyles,l=r.get(n),l||(l={type:"style",instance:null,count:0,state:null},r.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=vi(r.href);var f=Xt(s).hoistableStyles,y=f.get(e);if(y||(s=s.ownerDocument||s,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,y),(f=s.querySelector(xl(e)))&&!f._p&&(y.instance=f,y.state.loading=5),En.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},En.set(e,r),f||Sx(s,e,r,y.state))),n&&l===null)throw Error(o(528,""));return y}if(n&&l!==null)throw Error(o(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=gi(r),r=Xt(s).hoistableScripts,l=r.get(n),l||(l={type:"script",instance:null,count:0,state:null},r.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function vi(e){return'href="'+yn(e)+'"'}function xl(e){return'link[rel="stylesheet"]['+e+"]"}function zy(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function Sx(e,n,r,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),Lt(n,"link",r),rt(n),e.head.appendChild(n))}function gi(e){return'[src="'+yn(e)+'"]'}function Sl(e){return"script[async]"+e}function Ry(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+yn(r.href)+'"]');if(l)return n.instance=l,rt(l),l;var s=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),rt(l),Lt(l,"style",s),hu(l,r.precedence,e),n.instance=l;case"stylesheet":s=vi(r.href);var f=e.querySelector(xl(s));if(f)return n.state.loading|=4,n.instance=f,rt(f),f;l=zy(r),(s=En.get(s))&&df(l,s),f=(e.ownerDocument||e).createElement("link"),rt(f);var y=f;return y._p=new Promise(function(x,R){y.onload=x,y.onerror=R}),Lt(f,"link",l),n.state.loading|=4,hu(f,r.precedence,e),n.instance=f;case"script":return f=gi(r.src),(s=e.querySelector(Sl(f)))?(n.instance=s,rt(s),s):(l=r,(s=En.get(f))&&(l=v({},r),hf(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),rt(s),Lt(s,"link",l),e.head.appendChild(s),n.instance=s);case"void":return null;default:throw Error(o(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,hu(l,r.precedence,e));return n.instance}function hu(e,n,r){for(var l=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,f=s,y=0;y title"):null)}function _x(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function My(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function wx(e,n,r,l){if(r.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var s=vi(l.href),f=n.querySelector(xl(s));if(f){n=f._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=pu.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=f,rt(f);return}f=n.ownerDocument||n,l=zy(l),(s=En.get(s))&&df(l,s),f=f.createElement("link"),rt(f);var y=f;y._p=new Promise(function(x,R){y.onload=x,y.onerror=R}),Lt(f,"link",l),r.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=pu.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var mf=0;function Ex(e,n){return e.stylesheets&&e.count===0&&vu(e,e.stylesheets),0mf?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yu=null;function vu(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yu=new Map,n.forEach(Tx,e),yu=null,pu.call(e))}function Tx(e,n){if(!(n.state.loading&4)){var r=yu.get(e);if(r)var l=r.get(null);else{r=new Map,yu.set(e,r);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),wf.exports=qx(),wf.exports}var Yx=Qx();const Gx=Jl(Yx);var Wl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Px={setTimeout:(t,a)=>setTimeout(t,a),clearTimeout:t=>clearTimeout(t),setInterval:(t,a)=>setInterval(t,a),clearInterval:t=>clearInterval(t)},Vx=class{#e=Px;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,a){return this.#e.setTimeout(t,a)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,a){return this.#e.setInterval(t,a)}clearInterval(t){this.#e.clearInterval(t)}},Ar=new Vx;function Xx(t){setTimeout(t,0)}var Dr=typeof window>"u"||"Deno"in globalThis;function tn(){}function Kx(t,a){return typeof t=="function"?)DELIM" +R"DELIM(t(a):t}function ld(t){return typeof t=="number"&&t>=0&&t!==1/0}function Zg(t,a){return Math.max(t+(a||0)-Date.now(),0)}function er(t,a){return typeof t=="function"?t(a):t}function zn(t,a){return typeof t=="function"?t(a):t}function ev(t,a){const{type:i="all",exact:o,fetchStatus:u,predicate:c,queryKey:d,stale:h}=t;if(d){if(o){if(a.queryHash!==Rd(d,a.options))return!1}else if(!Ql(a.queryKey,d))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||u&&u!==a.state.fetchStatus||c&&!c(a))}function tv(t,a){const{exact:i,status:o,predicate:u,mutationKey:c}=t;if(c){if(!a.options.mutationKey)return!1;if(i){if(ql(a.options.mutationKey)!==ql(c))return!1}else if(!Ql(a.options.mutationKey,c))return!1}return!(o&&a.state.status!==o||u&&!u(a))}function Rd(t,a){return(a?.queryKeyHashFn||ql)(t)}function ql(t){return JSON.stringify(t,(a,i)=>ud(i)?Object.keys(i).sort().reduce((o,u)=>(o[u]=i[u],o),{}):i)}function Ql(t,a){return t===a?!0:typeof t!=typeof a?!1:t&&a&&typeof t=="object"&&typeof a=="object"?Object.keys(a).every(i=>Ql(t[i],a[i])):!1}var Fx=Object.prototype.hasOwnProperty;function qg(t,a){if(t===a)return t;const i=nv(t)&&nv(a);if(!i&&!(ud(t)&&ud(a)))return a;const u=(i?t:Object.keys(t)).length,c=i?a:Object.keys(a),d=c.length,h=i?new Array(d):{};let p=0;for(let m=0;m{Ar.setTimeout(a,t)})}function sd(t,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(t,a):i.structuralSharing!==!1?qg(t,a):a}function Ix(t,a,i=0){const o=[...t,a];return i&&o.length>i?o.slice(1):o}function Wx(t,a,i=0){const o=[a,...t];return i&&o.length>i?o.slice(0,-1):o}var Od=Symbol();function Qg(t,a){return!t.queryFn&&a?.initialPromise?()=>a.initialPromise:!t.queryFn||t.queryFn===Od?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function eS(t,a){return typeof t=="function"?t(...a):!!t}var tS=class extends Wl{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!Dr&&window.addEventListener){const a=()=>t();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(a=>{a(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Ad=new tS;function cd(){let t,a;const i=new Promise((u,c)=>{t=u,a=c});i.status="pending",i.catch(()=>{});function o(u){Object.assign(i,u),delete i.resolve,delete i.reject}return i.resolve=u=>{o({status:"fulfilled",value:u}),t(u)},i.reject=u=>{o({status:"rejected",reason:u}),a(u)},i}var nS=Xx;function aS(){let t=[],a=0,i=h=>{h()},o=h=>{h()},u=nS;const c=h=>{a?t.push(h):u(()=>{i(h)})},d=()=>{const h=t;t=[],h.length&&u(()=>{o(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{c(()=>{h(...p)})},schedule:c,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{u=h}}}var Bt=aS(),rS=class extends Wl{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!Dr&&window.addEventListener){const a=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(i=>{i(t)}))}isOnline(){return this.#e}},Yu=new rS;function iS(t){return Math.min(1e3*2**t,3e4)}function Yg(t){return(t??"online")==="online"?Yu.isOnline():!0}var fd=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Gg(t){let a=!1,i=0,o;const u=cd(),c=()=>u.status!=="pending",d=A=>{if(!c()){const B=new fd(A);b(B),t.onCancel?.(B)}},h=()=>{a=!0},p=()=>{a=!1},m=()=>Ad.isFocused()DELIM" +R"DELIM()&&(t.networkMode==="always"||Yu.isOnline())&&t.canRun(),g=()=>Yg(t.networkMode)&&t.canRun(),v=A=>{c()||(o?.(),u.resolve(A))},b=A=>{c()||(o?.(),u.reject(A))},_=()=>new Promise(A=>{o=B=>{(c()||m())&&A(B)},t.onPause?.()}).then(()=>{o=void 0,c()||t.onContinue?.()}),E=()=>{if(c())return;let A;const B=i===0?t.initialPromise:void 0;try{A=B??t.fn()}catch(D){A=Promise.reject(D)}Promise.resolve(A).then(v).catch(D=>{if(c())return;const Q=t.retry??(Dr?0:3),X=t.retryDelay??iS,se=typeof X=="function"?X(i,D):X,ue=Q===!0||typeof Q=="number"&&im()?void 0:_()).then(()=>{a?b(D):E()})})};return{promise:u,status:()=>u.status,cancel:d,continue:()=>(o?.(),u),cancelRetry:h,continueRetry:p,canStart:g,start:()=>(g()?E():_().then(E),u)}}var Pg=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ld(this.gcTime)&&(this.#e=Ar.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Dr?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Ar.clearTimeout(this.#e),this.#e=void 0)}},lS=class extends Pg{#e;#t;#n;#r;#a;#o;#l;constructor(t){super(),this.#l=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#n=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=iv(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(t){if(this.options={...this.#o,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=iv(this.options);a.data!==void 0&&(this.setState(rv(a.data,a.dataUpdatedAt)),this.#e=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,a){const i=sd(this.state.data,t,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(t,a){this.#i({type:"setState",state:t,setStateOptions:a})}cancel(t){const a=this.#a?.promise;return this.#a?.cancel(t),a?a.then(tn).catch(tn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>zn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Od||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>er(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:!Zg(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(a=>a!==t),this.observers.length||(this.#a&&(this.#l?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(t,a){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},u=()=>{const h=Qg(this.options,a),m=(()=>{const g={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(g),g})();return this.#l=!1,this.options.persister?this.options.persister(h,m,this):h(m)},d=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:u};return o(h),h})();this.options.behavior?.onFetch(d,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#a=Gg({initialPromise:a?.initialPromise,fn:d.fetchFn,onCancel:h=>{h instanceof fd&&h.revert&&this.setState({...this.#t,fetchStatus:"idle"}),i.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()DELIM" +R"DELIM()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof fd){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(t){const a=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Vg(i.data,this.options),fetchMeta:t.meta??null};case"success":const o={...i,...rv(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=t.manual?o:void 0,o;case"error":const u=t.error;return{...i,error:u,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=a(this.state),Bt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function Vg(t,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yg(a.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function rv(t,a){return{data:t,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function iv(t){const a=typeof t.initialData=="function"?t.initialData():t.initialData,i=a!==void 0,o=i?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var oS=class extends Wl{constructor(t,a){super(),this.options=a,this.#e=t,this.#i=null,this.#l=cd(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#o;#l;#i;#p;#d;#h;#s;#c;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),lv(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const a=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof zn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),a._defaulted&&!od(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&ov(this.#t,i,this.options,a)&&this.#f(),this.updateResult(),o&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||er(this.options.staleTime,this.#t)!==er(a.staleTime,this.#t))&&this.#y();const u=this.#v();o&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||u!==this.#u)&&this.#g(u)}getOptimisticResult(t){const a=this.#e.getQueryCache().build(this.#e,t),i=this.createResult(a,t);return sS(this,i)&&(this.#r=i,this.#o=this.options,this.#a=this.#t.state),i}getCurrentResult(){return this.#r}trackResult(t,a){return new Proxy(t,{get:(i,o)=>(this.trackProp(o),a?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#l.status==="pending"&&this.#l.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,o))})}trackProp(t){this.#m.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const a=this.#e.defaultQueryOptions(t),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(t){this.#_();let a=this.#t.fetch(this.options,t);return t?.throwOnError||(a=a.catch(tn)),a}#y(){this.#x();const t=er(this.options.staleTime,this.#t);if(Dr||this.#r.isStale||!ld(t))return;const i=Zg(this.#r.dataUpdatedAt,t)+1;this.#s=Ar.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.optio)DELIM" +R"DELIM(ns.refetchInterval)??!1}#g(t){this.#S(),this.#u=t,!(Dr||zn(this.options.enabled,this.#t)===!1||!ld(this.#u)||this.#u===0)&&(this.#c=Ar.setInterval(()=>{(this.options.refetchIntervalInBackground||Ad.isFocused())&&this.#f()},this.#u))}#b(){this.#y(),this.#g(this.#v())}#x(){this.#s&&(Ar.clearTimeout(this.#s),this.#s=void 0)}#S(){this.#c&&(Ar.clearInterval(this.#c),this.#c=void 0)}createResult(t,a){const i=this.#t,o=this.options,u=this.#r,c=this.#a,d=this.#o,p=t!==i?t.state:this.#n,{state:m}=t;let g={...m},v=!1,b;if(a._optimisticResults){const I=this.hasListeners(),ie=!I&&lv(t,a),V=I&&ov(t,i,a,o);(ie||V)&&(g={...g,...Vg(m.data,t.options)}),a._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:_,errorUpdatedAt:E,status:A}=g;b=g.data;let B=!1;if(a.placeholderData!==void 0&&b===void 0&&A==="pending"){let I;u?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(I=u.data,B=!0):I=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,I!==void 0&&(A="success",b=sd(u?.data,I,a),v=!0)}if(a.select&&b!==void 0&&!B)if(u&&b===c?.data&&a.select===this.#p)b=this.#d;else try{this.#p=a.select,b=a.select(b),b=sd(u?.data,b,a),this.#d=b,this.#i=null}catch(I){this.#i=I}this.#i&&(_=this.#i,b=this.#d,E=Date.now(),A="error");const D=g.fetchStatus==="fetching",Q=A==="pending",X=A==="error",se=Q&&D,ue=b!==void 0,C={status:A,fetchStatus:g.fetchStatus,isPending:Q,isSuccess:A==="success",isError:X,isInitialLoading:se,isLoading:se,data:b,dataUpdatedAt:g.dataUpdatedAt,error:_,errorUpdatedAt:E,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:D,isRefetching:D&&!Q,isLoadingError:X&&!ue,isPaused:g.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:X&&ue,isStale:Md(t,a),refetch:this.refetch,promise:this.#l,isEnabled:zn(a.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=ee=>{C.status==="error"?ee.reject(C.error):C.data!==void 0&&ee.resolve(C.data)},ie=()=>{const ee=this.#l=C.promise=cd();I(ee)},V=this.#l;switch(V.status){case"pending":t.queryHash===i.queryHash&&I(V);break;case"fulfilled":(C.status==="error"||C.data!==V.value)&&ie();break;case"rejected":(C.status!=="error"||C.error!==V.reason)&&ie();break}}return C}updateResult(){const t=this.#r,a=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#t),od(a,t))return;this.#r=a;const i=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,u=typeof o=="function"?o():o;if(u==="all"||!u&&!this.#m.size)return!0;const c=new Set(u??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#r).some(d=>{const h=d;return this.#r[h]!==t[h]&&c.has(h)})};this.#w({listeners:i()})}#_(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const a=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(a?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(a=>{a(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function uS(t,a){return zn(a.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&a.retryOnMount===!1)}function lv(t,a){return uS(t,a)||t.state.data!==void 0&&dd(t,a,a.refetchOnMount)}function dd(t,a,i){if(zn(a.enabled,t)!==!1&&er(a.staleTime,t)!=="static"){const o=typeof i=="function"?i(t):i;return o==="always"||o!==!1&&Md(t,a)}return!1}function ov(t,a,i,o){return(t!==a||zn(o.enabled,t)===!1)&&(!i.suspense||t.state.status!=="error")&&Md(t,i)}function Md(t,a){return zn(a.enabled,t)!==!1&&t.isStaleByTime(er(a.staleTime,t))}function sS(t,a){return!od(t.getCurrentResult(),a)}function uv(t){return{onFetch:(a,i)=>{const o=a.options,u=a.fetchOptions?.meta?.fetchMore?.direction,c=a.state.data?.pages||[],d=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let g=!1;const v=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(a.signal.aborted?g=!0:a.signal.addEventListener("abort",()=>{g=!0}),a.signal)})},b=Qg(a.options,a.fetchOptions),_=async(E,A,B)=>{if(g)return Promise.reject();if(A==null&&E.pages.length)return Promise.resolve(E);const Q=(()=>{const me={client:a.client,queryKey:a.queryKey,pageParam:A,direction:B?"backward":"forward",meta:a.options.meta};return v(me),me})(),X=await b(Q),{maxPages:se}=a.options,ue=B?Wx:Ix;return{pages:ue(E.pages,X,se),pageParams:ue(E.pageParams,A,se)}};if(u&&c.length){const E=u==="backward",A=E?cS:sv,B={pages:c,pageParams:d},D=A(o,B);h=await _(B,D,E)}else{const E=t??c.length;do{const A=p===0?d[0]??o.initialPageParam:sv(o,h);if(p>0&&A==null)break;h=await _(h,A),p++}while(pa.options.persister?.(m,{cli)DELIM" +R"DELIM(ent:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function sv(t,{pages:a,pageParams:i}){const o=a.length-1;return a.length>0?t.getNextPageParam(a[o],a,i[o],i):void 0}function cS(t,{pages:a,pageParams:i}){return a.length>0?t.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var fS=class extends Pg{#e;#t;#n;#r;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||dS(),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.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(a=>a!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){const a=()=>{this.#a({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Gg({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#a({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",u=!this.#r.canStart();try{if(o)a();else{this.#a({type:"pending",variables:t,isPaused:u}),await this.#n.config.onMutate?.(t,this,i);const d=await this.options.onMutate?.(t,i);d!==this.state.context&&this.#a({type:"pending",context:d,variables:t,isPaused:u})}const c=await this.#r.start();return await this.#n.config.onSuccess?.(c,t,this.state.context,this,i),await this.options.onSuccess?.(c,t,this.state.context,i),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(c,null,t,this.state.context,i),this.#a({type:"success",data:c}),c}catch(c){try{throw await this.#n.config.onError?.(c,t,this.state.context,this,i),await this.options.onError?.(c,t,this.state.context,i),await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(void 0,c,t,this.state.context,i),c}finally{this.#a({type:"error",error:c})}}finally{this.#n.runNext(this)}}#a(t){const a=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Bt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function dS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hS=class extends Wl{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,a,i){const o=new fS({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(a),state:i});return this.add(o),o}add(t){this.#e.add(t);const a=Tu(t);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(t):this.#t.set(a,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const a=Tu(t);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const o=i.indexOf(t);o!==-1&&i.splice(o,1)}else i[0]===t&&this.#t.delete(a)}}this.notify({type:"removed",mutation:t})}canRun(t){const a=Tu(t);if(typeof a=="string"){const o=this.#t.get(a)?.find(u=>u.state.status==="pending");return!o||o===t}else return!0}runNext(t){const a=Tu(t);return typeof a=="string"?this.#t.get(a)?.find(o=>o!==t&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Bt.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const a={exact:!0,...t};return this.getAll().find(i=>tv(a,i))}findAll(t={}){return this.getAll().filter(a=>tv(t,a))}notify(t){Bt.batch(()=>{this.listeners.forEach(a=>{a(t)})})}resumePausedMutations(){const t=this.getAll().filter(a=>a.state.isPaused);return Bt.batch(()=>Promise.all(t.map(a=>a.continue().catch(tn))))}};function Tu(t){return t.options.scope?.id}var mS=class extends Wl{constructor(t={}){super(),this.co)DELIM" +R"DELIM(nfig=t,this.#e=new Map}#e;build(t,a,i){const o=a.queryKey,u=a.queryHash??Rd(o,a);let c=this.get(u);return c||(c=new lS({client:t,queryKey:o,queryHash:u,options:t.defaultQueryOptions(a),state:i,defaultOptions:t.getQueryDefaults(o)}),this.add(c)),c}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const a=this.#e.get(t.queryHash);a&&(t.destroy(),a===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const a={exact:!0,...t};return this.getAll().find(i=>ev(a,i))}findAll(t={}){const a=this.getAll();return Object.keys(t).length>0?a.filter(i=>ev(t,i)):a}notify(t){Bt.batch(()=>{this.listeners.forEach(a=>{a(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},pS=class{#e;#t;#n;#r;#a;#o;#l;#i;constructor(t={}){this.#e=t.queryCache||new mS,this.#t=t.mutationCache||new hS,this.#n=t.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#l=Ad.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Yu.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#l?.(),this.#l=void 0,this.#i?.(),this.#i=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const a=this.defaultQueryOptions({queryKey:t});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(t){const a=this.defaultQueryOptions(t),i=this.#e.build(this,a),o=i.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&i.isStaleByTime(er(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(o))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:a,state:i})=>{const o=i.data;return[a,o]})}setQueryData(t,a,i){const o=this.defaultQueryOptions({queryKey:t}),c=this.#e.get(o.queryHash)?.state.data,d=Kx(a,c);if(d!==void 0)return this.#e.build(this,o).setData(d,{...i,manual:!0})}setQueriesData(t,a,i){return Bt.batch(()=>this.#e.findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,a,i)]))}getQueryState(t){const a=this.defaultQueryOptions({queryKey:t});return this.#e.get(a.queryHash)?.state}removeQueries(t){const a=this.#e;Bt.batch(()=>{a.findAll(t).forEach(i=>{a.remove(i)})})}resetQueries(t,a){const i=this.#e;return Bt.batch(()=>(i.findAll(t).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...t},a)))}cancelQueries(t,a={}){const i={revert:!0,...a},o=Bt.batch(()=>this.#e.findAll(t).map(u=>u.cancel(i)));return Promise.all(o).then(tn).catch(tn)}invalidateQueries(t,a={}){return Bt.batch(()=>(this.#e.findAll(t).forEach(i=>{i.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},a)))}refetchQueries(t,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},o=Bt.batch(()=>this.#e.findAll(t).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let c=u.fetch(void 0,i);return i.throwOnError||(c=c.catch(tn)),u.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(o).then(tn)}fetchQuery(t){const a=this.defaultQueryOptions(t);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(er(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(tn).catch(tn)}fetchInfiniteQuery(t){return t.behavior=uv(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(tn).catch(tn)}ensureInfiniteQueryData(t){return t.behavior=uv(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Yu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,a){this.#r.set(ql(t),{queryKey:t,defaultOptions:a})}getQueryDefaults(t){const a=[...this.#r.values()],i={};return a.forEach(o=>{Ql(t,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(t,a){this.#a.set(ql(t),{mutationKey:t,defaultOptions:a})}getMutationDefaults(t){const a=[...this.#a.values()],i={};return a.forEach(o=>{Ql(t,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(t){if(t._defaulted)return t;const a={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return a.queryHash||(a.queryHash=Rd(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Od&&(a.enabled=!1),a}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_d)DELIM" +R"DELIM(efaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Xg=O.createContext(void 0),Kg=t=>{const a=O.useContext(Xg);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},yS=({client:t,children:a})=>(O.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(Xg.Provider,{value:t,children:a})),Fg=O.createContext(!1),vS=()=>O.useContext(Fg);Fg.Provider;function gS(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var bS=O.createContext(gS()),xS=()=>O.useContext(bS),SS=(t,a)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(a.isReset()||(t.retryOnMount=!1))},_S=t=>{O.useEffect(()=>{t.clearReset()},[t])},wS=({result:t,errorResetBoundary:a,throwOnError:i,query:o,suspense:u})=>t.isError&&!a.isReset()&&!t.isFetching&&o&&(u&&t.data===void 0||eS(i,[t.error,o])),ES=t=>{if(t.suspense){const i=u=>u==="static"?u:Math.max(u??1e3,1e3),o=t.staleTime;t.staleTime=typeof o=="function"?(...u)=>i(o(...u)):i(o),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},TS=(t,a)=>t.isLoading&&t.isFetching&&!a,zS=(t,a)=>t?.suspense&&a.isPending,cv=(t,a,i)=>a.fetchOptimistic(t).catch(()=>{i.clearReset()});function RS(t,a,i){const o=vS(),u=xS(),c=Kg(),d=c.defaultQueryOptions(t);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=o?"isRestoring":"optimistic",ES(d),SS(d,u),_S(u);const h=!c.getQueryCache().get(d.queryHash),[p]=O.useState(()=>new a(c,d)),m=p.getOptimisticResult(d),g=!o&&t.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(v=>{const b=g?p.subscribe(Bt.batchCalls(v)):tn;return p.updateResult(),b},[p,g]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),O.useEffect(()=>{p.setOptions(d)},[d,p]),zS(d,m))throw cv(d,p,u);if(wS({result:m,errorResetBoundary:u,throwOnError:d.throwOnError,query:c.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Dr&&TS(m,o)&&(h?cv(d,p,u):c.getQueryCache().get(d.queryHash)?.promise)?.catch(tn).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function xa(t,a){return RS(t,oS)}const OS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let fv=(t=21)=>{let a="",i=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)a+=OS[i[t]&63];return a};var ku={exports:{}},AS=ku.exports,dv;function MS(){return dv||(dv=1,(function(t,a){(function(i,o){t.exports=o()})(AS,(function(){var i=1e3,o=6e4,u=36e5,c="millisecond",d="second",h="minute",p="hour",m="day",g="week",v="month",b="quarter",_="year",E="date",A="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|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,Q={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(ne){var J=["th","st","nd","rd"],w=ne%100;return"["+ne+(J[(w-20)%10]||J[w]||J[0])+"]"}},X=function(ne,J,w){var k=String(ne);return!k||k.length>=J?ne:""+Array(J+1-k.length).join(w)+ne},se={s:X,z:function(ne){var J=-ne.utcOffset(),w=Math.abs(J),k=Math.floor(w/60),L=w%60;return(J<=0?"+":"-")+X(k,2,"0")+":"+X(L,2,"0")},m:function ne(J,w){if(J.date()1)return ne(le[0])}else{var T=J.name;me[T]=J,L=T}return!k&&L&&(ue=L),L||!k&&ue},V=function(ne,J){if(I(ne))return ne.clone();var w=typeof J=="object"?J:{};return w.date=ne,w.args=arguments,new _e(w)},ee=se;ee.l=ie,ee.i=I,ee.w=function(ne,J){return V(ne,{locale:J.$L,utc:J.$u,x:J.$x,$offset:J.$offset})};var _e=(function(){function ne(w){this.$L=ie(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[C]=!0}var J=ne.prototype;return J.parse=function(w){this.$d=(function(k){var L=k.date,ae=k.utc;if(L===null)return new Date(NaN);if(ee.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var le=L.match(B);if(le){var T=le[2]-1||0,Z=(le[7]||"0").substring(0,3);return ae?new Date(Date.UTC(le[1],T,le[3]||1,le[4]||0,le[5]||0,le[6]||0,Z)):new Date(le[1],T,le[3]||1,le[4]||0,le[5]||0,le[6]||0,Z)}}return new Date(L)})(w),this.init()},J.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.get)DELIM" +R"DELIM(Date(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},J.$utils=function(){return ee},J.isValid=function(){return this.$d.toString()!==A},J.isSame=function(w,k){var L=V(w);return this.startOf(k)<=L&&L<=this.endOf(k)},J.isAfter=function(w,k){return V(w)-1&&w%1==0&&w0?k[Q(0,L-1)]:void 0}function me(w){return ie(w)&&g.call(w,"callee")&&(!b.call(w,"callee")||v.call(w)==a)}var C=Array.isArray;function I(w){return w!=null&&ee(w.length)&&!V(w)}function ie(w){return Oe(w)&&I(w)}function V(w){var k=_e(w)?v.call(w):"";return k==i||k==o}function ee(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=t}function _e(w){var k=typeof w;return!!w&&(k=="object"||k=="function")}function Oe(w){return!!w&&typeof w=="object"}function ne(w){return I(w)?B(w):D(w)}function J(w){return w?h(w,ne(w)):[]}return Rf=ue,Rf}var DS=NS();const jS=Jl(DS);function eo(t){if(!t)return;const a=t.toLowerCase(),i=a.indexOf("1");if(i>0){const u=a.slice(0,i);if(["bc","tb","bcrt","ltc","sb"].includes(u)){const c=a.slice(i+1),d=c.charAt(0);return d==="p"?"p2tr":d==="q"?c.length===39||c.length===40||t.length===42?"p2wpkh":c.length===59||c.length===60||t.length===62?"p2wsh":"segwit":"segwit"}}switch(a[0]){case"1":case"m":case"n":return"p2pkh";case"3":case"2":return"p2sh";default:return}}const kl=new Set;let Of=0;function mv(t){for(const a of kl)a(t)}const Ig=Jg().subtract(2,"hour").unix(),Ai=Array.from({length:20}).map((t,a)=>{const i=`mock-tx-${a.toString().padStart(4,"0")}`,o=[{index:0,address:`bcrt1qmock${String(a)}`,valueSats:1e6+a*1234,scriptType:"p2wpkh",spent:!1,script:{hex:`0014mockoutput${String(a)}`,mnemonic:"OP_0 mock-output-pubkey"}}];return{txid:i,hash:i,status:"confirmed",confirmations:10-Math.floor(a/2),blockHeight:8e5-a,blockHash:`mock-block-${String(Math.floor(a/2))}`,receivedTime:Ig+a*60,feeSats:250+a,feeRate:12+a*.1,size:225+a,weight:900+a*4,version:2,locktime:0,totalInput:1005e3,totalOutput:o.reduce((u,c)=>u+c.valueSats,0),inputs:[{index:0,prevTxId:`mock-prev-${String(a)}`,prevOutputIndex:0,address:`bcrt1qprev${String(a)}`,valueSats:1005e3,scriptType:"p2wpkh",script:{hex:`160014mockinputscriptsig${String(a)}`,mnemonic:"OP_PUSHBYTES_22 mock-input-scriptsig"},witness:["3045022100cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafe","02deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbe"],sequence:4294967293}],outputs:o}}),ba=[];for(let t=0;t<6;t+=1){const a=8e5+t,i=`mock-block-${String(a)}`,o=Ai.slice(t*3,t*3+3);ba.push({hash:i,height:a,timestamp:Ig+t*600,txCount:o.length,size:12e5,weight:4e6,difficulty:5e10,previousBlockHash:t===0?null:ba[t-1]?.hash,merkleRoot:`mock-merkle-${String(t)}`,nonce:1e3+t,bits:486604799,version:2,nextBlockHash:null,transactions:o}),t>0&&(ba[t-1].nextBlockHash=i)}const kS={bcrt1qmock0:{address:"bcrt1qmock0",addressType:eo("bcrt1qmock0"),balance:2345678,totalReceived:5e6,totalSent:2654322,txCount:5,utxoCount:3,transactions:Ai.slice(0,5).map(t=>({txid:t.txid,timestamp:t.receivedTime,valueChange:t.outputs[0]?.valueSats??0,blockHeight:t.blockHeight}))}};function Af(t){if(t==="latest"){const i=ba.at(-1);if(!i)throw new Error("No blocks available");return i}const a=ba.find(i=>i.hash===t||i.height.toString()===t);if(!a)throw new Error("Block not found");return a}function Cd(t){return kS[t]??{address:t,addressType:eo(t),balance:0,totalReceived:0,totalSent:0,txCount:0,utxoCount:0,transactions:[]}}function LS(t){const{transactions:a,...i}=Cd(t);return i}function BS(t,a){const i=Cd(t),o=10,u=a?i.transactions.findIndex(c=>c.txid===a)+1:0;return u<=0&&a?[]:i.transactions.slice(u,u+o)}function Mf(){return{metadata:{id:"mock",label:"Mock data (offline)",type:"mock",connectionState:"connected",supportsWebsocket:!0,endpoint:"offline",description:"Generates synthetic blockchain data for development."},getLatestBlocks(t=10){const a=[...ba].reverse().slice(0,t).map(i=>({hash:i.hash,height:i.height,timestamp:i.timestamp,txCount:i.txCount,size:i.size,weight:i.weight,difficulty:i.difficulty,previousBlockHash:i.previousBlockHash}));return Promise.resolve(a)},getBlockHeader(t){const{transactions:a,...i}=Af(t);return Promise.resolve(i)},getBlock(t){return Promise.resolve(Af(t))},getBlocksBefore(t,a=10){const i=ba.filter(o=>o.height<=t).reverse().slice(0,a).map(o=>({hash:o.hash,height:o.height,timestamp:o.timestamp,txCount:o.txCount,size:o.size,weight:o.weight,difficulty:o.difficulty,previousBlockHash:o.previousBlockHash}));return Promise.resolve(i))DELIM" +R"DELIM(},getBlockTransactions(t,a=0){const i=Af(t);return Promise.resolve(i.transactions.slice(a,a+25))},getTransactionHeader(t){const a=Ai.find(i=>i.txid===t||i.hash===t);return a?Promise.resolve(a):Promise.reject(new Error("Transaction not found"))},getTransaction(t){const a=Ai.find(i=>i.txid===t||i.hash===t);return a?Promise.resolve(a):Promise.reject(new Error("Transaction not found"))},getAddressSummary(t){return Promise.resolve(LS(t))},getAddress(t){return Promise.resolve(Cd(t))},getAddressTransactions(t,a){return Promise.resolve(BS(t,a))},subscribeToEvents(t){return kl.add(t),kl.size===1&&US(),()=>{kl.delete(t),kl.size===0&&HS()}}}}let $l=null;function US(){$l||($l=setInterval(()=>{const t=ZS();ba.push(t),mv({type:"block.new",payload:$S(t)});const a=jS(Ai);a&&mv({type:"tx.new",payload:a})},15e3))}function HS(){$l&&(clearInterval($l),$l=null)}function $S(t){return{hash:t.hash,height:t.height,timestamp:t.timestamp,txCount:t.txCount,size:t.size,weight:t.weight,difficulty:t.difficulty,previousBlockHash:t.previousBlockHash}}function ZS(){Of+=1;const t=ba.at(-1);if(!t)throw new Error("No blocks available");const a=t.height+1,i=`mock-block-${String(a)}-${fv(6)}`,o=Jg().unix(),u=Ai.slice(0,2).map(d=>({...d,blockHash:i,blockHeight:a})),c={hash:i,height:a,timestamp:o,txCount:u.length,size:12e5+Of*1e3,weight:4e6,difficulty:5e10,previousBlockHash:t.hash,merkleRoot:`mock-merkle-${fv(10)}`,nonce:1e3+Of,bits:486604799,version:2,nextBlockHash:null,transactions:u};return t.nextBlockHash=i,c}function F(t,a,i){function o(h,p){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:p,constr:d,traits:new Set},enumerable:!1}),h._zod.traits.has(t))return;h._zod.traits.add(t),a(h,p);const m=d.prototype,g=Object.keys(m);for(let v=0;vi?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(t)}),Object.defineProperty(d,"name",{value:t}),d}class zi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Wg extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}const e0={};function jr(t){return e0}function t0(t){const a=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,u])=>a.indexOf(+o)===-1).map(([o,u])=>u)}function hd(t,a){return typeof a=="bigint"?a.toString():a}function Nd(t){return{get value(){{const a=t();return Object.defineProperty(this,"value",{value:a}),a}}}}function Dd(t){return t==null}function jd(t){const a=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;return t.slice(a,i)}function qS(t,a){const i=(t.toString().split(".")[1]||"").length,o=a.toString();let u=(o.split(".")[1]||"").length;if(u===0&&/\d?e-\d?/.test(o)){const p=o.match(/\d?e-(\d?)/);p?.[1]&&(u=Number.parseInt(p[1]))}const c=i>u?i:u,d=Number.parseInt(t.toFixed(c).replace(".","")),h=Number.parseInt(a.toFixed(c).replace(".",""));return d%h/10**c}const pv=Symbol("evaluating");function tt(t,a,i){let o;Object.defineProperty(t,a,{get(){if(o!==pv)return o===void 0&&(o=pv,o=i()),o},set(u){Object.defineProperty(t,a,{value:u})},configurable:!0})}function Lr(t,a,i){Object.defineProperty(t,a,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Br(...t){const a={};for(const i of t){const o=Object.getOwnPropertyDescriptors(i);Object.assign(a,o)}return Object.defineProperties({},a)}function yv(t){return JSON.stringify(t)}function QS(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const n0="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Gu(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const YS=Nd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Yl(t){if(Gu(t)===!1)return!1;const a=t.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(Gu(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function a0(t){return Yl(t)?{...t}:Array.isArray(t)?[...t]:t}const GS=new Set(["string","number","symbol"]);function es(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tr(t,a,i){const o=new t._zod.constr(a??t._zod.def);return(!a||i?.parent)&&(o._zod.parent=t),o}function Se(t){const a=t;if(!a)return{};if(typeof a=="string")return{error:()=>a};if(a?.message!==void 0){if(a?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");a.error=a.message}return delete a.message,typeof a.error=="string"?{...a,error:()=>a.error}:a}function PS(t){return Object.keys(t).filter)DELIM" +R"DELIM((a=>t[a]._zod.optin==="optional"&&t[a]._zod.optout==="optional")}const VS={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function XS(t,a){const i=t._zod.def,o=Br(t._zod.def,{get shape(){const u={};for(const c in a){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);a[c]&&(u[c]=i.shape[c])}return Lr(this,"shape",u),u},checks:[]});return tr(t,o)}function KS(t,a){const i=t._zod.def,o=Br(t._zod.def,{get shape(){const u={...t._zod.def.shape};for(const c in a){if(!(c in i.shape))throw new Error(`Unrecognized key: "${c}"`);a[c]&&delete u[c]}return Lr(this,"shape",u),u},checks:[]});return tr(t,o)}function FS(t,a){if(!Yl(a))throw new Error("Invalid input to extend: expected a plain object");const i=t._zod.def.checks;if(i&&i.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const u=Br(t._zod.def,{get shape(){const c={...t._zod.def.shape,...a};return Lr(this,"shape",c),c},checks:[]});return tr(t,u)}function JS(t,a){if(!Yl(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i={...t._zod.def,get shape(){const o={...t._zod.def.shape,...a};return Lr(this,"shape",o),o},checks:t._zod.def.checks};return tr(t,i)}function IS(t,a){const i=Br(t._zod.def,{get shape(){const o={...t._zod.def.shape,...a._zod.def.shape};return Lr(this,"shape",o),o},get catchall(){return a._zod.def.catchall},checks:[]});return tr(t,i)}function WS(t,a,i){const o=Br(a._zod.def,{get shape(){const u=a._zod.def.shape,c={...u};if(i)for(const d in i){if(!(d in u))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(c[d]=t?new t({type:"optional",innerType:u[d]}):u[d])}else for(const d in u)c[d]=t?new t({type:"optional",innerType:u[d]}):u[d];return Lr(this,"shape",c),c},checks:[]});return tr(a,o)}function e2(t,a,i){const o=Br(a._zod.def,{get shape(){const u=a._zod.def.shape,c={...u};if(i)for(const d in i){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(c[d]=new t({type:"nonoptional",innerType:u[d]}))}else for(const d in u)c[d]=new t({type:"nonoptional",innerType:u[d]});return Lr(this,"shape",c),c},checks:[]});return tr(a,o)}function Ei(t,a=0){if(t.aborted===!0)return!0;for(let i=a;i{var o;return(o=i).path??(o.path=[]),i.path.unshift(t),i})}function zu(t){return typeof t=="string"?t:t?.message}function kr(t,a,i){const o={...t,path:t.path??[]};if(!t.message){const u=zu(t.inst?._zod.def?.error?.(t))??zu(a?.error?.(t))??zu(i.customError?.(t))??zu(i.localeError?.(t))??"Invalid input";o.message=u}return delete o.inst,delete o.continue,a?.reportInput||delete o.input,o}function kd(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Gl(...t){const[a,i,o]=t;return typeof a=="string"?{message:a,code:"custom",input:i,inst:o}:{...a}}const i0=(t,a)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:a,enumerable:!1}),t.message=JSON.stringify(a,hd,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},l0=F("$ZodError",i0),o0=F("$ZodError",i0,{Parent:Error});function t2(t,a=i=>i.message){const i={},o=[];for(const u of t.issues)u.path.length>0?(i[u.path[0]]=i[u.path[0]]||[],i[u.path[0]].push(a(u))):o.push(a(u));return{formErrors:o,fieldErrors:i}}function n2(t,a=i=>i.message){const i={_errors:[]},o=u=>{for(const c of u.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>o({issues:d}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)i._errors.push(a(c));else{let d=i,h=0;for(;h(a,i,o,u)=>{const c=o?Object.assign(o,{async:!1}):{async:!1},d=a._zod.run({value:i,issues:[]},c);if(d instanceof Promise)throw new zi;if(d.issues.length){const h=new(u?.Err??t)(d.issues.map(p=>kr(p,c,jr())));throw n0(h,u?.callee),h}return d.value},Bd=t=>async(a,i,o,u)=>{const c=o?Object.assign(o,{async:!0}):{async:!0};let d=a._zod.run({value:i,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const h=new(u?.Err??t)(d.issues.map(p=>kr(p,c,jr())));throw n0(h,u?.callee),h}return d.value},ts=t=>(a,i,o)=>{const u=o?{...o,async:!1}:{async:!1},c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise)throw new zi;return c.issues.length?{success:!1,error:new(t??l0)(c.issues.map(d=>kr(d,u,jr())))}:{success:!0,data:c.value}},a2=ts(o0),ns=t=>async(a,i,o)=>{const u=o?Object.assign(o,{async:!0}):{async:!0};let c=a._zod.run({value:i,issues:[]},u);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new t(c.issues.map)DELIM" +R"DELIM((d=>kr(d,u,jr())))}:{success:!0,data:c.value}},r2=ns(o0),i2=t=>(a,i,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ld(t)(a,i,u)},l2=t=>(a,i,o)=>Ld(t)(a,i,o),o2=t=>async(a,i,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Bd(t)(a,i,u)},u2=t=>async(a,i,o)=>Bd(t)(a,i,o),s2=t=>(a,i,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ts(t)(a,i,u)},c2=t=>(a,i,o)=>ts(t)(a,i,o),f2=t=>async(a,i,o)=>{const u=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ns(t)(a,i,u)},d2=t=>async(a,i,o)=>ns(t)(a,i,o),h2=/^[cC][^\s-]{8,}$/,m2=/^[0-9a-z]+$/,p2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,y2=/^[0-9a-vA-V]{20}$/,v2=/^[A-Za-z0-9]{27}$/,g2=/^[a-zA-Z0-9_-]{21}$/,b2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,x2=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vv=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,S2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function w2(){return new RegExp(_2,"u")}const E2=/^(?:(?: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])$/,T2=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,z2=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,R2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,O2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,u0=/^[A-Za-z0-9_-]*$/,A2=/^\+(?:[0-9]){6,14}[0-9]$/,s0="(?:(?:\\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])))",M2=new RegExp(`^${s0}$`);function c0(t){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${a}`:t.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${t.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function C2(t){return new RegExp(`^${c0(t)}$`)}function N2(t){const a=c0({precision:t.precision}),i=["Z"];t.local&&i.push(""),t.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${a}(?:${i.join("|")})`;return new RegExp(`^${s0}T(?:${o})$`)}const D2=t=>{const a=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},j2=/^-?\d+$/,k2=/^-?\d+(?:\.\d+)?/,L2=/^(?:true|false)$/i,B2=/^[^A-Z]*$/,U2=/^[^a-z]*$/,an=F("$ZodCheck",(t,a)=>{var i;t._zod??(t._zod={}),t._zod.def=a,(i=t._zod).onattach??(i.onattach=[])}),f0={number:"number",bigint:"bigint",object:"date"},d0=F("$ZodCheckLessThan",(t,a)=>{an.init(t,a);const i=f0[typeof a.value];t._zod.onattach.push(o=>{const u=o._zod.bag,c=(a.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?o.value<=a.value:o.value{an.init(t,a);const i=f0[typeof a.value];t._zod.onattach.push(o=>{const u=o._zod.bag,c=(a.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>c&&(a.inclusive?u.minimum=a.value:u.exclusiveMinimum=a.value)}),t._zod.check=o=>{(a.inclusive?o.value>=a.value:o.value>a.value)||o.issues.push({origin:i,code:"too_small",minimum:a.value,input:o.value,inclusive:a.inclusive,inst:t,continue:!a.abort})}}),H2=F("$ZodCheckMultipleOf",(t,a)=>{an.init(t,a),t._zod.onattach.push(i=>{var o;(o=i._zod.bag).multipleOf??(o.multipleOf=a.value)}),t._zod.check=i=>{if(typeof i.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%a.value===BigInt(0):qS(i.value,a.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:a.value,input:i.value,inst:t,continue:!a.abort})}}),$2=F("$ZodCheckNumberFormat",(t,a)=>{an.init(t,a),a.format=a.format||"float64";const i=a.format?.includes("int"),o=i?"int":"number",[u,c]=VS[a.format];t._zod.onattach.push(d=>{const h=d._zod.bag;h.format=a.format,h.minim)DELIM" +R"DELIM(um=u,h.maximum=c,i&&(h.pattern=j2)}),t._zod.check=d=>{const h=d.value;if(i){if(!Number.isInteger(h)){d.issues.push({expected:o,format:a.format,code:"invalid_type",continue:!1,input:h,inst:t});return}if(!Number.isSafeInteger(h)){h>0?d.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,continue:!a.abort}):d.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,continue:!a.abort});return}}hc&&d.issues.push({origin:"number",input:h,code:"too_big",maximum:c,inst:t})}}),Z2=F("$ZodCheckMaxLength",(t,a)=>{var i;an.init(t,a),(i=t._zod.def).when??(i.when=o=>{const u=o.value;return!Dd(u)&&u.length!==void 0}),t._zod.onattach.push(o=>{const u=o._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const u=o.value;if(u.length<=a.maximum)return;const d=kd(u);o.issues.push({origin:d,code:"too_big",maximum:a.maximum,inclusive:!0,input:u,inst:t,continue:!a.abort})}}),q2=F("$ZodCheckMinLength",(t,a)=>{var i;an.init(t,a),(i=t._zod.def).when??(i.when=o=>{const u=o.value;return!Dd(u)&&u.length!==void 0}),t._zod.onattach.push(o=>{const u=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>u&&(o._zod.bag.minimum=a.minimum)}),t._zod.check=o=>{const u=o.value;if(u.length>=a.minimum)return;const d=kd(u);o.issues.push({origin:d,code:"too_small",minimum:a.minimum,inclusive:!0,input:u,inst:t,continue:!a.abort})}}),Q2=F("$ZodCheckLengthEquals",(t,a)=>{var i;an.init(t,a),(i=t._zod.def).when??(i.when=o=>{const u=o.value;return!Dd(u)&&u.length!==void 0}),t._zod.onattach.push(o=>{const u=o._zod.bag;u.minimum=a.length,u.maximum=a.length,u.length=a.length}),t._zod.check=o=>{const u=o.value,c=u.length;if(c===a.length)return;const d=kd(u),h=c>a.length;o.issues.push({origin:d,...h?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!a.abort})}}),as=F("$ZodCheckStringFormat",(t,a)=>{var i,o;an.init(t,a),t._zod.onattach.push(u=>{const c=u._zod.bag;c.format=a.format,a.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(a.pattern))}),a.pattern?(i=t._zod).check??(i.check=u=>{a.pattern.lastIndex=0,!a.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:a.format,input:u.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:t,continue:!a.abort})}):(o=t._zod).check??(o.check=()=>{})}),Y2=F("$ZodCheckRegex",(t,a)=>{as.init(t,a),t._zod.check=i=>{a.pattern.lastIndex=0,!a.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:a.pattern.toString(),inst:t,continue:!a.abort})}}),G2=F("$ZodCheckLowerCase",(t,a)=>{a.pattern??(a.pattern=B2),as.init(t,a)}),P2=F("$ZodCheckUpperCase",(t,a)=>{a.pattern??(a.pattern=U2),as.init(t,a)}),V2=F("$ZodCheckIncludes",(t,a)=>{an.init(t,a);const i=es(a.includes),o=new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=o,t._zod.onattach.push(u=>{const c=u._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(o)}),t._zod.check=u=>{u.value.includes(a.includes,a.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:u.value,inst:t,continue:!a.abort})}}),X2=F("$ZodCheckStartsWith",(t,a)=>{an.init(t,a);const i=new RegExp(`^${es(a.prefix)}.*`);a.pattern??(a.pattern=i),t._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(i)}),t._zod.check=o=>{o.value.startsWith(a.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:o.value,inst:t,continue:!a.abort})}}),K2=F("$ZodCheckEndsWith",(t,a)=>{an.init(t,a);const i=new RegExp(`.*${es(a.suffix)}$`);a.pattern??(a.pattern=i),t._zod.onattach.push(o=>{const u=o._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(i)}),t._zod.check=o=>{o.value.endsWith(a.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:o.value,inst:t,continue:!a.abort})}}),F2=F("$ZodCheckOverwrite",(t,a)=>{an.init(t,a),t._zod.check=i=>{i.value=a.tx(i.value)}});class J2{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const o=a.split(` +`).filter(d=>d),u=Math.min(...o.map(d=>d.length-d.trimStart().length)),c=o.map(d=>d.slice(u)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const a=Function,i=this?.args,u=[...(this?.content??[""]).map(c=>` ${c}`)];return new a(...i,u.join(` +`))}}const I2={major:4,minor:2,patch:1},xt=F("$ZodType",(t,a)=>{var i;t??(t={}),t._zod.def=a,t._zod.bag=t._zod.bag||{},t._zod.version=I2;const o=[)DELIM" +R"DELIM(...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(const u of o)for(const c of u._zod.onattach)c(t);if(o.length===0)(i=t._zod).deferred??(i.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const u=(d,h,p)=>{let m=Ei(d),g;for(const v of h){if(v._zod.def.when){if(!v._zod.def.when(d))continue}else if(m)continue;const b=d.issues.length,_=v._zod.check(d);if(_ instanceof Promise&&p?.async===!1)throw new zi;if(g||_ instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await _,d.issues.length!==b&&(m||(m=Ei(d,b)))});else{if(d.issues.length===b)continue;m||(m=Ei(d,b))}}return g?g.then(()=>d):d},c=(d,h,p)=>{if(Ei(d))return d.aborted=!0,d;const m=u(h,o,p);if(m instanceof Promise){if(p.async===!1)throw new zi;return m.then(g=>t._zod.parse(g,p))}return t._zod.parse(m,p)};t._zod.run=(d,h)=>{if(h.skipChecks)return t._zod.parse(d,h);if(h.direction==="backward"){const m=t._zod.parse({value:d.value,issues:[]},{...h,skipChecks:!0});return m instanceof Promise?m.then(g=>c(g,d,h)):c(m,d,h)}const p=t._zod.parse(d,h);if(p instanceof Promise){if(h.async===!1)throw new zi;return p.then(m=>u(m,o,h))}return u(p,o,h)}}t["~standard"]={validate:u=>{try{const c=a2(t,u);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return r2(t,u).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}}),Ud=F("$ZodString",(t,a)=>{xt.init(t,a),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??D2(t._zod.bag),t._zod.parse=(i,o)=>{if(a.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:t}),i}}),lt=F("$ZodStringFormat",(t,a)=>{as.init(t,a),Ud.init(t,a)}),W2=F("$ZodGUID",(t,a)=>{a.pattern??(a.pattern=x2),lt.init(t,a)}),e_=F("$ZodUUID",(t,a)=>{if(a.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(o===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=vv(o))}else a.pattern??(a.pattern=vv());lt.init(t,a)}),t_=F("$ZodEmail",(t,a)=>{a.pattern??(a.pattern=S2),lt.init(t,a)}),n_=F("$ZodURL",(t,a)=>{lt.init(t,a),t._zod.check=i=>{try{const o=i.value.trim(),u=new URL(o);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(u.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:t,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:t,continue:!a.abort})),a.normalize?i.value=u.href:i.value=o;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:t,continue:!a.abort})}}}),a_=F("$ZodEmoji",(t,a)=>{a.pattern??(a.pattern=w2()),lt.init(t,a)}),r_=F("$ZodNanoID",(t,a)=>{a.pattern??(a.pattern=g2),lt.init(t,a)}),i_=F("$ZodCUID",(t,a)=>{a.pattern??(a.pattern=h2),lt.init(t,a)}),l_=F("$ZodCUID2",(t,a)=>{a.pattern??(a.pattern=m2),lt.init(t,a)}),o_=F("$ZodULID",(t,a)=>{a.pattern??(a.pattern=p2),lt.init(t,a)}),u_=F("$ZodXID",(t,a)=>{a.pattern??(a.pattern=y2),lt.init(t,a)}),s_=F("$ZodKSUID",(t,a)=>{a.pattern??(a.pattern=v2),lt.init(t,a)}),c_=F("$ZodISODateTime",(t,a)=>{a.pattern??(a.pattern=N2(a)),lt.init(t,a)}),f_=F("$ZodISODate",(t,a)=>{a.pattern??(a.pattern=M2),lt.init(t,a)}),d_=F("$ZodISOTime",(t,a)=>{a.pattern??(a.pattern=C2(a)),lt.init(t,a)}),h_=F("$ZodISODuration",(t,a)=>{a.pattern??(a.pattern=b2),lt.init(t,a)}),m_=F("$ZodIPv4",(t,a)=>{a.pattern??(a.pattern=E2),lt.init(t,a),t._zod.bag.format="ipv4"}),p_=F("$ZodIPv6",(t,a)=>{a.pattern??(a.pattern=T2),lt.init(t,a),t._zod.bag.format="ipv6",t._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:t,continue:!a.abort})}}}),y_=F("$ZodCIDRv4",(t,a)=>{a.pattern??(a.pattern=z2),lt.init(t,a)}),v_=F("$ZodCIDRv6",(t,a)=>{a.pattern??(a.pattern=R2),lt.init(t,a),t._zod.check=i=>{const o=i.value.split("/");try{if(o.length!==2)throw new Error;const[u,c]=o;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${u}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:t,continue:!a.abort})}}});function m0(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const g_=F("$ZodBase64",(t,a)=>{a.pattern??(a.pattern=O2),lt.init(t,a),t._zod.bag.contentEncoding="base64",t._zod.check=i=>{m0(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:t,continue:!a.abort})}});function b_(t){if(!u0.test(t))return!1;const a=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return m0(i)}const x_=F("$ZodBase64URL",(t,a)=>{a.pattern??(a.pattern=u0),lt.init(t,a),t._zod.bag.contentEncoding="base64url",t._zod.check=i=>{b_(i.value)||i.issues.push({code:"invalid_format",format:"base64url)DELIM" +R"DELIM(",input:i.value,inst:t,continue:!a.abort})}}),S_=F("$ZodE164",(t,a)=>{a.pattern??(a.pattern=A2),lt.init(t,a)});function __(t,a=null){try{const i=t.split(".");if(i.length!==3)return!1;const[o]=i;if(!o)return!1;const u=JSON.parse(atob(o));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||a&&(!("alg"in u)||u.alg!==a))}catch{return!1}}const w_=F("$ZodJWT",(t,a)=>{lt.init(t,a),t._zod.check=i=>{__(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:t,continue:!a.abort})}}),p0=F("$ZodNumber",(t,a)=>{xt.init(t,a),t._zod.pattern=t._zod.bag.pattern??k2,t._zod.parse=(i,o)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const u=i.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return i;const c=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:u,inst:t,...c?{received:c}:{}}),i}}),E_=F("$ZodNumberFormat",(t,a)=>{$2.init(t,a),p0.init(t,a)}),T_=F("$ZodBoolean",(t,a)=>{xt.init(t,a),t._zod.pattern=L2,t._zod.parse=(i,o)=>{if(a.coerce)try{i.value=!!i.value}catch{}const u=i.value;return typeof u=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:t}),i}}),z_=F("$ZodUnknown",(t,a)=>{xt.init(t,a),t._zod.parse=i=>i}),R_=F("$ZodNever",(t,a)=>{xt.init(t,a),t._zod.parse=(i,o)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:t}),i)});function gv(t,a,i){t.issues.length&&a.issues.push(...r0(i,t.issues)),a.value[i]=t.value}const O_=F("$ZodArray",(t,a)=>{xt.init(t,a),t._zod.parse=(i,o)=>{const u=i.value;if(!Array.isArray(u))return i.issues.push({expected:"array",code:"invalid_type",input:u,inst:t}),i;i.value=Array(u.length);const c=[];for(let d=0;dgv(m,i,d))):gv(p,i,d)}return c.length?Promise.all(c).then(()=>i):i}});function Pu(t,a,i,o){t.issues.length&&a.issues.push(...r0(i,t.issues)),t.value===void 0?i in o&&(a.value[i]=void 0):a.value[i]=t.value}function y0(t){const a=Object.keys(t.shape);for(const o of a)if(!t.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const i=PS(t.shape);return{...t,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function v0(t,a,i,o,u,c){const d=[],h=u.keySet,p=u.catchall._zod,m=p.def.type;for(const g in a){if(h.has(g))continue;if(m==="never"){d.push(g);continue}const v=p.run({value:a[g],issues:[]},o);v instanceof Promise?t.push(v.then(b=>Pu(b,i,g,a))):Pu(v,i,g,a)}return d.length&&i.issues.push({code:"unrecognized_keys",keys:d,input:a,inst:c}),t.length?Promise.all(t).then(()=>i):i}const A_=F("$ZodObject",(t,a)=>{if(xt.init(t,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const h=a.shape;Object.defineProperty(a,"shape",{get:()=>{const p={...h};return Object.defineProperty(a,"shape",{value:p}),p}})}const o=Nd(()=>y0(a));tt(t._zod,"propValues",()=>{const h=a.shape,p={};for(const m in h){const g=h[m]._zod;if(g.values){p[m]??(p[m]=new Set);for(const v of g.values)p[m].add(v)}}return p});const u=Gu,c=a.catchall;let d;t._zod.parse=(h,p)=>{d??(d=o.value);const m=h.value;if(!u(m))return h.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),h;h.value={};const g=[],v=d.shape;for(const b of d.keys){const E=v[b]._zod.run({value:m[b],issues:[]},p);E instanceof Promise?g.push(E.then(A=>Pu(A,h,b,m))):Pu(E,h,b,m)}return c?v0(g,m,h,p,o.value,t):g.length?Promise.all(g).then(()=>h):h}}),M_=F("$ZodObjectJIT",(t,a)=>{A_.init(t,a);const i=t._zod.parse,o=Nd(()=>y0(a)),u=b=>{const _=new J2(["shape","payload","ctx"]),E=o.value,A=X=>{const se=yv(X);return`shape[${se}]._zod.run({ value: input[${se}], issues: [] }, ctx)`};_.write("const input = payload.value;");const B=Object.create(null);let D=0;for(const X of E.keys)B[X]=`key_${D++}`;_.write("const newResult = {};");for(const X of E.keys){const se=B[X],ue=yv(X);_.write(`const ${se} = ${A(X)};`),_.write(` + if (${se}.issues.length) { + payload.issues = payload.issues.concat(${se}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${ue}, ...iss.path] : [${ue}] + }))); + } + + + if (${se}.value === undefined) { + if (${ue} in input) { + newResult[${ue}] = undefined; + } + } else { + newResult[${ue}] = ${se}.value; + } + + `)}_.write("payload.value = newResult;"),_.write("return payload;");const Q=_.compile();return(X,se)=>Q(b,X,se)};let c;const d=Gu,h=!e0.jitless,m=h&&YS.value,g=a.catchall;let v;t._zod.parse=(b,_)=>{v??(v=o.value);const E=b.value;return d(E)?h&&m&&_?.async===!1&&_.jitless!==!0?(c||(c=u(a.shape)),b=c(b,_),g?v0([],E,b,_,v,t):b):i(b,_):(b.issues.push({expected:"object",code:"invalid_type",input:E,inst:t}),b)}});function bv(t,a,i,o){for(const c of t)if(c.issues.length===0)return a.value=c.value,a;const u=t.filter(c=>!Ei(c));return u.length===1?(a.val)DELIM" + R"DELIM(ue=u[0].value,u[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:i,errors:t.map(c=>c.issues.map(d=>kr(d,o,jr())))}),a)}const C_=F("$ZodUnion",(t,a)=>{xt.init(t,a),tt(t._zod,"optin",()=>a.options.some(u=>u._zod.optin==="optional")?"optional":void 0),tt(t._zod,"optout",()=>a.options.some(u=>u._zod.optout==="optional")?"optional":void 0),tt(t._zod,"values",()=>{if(a.options.every(u=>u._zod.values))return new Set(a.options.flatMap(u=>Array.from(u._zod.values)))}),tt(t._zod,"pattern",()=>{if(a.options.every(u=>u._zod.pattern)){const u=a.options.map(c=>c._zod.pattern);return new RegExp(`^(${u.map(c=>jd(c.source)).join("|")})$`)}});const i=a.options.length===1,o=a.options[0]._zod.run;t._zod.parse=(u,c)=>{if(i)return o(u,c);let d=!1;const h=[];for(const p of a.options){const m=p._zod.run({value:u.value,issues:[]},c);if(m instanceof Promise)h.push(m),d=!0;else{if(m.issues.length===0)return m;h.push(m)}}return d?Promise.all(h).then(p=>bv(p,u,t,c)):bv(h,u,t,c)}}),N_=F("$ZodIntersection",(t,a)=>{xt.init(t,a),t._zod.parse=(i,o)=>{const u=i.value,c=a.left._zod.run({value:u,issues:[]},o),d=a.right._zod.run({value:u,issues:[]},o);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([p,m])=>xv(i,p,m)):xv(i,c,d)}});function md(t,a){if(t===a)return{valid:!0,data:t};if(t instanceof Date&&a instanceof Date&&+t==+a)return{valid:!0,data:t};if(Yl(t)&&Yl(a)){const i=Object.keys(a),o=Object.keys(t).filter(c=>i.indexOf(c)!==-1),u={...t,...a};for(const c of o){const d=md(t[c],a[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};u[c]=d.data}return{valid:!0,data:u}}if(Array.isArray(t)&&Array.isArray(a)){if(t.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let o=0;o{xt.init(t,a);const i=t0(a.entries),o=new Set(i);t._zod.values=o,t._zod.pattern=new RegExp(`^(${i.filter(u=>GS.has(typeof u)).map(u=>typeof u=="string"?es(u):u.toString()).join("|")})$`),t._zod.parse=(u,c)=>{const d=u.value;return o.has(d)||u.issues.push({code:"invalid_value",values:i,input:d,inst:t}),u}}),j_=F("$ZodTransform",(t,a)=>{xt.init(t,a),t._zod.parse=(i,o)=>{if(o.direction==="backward")throw new Wg(t.constructor.name);const u=a.transform(i.value,i);if(o.async)return(u instanceof Promise?u:Promise.resolve(u)).then(d=>(i.value=d,i));if(u instanceof Promise)throw new zi;return i.value=u,i}});function Sv(t,a){return t.issues.length&&a===void 0?{issues:[],value:void 0}:t}const k_=F("$ZodOptional",(t,a)=>{xt.init(t,a),t._zod.optin="optional",t._zod.optout="optional",tt(t._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),tt(t._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jd(i.source)})?$`):void 0}),t._zod.parse=(i,o)=>{if(a.innerType._zod.optin==="optional"){const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(c=>Sv(c,i.value)):Sv(u,i.value)}return i.value===void 0?i:a.innerType._zod.run(i,o)}}),L_=F("$ZodNullable",(t,a)=>{xt.init(t,a),tt(t._zod,"optin",()=>a.innerType._zod.optin),tt(t._zod,"optout",()=>a.innerType._zod.optout),tt(t._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jd(i.source)}|null)$`):void 0}),tt(t._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),t._zod.parse=(i,o)=>i.value===null?i:a.innerType._zod.run(i,o)}),B_=F("$ZodDefault",(t,a)=>{xt.init(t,a),t._zod.optin="optional",tt(t._zod,"values",()=>a.innerType._zod.values),t._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);if(i.value===void 0)return i.value=a.defaultValue,i;const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(c=>_v(c,a)):_v(u,a)}});function _v(t,a){return t.value===void 0&&(t.value=a.defaultValue),t}const U_=F("$ZodPrefault",(t,a)=>{xt.init(t,a),t._zod.optin="optional",tt(t._zod,"values",()=>a.innerType._zod.values),t._zod.parse=(i,o)=>(o.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,o))}),H_=F("$ZodNonOptional",(t,a)=>{xt.init(t,a),tt(t._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(o=>o!==void 0)):void 0}),t._zod.parse=(i,o)=>{const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(c=>wv(c,t)):wv(u,t)}});function wv(t,a){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:a}),t}const $_=F("$ZodCatch",(t,a)=>{xt.init(t,a),tt(t._zod,"optin",()=>a.innerType._zod.optin)DELIM" + R"DELIM(),tt(t._zod,"optout",()=>a.innerType._zod.optout),tt(t._zod,"values",()=>a.innerType._zod.values),t._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(c=>(i.value=c.value,c.issues.length&&(i.value=a.catchValue({...i,error:{issues:c.issues.map(d=>kr(d,o,jr()))},input:i.value}),i.issues=[]),i)):(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(c=>kr(c,o,jr()))},input:i.value}),i.issues=[]),i)}}),Z_=F("$ZodPipe",(t,a)=>{xt.init(t,a),tt(t._zod,"values",()=>a.in._zod.values),tt(t._zod,"optin",()=>a.in._zod.optin),tt(t._zod,"optout",()=>a.out._zod.optout),tt(t._zod,"propValues",()=>a.in._zod.propValues),t._zod.parse=(i,o)=>{if(o.direction==="backward"){const c=a.out._zod.run(i,o);return c instanceof Promise?c.then(d=>Ru(d,a.in,o)):Ru(c,a.in,o)}const u=a.in._zod.run(i,o);return u instanceof Promise?u.then(c=>Ru(c,a.out,o)):Ru(u,a.out,o)}});function Ru(t,a,i){return t.issues.length?(t.aborted=!0,t):a._zod.run({value:t.value,issues:t.issues},i)}const q_=F("$ZodReadonly",(t,a)=>{xt.init(t,a),tt(t._zod,"propValues",()=>a.innerType._zod.propValues),tt(t._zod,"values",()=>a.innerType._zod.values),tt(t._zod,"optin",()=>a.innerType?._zod?.optin),tt(t._zod,"optout",()=>a.innerType?._zod?.optout),t._zod.parse=(i,o)=>{if(o.direction==="backward")return a.innerType._zod.run(i,o);const u=a.innerType._zod.run(i,o);return u instanceof Promise?u.then(Ev):Ev(u)}});function Ev(t){return t.value=Object.freeze(t.value),t}const Q_=F("$ZodCustom",(t,a)=>{an.init(t,a),xt.init(t,a),t._zod.parse=(i,o)=>i,t._zod.check=i=>{const o=i.value,u=a.fn(o);if(u instanceof Promise)return u.then(c=>Tv(c,i,o,t));Tv(u,i,o,t)}});function Tv(t,a,i,o){if(!t){const u={code:"custom",input:i,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(u.params=o._zod.def.params),a.issues.push(Gl(u))}}var zv;class Y_{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...i){const o=i[0];if(this._map.set(a,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,a)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const i=this._map.get(a);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(a),this}get(a){const i=a._zod.parent;if(i){const o={...this.get(i)??{}};delete o.id;const u={...o,...this._map.get(a)};return Object.keys(u).length?u:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function G_(){return new Y_}(zv=globalThis).__zod_globalRegistry??(zv.__zod_globalRegistry=G_());const Ll=globalThis.__zod_globalRegistry;function P_(t,a){return new t({type:"string",...Se(a)})}function V_(t,a){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Se(a)})}function Rv(t,a){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Se(a)})}function X_(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Se(a)})}function K_(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Se(a)})}function F_(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Se(a)})}function J_(t,a){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Se(a)})}function I_(t,a){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Se(a)})}function W_(t,a){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Se(a)})}function ew(t,a){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Se(a)})}function tw(t,a){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Se(a)})}function nw(t,a){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Se(a)})}function aw(t,a){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Se(a)})}function rw(t,a){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Se(a)})}function iw(t,a){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Se(a)})}function lw(t,a){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Se(a)})}function ow(t,a){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Se(a)})}function uw(t,a){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Se(a)})}function sw(t,a){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Se(a)})}function cw(t,a){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Se(a)})}function fw(t,a){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Se(a)})}function dw(t,a){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Se(a)})}function hw(t,a){return )DELIM" + R"DELIM(new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Se(a)})}function mw(t,a){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Se(a)})}function pw(t,a){return new t({type:"string",format:"date",check:"string_format",...Se(a)})}function yw(t,a){return new t({type:"string",format:"time",check:"string_format",precision:null,...Se(a)})}function vw(t,a){return new t({type:"string",format:"duration",check:"string_format",...Se(a)})}function gw(t,a){return new t({type:"number",checks:[],...Se(a)})}function bw(t,a){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Se(a)})}function xw(t,a){return new t({type:"boolean",...Se(a)})}function Sw(t){return new t({type:"unknown"})}function _w(t,a){return new t({type:"never",...Se(a)})}function Ov(t,a){return new d0({check:"less_than",...Se(a),value:t,inclusive:!1})}function Cf(t,a){return new d0({check:"less_than",...Se(a),value:t,inclusive:!0})}function Av(t,a){return new h0({check:"greater_than",...Se(a),value:t,inclusive:!1})}function Nf(t,a){return new h0({check:"greater_than",...Se(a),value:t,inclusive:!0})}function Mv(t,a){return new H2({check:"multiple_of",...Se(a),value:t})}function g0(t,a){return new Z2({check:"max_length",...Se(a),maximum:t})}function Vu(t,a){return new q2({check:"min_length",...Se(a),minimum:t})}function b0(t,a){return new Q2({check:"length_equals",...Se(a),length:t})}function ww(t,a){return new Y2({check:"string_format",format:"regex",...Se(a),pattern:t})}function Ew(t){return new G2({check:"string_format",format:"lowercase",...Se(t)})}function Tw(t){return new P2({check:"string_format",format:"uppercase",...Se(t)})}function zw(t,a){return new V2({check:"string_format",format:"includes",...Se(a),includes:t})}function Rw(t,a){return new X2({check:"string_format",format:"starts_with",...Se(a),prefix:t})}function Ow(t,a){return new K2({check:"string_format",format:"ends_with",...Se(a),suffix:t})}function Ci(t){return new F2({check:"overwrite",tx:t})}function Aw(t){return Ci(a=>a.normalize(t))}function Mw(){return Ci(t=>t.trim())}function Cw(){return Ci(t=>t.toLowerCase())}function Nw(){return Ci(t=>t.toUpperCase())}function Dw(){return Ci(t=>QS(t))}function jw(t,a,i){return new t({type:"array",element:a,...Se(i)})}function kw(t,a,i){return new t({type:"custom",check:"custom",fn:a,...Se(i)})}function Lw(t){const a=Bw(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(Gl(o,i.value,a._zod.def));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=i.value),u.inst??(u.inst=a),u.continue??(u.continue=!a._zod.def.abort),i.issues.push(Gl(u))}},t(i.value,i)));return a}function Bw(t,a){const i=new an({check:"custom",...Se(a)});return i._zod.check=t,i}function x0(t){let a=t?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Ll,target:a,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Ut(t,a,i={path:[],schemaPath:[]}){var o;const u=t._zod.def,c=a.seen.get(t);if(c)return c.count++,i.schemaPath.includes(t)&&(c.cycle=i.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(t,d);const h=t._zod.toJSONSchema?.();if(h)d.schema=h;else{const g={...i,schemaPath:[...i.schemaPath,t],path:i.path},v=t._zod.parent;if(v)d.ref=v,Ut(v,a,g),a.seen.get(v).isParent=!0;else if(t._zod.processJSONSchema)t._zod.processJSONSchema(a,d.schema,g);else{const b=d.schema,_=a.processors[u.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);_(t,a,b,g)}}const p=a.metadataRegistry.get(t);return p&&Object.assign(d.schema,p),a.io==="input"&&Yt(t)&&(delete d.schema.examples,delete d.schema.default),a.io==="input"&&d.schema._prefault&&((o=d.schema).default??(o.default=d.schema._prefault)),delete d.schema._prefault,a.seen.get(t).schema}function S0(t,a){const i=t.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=c=>{const d=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const g=t.external.registry.get(c[0])?.id,v=t.external.uri??(_=>_);if(g)return{ref:v(g)};const b=c[1].defId??c[1].schema.id??`schema${t.counter++}`;return c[1].defId=b,{defId:b,ref:`${v("__shared")}#/${d}/${b}`}}if(c[1]===i)return{ref:"#"};const p=`#/${d}/`,m=c[1].schema.id??`__schema${t.counter++}`;return{defId:m,ref:p+m}},u=c=>{if(c[1].schema.$ref)return;const d=c[1],{ref:h,defId:p}=o(c);d.def={...d.schema},p&&(d.defId=p);const m=d.schema;for(const g in m)delete m[g];m.$ref=h};if(t.cycles==="throw")for(const c of t.seen.entries()){const d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/ +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of t.seen.entries())DELIM" +R"DELIM(){const d=c[1];if(a===c[0]){u(c);continue}if(t.external){const p=t.external.registry.get(c[0])?.id;if(a!==c[0]&&p){u(c);continue}}if(t.metadataRegistry.get(c[0])?.id){u(c);continue}if(d.cycle){u(c);continue}if(d.count>1&&t.reused==="ref"){u(c);continue}}}function _0(t,a){const i=t.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=d=>{const h=t.seen.get(d),p=h.def??h.schema,m={...p};if(h.ref===null)return;const g=h.ref;if(h.ref=null,g){o(g);const v=t.seen.get(g).schema;v.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):(Object.assign(p,v),Object.assign(p,m))}h.isParent||t.override({zodSchema:d,jsonSchema:p,path:h.path??[]})};for(const d of[...t.seen.entries()].reverse())o(d[0]);const u={};if(t.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const d=t.external.registry.get(a)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=t.external.uri(d)}Object.assign(u,i.def??i.schema);const c=t.external?.defs??{};for(const d of t.seen.entries()){const h=d[1];h.def&&h.defId&&(c[h.defId]=h.def)}t.external||Object.keys(c).length>0&&(t.target==="draft-2020-12"?u.$defs=c:u.definitions=c);try{const d=JSON.parse(JSON.stringify(u));return Object.defineProperty(d,"~standard",{value:{...a["~standard"],jsonSchema:{input:Xu(a,"input"),output:Xu(a,"output")}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Yt(t,a){const i=a??{seen:new Set};if(i.seen.has(t))return!1;i.seen.add(t);const o=t._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Yt(o.element,i);if(o.type==="set")return Yt(o.valueType,i);if(o.type==="lazy")return Yt(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Yt(o.innerType,i);if(o.type==="intersection")return Yt(o.left,i)||Yt(o.right,i);if(o.type==="record"||o.type==="map")return Yt(o.keyType,i)||Yt(o.valueType,i);if(o.type==="pipe")return Yt(o.in,i)||Yt(o.out,i);if(o.type==="object"){for(const u in o.shape)if(Yt(o.shape[u],i))return!0;return!1}if(o.type==="union"){for(const u of o.options)if(Yt(u,i))return!0;return!1}if(o.type==="tuple"){for(const u of o.items)if(Yt(u,i))return!0;return!!(o.rest&&Yt(o.rest,i))}return!1}const Uw=(t,a={})=>i=>{const o=x0({...i,processors:a});return Ut(t,o),S0(o,t),_0(o,t)},Xu=(t,a)=>i=>{const{libraryOptions:o,target:u}=i??{},c=x0({...o??{},target:u,io:a,processors:{}});return Ut(t,c),S0(c,t),_0(c,t)},Hw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$w=(t,a,i,o)=>{const u=i;u.type="string";const{minimum:c,maximum:d,format:h,patterns:p,contentEncoding:m}=t._zod.bag;if(typeof c=="number"&&(u.minLength=c),typeof d=="number"&&(u.maxLength=d),h&&(u.format=Hw[h]??h,u.format===""&&delete u.format),m&&(u.contentEncoding=m),p&&p.size>0){const g=[...p];g.length===1?u.pattern=g[0].source:g.length>1&&(u.allOf=[...g.map(v=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},Zw=(t,a,i,o)=>{const u=i,{minimum:c,maximum:d,format:h,multipleOf:p,exclusiveMaximum:m,exclusiveMinimum:g}=t._zod.bag;typeof h=="string"&&h.includes("int")?u.type="integer":u.type="number",typeof g=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(u.minimum=g,u.exclusiveMinimum=!0):u.exclusiveMinimum=g),typeof c=="number"&&(u.minimum=c,typeof g=="number"&&a.target!=="draft-04"&&(g>=c?delete u.minimum:delete u.exclusiveMinimum)),typeof m=="number"&&(a.target==="draft-04"||a.target==="openapi-3.0"?(u.maximum=m,u.exclusiveMaximum=!0):u.exclusiveMaximum=m),typeof d=="number"&&(u.maximum=d,typeof m=="number"&&a.target!=="draft-04"&&(m<=d?delete u.maximum:delete u.exclusiveMaximum)),typeof p=="number"&&(u.multipleOf=p)},qw=(t,a,i,o)=>{i.type="boolean"},Qw=(t,a,i,o)=>{i.not={}},Yw=(t,a,i,o)=>{},Gw=(t,a,i,o)=>{const u=t._zod.def,c=t0(u.entries);c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),i.enum=c},Pw=(t,a,i,o)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Vw=(t,a,i,o)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Xw=(t,a,i,o)=>{const u=i,c=t._zod.def,{minimum:d,maximum:h}=t._zod.bag;typeof d=="number"&&(u.minItems=d),typeof h=="number"&&(u.maxItems=h),u.type="array",u.items=Ut(c.element,a,{...o,path:[...o.path,"items"]})},Kw=(t,a,i,o)=>{const u=i,c=t._zod.def;u.type="object",u.properties={};const d=c.shape;for(const m in d)u.properties[m]=Ut(d[m],a,{...o,path:[...o.path,"properties",m]});const h=new Set(Object.keys(d)),p=new Set([...h].filter(m=>{co)DELIM" +R"DELIM(nst g=c.shape[m]._zod;return a.io==="input"?g.optin===void 0:g.optout===void 0}));p.size>0&&(u.required=Array.from(p)),c.catchall?._zod.def.type==="never"?u.additionalProperties=!1:c.catchall?c.catchall&&(u.additionalProperties=Ut(c.catchall,a,{...o,path:[...o.path,"additionalProperties"]})):a.io==="output"&&(u.additionalProperties=!1)},Fw=(t,a,i,o)=>{const u=t._zod.def,c=u.inclusive===!1,d=u.options.map((h,p)=>Ut(h,a,{...o,path:[...o.path,c?"oneOf":"anyOf",p]}));c?i.oneOf=d:i.anyOf=d},Jw=(t,a,i,o)=>{const u=t._zod.def,c=Ut(u.left,a,{...o,path:[...o.path,"allOf",0]}),d=Ut(u.right,a,{...o,path:[...o.path,"allOf",1]}),h=m=>"allOf"in m&&Object.keys(m).length===1,p=[...h(c)?c.allOf:[c],...h(d)?d.allOf:[d]];i.allOf=p},Iw=(t,a,i,o)=>{const u=t._zod.def,c=Ut(u.innerType,a,o),d=a.seen.get(t);a.target==="openapi-3.0"?(d.ref=u.innerType,i.nullable=!0):i.anyOf=[c,{type:"null"}]},Ww=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType},eE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType,i.default=JSON.parse(JSON.stringify(u.defaultValue))},tE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(u.defaultValue)))},nE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType;let d;try{d=u.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=d},aE=(t,a,i,o)=>{const u=t._zod.def,c=a.io==="input"?u.in._zod.def.type==="transform"?u.out:u.in:u.out;Ut(c,a,o);const d=a.seen.get(t);d.ref=c},rE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType,i.readOnly=!0},iE=(t,a,i,o)=>{const u=t._zod.def;Ut(u.innerType,a,o);const c=a.seen.get(t);c.ref=u.innerType},lE=F("ZodISODateTime",(t,a)=>{c_.init(t,a),st.init(t,a)});function oE(t){return mw(lE,t)}const uE=F("ZodISODate",(t,a)=>{f_.init(t,a),st.init(t,a)});function sE(t){return pw(uE,t)}const cE=F("ZodISOTime",(t,a)=>{d_.init(t,a),st.init(t,a)});function fE(t){return yw(cE,t)}const dE=F("ZodISODuration",(t,a)=>{h_.init(t,a),st.init(t,a)});function hE(t){return vw(dE,t)}const mE=(t,a)=>{l0.init(t,a),t.name="ZodError",Object.defineProperties(t,{format:{value:i=>n2(t,i)},flatten:{value:i=>t2(t,i)},addIssue:{value:i=>{t.issues.push(i),t.message=JSON.stringify(t.issues,hd,2)}},addIssues:{value:i=>{t.issues.push(...i),t.message=JSON.stringify(t.issues,hd,2)}},isEmpty:{get(){return t.issues.length===0}}})},On=F("ZodError",mE,{Parent:Error}),pE=Ld(On),yE=Bd(On),vE=ts(On),gE=ns(On),bE=i2(On),xE=l2(On),SE=o2(On),_E=u2(On),wE=s2(On),EE=c2(On),TE=f2(On),zE=d2(On),zt=F("ZodType",(t,a)=>(xt.init(t,a),Object.assign(t["~standard"],{jsonSchema:{input:Xu(t,"input"),output:Xu(t,"output")}}),t.toJSONSchema=Uw(t,{}),t.def=a,t.type=a.type,Object.defineProperty(t,"_def",{value:a}),t.check=(...i)=>t.clone(Br(a,{checks:[...a.checks??[],...i.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),t.clone=(i,o)=>tr(t,i,o),t.brand=()=>t,t.register=((i,o)=>(i.add(t,o),t)),t.parse=(i,o)=>pE(t,i,o,{callee:t.parse}),t.safeParse=(i,o)=>vE(t,i,o),t.parseAsync=async(i,o)=>yE(t,i,o,{callee:t.parseAsync}),t.safeParseAsync=async(i,o)=>gE(t,i,o),t.spa=t.safeParseAsync,t.encode=(i,o)=>bE(t,i,o),t.decode=(i,o)=>xE(t,i,o),t.encodeAsync=async(i,o)=>SE(t,i,o),t.decodeAsync=async(i,o)=>_E(t,i,o),t.safeEncode=(i,o)=>wE(t,i,o),t.safeDecode=(i,o)=>EE(t,i,o),t.safeEncodeAsync=async(i,o)=>TE(t,i,o),t.safeDecodeAsync=async(i,o)=>zE(t,i,o),t.refine=(i,o)=>t.check(v4(i,o)),t.superRefine=i=>t.check(g4(i)),t.overwrite=i=>t.check(Ci(i)),t.optional=()=>jv(t),t.nullable=()=>kv(t),t.nullish=()=>jv(kv(t)),t.nonoptional=i=>c4(t,i),t.array=()=>Mi(t),t.or=i=>WE([t,i]),t.and=i=>t4(t,i),t.transform=i=>Lv(t,r4(i)),t.default=i=>o4(t,i),t.prefault=i=>s4(t,i),t.catch=i=>d4(t,i),t.pipe=i=>Lv(t,i),t.readonly=()=>p4(t),t.describe=i=>{const o=t.clone();return Ll.add(o,{description:i}),o},Object.defineProperty(t,"description",{get(){return Ll.get(t)?.description},configurable:!0}),t.meta=(...i)=>{if(i.length===0)return Ll.get(t);const o=t.clone();return Ll.add(o,i[0]),o},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),w0=F("_ZodString",(t,a)=>{Ud.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(o,u,c)=>$w(t,o,u);const i=t._zod.bag;t.format=i.format??null,t.minLength=i.minimum??null,t.maxLength=i.maximum??null,t.regex=(...o)=>t.check(ww(...o)),t.includes=(...o)=>t.check(zw(...o)),t.startsWith=(...o)=>t.check(Rw(...o)),t.endsWith=(...o)=>t.check(Ow(...o)),t.min=(...o)=>t.check(Vu(...o)),t.max=(...o)=>t.check(g0(...o)),t.length=(...o)=>t.check(b0(...o)),t.nonempty=(...o)=>t.check(Vu(1,...o)),t.lowercase=o=>t.check(Ew(o)),t.uppercase=o=>t.check(Tw(o)),t.trim=()=>t.check(Mw()),t.normalize=(...o)=>t.check(Aw(...o)),t.toLowerCase=()=>t.check(Cw()),t.toUpperCase=()=>t.check(Nw()),t.slugify=()=>t.check)DELIM" +R"DELIM((Dw())}),RE=F("ZodString",(t,a)=>{Ud.init(t,a),w0.init(t,a),t.email=i=>t.check(V_(OE,i)),t.url=i=>t.check(I_(AE,i)),t.jwt=i=>t.check(hw(YE,i)),t.emoji=i=>t.check(W_(ME,i)),t.guid=i=>t.check(Rv(Cv,i)),t.uuid=i=>t.check(X_(Ou,i)),t.uuidv4=i=>t.check(K_(Ou,i)),t.uuidv6=i=>t.check(F_(Ou,i)),t.uuidv7=i=>t.check(J_(Ou,i)),t.nanoid=i=>t.check(ew(CE,i)),t.guid=i=>t.check(Rv(Cv,i)),t.cuid=i=>t.check(tw(NE,i)),t.cuid2=i=>t.check(nw(DE,i)),t.ulid=i=>t.check(aw(jE,i)),t.base64=i=>t.check(cw(ZE,i)),t.base64url=i=>t.check(fw(qE,i)),t.xid=i=>t.check(rw(kE,i)),t.ksuid=i=>t.check(iw(LE,i)),t.ipv4=i=>t.check(lw(BE,i)),t.ipv6=i=>t.check(ow(UE,i)),t.cidrv4=i=>t.check(uw(HE,i)),t.cidrv6=i=>t.check(sw($E,i)),t.e164=i=>t.check(dw(QE,i)),t.datetime=i=>t.check(oE(i)),t.date=i=>t.check(sE(i)),t.time=i=>t.check(fE(i)),t.duration=i=>t.check(hE(i))});function Tt(t){return P_(RE,t)}const st=F("ZodStringFormat",(t,a)=>{lt.init(t,a),w0.init(t,a)}),OE=F("ZodEmail",(t,a)=>{t_.init(t,a),st.init(t,a)}),Cv=F("ZodGUID",(t,a)=>{W2.init(t,a),st.init(t,a)}),Ou=F("ZodUUID",(t,a)=>{e_.init(t,a),st.init(t,a)}),AE=F("ZodURL",(t,a)=>{n_.init(t,a),st.init(t,a)}),ME=F("ZodEmoji",(t,a)=>{a_.init(t,a),st.init(t,a)}),CE=F("ZodNanoID",(t,a)=>{r_.init(t,a),st.init(t,a)}),NE=F("ZodCUID",(t,a)=>{i_.init(t,a),st.init(t,a)}),DE=F("ZodCUID2",(t,a)=>{l_.init(t,a),st.init(t,a)}),jE=F("ZodULID",(t,a)=>{o_.init(t,a),st.init(t,a)}),kE=F("ZodXID",(t,a)=>{u_.init(t,a),st.init(t,a)}),LE=F("ZodKSUID",(t,a)=>{s_.init(t,a),st.init(t,a)}),BE=F("ZodIPv4",(t,a)=>{m_.init(t,a),st.init(t,a)}),UE=F("ZodIPv6",(t,a)=>{p_.init(t,a),st.init(t,a)}),HE=F("ZodCIDRv4",(t,a)=>{y_.init(t,a),st.init(t,a)}),$E=F("ZodCIDRv6",(t,a)=>{v_.init(t,a),st.init(t,a)}),ZE=F("ZodBase64",(t,a)=>{g_.init(t,a),st.init(t,a)}),qE=F("ZodBase64URL",(t,a)=>{x_.init(t,a),st.init(t,a)}),QE=F("ZodE164",(t,a)=>{S_.init(t,a),st.init(t,a)}),YE=F("ZodJWT",(t,a)=>{w_.init(t,a),st.init(t,a)}),E0=F("ZodNumber",(t,a)=>{p0.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(o,u,c)=>Zw(t,o,u),t.gt=(o,u)=>t.check(Av(o,u)),t.gte=(o,u)=>t.check(Nf(o,u)),t.min=(o,u)=>t.check(Nf(o,u)),t.lt=(o,u)=>t.check(Ov(o,u)),t.lte=(o,u)=>t.check(Cf(o,u)),t.max=(o,u)=>t.check(Cf(o,u)),t.int=o=>t.check(Nv(o)),t.safe=o=>t.check(Nv(o)),t.positive=o=>t.check(Av(0,o)),t.nonnegative=o=>t.check(Nf(0,o)),t.negative=o=>t.check(Ov(0,o)),t.nonpositive=o=>t.check(Cf(0,o)),t.multipleOf=(o,u)=>t.check(Mv(o,u)),t.step=(o,u)=>t.check(Mv(o,u)),t.finite=()=>t;const i=t._zod.bag;t.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),t.isFinite=!0,t.format=i.format??null});function qe(t){return gw(E0,t)}const GE=F("ZodNumberFormat",(t,a)=>{E_.init(t,a),E0.init(t,a)});function Nv(t){return bw(GE,t)}const PE=F("ZodBoolean",(t,a)=>{T_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>qw(t,i,o)});function Hd(t){return xw(PE,t)}const VE=F("ZodUnknown",(t,a)=>{z_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Yw()});function Dv(){return Sw(VE)}const XE=F("ZodNever",(t,a)=>{R_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Qw(t,i,o)});function KE(t){return _w(XE,t)}const FE=F("ZodArray",(t,a)=>{O_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Xw(t,i,o,u),t.element=a.element,t.min=(i,o)=>t.check(Vu(i,o)),t.nonempty=i=>t.check(Vu(1,i)),t.max=(i,o)=>t.check(g0(i,o)),t.length=(i,o)=>t.check(b0(i,o)),t.unwrap=()=>t.element});function Mi(t,a){return jw(FE,t,a)}const JE=F("ZodObject",(t,a)=>{M_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Kw(t,i,o,u),tt(t,"shape",()=>a.shape),t.keyof=()=>n4(Object.keys(t._zod.def.shape)),t.catchall=i=>t.clone({...t._zod.def,catchall:i}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Dv()}),t.loose=()=>t.clone({...t._zod.def,catchall:Dv()}),t.strict=()=>t.clone({...t._zod.def,catchall:KE()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=i=>FS(t,i),t.safeExtend=i=>JS(t,i),t.merge=i=>IS(t,i),t.pick=i=>XS(t,i),t.omit=i=>KS(t,i),t.partial=(...i)=>WS(T0,t,i[0]),t.required=(...i)=>e2(z0,t,i[0])});function Xn(t,a){const i={type:"object",shape:t??{},...Se(a)};return new JE(i)}const IE=F("ZodUnion",(t,a)=>{C_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Fw(t,i,o,u),t.options=a.options});function WE(t,a){return new IE({type:"union",options:t,...Se(a)})}const e4=F("ZodIntersection",(t,a)=>{N_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Jw(t,i,o,u)});function t4(t,a){return new e4({type:"intersection",left:t,right:a})}const pd=F("ZodEnum",(t,a)=>{D_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(o,u,c)=>Gw(t,o,u),t.enum=a.entries,t.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));t.extract=(o,u)=>{const c={};for(const d of o)if(i.has(d))c[d]=a.entries[d];else throw new Error(`Key ${d} not found in enum`))DELIM" +R"DELIM(;return new pd({...a,checks:[],...Se(u),entries:c})},t.exclude=(o,u)=>{const c={...a.entries};for(const d of o)if(i.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new pd({...a,checks:[],...Se(u),entries:c})}});function n4(t,a){const i=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new pd({type:"enum",entries:i,...Se(a)})}const a4=F("ZodTransform",(t,a)=>{j_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Vw(t,i),t._zod.parse=(i,o)=>{if(o.direction==="backward")throw new Wg(t.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(Gl(c,i.value,a));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=i.value),d.inst??(d.inst=t),i.issues.push(Gl(d))}};const u=a.transform(i.value,i);return u instanceof Promise?u.then(c=>(i.value=c,i)):(i.value=u,i)}});function r4(t){return new a4({type:"transform",transform:t})}const T0=F("ZodOptional",(t,a)=>{k_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>iE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function jv(t){return new T0({type:"optional",innerType:t})}const i4=F("ZodNullable",(t,a)=>{L_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Iw(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function kv(t){return new i4({type:"nullable",innerType:t})}const l4=F("ZodDefault",(t,a)=>{B_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>eE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function o4(t,a){return new l4({type:"default",innerType:t,get defaultValue(){return typeof a=="function"?a():a0(a)}})}const u4=F("ZodPrefault",(t,a)=>{U_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>tE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function s4(t,a){return new u4({type:"prefault",innerType:t,get defaultValue(){return typeof a=="function"?a():a0(a)}})}const z0=F("ZodNonOptional",(t,a)=>{H_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Ww(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function c4(t,a){return new z0({type:"nonoptional",innerType:t,...Se(a)})}const f4=F("ZodCatch",(t,a)=>{$_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>nE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function d4(t,a){return new f4({type:"catch",innerType:t,catchValue:typeof a=="function"?a:()=>a})}const h4=F("ZodPipe",(t,a)=>{Z_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>aE(t,i,o,u),t.in=a.in,t.out=a.out});function Lv(t,a){return new h4({type:"pipe",in:t,out:a})}const m4=F("ZodReadonly",(t,a)=>{q_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>rE(t,i,o,u),t.unwrap=()=>t._zod.def.innerType});function p4(t){return new m4({type:"readonly",innerType:t})}const y4=F("ZodCustom",(t,a)=>{Q_.init(t,a),zt.init(t,a),t._zod.processJSONSchema=(i,o,u)=>Pw(t,i)});function v4(t,a={}){return kw(y4,t,a)}function g4(t){return Lw(t)}class $d extends Error{constructor(a,i){super(a),this.status=i}}const yd=Xn({id:Tt(),height:qe(),timestamp:qe().optional(),mediantime:qe().optional(),tx_count:qe().optional(),size:qe().optional(),weight:qe().optional(),difficulty:qe().optional(),bits:qe().optional(),merkle_root:Tt().optional(),previousblockhash:Tt().nullable().optional(),nonce:qe().optional(),version:qe().optional()}).loose(),b4=Xn({confirmed:Hd(),block_height:qe().optional(),block_hash:Tt().optional(),block_time:qe().optional()}),x4=Xn({txid:Tt().optional().nullable(),vout:qe().optional().nullable(),sequence:qe().optional(),scriptsig:Tt().optional().nullable(),scriptsig_asm:Tt().optional().nullable(),witness:Mi(Tt()).optional(),is_coinbase:Hd().optional(),prevout:Xn({scriptpubkey_type:Tt().optional(),scriptpubkey_address:Tt().optional(),scriptpubkey:Tt().optional(),scriptpubkey_asm:Tt().optional(),value:qe().optional()}).partial().nullable().optional()}).loose(),S4=Xn({scriptpubkey_type:Tt().optional(),scriptpubkey_address:Tt().optional(),scriptpubkey:Tt().optional(),scriptpubkey_asm:Tt().optional(),value:qe(),n:qe().optional()}).loose(),R0=Xn({txid:Tt(),hash:Tt().optional(),fee:qe().optional(),version:qe(),locktime:qe(),vin:Mi(x4),vout:Mi(S4),size:qe(),weight:qe(),status:b4}).loose(),Lu=Mi(yd),Ku=Mi(R0),Bv=Xn({in_best_chain:Hd(),next_best:Tt().optional(),height:qe().optional()}),Uv=Xn({address:Tt(),chain_stats:Xn({funded_txo_count:qe().optional(),funded_txo_sum:qe().optional(),spent_txo_count:qe().optional(),spent_txo_sum:qe().optional(),tx_count:qe().optional()}),mempool_stats:Xn({funded_txo_count:qe().optional(),funded_txo_sum:qe().optional(),spent_txo_count:qe().optional(),spent_txo_sum:qe().optional(),tx_count:qe().optional()})});async function Gt(t,a,i){const o=a.startsWith("/")?a:`/${a}`,u=await fetch(`${t}${o}`);if(!u.ok)throw new $d(`Request to ${a} failed with status ${String(u.status)}`,u.status);const c=await u.json();return i.parse(c)}async function Hv(t,a){const i=await fetch(`${t}/blocks/tip/height`);if(!i.ok)throw new $d("Unable to fetch tip height",i.status);const o=await i.text(),u=Numb)DELIM" +R"DELIM(er(o.trim());if(!Number.isFinite(u))throw new TypeError("Invalid tip height response");return a.lastKnownHeight=u,u}async function xi(t,a,i){if(a.lastKnownHeight===null){await Hv(t,a);return}typeof i=="number"&&a.lastKnownHeightc.scriptpubkey_address===t?u+c.value:u,0),o=a.vin.reduce((u,c)=>{const d=c.prevout;return d?.scriptpubkey_address===t&&typeof d.value=="number"?u+d.value:u},0);return i-o}async function Df(t,a){if(a==="latest"||a==="tip"){const i=await Gt(t,"/blocks",Lu);if(i.length===0)throw new Error("No blocks returned from API");return i[0].id}if(/^\d+$/.test(a)){const i=await fetch(`${t}/block-height/${a}`);if(!i.ok)throw new $d("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function $v(t,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const o=a+1;try{const u=await fetch(`${t}/block-height/${String(o)}`);return u.ok&&(await u.text()).trim()||null}catch(u){return console.warn(`Failed to resolve hash for height ${String(o)}`,u),null}}function Ol(t){return{hash:t.id,height:t.height,timestamp:t.timestamp??t.mediantime??0,txCount:t.tx_count??0,size:t.size??0,weight:t.weight??0,difficulty:t.difficulty,previousBlockHash:t.previousblockhash??null}}function jf(t,a){const i=t.status.confirmed?"confirmed":"unconfirmed",o=t.vin.map((p,m)=>{const g=p.is_coinbase||p.txid==null?void 0:typeof p.vout=="number"&&p.vout!==4294967295?p.vout:void 0;return{index:m,prevTxId:p.txid??void 0,prevOutputIndex:g,address:p.prevout?.scriptpubkey_address??void 0,valueSats:p.prevout?.value,scriptType:p.prevout?.scriptpubkey_type,isCoinbase:p.is_coinbase??!1,script:p.scriptsig||p.scriptsig_asm?{hex:p.scriptsig??void 0,mnemonic:p.scriptsig_asm??void 0}:void 0,witness:p.witness??void 0,sequence:p.sequence}}),u=t.vout.map((p,m)=>({index:m,address:p.scriptpubkey_address??void 0,valueSats:p.value,scriptType:p.scriptpubkey_type,spent:void 0,script:p.scriptpubkey||p.scriptpubkey_asm?{hex:p.scriptpubkey??void 0,mnemonic:p.scriptpubkey_asm??void 0}:void 0})),c=u.reduce((p,m)=>p+m.valueSats,0),d=a.lastKnownHeight;let h=0;return t.status.block_height&&i==="confirmed"&&(h=d&&d>=t.status.block_height?d-t.status.block_height+1:1),{txid:t.txid,hash:t.hash??t.txid,status:i,confirmations:h,blockHeight:t.status.block_height,blockHash:t.status.block_hash,receivedTime:t.status.block_time,feeSats:t.fee??null,feeRate:t.fee?t.fee/t.weight*4:null,size:t.size,weight:t.weight,version:t.version,locktime:t.locktime,totalInput:null,totalOutput:c,inputs:o,outputs:u}}function w4(t,a){const i=t.chain_stats,o=t.mempool_stats,u=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),c=O0(t.address,a.slice(0,25));return{address:t.address,addressType:eo(t.address),balance:u,totalReceived:(i.funded_txo_sum??0)+(o.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(o.spent_txo_sum??0),txCount:(i.tx_count??0)+(o.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:c}}function E4(t){const a=t.chain_stats,i=t.mempool_stats,o=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:t.address,addressType:eo(t.address),balance:o,totalReceived:(a.funded_txo_sum??0)+(i.funded_txo_sum??0),totalSent:(a.spent_txo_sum??0)+(i.spent_txo_sum??0),txCount:(a.tx_count??0)+(i.tx_count??0),utxoCount:(a.funded_txo_count??0)-(a.spent_txo_count??0)}}function O0(t,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:_4(t,i),blockHeight:i.status.block_height}))}async function Zv(t,a,i=0){const o=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return Gt(t,o,Ku)}async function T4(t,a,i){return i?Gt(t,`/address/${a}/txs/chain/${i}`,Ku):Gt(t,`/address/${a}/txs`,Ku)}function A0({baseUrl:t}){const a=new Set;let i=null;const o={lastBlockHash:null,lastKnownHeight:null};async function u(h){const p=await Gt(t,`/tx/${h}`,R0);return await(p.status.block_height?xi(t,o,p.status.block_height):xi(t,o)),jf(p,o)}function c(){i||a.size===0||(i=setInterval(async()=>{try{const h=await Gt(t,"/blocks",Lu);if(h.length===0)return;const p=h[0];if(p.id!==o.lastBlockHash){o.lastBlockHash=p.id,o.lastKnownHeight=Math.max(p.height,o.lastKnownHeight??0);const m=Ol(p);for(const g of a)g({type:"block.new",payload:m})}}catch(h){console.warn("Block polling failed",h)}},15e3))}function d(){i&&(clearInterval(i),i=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,endpoint:t,description:"Read-only adapter using Blockstream public REST API."},async getLatestBlocks(h=10){const p=await Gt(t,"/blocks",Lu);return p.length>0&&(o.lastBlockHash=p[0].id,o.lastKnownHeight=Math.max(p[0].height,o.lastKnownHeight??0)),p.slice(0,h).map(m=>Ol(m))},async getBlocksBefore(h,p=10){const m=Math.max(h,0),g=await Gt(t,`/blocks/${String(m)}`,Lu);return g.length>0&&(o.lastKnownHeight=Math.max(g[0].height,o.lastKnownHeight??0)),g.slice(0,p).map(v=>Ol(v))},async getBlockHeader(h){const p=await Df(t,h);await xi(t,)DELIM" +R"DELIM(o);const[m,g]=await Promise.all([Gt(t,`/block/${p}`,yd),Gt(t,`/block/${p}/status`,Bv).catch(()=>null)]),v=Ol(m);o.lastBlockHash=v.hash,o.lastKnownHeight=Math.max(v.height,o.lastKnownHeight??v.height);let b=g?.next_best??null;return b||(b=await $v(t,v.height,o)),{...v,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:b}},async getBlock(h){const p=await Df(t,h);await xi(t,o);const m=await Gt(t,`/block/${p}`,yd),[g,v]=await Promise.allSettled([Zv(t,p),Gt(t,`/block/${p}/status`,Bv)]);g.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",g.reason),v.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",v.reason);const b=Ol(m);o.lastBlockHash=b.hash,o.lastKnownHeight=Math.max(b.height,o.lastKnownHeight??b.height);const _=g.status==="fulfilled"?g.value:[];let A=(v.status==="fulfilled"?v.value:null)?.next_best??null;return A||(A=await $v(t,b.height,o)),{...b,merkleRoot:m.merkle_root,nonce:m.nonce,bits:m.bits,version:m.version,nextBlockHash:A,transactions:_.map(D=>jf(D,o))}},async getBlockTransactions(h,p=0){const m=await Df(t,h),g=await Zv(t,m,p),v=g.reduce((b,_)=>_.status.block_height?b===null?_.status.block_height:Math.max(b,_.status.block_height):b,null);return await(typeof v=="number"?xi(t,o,v):xi(t,o)),g.map(b=>jf(b,o))},async getTransactionHeader(h){return u(h)},async getTransaction(h){return u(h)},async getAddressSummary(h){const p=await Gt(t,`/address/${h}`,Uv);return E4(p)},async getAddress(h){const p=await Gt(t,`/address/${h}`,Uv),m=await Gt(t,`/address/${h}/txs`,Ku);return w4(p,m)},async getAddressTransactions(h,p){const m=await T4(t,h,p);return O0(h,m)},subscribeToEvents(h){return a.add(h),c(),()=>{a.delete(h),a.size===0&&d()}}}}function z4({baseUrl:t}){const a=A0({baseUrl:t});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:t,description:"Adapter backed by mempool.space REST API."}}}function Pl(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function M0(t,a){return Array.isArray(a)?a.length===0?!0:t?a.every(i=>typeof i=="string"):a.every(i=>Number.isSafeInteger(i)):!1}function C0(t){if(typeof t!="function")throw new Error("function expected");return!0}function Vl(t,a){if(typeof a!="string")throw new Error(`${t}: string expected`);return!0}function to(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function Fu(t){if(!Array.isArray(t))throw new Error("array expected")}function N0(t,a){if(!M0(!0,a))throw new Error(`${t}: array of strings expected`)}function Zd(t,a){if(!M0(!1,a))throw new Error(`${t}: array of numbers expected`)}function qd(...t){const a=c=>c,i=(c,d)=>h=>c(d(h)),o=t.map(c=>c.encode).reduceRight(i,a),u=t.map(c=>c.decode).reduce(i,a);return{encode:o,decode:u}}function D0(t){const a=typeof t=="string"?t.split(""):t,i=a.length;N0("alphabet",a);const o=new Map(a.map((u,c)=>[u,c]));return{encode:u=>(Fu(u),u.map(c=>{if(!Number.isSafeInteger(c)||c<0||c>=i)throw new Error(`alphabet.encode: digit index outside alphabet "${c}". Allowed: ${t}`);return a[c]})),decode:u=>(Fu(u),u.map(c=>{Vl("alphabet.decode",c);const d=o.get(c);if(d===void 0)throw new Error(`Unknown letter: "${c}". Allowed: ${t}`);return d}))}}function j0(t=""){return Vl("join",t),{encode:a=>(N0("join.decode",a),a.join(t)),decode:a=>(Vl("join.decode",a),a.split(t))}}function qv(t,a,i){if(a<2)throw new Error(`convertRadix: invalid from=${a}, base cannot be less than 2`);if(i<2)throw new Error(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(Fu(t),!t.length)return[];let o=0;const u=[],c=Array.from(t,h=>{if(to(h),h<0||h>=a)throw new Error(`invalid integer: ${h}`);return h}),d=c.length;for(;;){let h=0,p=!0;for(let m=o;ma===0?t:k0(a,t%a),Ju=(t,a)=>t+(a-k0(t,a)),Bu=(()=>{let t=[];for(let a=0;a<40;a++)t.push(2**a);return t})();function vd(t,a,i,o){if(Fu(t),a<=0||a>32)throw new Error(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new Error(`convertRadix2: wrong to=${i}`);if(Ju(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${Ju(a,i)}`);let u=0,c=0;const d=Bu[a],h=Bu[i]-1,p=[];for(const m of t){if(to(m),m>=d)throw new Error(`convertRadix2: invalid data word=${m} from=${a}`);if(u=u<32)throw new Error(`convertRadix2: carry overflow pos=${c} from=${a}`);for(c+=a;c>=i;c-=i)p.push((u>>c-i&h)>>>0);const g=Bu[c];if(g===void 0)throw new Error("invalid carry");u&=g-1}if(u=u<=a)throw new Error("Excess padding");if(!o&&u>0)throw new Error(`Non-zero padding: ${u}`);return o&&c>0&&p.push)DELIM" +R"DELIM((u>>>0),p}function R4(t){to(t);const a=2**8;return{encode:i=>{if(!Pl(i))throw new Error("radix.encode input should be Uint8Array");return qv(Array.from(i),a,t)},decode:i=>(Zd("radix.decode",i),Uint8Array.from(qv(i,t,a)))}}function O4(t,a=!1){if(to(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Ju(8,t)>32||Ju(t,8)>32)throw new Error("radix2: carry overflow");return{encode:i=>{if(!Pl(i))throw new Error("radix2.encode input should be Uint8Array");return vd(Array.from(i),8,t,!a)},decode:i=>(Zd("radix2.decode",i),Uint8Array.from(vd(i,t,8,a)))}}function Qv(t){return C0(t),function(...a){try{return t.apply(null,a)}catch{}}}function A4(t,a){return to(t),C0(a),{encode(i){if(!Pl(i))throw new Error("checksum.encode: input should be Uint8Array");const o=a(i).slice(0,t),u=new Uint8Array(i.length+t);return u.set(i),u.set(o,i.length),u},decode(i){if(!Pl(i))throw new Error("checksum.decode: input should be Uint8Array");const o=i.slice(0,-t),u=i.slice(-t),c=a(o).slice(0,t);for(let d=0;dqd(R4(58),D0(t),j0("")),C4=M4("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),N4=t=>qd(A4(4,a=>t(t(a))),C4),gd=qd(D0("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),j0("")),Yv=[996825010,642813549,513874426,1027748829,705979059];function Al(t){const a=t>>25;let i=(t&33554431)<<5;for(let o=0;o>o&1)===1&&(i^=Yv[o]);return i}function Gv(t,a,i=1){const o=t.length;let u=1;for(let c=0;c126)throw new Error(`Invalid prefix (${t})`);u=Al(u)^d>>5}u=Al(u);for(let c=0;c_)throw new TypeError(`Length ${A} exceeds limit ${_}`);const B=v.toLowerCase(),D=Gv(B,b,a);return`${B}1${gd.encode(b)}${D}`}function h(v,b=90){Vl("bech32.decode input",v);const _=v.length;if(_<8||b!==!1&&_>b)throw new TypeError(`invalid string length: ${_} (${v}). Expected (8..${b})`);const E=v.toLowerCase();if(v!==E&&v!==v.toUpperCase())throw new Error("String must be lowercase or uppercase");const A=E.lastIndexOf("1");if(A===0||A===-1)throw new Error('Letter "1" must be present between prefix and data only');const B=E.slice(0,A),D=E.slice(A+1);if(D.length<6)throw new Error("Data must be at least 6 characters long");const Q=gd.decode(D).slice(0,-6),X=Gv(B,Q,a);if(!D.endsWith(X))throw new Error(`Invalid checksum in ${v}: expected "${X}"`);return{prefix:B,words:Q}}const p=Qv(h);function m(v){const{prefix:b,words:_}=h(v,!1);return{prefix:b,words:_,bytes:o(_)}}function g(v,b){return d(v,u(b))}return{encode:d,decode:h,encodeFromBytes:g,decodeToBytes:m,decodeUnsafe:p,fromWords:o,fromWordsUnsafe:c,toWords:u}}const Iu=L0("bech32"),bd=L0("bech32m");function D4(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Qd(t,a,i=""){const o=D4(t),u=t?.length;if(!o||a!==void 0){const d=i&&`"${i}" `,h="",p=o?`length=${u}`:`type=${typeof t}`;throw new Error(d+"expected Uint8Array"+h+", got "+p)}return t}function Pv(t,a=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(a&&t.finished)throw new Error("Hash#digest() has already been called")}function j4(t,a){Qd(t,void 0,"digestInto() output");const i=a.outputLen;if(t.length='+i)}function xd(...t){for(let a=0;a>>a}const k4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",L4=Array.from({length:256},(t,a)=>a.toString(16).padStart(2,"0"));function Uu(t){if(Qd(t),k4)return t.toHex();let a="";for(let i=0;it(c).update(u).digest(),o=t(void 0);return i.outputLen=o.outputLen,i.blockLen=o.blockLen,i.create=u=>t(u),Object.assign(i,a),Object.freeze(i)}const U4=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function H4(t,a,i){return t&a^~t&i}function $4(t,a,i){return t&a^t&i^a&i}class Z4{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,o,u){this.blockLen=a,this.outputLen=i,this.padOffset=o,this.isLE=u,this.buffer=new Uint8Array(a),this.view=kf(this.buffer)}update(a){Pv(this),Qd(a);const{view:i,buffer:o,blockLen:u}=this,c=a.length;for(let d=0;du-d&&(this.process(o,0),d=0);for(let v=d;vg.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v>>3,A=Pn(_,17)^Pn(_,19)^_>>>10;Xa[v]=A+Xa[v-7]+E+Xa[v-16]|0}let{A:o,B:u,C:c,D:d,E:h,F:p,G:m,H:g}=this;for(let v=0;v<64;v++){const b=Pn(h,6)^Pn(h,11)^Pn(h,25),_=g+b+H4(h,p,m)+q4[v]+Xa[v]|0,A=(Pn(o,2)^Pn(o,13)^Pn(o,22))+$4(o,u,c)|0;g=m,m=p,p=h,h=d+_|0,d=c,c=u,u=o,o=_+A|0}o=o+this.A|0,u=u+this.B|0,c=c+this.C|0,d=d+this.D|0,h=h+this.E|0,p=p+this.F|0,m=m+this.G|0,g=g+this.H|0,this.set(o,u,c,d,h,p,m,g)}roundClean(){xd(Xa)}destroy(){this.set(0,0,0,0,0,0,0,0),xd(this.buffer)}}class Y4 extends Q4{A=Va[0]|0;B=Va[1]|0;C=Va[2]|0;D=Va[3]|0;E=Va[4]|0;F=Va[5]|0;G=Va[6]|0;H=Va[7]|0;constructor(){super(32)}}const B0=B4(()=>new Y4,U4(1)),U0=N4(B0),G4=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function Yd(t){if(t.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(t.length/2);for(let i=0;i>>24,i=t&8388607;if(i===0||a<3)return;const o=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[t]}function Gd(t){const a=t.toLowerCase();if(a.includes("dup hash160")&&a.includes("equalverify checksig"))return"p2pkh";if(a.startsWith("hash160")&&a.includes("equal"))return"p2sh";if(a.startsWith("zero [")){const o=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return o.length===40?"p2wpkh":o.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function X4(){return"mainnet"}function K4(t){return t==="testnet"||t==="regtest"?{p2pkh:111,p2sh:196,hrp:t==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function Vv(t,a){const i=new Uint8Array(a.length/2+1);return i[0]=t,i.set(Yd(a),1),U0.encode(i)}function Lf(t,a,i){const o=Yd(i),u=Iu.toWords(o);return u.unshift(a),(a===0?Iu:bd).encode(t,u)}function H0(t,a){const i=t.toLowerCase(),o=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(o)return{address:Vv(a.p2pkh,o[1]),type:"p2pkh"};const u=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(u)return{address:Vv(a.p2sh,u[1]),type:"p2sh"};const c=i.match(/^zero \[([0-9a-f]{40})\]/);if(c)return{address:Lf(a.hrp,0,c[1]),type:"p2wpkh"};const d=i.match(/^zero \[([0-9a-f]{64})\]/);if(d)return{address:Lf(a.hrp,0,d[1]),type:"p2wsh"};const h=i.match(/^1 \[([0-9a-f]{64})\]/);return h?{address:Lf(a.hrp,1,h[1]),type:"p2tr"}:{type:Gd(t)}}function F4(t,a){try{const u=U0.decode(t),c=u[0],d=Uu(u.slice(1));if(d.length===40&&c===a.p2pkh)return{scriptHex:`76a914${d}88ac`,type:"p2pkh"};if(d.length===40&&c===a.p2sh)return{scriptHex:`a914${d}87`,type:"p2sh"}}catch{}const i=t.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const u=i,c=p=>{try{return p.decode(u,90)}catch{return null}},d=c(Iu);if(d&&d.prefix===a.hrp){const p=d.words[)DELIM" +R"DELIM(0],m=Iu.fromWords(d.words.slice(1)),g=Uu(m),v=m.length.toString(16).padStart(2,"0");if(p===0&&(m.length===20||m.length===32))return{scriptHex:`00${v}${g}`,type:m.length===20?"p2wpkh":"p2wsh"}}const h=c(bd);if(h&&h.prefix===a.hrp){const p=h.words[0],m=bd.fromWords(h.words.slice(1)),g=Uu(m),v=m.length.toString(16).padStart(2,"0");if(p===1&&m.length===32)return{scriptHex:`51${v}${g}`,type:"p2tr"}}}return null}function Bf(t,a){const i=t.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const o=F4(t,a);if(!o)return null;const u=B0(Yd(o.scriptHex)),c=Uint8Array.from(u).reverse();return{hash:Uu(c),type:o.type}}function Ml(t,a){return{hash:t.hash,height:t.height,timestamp:t.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:P4(t.bits),previousBlockHash:t.previous}}function J4(t){const a=V4(t);return a&&a.length>0?a:void 0}function I4(t,a,i,o){const u=/^0{64}$/u.test(t.point.hash),c=a?H0(a.script,i):{address:void 0,type:void 0},d=a?a.value:void 0,h=a?a.script:void 0;return{index:o,prevTxId:u?void 0:t.point.hash,prevOutputIndex:u?void 0:t.point.index,address:c.address,valueSats:d,scriptType:c.type??Gd(h??t.script),isCoinbase:u,script:t.script?{mnemonic:t.script}:void 0,witness:J4(t.witness),sequence:t.sequence}}function W4(t,a,i){const o=H0(t.script,i);return{index:a,address:o.address,valueSats:t.value,scriptType:o.type??Gd(t.script),spent:void 0,script:t.script?{mnemonic:t.script}:void 0}}function eT(t,a){return typeof t!="number"||typeof a!="number"?0:Math.max(0,t-a+1)}function Au(t,a,i,o,u){const c=t.outputs.map((g,v)=>W4(g,v,i)),d=c.reduce((g,v)=>g+v.valueSats,0),h=a.reduce((g,v)=>v?(g??0)+v.value:g,null),p=eT(o.tipHeight,o.blockHeight),m=typeof o.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:t.hash,hash:t.hash,status:m,confirmations:p,blockHeight:o.blockHeight,blockHash:o.blockHash,receivedTime:o.timestamp,feeSats:Number.isFinite(u)?u:void 0,feeRate:null,size:void 0,weight:void 0,version:t.version,locktime:t.locktime,totalInput:h,totalOutput:d,inputs:t.inputs.map((g,v)=>I4(g,a[v],i,v)),outputs:c}}const tT=25,Xv=5e3,Uf=new Map,Hf=new Map;async function nn(t,a,i){const o=a.startsWith("/")?a:`/${a}`;let u=o.includes("?")?`${t}${o}`:`${t}${o}?format=json`;i&&(u+=u.includes("?")?"&turbo=true":"?turbo=true");const c=Hf.get(u);if(c)return c;const d=(async()=>{const h=await fetch(u);if(!h.ok){const m=await h.text().catch(()=>"");throw new Error(`Request failed ${String(h.status)}: ${m||h.statusText}`)}const p=await h.text();try{return JSON.parse(p)}catch{return p}})();Hf.set(u,d);try{return await d}finally{Hf.delete(u)}}async function Ka(t,a,i){try{return await nn(t,a,i)}catch{return null}}async function Hu(t,a){const i=await nn(t,"/v1/top?format=json",a),o=typeof i=="number"?i:Number(i);if(!Number.isFinite(o))throw new Error("Invalid top height");return o}async function Bl(t,a){const i=Date.now(),o=`${t}|${a?"1":"0"}`,u=Uf.get(o);if(u&&u.expiresAt>i)return u.promise;const c=Hu(t,a).then(d=>(Uf.set(o,{promise:c,value:d,expiresAt:Date.now()+Xv}),d));return Uf.set(o,{promise:c,value:u?.value??null,expiresAt:i+Xv}),c}async function $f(t,a,i){if(a==="latest"||a==="tip"){const o=await Bl(t,i);return{path:`/v1/block/height/${String(o)}`,height:o}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function nT(t,a){const i=new Map;return(o,u)=>{const c=`${o}:${String(u)}`,d=i.get(c);if(d)return d;const h=nn(t,`/v1/output/${o}/${String(u)}?format=json`,a).catch(()=>null);return i.set(c,h),h}}async function aT(t,a,i){return nn(t,`${a}/txs?format=json`,i)}async function rT(t,a,i,o){return nn(t,`${a}/tx/${String(i)}?format=json`,o)}async function iT(t,a,i){return await nn(t,`${a}?format=json`,i)}async function Kv(t,a,i){return await nn(t,`/v1/address/${a}?format=json`,i).catch(()=>[])}function lT({baseUrl:t,pollIntervalMs:a=15e3,turbo:i=!1}){const o=new Set;let u=null,c=null;const d=K4(X4());function h(){u||(u=setInterval(async()=>{try{const m=await Hu(t,i);if(c===null){c=m;return}if(m>c){const g=await nn(t,`/v1/block/height/${String(m)}/header?format=json`,i),v=Ml(g);for(const b of o)b({type:"block.new",payload:v});c=m}}catch(m){console.warn("Libbitcoin poller failed",m)}},a))}function p(){u&&(clearInterval(u),u=null)}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:!1,endpoint:t,description:"Adapter for the libbitcoin embedded REST API."},async getLatestBlocks(m=10){const g=await Bl(t,i);c=g;const v=Array.from({length:m},(_,E)=>g-E).filter(_=>_>=0);return(await Promise.all(v.map(_=>nn(t,`/v1/block/height/${String(_)}/header?format=json`,i)))).map(_=>Ml(_))},async getBlocksBefore(m,g=10){const v=Array.from({length:g},(_,E)=>m-E).filter(_=>_>=0);return(await Promise.all(v.map(_=>nn(t,`/v1/block/height/${String(_)}/header?format=json`,i)))).map(_=>Ml(_))},async getBlockHeader(m){const{path:g,height:v}=await $f(t,m,i),[b,_]=await Promise.all([nn(t,`${g}/header?format=json`,i),v===void 0?Bl(t,i):Promi)DELIM" +R"DELIM(se.resolve(v)]);c=Math.max(c??0,_);let E=null;return b.height<_&&(E=(await Ka(t,`/v1/block/height/${String(b.height+1)}/header?format=json`,i))?.hash??null),{...Ml(b),merkleRoot:b.merkle_root,nonce:b.nonce,bits:b.bits,version:b.version,nextBlockHash:E}},async getBlock(m){const{path:g}=await $f(t,m,i),[v,b]=await Promise.all([iT(t,g,i),Bl(t,i)]);c=Math.max(c??0,b);let _=null;v.header.heightAu(D,[],d,{blockHeight:v.header.height,blockHash:v.header.hash,tipHeight:b,timestamp:v.header.timestamp}));return{...A,merkleRoot:v.header.merkle_root,nonce:v.header.nonce,bits:v.header.bits,version:v.header.version,nextBlockHash:_,transactions:B}},async getBlockTransactions(m,g=0){const{path:v}=await $f(t,m,i),b=await nn(t,`${v}/header?format=json`,i),[_,E]=await Promise.all([aT(t,v,i),Bl(t,i)]);c=Math.max(c??0,E);const A=_.slice(g,g+tT);return await Promise.all(A.map((D,Q)=>rT(t,v,g+Q,i).then(X=>Au(X,[],d,{blockHeight:b.height,blockHash:b.hash,tipHeight:E,timestamp:b.timestamp}))))},async getTransaction(m){const g=await nn(t,`/v1/tx/${m}?format=json`,i),[v,b,_]=await Promise.all([Ka(t,`/v1/tx/${m}/header?format=json`,i),Hu(t,i).catch(()=>null),Ka(t,`/v1/tx/${m}/fee?format=json`,i)]),E=nT(t,i),A=typeof _=="number"?_:Number(_),B=await Promise.all(g.inputs.map(D=>/^0{64}$/u.test(D.point.hash)?Promise.resolve(null):E(D.point.hash,D.point.index)));return Au(g,B,d,{blockHeight:v?.height,blockHash:v?.hash,tipHeight:typeof b=="number"?b:void 0,timestamp:v?.timestamp},Number.isFinite(A)?A:void 0)},async getTransactionHeader(m){const g=await nn(t,`/v1/tx/${m}?format=json`,i),[v,b,_]=await Promise.all([Ka(t,`/v1/tx/${m}/header?format=json`,i),Hu(t,i).catch(()=>null),Ka(t,`/v1/tx/${m}/fee?format=json`,i)]),E=typeof _=="number"?_:Number(_);return Au(g,[],d,{blockHeight:v?.height,blockHash:v?.hash,tipHeight:typeof b=="number"?b:void 0,timestamp:v?.timestamp},Number.isFinite(E)?E:void 0)},async getAddress(m){const g=Bf(m,d);if(!g)throw new Error("Unsupported address format for libbitcoin adapter");const[v,b]=await Promise.all([Ka(t,`/v1/address/${g.hash}/balance?format=json`,i),Kv(t,g.hash,i)]),_=typeof v=="number"?v:Number(v);let E=0;for(const D of b)E+=D.value;const A=Number.isFinite(_)?_:E,B=b.map(D=>({txid:D.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:D.value}));return{address:m,addressType:g.type,balance:A,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:void 0,transactions:B}},async getAddressSummary(m){const g=Bf(m,d);if(!g)throw new Error("Unsupported address format for libbitcoin adapter");const v=await Ka(t,`/v1/address/${g.hash}/balance?format=json`,i),b=typeof v=="number"?v:v===null?Number.NaN:Number(v),_=Number.isFinite(b)?b:0;return{address:m,addressType:g.type,balance:_,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:void 0}},async getAddressTransactions(m){const g=Bf(m,d);return g?(await Kv(t,g.hash,i)).map(b=>({txid:b.point.hash,blockHeight:void 0,timestamp:void 0,valueChange:b.value})):[]},subscribeToEvents(m){return o.add(m),h(),()=>{o.delete(m),o.size===0&&p()}}}}const $0=O.createContext(null),Z0=O.createContext(null),q0=O.createContext(null);function oT({children:t,client:a}){return S.jsx($0.Provider,{value:a,children:t})}function uT({children:t,provider:a,setProvider:i,availableProviders:o}){return S.jsx(Z0.Provider,{value:{provider:a,setProvider:i,availableProviders:o},children:t})}function sT({children:t,turbo:a,setTurbo:i}){return S.jsx(q0.Provider,{value:{turbo:a,setTurbo:i},children:t})}function rn(){const t=O.useContext($0);if(!t)throw new Error("BlockchainClientProvider missing in component tree");return t}function Q0(){return rn().metadata}function cT(){const t=O.useContext(Z0);if(!t)throw new Error("ProviderSwitcherProvider missing in component tree");return t}function fT(){const t=O.useContext(q0);if(!t)throw new Error("TurboProvider missing in component tree");return t}function dT(){const t=globalThis.window;return t?.location.origin?t.location.origin:"http://localhost:8080"}function hT(t,a){if(t==="blockstream")return A0({baseUrl:"https://blockstream.info/api"});if(t==="mempool")return z4({baseUrl:"https://mempool.space/api"});if(t==="libbitcoin"){const i=dT();return lT({baseUrl:i,turbo:a?.turboEnabled})}return t==="external"?(console.warn("No external API URL provided, falling back to mock client"),Mf()):(t==="mock"||console.warn(`Unknown provider "${t}", falling back to mock`),Mf())}function mT(){return[...new Set(["libbitcoin","blockstream","mempool"])]}function pT({children:t}){const a="libbitcoin",i=mT(),o=(()=>{const v=globalThis.window;return v?v.localStorage.getItem("turboEnabled")==="true":!1})(),u=(()=>{const v=globalThis.window;if(!v)return a;const b=v.localStorage.getItem("blockchainProvider");return b&&i.includes(b)?b:a})(),[c,d]=O.useState(o),[h,p]=O.useState(u),[m]=O.useSta)DELIM" +R"DELIM(te(()=>new pS({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),g=O.useMemo(()=>hT(h,{turboEnabled:c}),[h,c]);return O.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("turboEnabled",c?"true":"false")},[c]),O.useEffect(()=>{const v=globalThis.window;v&&v.localStorage.setItem("blockchainProvider",h)},[h]),S.jsx(uT,{provider:h,setProvider:p,availableProviders:i,children:S.jsx(sT,{turbo:c,setTurbo:d,children:S.jsx(oT,{client:g,children:S.jsxs(yS,{client:m,children:[t,null]})})})})}var Y0=t=>{throw TypeError(t)},yT=(t,a,i)=>a.has(t)||Y0("Cannot "+i),Zf=(t,a,i)=>(yT(t,a,"read from private field"),i?i.call(t):a.get(t)),vT=(t,a,i)=>a.has(t)?Y0("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,i),Fv="popstate";function gT(t={}){function a(o,u){let{pathname:c,search:d,hash:h}=o.location;return Xl("",{pathname:c,search:d,hash:h},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function i(o,u){return typeof u=="string"?u:Fn(u)}return xT(a,i,null,t)}function Ce(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function pt(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function bT(){return Math.random().toString(36).substring(2,10)}function Jv(t,a){return{usr:t.state,key:t.key,idx:a}}function Xl(t,a,i=null,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?nr(a):a,state:i,key:a&&a.key||o||bT()}}function Fn({pathname:t="/",search:a="",hash:i=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function nr(t){let a={};if(t){let i=t.indexOf("#");i>=0&&(a.hash=t.substring(i),t=t.substring(0,i));let o=t.indexOf("?");o>=0&&(a.search=t.substring(o),t=t.substring(0,o)),t&&(a.pathname=t)}return a}function xT(t,a,i,o={}){let{window:u=document.defaultView,v5Compat:c=!1}=o,d=u.history,h="POP",p=null,m=g();m==null&&(m=0,d.replaceState({...d.state,idx:m},""));function g(){return(d.state||{idx:null}).idx}function v(){h="POP";let B=g(),D=B==null?null:B-m;m=B,p&&p({action:h,location:A.location,delta:D})}function b(B,D){h="PUSH";let Q=Xl(A.location,B,D);m=g()+1;let X=Jv(Q,m),se=A.createHref(Q);try{d.pushState(X,"",se)}catch(ue){if(ue instanceof DOMException&&ue.name==="DataCloneError")throw ue;u.location.assign(se)}c&&p&&p({action:h,location:A.location,delta:1})}function _(B,D){h="REPLACE";let Q=Xl(A.location,B,D);m=g();let X=Jv(Q,m),se=A.createHref(Q);d.replaceState(X,"",se),c&&p&&p({action:h,location:A.location,delta:0})}function E(B){return G0(B)}let A={get action(){return h},get location(){return t(u,d)},listen(B){if(p)throw new Error("A history only accepts one active listener");return u.addEventListener(Fv,v),p=B,()=>{u.removeEventListener(Fv,v),p=null}},createHref(B){return a(u,B)},createURL:E,encodeLocation(B){let D=E(B);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:b,replace:_,go(B){return d.go(B)}};return A}function G0(t,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Ce(i,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Fn(t);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}var Ul,Iv=class{constructor(t){if(vT(this,Ul,new Map),t)for(let[a,i]of t)this.set(a,i)}get(t){if(Zf(this,Ul).has(t))return Zf(this,Ul).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,a){Zf(this,Ul).set(t,a)}};Ul=new WeakMap;var ST=new Set(["lazy","caseSensitive","path","id","index","children"]);function _T(t){return ST.has(t)}var wT=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function ET(t){return wT.has(t)}function TT(t){return t.index===!0}function Kl(t,a,i=[],o={},u=!1){return t.map((c,d)=>{let h=[...i,String(d)],p=typeof c.id=="string"?c.id:h.join("-");if(Ce(c.index!==!0||!c.children,"Cannot specify children on an index route"),Ce(u||!o[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),TT(c)){let m={...c,id:p};return o[p]=Wv(m,a(m)),m}else{let m={...c,id:p,children:void 0};return o[p]=Wv(m,a(m)),c.children&&(m.children=Kl(c.children,a,h,o,u)),m}})}function Wv(t,a){return Object.assign(t,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...t.lazy,...a.lazy}}:{}})}function Ja(t,a,i="/"){return Hl(t,a,i,!1)}function Hl(t,a,i,o){let u=typeof a=="string"?nr(a):a,c=Rn(u.pathname||"/",i);if(c==null)return null;let d=P0(t);RT(d);let h=null;for(let p=0;h==null&&p{let g={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:h,route:d};if(g.relativePath.startsWi)DELIM" +R"DELIM(th("/")){if(!g.relativePath.startsWith(o)&&p)return;Ce(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let v=Kn([o,g.relativePath]),b=i.concat(g);d.children&&d.children.length>0&&(Ce(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),P0(d.children,a,b,v,p)),!(d.path==null&&!d.index)&&a.push({path:v,score:jT(v,d.index),routesMeta:b})};return t.forEach((d,h)=>{if(d.path===""||!d.path?.includes("?"))c(d,h);else for(let p of V0(d.path))c(d,h,!0,p)}),a}function V0(t){let a=t.split("/");if(a.length===0)return[];let[i,...o]=a,u=i.endsWith("?"),c=i.replace(/\?$/,"");if(o.length===0)return u?[c,""]:[c];let d=V0(o.join("/")),h=[];return h.push(...d.map(p=>p===""?c:[c,p].join("/"))),u&&h.push(...d),h.map(p=>t.startsWith("/")&&p===""?"/":p)}function RT(t){t.sort((a,i)=>a.score!==i.score?i.score-a.score:kT(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var OT=/^:[\w-]+$/,AT=3,MT=2,CT=1,NT=10,DT=-2,eg=t=>t==="*";function jT(t,a){let i=t.split("/"),o=i.length;return i.some(eg)&&(o+=DT),a&&(o+=MT),i.filter(u=>!eg(u)).reduce((u,c)=>u+(OT.test(c)?AT:c===""?CT:NT),o)}function kT(t,a){return t.length===a.length&&t.slice(0,-1).every((o,u)=>o===a[u])?t[t.length-1]-a[a.length-1]:0}function LT(t,a,i=!1){let{routesMeta:o}=t,u={},c="/",d=[];for(let h=0;h{if(g==="*"){let E=h[b]||"";d=c.slice(0,c.length-E.length).replace(/(.)\/+$/,"$1")}const _=h[b];return v&&!_?m[g]=void 0:m[g]=(_||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:d,pattern:t}}function BT(t,a=!1,i=!0){pt(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],u="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,h,p)=>(o.push({paramName:h,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),u+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?u+="\\/*$":t!==""&&t!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,a?void 0:"i"),o]}function UT(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return pt(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),t}}function Rn(t,a){if(a==="/")return t;if(!t.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=t.charAt(i);return o&&o!=="/"?null:t.slice(i)||"/"}function HT({basename:t,pathname:a}){return a==="/"?t:Kn([t,a])}var X0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rs=t=>X0.test(t);function $T(t,a="/"){let{pathname:i,search:o="",hash:u=""}=typeof t=="string"?nr(t):t,c;if(i)if(rs(i))c=i;else{if(i.includes("//")){let d=i;i=i.replace(/\/\/+/g,"/"),pt(!1,`Pathnames cannot have embedded double slashes - normalizing ${d} -> ${i}`)}i.startsWith("/")?c=tg(i.substring(1),"/"):c=tg(i,a)}else c=a;return{pathname:c,search:qT(o),hash:QT(u)}}function tg(t,a){let i=a.replace(/\/+$/,"").split("/");return t.split("/").forEach(u=>{u===".."?i.length>1&&i.pop():u!=="."&&i.push(u)}),i.length>1?i.join("/"):"/"}function qf(t,a,i,o){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function K0(t){return t.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Pd(t){let a=K0(t);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function Vd(t,a,i,o=!1){let u;typeof t=="string"?u=nr(t):(u={...t},Ce(!u.pathname||!u.pathname.includes("?"),qf("?","pathname","search",u)),Ce(!u.pathname||!u.pathname.includes("#"),qf("#","pathname","hash",u)),Ce(!u.search||!u.search.includes("#"),qf("#","se)DELIM" +R"DELIM(arch","hash",u)));let c=t===""||u.pathname==="",d=c?"/":u.pathname,h;if(d==null)h=i;else{let v=a.length-1;if(!o&&d.startsWith("..")){let b=d.split("/");for(;b[0]==="..";)b.shift(),v-=1;u.pathname=b.join("/")}h=v>=0?a[v]:"/"}let p=$T(u,h),m=d&&d!=="/"&&d.endsWith("/"),g=(c||d===".")&&i.endsWith("/");return!p.pathname.endsWith("/")&&(m||g)&&(p.pathname+="/"),p}var Kn=t=>t.join("/").replace(/\/\/+/g,"/"),ZT=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qT=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,QT=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,no=class{constructor(t,a,i,o=!1){this.status=t,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Fl(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function ao(t){return t.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var F0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function J0(t,a){let i=t;if(typeof i!="string"||!X0.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,u=!1;if(F0)try{let c=new URL(window.location.href),d=i.startsWith("//")?new URL(c.protocol+i):new URL(i),h=Rn(d.pathname,a);d.origin===c.origin&&h!=null?i=h+d.search+d.hash:u=!0}catch{pt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:u,to:i}}var Wa=Symbol("Uninstrumented");function YT(t,a){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(u=>u({id:a.id,index:a.index,path:a.path,instrument(c){let d=Object.keys(i);for(let h of d)c[h]&&i[h].push(c[h])}}));let o={};if(typeof a.lazy=="function"&&i.lazy.length>0){let u=Ti(i.lazy,a.lazy,()=>{});u&&(o.lazy=u)}if(typeof a.lazy=="object"){let u=a.lazy;["middleware","loader","action"].forEach(c=>{let d=u[c],h=i[`lazy.${c}`];if(typeof d=="function"&&h.length>0){let p=Ti(h,d,()=>{});p&&(o.lazy=Object.assign(o.lazy||{},{[c]:p}))}})}return["loader","action"].forEach(u=>{let c=a[u];if(typeof c=="function"&&i[u].length>0){let d=c[Wa]??c,h=Ti(i[u],d,(...p)=>ng(p[0]));h&&(h[Wa]=d,o[u]=h)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(o.middleware=a.middleware.map(u=>{let c=u[Wa]??u,d=Ti(i.middleware,c,(...h)=>ng(h[0]));return d?(d[Wa]=c,d):u})),o}function GT(t,a){let i={navigate:[],fetch:[]};if(a.forEach(o=>o({instrument(u){let c=Object.keys(u);for(let d of c)u[d]&&i[d].push(u[d])}})),i.navigate.length>0){let o=t.navigate[Wa]??t.navigate,u=Ti(i.navigate,o,(...c)=>{let[d,h]=c;return{to:typeof d=="number"||typeof d=="string"?d:d?Fn(d):".",...ag(t,h??{})}});u&&(u[Wa]=o,t.navigate=u)}if(i.fetch.length>0){let o=t.fetch[Wa]??t.fetch,u=Ti(i.fetch,o,(...c)=>{let[d,,h,p]=c;return{href:h??".",fetcherKey:d,...ag(t,p??{})}});u&&(u[Wa]=o,t.fetch=u)}return t}function Ti(t,a,i){return t.length===0?null:async(...o)=>{let u=await I0(t,i(...o),()=>a(...o),t.length-1);if(u.type==="error")throw u.value;return u.value}}async function I0(t,a,i,o){let u=t[o],c;if(u){let d,h=async()=>(d?console.error("You cannot call instrumented handlers more than once"):d=I0(t,a,i,o-1),c=await d,Ce(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await u(h,a)}catch(p){console.error("An instrumentation function threw an error:",p)}d||await h(),await d}else try{c={type:"success",value:await i()}}catch(d){c={type:"error",value:d}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function ng(t){let{request:a,context:i,params:o,unstable_pattern:u}=t;return{request:PT(a),params:{...o},unstable_pattern:u,context:VT(i)}}function ag(t,a){return{currentUrl:Fn(t.state.location),..."formMethod"in a?{formMethod:a.formMethod}:{},..."formEncType"in a?{formEncType:a.formEncType}:{},..."formData"in a?{formData:a.formData}:{},..."body"in a?{body:a.body}:{}}}function PT(t){return{method:t.method,url:t.url,headers:{get:(...a)=>t.headers.get(...a)}}}function VT(t){if(KT(t)){let a={...t};return Object.freeze(a),a}else return{get:a=>t.get(a)}}var XT=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function KT(t){if(t===null||typeof t!="object")return!1;const a=Object.getPrototypeOf(t);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===XT}var W0=["POST","PUT","PATCH","DELETE"],FT=new Set(W0),JT=["GET",...W0],IT=new Set(JT),eb=new Set([301,302,303,307,308]),WT=new Set([307,308]),Qf={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},e3={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Cl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},t3=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),tb="remix-router-trans)DELIM" +R"DELIM(itions",nb=Symbol("ResetLoaderData");function n3(t){const a=t.window?t.window:typeof window<"u"?window:void 0,i=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";Ce(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let o=t.hydrationRouteProperties||[],u=t.mapRouteProperties||t3,c=u;if(t.unstable_instrumentations){let z=t.unstable_instrumentations;c=j=>({...u(j),...YT(z.map(q=>q.route).filter(Boolean),j)})}let d={},h=Kl(t.routes,c,void 0,d),p,m=t.basename||"/";m.startsWith("/")||(m=`/${m}`);let g=t.dataStrategy||o3,v={...t.future},b=null,_=new Set,E=null,A=null,B=null,D=t.hydrationData!=null,Q=Ja(h,t.history.location,m),X=!1,se=null,ue;if(Q==null&&!t.patchRoutesOnNavigation){let z=Tn(404,{pathname:t.history.location.pathname}),{matches:j,route:q}=Mu(h);ue=!0,Q=j,se={[q.id]:z}}else if(Q&&!t.hydrationData&&sr(Q,h,t.history.location.pathname).active&&(Q=null),Q)if(Q.some(z=>z.route.lazy))ue=!1;else if(!Q.some(z=>Xd(z.route)))ue=!0;else{let z=t.hydrationData?t.hydrationData.loaderData:null,j=t.hydrationData?t.hydrationData.errors:null;if(j){let q=Q.findIndex(te=>j[te.route.id]!==void 0);ue=Q.slice(0,q+1).every(te=>!_d(te.route,z,j))}else ue=Q.every(q=>!_d(q.route,z,j))}else{ue=!1,Q=[];let z=sr(null,h,t.history.location.pathname);z.active&&z.matches&&(X=!0,Q=z.matches)}let me,C={historyAction:t.history.action,location:t.history.location,matches:Q,initialized:ue,navigation:Qf,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||se,fetchers:new Map,blockers:new Map},I="POP",ie=null,V=!1,ee,_e=!1,Oe=new Map,ne=null,J=!1,w=!1,k=new Set,L=new Map,ae=0,le=-1,T=new Map,Z=new Set,W=new Map,re=new Map,he=new Set,we=new Map,Re,Ie=null;function Ge(){if(b=t.history.listen(({action:z,location:j,delta:q})=>{if(Re){Re(),Re=void 0;return}pt(we.size===0||q!=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 te=lr({currentLocation:C.location,nextLocation:j,historyAction:z});if(te&&q!=null){let oe=new Promise(ge=>{Re=ge});t.history.go(q*-1),Jn(te,{state:"blocked",location:j,proceed(){Jn(te,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),oe.then(()=>t.history.go(q))},reset(){let ge=new Map(C.blockers);ge.set(te,Cl),et({blockers:ge})}}),ie?.resolve(),ie=null;return}return Mn(z,j)}),i){T3(a,Oe);let z=()=>z3(a,Oe);a.addEventListener("pagehide",z),ne=()=>a.removeEventListener("pagehide",z)}return C.initialized||Mn("POP",C.location,{initialHydration:!0}),me}function ct(){b&&b(),ne&&ne(),_.clear(),ee&&ee.abort(),C.fetchers.forEach((z,j)=>Bi(j)),C.blockers.forEach((z,j)=>co(j))}function qt(z){return _.add(z),()=>_.delete(z)}function et(z,j={}){z.matches&&(z.matches=z.matches.map(oe=>{let ge=d[oe.route.id],fe=oe.route;return fe.element!==ge.element||fe.errorElement!==ge.errorElement||fe.hydrateFallbackElement!==ge.hydrateFallbackElement?{...oe,route:ge}:oe})),C={...C,...z};let q=[],te=[];C.fetchers.forEach((oe,ge)=>{oe.state==="idle"&&(he.has(ge)?q.push(ge):te.push(ge))}),he.forEach(oe=>{!C.fetchers.has(oe)&&!L.has(oe)&&q.push(oe)}),[..._].forEach(oe=>oe(C,{deletedFetchers:q,newErrors:z.errors??null,viewTransitionOpts:j.viewTransitionOpts,flushSync:j.flushSync===!0})),q.forEach(oe=>Bi(oe)),te.forEach(oe=>C.fetchers.delete(oe))}function Pt(z,j,{flushSync:q}={}){let te=C.actionData!=null&&C.navigation.formMethod!=null&&Zt(C.navigation.formMethod)&&C.navigation.state==="loading"&&z.state?._isRedirect!==!0,oe;j.actionData?Object.keys(j.actionData).length>0?oe=j.actionData:oe=null:te?oe=C.actionData:oe=null;let ge=j.loaderData?hg(C.loaderData,j.loaderData,j.matches||[],j.errors):C.loaderData,fe=C.blockers;fe.size>0&&(fe=new Map(fe),fe.forEach((Ee,be)=>fe.set(be,Cl)));let ce=J?!1:fo(z,j.matches||C.matches),de=V===!0||C.navigation.formMethod!=null&&Zt(C.navigation.formMethod)&&z.state?._isRedirect!==!0;p&&(h=p,p=void 0),J||I==="POP"||(I==="PUSH"?t.history.push(z,z.state):I==="REPLACE"&&t.history.replace(z,z.state));let ve;if(I==="POP"){let Ee=Oe.get(C.location.pathname);Ee&&Ee.has(z.pathname)?ve={currentLocation:C.location,nextLocation:z}:Oe.has(z.pathname)&&(ve={currentLocation:z,nextLocation:C.location})}else if(_e){let Ee=Oe.get(C.location.pathname);Ee?Ee.add(z.pathname):(Ee=new Set([z.pathname]),Oe.set(C.location.pathname,Ee)),ve={currentLocation:C.location,nextLocation:z}}et({...j,actionData:oe,loaderData:ge,historyAction:I,location:z,initialized:!0,navigation:Qf,revalidation:"idle",restoreScrollPosition:ce,preventScrollRese)DELIM" +R"DELIM(t:de,blockers:fe},{viewTransitionOpts:ve,flushSync:q===!0}),I="POP",V=!1,_e=!1,J=!1,w=!1,ie?.resolve(),ie=null,Ie?.resolve(),Ie=null}async function Zn(z,j){if(ie?.resolve(),ie=null,typeof z=="number"){ie||(ie=vg());let Le=ie.promise;return t.history.go(z),Le}let q=Sd(C.location,C.matches,m,z,j?.fromRouteId,j?.relative),{path:te,submission:oe,error:ge}=rg(!1,q,j),fe=C.location,ce=Xl(C.location,te,j&&j.state);ce={...ce,...t.history.encodeLocation(ce)};let de=j&&j.replace!=null?j.replace:void 0,ve="PUSH";de===!0?ve="REPLACE":de===!1||oe!=null&&Zt(oe.formMethod)&&oe.formAction===C.location.pathname+C.location.search&&(ve="REPLACE");let Ee=j&&"preventScrollReset"in j?j.preventScrollReset===!0:void 0,be=(j&&j.flushSync)===!0,Ze=lr({currentLocation:fe,nextLocation:ce,historyAction:ve});if(Ze){Jn(Ze,{state:"blocked",location:ce,proceed(){Jn(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ce}),Zn(z,j)},reset(){let Le=new Map(C.blockers);Le.set(Ze,Cl),et({blockers:Le})}});return}await Mn(ve,ce,{submission:oe,pendingError:ge,preventScrollReset:Ee,replace:j&&j.replace,enableViewTransition:j&&j.viewTransition,flushSync:be,callSiteDefaultShouldRevalidate:j&&j.unstable_defaultShouldRevalidate})}function Ni(){Ie||(Ie=vg()),$r(),et({revalidation:"loading"});let z=Ie.promise;return C.navigation.state==="submitting"?z:C.navigation.state==="idle"?(Mn(C.historyAction,C.location,{startUninterruptedRevalidation:!0}),z):(Mn(I||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:_e===!0}),z)}async function Mn(z,j,q){ee&&ee.abort(),ee=null,I=z,J=(q&&q.startUninterruptedRevalidation)===!0,ur(C.location,C.matches),V=(q&&q.preventScrollReset)===!0,_e=(q&&q.enableViewTransition)===!0;let te=p||h,oe=q&&q.overrideNavigation,ge=q?.initialHydration&&C.matches&&C.matches.length>0&&!X?C.matches:Ja(te,j,m),fe=(q&&q.flushSync)===!0;if(ge&&C.initialized&&!w&&p3(C.location,j)&&!(q&&q.submission&&Zt(q.submission.formMethod))){Pt(j,{matches:ge},{flushSync:fe});return}let ce=sr(ge,te,j.pathname);if(ce.active&&ce.matches&&(ge=ce.matches),!ge){let{error:ft,notFoundMatches:dt,route:Be}=Sa(j.pathname);Pt(j,{matches:dt,loaderData:{},errors:{[Be.id]:ft}},{flushSync:fe});return}ee=new AbortController;let de=wi(t.history,j,ee.signal,q&&q.submission),ve=t.getContext?await t.getContext():new Iv,Ee;if(q&&q.pendingError)Ee=[Ia(ge).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&Zt(q.submission.formMethod)){let ft=await us(de,j,q.submission,ge,ve,ce.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:fe});if(ft.shortCircuited)return;if(ft.pendingActionResult){let[dt,Be]=ft.pendingActionResult;if(mn(Be)&&Fl(Be.error)&&Be.error.status===404){ee=null,Pt(j,{matches:ft.matches,loaderData:{},errors:{[dt]:Be.error}});return}}ge=ft.matches||ge,Ee=ft.pendingActionResult,oe=Yf(j,q.submission),fe=!1,ce.active=!1,de=wi(t.history,de.url,de.signal)}let{shortCircuited:be,matches:Ze,loaderData:Le,errors:ut}=await uo(de,j,ge,ve,ce.active,oe,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,fe,Ee,q&&q.callSiteDefaultShouldRevalidate);be||(ee=null,Pt(j,{matches:Ze||ge,...mg(Ee),loaderData:Le,errors:ut}))}async function us(z,j,q,te,oe,ge,fe,ce={}){$r();let de=w3(j,q);if(et({navigation:de},{flushSync:ce.flushSync===!0}),ge){let be=await _a(te,j.pathname,z.signal);if(be.type==="aborted")return{shortCircuited:!0};if(be.type==="error"){if(be.partialMatches.length===0){let{matches:Le,route:ut}=Mu(h);return{matches:Le,pendingActionResult:[ut.id,{type:"error",error:be.error}]}}let Ze=Ia(be.partialMatches).route.id;return{matches:be.partialMatches,pendingActionResult:[Ze,{type:"error",error:be.error}]}}else if(be.matches)te=be.matches;else{let{notFoundMatches:Ze,error:Le,route:ut}=Sa(j.pathname);return{matches:Ze,pendingActionResult:[ut.id,{type:"error",error:Le}]}}}let ve,Ee=$u(te,j);if(!Ee.route.action&&!Ee.route.lazy)ve={type:"error",error:Tn(405,{method:z.method,pathname:j.pathname,routeId:Ee.route.id})};else{let be=Ri(c,d,z,te,Ee,fe?[]:o,oe),Ze=await rr(z,be,oe,null);if(ve=Ze[Ee.route.id],!ve){for(let Le of te)if(Ze[Le.route.id]){ve=Ze[Le.route.id];break}}if(z.signal.aborted)return{shortCircuited:!0}}if(Mr(ve)){let be;return ce&&ce.replace!=null?be=ce.replace:be=cg(ve.response.headers.get("Location"),new URL(z.url),m)===C.location.pathname+C.location.search,await yt(z,ve,!0,{submission:q,replace:be}),{shortCircuited:!0}}if(mn(ve)){let be=Ia(te,Ee.route.id);return(ce&&ce.replace)!==!0&&(I="PUSH"),{matches:te,pendingActionResult:[be.route.id,ve,Ee.route.id]}}return{matches:te,pendingActionResult:[Ee.route.id,ve]}}async function uo(z,j,q,te,oe,ge,fe,ce,de,ve,Ee,be,Ze){let Le=ge||Yf(j,fe),ut=fe||ce||yg(Le),ft=!J&&!ve;if(oe){if(ft){let vt=Hr(be);et({navigation:Le,...vt!==void 0?{actionData:vt}:{}},{flushSync:Ee})}let Ue=await _a(q,j.pathname,z.signal);if(Ue.type==="aborted")return{shortCircuited:!0};if(Ue.type==="error"){if(Ue.partialMatches.length===0){let{matches:kn,route:Nt)DELIM" +R"DELIM(}=Mu(h);return{matches:kn,loaderData:{},errors:{[Nt.id]:Ue.error}}}let vt=Ia(Ue.partialMatches).route.id;return{matches:Ue.partialMatches,loaderData:{},errors:{[vt]:Ue.error}}}else if(Ue.matches)q=Ue.matches;else{let{error:vt,notFoundMatches:kn,route:Nt}=Sa(j.pathname);return{matches:kn,loaderData:{},errors:{[Nt.id]:vt}}}}let dt=p||h,{dsMatches:Be,revalidatingFetchers:At}=ig(z,te,c,d,t.history,C,q,ut,j,ve?[]:o,ve===!0,w,k,he,W,Z,dt,m,t.patchRoutesOnNavigation!=null,be,Ze);if(le=++ae,!t.dataStrategy&&!Be.some(Ue=>Ue.shouldLoad)&&!Be.some(Ue=>Ue.route.middleware&&Ue.route.middleware.length>0)&&At.length===0){let Ue=Ht();return Pt(j,{matches:q,loaderData:{},errors:be&&mn(be[1])?{[be[0]]:be[1].error}:null,...mg(be),...Ue?{fetchers:new Map(C.fetchers)}:{}},{flushSync:Ee}),{shortCircuited:!0}}if(ft){let Ue={};if(!oe){Ue.navigation=Le;let vt=Hr(be);vt!==void 0&&(Ue.actionData=vt)}At.length>0&&(Ue.fetchers=Di(At)),et(Ue,{flushSync:Ee})}At.forEach(Ue=>{ot(Ue.key),Ue.controller&&L.set(Ue.key,Ue.controller)});let Xt=()=>At.forEach(Ue=>ot(Ue.key));ee&&ee.signal.addEventListener("abort",Xt);let{loaderResults:rt,fetcherResults:Dn}=await ki(Be,At,z,te);if(z.signal.aborted)return{shortCircuited:!0};ee&&ee.signal.removeEventListener("abort",Xt),At.forEach(Ue=>L.delete(Ue.key));let ln=Cu(rt);if(ln)return await yt(z,ln.result,!0,{replace:de}),{shortCircuited:!0};if(ln=Cu(Dn),ln)return Z.add(ln.key),await yt(z,ln.result,!0,{replace:de}),{shortCircuited:!0};let{loaderData:jn,errors:pn}=dg(C,q,rt,be,At,Dn);ve&&C.errors&&(pn={...C.errors,...pn});let Wn=Ht(),cr=so(le),fr=Wn||cr||At.length>0;return{matches:q,loaderData:jn,errors:pn,...fr?{fetchers:new Map(C.fetchers)}:{}}}function Hr(z){if(z&&!mn(z[1]))return{[z[0]]:z[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function Di(z){return z.forEach(j=>{let q=C.fetchers.get(j.key),te=Nl(void 0,q?q.data:void 0);C.fetchers.set(j.key,te)}),new Map(C.fetchers)}async function ji(z,j,q,te){ot(z);let oe=(te&&te.flushSync)===!0,ge=p||h,fe=Sd(C.location,C.matches,m,q,j,te?.relative),ce=Ja(ge,fe,m),de=sr(ce,ge,fe);if(de.active&&de.matches&&(ce=de.matches),!ce){Cn(z,j,Tn(404,{pathname:fe}),{flushSync:oe});return}let{path:ve,submission:Ee,error:be}=rg(!0,fe,te);if(be){Cn(z,j,be,{flushSync:oe});return}let Ze=t.getContext?await t.getContext():new Iv,Le=(te&&te.preventScrollReset)===!0;if(Ee&&Zt(Ee.formMethod)){await ss(z,j,ve,ce,Ze,de.active,oe,Le,Ee,te&&te.unstable_defaultShouldRevalidate);return}W.set(z,{routeId:j,path:ve}),await cs(z,j,ve,ce,Ze,de.active,oe,Le,Ee)}async function ss(z,j,q,te,oe,ge,fe,ce,de,ve){$r(),W.delete(z);let Ee=C.fetchers.get(z);Vt(z,E3(de,Ee),{flushSync:fe});let be=new AbortController,Ze=wi(t.history,q,be.signal,de);if(ge){let He=await _a(te,new URL(Ze.url).pathname,Ze.signal,z);if(He.type==="aborted")return;if(He.type==="error"){Cn(z,j,He.error,{flushSync:fe});return}else if(He.matches)te=He.matches;else{Cn(z,j,Tn(404,{pathname:q}),{flushSync:fe});return}}let Le=$u(te,q);if(!Le.route.action&&!Le.route.lazy){let He=Tn(405,{method:de.formMethod,pathname:q,routeId:j});Cn(z,j,He,{flushSync:fe});return}L.set(z,be);let ut=ae,ft=Ri(c,d,Ze,te,Le,o,oe),dt=await rr(Ze,ft,oe,z),Be=dt[Le.route.id];if(!Be){for(let He of ft)if(dt[He.route.id]){Be=dt[He.route.id];break}}if(Ze.signal.aborted){L.get(z)===be&&L.delete(z);return}if(he.has(z)){if(Mr(Be)||mn(Be)){Vt(z,va(void 0));return}}else{if(Mr(Be))if(L.delete(z),le>ut){Vt(z,va(void 0));return}else return Z.add(z),Vt(z,Nl(de)),yt(Ze,Be,!1,{fetcherSubmission:de,preventScrollReset:ce});if(mn(Be)){Cn(z,j,Be.error);return}}let At=C.navigation.location||C.location,Xt=wi(t.history,At,be.signal),rt=p||h,Dn=C.navigation.state!=="idle"?Ja(rt,C.navigation.location,m):C.matches;Ce(Dn,"Didn't find any matches after fetcher action");let ln=++ae;T.set(z,ln);let jn=Nl(de,Be.data);C.fetchers.set(z,jn);let{dsMatches:pn,revalidatingFetchers:Wn}=ig(Xt,oe,c,d,t.history,C,Dn,de,At,o,!1,w,k,he,W,Z,rt,m,t.patchRoutesOnNavigation!=null,[Le.route.id,Be],ve);Wn.filter(He=>He.key!==z).forEach(He=>{let dr=He.key,mo=C.fetchers.get(dr),Ui=Nl(void 0,mo?mo.data:void 0);C.fetchers.set(dr,Ui),ot(dr),He.controller&&L.set(dr,He.controller)}),et({fetchers:new Map(C.fetchers)});let cr=()=>Wn.forEach(He=>ot(He.key));be.signal.addEventListener("abort",cr);let{loaderResults:fr,fetcherResults:Ue}=await ki(pn,Wn,Xt,oe);if(be.signal.aborted)return;if(be.signal.removeEventListener("abort",cr),T.delete(z),L.delete(z),Wn.forEach(He=>L.delete(He.key)),C.fetchers.has(z)){let He=va(Be.data);C.fetchers.set(z,He)}let vt=Cu(fr);if(vt)return yt(Xt,vt.result,!1,{preventScrollReset:ce});if(vt=Cu(Ue),vt)return Z.add(vt.key),yt(Xt,vt.result,!1,{preventScrollReset:ce});let{loaderData:kn,errors:Nt}=dg(C,Dn,fr,void 0,Wn,Ue);so(ln),C.navigation.state==="loading"&&ln>le?(Ce(I,"Expected pending action"),ee&&ee.abort(),Pt(C.navigation.location,{matches:Dn,loaderData:kn,errors:Nt,fetchers:new Map(C.fetchers)})):(et({errors:Nt,loaderData:hg(C.loaderData,kn,Dn,Nt),fe)DELIM" +R"DELIM(tchers:new Map(C.fetchers)}),w=!1)}async function cs(z,j,q,te,oe,ge,fe,ce,de){let ve=C.fetchers.get(z);Vt(z,Nl(de,ve?ve.data:void 0),{flushSync:fe});let Ee=new AbortController,be=wi(t.history,q,Ee.signal);if(ge){let Be=await _a(te,new URL(be.url).pathname,be.signal,z);if(Be.type==="aborted")return;if(Be.type==="error"){Cn(z,j,Be.error,{flushSync:fe});return}else if(Be.matches)te=Be.matches;else{Cn(z,j,Tn(404,{pathname:q}),{flushSync:fe});return}}let Ze=$u(te,q);L.set(z,Ee);let Le=ae,ut=Ri(c,d,be,te,Ze,o,oe),dt=(await rr(be,ut,oe,z))[Ze.route.id];if(L.get(z)===Ee&&L.delete(z),!be.signal.aborted){if(he.has(z)){Vt(z,va(void 0));return}if(Mr(dt))if(le>Le){Vt(z,va(void 0));return}else{Z.add(z),await yt(be,dt,!1,{preventScrollReset:ce});return}if(mn(dt)){Cn(z,j,dt.error);return}Vt(z,va(dt.data))}}async function yt(z,j,q,{submission:te,fetcherSubmission:oe,preventScrollReset:ge,replace:fe}={}){q||(ie?.resolve(),ie=null),j.response.headers.has("X-Remix-Revalidate")&&(w=!0);let ce=j.response.headers.get("Location");Ce(ce,"Expected a Location header on the redirect Response"),ce=cg(ce,new URL(z.url),m);let de=Xl(C.location,ce,{_isRedirect:!0});if(i){let ut=!1;if(j.response.headers.has("X-Remix-Reload-Document"))ut=!0;else if(rs(ce)){const ft=G0(ce,!0);ut=ft.origin!==a.location.origin||Rn(ft.pathname,m)==null}if(ut){fe?a.location.replace(ce):a.location.assign(ce);return}}ee=null;let ve=fe===!0||j.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ee,formAction:be,formEncType:Ze}=C.navigation;!te&&!oe&&Ee&&be&&Ze&&(te=yg(C.navigation));let Le=te||oe;if(WT.has(j.response.status)&&Le&&Zt(Le.formMethod))await Mn(ve,de,{submission:{...Le,formAction:ce},preventScrollReset:ge||V,enableViewTransition:q?_e:void 0});else{let ut=Yf(de,te);await Mn(ve,de,{overrideNavigation:ut,fetcherSubmission:oe,preventScrollReset:ge||V,enableViewTransition:q?_e:void 0})}}async function rr(z,j,q,te){let oe,ge={};try{oe=await s3(g,z,j,te,q,!1)}catch(fe){return j.filter(ce=>ce.shouldLoad).forEach(ce=>{ge[ce.route.id]={type:"error",error:fe}}),ge}if(z.signal.aborted)return ge;if(!Zt(z.method))for(let fe of j){if(oe[fe.route.id]?.type==="error")break;!oe.hasOwnProperty(fe.route.id)&&!C.loaderData.hasOwnProperty(fe.route.id)&&(!C.errors||!C.errors.hasOwnProperty(fe.route.id))&&fe.shouldCallHandler()&&(oe[fe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${fe.route.id}`)})}for(let[fe,ce]of Object.entries(oe))if(b3(ce)){let de=ce.result;ge[fe]={type:"redirect",response:h3(de,z,fe,j,m)}}else ge[fe]=await d3(ce);return ge}async function ki(z,j,q,te){let oe=rr(q,z,te,null),ge=Promise.all(j.map(async de=>{if(de.matches&&de.match&&de.request&&de.controller){let Ee=(await rr(de.request,de.matches,te,de.key))[de.match.route.id];return{[de.key]:Ee}}else return Promise.resolve({[de.key]:{type:"error",error:Tn(404,{pathname:de.path})}})})),fe=await oe,ce=(await ge).reduce((de,ve)=>Object.assign(de,ve),{});return{loaderResults:fe,fetcherResults:ce}}function $r(){w=!0,W.forEach((z,j)=>{L.has(j)&&k.add(j),ot(j)})}function Vt(z,j,q={}){C.fetchers.set(z,j),et({fetchers:new Map(C.fetchers)},{flushSync:(q&&q.flushSync)===!0})}function Cn(z,j,q,te={}){let oe=Ia(C.matches,j);Bi(z),et({errors:{[oe.route.id]:q},fetchers:new Map(C.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Li(z){return re.set(z,(re.get(z)||0)+1),he.has(z)&&he.delete(z),C.fetchers.get(z)||e3}function fs(z,j){ot(z,j?.reason),Vt(z,va(null))}function Bi(z){let j=C.fetchers.get(z);L.has(z)&&!(j&&j.state==="loading"&&T.has(z))&&ot(z),W.delete(z),T.delete(z),Z.delete(z),he.delete(z),k.delete(z),C.fetchers.delete(z)}function ir(z){let j=(re.get(z)||0)-1;j<=0?(re.delete(z),he.add(z)):re.set(z,j),et({fetchers:new Map(C.fetchers)})}function ot(z,j){let q=L.get(z);q&&(q.abort(j),L.delete(z))}function Nn(z){for(let j of z){let q=Li(j),te=va(q.data);C.fetchers.set(j,te)}}function Ht(){let z=[],j=!1;for(let q of Z){let te=C.fetchers.get(q);Ce(te,`Expected fetcher: ${q}`),te.state==="loading"&&(Z.delete(q),z.push(q),j=!0)}return Nn(z),j}function so(z){let j=[];for(let[q,te]of T)if(te0}function ds(z,j){let q=C.blockers.get(z)||Cl;return we.get(z)!==j&&we.set(z,j),q}function co(z){C.blockers.delete(z),we.delete(z)}function Jn(z,j){let q=C.blockers.get(z)||Cl;Ce(q.state==="unblocked"&&j.state==="blocked"||q.state==="blocked"&&j.state==="blocked"||q.state==="blocked"&&j.state==="proceeding"||q.state==="blocked"&&j.state==="unblocked"||q.state==="proceeding"&&j.state==="unblocked",`Invalid blocker state transition: ${q.state} -> ${j.state}`);let te=new Map(C.blockers);te.set(z,j),et({blockers:te})}function lr({currentLocation:z,nextLocation:j,historyAction:q}){if(we.size===0)return;we.size>1&&pt(!1,"A router only supports one blocker at a time");let te=Array.from(we.entries()),[oe,ge]=te[te.length-1],fe=C.blockers.get(oe))DELIM" +R"DELIM(;if(!(fe&&fe.state==="proceeding")&&ge({currentLocation:z,nextLocation:j,historyAction:q}))return oe}function Sa(z){let j=Tn(404,{pathname:z}),q=p||h,{matches:te,route:oe}=Mu(q);return{notFoundMatches:te,route:oe,error:j}}function In(z,j,q){if(E=z,B=j,A=q||null,!D&&C.navigation===Qf){D=!0;let te=fo(C.location,C.matches);te!=null&&et({restoreScrollPosition:te})}return()=>{E=null,B=null,A=null}}function or(z,j){return A&&A(z,j.map(te=>zT(te,C.loaderData)))||z.key}function ur(z,j){if(E&&B){let q=or(z,j);E[q]=B()}}function fo(z,j){if(E){let q=or(z,j),te=E[q];if(typeof te=="number")return te}return null}function sr(z,j,q){if(t.patchRoutesOnNavigation)if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:Hl(j,q,m,!0)}}else return{active:!0,matches:Hl(j,q,m,!0)||[]};return{active:!1,matches:null}}async function _a(z,j,q,te){if(!t.patchRoutesOnNavigation)return{type:"success",matches:z};let oe=z;for(;;){let ge=p==null,fe=p||h,ce=d;try{await t.patchRoutesOnNavigation({signal:q,path:j,matches:oe,fetcherKey:te,patch:(Ee,be)=>{q.aborted||lg(Ee,be,fe,ce,c,!1)}})}catch(Ee){return{type:"error",error:Ee,partialMatches:oe}}finally{ge&&!q.aborted&&(h=[...h])}if(q.aborted)return{type:"aborted"};let de=Ja(fe,j,m),ve=null;if(de){if(Object.keys(de[0].params).length===0)return{type:"success",matches:de};if(ve=Hl(fe,j,m,!0),!(ve&&oe.lengthq.route.id===j[te].route.id)}function hs(z){d={},p=Kl(z,c,void 0,d)}function ho(z,j,q=!1){let te=p==null;lg(z,j,p||h,d,c,q),te&&(h=[...h],et({}))}return me={get basename(){return m},get future(){return v},get state(){return C},get routes(){return h},get window(){return a},initialize:Ge,subscribe:qt,enableScrollRestoration:In,navigate:Zn,fetch:ji,revalidate:Ni,createHref:z=>t.history.createHref(z),encodeLocation:z=>t.history.encodeLocation(z),getFetcher:Li,resetFetcher:fs,deleteFetcher:ir,dispose:ct,getBlocker:ds,deleteBlocker:co,patchRoutes:ho,_internalFetchControllers:L,_internalSetRoutes:hs,_internalSetStateDoNotUseOrYouWillBreakYourApp(z){et(z)}},t.unstable_instrumentations&&(me=GT(me,t.unstable_instrumentations.map(z=>z.router).filter(Boolean))),me}function a3(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Sd(t,a,i,o,u,c){let d,h;if(u){d=[];for(let m of a)if(d.push(m),m.route.id===u){h=m;break}}else d=a,h=a[a.length-1];let p=Vd(o||".",Pd(d),Rn(t.pathname,i)||t.pathname,c==="path");if(o==null&&(p.search=t.search,p.hash=t.hash),(o==null||o===""||o===".")&&h){let m=Fd(p.search);if(h.route.index&&!m)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&m){let g=new URLSearchParams(p.search),v=g.getAll("index");g.delete("index"),v.filter(_=>_).forEach(_=>g.append("index",_));let b=g.toString();p.search=b?`?${b}`:""}}return i!=="/"&&(p.pathname=HT({basename:i,pathname:p.pathname})),Fn(p)}function rg(t,a,i){if(!i||!a3(i))return{path:a};if(i.formMethod&&!_3(i.formMethod))return{path:a,error:Tn(405,{method:i.formMethod})};let o=()=>({path:a,error:Tn(400,{type:"invalid-body"})}),c=(i.formMethod||"get").toUpperCase(),d=ub(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!Zt(c))return o();let v=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((b,[_,E])=>`${b}${_}=${E} +`,""):String(i.body);return{path:a,submission:{formMethod:c,formAction:d,formEncType:i.formEncType,formData:void 0,json:void 0,text:v}}}else if(i.formEncType==="application/json"){if(!Zt(c))return o();try{let v=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:c,formAction:d,formEncType:i.formEncType,formData:void 0,json:v,text:void 0}}}catch{return o()}}}Ce(typeof FormData=="function","FormData is not available in this environment");let h,p;if(i.formData)h=Ed(i.formData),p=i.formData;else if(i.body instanceof FormData)h=Ed(i.body),p=i.body;else if(i.body instanceof URLSearchParams)h=i.body,p=fg(h);else if(i.body==null)h=new URLSearchParams,p=new FormData;else try{h=new URLSearchParams(i.body),p=fg(h)}catch{return o()}let m={formMethod:c,formAction:d,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(Zt(m.formMethod))return{path:a,submission:m};let g=nr(a);return t&&g.search&&Fd(g.search)&&h.append("index",""),g.search=`?${h}`,{path:Fn(g),submission:m}}function ig(t,a,i,o,u,c,d,h,p,m,g,v,b,_,E,A,B,D,Q,X,se){let ue=X?mn(X[1])?X[1].error:X[1].data:void 0,me=u.createURL(c.location),C=u.createURL(p),I;if(g&&c.errors){let J=Object.keys(c.errors)[0];I=d.findIndex(w=>w.route.id===J)}else if(X&&mn(X[1])){let J=X[0];I=d.findIndex(w=>w.route.id===J)-1}let ie=X?X[1].statusCode:void 0,V=ie&&ie>=400,ee={currentUrl:me,currentParams:c.matches[0]?.params||{},nextUrl:C,nextP)DELIM" +R"DELIM(arams:d[0].params,...h,actionResult:ue,actionStatus:ie},_e=ao(d),Oe=d.map((J,w)=>{let{route:k}=J,L=null;if(I!=null&&w>I?L=!1:k.lazy?L=!0:Xd(k)?g?L=_d(k,c.loaderData,c.errors):r3(c.loaderData,c.matches[w],J)&&(L=!0):L=!1,L!==null)return wd(i,o,t,_e,J,m,a,L);let ae=!1;typeof se=="boolean"?ae=se:V?ae=!1:(v||me.pathname+me.search===C.pathname+C.search||me.search!==C.search||i3(c.matches[w],J))&&(ae=!0);let le={...ee,defaultShouldRevalidate:ae},T=Zl(J,le);return wd(i,o,t,_e,J,m,a,T,le,se)}),ne=[];return E.forEach((J,w)=>{if(g||!d.some(re=>re.route.id===J.routeId)||_.has(w))return;let k=c.fetchers.get(w),L=k&&k.state!=="idle"&&k.data===void 0,ae=Ja(B,J.path,D);if(!ae){if(Q&&L)return;ne.push({key:w,routeId:J.routeId,path:J.path,matches:null,match:null,request:null,controller:null});return}if(A.has(w))return;let le=$u(ae,J.path),T=new AbortController,Z=wi(u,J.path,T.signal),W=null;if(b.has(w))b.delete(w),W=Ri(i,o,Z,ae,le,m,a);else if(L)v&&(W=Ri(i,o,Z,ae,le,m,a));else{let re;typeof se=="boolean"?re=se:V?re=!1:re=v;let he={...ee,defaultShouldRevalidate:re};Zl(le,he)&&(W=Ri(i,o,Z,ae,le,m,a,he))}W&&ne.push({key:w,routeId:J.routeId,path:J.path,matches:W,match:le,request:Z,controller:T})}),{dsMatches:Oe,revalidatingFetchers:ne}}function Xd(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function _d(t,a,i){if(t.lazy)return!0;if(!Xd(t))return!1;let o=a!=null&&t.id in a,u=i!=null&&i[t.id]!==void 0;return!o&&u?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!o&&!u}function r3(t,a,i){let o=!a||i.route.id!==a.route.id,u=!t.hasOwnProperty(i.route.id);return o||u}function i3(t,a){let i=t.route.path;return t.pathname!==a.pathname||i!=null&&i.endsWith("*")&&t.params["*"]!==a.params["*"]}function Zl(t,a){if(t.route.shouldRevalidate){let i=t.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function lg(t,a,i,o,u,c){let d;if(t){let m=o[t];Ce(m,`No route found to patch children into: routeId = ${t}`),m.children||(m.children=[]),d=m.children}else d=i;let h=[],p=[];if(a.forEach(m=>{let g=d.find(v=>ab(m,v));g?p.push({existingRoute:g,newRoute:m}):h.push(m)}),h.length>0){let m=Kl(h,u,[t||"_","patch",String(d?.length||"0")],o);d.push(...m)}if(c&&p.length>0)for(let m=0;ma.children?.some(u=>ab(i,u))):!1}var og=new WeakMap,rb=({key:t,route:a,manifest:i,mapRouteProperties:o})=>{let u=i[a.id];if(Ce(u,"No route found in manifest"),!u.lazy||typeof u.lazy!="object")return;let c=u.lazy[t];if(!c)return;let d=og.get(u);d||(d={},og.set(u,d));let h=d[t];if(h)return h;let p=(async()=>{let m=_T(t),v=u[t]!==void 0&&t!=="hasErrorBoundary";if(m)pt(!m,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),d[t]=Promise.resolve();else if(v)pt(!1,`Route "${u.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let b=await c();b!=null&&(Object.assign(u,{[t]:b}),Object.assign(u,o(u)))}typeof u.lazy=="object"&&(u.lazy[t]=void 0,Object.values(u.lazy).every(b=>b===void 0)&&(u.lazy=void 0))})();return d[t]=p,p},ug=new WeakMap;function l3(t,a,i,o,u){let c=i[t.id];if(Ce(c,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let g=ug.get(c);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{Ce(typeof t.lazy=="function","No lazy route function found");let b=await t.lazy(),_={};for(let E in b){let A=b[E];if(A===void 0)continue;let B=ET(E),Q=c[E]!==void 0&&E!=="hasErrorBoundary";B?pt(!B,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Q?pt(!Q,`Route "${c.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):_[E]=A}Object.assign(c,_),Object.assign(c,{...o(c),lazy:void 0})})();return ug.set(c,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let d=Object.keys(t.lazy),h=[],p;for(let g of d){if(u&&u.includes(g))continue;let v=rb({key:g,route:t,manifest:i,mapRouteProperties:o});v&&(h.push(v),g===a&&(p=v))}let m=h.length>0?Promise.all(h).then(()=>{}):void 0;return m?.catch(()=>{}),p?.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:p}}async function sg(t){let a=t.matches.filter(u=>u.shouldLoad),i={};return(await Promise.all(a.map(u=>u.resolve()))).forEach((u,c)=>{i[a[c].route.id]=u}),i}async function o3(t){return t.matches.some(a=>a.route.middl)DELIM" +R"DELIM(eware)?ib(t,()=>sg(t)):sg(t)}function ib(t,a){return u3(t,a,o=>{if(S3(o))throw o;return o},v3,i);function i(o,u,c){if(c)return Promise.resolve(Object.assign(c.value,{[u]:{type:"error",result:o}}));{let{matches:d}=t,h=Math.min(Math.max(d.findIndex(m=>m.route.id===u),0),Math.max(d.findIndex(m=>m.shouldCallHandler()),0)),p=Ia(d,d[h].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:o}})}}}async function u3(t,a,i,o,u){let{matches:c,request:d,params:h,context:p,unstable_pattern:m}=t,g=c.flatMap(b=>b.route.middleware?b.route.middleware.map(_=>[b.route.id,_]):[]);return await lb({request:d,params:h,context:p,unstable_pattern:m},g,a,i,o,u)}async function lb(t,a,i,o,u,c,d=0){let{request:h}=t;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let p=a[d];if(!p)return await i();let[m,g]=p,v,b=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await lb(t,a,i,o,u,c,d+1)},v.value}catch(_){return v={value:await c(_,m,v)},v.value}};try{let _=await g(t,b),E=_!=null?o(_):void 0;return u(E)?E:v?E??v.value:(v={value:await b()},v.value)}catch(_){return await c(_,m,v)}}function ob(t,a,i,o,u){let c=rb({key:"middleware",route:o.route,manifest:a,mapRouteProperties:t}),d=l3(o.route,Zt(i.method)?"action":"loader",a,t,u);return{middleware:c,route:d.lazyRoutePromise,handler:d.lazyHandlerPromise}}function wd(t,a,i,o,u,c,d,h,p=null,m){let g=!1,v=ob(t,a,i,u,c);return{...u,_lazyPromises:v,shouldLoad:h,shouldRevalidateArgs:p,shouldCallHandler(b){return g=!0,p?typeof m=="boolean"?Zl(u,{...p,defaultShouldRevalidate:m}):typeof b=="boolean"?Zl(u,{...p,defaultShouldRevalidate:b}):Zl(u,p):h},resolve(b){let{lazy:_,loader:E,middleware:A}=u.route,B=g||h||b&&!Zt(i.method)&&(_||E),D=A&&A.length>0&&!E&&!_;return B&&(Zt(i.method)||!D)?c3({request:i,unstable_pattern:o,match:u,lazyHandlerPromise:v?.handler,lazyRoutePromise:v?.route,handlerOverride:b,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function Ri(t,a,i,o,u,c,d,h=null){return o.map(p=>p.route.id!==u.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:ob(t,a,i,p,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:wd(t,a,i,ao(o),p,c,d,!0,h))}async function s3(t,a,i,o,u,c){i.some(m=>m._lazyPromises?.middleware)&&await Promise.all(i.map(m=>m._lazyPromises?.middleware));let d={request:a,unstable_pattern:ao(i),params:i[0].params,context:u,matches:i},p=await t({...d,fetcherKey:o,runClientMiddleware:m=>{let g=d;return ib(g,()=>m({...g,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(m=>[m._lazyPromises?.handler,m._lazyPromises?.route]))}catch{}return p}async function c3({request:t,unstable_pattern:a,match:i,lazyHandlerPromise:o,lazyRoutePromise:u,handlerOverride:c,scopedContext:d}){let h,p,m=Zt(t.method),g=m?"action":"loader",v=b=>{let _,E=new Promise((D,Q)=>_=Q);p=()=>_(),t.signal.addEventListener("abort",p);let A=D=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${i.route.id}]`)):b({request:t,unstable_pattern:a,params:i.params,context:d},...D!==void 0?[D]:[]),B=(async()=>{try{return{type:"data",result:await(c?c(Q=>A(Q)):A())}}catch(D){return{type:"error",result:D}}})();return Promise.race([B,E])};try{let b=m?i.route.action:i.route.loader;if(o||u)if(b){let _,[E]=await Promise.all([v(b).catch(A=>{_=A}),o,u]);if(_!==void 0)throw _;h=E}else{await o;let _=m?i.route.action:i.route.loader;if(_)[h]=await Promise.all([v(_),u]);else if(g==="action"){let E=new URL(t.url),A=E.pathname+E.search;throw Tn(405,{method:t.method,pathname:A,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(b)h=await v(b);else{let _=new URL(t.url),E=_.pathname+_.search;throw Tn(404,{pathname:E})}}catch(b){return{type:"error",result:b}}finally{p&&t.signal.removeEventListener("abort",p)}return h}async function f3(t){let a=t.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?t.body==null?null:t.json():t.text()}async function d3(t){let{result:a,type:i}=t;if(Kd(a)){let o;try{o=await f3(a)}catch(u){return{type:"error",error:u}}return i==="error"?{type:"error",error:new no(a.status,a.statusText,o),statusCode:a.status,headers:a.headers}:{type:"data",data:o,statusCode:a.status,headers:a.headers}}return i==="error"?pg(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:y3(a),statusCode:Fl(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Fl(a)?a.status:void 0}:pg(a)?{type:"data",data:a.data,statusCode:a.init?.status,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"data",data:a}}function h3(t,a,i,o,u){let c=t.headers.get("Location");if(Ce(c,"Redirect)DELIM" +R"DELIM(s returned/thrown from loaders/actions must have a Location header"),!rs(c)){let d=o.slice(0,o.findIndex(h=>h.route.id===i)+1);c=Sd(new URL(a.url),d,u,c),t.headers.set("Location",c)}return t}function cg(t,a,i){if(rs(t)){let o=t,u=o.startsWith("//")?new URL(a.protocol+o):new URL(o),c=Rn(u.pathname,i)!=null;if(u.origin===a.origin&&c)return u.pathname+u.search+u.hash}return t}function wi(t,a,i,o){let u=t.createURL(ub(a)).toString(),c={signal:i};if(o&&Zt(o.formMethod)){let{formMethod:d,formEncType:h}=o;c.method=d.toUpperCase(),h==="application/json"?(c.headers=new Headers({"Content-Type":h}),c.body=JSON.stringify(o.json)):h==="text/plain"?c.body=o.text:h==="application/x-www-form-urlencoded"&&o.formData?c.body=Ed(o.formData):c.body=o.formData}return new Request(u,c)}function Ed(t){let a=new URLSearchParams;for(let[i,o]of t.entries())a.append(i,typeof o=="string"?o:o.name);return a}function fg(t){let a=new FormData;for(let[i,o]of t.entries())a.append(i,o);return a}function m3(t,a,i,o=!1,u=!1){let c={},d=null,h,p=!1,m={},g=i&&mn(i[1])?i[1].error:void 0;return t.forEach(v=>{if(!(v.route.id in a))return;let b=v.route.id,_=a[b];if(Ce(!Mr(_),"Cannot handle redirect results in processLoaderData"),mn(_)){let E=_.error;if(g!==void 0&&(E=g,g=void 0),d=d||{},u)d[b]=E;else{let A=Ia(t,b);d[A.route.id]==null&&(d[A.route.id]=E)}o||(c[b]=nb),p||(p=!0,h=Fl(_.error)?_.error.status:500),_.headers&&(m[b]=_.headers)}else c[b]=_.data,_.statusCode&&_.statusCode!==200&&!p&&(h=_.statusCode),_.headers&&(m[b]=_.headers)}),g!==void 0&&i&&(d={[i[0]]:g},i[2]&&(c[i[2]]=void 0)),{loaderData:c,errors:d,statusCode:h||200,loaderHeaders:m}}function dg(t,a,i,o,u,c){let{loaderData:d,errors:h}=m3(a,i,o);return u.filter(p=>!p.matches||p.matches.some(m=>m.shouldLoad)).forEach(p=>{let{key:m,match:g,controller:v}=p;if(v&&v.signal.aborted)return;let b=c[m];if(Ce(b,"Did not find corresponding fetcher result"),mn(b)){let _=Ia(t.matches,g?.route.id);h&&h[_.route.id]||(h={...h,[_.route.id]:b.error}),t.fetchers.delete(m)}else if(Mr(b))Ce(!1,"Unhandled fetcher revalidation redirect");else{let _=va(b.data);t.fetchers.set(m,_)}}),{loaderData:d,errors:h}}function hg(t,a,i,o){let u=Object.entries(a).filter(([,c])=>c!==nb).reduce((c,[d,h])=>(c[d]=h,c),{});for(let c of i){let d=c.route.id;if(!a.hasOwnProperty(d)&&t.hasOwnProperty(d)&&c.route.loader&&(u[d]=t[d]),o&&o.hasOwnProperty(d))break}return u}function mg(t){return t?mn(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Ia(t,a){return(a?t.slice(0,t.findIndex(o=>o.route.id===a)+1):[...t]).reverse().find(o=>o.route.hasErrorBoundary===!0)||t[0]}function Mu(t){let a=t.length===1?t[0]:t.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Tn(t,{pathname:a,routeId:i,method:o,type:u,message:c}={}){let d="Unknown Server Error",h="Unknown @remix-run/router error";return t===400?(d="Bad Request",o&&a&&i?h=`You made a ${o} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:u==="invalid-body"&&(h="Unable to encode submission body")):t===403?(d="Forbidden",h=`Route "${i}" does not match URL "${a}"`):t===404?(d="Not Found",h=`No route matches URL "${a}"`):t===405&&(d="Method Not Allowed",o&&a&&i?h=`You made a ${o.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:o&&(h=`Invalid request method "${o.toUpperCase()}"`)),new no(t||500,d,new Error(h),!0)}function Cu(t){let a=Object.entries(t);for(let i=a.length-1;i>=0;i--){let[o,u]=a[i];if(Mr(u))return{key:o,result:u}}}function ub(t){let a=typeof t=="string"?nr(t):t;return Fn({...a,hash:""})}function p3(t,a){return t.pathname!==a.pathname||t.search!==a.search?!1:t.hash===""?a.hash!=="":t.hash===a.hash?!0:a.hash!==""}function y3(t){return new no(t.init?.status??500,t.init?.statusText??"Internal Server Error",t.data)}function v3(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([a,i])=>typeof a=="string"&&g3(i))}function g3(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function b3(t){return Kd(t.result)&&eb.has(t.result.status)}function mn(t){return t.type==="error"}function Mr(t){return(t&&t.type)==="redirect"}function pg(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Kd(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function x3(t){return eb.has(t)}function S3(t){return Kd(t)&&x3(t.status)&&t.headers.has("Location")}function _3(t){return IT.has(t.toUpperCase())}function Zt(t){return FT.has(t.toUpperCase())}function Fd(t){return new URLSearchParams(t).getAll("index").some(a=>a==="")}function $u(t,a){let i=typeof a=="string"?nr(a).search:a.search;if(t[t.length-1].route.index&&Fd(i||""))return t[t.length-1];let o=K0(t);return o)DELIM" +R"DELIM([o.length-1]}function yg(t){let{formMethod:a,formAction:i,formEncType:o,text:u,formData:c,json:d}=t;if(!(!a||!i||!o)){if(u!=null)return{formMethod:a,formAction:i,formEncType:o,formData:void 0,json:void 0,text:u};if(c!=null)return{formMethod:a,formAction:i,formEncType:o,formData:c,json:void 0,text:void 0};if(d!==void 0)return{formMethod:a,formAction:i,formEncType:o,formData:void 0,json:d,text:void 0}}}function Yf(t,a){return a?{state:"loading",location:t,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function w3(t,a){return{state:"submitting",location:t,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}function Nl(t,a){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:a}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function E3(t,a){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:a?a.data:void 0}}function va(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function T3(t,a){try{let i=t.sessionStorage.getItem(tb);if(i){let o=JSON.parse(i);for(let[u,c]of Object.entries(o||{}))c&&Array.isArray(c)&&a.set(u,new Set(c||[]))}}catch{}}function z3(t,a){if(a.size>0){let i={};for(let[o,u]of a)i[o]=[...u];try{t.sessionStorage.setItem(tb,JSON.stringify(i))}catch(o){pt(!1,`Failed to save applied view transitions in sessionStorage (${o}).`)}}}function vg(){let t,a,i=new Promise((o,u)=>{t=async c=>{o(c);try{await i}catch{}},a=async c=>{u(c);try{await i}catch{}}});return{promise:i,resolve:t,reject:a}}var Ur=O.createContext(null);Ur.displayName="DataRouter";var ro=O.createContext(null);ro.displayName="DataRouterState";var sb=O.createContext(!1);function R3(){return O.useContext(sb)}var Jd=O.createContext({isTransitioning:!1});Jd.displayName="ViewTransition";var cb=O.createContext(new Map);cb.displayName="Fetchers";var O3=O.createContext(null);O3.displayName="Await";var An=O.createContext(null);An.displayName="Navigation";var is=O.createContext(null);is.displayName="Location";var $n=O.createContext({outlet:null,matches:[],isDataRoute:!1});$n.displayName="Route";var Id=O.createContext(null);Id.displayName="RouteError";var fb="REACT_ROUTER_ERROR",A3="REDIRECT",M3="ROUTE_ERROR_RESPONSE";function C3(t){if(t.startsWith(`${fb}:${A3}:{`))try{let a=JSON.parse(t.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function N3(t){if(t.startsWith(`${fb}:${M3}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new no(a.status,a.statusText,a.data)}catch{}}function D3(t,{relative:a}={}){Ce(io(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:o}=O.useContext(An),{hash:u,pathname:c,search:d}=oo(t,{relative:a}),h=c;return i!=="/"&&(h=c==="/"?i:Kn([i,c])),o.createHref({pathname:h,search:d,hash:u})}function io(){return O.useContext(is)!=null}function ar(){return Ce(io(),"useLocation() may be used only in the context of a component."),O.useContext(is).location}var db="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function hb(t){O.useContext(An).static||O.useLayoutEffect(t)}function lo(){let{isDataRoute:t}=O.useContext($n);return t?V3():j3()}function j3(){Ce(io(),"useNavigate() may be used only in the context of a component.");let t=O.useContext(Ur),{basename:a,navigator:i}=O.useContext(An),{matches:o}=O.useContext($n),{pathname:u}=ar(),c=JSON.stringify(Pd(o)),d=O.useRef(!1);return hb(()=>{d.current=!0}),O.useCallback((p,m={})=>{if(pt(d.current,db),!d.current)return;if(typeof p=="number"){i.go(p);return}let g=Vd(p,JSON.parse(c),u,m.relative==="path");t==null&&a!=="/"&&(g.pathname=g.pathname==="/"?a:Kn([a,g.pathname])),(m.replace?i.replace:i.push)(g,m.state,m)},[a,i,c,u,t])}var k3=O.createContext(null);function L3(t){let a=O.useContext($n).outlet;return O.useMemo(()=>a&&O.createElement(k3.Provider,{value:t},a),[a,t])}function Wd(){let{matches:t}=O.useContext($n),a=t[t.length-1];return a?a.params:{}}function oo(t,{relative:a}={}){let{matches:i}=O.useContext($n),{pathname:o}=ar(),u=JSON.stringify(Pd(i));return O.useMemo(()=>Vd(t,JSON.parse(u),o,a==="path"),[t,u,o,a])}function B3(t,a,i,o,u){Ce(io(),"useRoutes() may be used only in the context of a component.");let{navigator:c}=O.useContext(An),{matches:)DELIM" +R"DELIM(d}=O.useContext($n),h=d[d.length-1],p=h?h.params:{},m=h?h.pathname:"/",g=h?h.pathnameBase:"/",v=h&&h.route;{let Q=v&&v.path||"";yb(m,!v||Q.endsWith("*")||Q.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${m}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. +Please change the parent to .`)}let b=ar(),_;_=b;let E=_.pathname||"/",A=E;if(g!=="/"){let Q=g.replace(/^\//,"").split("/");A="/"+E.replace(/^\//,"").split("/").slice(Q.length).join("/")}let B=Ja(t,{pathname:A});return pt(v||B!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),pt(B==null||B[B.length-1].route.element!==void 0||B[B.length-1].route.Component!==void 0||B[B.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),q3(B&&B.map(Q=>Object.assign({},Q,{params:Object.assign({},p,Q.params),pathname:Kn([g,c.encodeLocation?c.encodeLocation(Q.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Q.pathname]),pathnameBase:Q.pathnameBase==="/"?g:Kn([g,c.encodeLocation?c.encodeLocation(Q.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Q.pathnameBase])})),d,i,o,u)}function U3(){let t=pb(),a=Fl(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),i=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:o},c={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=O.createElement(O.Fragment,null,O.createElement("p",null,"💿 Hey developer 👋"),O.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",O.createElement("code",{style:c},"ErrorBoundary")," or"," ",O.createElement("code",{style:c},"errorElement")," prop on your route.")),O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},a),i?O.createElement("pre",{style:u},i):null,d)}var H3=O.createElement(U3,null),mb=class extends O.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,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){this.props.onError?this.props.onError(t,a):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const i=N3(t.digest);i&&(t=i)}let a=t!==void 0?O.createElement($n.Provider,{value:this.props.routeContext},O.createElement(Id.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?O.createElement($3,{error:t},a):a}};mb.contextType=sb;var Gf=new WeakMap;function $3({children:t,error:a}){let{basename:i}=O.useContext(An);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=C3(a.digest);if(o){let u=Gf.get(a);if(u)throw u;let c=J0(o.location,i);if(F0&&!Gf.get(a))if(c.isExternal||o.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:o.replace}));throw Gf.set(a,d),d}return O.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return t}function Z3({routeContext:t,match:a,children:i}){let o=O.useContext(Ur);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),O.createElement($n.Provider,{value:t},i)}function q3(t,a=[],i=null,o=null,u=null){if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(a.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let c=t,d=i?.errors;if(d!=null){let g=c.findIndex(v=>v.route.id&&d?.[v.route.id]!==void 0);Ce(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,g+1))}let h=!1,p=-1;if(i)for(let g=0;g=0?c=c.slice(0,p+1):c=[c[0]];break}}}let m=i&&o?(g,v)=>{o(g,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:ao(i.matches),er)DELIM" +R"DELIM(rorInfo:v})}:void 0;return c.reduceRight((g,v,b)=>{let _,E=!1,A=null,B=null;i&&(_=d&&v.route.id?d[v.route.id]:void 0,A=v.route.errorElement||H3,h&&(p<0&&b===0?(yb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,B=null):p===b&&(E=!0,B=v.route.hydrateFallbackElement||null)));let D=a.concat(c.slice(0,b+1)),Q=()=>{let X;return _?X=A:E?X=B:v.route.Component?X=O.createElement(v.route.Component,null):v.route.element?X=v.route.element:X=g,O.createElement(Z3,{match:v,routeContext:{outlet:g,matches:D,isDataRoute:i!=null},children:X})};return i&&(v.route.ErrorBoundary||v.route.errorElement||b===0)?O.createElement(mb,{location:i.location,revalidation:i.revalidation,component:A,error:_,children:Q(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:m}):Q()},null)}function eh(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Q3(t){let a=O.useContext(Ur);return Ce(a,eh(t)),a}function Y3(t){let a=O.useContext(ro);return Ce(a,eh(t)),a}function G3(t){let a=O.useContext($n);return Ce(a,eh(t)),a}function th(t){let a=G3(t),i=a.matches[a.matches.length-1];return Ce(i.route.id,`${t} can only be used on routes that contain a unique "id"`),i.route.id}function P3(){return th("useRouteId")}function pb(){let t=O.useContext(Id),a=Y3("useRouteError"),i=th("useRouteError");return t!==void 0?t:a.errors?.[i]}function V3(){let{router:t}=Q3("useNavigate"),a=th("useNavigate"),i=O.useRef(!1);return hb(()=>{i.current=!0}),O.useCallback(async(u,c={})=>{pt(i.current,db),i.current&&(typeof u=="number"?await t.navigate(u):await t.navigate(u,{fromRouteId:a,...c}))},[t,a])}var gg={};function yb(t,a,i){!a&&!gg[t]&&(gg[t]=!0,pt(!1,i))}var bg={};function xg(t,a){!t&&!bg[a]&&(bg[a]=!0,console.warn(a))}var X3="useOptimistic",Sg=Ux[X3],K3=()=>{};function F3(t){return Sg?Sg(t):[t,K3]}function J3(t){let a={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&pt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:O.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&pt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:O.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&pt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:O.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),a}var I3=["HydrateFallback","hydrateFallbackElement"],W3=class{constructor(){this.status="pending",this.promise=new Promise((t,a)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",t(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",a(i))}})}};function ez({router:t,flushSync:a,onError:i,unstable_useTransitions:o}){o=R3()||o;let[c,d]=O.useState(t.state),[h,p]=F3(c),[m,g]=O.useState(),[v,b]=O.useState({isTransitioning:!1}),[_,E]=O.useState(),[A,B]=O.useState(),[D,Q]=O.useState(),X=O.useRef(new Map),se=O.useCallback((I,{deletedFetchers:ie,newErrors:V,flushSync:ee,viewTransitionOpts:_e})=>{V&&i&&Object.values(V).forEach(ne=>i(ne,{location:I.location,params:I.matches[0]?.params??{},unstable_pattern:ao(I.matches)})),I.fetchers.forEach((ne,J)=>{ne.data!==void 0&&X.current.set(J,ne.data)}),ie.forEach(ne=>X.current.delete(ne)),xg(ee===!1||a!=null,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Oe=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(xg(_e==null||Oe,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_e||!Oe){a&&ee?a(()=>d(I)):o===!1?d(I):O.startTransition(()=>{o===!0&&p(ne=>_g(ne,I)),d(I)});return}if(a&&ee){a(()=>{A&&(_?.resolve(),A.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:_e.currentLocation,nextLocation:_e.nextLocation})});let ne=t.window.document.startViewTransition(()=>{a(()=>d(I))});ne.finished.finally(()=>{a(()=>{E(void 0),B(void 0),g(void 0),b({isTransitioning:!1})})}),a(()=>B(ne));return}A?(_?.resolve(),A.skipTransition(),Q({state:I,currentLocation:_e.currentLocation,nextLocation:_e.nextLocation})):(g(I),b({isTransitioning:!0,flushSync:!1,currentLocation:_e.currentLocation,nextLocation:_e.nextLocation}))},[t.window,a,A,_,o,p,i]);O.useLayoutEffect(()=>t.subscribe(se),[t,se]),O.useEffect(()=>{v.isTra)DELIM" +R"DELIM(nsitioning&&!v.flushSync&&E(new W3)},[v]),O.useEffect(()=>{if(_&&m&&t.window){let I=m,ie=_.promise,V=t.window.document.startViewTransition(async()=>{o===!1?d(I):O.startTransition(()=>{o===!0&&p(ee=>_g(ee,I)),d(I)}),await ie});V.finished.finally(()=>{E(void 0),B(void 0),g(void 0),b({isTransitioning:!1})}),B(V)}},[m,_,t.window,o,p]),O.useEffect(()=>{_&&m&&h.location.key===m.location.key&&_.resolve()},[_,A,h.location,m]),O.useEffect(()=>{!v.isTransitioning&&D&&(g(D.state),b({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),Q(void 0))},[v.isTransitioning,D]);let ue=O.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:I=>t.navigate(I),push:(I,ie,V)=>t.navigate(I,{state:ie,preventScrollReset:V?.preventScrollReset}),replace:(I,ie,V)=>t.navigate(I,{replace:!0,state:ie,preventScrollReset:V?.preventScrollReset})}),[t]),me=t.basename||"/",C=O.useMemo(()=>({router:t,navigator:ue,static:!1,basename:me,onError:i}),[t,ue,me,i]);return O.createElement(O.Fragment,null,O.createElement(Ur.Provider,{value:C},O.createElement(ro.Provider,{value:h},O.createElement(cb.Provider,{value:X.current},O.createElement(Jd.Provider,{value:v},O.createElement(rz,{basename:me,location:h.location,navigationType:h.historyAction,navigator:ue,unstable_useTransitions:o},O.createElement(tz,{routes:t.routes,future:t.future,state:h,onError:i})))))),null)}function _g(t,a){return{...t,navigation:a.navigation.state!=="idle"?a.navigation:t.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:t.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:t.actionData,fetchers:a.fetchers}}var tz=O.memo(nz);function nz({routes:t,future:a,state:i,onError:o}){return B3(t,void 0,i,o,a)}function az(t){return L3(t.context)}function ga(t){Ce(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function rz({basename:t="/",children:a=null,location:i,navigationType:o="POP",navigator:u,static:c=!1,unstable_useTransitions:d}){Ce(!io(),"You cannot render a inside another . You should never have more than one in your app.");let h=t.replace(/^\/*/,"/"),p=O.useMemo(()=>({basename:h,navigator:u,static:c,unstable_useTransitions:d,future:{}}),[h,u,c,d]);typeof i=="string"&&(i=nr(i));let{pathname:m="/",search:g="",hash:v="",state:b=null,key:_="default"}=i,E=O.useMemo(()=>{let A=Rn(m,h);return A==null?null:{location:{pathname:A,search:g,hash:v,state:b,key:_},navigationType:o}},[h,m,g,v,b,_,o]);return pt(E!=null,` is not able to match the URL "${m}${g}${v}" because it does not start with the basename, so the won't render anything.`),E==null?null:O.createElement(An.Provider,{value:p},O.createElement(is.Provider,{children:a,value:E}))}function Td(t,a=[]){let i=[];return O.Children.forEach(t,(o,u)=>{if(!O.isValidElement(o))return;let c=[...a,u];if(o.type===O.Fragment){i.push.apply(i,Td(o.props.children,c));return}Ce(o.type===ga,`[${typeof o.type=="string"?o.type:o.type.name}] is not a component. All component children of must be a or `),Ce(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||c.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Td(o.props.children,c)),i.push(d)}),i}var iz=Td,Zu="get",qu="application/x-www-form-urlencoded";function ls(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function lz(t){return ls(t)&&t.tagName.toLowerCase()==="button"}function oz(t){return ls(t)&&t.tagName.toLowerCase()==="form"}function uz(t){return ls(t)&&t.tagName.toLowerCase()==="input"}function sz(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function cz(t,a){return t.button===0&&(!a||a==="_self")&&!sz(t)}function zd(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,i)=>{let o=t[i];return a.concat(Array.isArray(o)?o.map(u=>[i,u]):[[i,o]])},[]))}function fz(t,a){let i=zd(t);return a&&a.forEach((o,u)=>{i.has(u)||a.getAll(u).forEach(c=>{i.append(u,c)})}),i}var Nu=null;function dz(){if(Nu===null)try{new FormData(document.createElement("form"),0),Nu=!1}catch{Nu=!0}return Nu}var hz=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pf(t){return t!=null&&!hz.has(t)?(pt(!1,`"${t}" is not a valid \`encType\` for \`
\`)DELIM" +R"DELIM(/\`\` and will default to "${qu}"`),null):t}function mz(t,a){let i,o,u,c,d;if(oz(t)){let h=t.getAttribute("action");o=h?Rn(h,a):null,i=t.getAttribute("method")||Zu,u=Pf(t.getAttribute("enctype"))||qu,c=new FormData(t)}else if(lz(t)||uz(t)&&(t.type==="submit"||t.type==="image")){let h=t.form;if(h==null)throw new Error('Cannot submit a