From 6a6fc66368d962d7b0566c65dbfaccb3ce3bee8b Mon Sep 17 00:00:00 2001 From: BOB450 Date: Tue, 21 Jul 2026 18:34:55 -0600 Subject: [PATCH 1/2] Block transaction pages now fail atomically when any expected transaction request fails, preventing incomplete results from appearing successful. --- console/embedded/native_css.cpp | 10 +- console/embedded/native_ecma.cpp | 156 +++++++++++++++---------------- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git a/console/embedded/native_css.cpp b/console/embedded/native_css.cpp index a2a4b57b..663b6c3e 100644 --- a/console/embedded/native_css.cpp +++ b/console/embedded/native_css.cpp @@ -22,11 +22,11 @@ namespace libbitcoin { namespace server { DEFINE_EMBEDDED_PAGE(native_pages, char, css, -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-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--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-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--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-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-xl:36rem;--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-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--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-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--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,currentcolor 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);)DELIM" -R"DELIM(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:where([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{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-y-0{inset-block:0}.left-0{left:0}.z-50{z-index:50}.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:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-2{margin-right:calc(var(--spacing) * 2)}.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}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-8{height:calc(var(--spacing) * 8)}.h-full{height:100%}.max-h-\[60vh\]{max-height:60vh}.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:0}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.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:0}.gap-1{gap:var(--spacing)}.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)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * 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-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;)DELIM" -R"DELIM(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-style);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}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-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\/20{border-color:#c8563733}.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)}}.border-textMuted\/30{border-color:#cfcfcf4d}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accentSecondary{background-color:#c85637}.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-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.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\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.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\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.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-surface\/95{background-color:#1f211cf2}.bg-textPrimary{background-color:#ededed}.bg-transparent{background-color:#0000}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.18\)\,rgba\(255\,255\,255\,0\)\)\]{background-image:linear-gradient(#ffffff2e,#fff0)}.from-accent\/8{--tw-gradient-from:oklab(78.4754% .0670866 .152134/.08);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-surface\/60{--tw-gradient-to:oklab(24.3789% -.00557161 .00797938/.6);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.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:var(--spacing)}.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)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.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-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--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(--color-emerald-300)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed})DELIM" -R"DELIM(.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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)}.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,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-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: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: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}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.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\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\: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,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}}@media(min-width:80rem){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}: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-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@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%})DELIM" -R"DELIM(@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-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@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} +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-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--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-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--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-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-xl:36rem;--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-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--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-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--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,currentcolor 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)DELIM" +R"DELIM((--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:where([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{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-y-0{inset-block:0}.left-0{left:0}.z-50{z-index:50}.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:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-2{margin-right:calc(var(--spacing) * 2)}.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}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-8{height:calc(var(--spacing) * 8)}.h-full{height:100%}.max-h-\[60vh\]{max-height:60vh}.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:0}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.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:0}.gap-1{gap:var(--spacing)}.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)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * 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-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * 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))DELIM" +R"DELIM( * 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-style);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}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-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\/20{border-color:#c8563733}.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)}}.border-textMuted\/30{border-color:#cfcfcf4d}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accentSecondary{background-color:#c85637}.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-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.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\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.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\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.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-surface\/95{background-color:#1f211cf2}.bg-textPrimary{background-color:#ededed}.bg-transparent{background-color:#0000}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.18\)\,rgba\(255\,255\,255\,0\)\)\]{background-image:linear-gradient(#ffffff2e,#fff0)}.from-accent\/8{--tw-gradient-from:oklab(78.4754% .0670866 .152134/.08);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-surface\/60{--tw-gradient-to:oklab(24.3789% -.00557161 .00797938/.6);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.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:var(--spacing)}.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)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.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-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--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(--color-emerald-300)}.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}.nor)DELIM" +R"DELIM(mal-case{text-transform:none}.uppercase{text-transform:uppercase}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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)}.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,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-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: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: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}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.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\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\: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,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}}@media(min-width:80rem){.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}: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-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@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:fa)DELIM" +R"DELIM(lse;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-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@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" ) diff --git a/console/embedded/native_ecma.cpp b/console/embedded/native_ecma.cpp index cac966f5..cb5cebc6 100644 --- a/console/embedded/native_ecma.cpp +++ b/console/embedded/native_ecma.cpp @@ -22,49 +22,49 @@ namespace libbitcoin { namespace server { DEFINE_EMBEDDED_PAGE(native_pages, char, ecma, -R"DELIM(function ew(e,a){for(var i=0;il[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function Sh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bd={exports:{}},so={};var Xg;function tw(){if(Xg)return so;Xg=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,s,u){var c=null;if(u!==void 0&&(c=""+u),s.key!==void 0&&(c=""+s.key),"key"in s){u={};for(var d in s)d!=="key"&&(u[d]=s[d])}else u=s;return s=u.ref,{$$typeof:e,type:l,key:c,ref:s!==void 0?s:null,props:u}}return so.Fragment=a,so.jsx=i,so.jsxs=i,so}var Ig;function nw(){return Ig||(Ig=1,bd.exports=tw()),bd.exports}var v=nw(),xd={exports:{}},ke={};var Jg;function aw(){if(Jg)return ke;Jg=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=x&&C[x]||C["@@iterator"],typeof C=="function"?C:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,N={};function F(C,K,oe){this.props=C,this.context=K,this.refs=N,this.updater=oe||E}F.prototype.isReactComponent={},F.prototype.setState=function(C,K){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,K,"setState")},F.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function V(){}V.prototype=F.prototype;function J(C,K,oe){this.props=C,this.context=K,this.refs=N,this.updater=oe||E}var ue=J.prototype=new V;ue.constructor=J,R(ue,F.prototype),ue.isPureReactComponent=!0;var ae=Array.isArray;function xe(){}var j={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function D(C,K,oe){var he=oe.ref;return{$$typeof:e,type:C,key:K,ref:he!==void 0?he:null,props:oe}}function B(C,K){return D(C.type,K,C.props)}function Q(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function q(C){var K={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(oe){return K[oe]})}var G=/\/+/g;function re(C,K){return typeof C=="object"&&C!==null&&C.key!=null?q(""+C.key):K.toString(36)}function fe(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(xe,xe):(C.status="pending",C.then(function(K){C.status==="pending"&&(C.status="fulfilled",C.value=K)},function(K){C.status==="pending"&&(C.status="rejected",C.reason=K)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function M(C,K,oe,he,Ee){var Te=typeof C;(Te==="undefined"||Te==="boolean")&&(C=null);var W=!1;if(C===null)W=!0;else switch(Te){case"bigint":case"string":case"number":W=!0;break;case"object":switch(C.$$typeof){case e:case a:W=!0;break;case b:return W=C._init,M(W(C._payload),K,oe,he,Ee)}}if(W)return Ee=Ee(C),W=he===""?"."+re(C,0):he,ae(Ee)?(oe="",W!=null&&(oe=W.replace(G,"$&/")+"/"),M(Ee,K,oe,"",function(ge){return ge})):Ee!=null&&(Q(Ee)&&(Ee=B(Ee,oe+(Ee.key==null||C&&C.key===Ee.key?"":(""+Ee.key).replace(G,"$&/")+"/")+W)),K.push(Ee)),1;W=0;var de=he===""?".":he+":";if(ae(C))for(var X=0;X>>1,we=M[ce];if(0>>1;ces(oe,le))hes(Ee,oe)?(M[ce]=Ee,M[he]=le,ce=he):(M[ce]=oe,M[K]=le,ce=K);else if(hes(Ee,le))M[ce]=Ee,M[he]=le,ce=he;else break e}}return k}function s(M,k){var le=M.sortIndex-k.sortIndex;return le!==0?le:M.id-k.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],p=[],b=1,g=null,x=3,w=!1,E=!1,R=!1,N=!1,F=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function ue(M){for(var k=i(p);k!==null;){if(k.callback===null)l(p);else if(k.startTime<=M)l(p),k.sortIndex=k.expirationTime,a(m,k);else break;k=i(p)}}function ae(M){if(R=!1,ue(M),!E)if(i(m)!==null)E=!0,xe||(xe=!0,q());else{var k=i(p);k!==null&&fe(ae,k.startTime-M)}}var xe=!1,j=-1,_=5,D=-1;function B(){return N?!0:!(e.unstable_now()-D<_)}function Q(){if(N=!1,xe){var M=e.unstable_now();D=M;var k=!0;try{e:{E=!1,R&&(R=!1,V(j),j=-1),w=!0;var le=x;try{t:{for(ue(M),g=i(m);g!==null&&!(g.expirationTime>M&&B());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,x=g.priorityLevel;var we=ce(g.expirationTime<=M);if(M=e.unstable_now(),typeof we=="function"){g.callback=we,ue(M),k=!0;break t}g===i(m)&&l(m),ue(M)}else l(m);g=i(m)}if(g!==null)k=!0;else{var C=i(p);C!==null&&fe(ae,C.startTime-M),k=!1}}break e}finally{g=null,x=le,w=!1}k=void 0}}finally{k?q():xe=!1}}}var q;if(typeof J=="function")q=function(){J(Q)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,re=G.port2;G.port1.onmessage=Q,q=function(){re.postMessage(null)}}else q=function(){F(Q,0)};function fe(M,k){j=F(function(){M(e.unstable_now())},k)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125ce?(M.sortIndex=le,a(p,M),i(m)===null&&M===i(p)&&(R?(V(j),j=-1):R=!0,fe(ae,le-ce))):(M.sortIndex=we,a(m,M),E||w||(E=!0,xe||(xe=!0,q()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var k=x;return function(){var le=x;x=k;try{return M.apply(this,arguments)}finally{x=le}}}})(_d)),_d}var tv;function lw(){return tv||(tv=1,wd.exports=iw()),wd.exports}var Ed={exports:{}},Jt={};var nv;function ow(){if(nv)return Jt;nv=1;var e=wh();function a(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Ed.exports=ow(),Ed.exports}var rv;function sw(){if(rv)return uo;rv=1;var e=lw(),a=wh(),i=Q0();function l(t){var n="https://react.dev/errors/"+t;if(1we||(t.current=ce[we],ce[we]=null,we--)}function oe(t,n){we++,ce[we]=t.current,t.current=n}var he=C(null),Ee=C(null),Te=C(null),W=C(null);function de(t,n){switch(oe(Te,n),oe(Ee,t),oe(he,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?bg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=bg(n),t=xg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(he),oe(he,t)}function X(){K(he),K(Ee),K(Te)}function ge(t){t.memoizedState!==null&&oe(W,t);var n=he.current,r=xg(n,t.type);n!==r&&(oe(Ee,t),oe(he,r))}function pe(t){Ee.current===t&&(K(he),K(Ee)),W.current===t&&(K(W),ro._currentValue=le)}var Ue,je;function He(t){if(Ue===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ue=n&&n[1]||"",je=-1l[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function Sh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bd={exports:{}},oo={};var Jg;function lw(){if(Jg)return oo;Jg=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,s,u){var c=null;if(u!==void 0&&(c=""+u),s.key!==void 0&&(c=""+s.key),"key"in s){u={};for(var d in s)d!=="key"&&(u[d]=s[d])}else u=s;return s=u.ref,{$$typeof:e,type:l,key:c,ref:s!==void 0?s:null,props:u}}return oo.Fragment=a,oo.jsx=i,oo.jsxs=i,oo}var Wg;function ow(){return Wg||(Wg=1,bd.exports=lw()),bd.exports}var v=ow(),xd={exports:{}},ke={};var ev;function sw(){if(ev)return ke;ev=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=x&&C[x]||C["@@iterator"],typeof C=="function"?C:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,N={};function F(C,K,oe){this.props=C,this.context=K,this.refs=N,this.updater=oe||E}F.prototype.isReactComponent={},F.prototype.setState=function(C,K){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,K,"setState")},F.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function V(){}V.prototype=F.prototype;function J(C,K,oe){this.props=C,this.context=K,this.refs=N,this.updater=oe||E}var ue=J.prototype=new V;ue.constructor=J,R(ue,F.prototype),ue.isPureReactComponent=!0;var ae=Array.isArray;function xe(){}var j={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function D(C,K,oe){var he=oe.ref;return{$$typeof:e,type:C,key:K,ref:he!==void 0?he:null,props:oe}}function B(C,K){return D(C.type,K,C.props)}function Q(C){return typeof C=="object"&&C!==null&&C.$$typeof===e}function q(C){var K={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(oe){return K[oe]})}var G=/\/+/g;function re(C,K){return typeof C=="object"&&C!==null&&C.key!=null?q(""+C.key):K.toString(36)}function fe(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(xe,xe):(C.status="pending",C.then(function(K){C.status==="pending"&&(C.status="fulfilled",C.value=K)},function(K){C.status==="pending"&&(C.status="rejected",C.reason=K)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function M(C,K,oe,he,Ee){var Te=typeof C;(Te==="undefined"||Te==="boolean")&&(C=null);var W=!1;if(C===null)W=!0;else switch(Te){case"bigint":case"string":case"number":W=!0;break;case"object":switch(C.$$typeof){case e:case a:W=!0;break;case b:return W=C._init,M(W(C._payload),K,oe,he,Ee)}}if(W)return Ee=Ee(C),W=he===""?"."+re(C,0):he,ae(Ee)?(oe="",W!=null&&(oe=W.replace(G,"$&/")+"/"),M(Ee,K,oe,"",function(ge){return ge})):Ee!=null&&(Q(Ee)&&(Ee=B(Ee,oe+(Ee.key==null||C&&C.key===Ee.key?"":(""+Ee.key).replace(G,"$&/")+"/")+W)),K.push(Ee)),1;W=0;var de=he===""?".":he+":";if(ae(C))for(var X=0;X>>1,we=M[ce];if(0>>1;ces(oe,le))hes(Ee,oe)?(M[ce]=Ee,M[he]=le,ce=he):(M[ce]=oe,M[K]=le,ce=K);else if(hes(Ee,le))M[ce]=Ee,M[he]=le,ce=he;else break e}}return k}function s(M,k){var le=M.sortIndex-k.sortIndex;return le!==0?le:M.id-k.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],p=[],b=1,g=null,x=3,w=!1,E=!1,R=!1,N=!1,F=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function ue(M){for(var k=i(p);k!==null;){if(k.callback===null)l(p);else if(k.startTime<=M)l(p),k.sortIndex=k.expirationTime,a(m,k);else break;k=i(p)}}function ae(M){if(R=!1,ue(M),!E)if(i(m)!==null)E=!0,xe||(xe=!0,q());else{var k=i(p);k!==null&&fe(ae,k.startTime-M)}}var xe=!1,j=-1,_=5,D=-1;function B(){return N?!0:!(e.unstable_now()-D<_)}function Q(){if(N=!1,xe){var M=e.unstable_now();D=M;var k=!0;try{e:{E=!1,R&&(R=!1,V(j),j=-1),w=!0;var le=x;try{t:{for(ue(M),g=i(m);g!==null&&!(g.expirationTime>M&&B());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,x=g.priorityLevel;var we=ce(g.expirationTime<=M);if(M=e.unstable_now(),typeof we=="function"){g.callback=we,ue(M),k=!0;break t}g===i(m)&&l(m),ue(M)}else l(m);g=i(m)}if(g!==null)k=!0;else{var C=i(p);C!==null&&fe(ae,C.startTime-M),k=!1}}break e}finally{g=null,x=le,w=!1}k=void 0}}finally{k?q():xe=!1}}}var q;if(typeof J=="function")q=function(){J(Q)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,re=G.port2;G.port1.onmessage=Q,q=function(){re.postMessage(null)}}else q=function(){F(Q,0)};function fe(M,k){j=F(function(){M(e.unstable_now())},k)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125ce?(M.sortIndex=le,a(p,M),i(m)===null&&M===i(p)&&(R?(V(j),j=-1):R=!0,fe(ae,le-ce))):(M.sortIndex=we,a(m,M),E||w||(E=!0,xe||(xe=!0,q()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var k=x;return function(){var le=x;x=k;try{return M.apply(this,arguments)}finally{x=le}}}})(_d)),_d}var av;function fw(){return av||(av=1,wd.exports=cw()),wd.exports}var Ed={exports:{}},It={};var rv;function dw(){if(rv)return It;rv=1;var e=wh();function a(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Ed.exports=dw(),Ed.exports}var lv;function hw(){if(lv)return so;lv=1;var e=fw(),a=wh(),i=Y0();function l(t){var n="https://react.dev/errors/"+t;if(1we||(t.current=ce[we],ce[we]=null,we--)}function oe(t,n){we++,ce[we]=t.current,t.current=n}var he=C(null),Ee=C(null),Te=C(null),W=C(null);function de(t,n){switch(oe(Te,n),oe(Ee,t),oe(he,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Sg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Sg(n),t=wg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(he),oe(he,t)}function X(){K(he),K(Ee),K(Te)}function ge(t){t.memoizedState!==null&&oe(W,t);var n=he.current,r=wg(n,t.type);n!==r&&(oe(Ee,t),oe(he,r))}function pe(t){Ee.current===t&&(K(he),K(Ee)),W.current===t&&(K(W),ao._currentValue=le)}var Ue,je;function He(t){if(Ue===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ue=n&&n[1]||"",je=-1)":-1f||A[o]!==$[f]){var I=` -`+A[o].replace(" at new "," at ");return t.displayName&&I.includes("")&&(I=I.replace("",t.displayName)),I}while(1<=o&&0<=f);break}}}finally{Mt=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?He(r):""}function qe(t,n){switch(t.tag){case 26:case 27:case 5:return He(t.type);case 16:return He("Lazy");case 13:return t.child!==n&&n!==null?He("Suspense Fallback"):He("Suspense");case 19:return He("SuspenseList");case 0:case 15:return Ve(t.type,!1);case 11:return Ve(t.type.render,!1);case 1:return Ve(t.type,!0);case 31:return He("Activity");default:return""}}function st(t){try{var n="",r=null;do n+=qe(t,r),r=t,t=t.return;while(t);return n}catch(o){return` +`+A[o].replace(" at new "," at ");return t.displayName&&I.includes("")&&(I=I.replace("",t.displayName)),I}while(1<=o&&0<=f);break}}}finally{Ot=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?He(r):""}function Fe(t,n){switch(t.tag){case 26:case 27:case 5:return He(t.type);case 16:return He("Lazy");case 13:return t.child!==n&&n!==null?He("Suspense Fallback"):He("Suspense");case 19:return He("SuspenseList");case 0:case 15:return qe(t.type,!1);case 11:return qe(t.type.render,!1);case 1:return qe(t.type,!0);case 31:return He("Activity");default:return""}}function tt(t){try{var n="",r=null;do n+=Fe(t,r),r=t,t=t.return;while(t);return n}catch(o){return` Error generating stack: `+o.message+` -`+o.stack}}var Fe=Object.prototype.hasOwnProperty,pt=e.unstable_scheduleCallback,nn=e.unstable_cancelCallback,Mn=e.unstable_shouldYield,vl=e.unstable_requestPaint,Qt=e.unstable_now,$t=e.unstable_getCurrentPriorityLevel,On=e.unstable_ImmediatePriority,wa=e.unstable_UserBlockingPriority,sa=e.unstable_NormalPriority,In=e.unstable_LowPriority,kn=e.unstable_IdlePriority,uc=e.log,cc=e.unstable_setDisableYieldValue,_a=null,an=null;function qt(t){if(typeof uc=="function"&&cc(t),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(_a,t)}catch{}})DELIM" -R"DELIM(var It=Math.clz32?Math.clz32:fc,Io=Math.log,Jo=Math.LN2;function fc(t){return t>>>=0,t===0?32:31-(Io(t)/Jo|0)|0}var Lr=256,Ea=262144,Br=4194304;function Jn(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function hi(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var S=o&134217727;return S!==0?(o=S&~h,o!==0?f=Jn(o):(y&=S,y!==0?f=Jn(y):r||(r=S&~t,r!==0&&(f=Jn(r))))):(S=o&~h,S!==0?f=Jn(S):y!==0?f=Jn(y):r||(r=o&~t,r!==0&&(f=Jn(r)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:f}function Va(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function dc(t,n){switch(t){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 bl(){var t=Br;return Br<<=1,(Br&62914560)===0&&(Br=4194304),t}function Xa(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function ua(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Wo(t,n,r,o,f,h){var y=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var S=t.entanglements,A=t.expirationTimes,$=t.hiddenUpdates;for(r=y&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Aa=/[\n"\\]/g;function ln(t){return t.replace(Aa,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function xl(t,n,r,o,f,h,y,S){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+ht(n)):t.value!==""+ht(n)&&(t.value=""+ht(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?hc(t,y,ht(n)):r!=null?hc(t,y,ht(r)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+ht(S):t.removeAttribute("name")}function hm(t,n,r,o,f,h,y,S){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){yi(t);return}r=r!=null?""+ht(r):"",n=n!=null?""+ht(n):r,S||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=S?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),yi(t)}function hc(t,n,r){n==="number"&&it(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function vi(t,n,r,o){if(t=t.options,n){n={};)DELIM" -R"DELIM(for(var f=0;f"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vc=!1;if(Ca)try{var wl={};Object.defineProperty(wl,"passive",{get:function(){vc=!0}}),window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{vc=!1}var Ja=null,bc=null,as=null;function xm(){if(as)return as;var t,n=bc,r=n.length,o,f="value"in Ja?Ja.value:Ja.textContent,h=f.length;for(t=0;t=Tl),Rm=" ",Am=!1;function zm(t,n){switch(t){case"keyup":return w1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var wi=!1;function E1(t,n){switch(t){case"compositionend":return Cm(n);case"keypress":return n.which!==32?null:(Am=!0,Rm);case"textInput":return t=n.data,t===Rm&&Am?null:t;default:return null}}function T1(t,n){if(wi)return t==="compositionend"||!Ec&&zm(t,n)?(t=xm(),as=bc=Ja=null,wi=!1,t):null;switch(t){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-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Bm(r)}}function Hm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Hm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function $m(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=it(t.document);n instanceof t.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)t=n.contentWindow;else break;n=it(t.document)}return n}function Ac(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var O1=Ca&&"documentMode"in document&&11>=document.documentMode,_i=null,zc=null,Cl=null,Cc=!1;function Zm(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cc||_i==null||_i!==it(o)||(o=_i,"selectionStart"in o&&Ac(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Cl&&zl(Cl,o)||(Cl=o,o=Xs(zc,"onSelect"),0>=y,f-=y,ca=1<<32-It(n)+f|r<$e?(Ge=_e,_e=null):Ge=_e.sibling;var tt=P(U,_e,H[$e],ee);if(tt===null){_e===null&&(_e=Ge);break}t&&_e&&tt.alternate===null&&n(U,_e),O=h(tt,O,$e),et===null?Re=tt:et.sibling=tt,et=tt,_e=Ge}if($e===H.length)return r(U,_e),Ke&&Na(U,$e),Re;if(_e===null){for(;$e$e?(Ge=_e,_e=null):Ge=_e.sibling;var xr=P(U,_e,tt.value,ee);if(xr===null){_e===null&&(_e=Ge);break}t&&_e&&xr.alternate===null&&n(U,_e),O=h(xr,O,$e),et===null?Re=xr:et.sibling=xr,et=xr,_e=Ge}if(tt.done)return r(U,_e),Ke&&Na(U,$e),Re;if(_e===null){for(;!tt.done;$e++,tt=H.next())tt=te(U,tt.value,ee),tt!==null&&(O=h(tt,O,$e),et===null?Re=tt:et.sibling=tt,et=tt);return Ke&&Na(U,$e),Re}for(_e=o(_e);!tt.done;$e++,tt=H.next())tt=Y(_e,U,$e,tt.value,ee),tt!==null&&(t&&tt.alternate!==null&&_e.delete(tt.key===null?$e:tt.key),O=h(tt,O,$e),et===null?Re=tt:et.sibling=tt,et=tt);return t&&_e.forEach(function(WS){return n(U,WS)}),Ke&&Na(U,$e),Re}function ft(U,O,H,ee){if(typeof H=="object"&&H!==null&&H.type===R&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case w:e:{for(var Re=H.key;O!==null;){if(O.key===Re){if(Re=H.type,Re===R){if(O.tag===7){r(U,O.sibling),ee=f(O,H.props.children),ee.return=U,U=ee;break e}}else if(O.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===_&&Gr(Re)===O.type){r(U,O.sibling),ee=f(O,H.props),Dl(ee,H),ee.return=U,U=ee;break e}r(U,O);break}else n(U,O);O=O.sibling}H.type===R?(ee=qr(H.props.children,U.mode,ee,H.key),ee.return=U,U=ee):(ee=hs(H.type,H.key,H.props,null,U.mode,ee),Dl(ee,H),ee.return=U,U=ee)}return y(U);case E:e:{for(Re=H.key;O!==null;){if(O.key===Re)if(O.tag===4&&O.stateNode.containerInfo===H.containerInfo&&O.stateNode.implementation===H.implementation){r(U,O.sibling),ee=f(O,H.children||[]),ee.return=U,U=ee;break e}else{r(U,O);break}else n(U,O);O=O.sibling}ee=Lc(H,U.mode,ee),ee.return=U,U=ee}return y(U);case _:return H=Gr(H),ft(U,O,H,ee)}if(fe(H))return Se(U,O,H,ee);if(q(H)){if(Re=q(H),typeof Re!="function")throw Error(l(150));return H=Re.call(H),Ne(U,O,H,ee)}if(typeof H.then=="function")return ft(U,O,xs(H),ee);if(H.$$typeof===J)return ft(U,O,ys(U,H),ee);Ss(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,O!==null&&O.tag===6?(r(U,O.sibling),ee=f(O,H),ee.return=U,U=ee):(r(U,O),ee=Dc(H,U.mode,ee),ee.return=U,U=ee),y(U)):r(U,O)}return function(U,O,H,ee){try{kl=0;var Re=ft(U,O,H,ee);return ki=null,Re}catch(_e){if(_e===Oi||_e===vs)throw _e;var et=wn(29,_e,null,U.mode);return et.lanes=ee,et.return=U,et}}}var Vr=cp(!0),fp=cp(!1),ar=!1;function Kc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vc(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function rr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ir(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(nt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=ds(t),Km(t,null,r),n}return fs(t,o,n,r),ds(t)}function Ll(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ts(t,r)}}function Xc(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var f=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?f=h=y:h=h.next=y,r=r.next}while(r!==null);h===null?f=h=n:h=h.next=n}else f=h=n;r={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var Ic=!1;function Bl(){if(Ic){var t=Mi;if(t!==null)throw t}}function Ul(t,n,r,o){Ic=!1;var f=t.updateQueue;ar=!1;var h=f.firstBaseUpdate,y=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var A=S,$=A.next;A.next=null,y===null?h=$:y.next=$,y=A;var I=t.alternate;I!==null&&(I=I.updateQueue,S=I.lastBaseUpdate,S!==y&&(S===null?I.firstBaseUpdate=$:S.next=$,I.lastBaseUpdate=A))}if(h!==null){var te=f.baseState;y=0,I=$=A=null,S=h;do{var P=S.lane&-536870913,Y=P!==S.lane;if(Y?(Ye&P)===P:(o&P)===P){P!==0&&P===Ni&&(Ic=!0),I!==null&&(I=I.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Se=t,Ne=S;P=n;var ft=r;switch(Ne.tag){case 1:if(Se=Ne.payload,typeof Se=="function"){te=Se.call(ft,te,P);break e}te=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ne.payload,P=typeof Se=="function"?Se.call(ft,te,P):Se,P==null)break e;te=g({},te,P);break e;case 2:ar=!0}}P=S.callback,P!==null&&(t.flags|=64,Y&&(t.flags|=8192),Y=f.callbacks,Y===null?f.callbacks=[P]:Y.push(P))}else Y={lane:P,tag:S.tag,payload:S.payload,callback:S.callback,next:null},I===null?($=I=Y,A=te):I=I.next=Y,y|=P;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;Y=S,S=Y.next,Y.next=null,f.lastBaseUpdate=Y,f.shared.pending=null}}while(!0);I===null&&(A=te),f.baseState=A,f.firstBaseUpdate=$,f.lastBaseUpdate=I,h===null&&(f.shared.lanes=0),cr|=y,t.lanes=y,t.memoizedState=te}}function dp(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function hp(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;th?h:8;var y=M.T,S={};M.T=S,gf(t,!1,n,r);try{var A=f(),$=M.S;if($!==null&&$(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var I=q1(A,o);Zl(t,n,I,An(t))}else Zl(t,n,o,An(t))}catch(te){Zl(t,n,{then:function(){},status:"rejected",reason:te},An())}finally{k.p=h,y!==null&&S.types!==null&&(y.types=S.types),M.T=y}}function K1(){}function pf(t,n,r,o){if(t.tag!==5)throw Error(l(476));var f=Fp(t).queue;Qp(t,f,n,le,r===null?K1:function(){return Yp(t),r(o)})}function Fp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:le},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:r},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Yp(t){var n=Fp(t);n.next===null&&(n=t.alternate.memoizedState),Zl(t,n.next.queue,{},An())}function yf(){return Yt(ro)}function Gp(){return zt().memoizedState}function Kp(){return zt().memoizedState}function V1(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=An();t=rr(r);var o=ir(n,t,r);o!==null&&(yn(o,n,r),Ll(o,n,r)),n={cache:Qc()},t.payload=n;return}n=n.return}}function X1(t,n,r){var o=An();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(t)?Xp(n,r):(r=Oc(t,n,r,o),r!==null&&(yn(r,t,o),Ip(r,n,o)))}function Vp(t,n,r){var o=An();Zl(t,n,r,o)}function Zl(t,n,r,o){var f={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ns(t))Xp(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var y=n.lastRenderedState,S=h(y,r);if(f.hasEagerState=!0,f.eagerState=S,Sn(S,y))return fs(t,n,f,0),mt===null&&cs(),!1}catch{}if(r=Oc(t,n,f,o),r!==null)return yn(r,t,o),Ip(r,n,o),!0}return!1}function gf(t,n,r,o){if(o={lane:2,revertLane:Vf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ns(t)){if(n)throw Error(l(479))}else n=Oc(t,r,o,2),n!==null&&yn(n,t,2)}function Ns(t){var n=t.alternate;return t===Be||n!==null&&n===Be}function Xp(t,n){Li=Es=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function Ip(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ts(t,r)}}var ql={readContext:Yt,use:As,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};ql.useEffectEvent=_t;var Jp={readContext:Yt,use:As,useCallback:function(t,n){return on().memoizedState=[t,n===void 0?null:n],t},useContext:Yt,useEffect:Dp,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,Cs(4194308,4,Hp.bind(null,n,t),r)},useLayoutEffect:function(t,n){return Cs(4194308,4,t,n)},useInsertionEffect:function(t,n){Cs(4,2,t,n)},useMemo:function(t,n){var r=on();n=n===void 0?null:n;var o=t();if(Xr){qt(!0);try{t()}finally{qt(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=on();if(r!==void 0){var f=r(n);if(Xr){qt(!0);try{r(n)}finally{qt(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=X1.bind(null,Be,t),[o.memoizedState,t]},useRef:function(t){var n=on();return t={current:t},n.memoizedState=t},useState:function(t){t=cf(t);var n=t.queue,r=Vp.bind(null,Be,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:hf,useDeferredValue:function(t,n){var r=on();return mf(r,t,n)},useTransition:function(){var t=cf(!1);return t=Qp.bind(null,Be,t.queue,!0,!1),on().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=Be,f=on();if(Ke){if(r===void 0)throw Error(l(407));r=r()}else{if(r=n(),mt===null)throw Error(l(349));(Ye&127)!==0||bp(o,n,r)}f.memoizedState=r;var h={value:r,getSnapshot:n};return f.queue=h,Dp(Sp.bind(null,o,h,t),[t]),o.flags|=2048,Ui(9,{destroy:void 0},xp.bind(null,o,h,r,n),null),r},useId:function(){var t=on(),n=mt.identifierPrefix;if(Ke){var r=fa,o=ca;r=(o&~(1<<32-It(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ts++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?y.createElement(f,{is:o.is}):y.createElement(f)}}h[me]=n,h[ve]=o;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)h.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=h;e:switch(Kt(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ba(n)}}return vt(n),Nf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Ba(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=Te.current,Ci(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,f=Ft,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[me]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||gg(t.nodeValue,r)),t||tr(n,!0)}else t=Is(t).createTextNode(o),t[me]=n,n.stateNode=t})DELIM" -R"DELIM(return vt(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=Ci(n),r!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[me]=n}else Pr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),t=!1}else r=$c(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(En(n),n):(En(n),null);if((n.flags&128)!==0)throw Error(l(558))}return vt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Ci(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(l(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[me]=n}else Pr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),f=!1}else f=$c(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(En(n),n):(En(n),null)}return En(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),Ls(n,n.updateQueue),vt(n),null);case 4:return X(),t===null&&Wf(n.stateNode.containerInfo),vt(n),null;case 10:return Oa(n.type),vt(n),null;case 19:if(K(At),o=n.memoizedState,o===null)return vt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)Ql(o,!1);else{if(Et!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=_s(t),h!==null){for(n.flags|=128,Ql(o,!1),t=h.updateQueue,n.updateQueue=t,Ls(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)Vm(r,t),r=r.sibling;return oe(At,At.current&1|2),Ke&&Na(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Qt()>Zs&&(n.flags|=128,f=!0,Ql(o,!1),n.lanes=4194304)}else{if(!f)if(t=_s(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Ls(n,t),Ql(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ke)return vt(n),null}else 2*Qt()-o.renderingStartTime>Zs&&r!==536870912&&(n.flags|=128,f=!0,Ql(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Qt(),t.sibling=null,r=At.current,oe(At,f?r&1|2:r&1),Ke&&Na(n,o.treeForkCount),t):(vt(n),null);case 22:case 23:return En(n),Wc(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(vt(n),n.subtreeFlags&6&&(n.flags|=8192)):vt(n),r=n.updateQueue,r!==null&&Ls(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&K(Yr),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Oa(Ot),vt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function tS(t,n){switch(Uc(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Oa(Ot),X(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return pe(n),null;case 31:if(n.memoizedState!==null){if(En(n),n.alternate===null)throw Error(l(340));Pr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(En(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Pr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return K(At),null;case 4:return X(),null;case 10:return Oa(n.type),null;case 22:case 23:return En(n),Wc(),t!==null&&K(Yr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Oa(Ot),null;case 25:return null;default:return null}}function wy(t,n){switch(Uc(n),n.tag){case 3:Oa(Ot),X();break;case 26:case 27:case 5:pe(n);break;case 4:X();break;case 31:n.memoizedState!==null&&En(n);break;case 13:En(n);break;case 19:K(At);break;case 10:Oa(n.type);break;case 22:case 23:En(n),Wc(),t!==null&&K(Yr);break;case 24:Oa(Ot)}}function Fl(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var f=o.next;r=f;do{if((r.tag&t)===t){o=void 0;var h=r.create,y=r.inst;o=h(),y.destroy=o}r=r.next}while(r!==f)}}catch(S){ot(n,n.return,S)}}function sr(t,n,r){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var y=o.inst,S=y.destroy;if(S!==void 0){y.destroy=void 0,f=n;var A=r,$=S;try{$()}catch(I){ot(f,A,I)}}}o=o.next}while(o!==h)}}catch(I){ot(n,n.return,I)}}function _y(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{hp(n,r)}catch(o){ot(t,t.return,o)}}}function Ey(t,n,r){r.props=Ir(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){ot(t,n,o)}}function Yl(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(f){ot(t,n,f)}}function da(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(f){ot(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(f){ot(t,n,f)}else r.current=null}function Ty(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(f){ot(t,t.return,f)}}function Mf(t,n,r){try{var o=t.stateNode;_S(o,t.type,r,n),o[ve]=n}catch(f){ot(t,t.return,f)}}function Ry(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&pr(t.type)||t.tag===4}function Of(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ry(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&pr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function kf(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(t),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=za));else if(o!==4&&(o===27&&pr(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(kf(t,n,r),t=t.sibling;t!==null;)kf(t,n,r),t=t.sibling}function Bs(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(o!==4&&(o===27&&pr(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(Bs(t,n,r),t=t.sibling;t!==null;)Bs(t,n,r),t=t.sibling}function Ay(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Kt(n,o,r),n[me]=t,n[ve]=r}catch(h){ot(t,t.return,h)}}var Ua=!1,Lt=!1,Df=!1,zy=typeof WeakSet=="function"?WeakSet:Set,Pt=null;function nS(t,n){if(t=t.containerInfo,nd=ru,t=$m(t),Ac(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var y=0,S=-1,A=-1,$=0,I=0,te=t,P=null;t:for(;;){for(var Y;te!==r||f!==0&&te.nodeType!==3||(S=y+f),te!==h||o!==0&&te.nodeType!==3||(A=y+o),te.nodeType===3&&(y+=te.nodeValue.length),(Y=te.firstChild)!==null;)P=te,te=Y;for(;;){if(te===t)break t;if(P===r&&++$===f&&(S=y),P===h&&++I===o&&(A=y),(Y=te.nextSibling)!==null)break;te=P,P=te.parentNode}te=Y}r=S===-1||A===-1?null:{start:S,end:A}}else r=null}r=r||{start:0,end:0}}else r=null;)DELIM" -R"DELIM(for(ad={focusedElem:t,selectionRange:r},ru=!1,Pt=n;Pt!==null;)if(n=Pt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Pt=t;else for(;Pt!==null;){switch(n=Pt,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),Kt(h,o,r),h[me]=t,Ie(h),o=h;break e;case"link":var y=kg("link","href",f).get(o+(r.href||""));if(y){for(var S=0;Sft&&(y=ft,ft=Ne,Ne=y);var U=Um(S,Ne),O=Um(S,ft);if(U&&O&&(Y.rangeCount!==1||Y.anchorNode!==U.node||Y.anchorOffset!==U.offset||Y.focusNode!==O.node||Y.focusOffset!==O.offset)){var H=te.createRange();H.setStart(U.node,U.offset),Y.removeAllRanges(),Ne>ft?(Y.addRange(H),Y.extend(O.node,O.offset)):(H.setEnd(O.node,O.offset),Y.addRange(H))}}}}for(te=[],Y=S;Y=Y.parentNode;)Y.nodeType===1&&te.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;Sr?32:r,M.T=null,r=qf,qf=null;var h=dr,y=Pa;if(Zt=0,Pi=dr=null,Pa=0,(nt&6)!==0)throw Error(l(331));var S=nt;if(nt|=4,Hy(h.current),Ly(h,h.current,y,r),nt=S,Jl(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(_a,h)}catch{}return!0}finally{k.p=f,M.T=o,ag(t,n)}}function ig(t,n,r){n=Bn(r,n),n=Sf(t.stateNode,n,2),t=ir(t,n,2),t!==null&&(ua(t,2),ha(t))}function ot(t,n,r){if(t.tag===3)ig(t,t,r);else for(;n!==null;){if(n.tag===3){ig(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(fr===null||!fr.has(o))){t=Bn(r,t),r=ly(2),o=ir(n,r,2),o!==null&&(oy(r,o,n,t),ua(o,2),ha(o));break}}n=n.return}}function Yf(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new iS;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(r)||(Uf=!0,f.add(r),t=cS.bind(null,t,n,r),n.then(t,t))}function cS(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,mt===t&&(Ye&r)===r&&(Et===4||Et===3&&(Ye&62914560)===Ye&&300>Qt()-$s?(nt&2)===0&&Qi(t,0):Hf|=r,qi===Ye&&(qi=0)),ha(t)}function lg(t,n){n===0&&(n=bl()),t=Zr(t,n),t!==null&&(ua(t,n),ha(t))}function fS(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),lg(t,r)}function dS(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(r=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),lg(t,r)}function hS(t,n){return pt(t,n)}var Gs=null,Yi=null,Gf=!1,Ks=!1,Kf=!1,mr=0;function ha(t){t!==Yi&&t.next===null&&(Yi===null?Gs=Yi=t:Yi=Yi.next=t),Ks=!0,Gf||(Gf=!0,pS())}function Jl(t,n){if(!Kf&&Ks){Kf=!0;do for(var r=!1,o=Gs;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var y=o.suspendedLanes,S=o.pingedLanes;h=(1<<31-It(42|t)+1)-1,h&=f&~(y&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,cg(o,h))}else h=Ye,h=hi(o,o===mt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Va(o,h)||(r=!0,cg(o,h));o=o.next}while(r);Kf=!1}}function mS(){og()}function og(){Ks=Gf=!1;var t=0;mr!==0&&TS()&&(t=mr);for(var n=Qt(),r=null,o=Gs;o!==null;){var f=o.next,h=sg(o,n);h===0?(o.next=null,r===null?Gs=f:r.next=f,f===null&&(Yi=r)):(r=o,(t!==0||(h&3)!==0)&&(Ks=!0)),o=f}Zt!==0&&Zt!==5||Jl(t),mr!==0&&(mr=0)}function sg(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0S)break;var I=A.transferSize,te=A.initiatorType;I&&vg(te)&&(A=A.responseEnd,y+=I*(A"u"?null:document;function jg(t,n,r){var o=Gi;if(o&&typeof n=="string"&&n){var f=ln(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof r=="string"&&(f+='[crossorigin="'+r+'"]'),Cg.has(f)||(Cg.add(f),t={rel:t,crossOrigin:r,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),Kt(n,"link",t),Ie(n),o.head.appendChild(n)))}}function kS(t){Qa.D(t),jg("dns-prefetch",t,null)}function DS(t,n){Qa.C(t,n),jg("preconnect",t,n)}function LS(t,n,r){Qa.L(t,n,r);var o=Gi;if(o&&t&&n){var f='link[rel="preload"][as="'+ln(n)+'"]';n==="image"&&r&&r.imageSrcSet?(f+='[imagesrcset="'+ln(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(f+='[imagesizes="'+ln(r.imageSizes)+'"]')):f+='[href="'+ln(t)+'"]';var h=f;switch(n){case"style":h=Ki(t);break;case"script":h=Vi(t)}Pn.has(h)||(t=g({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),Pn.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(no(h))||n==="script"&&o.querySelector(ao(h))||(n=o.createElement("link"),Kt(n,"link",t),Ie(n),o.head.appendChild(n)))}}function BS(t,n){Qa.m(t,n);var r=Gi;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+ln(o)+'"][href="'+ln(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Vi(t)}if(!Pn.has(h)&&(t=g({rel:"modulepreload",href:t},n),Pn.set(h,t),r.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ao(h)))return}o=r.createElement("link"),Kt(o,"link",t),Ie(o),r.head.appendChild(o)}}}function US(t,n,r){Qa.S(t,n,r);var o=Gi;)DELIM" -R"DELIM(if(o&&t){var f=Rt(o).hoistableStyles,h=Ki(t);n=n||"default";var y=f.get(h);if(!y){var S={loading:0,preload:null};if(y=o.querySelector(no(h)))S.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":n},r),(r=Pn.get(h))&&cd(t,r);var A=y=o.createElement("link");Ie(A),Kt(A,"link",t),A._p=new Promise(function($,I){A.onload=$,A.onerror=I}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ws(y,n,o)}y={type:"stylesheet",instance:y,count:1,state:S},f.set(h,y)}}}function HS(t,n){Qa.X(t,n);var r=Gi;if(r&&t){var o=Rt(r).hoistableScripts,f=Vi(t),h=o.get(f);h||(h=r.querySelector(ao(f)),h||(t=g({src:t,async:!0},n),(n=Pn.get(f))&&fd(t,n),h=r.createElement("script"),Ie(h),Kt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function $S(t,n){Qa.M(t,n);var r=Gi;if(r&&t){var o=Rt(r).hoistableScripts,f=Vi(t),h=o.get(f);h||(h=r.querySelector(ao(f)),h||(t=g({src:t,async:!0,type:"module"},n),(n=Pn.get(f))&&fd(t,n),h=r.createElement("script"),Ie(h),Kt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Ng(t,n,r,o){var f=(f=Te.current)?Js(f):null;if(!f)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Ki(r.href),r=Rt(f).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Ki(r.href);var h=Rt(f).hoistableStyles,y=h.get(t);if(y||(f=f.ownerDocument||f,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,y),(h=f.querySelector(no(t)))&&!h._p&&(y.instance=h,y.state.loading=5),Pn.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Pn.set(t,r),h||ZS(f,t,r,y.state))),n&&o===null)throw Error(l(528,""));return y}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Vi(r),r=Rt(f).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Ki(t){return'href="'+ln(t)+'"'}function no(t){return'link[rel="stylesheet"]['+t+"]"}function Mg(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function ZS(t,n,r,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Kt(n,"link",r),Ie(n),t.head.appendChild(n))}function Vi(t){return'[src="'+ln(t)+'"]'}function ao(t){return"script[async]"+t}function Og(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+ln(r.href)+'"]');if(o)return n.instance=o,Ie(o),o;var f=g({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Ie(o),Kt(o,"style",f),Ws(o,r.precedence,t),n.instance=o;case"stylesheet":f=Ki(r.href);var h=t.querySelector(no(f));if(h)return n.state.loading|=4,n.instance=h,Ie(h),h;o=Mg(r),(f=Pn.get(f))&&cd(o,f),h=(t.ownerDocument||t).createElement("link"),Ie(h);var y=h;return y._p=new Promise(function(S,A){y.onload=S,y.onerror=A}),Kt(h,"link",o),n.state.loading|=4,Ws(h,r.precedence,t),n.instance=h;case"script":return h=Vi(r.src),(f=t.querySelector(ao(h)))?(n.instance=f,Ie(f),f):(o=r,(f=Pn.get(h))&&(o=g({},r),fd(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Ie(f),Kt(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Ws(o,r.precedence,t));return n.instance}function Ws(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,y=0;y title"):null)}function qS(t,n,r){if(r===1||n.itemProp!=null)return!1;switch(t){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"?(t=n.disabled,typeof n.precedence=="string"&&t==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 Lg(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function PS(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var f=Ki(o.href),h=n.querySelector(no(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=tu.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=h,Ie(h);return}h=n.ownerDocument||n,o=Mg(o),(f=Pn.get(f))&&cd(o,f),h=h.createElement("link"),Ie(h);var y=h;y._p=new Promise(function(S,A){y.onload=S,y.onerror=A}),Kt(h,"link",o),r.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=tu.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var dd=0;function QS(t,n){return t.stylesheets&&t.count===0&&au(t,t.stylesheets),0dd?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function tu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)au(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var nu=null;function au(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,nu=new Map,n.forEach(FS,t),nu=null,tu.call(t))}function FS(t,n){if(!(n.state.loading&4)){var r=nu.get(t);if(r)var o=r.get(null);else{r=new Map,nu.set(t,r);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Sd.exports=sw(),Sd.exports}var cw=uw();const fw=Sh(cw);var Ho=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(){}},dw=class extends Ho{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e();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(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},_h=new dw,hw={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},mw=class{#e=hw;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,a){return this.#e.setTimeout(e,a)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,a){return this.#e.setInterval(e,a)}clearInterval(e){this.#e.clearInterval(e)}},ri=new mw;function pw(e){setTimeout(e,0)}var yw=typeof window>"u"||"Deno"in globalThis;function vn(){}function gw(e,a){return typeof e=="function"?e(a):e}function Wd(e){return typeof e=="number"&&e>=0&&e!==1/0}function F0(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Nr(e,a){return typeof e=="function"?e(a):e}function zn(e,a){return typeof e=="function"?e(a):e}function lv(e,a){const{type:i="all",exact:l,fetchStatus:s,predicate:u,queryKey:c,stale:d}=e;if(c){if(l){if(a.queryHash!==Eh(c,a.options))return!1}else if(!Ao(a.queryKey,c))return!1}if(i!=="all"){const m=a.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof d=="boolean"&&a.isStale()!==d||s&&s!==a.state.fetchStatus||u&&!u(a))}function ov(e,a){const{exact:i,status:l,predicate:s,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(Ro(a.options.mutationKey)!==Ro(u))return!1}else if(!Ao(a.options.mutationKey,u))return!1}return!(l&&a.state.status!==l||s&&!s(a))}function Eh(e,a){return(a?.queryKeyHashFn||Ro)(e)}function Ro(e){return JSON.stringify(e,(a,i)=>th(i)?Object.keys(i).sort().reduce((l,s)=>(l[s]=i[s],l),{}):i)}function Ao(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>Ao(e[i],a[i])):!1}var vw=Object.prototype.hasOwnProperty;function Y0(e,a,i=0){if(e===a)return e;if(i>500)return a;const l=sv(e)&&sv(a);if(!l&&!(th(e)&&th(a)))return a;const u=(l?e:Object.keys(e)).length,c=l?a:Object.keys(a),d=c.length,m=l?new Array(d):{};let p=0;for(let b=0;b{ri.setTimeout(a,e)})}function nh(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?Y0(e,a):a}function xw(e,a,i=0){const l=[...e,a];return i&&l.length>i?l.slice(1):l}function Sw(e,a,i=0){const l=[a,...e];return i&&l.length>i?l.slice(0,-1):l}var Th=Symbol();function G0(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Th?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function K0(e,a){return typeof e=="function"?e(...a):!!e}function ww(e,a,i){let l=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=a(),l||(l=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var zo=(()=>{let e=()=>yw;return{isServer(){return e()},setIsServer(a){e=a}}})();function ah(){let e,a;const i=new Promise((s,u)=>{e=s,a=u});i.status="pending",i.catch(()=>{});function l(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{l({status:"fulfilled",value:s}),e(s)},i.reject=s=>{l({status:"rejected",reason:s}),a(s)},i}var _w=pw;function Ew(){let e=[],a=0,i=d=>{d()},l=d=>{d()},s=_w;const u=d=>{a?e.push(d):s(()=>{i(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{l(()=>{d.forEach(m=>{i(m)})})})};return{batch:d=>{let m;a++;try{m=d()}finally{a--,a||c()}return m},batchCalls:d=>(...m)=>{u(()=>{d(...m)})},schedule:u,setNotifyFunction:d=>{i=d},setBatchNotifyFunction:d=>{l=d},setScheduler:d=>{s=d}}}var Vt=Ew(),Tw=class extends Ho{#e=!0;#t;#n;)DELIM" -R"DELIM(constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e(!0),i=()=>e(!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(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},Bu=new Tw;function Rw(e){return Math.min(1e3*2**e,3e4)}function V0(e){return(e??"online")==="online"?Bu.isOnline():!0}var rh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function X0(e){let a=!1,i=0,l;const s=ah(),u=()=>s.status!=="pending",c=R=>{if(!u()){const N=new rh(R);x(N),e.onCancel?.(N)}},d=()=>{a=!0},m=()=>{a=!1},p=()=>_h.isFocused()&&(e.networkMode==="always"||Bu.isOnline())&&e.canRun(),b=()=>V0(e.networkMode)&&e.canRun(),g=R=>{u()||(l?.(),s.resolve(R))},x=R=>{u()||(l?.(),s.reject(R))},w=()=>new Promise(R=>{l=N=>{(u()||p())&&R(N)},e.onPause?.()}).then(()=>{l=void 0,u()||e.onContinue?.()}),E=()=>{if(u())return;let R;const N=i===0?e.initialPromise:void 0;try{R=N??e.fn()}catch(F){R=Promise.reject(F)}Promise.resolve(R).then(g).catch(F=>{if(u())return;const V=e.retry??(zo.isServer()?0:3),J=e.retryDelay??Rw,ue=typeof J=="function"?J(i,F):J,ae=V===!0||typeof V=="number"&&ip()?void 0:w()).then(()=>{a?x(F):E()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(l?.(),s),cancelRetry:d,continueRetry:m,canStart:b,start:()=>(b()?E():w().then(E),s)}}var I0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wd(this.gcTime)&&(this.#e=ri.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(zo.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(ri.clearTimeout(this.#e),this.#e=void 0)}};function Aw(e){return{onFetch:(a,i)=>{const l=a.options,s=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],c=a.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const p=async()=>{let b=!1;const g=E=>{ww(E,()=>a.signal,()=>b=!0)},x=G0(a.options,a.fetchOptions),w=async(E,R,N)=>{if(b)return Promise.reject(a.signal.reason);if(R==null&&E.pages.length)return Promise.resolve(E);const V=(()=>{const xe={client:a.client,queryKey:a.queryKey,pageParam:R,direction:N?"backward":"forward",meta:a.options.meta};return g(xe),xe})(),J=await x(V),{maxPages:ue}=a.options,ae=N?Sw:xw;return{pages:ae(E.pages,J,ue),pageParams:ae(E.pageParams,R,ue)}};if(s&&u.length){const E=s==="backward",R=E?zw:cv,N={pages:u,pageParams:c},F=R(l,N);d=await w(N,F,E)}else{const E=e??u.length;do{const R=m===0?c[0]??l.initialPageParam:cv(l,d);if(m>0&&R==null)break;d=await w(d,R),m++}while(ma.options.persister?.(p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=p}}}function cv(e,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?e.getNextPageParam(a[l],a,i[l],i):void 0}function zw(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var Cw=class extends I0{#e;#t;#n;#a;#i;#r;#o;#l;constructor(e){super(),this.#l=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#a=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=dv(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=dv(this.options);a.data!==void 0&&(this.setState(fv(a.data,a.dataUpdatedAt)),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,a){const i=nh(this.state.data,e,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e){this.#s({type:"setState",state:e})}cancel(e){const a=this.#r?.promise;return this.#r?.cancel(e),a?a.then(vn).catch(vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>zn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Th||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Nr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!F0(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#r&&(this.#l||this.#c()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const i=new AbortController,l=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},s=()=>{const m=G0(this.options,a),b=(()=>{const g={client:this.#i,queryKey:this.queryKey,meta:this.meta};return l(g),g})();return this.#l=!1,this.options.persister?this.options.persister(m,b,this):m(b)},c=(()=>{const m={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return l(m),m})();(this.#e==="infinite"?Aw(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#s({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=X0({initialPromise:a?.initialPromise,fn:c.fetchFn,onCancel:m=>{m instanceof rh&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),i.abort()},onFail:(m,p)=>{this.#s({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const m=await this.#r.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#a.config.onSuccess?.(m,this),this.#a.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof rh){if(m.silent)return this.#r.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#s({type:"error",error:m}),this.#a.config.onError?.(m,this),)DELIM" -R"DELIM(this.#a.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#s(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...J0(i.data,this.options),fetchMeta:e.meta??null};case"success":const l={...i,...fv(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?l:void 0,l;case"error":const s=e.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),Vt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function J0(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:V0(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fv(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dv(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,l=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var jw=class extends Ho{constructor(e,a){super(),this.options=a,this.#e=e,this.#l=null,this.#o=ah(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#i;#r;#o;#l;#c;#s;#m;#f;#d;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),hv(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ih(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ih(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),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.#w(),this.#t.setOptions(this.options),a._defaulted&&!eh(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&mv(this.#t,i,this.options,a)&&this.#h(),this.updateResult(),l&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||Nr(this.options.staleTime,this.#t)!==Nr(a.staleTime,this.#t))&&this.#y();const s=this.#g();l&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||s!==this.#u)&&this.#v(s)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return Mw(this,i)&&(this.#a=i,this.#r=this.options,this.#i=this.#t.state),i}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(i,l)=>(this.trackProp(l),a?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#h(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(vn)),a}#y(){this.#x();const e=Nr(this.options.staleTime,this.#t);if(zo.isServer()||this.#a.isStale||!Wd(e))return;const i=F0(this.#a.dataUpdatedAt,e)+1;this.#f=ri.setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#u=e,!(zo.isServer()||zn(this.options.enabled,this.#t)===!1||!Wd(this.#u)||this.#u===0)&&(this.#d=ri.setInterval(()=>{(this.options.refetchIntervalInBackground||_h.isFocused())&&this.#h()},this.#u))}#b(){this.#y(),this.#v(this.#g())}#x(){this.#f!==void 0&&(ri.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#d!==void 0&&(ri.clearInterval(this.#d),this.#d=void 0)}createResult(e,a){const i=this.#t,l=this.options,s=this.#a,u=this.#i,c=this.#r,m=e!==i?e.state:this.#n,{state:p}=e;let b={...p},g=!1,x;if(a._optimisticResults){const _=this.hasListeners(),D=!_&&hv(e,a),B=_&&mv(e,i,a,l);(D||B)&&(b={...b,...J0(p.data,e.options)}),a._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:E,status:R}=b;x=b.data;let N=!1;if(a.placeholderData!==void 0&&x===void 0&&R==="pending"){let _;s?.isPlaceholderData&&a.placeholderData===c?.placeholderData?(_=s.data,N=!0):_=typeof a.placeholderData=="function"?a.placeholderData(this.#m?.state.data,this.#m):a.placeholderData,_!==void 0&&(R="success",x=nh(s?.data,_,a),g=!0)}if(a.select&&x!==void 0&&!N)if(s&&x===u?.data&&a.select===this.#c)x=this.#s;else try{this.#c=a.select,x=a.select(x),x=nh(s?.data,x,a),this.#s=x,this.#l=null}catch(_){this.#l=_}this.#l&&(w=this.#l,x=this.#s,E=Date.now(),R="error");const F=b.fetchStatus==="fetching",V=R==="pending",J=R==="error",ue=V&&F,ae=x!==void 0,j={status:R,fetchStatus:b.fetchStatus,isPending:V,isSuccess:R==="success",isError:J,isInitialLoading:ue,isLoading:ue,data:x,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:E,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>m.dataUpdateCount||b.errorUpdateCount>m.errorUpdateCount,isFetching:F,isRefetching:F&&!V,isLoadingError:J&&!ae,isPaused:b.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:J&&ae,isStale:Rh(e,a),refetch:this.refetch,promise:this.#o,isEnabled:zn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const _=j.data!==void 0,D=j.status==="error"&&!_,B=G=>{D?G.reject(j.error):_&&G.resolve(j.data)},Q=()=>{const G=this.#o=j.promise=ah();B(G)},q=this.#o;switch(q.status){case"pending":e.queryHash===i.queryHash&&B(q);break;case"fulfilled":(D||j.data!==q.value)&&Q();break;case"rejected":(!D||j.error!==q.reason)&&Q();break}}return j}updateResult(){const e=this.#a,a=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#r=this.options,this.#i.data!==void 0&&(this.#m=this.#t),eh(a,e))return;this.#a=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,s=typeof l=="function"?l():l;if(s==="all"||!s&&!this.#p.size)return!0;const u=new Set(s??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#a).some(c=>{const d=c;return this.#a[d]!==e[d]&&u.has(d)})};this.#_({listeners:i()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Vt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Nw(e,a){return zn(a.enabled,)DELIM" -R"DELIM(e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&zn(a.retryOnMount,e)===!1)}function hv(e,a){return Nw(e,a)||e.state.data!==void 0&&ih(e,a,a.refetchOnMount)}function ih(e,a,i){if(zn(a.enabled,e)!==!1&&Nr(a.staleTime,e)!=="static"){const l=typeof i=="function"?i(e):i;return l==="always"||l!==!1&&Rh(e,a)}return!1}function mv(e,a,i,l){return(e!==a||zn(l.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Rh(e,i)}function Rh(e,a){return zn(a.enabled,e)!==!1&&e.isStaleByTime(Nr(a.staleTime,e))}function Mw(e,a){return!eh(e.getCurrentResult(),a)}var Ow=class extends I0{#e;#t;#n;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||kw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#i({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=X0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,c)=>{this.#i({type:"failed",failureCount:u,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",s=!this.#a.canStart();try{if(l)a();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const c=await this.options.onMutate?.(e,i);c!==this.state.context&&this.#i({type:"pending",context:c,variables:e,isPaused:s})}const u=await this.#a.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#i({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onError?.(u,e,this.state.context,i)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,i)}catch(c){Promise.reject(c)}throw this.#i({type:"error",error:u}),u}finally{this.#n.runNext(this)}}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Vt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function kw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Dw=class extends Ho{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const l=new Ow({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(l),l}add(e){this.#e.add(e);const a=fu(e);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=fu(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const l=i.indexOf(e);l!==-1&&i.splice(l,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=fu(e);if(typeof a=="string"){const l=this.#t.get(a)?.find(s=>s.state.status==="pending");return!l||l===e}else return!0}runNext(e){const a=fu(e);return typeof a=="string"?this.#t.get(a)?.find(l=>l!==e&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Vt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>ov(a,i))}findAll(e={}){return this.getAll().filter(a=>ov(e,a))}notify(e){Vt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Vt.batch(()=>Promise.all(e.map(a=>a.continue().catch(vn))))}};function fu(e){return e.options.scope?.id}var Lw=class extends Ho{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const l=a.queryKey,s=a.queryHash??Eh(l,a);let u=this.get(s);return u||(u=new Cw({client:e,queryKey:l,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(l)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Vt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>lv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>lv(e,i)):a}notify(e){Vt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bw=class{#e;#t;#n;#a;#i;#r;#o;#l;constructor(e={}){this.#e=e.queryCache||new Lw,this.#t=e.mutationCache||new Dw,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=_h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=Bu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#e.build(this,a),l=i.state.data;return l===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Nr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(e,a,i){const l=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(l.queryHash)?.state.data,c=gw(a,u);if(c!==void 0)return this.#e.build(this,l).setData(c,{...i,manual:!0})}setQueriesData(e,a,i){return Vt.batch(()=>this.#e.findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Vt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;)DELIM" -R"DELIM(return Vt.batch(()=>(i.findAll(e).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},l=Vt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(l).then(vn).catch(vn)}invalidateQueries(e,a={}){return Vt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=Vt.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(vn)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(l).then(vn)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(Nr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Bu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#a.set(Ro(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(l=>{Ao(e,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(e,a){this.#i.set(Ro(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#i.values()],i={};return a.forEach(l=>{Ao(e,l.mutationKey)&&Object.assign(i,l.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Eh(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===Th&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},W0=T.createContext(void 0),Iu=e=>{const a=T.useContext(W0);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},Uw=({client:e,children:a})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(W0.Provider,{value:e,children:a})),eb=T.createContext(!1),Hw=()=>T.useContext(eb);eb.Provider;function $w(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Zw=T.createContext($w()),qw=()=>T.useContext(Zw),Pw=(e,a,i)=>{const l=i?.state.error&&typeof e.throwOnError=="function"?K0(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||l)&&(a.isReset()||(e.retryOnMount=!1))},Qw=e=>{T.useEffect(()=>{e.clearReset()},[e])},Fw=({result:e,errorResetBoundary:a,throwOnError:i,query:l,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&l&&(s&&e.data===void 0||K0(i,[e.error,l])),Yw=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),l=e.staleTime;e.staleTime=typeof l=="function"?(...s)=>i(l(...s)):i(l),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Gw=(e,a)=>e.isLoading&&e.isFetching&&!a,Kw=(e,a)=>e?.suspense&&a.isPending,pv=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function Vw(e,a,i){const l=Hw(),s=qw(),u=Iu(),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const d=u.getQueryCache().get(c.queryHash),m=e.subscribed!==!1;c._optimisticResults=l?"isRestoring":m?"optimistic":void 0,Yw(c),Pw(c,s,d),Qw(s);const p=!u.getQueryCache().get(c.queryHash),[b]=T.useState(()=>new a(u,c)),g=b.getOptimisticResult(c),x=!l&&m;if(T.useSyncExternalStore(T.useCallback(w=>{const E=x?b.subscribe(Vt.batchCalls(w)):vn;return b.updateResult(),E},[b,x]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),T.useEffect(()=>{b.setOptions(c)},[c,b]),Kw(c,g))throw pv(c,b,s);if(Fw({result:g,errorResetBoundary:s,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw g.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(c,g),c.experimental_prefetchInRender&&!zo.isServer()&&Gw(g,l)&&(p?pv(c,b,s):d?.promise)?.catch(vn).finally(()=>{b.updateResult()}),c.notifyOnChangeProps?g:b.trackResult(g)}function Xw(e,a){return Vw(e,jw)}var yv;function ne(e,a,i){function l(d,m){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),a(d,m);const p=c.prototype,b=Object.keys(p);for(let g=0;gi?.Parent&&d instanceof i.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class sl extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tb extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}(yv=globalThis).__zod_globalConfig??(yv.__zod_globalConfig={});const Ah=globalThis.__zod_globalConfig;function oi(e){return Ah}function nb(e){const a=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,s])=>a.indexOf(+l)===-1).map(([l,s])=>s)}function lh(e,a){return typeof a=="bigint"?a.toString():a}function zh(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function Ch(e){return e==null}function jh(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function Iw(e,a){const i=e/a,l=Math.round(i),s=Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-l){};function Uu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Ww=zh(()=>{if(Ah.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Co(e){if(Uu(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(Uu(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function rb(e){return Co(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const e_=new Set(["string","number","symbol"]);function Ju(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kr(e,a,i){const l=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(l._zod.parent=e),l}function Ce(e){const a=e;if(!a)return{};if(typeof a=="string")return{error:()=>a};)DELIM" -R"DELIM(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 t_(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const n_={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 a_(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u=Or(e._zod.def,{get shape(){const c={};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&(c[d]=i.shape[d])}return ci(this,"shape",c),c},checks:[]});return kr(e,u)}function r_(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Or(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&delete c[d]}return ci(this,"shape",c),c},checks:[]});return kr(e,u)}function i_(e,a){if(!Co(a))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const u=e._zod.def.shape;for(const c in a)if(Object.getOwnPropertyDescriptor(u,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Or(e._zod.def,{get shape(){const u={...e._zod.def.shape,...a};return ci(this,"shape",u),u}});return kr(e,s)}function l_(e,a){if(!Co(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Or(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a};return ci(this,"shape",l),l}});return kr(e,i)}function o_(e,a){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const i=Or(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a._zod.def.shape};return ci(this,"shape",l),l},get catchall(){return a._zod.def.catchall},checks:a._zod.def.checks??[]});return kr(e,i)}function s_(e,a,i){const s=a._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Or(a._zod.def,{get shape(){const d=a._zod.def.shape,m={...d};if(i)for(const p in i){if(!(p in d))throw new Error(`Unrecognized key: "${p}"`);i[p]&&(m[p]=e?new e({type:"optional",innerType:d[p]}):d[p])}else for(const p in d)m[p]=e?new e({type:"optional",innerType:d[p]}):d[p];return ci(this,"shape",m),m},checks:[]});return kr(a,c)}function u_(e,a,i){const l=Or(a._zod.def,{get shape(){const s=a._zod.def.shape,u={...s};if(i)for(const c in i){if(!(c in u))throw new Error(`Unrecognized key: "${c}"`);i[c]&&(u[c]=new e({type:"nonoptional",innerType:s[c]}))}else for(const c in s)u[c]=new e({type:"nonoptional",innerType:s[c]});return ci(this,"shape",u),u}});return kr(a,l)}function il(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var l;return(l=i).path??(l.path=[]),i.path.unshift(e),i})}function du(e){return typeof e=="string"?e:e?.message}function si(e,a,i){const l=e.message?e.message:du(e.inst?._zod.def?.error?.(e))??du(a?.error?.(e))??du(i.customError?.(e))??du(i.localeError?.(e))??"Invalid input",{inst:s,continue:u,input:c,...d}=e;return d.path??(d.path=[]),d.message=l,a?.reportInput&&(d.input=c),d}function Nh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function jo(...e){const[a,i,l]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:l}:{...a}}const lb=(e,a)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:a,enumerable:!1}),e.message=JSON.stringify(a,lh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ob=ne("$ZodError",lb),sb=ne("$ZodError",lb,{Parent:Error});function f_(e,a=i=>i.message){const i={},l=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(a(s))):l.push(a(s));return{formErrors:l,fieldErrors:i}}function d_(e,a=i=>i.message){const i={_errors:[]},l=(s,u=[])=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>l({issues:d},[...u,...c.path]));else if(c.code==="invalid_key")l({issues:c.issues},[...u,...c.path]);else if(c.code==="invalid_element")l({issues:c.issues},[...u,...c.path]);else{const d=[...u,...c.path];if(d.length===0)i._errors.push(a(c));else{let m=i,p=0;for(;p(a,i,l,s)=>{const u=l?{...l,async:!1}:{async:!1},c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise)throw new sl;if(c.issues.length){const d=new(s?.Err??e)(c.issues.map(m=>si(m,u,oi())));throw ab(d,s?.callee),d}return c.value},Oh=e=>async(a,i,l,s)=>{const u=l?{...l,async:!0}:{async:!0};let c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new(s?.Err??e)(c.issues.map(m=>si(m,u,oi())));throw ab(d,s?.callee),d}return c.value},Wu=e=>(a,i,l)=>{const s=l?{...l,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new sl;return u.issues.length?{success:!1,error:new(e??ob)(u.issues.map(c=>si(c,s,oi())))}:{success:!0,data:u.value}},h_=Wu(sb),ec=e=>async(a,i,l)=>{const s=l?{...l,async:!0}:{async:!0};let u=a._zod.run({value:i,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>si(c,s,oi())))}:{success:!0,data:u.value}},m_=ec(sb),p_=e=>(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Mh(e)(a,i,s)},y_=e=>(a,i,l)=>Mh(e)(a,i,l),g_=e=>async(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Oh(e)(a,i,s)},v_=e=>async(a,i,l)=>Oh(e)(a,i,l),b_=e=>(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Wu(e)(a,i,s)},x_=e=>(a,i,l)=>Wu(e)(a,i,l),S_=e=>async(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return ec(e)(a,i,s)},w_=e=>async(a,i,l)=>ec(e)(a,i,l),__=/^[cC][0-9a-z]{6,}$/,E_=/^[0-9a-z]+$/,T_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,R_=/^[0-9a-vA-V]{20}$/,A_=/^[A-Za-z0-9]{27}$/,z_=/^[a-zA-Z0-9_-]{21}$/,C_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j_=/^([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})$/,bv=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[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)$/,N_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,M_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function O_(){return new RegExp(M_,"u")}const k_=/^(?:(?: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])$/,D_=/^(([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}|:))$/,L_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3})DELIM" -R"DELIM((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])$/,B_=/^(([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])$/,U_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ub=/^[A-Za-z0-9_-]*$/,H_=/^https?$/,$_=/^\+[1-9]\d{6,14}$/,cb="(?:(?:\\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])))",Z_=new RegExp(`^${cb}$`);function fb(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function q_(e){return new RegExp(`^${fb(e)}$`)}function P_(e){const a=fb({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${a}(?:${i.join("|")})`;return new RegExp(`^${cb}T(?:${l})$`)}const Q_=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},F_=/^-?\d+$/,Y_=/^-?\d+(?:\.\d+)?$/,G_=/^(?:true|false)$/i,K_=/^[^A-Z]*$/,V_=/^[^a-z]*$/,bn=ne("$ZodCheck",(e,a)=>{var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),db={number:"number",bigint:"bigint",object:"date"},hb=ne("$ZodCheckLessThan",(e,a)=>{bn.init(e,a);const i=db[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?l.value<=a.value:l.value{bn.init(e,a);const i=db[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>u&&(a.inclusive?s.minimum=a.value:s.exclusiveMinimum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value>=a.value:l.value>a.value)||l.issues.push({origin:i,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),X_=ne("$ZodCheckMultipleOf",(e,a)=>{bn.init(e,a),e._zod.onattach.push(i=>{var l;(l=i._zod.bag).multipleOf??(l.multipleOf=a.value)}),e._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):Iw(i.value,a.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:a.value,input:i.value,inst:e,continue:!a.abort})}}),I_=ne("$ZodCheckNumberFormat",(e,a)=>{bn.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),l=i?"int":"number",[s,u]=n_[a.format];e._zod.onattach.push(c=>{const d=c._zod.bag;d.format=a.format,d.minimum=s,d.maximum=u,i&&(d.pattern=F_)}),e._zod.check=c=>{const d=c.value;if(i){if(!Number.isInteger(d)){c.issues.push({expected:l,format:a.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort});return}}du&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!a.abort})}}),J_=ne("$ZodCheckMaxLength",(e,a)=>{var i;bn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Ch(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=l.value;if(s.length<=a.maximum)return;const c=Nh(s);l.issues.push({origin:c,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),W_=ne("$ZodCheckMinLength",(e,a)=>{var i;bn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Ch(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(l._zod.bag.minimum=a.minimum)}),e._zod.check=l=>{const s=l.value;if(s.length>=a.minimum)return;const c=Nh(s);l.issues.push({origin:c,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),e2=ne("$ZodCheckLengthEquals",(e,a)=>{var i;bn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Ch(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=l=>{const s=l.value,u=s.length;if(u===a.length)return;const c=Nh(s),d=u>a.length;l.issues.push({origin:c,...d?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!a.abort})}}),tc=ne("$ZodCheckStringFormat",(e,a)=>{var i,l;bn.init(e,a),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=a.format,a.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(a.pattern))}),a.pattern?(i=e._zod).check??(i.check=s=>{a.pattern.lastIndex=0,!a.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:a.format,input:s.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(l=e._zod).check??(l.check=()=>{})}),t2=ne("$ZodCheckRegex",(e,a)=>{tc.init(e,a),e._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:e,continue:!a.abort})}}),n2=ne("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=K_),tc.init(e,a)}),a2=ne("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=V_),tc.init(e,a)}),r2=ne("$ZodCheckIncludes",(e,a)=>{bn.init(e,a);const i=Ju(a.includes),l=new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=l,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(l)}),e._zod.check=s=>{s.value.includes(a.includes,a.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:s.value,inst:e,continue:!a.abort})}}),i2=ne("$ZodCheckStartsWith",(e,a)=>{bn.init(e,a);const i=new RegExp(`^${Ju(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.startsWith(a.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:l.value,inst:e,continue:!a.abort})}}),l2=ne("$ZodCheckEndsWith",(e,a)=>{bn.init(e,a);const i=new RegExp(`.*${Ju(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.endsWith(a.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:l.value,inst:e,continue:!a.abort})}}),o2=ne("$ZodCheckOverwrite",(e,a)=>{bn.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class s2{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 l=a.split(` -`).filter(c=>c),s=Math.min(...l.map(c=>c.length-c.trimStart().length)),u=l.map(c=>c.slice(s)).map(c=>" ".repeat(this.indent*2)+c);for(const c of u)this.content.push(c)}compile(){const a=Function,i=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new a(...i,)DELIM" -R"DELIM(s.join(` -`))}}const u2={major:4,minor:4,patch:3},jt=ne("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=u2;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const s of l)for(const u of s._zod.onattach)u(e);if(l.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,d,m)=>{let p=il(c),b;for(const g of d){if(g._zod.def.when){if(c_(c)||!g._zod.def.when(c))continue}else if(p)continue;const x=c.issues.length,w=g._zod.check(c);if(w instanceof Promise&&m?.async===!1)throw new sl;if(b||w instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await w,c.issues.length!==x&&(p||(p=il(c,x)))});else{if(c.issues.length===x)continue;p||(p=il(c,x))}}return b?b.then(()=>c):c},u=(c,d,m)=>{if(il(c))return c.aborted=!0,c;const p=s(d,l,m);if(p instanceof Promise){if(m.async===!1)throw new sl;return p.then(b=>e._zod.parse(b,m))}return e._zod.parse(p,m)};e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){const p=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(b=>u(b,c,d)):u(p,c,d)}const m=e._zod.parse(c,d);if(m instanceof Promise){if(d.async===!1)throw new sl;return m.then(p=>s(p,l,d))}return s(m,l,d)}}dt(e,"~standard",()=>({validate:s=>{try{const u=h_(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return m_(e,s).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}))}),kh=ne("$ZodString",(e,a)=>{jt.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Q_(e._zod.bag),e._zod.parse=(i,l)=>{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:e}),i}}),xt=ne("$ZodStringFormat",(e,a)=>{tc.init(e,a),kh.init(e,a)}),c2=ne("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=j_),xt.init(e,a)}),f2=ne("$ZodUUID",(e,a)=>{if(a.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(l===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=bv(l))}else a.pattern??(a.pattern=bv());xt.init(e,a)}),d2=ne("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=N_),xt.init(e,a)}),h2=ne("$ZodURL",(e,a)=>{xt.init(e,a),e._zod.check=i=>{try{const l=i.value.trim();if(!a.normalize&&a.protocol?.source===H_.source&&!/^https?:\/\//i.test(l)){i.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:i.value,inst:e,continue:!a.abort});return}const s=new URL(l);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:e,continue:!a.abort})),a.normalize?i.value=s.href:i.value=l;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),m2=ne("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=O_()),xt.init(e,a)}),p2=ne("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=z_),xt.init(e,a)}),y2=ne("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=__),xt.init(e,a)}),g2=ne("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=E_),xt.init(e,a)}),v2=ne("$ZodULID",(e,a)=>{a.pattern??(a.pattern=T_),xt.init(e,a)}),b2=ne("$ZodXID",(e,a)=>{a.pattern??(a.pattern=R_),xt.init(e,a)}),x2=ne("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=A_),xt.init(e,a)}),S2=ne("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=P_(a)),xt.init(e,a)}),w2=ne("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=Z_),xt.init(e,a)}),_2=ne("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=q_(a)),xt.init(e,a)}),E2=ne("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=C_),xt.init(e,a)}),T2=ne("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=k_),xt.init(e,a),e._zod.bag.format="ipv4"}),R2=ne("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=D_),xt.init(e,a),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!a.abort})}}}),A2=ne("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=L_),xt.init(e,a)}),z2=ne("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=B_),xt.init(e,a),e._zod.check=i=>{const l=i.value.split("/");try{if(l.length!==2)throw new Error;const[s,u]=l;if(!u)throw new Error;const c=Number(u);if(`${c}`!==u)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${s}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!a.abort})}}});function pb(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const C2=ne("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=U_),xt.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{pb(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function j2(e){if(!ub.test(e))return!1;const a=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return pb(i)}const N2=ne("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=ub),xt.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{j2(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),M2=ne("$ZodE164",(e,a)=>{a.pattern??(a.pattern=$_),xt.init(e,a)});function O2(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[l]=i;if(!l)return!1;const s=JSON.parse(atob(l));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const k2=ne("$ZodJWT",(e,a)=>{xt.init(e,a),e._zod.check=i=>{O2(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),yb=ne("$ZodNumber",(e,a)=>{jt.init(e,a),e._zod.pattern=e._zod.bag.pattern??Y_,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),i}}),D2=ne("$ZodNumberFormat",(e,a)=>{I_.init(e,a),yb.init(e,a)}),L2=ne("$ZodBoolean",(e,a)=>{jt.init(e,a),e._zod.pattern=G_,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),B2=ne("$ZodUnknown",(e,a)=>{jt.init(e,a),e._zod.parse=i=>i}),U2=ne("$ZodNever",(e,a)=>{jt.init(e,a),e._zod.parse=(i,l)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function xv(e,a,i){e.issues.length&&a.issues.push(...ib(i,e.issues)),a.value[i]=e.value}const H2=ne("$ZodArray",(e,a)=>{jt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const u=[];for(let c=0;cxv(p,i,c))):xv(m,i,c)}return u.length?Promise.all(u).then(()=>i):i}});function Hu(e,a,i,l,s,u){const c=i in l;if(e.issues.length){if(s&&u&&!c)return;a.issues.push(...ib(i,e.issues))}if(!c&&!s){e.issues.length||a.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}e.value===void 0?c&&(a.value[i]=void 0):a.value[i]=e.value}function gb(e){const a=Object.keys(e.shape);for(const l of a)if(!e.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const i=t_(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function vb(e,a,i,l,s,u){const c=[],d=s.keySet,m=s.catchall._zod,p=m.def.type,)DELIM" -R"DELIM(b=m.optin==="optional",g=m.optout==="optional";for(const x in a){if(x==="__proto__"||d.has(x))continue;if(p==="never"){c.push(x);continue}const w=m.run({value:a[x],issues:[]},l);w instanceof Promise?e.push(w.then(E=>Hu(E,i,x,a,b,g))):Hu(w,i,x,a,b,g)}return c.length&&i.issues.push({code:"unrecognized_keys",keys:c,input:a,inst:u}),e.length?Promise.all(e).then(()=>i):i}const $2=ne("$ZodObject",(e,a)=>{if(jt.init(e,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const d=a.shape;Object.defineProperty(a,"shape",{get:()=>{const m={...d};return Object.defineProperty(a,"shape",{value:m}),m}})}const l=zh(()=>gb(a));dt(e._zod,"propValues",()=>{const d=a.shape,m={};for(const p in d){const b=d[p]._zod;if(b.values){m[p]??(m[p]=new Set);for(const g of b.values)m[p].add(g)}}return m});const s=Uu,u=a.catchall;let c;e._zod.parse=(d,m)=>{c??(c=l.value);const p=d.value;if(!s(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d;d.value={};const b=[],g=c.shape;for(const x of c.keys){const w=g[x],E=w._zod.optin==="optional",R=w._zod.optout==="optional",N=w._zod.run({value:p[x],issues:[]},m);N instanceof Promise?b.push(N.then(F=>Hu(F,d,x,p,E,R))):Hu(N,d,x,p,E,R)}return u?vb(b,p,d,m,l.value,e):b.length?Promise.all(b).then(()=>d):d}}),Z2=ne("$ZodObjectJIT",(e,a)=>{$2.init(e,a);const i=e._zod.parse,l=zh(()=>gb(a)),s=x=>{const w=new s2(["shape","payload","ctx"]),E=l.value,R=J=>{const ue=vv(J);return`shape[${ue}]._zod.run({ value: input[${ue}], issues: [] }, ctx)`};w.write("const input = payload.value;");const N=Object.create(null);let F=0;for(const J of E.keys)N[J]=`key_${F++}`;w.write("const newResult = {};");for(const J of E.keys){const ue=N[J],ae=vv(J),xe=x[J],j=xe?._zod?.optin==="optional",_=xe?._zod?.optout==="optional";w.write(`const ${ue} = ${R(J)};`),j&&_?w.write(` +`+o.stack}}var nt=Object.prototype.hasOwnProperty,pt=e.unstable_scheduleCallback,tn=e.unstable_cancelCallback,xa=e.unstable_shouldYield,gl=e.unstable_requestPaint,Rt=e.unstable_now,bn=e.unstable_getCurrentPriorityLevel,Mn=e.unstable_ImmediatePriority,Dr=e.unstable_UserBlockingPriority,Ga=e.unstable_NormalPriority,Xn=e.unstable_LowPriority,On=e.unstable_IdlePriority,uc=e.log,cc=e.unstable_setDisableYieldValue,Sa=null,nn=null;function Zt(t){if(typeof uc=="function"&&cc(t),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(Sa,t)}catch{}}var Xt=Math.clz32?Math.clz32:fc,Io=Math.log,Jo=Math.LN2;function fc(t))DELIM" +R"DELIM({return t>>>=0,t===0?32:31-(Io(t)/Jo|0)|0}var Lr=256,wa=262144,Br=4194304;function In(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function di(t,n,r){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var S=o&134217727;return S!==0?(o=S&~h,o!==0?f=In(o):(y&=S,y!==0?f=In(y):r||(r=S&~t,r!==0&&(f=In(r))))):(S=o&~h,S!==0?f=In(S):y!==0?f=In(y):r||(r=o&~t,r!==0&&(f=In(r)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:f}function Ka(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function dc(t,n){switch(t){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 vl(){var t=Br;return Br<<=1,(Br&62914560)===0&&(Br=4194304),t}function Va(t){for(var n=[],r=0;31>r;r++)n.push(t);return n}function oa(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Wo(t,n,r,o,f,h){var y=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var S=t.entanglements,A=t.expirationTimes,$=t.hiddenUpdates;for(r=y&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ta=/[\n"\\]/g;function rn(t){return t.replace(Ta,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function bl(t,n,r,o,f,h,y,S){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),n!=null?y==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+ht(n)):t.value!==""+ht(n)&&(t.value=""+ht(n)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),n!=null?hc(t,y,ht(n)):r!=null?hc(t,y,ht(r)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.name=""+ht(S):t.removeAttribute("name")}function pm(t,n,r,o,f,h,y,S){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){pi(t);return}r=r!=null?""+ht(r):"",n=n!=null?""+ht(n):r,S||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=S?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),pi(t)}function hc(t,n,r){n==="number"&<(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function gi(t,n,r,o){if(t=t.options,n){n={};for(var f=0;f"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vc=!1;if(Aa)try{var Sl={};Object.defineProperty(Sl,"passive",{get:function(){vc=!0}}),window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{vc=!1}var Ia=null,bc=null,as=null;function wm(){if(as)return as;var t,n=bc,r=n.length,o,f="value"in Ia?Ia.value:Ia.textContent,h=f.length;for(t=0;t=El),zm=" ",Cm=!1;function jm(t,n){switch(t){case"keyup":return A1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Si=!1;function C1(t,n){switch(t){case"compositionend":return Nm(n);case"keypress":return n.which!==32?null:(Cm=!0,zm);case"textInput":return t=n.data,t===zm&&Cm?null:t;default:return null}}function j1(t,n){if(Si)return t==="compositionend"||!Ec&&jm(t,n)?(t=wm(),as=bc=Ia=null,Si=!1,t):null;switch(t){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-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Hm(r)}}function Zm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Zm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function qm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=lt(t.document);n instanceof t.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)t=n.contentWindow;else break;n=lt(t.document)}return n}function Ac(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var U1=Aa&&"documentMode"in document&&11>=document.documentMode,wi=null,zc=null,zl=null,Cc=!1;function Pm(t,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cc||wi==null||wi!==lt(o)||(o=wi,"selectionStart"in o&&Ac(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),zl&&Al(zl,o)||(zl=o,o=Xs(zc,"onSelect"),0>=y,f-=y,sa=1<<32-Xt(n)+f|r<$e?(Ge=_e,_e=null):Ge=_e.sibling;var et=P(U,_e,H[$e],ee);if(et===null){_e===null&&(_e=Ge);break}t&&_e&&et.alternate===null&&n(U,_e),O=h(et,O,$e),We===null?Re=et:We.sibling=et,We=et,_e=Ge}if($e===H.length)return r(U,_e),Ke&&Ca(U,$e),Re;if(_e===null){for(;$e$e?(Ge=_e,_e=null):Ge=_e.sibling;var br=P(U,_e,et.value,ee);if(br===null){_e===null&&(_e=Ge);break}t&&_e&&br.alternate===null&&n(U,_e),O=h(br,O,$e),We===null?Re=br:We.sibling=br,We=br,_e=Ge}if(et.done)return r(U,_e),Ke&&Ca(U,$e),Re;if(_e===null){for(;!et.done;$e++,et=H.next())et=te(U,et.value,ee),et!==null&&(O=h(et,O,$e),We===null?Re=et:We.sibling=et,We=et);return Ke&&Ca(U,$e),Re}for(_e=o(_e);!et.done;$e++,et=H.next())et=Y(_e,U,$e,et.value,ee),et!==null&&(t&&et.alternate!==null&&_e.delete(et.key===null?$e:et.key),O=h(et,O,$e),We===null?Re=et:We.sibling=et,We=et);return t&&_e.forEach(function(rw){return n(U,rw)}),Ke&&Ca(U,$e),Re}function ft(U,O,H,ee){if(typeof H=="object"&&H!==null&&H.type===R&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case w:e:{for(var Re=H.key;O!==null;){if(O.key===Re){if(Re=H.type,Re===R){if(O.tag===7){r(U,O.sibling),ee=f(O,H.props.children),ee.return=U,U=ee;break e}}else if(O.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===_&&Gr(Re)===O.type){r(U,O.sibling),ee=f(O,H.props),kl(ee,H),ee.return=U,U=ee;break e}r(U,O);break}else n(U,O);O=O.sibling}H.type===R?(ee=qr(H.props.children,U.mode,ee,H.key),ee.return=U,U=ee):(ee=hs(H.type,H.key,H.props,null,U.mode,ee),kl(ee,H),ee.return=U,U=ee)}return y(U);case E:e:{for(Re=H.key;O!==null;){if(O.key===Re)if(O.tag===4&&O.stateNode.containerInfo===H.containerInfo&&O.stateNode.implementation===H.implementation){r(U,O.sibling),ee=f(O,H.children||[]),ee.return=U,U=ee;break e}else{r(U,O);break}else n(U,O);O=O.sibling}ee=Lc(H,U.mode,ee),ee.return=U,U=ee}return y(U);case _:return H=Gr(H),ft(U,O,H,ee)}if(fe(H))return Se(U,O,H,ee);if(q(H)){if(Re=q(H),typeof Re!="function")throw Error(l(150));return H=Re.call(H),Ne(U,O,H,ee)}if(typeof H.then=="function")return ft(U,O,xs(H),ee);if(H.$$typeof===J)return ft(U,O,ys(U,H),ee);Ss(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,O!==null&&O.tag===6?(r(U,O.sibling),ee=f(O,H),ee.return=U,U=ee):(r(U,O),ee=Dc(H,U.mode,ee),ee.return=U,U=ee),y(U)):r(U,O)}return function(U,O,H,ee){try{Ol=0;var Re=ft(U,O,H,ee);return Oi=null,Re}catch(_e){if(_e===Mi||_e===vs)throw _e;var We=wn(29,_e,null,U.mode);return We.lanes=ee,We.return=U,We}}}var Vr=dp(!0),hp=dp(!1),nr=!1;function Kc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vc(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ar(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function rr(t,n,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(at&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=ds(t),Xm(t,null,r),n}return fs(t,o,n,r),ds(t)}function Dl(t,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ts(t,r)}}function Xc(t,n){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var f=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?f=h=y:h=h.next=y,r=r.next}while(r!==null);h===null?f=h=n:h=h.next=n}else f=h=n;r={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=n:t.next=n,r.lastBaseUpdate=n}var Ic=!1;function Ll(){if(Ic){var t=Ni;if(t!==null)throw t}}function Bl(t,n,r,o){Ic=!1;var f=t.updateQueue;nr=!1;var h=f.firstBaseUpdate,y=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var A=S,$=A.next;A.next=null,y===null?h=$:y.next=$,y=A;var I=t.alternate;I!==null&&(I=I.updateQueue,S=I.lastBaseUpdate,S!==y&&(S===null?I.firstBaseUpdate=$:S.next=$,I.lastBaseUpdate=A))}if(h!==null){var te=f.baseState;y=0,I=$=A=null,S=h;do{var P=S.lane&-536870913,Y=P!==S.lane;if(Y?(Ye&P)===P:(o&P)===P){P!==0&&P===ji&&(Ic=!0),I!==null&&(I=I.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Se=t,Ne=S;P=n;var ft=r;switch(Ne.tag){case 1:if(Se=Ne.payload,typeof Se=="function"){te=Se.call(ft,te,P);break e}te=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ne.payload,P=typeof Se=="function"?Se.call(ft,te,P):Se,P==null)break e;te=g({},te,P);break e;case 2:nr=!0}}P=S.callback,P!==null&&(t.flags|=64,Y&&(t.flags|=8192),Y=f.callbacks,Y===null?f.callbacks=[P]:Y.push(P))}else Y={lane:P,tag:S.tag,payload:S.payload,callback:S.callback,next:null},I===null?($=I=Y,A=te):I=I.next=Y,y|=P;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;Y=S,S=Y.next,Y.next=null,f.lastBaseUpdate=Y,f.shared.pending=null}}while(!0);I===null&&(A=te),f.baseState=A,f.firstBaseUpdate=$,f.lastBaseUpdate=I,h===null&&(f.shared.lanes=0),ur|=y,t.lanes=y,t.memoizedState=te}}function mp(t,n){if(typeof t!="function")throw Error(l(191,t));t.call(n)}function pp(t,n){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;th?h:8;var y=M.T,S={};M.T=S,gf(t,!1,n,r);try{var A=f(),$=M.S;if($!==null&&$(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var I=G1(A,o);$l(t,n,I,An(t))}else $l(t,n,o,An(t))}catch(te){$l(t,n,{then:function(){},status:"rejected",reason:te},An())}finally{k.p=h,y!==null&&S.types!==null&&(y.types=S.types),M.T=y}}function W1(){}function pf(t,n,r,o){if(t.tag!==5)throw Error(l(476));var f=Gp(t).queue;Yp(t,f,n,le,r===null?W1:function(){return Kp(t),r(o)})}function Gp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:le},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},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Kp(t){var n=Gp(t);n.next===null&&(n=t.alternate.memoizedState),$l(t,n.next.queue,{},An())}function yf(){return Qt(ao)}function Vp(){return Ct().memoizedState}function Xp(){return Ct().memoizedState}function eS(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var r=An();t=ar(r);var o=rr(n,t,r);o!==null&&(yn(o,n,r),Dl(o,n,r)),n={cache:Qc()},t.payload=n;return}n=n.return}}function tS(t,n,r){var o=An();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(t)?Jp(n,r):(r=Oc(t,n,r,o),r!==null&&(yn(r,t,o),Wp(r,n,o)))}function Ip(t,n,r){var o=An();$l(t,n,r,o)}function $l(t,n,r,o){var f={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ns(t))Jp(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var y=n.lastRenderedState,S=h(y,r);if(f.hasEagerState=!0,f.eagerState=S,Sn(S,y))return fs(t,n,f,0),mt===null&&cs(),!1}catch{}if(r=Oc(t,n,f,o),r!==null)return yn(r,t,o),Wp(r,n,o),!0}return!1}function gf(t,n,r,o){if(o={lane:2,revertLane:Vf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ns(t)){if(n)throw Error(l(479))}else n=Oc(t,r,o,2),n!==null&&yn(n,t,2)}function Ns(t){var n=t.alternate;return t===Be||n!==null&&n===Be}function Jp(t,n){Di=Es=!0;var r=t.pending;r===null?n.next=n:(n.next=r.next,r.next=n),t.pending=n}function Wp(t,n,r){if((r&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,r|=o,n.lanes=r,ts(t,r)}}var Zl={readContext:Qt,use:As,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};Zl.useEffectEvent=_t;var ey={readContext:Qt,use:As,useCallback:function(t,n){return ln().memoizedState=[t,n===void 0?null:n],t},useContext:Qt,useEffect:Bp,useImperativeHandle:function(t,n,r){r=r!=null?r.concat([t]):null,Cs(4194308,4,Zp.bind(null,n,t),r)},useLayoutEffect:function(t,n){return Cs(4194308,4,t,n)},useInsertionEffect:function(t,n){Cs(4,2,t,n)},useMemo:function(t,n){var r=ln();n=n===void 0?null:n;var o=t();if(Xr){Zt(!0);try{t()}finally{Zt(!1)}}return r.memoizedState=[o,n],o},useReducer:function(t,n,r){var o=ln();if(r!==void 0){var f=r(n);if(Xr){Zt(!0);try{r(n)}finally{Zt(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=tS.bind(null,Be,t),[o.memoizedState,t]},useRef:function(t){var n=ln();return t={current:t},n.memoizedState=t},useState:function(t){t=cf(t);var n=t.queue,r=Ip.bind(null,Be,n);return n.dispatch=r,[t.memoizedState,r]},useDebugValue:hf,useDeferredValue:function(t,n){var r=ln();return mf(r,t,n)},useTransition:function(){var t=cf(!1);return t=Yp.bind(null,Be,t.queue,!0,!1),ln().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,r){var o=Be,f=ln();if(Ke){if(r===void 0)throw Error(l(407));r=r()}else{if(r=n(),mt===null)throw Error(l(349));(Ye&127)!==0||Sp(o,n,r)}f.memoizedState=r;var h={value:r,getSnapshot:n};return f.queue=h,Bp(_p.bind(null,o,h,t),[t]),o.flags|=2048,Bi(9,{destroy:void 0},wp.bind(null,o,h,r,n),null),r},useId:function(){var t=ln(),n=mt.identifierPrefix;if(Ke){var r=ua,o=sa;r=(o&~(1<<32-Xt(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ts++,0<\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?y.createElement(f,{is:o.is}):y.createElement(f)}}h[me]=n,h[ve]=o;e:for(y=n.child;y!==null;){if(y.tag===5||y.tag===6)h.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=h;e:switch(Yt(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Da(n)}}return vt(n),Nf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,r),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Da(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(l(166));if(t=Te.current,zi(n)){if(t=n.stateNode,r=n.memoizedProps,o=null,f=Pt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[me]=n,t=!!(t.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||bg(t.nodeValue,r)),t||er(n,!0)}else t=Is(t).createTextNode(o),t[me]=n,n.stateNode=t}return vt(n),null;case 31:if(r=n.memoizedState,t===null||t.memoizedState!==null){if(o=zi(n),r!==null){if(t===null){if(!o)throw Error(l(318));if(t=n.memoizedState,t=t!==null?t.dehydrate)DELIM" +R"DELIM(d:null,!t)throw Error(l(557));t[me]=n}else Pr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),t=!1}else r=$c(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return n.flags&256?(En(n),n):(En(n),null);if((n.flags&128)!==0)throw Error(l(558))}return vt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=zi(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(l(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[me]=n}else Pr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),f=!1}else f=$c(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(En(n),n):(En(n),null)}return En(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,t=t!==null&&t.memoizedState!==null,r&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),r!==t&&r&&(n.child.flags|=8192),Ls(n,n.updateQueue),vt(n),null);case 4:return X(),t===null&&Wf(n.stateNode.containerInfo),vt(n),null;case 10:return Na(n.type),vt(n),null;case 19:if(K(zt),o=n.memoizedState,o===null)return vt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)Pl(o,!1);else{if(Et!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=_s(t),h!==null){for(n.flags|=128,Pl(o,!1),t=h.updateQueue,n.updateQueue=t,Ls(n,t),n.subtreeFlags=0,t=r,r=n.child;r!==null;)Im(r,t),r=r.sibling;return oe(zt,zt.current&1|2),Ke&&Ca(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Rt()>Zs&&(n.flags|=128,f=!0,Pl(o,!1),n.lanes=4194304)}else{if(!f)if(t=_s(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Ls(n,t),Pl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ke)return vt(n),null}else 2*Rt()-o.renderingStartTime>Zs&&r!==536870912&&(n.flags|=128,f=!0,Pl(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Rt(),t.sibling=null,r=zt.current,oe(zt,f?r&1|2:r&1),Ke&&Ca(n,o.treeForkCount),t):(vt(n),null);case 22:case 23:return En(n),Wc(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(vt(n),n.subtreeFlags&6&&(n.flags|=8192)):vt(n),r=n.updateQueue,r!==null&&Ls(n,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),t!==null&&K(Yr),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Na(kt),vt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function lS(t,n){switch(Uc(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Na(kt),X(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return pe(n),null;case 31:if(n.memoizedState!==null){if(En(n),n.alternate===null)throw Error(l(340));Pr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(En(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Pr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return K(zt),null;case 4:return X(),null;case 10:return Na(n.type),null;case 22:case 23:return En(n),Wc(),t!==null&&K(Yr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Na(kt),null;case 25:return null;default:return null}}function Ey(t,n){switch(Uc(n),n.tag){case 3:Na(kt),X();break;case 26:case 27:case 5:pe(n);break;case 4:X();break;case 31:n.memoizedState!==null&&En(n);break;case 13:En(n);break;case 19:K(zt);break;case 10:Na(n.type);break;case 22:case 23:En(n),Wc(),t!==null&&K(Yr);break;case 24:Na(kt)}}function Ql(t,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var f=o.next;r=f;do{if((r.tag&t)===t){o=void 0;var h=r.create,y=r.inst;o=h(),y.destroy=o}r=r.next}while(r!==f)}}catch(S){st(n,n.return,S)}}function or(t,n,r){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var y=o.inst,S=y.destroy;if(S!==void 0){y.destroy=void 0,f=n;var A=r,$=S;try{$()}catch(I){st(f,A,I)}}}o=o.next}while(o!==h)}}catch(I){st(n,n.return,I)}}function Ty(t){var n=t.updateQueue;if(n!==null){var r=t.stateNode;try{pp(n,r)}catch(o){st(t,t.return,o)}}}function Ry(t,n,r){r.props=Ir(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(o){st(t,n,o)}}function Fl(t,n){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof r=="function"?t.refCleanup=r(o):r.current=o}}catch(f){st(t,n,f)}}function ca(t,n){var r=t.ref,o=t.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(f){st(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(f){st(t,n,f)}else r.current=null}function Ay(t){var n=t.type,r=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(f){st(t,t.return,f)}}function Mf(t,n,r){try{var o=t.stateNode;zS(o,t.type,r,n),o[ve]=n}catch(f){st(t,t.return,f)}}function zy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&mr(t.type)||t.tag===4}function Of(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||zy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&mr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function kf(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(t),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=Ra));else if(o!==4&&(o===27&&mr(t.type)&&(r=t.stateNode,n=null),t=t.child,t!==null))for(kf(t,n,r),t=t.sibling;t!==null;)kf(t,n,r),t=t.sibling}function Bs(t,n,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(o!==4&&(o===27&&mr(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(Bs(t,n,r),t=t.sibling;t!==null;)Bs(t,n,r),t=t.sibling}function Cy(t){var n=t.stateNode,r=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Yt(n,o,r),n[me]=t,n[ve]=r}catch(h){st(t,t.return,h)}}var La=!1,Bt=!1,Df=!1,jy=typeof WeakSet=="function"?WeakSet:Set,qt=null;function oS(t,n){if(t=t.containerInfo,nd=ru,t=qm(t),Ac(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var y=0,S=-1,A=-1,$=0,I=0,te=t,P=null;t:for(;;){for(var Y;te!==r||f!==0&&te.nodeType!==3||(S=y+f),te!==h||o!==0&&te.nodeType!==3||(A=y+o),te.nodeType===3&&(y+=te.nodeValue.length),(Y=te.firstChild)!==null;)P=te,te=Y;for(;;){if(te===t)break t;if(P===r&&++$===f&&(S=y),P===h&&++I===o&&(A=y),(Y=te.nextSibling)!==null)break;te=P,P=te.parentNode}te=Y}r=S===-1||A===-1?null:{start:S,end:A}}else r=null}r=r||{start:0,end:0}}else r=null;for(ad={focusedElem:t,selectionRange:r},ru=!1,qt=n;qt!==null;)if(n=qt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,qt=t;else for(;qt!==null;){switch(n=qt,h=n.alternate,t=n.flags,n.tag)DELIM" +R"DELIM(){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(r=0;r title"))),Yt(h,o,r),h[me]=t,Xe(h),o=h;break e;case"link":var y=Lg("link","href",f).get(o+(r.href||""));if(y){for(var S=0;Sft&&(y=ft,ft=Ne,Ne=y);var U=$m(S,Ne),O=$m(S,ft);if(U&&O&&(Y.rangeCount!==1||Y.anchorNode!==U.node||Y.anchorOffset!==U.offset||Y.focusNode!==O.node||Y.focusOffset!==O.offset)){var H=te.createRange();H.setStart(U.node,U.offset),Y.removeAllRanges(),Ne>ft?(Y.addRange(H),Y.extend(O.node,O.offset)):(H.setEnd(O.node,O.offset),Y.addRange(H))}}}}for(te=[],Y=S;Y=Y.parentNode;)Y.nodeType===1&&te.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;Sr?32:r,M.T=null,r=qf,qf=null;var h=fr,y=Za;if($t=0,qi=fr=null,Za=0,(at&6)!==0)throw Error(l(331));var S=at;if(at|=4,Zy(h.current),Uy(h,h.current,y,r),at=S,Il(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(Sa,h)}catch{}return!0}finally{k.p=f,M.T=o,ig(t,n)}}function og(t,n,r){n=Ln(r,n),n=Sf(t.stateNode,n,2),t=rr(t,n,2),t!==null&&(oa(t,2),fa(t))}function st(t,n,r){if(t.tag===3)og(t,t,r);else for(;n!==null;){if(n.tag===3){og(n,t,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(cr===null||!cr.has(o))){t=Ln(r,t),r=sy(2),o=rr(n,r,2),o!==null&&(uy(r,o,n,t),oa(o,2),fa(o));break}}n=n.return}}function Yf(t,n,r){var o=t.pingCache;if(o===null){o=t.pingCache=new cS;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(r)||(Uf=!0,f.add(r),t=pS.bind(null,t,n,r),n.then(t,t))}function pS(t,n,r){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,mt===t&&(Ye&r)===r&&(Et===4||Et===3&&(Ye&62914560)===Ye&&300>Rt()-$s?(at&2)===0&&Pi(t,0):Hf|=r,Zi===Ye&&(Zi=0)),fa(t)}function sg(t,n){n===0&&(n=vl()),t=Zr(t,n),t!==null&&(oa(t,n),fa(t))}function yS(t){var n=t.memoizedState,r=0;n!==null&&(r=n.retryLane),sg(t,r)}function gS(t,n){var r=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(r=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(n),sg(t,r)}function vS(t,n){return pt(t,n)}var Gs=null,Fi=null,Gf=!1,Ks=!1,Kf=!1,hr=0;function fa(t){t!==Fi&&t.next===null&&(Fi===null?Gs=Fi=t:Fi=Fi.next=t),Ks=!0,Gf||(Gf=!0,xS())}function Il(t,n){if(!Kf&&Ks){Kf=!0;do for(var r=!1,o=Gs;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var y=o.suspendedLanes,S=o.pingedLanes;h=(1<<31-Xt(42|t)+1)-1,h&=f&~(y&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,dg(o,h))}else h=Ye,h=di(o,o===mt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Ka(o,h)||(r=!0,dg(o,h));o=o.next}while(r);Kf=!1}}function bS(){ug()}function ug(){Ks=Gf=!1;var t=0;hr!==0&&jS()&&(t=hr);for(var n=Rt(),r=null,o=Gs;o!==null;){var f=o.next,h=cg(o,n);h===0?(o.next=null,r===null?Gs=f:r.next=f,f===null&&(Fi=r)):(r=o,(t!==0||(h&3)!==0)&&(Ks=!0)),o=f}$t!==0&&$t!==5||Il(t),hr!==0&&(hr=0)}function cg(t,n){for(var r=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0S)break;var I=A.transferSize,te=A.initiatorType;I&&xg(te)&&(A=A.responseEnd,y+=I*(A"u"?null:document;function Mg(t,n,r){var o=Yi;if(o&&typeof n=="string"&&n){var f=rn(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof r=="string"&&(f+='[crossorigin="'+r+'"]'),Ng.has(f)||(Ng.add(f),t={rel:t,crossOrigin:r,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),Yt(n,"link",t),Xe(n),o.head.appendChild(n)))}}function HS(t){qa.D(t),Mg("dns-prefetch",t,null)}function $S(t,n){qa.C(t,n),Mg("preconnect",t,n)}function ZS(t,n,r){qa.L(t,n,r);var o=Yi;if(o&&t&&n){var f='link[rel="preload"][as="'+rn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(f+='[imagesrcset="'+rn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(f+='[imagesizes="'+rn(r.imageSizes)+'"]')):f+='[href="'+rn(t)+'"]';var h=f;switch(n){case"style":h=Gi(t);break;case"script":h=Ki(t)}qn.has(h)||(t=g({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:t,as:n},r),qn.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(to(h))||n==="script"&&o.querySelector(no(h))||(n=o.createElement("link"),Yt(n,"link",t),Xe(n),o.head.appendChild(n)))}}function qS(t,n){qa.m(t,n);var r=Yi;if(r&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+rn(o)+'"][href="'+rn(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ki(t)}if(!qn.has(h)&&(t=g({rel:"modulepreload",href:t},n),qn.set(h,t),r.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(no(h)))return}o=r.createElement("link"),Yt(o,"link",t),Xe(o),r.head.appendChild(o)}}}function PS(t,n,r){qa.S(t,n,r);var o=Yi;if(o&&t){var f=At(o).hoistableStyles,h=Gi(t);n=n||"default";var y=f.get(h);if(!y){var S={loading:0,preload:null};if(y=o.querySelector(to(h)))S.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":n},r),(r=qn.get(h))&&cd(t,r);var A=y=o.createElement("link");Xe(A),Yt(A,"link",t),A._p=new Promise(function($,I){A.onload=$,A.onerror=I}),A.addEventListener("load",functio)DELIM" +R"DELIM(n(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Ws(y,n,o)}y={type:"stylesheet",instance:y,count:1,state:S},f.set(h,y)}}}function QS(t,n){qa.X(t,n);var r=Yi;if(r&&t){var o=At(r).hoistableScripts,f=Ki(t),h=o.get(f);h||(h=r.querySelector(no(f)),h||(t=g({src:t,async:!0},n),(n=qn.get(f))&&fd(t,n),h=r.createElement("script"),Xe(h),Yt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function FS(t,n){qa.M(t,n);var r=Yi;if(r&&t){var o=At(r).hoistableScripts,f=Ki(t),h=o.get(f);h||(h=r.querySelector(no(f)),h||(t=g({src:t,async:!0,type:"module"},n),(n=qn.get(f))&&fd(t,n),h=r.createElement("script"),Xe(h),Yt(h,"link",t),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Og(t,n,r,o){var f=(f=Te.current)?Js(f):null;if(!f)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Gi(r.href),r=At(f).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Gi(r.href);var h=At(f).hoistableStyles,y=h.get(t);if(y||(f=f.ownerDocument||f,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,y),(h=f.querySelector(to(t)))&&!h._p&&(y.instance=h,y.state.loading=5),qn.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},qn.set(t,r),h||YS(f,t,r,y.state))),n&&o===null)throw Error(l(528,""));return y}if(n&&o!==null)throw Error(l(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ki(r),r=At(f).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function Gi(t){return'href="'+rn(t)+'"'}function to(t){return'link[rel="stylesheet"]['+t+"]"}function kg(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function YS(t,n,r,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Yt(n,"link",r),Xe(n),t.head.appendChild(n))}function Ki(t){return'[src="'+rn(t)+'"]'}function no(t){return"script[async]"+t}function Dg(t,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+rn(r.href)+'"]');if(o)return n.instance=o,Xe(o),o;var f=g({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Xe(o),Yt(o,"style",f),Ws(o,r.precedence,t),n.instance=o;case"stylesheet":f=Gi(r.href);var h=t.querySelector(to(f));if(h)return n.state.loading|=4,n.instance=h,Xe(h),h;o=kg(r),(f=qn.get(f))&&cd(o,f),h=(t.ownerDocument||t).createElement("link"),Xe(h);var y=h;return y._p=new Promise(function(S,A){y.onload=S,y.onerror=A}),Yt(h,"link",o),n.state.loading|=4,Ws(h,r.precedence,t),n.instance=h;case"script":return h=Ki(r.src),(f=t.querySelector(no(h)))?(n.instance=f,Xe(f),f):(o=r,(f=qn.get(h))&&(o=g({},r),fd(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Xe(f),Yt(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Ws(o,r.precedence,t));return n.instance}function Ws(t,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,y=0;y title"):null)}function GS(t,n,r){if(r===1||n.itemProp!=null)return!1;switch(t){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"?(t=n.disabled,typeof n.precedence=="string"&&t==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 Ug(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function KS(t,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var f=Gi(o.href),h=n.querySelector(to(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=tu.bind(t),n.then(t,t)),r.state.loading|=4,r.instance=h,Xe(h);return}h=n.ownerDocument||n,o=kg(o),(f=qn.get(f))&&cd(o,f),h=h.createElement("link"),Xe(h);var y=h;y._p=new Promise(function(S,A){y.onload=S,y.onerror=A}),Yt(h,"link",o),r.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(t.count++,r=tu.bind(t),n.addEventListener("load",r),n.addEventListener("error",r))}}var dd=0;function VS(t,n){return t.stylesheets&&t.count===0&&au(t,t.stylesheets),0dd?50:800)+n);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function tu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)au(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var nu=null;function au(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,nu=new Map,n.forEach(XS,t),nu=null,tu.call(t))}function XS(t,n){if(!(n.state.loading&4)){var r=nu.get(t);if(r)var o=r.get(null);else{r=new Map,nu.set(t,r);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Sd.exports=hw(),Sd.exports}var pw=mw();const yw=Sh(pw);var Ho=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(){}},gw=class extends Ho{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e();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(e){this.#n=e,this.#t?.(),this.#t=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},_h=new gw,vw={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},bw=class{#e=vw;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,a){return this.#e.setTimeout(e,a)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,a){return this.#e.setInterval(e,a)}clearInterval(e){this.#e.clearInterval(e)}},ai=new bw;function xw(e){setTimeout(e,0)}var Sw=typeof window>"u"||"Deno"in globalThis;function gn(){}function ww(e,a){return typeof e=="function"?e(a):e}function Wd(e){return typeof e=="number"&&e>=0&&e!==1/0}function G0(e,a){return Math.max(e+(a||0)-Date.now(),0)}function jr(e,a){return typeof e=="function"?e(a):e}function zn(e,a){return typeof e=="function"?e(a):e}function sv(e,a){const{type:i="all",exact:l,fetchStatus:s,predicate:u,queryKey:c,stale:d}=e;if(c){if(l){if(a.queryHash!==Eh(c,a.options))return!1}else if(!Ao(a.queryKey,c))return!1}if(i!=="all"){const m=a.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof d=="boolean"&&a.isStale()!==d||s&&s!==a.state.fetchStatus||u&&!u(a))}function uv(e,a){const{exact:i,status:l,predicate:s,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(Ro(a.options.mutationKey)!==Ro(u))return!1}else if(!Ao(a.options.mutationKey,u))return!1}return!(l&&a.state.status!==l||s&&!s(a))}function Eh(e,a){return(a?.queryKeyHashFn||Ro)(e)}function Ro(e){return JSON.stringify(e,(a,i)=>th(i)?Object.keys(i).sort().reduce((l,s)=>(l[s]=i[s],l),{}):i)}function Ao(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>Ao(e[i],a[i])):!1}var _w=Object.prototype.hasOwnProperty;function K0(e,a,i=0){if(e===a)return e;if(i>500)return a;const l=cv(e)&&cv(a);if(!l&&!(th(e)&&th(a)))return a;const u=(l?e:Object.keys(e)).length,c=l?a:Object.keys(a),d=c.length,m=l?new Array(d):{};let p=0;for(let b=0;b{ai.setTimeout(a,e)})}function nh(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?K0(e,a):a}function Tw(e,a,i=0){const l=[...e,a];return i&&l.length>i?l.slice(1):l}function Rw(e,a,i=0){const l=[a,...e];return i&&l.length>i?l.slice(0,-1):l}var Th=Symbol();function V0(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Th?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function X0(e,a){return typeof e=="function"?e(...a):!!e}function Aw(e,a,i){let l=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=a(),l||(l=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),e}var zo=(()=>{let e=()=>Sw;return{isServer(){return e()},setIsServer(a){e=a}}})();function ah(){let e,a;const i=new Promise((s,u)=>{e=s,a=u});i.status="pending",i.catch(()=>{});function l(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{l({status:"fulfilled",value:s}),e(s)},i.reject=s=>{l({status:"rejected",reason:s}),a(s)},i}var zw=xw;function Cw(){let e=[],a=0,i=d=>{d()},l=d=>{d()},s=zw;const u=d=>{a?e.push(d):s(()=>{i(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{l(()=>{d.forEach(m=>{i(m)})})})};return{batch:d=>{let m;a++;try{m=d()}finally{a--,a||c()}return m},batchCalls:d=>(...m)=>{u(()=>{d(...m)})},schedule:u,setNotifyFunction:d=>{i=d},setBatchNotifyFunction:d=>{l=d},setScheduler:d=>{s=d}}}var Kt=Cw(),jw=class extends Ho{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const a=()=>e(!0),i=()=>e(!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)}setEv)DELIM" +R"DELIM(entListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},Bu=new jw;function Nw(e){return Math.min(1e3*2**e,3e4)}function I0(e){return(e??"online")==="online"?Bu.isOnline():!0}var rh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function J0(e){let a=!1,i=0,l;const s=ah(),u=()=>s.status!=="pending",c=R=>{if(!u()){const N=new rh(R);x(N),e.onCancel?.(N)}},d=()=>{a=!0},m=()=>{a=!1},p=()=>_h.isFocused()&&(e.networkMode==="always"||Bu.isOnline())&&e.canRun(),b=()=>I0(e.networkMode)&&e.canRun(),g=R=>{u()||(l?.(),s.resolve(R))},x=R=>{u()||(l?.(),s.reject(R))},w=()=>new Promise(R=>{l=N=>{(u()||p())&&R(N)},e.onPause?.()}).then(()=>{l=void 0,u()||e.onContinue?.()}),E=()=>{if(u())return;let R;const N=i===0?e.initialPromise:void 0;try{R=N??e.fn()}catch(F){R=Promise.reject(F)}Promise.resolve(R).then(g).catch(F=>{if(u())return;const V=e.retry??(zo.isServer()?0:3),J=e.retryDelay??Nw,ue=typeof J=="function"?J(i,F):J,ae=V===!0||typeof V=="number"&&ip()?void 0:w()).then(()=>{a?x(F):E()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(l?.(),s),cancelRetry:d,continueRetry:m,canStart:b,start:()=>(b()?E():w().then(E),s)}}var W0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wd(this.gcTime)&&(this.#e=ai.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(zo.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(ai.clearTimeout(this.#e),this.#e=void 0)}};function Mw(e){return{onFetch:(a,i)=>{const l=a.options,s=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],c=a.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const p=async()=>{let b=!1;const g=E=>{Aw(E,()=>a.signal,()=>b=!0)},x=V0(a.options,a.fetchOptions),w=async(E,R,N)=>{if(b)return Promise.reject(a.signal.reason);if(R==null&&E.pages.length)return Promise.resolve(E);const V=(()=>{const xe={client:a.client,queryKey:a.queryKey,pageParam:R,direction:N?"backward":"forward",meta:a.options.meta};return g(xe),xe})(),J=await x(V),{maxPages:ue}=a.options,ae=N?Rw:Tw;return{pages:ae(E.pages,J,ue),pageParams:ae(E.pageParams,R,ue)}};if(s&&u.length){const E=s==="backward",R=E?Ow:dv,N={pages:u,pageParams:c},F=R(l,N);d=await w(N,F,E)}else{const E=e??u.length;do{const R=m===0?c[0]??l.initialPageParam:dv(l,d);if(m>0&&R==null)break;d=await w(d,R),m++}while(ma.options.persister?.(p,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=p}}}function dv(e,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?e.getNextPageParam(a[l],a,i[l],i):void 0}function Ow(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var kw=class extends W0{#e;#t;#n;#a;#i;#r;#o;#l;constructor(e){super(),this.#l=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#a=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=mv(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=mv(this.options);a.data!==void 0&&(this.setState(hv(a.data,a.dataUpdatedAt)),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,a){const i=nh(this.state.data,e,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e){this.#s({type:"setState",state:e})}cancel(e){const a=this.#r?.promise;return this.#r?.cancel(e),a?a.then(gn).catch(gn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>zn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Th||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>jr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!G0(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#r&&(this.#l||this.#c()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const i=new AbortController,l=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},s=()=>{const m=V0(this.options,a),b=(()=>{const g={client:this.#i,queryKey:this.queryKey,meta:this.meta};return l(g),g})();return this.#l=!1,this.options.persister?this.options.persister(m,b,this):m(b)},c=(()=>{const m={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return l(m),m})();(this.#e==="infinite"?Mw(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#s({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=J0({initialPromise:a?.initialPromise,fn:c.fetchFn,onCancel:m=>{m instanceof rh&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),i.abort()},onFail:(m,p)=>{this.#s({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const m=await this.#r.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#a.config.onSuccess?.(m,this),this.#a.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof rh){if(m.silent)return this.#r.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#s({type:"error",error:m}),this.#a.config.onError?.(m,this),this.#a.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#s(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...eb(i.data,this.options),fetchMeta:e.meta??null};case"success":const l={...i,...hv(e.data,e.dataUpdatedAt),dataUpdat)DELIM" +R"DELIM(eCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?l:void 0,l;case"error":const s=e.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),Kt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function eb(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I0(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function hv(e,a){return{data:e,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mv(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,l=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Dw=class extends Ho{constructor(e,a){super(),this.options=a,this.#e=e,this.#l=null,this.#o=ah(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#a=void 0;#i;#r;#o;#l;#c;#s;#m;#f;#d;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),pv(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ih(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ih(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const a=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),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.#w(),this.#t.setOptions(this.options),a._defaulted&&!eh(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&yv(this.#t,i,this.options,a)&&this.#h(),this.updateResult(),l&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||jr(this.options.staleTime,this.#t)!==jr(a.staleTime,this.#t))&&this.#y();const s=this.#g();l&&(this.#t!==i||zn(this.options.enabled,this.#t)!==zn(a.enabled,this.#t)||s!==this.#u)&&this.#v(s)}getOptimisticResult(e){const a=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(a,e);return Bw(this,i)&&(this.#a=i,this.#r=this.options,this.#i=this.#t.state),i}getCurrentResult(){return this.#a}trackResult(e,a){return new Proxy(e,{get:(i,l)=>(this.trackProp(l),a?.(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,l))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#h(e){this.#w();let a=this.#t.fetch(this.options,e);return e?.throwOnError||(a=a.catch(gn)),a}#y(){this.#x();const e=jr(this.options.staleTime,this.#t);if(zo.isServer()||this.#a.isStale||!Wd(e))return;const i=G0(this.#a.dataUpdatedAt,e)+1;this.#f=ai.setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#u=e,!(zo.isServer()||zn(this.options.enabled,this.#t)===!1||!Wd(this.#u)||this.#u===0)&&(this.#d=ai.setInterval(()=>{(this.options.refetchIntervalInBackground||_h.isFocused())&&this.#h()},this.#u))}#b(){this.#y(),this.#v(this.#g())}#x(){this.#f!==void 0&&(ai.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#d!==void 0&&(ai.clearInterval(this.#d),this.#d=void 0)}createResult(e,a){const i=this.#t,l=this.options,s=this.#a,u=this.#i,c=this.#r,m=e!==i?e.state:this.#n,{state:p}=e;let b={...p},g=!1,x;if(a._optimisticResults){const _=this.hasListeners(),D=!_&&pv(e,a),B=_&&yv(e,i,a,l);(D||B)&&(b={...b,...eb(p.data,e.options)}),a._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:E,status:R}=b;x=b.data;let N=!1;if(a.placeholderData!==void 0&&x===void 0&&R==="pending"){let _;s?.isPlaceholderData&&a.placeholderData===c?.placeholderData?(_=s.data,N=!0):_=typeof a.placeholderData=="function"?a.placeholderData(this.#m?.state.data,this.#m):a.placeholderData,_!==void 0&&(R="success",x=nh(s?.data,_,a),g=!0)}if(a.select&&x!==void 0&&!N)if(s&&x===u?.data&&a.select===this.#c)x=this.#s;else try{this.#c=a.select,x=a.select(x),x=nh(s?.data,x,a),this.#s=x,this.#l=null}catch(_){this.#l=_}this.#l&&(w=this.#l,x=this.#s,E=Date.now(),R="error");const F=b.fetchStatus==="fetching",V=R==="pending",J=R==="error",ue=V&&F,ae=x!==void 0,j={status:R,fetchStatus:b.fetchStatus,isPending:V,isSuccess:R==="success",isError:J,isInitialLoading:ue,isLoading:ue,data:x,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:E,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>m.dataUpdateCount||b.errorUpdateCount>m.errorUpdateCount,isFetching:F,isRefetching:F&&!V,isLoadingError:J&&!ae,isPaused:b.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:J&&ae,isStale:Rh(e,a),refetch:this.refetch,promise:this.#o,isEnabled:zn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const _=j.data!==void 0,D=j.status==="error"&&!_,B=G=>{D?G.reject(j.error):_&&G.resolve(j.data)},Q=()=>{const G=this.#o=j.promise=ah();B(G)},q=this.#o;switch(q.status){case"pending":e.queryHash===i.queryHash&&B(q);break;case"fulfilled":(D||j.data!==q.value)&&Q();break;case"rejected":(!D||j.error!==q.reason)&&Q();break}}return j}updateResult(){const e=this.#a,a=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#r=this.options,this.#i.data!==void 0&&(this.#m=this.#t),eh(a,e))return;this.#a=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,s=typeof l=="function"?l():l;if(s==="all"||!s&&!this.#p.size)return!0;const u=new Set(s??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#a).some(c=>{const d=c;return this.#a[d]!==e[d]&&u.has(d)})};this.#_({listeners:i()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const a=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Kt.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Lw(e,a){return zn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&zn(a.retryOnMount,e)===!1)}function pv(e,a){return Lw(e,a)||e.state.data!==void 0&&ih(e,a,a.refetchOnMount)}function ih(e,a,i){if(zn(a.enabled,e)!==!1&&jr(a.staleTime,e)!=="static"){const l=typeof i=="function"?i(e):i;return l==="always"||l!==!1&&Rh(e,a)}return!1}function yv(e,a,i,l){return(e!==a||zn(l.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Rh(e,i)}function Rh(e,a){return zn(a.enabled,e)!==!1&&e.isStale)DELIM" +R"DELIM(ByTime(jr(a.staleTime,e))}function Bw(e,a){return!eh(e.getCurrentResult(),a)}var Uw=class extends W0{#e;#t;#n;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Hw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#i({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=J0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,c)=>{this.#i({type:"failed",failureCount:u,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const l=this.state.status==="pending",s=!this.#a.canStart();try{if(l)a();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const c=await this.options.onMutate?.(e,i);c!==this.state.context&&this.#i({type:"pending",context:c,variables:e,isPaused:s})}const u=await this.#a.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#i({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onError?.(u,e,this.state.context,i)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,i)}catch(c){Promise.reject(c)}throw this.#i({type:"error",error:u}),u}finally{this.#n.runNext(this)}}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Kt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Hw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $w=class extends Ho{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,a,i){const l=new Uw({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(l),l}add(e){this.#e.add(e);const a=fu(e);if(typeof a=="string"){const i=this.#t.get(a);i?i.push(e):this.#t.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const a=fu(e);if(typeof a=="string"){const i=this.#t.get(a);if(i)if(i.length>1){const l=i.indexOf(e);l!==-1&&i.splice(l,1)}else i[0]===e&&this.#t.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=fu(e);if(typeof a=="string"){const l=this.#t.get(a)?.find(s=>s.state.status==="pending");return!l||l===e}else return!0}runNext(e){const a=fu(e);return typeof a=="string"?this.#t.get(a)?.find(l=>l!==e&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Kt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>uv(a,i))}findAll(e={}){return this.getAll().filter(a=>uv(e,a))}notify(e){Kt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return Kt.batch(()=>Promise.all(e.map(a=>a.continue().catch(gn))))}};function fu(e){return e.options.scope?.id}var Zw=class extends Ho{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,a,i){const l=a.queryKey,s=a.queryHash??Eh(l,a);let u=this.get(s);return u||(u=new kw({client:e,queryKey:l,queryHash:s,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(l)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#e.get(e.queryHash);a&&(e.destroy(),a===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Kt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>sv(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>sv(e,i)):a}notify(e){Kt.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){Kt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Kt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qw=class{#e;#t;#n;#a;#i;#r;#o;#l;constructor(e={}){this.#e=e.queryCache||new Zw,this.#t=e.mutationCache||new $w,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=_h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=Bu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#e.build(this,a),l=i.state.data;return l===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(jr(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(e,a,i){const l=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(l.queryHash)?.state.data,c=ww(a,u);if(c!==void 0)return this.#e.build(this,l).setData(c,{...i,manual:!0})}setQueriesData(e,a,i){return Kt.batch(()=>this.#e.findAll(e).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#e.get(a.queryHash)?.state}removeQueries(e){const a=this.#e;Kt.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#e;return Kt.batch(()=>(i.findAll(e).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},l=Kt.batch(()=>this.#e.findAll(e).map(s=>s.cancel(i)));return Promise.all(l).then(gn).catch(gn)}invalidateQueries(e,a={}){return Kt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=Kt.)DELIM" +R"DELIM(batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let u=s.fetch(void 0,i);return i.throwOnError||(u=u.catch(gn)),s.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(l).then(gn)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#e.build(this,a);return i.isStaleByTime(jr(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(gn).catch(gn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(gn).catch(gn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Bu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#a.set(Ro(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(l=>{Ao(e,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(e,a){this.#i.set(Ro(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#i.values()],i={};return a.forEach(l=>{Ao(e,l.mutationKey)&&Object.assign(i,l.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Eh(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===Th&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},tb=T.createContext(void 0),Iu=e=>{const a=T.useContext(tb);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},Pw=({client:e,children:a})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(tb.Provider,{value:e,children:a})),nb=T.createContext(!1),Qw=()=>T.useContext(nb);nb.Provider;function Fw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Yw=T.createContext(Fw()),Gw=()=>T.useContext(Yw),Kw=(e,a,i)=>{const l=i?.state.error&&typeof e.throwOnError=="function"?X0(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||l)&&(a.isReset()||(e.retryOnMount=!1))},Vw=e=>{T.useEffect(()=>{e.clearReset()},[e])},Xw=({result:e,errorResetBoundary:a,throwOnError:i,query:l,suspense:s})=>e.isError&&!a.isReset()&&!e.isFetching&&l&&(s&&e.data===void 0||X0(i,[e.error,l])),Iw=e=>{if(e.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),l=e.staleTime;e.staleTime=typeof l=="function"?(...s)=>i(l(...s)):i(l),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Jw=(e,a)=>e.isLoading&&e.isFetching&&!a,Ww=(e,a)=>e?.suspense&&a.isPending,gv=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function e_(e,a,i){const l=Qw(),s=Gw(),u=Iu(),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const d=u.getQueryCache().get(c.queryHash),m=e.subscribed!==!1;c._optimisticResults=l?"isRestoring":m?"optimistic":void 0,Iw(c),Kw(c,s,d),Vw(s);const p=!u.getQueryCache().get(c.queryHash),[b]=T.useState(()=>new a(u,c)),g=b.getOptimisticResult(c),x=!l&&m;if(T.useSyncExternalStore(T.useCallback(w=>{const E=x?b.subscribe(Kt.batchCalls(w)):gn;return b.updateResult(),E},[b,x]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),T.useEffect(()=>{b.setOptions(c)},[c,b]),Ww(c,g))throw gv(c,b,s);if(Xw({result:g,errorResetBoundary:s,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw g.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(c,g),c.experimental_prefetchInRender&&!zo.isServer()&&Jw(g,l)&&(p?gv(c,b,s):d?.promise)?.catch(gn).finally(()=>{b.updateResult()}),c.notifyOnChangeProps?g:b.trackResult(g)}function t_(e,a){return e_(e,Dw)}var vv;function ne(e,a,i){function l(d,m){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),a(d,m);const p=c.prototype,b=Object.keys(p);for(let g=0;gi?.Parent&&d instanceof i.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class ll extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ab extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}(vv=globalThis).__zod_globalConfig??(vv.__zod_globalConfig={});const Ah=globalThis.__zod_globalConfig;function li(e){return Ah}function rb(e){const a=Object.values(e).filter(l=>typeof l=="number");return Object.entries(e).filter(([l,s])=>a.indexOf(+l)===-1).map(([l,s])=>s)}function lh(e,a){return typeof a=="bigint"?a.toString():a}function zh(e){return{get value(){{const a=e();return Object.defineProperty(this,"value",{value:a}),a}}}}function Ch(e){return e==null}function jh(e){const a=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(a,i)}function n_(e,a){const i=e/a,l=Math.round(i),s=Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-l){};function Uu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const r_=zh(()=>{if(Ah.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Co(e){if(Uu(e)===!1)return!1;const a=e.constructor;if(a===void 0||typeof a!="function")return!0;const i=a.prototype;return!(Uu(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function lb(e){return Co(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const i_=new Set(["string","number","symbol"]);function Ju(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Or(e,a,i){const l=new e._zod.constr(a??e._zod.def);return(!a||i?.parent)&&(l._zod.parent=e),l}function Ce(e){const a=e;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 l_(e){return Object.keys(e).filter(a=>e[a]._zod.optin==="optional"&&e[a]._zod.optout==="optional")}const o_={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 s_(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".pick() cannot be)DELIM" +R"DELIM( used on object schemas containing refinements");const u=Mr(e._zod.def,{get shape(){const c={};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&(c[d]=i.shape[d])}return ui(this,"shape",c),c},checks:[]});return Or(e,u)}function u_(e,a){const i=e._zod.def,l=i.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=Mr(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const d in a){if(!(d in i.shape))throw new Error(`Unrecognized key: "${d}"`);a[d]&&delete c[d]}return ui(this,"shape",c),c},checks:[]});return Or(e,u)}function c_(e,a){if(!Co(a))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const u=e._zod.def.shape;for(const c in a)if(Object.getOwnPropertyDescriptor(u,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Mr(e._zod.def,{get shape(){const u={...e._zod.def.shape,...a};return ui(this,"shape",u),u}});return Or(e,s)}function f_(e,a){if(!Co(a))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Mr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a};return ui(this,"shape",l),l}});return Or(e,i)}function d_(e,a){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const i=Mr(e._zod.def,{get shape(){const l={...e._zod.def.shape,...a._zod.def.shape};return ui(this,"shape",l),l},get catchall(){return a._zod.def.catchall},checks:a._zod.def.checks??[]});return Or(e,i)}function h_(e,a,i){const s=a._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Mr(a._zod.def,{get shape(){const d=a._zod.def.shape,m={...d};if(i)for(const p in i){if(!(p in d))throw new Error(`Unrecognized key: "${p}"`);i[p]&&(m[p]=e?new e({type:"optional",innerType:d[p]}):d[p])}else for(const p in d)m[p]=e?new e({type:"optional",innerType:d[p]}):d[p];return ui(this,"shape",m),m},checks:[]});return Or(a,c)}function m_(e,a,i){const l=Mr(a._zod.def,{get shape(){const s=a._zod.def.shape,u={...s};if(i)for(const c in i){if(!(c in u))throw new Error(`Unrecognized key: "${c}"`);i[c]&&(u[c]=new e({type:"nonoptional",innerType:s[c]}))}else for(const c in s)u[c]=new e({type:"nonoptional",innerType:s[c]});return ui(this,"shape",u),u}});return Or(a,l)}function al(e,a=0){if(e.aborted===!0)return!0;for(let i=a;i{var l;return(l=i).path??(l.path=[]),i.path.unshift(e),i})}function du(e){return typeof e=="string"?e:e?.message}function oi(e,a,i){const l=e.message?e.message:du(e.inst?._zod.def?.error?.(e))??du(a?.error?.(e))??du(i.customError?.(e))??du(i.localeError?.(e))??"Invalid input",{inst:s,continue:u,input:c,...d}=e;return d.path??(d.path=[]),d.message=l,a?.reportInput&&(d.input=c),d}function Nh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function jo(...e){const[a,i,l]=e;return typeof a=="string"?{message:a,code:"custom",input:i,inst:l}:{...a}}const sb=(e,a)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:a,enumerable:!1}),e.message=JSON.stringify(a,lh,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ub=ne("$ZodError",sb),cb=ne("$ZodError",sb,{Parent:Error});function y_(e,a=i=>i.message){const i={},l=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(a(s))):l.push(a(s));return{formErrors:l,fieldErrors:i}}function g_(e,a=i=>i.message){const i={_errors:[]},l=(s,u=[])=>{for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>l({issues:d},[...u,...c.path]));else if(c.code==="invalid_key")l({issues:c.issues},[...u,...c.path]);else if(c.code==="invalid_element")l({issues:c.issues},[...u,...c.path]);else{const d=[...u,...c.path];if(d.length===0)i._errors.push(a(c));else{let m=i,p=0;for(;p(a,i,l,s)=>{const u=l?{...l,async:!1}:{async:!1},c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise)throw new ll;if(c.issues.length){const d=new(s?.Err??e)(c.issues.map(m=>oi(m,u,li())));throw ib(d,s?.callee),d}return c.value},Oh=e=>async(a,i,l,s)=>{const u=l?{...l,async:!0}:{async:!0};let c=a._zod.run({value:i,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new(s?.Err??e)(c.issues.map(m=>oi(m,u,li())));throw ib(d,s?.callee),d}return c.value},Wu=e=>(a,i,l)=>{const s=l?{...l,async:!1}:{async:!1},u=a._zod.run({value:i,issues:[]},s);if(u instanceof Promise)throw new ll;return u.issues.length?{success:!1,error:new(e??ub)(u.issues.map(c=>oi(c,s,li())))}:{success:!0,data:u.value}},v_=Wu(cb),ec=e=>async(a,i,l)=>{const s=l?{...l,async:!0}:{async:!0};let u=a._zod.run({value:i,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>oi(c,s,li())))}:{success:!0,data:u.value}},b_=ec(cb),x_=e=>(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Mh(e)(a,i,s)},S_=e=>(a,i,l)=>Mh(e)(a,i,l),w_=e=>async(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Oh(e)(a,i,s)},__=e=>async(a,i,l)=>Oh(e)(a,i,l),E_=e=>(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return Wu(e)(a,i,s)},T_=e=>(a,i,l)=>Wu(e)(a,i,l),R_=e=>async(a,i,l)=>{const s=l?{...l,direction:"backward"}:{direction:"backward"};return ec(e)(a,i,s)},A_=e=>async(a,i,l)=>ec(e)(a,i,l),z_=/^[cC][0-9a-z]{6,}$/,C_=/^[0-9a-z]+$/,j_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,N_=/^[0-9a-vA-V]{20}$/,M_=/^[A-Za-z0-9]{27}$/,O_=/^[a-zA-Z0-9_-]{21}$/,k_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,D_=/^([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})$/,Sv=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[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)$/,L_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,B_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function U_(){return new RegExp(B_,"u")}const H_=/^(?:(?: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-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}|:))$/,Z_=/^((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])$/,q_=/^(([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])$/,P_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fb=/^[A-Za-z0-9_-]*$/,Q_=/^https?$/,F_=/^\+[1-9]\d{6,14}$/,db="(?:(?:\\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])))",Y_=new RegExp(`^${db}$`);function hb(e){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="n)DELIM" +R"DELIM(umber"?e.precision===-1?`${a}`:e.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${e.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function G_(e){return new RegExp(`^${hb(e)}$`)}function K_(e){const a=hb({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const l=`${a}(?:${i.join("|")})`;return new RegExp(`^${db}T(?:${l})$`)}const V_=e=>{const a=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},X_=/^-?\d+$/,I_=/^-?\d+(?:\.\d+)?$/,J_=/^(?:true|false)$/i,W_=/^[^A-Z]*$/,e2=/^[^a-z]*$/,vn=ne("$ZodCheck",(e,a)=>{var i;e._zod??(e._zod={}),e._zod.def=a,(i=e._zod).onattach??(i.onattach=[])}),mb={number:"number",bigint:"bigint",object:"date"},pb=ne("$ZodCheckLessThan",(e,a)=>{vn.init(e,a);const i=mb[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?l.value<=a.value:l.value{vn.init(e,a);const i=mb[typeof a.value];e._zod.onattach.push(l=>{const s=l._zod.bag,u=(a.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>u&&(a.inclusive?s.minimum=a.value:s.exclusiveMinimum=a.value)}),e._zod.check=l=>{(a.inclusive?l.value>=a.value:l.value>a.value)||l.issues.push({origin:i,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:l.value,inclusive:a.inclusive,inst:e,continue:!a.abort})}}),t2=ne("$ZodCheckMultipleOf",(e,a)=>{vn.init(e,a),e._zod.onattach.push(i=>{var l;(l=i._zod.bag).multipleOf??(l.multipleOf=a.value)}),e._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):n_(i.value,a.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:a.value,input:i.value,inst:e,continue:!a.abort})}}),n2=ne("$ZodCheckNumberFormat",(e,a)=>{vn.init(e,a),a.format=a.format||"float64";const i=a.format?.includes("int"),l=i?"int":"number",[s,u]=o_[a.format];e._zod.onattach.push(c=>{const d=c._zod.bag;d.format=a.format,d.minimum=s,d.maximum=u,i&&(d.pattern=X_)}),e._zod.check=c=>{const d=c.value;if(i){if(!Number.isInteger(d)){c.issues.push({expected:l,format:a.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:l,inclusive:!0,continue:!a.abort});return}}du&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!a.abort})}}),a2=ne("$ZodCheckMaxLength",(e,a)=>{var i;vn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Ch(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const s=l.value;if(s.length<=a.maximum)return;const c=Nh(s);l.issues.push({origin:c,code:"too_big",maximum:a.maximum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),r2=ne("$ZodCheckMinLength",(e,a)=>{var i;vn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Ch(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>s&&(l._zod.bag.minimum=a.minimum)}),e._zod.check=l=>{const s=l.value;if(s.length>=a.minimum)return;const c=Nh(s);l.issues.push({origin:c,code:"too_small",minimum:a.minimum,inclusive:!0,input:s,inst:e,continue:!a.abort})}}),i2=ne("$ZodCheckLengthEquals",(e,a)=>{var i;vn.init(e,a),(i=e._zod.def).when??(i.when=l=>{const s=l.value;return!Ch(s)&&s.length!==void 0}),e._zod.onattach.push(l=>{const s=l._zod.bag;s.minimum=a.length,s.maximum=a.length,s.length=a.length}),e._zod.check=l=>{const s=l.value,u=s.length;if(u===a.length)return;const c=Nh(s),d=u>a.length;l.issues.push({origin:c,...d?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:l.value,inst:e,continue:!a.abort})}}),tc=ne("$ZodCheckStringFormat",(e,a)=>{var i,l;vn.init(e,a),e._zod.onattach.push(s=>{const u=s._zod.bag;u.format=a.format,a.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(a.pattern))}),a.pattern?(i=e._zod).check??(i.check=s=>{a.pattern.lastIndex=0,!a.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:a.format,input:s.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:e,continue:!a.abort})}):(l=e._zod).check??(l.check=()=>{})}),l2=ne("$ZodCheckRegex",(e,a)=>{tc.init(e,a),e._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:e,continue:!a.abort})}}),o2=ne("$ZodCheckLowerCase",(e,a)=>{a.pattern??(a.pattern=W_),tc.init(e,a)}),s2=ne("$ZodCheckUpperCase",(e,a)=>{a.pattern??(a.pattern=e2),tc.init(e,a)}),u2=ne("$ZodCheckIncludes",(e,a)=>{vn.init(e,a);const i=Ju(a.includes),l=new RegExp(typeof a.position=="number"?`^.{${a.position}}${i}`:i);a.pattern=l,e._zod.onattach.push(s=>{const u=s._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(l)}),e._zod.check=s=>{s.value.includes(a.includes,a.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:s.value,inst:e,continue:!a.abort})}}),c2=ne("$ZodCheckStartsWith",(e,a)=>{vn.init(e,a);const i=new RegExp(`^${Ju(a.prefix)}.*`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.startsWith(a.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:l.value,inst:e,continue:!a.abort})}}),f2=ne("$ZodCheckEndsWith",(e,a)=>{vn.init(e,a);const i=new RegExp(`.*${Ju(a.suffix)}$`);a.pattern??(a.pattern=i),e._zod.onattach.push(l=>{const s=l._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=l=>{l.value.endsWith(a.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:l.value,inst:e,continue:!a.abort})}}),d2=ne("$ZodCheckOverwrite",(e,a)=>{vn.init(e,a),e._zod.check=i=>{i.value=a.tx(i.value)}});class h2{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 l=a.split(` +`).filter(c=>c),s=Math.min(...l.map(c=>c.length-c.trimStart().length)),u=l.map(c=>c.slice(s)).map(c=>" ".repeat(this.indent*2)+c);for(const c of u)this.content.push(c)}compile(){const a=Function,i=this?.args,s=[...(this?.content??[""]).map(u=>` ${u}`)];return new a(...i,s.join(` +`))}}const m2={major:4,minor:4,patch:3},Nt=ne("$ZodType",(e,a)=>{var i;e??(e={}),e._zod.def=a,e._zod.bag=e._zod.bag||{},e._zod.version=m2;const l=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&l.unshift(e);for(const s of l)for(const u of s._zod.onattach)u(e);if(l.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,d,m)=>{let p=al(c),b;for(const g of d){if(g._zod.def.when){if(p_(c)||!g._zod.def.when(c))continue}else if(p)continue;const x=c.issues.length,w=g._zod.check(c);if(w instanceof Promise&&m?.async===!1)throw new ll;if(b||w instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await w,)DELIM" +R"DELIM(c.issues.length!==x&&(p||(p=al(c,x)))});else{if(c.issues.length===x)continue;p||(p=al(c,x))}}return b?b.then(()=>c):c},u=(c,d,m)=>{if(al(c))return c.aborted=!0,c;const p=s(d,l,m);if(p instanceof Promise){if(m.async===!1)throw new ll;return p.then(b=>e._zod.parse(b,m))}return e._zod.parse(p,m)};e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){const p=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(b=>u(b,c,d)):u(p,c,d)}const m=e._zod.parse(c,d);if(m instanceof Promise){if(d.async===!1)throw new ll;return m.then(p=>s(p,l,d))}return s(m,l,d)}}dt(e,"~standard",()=>({validate:s=>{try{const u=v_(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return b_(e,s).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}))}),kh=ne("$ZodString",(e,a)=>{Nt.init(e,a),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??V_(e._zod.bag),e._zod.parse=(i,l)=>{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:e}),i}}),xt=ne("$ZodStringFormat",(e,a)=>{tc.init(e,a),kh.init(e,a)}),p2=ne("$ZodGUID",(e,a)=>{a.pattern??(a.pattern=D_),xt.init(e,a)}),y2=ne("$ZodUUID",(e,a)=>{if(a.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(l===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=Sv(l))}else a.pattern??(a.pattern=Sv());xt.init(e,a)}),g2=ne("$ZodEmail",(e,a)=>{a.pattern??(a.pattern=L_),xt.init(e,a)}),v2=ne("$ZodURL",(e,a)=>{xt.init(e,a),e._zod.check=i=>{try{const l=i.value.trim();if(!a.normalize&&a.protocol?.source===Q_.source&&!/^https?:\/\//i.test(l)){i.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:i.value,inst:e,continue:!a.abort});return}const s=new URL(l);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:i.value,inst:e,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:i.value,inst:e,continue:!a.abort})),a.normalize?i.value=s.href:i.value=l;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!a.abort})}}}),b2=ne("$ZodEmoji",(e,a)=>{a.pattern??(a.pattern=U_()),xt.init(e,a)}),x2=ne("$ZodNanoID",(e,a)=>{a.pattern??(a.pattern=O_),xt.init(e,a)}),S2=ne("$ZodCUID",(e,a)=>{a.pattern??(a.pattern=z_),xt.init(e,a)}),w2=ne("$ZodCUID2",(e,a)=>{a.pattern??(a.pattern=C_),xt.init(e,a)}),_2=ne("$ZodULID",(e,a)=>{a.pattern??(a.pattern=j_),xt.init(e,a)}),E2=ne("$ZodXID",(e,a)=>{a.pattern??(a.pattern=N_),xt.init(e,a)}),T2=ne("$ZodKSUID",(e,a)=>{a.pattern??(a.pattern=M_),xt.init(e,a)}),R2=ne("$ZodISODateTime",(e,a)=>{a.pattern??(a.pattern=K_(a)),xt.init(e,a)}),A2=ne("$ZodISODate",(e,a)=>{a.pattern??(a.pattern=Y_),xt.init(e,a)}),z2=ne("$ZodISOTime",(e,a)=>{a.pattern??(a.pattern=G_(a)),xt.init(e,a)}),C2=ne("$ZodISODuration",(e,a)=>{a.pattern??(a.pattern=k_),xt.init(e,a)}),j2=ne("$ZodIPv4",(e,a)=>{a.pattern??(a.pattern=H_),xt.init(e,a),e._zod.bag.format="ipv4"}),N2=ne("$ZodIPv6",(e,a)=>{a.pattern??(a.pattern=$_),xt.init(e,a),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!a.abort})}}}),M2=ne("$ZodCIDRv4",(e,a)=>{a.pattern??(a.pattern=Z_),xt.init(e,a)}),O2=ne("$ZodCIDRv6",(e,a)=>{a.pattern??(a.pattern=q_),xt.init(e,a),e._zod.check=i=>{const l=i.value.split("/");try{if(l.length!==2)throw new Error;const[s,u]=l;if(!u)throw new Error;const c=Number(u);if(`${c}`!==u)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${s}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!a.abort})}}});function gb(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const k2=ne("$ZodBase64",(e,a)=>{a.pattern??(a.pattern=P_),xt.init(e,a),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{gb(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!a.abort})}});function D2(e){if(!fb.test(e))return!1;const a=e.replace(/[-_]/g,l=>l==="-"?"+":"/"),i=a.padEnd(Math.ceil(a.length/4)*4,"=");return gb(i)}const L2=ne("$ZodBase64URL",(e,a)=>{a.pattern??(a.pattern=fb),xt.init(e,a),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{D2(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!a.abort})}}),B2=ne("$ZodE164",(e,a)=>{a.pattern??(a.pattern=F_),xt.init(e,a)});function U2(e,a=null){try{const i=e.split(".");if(i.length!==3)return!1;const[l]=i;if(!l)return!1;const s=JSON.parse(atob(l));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||a&&(!("alg"in s)||s.alg!==a))}catch{return!1}}const H2=ne("$ZodJWT",(e,a)=>{xt.init(e,a),e._zod.check=i=>{U2(i.value,a.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!a.abort})}}),vb=ne("$ZodNumber",(e,a)=>{Nt.init(e,a),e._zod.pattern=e._zod.bag.pattern??I_,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const u=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...u?{received:u}:{}}),i}}),$2=ne("$ZodNumberFormat",(e,a)=>{n2.init(e,a),vb.init(e,a)}),Z2=ne("$ZodBoolean",(e,a)=>{Nt.init(e,a),e._zod.pattern=J_,e._zod.parse=(i,l)=>{if(a.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),q2=ne("$ZodUnknown",(e,a)=>{Nt.init(e,a),e._zod.parse=i=>i}),P2=ne("$ZodNever",(e,a)=>{Nt.init(e,a),e._zod.parse=(i,l)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function wv(e,a,i){e.issues.length&&a.issues.push(...ob(i,e.issues)),a.value[i]=e.value}const Q2=ne("$ZodArray",(e,a)=>{Nt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const u=[];for(let c=0;cwv(p,i,c))):wv(m,i,c)}return u.length?Promise.all(u).then(()=>i):i}});function Hu(e,a,i,l,s,u){const c=i in l;if(e.issues.length){if(s&&u&&!c)return;a.issues.push(...ob(i,e.issues))}if(!c&&!s){e.issues.length||a.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}e.value===void 0?c&&(a.value[i]=void 0):a.value[i]=e.value}function bb(e){const a=Object.keys(e.shape);for(const l of a)if(!e.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const i=l_(e.shape);return{...e,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(i)}}function xb(e,a,i,l,s,u){const c=[],d=s.keySet,m=s.catchall._zod,p=m.def.type,b=m.optin==="optional",g=m.optout==="optional";for(const x in a){if(x==="__proto__"||d.has(x))continue;if(p==="never"){c.push(x);continue}const w=m.run({value:a[x],issues:[]},l);w instanceof Promise?e.push(w.then(E=>Hu(E,i,x,a,b,g))):Hu(w,i,x,a,b,g)}return c.length&&i.issues.push({code:"unrecognized_keys",keys:c,input:a,inst:u}),e.length?Promise.all(e).then(()=>i):i}const F2=ne("$ZodObject",(e,a)=>{if(Nt.init(e,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const d=a.shape;Object.defineProperty(a,"shape",{get:()=>{const m={...d};return Object.defineProperty(a,"shape",{value:m}),m}})}const l=zh(()=>bb(a));dt(e._zod,"propValues",()=>{const d=a.shape,m={};for(const p in d){const b=d[p]._zo)DELIM" +R"DELIM(d;if(b.values){m[p]??(m[p]=new Set);for(const g of b.values)m[p].add(g)}}return m});const s=Uu,u=a.catchall;let c;e._zod.parse=(d,m)=>{c??(c=l.value);const p=d.value;if(!s(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d;d.value={};const b=[],g=c.shape;for(const x of c.keys){const w=g[x],E=w._zod.optin==="optional",R=w._zod.optout==="optional",N=w._zod.run({value:p[x],issues:[]},m);N instanceof Promise?b.push(N.then(F=>Hu(F,d,x,p,E,R))):Hu(N,d,x,p,E,R)}return u?xb(b,p,d,m,l.value,e):b.length?Promise.all(b).then(()=>d):d}}),Y2=ne("$ZodObjectJIT",(e,a)=>{F2.init(e,a);const i=e._zod.parse,l=zh(()=>bb(a)),s=x=>{const w=new h2(["shape","payload","ctx"]),E=l.value,R=J=>{const ue=xv(J);return`shape[${ue}]._zod.run({ value: input[${ue}], issues: [] }, ctx)`};w.write("const input = payload.value;");const N=Object.create(null);let F=0;for(const J of E.keys)N[J]=`key_${F++}`;w.write("const newResult = {};");for(const J of E.keys){const ue=N[J],ae=xv(J),xe=x[J],j=xe?._zod?.optin==="optional",_=xe?._zod?.optout==="optional";w.write(`const ${ue} = ${R(J)};`),j&&_?w.write(` if (${ue}.issues.length) { if (${ae} in input) { payload.issues = payload.issues.concat(${ue}.issues.map(iss => ({ @@ -123,48 +123,48 @@ R"DELIM(b=m.optin==="optional",g=m.optout==="optional";for(const x in a){if(x=== } } - `)}w.write("payload.value = newResult;"),w.write("return payload;");const V=w.compile();return(J,ue)=>V(x,J,ue)};let u;const c=Uu,d=!Ah.jitless,p=d&&Ww.value,b=a.catchall;let g;e._zod.parse=(x,w)=>{g??(g=l.value);const E=x.value;return c(E)?d&&p&&w?.async===!1&&w.jitless!==!0?(u||(u=s(a.shape)),x=u(x,w),b?vb([],E,x,w,g,e):x):i(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:E,inst:e}),x)}});function Sv(e,a,i,l){for(const u of e)if(u.issues.length===0)return a.value=u.value,a;const s=e.filter(u=>!il(u));return s.length===1?(a.value=s[0].value,s[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:i,errors:e.map(u=>u.issues.map(c=>si(c,l,oi())))}),a)}const q2=ne("$ZodUnion",(e,a)=>{jt.init(e,a),dt(e._zod,"optin",()=>a.options.some(l=>l._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>a.options.some(l=>l._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(a.options.every(l=>l._zod.values))return new Set(a.options.flatMap(l=>Array.from(l._zod.values)))}),dt(e._zod,"pattern",()=>{if(a.options.every(l=>l._zod.pattern)){const l=a.options.map(s=>s._zod.pattern);return new RegExp(`^(${l.map(s=>jh(s.source)).join("|")})$`)}});const i=a.options.length===1?a.options[0]._zod.run:null;e._zod.parse=(l,s)=>{if(i)return i(l,s);let u=!1;const c=[];for(const d of a.options){const m=d._zod.run({value:l.value,issues:[]},s);if(m instanceof Promise)c.push(m),u=!0;else{if(m.issues.length===0)return m;c.push(m)}}return u?Promise.all(c).then(d=>Sv(d,l,e,s)):Sv(c,l,e,s)}}),P2=ne("$ZodIntersection",(e,a)=>{jt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value,u=a.left._zod.run({value:s,issues:[]},l),c=a.right._zod.run({value:s,issues:[]},l);return u instanceof Promise||c instanceof Promise?Promise.all([u,c]).then(([m,p])=>wv(i,m,p)):wv(i,u,c)}});function oh(e,a){if(e===a)return{valid:!0,data:e};if(e instanceof Date&&a instanceof Date&&+e==+a)return{valid:!0,data:e};if(Co(e)&&Co(a)){const i=Object.keys(a),l=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...a};for(const u of l){const c=oh(e[u],a[u]);if(!c.valid)return{valid:!1,mergeErrorPath:[u,...c.mergeErrorPath]};s[u]=c.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let l=0;ld.l&&d.r).map(([d])=>d);if(u.length&&s&&e.issues.push({...s,keys:u}),il(e))return e;const c=oh(a.value,i.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const Q2=ne("$ZodEnum",(e,a)=>{jt.init(e,a);const i=nb(a.entries),l=new Set(i);e._zod.values=l,e._zod.pattern=new RegExp(`^(${i.filter(s=>e_.has(typeof s)).map(s=>typeof s=="string"?Ju(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const c=s.value;return l.has(c)||s.issues.push({code:"invalid_value",values:i,input:c,inst:e}),s}}),F2=ne("$ZodTransform",(e,a)=>{jt.init(e,a),e._zod.optin="optional",e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new tb(e.constructor.name);const s=a.transform(i.value,i);if(l.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(i.value=c,i.fallback=!0,i));if(s instanceof Promise)throw new sl;return i.value=s,i.fallback=!0,i}});function _v(e,a){return a===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const bb=ne("$ZodOptional",(e,a)=>{jt.init(e,a),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jh(i.source)})?$`):void 0}),e._zod.parse=(i,l)=>{if(a.innerType._zod.optin==="optional"){const s=i.value,u=a.innerType._zod.run(i,l);return u instanceof Promise?u.then(c=>_v(c,s)):_v(u,s)}return i.value===void 0?i:a.innerType._zod.run(i,l)}}),Y2=ne("$ZodExactOptional",(e,a)=>{bb.init(e,a),dt(e._zod,"values",)DELIM" -R"DELIM(()=>a.innerType._zod.values),dt(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(i,l)=>a.innerType._zod.run(i,l)}),G2=ne("$ZodNullable",(e,a)=>{jt.init(e,a),dt(e._zod,"optin",()=>a.innerType._zod.optin),dt(e._zod,"optout",()=>a.innerType._zod.optout),dt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jh(i.source)}|null)$`):void 0}),dt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,l)=>i.value===null?i:a.innerType._zod.run(i,l)}),K2=ne("$ZodDefault",(e,a)=>{jt.init(e,a),e._zod.optin="optional",dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);if(i.value===void 0)return i.value=a.defaultValue,i;const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Ev(u,a)):Ev(s,a)}});function Ev(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const V2=ne("$ZodPrefault",(e,a)=>{jt.init(e,a),e._zod.optin="optional",dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>(l.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,l))}),X2=ne("$ZodNonOptional",(e,a)=>{jt.init(e,a),dt(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(l=>l!==void 0)):void 0}),e._zod.parse=(i,l)=>{const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Tv(u,e)):Tv(s,e)}});function Tv(e,a){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:a}),e}const I2=ne("$ZodCatch",(e,a)=>{jt.init(e,a),e._zod.optin="optional",dt(e._zod,"optout",()=>a.innerType._zod.optout),dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(c=>si(c,l,oi()))},input:i.value}),i.issues=[],i.fallback=!0),i)):(i.value=s.value,s.issues.length&&(i.value=a.catchValue({...i,error:{issues:s.issues.map(u=>si(u,l,oi()))},input:i.value}),i.issues=[],i.fallback=!0),i)}}),J2=ne("$ZodPipe",(e,a)=>{jt.init(e,a),dt(e._zod,"values",()=>a.in._zod.values),dt(e._zod,"optin",()=>a.in._zod.optin),dt(e._zod,"optout",()=>a.out._zod.optout),dt(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,l)=>{if(l.direction==="backward"){const u=a.out._zod.run(i,l);return u instanceof Promise?u.then(c=>hu(c,a.in,l)):hu(u,a.in,l)}const s=a.in._zod.run(i,l);return s instanceof Promise?s.then(u=>hu(u,a.out,l)):hu(s,a.out,l)}});function hu(e,a,i){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},i)}const W2=ne("$ZodReadonly",(e,a)=>{jt.init(e,a),dt(e._zod,"propValues",()=>a.innerType._zod.propValues),dt(e._zod,"values",()=>a.innerType._zod.values),dt(e._zod,"optin",()=>a.innerType?._zod?.optin),dt(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(Rv):Rv(s)}});function Rv(e){return e.value=Object.freeze(e.value),e}const eE=ne("$ZodCustom",(e,a)=>{bn.init(e,a),jt.init(e,a),e._zod.parse=(i,l)=>i,e._zod.check=i=>{const l=i.value,s=a.fn(l);if(s instanceof Promise)return s.then(u=>Av(u,i,l,e));Av(s,i,l,e)}});function Av(e,a,i,l){if(!e){const s={code:"custom",input:i,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(s.params=l._zod.def.params),a.issues.push(jo(s))}}var zv;class tE{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...i){const l=i[0];return this._map.set(a,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,a),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 l={...this.get(i)??{}};delete l.id;const s={...l,...this._map.get(a)};return Object.keys(s).length?s:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function nE(){return new tE}(zv=globalThis).__zod_globalRegistry??(zv.__zod_globalRegistry=nE());const vo=globalThis.__zod_globalRegistry;function aE(e,a){return new e({type:"string",...Ce(a)})}function rE(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(a)})}function Cv(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(a)})}function iE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(a)})}function lE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(a)})}function oE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(a)})}function sE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(a)})}function uE(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(a)})}function cE(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(a)})}function fE(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(a)})}function dE(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(a)})}function hE(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(a)})}function mE(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(a)})}function pE(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(a)})}function yE(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(a)})}function gE(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(a)})}function vE(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(a)})}function bE(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(a)})}function xE(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(a)})}function SE(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(a)})}function wE(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(a)})}function _E(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(a)})}function EE(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(a)})}function TE(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(a)})}function RE(e,a){return new e({type:"string",format:"date",check:"string_format",...Ce(a)})}function AE(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(a)})}function zE(e,a){return new e({type:"string",format:"duration",check:"string_format",...Ce(a)})}function CE(e,a){return new e({type:"number",checks:[],...Ce(a)})}function jE(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(a)})}function NE(e,a){return new e({type:"boolean",...Ce(a)})}function ME(e){return new e({type:"unknown"})}function OE(e,a){return new e({type:"never",...Ce(a)})}function jv(e,a){return new hb({check:"less_than",...Ce(a),value:e,inclusive:!1})}function Td(e,a){return new hb({check:"less_than",...Ce(a),value:e,inclusive:!0})}function Nv(e,a){return new mb({check:"greater_than",...Ce(a),value:e,inclusive:!1})}function Rd(e,a){return new mb({check:"greater_than",...Ce(a),value:e,inclusive:!0})}function Mv(e,a){return new X_({check:"multiple_of",...Ce(a),value:e})}function xb(e,a){return new J_({check:"max_length",...Ce(a),maximum:e})}function $u(e,a){return new W_({check:"min_length",...Ce(a),)DELIM" -R"DELIM(minimum:e})}function Sb(e,a){return new e2({check:"length_equals",...Ce(a),length:e})}function kE(e,a){return new t2({check:"string_format",format:"regex",...Ce(a),pattern:e})}function DE(e){return new n2({check:"string_format",format:"lowercase",...Ce(e)})}function LE(e){return new a2({check:"string_format",format:"uppercase",...Ce(e)})}function BE(e,a){return new r2({check:"string_format",format:"includes",...Ce(a),includes:e})}function UE(e,a){return new i2({check:"string_format",format:"starts_with",...Ce(a),prefix:e})}function HE(e,a){return new l2({check:"string_format",format:"ends_with",...Ce(a),suffix:e})}function pl(e){return new o2({check:"overwrite",tx:e})}function $E(e){return pl(a=>a.normalize(e))}function ZE(){return pl(e=>e.trim())}function qE(){return pl(e=>e.toLowerCase())}function PE(){return pl(e=>e.toUpperCase())}function QE(){return pl(e=>Jw(e))}function FE(e,a,i){return new e({type:"array",element:a,...Ce(i)})}function YE(e,a,i){return new e({type:"custom",check:"custom",fn:a,...Ce(i)})}function GE(e,a){const i=KE(l=>(l.addIssue=s=>{if(typeof s=="string")l.issues.push(jo(s,l.value,i._zod.def));else{const u=s;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=l.value),u.inst??(u.inst=i),u.continue??(u.continue=!i._zod.def.abort),l.issues.push(jo(u))}},e(l.value,l)),a);return i}function KE(e,a){const i=new bn({check:"custom",...Ce(a)});return i._zod.check=e,i}function wb(e){let a=e?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??vo,target:a,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Xt(e,a,i={path:[],schemaPath:[]}){var l;const s=e._zod.def,u=a.seen.get(e);if(u)return u.count++,i.schemaPath.includes(e)&&(u.cycle=i.path),u.schema;const c={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(e,c);const d=e._zod.toJSONSchema?.();if(d)c.schema=d;else{const b={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,c.schema,b);else{const x=c.schema,w=a.processors[s.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);w(e,a,x,b)}const g=e._zod.parent;g&&(c.ref||(c.ref=g),Xt(g,a,b),a.seen.get(g).isParent=!0)}const m=a.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),a.io==="input"&&sn(e)&&(delete c.schema.examples,delete c.schema.default),a.io==="input"&&"_prefault"in c.schema&&((l=c.schema).default??(l.default=c.schema._prefault)),delete c.schema._prefault,a.seen.get(e).schema}function _b(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const c of e.seen.entries()){const d=e.metadataRegistry.get(c[0])?.id;if(d){const m=l.get(d);if(m&&m!==c[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(d,c[0])}}const s=c=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(c[0])?.id,x=e.external.uri??(E=>E);if(g)return{ref:x(g)};const w=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=w,{defId:w,ref:`${x("__shared")}#/${d}/${w}`}}if(c[1]===i)return{ref:"#"};const p=`#/${d}/`,b=c[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:p+b}},u=c=>{if(c[1].schema.$ref)return;const d=c[1],{ref:m,defId:p}=s(c);d.def={...d.schema},p&&(d.defId=p);const b=d.schema;for(const g in b)delete b[g];b.$ref=m};if(e.cycles==="throw")for(const c of e.seen.entries()){const d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/ + `)}w.write("payload.value = newResult;"),w.write("return payload;");const V=w.compile();return(J,ue)=>V(x,J,ue)};let u;const c=Uu,d=!Ah.jitless,p=d&&r_.value,b=a.catchall;let g;e._zod.parse=(x,w)=>{g??(g=l.value);const E=x.value;return c(E)?d&&p&&w?.async===!1&&w.jitless!==!0?(u||(u=s(a.shape)),x=u(x,w),b?xb([],E,x,w,g,e):x):i(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:E,inst:e}),x)}});function _v(e,a,i,l){for(const u of e)if(u.issues.length===0)return a.value=u.value,a;const s=e.filter(u=>!al(u));return s.length===1?(a.value=s[0].value,s[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:i,errors:e.map(u=>u.issues.map(c=>oi(c,l,li())))}),a)}const G2=ne("$ZodUnion",(e,a)=>{Nt.init(e,a),dt(e._zod,"optin",()=>a.options.some(l=>l._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>a.options.some(l=>l._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(a.options.every(l=>l._zod.values))return new Set(a.options.flatMap(l=>Array.from(l._zod.values)))}),dt(e._zod,"pattern",()=>{if(a.options.every(l=>l._zod.pattern)){const l=a.options.map(s=>s._zod.pattern);return new RegExp(`^(${l.map(s=>jh(s.source)).join("|")})$`)}});const i=a.options.length===1?a.options[0]._zod.run:null;e._zod.parse=(l,s)=>{if(i)return i(l,s);let u=!1;const c=[];for(const d of a.options){const m=d._zod.run({value:l.value,issues:[]},s);if(m instanceof Promise)c.push(m),u=!0;else{if(m.issues.length===0)return m;c.push(m)}}return u?Promise.all(c).then(d=>_v(d,l,e,s)):_v(c,l,e,s)}}),K2=ne("$ZodIntersection",(e,a)=>{Nt.init(e,a),e._zod.parse=(i,l)=>{const s=i.value,u=a.left._zod.run({value:s,issues:[]},l),c=a.right._zod.run({value:s,issues:[]},l);return u instanceof Promise||c instanceof Promise?Promise.all([u,c]).then(([m,p])=>Ev(i,m,p)):Ev(i,u,c)}});function oh(e,a){if(e===a)return{valid:!0,data:e};if(e instanceof Date&&a instanceof Date&&+e==+a)return{valid:!0,data:e};if(Co(e)&&Co(a)){const i=Object.keys(a),l=Object.keys(e).filter(u=>i.indexOf(u)!==-1),s={...e,...a};for(const u of l){const c=oh(e[u],a[u]);if(!c.valid)return{valid:!1,mergeErrorPath:[u,...c.mergeErrorPath]};s[u]=c.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(a)){if(e.length!==a.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let l=0;ld.l&&d.r).map(([d])=>d);if(u.length&&s&&e.issues.push({...s,keys:u}),al(e))return e;const c=oh(a.value,i.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const V2=ne("$ZodEnum",(e,a)=>{Nt.init(e,a);const i=rb(a.entries),l=new Set(i);e._zod.values=l,e._zod.pattern=new RegExp(`^(${i.filter(s=>i_.has(typeof s)).map(s=>typeof s=="string"?Ju(s):s.toString()).join("|")})$`),e._zod.parse=(s,u)=>{const c=s.value;return l.has(c)||s.issues.push({code:"invalid_value",values:i,input:c,inst:e}),s}}),X2=ne("$ZodTransform",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new ab(e.constructor.name);const s=a.transform(i.value,i);if(l.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(i.value=c,i.fallback=!0,i));if(s instanceof Promise)throw new ll;return i.value=s,i.fallback=!0,i}});function Tv(e,a){return a===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Sb=ne("$ZodOptional",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jh(i.source)})?$`):void 0}),e._zod.parse=(i,l)=>{if(a.innerType._zod.optin==="optional"){const s=i.value,u=a.innerType._zod.run(i,l);return u instanceof Promise?u.then(c=>Tv(c,s)):Tv(u,s)}return i.value===void 0?i:a.innerType._zod.run(i,l)}}),I2=ne("$ZodExactOptional",(e,a)=>{Sb.init(e,a),dt(e._zod,"values",()=>a.innerType._zod.values),dt(e._zod,"pattern",()=>a.innerType._zod.pattern),e._zod.parse=(i,l)=>a.innerType._zod.run(i,l)}),J2=ne("$ZodNullable",(e,a)=>{Nt.init(e,a),dt(e._zod,"optin",()=>a.innerType._zod.optin),dt(e._zod,"optout",()=>a.innerType._zod.optout),dt(e._zod,"pattern",()=>{const i=a.innerType._zod.pattern;return i?new RegExp(`^(${jh(i.source)}|null)$`):void 0}),dt(e._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),e._zod.parse=(i,l)=>i.value===null?i:a.innerType._zod.run(i,l)}),W2=ne("$ZodDefault",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);if(i.value===void 0)return i.value=a.defaultValue,)DELIM" +R"DELIM(i;const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Rv(u,a)):Rv(s,a)}});function Rv(e,a){return e.value===void 0&&(e.value=a.defaultValue),e}const eE=ne("$ZodPrefault",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>(l.direction==="backward"||i.value===void 0&&(i.value=a.defaultValue),a.innerType._zod.run(i,l))}),tE=ne("$ZodNonOptional",(e,a)=>{Nt.init(e,a),dt(e._zod,"values",()=>{const i=a.innerType._zod.values;return i?new Set([...i].filter(l=>l!==void 0)):void 0}),e._zod.parse=(i,l)=>{const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>Av(u,e)):Av(s,e)}});function Av(e,a){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:a}),e}const nE=ne("$ZodCatch",(e,a)=>{Nt.init(e,a),e._zod.optin="optional",dt(e._zod,"optout",()=>a.innerType._zod.optout),dt(e._zod,"values",()=>a.innerType._zod.values),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(u=>(i.value=u.value,u.issues.length&&(i.value=a.catchValue({...i,error:{issues:u.issues.map(c=>oi(c,l,li()))},input:i.value}),i.issues=[],i.fallback=!0),i)):(i.value=s.value,s.issues.length&&(i.value=a.catchValue({...i,error:{issues:s.issues.map(u=>oi(u,l,li()))},input:i.value}),i.issues=[],i.fallback=!0),i)}}),aE=ne("$ZodPipe",(e,a)=>{Nt.init(e,a),dt(e._zod,"values",()=>a.in._zod.values),dt(e._zod,"optin",()=>a.in._zod.optin),dt(e._zod,"optout",()=>a.out._zod.optout),dt(e._zod,"propValues",()=>a.in._zod.propValues),e._zod.parse=(i,l)=>{if(l.direction==="backward"){const u=a.out._zod.run(i,l);return u instanceof Promise?u.then(c=>hu(c,a.in,l)):hu(u,a.in,l)}const s=a.in._zod.run(i,l);return s instanceof Promise?s.then(u=>hu(u,a.out,l)):hu(s,a.out,l)}});function hu(e,a,i){return e.issues.length?(e.aborted=!0,e):a._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},i)}const rE=ne("$ZodReadonly",(e,a)=>{Nt.init(e,a),dt(e._zod,"propValues",()=>a.innerType._zod.propValues),dt(e._zod,"values",()=>a.innerType._zod.values),dt(e._zod,"optin",()=>a.innerType?._zod?.optin),dt(e._zod,"optout",()=>a.innerType?._zod?.optout),e._zod.parse=(i,l)=>{if(l.direction==="backward")return a.innerType._zod.run(i,l);const s=a.innerType._zod.run(i,l);return s instanceof Promise?s.then(zv):zv(s)}});function zv(e){return e.value=Object.freeze(e.value),e}const iE=ne("$ZodCustom",(e,a)=>{vn.init(e,a),Nt.init(e,a),e._zod.parse=(i,l)=>i,e._zod.check=i=>{const l=i.value,s=a.fn(l);if(s instanceof Promise)return s.then(u=>Cv(u,i,l,e));Cv(s,i,l,e)}});function Cv(e,a,i,l){if(!e){const s={code:"custom",input:i,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(s.params=l._zod.def.params),a.issues.push(jo(s))}}var jv;class lE{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...i){const l=i[0];return this._map.set(a,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,a),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 l={...this.get(i)??{}};delete l.id;const s={...l,...this._map.get(a)};return Object.keys(s).length?s:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function oE(){return new lE}(jv=globalThis).__zod_globalRegistry??(jv.__zod_globalRegistry=oE());const go=globalThis.__zod_globalRegistry;function sE(e,a){return new e({type:"string",...Ce(a)})}function uE(e,a){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(a)})}function Nv(e,a){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(a)})}function cE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(a)})}function fE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(a)})}function dE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(a)})}function hE(e,a){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(a)})}function mE(e,a){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(a)})}function pE(e,a){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(a)})}function yE(e,a){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(a)})}function gE(e,a){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(a)})}function vE(e,a){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(a)})}function bE(e,a){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(a)})}function xE(e,a){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(a)})}function SE(e,a){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(a)})}function wE(e,a){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(a)})}function _E(e,a){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(a)})}function EE(e,a){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(a)})}function TE(e,a){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(a)})}function RE(e,a){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(a)})}function AE(e,a){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(a)})}function zE(e,a){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(a)})}function CE(e,a){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(a)})}function jE(e,a){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(a)})}function NE(e,a){return new e({type:"string",format:"date",check:"string_format",...Ce(a)})}function ME(e,a){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(a)})}function OE(e,a){return new e({type:"string",format:"duration",check:"string_format",...Ce(a)})}function kE(e,a){return new e({type:"number",checks:[],...Ce(a)})}function DE(e,a){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(a)})}function LE(e,a){return new e({type:"boolean",...Ce(a)})}function BE(e){return new e({type:"unknown"})}function UE(e,a){return new e({type:"never",...Ce(a)})}function Mv(e,a){return new pb({check:"less_than",...Ce(a),value:e,inclusive:!1})}function Td(e,a){return new pb({check:"less_than",...Ce(a),value:e,inclusive:!0})}function Ov(e,a){return new yb({check:"greater_than",...Ce(a),value:e,inclusive:!1})}function Rd(e,a){return new yb({check:"greater_than",...Ce(a),value:e,inclusive:!0})}function kv(e,a){return new t2({check:"multiple_of",...Ce(a),value:e})}function wb(e,a){return new a2({check:"max_length",...Ce(a),maximum:e})}function $u(e,a){return new r2({check:"min_length",...Ce(a),minimum:e})}function _b(e,a){return new i2({check:"length_equals",...Ce(a),length:e})}function HE(e,a){return new l2({check:"string_format",format:"regex",...Ce(a),pattern:e})}function $E(e){return new o2({check:"string_format",format:"lowercase",...Ce(e)})}function ZE(e){return new s2({check:"string_format",format:"uppercase",...Ce(e)})}function qE(e,a){return new u2({check:"string_format",format:"includes",...Ce(a),includes:e})}function PE(e,a){return new c2({check:"string_format",format:"starts_with",...Ce(a),prefix:e})}function QE(e,a){return new f2({check:"string_format",format:"ends_with",...Ce(a),suffix:e})}function ml(e){return new d2({check:"overwrite",tx:e})}function FE(e){return ml(a=>a.normalize(e))}function YE(){return ml(e=>e.trim())}function GE(){return ml(e=>e.toLo)DELIM" +R"DELIM(werCase())}function KE(){return ml(e=>e.toUpperCase())}function VE(){return ml(e=>a_(e))}function XE(e,a,i){return new e({type:"array",element:a,...Ce(i)})}function IE(e,a,i){return new e({type:"custom",check:"custom",fn:a,...Ce(i)})}function JE(e,a){const i=WE(l=>(l.addIssue=s=>{if(typeof s=="string")l.issues.push(jo(s,l.value,i._zod.def));else{const u=s;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=l.value),u.inst??(u.inst=i),u.continue??(u.continue=!i._zod.def.abort),l.issues.push(jo(u))}},e(l.value,l)),a);return i}function WE(e,a){const i=new vn({check:"custom",...Ce(a)});return i._zod.check=e,i}function Eb(e){let a=e?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??go,target:a,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Vt(e,a,i={path:[],schemaPath:[]}){var l;const s=e._zod.def,u=a.seen.get(e);if(u)return u.count++,i.schemaPath.includes(e)&&(u.cycle=i.path),u.schema;const c={schema:{},count:1,cycle:void 0,path:i.path};a.seen.set(e,c);const d=e._zod.toJSONSchema?.();if(d)c.schema=d;else{const b={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(a,c.schema,b);else{const x=c.schema,w=a.processors[s.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);w(e,a,x,b)}const g=e._zod.parent;g&&(c.ref||(c.ref=g),Vt(g,a,b),a.seen.get(g).isParent=!0)}const m=a.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),a.io==="input"&&on(e)&&(delete c.schema.examples,delete c.schema.default),a.io==="input"&&"_prefault"in c.schema&&((l=c.schema).default??(l.default=c.schema._prefault)),delete c.schema._prefault,a.seen.get(e).schema}function Tb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const c of e.seen.entries()){const d=e.metadataRegistry.get(c[0])?.id;if(d){const m=l.get(d);if(m&&m!==c[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(d,c[0])}}const s=c=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(c[0])?.id,x=e.external.uri??(E=>E);if(g)return{ref:x(g)};const w=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=w,{defId:w,ref:`${x("__shared")}#/${d}/${w}`}}if(c[1]===i)return{ref:"#"};const p=`#/${d}/`,b=c[1].schema.id??`__schema${e.counter++}`;return{defId:b,ref:p+b}},u=c=>{if(c[1].schema.$ref)return;const d=c[1],{ref:m,defId:p}=s(c);d.def={...d.schema},p&&(d.defId=p);const b=d.schema;for(const g in b)delete b[g];b.$ref=m};if(e.cycles==="throw")for(const c of e.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 e.seen.entries()){const d=c[1];if(a===c[0]){u(c);continue}if(e.external){const p=e.external.registry.get(c[0])?.id;if(a!==c[0]&&p){u(c);continue}}if(e.metadataRegistry.get(c[0])?.id){u(c);continue}if(d.cycle){u(c);continue}if(d.count>1&&e.reused==="ref"){u(c);continue}}}function Eb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=d=>{const m=e.seen.get(d);if(m.ref===null)return;const p=m.def??m.schema,b={...p},g=m.ref;if(m.ref=null,g){l(g);const w=e.seen.get(g),E=w.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(E)):Object.assign(p,E),Object.assign(p,b),d._zod.parent===g)for(const N in p)N==="$ref"||N==="allOf"||N in b||delete p[N];if(E.$ref&&w.def)for(const N in p)N==="$ref"||N==="allOf"||N in w.def&&JSON.stringify(p[N])===JSON.stringify(w.def[N])&&delete p[N]}const x=d._zod.parent;if(x&&x!==g){l(x);const w=e.seen.get(x);if(w?.schema.$ref&&(p.$ref=w.schema.$ref,w.def))for(const E in p)E==="$ref"||E==="allOf"||E in w.def&&JSON.stringify(p[E])===JSON.stringify(w.def[E])&&delete p[E]}e.override({zodSchema:d,jsonSchema:p,path:m.path??[]})};for(const d of[...e.seen.entries()].reverse())l(d[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(a)?.id;if(!d)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(d)}Object.assign(s,i.def??i.schema);const u=e.metadataRegistry.get(a)?.id;u!==void 0&&s.id===u&&delete s.id;const c=e.external?.defs??{};for(const d of e.seen.entries()){const m=d[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,c[m.defId]=m.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...a["~standard"],jsonSchema:{input:Zu(a,"input",e.processors),output:Zu(a,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function sn(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return sn(l.element,i);if(l.type==="set")return sn(l.valueType,i);if(l.type==="lazy")return sn(l.getter(),i);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return sn(l.innerType,i);if(l.type==="intersection")return sn(l.left,i)||sn(l.right,i);if(l.type==="record"||l.type==="map")return sn(l.keyType,i)||sn(l.valueType,i);if(l.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:sn(l.in,i)||sn(l.out,i);if(l.type==="object"){for(const s in l.shape)if(sn(l.shape[s],i))return!0;return!1}if(l.type==="union"){for(const s of l.options)if(sn(s,i))return!0;return!1}if(l.type==="tuple"){for(const s of l.items)if(sn(s,i))return!0;return!!(l.rest&&sn(l.rest,i))}return!1}const VE=(e,a={})=>i=>{const l=wb({...i,processors:a});return Xt(e,l),_b(l,e),Eb(l,e)},Zu=(e,a,i={})=>l=>{const{libraryOptions:s,target:u}=l??{},c=wb({...s??{},target:u,io:a,processors:i});return Xt(e,c),_b(c,e),Eb(c,e)},XE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},IE=(e,a,i,l)=>{const s=i;s.type="string";const{minimum:u,maximum:c,format:d,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof c=="number"&&(s.maxLength=c),d&&(s.format=XE[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),p&&(s.contentEncoding=p),m&&m.size>0){const b=[...m];b.length===1?s.pattern=b[0].source:b.length>1&&(s.allOf=[...b.map(g=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},JE=(e,a,i,l)=>{const s=i,{minimum:u,maximum:c,format:d,)DELIM" -R"DELIM(multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:b}=e._zod.bag;typeof d=="string"&&d.includes("int")?s.type="integer":s.type="number";const g=typeof b=="number"&&b>=(u??Number.NEGATIVE_INFINITY),x=typeof p=="number"&&p<=(c??Number.POSITIVE_INFINITY),w=a.target==="draft-04"||a.target==="openapi-3.0";g?w?(s.minimum=b,s.exclusiveMinimum=!0):s.exclusiveMinimum=b:typeof u=="number"&&(s.minimum=u),x?w?(s.maximum=p,s.exclusiveMaximum=!0):s.exclusiveMaximum=p:typeof c=="number"&&(s.maximum=c),typeof m=="number"&&(s.multipleOf=m)},WE=(e,a,i,l)=>{i.type="boolean"},eT=(e,a,i,l)=>{i.not={}},tT=(e,a,i,l)=>{},nT=(e,a,i,l)=>{const s=e._zod.def,u=nb(s.entries);u.every(c=>typeof c=="number")&&(i.type="number"),u.every(c=>typeof c=="string")&&(i.type="string"),i.enum=u},aT=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},rT=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},iT=(e,a,i,l)=>{const s=i,u=e._zod.def,{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Xt(u.element,a,{...l,path:[...l.path,"items"]})},lT=(e,a,i,l)=>{const s=i,u=e._zod.def;s.type="object",s.properties={};const c=u.shape;for(const p in c)s.properties[p]=Xt(c[p],a,{...l,path:[...l.path,"properties",p]});const d=new Set(Object.keys(c)),m=new Set([...d].filter(p=>{const b=u.shape[p]._zod;return a.io==="input"?b.optin===void 0:b.optout===void 0}));m.size>0&&(s.required=Array.from(m)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Xt(u.catchall,a,{...l,path:[...l.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},oT=(e,a,i,l)=>{const s=e._zod.def,u=s.inclusive===!1,c=s.options.map((d,m)=>Xt(d,a,{...l,path:[...l.path,u?"oneOf":"anyOf",m]}));u?i.oneOf=c:i.anyOf=c},sT=(e,a,i,l)=>{const s=e._zod.def,u=Xt(s.left,a,{...l,path:[...l.path,"allOf",0]}),c=Xt(s.right,a,{...l,path:[...l.path,"allOf",1]}),d=p=>"allOf"in p&&Object.keys(p).length===1,m=[...d(u)?u.allOf:[u],...d(c)?c.allOf:[c]];i.allOf=m},uT=(e,a,i,l)=>{const s=e._zod.def,u=Xt(s.innerType,a,l),c=a.seen.get(e);a.target==="openapi-3.0"?(c.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},cT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},fT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},dT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},hT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType;let c;try{c=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=c},mT=(e,a,i,l)=>{const s=e._zod.def,u=s.in._zod.traits.has("$ZodTransform"),c=a.io==="input"?u?s.out:s.in:s.out;Xt(c,a,l);const d=a.seen.get(e);d.ref=c},pT=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.readOnly=!0},Tb=(e,a,i,l)=>{const s=e._zod.def;Xt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},yT=ne("ZodISODateTime",(e,a)=>{S2.init(e,a),wt.init(e,a)});function gT(e){return TE(yT,e)}const vT=ne("ZodISODate",(e,a)=>{w2.init(e,a),wt.init(e,a)});function bT(e){return RE(vT,e)}const xT=ne("ZodISOTime",(e,a)=>{_2.init(e,a),wt.init(e,a)});function ST(e){return AE(xT,e)}const wT=ne("ZodISODuration",(e,a)=>{E2.init(e,a),wt.init(e,a)});function _T(e){return zE(wT,e)}const ET=(e,a)=>{ob.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>d_(e,i)},flatten:{value:i=>f_(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,lh,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,lh,2)}},isEmpty:{get(){return e.issues.length===0}}})},Kn=ne("ZodError",ET,{Parent:Error}),TT=Mh(Kn),RT=Oh(Kn),AT=Wu(Kn),zT=ec(Kn),CT=p_(Kn),jT=y_(Kn),NT=g_(Kn),MT=v_(Kn),OT=b_(Kn),kT=x_(Kn),DT=S_(Kn),LT=w_(Kn),Ov=new WeakMap;function $o(e,a,i){const l=Object.getPrototypeOf(e);let s=Ov.get(l);if(s||(s=new Set,Ov.set(l,s)),!s.has(a)){s.add(a);for(const u in i){const c=i[u];Object.defineProperty(l,u,{configurable:!0,enumerable:!1,get(){const d=c.bind(this);return Object.defineProperty(this,u,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,u,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Nt=ne("ZodType",(e,a)=>(jt.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:Zu(e,"input"),output:Zu(e,"output")}}),e.toJSONSchema=VE(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.parse=(i,l)=>TT(e,i,l,{callee:e.parse}),e.safeParse=(i,l)=>AT(e,i,l),e.parseAsync=async(i,l)=>RT(e,i,l,{callee:e.parseAsync}),e.safeParseAsync=async(i,l)=>zT(e,i,l),e.spa=e.safeParseAsync,e.encode=(i,l)=>CT(e,i,l),e.decode=(i,l)=>jT(e,i,l),e.encodeAsync=async(i,l)=>NT(e,i,l),e.decodeAsync=async(i,l)=>MT(e,i,l),e.safeEncode=(i,l)=>OT(e,i,l),e.safeDecode=(i,l)=>kT(e,i,l),e.safeEncodeAsync=async(i,l)=>DT(e,i,l),e.safeDecodeAsync=async(i,l)=>LT(e,i,l),$o(e,"ZodType",{check(...i){const l=this.def;return this.clone(Or(l,{checks:[...l.checks??[],...i.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...i){return this.check(...i)},clone(i,l){return kr(this,i,l)},brand(){return this},register(i,l){return i.add(this,l),this},refine(i,l){return this.check(C4(i,l))},superRefine(i,l){return this.check(j4(i,l))},overwrite(i){return this.check(pl(i))},optional(){return Bv(this)},exactOptional(){return y4(this)},nullable(){return Uv(this)},nullish(){return Bv(Uv(this))},nonoptional(i){return w4(this,i)},array(){return dl(this)},or(i){return u4([this,i])},and(i){return f4(this,i)},transform(i){return Hv(this,m4(i))},default(i){return b4(this,i)},prefault(i){return S4(this,i)},catch(i){return E4(this,i)},pipe(i){return Hv(this,i)},readonly(){return A4(this)},describe(i){const l=this.clone();return vo.add(l,{description:i}),l},meta(...i){if(i.length===0)return vo.get(this);const l=this.clone();return vo.add(l,i[0]),l},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(i){return i(this)}}),Object.defineProperty(e,"description",{get(){return vo.get(e)?.description},configurable:!0}),e)),Rb=ne("_ZodString",(e,a)=>{kh.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>IE(e,l,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,$o(e,"_ZodString",{regex(...l){return this.check(kE(...l))},includes(...l){return this.check(BE(...l))},startsWith(...l){return this.check(UE(...l))},endsWith(...l){return this.check(HE(...l))},min(...l){return this.check($u(...l))},max(...l){return this.check(xb(...l))},length(...l){return this.check(Sb(...l))},nonempty(...l){return this.check($u(1,...l))},lowercase(l){return this.check(DE(l))},uppercase(l){return this.check(LE(l))},trim(){return this.check(ZE())},normalize(...l){return this.check($E(...l))},toLowerCase(){return this.check(qE())},toUpperCase(){return this.check(PE())},slugify(){return this.check(QE())}})}),BT=ne("ZodString",(e,a)=>{kh.init(e,a),Rb.init(e,a),e.email=i=>e.check(rE(UT,i)),e.url=i=>e.check(uE(HT,i)),e.jwt=i=>e.check(EE(e4,i)),e.emoji=i=>e.check(cE($T,i)),e.guid=i=>e.check(Cv(kv,i)),e.uuid=i=>e.check(iE(mu,i)),e.uuidv4=i=>e.check(lE(mu,i)),e.uuidv6=i=>e.check(oE(mu,i)),e.uuidv7=i=>e.check(sE(mu,i)),e.nanoid=i=>e.check(fE(ZT,i)),e.guid=i=>e.check(Cv(kv,i)),e.cuid=i=>e.check(dE(qT,i)),e.cuid2=i=>e.check(hE(PT,i)),e.ulid=i=>e.check(mE(QT,i)),e.base64=i=>e.check(SE(IT,i)),e.base64url=i=>e.check(wE(JT,i)),e.xid=i=>e.check(pE(FT,i)),e.ksuid=i=>e.check(yE(YT,i)),e.ipv4=i=>e.check(gE(GT,i)),e.ipv6=i=>e.check(vE(KT,i)),)DELIM" -R"DELIM(e.cidrv4=i=>e.check(bE(VT,i)),e.cidrv6=i=>e.check(xE(XT,i)),e.e164=i=>e.check(_E(WT,i)),e.datetime=i=>e.check(gT(i)),e.date=i=>e.check(bT(i)),e.time=i=>e.check(ST(i)),e.duration=i=>e.check(_T(i))});function Ht(e){return aE(BT,e)}const wt=ne("ZodStringFormat",(e,a)=>{xt.init(e,a),Rb.init(e,a)}),UT=ne("ZodEmail",(e,a)=>{d2.init(e,a),wt.init(e,a)}),kv=ne("ZodGUID",(e,a)=>{c2.init(e,a),wt.init(e,a)}),mu=ne("ZodUUID",(e,a)=>{f2.init(e,a),wt.init(e,a)}),HT=ne("ZodURL",(e,a)=>{h2.init(e,a),wt.init(e,a)}),$T=ne("ZodEmoji",(e,a)=>{m2.init(e,a),wt.init(e,a)}),ZT=ne("ZodNanoID",(e,a)=>{p2.init(e,a),wt.init(e,a)}),qT=ne("ZodCUID",(e,a)=>{y2.init(e,a),wt.init(e,a)}),PT=ne("ZodCUID2",(e,a)=>{g2.init(e,a),wt.init(e,a)}),QT=ne("ZodULID",(e,a)=>{v2.init(e,a),wt.init(e,a)}),FT=ne("ZodXID",(e,a)=>{b2.init(e,a),wt.init(e,a)}),YT=ne("ZodKSUID",(e,a)=>{x2.init(e,a),wt.init(e,a)}),GT=ne("ZodIPv4",(e,a)=>{T2.init(e,a),wt.init(e,a)}),KT=ne("ZodIPv6",(e,a)=>{R2.init(e,a),wt.init(e,a)}),VT=ne("ZodCIDRv4",(e,a)=>{A2.init(e,a),wt.init(e,a)}),XT=ne("ZodCIDRv6",(e,a)=>{z2.init(e,a),wt.init(e,a)}),IT=ne("ZodBase64",(e,a)=>{C2.init(e,a),wt.init(e,a)}),JT=ne("ZodBase64URL",(e,a)=>{N2.init(e,a),wt.init(e,a)}),WT=ne("ZodE164",(e,a)=>{M2.init(e,a),wt.init(e,a)}),e4=ne("ZodJWT",(e,a)=>{k2.init(e,a),wt.init(e,a)}),Ab=ne("ZodNumber",(e,a)=>{yb.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>JE(e,l,s),$o(e,"ZodNumber",{gt(l,s){return this.check(Nv(l,s))},gte(l,s){return this.check(Rd(l,s))},min(l,s){return this.check(Rd(l,s))},lt(l,s){return this.check(jv(l,s))},lte(l,s){return this.check(Td(l,s))},max(l,s){return this.check(Td(l,s))},int(l){return this.check(Dv(l))},safe(l){return this.check(Dv(l))},positive(l){return this.check(Nv(0,l))},nonnegative(l){return this.check(Rd(0,l))},negative(l){return this.check(jv(0,l))},nonpositive(l){return this.check(Td(0,l))},multipleOf(l,s){return this.check(Mv(l,s))},step(l,s){return this.check(Mv(l,s))},finite(){return this}});const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function Je(e){return CE(Ab,e)}const t4=ne("ZodNumberFormat",(e,a)=>{D2.init(e,a),Ab.init(e,a)});function Dv(e){return jE(t4,e)}const n4=ne("ZodBoolean",(e,a)=>{L2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>WE(e,i,l)});function Dh(e){return NE(n4,e)}const a4=ne("ZodUnknown",(e,a)=>{B2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>tT()});function Lv(){return ME(a4)}const r4=ne("ZodNever",(e,a)=>{U2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>eT(e,i,l)});function i4(e){return OE(r4,e)}const l4=ne("ZodArray",(e,a)=>{H2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>iT(e,i,l,s),e.element=a.element,$o(e,"ZodArray",{min(i,l){return this.check($u(i,l))},nonempty(i){return this.check($u(1,i))},max(i,l){return this.check(xb(i,l))},length(i,l){return this.check(Sb(i,l))},unwrap(){return this.element}})});function dl(e,a){return FE(l4,e,a)}const o4=ne("ZodObject",(e,a)=>{Z2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>lT(e,i,l,s),dt(e,"shape",()=>a.shape),$o(e,"ZodObject",{keyof(){return d4(Object.keys(this._zod.def.shape))},catchall(i){return this.clone({...this._zod.def,catchall:i})},passthrough(){return this.clone({...this._zod.def,catchall:Lv()})},loose(){return this.clone({...this._zod.def,catchall:Lv()})},strict(){return this.clone({...this._zod.def,catchall:i4()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(i){return i_(this,i)},safeExtend(i){return l_(this,i)},merge(i){return o_(this,i)},pick(i){return a_(this,i)},omit(i){return r_(this,i)},partial(...i){return s_(zb,this,i[0])},required(...i){return u_(Cb,this,i[0])}})});function va(e,a){const i={type:"object",shape:e??{},...Ce(a)};return new o4(i)}const s4=ne("ZodUnion",(e,a)=>{q2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>oT(e,i,l,s),e.options=a.options});function u4(e,a){return new s4({type:"union",options:e,...Ce(a)})}const c4=ne("ZodIntersection",(e,a)=>{P2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>sT(e,i,l,s)});function f4(e,a){return new c4({type:"intersection",left:e,right:a})}const sh=ne("ZodEnum",(e,a)=>{Q2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>nT(e,l,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(l,s)=>{const u={};for(const c of l)if(i.has(c))u[c]=a.entries[c];else throw new Error(`Key ${c} not found in enum`);return new sh({...a,checks:[],...Ce(s),entries:u})},e.exclude=(l,s)=>{const u={...a.entries};for(const c of l)if(i.has(c))delete u[c];else throw new Error(`Key ${c} not found in enum`);return new sh({...a,checks:[],...Ce(s),entries:u})}});function d4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new sh({type:"enum",entries:i,...Ce(a)})}const h4=ne("ZodTransform",(e,a)=>{F2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>rT(e,i),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new tb(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(jo(u,i.value,a));else{const c=u;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=i.value),c.inst??(c.inst=e),i.issues.push(jo(c))}};const s=a.transform(i.value,i);return s instanceof Promise?s.then(u=>(i.value=u,i.fallback=!0,i)):(i.value=s,i.fallback=!0,i)}});function m4(e){return new h4({type:"transform",transform:e})}const zb=ne("ZodOptional",(e,a)=>{bb.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>Tb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function Bv(e){return new zb({type:"optional",innerType:e})}const p4=ne("ZodExactOptional",(e,a)=>{Y2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>Tb(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function y4(e){return new p4({type:"optional",innerType:e})}const g4=ne("ZodNullable",(e,a)=>{G2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>uT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function Uv(e){return new g4({type:"nullable",innerType:e})}const v4=ne("ZodDefault",(e,a)=>{K2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>fT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function b4(e,a){return new v4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():rb(a)}})}const x4=ne("ZodPrefault",(e,a)=>{V2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>dT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function S4(e,a){return new x4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():rb(a)}})}const Cb=ne("ZodNonOptional",(e,a)=>{X2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>cT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function w4(e,a){return new Cb({type:"nonoptional",innerType:e,...Ce(a)})}const _4=ne("ZodCatch",(e,a)=>{I2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>hT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function E4(e,a){return new _4({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const T4=ne("ZodPipe",(e,a)=>{J2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>mT(e,i,l,s),e.in=a.in,e.out=a.out});function Hv(e,a){return new T4({type:"pipe",in:e,out:a})}const R4=ne("ZodReadonly",(e,a)=>{W2.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>pT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function A4(e){return new R4({type:"readonly",innerType:e})}const z4=ne("ZodCustom",(e,a)=>{eE.init(e,a),Nt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>aT(e,i)});function C4(e,a={}){return YE(z4,e,a)}function j4(e,a){return GE(e,a)}function ui(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),l=i.indexOf("1");if(l>0){const c=i.slice(0,l);)DELIM" -R"DELIM(if(["bc","tb","bcrt","ltc","sb"].includes(c)){const d=i.slice(l+1);if(!d)return;const m=d.charAt(0);return m==="p"?"p2tr":m==="q"?d.length===39||d.length===40||e.length===42?"p2wpkh":d.length===59||d.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}const s=/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(a)&&a.length>=26&&a.length<=35;switch(i[0]){case"1":case"m":case"n":return s?"p2pkh":void 0;case"3":case"2":return s?"p2sh":void 0;default:return}}class Lh extends Error{constructor(a,i){super(a),this.status=i}status}const uh=va({id:Ht(),height:Je(),timestamp:Je().optional(),mediantime:Je().optional(),tx_count:Je().optional(),size:Je().optional(),weight:Je().optional(),difficulty:Je().optional(),bits:Je().optional(),merkle_root:Ht().optional(),previousblockhash:Ht().nullable().optional(),nonce:Je().optional(),version:Je().optional()}).loose(),N4=va({confirmed:Dh(),block_height:Je().optional(),block_hash:Ht().optional(),block_time:Je().optional()}),M4=va({txid:Ht().optional().nullable(),vout:Je().optional().nullable(),sequence:Je().optional(),scriptsig:Ht().optional().nullable(),scriptsig_asm:Ht().optional().nullable(),witness:dl(Ht()).optional(),is_coinbase:Dh().optional(),prevout:va({scriptpubkey_type:Ht().optional(),scriptpubkey_address:Ht().optional(),scriptpubkey:Ht().optional(),scriptpubkey_asm:Ht().optional(),value:Je().optional()}).partial().nullable().optional()}).loose(),O4=va({scriptpubkey_type:Ht().optional(),scriptpubkey_address:Ht().optional(),scriptpubkey:Ht().optional(),scriptpubkey_asm:Ht().optional(),value:Je(),n:Je().optional()}).loose(),Tu=va({txid:Ht(),hash:Ht().optional(),fee:Je().optional(),version:Je(),locktime:Je(),vin:dl(M4),vout:dl(O4),size:Je(),weight:Je(),status:N4}).loose(),Bh=dl(uh),qu=dl(Tu),$v=va({in_best_chain:Dh(),next_best:Ht().optional(),height:Je().optional()}),Zv=va({address:Ht(),chain_stats:va({funded_txo_count:Je().optional(),funded_txo_sum:Je().optional(),spent_txo_count:Je().optional(),spent_txo_sum:Je().optional(),tx_count:Je().optional()}),mempool_stats:va({funded_txo_count:Je().optional(),funded_txo_sum:Je().optional(),spent_txo_count:Je().optional(),spent_txo_sum:Je().optional(),tx_count:Je().optional()})});async function en(e,a,i){const l=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${l}`);if(!s.ok)throw new Lh(`Request to ${a} failed with status ${String(s.status)}`,s.status);const u=await s.json();return i.parse(u)}async function qv(e,a,i){if(i<=0)return[];const l=[];let s=a;for(;s&&l.lengthu.scriptpubkey_address===e?s+u.value:s,0),l=a.vin.reduce((s,u)=>{const c=u.prevout;return c?.scriptpubkey_address===e&&typeof c.value=="number"?s+c.value:s},0);return i-l}async function Ad(e,a){if(a==="latest"||a==="tip"){const i=await en(e,"/blocks",Bh);if(i.length===0)throw new Error("No blocks returned from API");return i[0].id}if(/^\d+$/.test(a)){const i=await fetch(`${e}/block-height/${a}`);if(!i.ok)throw new Lh("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function Qv(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const l=a+1;try{const s=await fetch(`${e}/block-height/${String(l)}`);return s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(l)}`,s),null}}function co(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 zd(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",l=e.vin.map((m,p)=>{const b=m.is_coinbase||m.txid==null?void 0:typeof m.vout=="number"&&m.vout!==4294967295?m.vout:void 0;return{index:p,prevTxId:m.txid??void 0,prevOutputIndex:b,address:m.prevout?.scriptpubkey_address??void 0,valueSats:m.prevout?.value,scriptType:m.prevout?.scriptpubkey_type,isCoinbase:m.is_coinbase??!1,script:m.scriptsig||m.scriptsig_asm?{hex:m.scriptsig??void 0,mnemonic:m.scriptsig_asm??void 0}:void 0,witness:m.witness??void 0,sequence:m.sequence}}),s=e.vout.map((m,p)=>({index:p,address:m.scriptpubkey_address??void 0,valueSats:m.value,scriptType:m.scriptpubkey_type,spent:void 0,script:m.scriptpubkey||m.scriptpubkey_asm?{hex:m.scriptpubkey??void 0,mnemonic:m.scriptpubkey_asm??void 0}:void 0})),u=s.reduce((m,p)=>m+p.valueSats,0),c=a.lastKnownHeight;let d=0;return e.status.block_height&&i==="confirmed"&&(d=c&&c>=e.status.block_height?c-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:i,confirmations:d,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:u,inputs:l,outputs:s}}function D4(e,a){const i=e.chain_stats,l=e.mempool_stats,s=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),u=jb(e.address,a.slice(0,25));return{address:e.address,addressType:ui(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(l.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(l.spent_txo_sum??0),txCount:(i.tx_count??0)+(l.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:u}}function L4(e){const a=e.chain_stats,i=e.mempool_stats,l=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:ui(e.address),balance:l,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 jb(e,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:k4(e,i),blockHeight:i.status.block_height}))}async function Fv(e,a,i=0){const l=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return en(e,l,qu)}async function B4(e,a,i){return i?en(e,`/address/${a}/txs/chain/${i}`,qu):en(e,`/address/${a}/txs`,qu)}function Nb({baseUrl:e}){const a=new Set;let i=null;const l={lastBlockHash:null,lastKnownHeight:null};async function s(d){const m=await en(e,`/tx/${d}`,Tu);return await(m.status.block_height?Ii(e,l,m.status.block_height):Ii(e,l)),zd(m,l)}function u(){i||a.size===0||(i=setInterval(async()=>{try{const d=await en(e,"/blocks",Bh);if(d.length===0)return;const m=d[0];if(m.id!==l.lastBlockHash){l.lastBlockHash=m.id,l.lastKnownHeight=Math.max(m.height,l.lastKnownHeight??0);const p=co(m);for(const b of a)b({type:"block.new",payload:p})}}catch(d){console.warn("Block polling failed",d)}},15e3))}function c(){i&&(clearInterval(i),i=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Read-only adapter using Blockstream public REST API."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},async getLatestBlocks(d=10){const m=await qv(e,"/blocks",d);return m.length>0&&(l.lastBlockHash=m[0].id,l.lastKnownHeight=Math.max(m[0].height,l.lastKnownHeight??0)),m.map(p=>co(p))},async getBlocksBefore(d,m=10){const p=Math.max(d,0),b=await qv(e,`/blocks/${String(p)}`,m);return b.length>0&&(l.lastKnownHeight=Math.max(b[0].height,l.lastKnownHeight??0)),b.map(g=>co(g))},async getBlockHeader(d){const m=await Ad(e,d);await Ii(e,l);const[p,b]=await Promise.all([en(e,`/block/${m}`,uh),en(e,`/block/${m})DELIM" -R"DELIM(/status`,$v).catch(()=>null)]),g=co(p);l.lastBlockHash=g.hash,l.lastKnownHeight=Math.max(g.height,l.lastKnownHeight??g.height);let x=b?.next_best??null;return x||(x=await Qv(e,g.height,l)),{...g,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:x}},getBlockStats(d){return Promise.resolve({})},async getBlock(d){const m=await Ad(e,d);await Ii(e,l);const p=await en(e,`/block/${m}`,uh),[b,g]=await Promise.allSettled([Fv(e,m),en(e,`/block/${m}/status`,$v)]);b.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",b.reason),g.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",g.reason);const x=co(p);l.lastBlockHash=x.hash,l.lastKnownHeight=Math.max(x.height,l.lastKnownHeight??x.height);const w=b.status==="fulfilled"?b.value:[];let R=(g.status==="fulfilled"?g.value:null)?.next_best??null;return R||(R=await Qv(e,x.height,l)),{...x,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:R,transactions:w.map(F=>zd(F,l))}},async getBlockTransactions(d,m=0){const p=await Ad(e,d),b=await Fv(e,p,m),g=b.reduce((x,w)=>w.status.block_height?x===null?w.status.block_height:Math.max(x,w.status.block_height):x,null);return await(typeof g=="number"?Ii(e,l,g):Ii(e,l)),b.map(x=>zd(x,l))},async getTransactionHeader(d){return s(d)},async getTransaction(d){return s(d)},async getTransactionInputScriptHex(d,m){const p=await en(e,`/tx/${d}`,Tu);if(m<0||m>=p.vin.length)throw new RangeError(`Input index ${String(m)} not found`);const g=p.vin[m].scriptsig;return typeof g=="string"?g:""},async getTransactionOutputScriptHex(d,m){const p=await en(e,`/tx/${d}`,Tu);if(m<0||m>=p.vout.length)throw new RangeError(`Output index ${String(m)} not found`);const g=p.vout[m].scriptpubkey;if(typeof g!="string")throw new TypeError("Output script missing in provider response");return g},async getAddressSummary(d){const m=await en(e,`/address/${d}`,Zv);return L4(m)},async getAddress(d){const m=await en(e,`/address/${d}`,Zv),p=await en(e,`/address/${d}/txs`,qu);return D4(m,p)},async getAddressTransactions(d,m){const p=await B4(e,d,m);return jb(d,p)},subscribeToEvents(d){return a.add(d),u(),()=>{a.delete(d),a.size===0&&c()}}}}function U4({baseUrl:e}){const a=Nb({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function No(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Mb(e,a){return Array.isArray(a)?a.length===0?!0:e?a.every(i=>typeof i=="string"):a.every(i=>Number.isSafeInteger(i)):!1}function Uh(e){if(typeof e!="function")throw new TypeError("function expected");return!0}function Mo(e,a){if(typeof a!="string")throw new TypeError(`${e}: string expected`);return!0}function Zo(e){if(typeof e!="number")throw new TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw new RangeError(`invalid integer: ${e}`)}function Pu(e){if(!Array.isArray(e))throw new TypeError("array expected")}function Ob(e,a){if(!Mb(!0,a))throw new TypeError(`${e}: array of strings expected`)}function Hh(e,a){if(!Mb(!1,a))throw new TypeError(`${e}: array of numbers expected`)}function $h(...e){const a=u=>u,i=(u,c)=>d=>u(c(d)),l=e.map(u=>u.encode).reduceRight(i,a),s=e.map(u=>u.decode).reduce(i,a);return{encode:l,decode:s}}function kb(e){const a=typeof e=="string"?e.split(""):e,i=a.length;Ob("alphabet",a);const l=new Map(a.map((s,u)=>[s,u]));return{encode:s=>(Pu(s),s.map(u=>{if(!Number.isSafeInteger(u)||u<0||u>=i)throw new Error(`alphabet.encode: digit index outside alphabet "${u}". Allowed: ${e}`);return a[u]})),decode:s=>(Pu(s),s.map(u=>{Mo("alphabet.decode",u);const c=l.get(u);if(c===void 0)throw new Error(`Unknown letter: "${u}". Allowed: ${e}`);return c}))}}function Db(e=""){return Mo("join",e),{encode:a=>(Ob("join.decode",a),a.join(e)),decode:a=>(Mo("join.decode",a),a.split(e))}}function Yv(e,a,i){if(a<2)throw new RangeError(`convertRadix: invalid from=${a}, base cannot be less than 2`);if(i<2)throw new RangeError(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(Pu(e),!e.length)return[];let l=0;const s=[],u=Array.from(e,d=>{if(Zo(d),d<0||d>=a)throw new Error(`invalid integer: ${d}`);return d}),c=u.length;for(;;){let d=0,m=!0;for(let p=l;pa===0?e:Lb(a,e%a),Qu=(e,a)=>e+(a-Lb(e,a)),Ru=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function ch(e,a,i,l){if(Pu(e),a<=0||a>32)throw new RangeError(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new RangeError(`convertRadix2: wrong to=${i}`);if(Qu(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${Qu(a,i)}`);let s=0,u=0;const c=Ru[a],d=Ru[i]-1,m=[];for(const p of e){if(Zo(p),p>=c)throw new Error(`convertRadix2: invalid data word=${p} from=${a}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${u} from=${a}`);for(u+=a;u>=i;u-=i)m.push((s>>u-i&d)>>>0);const b=Ru[u];if(b===void 0)throw new Error("invalid carry");s&=b-1}if(s=s<=a)throw new Error("Excess padding");if(!l&&s>0)throw new Error(`Non-zero padding: ${s}`);return l&&u>0&&m.push(s>>>0),m}function H4(e){Zo(e);const a=2**8;return{encode:i=>{if(!No(i))throw new TypeError("radix.encode input should be Uint8Array");return Yv(Array.from(i),a,e)},decode:i=>(Hh("radix.decode",i),Uint8Array.from(Yv(i,e,a)))}}function $4(e,a=!1){if(Zo(e),e<=0||e>32)throw new RangeError("radix2: bits should be in (0..32]");if(Qu(8,e)>32||Qu(e,8)>32)throw new RangeError("radix2: carry overflow");return{encode:i=>{if(!No(i))throw new TypeError("radix2.encode input should be Uint8Array");return ch(Array.from(i),8,e,!a)},decode:i=>(Hh("radix2.decode",i),Uint8Array.from(ch(i,e,8,a)))}}function Gv(e){return Uh(e),function(...a){try{return e.apply(null,a)}catch{}}}function Z4(e,a){if(Zo(e),e<=0)throw new RangeError(`checksum length must be positive: ${e}`);Uh(a);const i=a;return{encode(l){if(!No(l))throw new TypeError("checksum.encode: input should be Uint8Array");const s=i(l).slice(0,e),u=new Uint8Array(l.length+e);return u.set(l),u.set(s,l.length),u},decode(l){if(!No(l))throw new TypeError("checksum.decode: input should be Uint8Array");const s=l.slice(0,-e),u=l.slice(-e),c=i(s).slice(0,e);for(let d=0;d$h(H4(58),kb(e),Db("")),P4=Object.freeze(q4("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),Q4=e=>{Uh(e);const a=e;return $h(Z4(4,i=>a(a(i))),P4)},fh=$h(kb("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Db("")),Kv=[996825010,642813549,513874426,1027748829,705979059];function fo(e){const a=e>>25;let i=(e&33554431)<<5;for(let l=0;l>l&1)===1&&(i^=Kv[l]);return i}function Vv(e,a,i=1){const l=e.length;let s=1;for(let u=0;u126)throw new Error(`Invalid prefix (${e})`);s=fo(s)^c>>5}s=fo(s);for(let u=0;uw)throw new TypeError(`Length ${R} exceeds limit ${w}`);const N=g.toLowerCase(),F=Vv(N,x,a);return`${N}1${fh.encode(x)}${F}`}function d(g,)DELIM" -R"DELIM(x=90){Mo("bech32.decode input",g);const w=g.length;if(w<8||x!==!1&&w>x)throw new TypeError(`invalid string length: ${w} (${g}). Expected (8..${x})`);const E=g.toLowerCase();if(g!==E&&g!==g.toUpperCase())throw new Error("String must be lowercase or uppercase");const R=E.lastIndexOf("1");if(R===0||R===-1)throw new Error('Letter "1" must be present between prefix and data only');const N=E.slice(0,R),F=E.slice(R+1);if(F.length<6)throw new Error("Data must be at least 6 characters long");const V=fh.decode(F).slice(0,-6),J=Vv(N,V,a);if(!F.endsWith(J))throw new Error(`Invalid checksum in ${g}: expected "${J}"`);return{prefix:N,words:V}}const m=Gv(d);function p(g){const{prefix:x,words:w}=d(g,!1);return{prefix:x,words:w,bytes:l(w)}}function b(g,x){return c(g,s(x))}return{encode:c,decode:d,encodeFromBytes:b,decodeToBytes:p,decodeUnsafe:m,fromWords:l,fromWordsUnsafe:u,toWords:s}}const Fu=Object.freeze(Bb("bech32")),dh=Object.freeze(Bb("bech32m"));function F4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Zh(e,a,i=""){const l=F4(e),s=e?.length;if(!l||a!==void 0){const c=i&&`"${i}" `,d="",m=l?`length=${s}`:`type=${typeof e}`,p=c+"expected Uint8Array"+d+", got "+m;throw l?new RangeError(p):new TypeError(p)}return e}function Xv(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function Y4(e,a){Zh(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function hh(...e){for(let a=0;a>>a}const G4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",K4=Array.from({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function Au(e){if(Zh(e),G4)return e.toHex();let a="";for(let i=0;ie(u).update(s).digest(),l=e(void 0);return i.outputLen=l.outputLen,i.blockLen=l.blockLen,i.canXOF=l.canXOF,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const X4=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function I4(e,a,i){return e&a^~e&i}function J4(e,a,i){return e&a^e&i^a&i}class W4{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,l,s){this.blockLen=a,this.outputLen=i,this.padOffset=l,this.isLE=s,this.buffer=new Uint8Array(a),this.view=Cd(this.buffer)}update(a){Xv(this),Zh(a);const{view:i,buffer:l,blockLen:s}=this,u=a.length;for(let c=0;cs-c&&(this.process(l,0),c=0);for(let g=c;gb.length)throw new Error("_sha2: outputLen bigger than state");for(let g=0;g>>3,R=ma(w,17)^ma(w,19)^w>>>10;wr[g]=R+wr[g-7]+E+wr[g-16]|0}let{A:l,B:s,C:u,D:c,E:d,F:m,G:p,H:b}=this;for(let g=0;g<64;g++){const x=ma(d,6)^ma(d,11)^ma(d,25),w=b+x+I4(d,m,p)+eR[g]+wr[g]|0,R=(ma(l,2)^ma(l,13)^ma(l,22))+J4(l,s,u)|0;b=p,p=m,m=d,d=c+w|0,c=u,u=s,s=l,l=w+R|0}l=l+this.A|0,s=s+this.B|0,u=u+this.C|0,c=c+this.D|0,d=d+this.E|0,m=m+this.F|0,p=p+this.G|0,b=b+this.H|0,this.set(l,s,u,c,d,m,p,b)}roundClean(){hh(wr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),hh(this.buffer)}}class nR extends tR{A=Sr[0]|0;B=Sr[1]|0;C=Sr[2]|0;D=Sr[3]|0;E=Sr[4]|0;F=Sr[5]|0;G=Sr[6]|0;H=Sr[7]|0;constructor(){super(32)}}const Ub=V4(()=>new nR,X4(1)),Hb=Q4(Ub),aR=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function qh(e){if(e.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(e.length/2);for(let i=0;i>>24,i=e&8388607;if(i===0||a<3)return;const l=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function Ph(e){const a=e.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 l=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return l.length===40?"p2wpkh":l.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function qo(){return"mainnet"}function Po(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function Iv(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(qh(a),1),Hb.encode(i)}function jd(e,a,i){const l=qh(i),s=Fu.toWords(l);return s.unshift(a),(a===0?Fu:dh).encode(e,s)}function $b(e,a){const i=e.toLowerCase(),l=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(l)return{address:Iv(a.p2pkh,l[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:Iv(a.p2sh,s[1]),type:"p2sh"};const u=i.match(/^zero \[([0-9a-f]{40})\]/);if(u)return{address:jd(a.hrp,0,u[1]),type:"p2wpkh"};const c=i.match(/^zero \[([0-9a-f]{64})\]/);if(c)return{address:jd(a.hrp,0,c[1]),type:"p2wsh"};const d=i.match(/^1 \[([0-9a-f]{64})\]/);return d?{address:jd(a.hrp,1,d[1]),type:"p2tr"}:{type:Ph(e)}}function lR(e,a){try{const s=Hb.decode(e),u=s[0],c=Au(s.slice(1));if(c.length===40&&u===a.p2pkh)return{scriptHex:`76a914${c}88ac`,type:"p2pkh"};if(c.length===40&&u===a.p2sh)return{scriptHex:`a914${c}87`,type:"p2sh"}}catch{}const i=e.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const s=i,u=m=>{try{return m.decode(s,90)}catch{return null}},c=u(Fu);if(c&&c.prefix===a.hrp){const m=c.words[0],)DELIM" -R"DELIM(p=Fu.fromWords(c.words.slice(1)),b=Au(p),g=p.length.toString(16).padStart(2,"0");if(m===0&&(p.length===20||p.length===32))return{scriptHex:`00${g}${b}`,type:p.length===20?"p2wpkh":"p2wsh"}}const d=u(dh);if(d&&d.prefix===a.hrp){const m=d.words[0],p=dh.fromWords(d.words.slice(1)),b=Au(p),g=p.length.toString(16).padStart(2,"0");if(m===1&&p.length===32)return{scriptHex:`51${g}${b}`,type:"p2tr"}}}return null}function Mr(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const l=lR(e,a);if(!l)return null;const s=Ub(qh(l.scriptHex)),u=Uint8Array.from(s).reverse();return{hash:Au(u),type:l.type}}function zu(e,a){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:rR(e.bits),previousBlockHash:e.previous}}function oR(e){const a=iR(e);return a&&a.length>0?a:void 0}function sR(e,a,i,l){const s=/^0{64}$/u.test(e.point.hash),u=a?$b(a.script,i):{address:void 0,type:void 0},c=a?a.value:void 0,d=a?a.script:void 0;return{index:l,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:u.address,valueSats:c,scriptType:u.type??Ph(d??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:oR(e.witness),sequence:e.sequence}}function uR(e,a,i){const l=$b(e.script,i);return{index:a,address:l.address,valueSats:e.value,scriptType:l.type??Ph(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function cR(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function pu(e,a,i,l,s){const u=e.outputs.map((b,g)=>uR(b,g,i)),c=u.reduce((b,g)=>b+g.valueSats,0),d=a.reduce((b,g)=>g?(b??0)+g.value:b,null),m=cR(l.tipHeight,l.blockHeight),p=typeof l.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:p,confirmations:m,blockHeight:l.blockHeight,blockHash:l.blockHash,receivedTime:l.timestamp,feeSats:Number.isFinite(s)?s:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:d,totalOutput:c,inputs:e.inputs.map((b,g)=>sR(b,a[g],i,g)),outputs:u}}const yu=25,tl=8,fR="/v1/top/subscribe?format=json",dR="/v1/top/subscribe?format=json&stop=true",hR=5e3,mR=2500,Nd=5e3,pR=3e5,Jv=5e3,ho=new Map,Md=new Map,Yu={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function yR(e){if(!e||typeof e!="object"||Array.isArray(e))return Yu;const a=e,i=l=>typeof a[l]=="boolean"?a[l]:Yu[l];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function bo(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e.state;if(!i||typeof i!="object"||Array.isArray(i))return null;const l=i,s=typeof l.count=="number"?l.count:void 0,u=typeof l.size=="number"?l.size:void 0,c=typeof l.weight=="number"?l.weight:void 0;return s===void 0&&u===void 0&&c===void 0?null:{count:s,size:u,weight:c}}function Cu(e){return e?.weight??e?.size}function gR(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function gu(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,l=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof l=="number"?gR(i,l):e.feeRate;return{...e,wtxid:a.wtxid||e.wtxid,feeSats:typeof a.fee=="number"?a.fee:e.feeSats,feeRate:s,size:typeof a.maximal=="number"?a.maximal:e.size,weight:typeof a.weight=="number"?a.weight:e.weight,sigops:typeof a.confirmed?.sigops=="number"?a.confirmed.sigops:e.sigops,totalInput:typeof a.value=="number"?a.value:e.totalInput,totalOutput:typeof a.spend=="number"?a.spend:e.totalOutput}}async function gn(e,a,i){const l=a.startsWith("/")?a:`/${a}`;let s=l.includes("?")?`${e}${l}`:`${e}${l}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const u=Md.get(s);if(u)return u;const c=(async()=>{const d=await fetch(s,{headers:{Accept:"application/json"}});if(!d.ok){const p=await d.text().catch(()=>"");throw new Error(`Request failed ${String(d.status)}: ${p||d.statusText}`)}const m=await d.text();try{return JSON.parse(m)}catch{return m}})();Md.set(s,c);try{return await c}finally{Md.delete(s)}}async function Ut(e,a,i){try{return await gn(e,a,i)}catch{return null}}async function Zb(e,a){const i=await gn(e,"/v1/top?format=json",a),l=typeof i=="number"?i:Number(i);if(!Number.isFinite(l))throw new Error("Invalid top height");return l}function vR(e){return/^[0-9a-f]{64}$/iu.test(e)}function bR(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e.trim()):null}function mh(e){const a=bR(e);if(a!==null)return a;if(typeof e=="string"){const s=e.trim();return vR(s)?s:null}if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e,l=[i.payload,i.top,i.block,i.header,i.hash,i.height];for(const s of l){if(s===e)continue;const u=mh(s);if(u!==null)return u}return null}function xR(e){return typeof e=="string"?Promise.resolve(e):e instanceof ArrayBuffer?Promise.resolve(new TextDecoder().decode(e)):e instanceof Blob?e.text():Promise.resolve(null)}function SR(e){const a=e.trim();if(!a)return null;try{return mh(JSON.parse(a))}catch{return mh(a)}}function wR(e){const a=e.trim();if(!a)return null;const l=/^[a-z][a-z\d+\-.]*:\/\//iu.test(a)?a:`http://${a}`,s=globalThis.window;try{const u=new URL(l,s?.location.href??"http://localhost");if(u.protocol==="http:")u.protocol="ws:";else if(u.protocol==="https:")u.protocol="wss:";else if(u.protocol!=="ws:"&&u.protocol!=="wss:")return null;return u.hash="",u.search="",u.toString()}catch{return null}}async function ei(e,a){const i=Date.now(),l=`${e}|0`,s=ho.get(l);if(s&&s.expiresAt>i)return s.promise;const u=Zb(e,a).then(c=>(ho.set(l,{promise:u,value:c,expiresAt:Date.now()+Jv}),c),c=>{throw ho.get(l)?.promise===u&&ho.delete(l),c});return ho.set(l,{promise:u,value:s?.value??null,expiresAt:i+Jv}),u}async function vu(e,a,i){if(a==="latest"||a==="tip"){const l=await ei(e,i);return{path:`/v1/block/height/${String(l)}`,height:l}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function _R(e,a){const i=new Map;return(l,s)=>{const u=`${l}:${String(s)}`,c=i.get(u);if(c)return c;const d=gn(e,`/v1/output/${l}/${String(s)}?format=json`,a).catch(()=>null);return i.set(u,d),d}}async function Wv(e,a,i,l){return gn(e,`${a}/tx/${String(i)}?format=json`,l)}async function e0(e,a){return ni(a,tl,async i=>{const[l,s]=await Promise.all([gn(e,`/v1/block/height/${String(i)}/header?format=json`),Ut(e,`/v1/block/height/${String(i)}/header/context?format=json`)]),u=bo(s);return{...zu(l,u?.count),size:Cu(u)}})}async function t0(e,a,i){const l=await Ut(e,`/v1/address/${a}/confirmed?format=json`,i);return Array.isArray(l)?l:[]}async function ER(e,a,i){const l=await Ut(e,`/v1/address/${a}?format=json`,i);return Array.isArray(l)?l:[]}const n0=25,TR=8,RR=3e4;function AR(e){if(e===void 0)return 0;const a=Number(e);return Number.isInteger(a)&&a>0?a:0}async function zR(e,a,i){const l=await Ut(e,`/v1/output/${a}/${String(i)}/spender?format=json`);return l&&typeof l.hash=="string"?l:null}async function ni(e,a,i){const l=Array.from({length:e.length});let s=0;async function u(){for(;su())),l}async function CR(e,a,i){const l=await ni(a,TR,u=>zR(e,u.point.hash,u.point.index)),s=[];for(const[u,c]of a.entries()){const{hash:d,index:m}=c.point,p=l[u];s.push({id:`in:${d}:${String(m)}`,txid:d,outputIndex:m,valueChange:c.value,direction:"received",spent:p!==null,...i===null?{}:{cursor:i}}),p&&s.push({id:`out:${d}:${String(m)}`,txid:p.hash,valueChange:-c.value,direction:"sent",...i===null?{}:{cursor:i}})}return s}function a0(e,a){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const l=Number(e);if(Number.isFinite(l))return l}let i=0;for(const l of a)i+=l.value;return i}function Od({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const l=new Set,s=new Set;let u=null,c=null,d=null,m=null,)DELIM" -R"DELIM(p=null,b=Nd,g=!1,x=!1,w="idle",E=null,R=null;const N=Po(qo());let F=null,V=null;const J=wR(e),ue=!!(J&&globalThis.WebSocket),ae=new Map;async function xe(W,de){const X=Date.now(),ge=ae.get(W);if(ge&&ge.expiresAt>X)return ge.outputs;const pe=await ER(e,W,de);return ae.set(W,{outputs:pe,expiresAt:X+RR}),pe}async function j(W,de,X){const ge=await xe(W,de),pe=AR(X),Ue=ge.slice(pe,pe+n0),je=pe+n0,He=je{const de=yR(W);return F=de,de}).catch(W=>(console.warn("Libbitcoin configuration fetch failed",W),F=Yu,Yu)),V)}function D(W){return W.address}function B(W){return D(W)&&W.turbo}function Q(){return{transport:w,websocketAvailable:ue&&!g}}function q(W){if(w===W)return;w=W;const de=Q();for(const X of s)X(de)}async function G(W){const de=typeof W=="number"?`/v1/block/height/${String(W)}`:`/v1/block/hash/${W}`,[X,ge]=await Promise.all([gn(e,`${de}/header?format=json`),Ut(e,`${de}/header/context?format=json`)]);if(R===X.hash||E!==null&&X.heightE&&await G(W)}catch(W){console.warn("Libbitcoin poller failed",W)}}function fe(){l.size!==0&&(u||(u=setInterval(()=>{re()},a)),q("polling"))}function M(){u&&(clearInterval(u),u=null)}function k(){d&&(clearTimeout(d),d=null)}function le(){m&&(clearTimeout(m),m=null)}function ce(){p&&(clearTimeout(p),p=null)}function we(){if(p||!ue||l.size===0)return;const W=b;b=Math.min(b*2,pR),p=setTimeout(()=>{p=null,!(c||l.size===0)&&(g=!1,oe())},W)}function C(){g=!0,K(!1),fe(),we()}function K(W){if(k(),!!c){x=!0;try{W&&c.readyState===1&&c.send(dR),c.close()}catch{}finally{c=null}}}function oe(){if(le(),c)return!0;if(!ue||!J||g||l.size===0)return!1;try{x=!1,c=new WebSocket(J),q("connecting")}catch(de){return console.warn("Libbitcoin websocket unavailable, falling back to polling",de),C(),!1}const W=c;return d=setTimeout(()=>{c===W&&(console.warn("Libbitcoin websocket connect timed out, falling back to polling"),C())},hR),W.addEventListener("open",()=>{if(c===W){k();try{W.send(fR),M(),g=!1,b=Nd,q("websocket")}catch(de){console.warn("Libbitcoin websocket subscribe failed, falling back to polling",de),C()}}}),W.addEventListener("message",de=>{(async()=>{try{const X=await xR(de.data);if(X===null)return;const ge=SR(X);if(ge===null)return;await G(ge)}catch(X){console.warn("Libbitcoin websocket event handling failed",X)}})()}),W.addEventListener("error",de=>{x||c!==W||(console.warn("Libbitcoin websocket failed, falling back to polling",de),C())}),W.addEventListener("close",()=>{if(!(c!==null&&c!==W)){if(k(),c===W&&(c=null),x){x=!1;return}l.size!==0&&C()}}),!0}function he(){oe()||(fe(),we())}function Ee(){le(),ce(),b=Nd,g=!1,M(),K(!0),q("idle")}function Te(){l.size>0||m||(m=setTimeout(()=>{m=null,l.size===0&&Ee()},mR))}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:ue,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return _()},async getLatestBlocks(W=10){const de=await ei(e);E=de;const X=Array.from({length:W},(pe,Ue)=>de-Ue).filter(pe=>pe>=0),ge=await e0(e,X);return ge.length>0&&(R=ge[0].hash),ge},async getBlocksBefore(W,de=10){const X=Array.from({length:de},(ge,pe)=>W-pe).filter(ge=>ge>=0);return e0(e,X)},async getBlockHeader(W){const{path:de,height:X}=await vu(e,W),ge=X===void 0?ei(e):Promise.resolve(X),[pe,Ue,je]=await Promise.all([gn(e,`${de}/header?format=json`),ge,Ut(e,`${de}/header/context?format=json`)]);E=Math.max(E??0,Ue);let He=null;pe.heightOn),Mn=(await ni(pt,tl,$t=>Wv(e,de,$t).catch(()=>null))).filter($t=>$t!==null),vl=await ni(Mn,tl,$t=>Ut(e,`/v1/tx/${$t.hash}/details?format=json`)),Qt=Mn.map(($t,On)=>{const wa=vl[On],sa=pu($t,[],N,{blockHeight:pe.height,blockHash:pe.hash,tipHeight:Ue,timestamp:pe.timestamp},typeof wa?.fee=="number"?wa.fee:void 0);return gu(sa,wa)});return{...st,size:He?.maximal??Cu(Ve),weight:He?.weight,merkleRoot:pe.merkle_root,nonce:pe.nonce,bits:pe.bits,version:pe.version,nextBlockHash:Mt,feesSats:He?.fees,subsidySats:He?.subsidy,sigops:He?.sigops,transactions:Qt}},async getBlockTransactions(W,de=0){const{path:X}=await vu(e,W),[ge,pe,Ue]=await Promise.all([gn(e,`${X}/header?format=json`),ei(e),Ut(e,`${X}/header/context?format=json`)]);E=Math.max(E??0,pe);const je=bo(Ue)?.count;if(typeof je=="number"&&de>=je)return[];const He=typeof je=="number"?Math.min(de+yu,je):de+yu,Mt=Array.from({length:Math.max(0,He-de)},(Fe,pt)=>de+pt),qe=(await ni(Mt,tl,Fe=>Wv(e,X,Fe).catch(()=>null))).filter(Fe=>Fe!==null);if(qe.length===0)return[];const st=await ni(qe,tl,Fe=>Ut(e,`/v1/tx/${Fe.hash}/details?format=json`));return qe.map((Fe,pt)=>{const nn=st[pt],Mn=pu(Fe,[],N,{blockHeight:ge.height,blockHash:ge.hash,tipHeight:pe,timestamp:ge.timestamp},typeof nn?.fee=="number"?nn.fee:void 0);return gu(Mn,nn)})},async getTransaction(W){const de=await gn(e,`/v1/tx/${W}?format=json`),X=_R(e),ge=ni(de.inputs,tl,Ve=>/^0{64}$/u.test(Ve.point.hash)?Promise.resolve(null):X(Ve.point.hash,Ve.point.index)),[pe,Ue,je,He]=await Promise.all([Ut(e,`/v1/tx/${W}/header?format=json`),ei(e).catch(()=>null),Ut(e,`/v1/tx/${W}/details?format=json`),ge]);typeof Ue=="number"&&(E=Math.max(E??0,Ue));const Mt=pu(de,He,N,{blockHeight:pe?.height,blockHash:pe?.hash,tipHeight:typeof Ue=="number"?Ue:void 0,timestamp:pe?.timestamp},typeof je?.fee=="number"?je.fee:void 0);return gu(Mt,je)},async getTransactionHeader(W){const de=await gn(e,`/v1/tx/${W}?format=json`),[X,ge,pe]=await Promise.all([Ut(e,`/v1/tx/${W}/header?format=json`),ei(e).catch(()=>null),Ut(e,`/v1/tx/${W}/details?format=json`)]);typeof ge=="number"&&(E=Math.max(E??0,ge));const Ue=pu(de,[],N,{blockHeight:X?.height,blockHash:X?.hash,tipHeight:typeof ge=="number"?ge:void 0,timestamp:X?.timestamp},typeof pe?.fee=="number"?pe.fee:void 0);return gu(Ue,pe)},async getTransactionInputScriptHex(W,de){return(await gn(e,`/v1/input/${W}/${String(de)}/script?format=text`)).trim()},async getTransactionOutputScriptHex(W,de){return(await gn(e,`/v1/output/${W}/${String(de)}/script?format=text`)).trim()},async getAddress(W){const de=Mr(W,N);if(!de)throw new Error("Unsupported address format for libbitcoin adapter");const X=F??await _();if(!D(X))throw new Error("Address endpoints are disabled by server configuration");const ge=i&&B(X),[pe,Ue]=await Promise.all([Ut(e,`/v1/address/${de.hash}/balance?format=json`,ge),t0(e,de.hash,ge)]),je=a0(pe,Ue),He=await j(de.hash,ge);return{address:W,addressType:de.type,balance:je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ue.length,transactions:He}},async getAddressSummary(W){const de=Mr(W,N);if(!de)throw new Error("Unsupported address format for libbitcoin adapter");const X=F??await _();)DELIM" -R"DELIM(if(!D(X))throw new Error("Address endpoints are disabled by server configuration");const ge=i&&B(X),[pe,Ue]=await Promise.all([Ut(e,`/v1/address/${de.hash}/balance?format=json`,ge),t0(e,de.hash,ge)]),je=a0(pe,Ue);return{address:W,addressType:de.type,balance:je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ue.length}},async getAddressTransactions(W,de){const X=Mr(W,N);if(!X)return[];const ge=F??await _();if(!D(ge))return[];const pe=i&&B(ge);return j(X.hash,pe,de)},subscribeToEvents(W){return le(),l.add(W),he(),()=>{l.delete(W),Te()}},getEventStatus:Q,subscribeToEventStatus(W){return s.add(W),W(Q()),()=>{s.delete(W)}}}}const qb=T.createContext(null),Pb=T.createContext(null),Qb=T.createContext(null);function jR({children:e,client:a}){return v.jsx(qb.Provider,{value:a,children:e})}function NR({children:e,provider:a,setProvider:i,availableProviders:l,selectorVisible:s,setSelectorVisible:u}){return v.jsx(Pb.Provider,{value:{provider:a,setProvider:i,availableProviders:l,selectorVisible:s,setSelectorVisible:u},children:e})}function MR({children:e,turbo:a,setTurbo:i}){return v.jsx(Qb.Provider,{value:{turbo:a,setTurbo:i},children:e})}function Ka(){const e=T.useContext(qb);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function Qo(){return Ka().metadata}function Fb(){const e=T.useContext(Pb);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function Yb(){const e=T.useContext(Qb);if(!e)throw new Error("TurboProvider missing in component tree");return e}function kd(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function OR(e,a){if(e==="blockstream")return Nb({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return U4({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const l=kd();return Od({baseUrl:l,turbo:a?.turboEnabled})}if(e==="external"){console.warn("No external API URL provided, falling back to libbitcoin provider");const l=kd();return Od({baseUrl:l,turbo:a?.turboEnabled})}console.warn(`Unknown provider "${e}", falling back to libbitcoin provider`);const i=kd();return Od({baseUrl:i,turbo:a?.turboEnabled})}function kR(){return[...new Set(["libbitcoin","blockstream","mempool"])]}const Dd=10,DR=20;function Gb(e){return e.metadata.endpoint?{providerId:e.metadata.id,endpoint:e.metadata.endpoint}:{providerId:e.metadata.id}}function LR(e,a){if(!e||typeof e!="object"||Array.isArray(e))return!1;const i=e;return i.providerId===a.providerId&&i.endpoint===a.endpoint}function BR(e,a){if(!e||typeof e!="object"||Array.isArray(e))return a;const i=e.limit;return typeof i=="number"&&Number.isFinite(i)&&i>0?i:a}function UR(e,a,i){const l=e.getQueryCache().findAll({predicate:s=>{const u=s.queryKey;return u.length>=4&&LR(u[0],a)&&u[1]==="blocks"&&u[2]==="latest"}});for(const s of l){const u=BR(s.queryKey[3],Dd);e.setQueryData(s.queryKey,c=>[i,...(c??[]).filter(p=>p.hash!==i.hash)].slice(0,u))}e.setQueryData([a,"blocks","latest",{limit:Dd}],s=>[i,...(s??[]).filter(d=>d.hash!==i.hash)].slice(0,Dd))}function HR(e,a,i){e.setQueryData([a,"transactions","recent"],l=>[i,...(l??[]).filter(c=>c.txid!==i.txid)].slice(0,DR))}function $R(e,a,i){i.type==="block.new"&&UR(e,a,i.payload),i.type==="tx.new"&&HR(e,a,i.payload)}function Vn({queryKey:e,queryFn:a,enabled:i,staleTime:l,initialData:s}){const u=Ka();return Xw({queryKey:[Gb(u),...e],queryFn:()=>a(u),enabled:i,staleTime:l,initialData:s})}function Kb(e=10){return Vn({queryKey:["blocks","latest",{limit:e}],queryFn:a=>a.getLatestBlocks(e)})}function Vb(){return Vn({queryKey:["configuration"],queryFn:e=>e.getConfiguration(),staleTime:6e4})}function Xb(e){return Vn({queryKey:["block",e,"header"],queryFn:a=>a.getBlockHeader(e)})}function Ib(e,a){return Vn({queryKey:["block",e,"stats"],queryFn:i=>i.getBlockStats(e),enabled:(a?.enabled??!0)&&!!e.trim(),staleTime:1/0})}function ZR(e,a=0){return Vn({queryKey:["block",e,"transactions",{startIndex:a}],queryFn:i=>i.getBlockTransactions(e,a)})}function qR(e){return Vn({queryKey:["transaction",e,"header"],queryFn:a=>a.getTransactionHeader(e),enabled:!!e.trim()})}function PR(e,a){return Vn({queryKey:["transaction",e],queryFn:i=>i.getTransaction(e),enabled:a?.enabled??!!e.trim()})}function QR(e,a,i){return Vn({queryKey:["transaction",e,"input",a,"scriptHex"],queryFn:l=>l.getTransactionInputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function FR(e,a,i){return Vn({queryKey:["transaction",e,"output",a,"scriptHex"],queryFn:l=>l.getTransactionOutputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function YR(e){return Vn({queryKey:["address",e,"summary"],queryFn:a=>a.getAddressSummary(e),enabled:!!e.trim()})}function GR(e,a){return Vn({queryKey:["address",e,"transactions",{lastSeenTxid:null}],queryFn:i=>i.getAddressTransactions(e,a),enabled:!!e.trim()})}function KR(e){const a=Ka(),i=T.useRef(e);T.useEffect(()=>{i.current=e},[e]),T.useEffect(()=>{const l=a.subscribeToEvents(s=>{i.current(s)});return()=>{l()}},[a])}function VR(){const e=Ka(),a=T.useMemo(()=>({transport:e.metadata.supportsWebsocket?"websocket":"polling",websocketAvailable:e.metadata.supportsWebsocket}),[e.metadata.supportsWebsocket]),[i,l]=T.useState(()=>e.getEventStatus?e.getEventStatus():a);return T.useEffect(()=>{const s=e.getEventStatus?e.getEventStatus():a;return l(s),e.subscribeToEventStatus?.(l)},[e,a]),i}function XR(){const e=Ka(),a=T.useMemo(()=>Gb(e),[e]),i=Iu(),l=T.useCallback(s=>{$R(i,a,s)},[i,a]);return KR(l),null}function IR(e=10){const{data:a,isLoading:i,isError:l,error:s}=Kb(e),{data:u=[]}=Vn({queryKey:["transactions","recent"],queryFn:()=>Promise.resolve([]),enabled:!1,initialData:[]});return{data:a,recentTransactions:u,isLoading:i,isError:l,error:s}}function Ld(e){return globalThis.window?.localStorage.getItem(e)??null}function Bd(e,a){globalThis.window?.localStorage.setItem(e,a)}function JR({children:e}){const a="libbitcoin",i=kR(),[l,s]=T.useState(()=>Ld("turboEnabled")==="true"),[u,c]=T.useState(()=>{const g=Ld("blockchainProvider");return g&&i.includes(g)?g:a}),[d,m]=T.useState(()=>Ld("providerSelectorVisible")==="true"),[p]=T.useState(()=>new Bw({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),b=T.useMemo(()=>OR(u,{turboEnabled:l}),[u,l]);return T.useEffect(()=>{Bd("turboEnabled",l?"true":"false")},[l]),T.useEffect(()=>{Bd("blockchainProvider",u)},[u]),T.useEffect(()=>{Bd("providerSelectorVisible",d?"true":"false")},[d]),v.jsx(NR,{provider:u,setProvider:c,availableProviders:i,selectorVisible:d,setSelectorVisible:m,children:v.jsx(MR,{turbo:l,setTurbo:s,children:v.jsx(jR,{client:b,children:v.jsxs(Uw,{client:p,children:[v.jsx(XR,{}),e,null]})})})})}var Jb=e=>{throw TypeError(e)},Wb=(e,a,i)=>a.has(e)||Jb("Cannot "+i),Qn=(e,a,i)=>(Wb(e,a,"read from private field"),i?i.call(e):a.get(e)),xo=(e,a,i)=>a.has(e)?Jb("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),pa=(e,a,i,l)=>(Wb(e,a,"write to private field"),a.set(e,i),i),nc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Qh=/^[\\/]{2}/;function ex(e,a){return a+e.replace(/\\/g,"/")}var r0="popstate";function i0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function WR(e={}){function a(l,s){let u=s.state?.masked,{pathname:c,search:d,hash:m}=u||l.location;return Oo("",{pathname:c,search:d,hash:m},s.state&&s.state.usr||null,s.state&&s.state.key||"default",u?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,s){return typeof s=="string"?s:ba(s)}return t3(a,i,null,e)}function De(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function Tt(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function e3(){return Math.random().toString(36).substring(2,10)}function l0(e,a){return{usr:e.state,key:e.key,idx:a,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Oo(e,a,i=null,l,)DELIM" -R"DELIM(s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?xa(a):a,state:i,key:a&&a.key||l||e3(),mask:s}}function ba({pathname:e="/",search:a="",hash:i=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function xa(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function t3(e,a,i,l={}){let{window:s=document.defaultView,v5Compat:u=!1}=l,c=s.history,d="POP",m=null,p=b();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function b(){return(c.state||{idx:null}).idx}function g(){d="POP";let N=b(),F=N==null?null:N-p;p=N,m&&m({action:d,location:R.location,delta:F})}function x(N,F){d="PUSH";let V=i0(N)?N:Oo(R.location,N,F);p=b()+1;let J=l0(V,p),ue=R.createHref(V.mask||V);try{c.pushState(J,"",ue)}catch(ae){if(ae instanceof DOMException&&ae.name==="DataCloneError")throw ae;s.location.assign(ue)}u&&m&&m({action:d,location:R.location,delta:1})}function w(N,F){d="REPLACE";let V=i0(N)?N:Oo(R.location,N,F);p=b();let J=l0(V,p),ue=R.createHref(V.mask||V);c.replaceState(J,"",ue),u&&m&&m({action:d,location:R.location,delta:0})}function E(N){return tx(s,N)}let R={get action(){return d},get location(){return e(s,c)},listen(N){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(r0,g),m=N,()=>{s.removeEventListener(r0,g),m=null}},createHref(N){return a(s,N)},createURL:E,encodeLocation(N){let F=E(N);return{pathname:F.pathname,search:F.search,hash:F.hash}},push:x,replace:w,go(N){return c.go(N)}};return R}function tx(e,a,i=!1){let l="http://localhost";e&&(l=e.location.origin!=="null"?e.location.origin:e.location.href),De(l,"No window.location.(origin|href) available to create URL");let s=typeof a=="string"?a:ba(a);return s=s.replace(/ $/,"%20"),!i&&Qh.test(s)&&(s=l+s),new URL(s,l)}var So,o0=class{constructor(e){if(xo(this,So,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(Qn(this,So).has(e))return Qn(this,So).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){Qn(this,So).set(e,a)}};So=new WeakMap;var n3=new Set(["lazy","caseSensitive","path","id","index","children"]);function a3(e){return n3.has(e)}var r3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function i3(e){return r3.has(e)}function l3(e){return e.index===!0}function ko(e,a,i=[],l={},s=!1){return e.map((u,c)=>{let d=[...i,String(c)],m=typeof u.id=="string"?u.id:d.join("-");if(De(u.index!==!0||!u.children,"Cannot specify children on an index route"),De(s||!l[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),l3(u)){let p={...u,id:m};return l[m]=s0(p,a(p)),p}else{let p={...u,id:m,children:void 0};return l[m]=s0(p,a(p)),u.children&&(p.children=ko(u.children,a,d,l,s)),p}})}function s0(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function nx(e,a,i="/"){return la(e,a,i,!1)}function la(e,a,i,l,s){let u=typeof a=="string"?xa(a):a,c=Gn(u.pathname||"/",i);if(c==null)return null;let d=s??ju(e),m=null,p=v3(c);for(let b=0;m==null&&b{let b={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(l)&&m)return;De(b.relativePath.startsWith(l),`Absolute route path "${b.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(l.length)}let g=Yn([l,b.relativePath]),x=i.concat(b);c.children&&c.children.length>0&&(De(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),ax(c.children,a,x,g,m)),!(c.path==null&&!c.index)&&a.push({path:g,score:p3(g,c.index),routesMeta:x.map((w,E)=>{let[R,N]=lx(w.relativePath,w.caseSensitive,E===x.length-1);return{...w,matcher:R,compiledParams:N}})})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))u(c,d);else for(let m of rx(c.path))u(c,d,!0,m)}),a}function rx(e){let a=e.split("/");if(a.length===0)return[];let[i,...l]=a,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return s?[u,""]:[u];let c=rx(l.join("/")),d=[];return d.push(...c.map(m=>m===""?u:[u,m].join("/"))),s&&d.push(...c),d.map(m=>e.startsWith("/")&&m===""?"/":m)}function s3(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:y3(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var u3=/^:[\w-]+$/,c3=3,f3=2,d3=1,h3=10,m3=-2,u0=e=>e==="*";function p3(e,a){let i=e.split("/"),l=i.length;return i.some(u0)&&(l+=m3),a&&(l+=f3),i.filter(s=>!u0(s)).reduce((s,u)=>s+(u3.test(u)?c3:u===""?d3:h3),l)}function y3(e,a){return e.length===a.length&&e.slice(0,-1).every((l,s)=>l===a[s])?e[e.length-1]-a[a.length-1]:0}function g3(e,a,i=!1){let{routesMeta:l}=e,s={},u="/",c=[];for(let d=0;d{if(b==="*"){let E=d[x]||"";c=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const w=d[x];return g&&!w?p[b]=void 0:p[b]=(w||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:c,pattern:e}}function lx(e,a=!1,i=!0){Tt(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 l=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,m,p,b)=>{if(l.push({paramName:d,isOptional:m!=null}),m){let g=b.charAt(p+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),l]}function v3(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Tt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),e}}function Gn(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=e.charAt(i);return l&&l!=="/"?null:e.slice(i)||"/"}function b3({basename:e,pathname:a}){return a==="/"?e:Yn([e,a])}var Fh=e=>nc.test(e);function x3(e,a="/"){let{pathname:i,search:l="",hash:s=""}=typeof e=="string"?xa(e):e,u;return i?(i=Yh(i),i.startsWith("/")?u=c0(i.substring(1),"/"):u=c0(i,a)):u=a,{pathname:u,search:w3(l),hash:_3(s)}}function c0(e,a){let i=Ku(a).split("/");)DELIM" -R"DELIM(return e.split("/").forEach(s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function Ud(e,a,i,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. 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 ox(e){return e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function ac(e){let a=ox(e);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function Fo(e,a,i,l=!1){let s;typeof e=="string"?s=xa(e):(s={...e},De(!s.pathname||!s.pathname.includes("?"),Ud("?","pathname","search",s)),De(!s.pathname||!s.pathname.includes("#"),Ud("#","pathname","hash",s)),De(!s.search||!s.search.includes("#"),Ud("#","search","hash",s)));let u=e===""||s.pathname==="",c=u?"/":s.pathname,d;if(c==null)d=i;else{let g=a.length-1;if(!l&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}d=g>=0?a[g]:"/"}let m=x3(s,d),p=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(p||b)&&(m.pathname+="/"),m}var Yh=e=>e.replace(/[\\/]{2,}/g,"/"),Yn=e=>Yh(e.join("/")),Ku=e=>e.replace(/\/+$/,""),S3=e=>Ku(e).replace(/^\/*/,"/"),w3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,E3=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yo=class{constructor(e,a,i,l=!1){this.status=e,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Do(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Go(e){let a=e.map(i=>i.route.path).filter(Boolean);return Yn(a)||"/"}var sx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ux(e,a){let i=e;if(typeof i!="string"||!nc.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,s=!1;if(sx)try{let u=new URL(window.location.href),c=Qh.test(i)?new URL(ex(i,u.protocol)):new URL(i),d=Gn(c.pathname,a);c.origin===u.origin&&d!=null?i=d+c.search+c.hash:s=!0}catch{Tt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:s,to:i}}var jr=Symbol("Uninstrumented");function T3(e,a){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:a.id,index:a.index,path:a.path,instrument(u){let c=Object.keys(i);for(let d of c)u[d]&&i[d].push(u[d])}}));let l={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=ll(i.lazy,a.lazy,()=>{});s&&(l.lazy=s)}if(typeof a.lazy=="object"){let s=a.lazy;["middleware","loader","action"].forEach(u=>{let c=s[u],d=i[`lazy.${u}`];if(typeof c=="function"&&d.length>0){let m=ll(d,c,()=>{});m&&(l.lazy=Object.assign(l.lazy||{},{[u]:m}))}})}return["loader","action"].forEach(s=>{let u=a[s];if(typeof u=="function"&&i[s].length>0){let c=u[jr]??u,d=ll(i[s],c,(...m)=>f0(m[0]));d&&(s==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[jr]=c,l[s]=d)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(l.middleware=a.middleware.map(s=>{let u=s[jr]??s,c=ll(i.middleware,u,(...d)=>f0(d[0]));return c?(c[jr]=u,c):s})),l}function R3(e,a){let i={navigate:[],fetch:[]};if(a.forEach(l=>l({instrument(s){let u=Object.keys(s);for(let c of u)s[c]&&i[c].push(s[c])}})),i.navigate.length>0){let l=e.navigate[jr]??e.navigate,s=ll(i.navigate,l,(...u)=>{let[c,d]=u;return{to:typeof c=="number"||typeof c=="string"?c:c?ba(c):".",...d0(e,d??{})}});s&&(s[jr]=l,e.navigate=s)}if(i.fetch.length>0){let l=e.fetch[jr]??e.fetch,s=ll(i.fetch,l,(...u)=>{let[c,,d,m]=u;return{href:d??".",fetcherKey:c,...d0(e,m??{})}});s&&(s[jr]=l,e.fetch=s)}return e}function ll(e,a,i){return e.length===0?null:async(...l)=>{let s=await cx(e,i(...l),()=>a(...l),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function cx(e,a,i,l){let s=e[l],u;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=cx(e,a,i,l-1),u=await c,De(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await s(d,a)}catch(m){console.error("An instrumentation function threw an error:",m)}c||await d(),await c}else try{u={type:"success",value:await i()}}catch(c){u={type:"error",value:c}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function f0(e){let{request:a,context:i,params:l,pattern:s}=e;return{request:A3(a),params:{...l},pattern:s,context:z3(i)}}function d0(e,a){return{currentUrl:ba(e.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 A3(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function z3(e){if(j3(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var C3=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function j3(e){if(e===null||typeof e!="object")return!1;const a=Object.getPrototypeOf(e);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===C3}var fx=["POST","PUT","PATCH","DELETE"],N3=new Set(fx),M3=["GET",...fx],O3=new Set(M3),dx=new Set([301,302,303,307,308]),k3=new Set([307,308]),Hd={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},D3={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},L3=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),hx="remix-router-transitions",mx=Symbol("ResetLoaderData"),ti,nl,Rr,al,B3=class{constructor(e){xo(this,ti),xo(this,nl),xo(this,Rr),xo(this,al),pa(this,ti,e),pa(this,nl,ju(e))}get stableRoutes(){return Qn(this,ti)}get activeRoutes(){return Qn(this,Rr)??Qn(this,ti)}get branches(){return Qn(this,al)??Qn(this,nl)}get hasHMRRoutes(){return Qn(this,Rr)!=null}setRoutes(e){pa(this,ti,e),pa(this,nl,ju(e))}setHmrRoutes(e){pa(this,Rr,e),pa(this,al,ju(e))}commitHmrRoutes(){Qn(this,Rr)&&(pa(this,ti,Qn(this,Rr)),pa(this,nl,Qn(this,al)),pa(this,Rr,void 0),pa(this,al,void 0))}};ti=new WeakMap;nl=new WeakMap;Rr=new WeakMap;al=new WeakMap;function U3(e){const a=e.window?e.window:typeof window<"u"?window:void 0,i=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";De(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l=e.hydrationRouteProperties||[],s=e.mapRouteProperties||L3,u=s;if(e.instrumentations){let z=e.instrumentations;u=L=>({...s(L),...T3(z.map(Z=>Z.route).filter(Boolean),L)})}let c={},d=new B3(ko(e.routes,u,void 0,c)),m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let p=e.dataStrategy||P3,b={...e.future},g=null,x=new Set,w=null,E=null,R=null,N=null,F=e.hydrationData!=null,V=la(d.activeRoutes,e.history.location,m,!1,d.branches),J=!1,ue=null,ae,xe;if(V==null&&!e.patchRoutesOnNavigation){let z=Fn(404,{pathname:e.history.location.pathname}),{matches:L,route:Z}=bu(d.activeRoutes);ae=!0,xe=!ae,V=L,ue={[Z.id]:z}}else if(V&&!e.hydrationData&&Xa(V,d.activeRoutes,e.history.location.pathname).active&&(V=null),V)if(V.some(z=>z.route.lazy))ae=!1,xe=!ae;else if(!V.some(z=>Gh(z.route)))ae=!0,xe=!ae;else{let z=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null,Z=V;if(L){let ie=V.findIndex(se=>L[se.route.id]!==void 0);Z=Z.slice(0,ie+1)}xe=!1,ae=!0,Z.forEach(ie=>{let se=px(ie.route,z,L);xe=xe||se.renderFallback,ae=ae&&!se.shouldLoad})}else{ae=!1,xe=!ae,V=[];let z=Xa(null,d.activeRoutes,e.history.location.pathname);)DELIM" -R"DELIM(z.active&&z.matches&&(J=!0,V=z.matches)}let j,_={historyAction:e.history.action,location:e.history.location,matches:V,initialized:ae,renderFallback:xe,navigation:Hd,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||ue,fetchers:new Map,blockers:new Map},D="POP",B=null,Q=!1,q,G=!1,re=new Map,fe=null,M=!1,k=!1,le=new Set,ce=new Map,we=0,C=-1,K=new Map,oe=new Set,he=new Map,Ee=new Map,Te=new Set,W=new Map,de,X=null;function ge(){if(g=e.history.listen(({action:z,location:L,delta:Z})=>{if(de){de(),de=void 0;return}Tt(W.size===0||Z!=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 ie=Br({currentLocation:_.location,nextLocation:L,historyAction:z});if(ie&&Z!=null){let se=new Promise(be=>{de=be});e.history.go(Z*-1),Ea(ie,{state:"blocked",location:L,proceed(){Ea(ie,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),se.then(()=>e.history.go(Z))},reset(){let be=new Map(_.blockers);be.set(ie,mo),je({blockers:be})}}),B?.resolve(),B=null;return}return qe(z,L)}),i){sA(a,re);let z=()=>uA(a,re);a.addEventListener("pagehide",z),fe=()=>a.removeEventListener("pagehide",z)}return _.initialized||qe("POP",_.location,{initialHydration:!0}),j}function pe(){g&&g(),fe&&fe(),x.clear(),q&&q.abort(),_.fetchers.forEach((z,L)=>_a(_.fetchers,L)),_.blockers.forEach((z,L)=>Lr(L))}function Ue(z){if(x.add(z),w){let{newErrors:L}=w;w=null,z(_,{deletedFetchers:[],newErrors:L,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(z)}function je(z,L={}){z.matches&&(z.matches=z.matches.map(se=>{let be=c[se.route.id],me=se.route;return me.element!==be.element||me.errorElement!==be.errorElement||me.hydrateFallbackElement!==be.hydrateFallbackElement?{...se,route:be}:se})),_={..._,...z};let Z=[],ie=[];_.fetchers.forEach((se,be)=>{se.state==="idle"&&(Te.has(be)?Z.push(be):ie.push(be))}),Te.forEach(se=>{!_.fetchers.has(se)&&!ce.has(se)&&Z.push(se)}),x.size===0&&(w={newErrors:z.errors??null}),[...x].forEach(se=>se(_,{deletedFetchers:Z,newErrors:z.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),Z.forEach(se=>_a(_.fetchers,se)),ie.forEach(se=>_.fetchers.delete(se))}function He(z,L,{flushSync:Z}={}){let ie=_.actionData!=null&&_.navigation.formMethod!=null&&tn(_.navigation.formMethod)&&_.navigation.state==="loading"&&z.state?._isRedirect!==!0,se;L.actionData?Object.keys(L.actionData).length>0?se=L.actionData:se=null:ie?se=_.actionData:se=null;let be=L.loaderData?w0(_.loaderData,L.loaderData,L.matches||[],L.errors):_.loaderData,me=_.blockers;me.size>0&&(me=new Map(me),me.forEach((ze,Le)=>me.set(Le,mo)));let ve=M?!1:bl(z,L.matches||_.matches),ye=Q===!0||_.navigation.formMethod!=null&&tn(_.navigation.formMethod)&&z.state?._isRedirect!==!0;d.commitHmrRoutes(),M||D==="POP"||(D==="PUSH"?e.history.push(z,z.state):D==="REPLACE"&&e.history.replace(z,z.state));let Ae;if(D==="POP"){let ze=re.get(_.location.pathname);ze&&ze.has(z.pathname)?Ae={currentLocation:_.location,nextLocation:z}:re.has(z.pathname)&&(Ae={currentLocation:z,nextLocation:_.location})}else if(G){let ze=re.get(_.location.pathname);ze?ze.add(z.pathname):(ze=new Set([z.pathname]),re.set(_.location.pathname,ze)),Ae={currentLocation:_.location,nextLocation:z}}je({...L,actionData:se,loaderData:be,historyAction:D,location:z,initialized:!0,renderFallback:!1,navigation:Hd,revalidation:"idle",restoreScrollPosition:ve,preventScrollReset:ye,blockers:me},{viewTransitionOpts:Ae,flushSync:Z===!0}),D="POP",Q=!1,G=!1,M=!1,k=!1,B?.resolve(),B=null,X?.resolve(),X=null}async function Mt(z,L){if(B?.resolve(),B=null,typeof z=="number"){B||(B=R0());let We=B.promise;return e.history.go(z),We}let Z=ph(_.location,_.matches,m,z,L?.fromRouteId,L?.relative),{path:ie,submission:se,error:be}=h0(!1,Z,L),me;L?.mask&&(me={pathname:"",search:"",hash:"",...typeof L.mask=="string"?xa(L.mask):{..._.location.mask,...L.mask}});let ve=_.location,ye=Oo(ve,ie,L&&L.state,void 0,me);ye={...ye,...e.history.encodeLocation(ye)};let Ae=L&&L.replace!=null?L.replace:void 0,ze="PUSH";Ae===!0?ze="REPLACE":Ae===!1||se!=null&&tn(se.formMethod)&&se.formAction===_.location.pathname+_.location.search&&(ze="REPLACE");let Le=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Me=(L&&L.flushSync)===!0,Ze=Br({currentLocation:ve,nextLocation:ye,historyAction:ze});if(Ze){Ea(Ze,{state:"blocked",location:ye,proceed(){Ea(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),Mt(z,L)},reset(){let We=new Map(_.blockers);We.set(Ze,mo),je({blockers:We})}});return}await qe(ze,ye,{submission:se,pendingError:be,preventScrollReset:Le,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Me,callSiteDefaultShouldRevalidate:L&&L.defaultShouldRevalidate})}function Ve(){X||(X=R0()),sa(),je({revalidation:"loading"});let z=X.promise;return _.navigation.state==="submitting"?z:_.navigation.state==="idle"?(qe(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),z):(qe(D||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:G===!0}),z)}async function qe(z,L,Z){q&&q.abort(),q=null,D=z,M=(Z&&Z.startUninterruptedRevalidation)===!0,dc(_.location,_.matches),Q=(Z&&Z.preventScrollReset)===!0,G=(Z&&Z.enableViewTransition)===!0;let ie=d.activeRoutes,se=Z?.initialHydration&&_.matches&&_.matches.length>0&&!J?_.matches:la(ie,L,m,!1,d.branches),be=(Z&&Z.flushSync)===!0;if(se&&_.initialized&&!k&&J3(_.location,L)&&!(Z&&Z.submission&&tn(Z.submission.formMethod))){He(L,{matches:se},{flushSync:be});return}let me=Xa(se,ie,L.pathname);if(me.active&&me.matches&&(se=me.matches),!se){let{error:rt,notFoundMatches:Xe,route:Rt}=Jn(L.pathname);He(L,{matches:Xe,loaderData:{},errors:{[Rt.id]:rt}},{flushSync:be});return}let ve=Z&&Z.overrideNavigation?{...Z.overrideNavigation,matches:se,historyAction:z}:void 0;q=new AbortController;let ye=rl(e.history,L,q.signal,Z&&Z.submission),Ae=e.getContext?await e.getContext():new o0,ze;if(Z&&Z.pendingError)ze=[Cr(se).route.id,{type:"error",error:Z.pendingError}];else if(Z&&Z.submission&&tn(Z.submission.formMethod)){let rt=await st(ye,L,Z.submission,se,z,Ae,me.active,Z&&Z.initialHydration===!0,{replace:Z.replace,flushSync:be});if(rt.shortCircuited)return;if(rt.pendingActionResult){let[Xe,Rt]=rt.pendingActionResult;if(Cn(Rt)&&Do(Rt.error)&&Rt.error.status===404){q=null,He(L,{matches:rt.matches,loaderData:{},errors:{[Xe]:Rt.error}});return}}se=rt.matches||se,ze=rt.pendingActionResult,ve=$d(L,se,z,Z.submission),be=!1,me.active=!1,ye=rl(e.history,ye.url,ye.signal)}let{shortCircuited:Le,matches:Me,loaderData:Ze,errors:We,workingFetchers:yt}=await Fe(ye,L,se,z,Ae,me.active,ve,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,be,ze,Z&&Z.callSiteDefaultShouldRevalidate);Le||(q=null,He(L,{matches:Me||se,..._0(ze),loaderData:Ze,errors:We,...yt?{fetchers:yt}:{}}))}async function st(z,L,Z,ie,se,be,me,ve,ye={}){sa();let Ae=lA(L,ie,se,Z);if(je({navigation:Ae},{flushSync:ye.flushSync===!0}),me){let Me=await ua(ie,L.pathname,z.signal);if(Me.type==="aborted")return{shortCircuited:!0};if(Me.type==="error"){if(Me.partialMatches.length===0){let{matches:We,route:yt}=bu(d.activeRoutes);return{matches:We,pendingActionResult:[yt.id,{type:"error",error:Me.error}]}}let Ze=Cr(Me.partialMatches).route.id;return{matches:Me.partialMatches,pendingActionResult:[Ze,{type:"error",error:Me.error}]}}else if(Me.matches)ie=Me.matches;else{let{notFoundMatches:Ze,error:We,route:yt}=Jn(L.pathname);return{matches:Ze,)DELIM" -R"DELIM(pendingActionResult:[yt.id,{type:"error",error:We}]}}}let ze,Le=Nu(ie,L);if(!Le.route.action&&!Le.route.lazy)ze={type:"error",error:Fn(405,{method:z.method,pathname:L.pathname,routeId:Le.route.id})};else{let Me=ul(u,c,z,L,ie,Le,ve?[]:l,be),Ze=await On(z,L,Me,be,null);if(ze=Ze[Le.route.id],!ze){for(let We of ie)if(Ze[We.route.id]){ze=Ze[We.route.id];break}}if(z.signal.aborted)return{shortCircuited:!0}}if(ii(ze)){let Me;return ye&&ye.replace!=null?Me=ye.replace:Me=b0(ze.response.headers.get("Location"),new URL(z.url),m,e.history)===_.location.pathname+_.location.search,await $t(z,ze,!0,{submission:Z,replace:Me}),{shortCircuited:!0}}if(Cn(ze)){let Me=Cr(ie,Le.route.id);return(ye&&ye.replace)!==!0&&(D="PUSH"),{matches:ie,pendingActionResult:[Me.route.id,ze,Le.route.id]}}return{matches:ie,pendingActionResult:[Le.route.id,ze]}}async function Fe(z,L,Z,ie,se,be,me,ve,ye,Ae,ze,Le,Me,Ze){let We=me||$d(L,Z,ie,ve),yt=ve||ye||T0(We),rt=!M&&!ze;if(be){if(rt){let ht=pt(Me);je({navigation:We,...ht!==void 0?{actionData:ht}:{}},{flushSync:Le})}let Oe=await ua(Z,L.pathname,z.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){if(Oe.partialMatches.length===0){let{matches:xn,route:ta}=bu(d.activeRoutes);return{matches:xn,loaderData:{},errors:{[ta.id]:Oe.error}}}let ht=Cr(Oe.partialMatches).route.id;return{matches:Oe.partialMatches,loaderData:{},errors:{[ht]:Oe.error}}}else if(Oe.matches)Z=Oe.matches;else{let{error:ht,notFoundMatches:xn,route:ta}=Jn(L.pathname);return{matches:xn,loaderData:{},errors:{[ta.id]:ht}}}}let Xe=d.activeRoutes,{dsMatches:Rt,revalidatingFetchers:Ie}=m0(z,se,u,c,e.history,_,Z,yt,L,ze?[]:l,ze===!0,k,le,Te,he,oe,Xe,m,e.patchRoutesOnNavigation!=null,d.branches,Me,Ze);if(C=++we,!e.dataStrategy&&!Rt.some(Oe=>Oe.shouldLoad)&&!Rt.some(Oe=>Oe.route.middleware&&Oe.route.middleware.length>0)&&Ie.length===0){let Oe=new Map(_.fetchers),ht=Io(Oe);return He(L,{matches:Z,loaderData:{},errors:Me&&Cn(Me[1])?{[Me[0]]:Me[1].error}:null,..._0(Me),...ht?{fetchers:Oe}:{}},{flushSync:Le}),{shortCircuited:!0}}if(rt){let Oe={};if(!be){Oe.navigation=We;let ht=pt(Me);ht!==void 0&&(Oe.actionData=ht)}Ie.length>0&&(Oe.fetchers=nn(Ie)),je(Oe,{flushSync:Le})}Ie.forEach(Oe=>{qt(Oe.key),Oe.controller&&ce.set(Oe.key,Oe.controller)});let Ia=()=>Ie.forEach(Oe=>qt(Oe.key));q&&q.signal.addEventListener("abort",Ia);let{loaderResults:Wn,fetcherResults:cn}=await wa(Rt,Ie,z,L,se);if(z.signal.aborted)return{shortCircuited:!0};q&&q.signal.removeEventListener("abort",Ia),Ie.forEach(Oe=>ce.delete(Oe.key));let rn=xu(Wn);if(rn)return await $t(z,rn.result,!0,{replace:Ae}),{shortCircuited:!0};if(rn=xu(cn),rn)return oe.add(rn.key),await $t(z,rn.result,!0,{replace:Ae}),{shortCircuited:!0};let Dn=new Map(_.fetchers),{loaderData:mi,errors:ea}=S0(_,Z,Wn,Me,Ie,cn,Dn);ze&&_.errors&&(ea={..._.errors,...ea});let pi=Io(Dn),Ta=Jo(C,Dn),Ra=pi||Ta||Ie.length>0;return{matches:Z,loaderData:mi,errors:ea,...Ra?{workingFetchers:Dn}:{}}}function pt(z){if(z&&!Cn(z[1]))return{[z[0]]:z[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function nn(z){let L=new Map(_.fetchers);return z.forEach(Z=>{let ie=L.get(Z.key),se=po(void 0,ie?ie.data:void 0);L.set(Z.key,se)}),L}async function Mn(z,L,Z,ie){qt(z);let se=(ie&&ie.flushSync)===!0,be=d.activeRoutes,me=ph(_.location,_.matches,m,Z,L,ie?.relative),ve=la(be,me,m,!1,d.branches),ye=Xa(ve,be,me);if(ye.active&&ye.matches&&(ve=ye.matches),!ve){kn(z,L,Fn(404,{pathname:me}),{flushSync:se});return}let{path:Ae,submission:ze,error:Le}=h0(!0,me,ie);if(Le){kn(z,L,Le,{flushSync:se});return}let Me=e.getContext?await e.getContext():new o0,Ze=(ie&&ie.preventScrollReset)===!0;if(ze&&tn(ze.formMethod)){await vl(z,L,Ae,ve,Me,ye.active,se,Ze,ze,ie&&ie.defaultShouldRevalidate);return}he.set(z,{routeId:L,path:Ae}),await Qt(z,L,Ae,ve,Me,ye.active,se,Ze,ze)}async function vl(z,L,Z,ie,se,be,me,ve,ye,Ae){sa(),he.delete(z);let ze=_.fetchers.get(z);In(z,oA(ye,ze),{flushSync:me});let Le=new AbortController,Me=rl(e.history,Z,Le.signal,ye);if(be){let it=await ua(ie,new URL(Me.url).pathname,Me.signal,z);if(it.type==="aborted")return;if(it.type==="error"){kn(z,L,it.error,{flushSync:me});return}else if(it.matches)ie=it.matches;else{kn(z,L,Fn(404,{pathname:Z}),{flushSync:me});return}}let Ze=Nu(ie,Z);if(!Ze.route.action&&!Ze.route.lazy){let it=Fn(405,{method:ye.formMethod,pathname:Z,routeId:L});kn(z,L,it,{flushSync:me});return}ce.set(z,Le);let We=we,yt=ul(u,c,Me,Z,ie,Ze,l,se),rt=await On(Me,Z,yt,se,z),Xe=rt[Ze.route.id];if(!Xe){for(let it of yt)if(rt[it.route.id]){Xe=rt[it.route.id];break}}if(Me.signal.aborted){ce.get(z)===Le&&ce.delete(z);return}if(Te.has(z)){if(ii(Xe)||Cn(Xe)){In(z,ga(void 0));return}}else{if(ii(Xe))if(ce.delete(z),C>We){In(z,ga(void 0));return}else return oe.add(z),In(z,po(ye)),$t(Me,Xe,!1,{fetcherSubmission:ye,preventScrollReset:ve});if(Cn(Xe)){kn(z,L,Xe.error);return}}let Rt=_.navigation.location||_.location,Ie=rl(e.history,Rt,Le.signal),Ia=d.activeRoutes,Wn=_.navigation.state!=="idle"?la(Ia,_.navigation.location,m,!1,d.branches):_.matches;De(Wn,"Didn't find any matches after fetcher action");let cn=++we;K.set(z,cn);let{dsMatches:rn,revalidatingFetchers:Dn}=m0(Ie,se,u,c,e.history,_,Wn,ye,Rt,l,!1,k,le,Te,he,oe,Ia,m,e.patchRoutesOnNavigation!=null,d.branches,[Ze.route.id,Xe],Ae),mi=po(ye,Xe.data),ea=new Map(_.fetchers);ea.set(z,mi),Dn.filter(it=>it.key!==z).forEach(it=>{let Aa=it.key,ln=ea.get(Aa),xl=po(void 0,ln?ln.data:void 0);ea.set(Aa,xl),qt(Aa),it.controller&&ce.set(Aa,it.controller)}),je({fetchers:ea});let pi=()=>Dn.forEach(it=>qt(it.key));Le.signal.addEventListener("abort",pi);let{loaderResults:Ta,fetcherResults:Ra}=await wa(rn,Dn,Ie,Rt,se);if(Le.signal.aborted)return;Le.signal.removeEventListener("abort",pi),K.delete(z),ce.delete(z),Dn.forEach(it=>ce.delete(it.key));let Oe=_.fetchers.has(z),ht=it=>{if(!Oe)return it;let Aa=new Map(it.fetchers);return Aa.set(z,ga(Xe.data)),{...it,fetchers:Aa}},xn=xu(Ta);if(xn)return _=ht(_),$t(Ie,xn.result,!1,{preventScrollReset:ve});if(xn=xu(Ra),xn)return oe.add(xn.key),_=ht(_),$t(Ie,xn.result,!1,{preventScrollReset:ve});let ta=new Map(_.fetchers);Oe&&ta.set(z,ga(Xe.data));let{loaderData:yi,errors:gi}=S0(_,Wn,Ta,void 0,Dn,Ra,ta);Jo(cn,ta),_.navigation.state==="loading"&&cn>C?(De(D,"Expected pending action"),q&&q.abort(),He(_.navigation.location,{matches:Wn,loaderData:yi,errors:gi,fetchers:ta})):(je({errors:gi,loaderData:w0(_.loaderData,yi,Wn,gi),fetchers:ta}),k=!1)}async function Qt(z,L,Z,ie,se,be,me,ve,ye){let Ae=_.fetchers.get(z);In(z,po(ye,Ae?Ae.data:void 0),{flushSync:me});let ze=new AbortController,Le=rl(e.history,Z,ze.signal);if(be){let Xe=await ua(ie,new URL(Le.url).pathname,Le.signal,z);if(Xe.type==="aborted")return;if(Xe.type==="error"){kn(z,L,Xe.error,{flushSync:me});return}else if(Xe.matches)ie=Xe.matches;else{kn(z,L,Fn(404,{pathname:Z}),{flushSync:me});return}}let Me=Nu(ie,Z);ce.set(z,ze);let Ze=we,We=ul(u,c,Le,Z,ie,Me,l,se),yt=await On(Le,Z,We,se,z),rt=yt[Me.route.id];if(!rt){for(let Xe of ie)if(yt[Xe.route.id]){rt=yt[Xe.route.id];break}}if(ce.get(z)===ze&&ce.delete(z),!Le.signal.aborted){if(Te.has(z)){In(z,ga(void 0));return}if(ii(rt))if(C>Ze){In(z,ga(void 0));return}else{oe.add(z),await $t(Le,rt,!1,{preventScrollReset:ve});return}if(Cn(rt)){kn(z,L,rt.error);return}In(z,ga(rt.data))}}async function $t(z,L,Z,{submission:ie,fetcherSubmission:se,preventScrollReset:be,replace:me}={}){Z||(B?.resolve(),B=null),L.response.headers.has("X-Remix-Revalidate")&&(k=!0);let ve=L.response.headers.get("Location");De(ve,"Expected a Location header on the redirect Response"),ve=b0(ve,new URL(z.url),m,e.history);let ye=Oo(_.location,ve,{_isRedirect:!0});if(i){let We=!1;if(L.response.headers.has("X-Remix-Reload-Document"))We=!0;else if(Fh(ve)){const yt=tx(a,ve,!0);We=yt.origin!==a.location.origin||Gn(yt.pathname,m)==null}if(We){me?a.location.replace(ve):a.location.assign(ve);return}}q=null;let Ae=me===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ze,)DELIM" -R"DELIM(formAction:Le,formEncType:Me}=_.navigation;!ie&&!se&&ze&&Le&&Me&&(ie=T0(_.navigation));let Ze=ie||se;if(k3.has(L.response.status)&&Ze&&tn(Ze.formMethod))await qe(Ae,ye,{submission:{...Ze,formAction:ve},preventScrollReset:be||Q,enableViewTransition:Z?G:void 0});else{let We=$d(ye,[],Ae,ie);await qe(Ae,ye,{overrideNavigation:We,fetcherSubmission:se,preventScrollReset:be||Q,enableViewTransition:Z?G:void 0})}}async function On(z,L,Z,ie,se){let be,me={};try{be=await F3(p,z,L,Z,se,ie,!1)}catch(ve){return Z.filter(ye=>ye.shouldLoad).forEach(ye=>{me[ye.route.id]={type:"error",error:ve}}),me}if(z.signal.aborted)return me;if(!tn(z.method))for(let ve of Z){if(be[ve.route.id]?.type==="error")break;!be.hasOwnProperty(ve.route.id)&&!_.loaderData.hasOwnProperty(ve.route.id)&&(!_.errors||!_.errors.hasOwnProperty(ve.route.id))&&ve.shouldCallHandler()&&(be[ve.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ve.route.id}`)})}for(let[ve,ye]of Object.entries(be))if(nA(ye)){let Ae=ye.result;me[ve]={type:"redirect",response:V3(Ae,z,ve,Z,m)}}else me[ve]=await K3(ye);return me}async function wa(z,L,Z,ie,se){let be=On(Z,ie,z,se,null),me=Promise.all(L.map(async Ae=>{if(Ae.matches&&Ae.match&&Ae.request&&Ae.controller){let Le=(await On(Ae.request,Ae.path,Ae.matches,se,Ae.key))[Ae.match.route.id];return{[Ae.key]:Le}}else return Promise.resolve({[Ae.key]:{type:"error",error:Fn(404,{pathname:Ae.path})}})})),ve=await be,ye=(await me).reduce((Ae,ze)=>Object.assign(Ae,ze),{});return{loaderResults:ve,fetcherResults:ye}}function sa(){k=!0,he.forEach((z,L)=>{ce.has(L)&&le.add(L),qt(L)})}function In(z,L,Z={}){let ie=new Map(_.fetchers);ie.set(z,L),je({fetchers:ie},{flushSync:(Z&&Z.flushSync)===!0})}function kn(z,L,Z,ie={}){let se=Cr(_.matches,L),be=new Map(_.fetchers);_a(be,z),je({errors:{[se.route.id]:Z},fetchers:be},{flushSync:(ie&&ie.flushSync)===!0})}function uc(z){return Ee.set(z,(Ee.get(z)||0)+1),Te.has(z)&&Te.delete(z),_.fetchers.get(z)||D3}function cc(z,L){qt(z,L?.reason),In(z,ga(null))}function _a(z,L){let Z=_.fetchers.get(L);ce.has(L)&&!(Z&&Z.state==="loading"&&K.has(L))&&qt(L),he.delete(L),K.delete(L),oe.delete(L),Te.delete(L),le.delete(L),z.delete(L)}function an(z){let L=(Ee.get(z)||0)-1;L<=0?(Ee.delete(z),Te.add(z)):Ee.set(z,L),je({fetchers:new Map(_.fetchers)})}function qt(z,L){let Z=ce.get(z);Z&&(Z.abort(L),ce.delete(z))}function It(z,L){for(let Z of z){let ie=L.get(Z);De(ie,`Expected fetcher: ${Z}`);let se=ga(ie.data);L.set(Z,se)}}function Io(z){let L=[],Z=!1;for(let ie of oe){let se=z.get(ie);De(se,`Expected fetcher: ${ie}`),se.state==="loading"&&(oe.delete(ie),L.push(ie),Z=!0)}return It(L,z),Z}function Jo(z,L){let Z=[];for(let[ie,se]of K)if(se0}function fc(z,L){let Z=_.blockers.get(z)||mo;return W.get(z)!==L&&W.set(z,L),Z}function Lr(z){_.blockers.delete(z),W.delete(z)}function Ea(z,L){let Z=_.blockers.get(z)||mo;De(Z.state==="unblocked"&&L.state==="blocked"||Z.state==="blocked"&&L.state==="blocked"||Z.state==="blocked"&&L.state==="proceeding"||Z.state==="blocked"&&L.state==="unblocked"||Z.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${Z.state} -> ${L.state}`);let ie=new Map(_.blockers);ie.set(z,L),je({blockers:ie})}function Br({currentLocation:z,nextLocation:L,historyAction:Z}){if(W.size===0)return;W.size>1&&Tt(!1,"A router only supports one blocker at a time");let ie=Array.from(W.entries()),[se,be]=ie[ie.length-1],me=_.blockers.get(se);if(!(me&&me.state==="proceeding")&&be({currentLocation:z,nextLocation:L,historyAction:Z}))return se}function Jn(z){let L=Fn(404,{pathname:z}),Z=d.activeRoutes,{matches:ie,route:se}=bu(Z);return{notFoundMatches:ie,route:se,error:L}}function hi(z,L,Z){if(E=z,N=L,R=Z||null,!F&&_.navigation===Hd){F=!0;let ie=bl(_.location,_.matches);ie!=null&&je({restoreScrollPosition:ie})}return()=>{E=null,N=null,R=null}}function Va(z,L){return R&&R(z,L.map(ie=>o3(ie,_.loaderData)))||z.key}function dc(z,L){if(E&&N){let Z=Va(z,L);E[Z]=N()}}function bl(z,L){if(E){let Z=Va(z,L),ie=E[Z];if(typeof ie=="number")return ie}return null}function Xa(z,L,Z){if(e.patchRoutesOnNavigation){let ie=d.branches;if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:la(L,Z,m,!0,ie)}}else return{active:!0,matches:la(L,Z,m,!0,ie)||[]}}return{active:!1,matches:null}}async function ua(z,L,Z,ie){if(!e.patchRoutesOnNavigation)return{type:"success",matches:z};let se=z;for(;;){let be=c;try{await e.patchRoutesOnNavigation({signal:Z,path:L,matches:se,fetcherKey:ie,patch:(Ae,ze)=>{Z.aborted||p0(Ae,ze,d,be,u,!1)}})}catch(Ae){return{type:"error",error:Ae,partialMatches:se}}if(Z.aborted)return{type:"aborted"};let me=d.branches,ve=la(d.activeRoutes,L,m,!1,me),ye=null;if(ve){if(Object.keys(ve[0].params).length===0)return{type:"success",matches:ve};if(ye=la(d.activeRoutes,L,m,!0,me),!(ye&&se.lengthZ.route.id===L[ie].route.id)}function es(z){c={},d.setHmrRoutes(ko(z,u,void 0,c))}function ts(z,L,Z=!1){p0(z,L,d,c,u,Z),d.hasHMRRoutes||je({})}return j={get basename(){return m},get future(){return b},get state(){return _},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return c},get window(){return a},initialize:ge,subscribe:Ue,enableScrollRestoration:hi,navigate:Mt,fetch:Mn,revalidate:Ve,createHref:z=>e.history.createHref(z),encodeLocation:z=>e.history.encodeLocation(z),getFetcher:uc,resetFetcher:cc,deleteFetcher:an,dispose:pe,getBlocker:fc,deleteBlocker:Lr,patchRoutes:ts,_internalFetchControllers:ce,_internalSetRoutes:es,_internalSetStateDoNotUseOrYouWillBreakYourApp(z){je(z)}},e.instrumentations&&(j=R3(j,e.instrumentations.map(z=>z.router).filter(Boolean))),j}function H3(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ph(e,a,i,l,s,u){let c,d;if(s){c=[];for(let p of a)if(c.push(p),p.route.id===s){d=p;break}}else c=a,d=a[a.length-1];let m=Fo(l||".",ac(c),Gn(e.pathname,i)||e.pathname,u==="path");if(l==null&&(m.search=e.search,m.hash=e.hash),(l==null||l===""||l===".")&&d){let p=Vh(m.search);if(d.route.index&&!p)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let b=new URLSearchParams(m.search),g=b.getAll("index");b.delete("index"),g.filter(w=>w).forEach(w=>b.append("index",w));let x=b.toString();m.search=x?`?${x}`:""}}return i!=="/"&&(m.pathname=b3({basename:i,pathname:m.pathname})),ba(m)}function h0(e,a,i){if(!i||!H3(i))return{path:a};if(i.formMethod&&!iA(i.formMethod))return{path:a,error:Fn(405,{method:i.formMethod})};let l=()=>({path:a,error:Fn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),c=wx(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!tn(u))return l();let g=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[w,E])=>`${x}${w}=${E} -`,""):String(i.body);return{path:a,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:void 0,text:g}}}else if(i.formEncType==="application/json"){if(!tn(u))return l();try{let g=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:g,text:void 0}}}catch{return l()}}}De(typeof FormData=="function","FormData is not available in this environment");let d,m;if(i.formData)d=vh(i.formData),m=i.formData;else if(i.body instanceof FormData)d=vh(i.body),m=i.body;else if(i.body instanceof URLSearchParams)d=i.body,m=x0(d);else if(i.body==null)d=new URLSearchParams,m=new FormData;else try{d=new URLSearchParams(i.body),m=x0(d)}catch{return l()}let p={formMethod:u,)DELIM" -R"DELIM(formAction:c,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(tn(p.formMethod))return{path:a,submission:p};let b=xa(a);return e&&b.search&&Vh(b.search)&&d.append("index",""),b.search=`?${d}`,{path:ba(b),submission:p}}function m0(e,a,i,l,s,u,c,d,m,p,b,g,x,w,E,R,N,F,V,J,ue,ae){let xe=ue?Cn(ue[1])?ue[1].error:ue[1].data:void 0,j=s.createURL(u.location),_=s.createURL(m),D;if(b&&u.errors){let M=Object.keys(u.errors)[0];D=c.findIndex(k=>k.route.id===M)}else if(ue&&Cn(ue[1])){let M=ue[0];D=c.findIndex(k=>k.route.id===M)-1}let B=ue?ue[1].statusCode:void 0,Q=B&&B>=400,q={currentUrl:j,currentParams:u.matches[0]?.params||{},nextUrl:_,nextParams:c[0].params,...d,actionResult:xe,actionStatus:B},G=Go(c),re=c.map((M,k)=>{let{route:le}=M,ce=null;if(D!=null&&k>D)ce=!1;else if(le.lazy)ce=!0;else if(!Gh(le))ce=!1;else if(b){let{shouldLoad:oe}=px(le,u.loaderData,u.errors);ce=oe}else $3(u.loaderData,u.matches[k],M)&&(ce=!0);if(ce!==null)return yh(i,l,e,m,G,M,p,a,ce);let we=!1;typeof ae=="boolean"?we=ae:Q?we=!1:(g||j.pathname+j.search===_.pathname+_.search||j.search!==_.search||Z3(u.matches[k],M))&&(we=!0);let C={...q,defaultShouldRevalidate:we},K=_o(M,C);return yh(i,l,e,m,G,M,p,a,K,C,ae)}),fe=[];return E.forEach((M,k)=>{if(b||!c.some(Ee=>Ee.route.id===M.routeId)||w.has(k))return;let le=u.fetchers.get(k),ce=le&&le.state!=="idle"&&le.data===void 0,we=la(N,M.path,F??"/",!1,J);if(!we){if(V&&ce)return;fe.push({key:k,routeId:M.routeId,path:M.path,matches:null,match:null,request:null,controller:null});return}if(R.has(k))return;let C=Nu(we,M.path),K=new AbortController,oe=rl(s,M.path,K.signal),he=null;if(x.has(k))x.delete(k),he=ul(i,l,oe,M.path,we,C,p,a);else if(ce)g&&(he=ul(i,l,oe,M.path,we,C,p,a));else{let Ee;typeof ae=="boolean"?Ee=ae:Q?Ee=!1:Ee=g;let Te={...q,defaultShouldRevalidate:Ee};_o(C,Te)&&(he=ul(i,l,oe,M.path,we,C,p,a,Te))}he&&fe.push({key:k,routeId:M.routeId,path:M.path,matches:he,match:C,request:oe,controller:K})}),{dsMatches:re,revalidatingFetchers:fe}}function Gh(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function px(e,a,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Gh(e))return{shouldLoad:!1,renderFallback:!1};let l=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;if(!l&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!l};let u=!l&&!s;return{shouldLoad:u,renderFallback:u}}function $3(e,a,i){let l=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return l||s}function Z3(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==a.params["*"]}function _o(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function p0(e,a,i,l,s,u){let c;if(e){let p=l[e];De(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),c=p.children}else c=i.activeRoutes;let d=[],m=[];if(a.forEach(p=>{let b=c.find(g=>yx(p,g));b?m.push({existingRoute:b,newRoute:p}):d.push(p)}),d.length>0){let p=ko(d,s,[e||"_","patch",String(c?.length||"0")],l);c.push(...p)}if(u&&m.length>0)for(let p=0;pa.children?.some(s=>yx(i,s)))??!1:!1}var y0=new WeakMap,gx=({key:e,route:a,manifest:i,mapRouteProperties:l})=>{let s=i[a.id];if(De(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let u=s.lazy[e];if(!u)return;let c=y0.get(s);c||(c={},y0.set(s,c));let d=c[e];if(d)return d;let m=(async()=>{let p=a3(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(p)Tt(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Tt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await u();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,l(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return c[e]=m,m},g0=new WeakMap;function q3(e,a,i,l,s){let u=i[e.id];if(De(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let b=g0.get(u);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let g=(async()=>{De(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),w={};for(let E in x){let R=x[E];if(R===void 0)continue;let N=i3(E),V=u[E]!==void 0&&E!=="hasErrorBoundary";N?Tt(!N,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):V?Tt(!V,`Route "${u.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.`):w[E]=R}Object.assign(u,w),Object.assign(u,{...l(u),lazy:void 0})})();return g0.set(u,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],m;for(let b of c){if(s&&s.includes(b))continue;let g=gx({key:b,route:e,manifest:i,mapRouteProperties:l});g&&(d.push(g),b===a&&(m=g))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),m?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:m}}async function v0(e){let a=e.matches.filter(s=>s.shouldLoad),i={};return(await Promise.all(a.map(s=>s.resolve()))).forEach((s,u)=>{i[a[u].route.id]=s}),i}async function P3(e){return e.matches.some(a=>a.route.middleware)?vx(e,()=>v0(e)):v0(e)}function vx(e,a){return Q3(e,a,l=>{if(rA(l))throw l;return l},eA,i);function i(l,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:l}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(p=>p.route.id===s),0),Math.max(c.findIndex(p=>p.shouldCallHandler()),0)),m=Cr(c,c[d].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:l}})}}}async function Q3(e,a,i,l,s){let{matches:u,...c}=e,d=u.flatMap(p=>p.route.middleware?p.route.middleware.map(b=>[p.route.id,b]):[]);return await bx(c,d,a,i,l,s)}async function bx(e,a,i,l,s,u,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let m=a[c];if(!m)return await i();let[p,b]=m,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await bx(e,a,i,l,s,u,c+1)},g.value}catch(w){return g={value:await u(w,p,g)},g.value}};try{let w=await b(e,x),E=w!=null?l(w):void 0;return s(E)?E:g?E??g.value:(g={value:await x()},g.value)}catch(w){return await u(w,p,g)}}function xx(e,a,i,l,s){let u=gx({key:"middleware",route:l.route,manifest:a,mapRouteProperties:e}),c=q3(l.route,tn(i.method)?"action":"loader",a,e,s);return{middleware:u,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function yh(e,a,i,l,s,u,c,d,m,p=null,b){let g=!1,x=xx(e,a,i,u,c);return{...u,_lazyPromises:x,shouldLoad:m,shouldRevalidateArgs:p,shouldCallHandler(w){return g=!0,p?typeof b=="boolean"?_o(u,{...p,defaultShouldRevalidate:b}):typeof w=="boolean"?_o(u,{...p,defaultShouldRevalidate:w}):_o(u,p):m},resolve(w){let{lazy:E,loader:R,middleware:N}=u.route,F=g||m||w&&!tn(i.method)&&(E||R),V=N&&N.length>0&&!R&&!E;return F&&(tn(i.method)||!V)?Y3({request:i,path:l,pattern:s,match:u,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:w,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function ul(e,a,i,l,s,u,c,d,)DELIM" -R"DELIM(m=null){return s.map(p=>p.route.id!==u.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:xx(e,a,i,p,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:yh(e,a,i,l,Go(s),p,c,d,!0,m))}async function F3(e,a,i,l,s,u,c){l.some(b=>b._lazyPromises?.middleware)&&await Promise.all(l.map(b=>b._lazyPromises?.middleware));let d={request:a,url:Sx(a,i),pattern:Go(l),params:l[0].params,context:u,matches:l},p=await e({...d,fetcherKey:s,runClientMiddleware:b=>{let g=d;return vx(g,()=>b({...g,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(l.flatMap(b=>[b._lazyPromises?.handler,b._lazyPromises?.route]))}catch{}return p}async function Y3({request:e,path:a,pattern:i,match:l,lazyHandlerPromise:s,lazyRoutePromise:u,handlerOverride:c,scopedContext:d}){let m,p,b=tn(e.method),g=b?"action":"loader",x=w=>{let E,R=new Promise((V,J)=>E=J);p=()=>E(),e.signal.addEventListener("abort",p);let N=V=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${l.route.id}]`)):w({request:e,url:Sx(e,a),pattern:i,params:l.params,context:d},...V!==void 0?[V]:[]),F=(async()=>{try{return{type:"data",result:await(c?c(J=>N(J)):N())}}catch(V){return{type:"error",result:V}}})();return Promise.race([F,R])};try{let w=b?l.route.action:l.route.loader;if(s||u)if(w){let E,[R]=await Promise.all([x(w).catch(N=>{E=N}),s,u]);if(E!==void 0)throw E;m=R}else{await s;let E=b?l.route.action:l.route.loader;if(E)[m]=await Promise.all([x(E),u]);else if(g==="action"){let R=new URL(e.url),N=R.pathname+R.search;throw Fn(405,{method:e.method,pathname:N,routeId:l.route.id})}else return{type:"data",result:void 0}}else if(w)m=await x(w);else{let E=new URL(e.url),R=E.pathname+E.search;throw Fn(404,{pathname:R})}}catch(w){return{type:"error",result:w}}finally{p&&e.signal.removeEventListener("abort",p)}return m}async function G3(e){let a=e.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?e.body==null?null:e.json():e.text()}async function K3(e){let{result:a,type:i}=e;if(Kh(a)){let l;try{l=await G3(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new Yo(a.status,a.statusText,l),statusCode:a.status,headers:a.headers}:{type:"data",data:l,statusCode:a.status,headers:a.headers}}return i==="error"?E0(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:W3(a),statusCode:Do(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Do(a)?a.status:void 0}:E0(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 V3(e,a,i,l,s){let u=e.headers.get("Location");if(De(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!Fh(u)){let c=l.slice(0,l.findIndex(d=>d.route.id===i)+1);u=ph(new URL(a.url),c,s,u),e.headers.set("Location",u)}return e}var X3=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function gh(e){try{return X3.includes(new URL(e).protocol)}catch{return!1}}function b0(e,a,i,l){if(Fh(e)){let s=e,u=Qh.test(s)?new URL(ex(s,a.protocol)):new URL(s);if(gh(u.toString()))throw new Error("Invalid redirect location");let c=Gn(u.pathname,i)!=null;if(u.origin===a.origin&&c)return Yh(u.pathname)+u.search+u.hash}try{let s=l.createURL(e);if(gh(s.toString()))throw new Error("Invalid redirect location")}catch{}return e}function rl(e,a,i,l){let s=e.createURL(wx(a)).toString(),u={signal:i};if(l&&tn(l.formMethod)){let{formMethod:c,formEncType:d}=l;u.method=c.toUpperCase(),d==="application/json"?(u.headers=new Headers({"Content-Type":d}),u.body=JSON.stringify(l.json)):d==="text/plain"?u.body=l.text:d==="application/x-www-form-urlencoded"&&l.formData?u.body=vh(l.formData):u.body=l.formData}return new Request(s,u)}function Sx(e,a){let i=new URL(e.url),l=typeof a=="string"?xa(a):a;if(i.pathname=l.pathname||"/",l.search){let s=new URLSearchParams(l.search),u=s.getAll("index");s.delete("index");for(let c of u.filter(Boolean))s.append("index",c);i.search=s.size?`?${s.toString()}`:""}else i.search="";return i.hash=l.hash||"",i}function vh(e){let a=new URLSearchParams;for(let[i,l]of e.entries())a.append(i,typeof l=="string"?l:l.name);return a}function x0(e){let a=new FormData;for(let[i,l]of e.entries())a.append(i,l);return a}function I3(e,a,i,l=!1,s=!1){let u={},c=null,d,m=!1,p={},b=i&&Cn(i[1])?i[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in a))return;let x=g.route.id,w=a[x];if(De(!ii(w),"Cannot handle redirect results in processLoaderData"),Cn(w)){let E=w.error;if(b!==void 0&&(E=b,b=void 0),c=c||{},s)c[x]=E;else{let R=Cr(e,x);c[R.route.id]==null&&(c[R.route.id]=E)}l||(u[x]=mx),m||(m=!0,d=Do(w.error)?w.error.status:500),w.headers&&(p[x]=w.headers)}else u[x]=w.data,w.statusCode&&w.statusCode!==200&&!m&&(d=w.statusCode),w.headers&&(p[x]=w.headers)}),b!==void 0&&i&&(c={[i[0]]:b},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:c,statusCode:d||200,loaderHeaders:p}}function S0(e,a,i,l,s,u,c){let{loaderData:d,errors:m}=I3(a,i,l);return s.filter(p=>!p.matches||p.matches.some(b=>b.shouldLoad)).forEach(p=>{let{key:b,match:g,controller:x}=p;if(x&&x.signal.aborted)return;let w=u[b];if(De(w,"Did not find corresponding fetcher result"),Cn(w)){let E=Cr(e.matches,g?.route.id);m&&m[E.route.id]||(m={...m,[E.route.id]:w.error}),c.delete(b)}else if(ii(w))De(!1,"Unhandled fetcher revalidation redirect");else{let E=ga(w.data);c.set(b,E)}}),{loaderData:d,errors:m}}function w0(e,a,i,l){let s=Object.entries(a).filter(([,u])=>u!==mx).reduce((u,[c,d])=>(u[c]=d,u),{});for(let u of i){let c=u.route.id;if(!a.hasOwnProperty(c)&&e.hasOwnProperty(c)&&u.route.loader&&(s[c]=e[c]),l&&l.hasOwnProperty(c))break}return s}function _0(e){return e?Cn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Cr(e,a){return(a?e.slice(0,e.findIndex(l=>l.route.id===a)+1):[...e]).reverse().find(l=>l.route.hasErrorBoundary===!0)||e[0]}function bu(e){let a=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Fn(e,{pathname:a,routeId:i,method:l,type:s,message:u}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",l&&a&&i?d=`You made a ${l} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${i}" does not match URL "${a}"`):e===404?(c="Not Found",d=`No route matches URL "${a}"`):e===405&&(c="Method Not Allowed",l&&a&&i?d=`You made a ${l.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:l&&(d=`Invalid request method "${l.toUpperCase()}"`)),new Yo(e||500,c,new Error(d),!0)}function xu(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[l,s]=a[i];if(ii(s))return{key:l,result:s}}}function wx(e){let a=typeof e=="string"?xa(e):e;return ba({...a,hash:""})}function J3(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function W3(e){return new Yo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function eA(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&tA(i))}function tA(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function nA(e){return Kh(e.result)&&dx.has(e.result.status)}function Cn(e){return e.type==="error"}function ii(e){return(e&&e.type)==="redirect"})DELIM" -R"DELIM(function E0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Kh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function aA(e){return dx.has(e)}function rA(e){return Kh(e)&&aA(e.status)&&e.headers.has("Location")}function iA(e){return O3.has(e.toUpperCase())}function tn(e){return N3.has(e.toUpperCase())}function Vh(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function Nu(e,a){let i=typeof a=="string"?xa(a).search:a.search;if(e[e.length-1].route.index&&Vh(i||""))return e[e.length-1];let l=ox(e);return l[l.length-1]}function T0(e){let{formMethod:a,formAction:i,formEncType:l,text:s,formData:u,json:c}=e;if(!(!a||!i||!l)){if(s!=null)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:a,formAction:i,formEncType:l,formData:u,json:void 0,text:void 0};if(c!==void 0)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:c,text:void 0}}}function $d(e,a,i,l){return l?{state:"loading",location:e,matches:a,historyAction:i,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}:{state:"loading",location:e,matches:a,historyAction:i,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function lA(e,a,i,l){return{state:"submitting",location:e,matches:a,historyAction:i,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}}function po(e,a){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.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 oA(e,a){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a?a.data:void 0}}function ga(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 sA(e,a){try{let i=e.sessionStorage.getItem(hx);if(i){let l=JSON.parse(i);for(let[s,u]of Object.entries(l||{}))u&&Array.isArray(u)&&a.set(s,new Set(u||[]))}}catch{}}function uA(e,a){if(a.size>0){let i={};for(let[l,s]of a)i[l]=[...s];try{e.sessionStorage.setItem(hx,JSON.stringify(i))}catch(l){Tt(!1,`Failed to save applied view transitions in sessionStorage (${l}).`)}}}function R0(){let e,a,i=new Promise((l,s)=>{e=async u=>{l(u);try{await i}catch{}},a=async u=>{s(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var fi=T.createContext(null);fi.displayName="DataRouter";var Ko=T.createContext(null);Ko.displayName="DataRouterState";var _x=T.createContext(!1);function Ex(){return T.useContext(_x)}var Xh=T.createContext({isTransitioning:!1});Xh.displayName="ViewTransition";var Tx=T.createContext(new Map);Tx.displayName="Fetchers";var cA=T.createContext(null);cA.displayName="Await";var jn=T.createContext(null);jn.displayName="Navigation";var rc=T.createContext(null);rc.displayName="Location";var Xn=T.createContext({outlet:null,matches:[],isDataRoute:!1});Xn.displayName="Route";var Ih=T.createContext(null);Ih.displayName="RouteError";var Rx="REACT_ROUTER_ERROR",fA="REDIRECT",dA="ROUTE_ERROR_RESPONSE";function hA(e){if(e.startsWith(`${Rx}:${fA}:{`))try{let a=JSON.parse(e.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 mA(e){if(e.startsWith(`${Rx}:${dA}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Yo(a.status,a.statusText,a.data)}catch{}}function pA(e,{relative:a}={}){De(yl(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:l}=T.useContext(jn),{hash:s,pathname:u,search:c}=Vo(e,{relative:a}),d=u;return i!=="/"&&(d=u==="/"?i:Yn([i,u])),l.createHref({pathname:d,search:c,hash:s})}function yl(){return T.useContext(rc)!=null}function Nn(){return De(yl(),"useLocation() may be used only in the context of a component."),T.useContext(rc).location}var Ax="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function zx(e){T.useContext(jn).static||T.useLayoutEffect(e)}function Sa(){let{isDataRoute:e}=T.useContext(Xn);return e?CA():yA()}function yA(){De(yl(),"useNavigate() may be used only in the context of a component.");let e=T.useContext(fi),{basename:a,navigator:i}=T.useContext(jn),{matches:l}=T.useContext(Xn),{pathname:s}=Nn(),u=JSON.stringify(ac(l)),c=T.useRef(!1);return zx(()=>{c.current=!0}),T.useCallback((m,p={})=>{if(Tt(c.current,Ax),!c.current)return;if(typeof m=="number"){i.go(m);return}let b=Fo(m,JSON.parse(u),s,p.relative==="path");e==null&&a!=="/"&&(b.pathname=b.pathname==="/"?a:Yn([a,b.pathname])),(p.replace?i.replace:i.push)(b,p.state,p)},[a,i,u,s,e])}var gA=T.createContext(null);function vA(e){let a=T.useContext(Xn).outlet;return T.useMemo(()=>a&&T.createElement(gA.Provider,{value:e},a),[a,e])}function Jh(){let{matches:e}=T.useContext(Xn);return e[e.length-1]?.params??{}}function Vo(e,{relative:a}={}){let{matches:i}=T.useContext(Xn),{pathname:l}=Nn(),s=JSON.stringify(ac(i));return T.useMemo(()=>Fo(e,JSON.parse(s),l,a==="path"),[e,s,l,a])}function bA(e,a,i){De(yl(),"useRoutes() may be used only in the context of a component.");let{navigator:l}=T.useContext(jn),{matches:s}=T.useContext(Xn),u=s[s.length-1],c=u?u.params:{},d=u?u.pathname:"/",m=u?u.pathnameBase:"/",p=u&&u.route;{let N=p&&p.path||"";Nx(d,!p||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${d}" (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. +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of e.seen.entries()){const d=c[1];if(a===c[0]){u(c);continue}if(e.external){const p=e.external.registry.get(c[0])?.id;if(a!==c[0]&&p){u(c);continue}}if(e.metadataRegistry.get(c[0])?.id){u(c);continue}if(d.cycle){u(c);continue}if(d.count>1&&e.reused==="ref"){u(c);continue}}}function Rb(e,a){const i=e.seen.get(a);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=d=>{const m=e.seen.get(d);if(m.ref===null)return;const p=m.def??m.schema,b={...p},g=m.ref;if(m.ref=null,g){l(g);const w=e.seen.get(g),E=w.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(E)):Object.assign(p,E),Object.assign(p,b),d._zod.parent===g)for(const N in p)N==="$ref"||N==="allOf"||N in b||delete p[N];if(E.$ref&&w.def)for(const N in p)N==="$ref"||N==="allOf"||N in w.def&&JSON.stringify(p[N])===JSON.stringify(w.def[N])&&delete p[N]}const x=d._zod.parent;if(x&&x!==g){l(x);const w=e.seen.get(x);if(w?.schema.$ref&&(p.$ref=w.schema.$ref,w.def))for(const E in p)E==="$ref"||E==="allOf"||E in w.def&&JSON.stringify(p[E])===JSON.stringify(w.def[E])&&delete p[E]}e.override({zodSchema:d,jsonSchema:p,path:m.path??[]})};for(const d of[...e.seen.entries()].reverse())l(d[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(a)?.id;if(!d)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(d)}Object.assign(s,i.def??i.schema);const u=e.metadataRegistry.get(a)?.id;u!==void 0&&s.id===u&&delete s.id;const c=e.external?.defs??{};for(const d of e.seen.entries()){const m=d[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,c[m.defId]=m.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?s.$defs=c:s.definitions=c);try{const d=JSON.parse(JSON.stringify(s));return Object.defineProperty(d,"~standard",{value:{...a["~standard"],jsonSchema:{input:Zu(a,"input",e.processors),output:Zu(a,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function on(e,a){const i=a??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return on(l.element,i);if(l.type==="set")return on(l.valueType,i);if(l.type==="lazy")return on(l.getter(),i);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return on(l.innerType,i);if(l.type==="intersection")return on(l.left,i)||on(l.right,i);if(l.type==="record"||l.type==="map")return on(l.keyType,i)||on(l.valueType,i);if(l.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:on(l.in,i)||on(l.out,i);if(l.type==="object"){for(const s in l.shape)if(on(l.shape[s],i))return!0;return!1}if(l.type==="union"){for(const s of l.options)if(on(s,i))return!0;return!1}if(l.type==="tuple"){for(const s of l.items)if(on(s,i))return!0;return!!(l.rest&&on(l.rest,i))}return!1}const eT=(e,a={})=>i=>{const l=Eb({...i,processors:a});return Vt(e,l),Tb(l,e),Rb(l,e)},Zu=(e,a,i={})=>l=>{const{libraryOptions:s,target:u}=l??{},c=Eb({...s??{},target:u,io:a,processors:i});return Vt(e,c),Tb(c,e),Rb(c,e)},tT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nT=(e,a,i,l)=>{const s=i;s.type="string";const{minimum:u,maximum:c,format:d,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof u=="number"&&(s.minLength=u),typeof c=="number"&&(s.maxLength=c),d&&(s.format=tT[d]??d,s.format===""&&delete s.format,d==="time"&&delete s.format),p&&(s.contentEncoding=p),m&&m.size>0){const b=[...m];b.length===1?s.pattern=b[0].source:b.length>1&&(s.allOf=[...b.map(g=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},aT=(e,a,i,l)=>{const s=i,{minimum:u,maximum:c,format:d,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:b}=e._zod.bag;typeof d=="string"&&d.includes("int")?s.type="integer":s.type="number";const g=typeof b=="number"&&b>=(u??Number.NEGATIVE_INFINITY),x=typeof p=="number"&&p<=(c??Number.POSITIVE_INFINITY),w=a.target==="draft-04"||a.target==="openapi-3.0";g?w?(s.minimum=b,s.exclusiveMinimum=!0):s.exclusiveMinimum=b:typeof u=="number"&&(s.minimum=u),x?w?(s.maximum=p,s.exclusiveMaximum=!0):s.exclusiveMaximum=p:typeof c=="number"&&(s.maximum=c),typeof m=="number"&&(s.multipleOf=m)},rT=(e,a,i,l)=>{i.type="boolean"},iT=(e,a,i,l)=>{i.not={}},lT=(e,a,i,l)=>{},oT=(e,a,i,l)=>{const s=e._zod.def,u=rb(s.entries);u.every(c=>typeof c=="number")&&(i.type="number"),u.every(c=>typeof c=="string")&&(i.type="string"),i.enum=u},sT=(e,a,i,l)=>{if(a.unrepresentable)DELIM" +R"DELIM(==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},uT=(e,a,i,l)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},cT=(e,a,i,l)=>{const s=i,u=e._zod.def,{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=Vt(u.element,a,{...l,path:[...l.path,"items"]})},fT=(e,a,i,l)=>{const s=i,u=e._zod.def;s.type="object",s.properties={};const c=u.shape;for(const p in c)s.properties[p]=Vt(c[p],a,{...l,path:[...l.path,"properties",p]});const d=new Set(Object.keys(c)),m=new Set([...d].filter(p=>{const b=u.shape[p]._zod;return a.io==="input"?b.optin===void 0:b.optout===void 0}));m.size>0&&(s.required=Array.from(m)),u.catchall?._zod.def.type==="never"?s.additionalProperties=!1:u.catchall?u.catchall&&(s.additionalProperties=Vt(u.catchall,a,{...l,path:[...l.path,"additionalProperties"]})):a.io==="output"&&(s.additionalProperties=!1)},dT=(e,a,i,l)=>{const s=e._zod.def,u=s.inclusive===!1,c=s.options.map((d,m)=>Vt(d,a,{...l,path:[...l.path,u?"oneOf":"anyOf",m]}));u?i.oneOf=c:i.anyOf=c},hT=(e,a,i,l)=>{const s=e._zod.def,u=Vt(s.left,a,{...l,path:[...l.path,"allOf",0]}),c=Vt(s.right,a,{...l,path:[...l.path,"allOf",1]}),d=p=>"allOf"in p&&Object.keys(p).length===1,m=[...d(u)?u.allOf:[u],...d(c)?c.allOf:[c]];i.allOf=m},mT=(e,a,i,l)=>{const s=e._zod.def,u=Vt(s.innerType,a,l),c=a.seen.get(e);a.target==="openapi-3.0"?(c.ref=s.innerType,i.nullable=!0):i.anyOf=[u,{type:"null"}]},pT=(e,a,i,l)=>{const s=e._zod.def;Vt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},yT=(e,a,i,l)=>{const s=e._zod.def;Vt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},gT=(e,a,i,l)=>{const s=e._zod.def;Vt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,a.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},vT=(e,a,i,l)=>{const s=e._zod.def;Vt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType;let c;try{c=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=c},bT=(e,a,i,l)=>{const s=e._zod.def,u=s.in._zod.traits.has("$ZodTransform"),c=a.io==="input"?u?s.out:s.in:s.out;Vt(c,a,l);const d=a.seen.get(e);d.ref=c},xT=(e,a,i,l)=>{const s=e._zod.def;Vt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType,i.readOnly=!0},Ab=(e,a,i,l)=>{const s=e._zod.def;Vt(s.innerType,a,l);const u=a.seen.get(e);u.ref=s.innerType},ST=ne("ZodISODateTime",(e,a)=>{R2.init(e,a),wt.init(e,a)});function wT(e){return jE(ST,e)}const _T=ne("ZodISODate",(e,a)=>{A2.init(e,a),wt.init(e,a)});function ET(e){return NE(_T,e)}const TT=ne("ZodISOTime",(e,a)=>{z2.init(e,a),wt.init(e,a)});function RT(e){return ME(TT,e)}const AT=ne("ZodISODuration",(e,a)=>{C2.init(e,a),wt.init(e,a)});function zT(e){return OE(AT,e)}const CT=(e,a)=>{ub.init(e,a),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>g_(e,i)},flatten:{value:i=>y_(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,lh,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,lh,2)}},isEmpty:{get(){return e.issues.length===0}}})},Gn=ne("ZodError",CT,{Parent:Error}),jT=Mh(Gn),NT=Oh(Gn),MT=Wu(Gn),OT=ec(Gn),kT=x_(Gn),DT=S_(Gn),LT=w_(Gn),BT=__(Gn),UT=E_(Gn),HT=T_(Gn),$T=R_(Gn),ZT=A_(Gn),Dv=new WeakMap;function $o(e,a,i){const l=Object.getPrototypeOf(e);let s=Dv.get(l);if(s||(s=new Set,Dv.set(l,s)),!s.has(a)){s.add(a);for(const u in i){const c=i[u];Object.defineProperty(l,u,{configurable:!0,enumerable:!1,get(){const d=c.bind(this);return Object.defineProperty(this,u,{configurable:!0,writable:!0,enumerable:!0,value:d}),d},set(d){Object.defineProperty(this,u,{configurable:!0,writable:!0,enumerable:!0,value:d})}})}}}const Mt=ne("ZodType",(e,a)=>(Nt.init(e,a),Object.assign(e["~standard"],{jsonSchema:{input:Zu(e,"input"),output:Zu(e,"output")}}),e.toJSONSchema=eT(e,{}),e.def=a,e.type=a.type,Object.defineProperty(e,"_def",{value:a}),e.parse=(i,l)=>jT(e,i,l,{callee:e.parse}),e.safeParse=(i,l)=>MT(e,i,l),e.parseAsync=async(i,l)=>NT(e,i,l,{callee:e.parseAsync}),e.safeParseAsync=async(i,l)=>OT(e,i,l),e.spa=e.safeParseAsync,e.encode=(i,l)=>kT(e,i,l),e.decode=(i,l)=>DT(e,i,l),e.encodeAsync=async(i,l)=>LT(e,i,l),e.decodeAsync=async(i,l)=>BT(e,i,l),e.safeEncode=(i,l)=>UT(e,i,l),e.safeDecode=(i,l)=>HT(e,i,l),e.safeEncodeAsync=async(i,l)=>$T(e,i,l),e.safeDecodeAsync=async(i,l)=>ZT(e,i,l),$o(e,"ZodType",{check(...i){const l=this.def;return this.clone(Mr(l,{checks:[...l.checks??[],...i.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...i){return this.check(...i)},clone(i,l){return Or(this,i,l)},brand(){return this},register(i,l){return i.add(this,l),this},refine(i,l){return this.check(k4(i,l))},superRefine(i,l){return this.check(D4(i,l))},overwrite(i){return this.check(ml(i))},optional(){return Hv(this)},exactOptional(){return S4(this)},nullable(){return $v(this)},nullish(){return Hv($v(this))},nonoptional(i){return A4(this,i)},array(){return fl(this)},or(i){return m4([this,i])},and(i){return y4(this,i)},transform(i){return Zv(this,b4(i))},default(i){return E4(this,i)},prefault(i){return R4(this,i)},catch(i){return C4(this,i)},pipe(i){return Zv(this,i)},readonly(){return M4(this)},describe(i){const l=this.clone();return go.add(l,{description:i}),l},meta(...i){if(i.length===0)return go.get(this);const l=this.clone();return go.add(l,i[0]),l},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(i){return i(this)}}),Object.defineProperty(e,"description",{get(){return go.get(e)?.description},configurable:!0}),e)),zb=ne("_ZodString",(e,a)=>{kh.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>nT(e,l,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,$o(e,"_ZodString",{regex(...l){return this.check(HE(...l))},includes(...l){return this.check(qE(...l))},startsWith(...l){return this.check(PE(...l))},endsWith(...l){return this.check(QE(...l))},min(...l){return this.check($u(...l))},max(...l){return this.check(wb(...l))},length(...l){return this.check(_b(...l))},nonempty(...l){return this.check($u(1,...l))},lowercase(l){return this.check($E(l))},uppercase(l){return this.check(ZE(l))},trim(){return this.check(YE())},normalize(...l){return this.check(FE(...l))},toLowerCase(){return this.check(GE())},toUpperCase(){return this.check(KE())},slugify(){return this.check(VE())}})}),qT=ne("ZodString",(e,a)=>{kh.init(e,a),zb.init(e,a),e.email=i=>e.check(uE(PT,i)),e.url=i=>e.check(mE(QT,i)),e.jwt=i=>e.check(CE(i4,i)),e.emoji=i=>e.check(pE(FT,i)),e.guid=i=>e.check(Nv(Lv,i)),e.uuid=i=>e.check(cE(mu,i)),e.uuidv4=i=>e.check(fE(mu,i)),e.uuidv6=i=>e.check(dE(mu,i)),e.uuidv7=i=>e.check(hE(mu,i)),e.nanoid=i=>e.check(yE(YT,i)),e.guid=i=>e.check(Nv(Lv,i)),e.cuid=i=>e.check(gE(GT,i)),e.cuid2=i=>e.check(vE(KT,i)),e.ulid=i=>e.check(bE(VT,i)),e.base64=i=>e.check(RE(n4,i)),e.base64url=i=>e.check(AE(a4,i)),e.xid=i=>e.check(xE(XT,i)),e.ksuid=i=>e.check(SE(IT,i)),e.ipv4=i=>e.check(wE(JT,i)),e.ipv6=i=>e.check(_E(WT,i)),e.cidrv4=i=>e.check(EE(e4,i)),e.cidrv6=i=>e.check(TE(t4,i)),e.e164=i=>e.check(zE(r4,i)),e.datetime=i=>e.check(wT(i)),e.date=i=>e.check(ET(i)),e.time=i=>e.check(RT(i)),e.duration=i=>e.check(zT(i))});function Ht(e){return sE(qT,e)}const wt=ne("ZodStringFormat",(e,a)=>{xt.init(e,a),zb.init(e,a)}),PT=ne("ZodEmail",(e,a)=>{g2.init(e,a),wt.init(e,a)}),Lv=ne("ZodGUID",(e,a)=>{p2.init(e,a),wt.init(e,a)}),mu=ne("ZodUUID",(e,a)=>{y2.init(e,a),wt.init(e,a)}),QT=ne("ZodURL",(e,a)=>{v2.init(e,a),wt.init(e,a)}),FT=ne("ZodEmoji",(e,a)=>{b2.init(e,a),wt.init(e,a)}),YT=ne("ZodNanoID",(e,a)=>{x2.init(e,a),wt.init(e,a)}),GT=ne("ZodCUID",(e,a)=>{S2.init(e,a),wt.init(e,a)}),KT=ne("ZodCUID2",(e,a)=>{w2.init(e,a),wt.init(e,a)}),VT=ne("ZodULID",(e,a)=>{_2.init(e,a),wt.init(e,a)}),XT=ne("ZodXID",(e,a)=>{E2.init(e,a),wt.init(e,a)}),I)DELIM" +R"DELIM(T=ne("ZodKSUID",(e,a)=>{T2.init(e,a),wt.init(e,a)}),JT=ne("ZodIPv4",(e,a)=>{j2.init(e,a),wt.init(e,a)}),WT=ne("ZodIPv6",(e,a)=>{N2.init(e,a),wt.init(e,a)}),e4=ne("ZodCIDRv4",(e,a)=>{M2.init(e,a),wt.init(e,a)}),t4=ne("ZodCIDRv6",(e,a)=>{O2.init(e,a),wt.init(e,a)}),n4=ne("ZodBase64",(e,a)=>{k2.init(e,a),wt.init(e,a)}),a4=ne("ZodBase64URL",(e,a)=>{L2.init(e,a),wt.init(e,a)}),r4=ne("ZodE164",(e,a)=>{B2.init(e,a),wt.init(e,a)}),i4=ne("ZodJWT",(e,a)=>{H2.init(e,a),wt.init(e,a)}),Cb=ne("ZodNumber",(e,a)=>{vb.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>aT(e,l,s),$o(e,"ZodNumber",{gt(l,s){return this.check(Ov(l,s))},gte(l,s){return this.check(Rd(l,s))},min(l,s){return this.check(Rd(l,s))},lt(l,s){return this.check(Mv(l,s))},lte(l,s){return this.check(Td(l,s))},max(l,s){return this.check(Td(l,s))},int(l){return this.check(Bv(l))},safe(l){return this.check(Bv(l))},positive(l){return this.check(Ov(0,l))},nonnegative(l){return this.check(Rd(0,l))},negative(l){return this.check(Mv(0,l))},nonpositive(l){return this.check(Td(0,l))},multipleOf(l,s){return this.check(kv(l,s))},step(l,s){return this.check(kv(l,s))},finite(){return this}});const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function Ie(e){return kE(Cb,e)}const l4=ne("ZodNumberFormat",(e,a)=>{$2.init(e,a),Cb.init(e,a)});function Bv(e){return DE(l4,e)}const o4=ne("ZodBoolean",(e,a)=>{Z2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>rT(e,i,l)});function Dh(e){return LE(o4,e)}const s4=ne("ZodUnknown",(e,a)=>{q2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>lT()});function Uv(){return BE(s4)}const u4=ne("ZodNever",(e,a)=>{P2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>iT(e,i,l)});function c4(e){return UE(u4,e)}const f4=ne("ZodArray",(e,a)=>{Q2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>cT(e,i,l,s),e.element=a.element,$o(e,"ZodArray",{min(i,l){return this.check($u(i,l))},nonempty(i){return this.check($u(1,i))},max(i,l){return this.check(wb(i,l))},length(i,l){return this.check(_b(i,l))},unwrap(){return this.element}})});function fl(e,a){return XE(f4,e,a)}const d4=ne("ZodObject",(e,a)=>{Y2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>fT(e,i,l,s),dt(e,"shape",()=>a.shape),$o(e,"ZodObject",{keyof(){return g4(Object.keys(this._zod.def.shape))},catchall(i){return this.clone({...this._zod.def,catchall:i})},passthrough(){return this.clone({...this._zod.def,catchall:Uv()})},loose(){return this.clone({...this._zod.def,catchall:Uv()})},strict(){return this.clone({...this._zod.def,catchall:c4()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(i){return c_(this,i)},safeExtend(i){return f_(this,i)},merge(i){return d_(this,i)},pick(i){return s_(this,i)},omit(i){return u_(this,i)},partial(...i){return h_(jb,this,i[0])},required(...i){return m_(Nb,this,i[0])}})});function ya(e,a){const i={type:"object",shape:e??{},...Ce(a)};return new d4(i)}const h4=ne("ZodUnion",(e,a)=>{G2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>dT(e,i,l,s),e.options=a.options});function m4(e,a){return new h4({type:"union",options:e,...Ce(a)})}const p4=ne("ZodIntersection",(e,a)=>{K2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>hT(e,i,l,s)});function y4(e,a){return new p4({type:"intersection",left:e,right:a})}const sh=ne("ZodEnum",(e,a)=>{V2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(l,s,u)=>oT(e,l,s),e.enum=a.entries,e.options=Object.values(a.entries);const i=new Set(Object.keys(a.entries));e.extract=(l,s)=>{const u={};for(const c of l)if(i.has(c))u[c]=a.entries[c];else throw new Error(`Key ${c} not found in enum`);return new sh({...a,checks:[],...Ce(s),entries:u})},e.exclude=(l,s)=>{const u={...a.entries};for(const c of l)if(i.has(c))delete u[c];else throw new Error(`Key ${c} not found in enum`);return new sh({...a,checks:[],...Ce(s),entries:u})}});function g4(e,a){const i=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new sh({type:"enum",entries:i,...Ce(a)})}const v4=ne("ZodTransform",(e,a)=>{X2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>uT(e,i),e._zod.parse=(i,l)=>{if(l.direction==="backward")throw new ab(e.constructor.name);i.addIssue=u=>{if(typeof u=="string")i.issues.push(jo(u,i.value,a));else{const c=u;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=i.value),c.inst??(c.inst=e),i.issues.push(jo(c))}};const s=a.transform(i.value,i);return s instanceof Promise?s.then(u=>(i.value=u,i.fallback=!0,i)):(i.value=s,i.fallback=!0,i)}});function b4(e){return new v4({type:"transform",transform:e})}const jb=ne("ZodOptional",(e,a)=>{Sb.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>Ab(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function Hv(e){return new jb({type:"optional",innerType:e})}const x4=ne("ZodExactOptional",(e,a)=>{I2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>Ab(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function S4(e){return new x4({type:"optional",innerType:e})}const w4=ne("ZodNullable",(e,a)=>{J2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>mT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function $v(e){return new w4({type:"nullable",innerType:e})}const _4=ne("ZodDefault",(e,a)=>{W2.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>yT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function E4(e,a){return new _4({type:"default",innerType:e,get defaultValue(){return typeof a=="function"?a():lb(a)}})}const T4=ne("ZodPrefault",(e,a)=>{eE.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>gT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function R4(e,a){return new T4({type:"prefault",innerType:e,get defaultValue(){return typeof a=="function"?a():lb(a)}})}const Nb=ne("ZodNonOptional",(e,a)=>{tE.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>pT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function A4(e,a){return new Nb({type:"nonoptional",innerType:e,...Ce(a)})}const z4=ne("ZodCatch",(e,a)=>{nE.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>vT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function C4(e,a){return new z4({type:"catch",innerType:e,catchValue:typeof a=="function"?a:()=>a})}const j4=ne("ZodPipe",(e,a)=>{aE.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>bT(e,i,l,s),e.in=a.in,e.out=a.out});function Zv(e,a){return new j4({type:"pipe",in:e,out:a})}const N4=ne("ZodReadonly",(e,a)=>{rE.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>xT(e,i,l,s),e.unwrap=()=>e._zod.def.innerType});function M4(e){return new N4({type:"readonly",innerType:e})}const O4=ne("ZodCustom",(e,a)=>{iE.init(e,a),Mt.init(e,a),e._zod.processJSONSchema=(i,l,s)=>sT(e,i)});function k4(e,a={}){return IE(O4,e,a)}function D4(e,a){return JE(e,a)}function si(e){if(!e)return;const a=e.trim();if(!a)return;const i=a.toLowerCase(),l=i.indexOf("1");if(l>0){const c=i.slice(0,l);if(["bc","tb","bcrt","ltc","sb"].includes(c)){const d=i.slice(l+1);if(!d)return;const m=d.charAt(0);return m==="p"?"p2tr":m==="q"?d.length===39||d.length===40||e.length===42?"p2wpkh":d.length===59||d.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}const s=/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(a)&&a.length>=26&&a.length<=35;switch(i[0]){case"1":case"m":case"n":return s?"p2pkh":void 0;case"3":case"2":return s?"p2sh":void 0;default:return}}class Lh extends Error{constructor(a,i){super(a),this.status=i}status}const uh=ya({id:Ht(),height:Ie(),timestamp:Ie().optional(),mediantime:Ie().optional(),tx_count:Ie().optional(),size:Ie().optional(),weight:Ie().optional(),difficulty:Ie().optional(),bits:Ie().optional(),merkle_root:Ht().optional(),previousblockhash:Ht().nullable().optional()DELIM" +R"DELIM(),nonce:Ie().optional(),version:Ie().optional()}).loose(),L4=ya({confirmed:Dh(),block_height:Ie().optional(),block_hash:Ht().optional(),block_time:Ie().optional()}),B4=ya({txid:Ht().optional().nullable(),vout:Ie().optional().nullable(),sequence:Ie().optional(),scriptsig:Ht().optional().nullable(),scriptsig_asm:Ht().optional().nullable(),witness:fl(Ht()).optional(),is_coinbase:Dh().optional(),prevout:ya({scriptpubkey_type:Ht().optional(),scriptpubkey_address:Ht().optional(),scriptpubkey:Ht().optional(),scriptpubkey_asm:Ht().optional(),value:Ie().optional()}).partial().nullable().optional()}).loose(),U4=ya({scriptpubkey_type:Ht().optional(),scriptpubkey_address:Ht().optional(),scriptpubkey:Ht().optional(),scriptpubkey_asm:Ht().optional(),value:Ie(),n:Ie().optional()}).loose(),Tu=ya({txid:Ht(),hash:Ht().optional(),fee:Ie().optional(),version:Ie(),locktime:Ie(),vin:fl(B4),vout:fl(U4),size:Ie(),weight:Ie(),status:L4}).loose(),Bh=fl(uh),qu=fl(Tu),qv=ya({in_best_chain:Dh(),next_best:Ht().optional(),height:Ie().optional()}),Pv=ya({address:Ht(),chain_stats:ya({funded_txo_count:Ie().optional(),funded_txo_sum:Ie().optional(),spent_txo_count:Ie().optional(),spent_txo_sum:Ie().optional(),tx_count:Ie().optional()}),mempool_stats:ya({funded_txo_count:Ie().optional(),funded_txo_sum:Ie().optional(),spent_txo_count:Ie().optional(),spent_txo_sum:Ie().optional(),tx_count:Ie().optional()})});async function Wt(e,a,i){const l=a.startsWith("/")?a:`/${a}`,s=await fetch(`${e}${l}`);if(!s.ok)throw new Lh(`Request to ${a} failed with status ${String(s.status)}`,s.status);const u=await s.json();return i.parse(u)}async function Qv(e,a,i){if(i<=0)return[];const l=[];let s=a;for(;s&&l.lengthu.scriptpubkey_address===e?s+u.value:s,0),l=a.vin.reduce((s,u)=>{const c=u.prevout;return c?.scriptpubkey_address===e&&typeof c.value=="number"?s+c.value:s},0);return i-l}async function Ad(e,a){if(a==="latest"||a==="tip"){const i=await Wt(e,"/blocks",Bh);if(i.length===0)throw new Error("No blocks returned from API");return i[0].id}if(/^\d+$/.test(a)){const i=await fetch(`${e}/block-height/${a}`);if(!i.ok)throw new Lh("Unable to resolve block height",i.status);return(await i.text()).trim()}return a}async function Yv(e,a,i){if(i.lastKnownHeight==null||a>=i.lastKnownHeight)return null;const l=a+1;try{const s=await fetch(`${e}/block-height/${String(l)}`);return s.ok&&(await s.text()).trim()||null}catch(s){return console.warn(`Failed to resolve hash for height ${String(l)}`,s),null}}function uo(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 zd(e,a){const i=e.status.confirmed?"confirmed":"unconfirmed",l=e.vin.map((m,p)=>{const b=m.is_coinbase||m.txid==null?void 0:typeof m.vout=="number"&&m.vout!==4294967295?m.vout:void 0;return{index:p,prevTxId:m.txid??void 0,prevOutputIndex:b,address:m.prevout?.scriptpubkey_address??void 0,valueSats:m.prevout?.value,scriptType:m.prevout?.scriptpubkey_type,isCoinbase:m.is_coinbase??!1,script:m.scriptsig||m.scriptsig_asm?{hex:m.scriptsig??void 0,mnemonic:m.scriptsig_asm??void 0}:void 0,witness:m.witness??void 0,sequence:m.sequence}}),s=e.vout.map((m,p)=>({index:p,address:m.scriptpubkey_address??void 0,valueSats:m.value,scriptType:m.scriptpubkey_type,spent:void 0,script:m.scriptpubkey||m.scriptpubkey_asm?{hex:m.scriptpubkey??void 0,mnemonic:m.scriptpubkey_asm??void 0}:void 0})),u=s.reduce((m,p)=>m+p.valueSats,0),c=a.lastKnownHeight;let d=0;return e.status.block_height&&i==="confirmed"&&(d=c&&c>=e.status.block_height?c-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:i,confirmations:d,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:u,inputs:l,outputs:s}}function $4(e,a){const i=e.chain_stats,l=e.mempool_stats,s=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),u=Mb(e.address,a.slice(0,25));return{address:e.address,addressType:si(e.address),balance:s,totalReceived:(i.funded_txo_sum??0)+(l.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(l.spent_txo_sum??0),txCount:(i.tx_count??0)+(l.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:u}}function Z4(e){const a=e.chain_stats,i=e.mempool_stats,l=(a.funded_txo_sum??0)-(a.spent_txo_sum??0);return{address:e.address,addressType:si(e.address),balance:l,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 Mb(e,a){return a.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:H4(e,i),blockHeight:i.status.block_height}))}async function Gv(e,a,i=0){const l=i>0?`/block/${a}/txs/${String(i)}`:`/block/${a}/txs`;return Wt(e,l,qu)}async function q4(e,a,i){return i?Wt(e,`/address/${a}/txs/chain/${i}`,qu):Wt(e,`/address/${a}/txs`,qu)}function Ob({baseUrl:e}){const a=new Set;let i=null;const l={lastBlockHash:null,lastKnownHeight:null};async function s(d){const m=await Wt(e,`/tx/${d}`,Tu);return await(m.status.block_height?Xi(e,l,m.status.block_height):Xi(e,l)),zd(m,l)}function u(){i||a.size===0||(i=setInterval(async()=>{try{const d=await Wt(e,"/blocks",Bh);if(d.length===0)return;const m=d[0];if(m.id!==l.lastBlockHash){l.lastBlockHash=m.id,l.lastKnownHeight=Math.max(m.height,l.lastKnownHeight??0);const p=uo(m);for(const b of a)b({type:"block.new",payload:p})}}catch(d){console.warn("Block polling failed",d)}},15e3))}function c(){i&&(clearInterval(i),i=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Read-only adapter using Blockstream public REST API."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},async getLatestBlocks(d=10){const m=await Qv(e,"/blocks",d);return m.length>0&&(l.lastBlockHash=m[0].id,l.lastKnownHeight=Math.max(m[0].height,l.lastKnownHeight??0)),m.map(p=>uo(p))},async getBlocksBefore(d,m=10){const p=Math.max(d,0),b=await Qv(e,`/blocks/${String(p)}`,m);return b.length>0&&(l.lastKnownHeight=Math.max(b[0].height,l.lastKnownHeight??0)),b.map(g=>uo(g))},async getBlockHeader(d){const m=await Ad(e,d);await Xi(e,l);const[p,b]=await Promise.all([Wt(e,`/block/${m}`,uh),Wt(e,`/block/${m}/status`,qv).catch(()=>null)]),g=uo(p);l.lastBlockHash=g.hash,l.lastKnownHeight=Math.max(g.height,l.lastKnownHeight??g.height);let x=b?.next_best??null;return x||(x=await Yv(e,g.height,l)),{...g,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:x}},getBlockStats(d){return Promise.resolve({})},async getBlock(d){const m=await Ad(e,d);await Xi(e,l);const p=await Wt(e,`/block/${m}`,uh),[b,g]=await Promise.allSettled([Gv(e,m),Wt(e,`/block/${m}/status`,qv)]);b.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",b.reason),g.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",g.reason);const x=uo(p);l.lastBlockHash=x.hash,l.lastKnownHeight=Math.max(x.height,l.lastKnownHeight??x.height);const w=b.status==="fulfilled"?b.)DELIM" +R"DELIM(value:[];let R=(g.status==="fulfilled"?g.value:null)?.next_best??null;return R||(R=await Yv(e,x.height,l)),{...x,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:R,transactions:w.map(F=>zd(F,l))}},async getBlockTransactions(d,m=0){const p=await Ad(e,d),b=await Gv(e,p,m),g=b.reduce((x,w)=>w.status.block_height?x===null?w.status.block_height:Math.max(x,w.status.block_height):x,null);return await(typeof g=="number"?Xi(e,l,g):Xi(e,l)),b.map(x=>zd(x,l))},async getTransactionHeader(d){return s(d)},async getTransaction(d){return s(d)},async getTransactionInputScriptHex(d,m){const p=await Wt(e,`/tx/${d}`,Tu);if(m<0||m>=p.vin.length)throw new RangeError(`Input index ${String(m)} not found`);const g=p.vin[m].scriptsig;return typeof g=="string"?g:""},async getTransactionOutputScriptHex(d,m){const p=await Wt(e,`/tx/${d}`,Tu);if(m<0||m>=p.vout.length)throw new RangeError(`Output index ${String(m)} not found`);const g=p.vout[m].scriptpubkey;if(typeof g!="string")throw new TypeError("Output script missing in provider response");return g},async getAddressSummary(d){const m=await Wt(e,`/address/${d}`,Pv);return Z4(m)},async getAddress(d){const m=await Wt(e,`/address/${d}`,Pv),p=await Wt(e,`/address/${d}/txs`,qu);return $4(m,p)},async getAddressTransactions(d,m){const p=await q4(e,d,m);return Mb(d,p)},subscribeToEvents(d){return a.add(d),u(),()=>{a.delete(d),a.size===0&&c()}}}}function P4({baseUrl:e}){const a=Ob({baseUrl:e});return{...a,metadata:{...a.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function No(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function kb(e,a){return Array.isArray(a)?a.length===0?!0:e?a.every(i=>typeof i=="string"):a.every(i=>Number.isSafeInteger(i)):!1}function Uh(e){if(typeof e!="function")throw new TypeError("function expected");return!0}function Mo(e,a){if(typeof a!="string")throw new TypeError(`${e}: string expected`);return!0}function Zo(e){if(typeof e!="number")throw new TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw new RangeError(`invalid integer: ${e}`)}function Pu(e){if(!Array.isArray(e))throw new TypeError("array expected")}function Db(e,a){if(!kb(!0,a))throw new TypeError(`${e}: array of strings expected`)}function Hh(e,a){if(!kb(!1,a))throw new TypeError(`${e}: array of numbers expected`)}function $h(...e){const a=u=>u,i=(u,c)=>d=>u(c(d)),l=e.map(u=>u.encode).reduceRight(i,a),s=e.map(u=>u.decode).reduce(i,a);return{encode:l,decode:s}}function Lb(e){const a=typeof e=="string"?e.split(""):e,i=a.length;Db("alphabet",a);const l=new Map(a.map((s,u)=>[s,u]));return{encode:s=>(Pu(s),s.map(u=>{if(!Number.isSafeInteger(u)||u<0||u>=i)throw new Error(`alphabet.encode: digit index outside alphabet "${u}". Allowed: ${e}`);return a[u]})),decode:s=>(Pu(s),s.map(u=>{Mo("alphabet.decode",u);const c=l.get(u);if(c===void 0)throw new Error(`Unknown letter: "${u}". Allowed: ${e}`);return c}))}}function Bb(e=""){return Mo("join",e),{encode:a=>(Db("join.decode",a),a.join(e)),decode:a=>(Mo("join.decode",a),a.split(e))}}function Kv(e,a,i){if(a<2)throw new RangeError(`convertRadix: invalid from=${a}, base cannot be less than 2`);if(i<2)throw new RangeError(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(Pu(e),!e.length)return[];let l=0;const s=[],u=Array.from(e,d=>{if(Zo(d),d<0||d>=a)throw new Error(`invalid integer: ${d}`);return d}),c=u.length;for(;;){let d=0,m=!0;for(let p=l;pa===0?e:Ub(a,e%a),Qu=(e,a)=>e+(a-Ub(e,a)),Ru=(()=>{let e=[];for(let a=0;a<40;a++)e.push(2**a);return e})();function ch(e,a,i,l){if(Pu(e),a<=0||a>32)throw new RangeError(`convertRadix2: wrong from=${a}`);if(i<=0||i>32)throw new RangeError(`convertRadix2: wrong to=${i}`);if(Qu(a,i)>32)throw new Error(`convertRadix2: carry overflow from=${a} to=${i} carryBits=${Qu(a,i)}`);let s=0,u=0;const c=Ru[a],d=Ru[i]-1,m=[];for(const p of e){if(Zo(p),p>=c)throw new Error(`convertRadix2: invalid data word=${p} from=${a}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${u} from=${a}`);for(u+=a;u>=i;u-=i)m.push((s>>u-i&d)>>>0);const b=Ru[u];if(b===void 0)throw new Error("invalid carry");s&=b-1}if(s=s<=a)throw new Error("Excess padding");if(!l&&s>0)throw new Error(`Non-zero padding: ${s}`);return l&&u>0&&m.push(s>>>0),m}function Q4(e){Zo(e);const a=2**8;return{encode:i=>{if(!No(i))throw new TypeError("radix.encode input should be Uint8Array");return Kv(Array.from(i),a,e)},decode:i=>(Hh("radix.decode",i),Uint8Array.from(Kv(i,e,a)))}}function F4(e,a=!1){if(Zo(e),e<=0||e>32)throw new RangeError("radix2: bits should be in (0..32]");if(Qu(8,e)>32||Qu(e,8)>32)throw new RangeError("radix2: carry overflow");return{encode:i=>{if(!No(i))throw new TypeError("radix2.encode input should be Uint8Array");return ch(Array.from(i),8,e,!a)},decode:i=>(Hh("radix2.decode",i),Uint8Array.from(ch(i,e,8,a)))}}function Vv(e){return Uh(e),function(...a){try{return e.apply(null,a)}catch{}}}function Y4(e,a){if(Zo(e),e<=0)throw new RangeError(`checksum length must be positive: ${e}`);Uh(a);const i=a;return{encode(l){if(!No(l))throw new TypeError("checksum.encode: input should be Uint8Array");const s=i(l).slice(0,e),u=new Uint8Array(l.length+e);return u.set(l),u.set(s,l.length),u},decode(l){if(!No(l))throw new TypeError("checksum.decode: input should be Uint8Array");const s=l.slice(0,-e),u=l.slice(-e),c=i(s).slice(0,e);for(let d=0;d$h(Q4(58),Lb(e),Bb("")),K4=Object.freeze(G4("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),V4=e=>{Uh(e);const a=e;return $h(Y4(4,i=>a(a(i))),K4)},fh=$h(Lb("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Bb("")),Xv=[996825010,642813549,513874426,1027748829,705979059];function co(e){const a=e>>25;let i=(e&33554431)<<5;for(let l=0;l>l&1)===1&&(i^=Xv[l]);return i}function Iv(e,a,i=1){const l=e.length;let s=1;for(let u=0;u126)throw new Error(`Invalid prefix (${e})`);s=co(s)^c>>5}s=co(s);for(let u=0;uw)throw new TypeError(`Length ${R} exceeds limit ${w}`);const N=g.toLowerCase(),F=Iv(N,x,a);return`${N}1${fh.encode(x)}${F}`}function d(g,x=90){Mo("bech32.decode input",g);const w=g.length;if(w<8||x!==!1&&w>x)throw new TypeError(`invalid string length: ${w} (${g}). Expected (8..${x})`);const E=g.toLowerCase();if(g!==E&&g!==g.toUpperCase())throw new Error("String must be lowercase or uppercase");const R=E.lastIndexOf("1");if(R===0||R===-1)throw new Error('Letter "1" must be present between prefix and data only');const N=E.slice(0,R),F=E.slice(R+1);if(F.length<6)throw new Error("Data must be at least 6 characters long");const V=fh.decode(F).slice(0,-6),J=Iv(N,V,a);if(!F.endsWith(J))throw new Error(`Invalid checksum in ${g}: expected "${J}"`);return{prefix:N,words:V}}const m=Vv(d);function p(g){const{prefix:x,words:w}=d(g,!1);return{prefix:x,words:w,bytes:l(w)}}function b(g,x){return c(g,s(x))}return{encode:c,decode:d,encodeFromBytes:b,decodeToBytes:p,decodeUnsafe:m,fromWords:l,fromWo)DELIM" +R"DELIM(rdsUnsafe:u,toWords:s}}const Fu=Object.freeze(Hb("bech32")),dh=Object.freeze(Hb("bech32m"));function X4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Zh(e,a,i=""){const l=X4(e),s=e?.length;if(!l||a!==void 0){const c=i&&`"${i}" `,d="",m=l?`length=${s}`:`type=${typeof e}`,p=c+"expected Uint8Array"+d+", got "+m;throw l?new RangeError(p):new TypeError(p)}return e}function Jv(e,a=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(a&&e.finished)throw new Error("Hash#digest() has already been called")}function I4(e,a){Zh(e,void 0,"digestInto() output");const i=a.outputLen;if(e.length='+i)}function hh(...e){for(let a=0;a>>a}const J4=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",W4=Array.from({length:256},(e,a)=>a.toString(16).padStart(2,"0"));function Au(e){if(Zh(e),J4)return e.toHex();let a="";for(let i=0;ie(u).update(s).digest(),l=e(void 0);return i.outputLen=l.outputLen,i.blockLen=l.blockLen,i.canXOF=l.canXOF,i.create=s=>e(s),Object.assign(i,a),Object.freeze(i)}const tR=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function nR(e,a,i){return e&a^~e&i}function aR(e,a,i){return e&a^e&i^a&i}class rR{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(a,i,l,s){this.blockLen=a,this.outputLen=i,this.padOffset=l,this.isLE=s,this.buffer=new Uint8Array(a),this.view=Cd(this.buffer)}update(a){Jv(this),Zh(a);const{view:i,buffer:l,blockLen:s}=this,u=a.length;for(let c=0;cs-c&&(this.process(l,0),c=0);for(let g=c;gb.length)throw new Error("_sha2: outputLen bigger than state");for(let g=0;g>>3,R=da(w,17)^da(w,19)^w>>>10;Sr[g]=R+Sr[g-7]+E+Sr[g-16]|0}let{A:l,B:s,C:u,D:c,E:d,F:m,G:p,H:b}=this;for(let g=0;g<64;g++){const x=da(d,6)^da(d,11)^da(d,25),w=b+x+nR(d,m,p)+iR[g]+Sr[g]|0,R=(da(l,2)^da(l,13)^da(l,22))+aR(l,s,u)|0;b=p,p=m,m=d,d=c+w|0,c=u,u=s,s=l,l=w+R|0}l=l+this.A|0,s=s+this.B|0,u=u+this.C|0,c=c+this.D|0,d=d+this.E|0,m=m+this.F|0,p=p+this.G|0,b=b+this.H|0,this.set(l,s,u,c,d,m,p,b)}roundClean(){hh(Sr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),hh(this.buffer)}}class oR extends lR{A=xr[0]|0;B=xr[1]|0;C=xr[2]|0;D=xr[3]|0;E=xr[4]|0;F=xr[5]|0;G=xr[6]|0;H=xr[7]|0;constructor(){super(32)}}const $b=eR(()=>new oR,tR(1)),Zb=V4($b),sR=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function qh(e){if(e.length%2!==0)throw new Error("Invalid hex string");const a=new Uint8Array(e.length/2);for(let i=0;i>>24,i=e&8388607;if(i===0||a<3)return;const l=BigInt(i)*(1n<i[1]).filter(Boolean);return a.length>0?a:[e]}function Ph(e){const a=e.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 l=a.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return l.length===40?"p2wpkh":l.length===64?"p2wsh":"segwit"}if(a.startsWith("1 ["))return"p2tr"}function qo(){return"mainnet"}function Po(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function Wv(e,a){const i=new Uint8Array(a.length/2+1);return i[0]=e,i.set(qh(a),1),Zb.encode(i)}function jd(e,a,i){const l=qh(i),s=Fu.toWords(l);return s.unshift(a),(a===0?Fu:dh).encode(e,s)}function qb(e,a){const i=e.toLowerCase(),l=i.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(l)return{address:Wv(a.p2pkh,l[1]),type:"p2pkh"};const s=i.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(s)return{address:Wv(a.p2sh,s[1]),type:"p2sh"};const u=i.match(/^zero \[([0-9a-f]{40})\]/);if(u)return{address:jd(a.hrp,0,u[1]),type:"p2wpkh"};const c=i.match(/^zero \[([0-9a-f]{64})\]/);if(c)return{address:jd(a.hrp,0,c[1]),type:"p2wsh"};const d=i.match(/^1 \[([0-9a-f]{64})\]/);return d?{address:jd(a.hrp,1,d[1]),type:"p2tr"}:{type:Ph(e)}}function fR(e,a){try{const s=Zb.decode(e),u=s[0],c=Au(s.slice(1));if(c.length===40&&u===a.p2pkh)return{scriptHex:`76a914${c}88ac`,type:"p2pkh"};if(c.length===40&&u===a.p2sh)return{scriptHex:`a914${c}87`,type:"p2sh"}}catch{}const i=e.toLowerCase();if(i.indexOf("1")>0&&i.startsWith(`${a.hrp}1`)){const s=i,u=m=>{try{return m.decode(s,90)}catch{return null}},c=u(Fu);if(c&&c.prefix===a.hrp){const m=c.words[0],p=Fu.fromWords(c.words.slice(1)),b=Au(p),g=p.length.toString(16).padStart(2,"0");if(m===0&&(p.length===20||p.length===32))return{scriptHex:`00${g}${b}`,type:p.length===20?"p2wpkh":"p2wsh"}}const d=u(dh);if(d&&d.prefix===a.hrp){const m=d.words[0],p=dh.fromWords(d.words.slice(1)),b=Au(p),g=p.length.toString(16).padStart(2,"0");if(m===1&&p.length===32)return{scriptHex:`51${g}${b}`,type:"p2tr"}}}return null}function Nr(e,a){const i=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(i))return{hash:i,type:"script-hash"};const l=fR(e,a);if(!l)return null;const s=$b(qh(l.scriptHex)),u=Uint8Array.from(s).reverse();return{hash:Au(u),type:l.type}}function zu(e,a){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:a,size:void 0,weight:void 0,difficulty:uR(e.bits),previousBlockHash:e.previous}}function dR(e){const a=cR(e);return a&&a.length>0?a:void 0}function hR(e,a,i,)DELIM" +R"DELIM(l){const s=/^0{64}$/u.test(e.point.hash),u=a?qb(a.script,i):{address:void 0,type:void 0},c=a?a.value:void 0,d=a?a.script:void 0;return{index:l,prevTxId:s?void 0:e.point.hash,prevOutputIndex:s?void 0:e.point.index,address:u.address,valueSats:c,scriptType:u.type??Ph(d??e.script),isCoinbase:s,script:e.script?{mnemonic:e.script}:void 0,witness:dR(e.witness),sequence:e.sequence}}function mR(e,a,i){const l=qb(e.script,i);return{index:a,address:l.address,valueSats:e.value,scriptType:l.type??Ph(e.script),spent:void 0,script:e.script?{mnemonic:e.script}:void 0}}function pR(e,a){return typeof e!="number"||typeof a!="number"?0:Math.max(0,e-a+1)}function pu(e,a,i,l,s){const u=e.outputs.map((b,g)=>mR(b,g,i)),c=u.reduce((b,g)=>b+g.valueSats,0),d=a.reduce((b,g)=>g?(b??0)+g.value:b,null),m=pR(l.tipHeight,l.blockHeight),p=typeof l.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:p,confirmations:m,blockHeight:l.blockHeight,blockHash:l.blockHash,receivedTime:l.timestamp,feeSats:Number.isFinite(s)?s:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:d,totalOutput:c,inputs:e.inputs.map((b,g)=>hR(b,a[g],i,g)),outputs:u}}const yu=25,wo=8,yR="/v1/top/subscribe?format=json",gR="/v1/top/subscribe?format=json&stop=true",vR=5e3,bR=2500,Nd=5e3,xR=3e5,e0=5e3,fo=new Map,Md=new Map;class Qh extends Error{constructor(a,i){super(a),this.status=i,this.name="LibbitcoinApiError"}status}const Yu={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function SR(e){if(!e||typeof e!="object"||Array.isArray(e))return Yu;const a=e,i=l=>typeof a[l]=="boolean"?a[l]:Yu[l];return{address:i("address"),filter:i("filter"),turbo:i("turbo"),witness:i("witness"),retarget:i("retarget"),difficult:i("difficult")}}function vo(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e.state;if(!i||typeof i!="object"||Array.isArray(i))return null;const l=i,s=typeof l.count=="number"?l.count:void 0,u=typeof l.size=="number"?l.size:void 0,c=typeof l.weight=="number"?l.weight:void 0;return s===void 0&&u===void 0&&c===void 0?null:{count:s,size:u,weight:c}}function Cu(e){return e?.weight??e?.size}function wR(e,a){return!Number.isFinite(e)||!Number.isFinite(a)||a<=0?null:e/a*4}function gu(e,a){if(!a)return e;const i=typeof a.fee=="number"?a.fee:void 0,l=typeof a.weight=="number"?a.weight:void 0,s=typeof i=="number"&&typeof l=="number"?wR(i,l):e.feeRate;return{...e,wtxid:a.wtxid||e.wtxid,feeSats:typeof a.fee=="number"?a.fee:e.feeSats,feeRate:s,size:typeof a.maximal=="number"?a.maximal:e.size,weight:typeof a.weight=="number"?a.weight:e.weight,sigops:typeof a.confirmed?.sigops=="number"?a.confirmed.sigops:e.sigops,totalInput:typeof a.value=="number"?a.value:e.totalInput,totalOutput:typeof a.spend=="number"?a.spend:e.totalOutput}}async function sn(e,a,i){const l=a.startsWith("/")?a:`/${a}`;let s=l.includes("?")?`${e}${l}`:`${e}${l}?format=json`;i&&(s+=s.includes("?")?"&turbo=true":"?turbo=true");const u=Md.get(s);if(u)return u;const c=(async()=>{const d=await fetch(s,{headers:{Accept:"application/json"}});if(!d.ok){const p=await d.text().catch(()=>"");throw new Qh(`Request failed ${String(d.status)}: ${p||d.statusText}`,d.status)}const m=await d.text();try{return JSON.parse(m)}catch{return m}})();Md.set(s,c);try{return await c}finally{Md.delete(s)}}async function Gt(e,a,i){try{return await sn(e,a,i)}catch{return null}}async function Fh(e,a,i){try{return await sn(e,a,i)}catch(l){if(l instanceof Qh&&l.status===404)return null;throw l}}async function Pb(e,a){const i=await sn(e,"/v1/top?format=json",a),l=typeof i=="number"?i:Number(i);if(!Number.isFinite(l))throw new Error("Invalid top height");return l}function _R(e){return/^[0-9a-f]{64}$/iu.test(e)}function ER(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e.trim()):null}function mh(e){const a=ER(e);if(a!==null)return a;if(typeof e=="string"){const s=e.trim();return _R(s)?s:null}if(!e||typeof e!="object"||Array.isArray(e))return null;const i=e,l=[i.payload,i.top,i.block,i.header,i.hash,i.height];for(const s of l){if(s===e)continue;const u=mh(s);if(u!==null)return u}return null}function TR(e){return typeof e=="string"?Promise.resolve(e):e instanceof ArrayBuffer?Promise.resolve(new TextDecoder().decode(e)):e instanceof Blob?e.text():Promise.resolve(null)}function RR(e){const a=e.trim();if(!a)return null;try{return mh(JSON.parse(a))}catch{return mh(a)}}function AR(e){const a=e.trim();if(!a)return null;const l=/^[a-z][a-z\d+\-.]*:\/\//iu.test(a)?a:`http://${a}`,s=globalThis.window;try{const u=new URL(l,s?.location.href??"http://localhost");if(u.protocol==="http:")u.protocol="ws:";else if(u.protocol==="https:")u.protocol="wss:";else if(u.protocol!=="ws:"&&u.protocol!=="wss:")return null;return u.hash="",u.search="",u.toString()}catch{return null}}async function ei(e,a){const i=Date.now(),l=`${e}|0`,s=fo.get(l);if(s&&s.expiresAt>i)return s.promise;const u=Pb(e,a).then(c=>(fo.set(l,{promise:u,value:c,expiresAt:Date.now()+e0}),c),c=>{throw fo.get(l)?.promise===u&&fo.delete(l),c});return fo.set(l,{promise:u,value:s?.value??null,expiresAt:i+e0}),u}async function vu(e,a,i){if(a==="latest"||a==="tip"){const l=await ei(e,i);return{path:`/v1/block/height/${String(l)}`,height:l}}return/^\d+$/u.test(a)?{path:`/v1/block/height/${a}`}:{path:`/v1/block/hash/${a}`}}function zR(e,a){const i=new Map;return(l,s)=>{const u=`${l}:${String(s)}`,c=i.get(u);if(c)return c;const d=sn(e,`/v1/output/${l}/${String(s)}?format=json`,a).catch(()=>null);return i.set(u,d),d}}async function CR(e,a,i,l){return sn(e,`${a}/tx/${String(i)}?format=json`,l)}async function t0(e,a,i,l){const s=await ol(i,wo,async c=>{try{return await CR(e,a,c)}catch(d){if(l&&d instanceof Qh&&d.status===404)return null;throw d}}),u=s.indexOf(null);if(u===-1)return s.filter(c=>c!==null);if(s.slice(u+1).some(c=>c!==null))throw new Error("Libbitcoin returned a non-contiguous block transaction page");return s.slice(0,u).filter(c=>c!==null)}async function n0(e,a){return ol(a,wo,async i=>{const[l,s]=await Promise.all([sn(e,`/v1/block/height/${String(i)}/header?format=json`),Gt(e,`/v1/block/height/${String(i)}/header/context?format=json`)]),u=vo(s);return{...zu(l,u?.count),size:Cu(u)}})}function Qb(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Fb(e){return Qb(e)?typeof e.hash=="string"&&e.hash.length>0&&typeof e.index=="number"&&Number.isInteger(e.index)&&e.index>=0:!1}function Yb(e,a){if(!Array.isArray(e)||!e.every(i=>Qb(i)&&Fb(i.point)&&typeof i.value=="number"&&Number.isFinite(i.value)&&i.value>=0))throw new TypeError(`Invalid response from ${a}`);return e}async function a0(e,a,i){const l=`/v1/address/${a}/confirmed?format=json`,s=await Fh(e,l,i);return s===null?[]:Yb(s,l)}async function jR(e,a,i){const l=`/v1/address/${a}?format=json`,s=await Fh(e,l,i);return s===null?[]:Yb(s,l)}const r0=25,NR=8,MR=3e4;function OR(e){if(e===void 0)return 0;const a=Number(e);return Number.isInteger(a)&&a>0?a:0}async function kR(e,a,i){const l=`/v1/output/${a}/${String(i)}/spender?format=json`,s=await Fh(e,l);if(s===null)return null;if(!Fb(s))throw new TypeError(`Invalid response from ${l}`);return s}async function ol(e,a,i){const l=Array.from({length:e.length});let s=0;async function u(){for(;su())),l}async function DR(e,a,i){const l=await ol(a,NR,u=>kR(e,u.point.hash,u.point.index)),s=[];for(const[u,c]of a.entries()){const{hash:d,index:m}=c.point,p=l[u];s.push({id:`in:${d}:${String(m)}`,txid:d,outputIndex:m,valueChange:c.value,direction:"received",spent:p!==null,...i===null?{}:{cursor:i}}),p&&s.push({id:`out:${d}:${String(m)}`,txid:p.hash,valueChange:-c.value,direction:"sent",...i===null?{}:{cursor:i}})}return s}function i0(e,a){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const l=Number(e);if(Number.isFinit)DELIM" +R"DELIM(e(l))return l}let i=0;for(const l of a)i+=l.value;return i}function Od({baseUrl:e,pollIntervalMs:a=15e3,turbo:i=!1}){const l=new Set,s=new Set;let u=null,c=null,d=null,m=null,p=null,b=Nd,g=!1,x=!1,w="idle",E=null,R=null;const N=Po(qo());let F=null,V=null;const J=AR(e),ue=!!(J&&globalThis.WebSocket),ae=new Map;async function xe(W,de){const X=Date.now(),ge=ae.get(W);if(ge&&ge.expiresAt>X)return ge.outputs;const pe=await jR(e,W,de);return ae.set(W,{outputs:pe,expiresAt:X+MR}),pe}async function j(W,de,X){const ge=await xe(W,de),pe=OR(X),Ue=ge.slice(pe,pe+r0),je=pe+r0,He=je{const de=SR(W);return F=de,de}).catch(W=>(console.warn("Libbitcoin configuration fetch failed",W),F=Yu,Yu)),V)}function D(W){return W.address}function B(W){return D(W)&&W.turbo}function Q(){return{transport:w,websocketAvailable:ue&&!g}}function q(W){if(w===W)return;w=W;const de=Q();for(const X of s)X(de)}async function G(W){const de=typeof W=="number"?`/v1/block/height/${String(W)}`:`/v1/block/hash/${W}`,[X,ge]=await Promise.all([sn(e,`${de}/header?format=json`),Gt(e,`${de}/header/context?format=json`)]);if(R===X.hash||E!==null&&X.heightE&&await G(W)}catch(W){console.warn("Libbitcoin poller failed",W)}}function fe(){l.size!==0&&(u||(u=setInterval(()=>{re()},a)),q("polling"))}function M(){u&&(clearInterval(u),u=null)}function k(){d&&(clearTimeout(d),d=null)}function le(){m&&(clearTimeout(m),m=null)}function ce(){p&&(clearTimeout(p),p=null)}function we(){if(p||!ue||l.size===0)return;const W=b;b=Math.min(b*2,xR),p=setTimeout(()=>{p=null,!(c||l.size===0)&&(g=!1,oe())},W)}function C(){g=!0,K(!1),fe(),we()}function K(W){if(k(),!!c){x=!0;try{W&&c.readyState===1&&c.send(gR),c.close()}catch{}finally{c=null}}}function oe(){if(le(),c)return!0;if(!ue||!J||g||l.size===0)return!1;try{x=!1,c=new WebSocket(J),q("connecting")}catch(de){return console.warn("Libbitcoin websocket unavailable, falling back to polling",de),C(),!1}const W=c;return d=setTimeout(()=>{c===W&&(console.warn("Libbitcoin websocket connect timed out, falling back to polling"),C())},vR),W.addEventListener("open",()=>{if(c===W){k();try{W.send(yR),M(),g=!1,b=Nd,q("websocket")}catch(de){console.warn("Libbitcoin websocket subscribe failed, falling back to polling",de),C()}}}),W.addEventListener("message",de=>{(async()=>{try{const X=await TR(de.data);if(X===null)return;const ge=RR(X);if(ge===null)return;await G(ge)}catch(X){console.warn("Libbitcoin websocket event handling failed",X)}})()}),W.addEventListener("error",de=>{x||c!==W||(console.warn("Libbitcoin websocket failed, falling back to polling",de),C())}),W.addEventListener("close",()=>{if(!(c!==null&&c!==W)){if(k(),c===W&&(c=null),x){x=!1;return}l.size!==0&&C()}}),!0}function he(){oe()||(fe(),we())}function Ee(){le(),ce(),b=Nd,g=!1,M(),K(!0),q("idle")}function Te(){l.size>0||m||(m=setTimeout(()=>{m=null,l.size===0&&Ee()},bR))}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:ue,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return _()},async getLatestBlocks(W=10){const de=await ei(e);E=de;const X=Array.from({length:W},(pe,Ue)=>de-Ue).filter(pe=>pe>=0),ge=await n0(e,X);return ge.length>0&&(R=ge[0].hash),ge},async getBlocksBefore(W,de=10){const X=Array.from({length:de},(ge,pe)=>W-pe).filter(ge=>ge>=0);return n0(e,X)},async getBlockHeader(W){const{path:de,height:X}=await vu(e,W),ge=X===void 0?ei(e):Promise.resolve(X),[pe,Ue,je]=await Promise.all([sn(e,`${de}/header?format=json`),ge,Gt(e,`${de}/header/context?format=json`)]);E=Math.max(E??0,Ue);let He=null;pe.heightbn),tn=await t0(e,de,pt,typeof Fe!="number"),xa=await ol(tn,wo,Rt=>Gt(e,`/v1/tx/${Rt.hash}/details?format=json`)),gl=tn.map((Rt,bn)=>{const Mn=xa[bn],Dr=pu(Rt,[],N,{blockHeight:pe.height,blockHash:pe.hash,tipHeight:Ue,timestamp:pe.timestamp},typeof Mn?.fee=="number"?Mn.fee:void 0);return gu(Dr,Mn)});return{...tt,size:He?.maximal??Cu(qe),weight:He?.weight,merkleRoot:pe.merkle_root,nonce:pe.nonce,bits:pe.bits,version:pe.version,nextBlockHash:Ot,feesSats:He?.fees,subsidySats:He?.subsidy,sigops:He?.sigops,transactions:gl}},async getBlockTransactions(W,de=0){const{path:X}=await vu(e,W),[ge,pe,Ue]=await Promise.all([sn(e,`${X}/header?format=json`),ei(e),Gt(e,`${X}/header/context?format=json`)]);E=Math.max(E??0,pe);const je=vo(Ue)?.count;if(typeof je=="number"&&de>=je)return[];const He=typeof je=="number"?Math.min(de+yu,je):de+yu,Ot=Array.from({length:Math.max(0,He-de)},(tt,nt)=>de+nt),qe=await t0(e,X,Ot,typeof je!="number");if(qe.length===0)return[];const Fe=await ol(qe,wo,tt=>Gt(e,`/v1/tx/${tt.hash}/details?format=json`));return qe.map((tt,nt)=>{const pt=Fe[nt],tn=pu(tt,[],N,{blockHeight:ge.height,blockHash:ge.hash,tipHeight:pe,timestamp:ge.timestamp},typeof pt?.fee=="number"?pt.fee:void 0);return gu(tn,pt)})},async getTransaction(W){const de=await sn(e,`/v1/tx/${W}?format=json`),X=zR(e),ge=ol(de.inputs,wo,qe=>/^0{64}$/u.test(qe.point.hash)?Promise.resolve(null):X(qe.point.hash,qe.point.index)),[pe,Ue,je,He]=await Promise.all([Gt(e,`/v1/tx/${W}/header?format=json`),ei(e).catch(()=>null),Gt(e,`/v1/tx/${W}/details?format=json`),ge]);typeof Ue=="number"&&(E=Math.max(E??0,Ue));const Ot=pu(de,He,N,{blockHeight:pe?.height,blockHash:pe?.hash,tipHeight:typeof Ue=="number"?Ue:void 0,timestamp:pe?.timestamp},typeof je?.fee=="number"?je.fee:void 0);return gu(Ot,je)},async getTransactionHeader(W){const de=await sn(e,`/v1/tx/${W}?format=json`),[X,ge,pe]=await Promise.all([Gt(e,`/v1/tx/${W}/header?format=json`),ei(e).catch(()=>null),Gt(e,`/v1/tx/${W}/details?format=json`)]);typeof ge=="number"&&(E=Math.max(E??0,ge));const Ue=pu(de,[],N,{blockHeight:X?.height,blockHash:X?.hash,tipHeight:typeof ge=="number"?ge:void 0,timestamp:X?.timestamp},typeof pe?.fee=="number"?pe.fee:void 0);return gu(Ue,pe)},async getTransactionInputScriptHex(W,de){return(await sn(e,`/v1/input/${W}/${String(de)}/script?format=text`)).trim()},async getTransactionOutputScriptHex(W,de){return(await sn(e,`/v1/output/${W}/${String(de)}/script?format=text`)).trim()},async getAddress(W){const de=Nr(W,N);if(!de)throw new Error("Unsupported address format for libbitcoin adapter");const X=F??await _();if(!D(X))throw new Error("Address endpoints are disabled by server configuration");const ge=i&&B(X),[pe,Ue]=await Promise.all([Gt(e,`/v1/address/${de.hash}/balance?format=json`,ge),a0(e,de.hash,ge)]),je=i0(pe,Ue),He=await j(de.hash,ge);return{address:W,addressType:de.type,balance:je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ue.length,transactions:He}},async getAddressSummary(W){const de=Nr(W,N);if(!de)throw new Error("Unsupported address format for libb)DELIM" +R"DELIM(itcoin adapter");const X=F??await _();if(!D(X))throw new Error("Address endpoints are disabled by server configuration");const ge=i&&B(X),[pe,Ue]=await Promise.all([Gt(e,`/v1/address/${de.hash}/balance?format=json`,ge),a0(e,de.hash,ge)]),je=i0(pe,Ue);return{address:W,addressType:de.type,balance:je,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ue.length}},async getAddressTransactions(W,de){const X=Nr(W,N);if(!X)return[];const ge=F??await _();if(!D(ge))return[];const pe=i&&B(ge);return j(X.hash,pe,de)},subscribeToEvents(W){return le(),l.add(W),he(),()=>{l.delete(W),Te()}},getEventStatus:Q,subscribeToEventStatus(W){return s.add(W),W(Q()),()=>{s.delete(W)}}}}const Gb=T.createContext(null),Kb=T.createContext(null),Vb=T.createContext(null);function LR({children:e,client:a}){return v.jsx(Gb.Provider,{value:a,children:e})}function BR({children:e,provider:a,setProvider:i,availableProviders:l,selectorVisible:s,setSelectorVisible:u}){return v.jsx(Kb.Provider,{value:{provider:a,setProvider:i,availableProviders:l,selectorVisible:s,setSelectorVisible:u},children:e})}function UR({children:e,turbo:a,setTurbo:i}){return v.jsx(Vb.Provider,{value:{turbo:a,setTurbo:i},children:e})}function Ya(){const e=T.useContext(Gb);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function Qo(){return Ya().metadata}function Xb(){const e=T.useContext(Kb);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function Ib(){const e=T.useContext(Vb);if(!e)throw new Error("TurboProvider missing in component tree");return e}function kd(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8080"}function HR(e,a){if(e==="blockstream")return Ob({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return P4({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const l=kd();return Od({baseUrl:l,turbo:a?.turboEnabled})}if(e==="external"){console.warn("No external API URL provided, falling back to libbitcoin provider");const l=kd();return Od({baseUrl:l,turbo:a?.turboEnabled})}console.warn(`Unknown provider "${e}", falling back to libbitcoin provider`);const i=kd();return Od({baseUrl:i,turbo:a?.turboEnabled})}function $R(){return[...new Set(["libbitcoin","blockstream","mempool"])]}const Dd=10,ZR=20;function Jb(e){return e.metadata.endpoint?{providerId:e.metadata.id,endpoint:e.metadata.endpoint}:{providerId:e.metadata.id}}function qR(e,a){if(!e||typeof e!="object"||Array.isArray(e))return!1;const i=e;return i.providerId===a.providerId&&i.endpoint===a.endpoint}function PR(e,a){if(!e||typeof e!="object"||Array.isArray(e))return a;const i=e.limit;return typeof i=="number"&&Number.isFinite(i)&&i>0?i:a}function QR(e,a,i){const l=e.getQueryCache().findAll({predicate:s=>{const u=s.queryKey;return u.length>=4&&qR(u[0],a)&&u[1]==="blocks"&&u[2]==="latest"}});for(const s of l){const u=PR(s.queryKey[3],Dd);e.setQueryData(s.queryKey,c=>[i,...(c??[]).filter(p=>p.hash!==i.hash)].slice(0,u))}e.setQueryData([a,"blocks","latest",{limit:Dd}],s=>[i,...(s??[]).filter(d=>d.hash!==i.hash)].slice(0,Dd))}function FR(e,a,i){e.setQueryData([a,"transactions","recent"],l=>[i,...(l??[]).filter(c=>c.txid!==i.txid)].slice(0,ZR))}function YR(e,a,i){i.type==="block.new"&&QR(e,a,i.payload),i.type==="tx.new"&&FR(e,a,i.payload)}function Kn({queryKey:e,queryFn:a,enabled:i,staleTime:l,initialData:s}){const u=Ya();return t_({queryKey:[Jb(u),...e],queryFn:()=>a(u),enabled:i,staleTime:l,initialData:s})}function Wb(e=10){return Kn({queryKey:["blocks","latest",{limit:e}],queryFn:a=>a.getLatestBlocks(e)})}function ex(){return Kn({queryKey:["configuration"],queryFn:e=>e.getConfiguration(),staleTime:6e4})}function tx(e){return Kn({queryKey:["block",e,"header"],queryFn:a=>a.getBlockHeader(e)})}function nx(e,a){return Kn({queryKey:["block",e,"stats"],queryFn:i=>i.getBlockStats(e),enabled:(a?.enabled??!0)&&!!e.trim(),staleTime:1/0})}function GR(e,a=0){return Kn({queryKey:["block",e,"transactions",{startIndex:a}],queryFn:i=>i.getBlockTransactions(e,a)})}function KR(e){return Kn({queryKey:["transaction",e,"header"],queryFn:a=>a.getTransactionHeader(e),enabled:!!e.trim()})}function VR(e,a){return Kn({queryKey:["transaction",e],queryFn:i=>i.getTransaction(e),enabled:a?.enabled??!!e.trim()})}function XR(e,a,i){return Kn({queryKey:["transaction",e,"input",a,"scriptHex"],queryFn:l=>l.getTransactionInputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function IR(e,a,i){return Kn({queryKey:["transaction",e,"output",a,"scriptHex"],queryFn:l=>l.getTransactionOutputScriptHex(e,a),enabled:(i?.enabled??!0)&&!!e.trim()})}function JR(e){return Kn({queryKey:["address",e,"summary"],queryFn:a=>a.getAddressSummary(e),enabled:!!e.trim()})}function WR(e,a){return Kn({queryKey:["address",e,"transactions",{lastSeenTxid:null}],queryFn:i=>i.getAddressTransactions(e,a),enabled:!!e.trim()})}function e3(e){const a=Ya(),i=T.useRef(e);T.useEffect(()=>{i.current=e},[e]),T.useEffect(()=>{const l=a.subscribeToEvents(s=>{i.current(s)});return()=>{l()}},[a])}function t3(){const e=Ya(),a=T.useMemo(()=>({transport:e.metadata.supportsWebsocket?"websocket":"polling",websocketAvailable:e.metadata.supportsWebsocket}),[e.metadata.supportsWebsocket]),[i,l]=T.useState(()=>e.getEventStatus?e.getEventStatus():a);return T.useEffect(()=>{const s=e.getEventStatus?e.getEventStatus():a;return l(s),e.subscribeToEventStatus?.(l)},[e,a]),i}function n3(){const e=Ya(),a=T.useMemo(()=>Jb(e),[e]),i=Iu(),l=T.useCallback(s=>{YR(i,a,s)},[i,a]);return e3(l),null}function a3(e=10){const{data:a,isLoading:i,isError:l,error:s}=Wb(e),{data:u=[]}=Kn({queryKey:["transactions","recent"],queryFn:()=>Promise.resolve([]),enabled:!1,initialData:[]});return{data:a,recentTransactions:u,isLoading:i,isError:l,error:s}}function Ld(e){return globalThis.window?.localStorage.getItem(e)??null}function Bd(e,a){globalThis.window?.localStorage.setItem(e,a)}function r3({children:e}){const a="libbitcoin",i=$R(),[l,s]=T.useState(()=>Ld("turboEnabled")==="true"),[u,c]=T.useState(()=>{const g=Ld("blockchainProvider");return g&&i.includes(g)?g:a}),[d,m]=T.useState(()=>Ld("providerSelectorVisible")==="true"),[p]=T.useState(()=>new qw({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),b=T.useMemo(()=>HR(u,{turboEnabled:l}),[u,l]);return T.useEffect(()=>{Bd("turboEnabled",l?"true":"false")},[l]),T.useEffect(()=>{Bd("blockchainProvider",u)},[u]),T.useEffect(()=>{Bd("providerSelectorVisible",d?"true":"false")},[d]),v.jsx(BR,{provider:u,setProvider:c,availableProviders:i,selectorVisible:d,setSelectorVisible:m,children:v.jsx(UR,{turbo:l,setTurbo:s,children:v.jsx(LR,{client:b,children:v.jsxs(Pw,{client:p,children:[v.jsx(n3,{}),e,null]})})})})}var ax=e=>{throw TypeError(e)},rx=(e,a,i)=>a.has(e)||ax("Cannot "+i),Pn=(e,a,i)=>(rx(e,a,"read from private field"),i?i.call(e):a.get(e)),bo=(e,a,i)=>a.has(e)?ax("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),ha=(e,a,i,l)=>(rx(e,a,"write to private field"),a.set(e,i),i),nc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Yh=/^[\\/]{2}/;function ix(e,a){return a+e.replace(/\\/g,"/")}var l0="popstate";function o0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function i3(e={}){function a(l,s){let u=s.state?.masked,{pathname:c,search:d,hash:m}=u||l.location;return Oo("",{pathname:c,search:d,hash:m},s.state&&s.state.usr||null,s.state&&s.state.key||"default",u?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,s){return typeof s=="string"?s:ga(s)}return o3(a,i,null,e)}function De(e,a){if(e===!1||e===null||typeof e>"u")throw new Error(a)}function Tt(e,a){if(!e){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function l3(){return Math.random().toString(36).substring(2,10)}function s0(e,a){return{usr:e.state,key:e.key,idx:a,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}fun)DELIM" +R"DELIM(ction Oo(e,a,i=null,l,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof a=="string"?va(a):a,state:i,key:a&&a.key||l||l3(),mask:s}}function ga({pathname:e="/",search:a="",hash:i=""}){return a&&a!=="?"&&(e+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function va(e){let a={};if(e){let i=e.indexOf("#");i>=0&&(a.hash=e.substring(i),e=e.substring(0,i));let l=e.indexOf("?");l>=0&&(a.search=e.substring(l),e=e.substring(0,l)),e&&(a.pathname=e)}return a}function o3(e,a,i,l={}){let{window:s=document.defaultView,v5Compat:u=!1}=l,c=s.history,d="POP",m=null,p=b();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function b(){return(c.state||{idx:null}).idx}function g(){d="POP";let N=b(),F=N==null?null:N-p;p=N,m&&m({action:d,location:R.location,delta:F})}function x(N,F){d="PUSH";let V=o0(N)?N:Oo(R.location,N,F);p=b()+1;let J=s0(V,p),ue=R.createHref(V.mask||V);try{c.pushState(J,"",ue)}catch(ae){if(ae instanceof DOMException&&ae.name==="DataCloneError")throw ae;s.location.assign(ue)}u&&m&&m({action:d,location:R.location,delta:1})}function w(N,F){d="REPLACE";let V=o0(N)?N:Oo(R.location,N,F);p=b();let J=s0(V,p),ue=R.createHref(V.mask||V);c.replaceState(J,"",ue),u&&m&&m({action:d,location:R.location,delta:0})}function E(N){return lx(s,N)}let R={get action(){return d},get location(){return e(s,c)},listen(N){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(l0,g),m=N,()=>{s.removeEventListener(l0,g),m=null}},createHref(N){return a(s,N)},createURL:E,encodeLocation(N){let F=E(N);return{pathname:F.pathname,search:F.search,hash:F.hash}},push:x,replace:w,go(N){return c.go(N)}};return R}function lx(e,a,i=!1){let l="http://localhost";e&&(l=e.location.origin!=="null"?e.location.origin:e.location.href),De(l,"No window.location.(origin|href) available to create URL");let s=typeof a=="string"?a:ga(a);return s=s.replace(/ $/,"%20"),!i&&Yh.test(s)&&(s=l+s),new URL(s,l)}var xo,u0=class{constructor(e){if(bo(this,xo,new Map),e)for(let[a,i]of e)this.set(a,i)}get(e){if(Pn(this,xo).has(e))return Pn(this,xo).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,a){Pn(this,xo).set(e,a)}};xo=new WeakMap;var s3=new Set(["lazy","caseSensitive","path","id","index","children"]);function u3(e){return s3.has(e)}var c3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function f3(e){return c3.has(e)}function d3(e){return e.index===!0}function ko(e,a,i=[],l={},s=!1){return e.map((u,c)=>{let d=[...i,String(c)],m=typeof u.id=="string"?u.id:d.join("-");if(De(u.index!==!0||!u.children,"Cannot specify children on an index route"),De(s||!l[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),d3(u)){let p={...u,id:m};return l[m]=c0(p,a(p)),p}else{let p={...u,id:m,children:void 0};return l[m]=c0(p,a(p)),u.children&&(p.children=ko(u.children,a,d,l,s)),p}})}function c0(e,a){return Object.assign(e,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...e.lazy,...a.lazy}}:{}})}function ox(e,a,i="/"){return ia(e,a,i,!1)}function ia(e,a,i,l,s){let u=typeof a=="string"?va(a):a,c=Yn(u.pathname||"/",i);if(c==null)return null;let d=s??ju(e),m=null,p=E3(c);for(let b=0;m==null&&b{let b={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(l)&&m)return;De(b.relativePath.startsWith(l),`Absolute route path "${b.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(l.length)}let g=Fn([l,b.relativePath]),x=i.concat(b);c.children&&c.children.length>0&&(De(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),sx(c.children,a,x,g,m)),!(c.path==null&&!c.index)&&a.push({path:g,score:S3(g,c.index),routesMeta:x.map((w,E)=>{let[R,N]=fx(w.relativePath,w.caseSensitive,E===x.length-1);return{...w,matcher:R,compiledParams:N}})})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))u(c,d);else for(let m of ux(c.path))u(c,d,!0,m)}),a}function ux(e){let a=e.split("/");if(a.length===0)return[];let[i,...l]=a,s=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return s?[u,""]:[u];let c=ux(l.join("/")),d=[];return d.push(...c.map(m=>m===""?u:[u,m].join("/"))),s&&d.push(...c),d.map(m=>e.startsWith("/")&&m===""?"/":m)}function m3(e){e.sort((a,i)=>a.score!==i.score?i.score-a.score:w3(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var p3=/^:[\w-]+$/,y3=3,g3=2,v3=1,b3=10,x3=-2,f0=e=>e==="*";function S3(e,a){let i=e.split("/"),l=i.length;return i.some(f0)&&(l+=x3),a&&(l+=g3),i.filter(s=>!f0(s)).reduce((s,u)=>s+(p3.test(u)?y3:u===""?v3:b3),l)}function w3(e,a){return e.length===a.length&&e.slice(0,-1).every((l,s)=>l===a[s])?e[e.length-1]-a[a.length-1]:0}function _3(e,a,i=!1){let{routesMeta:l}=e,s={},u="/",c=[];for(let d=0;d{if(b==="*"){let E=d[x]||"";c=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const w=d[x];return g&&!w?p[b]=void 0:p[b]=(w||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:c,pattern:e}}function fx(e,a=!1,i=!0){Tt(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 l=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,m,p,b)=>{if(l.push({paramName:d,isOptional:m!=null}),m){let g=b.charAt(p+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,a?void 0:"i"),l]}function E3(e){try{return e.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Tt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),e}}function Yn(e,a){if(a==="/")return e;if(!e.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=e.charAt(i);return l&&l!=="/"?null:e.slice(i)||"/"}function T3({basename:e,pathname:a}){return a==="/"?e:Fn([e,a])}var Gh=e=>nc.test(e);function R3(e,a="/"){let{pathname:i,search:l="",hash:s=""}=typeof e=="string"?va(e):e,u;return i?(i=Kh(i),i.startsWith("/")?u=d0(i.substring(1),"/"):u=d0(i,a)):u=a,{pathname:u,search:z3(l),hash:C3(s)}}function d0(e,a){let i=Ku(a).split("/");return e.split("/").forEach)DELIM" +R"DELIM((s=>{s===".."?i.length>1&&i.pop():s!=="."&&i.push(s)}),i.length>1?i.join("/"):"/"}function Ud(e,a,i,l){return`Cannot include a '${e}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. 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 dx(e){return e.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function ac(e){let a=dx(e);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function Fo(e,a,i,l=!1){let s;typeof e=="string"?s=va(e):(s={...e},De(!s.pathname||!s.pathname.includes("?"),Ud("?","pathname","search",s)),De(!s.pathname||!s.pathname.includes("#"),Ud("#","pathname","hash",s)),De(!s.search||!s.search.includes("#"),Ud("#","search","hash",s)));let u=e===""||s.pathname==="",c=u?"/":s.pathname,d;if(c==null)d=i;else{let g=a.length-1;if(!l&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}d=g>=0?a[g]:"/"}let m=R3(s,d),p=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(p||b)&&(m.pathname+="/"),m}var Kh=e=>e.replace(/[\\/]{2,}/g,"/"),Fn=e=>Kh(e.join("/")),Ku=e=>e.replace(/\/+$/,""),A3=e=>Ku(e).replace(/^\/*/,"/"),z3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,C3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,j3=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yo=class{constructor(e,a,i,l=!1){this.status=e,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Do(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Go(e){let a=e.map(i=>i.route.path).filter(Boolean);return Fn(a)||"/"}var hx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mx(e,a){let i=e;if(typeof i!="string"||!nc.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,s=!1;if(hx)try{let u=new URL(window.location.href),c=Yh.test(i)?new URL(ix(i,u.protocol)):new URL(i),d=Yn(c.pathname,a);c.origin===u.origin&&d!=null?i=d+c.search+c.hash:s=!0}catch{Tt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:s,to:i}}var Cr=Symbol("Uninstrumented");function N3(e,a){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:a.id,index:a.index,path:a.path,instrument(u){let c=Object.keys(i);for(let d of c)u[d]&&i[d].push(u[d])}}));let l={};if(typeof a.lazy=="function"&&i.lazy.length>0){let s=rl(i.lazy,a.lazy,()=>{});s&&(l.lazy=s)}if(typeof a.lazy=="object"){let s=a.lazy;["middleware","loader","action"].forEach(u=>{let c=s[u],d=i[`lazy.${u}`];if(typeof c=="function"&&d.length>0){let m=rl(d,c,()=>{});m&&(l.lazy=Object.assign(l.lazy||{},{[u]:m}))}})}return["loader","action"].forEach(s=>{let u=a[s];if(typeof u=="function"&&i[s].length>0){let c=u[Cr]??u,d=rl(i[s],c,(...m)=>h0(m[0]));d&&(s==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[Cr]=c,l[s]=d)}}),a.middleware&&a.middleware.length>0&&i.middleware.length>0&&(l.middleware=a.middleware.map(s=>{let u=s[Cr]??s,c=rl(i.middleware,u,(...d)=>h0(d[0]));return c?(c[Cr]=u,c):s})),l}function M3(e,a){let i={navigate:[],fetch:[]};if(a.forEach(l=>l({instrument(s){let u=Object.keys(s);for(let c of u)s[c]&&i[c].push(s[c])}})),i.navigate.length>0){let l=e.navigate[Cr]??e.navigate,s=rl(i.navigate,l,(...u)=>{let[c,d]=u;return{to:typeof c=="number"||typeof c=="string"?c:c?ga(c):".",...m0(e,d??{})}});s&&(s[Cr]=l,e.navigate=s)}if(i.fetch.length>0){let l=e.fetch[Cr]??e.fetch,s=rl(i.fetch,l,(...u)=>{let[c,,d,m]=u;return{href:d??".",fetcherKey:c,...m0(e,m??{})}});s&&(s[Cr]=l,e.fetch=s)}return e}function rl(e,a,i){return e.length===0?null:async(...l)=>{let s=await px(e,i(...l),()=>a(...l),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function px(e,a,i,l){let s=e[l],u;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=px(e,a,i,l-1),u=await c,De(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await s(d,a)}catch(m){console.error("An instrumentation function threw an error:",m)}c||await d(),await c}else try{u={type:"success",value:await i()}}catch(c){u={type:"error",value:c}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function h0(e){let{request:a,context:i,params:l,pattern:s}=e;return{request:O3(a),params:{...l},pattern:s,context:k3(i)}}function m0(e,a){return{currentUrl:ga(e.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 O3(e){return{method:e.method,url:e.url,headers:{get:(...a)=>e.headers.get(...a)}}}function k3(e){if(L3(e)){let a={...e};return Object.freeze(a),a}else return{get:a=>e.get(a)}}var D3=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function L3(e){if(e===null||typeof e!="object")return!1;const a=Object.getPrototypeOf(e);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===D3}var yx=["POST","PUT","PATCH","DELETE"],B3=new Set(yx),U3=["GET",...yx],H3=new Set(U3),gx=new Set([301,302,303,307,308]),$3=new Set([307,308]),Hd={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Z3={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ho={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},q3=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),vx="remix-router-transitions",bx=Symbol("ResetLoaderData"),ti,el,Tr,tl,P3=class{constructor(e){bo(this,ti),bo(this,el),bo(this,Tr),bo(this,tl),ha(this,ti,e),ha(this,el,ju(e))}get stableRoutes(){return Pn(this,ti)}get activeRoutes(){return Pn(this,Tr)??Pn(this,ti)}get branches(){return Pn(this,tl)??Pn(this,el)}get hasHMRRoutes(){return Pn(this,Tr)!=null}setRoutes(e){ha(this,ti,e),ha(this,el,ju(e))}setHmrRoutes(e){ha(this,Tr,e),ha(this,tl,ju(e))}commitHmrRoutes(){Pn(this,Tr)&&(ha(this,ti,Pn(this,Tr)),ha(this,el,Pn(this,tl)),ha(this,Tr,void 0),ha(this,tl,void 0))}};ti=new WeakMap;el=new WeakMap;Tr=new WeakMap;tl=new WeakMap;function Q3(e){const a=e.window?e.window:typeof window<"u"?window:void 0,i=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";De(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l=e.hydrationRouteProperties||[],s=e.mapRouteProperties||q3,u=s;if(e.instrumentations){let z=e.instrumentations;u=L=>({...s(L),...N3(z.map(Z=>Z.route).filter(Boolean),L)})}let c={},d=new P3(ko(e.routes,u,void 0,c)),m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let p=e.dataStrategy||V3,b={...e.future},g=null,x=new Set,w=null,E=null,R=null,N=null,F=e.hydrationData!=null,V=ia(d.activeRoutes,e.history.location,m,!1,d.branches),J=!1,ue=null,ae,xe;if(V==null&&!e.patchRoutesOnNavigation){let z=Qn(404,{pathname:e.history.location.pathname}),{matches:L,route:Z}=bu(d.activeRoutes);ae=!0,xe=!ae,V=L,ue={[Z.id]:z}}else if(V&&!e.hydrationData&&Va(V,d.activeRoutes,e.history.location.pathname).active&&(V=null),V)if(V.some(z=>z.route.lazy))ae=!1,xe=!ae;else if(!V.some(z=>Vh(z.route)))ae=!0,xe=!ae;else{let z=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null,Z=V;if(L){let ie=V.findIndex(se=>L[se.route.id]!==void 0);Z=Z.slice(0,ie+1)}xe=!1,ae=!0,Z.forEach(ie=>{let se=xx(ie.route,z,L);xe=xe||se.renderFallback,ae=ae&&!se.shouldLoad})}else{ae=!1,xe=!ae,V=[];let z=Va(null,d.activeRoutes,e.history.location.pathname);z.active&&z.matches&&(J=!0,V=z.matches)}let j,_=)DELIM" +R"DELIM({historyAction:e.history.action,location:e.history.location,matches:V,initialized:ae,renderFallback:xe,navigation:Hd,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||ue,fetchers:new Map,blockers:new Map},D="POP",B=null,Q=!1,q,G=!1,re=new Map,fe=null,M=!1,k=!1,le=new Set,ce=new Map,we=0,C=-1,K=new Map,oe=new Set,he=new Map,Ee=new Map,Te=new Set,W=new Map,de,X=null;function ge(){if(g=e.history.listen(({action:z,location:L,delta:Z})=>{if(de){de(),de=void 0;return}Tt(W.size===0||Z!=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 ie=Br({currentLocation:_.location,nextLocation:L,historyAction:z});if(ie&&Z!=null){let se=new Promise(be=>{de=be});e.history.go(Z*-1),wa(ie,{state:"blocked",location:L,proceed(){wa(ie,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),se.then(()=>e.history.go(Z))},reset(){let be=new Map(_.blockers);be.set(ie,ho),je({blockers:be})}}),B?.resolve(),B=null;return}return Fe(z,L)}),i){mA(a,re);let z=()=>pA(a,re);a.addEventListener("pagehide",z),fe=()=>a.removeEventListener("pagehide",z)}return _.initialized||Fe("POP",_.location,{initialHydration:!0}),j}function pe(){g&&g(),fe&&fe(),x.clear(),q&&q.abort(),_.fetchers.forEach((z,L)=>Sa(_.fetchers,L)),_.blockers.forEach((z,L)=>Lr(L))}function Ue(z){if(x.add(z),w){let{newErrors:L}=w;w=null,z(_,{deletedFetchers:[],newErrors:L,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(z)}function je(z,L={}){z.matches&&(z.matches=z.matches.map(se=>{let be=c[se.route.id],me=se.route;return me.element!==be.element||me.errorElement!==be.errorElement||me.hydrateFallbackElement!==be.hydrateFallbackElement?{...se,route:be}:se})),_={..._,...z};let Z=[],ie=[];_.fetchers.forEach((se,be)=>{se.state==="idle"&&(Te.has(be)?Z.push(be):ie.push(be))}),Te.forEach(se=>{!_.fetchers.has(se)&&!ce.has(se)&&Z.push(se)}),x.size===0&&(w={newErrors:z.errors??null}),[...x].forEach(se=>se(_,{deletedFetchers:Z,newErrors:z.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),Z.forEach(se=>Sa(_.fetchers,se)),ie.forEach(se=>_.fetchers.delete(se))}function He(z,L,{flushSync:Z}={}){let ie=_.actionData!=null&&_.navigation.formMethod!=null&&en(_.navigation.formMethod)&&_.navigation.state==="loading"&&z.state?._isRedirect!==!0,se;L.actionData?Object.keys(L.actionData).length>0?se=L.actionData:se=null:ie?se=_.actionData:se=null;let be=L.loaderData?E0(_.loaderData,L.loaderData,L.matches||[],L.errors):_.loaderData,me=_.blockers;me.size>0&&(me=new Map(me),me.forEach((ze,Le)=>me.set(Le,ho)));let ve=M?!1:vl(z,L.matches||_.matches),ye=Q===!0||_.navigation.formMethod!=null&&en(_.navigation.formMethod)&&z.state?._isRedirect!==!0;d.commitHmrRoutes(),M||D==="POP"||(D==="PUSH"?e.history.push(z,z.state):D==="REPLACE"&&e.history.replace(z,z.state));let Ae;if(D==="POP"){let ze=re.get(_.location.pathname);ze&&ze.has(z.pathname)?Ae={currentLocation:_.location,nextLocation:z}:re.has(z.pathname)&&(Ae={currentLocation:z,nextLocation:_.location})}else if(G){let ze=re.get(_.location.pathname);ze?ze.add(z.pathname):(ze=new Set([z.pathname]),re.set(_.location.pathname,ze)),Ae={currentLocation:_.location,nextLocation:z}}je({...L,actionData:se,loaderData:be,historyAction:D,location:z,initialized:!0,renderFallback:!1,navigation:Hd,revalidation:"idle",restoreScrollPosition:ve,preventScrollReset:ye,blockers:me},{viewTransitionOpts:Ae,flushSync:Z===!0}),D="POP",Q=!1,G=!1,M=!1,k=!1,B?.resolve(),B=null,X?.resolve(),X=null}async function Ot(z,L){if(B?.resolve(),B=null,typeof z=="number"){B||(B=z0());let Je=B.promise;return e.history.go(z),Je}let Z=ph(_.location,_.matches,m,z,L?.fromRouteId,L?.relative),{path:ie,submission:se,error:be}=p0(!1,Z,L),me;L?.mask&&(me={pathname:"",search:"",hash:"",...typeof L.mask=="string"?va(L.mask):{..._.location.mask,...L.mask}});let ve=_.location,ye=Oo(ve,ie,L&&L.state,void 0,me);ye={...ye,...e.history.encodeLocation(ye)};let Ae=L&&L.replace!=null?L.replace:void 0,ze="PUSH";Ae===!0?ze="REPLACE":Ae===!1||se!=null&&en(se.formMethod)&&se.formAction===_.location.pathname+_.location.search&&(ze="REPLACE");let Le=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Me=(L&&L.flushSync)===!0,Ze=Br({currentLocation:ve,nextLocation:ye,historyAction:ze});if(Ze){wa(Ze,{state:"blocked",location:ye,proceed(){wa(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),Ot(z,L)},reset(){let Je=new Map(_.blockers);Je.set(Ze,ho),je({blockers:Je})}});return}await Fe(ze,ye,{submission:se,pendingError:be,preventScrollReset:Le,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Me,callSiteDefaultShouldRevalidate:L&&L.defaultShouldRevalidate})}function qe(){X||(X=z0()),Ga(),je({revalidation:"loading"});let z=X.promise;return _.navigation.state==="submitting"?z:_.navigation.state==="idle"?(Fe(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),z):(Fe(D||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:G===!0}),z)}async function Fe(z,L,Z){q&&q.abort(),q=null,D=z,M=(Z&&Z.startUninterruptedRevalidation)===!0,dc(_.location,_.matches),Q=(Z&&Z.preventScrollReset)===!0,G=(Z&&Z.enableViewTransition)===!0;let ie=d.activeRoutes,se=Z?.initialHydration&&_.matches&&_.matches.length>0&&!J?_.matches:ia(ie,L,m,!1,d.branches),be=(Z&&Z.flushSync)===!0;if(se&&_.initialized&&!k&&rA(_.location,L)&&!(Z&&Z.submission&&en(Z.submission.formMethod))){He(L,{matches:se},{flushSync:be});return}let me=Va(se,ie,L.pathname);if(me.active&&me.matches&&(se=me.matches),!se){let{error:it,notFoundMatches:Ve,route:At}=In(L.pathname);He(L,{matches:Ve,loaderData:{},errors:{[At.id]:it}},{flushSync:be});return}let ve=Z&&Z.overrideNavigation?{...Z.overrideNavigation,matches:se,historyAction:z}:void 0;q=new AbortController;let ye=nl(e.history,L,q.signal,Z&&Z.submission),Ae=e.getContext?await e.getContext():new u0,ze;if(Z&&Z.pendingError)ze=[zr(se).route.id,{type:"error",error:Z.pendingError}];else if(Z&&Z.submission&&en(Z.submission.formMethod)){let it=await tt(ye,L,Z.submission,se,z,Ae,me.active,Z&&Z.initialHydration===!0,{replace:Z.replace,flushSync:be});if(it.shortCircuited)return;if(it.pendingActionResult){let[Ve,At]=it.pendingActionResult;if(Cn(At)&&Do(At.error)&&At.error.status===404){q=null,He(L,{matches:it.matches,loaderData:{},errors:{[Ve]:At.error}});return}}se=it.matches||se,ze=it.pendingActionResult,ve=$d(L,se,z,Z.submission),be=!1,me.active=!1,ye=nl(e.history,ye.url,ye.signal)}let{shortCircuited:Le,matches:Me,loaderData:Ze,errors:Je,workingFetchers:yt}=await nt(ye,L,se,z,Ae,me.active,ve,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,be,ze,Z&&Z.callSiteDefaultShouldRevalidate);Le||(q=null,He(L,{matches:Me||se,...T0(ze),loaderData:Ze,errors:Je,...yt?{fetchers:yt}:{}}))}async function tt(z,L,Z,ie,se,be,me,ve,ye={}){Ga();let Ae=dA(L,ie,se,Z);if(je({navigation:Ae},{flushSync:ye.flushSync===!0}),me){let Me=await oa(ie,L.pathname,z.signal);if(Me.type==="aborted")return{shortCircuited:!0};if(Me.type==="error"){if(Me.partialMatches.length===0){let{matches:Je,route:yt}=bu(d.activeRoutes);return{matches:Je,pendingActionResult:[yt.id,{type:"error",error:Me.error}]}}let Ze=zr(Me.partialMatches).route.id;return{matches:Me.partialMatches,pendingActionResult:[Ze,{type:"error",error:Me.error}]}}else if(Me.matches)ie=Me.matches;else{let{notFoundMatches:Ze,error:Je,route:yt}=In(L.pathname);return{matches:Ze,pendingActionResult:[yt.id,{type:"error",error:Je}]}}}let ze,Le=Nu(ie,L);i)DELIM" +R"DELIM(f(!Le.route.action&&!Le.route.lazy)ze={type:"error",error:Qn(405,{method:z.method,pathname:L.pathname,routeId:Le.route.id})};else{let Me=sl(u,c,z,L,ie,Le,ve?[]:l,be),Ze=await Mn(z,L,Me,be,null);if(ze=Ze[Le.route.id],!ze){for(let Je of ie)if(Ze[Je.route.id]){ze=Ze[Je.route.id];break}}if(z.signal.aborted)return{shortCircuited:!0}}if(ri(ze)){let Me;return ye&&ye.replace!=null?Me=ye.replace:Me=S0(ze.response.headers.get("Location"),new URL(z.url),m,e.history)===_.location.pathname+_.location.search,await bn(z,ze,!0,{submission:Z,replace:Me}),{shortCircuited:!0}}if(Cn(ze)){let Me=zr(ie,Le.route.id);return(ye&&ye.replace)!==!0&&(D="PUSH"),{matches:ie,pendingActionResult:[Me.route.id,ze,Le.route.id]}}return{matches:ie,pendingActionResult:[Le.route.id,ze]}}async function nt(z,L,Z,ie,se,be,me,ve,ye,Ae,ze,Le,Me,Ze){let Je=me||$d(L,Z,ie,ve),yt=ve||ye||A0(Je),it=!M&&!ze;if(be){if(it){let ht=pt(Me);je({navigation:Je,...ht!==void 0?{actionData:ht}:{}},{flushSync:Le})}let Oe=await oa(Z,L.pathname,z.signal);if(Oe.type==="aborted")return{shortCircuited:!0};if(Oe.type==="error"){if(Oe.partialMatches.length===0){let{matches:xn,route:ea}=bu(d.activeRoutes);return{matches:xn,loaderData:{},errors:{[ea.id]:Oe.error}}}let ht=zr(Oe.partialMatches).route.id;return{matches:Oe.partialMatches,loaderData:{},errors:{[ht]:Oe.error}}}else if(Oe.matches)Z=Oe.matches;else{let{error:ht,notFoundMatches:xn,route:ea}=In(L.pathname);return{matches:xn,loaderData:{},errors:{[ea.id]:ht}}}}let Ve=d.activeRoutes,{dsMatches:At,revalidatingFetchers:Xe}=y0(z,se,u,c,e.history,_,Z,yt,L,ze?[]:l,ze===!0,k,le,Te,he,oe,Ve,m,e.patchRoutesOnNavigation!=null,d.branches,Me,Ze);if(C=++we,!e.dataStrategy&&!At.some(Oe=>Oe.shouldLoad)&&!At.some(Oe=>Oe.route.middleware&&Oe.route.middleware.length>0)&&Xe.length===0){let Oe=new Map(_.fetchers),ht=Io(Oe);return He(L,{matches:Z,loaderData:{},errors:Me&&Cn(Me[1])?{[Me[0]]:Me[1].error}:null,...T0(Me),...ht?{fetchers:Oe}:{}},{flushSync:Le}),{shortCircuited:!0}}if(it){let Oe={};if(!be){Oe.navigation=Je;let ht=pt(Me);ht!==void 0&&(Oe.actionData=ht)}Xe.length>0&&(Oe.fetchers=tn(Xe)),je(Oe,{flushSync:Le})}Xe.forEach(Oe=>{Zt(Oe.key),Oe.controller&&ce.set(Oe.key,Oe.controller)});let Xa=()=>Xe.forEach(Oe=>Zt(Oe.key));q&&q.signal.addEventListener("abort",Xa);let{loaderResults:Jn,fetcherResults:cn}=await Dr(At,Xe,z,L,se);if(z.signal.aborted)return{shortCircuited:!0};q&&q.signal.removeEventListener("abort",Xa),Xe.forEach(Oe=>ce.delete(Oe.key));let an=xu(Jn);if(an)return await bn(z,an.result,!0,{replace:Ae}),{shortCircuited:!0};if(an=xu(cn),an)return oe.add(an.key),await bn(z,an.result,!0,{replace:Ae}),{shortCircuited:!0};let kn=new Map(_.fetchers),{loaderData:hi,errors:Wn}=_0(_,Z,Jn,Me,Xe,cn,kn);ze&&_.errors&&(Wn={..._.errors,...Wn});let mi=Io(kn),_a=Jo(C,kn),Ea=mi||_a||Xe.length>0;return{matches:Z,loaderData:hi,errors:Wn,...Ea?{workingFetchers:kn}:{}}}function pt(z){if(z&&!Cn(z[1]))return{[z[0]]:z[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function tn(z){let L=new Map(_.fetchers);return z.forEach(Z=>{let ie=L.get(Z.key),se=mo(void 0,ie?ie.data:void 0);L.set(Z.key,se)}),L}async function xa(z,L,Z,ie){Zt(z);let se=(ie&&ie.flushSync)===!0,be=d.activeRoutes,me=ph(_.location,_.matches,m,Z,L,ie?.relative),ve=ia(be,me,m,!1,d.branches),ye=Va(ve,be,me);if(ye.active&&ye.matches&&(ve=ye.matches),!ve){On(z,L,Qn(404,{pathname:me}),{flushSync:se});return}let{path:Ae,submission:ze,error:Le}=p0(!0,me,ie);if(Le){On(z,L,Le,{flushSync:se});return}let Me=e.getContext?await e.getContext():new u0,Ze=(ie&&ie.preventScrollReset)===!0;if(ze&&en(ze.formMethod)){await gl(z,L,Ae,ve,Me,ye.active,se,Ze,ze,ie&&ie.defaultShouldRevalidate);return}he.set(z,{routeId:L,path:Ae}),await Rt(z,L,Ae,ve,Me,ye.active,se,Ze,ze)}async function gl(z,L,Z,ie,se,be,me,ve,ye,Ae){Ga(),he.delete(z);let ze=_.fetchers.get(z);Xn(z,hA(ye,ze),{flushSync:me});let Le=new AbortController,Me=nl(e.history,Z,Le.signal,ye);if(be){let lt=await oa(ie,new URL(Me.url).pathname,Me.signal,z);if(lt.type==="aborted")return;if(lt.type==="error"){On(z,L,lt.error,{flushSync:me});return}else if(lt.matches)ie=lt.matches;else{On(z,L,Qn(404,{pathname:Z}),{flushSync:me});return}}let Ze=Nu(ie,Z);if(!Ze.route.action&&!Ze.route.lazy){let lt=Qn(405,{method:ye.formMethod,pathname:Z,routeId:L});On(z,L,lt,{flushSync:me});return}ce.set(z,Le);let Je=we,yt=sl(u,c,Me,Z,ie,Ze,l,se),it=await Mn(Me,Z,yt,se,z),Ve=it[Ze.route.id];if(!Ve){for(let lt of yt)if(it[lt.route.id]){Ve=it[lt.route.id];break}}if(Me.signal.aborted){ce.get(z)===Le&&ce.delete(z);return}if(Te.has(z)){if(ri(Ve)||Cn(Ve)){Xn(z,pa(void 0));return}}else{if(ri(Ve))if(ce.delete(z),C>Je){Xn(z,pa(void 0));return}else return oe.add(z),Xn(z,mo(ye)),bn(Me,Ve,!1,{fetcherSubmission:ye,preventScrollReset:ve});if(Cn(Ve)){On(z,L,Ve.error);return}}let At=_.navigation.location||_.location,Xe=nl(e.history,At,Le.signal),Xa=d.activeRoutes,Jn=_.navigation.state!=="idle"?ia(Xa,_.navigation.location,m,!1,d.branches):_.matches;De(Jn,"Didn't find any matches after fetcher action");let cn=++we;K.set(z,cn);let{dsMatches:an,revalidatingFetchers:kn}=y0(Xe,se,u,c,e.history,_,Jn,ye,At,l,!1,k,le,Te,he,oe,Xa,m,e.patchRoutesOnNavigation!=null,d.branches,[Ze.route.id,Ve],Ae),hi=mo(ye,Ve.data),Wn=new Map(_.fetchers);Wn.set(z,hi),kn.filter(lt=>lt.key!==z).forEach(lt=>{let Ta=lt.key,rn=Wn.get(Ta),bl=mo(void 0,rn?rn.data:void 0);Wn.set(Ta,bl),Zt(Ta),lt.controller&&ce.set(Ta,lt.controller)}),je({fetchers:Wn});let mi=()=>kn.forEach(lt=>Zt(lt.key));Le.signal.addEventListener("abort",mi);let{loaderResults:_a,fetcherResults:Ea}=await Dr(an,kn,Xe,At,se);if(Le.signal.aborted)return;Le.signal.removeEventListener("abort",mi),K.delete(z),ce.delete(z),kn.forEach(lt=>ce.delete(lt.key));let Oe=_.fetchers.has(z),ht=lt=>{if(!Oe)return lt;let Ta=new Map(lt.fetchers);return Ta.set(z,pa(Ve.data)),{...lt,fetchers:Ta}},xn=xu(_a);if(xn)return _=ht(_),bn(Xe,xn.result,!1,{preventScrollReset:ve});if(xn=xu(Ea),xn)return oe.add(xn.key),_=ht(_),bn(Xe,xn.result,!1,{preventScrollReset:ve});let ea=new Map(_.fetchers);Oe&&ea.set(z,pa(Ve.data));let{loaderData:pi,errors:yi}=_0(_,Jn,_a,void 0,kn,Ea,ea);Jo(cn,ea),_.navigation.state==="loading"&&cn>C?(De(D,"Expected pending action"),q&&q.abort(),He(_.navigation.location,{matches:Jn,loaderData:pi,errors:yi,fetchers:ea})):(je({errors:yi,loaderData:E0(_.loaderData,pi,Jn,yi),fetchers:ea}),k=!1)}async function Rt(z,L,Z,ie,se,be,me,ve,ye){let Ae=_.fetchers.get(z);Xn(z,mo(ye,Ae?Ae.data:void 0),{flushSync:me});let ze=new AbortController,Le=nl(e.history,Z,ze.signal);if(be){let Ve=await oa(ie,new URL(Le.url).pathname,Le.signal,z);if(Ve.type==="aborted")return;if(Ve.type==="error"){On(z,L,Ve.error,{flushSync:me});return}else if(Ve.matches)ie=Ve.matches;else{On(z,L,Qn(404,{pathname:Z}),{flushSync:me});return}}let Me=Nu(ie,Z);ce.set(z,ze);let Ze=we,Je=sl(u,c,Le,Z,ie,Me,l,se),yt=await Mn(Le,Z,Je,se,z),it=yt[Me.route.id];if(!it){for(let Ve of ie)if(yt[Ve.route.id]){it=yt[Ve.route.id];break}}if(ce.get(z)===ze&&ce.delete(z),!Le.signal.aborted){if(Te.has(z)){Xn(z,pa(void 0));return}if(ri(it))if(C>Ze){Xn(z,pa(void 0));return}else{oe.add(z),await bn(Le,it,!1,{preventScrollReset:ve});return}if(Cn(it)){On(z,L,it.error);return}Xn(z,pa(it.data))}}async function bn(z,L,Z,{submission:ie,fetcherSubmission:se,preventScrollReset:be,replace:me}={}){Z||(B?.resolve(),B=null),L.response.headers.has("X-Remix-Revalidate")&&(k=!0);let ve=L.response.headers.get("Location");De(ve,"Expected a Location header on the redirect Response"),ve=S0(ve,new URL(z.url),m,e.history);let ye=Oo(_.location,ve,{_isRedirect:!0});if(i){let Je=!1;if(L.response.headers.has("X-Remix-Reload-Document"))Je=!0;else if(Gh(ve)){const yt=lx(a,ve,!0);Je=yt.origin!==a.location.origin||Yn(yt.pathname,m)==null}if(Je){me?a.location.replace(ve):a.location.assign(ve);return}}q=null;let Ae=me===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ze,formAction:Le,formEncType:Me}=_.navigation;!ie&&!se&&ze&&Le&&Me&&(ie=A0(_.navigation));)DELIM" +R"DELIM(let Ze=ie||se;if($3.has(L.response.status)&&Ze&&en(Ze.formMethod))await Fe(Ae,ye,{submission:{...Ze,formAction:ve},preventScrollReset:be||Q,enableViewTransition:Z?G:void 0});else{let Je=$d(ye,[],Ae,ie);await Fe(Ae,ye,{overrideNavigation:Je,fetcherSubmission:se,preventScrollReset:be||Q,enableViewTransition:Z?G:void 0})}}async function Mn(z,L,Z,ie,se){let be,me={};try{be=await I3(p,z,L,Z,se,ie,!1)}catch(ve){return Z.filter(ye=>ye.shouldLoad).forEach(ye=>{me[ye.route.id]={type:"error",error:ve}}),me}if(z.signal.aborted)return me;if(!en(z.method))for(let ve of Z){if(be[ve.route.id]?.type==="error")break;!be.hasOwnProperty(ve.route.id)&&!_.loaderData.hasOwnProperty(ve.route.id)&&(!_.errors||!_.errors.hasOwnProperty(ve.route.id))&&ve.shouldCallHandler()&&(be[ve.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ve.route.id}`)})}for(let[ve,ye]of Object.entries(be))if(sA(ye)){let Ae=ye.result;me[ve]={type:"redirect",response:tA(Ae,z,ve,Z,m)}}else me[ve]=await eA(ye);return me}async function Dr(z,L,Z,ie,se){let be=Mn(Z,ie,z,se,null),me=Promise.all(L.map(async Ae=>{if(Ae.matches&&Ae.match&&Ae.request&&Ae.controller){let Le=(await Mn(Ae.request,Ae.path,Ae.matches,se,Ae.key))[Ae.match.route.id];return{[Ae.key]:Le}}else return Promise.resolve({[Ae.key]:{type:"error",error:Qn(404,{pathname:Ae.path})}})})),ve=await be,ye=(await me).reduce((Ae,ze)=>Object.assign(Ae,ze),{});return{loaderResults:ve,fetcherResults:ye}}function Ga(){k=!0,he.forEach((z,L)=>{ce.has(L)&&le.add(L),Zt(L)})}function Xn(z,L,Z={}){let ie=new Map(_.fetchers);ie.set(z,L),je({fetchers:ie},{flushSync:(Z&&Z.flushSync)===!0})}function On(z,L,Z,ie={}){let se=zr(_.matches,L),be=new Map(_.fetchers);Sa(be,z),je({errors:{[se.route.id]:Z},fetchers:be},{flushSync:(ie&&ie.flushSync)===!0})}function uc(z){return Ee.set(z,(Ee.get(z)||0)+1),Te.has(z)&&Te.delete(z),_.fetchers.get(z)||Z3}function cc(z,L){Zt(z,L?.reason),Xn(z,pa(null))}function Sa(z,L){let Z=_.fetchers.get(L);ce.has(L)&&!(Z&&Z.state==="loading"&&K.has(L))&&Zt(L),he.delete(L),K.delete(L),oe.delete(L),Te.delete(L),le.delete(L),z.delete(L)}function nn(z){let L=(Ee.get(z)||0)-1;L<=0?(Ee.delete(z),Te.add(z)):Ee.set(z,L),je({fetchers:new Map(_.fetchers)})}function Zt(z,L){let Z=ce.get(z);Z&&(Z.abort(L),ce.delete(z))}function Xt(z,L){for(let Z of z){let ie=L.get(Z);De(ie,`Expected fetcher: ${Z}`);let se=pa(ie.data);L.set(Z,se)}}function Io(z){let L=[],Z=!1;for(let ie of oe){let se=z.get(ie);De(se,`Expected fetcher: ${ie}`),se.state==="loading"&&(oe.delete(ie),L.push(ie),Z=!0)}return Xt(L,z),Z}function Jo(z,L){let Z=[];for(let[ie,se]of K)if(se0}function fc(z,L){let Z=_.blockers.get(z)||ho;return W.get(z)!==L&&W.set(z,L),Z}function Lr(z){_.blockers.delete(z),W.delete(z)}function wa(z,L){let Z=_.blockers.get(z)||ho;De(Z.state==="unblocked"&&L.state==="blocked"||Z.state==="blocked"&&L.state==="blocked"||Z.state==="blocked"&&L.state==="proceeding"||Z.state==="blocked"&&L.state==="unblocked"||Z.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${Z.state} -> ${L.state}`);let ie=new Map(_.blockers);ie.set(z,L),je({blockers:ie})}function Br({currentLocation:z,nextLocation:L,historyAction:Z}){if(W.size===0)return;W.size>1&&Tt(!1,"A router only supports one blocker at a time");let ie=Array.from(W.entries()),[se,be]=ie[ie.length-1],me=_.blockers.get(se);if(!(me&&me.state==="proceeding")&&be({currentLocation:z,nextLocation:L,historyAction:Z}))return se}function In(z){let L=Qn(404,{pathname:z}),Z=d.activeRoutes,{matches:ie,route:se}=bu(Z);return{notFoundMatches:ie,route:se,error:L}}function di(z,L,Z){if(E=z,N=L,R=Z||null,!F&&_.navigation===Hd){F=!0;let ie=vl(_.location,_.matches);ie!=null&&je({restoreScrollPosition:ie})}return()=>{E=null,N=null,R=null}}function Ka(z,L){return R&&R(z,L.map(ie=>h3(ie,_.loaderData)))||z.key}function dc(z,L){if(E&&N){let Z=Ka(z,L);E[Z]=N()}}function vl(z,L){if(E){let Z=Ka(z,L),ie=E[Z];if(typeof ie=="number")return ie}return null}function Va(z,L,Z){if(e.patchRoutesOnNavigation){let ie=d.branches;if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:ia(L,Z,m,!0,ie)}}else return{active:!0,matches:ia(L,Z,m,!0,ie)||[]}}return{active:!1,matches:null}}async function oa(z,L,Z,ie){if(!e.patchRoutesOnNavigation)return{type:"success",matches:z};let se=z;for(;;){let be=c;try{await e.patchRoutesOnNavigation({signal:Z,path:L,matches:se,fetcherKey:ie,patch:(Ae,ze)=>{Z.aborted||g0(Ae,ze,d,be,u,!1)}})}catch(Ae){return{type:"error",error:Ae,partialMatches:se}}if(Z.aborted)return{type:"aborted"};let me=d.branches,ve=ia(d.activeRoutes,L,m,!1,me),ye=null;if(ve){if(Object.keys(ve[0].params).length===0)return{type:"success",matches:ve};if(ye=ia(d.activeRoutes,L,m,!0,me),!(ye&&se.lengthZ.route.id===L[ie].route.id)}function es(z){c={},d.setHmrRoutes(ko(z,u,void 0,c))}function ts(z,L,Z=!1){g0(z,L,d,c,u,Z),d.hasHMRRoutes||je({})}return j={get basename(){return m},get future(){return b},get state(){return _},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return c},get window(){return a},initialize:ge,subscribe:Ue,enableScrollRestoration:di,navigate:Ot,fetch:xa,revalidate:qe,createHref:z=>e.history.createHref(z),encodeLocation:z=>e.history.encodeLocation(z),getFetcher:uc,resetFetcher:cc,deleteFetcher:nn,dispose:pe,getBlocker:fc,deleteBlocker:Lr,patchRoutes:ts,_internalFetchControllers:ce,_internalSetRoutes:es,_internalSetStateDoNotUseOrYouWillBreakYourApp(z){je(z)}},e.instrumentations&&(j=M3(j,e.instrumentations.map(z=>z.router).filter(Boolean))),j}function F3(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ph(e,a,i,l,s,u){let c,d;if(s){c=[];for(let p of a)if(c.push(p),p.route.id===s){d=p;break}}else c=a,d=a[a.length-1];let m=Fo(l||".",ac(c),Yn(e.pathname,i)||e.pathname,u==="path");if(l==null&&(m.search=e.search,m.hash=e.hash),(l==null||l===""||l===".")&&d){let p=Ih(m.search);if(d.route.index&&!p)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let b=new URLSearchParams(m.search),g=b.getAll("index");b.delete("index"),g.filter(w=>w).forEach(w=>b.append("index",w));let x=b.toString();m.search=x?`?${x}`:""}}return i!=="/"&&(m.pathname=T3({basename:i,pathname:m.pathname})),ga(m)}function p0(e,a,i){if(!i||!F3(i))return{path:a};if(i.formMethod&&!fA(i.formMethod))return{path:a,error:Qn(405,{method:i.formMethod})};let l=()=>({path:a,error:Qn(400,{type:"invalid-body"})}),u=(i.formMethod||"get").toUpperCase(),c=Ax(a);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!en(u))return l();let g=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[w,E])=>`${x}${w}=${E} +`,""):String(i.body);return{path:a,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:void 0,text:g}}}else if(i.formEncType==="application/json"){if(!en(u))return l();try{let g=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:a,submission:{formMethod:u,formAction:c,formEncType:i.formEncType,formData:void 0,json:g,text:void 0}}}catch{return l()}}}De(typeof FormData=="function","FormData is not available in this environment");let d,m;if(i.formData)d=vh(i.formData),m=i.formData;else if(i.body instanceof FormData)d=vh(i.body),m=i.body;else if(i.body instanceof URLSearchParams)d=i.body,m=w0(d);else if(i.body==null)d=new URLSearchParams,m=new FormData;else try{d=new URLSearchParams(i.body),m=w0(d)}catch{return l()}let p={formMethod:u,formAction:c,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:m,json:vo)DELIM" +R"DELIM(id 0,text:void 0};if(en(p.formMethod))return{path:a,submission:p};let b=va(a);return e&&b.search&&Ih(b.search)&&d.append("index",""),b.search=`?${d}`,{path:ga(b),submission:p}}function y0(e,a,i,l,s,u,c,d,m,p,b,g,x,w,E,R,N,F,V,J,ue,ae){let xe=ue?Cn(ue[1])?ue[1].error:ue[1].data:void 0,j=s.createURL(u.location),_=s.createURL(m),D;if(b&&u.errors){let M=Object.keys(u.errors)[0];D=c.findIndex(k=>k.route.id===M)}else if(ue&&Cn(ue[1])){let M=ue[0];D=c.findIndex(k=>k.route.id===M)-1}let B=ue?ue[1].statusCode:void 0,Q=B&&B>=400,q={currentUrl:j,currentParams:u.matches[0]?.params||{},nextUrl:_,nextParams:c[0].params,...d,actionResult:xe,actionStatus:B},G=Go(c),re=c.map((M,k)=>{let{route:le}=M,ce=null;if(D!=null&&k>D)ce=!1;else if(le.lazy)ce=!0;else if(!Vh(le))ce=!1;else if(b){let{shouldLoad:oe}=xx(le,u.loaderData,u.errors);ce=oe}else Y3(u.loaderData,u.matches[k],M)&&(ce=!0);if(ce!==null)return yh(i,l,e,m,G,M,p,a,ce);let we=!1;typeof ae=="boolean"?we=ae:Q?we=!1:(g||j.pathname+j.search===_.pathname+_.search||j.search!==_.search||G3(u.matches[k],M))&&(we=!0);let C={...q,defaultShouldRevalidate:we},K=_o(M,C);return yh(i,l,e,m,G,M,p,a,K,C,ae)}),fe=[];return E.forEach((M,k)=>{if(b||!c.some(Ee=>Ee.route.id===M.routeId)||w.has(k))return;let le=u.fetchers.get(k),ce=le&&le.state!=="idle"&&le.data===void 0,we=ia(N,M.path,F??"/",!1,J);if(!we){if(V&&ce)return;fe.push({key:k,routeId:M.routeId,path:M.path,matches:null,match:null,request:null,controller:null});return}if(R.has(k))return;let C=Nu(we,M.path),K=new AbortController,oe=nl(s,M.path,K.signal),he=null;if(x.has(k))x.delete(k),he=sl(i,l,oe,M.path,we,C,p,a);else if(ce)g&&(he=sl(i,l,oe,M.path,we,C,p,a));else{let Ee;typeof ae=="boolean"?Ee=ae:Q?Ee=!1:Ee=g;let Te={...q,defaultShouldRevalidate:Ee};_o(C,Te)&&(he=sl(i,l,oe,M.path,we,C,p,a,Te))}he&&fe.push({key:k,routeId:M.routeId,path:M.path,matches:he,match:C,request:oe,controller:K})}),{dsMatches:re,revalidatingFetchers:fe}}function Vh(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function xx(e,a,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Vh(e))return{shouldLoad:!1,renderFallback:!1};let l=a!=null&&e.id in a,s=i!=null&&i[e.id]!==void 0;if(!l&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!l};let u=!l&&!s;return{shouldLoad:u,renderFallback:u}}function Y3(e,a,i){let l=!a||i.route.id!==a.route.id,s=!e.hasOwnProperty(i.route.id);return l||s}function G3(e,a){let i=e.route.path;return e.pathname!==a.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==a.params["*"]}function _o(e,a){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(a);if(typeof i=="boolean")return i}return a.defaultShouldRevalidate}function g0(e,a,i,l,s,u){let c;if(e){let p=l[e];De(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),c=p.children}else c=i.activeRoutes;let d=[],m=[];if(a.forEach(p=>{let b=c.find(g=>Sx(p,g));b?m.push({existingRoute:b,newRoute:p}):d.push(p)}),d.length>0){let p=ko(d,s,[e||"_","patch",String(c?.length||"0")],l);c.push(...p)}if(u&&m.length>0)for(let p=0;pa.children?.some(s=>Sx(i,s)))??!1:!1}var v0=new WeakMap,wx=({key:e,route:a,manifest:i,mapRouteProperties:l})=>{let s=i[a.id];if(De(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let u=s.lazy[e];if(!u)return;let c=v0.get(s);c||(c={},v0.set(s,c));let d=c[e];if(d)return d;let m=(async()=>{let p=u3(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(p)Tt(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Tt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await u();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,l(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return c[e]=m,m},b0=new WeakMap;function K3(e,a,i,l,s){let u=i[e.id];if(De(u,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let b=b0.get(u);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let g=(async()=>{De(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),w={};for(let E in x){let R=x[E];if(R===void 0)continue;let N=f3(E),V=u[E]!==void 0&&E!=="hasErrorBoundary";N?Tt(!N,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):V?Tt(!V,`Route "${u.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.`):w[E]=R}Object.assign(u,w),Object.assign(u,{...l(u),lazy:void 0})})();return b0.set(u,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],m;for(let b of c){if(s&&s.includes(b))continue;let g=wx({key:b,route:e,manifest:i,mapRouteProperties:l});g&&(d.push(g),b===a&&(m=g))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),m?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:m}}async function x0(e){let a=e.matches.filter(s=>s.shouldLoad),i={};return(await Promise.all(a.map(s=>s.resolve()))).forEach((s,u)=>{i[a[u].route.id]=s}),i}async function V3(e){return e.matches.some(a=>a.route.middleware)?_x(e,()=>x0(e)):x0(e)}function _x(e,a){return X3(e,a,l=>{if(cA(l))throw l;return l},lA,i);function i(l,s,u){if(u)return Promise.resolve(Object.assign(u.value,{[s]:{type:"error",result:l}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(p=>p.route.id===s),0),Math.max(c.findIndex(p=>p.shouldCallHandler()),0)),m=zr(c,c[d].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:l}})}}}async function X3(e,a,i,l,s){let{matches:u,...c}=e,d=u.flatMap(p=>p.route.middleware?p.route.middleware.map(b=>[p.route.id,b]):[]);return await Ex(c,d,a,i,l,s)}async function Ex(e,a,i,l,s,u,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let m=a[c];if(!m)return await i();let[p,b]=m,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await Ex(e,a,i,l,s,u,c+1)},g.value}catch(w){return g={value:await u(w,p,g)},g.value}};try{let w=await b(e,x),E=w!=null?l(w):void 0;return s(E)?E:g?E??g.value:(g={value:await x()},g.value)}catch(w){return await u(w,p,g)}}function Tx(e,a,i,l,s){let u=wx({key:"middleware",route:l.route,manifest:a,mapRouteProperties:e}),c=K3(l.route,en(i.method)?"action":"loader",a,e,s);return{middleware:u,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function yh(e,a,i,l,s,u,c,d,m,p=null,b){let g=!1,x=Tx(e,a,i,u,c);return{...u,_lazyPromises:x,shouldLoad:m,shouldRevalidateArgs:p,shouldCallHandler(w){return g=!0,p?typeof b=="boolean"?_o(u,{...p,defaultShouldRevalidate:b}):typeof w=="boolean"?_o(u,{...p,defaultShouldRevalidate:w}):_o(u,p):m},resolve(w){let{lazy:E,loader:R,middleware:N}=u.route,F=g||m||w&&!en(i.method)&&(E||R),V=N&&N.length>0&&!R&&!E;return F&&(en(i.method)||!V)?J3({request:i,path:l,pattern:s,match:u,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:w,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function sl(e,a,i,l,s,u,c,d,m=null){return s.map(p=>p.route.id!==u.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:())DELIM" +R"DELIM(=>!1,_lazyPromises:Tx(e,a,i,p,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:yh(e,a,i,l,Go(s),p,c,d,!0,m))}async function I3(e,a,i,l,s,u,c){l.some(b=>b._lazyPromises?.middleware)&&await Promise.all(l.map(b=>b._lazyPromises?.middleware));let d={request:a,url:Rx(a,i),pattern:Go(l),params:l[0].params,context:u,matches:l},p=await e({...d,fetcherKey:s,runClientMiddleware:b=>{let g=d;return _x(g,()=>b({...g,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(l.flatMap(b=>[b._lazyPromises?.handler,b._lazyPromises?.route]))}catch{}return p}async function J3({request:e,path:a,pattern:i,match:l,lazyHandlerPromise:s,lazyRoutePromise:u,handlerOverride:c,scopedContext:d}){let m,p,b=en(e.method),g=b?"action":"loader",x=w=>{let E,R=new Promise((V,J)=>E=J);p=()=>E(),e.signal.addEventListener("abort",p);let N=V=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${l.route.id}]`)):w({request:e,url:Rx(e,a),pattern:i,params:l.params,context:d},...V!==void 0?[V]:[]),F=(async()=>{try{return{type:"data",result:await(c?c(J=>N(J)):N())}}catch(V){return{type:"error",result:V}}})();return Promise.race([F,R])};try{let w=b?l.route.action:l.route.loader;if(s||u)if(w){let E,[R]=await Promise.all([x(w).catch(N=>{E=N}),s,u]);if(E!==void 0)throw E;m=R}else{await s;let E=b?l.route.action:l.route.loader;if(E)[m]=await Promise.all([x(E),u]);else if(g==="action"){let R=new URL(e.url),N=R.pathname+R.search;throw Qn(405,{method:e.method,pathname:N,routeId:l.route.id})}else return{type:"data",result:void 0}}else if(w)m=await x(w);else{let E=new URL(e.url),R=E.pathname+E.search;throw Qn(404,{pathname:R})}}catch(w){return{type:"error",result:w}}finally{p&&e.signal.removeEventListener("abort",p)}return m}async function W3(e){let a=e.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?e.body==null?null:e.json():e.text()}async function eA(e){let{result:a,type:i}=e;if(Xh(a)){let l;try{l=await W3(a)}catch(s){return{type:"error",error:s}}return i==="error"?{type:"error",error:new Yo(a.status,a.statusText,l),statusCode:a.status,headers:a.headers}:{type:"data",data:l,statusCode:a.status,headers:a.headers}}return i==="error"?R0(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:iA(a),statusCode:Do(a)?a.status:void 0,headers:a.init?.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:Do(a)?a.status:void 0}:R0(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 tA(e,a,i,l,s){let u=e.headers.get("Location");if(De(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!Gh(u)){let c=l.slice(0,l.findIndex(d=>d.route.id===i)+1);u=ph(new URL(a.url),c,s,u),e.headers.set("Location",u)}return e}var nA=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function gh(e){try{return nA.includes(new URL(e).protocol)}catch{return!1}}function S0(e,a,i,l){if(Gh(e)){let s=e,u=Yh.test(s)?new URL(ix(s,a.protocol)):new URL(s);if(gh(u.toString()))throw new Error("Invalid redirect location");let c=Yn(u.pathname,i)!=null;if(u.origin===a.origin&&c)return Kh(u.pathname)+u.search+u.hash}try{let s=l.createURL(e);if(gh(s.toString()))throw new Error("Invalid redirect location")}catch{}return e}function nl(e,a,i,l){let s=e.createURL(Ax(a)).toString(),u={signal:i};if(l&&en(l.formMethod)){let{formMethod:c,formEncType:d}=l;u.method=c.toUpperCase(),d==="application/json"?(u.headers=new Headers({"Content-Type":d}),u.body=JSON.stringify(l.json)):d==="text/plain"?u.body=l.text:d==="application/x-www-form-urlencoded"&&l.formData?u.body=vh(l.formData):u.body=l.formData}return new Request(s,u)}function Rx(e,a){let i=new URL(e.url),l=typeof a=="string"?va(a):a;if(i.pathname=l.pathname||"/",l.search){let s=new URLSearchParams(l.search),u=s.getAll("index");s.delete("index");for(let c of u.filter(Boolean))s.append("index",c);i.search=s.size?`?${s.toString()}`:""}else i.search="";return i.hash=l.hash||"",i}function vh(e){let a=new URLSearchParams;for(let[i,l]of e.entries())a.append(i,typeof l=="string"?l:l.name);return a}function w0(e){let a=new FormData;for(let[i,l]of e.entries())a.append(i,l);return a}function aA(e,a,i,l=!1,s=!1){let u={},c=null,d,m=!1,p={},b=i&&Cn(i[1])?i[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in a))return;let x=g.route.id,w=a[x];if(De(!ri(w),"Cannot handle redirect results in processLoaderData"),Cn(w)){let E=w.error;if(b!==void 0&&(E=b,b=void 0),c=c||{},s)c[x]=E;else{let R=zr(e,x);c[R.route.id]==null&&(c[R.route.id]=E)}l||(u[x]=bx),m||(m=!0,d=Do(w.error)?w.error.status:500),w.headers&&(p[x]=w.headers)}else u[x]=w.data,w.statusCode&&w.statusCode!==200&&!m&&(d=w.statusCode),w.headers&&(p[x]=w.headers)}),b!==void 0&&i&&(c={[i[0]]:b},i[2]&&(u[i[2]]=void 0)),{loaderData:u,errors:c,statusCode:d||200,loaderHeaders:p}}function _0(e,a,i,l,s,u,c){let{loaderData:d,errors:m}=aA(a,i,l);return s.filter(p=>!p.matches||p.matches.some(b=>b.shouldLoad)).forEach(p=>{let{key:b,match:g,controller:x}=p;if(x&&x.signal.aborted)return;let w=u[b];if(De(w,"Did not find corresponding fetcher result"),Cn(w)){let E=zr(e.matches,g?.route.id);m&&m[E.route.id]||(m={...m,[E.route.id]:w.error}),c.delete(b)}else if(ri(w))De(!1,"Unhandled fetcher revalidation redirect");else{let E=pa(w.data);c.set(b,E)}}),{loaderData:d,errors:m}}function E0(e,a,i,l){let s=Object.entries(a).filter(([,u])=>u!==bx).reduce((u,[c,d])=>(u[c]=d,u),{});for(let u of i){let c=u.route.id;if(!a.hasOwnProperty(c)&&e.hasOwnProperty(c)&&u.route.loader&&(s[c]=e[c]),l&&l.hasOwnProperty(c))break}return s}function T0(e){return e?Cn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function zr(e,a){return(a?e.slice(0,e.findIndex(l=>l.route.id===a)+1):[...e]).reverse().find(l=>l.route.hasErrorBoundary===!0)||e[0]}function bu(e){let a=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Qn(e,{pathname:a,routeId:i,method:l,type:s,message:u}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",l&&a&&i?d=`You made a ${l} request to "${a}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${i}" does not match URL "${a}"`):e===404?(c="Not Found",d=`No route matches URL "${a}"`):e===405&&(c="Method Not Allowed",l&&a&&i?d=`You made a ${l.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:l&&(d=`Invalid request method "${l.toUpperCase()}"`)),new Yo(e||500,c,new Error(d),!0)}function xu(e){let a=Object.entries(e);for(let i=a.length-1;i>=0;i--){let[l,s]=a[i];if(ri(s))return{key:l,result:s}}}function Ax(e){let a=typeof e=="string"?va(e):e;return ga({...a,hash:""})}function rA(e,a){return e.pathname!==a.pathname||e.search!==a.search?!1:e.hash===""?a.hash!=="":e.hash===a.hash?!0:a.hash!==""}function iA(e){return new Yo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function lA(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([a,i])=>typeof a=="string"&&oA(i))}function oA(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function sA(e){return Xh(e.result)&&gx.has(e.result.status)}function Cn(e){return e.type==="error"}function ri(e){return(e&&e.type)==="redirect"}function R0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Xh(e){return e)DELIM" +R"DELIM(!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function uA(e){return gx.has(e)}function cA(e){return Xh(e)&&uA(e.status)&&e.headers.has("Location")}function fA(e){return H3.has(e.toUpperCase())}function en(e){return B3.has(e.toUpperCase())}function Ih(e){return new URLSearchParams(e).getAll("index").some(a=>a==="")}function Nu(e,a){let i=typeof a=="string"?va(a).search:a.search;if(e[e.length-1].route.index&&Ih(i||""))return e[e.length-1];let l=dx(e);return l[l.length-1]}function A0(e){let{formMethod:a,formAction:i,formEncType:l,text:s,formData:u,json:c}=e;if(!(!a||!i||!l)){if(s!=null)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:void 0,text:s};if(u!=null)return{formMethod:a,formAction:i,formEncType:l,formData:u,json:void 0,text:void 0};if(c!==void 0)return{formMethod:a,formAction:i,formEncType:l,formData:void 0,json:c,text:void 0}}}function $d(e,a,i,l){return l?{state:"loading",location:e,matches:a,historyAction:i,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}:{state:"loading",location:e,matches:a,historyAction:i,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function dA(e,a,i,l){return{state:"submitting",location:e,matches:a,historyAction:i,formMethod:l.formMethod,formAction:l.formAction,formEncType:l.formEncType,formData:l.formData,json:l.json,text:l.text}}function mo(e,a){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.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 hA(e,a){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:a?a.data:void 0}}function pa(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 mA(e,a){try{let i=e.sessionStorage.getItem(vx);if(i){let l=JSON.parse(i);for(let[s,u]of Object.entries(l||{}))u&&Array.isArray(u)&&a.set(s,new Set(u||[]))}}catch{}}function pA(e,a){if(a.size>0){let i={};for(let[l,s]of a)i[l]=[...s];try{e.sessionStorage.setItem(vx,JSON.stringify(i))}catch(l){Tt(!1,`Failed to save applied view transitions in sessionStorage (${l}).`)}}}function z0(){let e,a,i=new Promise((l,s)=>{e=async u=>{l(u);try{await i}catch{}},a=async u=>{s(u);try{await i}catch{}}});return{promise:i,resolve:e,reject:a}}var ci=T.createContext(null);ci.displayName="DataRouter";var Ko=T.createContext(null);Ko.displayName="DataRouterState";var zx=T.createContext(!1);function Cx(){return T.useContext(zx)}var Jh=T.createContext({isTransitioning:!1});Jh.displayName="ViewTransition";var jx=T.createContext(new Map);jx.displayName="Fetchers";var yA=T.createContext(null);yA.displayName="Await";var jn=T.createContext(null);jn.displayName="Navigation";var rc=T.createContext(null);rc.displayName="Location";var Vn=T.createContext({outlet:null,matches:[],isDataRoute:!1});Vn.displayName="Route";var Wh=T.createContext(null);Wh.displayName="RouteError";var Nx="REACT_ROUTER_ERROR",gA="REDIRECT",vA="ROUTE_ERROR_RESPONSE";function bA(e){if(e.startsWith(`${Nx}:${gA}:{`))try{let a=JSON.parse(e.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 xA(e){if(e.startsWith(`${Nx}:${vA}:{`))try{let a=JSON.parse(e.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Yo(a.status,a.statusText,a.data)}catch{}}function SA(e,{relative:a}={}){De(pl(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:l}=T.useContext(jn),{hash:s,pathname:u,search:c}=Vo(e,{relative:a}),d=u;return i!=="/"&&(d=u==="/"?i:Fn([i,u])),l.createHref({pathname:d,search:c,hash:s})}function pl(){return T.useContext(rc)!=null}function Nn(){return De(pl(),"useLocation() may be used only in the context of a component."),T.useContext(rc).location}var Mx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ox(e){T.useContext(jn).static||T.useLayoutEffect(e)}function ba(){let{isDataRoute:e}=T.useContext(Vn);return e?DA():wA()}function wA(){De(pl(),"useNavigate() may be used only in the context of a component.");let e=T.useContext(ci),{basename:a,navigator:i}=T.useContext(jn),{matches:l}=T.useContext(Vn),{pathname:s}=Nn(),u=JSON.stringify(ac(l)),c=T.useRef(!1);return Ox(()=>{c.current=!0}),T.useCallback((m,p={})=>{if(Tt(c.current,Mx),!c.current)return;if(typeof m=="number"){i.go(m);return}let b=Fo(m,JSON.parse(u),s,p.relative==="path");e==null&&a!=="/"&&(b.pathname=b.pathname==="/"?a:Fn([a,b.pathname])),(p.replace?i.replace:i.push)(b,p.state,p)},[a,i,u,s,e])}var _A=T.createContext(null);function EA(e){let a=T.useContext(Vn).outlet;return T.useMemo(()=>a&&T.createElement(_A.Provider,{value:e},a),[a,e])}function em(){let{matches:e}=T.useContext(Vn);return e[e.length-1]?.params??{}}function Vo(e,{relative:a}={}){let{matches:i}=T.useContext(Vn),{pathname:l}=Nn(),s=JSON.stringify(ac(i));return T.useMemo(()=>Fo(e,JSON.parse(s),l,a==="path"),[e,s,l,a])}function TA(e,a,i){De(pl(),"useRoutes() may be used only in the context of a component.");let{navigator:l}=T.useContext(jn),{matches:s}=T.useContext(Vn),u=s[s.length-1],c=u?u.params:{},d=u?u.pathname:"/",m=u?u.pathnameBase:"/",p=u&&u.route;{let N=p&&p.path||"";Lx(d,!p||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${d}" (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=Nn(),g;g=b;let x=g.pathname||"/",w=x;if(m!=="/"){let N=m.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(N.length).join("/")}let E=i&&i.state.matches.length?i.state.matches.map(N=>Object.assign(N,{route:i.manifest[N.route.id]||N.route})):nx(e,{pathname:w});return Tt(p||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Tt(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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.`),EA(E&&E.map(N=>Object.assign({},N,{params:Object.assign({},c,N.params),pathname:Yn([m,l.encodeLocation?l.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?m:Yn([m,l.encodeLocation?l.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),s,i)}function xA(){let e=jx(),a=Do(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,l="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:u},"ErrorBoundary")," or"," ",)DELIM" -R"DELIM(T.createElement("code",{style:u},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},a),i?T.createElement("pre",{style:s},i):null,c)}var SA=T.createElement(xA,null),Cx=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,a){return a.location!==e.location||a.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:a.error,location:a.location,revalidation:e.revalidation||a.revalidation}}componentDidCatch(e,a){this.props.onError?this.props.onError(e,a):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const i=mA(e.digest);i&&(e=i)}let a=e!==void 0?T.createElement(Xn.Provider,{value:this.props.routeContext},T.createElement(Ih.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(wA,{error:e},a):a}};Cx.contextType=_x;var Zd=new WeakMap;function wA({children:e,error:a}){let{basename:i}=T.useContext(jn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=hA(a.digest);if(l){let s=Zd.get(a);if(s)throw s;let u=ux(l.location,i),c=u.absoluteURL||u.to;if(gh(c))throw new Error("Invalid redirect location");if(sx&&!Zd.get(a))if(u.isExternal||l.reloadDocument)window.location.href=c;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw Zd.set(a,d),d}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c}`})}}return e}function _A({routeContext:e,match:a,children:i}){let l=T.useContext(fi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),T.createElement(Xn.Provider,{value:e},i)}function EA(e,a=[],i){let l=i?.state;if(e==null){if(!l)return null;if(l.errors)e=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)e=l.matches;else return null}let s=e,u=l?.errors;if(u!=null){let b=s.findIndex(g=>g.route.id&&u?.[g.route.id]!==void 0);De(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),s=s.slice(0,Math.min(s.length,b+1))}let c=!1,d=-1;if(i&&l){c=l.renderFallback;for(let b=0;b=0?s=s.slice(0,d+1):s=[s[0]];break}}}}let m=i?.onError,p=l&&m?(b,g)=>{m(b,{location:l.location,params:l.matches?.[0]?.params??{},pattern:Go(l.matches),errorInfo:g})}:void 0;return s.reduceRight((b,g,x)=>{let w,E=!1,R=null,N=null;l&&(w=u&&g.route.id?u[g.route.id]:void 0,R=g.route.errorElement||SA,c&&(d<0&&x===0?(Nx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,N=null):d===x&&(E=!0,N=g.route.hydrateFallbackElement||null)));let F=a.concat(s.slice(0,x+1)),V=()=>{let J;return w?J=R:E?J=N:g.route.Component?J=T.createElement(g.route.Component,null):g.route.element?J=g.route.element:J=b,T.createElement(_A,{match:g,routeContext:{outlet:b,matches:F,isDataRoute:l!=null},children:J})};return l&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?T.createElement(Cx,{location:l.location,revalidation:l.revalidation,component:R,error:w,children:V(),routeContext:{outlet:null,matches:F,isDataRoute:!0},onError:p}):V()},null)}function Wh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TA(e){let a=T.useContext(fi);return De(a,Wh(e)),a}function RA(e){let a=T.useContext(Ko);return De(a,Wh(e)),a}function AA(e){let a=T.useContext(Xn);return De(a,Wh(e)),a}function em(e){let a=AA(e),i=a.matches[a.matches.length-1];return De(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function zA(){return em("useRouteId")}function jx(){let e=T.useContext(Ih),a=RA("useRouteError"),i=em("useRouteError");return e!==void 0?e:a.errors?.[i]}function CA(){let{router:e}=TA("useNavigate"),a=em("useNavigate"),i=T.useRef(!1);return zx(()=>{i.current=!0}),T.useCallback(async(s,u={})=>{Tt(i.current,Ax),i.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:a,...u}))},[e,a])}var A0={};function Nx(e,a,i){!a&&!A0[e]&&(A0[e]=!0,Tt(!1,i))}var z0={};function C0(e,a){!e&&!z0[a]&&(z0[a]=!0,console.warn(a))}var jA="useOptimistic",j0=rw[jA],NA=()=>{};function MA(e){return j0?j0(e):[e,NA]}function OA(e){let a={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Tt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:T.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Tt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:T.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Tt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:T.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),a}var kA=["HydrateFallback","hydrateFallbackElement"],DA=class{constructor(){this.status="pending",this.promise=new Promise((e,a)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",a(i))}})}};function LA({router:e,flushSync:a,onError:i,useTransitions:l}){l=Ex()||l;let[u,c]=T.useState(e.state),[d,m]=MA(u),[p,b]=T.useState(),[g,x]=T.useState({isTransitioning:!1}),[w,E]=T.useState(),[R,N]=T.useState(),[F,V]=T.useState(),J=T.useRef(new Map),ue=T.useCallback((_,{deletedFetchers:D,newErrors:B,flushSync:Q,viewTransitionOpts:q})=>{B&&i&&Object.values(B).forEach(re=>i(re,{location:_.location,params:_.matches[0]?.params??{},pattern:Go(_.matches)})),_.fetchers.forEach((re,fe)=>{re.data!==void 0&&J.current.set(fe,re.data)}),D.forEach(re=>J.current.delete(re)),C0(Q===!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 G=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(C0(q==null||G,"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."),!q||!G){a&&Q?a(()=>c(_)):l===!1?c(_):T.startTransition(()=>{l===!0&&m(re=>N0(re,_)),c(_)});return}if(a&&Q){a(()=>{R&&(w?.resolve(),R.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:q.currentLocation,nextLocation:q.nextLocation})});let re=e.window.document.startViewTransition(()=>{a(()=>c(_))});re.finished.finally(()=>{a(()=>{E(void 0),N(void 0),b(void 0),x({isTransitioning:!1})})}),a(()=>N(re));return}R?(w?.resolve(),R.skipTransition(),V({state:_,currentLocation:q.currentLocation,nextLocation:q.nextLocation})):(b(_),x({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}))},[e.window,a,R,w,l,m,i]);T.useLayoutEffect(()=>e.subscribe(ue),[e,ue]),T.useEffect(()=>{g.isTransitioning&&!g.flushSync&&E(new DA)},[g]),)DELIM" -R"DELIM(T.useEffect(()=>{if(w&&p&&e.window){let _=p,D=w.promise,B=e.window.document.startViewTransition(async()=>{l===!1?c(_):T.startTransition(()=>{l===!0&&m(Q=>N0(Q,_)),c(_)}),await D});B.finished.finally(()=>{E(void 0),N(void 0),b(void 0),x({isTransitioning:!1})}),N(B)}},[p,w,e.window,l,m]),T.useEffect(()=>{w&&p&&d.location.key===p.location.key&&w.resolve()},[w,R,d.location,p]),T.useEffect(()=>{!g.isTransitioning&&F&&(b(F.state),x({isTransitioning:!0,flushSync:!1,currentLocation:F.currentLocation,nextLocation:F.nextLocation}),V(void 0))},[g.isTransitioning,F]);let ae=T.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:_=>e.navigate(_),push:(_,D,B)=>e.navigate(_,{state:D,preventScrollReset:B?.preventScrollReset}),replace:(_,D,B)=>e.navigate(_,{replace:!0,state:D,preventScrollReset:B?.preventScrollReset})}),[e]),xe=e.basename||"/",j=T.useMemo(()=>({router:e,navigator:ae,static:!1,basename:xe,onError:i}),[e,ae,xe,i]);return T.createElement(T.Fragment,null,T.createElement(fi.Provider,{value:j},T.createElement(Ko.Provider,{value:d},T.createElement(Tx.Provider,{value:J.current},T.createElement(Xh.Provider,{value:g},T.createElement(ZA,{basename:xe,location:d.location,navigationType:d.historyAction,navigator:ae,useTransitions:l},T.createElement(BA,{routes:e.routes,manifest:e.manifest,future:e.future,state:d,isStatic:!1,onError:i})))))),null)}function N0(e,a){return{...e,navigation:a.navigation.state!=="idle"?a.navigation:e.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:e.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:e.actionData,fetchers:a.fetchers}}var BA=T.memo(UA);function UA({routes:e,manifest:a,future:i,state:l,isStatic:s,onError:u}){return bA(e,void 0,{manifest:a,state:l,isStatic:s,onError:u})}function HA({to:e,replace:a,state:i,relative:l}){De(yl()," may be used only in the context of a component.");let{static:s}=T.useContext(jn);Tt(!s," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:u}=T.useContext(Xn),{pathname:c}=Nn(),d=Sa(),m=Fo(e,ac(u),c,l==="path"),p=JSON.stringify(m);return T.useEffect(()=>{d(JSON.parse(p),{replace:a,state:i,relative:l})},[d,p,l,a,i]),null}function $A(e){return vA(e.context)}function Bt(e){De(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function ZA({basename:e="/",children:a=null,location:i,navigationType:l="POP",navigator:s,static:u=!1,useTransitions:c}){De(!yl(),"You cannot render a inside another . You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),m=T.useMemo(()=>({basename:d,navigator:s,static:u,useTransitions:c,future:{}}),[d,s,u,c]);typeof i=="string"&&(i=xa(i));let{pathname:p="/",search:b="",hash:g="",state:x=null,key:w="default",mask:E}=i,R=T.useMemo(()=>{let N=Gn(p,d);return N==null?null:{location:{pathname:N,search:b,hash:g,state:x,key:w,mask:E},navigationType:l}},[d,p,b,g,x,w,l,E]);return Tt(R!=null,` is not able to match the URL "${p}${b}${g}" because it does not start with the basename, so the won't render anything.`),R==null?null:T.createElement(jn.Provider,{value:m},T.createElement(rc.Provider,{children:a,value:R}))}function bh(e,a=[]){let i=[];return T.Children.forEach(e,(l,s)=>{if(!T.isValidElement(l))return;let u=[...a,s];if(l.type===T.Fragment){i.push.apply(i,bh(l.props.children,u));return}De(l.type===Bt,`[${typeof l.type=="string"?l.type:l.type.name}] is not a component. All component children of must be a or `),De(!l.props.index||!l.props.children,"An index route cannot have child routes.");let c={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(c.children=bh(l.props.children,u)),i.push(c)}),i}var qA=bh,Mu="get",Ou="application/x-www-form-urlencoded";function ic(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function PA(e){return ic(e)&&e.tagName.toLowerCase()==="button"}function QA(e){return ic(e)&&e.tagName.toLowerCase()==="form"}function FA(e){return ic(e)&&e.tagName.toLowerCase()==="input"}function YA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function GA(e,a){return e.button===0&&(!a||a==="_self")&&!YA(e)}function xh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((a,i)=>{let l=e[i];return a.concat(Array.isArray(l)?l.map(s=>[i,s]):[[i,l]])},[]))}function KA(e,a){let i=xh(e);return a&&a.forEach((l,s)=>{i.has(s)||a.getAll(s).forEach(u=>{i.append(s,u)})}),i}var Su=null;function VA(){if(Su===null)try{new FormData(document.createElement("form"),0),Su=!1}catch{Su=!0}return Su}var XA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qd(e){return e!=null&&!XA.has(e)?(Tt(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Ou}"`),null):e}function IA(e,a){let i,l,s,u,c;if(QA(e)){let d=e.getAttribute("action");l=d?Gn(d,a):null,i=e.getAttribute("method")||Mu,s=qd(e.getAttribute("enctype"))||Ou,u=new FormData(e)}else if(PA(e)||FA(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a