From e5ebc86c845e91494c835b421a673377051dafea Mon Sep 17 00:00:00 2001 From: BOB450 Date: Mon, 17 Aug 2026 21:29:34 -0600 Subject: [PATCH] Add a sync progress bar. - Uses any esplora compatible api for top reference. - Hides the bar at 18 blocks or fewer, or when the local node is ahead. - Uses native top for canonical top progress. --- console/embedded/admin_css.cpp | 12 +-- console/embedded/admin_ecma.cpp | 133 ++++++++++++++++---------------- 2 files changed, 73 insertions(+), 72 deletions(-) diff --git a/console/embedded/admin_css.cpp b/console/embedded/admin_css.cpp index 33deaee3..9472cf97 100644 --- a/console/embedded/admin_css.cpp +++ b/console/embedded/admin_css.cpp @@ -23,12 +23,12 @@ namespace server { // Simple test css for embedded page, links in font. DEFINE_EMBEDDED_PAGE(admin_pages, char, css, -R"DELIM(.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}@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-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-200:oklch(92.4% .12 95.746);--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-cyan-300:oklch(86.5% .127 207.078);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-500:oklch(60.6% .25 292.717);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-500:oklch(55.4% .046 257.417);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-500:oklch(55.2% .016 285.938);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xl:36rem;--container-4xl:56rem;--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-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--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,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, 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:where(:not(iframe)){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))DELIM" -R"DELIM(){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;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}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.order-3{order:3}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.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-auto{margin-right:auto}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:bloc)DELIM" -R"DELIM(k}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing) * 2)}.h-10{height:calc(var(--spacing) * 10)}.h-full{height:100%}.max-h-\[65vh\]{max-height:65vh}.max-h-\[92vh\]{max-height:92vh}.min-h-5{min-height:calc(var(--spacing) * 5)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-24{width:calc(var(--spacing) * 24)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[96rem\]{max-width:96rem}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-56{min-width:calc(var(--spacing) * 56)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.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}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-px{gap:1px}: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-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * 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-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-4{row-gap:calc(var(--spacing) * 4)}: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-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.self-end{align-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.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-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-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent\/10{border-color:#ffa0221a}.border-accent\/15{border-color:#ffa02226}.border-accent\/20{border-color:#ffa02233}.border-accent\/25{border-color:#ffa02240}.border-accent\/30{border-color:#ffa0224d}.border-accent\/35{border-color:#ffa02259}.border-amber-400\/60{border-color:#fcbb0099}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/60{border-color:color-mix(in oklab,var(--color-amber-400) 60%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-emerald-500\/40{border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/40{border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500) 40%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-slate-500\/40{border-color:#62748e66}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/40{border-color:color-mix(in oklab,var(--color-slate-500) 40%,transparent)}}.border-textMuted\/25{border-color:#cfcfcf40}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/15{background-color:#ffa02226}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-background{background-color:#272822}.bg-background\/35{background-color:#27282259}.bg-background\/50{background-color:#27282280}.bg-background\/60{background-color:#27282299}.bg-background\/70{background-color:#272822b3}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-black\/75{background-color:#000000bf}@supports (color:color-mix(in lab,red,red)){.bg-black\/75{background-color:color-mix(in oklab,var(--color-black) 75%,transparent)}}.bg-blue-500\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/15{background-color:color-mix(in oklab,var(--color-blue-500) 15%,transparent)}}.bg-current{background-color:currentColor}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.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-indigo-500\/15{backg)DELIM" -R"DELIM(round-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500) 10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-sky-500\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/15{background-color:color-mix(in oklab,var(--color-sky-500) 15%,transparent)}}.bg-slate-500\/10{background-color:#62748e1a}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/10{background-color:color-mix(in oklab,var(--color-slate-500) 10%,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{background-color:#1f211c}.bg-surface\/50{background-color:#1f211c80}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/70{background-color:#1f211cb3}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/95{background-color:#1f211cf2}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-zinc-500\/20{background-color:#71717b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-500\/20{background-color:color-mix(in oklab,var(--color-zinc-500) 20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-accent\/25{--tw-gradient-from:oklab(78.4754% .0670866 .152134/.25);--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))}.from-accentSecondary\/25{--tw-gradient-from:oklab(59.3513% .123469 .0900698/.25);--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))}.from-emerald-500\/20{--tw-gradient-from:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.from-emerald-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-500) 20%, transparent)}}.from-emerald-500\/20{--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))}.from-sky-500\/20{--tw-gradient-from:#00a5ef33}@supports (color:color-mix(in lab,red,red)){.from-sky-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-sky-500) 20%, transparent)}}.from-sky-500\/20{--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-transparent{--tw-gradient-to:transparent;--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-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.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-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-left{text-align:left}.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}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.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-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.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}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-background{color:#272822}.text-blue-300{color:var(--color-blue-300)}.text-cyan-300{color:var(--color-cyan-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-indigo-300{color:var(--color-indigo-300)}.text-orange-300{color:var(--color-orange-300)}.text-red-300{color:var(--color-red-300)}.text-sky-300{color:var(--color-sky-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-violet-300{color:var(--color-violet-300)}.text-zinc-300{color:var(--color-zinc-300)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.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-black\/50{--tw-shadow-color:#00000080}@supports (color:color-mix(in lab,red,red)){.shadow-black\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/60{--tw-shadow-color:#0009}@supports (color:color-mix(in lab,red,red)){.shadow-black\/60{--tw-shadow-color:color-mix(in oklab, co)DELIM" -R"DELIM(lor-mix(in oklab, var(--color-black) 60%, transparent) var(--tw-shadow-alpha), transparent)}}.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))}.placeholder\:text-textMuted\/50::placeholder{color:#cfcfcf80}.placeholder\:text-textMuted\/60::placeholder{color:#cfcfcf99}@media(hover:hover){.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accent\/60:hover{border-color:#ffa02299}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accent\/10:hover{background-color:#ffa0221a}.hover\:bg-accent\/90:hover{background-color:#ffa022e6}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-textPrimary:hover{color:#ededed}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-textMuted:disabled{color:#cfcfcf}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:order-none{order:0}.sm\:w-auto{width:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[7\.5rem_7\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:7.5rem 7.5rem minmax(0,1fr)}.sm\:grid-cols-\[8\.5rem_10rem_minmax\(0\,1fr\)\]{grid-template-columns:8.5rem 10rem minmax(0,1fr)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}}@media(min-width:48rem){.md\:grid-cols-\[minmax\(0\,1fr\)_11rem_11rem\]{grid-template-columns:minmax(0,1fr) 11rem 11rem}}@media(min-width:64rem){.lg\:flex{display:flex}.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-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(12rem\,1\.2fr\)_minmax\(11rem\,1fr\)_minmax\(9rem\,0\.8fr\)_3\.5rem_auto\]{grid-template-columns:minmax(12rem,1.2fr) minmax(11rem,1fr) minmax(9rem,.8fr) 3.5rem auto}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[1\.1fr_0\.9fr\]{grid-template-columns:1.1fr .9fr}}}:root{color-scheme:dark;font-synthesis:none;text-rendering:optimizelegibility}body{min-width:calc(var(--spacing) * 80);font-family:var(--font-sans);color:#ededed;background-color:#272822;margin:0;overflow-x:hidden}button,input,select{font:inherit}::selection{color:#272822;background-color:#ffa022}*{scrollbar-color:#c85637 #1f211c;scrollbar-width:thin}.uplot{color:#cfcfcf;font-family:ui-sans-serif,system-ui,sans-serif}.uplot .u-legend{margin-bottom:.75rem;font-size:.75rem}.uplot .u-legend .u-series{padding:.2rem .45rem}.uplot .u-select{background:#ffa0221f;border:1px solid #ffa02259}@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-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-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{synta)DELIM" -R"DELIM(x:"*";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} +R"DELIM(.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}@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-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-200:oklch(92.4% .12 95.746);--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-cyan-300:oklch(86.5% .127 207.078);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-500:oklch(60.6% .25 292.717);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-500:oklch(55.4% .046 257.417);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-500:oklch(55.2% .016 285.938);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xl:36rem;--container-4xl:56rem;--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-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--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,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, 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:where(:not(iframe)){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:col)DELIM" +R"DELIM(or-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;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}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.order-3{order:3}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.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)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mr-auto{margin-right:auto}.mb-3{margin-bottom:calc(var(--spacing) * 3)DELIM" +R"DELIM()}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-10{height:calc(var(--spacing) * 10)}.h-full{height:100%}.max-h-\[65vh\]{max-height:65vh}.max-h-\[92vh\]{max-height:92vh}.max-h-\[calc\(100vh-2rem\)\]{max-height:calc(100vh - 2rem)}.min-h-5{min-height:calc(var(--spacing) * 5)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-24{width:calc(var(--spacing) * 24)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[96rem\]{max-width:96rem}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-56{min-width:calc(var(--spacing) * 56)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.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}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-px{gap:1px}: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-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * 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-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-4{row-gap:calc(var(--spacing) * 4)}: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-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.self-end{align-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.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-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-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent\/10{border-color:#ffa0221a}.border-accent\/15{border-color:#ffa02226}.border-accent\/20{border-color:#ffa02233}.border-accent\/25{border-color:#ffa02240}.border-accent\/30{border-color:#ffa0224d}.border-accent\/35{border-color:#ffa02259}.border-amber-400\/60{border-color:#fcbb0099}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/60{border-color:color-mix(in oklab,var(--color-amber-400) 60%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-emerald-500\/40{border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/40{border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.border-orange-500\/40{border-color:#fe6e0066}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/40{border-color:color-mix(in oklab,var(--color-orange-500) 40%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-slate-500\/40{border-color:#62748e66}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/40{border-color:color-mix(in oklab,var(--color-slate-500) 40%,transparent)}}.border-textMuted\/25{border-color:#cfcfcf40}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/15{background-color:#ffa02226}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-background{background-color:#272822}.bg-background\/35{background-color:#27282259}.bg-background\/50{background-color:#27282280}.bg-background\/60{background-color:#27282299}.bg-background\/70{background-color:#272822b3}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-black\/75{background-color:#000000bf}@supports (color:color-mix(in lab,red,red)){.bg-black\/75{background-color:color-mix(in oklab,var(--color-black) 75%,transparent)}}.bg-blue-500\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/15{background-color:color-mix(in oklab,var(--color-blue-500) 15%,transparent)}}.bg-current{background-color:currentColor}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@suppo)DELIM" +R"DELIM(rts (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500) 10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-sky-500\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/15{background-color:color-mix(in oklab,var(--color-sky-500) 15%,transparent)}}.bg-slate-500\/10{background-color:#62748e1a}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/10{background-color:color-mix(in oklab,var(--color-slate-500) 10%,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{background-color:#1f211c}.bg-surface\/50{background-color:#1f211c80}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/70{background-color:#1f211cb3}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/95{background-color:#1f211cf2}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-zinc-500\/20{background-color:#71717b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-500\/20{background-color:color-mix(in oklab,var(--color-zinc-500) 20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-accent\/25{--tw-gradient-from:oklab(78.4754% .0670866 .152134/.25);--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))}.from-accentSecondary\/25{--tw-gradient-from:oklab(59.3513% .123469 .0900698/.25);--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))}.from-emerald-500\/20{--tw-gradient-from:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.from-emerald-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-500) 20%, transparent)}}.from-emerald-500\/20{--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))}.from-sky-500\/20{--tw-gradient-from:#00a5ef33}@supports (color:color-mix(in lab,red,red)){.from-sky-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-sky-500) 20%, transparent)}}.from-sky-500\/20{--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-transparent{--tw-gradient-to:transparent;--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-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.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-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.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}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.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-\[0\.2em\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-\[0\.16em\]{--tw-tracking:.16em;letter-spacing:.16em}.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}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-background{color:#272822}.text-blue-300{color:var(--color-blue-300)}.text-cyan-300{color:var(--color-cyan-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-indigo-300{color:var(--color-indigo-300)}.text-orange-300{color:var(--color-orange-300)}.text-red-300{color:var(--color-red-300)}.text-sky-300{color:var(--color-sky-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-violet-300{color:var(--color-violet-300)}.text-zinc-300{color:var(--color-zinc-300)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.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-black\/50{--tw-shadow-color:#00000080}@supports (color:color-mix(in lab,red,red)){.shadow-black\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-bla)DELIM" +R"DELIM(ck) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/60{--tw-shadow-color:#0009}@supports (color:color-mix(in lab,red,red)){.shadow-black\/60{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 60%, transparent) var(--tw-shadow-alpha), transparent)}}.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))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-700{--tw-duration:.7s;transition-duration:.7s}.placeholder\:text-textMuted\/50::placeholder{color:#cfcfcf80}.placeholder\:text-textMuted\/60::placeholder{color:#cfcfcf99}@media(hover:hover){.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accent\/60:hover{border-color:#ffa02299}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accent\/10:hover{background-color:#ffa0221a}.hover\:bg-accent\/90:hover{background-color:#ffa022e6}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-textPrimary:hover{color:#ededed}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-textMuted:disabled{color:#cfcfcf}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:order-none{order:0}.sm\:w-auto{width:auto}.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\:grid-cols-\[7\.5rem_7\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:7.5rem 7.5rem minmax(0,1fr)}.sm\:grid-cols-\[8\.5rem_10rem_minmax\(0\,1fr\)\]{grid-template-columns:8.5rem 10rem minmax(0,1fr)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}}@media(min-width:48rem){.md\:grid-cols-\[minmax\(0\,1fr\)_11rem_11rem\]{grid-template-columns:minmax(0,1fr) 11rem 11rem}}@media(min-width:64rem){.lg\:flex{display:flex}.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-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(12rem\,1\.2fr\)_minmax\(11rem\,1fr\)_minmax\(9rem\,0\.8fr\)_3\.5rem_auto\]{grid-template-columns:minmax(12rem,1.2fr) minmax(11rem,1fr) minmax(9rem,.8fr) 3.5rem auto}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[1\.1fr_0\.9fr\]{grid-template-columns:1.1fr .9fr}}}:root{color-scheme:dark;font-synthesis:none;text-rendering:optimizelegibility}body{min-width:calc(var(--spacing) * 80);font-family:var(--font-sans);color:#ededed;background-color:#272822;margin:0;overflow-x:hidden}button,input,select{font:inherit}::selection{color:#272822;background-color:#ffa022}*{scrollbar-color:#c85637 #1f211c;scrollbar-width:thin}.uplot{color:#cfcfcf;font-family:ui-sans-serif,system-ui,sans-serif}.uplot .u-legend{margin-bottom:.75rem;font-size:.75rem}.uplot .u-legend .u-series{padding:.2rem .45rem}.uplot .u-select{background:#ffa0221f;border:1px solid #ffa02259}@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-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits)DELIM" +R"DELIM(: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-duration{syntax:"*";inherits:false} )DELIM" ) diff --git a/console/embedded/admin_ecma.cpp b/console/embedded/admin_ecma.cpp index 470fddf6..f8e16182 100644 --- a/console/embedded/admin_ecma.cpp +++ b/console/embedded/admin_ecma.cpp @@ -23,45 +23,45 @@ namespace server { // Simple test ecma script for embedded page. DEFINE_EMBEDDED_PAGE(admin_pages, char, ecma, -R"DELIM((function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function u(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(c){if(c.ep)return;c.ep=!0;const d=u(c);fetch(c.href,d)}})();function Fv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zd={exports:{}},_r={};var c0;function lS(){if(c0)return _r;c0=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function u(s,c,d){var f=null;if(d!==void 0&&(f=""+d),c.key!==void 0&&(f=""+c.key),"key"in c){d={};for(var p in c)p!=="key"&&(d[p]=c[p])}else d=c;return c=d.ref,{$$typeof:n,type:s,key:f,ref:c!==void 0?c:null,props:d}}return _r.Fragment=a,_r.jsx=u,_r.jsxs=u,_r}var o0;function aS(){return o0||(o0=1,Zd.exports=lS()),Zd.exports}var z=aS(),Ld={exports:{}},Re={};var f0;function iS(){if(f0)return Re;f0=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),T=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=T&&A[T]||A["@@iterator"],typeof A=="function"?A:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,W={};function F(A,L,G){this.props=A,this.context=L,this.refs=W,this.updater=G||O}F.prototype.isReactComponent={},F.prototype.setState=function(A,L){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,L,"setState")},F.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function B(){}B.prototype=F.prototype;function I(A,L,G){this.props=A,this.context=L,this.refs=W,this.updater=G||O}var q=I.prototype=new B;q.constructor=I,Y(q,F.prototype),q.isPureReactComponent=!0;var ae=Array.isArray;function ne(){}var le={H:null,A:null,T:null,S:null},se=Object.prototype.hasOwnProperty;function Ae(A,L,G){var ie=G.ref;return{$$typeof:n,type:A,key:L,ref:ie!==void 0?ie:null,props:G}}function ze(A,L){return Ae(A.type,L,A.props)}function ee(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function ye(A){var L={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(G){return L[G]})}var ce=/\/+/g;function Ee(A,L){return typeof A=="object"&&A!==null&&A.key!=null?ye(""+A.key):L.toString(36)}function de(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(ne,ne):(A.status="pending",A.then(function(L){A.status==="pending"&&(A.status="fulfilled",A.value=L)},function(L){A.status==="pending"&&(A.status="rejected",A.reason=L)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function U(A,L,G,ie,xe){var pe=typeof A;(pe==="undefined"||pe==="boolean")&&(A=null);var ge=!1;if(A===null)ge=!0;else switch(pe){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(A.$$typeof){case n:case a:ge=!0;break;case x:return ge=A._init,U(ge(A._payload),L,G,ie,xe)}}if(ge)return xe=xe(A),ge=ie===""?"."+Ee(A,0):ie,ae(xe)?(G="",ge!=null&&(G=ge.replace(ce,"$&/")+"/"),U(xe,L,G,"",function(nt){return nt})):xe!=null&&(ee(xe)&&(xe=ze(xe,G+(xe.key==null||A&&A.key===xe.key?"":(""+xe.key).replace(ce,"$&/")+"/")+ge)),L.push(xe)),1;ge=0;var mt=ie===""?".":ie+":";if(ae(A))for(var Qe=0;Qe>>1,be=U[Oe];if(0>>1;Oec(G,me))iec(xe,G)?(U[Oe]=xe,U[ie]=me,Oe=ie):(U[Oe]=G,U[L]=me,Oe=L);else if(iec(xe,me))U[Oe]=xe,U[ie]=me,Oe=ie;else break e}}return Q}function c(U,Q){var me=U.sortIndex-Q.sortIndex;return me!==0?me:U.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var g=[],v=[],x=1,S=null,T=3,w=!1,O=!1,Y=!1,W=!1,F=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function q(U){for(var Q=u(v);Q!==null;){if(Q.callback===null)s(v);else if(Q.startTime<=U)s(v),Q.sortIndex=Q.expirationTime,a(g,Q);else break;Q=u(v)}}function ae(U){if(Y=!1,q(U),!O)if(u(g)!==null)O=!0,ne||(ne=!0,ye());else{var Q=u(v);Q!==null&&de(ae,Q.startTime-U)}}var ne=!1,le=-1,se=5,Ae=-1;function ze(){return W?!0:!(n.unstable_now()-AeU&&ze());){var Oe=S.callback;if(typeof Oe=="function"){S.callback=null,T=S.priorityLevel;var be=Oe(S.expirationTime<=U);if(U=n.unstable_now(),typeof be=="function"){S.callback=be,q(U),Q=!0;break t}S===u(g)&&s(g),q(U)}else s(g);S=u(g)}if(S!==null)Q=!0;else{var A=u(v);A!==null&&de(ae,A.startTime-U),Q=!1}}break e}finally{S=null,T=me,w=!1}Q=void 0}}finally{Q?ye():ne=!1}}}var ye;if(typeof I=="function")ye=function(){I(ee)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Ee=ce.port2;ce.port1.onmessage=ee,ye=function(){Ee.postMessage(null)}}else ye=function(){F(ee,0)};function de(U,Q){le=F(function(){U(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_forceFrameRate=function(U){0>U||125Oe?(U.sortIndex=me,a(v,U),u(g)===null&&U===u(v)&&(Y?(B(le),le=-1):Y=!0,de(ae,me-Oe))):(U.sortIndex=be,a(g,U),O||w||(O=!0,ne||(ne=!0,ye()))),U},n.unstable_shouldYield=ze,n.unstable_wrapCallback=function(U){var Q=T;return function(){var me=T;T=Q;try{return U.apply(this,arguments)}finally{T=me}}}})(qd)),qd}var m0;function rS(){return m0||(m0=1,Bd.exports=sS()),Bd.exports}var Gd={exports:{}},On={};var p0;function cS(){if(p0)return On;p0=1;var n=xh();function a(g){var v="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Gd.exports=cS(),Gd.exports}var v0;function fS(){if(v0)return xr;v0=1;var n=rS(),a=xh(),u=oS();function s(e){var t="https://react.dev/errors/"+e;if(1be||(e.current=Oe[be],Oe[be]=null,be--)}function G(e,t){be++,Oe[be]=e.current,e.current=t}var ie=A(null),xe=A(null),pe=A(null),ge=A(null);function mt(e,t){switch(G(pe,t),G(xe,e),G(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dg(t),e=Cg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(ie),G(ie,e)}function Qe(){L(ie),L(xe),L(pe)}function nt(e){e.memoizedState!==null&&G(ge,e);var t=ie.current,l=Cg(t,e.type);t!==l&&(G(xe,e),G(ie,l))}function Nn(e){xe.current===e&&(L(ie),L(xe)),ge.current===e&&(L(ge),vr._currentValue=me)}var Pn,jn;function xn(e){if(Pn===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Pn=t&&t[1]||"",jn=-1)":-1{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function s(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function u(c){if(c.ep)return;c.ep=!0;const d=s(c);fetch(c.href,d)}})();function Pv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zd={exports:{}},_r={};var o0;function rS(){if(o0)return _r;o0=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function s(u,c,d){var f=null;if(d!==void 0&&(f=""+d),c.key!==void 0&&(f=""+c.key),"key"in c){d={};for(var m in c)m!=="key"&&(d[m]=c[m])}else d=c;return c=d.ref,{$$typeof:n,type:u,key:f,ref:c!==void 0?c:null,props:d}}return _r.Fragment=l,_r.jsx=s,_r.jsxs=s,_r}var f0;function cS(){return f0||(f0=1,Zd.exports=rS()),Zd.exports}var S=cS(),Ld={exports:{}},Re={};var d0;function oS(){if(d0)return Re;d0=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),w=Symbol.iterator;function E(M){return M===null||typeof M!="object"?null:(M=w&&M[w]||M["@@iterator"],typeof M=="function"?M:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,I={};function W(M,L,G){this.props=M,this.context=L,this.refs=I,this.updater=G||j}W.prototype.isReactComponent={},W.prototype.setState=function(M,L){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,L,"setState")},W.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function X(){}X.prototype=W.prototype;function Q(M,L,G){this.props=M,this.context=L,this.refs=I,this.updater=G||j}var q=Q.prototype=new X;q.constructor=Q,H(q,W.prototype),q.isPureReactComponent=!0;var ae=Array.isArray;function le(){}var ee={H:null,A:null,T:null,S:null},ue=Object.prototype.hasOwnProperty;function Me(M,L,G){var ie=G.ref;return{$$typeof:n,type:M,key:L,ref:ie!==void 0?ie:null,props:G}}function ze(M,L){return Me(M.type,L,M.props)}function te(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}function be(M){var L={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(G){return L[G]})}var ce=/\/+/g;function Ee(M,L){return typeof M=="object"&&M!==null&&M.key!=null?be(""+M.key):L.toString(36)}function de(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(le,le):(M.status="pending",M.then(function(L){M.status==="pending"&&(M.status="fulfilled",M.value=L)},function(L){M.status==="pending"&&(M.status="rejected",M.reason=L)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function U(M,L,G,ie,xe){var pe=typeof M;(pe==="undefined"||pe==="boolean")&&(M=null);var ve=!1;if(M===null)ve=!0;else switch(pe){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(M.$$typeof){case n:case l:ve=!0;break;case _:return ve=M._init,U(ve(M._payload),L,G,ie,xe)}}if(ve)return xe=xe(M),ve=ie===""?"."+Ee(M,0):ie,ae(xe)?(G="",ve!=null&&(G=ve.replace(ce,"$&/")+"/"),U(xe,L,G,"",function(nt){return nt})):xe!=null&&(te(xe)&&(xe=ze(xe,G+(xe.key==null||M&&M.key===xe.key?"":(""+xe.key).replace(ce,"$&/")+"/")+ve)),L.push(xe)),1;ve=0;var mt=ie===""?".":ie+":";if(ae(M))for(var Ye=0;Ye>>1,Se=U[Oe];if(0>>1;Oec(G,me))iec(xe,G)?(U[Oe]=xe,U[ie]=me,Oe=ie):(U[Oe]=G,U[L]=me,Oe=L);else if(iec(xe,me))U[Oe]=xe,U[ie]=me,Oe=ie;else break e}}return Y}function c(U,Y){var me=U.sortIndex-Y.sortIndex;return me!==0?me:U.id-Y.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var g=[],v=[],_=1,x=null,w=3,E=!1,j=!1,H=!1,I=!1,W=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function q(U){for(var Y=s(v);Y!==null;){if(Y.callback===null)u(v);else if(Y.startTime<=U)u(v),Y.sortIndex=Y.expirationTime,l(g,Y);else break;Y=s(v)}}function ae(U){if(H=!1,q(U),!j)if(s(g)!==null)j=!0,le||(le=!0,be());else{var Y=s(v);Y!==null&&de(ae,Y.startTime-U)}}var le=!1,ee=-1,ue=5,Me=-1;function ze(){return I?!0:!(n.unstable_now()-MeU&&ze());){var Oe=x.callback;if(typeof Oe=="function"){x.callback=null,w=x.priorityLevel;var Se=Oe(x.expirationTime<=U);if(U=n.unstable_now(),typeof Se=="function"){x.callback=Se,q(U),Y=!0;break t}x===s(g)&&u(g),q(U)}else u(g);x=s(g)}if(x!==null)Y=!0;else{var M=s(v);M!==null&&de(ae,M.startTime-U),Y=!1}}break e}finally{x=null,w=me,E=!1}Y=void 0}}finally{Y?be():le=!1}}}var be;if(typeof Q=="function")be=function(){Q(te)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Ee=ce.port2;ce.port1.onmessage=te,be=function(){Ee.postMessage(null)}}else be=function(){W(te,0)};function de(U,Y){ee=W(function(){U(n.unstable_now())},Y)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_forceFrameRate=function(U){0>U||125Oe?(U.sortIndex=me,l(v,U),s(g)===null&&U===s(v)&&(H?(X(ee),ee=-1):H=!0,de(ae,me-Oe))):(U.sortIndex=Se,l(g,U),j||E||(j=!0,le||(le=!0,be()))),U},n.unstable_shouldYield=ze,n.unstable_wrapCallback=function(U){var Y=w;return function(){var me=w;w=Y;try{return U.apply(this,arguments)}finally{w=me}}}})(qd)),qd}var p0;function hS(){return p0||(p0=1,Bd.exports=dS()),Bd.exports}var Gd={exports:{}},On={};var g0;function mS(){if(g0)return On;g0=1;var n=zh();function l(g){var v="https://react.dev/errors/"+g;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Gd.exports=mS(),Gd.exports}var y0;function gS(){if(y0)return xr;y0=1;var n=hS(),l=zh(),s=pS();function u(e){var t="https://react.dev/errors/"+e;if(1Se||(e.current=Oe[Se],Oe[Se]=null,Se--)}function G(e,t){Se++,Oe[Se]=e.current,e.current=t}var ie=M(null),xe=M(null),pe=M(null),ve=M(null);function mt(e,t){switch(G(pe,t),G(xe,e),G(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cg(t),e=Rg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(ie),G(ie,e)}function Ye(){L(ie),L(xe),L(pe)}function nt(e){e.memoizedState!==null&&G(ve,e);var t=ie.current,a=Rg(t,e.type);t!==a&&(G(xe,e),G(ie,a))}function Nn(e){xe.current===e&&(L(ie),L(xe)),ve.current===e&&(L(ve),vr._currentValue=me)}var el,jn;function xn(e){if(el===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);el=t&&t[1]||"",jn=-1)":-1r||M[i]!==k[r]){var $=` -`+M[i].replace(" at new "," at ");return e.displayName&&$.includes("")&&($=$.replace("",e.displayName)),$}while(1<=i&&0<=r);break}}}finally{Yl=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?xn(l):""}function Ni(e,t){switch(e.tag){case 26:case 27:case 5:return xn(e.type);case 16:return xn("Lazy");case 13:return e.child!==t&&t!==null?xn("Suspense Fallback"):xn("Suspense");case 19:return xn("SuspenseList");case 0:case 15:return $l(e.type,!1);case 11:return $l(e.type.render,!1);case 1:return $l(e.type,!0);case 31:return xn("Activity");default:return""}}function ji(e){try{var t="",l=null;do t+=Ni(e,l),l=e,e=e.return;while(e);return t}catch(i){return` +`);for(r=i=0;ir||A[i]!==k[r]){var $=` +`+A[i].replace(" at new "," at ");return e.displayName&&$.includes("")&&($=$.replace("",e.displayName)),$}while(1<=i&&0<=r);break}}}finally{Vl=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?xn(a):""}function Ni(e,t){switch(e.tag){case 26:case 27:case 5:return xn(e.type);case 16:return xn("Lazy");case 13:return e.child!==t&&t!==null?xn("Suspense Fallback"):xn("Suspense");case 19:return xn("SuspenseList");case 0:case 15:return Kl(e.type,!1);case 11:return Kl(e.type.render,!1);case 1:return Kl(e.type,!0);case 31:return xn("Activity");default:return""}}function ji(e){try{var t="",a=null;do t+=Ni(e,a),a=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var Nl=Object.prototype.hasOwnProperty,Ft=n.unstable_scheduleCallback,Vl=n.unstable_cancelCallback,jl=n.unstable_shouldYield,sa=n.unstable_requestPaint,Te=n.unstable_now,oe=n.unstable_getCurrentPriorityLevel,lt=n.unstable_ImmediatePriority,Nt=n.unstable_UserBlockingPriority,Dl=n.unstable_NormalPriority,ra=n.unstable_LowPriority,el=n.unstable_IdlePriority,ca=n.log,Dn=n.unstable_setDisableYieldValue,nn=null,rt=null;function Qt(e){if(typeof ca=="function"&&Dn(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(nn,e)}catch{}}var on=Math.clz32?Math.clz32:oa,vu=Math.log,Ba=Math.LN2;function oa(e){return e>>>=0,e===0?32:31-(vu(e)/Ba|0)|0}var fa=256,fn=262144,qa=4194304;function Kl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8)DELIM" -R"DELIM(192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function yu(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var r=0,o=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var b=i&134217727;return b!==0?(i=b&~o,i!==0?r=Kl(i):(h&=b,h!==0?r=Kl(h):l||(l=b&~e,l!==0&&(r=Kl(l))))):(b=i&~o,b!==0?r=Kl(b):h!==0?r=Kl(h):l||(l=i&~e,l!==0&&(r=Kl(l)))),r===0?0:t!==0&&t!==r&&(t&o)===0&&(o=r&-r,l=t&-t,o>=l||o===32&&(l&4194048)!==0)?t:r}function Di(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qo(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Br(){var e=qa;return qa<<=1,(qa&62914560)===0&&(qa=4194304),e}function zs(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function tl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ln(e,t,l,i,r,o){var h=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var b=e.entanglements,M=e.expirationTimes,k=e.hiddenUpdates;for(l=h&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Go=/[\n"\\]/g;function Rn(e){return e.replace(Go,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Eu(e,t,l,i,r,o,h,b){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Cn(t)):e.value!==""+Cn(t)&&(e.value=""+Cn(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Tu(e,h,Cn(t)):l!=null?Tu(e,h,Cn(l)):i!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Cn(b):e.removeAttribute("name")}function Qr(e,t,l,i,r,o,h,b){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||l!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){xu(e);return}l=l!=null?""+Cn(l):"",t=t!=null?""+Cn(t):l,b||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=b?e.checked:!!i,e.defaultChecked=!!i,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),xu(e)}function Tu(e,t,l){t==="number"&&zu(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Fl(e,t,l,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ou=!1;if(Tn)try{var Xa={};Object.defineProperty(Xa,"passive",{get:function(){Ou=!0}}),window.addEventListener("test",Xa,Xa),window.removeEventListener("test",Xa,Xa)}catch{Ou=!1}var kn=null,Il=null,Li=null;function Cs(){if(Li)return Li;var e,t=Il,l=t.length,i,r="value"in kn?kn.value:kn.textContent,o=r.length;for(e=0;e=Ia),qs=" ",ya=!1;function Gi(e,t){switch(e){case"keyup":return ec.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ht(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ba=!1;function Dt(e,t){switch(e){case"compositionend":return Ht(t);case"keypress":return t.which!==32?null:(ya=!0,qs);case"textInput":return e=t.data,e===qs&&ya?null:e;default:return null}}function tc(e,t){if(ba)return e==="compositionend"||!Nu&&Gi(e,t)?(e=Cs(),Li=Il=kn=null,ba=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Ne(l)}}function ct(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ct(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function St(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zu(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=zu(e.document)}return t}function Ct(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var et=Tn&&"documentMode"in document&&11>=document.documentMode,it=null,hn=null,Bt=null,wn=!1;function Yn(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;wn||it==null||it!==zu(i)||(i=it,"selectionStart"in i&&Ct(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Bt&&Ue(Bt,i)||(Bt=i,i=$c(hn,"onSelect"),0>=h,r-=h,ta=1<<32-on(t)+r|l<Ze?(qe=ve,ve=null):qe=ve.sibling;var Xe=Z(D,ve,R[Ze],K);if(Xe===null){ve===null&&(ve=qe);break}e&&ve&&Xe.alternate===null&&t(D,ve),j=o(Xe,j,Ze),Ke===null?we=Xe:Ke.sibling=Xe,Ke=Xe,ve=qe}if(Ze===R.leng)DELIM" -R"DELIM(th)return l(D,ve),Ye&&xa(D,Ze),we;if(ve===null){for(;ZeZe?(qe=ve,ve=null):qe=ve.sibling;var _i=Z(D,ve,Xe.value,K);if(_i===null){ve===null&&(ve=qe);break}e&&ve&&_i.alternate===null&&t(D,ve),j=o(_i,j,Ze),Ke===null?we=_i:Ke.sibling=_i,Ke=_i,ve=qe}if(Xe.done)return l(D,ve),Ye&&xa(D,Ze),we;if(ve===null){for(;!Xe.done;Ze++,Xe=R.next())Xe=J(D,Xe.value,K),Xe!==null&&(j=o(Xe,j,Ze),Ke===null?we=Xe:Ke.sibling=Xe,Ke=Xe);return Ye&&xa(D,Ze),we}for(ve=i(ve);!Xe.done;Ze++,Xe=R.next())Xe=H(ve,D,Ze,Xe.value,K),Xe!==null&&(e&&Xe.alternate!==null&&ve.delete(Xe.key===null?Ze:Xe.key),j=o(Xe,j,Ze),Ke===null?we=Xe:Ke.sibling=Xe,Ke=Xe);return e&&ve.forEach(function(nS){return t(D,nS)}),Ye&&xa(D,Ze),we}function dt(D,j,R,K){if(typeof R=="object"&&R!==null&&R.type===Y&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case w:e:{for(var we=R.key;j!==null;){if(j.key===we){if(we=R.type,we===Y){if(j.tag===7){l(D,j.sibling),K=r(j,R.props.children),K.return=D,D=K;break e}}else if(j.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===se&&Fi(we)===j.type){l(D,j.sibling),K=r(j,R.props),Xs(K,R),K.return=D,D=K;break e}l(D,j);break}else t(D,j);j=j.sibling}R.type===Y?(K=$i(R.props.children,D.mode,K,R.key),K.return=D,D=K):(K=rc(R.type,R.key,R.props,null,D.mode,K),Xs(K,R),K.return=D,D=K)}return h(D);case O:e:{for(we=R.key;j!==null;){if(j.key===we)if(j.tag===4&&j.stateNode.containerInfo===R.containerInfo&&j.stateNode.implementation===R.implementation){l(D,j.sibling),K=r(j,R.children||[]),K.return=D,D=K;break e}else{l(D,j);break}else t(D,j);j=j.sibling}K=ef(R,D.mode,K),K.return=D,D=K}return h(D);case se:return R=Fi(R),dt(D,j,R,K)}if(de(R))return he(D,j,R,K);if(ye(R)){if(we=ye(R),typeof we!="function")throw Error(s(150));return R=we.call(R),je(D,j,R,K)}if(typeof R.then=="function")return dt(D,j,pc(R),K);if(R.$$typeof===I)return dt(D,j,fc(D,R),K);gc(D,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,j!==null&&j.tag===6?(l(D,j.sibling),K=r(j,R),K.return=D,D=K):(l(D,j),K=Po(R,D.mode,K),K.return=D,D=K),h(D)):l(D,j)}return function(D,j,R,K){try{Ks=0;var we=dt(D,j,R,K);return Bu=null,we}catch(ve){if(ve===Hu||ve===hc)throw ve;var Ke=al(29,ve,null,D.mode);return Ke.lanes=K,Ke.return=D,Ke}}}var Ii=zm(!0),Em=zm(!1),ai=!1;function hf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ii(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ui(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(We&2)!==0){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=sc(e),sm(e,null,l),t}return uc(e,i,t,l),sc(e)}function Js(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,da(e,l)}}function pf(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var r=null,o=null;if(l=l.firstBaseUpdate,l!==null){do{var h={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};o===null?r=o=h:o=o.next=h,l=l.next}while(l!==null);o===null?r=o=t:o=o.next=t}else r=o=t;l={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var gf=!1;function Fs(){if(gf){var e=Lu;if(e!==null)throw e}}function Ws(e,t,l,i){gf=!1;var r=e.updateQueue;ai=!1;var o=r.firstBaseUpdate,h=r.lastBaseUpdate,b=r.shared.pending;if(b!==null){r.shared.pending=null;var M=b,k=M.next;M.next=null,h===null?o=k:h.next=k,h=M;var $=e.alternate;$!==null&&($=$.updateQueue,b=$.lastBaseUpdate,b!==h&&(b===null?$.firstBaseUpdate=k:b.next=k,$.lastBaseUpdate=M))}if(o!==null){var J=r.baseState;h=0,$=k=M=null,b=o;do{var Z=b.lane&-536870913,H=Z!==b.lane;if(H?(Be&Z)===Z:(i&Z)===Z){Z!==0&&Z===Zu&&(gf=!0),$!==null&&($=$.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var he=e,je=b;Z=t;var dt=l;switch(je.tag){case 1:if(he=je.payload,typeof he=="function"){J=he.call(dt,J,Z);break e}J=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=je.payload,Z=typeof he=="function"?he.call(dt,J,Z):he,Z==null)break e;J=S({},J,Z);break e;case 2:ai=!0}}Z=b.callback,Z!==null&&(e.flags|=64,H&&(e.flags|=8192),H=r.callbacks,H===null?r.callbacks=[Z]:H.push(Z))}else H={lane:Z,tag:b.tag,payload:b.payload,callback:b.callback,next:null},$===null?(k=$=H,M=J):$=$.next=H,h|=Z;if(b=b.next,b===null){if(b=r.shared.pending,b===null)break;H=b,b=H.next,H.next=null,r.lastBaseUpdate=H,r.shared.pending=null}}while(!0);$===null&&(M=J),r.baseState=M,r.firstBaseUpdate=k,r.lastBaseUpdate=$,o===null&&(r.shared.lanes=0),fi|=h,e.lanes=h,e.memoizedState=J}}function Tm(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function wm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;eo?o:8;var h=U.T,b={};U.T=b,Uf(e,!1,t,l);try{var M=r(),k=U.S;if(k!==null&&k(b,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var $=$b(M,i);er(e,t,$,cl(e))}else er(e,t,i,cl(e))}catch(J){er(e,t,{then:function(){},status:"rejected",reason:J},cl())}finally{Q.p=o,h!==null&&b.types!==null&&(h.types=b.types),U.T=h}}function Wb(){}function Cf(e,t,l,i){if(e.tag!==5)throw Error(s(476));var r=ap(e).queue;lp(e,r,t,me,l===null?Wb:function(){return ip(e),l(i)})}function ap(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:me},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ip(e){var t=ap(e);t.next===null&&(t=e.alternate.memoizedState),er(e,t.next.queue,{},cl())}function Rf(){return gn(vr)}function up(){return Gt().memoizedState}function sp(){return Gt().memoizedState}function Ib(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=cl();e=ii(l);var i=ui(t,e,l);i!==null&&(Fn(i,t,l),Js(i,t,l)),t={cache:cf()},e.payload=t;return}t=t.return}}function Pb(e,t,l){var i=cl();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},wc(e)?cp(t,l):(l=Wo(e,t,l,i),l!==null&&(Fn(l,e,i),op(l,t,i)))}function rp(e,t,l){var i=cl();er(e,t,l,i)}function er(e,t,l,i){var r={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(wc(e))cp(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,b=o(h,l);if(r.hasEagerState=!0,r.eagerState=b,Ce(b,h))return uc(e,t,r,0),pt===null&&ic(),!1}catch{}if(l=Wo(e,t,r,i),l!==null)return Fn(l,e,i),op(l,t,i),!0}return!1}function Uf(e,t,l,i){if(i={lane:2,revertLane:hd(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},wc(e)){if(t)throw Error(s(479))}else t=Wo(e,l,i,2),t!==null&&Fn(t,e,2)}function wc(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function cp(e,t){Gu=bc=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function op(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,da(e,l)}}var tr={readContext:gn,use:xc,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};tr.useEffectEvent=Rt;var fp={readContext:gn,use:xc,useCallback:function(e,t){return Ln().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:Xm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Ec(4194308,4,Im.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Ec(4194308,4,e,t)},useInsertionEffect:function(e,t){Ec(4,2,e,t)},useMemo:function(e,t){var l=Ln();t=t===void 0?null:t;var i=e();if(Pi){Qt(!0);try{e()}finally{Qt(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=Ln();if(l!==void 0){var r=l(t);if(Pi){Qt(!0);try{l(t)}finally{Qt(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=Pb.bind(null,ke,e),[i.memoizedState,e]},useRef:function(e){var t=Ln();return e={current:e},t.memoizedState=e},useState:function(e){e=Af(e);var t=e.queue,l=rp.bind(null,ke,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:jf,useDeferredValue:function(e,t){var l=Ln();return Df(l,e,t)},useTransition:function(){var e=Af(!1);return e=lp.bind(null,ke,e.queue,!0,!1),Ln().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=ke,r=Ln();if(Ye){if(l===void 0)throw Error(s(407));l=l()}else{if(l=t(),pt===null)throw Error(s(349));(Be&127)!==0||Dm(i,t,l)}r.memoizedState=l;var o={value:l,getSnapshot:t};return r.queue=o,Xm(Rm.bind(null,i,o,e),[e]),i.flags|=2048,Yu(9,{destroy:void 0},Cm.bind(null,i,o,l,t),null),l},useId:function(){var e=Ln(),t=pt.identifierPrefix;if(Ye){var l=na,i=ta;l=(i&~(1<<32-on(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Sc++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?h.createElement("select",{is:i.is}):h.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?h.createElement(r,{is:i.is}):h.createElement(r)}}o[Wt]=t,o[En]=i;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)o.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=o;e:switch(yn(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Aa(t)}}return xt(t),Jf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Aa(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=pe.current,Uu(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,r=pn,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[Wt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||Ng(e.nodeValue,l)),e||ni(t,!0)}else e=Vc(e).createTextNode(i),e[Wt]=t,t.stateNode=e}return xt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=Uu(t),l!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[Wt]=t}else Vi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else l=af(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(ul(t),t):(ul(t),null);if((t.flags&128)!==0)throw Error(s(558))}return xt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Uu(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Err)DELIM" -R"DELIM(or(s(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));r[Wt]=t}else Vi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),r=!1}else r=af(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ul(t),t):(ul(t),null)}return ul(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),jc(t,t.updateQueue),xt(t),null);case 4:return Qe(),e===null&&vd(t.stateNode.containerInfo),xt(t),null;case 10:return Ea(t.type),xt(t),null;case 19:if(L(qt),i=t.memoizedState,i===null)return xt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)lr(i,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=yc(e),o!==null){for(t.flags|=128,lr(i,!1),e=o.updateQueue,t.updateQueue=e,jc(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)rm(l,e),l=l.sibling;return G(qt,qt.current&1|2),Ye&&xa(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Te()>kc&&(t.flags|=128,r=!0,lr(i,!1),t.lanes=4194304)}else{if(!r)if(e=yc(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,jc(t,e),lr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ye)return xt(t),null}else 2*Te()-i.renderingStartTime>kc&&l!==536870912&&(t.flags|=128,r=!0,lr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e!==null?e.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Te(),e.sibling=null,l=qt.current,G(qt,r?l&1|2:l&1),Ye&&xa(t,i.treeForkCount),e):(xt(t),null);case 22:case 23:return ul(t),yf(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),l=t.updateQueue,l!==null&&jc(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&L(Ji),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Ea($t),xt(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function a1(e,t){switch(nf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ea($t),Qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Nn(t),null;case 31:if(t.memoizedState!==null){if(ul(t),t.alternate===null)throw Error(s(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ul(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(qt),null;case 4:return Qe(),null;case 10:return Ea(t.type),null;case 22:case 23:return ul(t),yf(),e!==null&&L(Ji),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ea($t),null;case 25:return null;default:return null}}function Up(e,t){switch(nf(t),t.tag){case 3:Ea($t),Qe();break;case 26:case 27:case 5:Nn(t);break;case 4:Qe();break;case 31:t.memoizedState!==null&&ul(t);break;case 13:ul(t);break;case 19:L(qt);break;case 10:Ea(t.type);break;case 22:case 23:ul(t),yf(),e!==null&&L(Ji);break;case 24:Ea($t)}}function ar(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var r=i.next;l=r;do{if((l.tag&e)===e){i=void 0;var o=l.create,h=l.inst;i=o(),h.destroy=i}l=l.next}while(l!==r)}}catch(b){st(t,t.return,b)}}function ci(e,t,l){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var o=r.next;i=o;do{if((i.tag&e)===e){var h=i.inst,b=h.destroy;if(b!==void 0){h.destroy=void 0,r=t;var M=l,k=b;try{k()}catch($){st(r,M,$)}}}i=i.next}while(i!==o)}}catch($){st(t,t.return,$)}}function kp(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{wm(t,l)}catch(i){st(e,e.return,i)}}}function Zp(e,t,l){l.props=eu(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){st(e,t,i)}}function ir(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(r){st(e,t,r)}}function la(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(r){st(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(r){st(e,t,r)}else l.current=null}function Lp(e){var t=e.type,l=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(r){st(e,e.return,r)}}function Ff(e,t,l){try{var i=e.stateNode;w1(i,e.type,l,t),i[En]=t}catch(r){st(e,e.return,r)}}function Hp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&gi(e.type)||e.tag===4}function Wf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&gi(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function If(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Un));else if(i!==4&&(i===27&&gi(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(If(e,t,l),e=e.sibling;e!==null;)If(e,t,l),e=e.sibling}function Dc(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(i!==4&&(i===27&&gi(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Dc(e,t,l),e=e.sibling;e!==null;)Dc(e,t,l),e=e.sibling}function Bp(e){var t=e.stateNode,l=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);yn(t,i,l),t[Wt]=e,t[En]=l}catch(o){st(e,e.return,o)}}var Oa=!1,Xt=!1,Pf=!1,qp=typeof WeakSet=="function"?WeakSet:Set,rn=null;function i1(e,t){if(e=e.containerInfo,Sd=Pc,e=St(e),Ct(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{l.nodeType,o.nodeType}catch{l=null;break e}var h=0,b=-1,M=-1,k=0,$=0,J=e,Z=null;t:for(;;){for(var H;J!==l||r!==0&&J.nodeType!==3||(b=h+r),J!==o||i!==0&&J.nodeType!==3||(M=h+i),J.nodeType===3&&(h+=J.nodeValue.length),(H=J.firstChild)!==null;)Z=J,J=H;for(;;){if(J===e)break t;if(Z===l&&++k===r&&(b=h),Z===o&&++$===i&&(M=h),(H=J.nextSibling)!==null)break;J=Z,Z=J.parentNode}J=H}l=b===-1||M===-1?null:{start:b,end:M}}else l=null}l=l||{start:0,end:0}}else l=null;for(_d={focusedElem:e,selectionRange:l},Pc=!1,rn=t;rn!==null;)if(t=rn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,rn=e;else for(;rn!==null;){switch(t=rn,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),yn(o,i,l),o[Wt]=e,Lt(o),i=o;break e;case"link":var h=Kg("link","href",r).get(i+(l.href||""));if(h){for(var b=0;bdt&&(h=dt,dt=je,je=h);var D=Se(b,je),j=Se(b,dt);if(D&&j&&(H.rangeCount!==1||H.anchorNode!==D.node||H.anchorOffset!==D.offset||H.focusNode!==j.node||H.focusOffset!==j.offset)){var R=J.createRange();R.setStart(D.node,D.offset),H.removeAllRanges(),je>dt?(H.addRange(R),H.extend(j.node,j.offset)):(R.setEnd(j.node,j.offset),H.addRange(R))}}}}for(J=[],H=b;H=H.parentNode;)H.nodeType===1&&J.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;bl?32:l,U.T=null,l=ud,ud=null;var o=hi,h=Ra;if(It=0,Ju=hi=null,Ra=0,(We&6)!==0)throw Error(s(331));var b=We;if(We|=4,Ip(o.current),Jp(o,o.current,h,l),We=b,fr(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(nn,o)}catch{}return!0}finally{Q.p=r,U.T=i,gg(e,t)}}function yg(e,t,l){t=bl(l,t),t=Hf(e.stateNode,t,2),e=ui(e,t,2),e!==null&&(tl(e,2),aa(e))}function st(e,t,l){if(e.tag===3)yg(e,e,l);else for(;t!==null;){if(t.tag===3){yg(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(di===null||!di.has(i))){e=bl(l,e),l=bp(2),i=ui(t,l,2),i!==null&&(Sp(l,i,t,e),tl(i,2),aa(i));break}}t=t.return}}function od(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new r1;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(l)||(nd=!0,r.add(l),e=h1.bind(null,e,t,l),t.then(e,e))}function h1(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,pt===e&&(Be&l)===l&&(Ut===4||Ut===3&&(Be&62914560)===Be&&300>Te()-Uc?(We&2)===0&&Fu(e,0):ld|=l,Xu===Be&&(Xu=0)),aa(e)}function bg(e,t){t===0&&(t=Br()),e=Yi(e,t),e!==null&&(tl(e,t),aa(e))}function m1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),bg(e,l)}function p1(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(l=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),bg(e,l)}function g1(e,t){return Ft(e,t)}var Gc=null,Iu=null,fd=!1,Qc=!1,dd=!1,pi=0;function aa(e){e!==Iu&&e.next===null&&(Iu===null?Gc=Iu=e:Iu=Iu.next=e),Qc=!0,fd||(fd=!0,y1())}function fr(e,t){if(!dd&&Qc){dd=!0;do for(var l=!1,i=Gc;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var o=0;else{var h=i.suspendedLanes,b=i.pingedLanes;o=(1<<31-on(42|e)+1)-1,o&=r&~(h&~b),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(l=!0,zg(i,o))}else o=Be,o=yu(i,i===pt?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Di(i,o)||(l=!0,zg(i,o));i=i.next}while(l);dd=!1}}function v1(){Sg()}function Sg(){Qc=fd=!1;var e=0;pi!==0&&A1()&&(e=pi);for(var t=Te(),l=null,i=Gc;i!==null;){var r=i.next,o=_g(i,t);o===0?(i.next=null,l===null?Gc=r:l.next=r,r===null&&(Iu=l)):(l=i,(e!==0||(o&3)!==0)&&(Qc=!0)),i=r}It!==0&&It!==5||fr(e),pi!==0&&(pi=0)}function _g(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0b)break;var $=M.transferSize,J=M.initiatorType;$&&jg(J)&&(M=M.responseEnd,h+=$*(M"u"?null:document;function Qg(e,t,l){var i=Pu;if(i&&typeof t=="string"&&t){var r=Rn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof l=="string"&&(r+='[crossorigin="'+l+'"]'),Gg.has(r)||(Gg.add(r),e={rel:e,crossOrigin:l,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),yn(t,"link",e),Lt(t),i.head.appendChild(t)))}}function Z1(e){Ua.D(e),Qg("dns-prefetch",e,null)}function L1(e,t){Ua.C(e,t),Qg("preconnect",e,t)}function H1(e,t,l){Ua.L(e,t,l);var i=Pu;if(i&&e&&t){var r='link[rel="preload"][as="'+Rn(t)+'"]';t==="image"&&l&&l.imageSrcSet?(r+='[imagesrcset="'+Rn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(r+='[imagesizes="'+Rn(l.imageSizes)+'"]')):r+='[href="'+Rn(e)+'"]';var o=r;switch(t){case"style":o=es(e);break;case"script":o=ts(e)}Tl.has(o)||(e=S({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Tl.set(o,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(pr(o))||t==="script"&&i.querySelector(gr(o))||(t=i.createElement("link"),yn(t,"link",e),Lt(t),i.head.appendChild(t)))}}function B1(e,t){Ua.m(e,t);var l=Pu;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Rn(i)+'"][href="'+Rn(e)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=ts(e)}if(!Tl.has(o)&&(e=S({rel:"modulepreload",href:e},t),Tl.set(o,e),l.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(gr(o)))return}i=l.createElement("link"),yn(i,"link",e),Lt(i),l.head.appendChild(i)}}}function q1(e,t,l){Ua.S(e,t,l);var i=Pu;if(i&&e){var r=pl(i).hoistableStyles,o=es(e);t=t||"default";var h=r.get(o);if(!h){var b={loading:0,preload:null};if(h=i.querySelector(pr(o)))b.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Tl.get(o))&&Ad(e,l);var M=h=i.createElement("link");Lt(M),yn(M,"link",e),M._p=new Promise(function(k,$){M.onload=k,M.onerror=$}),M.addEventListener("load",function(){b.loading|=1}),M.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Xc(h,t,i)}h={type:"stylesheet",instance:h,count:1,state:b},r.set(o,h)}}}function G1(e,t){Ua.X(e,t);var l=Pu;if(l&&e){var i=pl(l).hoistableScripts,r=ts(e),o=i.get(r);o||(o=l.querySelector(gr(r)),o||(e=S({src:e,async:!0},t),(t=Tl.get(r))&&Od(e,t),o=l.createElement("script"),Lt(o),yn(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function Q1(e,t){Ua.M(e,t);var l=Pu;if(l&&e){var i=pl(l).hoistableScripts,r=ts(e),o=i.get(r);o||(o=)DELIM" -R"DELIM(l.querySelector(gr(r)),o||(e=S({src:e,async:!0,type:"module"},t),(t=Tl.get(r))&&Od(e,t),o=l.createElement("script"),Lt(o),yn(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function Yg(e,t,l,i){var r=(r=pe.current)?Kc(r):null;if(!r)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=es(l.href),l=pl(r).hoistableStyles,i=l.get(t),i||(i={type:"style",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=es(l.href);var o=pl(r).hoistableStyles,h=o.get(e);if(h||(r=r.ownerDocument||r,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,h),(o=r.querySelector(pr(e)))&&!o._p&&(h.instance=o,h.state.loading=5),Tl.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Tl.set(e,l),o||Y1(r,e,l,h.state))),t&&i===null)throw Error(s(528,""));return h}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ts(l),l=pl(r).hoistableScripts,i=l.get(t),i||(i={type:"script",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function es(e){return'href="'+Rn(e)+'"'}function pr(e){return'link[rel="stylesheet"]['+e+"]"}function $g(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function Y1(e,t,l,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),yn(t,"link",l),Lt(t),e.head.appendChild(t))}function ts(e){return'[src="'+Rn(e)+'"]'}function gr(e){return"script[async]"+e}function Vg(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Rn(l.href)+'"]');if(i)return t.instance=i,Lt(i),i;var r=S({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Lt(i),yn(i,"style",r),Xc(i,l.precedence,e),t.instance=i;case"stylesheet":r=es(l.href);var o=e.querySelector(pr(r));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;i=$g(l),(r=Tl.get(r))&&Ad(i,r),o=(e.ownerDocument||e).createElement("link"),Lt(o);var h=o;return h._p=new Promise(function(b,M){h.onload=b,h.onerror=M}),yn(o,"link",i),t.state.loading|=4,Xc(o,l.precedence,e),t.instance=o;case"script":return o=ts(l.src),(r=e.querySelector(gr(o)))?(t.instance=r,Lt(r),r):(i=l,(r=Tl.get(o))&&(i=S({},l),Od(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Lt(r),yn(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Xc(i,l.precedence,e));return t.instance}function Xc(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,h=0;h title"):null)}function $1(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Jg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function V1(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var r=es(i.href),o=t.querySelector(pr(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fc.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=o,Lt(o);return}o=t.ownerDocument||t,i=$g(i),(r=Tl.get(r))&&Ad(i,r),o=o.createElement("link"),Lt(o);var h=o;h._p=new Promise(function(b,M){h.onload=b,h.onerror=M}),yn(o,"link",i),l.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Fc.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Nd=0;function K1(e,t){return e.stylesheets&&e.count===0&&Ic(e,e.stylesheets),0Nd?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function Fc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ic(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Wc=null;function Ic(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wc=new Map,t.forEach(X1,e),Wc=null,Fc.call(e))}function X1(e,t){if(!(t.state.loading&4)){var l=Wc.get(e);if(l)var i=l.get(null);else{l=new Map,Wc.set(e,l);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Hd.exports=fS(),Hd.exports}var hS=dS();const mS=Fv(hS),zh="libbitcoinAdminDashboardEndpoints";function Eh(){try{return globalThis.window?.localStorage??null}catch{return null}}function pS(){return globalThis.window?.location.origin??"http://localhost"}function ua(n){const a=n.trim();if(!a)throw new Error("Endpoint URL is required");const u=/^[a-z][a-z\d+\-.]*:\/\//iu.test(a)?a:`http://${a}`,s=new URL(u);if(s.protocol!=="http:"&&s.protocol!=="https:")throw new Error("Endpoint must use HTTP or HTTPS");return s.pathname=s.pathname.replace(/\/+$/u,"")||"/",s.search="",s.hash="",s.toString().replace(/\/$/u,"")}function Wv(n){const a=new URL(ua(n));return a.protocol=a.protocol==="https:"?"wss:":"ws:",a.pathname="/",a.search="",a.hash="",a.toString()}function gS(n,a=pS()){return new URL(ua(n)).origin===new URL(a).origin}function Iv(){return{adminUrl:ua("http://172.20.208.1:8080"),nativeUrl:ua("http://172.20.208.1:80")}}function vS(n=Eh()){const a=Iv();try{const u=n?.getItem(zh);if(!u)return a;const s=JSON.parse(u);if(!s||typeof s!="object"||Array.isArray(s))return a;const c=s;return{adminUrl:typeof c.adminUrl=="string"?ua(c.adminUrl):a.adminUrl,nativeUrl:typeof c.nativeUrl=="string"?ua(c.nativeUrl):a.nativeUrl}}catch{return a}}function yS(n,a=Eh()){const u={adminUrl:ua(n.adminUrl),nativeUrl:ua(n.nativeUrl)};try{a?.setItem(zh,JSON.stringify(u))}catch{}}function bS(n=Eh()){try{n?.removeItem(zh)}catch{}}function SS({configuration:n,onClose:a,onReset:u,onSave:s}){const[c,d]=_e.useState(n.adminUrl),[f,p]=_e.useState(n.nativeUrl),[g,v]=_e.useState(null);function x(S){S.preventDefault();try{s({adminUrl:ua(c),nativeUrl:ua(f)})}catch(T){v(T instanceof Error?T.message:"Invalid endpoint configuration")}}return z.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:S=>{S.target===S.currentTarget&&a()},children:z.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"endpoint-settings-title",className:"border-accent/30 bg-surface w-full max-w-xl rounded-2xl border shadow-2xl shadow-black/50",children:[z.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[z.jsxs("div",{children:[z.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Runtime configuration"}),z.jsx("h2",{id:"endpoint-settings-title",className:"mt-1 text-xl font-semibold",children:"Node endpoints"})]}),z.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close endpoint settings",children:"×"})]}),z.jsxs("form",{onSubmit:x,className:"space-y-5 p-5",children:[z.jsxs("label",{className:"block space-y-2",children:[z.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Admin endpoint"}),z.jsx("input",{value:c,onChange:S=>{d(S.target.value)},className:"border-accent/30 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:admin-port",autoComplete:"url"})]}),z.jsxs("label",{className:"block space-y-2",children:[z.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Native endpoint"}),z.jsx("input",{value:f,onChange:S=>{p(S.target.value)},className:"border-accent/30 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:native-port",autoComplete:"url"})]}),g&&z.jsx("p",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-300",children:g}),z.jsxs("div",{className:"flex flex-wrap justify-between gap-3 pt-2",children:[z.jsx("button",{type:"button",onClick:u,className:"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary rounded-lg border px-4 py-2 text-sm",children:"Reset defaults"}),z.jsxs("div",{className:"flex gap-2",children:[z.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-textPrimary rounded-lg px-4 py-2 text-sm",children:"Cancel"}),z.jsx("button",{type:"submit",className:"bg-accent text-background hover:bg-accent/90 rounded-lg px-4 py-2 text-sm font-semibold",children:"Save and reconnect"})]})]})]})]})})}var b0;function X(n,a,u){function s(p,g){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:g,constr:f,traits:new Set},enumerable:!1}),p._zod.traits.has(n))return;p._zod.traits.add(n),a(p,g);const v=f.prototype,x=Object.keys(v);for(let S=0;Su?.Parent&&p instanceof u.Parent?!0:p?._zod?.traits?.has(n)}),Object.defineProperty(f,"name",{value:n}),f}class cs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Pv extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}(b0=globalThis).__zod_globalConfig??(b0.__zod_globalConfig={});const Th=globalThis.__zod_globalConfig;function fu(n){return Th}function ey(n){const a=Object.values(n).filter(s=>typeof s=="number");return Object.entries(n).filter(([s,c])=>a.indexOf(+s)===-1).map(([s,c])=>c)}function Pd(n,a){return typeof a=="bigint"?a.toString():a}function wh(n){return{get value(){{const a=n();return Object.defineProperty(this,"value",{value:a}),a}}}}function Mh(n){return n==null}function Ah(n){const a=n.startsWith("^")?1:0,u=n.endsWith("$")?n.length-1:n.length;return n.slice(a,u)}function _S(n,a){const u=n/a,s=Math.round(u),c=Number.EPSILON*Math.max(Math.abs(u),1);return Math.abs(u-s){};function bo(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const zS=wh(()=>{if(Th.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function Dr(n){if(bo(n)===!1)return!1;const a=n.constructor;if(a===void 0||typeof a!="function")return!0;const u=a.prototype;return!(bo(u)===!1||Object.prototype.hasOwnProperty.call(u,"isPrototypeOf")===!1)}function ny(n){return Dr(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const ES=new Set(["string","number","symbol"]);function ds(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oi(n,a,u){const s=new n._zod.constr(a??n._zod.def);return(!a||u?.parent)&&(s._zod.parent=n),s}function Me(n){const a=n;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 TS(n){return Object.keys(n).filter(a=>n[a]._zod.optin==="optional"&&n[a]._zod.optout==="optional")}const wS={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 MS(n,a){const u=n._zod.def,s=u.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const d=Ai(n._zod.def,{get shape(){const f={};for(const p in a){if(!(p in u.shape))throw new Error(`Unrecognized key: "${p}"`);a[p]&&(f[p]=u.shape[p])}return mu(this,"shape",f),f},checks:[]});return Oi(n,d)}function AS(n,a){const u=n._zod.def,s=u.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const d=Ai(n._zod.def,{get shape(){const f={...n._zod.def.shape};for(const p in a){if(!(p in u.shape))throw new Error(`Unrecognized key: "${p}"`);a[p]&&delete f[p]}return mu(this,"shape",f),f},checks:[]});return Oi(n,d)}function OS(n,a){if(!Dr(a))throw new Error("Invalid input to extend: expected a plain object");const u=n._zod.def.checks;if(u&&u.length>0){const d=n._zod.def.shape;for(const f in a)if(Object.getOwnPropertyDescriptor(d,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const c=Ai(n._zod.def,{get shape(){const d={...n._zod.def.shape,...a};return mu(this,"shape",d),d}});return Oi(n,c)}function NS(n,a){if(!Dr(a))throw new Error("Invalid input to safeExtend: expected a plain object");const u=Ai(n._zod.def,{get shape(){const s={...n._zod.def.shape,...a};return mu(this,"shape",s),s}});return Oi(n,u)}function jS(n,a){if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const u=Ai(n._zod.def,{get shape(){const s={...n._zod.def.shape,...a._zod.def.shape};return mu(this,"shape",s),s},get catchall(){return a._zod.def.catchall},checks:a._zod.def.checks??[]});return Oi(n,u)}function DS(n,a,u){const c=a._zod.def.checks;if(c&&c.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const f=Ai(a._zod.def,{get shape(){const p=a._zod.def.shape,g={...p};if(u)for(const v in u){if(!(v in p))throw new Error(`Unrecognized key: "${v}"`);u[v]&&(g[v]=n?new n({type:"optional",innerType:p[v]}):p[v])}else for(const v in p)g[v]=n?new n({type:"optional",innerType:p[v]}):p[v];return mu(this,"shape",g),g},checks:[]});return Oi(a,f)}function CS(n,a,u){const s=Ai(a._zod.def,{get shape(){const c=a._zod.def.shape,d={...c};if(u)for(const f in u){if(!(f in d))throw new Error(`Unrecognized key: "${f}"`);u[f]&&(d[f]=new n({type:"nonoptional",innerType:c[f]}))}else for(const f in c)d[f]=new n({type:"nonoptional",innerType:c[f]});return mu(this,"shape",d),d}});return Oi(a,s)}function rs(n,a=0){if(n.aborted===!0)return!0;for(let u=a;u{var s;return(s=u).path??(s.path=[]),u.path.unshift(n),u})}function uo(n){return typeof n=="string"?n:n?.message}function du(n,a,u){const s=n.message?n.message:uo(n.inst?._zod.def?.error?.(n))??uo(a?.error?.(n))??uo(u.customError?.(n))??uo(u.localeError?.(n))??"Invalid input",{inst:c,continue:d,input:f,...p}=n;return p.path??(p.path=[]),p.message=s,a?.reportInput&&(p.input=f),p}function Oh(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Cr(...n){const[a,u,s]=n;return typeof a=="string"?{message:a,code:"custom",input:u,inst:s}:{...a}}const ay=(n,a)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:a,enumerable:!1}),n.message=JSON.stringify(a,Pd,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},iy=X("$ZodError",ay),uy=X("$ZodError",ay,{Parent:Error});function US(n,a=u=>u.message){const u={},s=[];for(const c of n.issues)c.path.length>0?(u[c.path[0]]=u[c.path[0]]||[],u[c.path[0]].push(a(c))):s.push(a(c));return{formErrors:s,fieldErrors:u}}function kS(n,a=u=>u.message){const u={_errors:[]},s=(c,d=[])=>{for(const f of c.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(p=>s({issues:p},[...d,...f.path]));else if(f.code==="invalid_key")s({issues:f.issues},[...d,...f.path]);else if(f.code==="invalid_element")s({issues:f.issues},[...d,...f.path]);else{const p=[...d,...f.path];if(p.length===0)u._errors.push(a(f));else{let g=u,v=0;for(;v(a,u,s,c)=>{const d=s?{...s,async:!1}:{async:!1},f=a._zod.run({value:u,issues:[]},d);if(f instanceof Promise)throw new cs;if(f.issues.length){const p=new(c?.Err??n)(f.issues.map(g=>du(g,d,fu())));throw ty(p,c?.callee),p}return f.value},jh=n=>async(a,u,s,c)=>{const d=s?{...s,async:!0}:{async:!0};let f=a._zod.run({value:u,issues:[]},d);if(f instanceof Promise&&(f=await f),f.issues.length){const p=new(c?.Err??n)(f.issues.map(g=>du(g,d,fu())));throw ty(p,c?.callee),p}return f.value},Oo=n=>(a,u,s)=>{const c=s?{...s,async:!1}:{async:!1},d=a._zod.run({value:u,issues:[]},c);if(d instanceof Promise)throw new cs;return d.issues.length?{success:!1,error:new(n??iy)(d.issues.map(f=>du(f,c,fu())))}:{success:!0,data:d.value}},ZS=Oo(uy),No=n=>async(a,u,s)=>{const c=s?{...s,async:!0}:{async:!0};let d=a._zod.run({value:u,issues:[]},c);return d instanceof Promise&&(d=await d),d.issues.length?{success:!1,error:new n(d.issues.map(f=>du(f,c,fu())))}:{success:!0,data:d.value}},LS=No(uy),HS=n=>(a,u,s)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return Nh(n)(a,u,c)},BS=n=>(a,u,s)=>Nh(n)(a,u,s),qS=n=>async(a,u,s)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return jh(n)(a,u,c)},GS=n=>async(a,u,s)=>jh(n)(a,u,s),QS=n=>(a,u,s)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return Oo(n)(a,u,c)},YS=n=>(a,u,s)=>Oo(n)(a,u,s),$S=n=>async(a,u,s)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return No(n)(a,u,c)},VS=n=>async(a,u,s)=>No(n)(a,u,s),KS=/^[cC][0-9a-z]{6,}$/,XS=/^[0-9a-z]+$/,JS=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,FS=/^[0)DELIM" -R"DELIM(-9a-vA-V]{20}$/,WS=/^[A-Za-z0-9]{27}$/,IS=/^[a-zA-Z0-9_-]{21}$/,PS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,e_=/^([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})$/,x0=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[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)$/,t_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,n_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function l_(){return new RegExp(n_,"u")}const a_=/^(?:(?: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])$/,i_=/^(([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}|:))$/,u_=/^((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])$/,s_=/^(([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])$/,r_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sy=/^[A-Za-z0-9_-]*$/,c_=/^https?$/,o_=/^\+[1-9]\d{6,14}$/,ry="(?:(?:\\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])))",f_=new RegExp(`^${ry}$`);function cy(n){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${a}`:n.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${n.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function d_(n){return new RegExp(`^${cy(n)}$`)}function h_(n){const a=cy({precision:n.precision}),u=["Z"];n.local&&u.push(""),n.offset&&u.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${a}(?:${u.join("|")})`;return new RegExp(`^${ry}T(?:${s})$`)}const m_=n=>{const a=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},p_=/^-?\d+$/,g_=/^-?\d+(?:\.\d+)?$/,v_=/^(?:true|false)$/i,y_=/^[^A-Z]*$/,b_=/^[^a-z]*$/,In=X("$ZodCheck",(n,a)=>{var u;n._zod??(n._zod={}),n._zod.def=a,(u=n._zod).onattach??(u.onattach=[])}),oy={number:"number",bigint:"bigint",object:"date"},fy=X("$ZodCheckLessThan",(n,a)=>{In.init(n,a);const u=oy[typeof a.value];n._zod.onattach.push(s=>{const c=s._zod.bag,d=(a.inclusive?c.maximum:c.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?s.value<=a.value:s.value{In.init(n,a);const u=oy[typeof a.value];n._zod.onattach.push(s=>{const c=s._zod.bag,d=(a.inclusive?c.minimum:c.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>d&&(a.inclusive?c.minimum=a.value:c.exclusiveMinimum=a.value)}),n._zod.check=s=>{(a.inclusive?s.value>=a.value:s.value>a.value)||s.issues.push({origin:u,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:s.value,inclusive:a.inclusive,inst:n,continue:!a.abort})}}),S_=X("$ZodCheckMultipleOf",(n,a)=>{In.init(n,a),n._zod.onattach.push(u=>{var s;(s=u._zod.bag).multipleOf??(s.multipleOf=a.value)}),n._zod.check=u=>{if(typeof u.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof u.value=="bigint"?u.value%a.value===BigInt(0):_S(u.value,a.value)===0)||u.issues.push({origin:typeof u.value,code:"not_multiple_of",divisor:a.value,input:u.value,inst:n,continue:!a.abort})}}),__=X("$ZodCheckNumberFormat",(n,a)=>{In.init(n,a),a.format=a.format||"float64";const u=a.format?.includes("int"),s=u?"int":"number",[c,d]=wS[a.format];n._zod.onattach.push(f=>{const p=f._zod.bag;p.format=a.format,p.minimum=c,p.maximum=d,u&&(p.pattern=p_)}),n._zod.check=f=>{const p=f.value;if(u){if(!Number.isInteger(p)){f.issues.push({expected:s,format:a.format,code:"invalid_type",continue:!1,input:p,inst:n});return}if(!Number.isSafeInteger(p)){p>0?f.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:s,inclusive:!0,continue:!a.abort}):f.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:s,inclusive:!0,continue:!a.abort});return}}pd&&f.issues.push({origin:"number",input:p,code:"too_big",maximum:d,inclusive:!0,inst:n,continue:!a.abort})}}),x_=X("$ZodCheckMaxLength",(n,a)=>{var u;In.init(n,a),(u=n._zod.def).when??(u.when=s=>{const c=s.value;return!Mh(c)&&c.length!==void 0}),n._zod.onattach.push(s=>{const c=s._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const c=s.value;if(c.length<=a.maximum)return;const f=Oh(c);s.issues.push({origin:f,code:"too_big",maximum:a.maximum,inclusive:!0,input:c,inst:n,continue:!a.abort})}}),z_=X("$ZodCheckMinLength",(n,a)=>{var u;In.init(n,a),(u=n._zod.def).when??(u.when=s=>{const c=s.value;return!Mh(c)&&c.length!==void 0}),n._zod.onattach.push(s=>{const c=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>c&&(s._zod.bag.minimum=a.minimum)}),n._zod.check=s=>{const c=s.value;if(c.length>=a.minimum)return;const f=Oh(c);s.issues.push({origin:f,code:"too_small",minimum:a.minimum,inclusive:!0,input:c,inst:n,continue:!a.abort})}}),E_=X("$ZodCheckLengthEquals",(n,a)=>{var u;In.init(n,a),(u=n._zod.def).when??(u.when=s=>{const c=s.value;return!Mh(c)&&c.length!==void 0}),n._zod.onattach.push(s=>{const c=s._zod.bag;c.minimum=a.length,c.maximum=a.length,c.length=a.length}),n._zod.check=s=>{const c=s.value,d=c.length;if(d===a.length)return;const f=Oh(c),p=d>a.length;s.issues.push({origin:f,...p?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:s.value,inst:n,continue:!a.abort})}}),jo=X("$ZodCheckStringFormat",(n,a)=>{var u,s;In.init(n,a),n._zod.onattach.push(c=>{const d=c._zod.bag;d.format=a.format,a.pattern&&(d.patterns??(d.patterns=new Set),d.patterns.add(a.pattern))}),a.pattern?(u=n._zod).check??(u.check=c=>{a.pattern.lastIndex=0,!a.pattern.test(c.value)&&c.issues.push({origin:"string",code:"invalid_format",format:a.format,input:c.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:n,continue:!a.abort})}):(s=n._zod).check??(s.check=()=>{})}),T_=X("$ZodCheckRegex",(n,a)=>{jo.init(n,a),n._zod.check=u=>{a.pattern.lastIndex=0,!a.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:"regex",input:u.value,pattern:a.pattern.toString(),inst:n,continue:!a.abort})}}),w_=X("$ZodCheckLowerCase",(n,a)=>{a.pattern??(a.pattern=y_),jo.init(n,a)}),M_=X("$ZodCheckUpperCase",(n,a)=>{a.pattern??(a.pattern=b_),jo.init(n,a)}),A_=X("$ZodCheckIncludes",(n,a)=>{In.init(n,a);const u=ds(a.includes),s=new RegExp(typeof a.position=="number"?`^.{${a.position}}${u}`:u);a.pattern=s,n._zod.onattach.push(c=>{const d=c._zod.bag;d.patterns??(d.patterns=new Set),d.patterns.add(s)}),n._zod.check=c=>{c.value.includes(a.includes,a.position)||c.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:c.value,inst:n,continue:!a.abort})}}),O_=X("$ZodCheckStartsWith",(n,a)=>{In.init(n,a);const u=new RegExp(`^${ds(a.prefix)}.*`);a.pattern??(a)DELIM" -R"DELIM(.pattern=u),n._zod.onattach.push(s=>{const c=s._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(u)}),n._zod.check=s=>{s.value.startsWith(a.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:s.value,inst:n,continue:!a.abort})}}),N_=X("$ZodCheckEndsWith",(n,a)=>{In.init(n,a);const u=new RegExp(`.*${ds(a.suffix)}$`);a.pattern??(a.pattern=u),n._zod.onattach.push(s=>{const c=s._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(u)}),n._zod.check=s=>{s.value.endsWith(a.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:s.value,inst:n,continue:!a.abort})}}),j_=X("$ZodCheckOverwrite",(n,a)=>{In.init(n,a),n._zod.check=u=>{u.value=a.tx(u.value)}});class D_{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 s=a.split(` -`).filter(f=>f),c=Math.min(...s.map(f=>f.length-f.trimStart().length)),d=s.map(f=>f.slice(c)).map(f=>" ".repeat(this.indent*2)+f);for(const f of d)this.content.push(f)}compile(){const a=Function,u=this?.args,c=[...(this?.content??[""]).map(d=>` ${d}`)];return new a(...u,c.join(` -`))}}const C_={major:4,minor:4,patch:3},kt=X("$ZodType",(n,a)=>{var u;n??(n={}),n._zod.def=a,n._zod.bag=n._zod.bag||{},n._zod.version=C_;const s=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&s.unshift(n);for(const c of s)for(const d of c._zod.onattach)d(n);if(s.length===0)(u=n._zod).deferred??(u.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const c=(f,p,g)=>{let v=rs(f),x;for(const S of p){if(S._zod.def.when){if(RS(f)||!S._zod.def.when(f))continue}else if(v)continue;const T=f.issues.length,w=S._zod.check(f);if(w instanceof Promise&&g?.async===!1)throw new cs;if(x||w instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await w,f.issues.length!==T&&(v||(v=rs(f,T)))});else{if(f.issues.length===T)continue;v||(v=rs(f,T))}}return x?x.then(()=>f):f},d=(f,p,g)=>{if(rs(f))return f.aborted=!0,f;const v=c(p,s,g);if(v instanceof Promise){if(g.async===!1)throw new cs;return v.then(x=>n._zod.parse(x,g))}return n._zod.parse(v,g)};n._zod.run=(f,p)=>{if(p.skipChecks)return n._zod.parse(f,p);if(p.direction==="backward"){const v=n._zod.parse({value:f.value,issues:[]},{...p,skipChecks:!0});return v instanceof Promise?v.then(x=>d(x,f,p)):d(v,f,p)}const g=n._zod.parse(f,p);if(g instanceof Promise){if(p.async===!1)throw new cs;return g.then(v=>c(v,s,p))}return c(g,s,p)}}ht(n,"~standard",()=>({validate:c=>{try{const d=ZS(n,c);return d.success?{value:d.data}:{issues:d.error?.issues}}catch{return LS(n,c).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),Dh=X("$ZodString",(n,a)=>{kt.init(n,a),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??m_(n._zod.bag),n._zod.parse=(u,s)=>{if(a.coerce)try{u.value=String(u.value)}catch{}return typeof u.value=="string"||u.issues.push({expected:"string",code:"invalid_type",input:u.value,inst:n}),u}}),wt=X("$ZodStringFormat",(n,a)=>{jo.init(n,a),Dh.init(n,a)}),R_=X("$ZodGUID",(n,a)=>{a.pattern??(a.pattern=e_),wt.init(n,a)}),U_=X("$ZodUUID",(n,a)=>{if(a.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(s===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=x0(s))}else a.pattern??(a.pattern=x0());wt.init(n,a)}),k_=X("$ZodEmail",(n,a)=>{a.pattern??(a.pattern=t_),wt.init(n,a)}),Z_=X("$ZodURL",(n,a)=>{wt.init(n,a),n._zod.check=u=>{try{const s=u.value.trim();if(!a.normalize&&a.protocol?.source===c_.source&&!/^https?:\/\//i.test(s)){u.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:u.value,inst:n,continue:!a.abort});return}const c=new URL(s);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(c.hostname)||u.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:u.value,inst:n,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(c.protocol.endsWith(":")?c.protocol.slice(0,-1):c.protocol)||u.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:u.value,inst:n,continue:!a.abort})),a.normalize?u.value=c.href:u.value=s;return}catch{u.issues.push({code:"invalid_format",format:"url",input:u.value,inst:n,continue:!a.abort})}}}),L_=X("$ZodEmoji",(n,a)=>{a.pattern??(a.pattern=l_()),wt.init(n,a)}),H_=X("$ZodNanoID",(n,a)=>{a.pattern??(a.pattern=IS),wt.init(n,a)}),B_=X("$ZodCUID",(n,a)=>{a.pattern??(a.pattern=KS),wt.init(n,a)}),q_=X("$ZodCUID2",(n,a)=>{a.pattern??(a.pattern=XS),wt.init(n,a)}),G_=X("$ZodULID",(n,a)=>{a.pattern??(a.pattern=JS),wt.init(n,a)}),Q_=X("$ZodXID",(n,a)=>{a.pattern??(a.pattern=FS),wt.init(n,a)}),Y_=X("$ZodKSUID",(n,a)=>{a.pattern??(a.pattern=WS),wt.init(n,a)}),$_=X("$ZodISODateTime",(n,a)=>{a.pattern??(a.pattern=h_(a)),wt.init(n,a)}),V_=X("$ZodISODate",(n,a)=>{a.pattern??(a.pattern=f_),wt.init(n,a)}),K_=X("$ZodISOTime",(n,a)=>{a.pattern??(a.pattern=d_(a)),wt.init(n,a)}),X_=X("$ZodISODuration",(n,a)=>{a.pattern??(a.pattern=PS),wt.init(n,a)}),J_=X("$ZodIPv4",(n,a)=>{a.pattern??(a.pattern=a_),wt.init(n,a),n._zod.bag.format="ipv4"}),F_=X("$ZodIPv6",(n,a)=>{a.pattern??(a.pattern=i_),wt.init(n,a),n._zod.bag.format="ipv6",n._zod.check=u=>{try{new URL(`http://[${u.value}]`)}catch{u.issues.push({code:"invalid_format",format:"ipv6",input:u.value,inst:n,continue:!a.abort})}}}),W_=X("$ZodCIDRv4",(n,a)=>{a.pattern??(a.pattern=u_),wt.init(n,a)}),I_=X("$ZodCIDRv6",(n,a)=>{a.pattern??(a.pattern=s_),wt.init(n,a),n._zod.check=u=>{const s=u.value.split("/");try{if(s.length!==2)throw new Error;const[c,d]=s;if(!d)throw new Error;const f=Number(d);if(`${f}`!==d)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${c}]`)}catch{u.issues.push({code:"invalid_format",format:"cidrv6",input:u.value,inst:n,continue:!a.abort})}}});function hy(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const P_=X("$ZodBase64",(n,a)=>{a.pattern??(a.pattern=r_),wt.init(n,a),n._zod.bag.contentEncoding="base64",n._zod.check=u=>{hy(u.value)||u.issues.push({code:"invalid_format",format:"base64",input:u.value,inst:n,continue:!a.abort})}});function ex(n){if(!sy.test(n))return!1;const a=n.replace(/[-_]/g,s=>s==="-"?"+":"/"),u=a.padEnd(Math.ceil(a.length/4)*4,"=");return hy(u)}const tx=X("$ZodBase64URL",(n,a)=>{a.pattern??(a.pattern=sy),wt.init(n,a),n._zod.bag.contentEncoding="base64url",n._zod.check=u=>{ex(u.value)||u.issues.push({code:"invalid_format",format:"base64url",input:u.value,inst:n,continue:!a.abort})}}),nx=X("$ZodE164",(n,a)=>{a.pattern??(a.pattern=o_),wt.init(n,a)});function lx(n,a=null){try{const u=n.split(".");if(u.length!==3)return!1;const[s]=u;if(!s)return!1;const c=JSON.parse(atob(s));return!("typ"in c&&c?.typ!=="JWT"||!c.alg||a&&(!("alg"in c)||c.alg!==a))}catch{return!1}}const ax=X("$ZodJWT",(n,a)=>{wt.init(n,a),n._zod.check=u=>{lx(u.value,a.alg)||u.issues.push({code:"invalid_format",format:"jwt",input:u.value,inst:n,continue:!a.abort})}}),my=X("$ZodNumber",(n,a)=>{kt.init(n,a),n._zod.pattern=n._zod.bag.pattern??g_,n._zod.parse=(u,s)=>{if(a.coerce)try{u.value=Number(u.value)}catch{}const c=u.value;if(typeof c=="number"&&!Number.isNaN(c)&&Number.isFinite(c))return u;const d=typeof c=="number"?Number.isNaN(c)?"NaN":Number.isFinite(c)?void 0:"Infinity":void 0;return u.issues.push({expected:"number",code:"invalid_type",input:c,inst:n,...d?{received:d}:{}}),u}}),ix=X("$ZodNumberFormat",(n,a)=>{__.init(n,a),my.init(n,a)}),ux=X("$ZodBoolean",(n,a)=>{kt.init(n,a),n._zod.pattern=v_,n._zod.parse=(u,s)=>{if(a.coerce)try{u.value=!!u.value}catch{}const c=u.value;return typeof c=="boolean"||u.issues.push({expected:"boolean",code:"invalid_type",input:c,inst:n}),u}}),sx=X("$ZodUnknown",(n,a)=>{kt.init(n,a),n._zod.parse=u=>u}),rx=X("$ZodNever",(n,a)=>{kt.init(n,a),n._zod.par)DELIM" -R"DELIM(se=(u,s)=>(u.issues.push({expected:"never",code:"invalid_type",input:u.value,inst:n}),u)});function z0(n,a,u){n.issues.length&&a.issues.push(...ly(u,n.issues)),a.value[u]=n.value}const cx=X("$ZodArray",(n,a)=>{kt.init(n,a),n._zod.parse=(u,s)=>{const c=u.value;if(!Array.isArray(c))return u.issues.push({expected:"array",code:"invalid_type",input:c,inst:n}),u;u.value=Array(c.length);const d=[];for(let f=0;fz0(v,u,f))):z0(g,u,f)}return d.length?Promise.all(d).then(()=>u):u}});function So(n,a,u,s,c,d){const f=u in s;if(n.issues.length){if(c&&d&&!f)return;a.issues.push(...ly(u,n.issues))}if(!f&&!c){n.issues.length||a.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[u]});return}n.value===void 0?f&&(a.value[u]=void 0):a.value[u]=n.value}function py(n){const a=Object.keys(n.shape);for(const s of a)if(!n.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const u=TS(n.shape);return{...n,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(u)}}function gy(n,a,u,s,c,d){const f=[],p=c.keySet,g=c.catchall._zod,v=g.def.type,x=g.optin==="optional",S=g.optout==="optional";for(const T in a){if(T==="__proto__"||p.has(T))continue;if(v==="never"){f.push(T);continue}const w=g.run({value:a[T],issues:[]},s);w instanceof Promise?n.push(w.then(O=>So(O,u,T,a,x,S))):So(w,u,T,a,x,S)}return f.length&&u.issues.push({code:"unrecognized_keys",keys:f,input:a,inst:d}),n.length?Promise.all(n).then(()=>u):u}const ox=X("$ZodObject",(n,a)=>{if(kt.init(n,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const p=a.shape;Object.defineProperty(a,"shape",{get:()=>{const g={...p};return Object.defineProperty(a,"shape",{value:g}),g}})}const s=wh(()=>py(a));ht(n._zod,"propValues",()=>{const p=a.shape,g={};for(const v in p){const x=p[v]._zod;if(x.values){g[v]??(g[v]=new Set);for(const S of x.values)g[v].add(S)}}return g});const c=bo,d=a.catchall;let f;n._zod.parse=(p,g)=>{f??(f=s.value);const v=p.value;if(!c(v))return p.issues.push({expected:"object",code:"invalid_type",input:v,inst:n}),p;p.value={};const x=[],S=f.shape;for(const T of f.keys){const w=S[T],O=w._zod.optin==="optional",Y=w._zod.optout==="optional",W=w._zod.run({value:v[T],issues:[]},g);W instanceof Promise?x.push(W.then(F=>So(F,p,T,v,O,Y))):So(W,p,T,v,O,Y)}return d?gy(x,v,p,g,s.value,n):x.length?Promise.all(x).then(()=>p):p}}),fx=X("$ZodObjectJIT",(n,a)=>{ox.init(n,a);const u=n._zod.parse,s=wh(()=>py(a)),c=T=>{const w=new D_(["shape","payload","ctx"]),O=s.value,Y=I=>{const q=_0(I);return`shape[${q}]._zod.run({ value: input[${q}], issues: [] }, ctx)`};w.write("const input = payload.value;");const W=Object.create(null);let F=0;for(const I of O.keys)W[I]=`key_${F++}`;w.write("const newResult = {};");for(const I of O.keys){const q=W[I],ae=_0(I),ne=T[I],le=ne?._zod?.optin==="optional",se=ne?._zod?.optout==="optional";w.write(`const ${q} = ${Y(I)};`),le&&se?w.write(` +`+i.stack}}var Dl=Object.prototype.hasOwnProperty,Ft=n.unstable_scheduleCallback,Xl=n.unstable_cancelCallback,Cl=n.unstable_shouldYield,ra=n.unstable_requestPaint,Te=n.unstable_now,oe=n.unstable_getCurrentPriorityLevel,lt=n.unstable_ImmediatePriority,Nt=n.unstable_UserBlockingPriority,Rl=n.unstable_NormalPriority,ca=n.unstable_LowPriority,tl=n.unstable_IdlePriority,oa=n.log,Dn=n.unstable_setDisableYieldValue,nn=null,rt=null;function Yt(e){if(typeof oa=="function"&&Dn(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(nn,e)}catch{}}var on=Math.clz32?Math.clz32:fa,vs=Math.log,Ba=Math.LN2;function fa(e){return e>>>=0,e===0?32:31-(vs(e)/Ba|0)|0}var da=256,fn=262144,qa=4194304;function Jl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8)DELIM" +R"DELIM(192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ys(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var r=0,o=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var b=i&134217727;return b!==0?(i=b&~o,i!==0?r=Jl(i):(h&=b,h!==0?r=Jl(h):a||(a=b&~e,a!==0&&(r=Jl(a))))):(b=i&~o,b!==0?r=Jl(b):h!==0?r=Jl(h):a||(a=i&~e,a!==0&&(r=Jl(a)))),r===0?0:t!==0&&t!==r&&(t&o)===0&&(o=r&-r,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:r}function Di(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qo(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Br(){var e=qa;return qa<<=1,(qa&62914560)===0&&(qa=4194304),e}function zu(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function nl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ln(e,t,a,i,r,o){var h=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var b=e.entanglements,A=e.expirationTimes,k=e.hiddenUpdates;for(a=h&~a;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Go=/[\n"\\]/g;function Rn(e){return e.replace(Go,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Es(e,t,a,i,r,o,h,b){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Cn(t)):e.value!==""+Cn(t)&&(e.value=""+Cn(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Ts(e,h,Cn(t)):a!=null?Ts(e,h,Cn(a)):i!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Cn(b):e.removeAttribute("name")}function Yr(e,t,a,i,r,o,h,b){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){xs(e);return}a=a!=null?""+Cn(a):"",t=t!=null?""+Cn(t):a,b||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=b?e.checked:!!i,e.defaultChecked=!!i,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),xs(e)}function Ts(e,t,a){t==="number"&&zs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Il(e,t,a,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Os=!1;if(Tn)try{var Xa={};Object.defineProperty(Xa,"passive",{get:function(){Os=!0}}),window.addEventListener("test",Xa,Xa),window.removeEventListener("test",Xa,Xa)}catch{Os=!1}var kn=null,ea=null,Li=null;function Cu(){if(Li)return Li;var e,t=ea,a=t.length,i,r="value"in kn?kn.value:kn.textContent,o=r.length;for(e=0;e=Ia),qu=" ",ba=!1;function Gi(e,t){switch(e){case"keyup":return ec.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ht(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sa=!1;function Dt(e,t){switch(e){case"compositionend":return Ht(t);case"keypress":return t.which!==32?null:(ba=!0,qu);case"textInput":return e=t.data,e===qu&&ba?null:e;default:return null}}function tc(e,t){if(Sa)return e==="compositionend"||!Ns&&Gi(e,t)?(e=Cu(),Li=ea=kn=null,Sa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Ne(a)}}function ct(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ct(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function St(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=zs(e.document)}return t}function Ct(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var et=Tn&&"documentMode"in document&&11>=document.documentMode,it=null,hn=null,Bt=null,wn=!1;function Qn(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;wn||it==null||it!==zs(i)||(i=it,"selectionStart"in i&&Ct(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Bt&&Ue(Bt,i)||(Bt=i,i=Qc(hn,"onSelect"),0>=h,r-=h,la=1<<32-on(t)+r|a<Ze?(qe=ye,ye=null):qe=ye.sibling;var Xe=Z(D,ye,R[Ze],K);if(Xe===null){ye===null&&(ye=qe);break}e&&ye&&Xe.alternate===null&&t(D,ye),N=o(Xe,N,Ze),Ke===null?we=Xe:Ke.sibling=Xe,Ke=Xe,ye=qe}if(Ze===R.leng)DELIM" +R"DELIM(th)return a(D,ye),$e&&za(D,Ze),we;if(ye===null){for(;ZeZe?(qe=ye,ye=null):qe=ye.sibling;var _i=Z(D,ye,Xe.value,K);if(_i===null){ye===null&&(ye=qe);break}e&&ye&&_i.alternate===null&&t(D,ye),N=o(_i,N,Ze),Ke===null?we=_i:Ke.sibling=_i,Ke=_i,ye=qe}if(Xe.done)return a(D,ye),$e&&za(D,Ze),we;if(ye===null){for(;!Xe.done;Ze++,Xe=R.next())Xe=F(D,Xe.value,K),Xe!==null&&(N=o(Xe,N,Ze),Ke===null?we=Xe:Ke.sibling=Xe,Ke=Xe);return $e&&za(D,Ze),we}for(ye=i(ye);!Xe.done;Ze++,Xe=R.next())Xe=B(ye,D,Ze,Xe.value,K),Xe!==null&&(e&&Xe.alternate!==null&&ye.delete(Xe.key===null?Ze:Xe.key),N=o(Xe,N,Ze),Ke===null?we=Xe:Ke.sibling=Xe,Ke=Xe);return e&&ye.forEach(function(uS){return t(D,uS)}),$e&&za(D,Ze),we}function dt(D,N,R,K){if(typeof R=="object"&&R!==null&&R.type===H&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case E:e:{for(var we=R.key;N!==null;){if(N.key===we){if(we=R.type,we===H){if(N.tag===7){a(D,N.sibling),K=r(N,R.props.children),K.return=D,D=K;break e}}else if(N.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===ue&&Fi(we)===N.type){a(D,N.sibling),K=r(N,R.props),Xu(K,R),K.return=D,D=K;break e}a(D,N);break}else t(D,N);N=N.sibling}R.type===H?(K=Qi(R.props.children,D.mode,K,R.key),K.return=D,D=K):(K=rc(R.type,R.key,R.props,null,D.mode,K),Xu(K,R),K.return=D,D=K)}return h(D);case j:e:{for(we=R.key;N!==null;){if(N.key===we)if(N.tag===4&&N.stateNode.containerInfo===R.containerInfo&&N.stateNode.implementation===R.implementation){a(D,N.sibling),K=r(N,R.children||[]),K.return=D,D=K;break e}else{a(D,N);break}else t(D,N);N=N.sibling}K=ef(R,D.mode,K),K.return=D,D=K}return h(D);case ue:return R=Fi(R),dt(D,N,R,K)}if(de(R))return he(D,N,R,K);if(be(R)){if(we=be(R),typeof we!="function")throw Error(u(150));return R=we.call(R),je(D,N,R,K)}if(typeof R.then=="function")return dt(D,N,pc(R),K);if(R.$$typeof===Q)return dt(D,N,fc(D,R),K);gc(D,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,N!==null&&N.tag===6?(a(D,N.sibling),K=r(N,R),K.return=D,D=K):(a(D,N),K=Po(R,D.mode,K),K.return=D,D=K),h(D)):a(D,N)}return function(D,N,R,K){try{Ku=0;var we=dt(D,N,R,K);return Bs=null,we}catch(ye){if(ye===Hs||ye===hc)throw ye;var Ke=il(29,ye,null,D.mode);return Ke.lanes=K,Ke.return=D,Ke}}}var Ii=Em(!0),Tm=Em(!1),ai=!1;function hf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ii(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function si(e,t,a){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(We&2)!==0){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=uc(e),rm(e,null,a),t}return sc(e,i,t,a),uc(e)}function Ju(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,ha(e,a)}}function pf(e,t){var a=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var r=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var h={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?r=o=h:o=o.next=h,a=a.next}while(a!==null);o===null?r=o=t:o=o.next=t}else r=o=t;a={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var gf=!1;function Fu(){if(gf){var e=Ls;if(e!==null)throw e}}function Wu(e,t,a,i){gf=!1;var r=e.updateQueue;ai=!1;var o=r.firstBaseUpdate,h=r.lastBaseUpdate,b=r.shared.pending;if(b!==null){r.shared.pending=null;var A=b,k=A.next;A.next=null,h===null?o=k:h.next=k,h=A;var $=e.alternate;$!==null&&($=$.updateQueue,b=$.lastBaseUpdate,b!==h&&(b===null?$.firstBaseUpdate=k:b.next=k,$.lastBaseUpdate=A))}if(o!==null){var F=r.baseState;h=0,$=k=A=null,b=o;do{var Z=b.lane&-536870913,B=Z!==b.lane;if(B?(Be&Z)===Z:(i&Z)===Z){Z!==0&&Z===Zs&&(gf=!0),$!==null&&($=$.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var he=e,je=b;Z=t;var dt=a;switch(je.tag){case 1:if(he=je.payload,typeof he=="function"){F=he.call(dt,F,Z);break e}F=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=je.payload,Z=typeof he=="function"?he.call(dt,F,Z):he,Z==null)break e;F=x({},F,Z);break e;case 2:ai=!0}}Z=b.callback,Z!==null&&(e.flags|=64,B&&(e.flags|=8192),B=r.callbacks,B===null?r.callbacks=[Z]:B.push(Z))}else B={lane:Z,tag:b.tag,payload:b.payload,callback:b.callback,next:null},$===null?(k=$=B,A=F):$=$.next=B,h|=Z;if(b=b.next,b===null){if(b=r.shared.pending,b===null)break;B=b,b=B.next,B.next=null,r.lastBaseUpdate=B,r.shared.pending=null}}while(!0);$===null&&(A=F),r.baseState=A,r.firstBaseUpdate=k,r.lastBaseUpdate=$,o===null&&(r.shared.lanes=0),fi|=h,e.lanes=h,e.memoizedState=F}}function wm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Am(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;eo?o:8;var h=U.T,b={};U.T=b,Uf(e,!1,t,a);try{var A=r(),k=U.S;if(k!==null&&k(b,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var $=Fb(A,i);er(e,t,$,ol(e))}else er(e,t,i,ol(e))}catch(F){er(e,t,{then:function(){},status:"rejected",reason:F},ol())}finally{Y.p=o,h!==null&&b.types!==null&&(h.types=b.types),U.T=h}}function n1(){}function Cf(e,t,a,i){if(e.tag!==5)throw Error(u(476));var r=ip(e).queue;ap(e,r,t,me,a===null?n1:function(){return sp(e),a(i)})}function ip(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:me},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sp(e){var t=ip(e);t.next===null&&(t=e.alternate.memoizedState),er(e,t.next.queue,{},ol())}function Rf(){return gn(vr)}function up(){return Gt().memoizedState}function rp(){return Gt().memoizedState}function l1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ol();e=ii(a);var i=si(t,e,a);i!==null&&(Wn(i,t,a),Ju(i,t,a)),t={cache:cf()},e.payload=t;return}t=t.return}}function a1(e,t,a){var i=ol();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},wc(e)?op(t,a):(a=Wo(e,t,a,i),a!==null&&(Wn(a,e,i),fp(a,t,i)))}function cp(e,t,a){var i=ol();er(e,t,a,i)}function er(e,t,a,i){var r={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(wc(e))op(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,b=o(h,a);if(r.hasEagerState=!0,r.eagerState=b,Ce(b,h))return sc(e,t,r,0),pt===null&&ic(),!1}catch{}if(a=Wo(e,t,r,i),a!==null)return Wn(a,e,i),fp(a,t,i),!0}return!1}function Uf(e,t,a,i){if(i={lane:2,revertLane:hd(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},wc(e)){if(t)throw Error(u(479))}else t=Wo(e,a,i,2),t!==null&&Wn(t,e,2)}function wc(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function op(e,t){Gs=bc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function fp(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,ha(e,a)}}var tr={readContext:gn,use:xc,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};tr.useEffectEvent=Rt;var dp={readContext:gn,use:xc,useCallback:function(e,t){return Ln().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:Jm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ec(4194308,4,Pm.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ec(4194308,4,e,t)},useInsertionEffect:function(e,t){Ec(4,2,e,t)},useMemo:function(e,t){var a=Ln();t=t===void 0?null:t;var i=e();if(Pi){Yt(!0);try{e()}finally{Yt(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=Ln();if(a!==void 0){var r=a(t);if(Pi){Yt(!0);try{a(t)}finally{Yt(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=a1.bind(null,ke,e),[i.memoizedState,e]},useRef:function(e){var t=Ln();return e={current:e},t.memoizedState=e},useState:function(e){e=Mf(e);var t=e.queue,a=cp.bind(null,ke,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:jf,useDeferredValue:function(e,t){var a=Ln();return Df(a,e,t)},useTransition:function(){var e=Mf(!1);return e=ap.bind(null,ke,e.queue,!0,!1),Ln().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=ke,r=Ln();if($e){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),pt===null)throw Error(u(349));(Be&127)!==0||Cm(i,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Jm(Um.bind(null,i,o,e),[e]),i.flags|=2048,$s(9,{destroy:void 0},Rm.bind(null,i,o,a,t),null),a},useId:function(){var e=Ln(),t=pt.identifierPrefix;if($e){var a=aa,i=la;a=(i&~(1<<32-on(i)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Sc++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?h.createElement("select",{is:i.is}):h.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?h.createElement(r,{is:i.is}):h.createElement(r)}}o[Wt]=t,o[En]=i;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)o.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=o;e:switch(yn(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Oa(t)}}return xt(t),Jf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Oa(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=pe.current,Us(t)){if(e=t.stateNode,a=t.memoizedProps,i=null,r=pn,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[Wt]=t,e=!!(e.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||jg(e.nodeValue,a)),e||ni(t,!0)}else e=Vc(e).createTextNode(i),e[Wt]=t,t.stateNode=e}return xt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(i=Us(t),a!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Wt]=t}else Vi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else a=af(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ul(t),t):(ul(t),null);if((t.flags&128)!==0)throw Error(u(558))}return xt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Us(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Err)DELIM" +R"DELIM(or(u(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(u(317));r[Wt]=t}else Vi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),r=!1}else r=af(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ul(t),t):(ul(t),null)}return ul(t),(t.flags&128)!==0?(t.lanes=a,t):(a=i!==null,e=e!==null&&e.memoizedState!==null,a&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),jc(t,t.updateQueue),xt(t),null);case 4:return Ye(),e===null&&vd(t.stateNode.containerInfo),xt(t),null;case 10:return Ta(t.type),xt(t),null;case 19:if(L(qt),i=t.memoizedState,i===null)return xt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)lr(i,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=yc(e),o!==null){for(t.flags|=128,lr(i,!1),e=o.updateQueue,t.updateQueue=e,jc(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)cm(a,e),a=a.sibling;return G(qt,qt.current&1|2),$e&&za(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Te()>kc&&(t.flags|=128,r=!0,lr(i,!1),t.lanes=4194304)}else{if(!r)if(e=yc(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,jc(t,e),lr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!$e)return xt(t),null}else 2*Te()-i.renderingStartTime>kc&&a!==536870912&&(t.flags|=128,r=!0,lr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e!==null?e.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Te(),e.sibling=null,a=qt.current,G(qt,r?a&1|2:a&1),$e&&za(t,i.treeForkCount),e):(xt(t),null);case 22:case 23:return ul(t),yf(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(a&536870912)!==0&&(t.flags&128)===0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),a=t.updateQueue,a!==null&&jc(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==a&&(t.flags|=2048),e!==null&&L(Ji),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ta(Qt),xt(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function c1(e,t){switch(nf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ta(Qt),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Nn(t),null;case 31:if(t.memoizedState!==null){if(ul(t),t.alternate===null)throw Error(u(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ul(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Vi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(qt),null;case 4:return Ye(),null;case 10:return Ta(t.type),null;case 22:case 23:return ul(t),yf(),e!==null&&L(Ji),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ta(Qt),null;case 25:return null;default:return null}}function kp(e,t){switch(nf(t),t.tag){case 3:Ta(Qt),Ye();break;case 26:case 27:case 5:Nn(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&ul(t);break;case 13:ul(t);break;case 19:L(qt);break;case 10:Ta(t.type);break;case 22:case 23:ul(t),yf(),e!==null&&L(Ji);break;case 24:Ta(Qt)}}function ar(e,t){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var r=i.next;a=r;do{if((a.tag&e)===e){i=void 0;var o=a.create,h=a.inst;i=o(),h.destroy=i}a=a.next}while(a!==r)}}catch(b){ut(t,t.return,b)}}function ci(e,t,a){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var o=r.next;i=o;do{if((i.tag&e)===e){var h=i.inst,b=h.destroy;if(b!==void 0){h.destroy=void 0,r=t;var A=a,k=b;try{k()}catch($){ut(r,A,$)}}}i=i.next}while(i!==o)}}catch($){ut(t,t.return,$)}}function Zp(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Am(t,a)}catch(i){ut(e,e.return,i)}}}function Lp(e,t,a){a.props=es(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(i){ut(e,t,i)}}function ir(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof a=="function"?e.refCleanup=a(i):a.current=i}}catch(r){ut(e,t,r)}}function ia(e,t){var a=e.ref,i=e.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(r){ut(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){ut(e,t,r)}else a.current=null}function Hp(e){var t=e.type,a=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break e;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(r){ut(e,e.return,r)}}function Ff(e,t,a){try{var i=e.stateNode;j1(i,e.type,a,t),i[En]=t}catch(r){ut(e,e.return,r)}}function Bp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&gi(e.type)||e.tag===4}function Wf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&gi(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function If(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Un));else if(i!==4&&(i===27&&gi(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(If(e,t,a),e=e.sibling;e!==null;)If(e,t,a),e=e.sibling}function Dc(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(i!==4&&(i===27&&gi(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Dc(e,t,a),e=e.sibling;e!==null;)Dc(e,t,a),e=e.sibling}function qp(e){var t=e.stateNode,a=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);yn(t,i,a),t[Wt]=e,t[En]=a}catch(o){ut(e,e.return,o)}}var Na=!1,Xt=!1,Pf=!1,Gp=typeof WeakSet=="function"?WeakSet:Set,rn=null;function o1(e,t){if(e=e.containerInfo,Sd=Pc,e=St(e),Ct(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var h=0,b=-1,A=-1,k=0,$=0,F=e,Z=null;t:for(;;){for(var B;F!==a||r!==0&&F.nodeType!==3||(b=h+r),F!==o||i!==0&&F.nodeType!==3||(A=h+i),F.nodeType===3&&(h+=F.nodeValue.length),(B=F.firstChild)!==null;)Z=F,F=B;for(;;){if(F===e)break t;if(Z===a&&++k===r&&(b=h),Z===o&&++$===i&&(A=h),(B=F.nextSibling)!==null)break;F=Z,Z=F.parentNode}F=B}a=b===-1||A===-1?null:{start:b,end:A}}else a=null}a=a||{start:0,end:0}}else a=null;for(_d={focusedElem:e,selectionRange:a},Pc=!1,rn=t;rn!==null;)if(t=rn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,rn=e;else for(;rn!==null;){switch(t=rn,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a title"))),yn(o,i,a),o[Wt]=e,Lt(o),i=o;break e;case"link":var h=Xg("link","href",r).get(i+(a.href||""));if(h){for(var b=0;bdt&&(h=dt,dt=je,je=h);var D=_e(b,je),N=_e(b,dt);if(D&&N&&(B.rangeCount!==1||B.anchorNode!==D.node||B.anchorOffset!==D.offset||B.focusNode!==N.node||B.focusOffset!==N.offset)){var R=F.createRange();R.setStart(D.node,D.offset),B.removeAllRanges(),je>dt?(B.addRange(R),B.extend(N.node,N.offset)):(R.setEnd(N.node,N.offset),B.addRange(R))}}}}for(F=[],B=b;B=B.parentNode;)B.nodeType===1&&F.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;ba?32:a,U.T=null,a=sd,sd=null;var o=hi,h=Ua;if(It=0,Js=hi=null,Ua=0,(We&6)!==0)throw Error(u(331));var b=We;if(We|=4,Pp(o.current),Fp(o,o.current,h,a),We=b,fr(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(nn,o)}catch{}return!0}finally{Y.p=r,U.T=i,vg(e,t)}}function bg(e,t,a){t=_l(a,t),t=Hf(e.stateNode,t,2),e=si(e,t,2),e!==null&&(nl(e,2),sa(e))}function ut(e,t,a){if(e.tag===3)bg(e,e,a);else for(;t!==null;){if(t.tag===3){bg(t,e,a);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(di===null||!di.has(i))){e=_l(a,e),a=Sp(2),i=si(t,a,2),i!==null&&(_p(a,i,t,e),nl(i,2),sa(i));break}}t=t.return}}function od(e,t,a){var i=e.pingCache;if(i===null){i=e.pingCache=new h1;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(a)||(nd=!0,r.add(a),e=y1.bind(null,e,t,a),t.then(e,e))}function y1(e,t,a){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,pt===e&&(Be&a)===a&&(Ut===4||Ut===3&&(Be&62914560)===Be&&300>Te()-Uc?(We&2)===0&&Fs(e,0):ld|=a,Xs===Be&&(Xs=0)),sa(e)}function Sg(e,t){t===0&&(t=Br()),e=$i(e,t),e!==null&&(nl(e,t),sa(e))}function b1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Sg(e,a)}function S1(e,t){var a=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),Sg(e,a)}function _1(e,t){return Ft(e,t)}var Gc=null,Is=null,fd=!1,Yc=!1,dd=!1,pi=0;function sa(e){e!==Is&&e.next===null&&(Is===null?Gc=Is=e:Is=Is.next=e),Yc=!0,fd||(fd=!0,z1())}function fr(e,t){if(!dd&&Yc){dd=!0;do for(var a=!1,i=Gc;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var o=0;else{var h=i.suspendedLanes,b=i.pingedLanes;o=(1<<31-on(42|e)+1)-1,o&=r&~(h&~b),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,Eg(i,o))}else o=Be,o=ys(i,i===pt?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Di(i,o)||(a=!0,Eg(i,o));i=i.next}while(a);dd=!1}}function x1(){_g()}function _g(){Yc=fd=!1;var e=0;pi!==0&&C1()&&(e=pi);for(var t=Te(),a=null,i=Gc;i!==null;){var r=i.next,o=xg(i,t);o===0?(i.next=null,a===null?Gc=r:a.next=r,r===null&&(Is=a)):(a=i,(e!==0||(o&3)!==0)&&(Yc=!0)),i=r}It!==0&&It!==5||fr(e),pi!==0&&(pi=0)}function xg(e,t){for(var a=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0b)break;var $=A.transferSize,F=A.initiatorType;$&&Dg(F)&&(A=A.responseEnd,h+=$*(A"u"?null:document;function $g(e,t,a){var i=Ps;if(i&&typeof t=="string"&&t){var r=Rn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),Yg.has(r)||(Yg.add(r),e={rel:e,crossOrigin:a,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),yn(t,"link",e),Lt(t),i.head.appendChild(t)))}}function G1(e){ka.D(e),$g("dns-prefetch",e,null)}function Y1(e,t){ka.C(e,t),$g("preconnect",e,t)}function $1(e,t,a){ka.L(e,t,a);var i=Ps;if(i&&e&&t){var r='link[rel="preload"][as="'+Rn(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Rn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Rn(a.imageSizes)+'"]')):r+='[href="'+Rn(e)+'"]';var o=r;switch(t){case"style":o=eu(e);break;case"script":o=tu(e)}Al.has(o)||(e=x({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Al.set(o,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(pr(o))||t==="script"&&i.querySelector(gr(o))||(t=i.createElement("link"),yn(t,"link",e),Lt(t),i.head.appendChild(t)))}}function Q1(e,t){ka.m(e,t);var a=Ps;if(a&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Rn(i)+'"][href="'+Rn(e)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=tu(e)}if(!Al.has(o)&&(e=x({rel:"modulepreload",href:e},t),Al.set(o,e),a.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(gr(o)))return}i=a.createElement("link"),yn(i,"link",e),Lt(i),a.head.appendChild(i)}}}function V1(e,t,a){ka.S(e,t,a);var i=Ps;if(i&&e){var r=vl(i).hoistableStyles,o=eu(e);t=t||"default";var h=r.get(o);if(!h){var b={loading:0,preload:null};if(h=i.querySelector(pr(o)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Al.get(o))&&Md(e,a);var A=h=i.createElement("link");Lt(A),yn(A,"link",e),A._p=new Promise(function(k,$){A.onload=k,A.onerror=$}),A.addEventListener("load",function(){b.loading|=1}),A.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Xc(h,t,i)}h={type:"stylesheet",instance:h,count:1,state:b},r.set(o,h)}}}function K1(e,t){ka.X(e,t);var a=Ps;if(a&&e){var i=vl(a).hoistableScripts,r=tu(e),o=i.get(r);o||(o=a.querySelector(gr(r)),o||(e=x({src:e,async:!0},t),(t=Al.get(r))&&Od(e,t),o=a.createElement("script"),Lt(o),yn(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function X1(e,t){ka.M(e,t);var a=Ps;if(a&&e){var i=vl(a).hoistableScripts,r=tu(e),o=i.get(r);o||(o=)DELIM" +R"DELIM(a.querySelector(gr(r)),o||(e=x({src:e,async:!0,type:"module"},t),(t=Al.get(r))&&Od(e,t),o=a.createElement("script"),Lt(o),yn(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function Qg(e,t,a,i){var r=(r=pe.current)?Kc(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=eu(a.href),a=vl(r).hoistableStyles,i=a.get(t),i||(i={type:"style",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=eu(a.href);var o=vl(r).hoistableStyles,h=o.get(e);if(h||(r=r.ownerDocument||r,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,h),(o=r.querySelector(pr(e)))&&!o._p&&(h.instance=o,h.state.loading=5),Al.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Al.set(e,a),o||J1(r,e,a,h.state))),t&&i===null)throw Error(u(528,""));return h}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=tu(a),a=vl(r).hoistableScripts,i=a.get(t),i||(i={type:"script",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function eu(e){return'href="'+Rn(e)+'"'}function pr(e){return'link[rel="stylesheet"]['+e+"]"}function Vg(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function J1(e,t,a,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),yn(t,"link",a),Lt(t),e.head.appendChild(t))}function tu(e){return'[src="'+Rn(e)+'"]'}function gr(e){return"script[async]"+e}function Kg(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Rn(a.href)+'"]');if(i)return t.instance=i,Lt(i),i;var r=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Lt(i),yn(i,"style",r),Xc(i,a.precedence,e),t.instance=i;case"stylesheet":r=eu(a.href);var o=e.querySelector(pr(r));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;i=Vg(a),(r=Al.get(r))&&Md(i,r),o=(e.ownerDocument||e).createElement("link"),Lt(o);var h=o;return h._p=new Promise(function(b,A){h.onload=b,h.onerror=A}),yn(o,"link",i),t.state.loading|=4,Xc(o,a.precedence,e),t.instance=o;case"script":return o=tu(a.src),(r=e.querySelector(gr(o)))?(t.instance=r,Lt(r),r):(i=a,(r=Al.get(o))&&(i=x({},a),Od(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Lt(r),yn(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Xc(i,a.precedence,e));return t.instance}function Xc(e,t,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,h=0;h title"):null)}function F1(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Fg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function W1(e,t,a,i){if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var r=eu(i.href),o=t.querySelector(pr(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,Lt(o);return}o=t.ownerDocument||t,i=Vg(i),(r=Al.get(r))&&Md(i,r),o=o.createElement("link"),Lt(o);var h=o;h._p=new Promise(function(b,A){h.onload=b,h.onerror=A}),yn(o,"link",i),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Fc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Nd=0;function I1(e,t){return e.stylesheets&&e.count===0&&Ic(e,e.stylesheets),0Nd?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function Fc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ic(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Wc=null;function Ic(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wc=new Map,t.forEach(P1,e),Wc=null,Fc.call(e))}function P1(e,t){if(!(t.state.loading&4)){var a=Wc.get(e);if(a)var i=a.get(null);else{a=new Map,Wc.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Hd.exports=gS(),Hd.exports}var yS=vS();const bS=Pv(yS),Eh="libbitcoinAdminDashboardEndpoints",SS="https://blockstream.info/api";function Th(){try{return globalThis.window?.localStorage??null}catch{return null}}function _S(){return globalThis.window?.location.origin??"http://localhost"}function qn(n){const l=n.trim();if(!l)throw new Error("Endpoint URL is required");const s=/^[a-z][a-z\d+\-.]*:\/\//iu.test(l)?l:`http://${l}`,u=new URL(s);if(u.protocol!=="http:"&&u.protocol!=="https:")throw new Error("Endpoint must use HTTP or HTTPS");return u.pathname=u.pathname.replace(/\/+$/u,"")||"/",u.search="",u.hash="",u.toString().replace(/\/$/u,"")}function xS(n,l){return new URL(l.replace(/^\/+/u,""),`${qn(n)}/`).toString()}function ey(n){const l=new URL(qn(n));return l.protocol=l.protocol==="https:"?"wss:":"ws:",l.pathname="/",l.search="",l.hash="",l.toString()}function zS(n,l=_S()){return new URL(qn(n)).origin===new URL(l).origin}function ty(){return{adminUrl:qn("http://172.20.208.1:8080"),nativeUrl:qn("http://172.20.208.1:80"),referenceUrl:qn(SS)}}function ES(n=Th()){const l=ty();try{const s=n?.getItem(Eh);if(!s)return l;const u=JSON.parse(s);if(!u||typeof u!="object"||Array.isArray(u))return l;const c=u;return{adminUrl:typeof c.adminUrl=="string"?qn(c.adminUrl):l.adminUrl,nativeUrl:typeof c.nativeUrl=="string"?qn(c.nativeUrl):l.nativeUrl,referenceUrl:typeof c.referenceUrl=="string"?qn(c.referenceUrl):l.referenceUrl}}catch{return l}}function TS(n,l=Th()){const s={adminUrl:qn(n.adminUrl),nativeUrl:qn(n.nativeUrl),referenceUrl:qn(n.referenceUrl)};try{l?.setItem(Eh,JSON.stringify(s))}catch{}}function wS(n=Th()){try{n?.removeItem(Eh)}catch{}}function AS({configuration:n,onClose:l,onReset:s,onSave:u}){const[c,d]=ge.useState(n.adminUrl),[f,m]=ge.useState(n.nativeUrl),[g,v]=ge.useState(n.referenceUrl),[_,x]=ge.useState(null);function w(E){E.preventDefault();try{u({adminUrl:qn(c),nativeUrl:qn(f),referenceUrl:qn(g)})}catch(j){x(j instanceof Error?j.message:"Invalid endpoint configuration")}}return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:E=>{E.target===E.currentTarget&&l()},children:S.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"endpoint-settings-title",className:"border-accent/30 bg-surface max-h-[calc(100vh-2rem)] w-full max-w-xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/50",children:[S.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Runtime configuration"}),S.jsx("h2",{id:"endpoint-settings-title",className:"mt-1 text-xl font-semibold",children:"Node endpoints"})]}),S.jsx("button",{type:"button",onClick:l,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close endpoint settings",children:"×"})]}),S.jsxs("form",{onSubmit:w,className:"space-y-5 p-5",children:[S.jsxs("label",{className:"block space-y-2",children:[S.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Admin endpoint"}),S.jsx("input",{value:c,onChange:E=>{d(E.target.value)},className:"border-accent/30 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:admin-port",autoComplete:"url"})]}),S.jsxs("label",{className:"block space-y-2",children:[S.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Native endpoint"}),S.jsx("input",{value:f,onChange:E=>{m(E.target.value)},className:"border-accent/30 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:native-port",autoComplete:"url"})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{htmlFor:"sync-reference-api",className:"text-textPrimary block text-sm font-medium",children:"Sync reference API"}),S.jsx("input",{id:"sync-reference-api",value:g,onChange:E=>{v(E.target.value)},className:"border-accent/30 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"https://blockstream.info/api",autoComplete:"url","aria-describedby":"sync-reference-api-help"}),S.jsx("p",{id:"sync-reference-api-help",className:"text-textMuted text-xs",children:"Esplora-compatible; /blocks/tip/height is appended automatically."})]}),_&&S.jsx("p",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-300",children:_}),S.jsxs("div",{className:"flex flex-wrap justify-between gap-3 pt-2",children:[S.jsx("button",{type:"button",onClick:s,className:"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary rounded-lg border px-4 py-2 text-sm",children:"Reset defaults"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{type:"button",onClick:l,className:"text-textMuted hover:text-textPrimary rounded-lg px-4 py-2 text-sm",children:"Cancel"}),S.jsx("button",{type:"submit",className:"bg-accent text-background hover:bg-accent/90 rounded-lg px-4 py-2 text-sm font-semibold",children:"Save endpoints"})]})]})]})]})})}var S0;function J(n,l,s){function u(m,g){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:g,constr:f,traits:new Set},enumerable:!1}),m._zod.traits.has(n))return;m._zod.traits.add(n),l(m,g);const v=f.prototype,_=Object.keys(v);for(let x=0;x<_.length;x++){const w=_[x];w in m||(m[w]=v[w].bind(m))}}const c=s?.Parent??Object;class d extends c{}Object.defineProperty(d,"name",{value:n});function f(m){var g;const v=s?.Parent?new d:this;u(v,m),(g=v._zod).deferred??(g.deferred=[]);for(const _ of v._zod.deferred)_();return v}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:m=>s?.Parent&&m instanceof s.Parent?!0:m?._zod?.traits?.has(n)}),Object.defineProperty(f,"name",{value:n}),f}class cu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync()DELIM" +R"DELIM() instead.")}}class ny extends Error{constructor(l){super(`Encountered unidirectional transform during encode: ${l}`),this.name="ZodEncodeError"}}(S0=globalThis).__zod_globalConfig??(S0.__zod_globalConfig={});const wh=globalThis.__zod_globalConfig;function fs(n){return wh}function ly(n){const l=Object.values(n).filter(u=>typeof u=="number");return Object.entries(n).filter(([u,c])=>l.indexOf(+u)===-1).map(([u,c])=>c)}function eh(n,l){return typeof l=="bigint"?l.toString():l}function Ah(n){return{get value(){{const l=n();return Object.defineProperty(this,"value",{value:l}),l}}}}function Mh(n){return n==null}function Oh(n){const l=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;return n.slice(l,s)}function MS(n,l){const s=n/l,u=Math.round(s),c=Number.EPSILON*Math.max(Math.abs(s),1);return Math.abs(s-u){};function bo(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const NS=Ah(()=>{if(wh.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function Dr(n){if(bo(n)===!1)return!1;const l=n.constructor;if(l===void 0||typeof l!="function")return!0;const s=l.prototype;return!(bo(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function iy(n){return Dr(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const jS=new Set(["string","number","symbol"]);function du(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oi(n,l,s){const u=new n._zod.constr(l??n._zod.def);return(!l||s?.parent)&&(u._zod.parent=n),u}function Ae(n){const l=n;if(!l)return{};if(typeof l=="string")return{error:()=>l};if(l?.message!==void 0){if(l?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");l.error=l.message}return delete l.message,typeof l.error=="string"?{...l,error:()=>l.error}:l}function DS(n){return Object.keys(n).filter(l=>n[l]._zod.optin==="optional"&&n[l]._zod.optout==="optional")}const CS={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 RS(n,l){const s=n._zod.def,u=s.checks;if(u&&u.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const d=Mi(n._zod.def,{get shape(){const f={};for(const m in l){if(!(m in s.shape))throw new Error(`Unrecognized key: "${m}"`);l[m]&&(f[m]=s.shape[m])}return ms(this,"shape",f),f},checks:[]});return Oi(n,d)}function US(n,l){const s=n._zod.def,u=s.checks;if(u&&u.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const d=Mi(n._zod.def,{get shape(){const f={...n._zod.def.shape};for(const m in l){if(!(m in s.shape))throw new Error(`Unrecognized key: "${m}"`);l[m]&&delete f[m]}return ms(this,"shape",f),f},checks:[]});return Oi(n,d)}function kS(n,l){if(!Dr(l))throw new Error("Invalid input to extend: expected a plain object");const s=n._zod.def.checks;if(s&&s.length>0){const d=n._zod.def.shape;for(const f in l)if(Object.getOwnPropertyDescriptor(d,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const c=Mi(n._zod.def,{get shape(){const d={...n._zod.def.shape,...l};return ms(this,"shape",d),d}});return Oi(n,c)}function ZS(n,l){if(!Dr(l))throw new Error("Invalid input to safeExtend: expected a plain object");const s=Mi(n._zod.def,{get shape(){const u={...n._zod.def.shape,...l};return ms(this,"shape",u),u}});return Oi(n,s)}function LS(n,l){if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const s=Mi(n._zod.def,{get shape(){const u={...n._zod.def.shape,...l._zod.def.shape};return ms(this,"shape",u),u},get catchall(){return l._zod.def.catchall},checks:l._zod.def.checks??[]});return Oi(n,s)}function HS(n,l,s){const c=l._zod.def.checks;if(c&&c.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const f=Mi(l._zod.def,{get shape(){const m=l._zod.def.shape,g={...m};if(s)for(const v in s){if(!(v in m))throw new Error(`Unrecognized key: "${v}"`);s[v]&&(g[v]=n?new n({type:"optional",innerType:m[v]}):m[v])}else for(const v in m)g[v]=n?new n({type:"optional",innerType:m[v]}):m[v];return ms(this,"shape",g),g},checks:[]});return Oi(l,f)}function BS(n,l,s){const u=Mi(l._zod.def,{get shape(){const c=l._zod.def.shape,d={...c};if(s)for(const f in s){if(!(f in d))throw new Error(`Unrecognized key: "${f}"`);s[f]&&(d[f]=new n({type:"nonoptional",innerType:c[f]}))}else for(const f in c)d[f]=new n({type:"nonoptional",innerType:c[f]});return ms(this,"shape",d),d}});return Oi(l,u)}function ru(n,l=0){if(n.aborted===!0)return!0;for(let s=l;s{var u;return(u=s).path??(u.path=[]),s.path.unshift(n),s})}function so(n){return typeof n=="string"?n:n?.message}function ds(n,l,s){const u=n.message?n.message:so(n.inst?._zod.def?.error?.(n))??so(l?.error?.(n))??so(s.customError?.(n))??so(s.localeError?.(n))??"Invalid input",{inst:c,continue:d,input:f,...m}=n;return m.path??(m.path=[]),m.message=u,l?.reportInput&&(m.input=f),m}function Nh(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Cr(...n){const[l,s,u]=n;return typeof l=="string"?{message:l,code:"custom",input:s,inst:u}:{...l}}const uy=(n,l)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:l,enumerable:!1}),n.message=JSON.stringify(l,eh,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},ry=J("$ZodError",uy),cy=J("$ZodError",uy,{Parent:Error});function GS(n,l=s=>s.message){const s={},u=[];for(const c of n.issues)c.path.length>0?(s[c.path[0]]=s[c.path[0]]||[],s[c.path[0]].push(l(c))):u.push(l(c));return{formErrors:u,fieldErrors:s}}function YS(n,l=s=>s.message){const s={_errors:[]},u=(c,d=[])=>{for(const f of c.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(m=>u({issues:m},[...d,...f.path]));else if(f.code==="invalid_key")u({issues:f.issues},[...d,...f.path]);else if(f.code==="invalid_element")u({issues:f.issues},[...d,...f.path]);else{const m=[...d,...f.path];if(m.length===0)s._errors.push(l(f));else{let g=s,v=0;for(;v(l,s,u,c)=>{const d=u?{...u,async:!1}:{async:!1},f=l._zod.run({value:s,issues:[]},d);if(f instanceof Promise)throw new cu;if(f.issues.length){const m=new(c?.Err??n)(f.issues.map(g=>ds(g,d,fs())));throw ay(m,c?.callee),m}return f.value},Dh=n=>async(l,s,u,c)=>{const d=u?{...u,async:!0}:{async:!0};let f=l._zod.run({value:s,issues:[]},d);if(f instanceof Promise&&(f=await f),f.issues.length){const m=new(c?.Err??n)(f.issues.map(g=>ds(g,d,fs())));throw ay(m,c?.callee),m}return f.value},Oo=n=>(l,s,u)=>{const c=u?{...u,async:!1}:{async:!1},d=l._zod.run({value:s,issues:[]},c);if(d instanceof P)DELIM" +R"DELIM(romise)throw new cu;return d.issues.length?{success:!1,error:new(n??ry)(d.issues.map(f=>ds(f,c,fs())))}:{success:!0,data:d.value}},$S=Oo(cy),No=n=>async(l,s,u)=>{const c=u?{...u,async:!0}:{async:!0};let d=l._zod.run({value:s,issues:[]},c);return d instanceof Promise&&(d=await d),d.issues.length?{success:!1,error:new n(d.issues.map(f=>ds(f,c,fs())))}:{success:!0,data:d.value}},QS=No(cy),VS=n=>(l,s,u)=>{const c=u?{...u,direction:"backward"}:{direction:"backward"};return jh(n)(l,s,c)},KS=n=>(l,s,u)=>jh(n)(l,s,u),XS=n=>async(l,s,u)=>{const c=u?{...u,direction:"backward"}:{direction:"backward"};return Dh(n)(l,s,c)},JS=n=>async(l,s,u)=>Dh(n)(l,s,u),FS=n=>(l,s,u)=>{const c=u?{...u,direction:"backward"}:{direction:"backward"};return Oo(n)(l,s,c)},WS=n=>(l,s,u)=>Oo(n)(l,s,u),IS=n=>async(l,s,u)=>{const c=u?{...u,direction:"backward"}:{direction:"backward"};return No(n)(l,s,c)},PS=n=>async(l,s,u)=>No(n)(l,s,u),e_=/^[cC][0-9a-z]{6,}$/,t_=/^[0-9a-z]+$/,n_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,l_=/^[0-9a-vA-V]{20}$/,a_=/^[A-Za-z0-9]{27}$/,i_=/^[a-zA-Z0-9_-]{21}$/,s_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,u_=/^([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})$/,z0=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[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)$/,r_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,c_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function o_(){return new RegExp(c_,"u")}const f_=/^(?:(?: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}|:))$/,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-9]|[1-2][0-9]|3[0-2])$/,m_=/^(([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}=))?$/,oy=/^[A-Za-z0-9_-]*$/,g_=/^https?$/,v_=/^\+[1-9]\d{6,14}$/,fy="(?:(?:\\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(`^${fy}$`);function dy(n){const l="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${l}`:n.precision===0?`${l}:[0-5]\\d`:`${l}:[0-5]\\d\\.\\d{${n.precision}}`:`${l}(?::[0-5]\\d(?:\\.\\d+)?)?`}function b_(n){return new RegExp(`^${dy(n)}$`)}function S_(n){const l=dy({precision:n.precision}),s=["Z"];n.local&&s.push(""),n.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const u=`${l}(?:${s.join("|")})`;return new RegExp(`^${fy}T(?:${u})$`)}const __=n=>{const l=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${l}$`)},x_=/^-?\d+$/,z_=/^-?\d+(?:\.\d+)?$/,E_=/^(?:true|false)$/i,T_=/^[^A-Z]*$/,w_=/^[^a-z]*$/,Pn=J("$ZodCheck",(n,l)=>{var s;n._zod??(n._zod={}),n._zod.def=l,(s=n._zod).onattach??(s.onattach=[])}),hy={number:"number",bigint:"bigint",object:"date"},my=J("$ZodCheckLessThan",(n,l)=>{Pn.init(n,l);const s=hy[typeof l.value];n._zod.onattach.push(u=>{const c=u._zod.bag,d=(l.inclusive?c.maximum:c.exclusiveMaximum)??Number.POSITIVE_INFINITY;l.value{(l.inclusive?u.value<=l.value:u.value{Pn.init(n,l);const s=hy[typeof l.value];n._zod.onattach.push(u=>{const c=u._zod.bag,d=(l.inclusive?c.minimum:c.exclusiveMinimum)??Number.NEGATIVE_INFINITY;l.value>d&&(l.inclusive?c.minimum=l.value:c.exclusiveMinimum=l.value)}),n._zod.check=u=>{(l.inclusive?u.value>=l.value:u.value>l.value)||u.issues.push({origin:s,code:"too_small",minimum:typeof l.value=="object"?l.value.getTime():l.value,input:u.value,inclusive:l.inclusive,inst:n,continue:!l.abort})}}),A_=J("$ZodCheckMultipleOf",(n,l)=>{Pn.init(n,l),n._zod.onattach.push(s=>{var u;(u=s._zod.bag).multipleOf??(u.multipleOf=l.value)}),n._zod.check=s=>{if(typeof s.value!=typeof l.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%l.value===BigInt(0):MS(s.value,l.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:l.value,input:s.value,inst:n,continue:!l.abort})}}),M_=J("$ZodCheckNumberFormat",(n,l)=>{Pn.init(n,l),l.format=l.format||"float64";const s=l.format?.includes("int"),u=s?"int":"number",[c,d]=CS[l.format];n._zod.onattach.push(f=>{const m=f._zod.bag;m.format=l.format,m.minimum=c,m.maximum=d,s&&(m.pattern=x_)}),n._zod.check=f=>{const m=f.value;if(s){if(!Number.isInteger(m)){f.issues.push({expected:u,format:l.format,code:"invalid_type",continue:!1,input:m,inst:n});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:u,inclusive:!0,continue:!l.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:u,inclusive:!0,continue:!l.abort});return}}md&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:d,inclusive:!0,inst:n,continue:!l.abort})}}),O_=J("$ZodCheckMaxLength",(n,l)=>{var s;Pn.init(n,l),(s=n._zod.def).when??(s.when=u=>{const c=u.value;return!Mh(c)&&c.length!==void 0}),n._zod.onattach.push(u=>{const c=u._zod.bag.maximum??Number.POSITIVE_INFINITY;l.maximum{const c=u.value;if(c.length<=l.maximum)return;const f=Nh(c);u.issues.push({origin:f,code:"too_big",maximum:l.maximum,inclusive:!0,input:c,inst:n,continue:!l.abort})}}),N_=J("$ZodCheckMinLength",(n,l)=>{var s;Pn.init(n,l),(s=n._zod.def).when??(s.when=u=>{const c=u.value;return!Mh(c)&&c.length!==void 0}),n._zod.onattach.push(u=>{const c=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;l.minimum>c&&(u._zod.bag.minimum=l.minimum)}),n._zod.check=u=>{const c=u.value;if(c.length>=l.minimum)return;const f=Nh(c);u.issues.push({origin:f,code:"too_small",minimum:l.minimum,inclusive:!0,input:c,inst:n,continue:!l.abort})}}),j_=J("$ZodCheckLengthEquals",(n,l)=>{var s;Pn.init(n,l),(s=n._zod.def).when??(s.when=u=>{const c=u.value;return!Mh(c)&&c.length!==void 0}),n._zod.onattach.push(u=>{const c=u._zod.bag;c.minimum=l.length,c.maximum=l.length,c.length=l.length}),n._zod.check=u=>{const c=u.value,d=c.length;if(d===l.length)return;const f=Nh(c),m=d>l.length;u.issues.push({origin:f,...m?{code:"too_big",maximum:l.length}:{code:"too_small",minimum:l.length},inclusive:!0,exact:!0,input:u.value,inst:n,continue:!l.abort})}}),jo=J("$ZodCheckStringFormat",(n,l)=>{var s,u;Pn.init(n,l),n._zod.onattach.push(c=>{const d=c._zod.bag;d.format=l.format,l.pattern&&(d.patterns??(d.patterns=new Set),d.patterns.add(l.pattern))}),l.pattern?(s=n._zod).check??(s.check=c=>{l.pattern.lastIndex=0,!l.pattern.test(c.value)&&c.issues.push({origin:"string",code:"invalid_format",format:l.format,input:c.value,...l.pattern?{pattern:l.pattern.toString()}:{},in)DELIM" +R"DELIM(st:n,continue:!l.abort})}):(u=n._zod).check??(u.check=()=>{})}),D_=J("$ZodCheckRegex",(n,l)=>{jo.init(n,l),n._zod.check=s=>{l.pattern.lastIndex=0,!l.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:l.pattern.toString(),inst:n,continue:!l.abort})}}),C_=J("$ZodCheckLowerCase",(n,l)=>{l.pattern??(l.pattern=T_),jo.init(n,l)}),R_=J("$ZodCheckUpperCase",(n,l)=>{l.pattern??(l.pattern=w_),jo.init(n,l)}),U_=J("$ZodCheckIncludes",(n,l)=>{Pn.init(n,l);const s=du(l.includes),u=new RegExp(typeof l.position=="number"?`^.{${l.position}}${s}`:s);l.pattern=u,n._zod.onattach.push(c=>{const d=c._zod.bag;d.patterns??(d.patterns=new Set),d.patterns.add(u)}),n._zod.check=c=>{c.value.includes(l.includes,l.position)||c.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:l.includes,input:c.value,inst:n,continue:!l.abort})}}),k_=J("$ZodCheckStartsWith",(n,l)=>{Pn.init(n,l);const s=new RegExp(`^${du(l.prefix)}.*`);l.pattern??(l.pattern=s),n._zod.onattach.push(u=>{const c=u._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(s)}),n._zod.check=u=>{u.value.startsWith(l.prefix)||u.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:l.prefix,input:u.value,inst:n,continue:!l.abort})}}),Z_=J("$ZodCheckEndsWith",(n,l)=>{Pn.init(n,l);const s=new RegExp(`.*${du(l.suffix)}$`);l.pattern??(l.pattern=s),n._zod.onattach.push(u=>{const c=u._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(s)}),n._zod.check=u=>{u.value.endsWith(l.suffix)||u.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:l.suffix,input:u.value,inst:n,continue:!l.abort})}}),L_=J("$ZodCheckOverwrite",(n,l)=>{Pn.init(n,l),n._zod.check=s=>{s.value=l.tx(s.value)}});class H_{constructor(l=[]){this.content=[],this.indent=0,this&&(this.args=l)}indented(l){this.indent+=1,l(this),this.indent-=1}write(l){if(typeof l=="function"){l(this,{execution:"sync"}),l(this,{execution:"async"});return}const u=l.split(` +`).filter(f=>f),c=Math.min(...u.map(f=>f.length-f.trimStart().length)),d=u.map(f=>f.slice(c)).map(f=>" ".repeat(this.indent*2)+f);for(const f of d)this.content.push(f)}compile(){const l=Function,s=this?.args,c=[...(this?.content??[""]).map(d=>` ${d}`)];return new l(...s,c.join(` +`))}}const B_={major:4,minor:4,patch:3},kt=J("$ZodType",(n,l)=>{var s;n??(n={}),n._zod.def=l,n._zod.bag=n._zod.bag||{},n._zod.version=B_;const u=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&u.unshift(n);for(const c of u)for(const d of c._zod.onattach)d(n);if(u.length===0)(s=n._zod).deferred??(s.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const c=(f,m,g)=>{let v=ru(f),_;for(const x of m){if(x._zod.def.when){if(qS(f)||!x._zod.def.when(f))continue}else if(v)continue;const w=f.issues.length,E=x._zod.check(f);if(E instanceof Promise&&g?.async===!1)throw new cu;if(_||E instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await E,f.issues.length!==w&&(v||(v=ru(f,w)))});else{if(f.issues.length===w)continue;v||(v=ru(f,w))}}return _?_.then(()=>f):f},d=(f,m,g)=>{if(ru(f))return f.aborted=!0,f;const v=c(m,u,g);if(v instanceof Promise){if(g.async===!1)throw new cu;return v.then(_=>n._zod.parse(_,g))}return n._zod.parse(v,g)};n._zod.run=(f,m)=>{if(m.skipChecks)return n._zod.parse(f,m);if(m.direction==="backward"){const v=n._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return v instanceof Promise?v.then(_=>d(_,f,m)):d(v,f,m)}const g=n._zod.parse(f,m);if(g instanceof Promise){if(m.async===!1)throw new cu;return g.then(v=>c(v,u,m))}return c(g,u,m)}}ht(n,"~standard",()=>({validate:c=>{try{const d=$S(n,c);return d.success?{value:d.data}:{issues:d.error?.issues}}catch{return QS(n,c).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),Ch=J("$ZodString",(n,l)=>{kt.init(n,l),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??__(n._zod.bag),n._zod.parse=(s,u)=>{if(l.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:n}),s}}),wt=J("$ZodStringFormat",(n,l)=>{jo.init(n,l),Ch.init(n,l)}),q_=J("$ZodGUID",(n,l)=>{l.pattern??(l.pattern=u_),wt.init(n,l)}),G_=J("$ZodUUID",(n,l)=>{if(l.version){const u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[l.version];if(u===void 0)throw new Error(`Invalid UUID version: "${l.version}"`);l.pattern??(l.pattern=z0(u))}else l.pattern??(l.pattern=z0());wt.init(n,l)}),Y_=J("$ZodEmail",(n,l)=>{l.pattern??(l.pattern=r_),wt.init(n,l)}),$_=J("$ZodURL",(n,l)=>{wt.init(n,l),n._zod.check=s=>{try{const u=s.value.trim();if(!l.normalize&&l.protocol?.source===g_.source&&!/^https?:\/\//i.test(u)){s.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:s.value,inst:n,continue:!l.abort});return}const c=new URL(u);l.hostname&&(l.hostname.lastIndex=0,l.hostname.test(c.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:l.hostname.source,input:s.value,inst:n,continue:!l.abort})),l.protocol&&(l.protocol.lastIndex=0,l.protocol.test(c.protocol.endsWith(":")?c.protocol.slice(0,-1):c.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:l.protocol.source,input:s.value,inst:n,continue:!l.abort})),l.normalize?s.value=c.href:s.value=u;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:n,continue:!l.abort})}}}),Q_=J("$ZodEmoji",(n,l)=>{l.pattern??(l.pattern=o_()),wt.init(n,l)}),V_=J("$ZodNanoID",(n,l)=>{l.pattern??(l.pattern=i_),wt.init(n,l)}),K_=J("$ZodCUID",(n,l)=>{l.pattern??(l.pattern=e_),wt.init(n,l)}),X_=J("$ZodCUID2",(n,l)=>{l.pattern??(l.pattern=t_),wt.init(n,l)}),J_=J("$ZodULID",(n,l)=>{l.pattern??(l.pattern=n_),wt.init(n,l)}),F_=J("$ZodXID",(n,l)=>{l.pattern??(l.pattern=l_),wt.init(n,l)}),W_=J("$ZodKSUID",(n,l)=>{l.pattern??(l.pattern=a_),wt.init(n,l)}),I_=J("$ZodISODateTime",(n,l)=>{l.pattern??(l.pattern=S_(l)),wt.init(n,l)}),P_=J("$ZodISODate",(n,l)=>{l.pattern??(l.pattern=y_),wt.init(n,l)}),ex=J("$ZodISOTime",(n,l)=>{l.pattern??(l.pattern=b_(l)),wt.init(n,l)}),tx=J("$ZodISODuration",(n,l)=>{l.pattern??(l.pattern=s_),wt.init(n,l)}),nx=J("$ZodIPv4",(n,l)=>{l.pattern??(l.pattern=f_),wt.init(n,l),n._zod.bag.format="ipv4"}),lx=J("$ZodIPv6",(n,l)=>{l.pattern??(l.pattern=d_),wt.init(n,l),n._zod.bag.format="ipv6",n._zod.check=s=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:n,continue:!l.abort})}}}),ax=J("$ZodCIDRv4",(n,l)=>{l.pattern??(l.pattern=h_),wt.init(n,l)}),ix=J("$ZodCIDRv6",(n,l)=>{l.pattern??(l.pattern=m_),wt.init(n,l),n._zod.check=s=>{const u=s.value.split("/");try{if(u.length!==2)throw new Error;const[c,d]=u;if(!d)throw new Error;const f=Number(d);if(`${f}`!==d)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${c}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:n,continue:!l.abort})}}});function gy(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const sx=J("$ZodBase64",(n,l)=>{l.pattern??(l.pattern=p_),wt.init(n,l),n._zod.bag.contentEncoding="base64",n._zod.check=s=>{gy(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:n,continue:!l.abort})}});function ux(n){if(!oy.test(n))return!1;const l=n.replace(/[-_]/g,u=>u==="-"?"+":"/"),s=l.padEnd(Math.ceil(l.length/4)*4,"=");return gy(s)}const rx=J("$ZodBase64URL",(n,l)=>{l.pattern??(l.pattern=oy),wt.init(n,l),n._zod.bag.contentEncoding="base64url",n._zod.check=s=>{ux(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:n,continue:!l.abort})}}),cx=J("$ZodE164",(n,l)=>{l.pattern??(l.pattern=v_),wt.init(n,l)});function ox(n,l=null){try{const s=n.split(".");if(s.length!==3)return!1;const[u]=s;if(!u)return!1;const c=JSON.parse(atob(u));return!("typ"in c&&c?.typ!=="JWT"||!c.alg||l&&(!("alg"in c)||c.alg!==l))}catch{return!1}}co)DELIM" +R"DELIM(nst fx=J("$ZodJWT",(n,l)=>{wt.init(n,l),n._zod.check=s=>{ox(s.value,l.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:n,continue:!l.abort})}}),vy=J("$ZodNumber",(n,l)=>{kt.init(n,l),n._zod.pattern=n._zod.bag.pattern??z_,n._zod.parse=(s,u)=>{if(l.coerce)try{s.value=Number(s.value)}catch{}const c=s.value;if(typeof c=="number"&&!Number.isNaN(c)&&Number.isFinite(c))return s;const d=typeof c=="number"?Number.isNaN(c)?"NaN":Number.isFinite(c)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:c,inst:n,...d?{received:d}:{}}),s}}),dx=J("$ZodNumberFormat",(n,l)=>{M_.init(n,l),vy.init(n,l)}),hx=J("$ZodBoolean",(n,l)=>{kt.init(n,l),n._zod.pattern=E_,n._zod.parse=(s,u)=>{if(l.coerce)try{s.value=!!s.value}catch{}const c=s.value;return typeof c=="boolean"||s.issues.push({expected:"boolean",code:"invalid_type",input:c,inst:n}),s}}),mx=J("$ZodUnknown",(n,l)=>{kt.init(n,l),n._zod.parse=s=>s}),px=J("$ZodNever",(n,l)=>{kt.init(n,l),n._zod.parse=(s,u)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:n}),s)});function E0(n,l,s){n.issues.length&&l.issues.push(...sy(s,n.issues)),l.value[s]=n.value}const gx=J("$ZodArray",(n,l)=>{kt.init(n,l),n._zod.parse=(s,u)=>{const c=s.value;if(!Array.isArray(c))return s.issues.push({expected:"array",code:"invalid_type",input:c,inst:n}),s;s.value=Array(c.length);const d=[];for(let f=0;fE0(v,s,f))):E0(g,s,f)}return d.length?Promise.all(d).then(()=>s):s}});function So(n,l,s,u,c,d){const f=s in u;if(n.issues.length){if(c&&d&&!f)return;l.issues.push(...sy(s,n.issues))}if(!f&&!c){n.issues.length||l.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[s]});return}n.value===void 0?f&&(l.value[s]=void 0):l.value[s]=n.value}function yy(n){const l=Object.keys(n.shape);for(const u of l)if(!n.shape?.[u]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${u}": expected a Zod schema`);const s=DS(n.shape);return{...n,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(s)}}function by(n,l,s,u,c,d){const f=[],m=c.keySet,g=c.catchall._zod,v=g.def.type,_=g.optin==="optional",x=g.optout==="optional";for(const w in l){if(w==="__proto__"||m.has(w))continue;if(v==="never"){f.push(w);continue}const E=g.run({value:l[w],issues:[]},u);E instanceof Promise?n.push(E.then(j=>So(j,s,w,l,_,x))):So(E,s,w,l,_,x)}return f.length&&s.issues.push({code:"unrecognized_keys",keys:f,input:l,inst:d}),n.length?Promise.all(n).then(()=>s):s}const vx=J("$ZodObject",(n,l)=>{if(kt.init(n,l),!Object.getOwnPropertyDescriptor(l,"shape")?.get){const m=l.shape;Object.defineProperty(l,"shape",{get:()=>{const g={...m};return Object.defineProperty(l,"shape",{value:g}),g}})}const u=Ah(()=>yy(l));ht(n._zod,"propValues",()=>{const m=l.shape,g={};for(const v in m){const _=m[v]._zod;if(_.values){g[v]??(g[v]=new Set);for(const x of _.values)g[v].add(x)}}return g});const c=bo,d=l.catchall;let f;n._zod.parse=(m,g)=>{f??(f=u.value);const v=m.value;if(!c(v))return m.issues.push({expected:"object",code:"invalid_type",input:v,inst:n}),m;m.value={};const _=[],x=f.shape;for(const w of f.keys){const E=x[w],j=E._zod.optin==="optional",H=E._zod.optout==="optional",I=E._zod.run({value:v[w],issues:[]},g);I instanceof Promise?_.push(I.then(W=>So(W,m,w,v,j,H))):So(I,m,w,v,j,H)}return d?by(_,v,m,g,u.value,n):_.length?Promise.all(_).then(()=>m):m}}),yx=J("$ZodObjectJIT",(n,l)=>{vx.init(n,l);const s=n._zod.parse,u=Ah(()=>yy(l)),c=w=>{const E=new H_(["shape","payload","ctx"]),j=u.value,H=Q=>{const q=x0(Q);return`shape[${q}]._zod.run({ value: input[${q}], issues: [] }, ctx)`};E.write("const input = payload.value;");const I=Object.create(null);let W=0;for(const Q of j.keys)I[Q]=`key_${W++}`;E.write("const newResult = {};");for(const Q of j.keys){const q=I[Q],ae=x0(Q),le=w[Q],ee=le?._zod?.optin==="optional",ue=le?._zod?.optout==="optional";E.write(`const ${q} = ${H(Q)};`),ee&&ue?E.write(` if (${q}.issues.length) { if (${ae} in input) { payload.issues = payload.issues.concat(${q}.issues.map(iss => ({ @@ -79,7 +79,7 @@ R"DELIM(se=(u,s)=>(u.issues.push({expected:"never",code:"invalid_type",input:u.v newResult[${ae}] = ${q}.value; } - `):le?w.write(` + `):ee?E.write(` if (${q}.issues.length) { payload.issues = payload.issues.concat(${q}.issues.map(iss => ({ ...iss, @@ -95,7 +95,7 @@ R"DELIM(se=(u,s)=>(u.issues.push({expected:"never",code:"invalid_type",input:u.v newResult[${ae}] = ${q}.value; } - `):w.write(` + `):E.write(` const ${q}_present = ${ae} in input; if (${q}.issues.length) { payload.issues = payload.issues.concat(${q}.issues.map(iss => ({ @@ -120,34 +120,35 @@ R"DELIM(se=(u,s)=>(u.issues.push({expected:"never",code:"invalid_type",input:u.v } } - `)}w.write("payload.value = newResult;"),w.write("return payload;");const B=w.compile();return(I,q)=>B(T,I,q)};let d;const f=bo,p=!Th.jitless,v=p&&zS.value,x=a.catchall;let S;n._zod.parse=(T,w)=>{S??(S=s.value);const O=T.value;return f(O)?p&&v&&w?.async===!1&&w.jitless!==!0?(d||(d=c(a.shape)),T=d(T,w),x?gy([],O,T,w,S,n):T):u(T,w):(T.issues.push({expected:"object",code:"invalid_type",input:O,inst:n}),T)}});function E0(n,a,u,s){for(const d of n)if(d.issues.length===0)return a.value=d.value,a;const c=n.filter(d=>!rs(d));return c.length===1?(a.value=c[0].value,c[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:u,errors:n.map(d=>d.issues.map(f=>du(f,s,fu())))}),a)}const dx=X("$ZodUnion",(n,a)=>{kt.init(n,a),ht(n._zod,"optin",()=>a.options.some(s=>s._zod.optin==="optional")?"optional":void 0),ht(n._zod,"optout",()=>a.options.some(s=>s._zod.optout==="optional")?"optional":void 0),ht(n._zod,"values",()=>{if(a.options.every(s=>s._zod.values))return new Set(a.options.flatMap(s=>Array.from(s._zod.values)))}),ht(n._zod,"pattern",()=>{if(a.options.every(s=>s._zod.pattern)){const s=a.options.map(c=>c._zod.pattern);return new RegExp(`^(${s.map(c=>Ah(c.source)).join("|")})$`)}});const u=a.options.length===1?a.options[0]._zod.run:null;n._zod.parse=(s,c)=>{if(u)return u(s,c);let d=!1;const f=[];for(const p of a.options){const g=p._zod.run({value:s.value,issues:[]},c);if(g instanceof Promise)f.push(g),d=!0;else{if(g.issues.length===0)return g;f.push(g)}}return d?Promise.all(f).then(p=>E0(p,s,n,c)):E0(f,s,n,c)}}),hx=X("$ZodIntersection",(n,a)=>{kt.init(n,a),n._zod.parse=(u,s)=>{const c=u.value,d=a.left._zod.run({value:c,issues:[]},s),f=a.right._zod.run({value:c,issues:[]},s);return d instanceof Promise||f instanceof Promise?Promise.all([d,f]).then(([g,v])=>T0(u,g,v)):T0(u,d,f)}});function eh(n,a){if(n===a)return{valid:!0,data:n};if(n instanceof Date&&a instanceof Date&&+n==+a)return{valid:!0,data:n};if(Dr(n)&&Dr(a)){const u=Object.keys(a),s=Object.keys(n).filter(d=>u.indexOf(d)!==-1),c={...n,...a};for(const d of s){const f=eh(n[d],a[d]);if(!f.valid)return{valid:!1,mergeErrorPath:[d,...f.mergeErrorPath]};c[d]=f.data}return{valid:!0,data:c}}if(Array.isArray(n)&&Array.isArray(a)){if(n.length!==a.length)return{valid:!1,mergeErrorPath:[]};const u=[];for(let s=0;sp.l&&p.r).map(([p])=>p);if(d.length&&c&&n.issues.push({...c,keys:d}),rs(n))return n;const f=eh(a.value,u.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return n.value=f.data,n}const mx=X("$ZodEnum",(n,a)=>{kt.init(n,a);const u=ey(a.entries),s=new Set(u);n._zod.values=s,n._zod.pattern=new RegExp(`^(${u.filter(c=>ES.has(typeof c)).map(c=>typeof c=="string"?ds(c):c.toString()).join("|")})$`),n._zod.parse=(c,d)=>{const f=)DELIM" -R"DELIM(c.value;return s.has(f)||c.issues.push({code:"invalid_value",values:u,input:f,inst:n}),c}}),px=X("$ZodLiteral",(n,a)=>{if(kt.init(n,a),a.values.length===0)throw new Error("Cannot create literal schema with no valid values");const u=new Set(a.values);n._zod.values=u,n._zod.pattern=new RegExp(`^(${a.values.map(s=>typeof s=="string"?ds(s):s?ds(s.toString()):String(s)).join("|")})$`),n._zod.parse=(s,c)=>{const d=s.value;return u.has(d)||s.issues.push({code:"invalid_value",values:a.values,input:d,inst:n}),s}}),gx=X("$ZodTransform",(n,a)=>{kt.init(n,a),n._zod.optin="optional",n._zod.parse=(u,s)=>{if(s.direction==="backward")throw new Pv(n.constructor.name);const c=a.transform(u.value,u);if(s.async)return(c instanceof Promise?c:Promise.resolve(c)).then(f=>(u.value=f,u.fallback=!0,u));if(c instanceof Promise)throw new cs;return u.value=c,u.fallback=!0,u}});function w0(n,a){return a===void 0&&(n.issues.length||n.fallback)?{issues:[],value:void 0}:n}const vy=X("$ZodOptional",(n,a)=>{kt.init(n,a),n._zod.optin="optional",n._zod.optout="optional",ht(n._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),ht(n._zod,"pattern",()=>{const u=a.innerType._zod.pattern;return u?new RegExp(`^(${Ah(u.source)})?$`):void 0}),n._zod.parse=(u,s)=>{if(a.innerType._zod.optin==="optional"){const c=u.value,d=a.innerType._zod.run(u,s);return d instanceof Promise?d.then(f=>w0(f,c)):w0(d,c)}return u.value===void 0?u:a.innerType._zod.run(u,s)}}),vx=X("$ZodExactOptional",(n,a)=>{vy.init(n,a),ht(n._zod,"values",()=>a.innerType._zod.values),ht(n._zod,"pattern",()=>a.innerType._zod.pattern),n._zod.parse=(u,s)=>a.innerType._zod.run(u,s)}),yx=X("$ZodNullable",(n,a)=>{kt.init(n,a),ht(n._zod,"optin",()=>a.innerType._zod.optin),ht(n._zod,"optout",()=>a.innerType._zod.optout),ht(n._zod,"pattern",()=>{const u=a.innerType._zod.pattern;return u?new RegExp(`^(${Ah(u.source)}|null)$`):void 0}),ht(n._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),n._zod.parse=(u,s)=>u.value===null?u:a.innerType._zod.run(u,s)}),bx=X("$ZodDefault",(n,a)=>{kt.init(n,a),n._zod.optin="optional",ht(n._zod,"values",()=>a.innerType._zod.values),n._zod.parse=(u,s)=>{if(s.direction==="backward")return a.innerType._zod.run(u,s);if(u.value===void 0)return u.value=a.defaultValue,u;const c=a.innerType._zod.run(u,s);return c instanceof Promise?c.then(d=>M0(d,a)):M0(c,a)}});function M0(n,a){return n.value===void 0&&(n.value=a.defaultValue),n}const Sx=X("$ZodPrefault",(n,a)=>{kt.init(n,a),n._zod.optin="optional",ht(n._zod,"values",()=>a.innerType._zod.values),n._zod.parse=(u,s)=>(s.direction==="backward"||u.value===void 0&&(u.value=a.defaultValue),a.innerType._zod.run(u,s))}),_x=X("$ZodNonOptional",(n,a)=>{kt.init(n,a),ht(n._zod,"values",()=>{const u=a.innerType._zod.values;return u?new Set([...u].filter(s=>s!==void 0)):void 0}),n._zod.parse=(u,s)=>{const c=a.innerType._zod.run(u,s);return c instanceof Promise?c.then(d=>A0(d,n)):A0(c,n)}});function A0(n,a){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:a}),n}const xx=X("$ZodCatch",(n,a)=>{kt.init(n,a),n._zod.optin="optional",ht(n._zod,"optout",()=>a.innerType._zod.optout),ht(n._zod,"values",()=>a.innerType._zod.values),n._zod.parse=(u,s)=>{if(s.direction==="backward")return a.innerType._zod.run(u,s);const c=a.innerType._zod.run(u,s);return c instanceof Promise?c.then(d=>(u.value=d.value,d.issues.length&&(u.value=a.catchValue({...u,error:{issues:d.issues.map(f=>du(f,s,fu()))},input:u.value}),u.issues=[],u.fallback=!0),u)):(u.value=c.value,c.issues.length&&(u.value=a.catchValue({...u,error:{issues:c.issues.map(d=>du(d,s,fu()))},input:u.value}),u.issues=[],u.fallback=!0),u)}}),zx=X("$ZodPipe",(n,a)=>{kt.init(n,a),ht(n._zod,"values",()=>a.in._zod.values),ht(n._zod,"optin",()=>a.in._zod.optin),ht(n._zod,"optout",()=>a.out._zod.optout),ht(n._zod,"propValues",()=>a.in._zod.propValues),n._zod.parse=(u,s)=>{if(s.direction==="backward"){const d=a.out._zod.run(u,s);return d instanceof Promise?d.then(f=>so(f,a.in,s)):so(d,a.in,s)}const c=a.in._zod.run(u,s);return c instanceof Promise?c.then(d=>so(d,a.out,s)):so(c,a.out,s)}});function so(n,a,u){return n.issues.length?(n.aborted=!0,n):a._zod.run({value:n.value,issues:n.issues,fallback:n.fallback},u)}const Ex=X("$ZodReadonly",(n,a)=>{kt.init(n,a),ht(n._zod,"propValues",()=>a.innerType._zod.propValues),ht(n._zod,"values",()=>a.innerType._zod.values),ht(n._zod,"optin",()=>a.innerType?._zod?.optin),ht(n._zod,"optout",()=>a.innerType?._zod?.optout),n._zod.parse=(u,s)=>{if(s.direction==="backward")return a.innerType._zod.run(u,s);const c=a.innerType._zod.run(u,s);return c instanceof Promise?c.then(O0):O0(c)}});function O0(n){return n.value=Object.freeze(n.value),n}const Tx=X("$ZodCustom",(n,a)=>{In.init(n,a),kt.init(n,a),n._zod.parse=(u,s)=>u,n._zod.check=u=>{const s=u.value,c=a.fn(s);if(c instanceof Promise)return c.then(d=>N0(d,u,s,n));N0(c,u,s,n)}});function N0(n,a,u,s){if(!n){const c={code:"custom",input:u,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(c.params=s._zod.def.params),a.issues.push(Cr(c))}}var j0;class wx{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...u){const s=u[0];return this._map.set(a,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const u=this._map.get(a);return u&&typeof u=="object"&&"id"in u&&this._idmap.delete(u.id),this._map.delete(a),this}get(a){const u=a._zod.parent;if(u){const s={...this.get(u)??{}};delete s.id;const c={...s,...this._map.get(a)};return Object.keys(c).length?c:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function Mx(){return new wx}(j0=globalThis).__zod_globalRegistry??(j0.__zod_globalRegistry=Mx());const Tr=globalThis.__zod_globalRegistry;function Ax(n,a){return new n({type:"string",...Me(a)})}function Ox(n,a){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Me(a)})}function D0(n,a){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Me(a)})}function Nx(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Me(a)})}function jx(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Me(a)})}function Dx(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Me(a)})}function Cx(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Me(a)})}function Rx(n,a){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Me(a)})}function Ux(n,a){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Me(a)})}function kx(n,a){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Me(a)})}function Zx(n,a){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Me(a)})}function Lx(n,a){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Me(a)})}function Hx(n,a){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Me(a)})}function Bx(n,a){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Me(a)})}function qx(n,a){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Me(a)})}function Gx(n,a){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Me(a)})}function Qx(n,a){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Me(a)})}function Yx(n,a){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Me(a)})}function $x(n,a){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Me(a)})}function Vx(n,a){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Me(a)})}function Kx(n,a){return new n({type:"string",format:"base64url",check)DELIM" -R"DELIM(:"string_format",abort:!1,...Me(a)})}function Xx(n,a){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Me(a)})}function Jx(n,a){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Me(a)})}function Fx(n,a){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Me(a)})}function Wx(n,a){return new n({type:"string",format:"date",check:"string_format",...Me(a)})}function Ix(n,a){return new n({type:"string",format:"time",check:"string_format",precision:null,...Me(a)})}function Px(n,a){return new n({type:"string",format:"duration",check:"string_format",...Me(a)})}function e2(n,a){return new n({type:"number",checks:[],...Me(a)})}function t2(n,a){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Me(a)})}function n2(n,a){return new n({type:"boolean",...Me(a)})}function l2(n){return new n({type:"unknown"})}function a2(n,a){return new n({type:"never",...Me(a)})}function C0(n,a){return new fy({check:"less_than",...Me(a),value:n,inclusive:!1})}function Qd(n,a){return new fy({check:"less_than",...Me(a),value:n,inclusive:!0})}function R0(n,a){return new dy({check:"greater_than",...Me(a),value:n,inclusive:!1})}function Yd(n,a){return new dy({check:"greater_than",...Me(a),value:n,inclusive:!0})}function U0(n,a){return new S_({check:"multiple_of",...Me(a),value:n})}function yy(n,a){return new x_({check:"max_length",...Me(a),maximum:n})}function _o(n,a){return new z_({check:"min_length",...Me(a),minimum:n})}function by(n,a){return new E_({check:"length_equals",...Me(a),length:n})}function i2(n,a){return new T_({check:"string_format",format:"regex",...Me(a),pattern:n})}function u2(n){return new w_({check:"string_format",format:"lowercase",...Me(n)})}function s2(n){return new M_({check:"string_format",format:"uppercase",...Me(n)})}function r2(n,a){return new A_({check:"string_format",format:"includes",...Me(a),includes:n})}function c2(n,a){return new O_({check:"string_format",format:"starts_with",...Me(a),prefix:n})}function o2(n,a){return new N_({check:"string_format",format:"ends_with",...Me(a),suffix:n})}function ys(n){return new j_({check:"overwrite",tx:n})}function f2(n){return ys(a=>a.normalize(n))}function d2(){return ys(n=>n.trim())}function h2(){return ys(n=>n.toLowerCase())}function m2(){return ys(n=>n.toUpperCase())}function p2(){return ys(n=>xS(n))}function g2(n,a,u){return new n({type:"array",element:a,...Me(u)})}function v2(n,a,u){return new n({type:"custom",check:"custom",fn:a,...Me(u)})}function y2(n,a){const u=b2(s=>(s.addIssue=c=>{if(typeof c=="string")s.issues.push(Cr(c,s.value,u._zod.def));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=u),d.continue??(d.continue=!u._zod.def.abort),s.issues.push(Cr(d))}},n(s.value,s)),a);return u}function b2(n,a){const u=new In({check:"custom",...Me(a)});return u._zod.check=n,u}function Sy(n){let a=n?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??Tr,target:a,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function _n(n,a,u={path:[],schemaPath:[]}){var s;const c=n._zod.def,d=a.seen.get(n);if(d)return d.count++,u.schemaPath.includes(n)&&(d.cycle=u.path),d.schema;const f={schema:{},count:1,cycle:void 0,path:u.path};a.seen.set(n,f);const p=n._zod.toJSONSchema?.();if(p)f.schema=p;else{const x={...u,schemaPath:[...u.schemaPath,n],path:u.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(a,f.schema,x);else{const T=f.schema,w=a.processors[c.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${c.type}`);w(n,a,T,x)}const S=n._zod.parent;S&&(f.ref||(f.ref=S),_n(S,a,x),a.seen.get(S).isParent=!0)}const g=a.metadataRegistry.get(n);return g&&Object.assign(f.schema,g),a.io==="input"&&Hn(n)&&(delete f.schema.examples,delete f.schema.default),a.io==="input"&&"_prefault"in f.schema&&((s=f.schema).default??(s.default=f.schema._prefault)),delete f.schema._prefault,a.seen.get(n).schema}function _y(n,a){const u=n.seen.get(a);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const f of n.seen.entries()){const p=n.metadataRegistry.get(f[0])?.id;if(p){const g=s.get(p);if(g&&g!==f[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(p,f[0])}}const c=f=>{const p=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const S=n.external.registry.get(f[0])?.id,T=n.external.uri??(O=>O);if(S)return{ref:T(S)};const w=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=w,{defId:w,ref:`${T("__shared")}#/${p}/${w}`}}if(f[1]===u)return{ref:"#"};const v=`#/${p}/`,x=f[1].schema.id??`__schema${n.counter++}`;return{defId:x,ref:v+x}},d=f=>{if(f[1].schema.$ref)return;const p=f[1],{ref:g,defId:v}=c(f);p.def={...p.schema},v&&(p.defId=v);const x=p.schema;for(const S in x)delete x[S];x.$ref=g};if(n.cycles==="throw")for(const f of n.seen.entries()){const p=f[1];if(p.cycle)throw new Error(`Cycle detected: #/${p.cycle?.join("/")}/ + `)}E.write("payload.value = newResult;"),E.write("return payload;");const X=E.compile();return(Q,q)=>X(w,Q,q)};let d;const f=bo,m=!wh.jitless,v=m&&NS.value,_=l.catchall;let x;n._zod.parse=(w,E)=>{x??(x=u.value);const j=w.value;return f(j)?m&&v&&E?.async===!1&&E.jitless!==!0?(d||(d=c(l.shape)),w=d(w,E),_?by([],j,w,E,x,n):w):s(w,E):(w.issues.push({expected:"object",code:"invalid_type",input:j,inst:n}),w)}});function T0(n,l,s,u){for(const d of n)if(d.issues.length===0)return l.value=d.value,l;const c=n.filter(d=>!ru(d));return c.length===1?(l.value=c[0].value,c[0]):(l.issues.push({code:"invalid_union",input:l.value,inst:s,errors:n.map(d=>d.issues.map(f=>ds(f,u,fs())))}),l)}const bx=J("$ZodUnion",(n,l)=>{kt.init(n,l),ht(n._zod,"optin",()=>l.options.some(u=>u._zod.optin==="optional")?"optional":void 0),ht(n._zod,"optout",()=>l.options.some(u=>u._zod.optout==="optional")?"optional":void 0),ht(n._zod,"values",()=>{if(l.options.every(u=>u._zod.values))return new Set(l.options.flatMap(u=>Array.from(u._zod.values)))}),ht(n._zod,"pattern",()=>{if(l.options.every(u=>u._zod.pattern)){const u=l.options.map(c=>c._zod.pattern);return new RegExp(`^(${u.map(c=>Oh(c.source)).join("|")})$`)}});const s=l.options.length===1?l.options[0]._zod.run:null;n._zod.parse=(u,c)=>{if(s)return s(u,c);let d=!1;const f=[];for(const m of l.options){const g=m._zod.run({value:u.value,issues:[]},c);if(g instanceof Promise)f.push(g),d=!0;else{if(g.issues.length===0)return g;f.push(g)}}return d?Promise.all(f).then(m=>T0(m,u,n,c)):T0(f,u,n,c)}}),Sx=J("$ZodIntersection",(n,l)=>{kt.init(n,l),n._zod.parse=(s,u)=>{const c=s.value,d=l.left._zod.run({value:c,issues:[]},u),f=l.right._zod.run({value:c,issues:[]},u);return d instanceof Promise||f instanceof Promise?Promise.all([d,f]).then(([g,v])=>w0(s,g,v)):w0(s,d,f)}});function th(n,l){if(n===l)return{valid:!0,data:n};if(n instanceof Date&&l instanceof Date&&+n==+l)return{valid:!0,data:n};if(Dr(n)&&Dr(l)){const s=Object.keys(l),u=Object.keys(n).filter(d=>s.indexOf(d)!==-1),c={...n,...l};for(const d of u){const f=th(n[d],l[d]);if(!f.valid)return{valid:!1,mergeErrorPath:[d,...f.mergeErrorPath]};c[d]=f.data}return{valid:!0,data:c}}if(Array.isArray(n)&&Array.isArray(l)){if(n.length!==l.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let u=0;um.l&&m.r).map(([m])=>m);if(d.length&&c&&n.issues.push({...c,keys:d}),ru(n))return n;const f=th(l.value,s.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return n.value=f.data,n}const _x=J("$ZodEnum",(n,l)=>{kt.init(n,l);const s=ly(l.entries),u=new Set(s);n._zod.values=u,n._zod.pattern=new RegExp(`^(${s.filter(c=>jS.has(typeof c)).map(c=>typeof c=="string"?du(c):c.toString()).join("|")})$`),n._zod.parse=(c,d)=>{const f=c.value;return u.has(f)||c.issues.push({code:"invalid_value",values:s,input:f,inst:n}),c}}),xx=J("$ZodLiteral",(n,l)=>{if(kt.init(n,l),l.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(l.values);n._zod.values=s,n._zod.pattern=new RegExp(`^(${l.values.map(u=>typeof u=="string"?du(u):u?du(u.toString()):String(u)).join("|")})$`),n._zod.parse=(u,c)=>{const d=u.value;return s.has(d)||u.issues.push({code:"invalid_value",values:l.values,input:d,inst:n}),u}}),zx=J("$ZodTransform",(n,l)=>{kt.init(n,l),n._zod.optin="optional",n._zod.parse=(s,u)=>{if(u.direction==="backward")throw new ny(n.constructor.name);const c=l.transform(s.value,s);if(u.async)return(c instanceof Promise?c:Promise.resolve(c)).then(f=>(s.value=f,s.fallback=!0,s));if(c instanceof Promise)throw new cu;return s.value=c,s.fallback=!0,s}});function A0(n,l){return l===void 0&&(n.issues.length||n.fallback)?{issues:[],value:void 0}:n}const Sy=J("$ZodOptional",(n,l)=>{kt.init(n,l),n._zod.optin="optional",n._zod.optout="optional",ht(n._zod,"values",()=>l.innerType._zod.values?new Set([...l.innerType._zod.values,void 0]):void 0),ht(n._zod,"pattern",()=>{const s=l.innerType._zod.pattern;return s?new RegExp(`^(${Oh(s.source)})?$`):void 0}),n._zod.parse=(s,u)=>{if(l.innerType._zod.optin==="optional"){const c=s.value,d=l.innerType._zod.run(s,u);return d instanceof Promise?d.then(f=>A0(f,c)):A0(d,c)}return s.value===void 0?s:l.innerType._zod.run(s,u)}}),Ex=J("$ZodExactOptional",(n,l)=>{Sy.init(n,l),ht(n._zod,"values",()=>l.innerType._zod.values),ht(n._zod,"pattern",()=>l.innerType._zod.pattern),n._zod.parse=(s,u)=>l.innerType._zod.run(s,u)}),Tx=J("$ZodNullable",(n,l)=>{kt.init(n,l),ht(n._zod,"optin",()=>l.innerType._zod.optin),ht(n._zod,"optout",()=>l.innerType._zod.optout),ht(n._zod,"pattern",()=>{const s=l.innerType._zod.pattern;return s?new RegExp(`^(${Oh(s.source)}|null)$`):void 0}),ht(n._zod,"values",()=>l.innerType._zod.values?new Set([...l.innerType._zod.values,null]):void 0),n._zod.parse=(s,u)=>s.value===null?s:l.innerType._zod.run(s,u)}),wx=J("$ZodDefault",(n,l)=>{kt.init(n,l),n._zod.optin="optional",ht(n._zod,"values",()=>l.innerType._zod.values),n._zod.parse=(s,u)=>{if(u.direction==="backward")return l.innerType._zod.run(s,u);if(s.value===void 0)return s.value=l.defaultValue,s;const c=l.innerType._zod.run(s,u);return c instanceof Promise?c.then(d=>M0(d,l)):M0(c,l)}});function M0(n,l){return n.value===void 0&&(n.value=l.defaultValue),n}const Ax=J("$ZodPrefault",(n,l)=>{kt.init(n,l),n._zod.optin="optional",ht(n._zod,"values",()=>l.innerType._zod.values),n._zod.parse=(s,u)=>(u.direction==="backward"||s.value===void 0&&(s.value=l.defaultValue),l.innerType._zod.run(s,u))}),Mx=J("$ZodNonOptional",(n,l)=>{kt.init(n,l),ht(n._zod,"values",()=>{const s=l.innerType._zod.values;return s?new Set([...s].filter(u=>u!==void 0)):void 0}),n._zod.parse=(s,u)=>{const c=l.innerType._zod.run(s,u);return c instanceof Promise?c.then(d=>O0(d,n)):O0(c,n)}});function O0(n,l){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:l}),n}const Ox=J("$ZodCatch",(n,l)=>{kt.init(n,l),n._zod.optin="optional",ht(n._zod,"optout",()=>l.innerType._zod.optout),ht(n._zod,"values",()=>l.innerType._zod.values),n._zod.parse=(s,u)=>{if(u.direction==="backward")return l.innerType._zod.run(s,u);const c=l.innerType._zod.run(s,u);return c instanceof Promise?c.then(d=>(s.value=d.value,d.issues.length&&(s.value=l.catchValue({...s,error:{issues:d.issues.map(f=>ds(f,u,fs()))},input:s.value}),s.issues=[],s.fallback=!0),s)):(s.value=c.value,c.issues.length&&(s.value=l.catchValue({...s,error:{issues:c.issues.map(d=>ds(d,u,fs()))},input:s.value}),s.issues=[],s.fallback=!0),s)}}),Nx=J("$ZodPipe",(n,l)=>{kt.init(n,l),ht(n._zod,"values",()=>l.in._zod.values),ht(n._zod,"optin",()=>l.in._zod.optin),ht(n._zod,"optout",()=>l.out._zod.optout),ht(n._zod,"propValues",()=>l.in._zod.propValues),n._zod.parse=(s,u)=>{if(u.direction==="backward"){const d=l.out._zod.run(s,u);return d instanceof Promise?d.then(f=>uo(f,l.in,u)):uo(d,l.in,u)}const c=l.in._zod.run(s,u);return c instanceof Promise?c.then(d=>uo(d,l.out,u)):uo(c,l.out,u)}});function uo(n,l,s){return n.issues.length?(n.aborted=!0,n):l._zod.run({value:n.value,issues:n.issues,fallback:n.fallback},s)}const jx=J("$ZodReadonly",(n,l)=>{kt.init(n,l),ht(n._zod,"propValues",()=>l.innerType._zod.propValues),ht(n._zod,"values",()=>l.innerType._zod.values),ht(n._zod,"optin",()=>l.innerType?._zod?.optin),ht(n._zod,"optout",()=>l.innerType?._zod?.optout),n._zod.parse=(s,u)=>{if(u.direction==="backward")return l.innerType._zod.run(s,u);const c=l.innerType._zod.run(s,u);return c instanceof Promise?c.then(N0):N0(c)}});function N0(n){return n.value=Object.freeze(n.value),n}const Dx=J("$ZodCustom",(n,l)=>{Pn.init(n,l),kt.init(n,l),n._zod.parse=(s,u)=>s,n._zod.check=s=>{const u=s.value,c=l.fn(u);if(c instanceof Promise)return c.then(d=>j0(d,s,u,n));j0(c,s,u,n)}});function j0(n,l,s,u){if(!n){const c={code:"custom",input:s,inst:u,path:[...u._zod.def.path??[]],continue:!u._zod.def.abort};u._zod.def.params&&(c.params=u._zod.def.params),l.issues.push(Cr(c))}}var D0;class Cx{constructor(){this._map=new WeakMap,this._idmap=new Map}add(l,...s){const u=s[0];return this._map.set(l,u),u&&typeof u=="object"&&"id"in u&&this._idmap.set(u.id,l),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(l){const s=this._map.get(l);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(l),this}get(l){const s=l._zod.parent;if(s){const u={...this.get(s)??{}};delete u.id;const c={...u,...this._map.get(l)};return Object.keys(c).length?c:void 0}return this._map.get(l)}has(l){return this._map.has(l)}}function Rx(){return new Cx}(D0=globalThis).__zod_globalRegistry??(D0.__zod_globalRegistry=Rx());const Tr=globalThis.__zod_globalRegistry;function Ux(n,l){return new n({type:"string",...Ae(l)})}function kx(n,l){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Ae(l)})}function C0(n,l){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(l)})}function Zx(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(l)})}function Lx(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(l)})}function Hx(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(l)})}function Bx(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(l)})}function qx(n,l){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Ae(l)})}function Gx(n,l){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(l)})}function Yx(n,l){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(l)})}function $x(n,l){return new n({type:"string",format:"cuid",check:"string_format",a)DELIM" +R"DELIM(bort:!1,...Ae(l)})}function Qx(n,l){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(l)})}function Vx(n,l){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(l)})}function Kx(n,l){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(l)})}function Xx(n,l){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(l)})}function Jx(n,l){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(l)})}function Fx(n,l){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(l)})}function Wx(n,l){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(l)})}function Ix(n,l){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(l)})}function Px(n,l){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(l)})}function e2(n,l){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(l)})}function t2(n,l){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(l)})}function n2(n,l){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(l)})}function l2(n,l){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(l)})}function a2(n,l){return new n({type:"string",format:"date",check:"string_format",...Ae(l)})}function i2(n,l){return new n({type:"string",format:"time",check:"string_format",precision:null,...Ae(l)})}function s2(n,l){return new n({type:"string",format:"duration",check:"string_format",...Ae(l)})}function u2(n,l){return new n({type:"number",checks:[],...Ae(l)})}function r2(n,l){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(l)})}function c2(n,l){return new n({type:"boolean",...Ae(l)})}function o2(n){return new n({type:"unknown"})}function f2(n,l){return new n({type:"never",...Ae(l)})}function R0(n,l){return new my({check:"less_than",...Ae(l),value:n,inclusive:!1})}function Yd(n,l){return new my({check:"less_than",...Ae(l),value:n,inclusive:!0})}function U0(n,l){return new py({check:"greater_than",...Ae(l),value:n,inclusive:!1})}function $d(n,l){return new py({check:"greater_than",...Ae(l),value:n,inclusive:!0})}function k0(n,l){return new A_({check:"multiple_of",...Ae(l),value:n})}function _y(n,l){return new O_({check:"max_length",...Ae(l),maximum:n})}function _o(n,l){return new N_({check:"min_length",...Ae(l),minimum:n})}function xy(n,l){return new j_({check:"length_equals",...Ae(l),length:n})}function d2(n,l){return new D_({check:"string_format",format:"regex",...Ae(l),pattern:n})}function h2(n){return new C_({check:"string_format",format:"lowercase",...Ae(n)})}function m2(n){return new R_({check:"string_format",format:"uppercase",...Ae(n)})}function p2(n,l){return new U_({check:"string_format",format:"includes",...Ae(l),includes:n})}function g2(n,l){return new k_({check:"string_format",format:"starts_with",...Ae(l),prefix:n})}function v2(n,l){return new Z_({check:"string_format",format:"ends_with",...Ae(l),suffix:n})}function yu(n){return new L_({check:"overwrite",tx:n})}function y2(n){return yu(l=>l.normalize(n))}function b2(){return yu(n=>n.trim())}function S2(){return yu(n=>n.toLowerCase())}function _2(){return yu(n=>n.toUpperCase())}function x2(){return yu(n=>OS(n))}function z2(n,l,s){return new n({type:"array",element:l,...Ae(s)})}function E2(n,l,s){return new n({type:"custom",check:"custom",fn:l,...Ae(s)})}function T2(n,l){const s=w2(u=>(u.addIssue=c=>{if(typeof c=="string")u.issues.push(Cr(c,u.value,s._zod.def));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=u.value),d.inst??(d.inst=s),d.continue??(d.continue=!s._zod.def.abort),u.issues.push(Cr(d))}},n(u.value,u)),l);return s}function w2(n,l){const s=new Pn({check:"custom",...Ae(l)});return s._zod.check=n,s}function zy(n){let l=n?.target??"draft-2020-12";return l==="draft-4"&&(l="draft-04"),l==="draft-7"&&(l="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??Tr,target:l,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function _n(n,l,s={path:[],schemaPath:[]}){var u;const c=n._zod.def,d=l.seen.get(n);if(d)return d.count++,s.schemaPath.includes(n)&&(d.cycle=s.path),d.schema;const f={schema:{},count:1,cycle:void 0,path:s.path};l.seen.set(n,f);const m=n._zod.toJSONSchema?.();if(m)f.schema=m;else{const _={...s,schemaPath:[...s.schemaPath,n],path:s.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(l,f.schema,_);else{const w=f.schema,E=l.processors[c.type];if(!E)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${c.type}`);E(n,l,w,_)}const x=n._zod.parent;x&&(f.ref||(f.ref=x),_n(x,l,_),l.seen.get(x).isParent=!0)}const g=l.metadataRegistry.get(n);return g&&Object.assign(f.schema,g),l.io==="input"&&Hn(n)&&(delete f.schema.examples,delete f.schema.default),l.io==="input"&&"_prefault"in f.schema&&((u=f.schema).default??(u.default=f.schema._prefault)),delete f.schema._prefault,l.seen.get(n).schema}function Ey(n,l){const s=n.seen.get(l);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const u=new Map;for(const f of n.seen.entries()){const m=n.metadataRegistry.get(f[0])?.id;if(m){const g=u.get(m);if(g&&g!==f[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);u.set(m,f[0])}}const c=f=>{const m=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=n.external.registry.get(f[0])?.id,w=n.external.uri??(j=>j);if(x)return{ref:w(x)};const E=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=E,{defId:E,ref:`${w("__shared")}#/${m}/${E}`}}if(f[1]===s)return{ref:"#"};const v=`#/${m}/`,_=f[1].schema.id??`__schema${n.counter++}`;return{defId:_,ref:v+_}},d=f=>{if(f[1].schema.$ref)return;const m=f[1],{ref:g,defId:v}=c(f);m.def={...m.schema},v&&(m.defId=v);const _=m.schema;for(const x in _)delete _[x];_.$ref=g};if(n.cycles==="throw")for(const f of n.seen.entries()){const m=f[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of n.seen.entries()){const p=f[1];if(a===f[0]){d(f);continue}if(n.external){const v=n.external.registry.get(f[0])?.id;if(a!==f[0]&&v){d(f);continue}}if(n.metadataRegistry.get(f[0])?.id){d(f);continue}if(p.cycle){d(f);continue}if(p.count>1&&n.reused==="ref"){d(f);continue}}}function xy(n,a){const u=n.seen.get(a);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=p=>{const g=n.seen.get(p);if(g.ref===null)return;const v=g.def??g.schema,x={...v},S=g.ref;if(g.ref=null,S){s(S);const w=n.seen.get(S),O=w.schema;if(O.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(O)):Object.assign(v,O),Object.assign(v,x),p._zod.parent===S)for(const W in v)W==="$ref"||W==="allOf"||W in x||delete v[W];if(O.$ref&&w.def)for(const W in v)W==="$ref"||W==="allOf"||W in w.def&&JSON.stringify(v[W])===JSON.stringify(w.def[W])&&delete v[W]}const T=p._zod.parent;if(T&&T!==S){s(T);const w=n.seen.get(T);if(w?.schema.$ref&&(v.$ref=w.schema.$ref,w.def))for(const O in v)O==="$ref"||O==="allOf"||O in w.def&&JSON.stringify(v[O])===JSON.stringify(w.def[O])&&delete v[O]}n.override({zodSchema:p,jsonSchema:v,path:g.path??[]})};for(const p of[...n.seen.entries()].reverse())s(p[0]);const c={};if(n.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?c.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?c.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const p=n.external.registry.get(a)?.id;if(!p)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(p)}Object.assign(c,u.def??u.schema);const d=n.metadataRegistry.get(a)?.id;d!==void 0&&c.id===d&&delete c.id;const f=n.external?.defs??{};for(const p of n.seen.entries()){const g=p[1];g.def&&g.defId&&(g.def.id===g.defId&&delete g.def.id,f[g.defId]=g.def)}n.external||Object.keys(f).length>0&&(n.target==="draft-2020-12"?c.$defs=f:c.definitions=f);try{const p=JSON.parse(JSON.stringify(c));return Object.defineProperty(p,"~standard",{value:{...a["~standard"],jsonSchema:{input:xo(a,"input",n.processors),output:xo(a,"output",n.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function Hn(n,a){const u=a??{seen:new Set};if(u.seen.has(n))return!1;u.seen.add(n);const s=n._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return Hn(s.element,u);if(s.type==="set")return Hn(s.valueType,u);if(s.type==="lazy")return Hn(s.getter(),u);if(s.type==="pr)DELIM" -R"DELIM(omise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return Hn(s.innerType,u);if(s.type==="intersection")return Hn(s.left,u)||Hn(s.right,u);if(s.type==="record"||s.type==="map")return Hn(s.keyType,u)||Hn(s.valueType,u);if(s.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:Hn(s.in,u)||Hn(s.out,u);if(s.type==="object"){for(const c in s.shape)if(Hn(s.shape[c],u))return!0;return!1}if(s.type==="union"){for(const c of s.options)if(Hn(c,u))return!0;return!1}if(s.type==="tuple"){for(const c of s.items)if(Hn(c,u))return!0;return!!(s.rest&&Hn(s.rest,u))}return!1}const S2=(n,a={})=>u=>{const s=Sy({...u,processors:a});return _n(n,s),_y(s,n),xy(s,n)},xo=(n,a,u={})=>s=>{const{libraryOptions:c,target:d}=s??{},f=Sy({...c??{},target:d,io:a,processors:u});return _n(n,f),_y(f,n),xy(f,n)},_2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},x2=(n,a,u,s)=>{const c=u;c.type="string";const{minimum:d,maximum:f,format:p,patterns:g,contentEncoding:v}=n._zod.bag;if(typeof d=="number"&&(c.minLength=d),typeof f=="number"&&(c.maxLength=f),p&&(c.format=_2[p]??p,c.format===""&&delete c.format,p==="time"&&delete c.format),v&&(c.contentEncoding=v),g&&g.size>0){const x=[...g];x.length===1?c.pattern=x[0].source:x.length>1&&(c.allOf=[...x.map(S=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},z2=(n,a,u,s)=>{const c=u,{minimum:d,maximum:f,format:p,multipleOf:g,exclusiveMaximum:v,exclusiveMinimum:x}=n._zod.bag;typeof p=="string"&&p.includes("int")?c.type="integer":c.type="number";const S=typeof x=="number"&&x>=(d??Number.NEGATIVE_INFINITY),T=typeof v=="number"&&v<=(f??Number.POSITIVE_INFINITY),w=a.target==="draft-04"||a.target==="openapi-3.0";S?w?(c.minimum=x,c.exclusiveMinimum=!0):c.exclusiveMinimum=x:typeof d=="number"&&(c.minimum=d),T?w?(c.maximum=v,c.exclusiveMaximum=!0):c.exclusiveMaximum=v:typeof f=="number"&&(c.maximum=f),typeof g=="number"&&(c.multipleOf=g)},E2=(n,a,u,s)=>{u.type="boolean"},T2=(n,a,u,s)=>{u.not={}},w2=(n,a,u,s)=>{},M2=(n,a,u,s)=>{const c=n._zod.def,d=ey(c.entries);d.every(f=>typeof f=="number")&&(u.type="number"),d.every(f=>typeof f=="string")&&(u.type="string"),u.enum=d},A2=(n,a,u,s)=>{const c=n._zod.def,d=[];for(const f of c.values)if(f===void 0){if(a.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof f=="bigint"){if(a.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");d.push(Number(f))}else d.push(f);if(d.length!==0)if(d.length===1){const f=d[0];u.type=f===null?"null":typeof f,a.target==="draft-04"||a.target==="openapi-3.0"?u.enum=[f]:u.const=f}else d.every(f=>typeof f=="number")&&(u.type="number"),d.every(f=>typeof f=="string")&&(u.type="string"),d.every(f=>typeof f=="boolean")&&(u.type="boolean"),d.every(f=>f===null)&&(u.type="null"),u.enum=d},O2=(n,a,u,s)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},N2=(n,a,u,s)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},j2=(n,a,u,s)=>{const c=u,d=n._zod.def,{minimum:f,maximum:p}=n._zod.bag;typeof f=="number"&&(c.minItems=f),typeof p=="number"&&(c.maxItems=p),c.type="array",c.items=_n(d.element,a,{...s,path:[...s.path,"items"]})},D2=(n,a,u,s)=>{const c=u,d=n._zod.def;c.type="object",c.properties={};const f=d.shape;for(const v in f)c.properties[v]=_n(f[v],a,{...s,path:[...s.path,"properties",v]});const p=new Set(Object.keys(f)),g=new Set([...p].filter(v=>{const x=d.shape[v]._zod;return a.io==="input"?x.optin===void 0:x.optout===void 0}));g.size>0&&(c.required=Array.from(g)),d.catchall?._zod.def.type==="never"?c.additionalProperties=!1:d.catchall?d.catchall&&(c.additionalProperties=_n(d.catchall,a,{...s,path:[...s.path,"additionalProperties"]})):a.io==="output"&&(c.additionalProperties=!1)},C2=(n,a,u,s)=>{const c=n._zod.def,d=c.inclusive===!1,f=c.options.map((p,g)=>_n(p,a,{...s,path:[...s.path,d?"oneOf":"anyOf",g]}));d?u.oneOf=f:u.anyOf=f},R2=(n,a,u,s)=>{const c=n._zod.def,d=_n(c.left,a,{...s,path:[...s.path,"allOf",0]}),f=_n(c.right,a,{...s,path:[...s.path,"allOf",1]}),p=v=>"allOf"in v&&Object.keys(v).length===1,g=[...p(d)?d.allOf:[d],...p(f)?f.allOf:[f]];u.allOf=g},U2=(n,a,u,s)=>{const c=n._zod.def,d=_n(c.innerType,a,s),f=a.seen.get(n);a.target==="openapi-3.0"?(f.ref=c.innerType,u.nullable=!0):u.anyOf=[d,{type:"null"}]},k2=(n,a,u,s)=>{const c=n._zod.def;_n(c.innerType,a,s);const d=a.seen.get(n);d.ref=c.innerType},Z2=(n,a,u,s)=>{const c=n._zod.def;_n(c.innerType,a,s);const d=a.seen.get(n);d.ref=c.innerType,u.default=JSON.parse(JSON.stringify(c.defaultValue))},L2=(n,a,u,s)=>{const c=n._zod.def;_n(c.innerType,a,s);const d=a.seen.get(n);d.ref=c.innerType,a.io==="input"&&(u._prefault=JSON.parse(JSON.stringify(c.defaultValue)))},H2=(n,a,u,s)=>{const c=n._zod.def;_n(c.innerType,a,s);const d=a.seen.get(n);d.ref=c.innerType;let f;try{f=c.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}u.default=f},B2=(n,a,u,s)=>{const c=n._zod.def,d=c.in._zod.traits.has("$ZodTransform"),f=a.io==="input"?d?c.out:c.in:c.out;_n(f,a,s);const p=a.seen.get(n);p.ref=f},q2=(n,a,u,s)=>{const c=n._zod.def;_n(c.innerType,a,s);const d=a.seen.get(n);d.ref=c.innerType,u.readOnly=!0},zy=(n,a,u,s)=>{const c=n._zod.def;_n(c.innerType,a,s);const d=a.seen.get(n);d.ref=c.innerType},G2=X("ZodISODateTime",(n,a)=>{$_.init(n,a),Ot.init(n,a)});function Q2(n){return Fx(G2,n)}const Y2=X("ZodISODate",(n,a)=>{V_.init(n,a),Ot.init(n,a)});function $2(n){return Wx(Y2,n)}const V2=X("ZodISOTime",(n,a)=>{K_.init(n,a),Ot.init(n,a)});function K2(n){return Ix(V2,n)}const X2=X("ZodISODuration",(n,a)=>{X_.init(n,a),Ot.init(n,a)});function J2(n){return Px(X2,n)}const F2=(n,a)=>{iy.init(n,a),n.name="ZodError",Object.defineProperties(n,{format:{value:u=>kS(n,u)},flatten:{value:u=>US(n,u)},addIssue:{value:u=>{n.issues.push(u),n.message=JSON.stringify(n.issues,Pd,2)}},addIssues:{value:u=>{n.issues.push(...u),n.message=JSON.stringify(n.issues,Pd,2)}},isEmpty:{get(){return n.issues.length===0}}})},Ol=X("ZodError",F2,{Parent:Error}),W2=Nh(Ol),I2=jh(Ol),P2=Oo(Ol),ez=No(Ol),tz=HS(Ol),nz=BS(Ol),lz=qS(Ol),az=GS(Ol),iz=QS(Ol),uz=YS(Ol),sz=$S(Ol),rz=VS(Ol),k0=new WeakMap;function Lr(n,a,u){const s=Object.getPrototypeOf(n);let c=k0.get(s);if(c||(c=new Set,k0.set(s,c)),!c.has(a)){c.add(a);for(const d in u){const f=u[d];Object.defineProperty(s,d,{configurable:!0,enumerable:!1,get(){const p=f.bind(this);return Object.defineProperty(this,d,{configurable:!0,writable:!0,enumerable:!0,value:p}),p},set(p){Object.defineProperty(this,d,{configurable:!0,writable:!0,enumerable:!0,value:p})}})}}}const Zt=X("ZodType",(n,a)=>(kt.init(n,a),Object.assign(n["~standard"],{jsonSchema:{input:xo(n,"input"),output:xo(n,"output")}}),n.toJSONSchema=S2(n,{}),n.def=a,n.type=a.type,Object.defineProperty(n,"_def",{value:a}),n.parse=(u,s)=>W2(n,u,s,{callee:n.parse}),n.safeParse=(u,s)=>P2(n,u,s),n.parseAsync=async(u,s)=>I2(n,u,s,{callee:n.parseAsync}),n.safeParseAsync=async(u,s)=>ez(n,u,s),n.spa=n.safeParseAsync,n.encode=(u,s)=>tz(n,u,s),n.decode=(u,s)=>nz(n,u,s),n.encodeAsync=async(u,s)=>lz(n,u,s),n.decodeAsync=async(u,s)=>az(n,u,s),n.safeEncode=(u,s)=>iz(n,u,s),n.safeDecode=(u,s)=>uz(n,u,s),n.safeEncodeAsync=async(u,s)=>sz(n,u,s),n.safeDecodeAsync=async(u,s)=>rz(n,u,s),Lr(n,"ZodType",{check(...u){const s=this.def;return this.clone(Ai(s,{checks:[...s.checks??[],...u.map(c=>typeof c=="function"?{_zod:{check:c,def:{check:"custom"},onattach:[]}}:c)]}),{parent:!0})},with(...u){return this.check(...u)},clone(u,s){return Oi(this,u,s)},brand(){return this},register(u,s){return u.add(this,s),this},refine(u,s){return this.check(eE(u,s))},superRefine(u,s){return this.check(tE(u,s))},overwrite(u){return this.check(ys(u))},optional(){return B0(this)},exactOptional(){return qz(this)},n)DELIM" -R"DELIM(ullable(){return q0(this)},nullish(){return B0(q0(this))},nonoptional(u){return Kz(this,u)},array(){return Ch(this)},or(u){return Rh([this,u])},and(u){return kz(this,u)},transform(u){return G0(this,Hz(u))},default(u){return Yz(this,u)},prefault(u){return Vz(this,u)},catch(u){return Jz(this,u)},pipe(u){return G0(this,u)},readonly(){return Iz(this)},describe(u){const s=this.clone();return Tr.add(s,{description:u}),s},meta(...u){if(u.length===0)return Tr.get(this);const s=this.clone();return Tr.add(s,u[0]),s},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(u){return u(this)}}),Object.defineProperty(n,"description",{get(){return Tr.get(n)?.description},configurable:!0}),n)),Ey=X("_ZodString",(n,a)=>{Dh.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(s,c,d)=>x2(n,s,c);const u=n._zod.bag;n.format=u.format??null,n.minLength=u.minimum??null,n.maxLength=u.maximum??null,Lr(n,"_ZodString",{regex(...s){return this.check(i2(...s))},includes(...s){return this.check(r2(...s))},startsWith(...s){return this.check(c2(...s))},endsWith(...s){return this.check(o2(...s))},min(...s){return this.check(_o(...s))},max(...s){return this.check(yy(...s))},length(...s){return this.check(by(...s))},nonempty(...s){return this.check(_o(1,...s))},lowercase(s){return this.check(u2(s))},uppercase(s){return this.check(s2(s))},trim(){return this.check(d2())},normalize(...s){return this.check(f2(...s))},toLowerCase(){return this.check(h2())},toUpperCase(){return this.check(m2())},slugify(){return this.check(p2())}})}),cz=X("ZodString",(n,a)=>{Dh.init(n,a),Ey.init(n,a),n.email=u=>n.check(Ox(oz,u)),n.url=u=>n.check(Rx(fz,u)),n.jwt=u=>n.check(Jx(wz,u)),n.emoji=u=>n.check(Ux(dz,u)),n.guid=u=>n.check(D0(Z0,u)),n.uuid=u=>n.check(Nx(ro,u)),n.uuidv4=u=>n.check(jx(ro,u)),n.uuidv6=u=>n.check(Dx(ro,u)),n.uuidv7=u=>n.check(Cx(ro,u)),n.nanoid=u=>n.check(kx(hz,u)),n.guid=u=>n.check(D0(Z0,u)),n.cuid=u=>n.check(Zx(mz,u)),n.cuid2=u=>n.check(Lx(pz,u)),n.ulid=u=>n.check(Hx(gz,u)),n.base64=u=>n.check(Vx(zz,u)),n.base64url=u=>n.check(Kx(Ez,u)),n.xid=u=>n.check(Bx(vz,u)),n.ksuid=u=>n.check(qx(yz,u)),n.ipv4=u=>n.check(Gx(bz,u)),n.ipv6=u=>n.check(Qx(Sz,u)),n.cidrv4=u=>n.check(Yx(_z,u)),n.cidrv6=u=>n.check($x(xz,u)),n.e164=u=>n.check(Xx(Tz,u)),n.datetime=u=>n.check(Q2(u)),n.date=u=>n.check($2(u)),n.time=u=>n.check(K2(u)),n.duration=u=>n.check(J2(u))});function su(n){return Ax(cz,n)}const Ot=X("ZodStringFormat",(n,a)=>{wt.init(n,a),Ey.init(n,a)}),oz=X("ZodEmail",(n,a)=>{k_.init(n,a),Ot.init(n,a)}),Z0=X("ZodGUID",(n,a)=>{R_.init(n,a),Ot.init(n,a)}),ro=X("ZodUUID",(n,a)=>{U_.init(n,a),Ot.init(n,a)}),fz=X("ZodURL",(n,a)=>{Z_.init(n,a),Ot.init(n,a)}),dz=X("ZodEmoji",(n,a)=>{L_.init(n,a),Ot.init(n,a)}),hz=X("ZodNanoID",(n,a)=>{H_.init(n,a),Ot.init(n,a)}),mz=X("ZodCUID",(n,a)=>{B_.init(n,a),Ot.init(n,a)}),pz=X("ZodCUID2",(n,a)=>{q_.init(n,a),Ot.init(n,a)}),gz=X("ZodULID",(n,a)=>{G_.init(n,a),Ot.init(n,a)}),vz=X("ZodXID",(n,a)=>{Q_.init(n,a),Ot.init(n,a)}),yz=X("ZodKSUID",(n,a)=>{Y_.init(n,a),Ot.init(n,a)}),bz=X("ZodIPv4",(n,a)=>{J_.init(n,a),Ot.init(n,a)}),Sz=X("ZodIPv6",(n,a)=>{F_.init(n,a),Ot.init(n,a)}),_z=X("ZodCIDRv4",(n,a)=>{W_.init(n,a),Ot.init(n,a)}),xz=X("ZodCIDRv6",(n,a)=>{I_.init(n,a),Ot.init(n,a)}),zz=X("ZodBase64",(n,a)=>{P_.init(n,a),Ot.init(n,a)}),Ez=X("ZodBase64URL",(n,a)=>{tx.init(n,a),Ot.init(n,a)}),Tz=X("ZodE164",(n,a)=>{nx.init(n,a),Ot.init(n,a)}),wz=X("ZodJWT",(n,a)=>{ax.init(n,a),Ot.init(n,a)}),Ty=X("ZodNumber",(n,a)=>{my.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(s,c,d)=>z2(n,s,c),Lr(n,"ZodNumber",{gt(s,c){return this.check(R0(s,c))},gte(s,c){return this.check(Yd(s,c))},min(s,c){return this.check(Yd(s,c))},lt(s,c){return this.check(C0(s,c))},lte(s,c){return this.check(Qd(s,c))},max(s,c){return this.check(Qd(s,c))},int(s){return this.check(L0(s))},safe(s){return this.check(L0(s))},positive(s){return this.check(R0(0,s))},nonnegative(s){return this.check(Yd(0,s))},negative(s){return this.check(C0(0,s))},nonpositive(s){return this.check(Qd(0,s))},multipleOf(s,c){return this.check(U0(s,c))},step(s,c){return this.check(U0(s,c))},finite(){return this}});const u=n._zod.bag;n.minValue=Math.max(u.minimum??Number.NEGATIVE_INFINITY,u.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(u.maximum??Number.POSITIVE_INFINITY,u.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(u.format??"").includes("int")||Number.isSafeInteger(u.multipleOf??.5),n.isFinite=!0,n.format=u.format??null});function Ti(n){return e2(Ty,n)}const Mz=X("ZodNumberFormat",(n,a)=>{ix.init(n,a),Ty.init(n,a)});function L0(n){return t2(Mz,n)}const Az=X("ZodBoolean",(n,a)=>{ux.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>E2(n,u,s)});function ls(n){return n2(Az,n)}const Oz=X("ZodUnknown",(n,a)=>{sx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>w2()});function H0(){return l2(Oz)}const Nz=X("ZodNever",(n,a)=>{rx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>T2(n,u,s)});function jz(n){return a2(Nz,n)}const Dz=X("ZodArray",(n,a)=>{cx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>j2(n,u,s,c),n.element=a.element,Lr(n,"ZodArray",{min(u,s){return this.check(_o(u,s))},nonempty(u){return this.check(_o(1,u))},max(u,s){return this.check(yy(u,s))},length(u,s){return this.check(by(u,s))},unwrap(){return this.element}})});function Ch(n,a){return g2(Dz,n,a)}const Cz=X("ZodObject",(n,a)=>{fx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>D2(n,u,s,c),ht(n,"shape",()=>a.shape),Lr(n,"ZodObject",{keyof(){return Uh(Object.keys(this._zod.def.shape))},catchall(u){return this.clone({...this._zod.def,catchall:u})},passthrough(){return this.clone({...this._zod.def,catchall:H0()})},loose(){return this.clone({...this._zod.def,catchall:H0()})},strict(){return this.clone({...this._zod.def,catchall:jz()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(u){return OS(this,u)},safeExtend(u){return NS(this,u)},merge(u){return jS(this,u)},pick(u){return MS(this,u)},omit(u){return AS(this,u)},partial(...u){return DS(wy,this,u[0])},required(...u){return CS(My,this,u[0])}})});function pu(n,a){const u={type:"object",shape:n??{},...Me(a)};return new Cz(u)}const Rz=X("ZodUnion",(n,a)=>{dx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>C2(n,u,s,c),n.options=a.options});function Rh(n,a){return new Rz({type:"union",options:n,...Me(a)})}const Uz=X("ZodIntersection",(n,a)=>{hx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>R2(n,u,s,c)});function kz(n,a){return new Uz({type:"intersection",left:n,right:a})}const th=X("ZodEnum",(n,a)=>{mx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(s,c,d)=>M2(n,s,c),n.enum=a.entries,n.options=Object.values(a.entries);const u=new Set(Object.keys(a.entries));n.extract=(s,c)=>{const d={};for(const f of s)if(u.has(f))d[f]=a.entries[f];else throw new Error(`Key ${f} not found in enum`);return new th({...a,checks:[],...Me(c),entries:d})},n.exclude=(s,c)=>{const d={...a.entries};for(const f of s)if(u.has(f))delete d[f];else throw new Error(`Key ${f} not found in enum`);return new th({...a,checks:[],...Me(c),entries:d})}});function Uh(n,a){const u=Array.isArray(n)?Object.fromEntries(n.map(s=>[s,s])):n;return new th({type:"enum",entries:u,...Me(a)})}const Zz=X("ZodLiteral",(n,a)=>{px.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>A2(n,u,s),n.values=new Set(a.values),Object.defineProperty(n,"value",{get(){if(a.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return a.values[0]}})});function go(n,a){return new Zz({type:"literal",values:Array.isArray(n)?n:[n],...Me(a)})}const Lz=X("ZodTransform",(n,a)=>{gx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>N2(n,u),n._zod.parse=(u,s)=>{if(s.direction==="backward")throw new Pv(n.constructor.name);u.addIssue=d=>{if(typeof d=="string")u.issues.push(Cr(d,u.value,a));else{const f=d;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=u.value),f.in)DELIM" -R"DELIM(st??(f.inst=n),u.issues.push(Cr(f))}};const c=a.transform(u.value,u);return c instanceof Promise?c.then(d=>(u.value=d,u.fallback=!0,u)):(u.value=c,u.fallback=!0,u)}});function Hz(n){return new Lz({type:"transform",transform:n})}const wy=X("ZodOptional",(n,a)=>{vy.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>zy(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function B0(n){return new wy({type:"optional",innerType:n})}const Bz=X("ZodExactOptional",(n,a)=>{vx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>zy(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function qz(n){return new Bz({type:"optional",innerType:n})}const Gz=X("ZodNullable",(n,a)=>{yx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>U2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function q0(n){return new Gz({type:"nullable",innerType:n})}const Qz=X("ZodDefault",(n,a)=>{bx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>Z2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function Yz(n,a){return new Qz({type:"default",innerType:n,get defaultValue(){return typeof a=="function"?a():ny(a)}})}const $z=X("ZodPrefault",(n,a)=>{Sx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>L2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function Vz(n,a){return new $z({type:"prefault",innerType:n,get defaultValue(){return typeof a=="function"?a():ny(a)}})}const My=X("ZodNonOptional",(n,a)=>{_x.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>k2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function Kz(n,a){return new My({type:"nonoptional",innerType:n,...Me(a)})}const Xz=X("ZodCatch",(n,a)=>{xx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>H2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function Jz(n,a){return new Xz({type:"catch",innerType:n,catchValue:typeof a=="function"?a:()=>a})}const Fz=X("ZodPipe",(n,a)=>{zx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>B2(n,u,s,c),n.in=a.in,n.out=a.out});function G0(n,a){return new Fz({type:"pipe",in:n,out:a})}const Wz=X("ZodReadonly",(n,a)=>{Ex.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>q2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function Iz(n){return new Wz({type:"readonly",innerType:n})}const Pz=X("ZodCustom",(n,a)=>{Tx.init(n,a),Zt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>O2(n,u)});function eE(n,a={}){return v2(Pz,n,a)}function tE(n,a){return y2(n,a)}const Do=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],Rr=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",category:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"blocks",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"count"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:18,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],nE=pu({level:Ti().int().nonnegative(),time:Ti().int().nonnegative(),message:su()}),lE=pu({event:Ti().int().nonnegative(),value:Ti().nonnegative(),time:Ti().int().nonnegative()}),aE=pu({previous:Ti().nonnegative()}),iE=Rh([nE,lE,aE]),uE=2**Do.length-1,sE=2**Rr.length-1;function rE(n){return"level"in n}function cE(n){return"event"in n}function oE(n){return"previous"in n}function fE(n){try{const a=JSON.parse(n),u=iE.safeParse(a);return u.success?u.data:null}catch{return null}}function cu(n){return Rr[n]??{id:n,name:`event_${String(n)}`,label:`Event ${String(n)}`,category:"chain",valueKind:"unknown"}}function Q0(n){return Do[n]??{id:n,name:`level_${String(n)}`,label:`Level ${String(n)}`}}function dE(n,a){const u=cu(n);if(u.category!=="timing")return null;switch(u.valueKind){case"seconds":return a*1e3;case"milliseconds":return a;case"microseconds":return a/1e3;default:return null}}const hE=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function os(n,a=2){return new Intl.NumberFormat(void 0,{maximumFractionDigits:a}).format(n)}function ka(n){return hE.format(n)}function Or(n,a=!0){const u=new Date(n);if(!Number.isFinite(u.getTime()))return"Invalid time";const s=u.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return a?`${s}.${String(u.getMilliseconds()).padStart(3,"0")}`:s}function mE(n){const a=Math.max(0,Math.floor(n/1e3)),u=Math.floor(a/86400),s=Math.floor(a%86400/3600),c=Math.floor(a%3600/60),d=a%60;return u>0?`${String(u)}d ${String(s)}h`:s>0?`${String(s)}h ${String(c)}m`:c>0?`${String(c)}m ${String(d)}s`:`${String(d)}s`}function Ay(n,a){switch(cu(n).valueKind){case"height":return`height ${ka(a)}`;case"seconds":return`${os(a)} s`;case"milliseconds":return`${os(a)} ms`;case"microseconds":return`${os(a)} µs`;case"count":return ka(a);default:return String(a)}}function pE(n){return n>=100?`${os(n,0)}/s`:n>=10?`${os(n,1)}/s`:`${os(n,2)}/s`}function gE(n){try{const a=new URL(n),u=a.pathname==="/"?"":a.pathname.replace(/\/$/u,"");return`${a.host}${u}`}catch{return n}}const vE=[{value:"all",label:"All categories"},{value:"headers",label:"Headers"},{value:"blocks",label:"Blocks"},{value:"transactions",label:"Transactions"},{value:"chain",label:"Confirmed chain"},{value:"mining",label:"Mining"},{value:"timing",label:"Timing"}],yE={headers:"bg-violet-500/15 text-violet-300",blocks:"bg-accent/15 text-accent",transactions:"bg-sky-500/15 text-sky-300",chain:"bg-emerald-500/15 text-emerald-300",mining:"bg-amber-500/15 text-amber-300",timing:"bg-cyan-500/15 text-cyan-300"})DELIM" -R"DELIM(;function bE({events:n,onClear:a}){const[u,s]=_e.useState(""),[c,d]=_e.useState("all"),[f,p]=_e.useState(!1),[g,v]=_e.useState([]),x=f?g:n,S=_e.useMemo(()=>{const w=u.trim().toLowerCase();return x.filter(O=>{const Y=cu(O.event);return c==="all"||Y.category===c}).filter(O=>{if(!w)return!0;const Y=cu(O.event);return Y.name.includes(w)||Y.label.toLowerCase().includes(w)||String(O.value).includes(w)}).slice(0,250)},[c,u,x]);function T(){f||v(n),p(w=>!w)}return z.jsxs("section",{className:"space-y-4",children:[z.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[z.jsxs("div",{children:[z.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Node lifecycle"}),z.jsx("h2",{className:"mt-1 text-2xl font-semibold",children:"Live events"}),z.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"Heights are event payloads; timing values retain their source units."})]}),z.jsxs("div",{className:"flex gap-2",children:[z.jsx("button",{type:"button",onClick:T,className:"border-accent/35 text-accent hover:bg-accent/10 rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:f?"Resume":"Pause"}),z.jsx("button",{type:"button",onClick:a,className:"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:"Clear"})]})]}),z.jsxs("div",{className:"border-accent/20 bg-surface/70 flex flex-wrap gap-3 rounded-xl border p-4",children:[z.jsxs("label",{className:"min-w-56 flex-1",children:[z.jsx("span",{className:"sr-only",children:"Search events"}),z.jsx("input",{type:"search",value:u,onChange:w=>{s(w.target.value)},placeholder:"Search event names or values…",className:"border-accent/25 bg-background/70 text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0"})]}),z.jsxs("label",{children:[z.jsx("span",{className:"sr-only",children:"Filter event category"}),z.jsx("select",{value:c,onChange:w=>{d(w.target.value)},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent rounded-lg border px-3 py-2 text-sm focus:ring-0",children:vE.map(w=>z.jsx("option",{value:w.value,children:w.label},w.value))})]})]}),z.jsxs("div",{className:"border-accent/20 bg-surface/70 overflow-hidden rounded-xl border",children:[z.jsxs("div",{className:"border-accent/15 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[z.jsx("span",{children:f?"Paused snapshot":"Live stream"}),z.jsxs("span",{children:["Showing ",String(S.length)," of ",String(x.length)]})]}),z.jsx("div",{className:"max-h-[65vh] overflow-auto",children:S.length===0?z.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching events."}):z.jsx("ol",{className:"divide-y divide-white/5",children:S.map(w=>{const O=cu(w.event);return z.jsxs("li",{className:"grid items-start gap-2 px-4 py-3 text-xs sm:grid-cols-[8.5rem_10rem_minmax(0,1fr)]",children:[z.jsx("time",{dateTime:new Date(w.time).toISOString(),className:"text-textMuted font-mono tabular-nums",children:Or(w.time)}),z.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${yE[O.category]}`,children:O.name}),z.jsx("span",{className:"text-textPrimary font-mono tabular-nums",children:Ay(w.event,w.value)})]},w.id)})})})]}),z.jsxs("details",{className:"border-accent/20 bg-surface/50 rounded-xl border",children:[z.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-4 py-3 text-sm",children:["Event contract (",String(Rr.length)," identifiers)"]}),z.jsx("div",{className:"grid gap-2 border-t border-white/5 p-4 sm:grid-cols-2 lg:grid-cols-3",children:Rr.map(w=>z.jsxs("div",{className:"text-xs",children:[z.jsx("span",{className:"text-textMuted font-mono",children:String(w.id).padStart(2,"0")}),z.jsx("span",{className:"text-textPrimary ml-2",children:w.name})]},w.id))})]})]})}const Y0={0:"bg-sky-500/15 text-sky-300",1:"bg-emerald-500/15 text-emerald-300",2:"bg-violet-500/15 text-violet-300",3:"bg-cyan-500/15 text-cyan-300",4:"bg-indigo-500/15 text-indigo-300",5:"bg-blue-500/15 text-blue-300",6:"bg-red-500/20 text-red-300",7:"bg-orange-500/20 text-orange-300",8:"bg-slate-500/20 text-slate-300",9:"bg-zinc-500/20 text-zinc-300"};function SE({logs:n,onClear:a}){const[u,s]=_e.useState(""),[c,d]=_e.useState("all"),[f,p]=_e.useState(!1),[g,v]=_e.useState([]),x=f?g:n,S=_e.useMemo(()=>{const w=u.trim().toLowerCase();return x.filter(O=>c==="all"||O.level===Number(c)).filter(O=>!w||O.message.toLowerCase().includes(w)||Q0(O.level).name.includes(w)).slice(0,250)},[c,u,x]);function T(){f||v(n),p(w=>!w)}return z.jsxs("section",{className:"space-y-4",children:[z.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[z.jsxs("div",{children:[z.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Diagnostic stream"}),z.jsx("h2",{className:"mt-1 text-2xl font-semibold",children:"Node logs"}),z.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"The newest 1,000 messages are retained in this browser session."})]}),z.jsxs("div",{className:"flex gap-2",children:[z.jsx("button",{type:"button",onClick:T,className:"border-accent/35 text-accent hover:bg-accent/10 rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:f?"Resume":"Pause"}),z.jsx("button",{type:"button",onClick:a,className:"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:"Clear"})]})]}),z.jsxs("div",{className:"border-accent/20 bg-surface/70 flex flex-wrap gap-3 rounded-xl border p-4",children:[z.jsxs("label",{className:"min-w-56 flex-1",children:[z.jsx("span",{className:"sr-only",children:"Search logs"}),z.jsx("input",{type:"search",value:u,onChange:w=>{s(w.target.value)},placeholder:"Search messages…",className:"border-accent/25 bg-background/70 text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0"})]}),z.jsxs("label",{children:[z.jsx("span",{className:"sr-only",children:"Filter log level"}),z.jsxs("select",{value:c,onChange:w=>{d(w.target.value)},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent rounded-lg border px-3 py-2 text-sm focus:ring-0",children:[z.jsx("option",{value:"all",children:"All levels"}),Do.map(w=>z.jsx("option",{value:w.id,children:w.label},w.id))]})]})]}),z.jsxs("div",{className:"border-accent/20 bg-surface/70 overflow-hidden rounded-xl border",children:[z.jsxs("div",{className:"border-accent/15 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[z.jsx("span",{children:f?"Paused snapshot":"Live stream"}),z.jsxs("span",{children:["Showing ",String(S.length)," of ",String(x.length)]})]}),z.jsx("div",{className:"max-h-[65vh] overflow-auto",children:S.length===0?z.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching log messages."}):z.jsx("ol",{className:"divide-y divide-white/5",children:S.map(w=>{const O=Q0(w.level);return z.jsxs("li",{className:"grid gap-2 px-4 py-3 text-xs sm:grid-cols-[7.5rem_7.5rem_minmax(0,1fr)]",children:[z.jsx("time",{dateTime:new Date(w.time).toISOString(),className:"text-textMuted font-mono tabular-nums",children:Or(w.time,!1)}),z.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${Y0[w.level]??Y0[8]}`,children:O.name}),z.jsx("span",{className:"text-textPrimary min-w-0 font-mono leading-5 break-words whitespace-pre-wrap",children:w.message})]},w.id)})})})]})]})}const $d=["line","area","bar"],$0=["line","step","area"],_E=["line","step","area"],Oy={"occurrence-count":{id:"occurrence-count",label:"Occurrences per bucket",description:"Number of frames observed in each one-second bucket.",unit:"occurrences",chartTypes:$d},"oc)DELIM" -R"DELIM(currence-rate":{id:"occurrence-rate",label:"Occurrence rate",description:"Frames observed per second.",unit:"occurrences-per-second",chartTypes:$d},"cumulative-occurrences":{id:"cumulative-occurrences",label:"Cumulative occurrences",description:"Running number of frames observed during this browser session.",unit:"occurrences",chartTypes:$0},"payload-latest":{id:"payload-latest",label:"Latest value",description:"Most recently observed payload value.",unit:"count",chartTypes:_E},"payload-average":{id:"payload-average",label:"Average value",description:"Average payload value within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-minimum":{id:"payload-minimum",label:"Minimum value",description:"Minimum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-maximum":{id:"payload-maximum",label:"Maximum value",description:"Maximum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-sum":{id:"payload-sum",label:"Value per bucket",description:"Sum of count payloads within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-cumulative":{id:"payload-cumulative",label:"Cumulative value",description:"Running sum of count payloads during this browser session.",unit:"count",chartTypes:$0},"payload-change-rate":{id:"payload-change-rate",label:"Height change rate",description:"Change in the latest observed height per second.",unit:"height-per-second",chartTypes:$d}},bs=["occurrence-rate","occurrence-count","cumulative-occurrences"],xE=["payload-latest","payload-maximum","payload-change-rate",...bs],zE=["payload-average","payload-latest","payload-minimum","payload-maximum",...bs],EE=["payload-sum","payload-cumulative","payload-latest","payload-average",...bs];function Al(n){return`event:${String(n)}`}function xi(n){return`log:${String(n)}`}const zo="native:top";function TE(n){switch(n){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";default:return"unknown"}}function wE(n){switch(n){case"height":return xE;case"duration":return zE;case"count":return EE;default:return bs}}function ME(n){switch(n){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function Ny(n){const a=cu(n),u=TE(a.valueKind);return{id:Al(n),source:"event",sourceId:n,name:a.name,label:a.label,category:a.category,payloadKind:u,allowedMeasures:wE(u),defaultMeasure:ME(u),description:u==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${a.label} event with a ${u} payload.`}}const AE=[...Rr.map(n=>Ny(n.id)),...Do.map(n=>({id:xi(n.id),source:"log",sourceId:n.id,name:n.name,label:`${n.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:bs,defaultMeasure:"occurrence-rate",description:`${n.label} log message volume. Message text is not interpreted as numeric data.`})),{id:zo,source:"native",sourceId:"top",name:"canonical_top",label:"Canonical top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate"],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}],kh=AE,OE=new Map(kh.map(n=>[n.id,n]));function Za(n){const a=OE.get(n);if(a)return a;const u=/^event:(\d+)$/u.exec(n);return u?Ny(Number(u[1])):{id:n,source:"event",sourceId:-1,name:n,label:n,category:"unknown",payloadKind:"unknown",allowedMeasures:bs,defaultMeasure:"occurrence-rate",description:"Unknown signal; only occurrence measurements are available."}}function Ei(n,a){const u=Oy[a];if(a.startsWith("occurrence")||a==="cumulative-occurrences")return u;const s=a==="payload-change-rate"?"height-per-second":n.payloadKind==="height"?"height":n.payloadKind==="duration"?"milliseconds":"count";return{...u,unit:s}}function NE(n,a){return n.allowedMeasures.includes(a)}function jE(n,a){return dE(n,a)??a}const DE=3600*1e3,CE=250,RE=1e3,UE=1e3;class V0{constructor(a){this.capacity=a,this.#e=Array.from({length:a})}capacity;#e;#t=0;#n=0;push(a){this.#e[this.#t]=a,this.#t=(this.#t+1)%this.capacity,this.#n=Math.min(this.#n+1,this.capacity)}clear(){this.#t=0,this.#n=0}newestFirst(){const a=[];for(let u=0;uthis.#z;subscribe=a=>(this.#t.add(a),()=>{this.#t.delete(a)});start(){this.#y||(this.tick(),this.#y=setInterval(()=>{this.tick()},1e3))}stop(){this.#y&&(clearInterval(this.#y),this.#y=null),this.#p&&(clearTimeout(this.#p),this.#p=null)}ingest(a,u=this.#e()){const s=this.#E(u);this.#m+=1,rE(a)?this.#N(a,s):cE(a)?this.#j(a,s):oE(a)&&(this.#b+=1),this.#w()}recordInvalidFrame(){this.#S+=1,this.#w()}recordNativeTop(a,u=this.#e()){const s=this.#E(u),c=this.#r[zo];c?.value===a&&s-c.time<15e3||(this.#M(zo,s,a),this.#A(s),this.#w())}clearLogs(){this.#n.clear(),this.flush()}clearEvents(){this.#l.clear(),this.flush()}reset(){this.#n.clear(),this.#l.clear(),this.#a.clear(),this.#i={},this.#s={},this.#u={},this.#c={},this.#r={},this.#d={},this.#h=this.#E(this.#e()),this.#m=0,this.#g=0,this.#o=0,this.#b=0,this.#S=0,this.#_=null,this.#x=null,this.#v=0,this.#T(this.#h),this.flush()}tick(){const a=this.#E(this.#e());this.#T(a),this.#A(a),this.#w()}flush(){this.#p&&(clearTimeout(this.#p),this.#p=null),this.#z=this.#O();for(const a of this.#t)a()}#N(a,u){this.#g+=1,this.#_=u,this.#v+=1,this.#n.push({...a,id:this.#v,receivedAt:u}),this.#M(xi(a.level),u,null)}#j(a,u){this.#o+=1,this.#x=u,this.#v+=1,this.#l.push({...a,id:this.#v,receivedAt:u}),this.#M(Al(a.event),u,jE(a.event,a.value))}#E(a){return Number.isFinite(a)?(this.#f=Math.max(this.#f,a),this.#f):this.#f}#M(a,u,s){const c=this.#T(u),d=c.signals.get(a)??kE();if(d.count+=1,co(this.#u,a,1),s!==null){d.samples+=1,d.sum+=s,d.minimum=d.minimum===null?s:Math.min(d.minimum,s),d.maximum=d.maximum===null?s:Math.max(d.maximum,s),(d.firstAt===null||u=d.lastAt)&&(d.last=s,d.lastAt=u),co(this.#c,a,s);const f=this.#r[a];(!f||u>=f.time)&&(this.#r[a]={value:s,time:u}),this.#d[a]=Math.max(this.#d[a]??s,s)}c.signals.set(a,d)}#T(a){const u=Math.floor(a/1e3)*1e3,s=this.#a.get(u);if(s)return s;const c={time:u,signals:new Map};return this.#a.set(u,c),c}#A(a){const u=a-DE;for(const[s,c]of this.#a)if(!(s>=u)){for(const[d,f]of c.signals)co(this.#i,d,f.count),co(this.#s,d,f.sum);this.#a.delete(s)}}#w(){this.#p||(this.#p=setTimeout(()=>{this.#p=null,this.flush()},CE))}#O(){const a=[...this.#a.values()].sort((u,s)=>u.time-s.time);return{now:this.#E(this.#e()),sessionStartedAt:this.#h,totalFrames:this.#m,totalLogs:this.#g,totalEvents:this.#o,totalAcks:this.#b,invalidFrames:this.#S,buckets:a.map(u=>({time:u.time,signals:Object.fromEntries([...u.signals].map(([s,c])=>[s,{...c}]))})),priorSignalCounts:{...this.#i},priorSignalSums:{...this.#s},signalTotals:{...this.#u},signalSums:{...this.#c},signalLatest:{...this.#r},signalMaximums:{...this.#d},recentLogs:this.#n.newestFirst(),recentEvents:this.#l.newestFirst(),lastLogAt:this.#_,lastEventAt:this.#x}}}function LE(n,a,u,s,c=n[0]?.time??u){const d=u-s*1e3,f=d<=c,p=f?Math.floor(c/1e3)*1e3:Math.ceil(d/1e3)*1e3,g=f?c:p,v=Math.floor(u/1e3)*1e3,S=n.filter(w=>w.time>=p&&w.time<=v).reduce((w,O)=>w+(O.signals[a]?.count??0),0),T=Math.max(0,(u-g)/1e3);return T>0?S/T:0}function HE(n,a){const u=f=>LE(n.buckets,Al(f),n.now,a,n.sessionStartedAt),s=u(2)+u(14);if(s>0)return{label:"Reorganiz)DELIM" -R"DELIM(ing",rate:s};const d=[{label:"Confirming blocks",rate:u(6)},{label:"Validating blocks",rate:u(5)},{label:"Archiving blocks",rate:u(3)},{label:"Synchronizing headers",rate:Math.max(u(0),u(1))}].reduce((f,p)=>p.rate>f.rate?p:f);return d.rate>0?d:{label:"Idle",rate:0}}const BE={idle:"border-slate-500/40 bg-slate-500/10 text-slate-300",connecting:"border-amber-500/40 bg-amber-500/10 text-amber-300",connected:"border-emerald-500/40 bg-emerald-500/10 text-emerald-300",reconnecting:"border-orange-500/40 bg-orange-500/10 text-orange-300"};function qE({phase:n,label:a}){return z.jsxs("span",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-xs tracking-wide uppercase ${BE[n]}`,children:[z.jsx("span",{className:"h-2 w-2 rounded-full bg-current","aria-hidden":"true"}),a]})}const GE={orange:"from-accent/25",red:"from-accentSecondary/25",green:"from-emerald-500/20",blue:"from-sky-500/20"};function oo({label:n,value:a,detail:u,accent:s="orange"}){return z.jsxs("article",{className:`border-accent/20 bg-surface/80 rounded-xl border bg-gradient-to-br ${GE[s]} to-transparent p-5`,children:[z.jsx("p",{className:"text-textMuted text-xs font-medium tracking-[0.14em] uppercase",children:n}),z.jsx("p",{className:"text-textPrimary mt-3 text-3xl font-semibold tracking-tight tabular-nums",children:a}),z.jsx("div",{className:"text-textMuted mt-2 min-h-5 text-xs",children:u})]})}const us=16,nh=8,Zh=80,QE=[300,900,3600],lh=["line","step","area","bar"],bn=["#ffa022","#38bdf8","#34d399","#c084fc","#fb7185","#e879f9","#facc15","#60a5fa"],YE=Uh(["occurrence-count","occurrence-rate","cumulative-occurrences","payload-latest","payload-average","payload-minimum","payload-maximum","payload-sum","payload-cumulative","payload-change-rate"]),$E=pu({id:su().min(1).max(100),signalId:su().min(1).max(100),measure:YE,color:su().regex(/^#[\da-f]{6}$/iu),label:su().max(80).optional()}).strict(),jy=pu({id:su().min(1).max(100),title:su().trim().min(1).max(Zh),visualization:Uh(lh),range:Rh([go(300),go(900),go(3600)]),series:Ch($E).min(1).max(nh)}).strict(),VE=pu({version:go(1),charts:Ch(jy).max(us)}).strict(),Dy={id:"default-sync-pipeline",title:"Sync pipeline",visualization:"line",range:900,series:[dl("sync-header",Al(0),"occurrence-rate",bn[3]),dl("sync-archive",Al(3),"occurrence-rate",bn[0]),dl("sync-validate",Al(5),"occurrence-rate",bn[1]),dl("sync-confirm",Al(6),"occurrence-rate",bn[2])]},KE={id:"default-chain-progress",title:"Chain progress",visualization:"step",range:900,series:[dl("progress-top",zo,"payload-latest",bn[0]),dl("progress-organized",Al(13),"payload-latest",bn[2]),dl("progress-confirmed",Al(6),"payload-latest",bn[1])]},XE={id:"default-log-volume",title:"Log volume",visualization:"bar",range:900,series:[dl("logs-news",xi(1),"occurrence-rate",bn[2]),dl("logs-session",xi(2),"occurrence-rate",bn[3]),dl("logs-protocol",xi(3),"occurrence-rate",bn[1]),dl("logs-remote",xi(5),"occurrence-rate",bn[7]),dl("logs-fault",xi(6),"occurrence-rate",bn[4]),dl("logs-quitting",xi(7),"occurrence-rate",bn[0])]},Lh=[{id:"sync-pipeline",label:"Sync pipeline",description:"Header and block lifecycle throughput.",chart:Dy},{id:"chain-progress",label:"Chain progress",description:"Canonical, organized, and confirmed heights.",chart:KE},{id:"log-volume",label:"Log volume",description:"Message rates grouped by log level.",chart:XE}],Cy="libbitcoinAdminDashboardCharts";let K0=0;function dl(n,a,u,s){return{id:n,signalId:a,measure:u,color:s}}function Eo(n){return K0+=1,`${n}-${Date.now().toString(36)}-${String(K0)}`}function Hh(n,a=!1){return{...n,id:a?Eo("chart"):n.id,series:n.series.map(u=>({...u,id:a?Eo("series"):u.id}))}}function vo(){return Lh.map(n=>Hh(n.chart))}function JE(n){const a=Lh.find(u=>u.id===n);return Hh(a?.chart??Dy,!0)}function Ry(){return{id:Eo("chart"),title:"Custom chart",visualization:"line",range:900,series:[{id:Eo("series"),signalId:Al(3),measure:"occurrence-rate",color:bn[0]}]}}function FE(n){const a=" copy",u=`${n.title.slice(0,Zh-a.length).trimEnd()}${a}`;return{...Hh(n,!0),title:u}}function ah(n){const a=new Set(n.series.map(u=>Ei(Za(u.signalId),u.measure).unit));return a.size===1?[...a][0]??null:null}function Uy(n){const a=jy.safeParse(n);if(!a.success)return a.error.issues[0]?.message??"Invalid chart configuration";for(const u of n.series){const s=Za(u.signalId);if(!NE(s,u.measure))return`${Oy[u.measure].label} is not valid for ${s.label}.`;const c=Ei(s,u.measure);if(!c.chartTypes.includes(n.visualization))return`${c.label} cannot be displayed as a ${n.visualization} chart.`}return ah(n)===null?"All series on a chart must use compatible units.":null}function ky(n){const a=VE.safeParse(n);return!a.success||new Set(a.data.charts.map(u=>u.id)).size!==a.data.charts.length||a.data.charts.some(u=>new Set(u.series.map(s=>s.id)).size!==u.series.length)?null:a.data.charts.every(u=>Uy(u)===null)?a.data.charts:null}function Zy(){try{return globalThis.window?.localStorage??null}catch{return null}}function WE(n=Zy()){try{const a=n?.getItem(Cy);return a?ky(JSON.parse(a))??vo():vo()}catch{return vo()}}function IE(n,a=Zy()){try{const u={version:1,charts:n};if(!ky(u))return;a?.setItem(Cy,JSON.stringify(u))}catch{}}function Bh(n,a){return n.signals[a]}function X0(n,a,u,s){let c=s==="count"?n.priorSignalCounts[a]??0:n.priorSignalSums[a]??0;for(const d of n.buckets){if(d.time>=u)break;const f=Bh(d,a);c+=s==="count"?f?.count??0:f?.sum??0}return c}function PE(n,a,u){let s=null;for(const c of n){if(c.time>=u)break;const d=Bh(c,a);d?.last!==null&&d?.last!==void 0&&d.lastAt!==null&&(s={value:d.last,time:d.lastAt})}return s}function eT(n,a){const u=a<=n.sessionStartedAt?Math.floor(n.sessionStartedAt/1e3)*1e3:Math.ceil(a/1e3)*1e3,s=Math.floor(n.now/1e3)*1e3,c=new Map(n.buckets.map(f=>[f.time,f])),d=[];for(let f=u;f<=s;f+=1e3)d.push(c.get(f)??{time:f,signals:{}});return d}function tT(n,a,u){const s=Math.max(n.time,u),c=Math.min(a,n.time+1e3);return Math.max(0,(c-s)/1e3)}function nT(n,a,u,s){const c=Za(s.signalId);let d=s.measure==="cumulative-occurrences"?X0(n,s.signalId,u,"count"):s.measure==="payload-cumulative"?X0(n,s.signalId,u,"sum"):0,f=PE(n.buckets,s.signalId,u);return a.map(p=>{const g=Bh(p,s.signalId);switch(s.measure){case"occurrence-count":return g?.count??0;case"occurrence-rate":{const v=tT(p,n.now,n.sessionStartedAt);return v>0?(g?.count??0)/v:0}case"cumulative-occurrences":return d+=g?.count??0,d;case"payload-sum":return g&&g.samples>0?g.sum:null;case"payload-cumulative":return d+=g?.sum??0,d;case"payload-average":return g&&g.samples>0?g.sum/g.samples:null;case"payload-minimum":return g?.minimum??null;case"payload-maximum":return g?.maximum??null;case"payload-latest":return g?.last!==null&&g?.last!==void 0&&g.lastAt!==null?(f={value:g.last,time:g.lastAt},g.last):c.payloadKind==="height"?f?.value??null:null;case"payload-change-rate":{if(g?.last===null||g?.last===void 0||g.lastAt===null)return null;const v=f??(g.first!==null&&g.firstAt!==null?{value:g.first,time:g.firstAt}:null);if(f={value:g.last,time:g.lastAt},!v)return null;const x=(g.lastAt-v.time)/1e3;return x>0?(g.last-v.value)/x:null}}})}function lT(n,a){const u=n.now-a.range*1e3,s=eT(n,u),c=s[0]?.time??Math.floor(n.now/1e3)*1e3,d=a.series[0],f=Ei(Za(d.signalId),d.measure).unit,p=a.series.filter(g=>(n.signalTotals[g.signalId]??0)===0).map(g=>g.label??Za(g.signalId).label);return{data:[s.map(g=>g.time/1e3),...a.series.map(g=>nT(n,s,c,g))],unit:f,hasObservedData:p.length({...a}))}}function cT(){const n=new Map;for(const a of kh){const u=n.get(a.category)??[];u.push(a),n.set(a.category,u)}return[...n]}const oT=cT();function fT({chart:n,mode:a,onCancel:u,onSave:s}){const[c,d]=_e.useState(()=>rT(n)),f=Uy(c),p=ah(c);_e.useEffect(()=>{function w(O){O.key==="Escape"&&u()}return globalThis.addEventListener("keydown",w),()=>{globalThis.removeEventListener("keydown",w)}},[u]);const g=_e.useMemo(()=>new Set(lh.filter(w=>c.series.every(O=>Ei(Za(O.signalId),O.measure).chartTypes.includes(w)))),[c.series]);function v(w,O){d(Y=>({...Y,series:Y.series.map((W,F)=>F===w?O:W)}))}function x(w,O){const Y=c.series[w],W=Za(O);v(w,{...Y,signalId:O,measure:W.defaultMeasure})}function S(){if(c.series.length>=nh)return;const w=ah(c),O=kh.find(F=>F.allowedMeasures.some(B=>w===null||Ei(F,B).unit===w));if(!O)return;const Y=O.allowedMeasures.find(F=>w===null||Ei(O,F).unit===w)??O.defaultMeasure,W={id:`series-${Date.now().toString(36)}-${String(c.series.length+1)}`,signalId:O.id,measure:Y,color:bn[c.series.length%bn.length]??bn[0]};d(F=>({...F,series:[...F.series,W]}))}function T(w){w.preventDefault(),!f&&s({...c,title:c.title.trim()})}return z.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/75 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:w=>{w.target===w.currentTarget&&u()},children:z.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"chart-editor-title",className:"border-accent/30 bg-surface max-h-[92vh] w-full max-w-4xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/60",children:[z.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[z.jsxs("div",{children:[z.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Dashboard builder"}),z.jsx("h2",{id:"chart-editor-title",className:"mt-1 text-xl font-semibold",children:a==="add"?"Add chart":"Edit chart"})]}),z.jsx("button",{type:"button",onClick:u,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close chart editor",children:"×"})]}),a==="add"&&z.jsxs("div",{className:"border-accent/15 border-b p-5",children:[z.jsx("p",{className:"text-textMuted mb-3 text-xs font-medium tracking-wide uppercase",children:"Start from a template"}),z.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-5",children:[Lh.map(w=>z.jsxs("button",{type:"button",onClick:()=>{d(JE(w.id))},className:"border-accent/20 bg-background/50 hover:border-accent/60 rounded-lg border p-3 text-left",children:[z.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:w.label}),z.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:w.description})]},w.id)),z.jsxs("button",{type:"button",onClick:()=>{d(Ry())},className:"border-accent/20 bg-background/50 hover:border-accent/60 rounded-lg border p-3 text-left",children:[z.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:"Custom"}),z.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:"Begin with one editable series."})]})]})]}),z.jsxs("form",{onSubmit:T,className:"space-y-6 p-5",children:[z.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_11rem_11rem]",children:[z.jsxs("label",{className:"space-y-2",children:[z.jsx("span",{className:"text-sm font-medium",children:"Chart title"}),z.jsx("input",{value:c.title,maxLength:Zh,onChange:w=>{d(O=>({...O,title:w.target.value}))},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0"})]}),z.jsxs("label",{className:"space-y-2",children:[z.jsx("span",{className:"text-sm font-medium",children:"Chart type"}),z.jsx("select",{value:c.visualization,onChange:w=>{d(O=>({...O,visualization:w.target.value}))},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0",children:lh.map(w=>z.jsx("option",{value:w,disabled:!g.has(w),children:sT[w]},w))})]}),z.jsxs("label",{className:"space-y-2",children:[z.jsx("span",{className:"text-sm font-medium",children:"Time range"}),z.jsx("select",{value:c.range,onChange:w=>{d(O=>({...O,range:Number(w.target.value)}))},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0",children:QE.map(w=>z.jsx("option",{value:w,children:uT[w]},w))})]})]}),z.jsxs("section",{className:"space-y-3",children:[z.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[z.jsxs("div",{children:[z.jsx("h3",{className:"font-semibold",children:"Series"}),z.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:["One chart uses one axis unit",p===null?".":`: ${Ly(p)}.`]})]}),z.jsx("button",{type:"button",onClick:S,disabled:c.series.length>=nh,className:"border-accent/35 text-accent hover:bg-accent/10 disabled:text-textMuted rounded-lg border px-3 py-2 text-xs font-medium uppercase disabled:cursor-not-allowed disabled:opacity-50",children:"Add series"})]}),z.jsx("div",{className:"space-y-3",children:c.series.map((w,O)=>{const Y=Za(w.signalId),W=Ei(Y,w.measure);return z.jsxs("article",{className:"border-accent/15 bg-background/35 grid gap-3 rounded-xl border p-4 lg:grid-cols-[minmax(12rem,1.2fr)_minmax(11rem,1fr)_minmax(9rem,0.8fr)_3.5rem_auto]",children:[z.jsxs("label",{className:"space-y-1.5",children:[z.jsxs("span",{className:"text-textMuted text-xs",children:["Signal ",String(O+1)]}),z.jsx("select",{"aria-label":`Signal ${String(O+1)}`,value:w.signalId,onChange:F=>{x(O,F.target.value)},className:"border-accent/25 bg-surface text-textPrimary focus:border-accent w-full rounded-lg border px-2 py-2 text-sm focus:ring-0",children:oT.map(([F,B])=>z.jsx("optgroup",{label:F,children:B.map(I=>z.jsx("option",{value:I.id,children:I.label},I.id))},F))})]}),z.jsxs("label",{className:"space-y-1.5",children:[z.jsx("span",{className:"text-textMuted text-xs",children:"Measurement"}),z.jsx("select",{"aria-label":`Measurement ${String(O+1)}`,value:w.measure,onChange:F=>{v(O,{...w,measure:F.target.value})},className:"border-accent/25 bg-surface text-textPrimary focus:border-accent w-full rounded-lg border px-2 py-2 text-sm focus:ring-0",title:W.description,children:Y.allowedMeasures.map(F=>z.jsx("option",{value:F,children:Ei(Y,F).label},F))})]}),z.jsxs("label",{className:"space-y-1.5",children:[z.jsx("span",{className:"text-textMuted text-xs",children:"Display label"}),z.jsx("input",{"aria-label":`Display label ${String(O+1)}`,value:w.label??"",onChange:F=>{v(O,{...w,label:F.target.value||void 0})},placeholder:Y.label,className:"border-accent/25 bg-surface text-textPrimary placeholder:text-textMuted/50 focus:border-accent w-full rounded-lg border px-2 py-2 text-sm focus:ring-0"})]}),z.jsxs("label",{className:"space-y-1.5",children:[z.jsx("span",{className:"text-textMuted text-xs",children:"Color"}),z.jsx("input",{"aria-label":`Series color ${String(O+1)}`,type:"color",value:w.color,onChange:F=>{v(O,{...w,color:F.target.value})},className:"border-accent/25 bg-surface h-10 w-full rounded-lg border p-1"})]}),z.jsx("button",{type:"button",onClick:()=>{d(F=>({...F,series:F.series.filter((B,I)=>I!==O)}))},disabled:c.series.length===1,"aria-label":`Remove series ${String(O+1)}`,className:"text-textMuted self-end rounded-lg px-3 py-2 text-sm hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-30",children:"Remove"})]},w.id)})})]}),f&&z.jsx("p",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-200",children:f}),z.jsxs("div",{className:"flex justify-end gap-2 border-t border-white/5 pt-4",children:[z.jsx("button",{type:"button",onClick:u,className:"text-textMuted hover:text-textPrimary rounded-lg px-4 py-2 text-sm",children:"Cancel"}),z.jsx("butto)DELIM" -R"DELIM(n",{type:"submit",disabled:f!==null,className:"bg-accent text-background hover:bg-accent/90 rounded-lg px-4 py-2 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-40",children:a==="add"?"Add chart":"Save changes"})]})]})]})})}const dT=!0,tn="u-",hT="uplot",mT=tn+"hz",pT=tn+"vt",gT=tn+"title",vT=tn+"wrap",yT=tn+"under",bT=tn+"over",ST=tn+"axis",uu=tn+"off",_T=tn+"select",xT=tn+"cursor-x",zT=tn+"cursor-y",ET=tn+"cursor-pt",TT=tn+"legend",wT=tn+"live",MT=tn+"inline",AT=tn+"series",OT=tn+"marker",J0=tn+"label",NT=tn+"value",wr="width",Mr="height",zr="top",F0="bottom",as="left",Vd="right",qh="#000",W0=qh+"0",Kd="mousemove",I0="mousedown",Xd="mouseup",P0="mouseenter",ev="mouseleave",tv="dblclick",jT="resize",DT="scroll",nv="change",To="dppxchange",Gh="--",Ss=typeof window<"u",ih=Ss?document:null,fs=Ss?window:null,CT=Ss?navigator:null;let Ie,fo;function uh(){let n=devicePixelRatio;Ie!=n&&(Ie=n,fo&&rh(nv,fo,uh),fo=matchMedia(`(min-resolution: ${Ie-.001}dppx) and (max-resolution: ${Ie+.001}dppx)`),ou(nv,fo,uh),fs.dispatchEvent(new CustomEvent(To)))}function ol(n,a){if(a!=null){let u=n.classList;!u.contains(a)&&u.add(a)}}function sh(n,a){let u=n.classList;u.contains(a)&&u.remove(a)}function zt(n,a,u){n.style[a]=u+"px"}function ql(n,a,u,s){let c=ih.createElement(n);return a!=null&&ol(c,a),u?.insertBefore(c,s),c}function wl(n,a){return ql("div",n,a)}const lv=new WeakMap;function ia(n,a,u,s,c){let d="translate("+a+"px,"+u+"px)",f=lv.get(n);d!=f&&(n.style.transform=d,lv.set(n,d),a<0||u<0||a>s||u>c?ol(n,uu):sh(n,uu))}const av=new WeakMap;function iv(n,a,u){let s=a+u,c=av.get(n);s!=c&&(av.set(n,s),n.style.background=a,n.style.borderColor=u)}const uv=new WeakMap;function sv(n,a,u,s){let c=a+""+u,d=uv.get(n);c!=d&&(uv.set(n,c),n.style.height=u+"px",n.style.width=a+"px",n.style.marginLeft=s?-a/2+"px":0,n.style.marginTop=s?-u/2+"px":0)}const Qh={passive:!0},RT={...Qh,capture:!0};function ou(n,a,u,s){a.addEventListener(n,u,s?RT:Qh)}function rh(n,a,u,s){a.removeEventListener(n,u,Qh)}Ss&&uh();function Gl(n,a,u,s){let c;u=u||0,s=s||a.length-1;let d=s<=2147483647;for(;s-u>1;)c=d?u+s>>1:hl((u+s)/2),a[c]{let d=-1,f=-1;for(let p=s;p<=c;p++)if(n(u[p])){d=p;break}for(let p=c;p>=s;p--)if(n(u[p])){f=p;break}return[d,f]}}const By=n=>n!=null,qy=n=>n!=null&&n>0,Co=Hy(By),UT=Hy(qy);function kT(n,a,u,s=0,c=!1){let d=c?UT:Co,f=c?qy:By;[a,u]=d(n,a,u);let p=n[a],g=n[a];if(a>-1)if(s==1)p=n[a],g=n[u];else if(s==-1)p=n[u],g=n[a];else for(let v=a;v<=u;v++){let x=n[v];f(x)&&(xg&&(g=x))}return[p??gt,g??-gt]}function Ro(n,a,u,s){let c=ov(n),d=ov(a);n==a&&(c==-1?(n*=u,a/=u):(n/=u,a*=u));let f=u==10?La:Gy,p=c==1?hl:Ml,g=d==1?Ml:hl,v=p(f(en(n))),x=g(f(en(a))),S=hs(u,v),T=hs(u,x);return u==10&&(v<0&&(S=vt(S,-v)),x<0&&(T=vt(T,-x))),s||u==2?(n=S*c,a=T*d):(n=Vy(n,S),a=Uo(a,T)),[n,a]}function Yh(n,a,u,s){let c=Ro(n,a,u,s);return n==0&&(c[0]=0),a==0&&(c[1]=0),c}const $h=.1,rv={mode:3,pad:$h},Nr={pad:0,soft:null,mode:0},ZT={min:Nr,max:Nr};function wo(n,a,u,s){return ko(u)?cv(n,a,u):(Nr.pad=u,Nr.soft=s?0:null,Nr.mode=s?3:0,cv(n,a,ZT))}function Je(n,a){return n??a}function LT(n,a,u){for(a=Je(a,0),u=Je(u,n.length-1);a<=u;){if(n[a]!=null)return!0;a++}return!1}function cv(n,a,u){let s=u.min,c=u.max,d=Je(s.pad,0),f=Je(c.pad,0),p=Je(s.hard,-gt),g=Je(c.hard,gt),v=Je(s.soft,gt),x=Je(c.soft,-gt),S=Je(s.mode,0),T=Je(c.mode,0),w=a-n,O=La(w),Y=Bn(en(n),en(a)),W=La(Y),F=en(W-O);(w<1e-24||F>10)&&(w=0,(n==0||a==0)&&(w=1e-24,S==2&&v!=gt&&(d=0),T==2&&x!=-gt&&(f=0)));let B=w||Y||1e3,I=La(B),q=hs(10,hl(I)),ae=B*(w==0?n==0?.1:1:d),ne=vt(Vy(n-ae,q/10),24),le=n>=v&&(S==1||S==3&&ne<=v||S==2&&ne>=v)?v:gt,se=Bn(p,ne=le?le:Ql(le,ne)),Ae=B*(w==0?a==0?.1:1:f),ze=vt(Uo(a+Ae,q/10),24),ee=a<=x&&(T==1||T==3&&ze>=x||T==2&&ze<=x)?x:-gt,ye=Ql(g,ze>ee&&a<=ee?ee:Bn(ee,ze));return se==ye&&se==0&&(ye=100),[se,ye]}const HT=new Intl.NumberFormat(Ss?CT.language:"en-US"),Vh=n=>HT.format(n),ml=Math,yo=ml.PI,en=ml.abs,hl=ml.floor,Pt=ml.round,Ml=ml.ceil,Ql=ml.min,Bn=ml.max,hs=ml.pow,ov=ml.sign,La=ml.log10,Gy=ml.log2,BT=(n,a=1)=>ml.sinh(n)*a,Jd=(n,a=1)=>ml.asinh(n/a),gt=1/0;function fv(n){return(La((n^n>>31)-(n>>31))|0)+1}function ch(n,a,u){return Ql(Bn(n,a),u)}function Qy(n){return typeof n=="function"}function Ge(n){return Qy(n)?n:()=>n}const qT=()=>{},Yy=n=>n,$y=(n,a)=>a,GT=n=>null,dv=n=>!0,hv=(n,a)=>n==a,QT=/\.\d*?(?=9{6,}|0{6,})/gm,hu=n=>{if(Xy(n)||Mi.has(n))return n;const a=`${n}`,u=a.match(QT);if(u==null)return n;let s=u[0].length-1;if(a.indexOf("e-")!=-1){let[c,d]=a.split("e");return+`${hu(c)}e${d}`}return vt(n,s)};function au(n,a){return hu(vt(hu(n/a))*a)}function Uo(n,a){return hu(Ml(hu(n/a))*a)}function Vy(n,a){return hu(hl(hu(n/a))*a)}function vt(n,a=0){if(Xy(n))return n;let u=10**a,s=n*u*(1+Number.EPSILON);return Pt(s)/u}const Mi=new Map;function Ky(n){return((""+n).split(".")[1]||"").length}function Ur(n,a,u,s){let c=[],d=s.map(Ky);for(let f=a;f=0?0:p)+(f>=d[v]?0:d[v]),T=n==10?x:vt(x,S);c.push(T),Mi.set(T,S)}}return c}const jr={},Kh=[],ms=[null,null],zi=Array.isArray,Xy=Number.isInteger,YT=n=>n===void 0;function mv(n){return typeof n=="string"}function ko(n){let a=!1;if(n!=null){let u=n.constructor;a=u==null||u==Object}return a}function $T(n){return n!=null&&typeof n=="object"}const VT=Object.getPrototypeOf(Uint8Array),Jy="__proto__";function ps(n,a=ko){let u;if(zi(n)){let s=n.find(c=>c!=null);if(zi(s)||a(s)){u=Array(n.length);for(let c=0;cd){for(c=f-1;c>=0&&n[c]==null;)n[c--]=null;for(c=f+1;cf-p)],c=s[0].length,d=new Map;for(let f=0;f"u"?n=>Promise.resolve().then(n):queueMicrotask;function PT(n){let a=n[0],u=a.length,s=Array(u);for(let d=0;da[d]-a[f]);let c=[];for(let d=0;d=s&&n[c]==null;)c--;if(c<=s)return!0;const d=Bn(1,hl((c-s+1)/a));for(let f=n[s],p=s+d;p<=c;p+=d){const g=n[p];if(g!=null){if(g<=f)return!1;f=g}}return!0}const Fy=["January","February","March","April","May","June","July","August","September","October","November","December"],Wy=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Iy(n){return n.slice(0,3)}const nw=Wy.map(Iy),lw=Fy.map(Iy),aw={MMMM:Fy,MMM:lw,WWWW:Wy,WWW:nw};function Er(n){return(n<10?"0":"")+n}function iw(n){return(n<10?"00":n<100?"0":"")+n}const uw={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,a)=>a.MMMM[n.getMonth()],MMM:(n,a)=>a.MMM[n.getMonth()],MM:n=>Er(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>Er(n.getDate()),D:n=>n.getDate(),WWWW:(n,a)=>a.WWWW[n.getDay()],WWW:(n,a)=>a.WWW[n.ge)DELIM" -R"DELIM(tDay()],HH:n=>Er(n.getHours()),H:n=>n.getHours(),h:n=>{let a=n.getHours();return a==0?12:a>12?a-12:a},AA:n=>n.getHours()>=12?"PM":"AM",aa:n=>n.getHours()>=12?"pm":"am",a:n=>n.getHours()>=12?"p":"a",mm:n=>Er(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>Er(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>iw(n.getMilliseconds())};function Xh(n,a){a=a||aw;let u=[],s=/\{([a-z]+)\}|[^{]+/gi,c;for(;c=s.exec(n);)u.push(c[0][0]=="{"?uw[c[1]]:c[0]);return d=>{let f="";for(let p=0;pn%1==0,Mo=[1,2,2.5,5],cw=Ur(10,-32,0,Mo),eb=Ur(10,0,32,Mo),ow=eb.filter(Py),iu=cw.concat(eb),Jh=` -`,tb="{YYYY}",pv=Jh+tb,nb="{M}/{D}",Ar=Jh+nb,ho=Ar+"/{YY}",lb="{aa}",fw="{h}:{mm}",ss=fw+lb,gv=Jh+ss,vv=":{ss}",tt=null;function ab(n){let a=n*1e3,u=a*60,s=u*60,c=s*24,d=c*30,f=c*365,g=(n==1?Ur(10,0,3,Mo).filter(Py):Ur(10,-3,0,Mo)).concat([a,a*5,a*10,a*15,a*30,u,u*5,u*10,u*15,u*30,s,s*2,s*3,s*4,s*6,s*8,s*12,c,c*2,c*3,c*4,c*5,c*6,c*7,c*8,c*9,c*10,c*15,d,d*2,d*3,d*4,d*6,f,f*2,f*5,f*10,f*25,f*50,f*100]);const v=[[f,tb,tt,tt,tt,tt,tt,tt,1],[c*28,"{MMM}",pv,tt,tt,tt,tt,tt,1],[c,nb,pv,tt,tt,tt,tt,tt,1],[s,"{h}"+lb,ho,tt,Ar,tt,tt,tt,1],[u,ss,ho,tt,Ar,tt,tt,tt,1],[a,vv,ho+" "+ss,tt,Ar+" "+ss,tt,gv,tt,1],[n,vv+".{fff}",ho+" "+ss,tt,Ar+" "+ss,tt,gv,tt,1]];function x(S){return(T,w,O,Y,W,F)=>{let B=[],I=W>=f,q=W>=d&&W=c?c:W,ze=hl(O)-hl(ne),ee=se+ze+Uo(ne-se,Ae);B.push(ee);let ye=S(ee),ce=ye.getHours()+ye.getMinutes()/u+ye.getSeconds()/s,Ee=W/s,de=T.axes[w]._space,U=F/de;for(;ee=vt(ee+W,n==1?0:3),!(ee>Y);)if(Ee>1){let Q=hl(vt(ce+Ee,6))%24,be=S(ee).getHours()-Q;be>1&&(be=-1),ee-=be*s,ce=(ce+Ee)%24;let A=B[B.length-1];vt((ee-A)/W,3)*U>=.7&&B.push(ee)}else B.push(ee)}return B}}return[g,v,x]}const[dw,hw,mw]=ab(1),[pw,gw,vw]=ab(.001);Ur(2,-53,53,[1]);function yv(n,a){return n.map(u=>u.map((s,c)=>c==0||c==8||s==null?s:a(c==1||u[8]==0?s:u[1]+s)))}function bv(n,a){return(u,s,c,d,f)=>{let p=a.find(O=>f>=O[0])||a[a.length-1],g,v,x,S,T,w;return s.map(O=>{let Y=n(O),W=Y.getFullYear(),F=Y.getMonth(),B=Y.getDate(),I=Y.getHours(),q=Y.getMinutes(),ae=Y.getSeconds(),ne=W!=g&&p[2]||F!=v&&p[3]||B!=x&&p[4]||I!=S&&p[5]||q!=T&&p[6]||ae!=w&&p[7]||p[1];return g=W,v=F,x=B,S=I,T=q,w=ae,ne(Y)})}}function yw(n,a){let u=Xh(a);return(s,c,d,f,p)=>c.map(g=>u(n(g)))}function Fd(n,a,u){return new Date(n,a,u)}function Sv(n,a){return a(n)}const bw="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function _v(n,a){return(u,s,c,d)=>d==null?Gh:a(n(s))}function Sw(n,a){let u=n.series[a];return u.width?u.stroke(n,a):u.points.width?u.points.stroke(n,a):null}function _w(n,a){return n.series[a].fill(n,a)}const xw={show:!0,live:!0,isolate:!1,mount:qT,markers:{show:!0,width:2,stroke:Sw,fill:_w,dash:"solid"},idx:null,idxs:null,values:[]};function zw(n,a){let u=n.cursor.points,s=wl(),c=u.size(n,a);zt(s,wr,c),zt(s,Mr,c);let d=c/-2;zt(s,"marginLeft",d),zt(s,"marginTop",d);let f=u.width(n,a,c);return f&&zt(s,"borderWidth",f),s}function Ew(n,a){let u=n.series[a].points;return u._fill||u._stroke}function Tw(n,a){let u=n.series[a].points;return u._stroke||u._fill}function ww(n,a){return n.series[a].points.size}const Wd=[0,0];function Mw(n,a,u){return Wd[0]=a,Wd[1]=u,Wd}function mo(n,a,u,s=!0){return c=>{c.button==0&&(!s||c.target==a)&&u(c)}}function Id(n,a,u,s=!0){return c=>{(!s||c.target==a)&&u(c)}}const Aw={show:!0,x:!0,y:!0,lock:!1,move:Mw,points:{one:!1,show:zw,size:ww,width:0,stroke:Tw,fill:Ew},bind:{mousedown:mo,mouseup:mo,click:mo,dblclick:mo,mousemove:Id,mouseleave:Id,mouseenter:Id},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(n,a)=>{a.stopPropagation(),a.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(n,a,u,s,c)=>s-c,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},ib={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Fh=Jt({},ib,{filter:$y}),ub=Jt({},Fh,{size:10}),sb=Jt({},ib,{show:!1}),Wh='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',rb="bold "+Wh,cb=1.5,xv={show:!0,scale:"x",stroke:qh,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:rb,side:2,grid:Fh,ticks:ub,border:sb,font:Wh,lineGap:cb,rotate:0},Ow="Value",Nw="Time",zv={show:!0,scale:"x",auto:!1,sorted:1,min:gt,max:-gt,idxs:[]};function jw(n,a,u,s,c){return a.map(d=>d==null?"":Vh(d))}function Dw(n,a,u,s,c,d,f){let p=[],g=Mi.get(c)||0;u=f?u:vt(Uo(u,c),g);for(let v=u;v<=s;v=vt(v+c,g))p.push(Object.is(v,-0)?0:v);return p}function oh(n,a,u,s,c,d,f){const p=[],g=n.scales[n.axes[a].scale].log,v=g==10?La:Gy,x=hl(v(u));c=hs(g,x),g==10&&(c=iu[Gl(c,iu)]);let S=u,T=c*g;g==10&&(T=iu[Gl(T,iu)]);do p.push(S),S=S+c,g==10&&!Mi.has(S)&&(S=vt(S,Mi.get(c))),S>=T&&(c=S,T=c*g,g==10&&(T=iu[Gl(T,iu)]));while(S<=s);return p}function Cw(n,a,u,s,c,d,f){let g=n.scales[n.axes[a].scale].asinh,v=s>g?oh(n,a,Bn(g,u),s,c):[g],x=s>=0&&u<=0?[0]:[];return(u<-g?oh(n,a,Bn(g,-s),-u,c):[g]).reverse().map(T=>-T).concat(x,v)}const ob=/./,Rw=/[12357]/,Uw=/[125]/,Ev=/1/,fh=(n,a,u,s)=>n.map((c,d)=>a==4&&c==0||d%s==0&&u.test(c.toExponential()[c<0?1:0])?c:null);function kw(n,a,u,s,c){let d=n.axes[u],f=d.scale,p=n.scales[f],g=n.valToPos,v=d._space,x=g(10,f),S=g(9,f)-x>=v?ob:g(7,f)-x>=v?Rw:g(5,f)-x>=v?Uw:Ev;if(S==Ev){let T=en(g(1,f)-x);if(Tc,Mv={show:!0,auto:!0,sorted:0,gaps:fb,alpha:1,facets:[Jt({},wv,{scale:"x"}),Jt({},wv,{scale:"y"})]},Av={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:fb,alpha:1,points:{show:Bw,filter:null},values:null,min:gt,max:-gt,idxs:[],path:null,clip:null};function qw(n,a,u,s,c){return u/10}const db={time:dT,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Gw=Jt({},db,{time:!1,ori:1}),Ov={};function hb(n,a){let u=Ov[n];return u||(u={key:n,plots:[],sub(s){u.plots.push(s)},unsub(s){u.plots=u.plots.filter(c=>c!=s)},pub(s,c,d,f,p,g,v){for(let x=0;x{let F=f.pxRound;const B=v.dir*(v.ori==0?1:-1),I=v.ori==0?_s:xs;let q,ae;B==1?(q=u,ae=s):(q=s,ae=u);let ne=F(S(p[q],v,Y,w)),le=F(T(g[q],x,W,O)),se=F(S(p[ae],v,Y,w)),Ae=F(T(d==1?x.max:x.min,x,W,O)),ze=new Path2D(c);return I(ze,se,Ae),I(ze,ne,Ae),I(ze,ne,le),ze})}function Zo(n,a,u,s,c,d){let f=null;if(n.length>0){f=new Path2D;const p=a==0?Bo:em;let g=u;for(let S=0;ST[0]){let w=T[0]-g;w>0&&p(f,g,s,w,s+d),g=T[1]}}let v=u+c-g,x=10;v>0&&p(f,g,s-x/2,v,s+d+x)}return f}function Yw(n,a,u){let s=n[n.length-1];s&&s[0]==a?s[1]=u:n.push([a,u])}function Ph(n,a,u,s,c,d,f){let p=[],g=n.length;for(let v=c==1?u:s;v>=u&&v<=s;v+=c)if(a[v]===null){let S=v,T=v;if(c==1)for(;++v<=s&&a[v]===null;)T=v;else for(;--v>=u&&a[v]===null;)T=v;let w=d(n[S]),O=T==S?w:d(n[T]),Y=S-c;w=f<=0&&Y>=0&&Y=0&&F>=0&&F=w&&p.push([w,O])}return p}function Nv(n){return n==0?Yy:n==1?Pt:a=>au(a,n)}function mb(n){let a=n==0?Lo:Ho,u=n==0?(c,d,f,p,g,v)=>{c.arcTo(d,f,p,g,v)}:(c,d,f,p,g,v)=>{c.arcTo(f,d,g,p,v)},s=n==0?(c,d,f,p,g)=>{c.rect(d,f,p,g)}:(c,d,f,p,g)=>{c.rect(f,d,g,p)};return(c,d,f,p,g,v=0,x=0)=>{v==0&&x==0?s(c,d,f,p,g):(v=Ql(v,p/2,g/2),x=Ql(x,p/2,g/2),a(c,d+v,f),u(c,d+p,f,d+p,f+g,v),u(c,d+p,f+g,d,f+g,x),u(c,d,f+g,d,f,x),u(c,d,f,d+p,f,v),c.closePath())}}const Lo=(n,a,u)=>{n.moveTo(a,u)},Ho=(n,a,u)=>{n.moveTo(u,a)},_s=(n,a,u)=>{n.lineTo(a,u)},xs=(n,a,u)=>{n.lineTo(u,a)},Bo=mb(0),em=mb(1),pb=(n,a,u,s,c,d)=>{n.arc(a,u,s,c,d)},gb=(n,a,u,s,c,d)=>{n.arc(u,a,s,c,d)},vb=(n,a,u,s,c,d,f)=>{n.bezierCurveTo(a,u,s,c,d,f)},yb=(n,a,u,s,c,d,f)=>{n.bezierCurveTo(u,a,c,s,f,d)};function bb(n){return(a,u,s,c,d)=>gu(a,u,(f,p,g,v,x,S,T,w,O,Y,W)=>{let{pxRound:F,points:B}=f,I,q;v.ori==0?(I=Lo,q=pb):(I=Ho,q=gb);const ae=vt(B.width*Ie,3);let ne=(B.size-B.width)/2*Ie,le=vt(ne*2,3),se=new Path2D,Ae=new Path2D,{left:ze,top:ee,width:ye,height:ce}=a.bbox;Bo(Ae,ze-le,ee-le,ye+le*2,ce+le*2);const Ee=de=>{if(g[de]!=null){let U=F(S(p[de],v,Y,w)),Q=F(T(g[de],x,W,O));I(se,U+ne,Q),q(se,U,Q,ne,0,yo*2)}};if(d)d.forEach(Ee);else for(let de=s;de<=c;de++)Ee(de);return{stroke:ae>0?se:null,fill:se,clip:Ae,flags:gs|dh}})}function Sb(n){return(a,u,s,c,d,f)=>{s!=c&&(d!=s&&f!=s&&n(a,u,s),d!=c&&f!=c&&n(a,u,c),n(a,u,f))}}const $w=Sb(_s),Vw=Sb(xs);function _b(n){const a=Je(n?.alignGaps,0);return(u,s,c,d)=>gu(u,s,(f,p,g,v,x,S,T,w,O,Y,W)=>{[c,d]=Co(g,c,d);let F=f.pxRound,B=ce=>F(S(ce,v,Y,w)),I=ce=>F(T(ce,x,W,O)),q,ae;v.ori==0?(q=_s,ae=$w):(q=xs,ae=Vw);const ne=v.dir*(v.ori==0?1:-1),le={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:gs},se=le.stroke;let Ae=!1;if(d-c>=Y*4){let ce=G=>u.posToVal(G,v.key,!0),Ee=null,de=null,U,Q,me,Oe=B(p[ne==1?c:d]),be=B(p[c]),A=B(p[d]),L=ce(ne==1?be+1:A-1);for(let G=ne==1?c:d;G>=c&&G<=d;G+=ne){let ie=p[G],pe=(ne==1?ieL)?Oe:B(ie),ge=g[G];pe==Oe?ge!=null?(Q=ge,Ee==null?(q(se,pe,I(Q)),U=Ee=de=Q):Qde&&(de=Q)):ge===null&&(Ae=!0):(Ee!=null&&ae(se,Oe,I(Ee),I(de),I(U),I(Q)),ge!=null?(Q=ge,q(se,pe,I(Q)),Ee=de=U=Q):(Ee=de=null,ge===null&&(Ae=!0)),Oe=pe,L=ce(Oe+ne))}Ee!=null&&Ee!=de&&me!=Oe&&ae(se,Oe,I(Ee),I(de),I(U),I(Q))}else for(let ce=ne==1?c:d;ce>=c&&ce<=d;ce+=ne){let Ee=g[ce];Ee===null?Ae=!0:Ee!=null&&q(se,B(p[ce]),I(Ee))}let[ee,ye]=Ih(u,s);if(f.fill!=null||ee!=0){let ce=le.fill=new Path2D(se),Ee=f.fillTo(u,s,f.min,f.max,ee),de=I(Ee),U=B(p[c]),Q=B(p[d]);ne==-1&&([Q,U]=[U,Q]),q(ce,Q,de),q(ce,U,de)}if(!f.spanGaps){let ce=[];Ae&&ce.push(...Ph(p,g,c,d,ne,B,a)),le.gaps=ce=f.gaps(u,s,c,d,ce),le.clip=Zo(ce,v.ori,w,O,Y,W)}return ye!=0&&(le.band=ye==2?[Ha(u,s,c,d,se,-1),Ha(u,s,c,d,se,1)]:Ha(u,s,c,d,se,ye)),le})}function Kw(n){const a=Je(n.align,1),u=Je(n.ascDesc,!1),s=Je(n.alignGaps,0),c=Je(n.extend,!1);return(d,f,p,g)=>gu(d,f,(v,x,S,T,w,O,Y,W,F,B,I)=>{[p,g]=Co(S,p,g);let q=v.pxRound,{left:ae,width:ne}=d.bbox,le=be=>q(O(be,T,B,W)),se=be=>q(Y(be,w,I,F)),Ae=T.ori==0?_s:xs;const ze={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:gs},ee=ze.stroke,ye=T.dir*(T.ori==0?1:-1);let ce=se(S[ye==1?p:g]),Ee=le(x[ye==1?p:g]),de=Ee,U=Ee;c&&a==-1&&(U=ae,Ae(ee,U,ce)),Ae(ee,Ee,ce);for(let be=ye==1?p:g;be>=p&&be<=g;be+=ye){let A=S[be];if(A==null)continue;let L=le(x[be]),G=se(A);a==1?Ae(ee,L,ce):Ae(ee,de,G),Ae(ee,L,G),ce=G,de=L}let Q=de;c&&a==1&&(Q=ae+ne,Ae(ee,Q,ce));let[me,Oe]=Ih(d,f);if(v.fill!=null||me!=0){let be=ze.fill=new Path2D(ee),A=v.fillTo(d,f,v.min,v.max,me),L=se(A);Ae(be,Q,L),Ae(be,U,L)}if(!v.spanGaps){let be=[];be.push(...Ph(x,S,p,g,ye,le,s));let A=v.width*Ie/2,L=u||a==1?A:-A,G=u||a==-1?-A:A;be.forEach(ie=>{ie[0]+=L,ie[1]+=G}),ze.gaps=be=v.gaps(d,f,p,g,be),ze.clip=Zo(be,T.ori,W,F,B,I)}return Oe!=0&&(ze.band=Oe==2?[Ha(d,f,p,g,ee,-1),Ha(d,f,p,g,ee,1)]:Ha(d,f,p,g,ee,Oe)),ze})}function jv(n,a,u,s,c,d,f=gt){if(n.length>1){let p=null;for(let g=0,v=1/0;g{}),{fill:S,stroke:T}=v;return(w,O,Y,W)=>gu(w,O,(F,B,I,q,ae,ne,le,se,Ae,ze,ee)=>{let ye=F.pxRound,ce=u,Ee=s*Ie,de=p*Ie,U=g*Ie,Q,me;q.ori==0?[Q,me]=d(w,O):[me,Q]=d(w,O);const Oe=q.dir*(q.ori==0?1:-1);let be=q.ori==0?Bo:em,A=q.ori==0?x:(oe,lt,Nt,Dl,ra,el,ca)=>{x(oe,lt,Nt,ra,Dl,ca,el)},L=Je(w.bands,Kh).find(oe=>oe.series[0]==O),G=L!=null?L.dir:0,ie=F.fillTo(w,O,F.min,F.max,G),xe=ye(le(ie,ae,ee,Ae)),pe,ge,mt,Qe=ze,nt=ye(F.width*Ie),Nn=!1,Pn=null,jn=null,xn=null,Yl=null;S!=null&&(nt==0||T!=null)&&(Nn=!0,Pn=S.values(w,O,Y,W),jn=new Map,new Set(Pn).forEach(oe=>{oe!=null&&jn.set(oe,new Path2D)}),nt>0&&(xn=T.values(w,O,Y,W),Yl=new Map,new Set(xn).forEach(oe=>{oe!=null&&Yl.set(oe,new Path2D)})));let{x0:$l,size:Ni}=v;if($l!=null&&Ni!=null){ce=1,B=$l.values(w,O,Y,W),$l.unit==2&&(B=B.map(Nt=>w.posToVal(se+Nt*ze,q.key,!0)));let oe=Ni.values(w,O,Y,W);Ni.unit==2?ge=oe[0]*ze:ge=ne(oe[0],q,ze,se)-ne(0,q,ze,se),Qe=jv(B,I,ne,q,ze,se,Qe),mt=Qe-ge+Ee}else Qe=jv(B,I,ne,q,ze,se,Qe),mt=Qe*f+Ee,ge=Qe-mt;mt<1&&(mt=0),nt>=ge/2&&(nt=0),mt<5&&(ye=Yy);let ji=mt>0,Nl=Qe-mt-(ji?nt:0);ge=ye(ch(Nl,U,de)),pe=(ce==0?ge/2:ce==Oe?0:ge)-ce*Oe*((ce==0?Ee/2:0)+(ji?nt/2:0));const Ft={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Vl=Nn?null:new Path2D;let jl=null;if(L!=null)jl=w.data[L.series[1]];else{let{y0:oe,y1:lt}=v;oe!=null&<!=null&&(I=lt.values(w,O,Y,W),jl=oe.values(w,O,Y,W))}let sa=Q*ge,Te=me*ge;for(let oe=Oe==1?Y:W;oe>=Y&&oe<=W;oe+=Oe){let lt=I[oe];if(lt==null)continue;if(jl!=null){let rt=jl[oe]??0;if(lt-rt==0)continue;xe=le(rt,ae,ee,Ae)}let Nt=q.distr!=2||v!=null?B[oe]:oe,Dl=ne(Nt,q,ze,se),ra=le(Je(lt,ie),ae,ee,Ae),el=ye(Dl-pe),ca=ye(Bn(ra,xe)),Dn=ye(Ql(ra,xe)),nn=ca-Dn;if(lt!=null){let rt=lt<0?Te:sa,Qt=lt<0?sa:Te;Nn?(nt>0&&xn[oe]!=null&&be(Yl.get(xn[oe]),el,Dn+hl(nt/2),ge,Bn(0,nn-nt),rt,Qt),Pn[oe]!=null&&be(jn.get(Pn[oe]),el,Dn+hl(nt/2),ge,Bn(0,nn-nt),rt,Qt)):be(Vl,el,Dn+hl(nt/2),ge,Bn(0,nn-nt),rt,Qt),A(w,O,oe,el-nt/2,Dn,ge+nt,nn)}}return nt>0?Ft.stroke=Nn?Yl:Vl:Nn||(Ft._fill=F.width==0?F._fill:F._stroke??F._fill,Ft.width=0),Ft.fill=Nn?jn:Vl,Ft})}function Jw(n,a){const u=Je(a?.alignGaps,0);return(s,c,d,f)=>gu(s,c,(p,g,v,x,S,T,w,O,Y,W,F)=>{[d,f]=Co(v,d,f);let B=p.pxRound,I=Q=>B(T(Q,x,W,O)),q=Q=>B(w(Q,S,F,Y)),ae,ne,le;x.ori==0?(ae=Lo,le=_s,ne=vb):(ae=Ho,le=xs,ne=yb);const se=x.dir*(x.ori==0?1:-1);let Ae=I(g[se==1?d:f]),ze=Ae,ee=[],ye=[];for(let Q=se==1?d:f;Q>=d&&Q<=f;Q+=se)if(v[Q]!=null){let Oe=g[Q],be=I(Oe);ee.push(ze=be),ye.push(q(v[Q]))}const ce={stroke:n(ee,ye,ae,le,ne,B),fill:null,clip:null,band:null,gaps:null,flags:gs},Ee=ce.stroke;let[de,U]=Ih(s,c);if(p.fill!=null||de!=0){let Q=ce.fill=new Path2D(Ee),me=p.fillTo(s,c,p.min,p.max,de),Oe=q(me);le(Q,ze,Oe),le(Q,Ae,Oe)}if(!p.spanGaps){let)DELIM" -R"DELIM( Q=[];Q.push(...Ph(g,v,d,f,se,I,u)),ce.gaps=Q=p.gaps(s,c,d,f,Q),ce.clip=Zo(Q,x.ori,O,Y,W,F)}return U!=0&&(ce.band=U==2?[Ha(s,c,d,f,Ee,-1),Ha(s,c,d,f,Ee,1)]:Ha(s,c,d,f,Ee,U)),ce})}function Fw(n){return Jw(Ww,n)}function Ww(n,a,u,s,c,d){const f=n.length;if(f<2)return null;const p=new Path2D;if(u(p,n[0],a[0]),f==2)s(p,n[1],a[1]);else{let g=Array(f),v=Array(f-1),x=Array(f-1),S=Array(f-1);for(let T=0;T0!=v[T]>0?g[T]=0:(g[T]=3*(S[T-1]+S[T])/((2*S[T]+S[T-1])/v[T-1]+(S[T]+2*S[T-1])/v[T]),isFinite(g[T])||(g[T]=0));g[f-1]=v[f-2];for(let T=0;T{cn.pxRatio=Ie}));const Iw=_b(),Pw=bb();function Cv(n,a,u,s){return(s?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((d,f)=>mh(d,f,a,u))}function e3(n,a){return n.map((u,s)=>s==0?{}:Jt({},a,u))}function mh(n,a,u,s){return Jt({},a==0?u:s,n)}function xb(n,a,u){return a==null?ms:[a,u]}const t3=xb;function n3(n,a,u){return a==null?ms:wo(a,u,$h,!0)}function zb(n,a,u,s){return a==null?ms:Ro(a,u,n.scales[s].log,!1)}const l3=zb;function Eb(n,a,u,s){return a==null?ms:Yh(a,u,n.scales[s].log,!1)}const a3=Eb;function i3(n,a,u,s,c){let d=Bn(fv(n),fv(a)),f=a-n,p=Gl(c/s*f,u);do{let g=u[p],v=s*g/f;if(v>=c&&d+(g<5?Mi.get(g):0)<=17)return[g,v]}while(++p(a=Pt((u=+c)*Ie))+"px"),[n,a,u]}function u3(n){n.show&&[n.font,n.labelFont].forEach(a=>{let u=vt(a[2]*Ie,1);a[0]=a[0].replace(/[0-9.]+px/,u+"px"),a[1]=u})}function cn(n,a,u){const s={mode:Je(n.mode,1)},c=s.mode;function d(m,y,_,E){let N=y.valToPct(m);return E+_*(y.dir==-1?1-N:N)}function f(m,y,_,E){let N=y.valToPct(m);return E+_*(y.dir==-1?N:1-N)}function p(m,y,_,E){return y.ori==0?d(m,y,_,E):f(m,y,_,E)}s.valToPosH=d,s.valToPosV=f;let g=!1;s.status=0;const v=s.root=wl(hT);if(n.id!=null&&(v.id=n.id),ol(v,n.class),n.title){let m=wl(gT,v);m.textContent=n.title}const x=ql("canvas"),S=s.ctx=x.getContext("2d"),T=wl(vT,v);ou("click",T,m=>{m.target===O&&(Pe!=kn||at!=Il)&&Ve.click(s,m)},!0);const w=s.under=wl(yT,T);T.appendChild(x);const O=s.over=wl(bT,T);n=ps(n);const Y=+Je(n.pxAlign,1),W=Nv(Y);(n.plugins||[]).forEach(m=>{m.opts&&(n=m.opts(s,n)||n)});const F=n.ms||.001,B=s.series=c==1?Cv(n.series||[],zv,Av,!1):e3(n.series||[null],Mv),I=s.axes=Cv(n.axes||[],xv,Tv,!0),q=s.scales={},ae=s.bands=n.bands||[];ae.forEach(m=>{m.fill=Ge(m.fill||null),m.dir=Je(m.dir,-1)});const ne=c==2?B[1].facets[0].scale:B[0].scale,le={axes:js,series:Go},se=(n.drawOrder||["axes","series"]).map(m=>le[m]);function Ae(m){const y=m.distr==3?_=>La(_>0?_:m.clamp(s,_,m.min,m.max,m.key)):m.distr==4?_=>Jd(_,m.asinh):m.distr==100?_=>m.fwd(_):_=>_;return _=>{let E=y(_),{_min:N,_max:C}=m,V=C-N;return(E-N)/V}}function ze(m){let y=q[m];if(y==null){let _=(n.scales||jr)[m]||jr;if(_.from!=null){ze(_.from);let E=Jt({},q[_.from],_,{key:m});E.valToPct=Ae(E),q[m]=E}else{y=q[m]=Jt({},m==ne?db:Gw,_),y.key=m;let E=y.time,N=y.range,C=zi(N);if((m!=ne||c==2&&!E)&&(C&&(N[0]==null||N[1]==null)&&(N={min:N[0]==null?rv:{mode:1,hard:N[0],soft:N[0]},max:N[1]==null?rv:{mode:1,hard:N[1],soft:N[1]}},C=!1),!C&&ko(N))){let V=N;N=(P,te,ue)=>te==null?ms:wo(te,ue,V)}y.range=Ge(N||(E?t3:m==ne?y.distr==3?l3:y.distr==4?a3:xb:y.distr==3?zb:y.distr==4?Eb:n3)),y.auto=Ge(C?!1:y.auto),y.clamp=Ge(y.clamp||qw),y._min=y._max=null,y.valToPct=Ae(y)}}}ze("x"),ze("y"),c==1&&B.forEach(m=>{ze(m.scale)}),I.forEach(m=>{ze(m.scale)});for(let m in n.scales)ze(m);const ee=q[ne],ye=ee.distr;let ce,Ee;ee.ori==0?(ol(v,mT),ce=d,Ee=f):(ol(v,pT),ce=f,Ee=d);const de={};for(let m in q){let y=q[m];(y.min!=null||y.max!=null)&&(de[m]={min:y.min,max:y.max},y.min=y.max=null)}const U=n.tzDate||(m=>new Date(Pt(m/F))),Q=n.fmtDate||Xh,me=F==1?mw(U):vw(U),Oe=bv(U,yv(F==1?hw:gw,Q)),be=_v(U,Sv(bw,Q)),A=[],L=s.legend=Jt({},xw,n.legend),G=s.cursor=Jt({},Aw,{drag:{y:c==2}},n.cursor),ie=L.show,xe=G.show,pe=L.markers;L.idxs=A,pe.width=Ge(pe.width),pe.dash=Ge(pe.dash),pe.stroke=Ge(pe.stroke),pe.fill=Ge(pe.fill);let ge,mt,Qe,nt=[],Nn=[],Pn,jn=!1,xn={};if(L.live){const m=B[1]?B[1].values:null;jn=m!=null,Pn=jn?m(s,1,0):{_:0};for(let y in Pn)xn[y]=Gh}if(ie)if(ge=ql("table",TT,v),Qe=ql("tbody",null,ge),L.mount(s,ge),jn){mt=ql("thead",null,ge,Qe);let m=ql("tr",null,mt);ql("th",null,m);for(var Yl in Pn)ql("th",J0,m).textContent=Yl}else ol(ge,MT),L.live&&ol(ge,wT);const $l={show:!0},Ni={show:!1};function ji(m,y){if(y==0&&(jn||!L.live||c==2))return ms;let _=[],E=ql("tr",AT,Qe,Qe.childNodes[y]);ol(E,m.class),m.show||ol(E,uu);let N=ql("th",null,E);if(pe.show){let P=wl(OT,N);if(y>0){let te=pe.width(s,y);te&&(P.style.border=te+"px "+pe.dash(s,y)+" "+pe.stroke(s,y)),P.style.background=pe.fill(s,y)}}let C=wl(J0,N);m.label instanceof HTMLElement?C.appendChild(m.label):C.textContent=m.label,y>0&&(pe.show||(C.style.color=m.width>0?pe.stroke(s,y):pe.fill(s,y)),Ft("click",N,P=>{if(G._lock)return;tl(P);let te=B.indexOf(m);if((P.ctrlKey||P.metaKey)!=L.isolate){let ue=B.some((re,fe)=>fe>0&&fe!=te&&re.show);B.forEach((re,fe)=>{fe>0&&Zn(fe,ue?fe==te?$l:Ni:$l,!0,Dt.setSeries)})}else Zn(te,{show:!m.show},!0,Dt.setSeries)},!1),da&&Ft(P0,N,P=>{G._lock||(tl(P),Zn(B.indexOf(m),Wa,!0,Dt.setSeries))},!1));for(var V in Pn){let P=ql("td",NT,E);P.textContent="--",_.push(P)}return[E,_]}const Nl=new Map;function Ft(m,y,_,E=!0){const N=Nl.get(y)||{},C=G.bind[m](s,y,_,E);C&&(ou(m,y,N[m]=C),Nl.set(y,N))}function Vl(m,y,_){const E=Nl.get(y)||{};for(let N in E)(m==null||N==m)&&(rh(N,y,E[N]),delete E[N]);m==null&&Nl.delete(y)}let jl=0,sa=0,Te=0,oe=0,lt=0,Nt=0,Dl=lt,ra=Nt,el=Te,ca=oe,Dn=0,nn=0,rt=0,Qt=0;s.bbox={};let on=!1,vu=!1,Ba=!1,oa=!1,fa=!1,fn=!1;function qa(m,y,_){(_||m!=s.width||y!=s.height)&&Kl(m,y),$a(!1),Ba=!0,vu=!0,Wl()}function Kl(m,y){s.width=jl=Te=m,s.height=sa=oe=y,lt=Nt=0,Br(),zs();let _=s.bbox;Dn=_.left=au(lt*Ie,.5),nn=_.top=au(Nt*Ie,.5),rt=_.width=au(Te*Ie,.5),Qt=_.height=au(oe*Ie,.5)}const yu=3;function Di(){let m=!1,y=0;for(;!m;){y++;let _=Yr(y),E=$r(y);m=y==yu||_&&E,m||(Kl(s.width,s.height),vu=!0)}}function qo({width:m,height:y}){qa(m,y)}s.setSize=qo;function Br(){let m=!1,y=!1,_=!1,E=!1;I.forEach((N,C)=>{if(N.show&&N._show){let{side:V,_size:P}=N,te=V%2,ue=N.label!=null?N.labelSize:0,re=P+ue;re>0&&(te?(Te-=re,V==3?(lt+=re,E=!0):_=!0):(oe-=re,V==0?(Nt+=re,m=!0):y=!0))}}),qn[0]=m,qn[1]=_,qn[2]=y,qn[3]=E,Te-=Rl[1]+Rl[3],lt+=Rl[3],oe-=Rl[2]+Rl[0],Nt+=Rl[0]}function zs(){let m=lt+Te,y=Nt+oe,_=lt,E=Nt;function N(C,V){switch(C){case 1:return m+=V,m-V;case 2:return y+=V,y-V;case 3:return _-=V,_+V;case 0:return E-=V,E+V}}I.forEach((C,V)=>{if(C.show&&C._show){let P=C.side;C._pos=N(P,C._size),C.label!=null&&(C._lpos=N(P,C.labelSize))}})}if(G.dataIdx==null){let m=G.hover,y=m.skip=new Set(m.skip??[]);y.add(void 0);let _=m.prox=Ge(m.prox),E=m.bias??=0;G.dataIdx=(N,C,V,P)=>{if(C==0)return V;let te=V,ue=_(N,C,V,P)??gt,re=ue>=0&&ue0;)y.has(Ce[Se])||(Ue=Se);if(E==0||E==1)for(Se=V;Ne==null&&Se++ue&&(te=null);return te}}const tl=m=>{G.event=m};G.idxs=A,G._lock=!1;let ln=G.points;ln.show=Ge(ln.show),ln.size=Ge(ln.size),ln.stroke=Ge(ln.stroke),ln.width=Ge(ln.width),ln.fill=Ge(ln.fill);const nl=s.focus=Jt({},n.focus||{alpha:.3},G.focus),da=nl.prox>=0,ha=da&&ln.one;let zn=[],Xl=[],ma=[];function Es(m,y){let _=ln.show(s,y);if(_ instanceof HTMLElement)return ol(_,ET),ol(_,m.class),ia(_,-10,-10,Te,oe),O.insertBefore(_,zn[y]),_}function)DELIM" -R"DELIM( Cl(m,y){if(c==1||y>0){let _=c==1&&q[m.scale].time,E=m.value;m.value=_?mv(E)?_v(U,Sv(E,Q)):E||be:E||Lw,m.label=m.label||(_?Nw:Ow)}if(ha||y>0){m.width=m.width==null?1:m.width,m.paths=m.paths||Iw||GT,m.fillTo=Ge(m.fillTo||Qw),m.pxAlign=+Je(m.pxAlign,Y),m.pxRound=Nv(m.pxAlign),m.stroke=Ge(m.stroke||null),m.fill=Ge(m.fill||null),m._stroke=m._fill=m._paths=m._focus=null;let _=Hw(Bn(1,m.width),1),E=m.points=Jt({},{size:_,width:Bn(1,_*.2),stroke:m.stroke,space:_*2,paths:Pw,_stroke:null,_fill:null},m.points);E.show=Ge(E.show),E.filter=Ge(E.filter),E.fill=Ge(E.fill),E.stroke=Ge(E.stroke),E.paths=Ge(E.paths),E.pxAlign=m.pxAlign}if(ie){let _=ji(m,y);nt.splice(y,0,_[0]),Nn.splice(y,0,_[1]),L.values.push(null)}if(xe){A.splice(y,0,null);let _=null;ha?y==0&&(_=Es(m,y)):y>0&&(_=Es(m,y)),zn.splice(y,0,_),Xl.splice(y,0,0),ma.splice(y,0,0)}Ht("addSeries",y)}function Wt(m,y){y=y??B.length,m=c==1?mh(m,y,zv,Av):mh(m,y,{},Mv),B.splice(y,0,m),Cl(B[y],y)}s.addSeries=Wt;function En(m){if(B.splice(m,1),ie){L.values.splice(m,1),Nn.splice(m,1);let y=nt.splice(m,1)[0];Vl(null,y.firstChild),y.remove()}xe&&(A.splice(m,1),zn.splice(m,1)[0].remove(),Xl.splice(m,1),ma.splice(m,1)),Ht("delSeries",m)}s.delSeries=En;const qn=[!1,!1,!1,!1];function Ts(m,y){if(m._show=m.show,m.show){let _=m.side%2,E=q[m.scale];E==null&&(m.scale=_?B[1].scale:ne,E=q[m.scale]);let N=E.time;m.size=Ge(m.size),m.space=Ge(m.space),m.rotate=Ge(m.rotate),zi(m.incrs)&&m.incrs.forEach(V=>{!Mi.has(V)&&Mi.set(V,Ky(V))}),m.incrs=Ge(m.incrs||(E.distr==2?ow:N?F==1?dw:pw:iu)),m.splits=Ge(m.splits||(N&&E.distr==1?me:E.distr==3?oh:E.distr==4?Cw:Dw)),m.stroke=Ge(m.stroke),m.grid.stroke=Ge(m.grid.stroke),m.ticks.stroke=Ge(m.ticks.stroke),m.border.stroke=Ge(m.border.stroke);let C=m.values;m.values=zi(C)&&!zi(C[0])?Ge(C):N?zi(C)?bv(U,yv(C,Q)):mv(C)?yw(U,C):C||Oe:C||jw,m.filter=Ge(m.filter||(E.distr>=3&&E.log==10?kw:E.distr==3&&E.log==2?Zw:$y)),m.font=Rv(m.font),m.labelFont=Rv(m.labelFont),m._size=m.size(s,null,y,0),m._space=m._rotate=m._incrs=m._found=m._splits=m._values=null,m._size>0&&(qn[y]=!0,m._el=wl(ST,T))}}function Ci(m,y,_,E){let[N,C,V,P]=_,te=y%2,ue=0;return te==0&&(P||C)&&(ue=y==0&&!N||y==2&&!V?Pt(xv.size/3):0),te==1&&(N||V)&&(ue=y==1&&!C||y==3&&!P?Pt(Tv.size/2):0),ue}const qr=s.padding=(n.padding||[Ci,Ci,Ci,Ci]).map(m=>Ge(Je(m,Ci))),Rl=s._padding=qr.map((m,y)=>m(s,y,qn,0));let Mt,jt=null,bt=null;const Ul=c==1?B[0].idxs:null;let dn=null,pl=!1;function Lt(m,y){if(a=m??[],s.data=s._data=a,c==2){Mt=0;for(let _=1;_=0,fn=!0,Wl()}}s.setData=Lt;function bu(){pl=!0;let m,y;c==1&&(Mt>0?(jt=Ul[0]=0,bt=Ul[1]=Mt-1,m=a[0][jt],y=a[0][bt],ye==2?(m=jt,y=bt):m==y&&(ye==3?[m,y]=Ro(m,m,ee.log,!1):ye==4?[m,y]=Yh(m,m,ee.log,!1):ee.time?y=m+Pt(86400/F):[m,y]=wo(m,y,$h,!0))):(jt=Ul[0]=m=null,bt=Ul[1]=y=null)),Qn(ne,m,y)}let Ri,Gn,Jl,ws,Su,_u,Ms,Ga,Qa,Et;function Cn(m,y,_,E,N,C){m??=W0,_??=Kh,E??="butt",N??=W0,C??="round",m!=Ri&&(S.strokeStyle=Ri=m),N!=Gn&&(S.fillStyle=Gn=N),y!=Jl&&(S.lineWidth=Jl=y),C!=Su&&(S.lineJoin=Su=C),E!=_u&&(S.lineCap=_u=E),_!=ws&&S.setLineDash(ws=_)}function As(m,y,_,E){y!=Gn&&(S.fillStyle=Gn=y),m!=Ms&&(S.font=Ms=m),_!=Ga&&(S.textAlign=Ga=_),E!=Qa&&(S.textBaseline=Qa=E)}function Os(m,y,_,E,N=0){if(E.length>0&&m.auto(s,pl)&&(y==null||y.min==null)){let C=Je(jt,0),V=Je(bt,E.length-1),P=_.min==null?kT(E,C,V,N,m.distr==3):[_.min,_.max];m.min=Ql(m.min,_.min=P[0]),m.max=Bn(m.max,_.max=P[1])}}const xu={min:null,max:null};function Gr(){for(let E in q){let N=q[E];de[E]==null&&(N.min==null||de[ne]!=null&&N.auto(s,pl))&&(de[E]=xu)}for(let E in q){let N=q[E];de[E]==null&&N.from!=null&&de[N.from]!=null&&(de[E]=xu)}de[ne]!=null&&$a(!0);let m={};for(let E in de){let N=de[E];if(N!=null){let C=m[E]=ps(q[E],$T);if(N.min!=null)Jt(C,N);else if(E!=ne||c==2)if(Mt==0&&C.from==null){let V=C.range(s,null,null,E);C.min=V[0],C.max=V[1]}else C.min=gt,C.max=-gt}}if(Mt>0){B.forEach((E,N)=>{if(c==1){let C=E.scale,V=de[C];if(V==null)return;let P=m[C];if(N==0){let te=P.range(s,P.min,P.max,C);P.min=te[0],P.max=te[1],jt=Gl(P.min,a[0]),bt=Gl(P.max,a[0]),bt-jt>1&&(a[0][jt]P.max&&bt--),E.min=dn[jt],E.max=dn[bt]}else E.show&&E.auto&&Os(P,V,E,a[N],E.sorted);E.idxs[0]=jt,E.idxs[1]=bt}else if(N>0&&E.show&&E.auto){let[C,V]=E.facets,P=C.scale,te=V.scale,[ue,re]=a[N],fe=m[P],De=m[te];fe!=null&&Os(fe,de[P],C,ue,C.sorted),De!=null&&Os(De,de[te],V,re,V.sorted),E.min=V.min,E.max=V.max}});for(let E in m){let N=m[E],C=de[E];if(N.from==null&&(C==null||C.min==null)){let V=N.range(s,N.min==gt?null:N.min,N.max==-gt?null:N.max,E);N.min=V[0],N.max=V[1]}}}for(let E in m){let N=m[E];if(N.from!=null){let C=m[N.from];if(C.min==null)N.min=N.max=null;else{let V=N.range(s,C.min,C.max,E);N.min=V[0],N.max=V[1]}}}let y={},_=!1;for(let E in m){let N=m[E],C=q[E];if(C.min!=N.min||C.max!=N.max){C.min=N.min,C.max=N.max;let V=C.distr;C._min=V==3?La(C.min):V==4?Jd(C.min,C.asinh):V==100?C.fwd(C.min):C.min,C._max=V==3?La(C.max):V==4?Jd(C.max,C.asinh):V==100?C.fwd(C.max):C.max,y[E]=_=!0}}if(_){B.forEach((E,N)=>{c==2?N>0&&y.y&&(E._paths=null):y[E.scale]&&(E._paths=null)});for(let E in y)Ba=!0,Ht("setScale",E);xe&&G.left>=0&&(oa=fn=!0)}for(let E in de)de[E]=null}function zu(m){let y=ch(jt-1,0,Mt-1),_=ch(bt+1,0,Mt-1);for(;m[y]==null&&y>0;)y--;for(;m[_]==null&&_0){let m=B.some(y=>y._focus)&&Et!=nl.alpha;m&&(S.globalAlpha=Et=nl.alpha),B.forEach((y,_)=>{if(_>0&&y.show&&(Rn(_,!1),Rn(_,!0),y._paths==null)){let E=Et;Et!=y.alpha&&(S.globalAlpha=Et=y.alpha);let N=c==2?[0,a[_][0].length-1]:zu(a[_]);y._paths=y.paths(s,_,N[0],N[1]),Et!=E&&(S.globalAlpha=Et=E)}}),B.forEach((y,_)=>{if(_>0&&y.show){let E=Et;Et!=y.alpha&&(S.globalAlpha=Et=y.alpha),y._paths!=null&&Eu(_,!1);{let N=y._paths!=null?y._paths.gaps:null,C=y.points.show(s,_,jt,bt,N),V=y.points.filter(s,_,C,N);(C||V)&&(y.points._paths=y.points.paths(s,_,jt,bt,V),Eu(_,!0))}Et!=E&&(S.globalAlpha=Et=E),Ht("drawSeries",_)}}),m&&(S.globalAlpha=Et=1)}}function Rn(m,y){let _=y?B[m].points:B[m];_._stroke=_.stroke(s,m),_._fill=_.fill(s,m)}function Eu(m,y){let _=y?B[m].points:B[m],{stroke:E,fill:N,clip:C,flags:V,_stroke:P=_._stroke,_fill:te=_._fill,_width:ue=_.width}=_._paths;ue=vt(ue*Ie,3);let re=null,fe=ue%2/2;y&&te==null&&(te=ue>0?"#fff":P);let De=_.pxAlign==1&&fe>0;if(De&&S.translate(fe,fe),!y){let $e=Dn-ue/2,Ce=nn-ue/2,Ue=rt+ue,Ne=Qt+ue;re=new Path2D,re.rect($e,Ce,Ue,Ne)}y?Fl(P,ue,_.dash,_.cap,te,E,N,V,C):Qr(m,P,ue,_.dash,_.cap,te,E,N,V,re,C),De&&S.translate(-fe,-fe)}function Qr(m,y,_,E,N,C,V,P,te,ue,re){let fe=!1;te!=0&&ae.forEach((De,$e)=>{if(De.series[0]==m){let Ce=B[De.series[1]],Ue=a[De.series[1]],Ne=(Ce._paths||jr).band;zi(Ne)&&(Ne=De.dir==1?Ne[0]:Ne[1]);let Se,ct=null;Ce.show&&Ne&<(Ue,jt,bt)?(ct=De.fill(s,$e)||C,Se=Ce._paths.clip):Ne=null,Fl(y,_,E,N,ct,V,P,te,ue,re,Se,Ne),fe=!0}}),fe||Fl(y,_,E,N,C,V,P,te,ue,re)}const Tu=gs|dh;function Fl(m,y,_,E,N,C,V,P,te,ue,re,fe){Cn(m,y,_,E,N),(te||ue||fe)&&(S.save(),te&&S.clip(te),ue&&S.clip(ue)),fe?(P&Tu)==Tu?(S.clip(fe),re&&S.clip(re),ki(N,V),Ui(m,C,y)):P&dh?(ki(N,V),S.clip(fe),Ui(m,C,y)):P&gs&&(S.save(),S.clip(fe),re&&S.clip(re),ki(N,V),S.restore(),Ui(m,C,y)):(ki(N,V),Ui(m,C,y)),(te||ue||fe)&&S.restore()}function Ui(m,y,_){_>0&&(y instanceof Map?y.forEach((E,N)=>{S.strokeStyle=Ri=N,S.stroke(E)}):y!=null&&m&&S.stroke(y))}function ki(m,y){y instanceof Map?y.forEach((_,E)=>{S.fillStyle=Gn=E,S.fill(_)}):y!=null&&m&&S.fill(y)}function Ya(m,y,_,E){let N=I[m],C;if(E<=0)C=[0,0];else{let V=N._space=N.space(s,m,y,_,E),P=N._incrs=N.incrs(s,m,y,_,E,V);C=i3(y,_,P,E,V)}return N._found=C}function Ns(m,y,_,E,N,C,V,P,te,ue){let re=V%2/2;Y==1&&S.translate(re,re),Cn(P,V,te,ue,P),S.beginPath();let fe,De,$e,Ce,Ue=N+(E==0||E==3?-C:C);_==0?(De=N,Ce=Ue):(fe=N,$e=Ue);for(let Ne=0;)DELIM" -R"DELIM(Ne{if(!_.show)return;let N=q[_.scale];if(N.min==null){_._show&&(y=!1,_._show=!1,$a(!1));return}else _._show||(y=!1,_._show=!0,$a(!1));let C=_.side,V=C%2,{min:P,max:te}=N,[ue,re]=Ya(E,P,te,V==0?Te:oe);if(re==0)return;let fe=N.distr==2,De=_._splits=_.splits(s,E,P,te,ue,re,fe),$e=N.distr==2?De.map(Se=>dn[Se]):De,Ce=N.distr==2?dn[De[1]]-dn[De[0]]:ue,Ue=_._values=_.values(s,_.filter(s,$e,E,re,Ce),E,re,Ce);_._rotate=C==2?_.rotate(s,Ue,E,re):0;let Ne=_._size;_._size=Ml(_.size(s,Ue,E,m)),Ne!=null&&_._size!=Ne&&(y=!1)}),y}function $r(m){let y=!0;return qr.forEach((_,E)=>{let N=_(s,E,qn,m);N!=Rl[E]&&(y=!1),Rl[E]=N}),y}function js(){for(let m=0;mdn[sn]):$e,Ue=re.distr==2?dn[$e[1]]-dn[$e[0]]:te,Ne=y.ticks,Se=y.border,ct=Ne.show?Ne.size:0,St=Pt(ct*Ie),Ct=Pt((y.alignTo==2?y._size-ct-y.gap:y.gap)*Ie),et=y._rotate*-yo/180,it=W(y._pos*Ie),hn=(St+Ct)*P,Bt=it+hn;C=E==0?Bt:0,N=E==1?Bt:0;let wn=y.font[0],Yn=y.align==1?as:y.align==2?Vd:et>0?as:et<0?Vd:E==0?"center":_==3?Vd:as,an=et||E==1?"middle":_==2?zr:F0;As(wn,V,Yn,an);let Yt=y.font[1]*y.lineGap,Mn=$e.map(sn=>W(p(sn,re,fe,De))),$n=y._values;for(let sn=0;sn<$n.length;sn++){let An=$n[sn];if(An!=null){E==0?N=Mn[sn]:C=Mn[sn],An=""+An;let ea=An.indexOf(` -`)==-1?[An]:An.split(/\n/gm);for(let mn=0;mn{_>0&&(y._paths=null,m&&(c==1?(y.min=null,y.max=null):y.facets.forEach(E=>{E.min=null,E.max=null})))})}let wu=!1,Va=!1,Un=[];function Ds(){Va=!1;for(let m=0;m0&&queueMicrotask(Ds)}s.batch=Ka;function pa(){if(on&&(Gr(),on=!1),Ba&&(Di(),Ba=!1),vu){if(zt(w,as,lt),zt(w,zr,Nt),zt(w,wr,Te),zt(w,Mr,oe),zt(O,as,lt),zt(O,zr,Nt),zt(O,wr,Te),zt(O,Mr,oe),zt(T,wr,jl),zt(T,Mr,sa),x.width=Pt(jl*Ie),x.height=Pt(sa*Ie),I.forEach(({_el:m,_show:y,_size:_,_pos:E,side:N})=>{if(m!=null)if(y){let C=N===3||N===0?_:0,V=N%2==1;zt(m,V?"left":"top",E-C),zt(m,V?"width":"height",_),zt(m,V?"top":"left",V?Nt:lt),zt(m,V?"height":"width",V?oe:Te),sh(m,uu)}else ol(m,uu)}),Ri=Gn=Jl=Su=_u=Ms=Ga=Qa=ws=null,Et=1,qi(!0),lt!=Dl||Nt!=ra||Te!=el||oe!=ca){$a(!1);let m=Te/el,y=oe/ca;if(xe&&!oa&&G.left>=0){G.left*=m,G.top*=y,gl&&ia(gl,Pt(G.left),0,Te,oe),Tn&&ia(Tn,0,Pt(G.top),Te,oe);for(let _=0;_=0&&Fe.width>0){Fe.left*=m,Fe.width*=m,Fe.top*=y,Fe.height*=y;for(let _ in Ls)zt(Ja,_,Fe[_])}Dl=lt,ra=Nt,el=Te,ca=oe}Ht("setSize"),vu=!1}jl>0&&sa>0&&(S.clearRect(0,0,x.width,x.height),Ht("drawClear"),se.forEach(m=>m()),Ht("draw")),Fe.show&&fa&&(Fa(Fe),fa=!1),xe&&oa&&(va(null,!0,!1),oa=!1),L.show&&L.live&&fn&&(ks(),fn=!1),g||(g=!0,s.status=1,Ht("ready")),pl=!1,wu=!1}s.redraw=(m,y)=>{Ba=y||!1,m!==!1?Qn(ne,ee.min,ee.max):Wl()};function Mu(m,y){let _=q[m];if(_.from==null){if(Mt==0){let E=_.range(s,y.min,y.max,m);y.min=E[0],y.max=E[1]}if(y.min>y.max){let E=y.min;y.min=y.max,y.max=E}if(Mt>1&&y.min!=null&&y.max!=null&&y.max-y.min<1e-16)return;m==ne&&_.distr==2&&Mt>0&&(y.min=Gl(y.min,a[0]),y.max=Gl(y.max,a[0]),y.min==y.max&&y.max++),de[m]=y,on=!0,Wl()}}s.setScale=Mu;let Zi,Au,gl,Tn,Ou,Xa,kn,Il,Li,Cs,Pe,at,kl=!1;const Ve=G.drag;let yt=Ve.x,At=Ve.y;xe&&(G.x&&(Zi=wl(xT,O)),G.y&&(Au=wl(zT,O)),ee.ori==0?(gl=Zi,Tn=Au):(gl=Au,Tn=Zi),Pe=G.left,at=G.top);const Fe=s.select=Jt({show:!0,over:!0,left:0,width:0,top:0,height:0},n.select),Ja=Fe.show?wl(_T,Fe.over?O:w):null;function Fa(m,y){if(Fe.show){for(let _ in m)Fe[_]=m[_],_ in Ls&&zt(Ja,_,m[_]);y!==!1&&Ht("setSelect")}}s.setSelect=Fa;function Rs(m){if(B[m].show)ie&&sh(nt[m],uu);else if(ie&&ol(nt[m],uu),xe){let _=ha?zn[0]:zn[m];_!=null&&ia(_,-10,-10,Te,oe)}}function Qn(m,y,_){Mu(m,{min:y,max:_})}function Zn(m,y,_,E){y.focus!=null&&Vo(m),y.show!=null&&B.forEach((N,C)=>{C>0&&(m==C||m==null)&&(N.show=y.show,Rs(C),c==2?(Qn(N.facets[0].scale,null,null),Qn(N.facets[1].scale,null,null)):Qn(N.scale,null,null),Wl())}),_!==!1&&Ht("setSeries",m,y),E&&Pa("setSeries",s,m,y)}s.setSeries=Zn;function Vr(m,y){Jt(ae[m],y)}function Qo(m,y){m.fill=Ge(m.fill||null),m.dir=Je(m.dir,-1),y=y??ae.length,ae.splice(y,0,m)}function Yo(m){m==null?ae.length=0:ae.splice(m,1)}s.addBand=Qo,s.setBand=Vr,s.delBand=Yo;function $o(m,y){B[m].alpha=y,xe&&zn[m]!=null&&(zn[m].style.opacity=y),ie&&nt[m]&&(nt[m].style.opacity=y)}let ll,Pl,ga;const Wa={focus:!0};function Vo(m){if(m!=ga){let y=m==null,_=nl.alpha!=1;B.forEach((E,N)=>{if(c==1||N>0){let C=y||N==0||N==m;E._focus=y?null:C,_&&$o(N,C?1:nl.alpha)}}),ga=m,_&&Wl()}}ie&&da&&Ft(ev,ge,m=>{G._lock||(tl(m),ga!=null&&Zn(null,Wa,!0,Dt.setSeries))});function vl(m,y,_){let E=q[y];_&&(m=m/Ie-(E.ori==1?Nt:lt));let N=Te;E.ori==1&&(N=oe,m=N-m),E.dir==-1&&(m=N-m);let C=E._min,V=E._max,P=m/N,te=C+(V-C)*P,ue=E.distr;return ue==3?hs(10,te):ue==4?BT(te,E.asinh):ue==100?E.bwd(te):te}function Kr(m,y){let _=vl(m,ne,y);return Gl(_,a[0],jt,bt)}s.valToIdx=m=>Gl(m,a[0]),s.posToIdx=Kr,s.posToVal=vl,s.valToPos=(m,y,_)=>q[y].ori==0?d(m,q[y],_?rt:Te,_?Dn:0):f(m,q[y],_?Qt:oe,_?nn:0),s.setCursor=(m,y,_)=>{Pe=m.left,at=m.top,va(null,y,_)};function Xr(m,y){zt(Ja,as,Fe.left=m),zt(Ja,wr,Fe.width=y)}function Jr(m,y){zt(Ja,zr,Fe.top=m),zt(Ja,Mr,Fe.height=y)}let Hi=ee.ori==0?Xr:Jr,Bi=ee.ori==1?Xr:Jr;function Us(){if(ie&&L.live)for(let m=c==2?1:0;m{A[E]=_}):YT(m.idx)||A.fill(m.idx),L.idx=A[0]),ie&&L.live){for(let _=0;_0||c==1&&!jn)&&Ko(_,A[_]);Us()}fn=!1,y!==!1&&Ht("setLegend")}s.setLegend=ks;function Ko(m,y){let _=B[m],E=m==0&&ye==2?dn:a[m],N;jn?N=_.values(s,m,y)??xn:(N=_.value(s,y==null?null:E[y],m,y),N=N==null?xn:{_:N}),L.values[m]=N}function va(m,y,_){Li=Pe,Cs=at,[Pe,at]=G.move(s,Pe,at),G.left=Pe,G.top=at,xe&&(gl&&ia(gl,Pt(Pe),0,Te,oe),Tn&&ia(Tn,0,Pt(at),Te,oe));let E,N=jt>bt;ll=gt,Pl=null;let C=ee.ori==0?Te:oe,V=ee.ori==1?Te:oe;if(Pe<0||Mt==0||N){E=G.idx=null;for(let P=0;P0&&ct.show){let hn=et==null?-10:et==E?ue:ce(c==1?a[0][et]:a[Se][0][et],ee,C,0),Bt=it==null?-10:Ee(it,c==1?q[ct.scale]:q[ct.facets[1].scale],V,0);if(da&&it!=null){let wn=ee.ori==1?Pe:at,Yn=en(nl.dist(s,Se,et,Bt,wn));if(Yn=0?1:-1,$n=Yt>=0?1:-1;$n==Mn&&($n==1?an=)DELIM" -R"DELIM(=1?it>=Yt:it<=Yt:an==1?it<=Yt:it>=Yt)&&(ll=Yn,Pl=Se)}else ll=Yn,Pl=Se}}if(fn||ha){let wn,Yn;ee.ori==0?(wn=hn,Yn=Bt):(wn=Bt,Yn=hn);let an,Yt,Mn,$n,un,sn,An=!0,ea=ln.bbox;if(ea!=null){An=!1;let mn=ea(s,Se);Mn=mn.left,$n=mn.top,an=mn.width,Yt=mn.height}else Mn=wn,$n=Yn,an=Yt=ln.size(s,Se);if(sn=ln.fill(s,Se),un=ln.stroke(s,Se),ha)Se==Pl&&ll<=nl.prox&&(re=Mn,fe=$n,De=an,$e=Yt,Ce=An,Ue=sn,Ne=un);else{let mn=zn[Se];mn!=null&&(Xl[Se]=Mn,ma[Se]=$n,sv(mn,an,Yt,An),iv(mn,sn,un),ia(mn,Ml(Mn),Ml($n),Te,oe))}}}}if(ha){let Se=nl.prox,ct=ga==null?ll<=Se:ll>Se||Pl!=ga;if(fn||ct){let St=zn[0];St!=null&&(Xl[0]=re,ma[0]=fe,sv(St,De,$e,Ce),iv(St,Ue,Ne),ia(St,Ml(re),Ml(fe),Te,oe))}}}if(Fe.show&&kl)if(m!=null){let[P,te]=Dt.scales,[ue,re]=Dt.match,[fe,De]=m.cursor.sync.scales,$e=m.cursor.drag;if(yt=$e._x,At=$e._y,yt||At){let{left:Ce,top:Ue,width:Ne,height:Se}=m.select,ct=m.scales[fe].ori,St=m.posToVal,Ct,et,it,hn,Bt,wn=P!=null&&ue(P,fe),Yn=te!=null&&re(te,De);wn&&yt?(ct==0?(Ct=Ce,et=Ne):(Ct=Ue,et=Se),it=q[P],hn=ce(St(Ct,fe),it,C,0),Bt=ce(St(Ct+et,fe),it,C,0),Hi(Ql(hn,Bt),en(Bt-hn))):Hi(0,C),Yn&&At?(ct==1?(Ct=Ce,et=Ne):(Ct=Ue,et=Se),it=q[te],hn=Ee(St(Ct,De),it,V,0),Bt=Ee(St(Ct+et,De),it,V,0),Bi(Ql(hn,Bt),en(Bt-hn))):Bi(0,V)}else Hs()}else{let P=en(Li-Ou),te=en(Cs-Xa);if(ee.ori==1){let De=P;P=te,te=De}yt=Ve.x&&P>=Ve.dist,At=Ve.y&&te>=Ve.dist;let ue=Ve.uni;ue!=null?yt&&At&&(yt=P>=ue,At=te>=ue,!yt&&!At&&(te>P?At=!0:yt=!0)):Ve.x&&Ve.y&&(yt||At)&&(yt=At=!0);let re,fe;yt&&(ee.ori==0?(re=kn,fe=Pe):(re=Il,fe=at),Hi(Ql(re,fe),en(fe-re)),At||Bi(0,V)),At&&(ee.ori==1?(re=kn,fe=Pe):(re=Il,fe=at),Bi(Ql(re,fe),en(fe-re)),yt||Hi(0,C)),!yt&&!At&&(Hi(0,0),Bi(0,0))}if(Ve._x=yt,Ve._y=At,m==null){if(_){if(tc!=null){let[P,te]=Dt.scales;Dt.values[0]=P!=null?vl(ee.ori==0?Pe:at,P):null,Dt.values[1]=te!=null?vl(ee.ori==1?Pe:at,te):null}Pa(Kd,s,Pe,at,Te,oe,E)}if(da){let P=_&&Dt.setSeries,te=nl.prox;ga==null?ll<=te&&Zn(Pl,Wa,!0,P):ll>te?Zn(null,Wa,!0,P):Pl!=ga&&Zn(Pl,Wa,!0,P)}}fn&&(L.idx=E,ks()),y!==!1&&Ht("setCursor")}let Zl=null;Object.defineProperty(s,"rect",{get(){return Zl==null&&qi(!1),Zl}});function qi(m=!1){m?Zl=null:(Zl=O.getBoundingClientRect(),Ht("syncRect",Zl))}function Fr(m,y,_,E,N,C,V){G._lock||kl&&m!=null&&m.movementX==0&&m.movementY==0||(Zs(m,y,_,E,N,C,V,!1,m!=null),m!=null?va(null,!0,!0):va(y,!0,!1))}function Zs(m,y,_,E,N,C,V,P,te){if(Zl==null&&qi(!1),tl(m),m!=null)_=m.clientX-Zl.left,E=m.clientY-Zl.top;else{if(_<0||E<0){Pe=-10,at=-10;return}let[ue,re]=Dt.scales,fe=y.cursor.sync,[De,$e]=fe.values,[Ce,Ue]=fe.scales,[Ne,Se]=Dt.match,ct=y.axes[0].side%2==1,St=ee.ori==0?Te:oe,Ct=ee.ori==1?Te:oe,et=ct?C:N,it=ct?N:C,hn=ct?E:_,Bt=ct?_:E;if(Ce!=null?_=Ne(ue,Ce)?p(De,q[ue],St,0):-10:_=St*(hn/et),Ue!=null?E=Se(re,Ue)?p($e,q[re],Ct,0):-10:E=Ct*(Bt/it),ee.ori==1){let wn=_;_=E,E=wn}}te&&(y==null||y.cursor.event.type==Kd)&&((_<=1||_>=Te-1)&&(_=au(_,Te)),(E<=1||E>=oe-1)&&(E=au(E,oe))),P?(Ou=_,Xa=E,[kn,Il]=G.move(s,_,E)):(Pe=_,at=E)}const Ls={width:0,height:0,left:0,top:0};function Hs(){Fa(Ls,!1)}let Wr,Ir,Pr,ec;function Nu(m,y,_,E,N,C,V){kl=!0,yt=At=Ve._x=Ve._y=!1,Zs(m,y,_,E,N,C,V,!0,!1),m!=null&&(Ft(Xd,ih,Ia,!1),Pa(I0,s,kn,Il,Te,oe,null));let{left:P,top:te,width:ue,height:re}=Fe;Wr=P,Ir=te,Pr=ue,ec=re}function Ia(m,y,_,E,N,C,V){kl=Ve._x=Ve._y=!1,Zs(m,y,_,E,N,C,V,!1,!0);let{left:P,top:te,width:ue,height:re}=Fe,fe=ue>0||re>0,De=Wr!=P||Ir!=te||Pr!=ue||ec!=re;if(fe&&De&&Fa(Fe),Ve.setScale&&fe&&De){let $e=P,Ce=ue,Ue=te,Ne=re;if(ee.ori==1&&($e=te,Ce=re,Ue=P,Ne=ue),yt&&Qn(ne,vl($e,ne),vl($e+Ce,ne)),At)for(let Se in q){let ct=q[Se];Se!=ne&&ct.from==null&&ct.min!=gt&&Qn(Se,vl(Ue+Ne,Se),vl(Ue,Se))}Hs()}else G.lock&&(G._lock=!G._lock,va(y,!0,m!=null));m!=null&&(Vl(Xd,ih),Pa(Xd,s,Pe,at,Te,oe,null))}function Xo(m,y,_,E,N,C,V){if(G._lock)return;tl(m);let P=kl;if(kl){let te=!0,ue=!0,re=10,fe,De;ee.ori==0?(fe=yt,De=At):(fe=At,De=yt),fe&&De&&(te=Pe<=re||Pe>=Te-re,ue=at<=re||at>=oe-re),fe&&te&&(Pe=Pe{let N=Dt.match[2];_=N(s,y,_),_!=-1&&Zn(_,E,!0,!1)},xe&&(Ft(I0,O,Nu),Ft(Kd,O,Fr),Ft(P0,O,m=>{tl(m),qi(!1)}),Ft(ev,O,Xo),Ft(tv,O,Bs),hh.add(s),s.syncRect=qi);const Gi=s.hooks=n.hooks||{};function Ht(m,y,_){Va?Un.push([m,y,_]):m in Gi&&Gi[m].forEach(E=>{E.call(null,s,y,_)})}(n.plugins||[]).forEach(m=>{for(let y in m.hooks)Gi[y]=(Gi[y]||[]).concat(m.hooks[y])});const ba=(m,y,_)=>_,Dt=Jt({key:null,setSeries:!1,filters:{pub:dv,sub:dv},scales:[ne,B[1]?B[1].scale:null],match:[hv,hv,ba],values:[null,null]},G.sync);Dt.match.length==2&&Dt.match.push(ba),G.sync=Dt;const tc=Dt.key,Gs=hb(tc);function Pa(m,y,_,E,N,C,V){Dt.filters.pub(m,y,_,E,N,C,V)&&Gs.pub(m,y,_,E,N,C,V)}Gs.sub(s);function nc(m,y,_,E,N,C,V){Dt.filters.sub(m,y,_,E,N,C,V)&&ya[m](null,y,_,E,N,C,V)}s.pub=nc;function Qi(){Gs.unsub(s),hh.delete(s),Nl.clear(),rh(To,fs,qs),v.remove(),ge?.remove(),Ht("destroy")}s.destroy=Qi;function Sa(){Ht("init",n,a),Lt(a||n.data,!1),de[ne]?Mu(ne,de[ne]):bu(),fa=Fe.show&&(Fe.width>0||Fe.height>0),oa=fn=!0,qa(n.width,n.height)}return B.forEach(Cl),I.forEach(Ts),u?u instanceof HTMLElement?(u.appendChild(v),Sa()):u(s,Sa):Sa(),s}cn.assign=Jt;cn.fmtNum=Vh;cn.rangeNum=wo;cn.rangeLog=Ro;cn.rangeAsinh=Yh;cn.orient=gu;cn.pxRatio=Ie;cn.join=WT;cn.fmtDate=Xh,cn.tzDate=rw;cn.sync=hb;{cn.addGap=Yw,cn.clipGaps=Zo;let n=cn.paths={points:bb};n.linear=_b,n.stepped=Kw,n.bars=Xw,n.spline=Fw}function s3({data:n,series:a,height:u=280,emptyMessage:s="Waiting for live data…",valueSuffix:c="",zeroBased:d=!0,valueFormatter:f=c3,visualization:p="line",forceEmpty:g=!1}){const v=_e.useRef(null),x=_e.useRef(null),S=_e.useMemo(()=>r3(n),[n]),T=_e.useRef(S),w=!g&&n[0]?.length>0;return _e.useLayoutEffect(()=>{const O=v.current;if(!O)return;const Y={width:Math.max(240,O.clientWidth),height:u,padding:[12,8,0,0],cursor:{drag:{x:!0,y:!1,setScale:!0},focus:{prox:24}},legend:{show:!0,live:!0},scales:{x:{time:!0},y:{auto:!0,...d?{range:(B,I,q)=>[Math.min(0,I),q===0?1:q*1.08]}:{range:(B,I,q)=>{const ae=q-I,ne=ae===0?Math.max(1,Math.abs(q)*5e-4):ae*.08;return[I-ne,q+ne]}}}},axes:[{stroke:"#9f9f98",grid:{stroke:"#ffffff12",width:1},ticks:{stroke:"#ffffff20",width:1},font:"11px system-ui"},{size:72,stroke:"#9f9f98",grid:{stroke:"#ffffff12",width:1},ticks:{stroke:"#ffffff20",width:1},font:"11px system-ui",values:(B,I)=>I.map(q=>`${f(q)}${c}`)}],series:[{},...a.map(B=>{const I=p==="step"?cn.paths.stepped?.({align:1}):p==="bar"?cn.paths.bars?.({size:[.72,48,2]}):void 0;return{label:B.label,stroke:B.color,fill:p==="area"||p==="bar"?B.fill??`${B.color}24`:B.fill,width:B.width??2,paths:I,points:{show:p==="line"?B.points??!1:!1},value:(q,ae)=>ae===null?"—":`${f(ae)}${c}`}})]},W=new cn(Y,T.current,O);x.current=W;const F=new ResizeObserver(B=>{const I=B[0]?.contentRect.width;I&&I>0&&W.setSize({width:Math.round(I),height:u})});return F.observe(O),()=>{F.disconnect(),W.destroy(),x.current=null}},[u,a,f,c,p,d]),_e.useEffect(()=>{x.current?.setData(S)},[S]),z.jsxs("div",{className:"relative min-w-0",children:[z.jsx("div",{ref:v,className:"min-w-0 overflow-hidden"}),!w&&z.jsx("div",{className:"bg-surface text-textMuted pointer-events-none absolute inset-0 z-10 flex items-center justify-center text-sm",children:s})]})}function r3(n){const a=n[0];if(a.length>=2)return n;const u=Date.now()/1e3,s=a[0]??u,c=[s-1,s],d=n.slice(1).map(f=>{const p=f[0]??null;return[p,p]});return[c,...d]}function c3(n){return Math.abs(n)>=1e6?`${(n/1e6).toFixed(1)}m`:Math.abs(n)>=1e3?`${(n/1e3).toFixed(1)}k`:Math.abs(n)>=10?n.toFixed(0):Math.abs(n)>=1?n.toFixed(1):n.toFixed(2)}const o3={300:"5m",900:"15m",3600:"1h"},f3=new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),d3=new Intl.NumberFormat(void 0,{maximumFractionDigits:2});function h3(n){return f3.format(n)})DELIM" -R"DELIM(function m3(n){return d3.format(n)}function p3(n){return n==="height"||n==="occurrences"?h3:m3}function g3({metrics:n}){const[a,u]=_e.useState(WE),[s,c]=_e.useState(null),[d,f]=_e.useState(!1);_e.useEffect(()=>{IE(a)},[a]);function p(x){u(S=>s?.mode==="add"?S.length>=us?S:[...S,x]:S.map(T=>T.id===x.id?x:T)),c(null)}function g(x,S){u(T=>{const w=x+S;if(w<0||w>=T.length)return T;const O=[...T],Y=O[x],W=O[w];return O[x]=W,O[w]=Y,O})}function v(){if(!d){f(!0);return}u(vo()),f(!1)}return z.jsxs("section",{className:"space-y-4",children:[z.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[z.jsxs("div",{children:[z.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Live telemetry"}),z.jsx("h2",{className:"mt-1 text-2xl font-semibold",children:"Custom charts"}),z.jsxs("p",{className:"text-textMuted mt-1 text-sm",children:["Session data only · ",String(a.length)," of ",String(us)," charts"]})]}),z.jsxs("div",{className:"flex flex-wrap gap-2",children:[z.jsx("button",{type:"button",onClick:()=>{f(!1),c({mode:"add",chart:Ry()})},disabled:a.length>=us,className:"bg-accent text-background hover:bg-accent/90 rounded-lg px-4 py-2 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-40",children:"Add chart"}),z.jsx("button",{type:"button",onClick:v,onBlur:()=>{f(!1)},className:`rounded-lg border px-4 py-2 text-sm ${d?"border-amber-400/60 text-amber-200":"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary"}`,children:d?"Confirm reset":"Reset defaults"})]})]}),a.length===0?z.jsxs("div",{className:"border-accent/20 bg-surface/60 rounded-xl border border-dashed px-6 py-16 text-center",children:[z.jsx("p",{className:"text-textPrimary font-medium",children:"No charts in this dashboard."}),z.jsx("p",{className:"text-textMuted mt-2 text-sm",children:"Add a custom chart or start from a template."})]}):z.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:a.map((x,S)=>z.jsx(v3,{chart:x,metrics:n,canMoveEarlier:S>0,canMoveLater:S{u(T=>T.filter(w=>w.id!==x.id))},onDuplicate:()=>{u(T=>T.length>=us?T:[...T,FE(x)])},onEdit:()=>{c({mode:"edit",chart:x})},onMoveEarlier:()=>{g(S,-1)},onMoveLater:()=>{g(S,1)}},x.id))}),s&&z.jsx(fT,{chart:s.chart,mode:s.mode,onCancel:()=>{c(null)},onSave:p},`${s.mode}-${s.chart.id}`)]})}function v3({chart:n,metrics:a,canMoveEarlier:u,canMoveLater:s,canDuplicate:c,onDelete:d,onDuplicate:f,onEdit:p,onMoveEarlier:g,onMoveLater:v}){const[x,S]=_e.useState(null),[T,w]=_e.useState(0),O=_e.useMemo(()=>lT(x??a,n),[n,a,x]),Y=_e.useMemo(()=>n.series.map(B=>({label:B.label??Za(B.signalId).label,color:B.color})),[n.series]),W=p3(O.unit),F=`Waiting for ${n.series.length===1?Y[0]?.label?.toLowerCase():"the selected signals"}…`;return z.jsxs("article",{className:"border-accent/20 bg-surface/70 min-w-0 overflow-hidden rounded-xl border",children:[z.jsx("header",{className:"border-accent/15 space-y-3 border-b px-4 py-4 sm:px-5",children:z.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[z.jsxs("div",{className:"min-w-0",children:[z.jsx("h3",{className:"truncate font-semibold",title:n.title,children:n.title}),z.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:[Ly(O.unit)," · ",o3[n.range]," · ",n.visualization,x?" · paused":""]})]}),z.jsxs("div",{className:"flex flex-wrap justify-end gap-1 text-xs",children:[z.jsx(lu,{label:x?"Resume chart":"Pause chart",onClick:()=>{S(B=>B?null:a)},children:x?"Resume":"Pause"}),z.jsx(lu,{label:"Reset chart zoom",onClick:()=>{w(B=>B+1)},children:"Reset zoom"}),z.jsx(lu,{label:"Edit chart",onClick:p,children:"Edit"}),z.jsx(lu,{label:"Duplicate chart",onClick:f,disabled:!c,children:"Duplicate"}),z.jsx(lu,{label:`Move ${n.title} earlier`,onClick:g,disabled:!u,children:"←"}),z.jsx(lu,{label:`Move ${n.title} later`,onClick:v,disabled:!s,children:"→"}),z.jsx(lu,{label:"Delete chart",onClick:d,danger:!0,children:"Delete"})]})]})}),z.jsx("div",{className:"min-w-0 p-3 sm:p-5",children:z.jsx(s3,{data:O.data,series:Y,visualization:n.visualization,zeroBased:iT(O.unit),valueFormatter:W,valueSuffix:aT(O.unit),forceEmpty:!O.hasObservedData,emptyMessage:F},T)}),O.unobservedLabels.length>0&&O.hasObservedData&&z.jsxs("footer",{className:"border-accent/10 text-textMuted border-t px-5 py-2 text-[11px]",children:["Not observed this session: ",O.unobservedLabels.join(", ")]})]})}function lu({label:n,children:a,onClick:u,disabled:s=!1,danger:c=!1}){return z.jsx("button",{type:"button","aria-label":n,onClick:u,disabled:s,className:`rounded px-2 py-1.5 disabled:cursor-not-allowed disabled:opacity-30 ${c?"text-textMuted hover:bg-red-500/10 hover:text-red-300":"text-textMuted hover:text-textPrimary hover:bg-white/5"}`,children:a})}const y3=[{event:0,label:"Header archived"},{event:3,label:"Block archived"},{event:5,label:"Block validated"},{event:6,label:"Block confirmed"},{event:13,label:"Block organized"},{event:14,label:"Block reorganized"}];function b3({adminStatus:n,endpoints:a,metrics:u,native:s}){const c=HE(u,10),d=s.configuration,f=Al(6),p=[n.error?`Admin: ${n.error}`:null,s.status.error?`Native: ${s.status.error}`:null,s.transport==="none"&&s.restError?`Native REST: ${s.restError}`:null,u.invalidFrames>0?`${String(u.invalidFrames)} malformed admin frame${u.invalidFrames===1?"":"s"} ignored`:null].filter(g=>g!==null);return z.jsxs("div",{className:"space-y-8",children:[p.length>0&&z.jsxs("section",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3",children:[z.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Transport notice"}),z.jsx("ul",{className:"text-textMuted mt-1 space-y-1 text-xs",children:p.map(g=>z.jsx("li",{children:g},g))})]}),z.jsxs("section",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[z.jsx(oo,{label:"Canonical top",value:s.top===null?"—":ka(s.top),detail:s.transport==="none"?"Waiting for native API":`via ${s.transport==="websocket"?"native WebSocket":"REST fallback"}`,accent:"orange"}),z.jsx(oo,{label:"Current activity",value:c.label,detail:c.rate>0?`${pE(c.rate)} over the last 10 seconds`:"No lifecycle events in the last 10 seconds",accent:"green"}),z.jsx(oo,{label:"Highest confirmed",value:u.signalMaximums[f]===void 0?"—":ka(u.signalMaximums[f]),detail:`${ka(u.signalTotals[f]??0)} confirmations observed`,accent:"blue"}),z.jsx(oo,{label:"Collection uptime",value:mE(u.now-u.sessionStartedAt),detail:`${ka(u.totalEvents)} events · ${ka(u.totalLogs)} logs`,accent:"red"})]}),z.jsxs("section",{className:"grid gap-4 lg:grid-cols-2",children:[z.jsx(Uv,{title:"Admin stream",endpoint:a.adminUrl,status:n,detail:n.lastMessageAt?`Last frame ${Or(n.lastMessageAt)}`:"Waiting for the first frame"}),z.jsx(Uv,{title:"Native interface",endpoint:a.nativeUrl,status:s.status,detail:s.receivedAt?`Last state ${Or(s.receivedAt)} · ${s.transport}`:"Waiting for node state"})]}),z.jsx(g3,{metrics:u}),z.jsxs("section",{className:"grid gap-4 xl:grid-cols-[1.1fr_0.9fr]",children:[z.jsxs("div",{className:"border-accent/20 bg-surface/70 rounded-xl border",children:[z.jsxs("header",{className:"border-accent/15 border-b px-5 py-4",children:[z.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Lifecycle heights"}),z.jsx("h2",{className:"mt-1 font-semibold",children:"Highest observed event values"})]}),z.jsx("div",{className:"grid gap-px bg-white/5 sm:grid-cols-2 lg:grid-cols-3",children:y3.map(({event:g,label:v})=>{const x=u.signalMaximums[Al(g)];return z.jsxs("div",{className:"bg-surface px-5 py-4",children:[z.jsx("p",{className:"text-textMuted text-xs",children:v}),z.jsx("p",{className:"text-textPrimary mt-2 font-mono text-lg tabular-nums",children:x===void 0?"—":ka(x)})]},g)})})]}),z.jsxs("div",{className:"border-accent/20 bg-surface/70 rounded-xl border",children:[z.jsxs("header",{className:"border-accent/15 border-b px-5 py-4",c)DELIM" -R"DELIM(hildren:[z.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Capabilities"}),z.jsx("h2",{className:"mt-1 font-semibold",children:"Native configuration"})]}),d?z.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 p-5 text-sm",children:[z.jsx(is,{label:"Address index",enabled:d.address}),z.jsx(is,{label:"Client filters",enabled:d.filter}),z.jsx(is,{label:"Turbo",enabled:d.turbo}),z.jsx(is,{label:"Witness",enabled:d.witness}),z.jsx(is,{label:"Retarget",enabled:d.retarget}),z.jsx(is,{label:"Difficulty",enabled:d.difficult}),z.jsxs("div",{className:"col-span-2 border-t border-white/5 pt-3",children:[z.jsx("span",{className:"text-textMuted",children:"Pruned below"}),z.jsx("span",{className:"text-textPrimary float-right font-mono",children:d.pruned>0?ka(d.pruned):"Not pruned"})]})]}):z.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:"Waiting for native configuration."})]})]}),z.jsx("section",{children:z.jsxs("div",{className:"border-accent/20 bg-surface/70 rounded-xl border",children:[z.jsx("header",{className:"border-accent/15 border-b px-5 py-4",children:z.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Recent events"})}),u.recentEvents.length===0?z.jsx(S3,{text:"No events observed yet."}):z.jsx("ul",{className:"divide-y divide-white/5",children:u.recentEvents.slice(0,6).map(g=>z.jsxs("li",{className:"flex items-center gap-3 px-5 py-3 text-xs",children:[z.jsx("time",{className:"text-textMuted w-24 shrink-0 font-mono",children:Or(g.time)}),z.jsx("span",{className:"text-textPrimary min-w-0 flex-1 truncate font-mono",children:cu(g.event).name}),z.jsx("span",{className:"text-accent tabular-nums",children:Ay(g.event,g.value)})]},g.id))})]})})]})}function Uv({title:n,endpoint:a,status:u,detail:s}){return z.jsxs("article",{className:"border-accent/20 bg-surface/70 min-w-0 rounded-xl border p-5",children:[z.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[z.jsxs("div",{children:[z.jsx("p",{className:"text-textMuted text-xs tracking-wide uppercase",children:n}),z.jsx("p",{className:"text-textPrimary mt-2 font-mono text-sm break-all",children:gE(a)})]}),z.jsx(qE,{phase:u.phase,label:u.phase})]}),z.jsxs("div",{className:"text-textMuted mt-4 flex flex-wrap justify-between gap-2 border-t border-white/5 pt-3 text-xs",children:[z.jsx("span",{children:s}),z.jsxs("span",{children:[String(u.reconnects)," reconnect",u.reconnects===1?"":"s"]})]})]})}function is({label:n,enabled:a}){return z.jsxs("div",{className:"flex items-center justify-between gap-3",children:[z.jsx("span",{className:"text-textMuted",children:n}),z.jsx("span",{className:a?"text-emerald-300":"text-textMuted",children:a?"Enabled":"Disabled"})]})}function S3({text:n}){return z.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:n})}var Hr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_3=class extends Hr{#e;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const a=()=>n();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(n){this.#n=n,this.#t?.(),this.#t=n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(a=>{a(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},tm=new _3,x3={setTimeout:(n,a)=>setTimeout(n,a),clearTimeout:n=>clearTimeout(n),setInterval:(n,a)=>setInterval(n,a),clearInterval:n=>clearInterval(n)},z3=class{#e=x3;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,a){return this.#e.setTimeout(n,a)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,a){return this.#e.setInterval(n,a)}clearInterval(n){this.#e.clearInterval(n)}},ru=new z3;function E3(n){setTimeout(n,0)}var T3=typeof window>"u"||"Deno"in globalThis;function Wn(){}function w3(n,a){return typeof n=="function"?n(a):n}function ph(n){return typeof n=="number"&&n>=0&&n!==1/0}function Tb(n,a){return Math.max(n+(a||0)-Date.now(),0)}function wi(n,a){return typeof n=="function"?n(a):n}function fl(n,a){return typeof n=="function"?n(a):n}function kv(n,a){const{type:u="all",exact:s,fetchStatus:c,predicate:d,queryKey:f,stale:p}=n;if(f){if(s){if(a.queryHash!==nm(f,a.options))return!1}else if(!vs(a.queryKey,f))return!1}if(u!=="all"){const g=a.isActive();if(u==="active"&&!g||u==="inactive"&&g)return!1}return!(typeof p=="boolean"&&a.isStale()!==p||c&&c!==a.state.fetchStatus||d&&!d(a))}function Zv(n,a){const{exact:u,status:s,predicate:c,mutationKey:d}=n;if(d){if(!a.options.mutationKey)return!1;if(u){if(kr(a.options.mutationKey)!==kr(d))return!1}else if(!vs(a.options.mutationKey,d))return!1}return!(s&&a.state.status!==s||c&&!c(a))}function nm(n,a){return(a?.queryKeyHashFn||kr)(n)}function kr(n){return JSON.stringify(n,(a,u)=>vh(u)?Object.keys(u).sort().reduce((s,c)=>(s[c]=u[c],s),{}):u)}function vs(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(n&&a&&typeof n=="object"&&typeof a=="object"){if(Array.isArray(n)&&Array.isArray(a)){for(let s=0;s500)return a;const s=Lv(n)&&Lv(a);if(!s&&!(vh(n)&&vh(a)))return a;const d=(s?n:Object.keys(n)).length,f=s?a:Object.keys(a),p=f.length,g=s?new Array(p):{};let v=0;for(let x=0;x{ru.setTimeout(a,n)})}function yh(n,a,u){return typeof u.structuralSharing=="function"?u.structuralSharing(n,a):u.structuralSharing!==!1?wb(n,a):a}function O3(n,a,u=0){const s=[...n,a];return u&&s.length>u?s.slice(1):s}function N3(n,a,u=0){const s=[a,...n];return u&&s.length>u?s.slice(0,-1):s}var lm=Symbol();function Mb(n,a){return!n.queryFn&&a?.initialPromise?()=>a.initialPromise:!n.queryFn||n.queryFn===lm?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Ab(n,a){return typeof n=="function"?n(...a):!!n}function j3(n,a,u){let s=!1,c;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(c??=a(),s||(s=!0,c.aborted?u():c.addEventListener("abort",u,{once:!0})),c)}),n}var Zr=(()=>{let n=()=>T3;return{isServer(){return n()},setIsServer(a){n=a}}})();function bh(){let n,a;const u=new Promise((c,d)=>{n=c,a=d});u.status="pending",u.catch(()=>{});function s(c){Object.assign(u,c),delete u.resolve,delete u.reject}return u.resolve=c=>{s({status:"fulfilled",value:c}),n(c)},u.reject=c=>{s({status:"rejected",reason:c}),a(c)},u}var D3=E3;function C3(){let n=[],a=0,u=p=>{p()},s=p=>{p()},c=D3;const d=p=>{a?n.push(p):c(()=>{u(p)})},f=()=>{const p=n;n=[],p.length&&c(()=>{s(()=>{p.forEach(g=>{u(g)})})})};return{batch:p=>{let g;a++;try{g=p()}finally{a--,a||f()}return g},batchCalls)DELIM" -R"DELIM(:p=>(...g)=>{d(()=>{p(...g)})},schedule:d,setNotifyFunction:p=>{u=p},setBatchNotifyFunction:p=>{s=p},setScheduler:p=>{c=p}}}var Sn=C3(),R3=class extends Hr{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const a=()=>n(!0),u=()=>n(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",u)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(u=>{u(n)}))}isOnline(){return this.#e}},Ao=new R3;function U3(n){return Math.min(1e3*2**n,3e4)}function Ob(n){return(n??"online")==="online"?Ao.isOnline():!0}var Sh=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function Nb(n){let a=!1,u=0,s;const c=bh(),d=()=>c.status!=="pending",f=Y=>{if(!d()){const W=new Sh(Y);T(W),n.onCancel?.(W)}},p=()=>{a=!0},g=()=>{a=!1},v=()=>tm.isFocused()&&(n.networkMode==="always"||Ao.isOnline())&&n.canRun(),x=()=>Ob(n.networkMode)&&n.canRun(),S=Y=>{d()||(s?.(),c.resolve(Y))},T=Y=>{d()||(s?.(),c.reject(Y))},w=()=>new Promise(Y=>{s=W=>{(d()||v())&&Y(W)},n.onPause?.()}).then(()=>{s=void 0,d()||n.onContinue?.()}),O=()=>{if(d())return;let Y;const W=u===0?n.initialPromise:void 0;try{Y=W??n.fn()}catch(F){Y=Promise.reject(F)}Promise.resolve(Y).then(S).catch(F=>{if(d())return;const B=n.retry??(Zr.isServer()?0:3),I=n.retryDelay??U3,q=typeof I=="function"?I(u,F):I,ae=B===!0||typeof B=="number"&&uv()?void 0:w()).then(()=>{a?T(F):O()})})};return{promise:c,status:()=>c.status,cancel:f,continue:()=>(s?.(),c),cancelRetry:p,continueRetry:g,canStart:x,start:()=>(x()?O():w().then(O),c)}}var jb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ph(this.gcTime)&&(this.#e=ru.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Zr.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(ru.clearTimeout(this.#e),this.#e=void 0)}};function k3(n){return{onFetch:(a,u)=>{const s=a.options,c=a.fetchOptions?.meta?.fetchMore?.direction,d=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let p={pages:[],pageParams:[]},g=0;const v=async()=>{let x=!1;const S=O=>{j3(O,()=>a.signal,()=>x=!0)},T=Mb(a.options,a.fetchOptions),w=async(O,Y,W)=>{if(x)return Promise.reject(a.signal.reason);if(Y==null&&O.pages.length)return Promise.resolve(O);const B=(()=>{const ne={client:a.client,queryKey:a.queryKey,pageParam:Y,direction:W?"backward":"forward",meta:a.options.meta};return S(ne),ne})(),I=await T(B),{maxPages:q}=a.options,ae=W?N3:O3;return{pages:ae(O.pages,I,q),pageParams:ae(O.pageParams,Y,q)}};if(c&&d.length){const O=c==="backward",Y=O?Z3:Bv,W={pages:d,pageParams:f},F=Y(s,W);p=await w(W,F,O)}else{const O=n??d.length;do{const Y=g===0?f[0]??s.initialPageParam:Bv(s,p);if(g>0&&Y==null)break;p=await w(p,Y),g++}while(ga.options.persister?.(v,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},u):a.fetchFn=v}}}function Bv(n,{pages:a,pageParams:u}){const s=a.length-1;return a.length>0?n.getNextPageParam(a[s],a,u[s],u):void 0}function Z3(n,{pages:a,pageParams:u}){return a.length>0?n.getPreviousPageParam?.(a[0],a,u[0],u):void 0}var L3=class extends jb{#e;#t;#n;#l;#a;#i;#s;#u;constructor(n){super(),this.#u=!1,this.#s=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#a=n.client,this.#l=this.#a.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=Gv(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(n){if(this.options={...this.#s,...n},n?._type&&(this.#e=n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=Gv(this.options);a.data!==void 0&&(this.setState(qv(a.data,a.dataUpdatedAt)),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#l.remove(this)}setData(n,a){const u=yh(this.state.data,n,this.options);return this.#r({data:u,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),u}setState(n){this.#r({type:"setState",state:n})}cancel(n){const a=this.#i?.promise;return this.#i?.cancel(n),a?a.then(Wn).catch(Wn):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(n=>fl(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>wi(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!Tb(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(a=>a!==n),this.observers.length||(this.#i&&(this.#u||this.#c()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}async fetch(n,a){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(n&&this.setOptions(n),!this.options.queryFn){const g=this.observers.find(v=>v.options.queryFn);g&&this.setOptions(g.options)}const u=new AbortController,s=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(this.#u=!0,u.signal)})},c=()=>{const g=Mb(this.options,a),x=(()=>{const S={client:this.#a,queryKey:this.queryKey,meta:this.meta};return s(S),S})();return this.#u=!1,this.options.persister?this.options.persister(g,x,this):g(x)},f=(()=>{const g={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:c};return s(g),g})();(this.#e==="infinite"?k3(this.options.pages):this.options.behavior)?.onFetch(f,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#r({type:"fetch",meta:f.fetchOptions?.meta}),this.#i=Nb({initialPromise:a?.initialPromise,fn:f.fetchFn,onCancel:g=>{g instanceof Sh&&g.revert&&this.setState({...this.#n,fetchStatus:"idle"}),u.abort()},onFail:(g,v)=>{this.#r({type:"failed",failureCount:g,error:v})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const g=await this.#i.start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),this.#l.config.onSuccess?.(g,this),this.#l.config.onSettled?.(g,this.state.error,this),g}catch(g){if(g instanceof Sh){if(g.silent)return this.#i.promise;if(g.rever)DELIM" -R"DELIM(t){if(this.state.data===void 0)throw g;return this.state.data}}throw this.#r({type:"error",error:g}),this.#l.config.onError?.(g,this),this.#l.config.onSettled?.(this.state.data,g,this),g}finally{this.scheduleGc()}}#r(n){const a=u=>{switch(n.type){case"failed":return{...u,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...u,fetchStatus:"paused"};case"continue":return{...u,fetchStatus:"fetching"};case"fetch":return{...u,...Db(u.data,this.options),fetchMeta:n.meta??null};case"success":const s={...u,...qv(n.data,n.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?s:void 0,s;case"error":const c=n.error;return{...u,error:c,errorUpdateCount:u.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:u.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...u,isInvalidated:!0};case"setState":return{...u,...n.state}}};this.state=a(this.state),Sn.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:n})})}};function Db(n,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ob(a.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function qv(n,a){return{data:n,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Gv(n){const a=typeof n.initialData=="function"?n.initialData():n.initialData,u=a!==void 0,s=u?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:u?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:u?"success":"pending",fetchStatus:"idle"}}var H3=class extends Hr{constructor(n,a){super(),this.options=a,this.#e=n,this.#u=null,this.#s=bh(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#l=void 0;#a;#i;#s;#u;#c;#r;#d;#h;#f;#m;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Qv(this.#t,this.options)?this.#o():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _h(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _h(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#p(),this.#t.removeObserver(this)}setOptions(n){const a=this.options,u=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof fl(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#y(),this.#t.setOptions(this.options),a._defaulted&&!gh(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&Yv(this.#t,u,this.options,a)&&this.#o(),this.updateResult(),s&&(this.#t!==u||fl(this.options.enabled,this.#t)!==fl(a.enabled,this.#t)||wi(this.options.staleTime,this.#t)!==wi(a.staleTime,this.#t))&&this.#b();const c=this.#S();s&&(this.#t!==u||fl(this.options.enabled,this.#t)!==fl(a.enabled,this.#t)||c!==this.#m)&&this.#_(c)}getOptimisticResult(n){const a=this.#e.getQueryCache().build(this.#e,n),u=this.createResult(a,n);return q3(this,u)&&(this.#l=u,this.#i=this.options,this.#a=this.#t.state),u}getCurrentResult(){return this.#l}trackResult(n,a){return new Proxy(n,{get:(u,s)=>(this.trackProp(s),a?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,s))})}trackProp(n){this.#g.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const a=this.#e.defaultQueryOptions(n),u=this.#e.getQueryCache().build(this.#e,a);return u.fetch().then(()=>this.createResult(u,a))}fetch(n){return this.#o({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#l))}#o(n){this.#y();let a=this.#t.fetch(this.options,n);return n?.throwOnError||(a=a.catch(Wn)),a}#b(){this.#v();const n=wi(this.options.staleTime,this.#t);if(Zr.isServer()||this.#l.isStale||!ph(n))return;const u=Tb(this.#l.dataUpdatedAt,n)+1;this.#h=ru.setTimeout(()=>{this.#l.isStale||this.updateResult()},u)}#S(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#_(n){this.#p(),this.#m=n,!(Zr.isServer()||fl(this.options.enabled,this.#t)===!1||!ph(this.#m)||this.#m===0)&&(this.#f=ru.setInterval(()=>{(this.options.refetchIntervalInBackground||tm.isFocused())&&this.#o()},this.#m))}#x(){this.#b(),this.#_(this.#S())}#v(){this.#h!==void 0&&(ru.clearTimeout(this.#h),this.#h=void 0)}#p(){this.#f!==void 0&&(ru.clearInterval(this.#f),this.#f=void 0)}createResult(n,a){const u=this.#t,s=this.options,c=this.#l,d=this.#a,f=this.#i,g=n!==u?n.state:this.#n,{state:v}=n;let x={...v},S=!1,T;if(a._optimisticResults){const se=this.hasListeners(),Ae=!se&&Qv(n,a),ze=se&&Yv(n,u,a,s);(Ae||ze)&&(x={...x,...Db(v.data,n.options)}),a._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:w,errorUpdatedAt:O,status:Y}=x;T=x.data;let W=!1;if(a.placeholderData!==void 0&&T===void 0&&Y==="pending"){let se;c?.isPlaceholderData&&a.placeholderData===f?.placeholderData?(se=c.data,W=!0):se=typeof a.placeholderData=="function"?a.placeholderData(this.#d?.state.data,this.#d):a.placeholderData,se!==void 0&&(Y="success",T=yh(c?.data,se,a),S=!0)}if(a.select&&T!==void 0&&!W)if(c&&T===d?.data&&a.select===this.#c)T=this.#r;else try{this.#c=a.select,T=a.select(T),T=yh(c?.data,T,a),this.#r=T,this.#u=null}catch(se){this.#u=se}this.#u&&(w=this.#u,T=this.#r,O=Date.now(),Y="error");const F=x.fetchStatus==="fetching",B=Y==="pending",I=Y==="error",q=B&&F,ae=T!==void 0,le={status:Y,fetchStatus:x.fetchStatus,isPending:B,isSuccess:Y==="success",isError:I,isInitialLoading:q,isLoading:q,data:T,dataUpdatedAt:x.dataUpdatedAt,error:w,errorUpdatedAt:O,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:x.dataUpdateCount>g.dataUpdateCount||x.errorUpdateCount>g.errorUpdateCount,isFetching:F,isRefetching:F&&!B,isLoadingError:I&&!ae,isPaused:x.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:I&&ae,isStale:am(n,a),refetch:this.refetch,promise:this.#s,isEnabled:fl(a.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const se=le.data!==void 0,Ae=le.status==="error"&&!se,ze=ce=>{Ae?ce.reject(le.error):se&&ce.resolve(le.data)},ee=()=>{const ce=this.#s=le.promise=bh();ze(ce)},ye=this.#s;switch(ye.status){case"pending":n.queryHash===u.queryHash&&ze(ye);break;case"fulfilled":(Ae||le.data!==ye.value)&&ee();break;case"rejected":(!Ae||le.error!==ye.reason)&&ee();break}}return le}updateResult(){const n=this.#l,a=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#i=this.options,this.#a.data!==void 0&&(this.#d=this.#t),gh(a,n))return;this.#l=a;const u=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,c=typeof s=="function"?s():s;if(c==="all"||!c&&!this.#g.size)return!0;const d=new Set(c??this.#g);return this.options.throwOnError&&d.add("error"),Object.keys(this.#l).some(f=>{const p=f;return this.#l[p]!==n[p]&&d.has(p)})};this.#z({listeners:u()})}#y(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const a=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(a?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#z(n){Sn.batch(()=>{n.listeners&&this.listeners.forEach(a=>{a(t)DELIM" -R"DELIM(his.#l)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function B3(n,a){return fl(a.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&fl(a.retryOnMount,n)===!1)}function Qv(n,a){return B3(n,a)||n.state.data!==void 0&&_h(n,a,a.refetchOnMount)}function _h(n,a,u){if(fl(a.enabled,n)!==!1&&wi(a.staleTime,n)!=="static"){const s=typeof u=="function"?u(n):u;return s==="always"||s!==!1&&am(n,a)}return!1}function Yv(n,a,u,s){return(n!==a||fl(s.enabled,n)===!1)&&(!u.suspense||n.state.status!=="error")&&am(n,u)}function am(n,a){return fl(a.enabled,n)!==!1&&n.isStaleByTime(wi(a.staleTime,n))}function q3(n,a){return!gh(n.getCurrentResult(),a)}var G3=class extends jb{#e;#t;#n;#l;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||Q3(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(a=>a!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(n){const a=()=>{this.#a({type:"continue"})},u={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=Nb({fn:()=>this.options.mutationFn?this.options.mutationFn(n,u):Promise.reject(new Error("No mutationFn found")),onFail:(d,f)=>{this.#a({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",c=!this.#l.canStart();try{if(s)a();else{this.#a({type:"pending",variables:n,isPaused:c}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,u);const f=await this.options.onMutate?.(n,u);f!==this.state.context&&this.#a({type:"pending",context:f,variables:n,isPaused:c})}const d=await this.#l.start();return await this.#n.config.onSuccess?.(d,n,this.state.context,this,u),await this.options.onSuccess?.(d,n,this.state.context,u),await this.#n.config.onSettled?.(d,null,this.state.variables,this.state.context,this,u),await this.options.onSettled?.(d,null,n,this.state.context,u),this.#a({type:"success",data:d}),d}catch(d){try{await this.#n.config.onError?.(d,n,this.state.context,this,u)}catch(f){Promise.reject(f)}try{await this.options.onError?.(d,n,this.state.context,u)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,u)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,d,n,this.state.context,u)}catch(f){Promise.reject(f)}throw this.#a({type:"error",error:d}),d}finally{this.#n.runNext(this)}}#a(n){const a=u=>{switch(n.type){case"failed":return{...u,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...u,isPaused:!0};case"continue":return{...u,isPaused:!1};case"pending":return{...u,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...u,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...u,data:void 0,error:n.error,failureCount:u.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Sn.batch(()=>{this.#t.forEach(u=>{u.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function Q3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Y3=class extends Hr{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(n,a,u){const s=new G3({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(a),state:u});return this.add(s),s}add(n){this.#e.add(n);const a=po(n);if(typeof a=="string"){const u=this.#t.get(a);u?u.push(n):this.#t.set(a,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const a=po(n);if(typeof a=="string"){const u=this.#t.get(a);if(u)if(u.length>1){const s=u.indexOf(n);s!==-1&&u.splice(s,1)}else u[0]===n&&this.#t.delete(a)}}this.notify({type:"removed",mutation:n})}canRun(n){const a=po(n);if(typeof a=="string"){const s=this.#t.get(a)?.find(c=>c.state.status==="pending");return!s||s===n}else return!0}runNext(n){const a=po(n);return typeof a=="string"?this.#t.get(a)?.find(s=>s!==n&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Sn.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(n){const a={exact:!0,...n};return this.getAll().find(u=>Zv(a,u))}findAll(n={}){return this.getAll().filter(a=>Zv(n,a))}notify(n){Sn.batch(()=>{this.listeners.forEach(a=>{a(n)})})}resumePausedMutations(){const n=this.getAll().filter(a=>a.state.isPaused);return Sn.batch(()=>Promise.all(n.map(a=>a.continue().catch(Wn))))}};function po(n){return n.options.scope?.id}var $3=class extends Hr{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,a,u){const s=a.queryKey,c=a.queryHash??nm(s,a);let d=this.get(c);return d||(d=new L3({client:n,queryKey:s,queryHash:c,options:n.defaultQueryOptions(a),state:u,defaultOptions:n.getQueryDefaults(s)}),this.add(d)),d}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const a=this.#e.get(n.queryHash);a&&(n.destroy(),a===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Sn.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const a={exact:!0,...n};return this.getAll().find(u=>kv(a,u))}findAll(n={}){const a=this.getAll();return Object.keys(n).length>0?a.filter(u=>kv(n,u)):a}notify(n){Sn.batch(()=>{this.listeners.forEach(a=>{a(n)})})}onFocus(){Sn.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Sn.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},V3=class{#e;#t;#n;#l;#a;#i;#s;#u;constructor(n={}){this.#e=n.queryCache||new $3,this.#t=n.mutationCache||new Y3,this.#n=n.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#s=tm.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#u=Ao.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#s?.(),this.#s=void 0,this.#u?.(),this.#u=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const a=this.defaultQueryOptions({queryKey:n});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(n){const a=this.defaultQueryOptions(n),u=this.#e.build(this,a),s=u.state.data;return s===void 0?this.fetchQuery(n):(n.revalidateIfStale&&u.isStaleByTime(wi(a.staleTime,u))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:a,state:u})=>{const s=u.data;return[a,s]})}setQueryData(n,a,u){const s=this.defaultQueryOptions({queryKey:n}),d=this.#e.get(s.queryHash)?.state.data,f=w3(a,d);if(f!==void 0)return this.#e.build(this,s).setData(f,{...u,manual:!0})}setQueriesData(n,a,u){return Sn.batch(()=>this.#e.findAll(n).map(({queryKey:s})=>[s,this.setQueryData(s,a,u)]))}getQueryState(n){const a=this.defaultQueryOptions({queryKey:n});return this.#e.get(a.queryHash)?.state}removeQueries(n){const a=this.#e;Sn.bat)DELIM" -R"DELIM(ch(()=>{a.findAll(n).forEach(u=>{a.remove(u)})})}resetQueries(n,a){const u=this.#e;return Sn.batch(()=>(u.findAll(n).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...n},a)))}cancelQueries(n,a={}){const u={revert:!0,...a},s=Sn.batch(()=>this.#e.findAll(n).map(c=>c.cancel(u)));return Promise.all(s).then(Wn).catch(Wn)}invalidateQueries(n,a={}){return Sn.batch(()=>(this.#e.findAll(n).forEach(u=>{u.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},a)))}refetchQueries(n,a={}){const u={...a,cancelRefetch:a.cancelRefetch??!0},s=Sn.batch(()=>this.#e.findAll(n).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let d=c.fetch(void 0,u);return u.throwOnError||(d=d.catch(Wn)),c.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(s).then(Wn)}fetchQuery(n){const a=this.defaultQueryOptions(n);a.retry===void 0&&(a.retry=!1);const u=this.#e.build(this,a);return u.isStaleByTime(wi(a.staleTime,u))?u.fetch(a):Promise.resolve(u.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Wn).catch(Wn)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Wn).catch(Wn)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Ao.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,a){this.#l.set(kr(n),{queryKey:n,defaultOptions:a})}getQueryDefaults(n){const a=[...this.#l.values()],u={};return a.forEach(s=>{vs(n,s.queryKey)&&Object.assign(u,s.defaultOptions)}),u}setMutationDefaults(n,a){this.#a.set(kr(n),{mutationKey:n,defaultOptions:a})}getMutationDefaults(n){const a=[...this.#a.values()],u={};return a.forEach(s=>{vs(n,s.mutationKey)&&Object.assign(u,s.defaultOptions)}),u}defaultQueryOptions(n){if(n._defaulted)return n;const a={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return a.queryHash||(a.queryHash=nm(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===lm&&(a.enabled=!1),a}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Cb=_e.createContext(void 0),K3=n=>{const a=_e.useContext(Cb);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},X3=({client:n,children:a})=>(_e.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),z.jsx(Cb.Provider,{value:n,children:a})),Rb=_e.createContext(!1),J3=()=>_e.useContext(Rb);Rb.Provider;function F3(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var W3=_e.createContext(F3()),I3=()=>_e.useContext(W3),P3=(n,a,u)=>{const s=u?.state.error&&typeof n.throwOnError=="function"?Ab(n.throwOnError,[u.state.error,u]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||s)&&(a.isReset()||(n.retryOnMount=!1))},eM=n=>{_e.useEffect(()=>{n.clearReset()},[n])},tM=({result:n,errorResetBoundary:a,throwOnError:u,query:s,suspense:c})=>n.isError&&!a.isReset()&&!n.isFetching&&s&&(c&&n.data===void 0||Ab(u,[n.error,s])),nM=n=>{if(n.suspense){const u=c=>c==="static"?c:Math.max(c??1e3,1e3),s=n.staleTime;n.staleTime=typeof s=="function"?(...c)=>u(s(...c)):u(s),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},lM=(n,a)=>n.isLoading&&n.isFetching&&!a,aM=(n,a)=>n?.suspense&&a.isPending,$v=(n,a,u)=>a.fetchOptimistic(n).catch(()=>{u.clearReset()});function iM(n,a,u){const s=J3(),c=I3(),d=K3(),f=d.defaultQueryOptions(n);d.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const p=d.getQueryCache().get(f.queryHash),g=n.subscribed!==!1;f._optimisticResults=s?"isRestoring":g?"optimistic":void 0,nM(f),P3(f,c,p),eM(c);const v=!d.getQueryCache().get(f.queryHash),[x]=_e.useState(()=>new a(d,f)),S=x.getOptimisticResult(f),T=!s&&g;if(_e.useSyncExternalStore(_e.useCallback(w=>{const O=T?x.subscribe(Sn.batchCalls(w)):Wn;return x.updateResult(),O},[x,T]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),_e.useEffect(()=>{x.setOptions(f)},[f,x]),aM(f,S))throw $v(f,x,c);if(tM({result:S,errorResetBoundary:c,throwOnError:f.throwOnError,query:p,suspense:f.suspense}))throw S.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(f,S),f.experimental_prefetchInRender&&!Zr.isServer()&&lM(S,s)&&(v?$v(f,x,c):p?.promise)?.catch(Wn).finally(()=>{x.updateResult()}),f.notifyOnChangeProps?S:x.trackResult(S)}function uM(n,a){return iM(n,H3)}const Vv={phase:"idle",attempt:0,reconnects:0,connectedAt:null,lastMessageAt:null,error:null};class Ub{#e;#t=Vv;#n=null;#l=new Set;#a=null;#i=null;#s=null;#u;#c=!1;constructor(a){this.#e={...a,connectTimeoutMs:a.connectTimeoutMs??5e3,retryMinimumMs:a.retryMinimumMs??1e3,retryMaximumMs:a.retryMaximumMs??3e4,heartbeatMs:a.heartbeatMs??24e4,jitterRatio:a.jitterRatio??.2,now:a.now??Date.now,random:a.random??Math.random,webSocketFactory:a.webSocketFactory??(u=>new WebSocket(u))},this.#u=this.#e.retryMinimumMs}getStatus=()=>this.#t;subscribeStatus=a=>(this.#l.add(a),()=>{this.#l.delete(a)});start(){this.#c||(this.#c=!0,this.#u=this.#e.retryMinimumMs,this.#r())}stop(){this.#c=!1,this.#g();const a=this.#n;if(this.#n=null,a)try{a.readyState===1&&this.#e.onBeforeStop?.(a),a.close()}catch{}this.#o(Vv)}send(a){if(this.#n?.readyState!==1)return!1;try{return this.#n.send(a),!0}catch{return!1}}#r(){if(!this.#c||this.#n)return;const a=this.#t.reconnects>0;this.#o({...this.#t,phase:a?"reconnecting":"connecting",attempt:this.#t.attempt+1,error:null});let u;try{u=this.#e.webSocketFactory(this.#e.url),this.#n=u}catch(s){this.#o({...this.#t,error:rM(s)}),this.#d();return}this.#a=setTimeout(()=>{if(this.#n===u){this.#o({...this.#t,error:"Connection timed out"});try{u.close()}catch{this.#n=null,this.#d()}}},this.#e.connectTimeoutMs),u.addEventListener("open",()=>{this.#n!==u||!this.#c||(this.#f(),this.#u=this.#e.retryMinimumMs,this.#o({...this.#t,phase:"connected",connectedAt:this.#e.now(),error:null}),this.#e.onOpen?.(u),this.#h(u))}),u.addEventListener("message",s=>{if(this.#n!==u||!this.#c)return;const c=sM(s.data);if(c===null)return;const d=this.#e.now();(this.#t.lastMessageAt===null||d-this.#t.lastMessageAt>=1e3)&&this.#o({...this.#t,lastMessageAt:d}),this.#e.onMessage(c)}),u.addEventListener("error",()=>{if(!(this.#n!==u||!this.#c)){this.#o({...this.#t,error:"WebSocket connection failed"});try{u.close()}catch{this.#n=null,this.#d()}}}),u.addEventListener("close",()=>{this.#n===u&&(this.#n=null,this.#f(),this.#m(),this.#c&&this.#d())})}#d(){if(!this.#c||this.#i)return;const a=1+(this.#e.random()*2-1)*this.#e.jitterRatio,u=Math.max(0,Math.round(this.#u*a));this.#u=Math.min(this.#u*2,this.#e.retryMaximumMs),this.#o({...this.#t,phase:"reconnecting",reconnects:this.#t.reconnects+1,connectedAt:null}),this.#i=setTimeout(()=>{this.#i=null,this.#r()},u)}#h(a){this.#m(),!(!this.#e.onHeartbeat||this.#e.heartbeatMs<=0)&&(this.#s=setInterval(()=>{this.#n===a&&a.readyState===1&&this.#e.onHeartbeat?.(a)},this.#e.heartbeatMs))}#f(){this.#a&&(clearTimeout(this.#a),this.#a=null)}#m(){this.#s&&(clearInterval(this.#s),this.#s=null)}#g(){this.#f(),this.#m(),this.#i&&(clearTimeout(this.#i),this.#i=null)}#o(a){this.#t=a;for(const u of this.#l)u()}}function sM(n){return typeof n=="string"?n:n instanceof ArrayBuffer?new TextDecoder().decode(n):null}function rM(n){return n instanceof Error?n.message:"Unable to create WebSocket"}class cM{#e;#t;#n=new Set;#l=new Set;#a;constructor(a,u={}){this.#e=u.logFilter??uE,this.#t=u.eventFilter??sE,this.#a=new Ub({url:Wv(a),webSocketFactory:u.webSocketFactory,retryMinimumMs:u.retryMinimumMs,retryMaximumMs:u.retryMaximumMs,jitterRatio:u.jitterRatio,)DELIM" -R"DELIM(onOpen:s=>{this.#i(s)},onHeartbeat:s=>{this.#i(s)},onBeforeStop:s=>{s.send("/v1/log/subscribe?filter=0"),s.send("/v1/event/subscribe?filter=0")},onMessage:s=>{const c=fE(s);if(!c){for(const d of this.#l)d(s);return}for(const d of this.#n)d(c)}})}getStatus=()=>this.#a.getStatus();subscribeStatus=a=>this.#a.subscribeStatus(a);start(){this.#a.start()}stop(){this.#a.stop()}subscribeFrames(a){return this.#n.add(a),()=>{this.#n.delete(a)}}subscribeInvalidFrames(a){return this.#l.add(a),()=>{this.#l.delete(a)}}setFilters(a,u){this.#e=a,this.#t=u,this.#a.send(`/v1/log/subscribe?filter=${String(a)}`),this.#a.send(`/v1/event/subscribe?filter=${String(u)}`)}#i(a){a.send(`/v1/log/subscribe?filter=${String(this.#e)}`),a.send(`/v1/event/subscribe?filter=${String(this.#t)}`)}}const kb=pu({address:ls(),filter:ls(),turbo:ls(),witness:ls(),retarget:ls(),difficult:ls(),pruned:Ti().int().nonnegative()}),Zb=Ti().int().nonnegative();function oM(n){try{const a=JSON.parse(n),u=kb.safeParse(a);if(u.success)return{type:"configuration",payload:u.data};const s=Zb.safeParse(a);return s.success?{type:"top",payload:s.data}:null}catch{return null}}function Kv(n,a){return new URL(a,`${n.replace(/\/+$/u,"")}/`).toString()}async function Xv(n,a){const u=await fetch(n,{headers:{Accept:"application/json"},signal:a});if(!u.ok)throw new Error(`Native API request failed with status ${String(u.status)}`);return await u.json()}async function fM(n,a){const[u,s]=await Promise.all([Xv(Kv(n,"/v1/configuration?format=json"),a),Xv(Kv(n,"/v1/top?format=json"),a)]),c=kb.parse(u),d=Zb.parse(s);return{configuration:c,top:d,receivedAt:Date.now()}}const dM=15e3,hM={configuration:null,top:null,receivedAt:null,invalidFrames:0};class mM{#e=hM;#t=new Set;#n;#l;constructor(a,u={}){this.#l=u.now??Date.now,this.#n=new Ub({url:Wv(a),webSocketFactory:u.webSocketFactory,retryMinimumMs:u.retryMinimumMs,retryMaximumMs:u.retryMaximumMs,jitterRatio:u.jitterRatio,heartbeatMs:u.topPollIntervalMs??dM,now:this.#l,onOpen:s=>{s.send("/v1/configuration?format=json"),s.send("/v1/top/subscribe?format=json")},onHeartbeat:s=>{s.send("/v1/top?format=json")},onBeforeStop:s=>{s.send("/v1/top/subscribe?format=json&stop=true")},onMessage:s=>{const c=oM(s);if(!c){this.#i({...this.#e,invalidFrames:this.#e.invalidFrames+1});return}this.#a(c)}})}getStatus=()=>this.#n.getStatus();subscribeStatus=a=>this.#n.subscribeStatus(a);getState=()=>this.#e;subscribeState=a=>(this.#t.add(a),()=>{this.#t.delete(a)});start(){this.#n.start()}stop(){this.#n.stop()}#a(a){const u=this.#l();this.#i(a.type==="top"?{...this.#e,top:a.payload,receivedAt:u}:{...this.#e,configuration:a.payload,receivedAt:u})}#i(a){this.#e=a;for(const u of this.#t)u()}}function pM(n,a){const u=_e.useMemo(()=>new cM(n),[n]),s=_e.useSyncExternalStore(u.subscribeStatus,u.getStatus,u.getStatus);return _e.useEffect(()=>{const c=u.subscribeFrames(f=>{a.ingest(f)}),d=u.subscribeInvalidFrames(()=>{a.recordInvalidFrame()});return u.start(),()=>{c(),d(),u.stop()}},[u,a]),s}function gM(n,a){const u=_e.useMemo(()=>new mM(n),[n]),s=_e.useMemo(()=>gS(n),[n]),c=_e.useSyncExternalStore(u.subscribeStatus,u.getStatus,u.getStatus),d=_e.useSyncExternalStore(u.subscribeState,u.getState,u.getState);_e.useEffect(()=>(u.start(),()=>{u.stop()}),[u]);const f=uM({queryKey:["native-snapshot",n],queryFn:({signal:S})=>fM(n,S),enabled:s&&c.phase!=="connected",refetchInterval:15e3,retry:!1}),p=d.top??f.data?.top??null,g=d.configuration??f.data?.configuration??null,v=d.receivedAt??f.data?.receivedAt??null,x=c.phase==="connected"&&(d.top!==null||d.configuration!==null)?"websocket":f.isSuccess?"rest":"none";return _e.useEffect(()=>{p!==null&&a.recordNativeTop(p,v??Date.now())},[a,v,p]),{status:c,live:d,top:p,configuration:g,receivedAt:v,transport:x,restError:f.error instanceof Error?f.error.message:null}}const vM=[{id:"overview",label:"Overview"},{id:"logs",label:"Logs"},{id:"events",label:"Events"}];function yM(){const n=_e.useMemo(()=>new ZE,[]),[a,u]=_e.useState(vS),[s,c]=_e.useState("overview"),[d,f]=_e.useState(!1),p=_e.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),g=pM(a.adminUrl,n),v=gM(a.nativeUrl,n);_e.useEffect(()=>(n.start(),()=>{n.stop()}),[n]);function x(T){yS(T),n.reset(),u(T),f(!1)}function S(){bS();const T=Iv();n.reset(),u(T),f(!1)}return z.jsxs("div",{className:"bg-background text-textPrimary min-h-screen",children:[z.jsx("header",{className:"border-accent/25 bg-surface/95 sticky top-0 z-40 border-b backdrop-blur",children:z.jsx("div",{className:"mx-auto max-w-[96rem] px-4 sm:px-6",children:z.jsxs("div",{className:"flex min-h-16 flex-wrap items-center gap-x-6 gap-y-2 py-3",children:[z.jsxs("button",{type:"button",onClick:()=>{c("overview")},className:"mr-auto text-left",children:[z.jsx("p",{className:"text-accentSecondary text-[10px] font-medium tracking-[0.2em] uppercase",children:"Libbitcoin Server"}),z.jsx("h1",{className:"text-accent text-lg font-semibold tracking-tight",children:"Admin Dashboard"})]}),z.jsx("nav",{className:"order-3 flex w-full items-center gap-1 sm:order-none sm:w-auto",children:vM.map(T=>z.jsxs("button",{type:"button",onClick:()=>{c(T.id)},className:`rounded-lg px-3 py-2 text-sm transition ${s===T.id?"bg-accent/15 text-accent":"text-textMuted hover:text-textPrimary hover:bg-white/5"}`,children:[T.label,T.id==="logs"&&p.totalLogs>0&&z.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:p.totalLogs>999?"999+":String(p.totalLogs)}),T.id==="events"&&p.totalEvents>0&&z.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:p.totalEvents>999?"999+":String(p.totalEvents)})]},T.id))}),z.jsxs("div",{className:"flex items-center gap-3",children:[z.jsxs("div",{className:"hidden items-center gap-2 lg:flex","aria-label":"Connection summary",children:[z.jsx(Jv,{connected:g.phase==="connected",label:"Admin"}),z.jsx(Jv,{connected:v.transport!=="none",label:"Native"})]}),z.jsx("button",{type:"button",onClick:()=>{f(!0)},className:"border-accent/30 text-textMuted hover:border-accent hover:text-accent rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:"Endpoints"})]})]})})}),z.jsxs("main",{className:"mx-auto max-w-[96rem] min-w-0 px-4 py-8 sm:px-6",children:[s==="overview"&&z.jsx(b3,{adminStatus:g,endpoints:a,metrics:p,native:v}),s==="logs"&&z.jsx(SE,{logs:p.recentLogs,onClear:()=>{n.clearLogs()}}),s==="events"&&z.jsx(bE,{events:p.recentEvents,onClear:()=>{n.clearEvents()}})]}),d&&z.jsx(SS,{configuration:a,onClose:()=>{f(!1)},onReset:S,onSave:x},`${a.adminUrl}|${a.nativeUrl}`)]})}function Jv({connected:n,label:a}){return z.jsxs("span",{className:"text-textMuted inline-flex items-center gap-1.5 text-xs",children:[z.jsx("span",{className:`h-2 w-2 rounded-full ${n?"bg-emerald-400":"bg-amber-400"}`,"aria-hidden":"true"}),a]})}function bM({children:n}){const[a]=_e.useState(()=>new V3({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}));return z.jsxs(X3,{client:a,children:[n,null]})}const Lb=document.querySelector("#root");if(!Lb)throw new Error("Root element not found");mS.createRoot(Lb).render(z.jsx(uS.StrictMode,{children:z.jsx(bM,{children:z.jsx(yM,{})})})); +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of n.seen.entries()){const m=f[1];if(l===f[0]){d(f);continue}if(n.external){const v=n.external.registry.get(f[0])?.id;if(l!==f[0]&&v){d(f);continue}}if(n.metadataRegistry.get(f[0])?.id){d(f);continue}if(m.cycle){d(f);continue}if(m.count>1&&n.reused==="ref"){d(f);continue}}}function Ty(n,l){const s=n.seen.get(l);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const u=m=>{const g=n.seen.get(m);if(g.ref===null)return;const v=g.def??g.schema,_={...v},x=g.ref;if(g.ref=null,x){u(x);const E=n.seen.get(x),j=E.schema;if(j.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(j)):Object.assign(v,j),Object.assign(v,_),m._zod.parent===x)for(const I in v)I==="$ref"||I==="allOf"||I in _||delete v[I];if(j.$ref&&E.def)for(const I in v)I==="$ref"||I==="allOf"||I in E.def&&JSON.stringify(v[I])===JSON.stringify(E.def[I])&&delete v[I]}const w=m._zod.parent;if(w&&w!==x){u(w);const E=n.seen.get(w);if(E?.schema.$ref&&(v.$ref=E.schema.$ref,E.def))for(const j in v)j==="$ref"||j==="allOf"||j in E.def&&JSON.stringify(v[j])===JSON.stringify(E.def[j])&&delete v[j]}n.override({zodSchema:m,jsonSchema:v,path:g.path??[]})};for(const m of[...n.seen.entries()].reverse())u(m[0]);const c={};if(n.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?c.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?c.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const m=n.external.regi)DELIM" +R"DELIM(stry.get(l)?.id;if(!m)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(m)}Object.assign(c,s.def??s.schema);const d=n.metadataRegistry.get(l)?.id;d!==void 0&&c.id===d&&delete c.id;const f=n.external?.defs??{};for(const m of n.seen.entries()){const g=m[1];g.def&&g.defId&&(g.def.id===g.defId&&delete g.def.id,f[g.defId]=g.def)}n.external||Object.keys(f).length>0&&(n.target==="draft-2020-12"?c.$defs=f:c.definitions=f);try{const m=JSON.parse(JSON.stringify(c));return Object.defineProperty(m,"~standard",{value:{...l["~standard"],jsonSchema:{input:xo(l,"input",n.processors),output:xo(l,"output",n.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function Hn(n,l){const s=l??{seen:new Set};if(s.seen.has(n))return!1;s.seen.add(n);const u=n._zod.def;if(u.type==="transform")return!0;if(u.type==="array")return Hn(u.element,s);if(u.type==="set")return Hn(u.valueType,s);if(u.type==="lazy")return Hn(u.getter(),s);if(u.type==="promise"||u.type==="optional"||u.type==="nonoptional"||u.type==="nullable"||u.type==="readonly"||u.type==="default"||u.type==="prefault")return Hn(u.innerType,s);if(u.type==="intersection")return Hn(u.left,s)||Hn(u.right,s);if(u.type==="record"||u.type==="map")return Hn(u.keyType,s)||Hn(u.valueType,s);if(u.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:Hn(u.in,s)||Hn(u.out,s);if(u.type==="object"){for(const c in u.shape)if(Hn(u.shape[c],s))return!0;return!1}if(u.type==="union"){for(const c of u.options)if(Hn(c,s))return!0;return!1}if(u.type==="tuple"){for(const c of u.items)if(Hn(c,s))return!0;return!!(u.rest&&Hn(u.rest,s))}return!1}const A2=(n,l={})=>s=>{const u=zy({...s,processors:l});return _n(n,u),Ey(u,n),Ty(u,n)},xo=(n,l,s={})=>u=>{const{libraryOptions:c,target:d}=u??{},f=zy({...c??{},target:d,io:l,processors:s});return _n(n,f),Ey(f,n),Ty(f,n)},M2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},O2=(n,l,s,u)=>{const c=s;c.type="string";const{minimum:d,maximum:f,format:m,patterns:g,contentEncoding:v}=n._zod.bag;if(typeof d=="number"&&(c.minLength=d),typeof f=="number"&&(c.maxLength=f),m&&(c.format=M2[m]??m,c.format===""&&delete c.format,m==="time"&&delete c.format),v&&(c.contentEncoding=v),g&&g.size>0){const _=[...g];_.length===1?c.pattern=_[0].source:_.length>1&&(c.allOf=[..._.map(x=>({...l.target==="draft-07"||l.target==="draft-04"||l.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},N2=(n,l,s,u)=>{const c=s,{minimum:d,maximum:f,format:m,multipleOf:g,exclusiveMaximum:v,exclusiveMinimum:_}=n._zod.bag;typeof m=="string"&&m.includes("int")?c.type="integer":c.type="number";const x=typeof _=="number"&&_>=(d??Number.NEGATIVE_INFINITY),w=typeof v=="number"&&v<=(f??Number.POSITIVE_INFINITY),E=l.target==="draft-04"||l.target==="openapi-3.0";x?E?(c.minimum=_,c.exclusiveMinimum=!0):c.exclusiveMinimum=_:typeof d=="number"&&(c.minimum=d),w?E?(c.maximum=v,c.exclusiveMaximum=!0):c.exclusiveMaximum=v:typeof f=="number"&&(c.maximum=f),typeof g=="number"&&(c.multipleOf=g)},j2=(n,l,s,u)=>{s.type="boolean"},D2=(n,l,s,u)=>{s.not={}},C2=(n,l,s,u)=>{},R2=(n,l,s,u)=>{const c=n._zod.def,d=ly(c.entries);d.every(f=>typeof f=="number")&&(s.type="number"),d.every(f=>typeof f=="string")&&(s.type="string"),s.enum=d},U2=(n,l,s,u)=>{const c=n._zod.def,d=[];for(const f of c.values)if(f===void 0){if(l.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof f=="bigint"){if(l.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");d.push(Number(f))}else d.push(f);if(d.length!==0)if(d.length===1){const f=d[0];s.type=f===null?"null":typeof f,l.target==="draft-04"||l.target==="openapi-3.0"?s.enum=[f]:s.const=f}else d.every(f=>typeof f=="number")&&(s.type="number"),d.every(f=>typeof f=="string")&&(s.type="string"),d.every(f=>typeof f=="boolean")&&(s.type="boolean"),d.every(f=>f===null)&&(s.type="null"),s.enum=d},k2=(n,l,s,u)=>{if(l.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Z2=(n,l,s,u)=>{if(l.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},L2=(n,l,s,u)=>{const c=s,d=n._zod.def,{minimum:f,maximum:m}=n._zod.bag;typeof f=="number"&&(c.minItems=f),typeof m=="number"&&(c.maxItems=m),c.type="array",c.items=_n(d.element,l,{...u,path:[...u.path,"items"]})},H2=(n,l,s,u)=>{const c=s,d=n._zod.def;c.type="object",c.properties={};const f=d.shape;for(const v in f)c.properties[v]=_n(f[v],l,{...u,path:[...u.path,"properties",v]});const m=new Set(Object.keys(f)),g=new Set([...m].filter(v=>{const _=d.shape[v]._zod;return l.io==="input"?_.optin===void 0:_.optout===void 0}));g.size>0&&(c.required=Array.from(g)),d.catchall?._zod.def.type==="never"?c.additionalProperties=!1:d.catchall?d.catchall&&(c.additionalProperties=_n(d.catchall,l,{...u,path:[...u.path,"additionalProperties"]})):l.io==="output"&&(c.additionalProperties=!1)},B2=(n,l,s,u)=>{const c=n._zod.def,d=c.inclusive===!1,f=c.options.map((m,g)=>_n(m,l,{...u,path:[...u.path,d?"oneOf":"anyOf",g]}));d?s.oneOf=f:s.anyOf=f},q2=(n,l,s,u)=>{const c=n._zod.def,d=_n(c.left,l,{...u,path:[...u.path,"allOf",0]}),f=_n(c.right,l,{...u,path:[...u.path,"allOf",1]}),m=v=>"allOf"in v&&Object.keys(v).length===1,g=[...m(d)?d.allOf:[d],...m(f)?f.allOf:[f]];s.allOf=g},G2=(n,l,s,u)=>{const c=n._zod.def,d=_n(c.innerType,l,u),f=l.seen.get(n);l.target==="openapi-3.0"?(f.ref=c.innerType,s.nullable=!0):s.anyOf=[d,{type:"null"}]},Y2=(n,l,s,u)=>{const c=n._zod.def;_n(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.innerType},$2=(n,l,s,u)=>{const c=n._zod.def;_n(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.innerType,s.default=JSON.parse(JSON.stringify(c.defaultValue))},Q2=(n,l,s,u)=>{const c=n._zod.def;_n(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.innerType,l.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(c.defaultValue)))},V2=(n,l,s,u)=>{const c=n._zod.def;_n(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.innerType;let f;try{f=c.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=f},K2=(n,l,s,u)=>{const c=n._zod.def,d=c.in._zod.traits.has("$ZodTransform"),f=l.io==="input"?d?c.out:c.in:c.out;_n(f,l,u);const m=l.seen.get(n);m.ref=f},X2=(n,l,s,u)=>{const c=n._zod.def;_n(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.innerType,s.readOnly=!0},wy=(n,l,s,u)=>{const c=n._zod.def;_n(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.innerType},J2=J("ZodISODateTime",(n,l)=>{I_.init(n,l),Ot.init(n,l)});function F2(n){return l2(J2,n)}const W2=J("ZodISODate",(n,l)=>{P_.init(n,l),Ot.init(n,l)});function I2(n){return a2(W2,n)}const P2=J("ZodISOTime",(n,l)=>{ex.init(n,l),Ot.init(n,l)});function ez(n){return i2(P2,n)}const tz=J("ZodISODuration",(n,l)=>{tx.init(n,l),Ot.init(n,l)});function nz(n){return s2(tz,n)}const lz=(n,l)=>{ry.init(n,l),n.name="ZodError",Object.defineProperties(n,{format:{value:s=>YS(n,s)},flatten:{value:s=>GS(n,s)},addIssue:{value:s=>{n.issues.push(s),n.message=JSON.stringify(n.issues,eh,2)}},addIssues:{value:s=>{n.issues.push(...s),n.message=JSON.stringify(n.issues,eh,2)}},isEmpty:{get(){return n.issues.length===0}}})},jl=J("ZodError",lz,{Parent:Error}),az=jh(jl),iz=Dh(jl),sz=Oo(jl),uz=No(jl),rz=VS(jl),cz=KS(jl),oz=XS(jl),fz=JS(jl),dz=FS(jl),hz=WS(jl),mz=IS(jl),pz=PS(jl),Z0=new WeakMap;function Lr(n,l,s){const u=Object.getPrototypeOf(n);let c=Z0.get(u);if(c||(c=new Set,Z0.set(u,c)),!c.has(l)){c.add(l);for(const d in s){const f=s[d];Object.defineProperty(u,d,{configurable:!0,enumerable:!1,get(){const m=f.bind(this);return Object.defineProperty(this,d,{configurable:!0,writable:!0,enumerable:!0,value:m}),m},set(m){Object.defineProperty(this,d,{configurable:!0,writable:!0,enumerable:!0,value:m})}})}}}const Zt=J("ZodType",(n,l)=>(kt.init(n,l),Object.assign(n["~standard"],{jsonSchema:{input:xo(n,"input"),output:xo(n,"output")}}),n.toJSONSchema=A2(n,{}),n.def=l,n.type=l.type,Obje)DELIM" +R"DELIM(ct.defineProperty(n,"_def",{value:l}),n.parse=(s,u)=>az(n,s,u,{callee:n.parse}),n.safeParse=(s,u)=>sz(n,s,u),n.parseAsync=async(s,u)=>iz(n,s,u,{callee:n.parseAsync}),n.safeParseAsync=async(s,u)=>uz(n,s,u),n.spa=n.safeParseAsync,n.encode=(s,u)=>rz(n,s,u),n.decode=(s,u)=>cz(n,s,u),n.encodeAsync=async(s,u)=>oz(n,s,u),n.decodeAsync=async(s,u)=>fz(n,s,u),n.safeEncode=(s,u)=>dz(n,s,u),n.safeDecode=(s,u)=>hz(n,s,u),n.safeEncodeAsync=async(s,u)=>mz(n,s,u),n.safeDecodeAsync=async(s,u)=>pz(n,s,u),Lr(n,"ZodType",{check(...s){const u=this.def;return this.clone(Mi(u,{checks:[...u.checks??[],...s.map(c=>typeof c=="function"?{_zod:{check:c,def:{check:"custom"},onattach:[]}}:c)]}),{parent:!0})},with(...s){return this.check(...s)},clone(s,u){return Oi(this,s,u)},brand(){return this},register(s,u){return s.add(this,u),this},refine(s,u){return this.check(uE(s,u))},superRefine(s,u){return this.check(rE(s,u))},overwrite(s){return this.check(yu(s))},optional(){return q0(this)},exactOptional(){return Xz(this)},nullable(){return G0(this)},nullish(){return q0(G0(this))},nonoptional(s){return eE(this,s)},array(){return Rh(this)},or(s){return Uh([this,s])},and(s){return Yz(this,s)},transform(s){return Y0(this,Vz(s))},default(s){return Wz(this,s)},prefault(s){return Pz(this,s)},catch(s){return nE(this,s)},pipe(s){return Y0(this,s)},readonly(){return iE(this)},describe(s){const u=this.clone();return Tr.add(u,{description:s}),u},meta(...s){if(s.length===0)return Tr.get(this);const u=this.clone();return Tr.add(u,s[0]),u},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(s){return s(this)}}),Object.defineProperty(n,"description",{get(){return Tr.get(n)?.description},configurable:!0}),n)),Ay=J("_ZodString",(n,l)=>{Ch.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(u,c,d)=>O2(n,u,c);const s=n._zod.bag;n.format=s.format??null,n.minLength=s.minimum??null,n.maxLength=s.maximum??null,Lr(n,"_ZodString",{regex(...u){return this.check(d2(...u))},includes(...u){return this.check(p2(...u))},startsWith(...u){return this.check(g2(...u))},endsWith(...u){return this.check(v2(...u))},min(...u){return this.check(_o(...u))},max(...u){return this.check(_y(...u))},length(...u){return this.check(xy(...u))},nonempty(...u){return this.check(_o(1,...u))},lowercase(u){return this.check(h2(u))},uppercase(u){return this.check(m2(u))},trim(){return this.check(b2())},normalize(...u){return this.check(y2(...u))},toLowerCase(){return this.check(S2())},toUpperCase(){return this.check(_2())},slugify(){return this.check(x2())}})}),gz=J("ZodString",(n,l)=>{Ch.init(n,l),Ay.init(n,l),n.email=s=>n.check(kx(vz,s)),n.url=s=>n.check(qx(yz,s)),n.jwt=s=>n.check(n2(Cz,s)),n.emoji=s=>n.check(Gx(bz,s)),n.guid=s=>n.check(C0(L0,s)),n.uuid=s=>n.check(Zx(ro,s)),n.uuidv4=s=>n.check(Lx(ro,s)),n.uuidv6=s=>n.check(Hx(ro,s)),n.uuidv7=s=>n.check(Bx(ro,s)),n.nanoid=s=>n.check(Yx(Sz,s)),n.guid=s=>n.check(C0(L0,s)),n.cuid=s=>n.check($x(_z,s)),n.cuid2=s=>n.check(Qx(xz,s)),n.ulid=s=>n.check(Vx(zz,s)),n.base64=s=>n.check(Px(Nz,s)),n.base64url=s=>n.check(e2(jz,s)),n.xid=s=>n.check(Kx(Ez,s)),n.ksuid=s=>n.check(Xx(Tz,s)),n.ipv4=s=>n.check(Jx(wz,s)),n.ipv6=s=>n.check(Fx(Az,s)),n.cidrv4=s=>n.check(Wx(Mz,s)),n.cidrv6=s=>n.check(Ix(Oz,s)),n.e164=s=>n.check(t2(Dz,s)),n.datetime=s=>n.check(F2(s)),n.date=s=>n.check(I2(s)),n.time=s=>n.check(ez(s)),n.duration=s=>n.check(nz(s))});function us(n){return Ux(gz,n)}const Ot=J("ZodStringFormat",(n,l)=>{wt.init(n,l),Ay.init(n,l)}),vz=J("ZodEmail",(n,l)=>{Y_.init(n,l),Ot.init(n,l)}),L0=J("ZodGUID",(n,l)=>{q_.init(n,l),Ot.init(n,l)}),ro=J("ZodUUID",(n,l)=>{G_.init(n,l),Ot.init(n,l)}),yz=J("ZodURL",(n,l)=>{$_.init(n,l),Ot.init(n,l)}),bz=J("ZodEmoji",(n,l)=>{Q_.init(n,l),Ot.init(n,l)}),Sz=J("ZodNanoID",(n,l)=>{V_.init(n,l),Ot.init(n,l)}),_z=J("ZodCUID",(n,l)=>{K_.init(n,l),Ot.init(n,l)}),xz=J("ZodCUID2",(n,l)=>{X_.init(n,l),Ot.init(n,l)}),zz=J("ZodULID",(n,l)=>{J_.init(n,l),Ot.init(n,l)}),Ez=J("ZodXID",(n,l)=>{F_.init(n,l),Ot.init(n,l)}),Tz=J("ZodKSUID",(n,l)=>{W_.init(n,l),Ot.init(n,l)}),wz=J("ZodIPv4",(n,l)=>{nx.init(n,l),Ot.init(n,l)}),Az=J("ZodIPv6",(n,l)=>{lx.init(n,l),Ot.init(n,l)}),Mz=J("ZodCIDRv4",(n,l)=>{ax.init(n,l),Ot.init(n,l)}),Oz=J("ZodCIDRv6",(n,l)=>{ix.init(n,l),Ot.init(n,l)}),Nz=J("ZodBase64",(n,l)=>{sx.init(n,l),Ot.init(n,l)}),jz=J("ZodBase64URL",(n,l)=>{rx.init(n,l),Ot.init(n,l)}),Dz=J("ZodE164",(n,l)=>{cx.init(n,l),Ot.init(n,l)}),Cz=J("ZodJWT",(n,l)=>{fx.init(n,l),Ot.init(n,l)}),My=J("ZodNumber",(n,l)=>{vy.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(u,c,d)=>N2(n,u,c),Lr(n,"ZodNumber",{gt(u,c){return this.check(U0(u,c))},gte(u,c){return this.check($d(u,c))},min(u,c){return this.check($d(u,c))},lt(u,c){return this.check(R0(u,c))},lte(u,c){return this.check(Yd(u,c))},max(u,c){return this.check(Yd(u,c))},int(u){return this.check(H0(u))},safe(u){return this.check(H0(u))},positive(u){return this.check(U0(0,u))},nonnegative(u){return this.check($d(0,u))},negative(u){return this.check(R0(0,u))},nonpositive(u){return this.check(Yd(0,u))},multipleOf(u,c){return this.check(k0(u,c))},step(u,c){return this.check(k0(u,c))},finite(){return this}});const s=n._zod.bag;n.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),n.isFinite=!0,n.format=s.format??null});function Ti(n){return u2(My,n)}const Rz=J("ZodNumberFormat",(n,l)=>{dx.init(n,l),My.init(n,l)});function H0(n){return r2(Rz,n)}const Uz=J("ZodBoolean",(n,l)=>{hx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>j2(n,s,u)});function lu(n){return c2(Uz,n)}const kz=J("ZodUnknown",(n,l)=>{mx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>C2()});function B0(){return o2(kz)}const Zz=J("ZodNever",(n,l)=>{px.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>D2(n,s,u)});function Lz(n){return f2(Zz,n)}const Hz=J("ZodArray",(n,l)=>{gx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>L2(n,s,u,c),n.element=l.element,Lr(n,"ZodArray",{min(s,u){return this.check(_o(s,u))},nonempty(s){return this.check(_o(1,s))},max(s,u){return this.check(_y(s,u))},length(s,u){return this.check(xy(s,u))},unwrap(){return this.element}})});function Rh(n,l){return z2(Hz,n,l)}const Bz=J("ZodObject",(n,l)=>{yx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>H2(n,s,u,c),ht(n,"shape",()=>l.shape),Lr(n,"ZodObject",{keyof(){return kh(Object.keys(this._zod.def.shape))},catchall(s){return this.clone({...this._zod.def,catchall:s})},passthrough(){return this.clone({...this._zod.def,catchall:B0()})},loose(){return this.clone({...this._zod.def,catchall:B0()})},strict(){return this.clone({...this._zod.def,catchall:Lz()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(s){return kS(this,s)},safeExtend(s){return ZS(this,s)},merge(s){return LS(this,s)},pick(s){return RS(this,s)},omit(s){return US(this,s)},partial(...s){return HS(Oy,this,s[0])},required(...s){return BS(Ny,this,s[0])}})});function ps(n,l){const s={type:"object",shape:n??{},...Ae(l)};return new Bz(s)}const qz=J("ZodUnion",(n,l)=>{bx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>B2(n,s,u,c),n.options=l.options});function Uh(n,l){return new qz({type:"union",options:n,...Ae(l)})}const Gz=J("ZodIntersection",(n,l)=>{Sx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>q2(n,s,u,c)});function Yz(n,l){return new Gz({type:"intersection",left:n,right:l})}const nh=J("ZodEnum",(n,l)=>{_x.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(u,c,d)=>R2(n,u,c),n.enum=l.entries,n.options=Object.values(l.entries);const s=new Set(Object.keys(l.entries));n.extract=(u,c)=>{const d={};for(const f of u)if(s.has(f))d[f]=l.entries[f];else throw new Error(`Key ${f} not found in enum`);return new nh({...l,checks:[],...Ae(c),entries:d})},n.exclude=(u,c)=>{const d={...l.entries};for(const f of)DELIM" +R"DELIM( u)if(s.has(f))delete d[f];else throw new Error(`Key ${f} not found in enum`);return new nh({...l,checks:[],...Ae(c),entries:d})}});function kh(n,l){const s=Array.isArray(n)?Object.fromEntries(n.map(u=>[u,u])):n;return new nh({type:"enum",entries:s,...Ae(l)})}const $z=J("ZodLiteral",(n,l)=>{xx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>U2(n,s,u),n.values=new Set(l.values),Object.defineProperty(n,"value",{get(){if(l.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return l.values[0]}})});function go(n,l){return new $z({type:"literal",values:Array.isArray(n)?n:[n],...Ae(l)})}const Qz=J("ZodTransform",(n,l)=>{zx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>Z2(n,s),n._zod.parse=(s,u)=>{if(u.direction==="backward")throw new ny(n.constructor.name);s.addIssue=d=>{if(typeof d=="string")s.issues.push(Cr(d,s.value,l));else{const f=d;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=s.value),f.inst??(f.inst=n),s.issues.push(Cr(f))}};const c=l.transform(s.value,s);return c instanceof Promise?c.then(d=>(s.value=d,s.fallback=!0,s)):(s.value=c,s.fallback=!0,s)}});function Vz(n){return new Qz({type:"transform",transform:n})}const Oy=J("ZodOptional",(n,l)=>{Sy.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>wy(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function q0(n){return new Oy({type:"optional",innerType:n})}const Kz=J("ZodExactOptional",(n,l)=>{Ex.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>wy(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function Xz(n){return new Kz({type:"optional",innerType:n})}const Jz=J("ZodNullable",(n,l)=>{Tx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>G2(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function G0(n){return new Jz({type:"nullable",innerType:n})}const Fz=J("ZodDefault",(n,l)=>{wx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>$2(n,s,u,c),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function Wz(n,l){return new Fz({type:"default",innerType:n,get defaultValue(){return typeof l=="function"?l():iy(l)}})}const Iz=J("ZodPrefault",(n,l)=>{Ax.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>Q2(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function Pz(n,l){return new Iz({type:"prefault",innerType:n,get defaultValue(){return typeof l=="function"?l():iy(l)}})}const Ny=J("ZodNonOptional",(n,l)=>{Mx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>Y2(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function eE(n,l){return new Ny({type:"nonoptional",innerType:n,...Ae(l)})}const tE=J("ZodCatch",(n,l)=>{Ox.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>V2(n,s,u,c),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function nE(n,l){return new tE({type:"catch",innerType:n,catchValue:typeof l=="function"?l:()=>l})}const lE=J("ZodPipe",(n,l)=>{Nx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>K2(n,s,u,c),n.in=l.in,n.out=l.out});function Y0(n,l){return new lE({type:"pipe",in:n,out:l})}const aE=J("ZodReadonly",(n,l)=>{jx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>X2(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function iE(n){return new aE({type:"readonly",innerType:n})}const sE=J("ZodCustom",(n,l)=>{Dx.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>k2(n,s)});function uE(n,l={}){return E2(sE,n,l)}function rE(n,l){return T2(n,l)}const Do=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],Rr=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",category:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"blocks",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"count"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:18,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],cE=ps({level:Ti().int().nonnegative(),time:Ti().int().nonnegative(),message:us()}),oE=ps({event:Ti().int().nonnegative(),value:Ti().nonnegative(),time:Ti().int().nonnegative()}),fE=ps({previous:Ti().nonnegative()}),dE=Uh([cE,oE,fE]),hE=2**Do.length-1,mE=2**Rr.length-1;function pE(n){return"level"in n}function gE(n){return"event"in n}function vE(n){return"previous"in n}function yE(n){try{const l=JSON.parse(n),s=dE.safeParse(l);return s.success?s.data:null}catch{return null}}function cs(n){return Rr[n]??{id:n,name:`event_${String(n)}`,label:`Event ${String(n)}`,category:"chain",valueKind:"unknown"}}function $0(n){return Do[n]??{id:n,name:`level_${String(n)}`,label:`Level ${String(n)}`}}function bE(n,l){const s=cs(n);if(s.category!=="timing")return null;switch(s.valueKind){case"seconds":return l*1e3;case"milliseconds":return l;case"microseconds":return l/1e3;default:return null}}const SE=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function ou(n,l=2){return new Intl.NumberFormat(void 0,{maximumFractionDigits:l}).format(n)}function dl(n){return SE.format(n)}function Or(n,l=!0){const s=new Date(n);if(!Number.isFinite(s.getTime()))return"Invalid time";const u=s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return l?`${u}.${String(s.getMilliseconds()).padStart(3,"0")}`:u}function _E(n){const l=Math.max(0,Math.floor(n/1e3)),s=Math.floor(l/86400),u=Math.floor(l%86400/3600),c=Math.floor(l%3600/60),d=l%60;return s>0?`${String(s)}d ${String(u)}h`:u>0?`${String(u)}h ${String(c)}m`:c)DELIM" +R"DELIM(>0?`${String(c)}m ${String(d)}s`:`${String(d)}s`}function jy(n,l){switch(cs(n).valueKind){case"height":return`height ${dl(l)}`;case"seconds":return`${ou(l)} s`;case"milliseconds":return`${ou(l)} ms`;case"microseconds":return`${ou(l)} µs`;case"count":return dl(l);default:return String(l)}}function xE(n){return n>=100?`${ou(n,0)}/s`:n>=10?`${ou(n,1)}/s`:`${ou(n,2)}/s`}function Dy(n){try{const l=new URL(n),s=l.pathname==="/"?"":l.pathname.replace(/\/$/u,"");return`${l.host}${s}`}catch{return n}}const zE=[{value:"all",label:"All categories"},{value:"headers",label:"Headers"},{value:"blocks",label:"Blocks"},{value:"transactions",label:"Transactions"},{value:"chain",label:"Confirmed chain"},{value:"mining",label:"Mining"},{value:"timing",label:"Timing"}],EE={headers:"bg-violet-500/15 text-violet-300",blocks:"bg-accent/15 text-accent",transactions:"bg-sky-500/15 text-sky-300",chain:"bg-emerald-500/15 text-emerald-300",mining:"bg-amber-500/15 text-amber-300",timing:"bg-cyan-500/15 text-cyan-300"};function TE({events:n,onClear:l}){const[s,u]=ge.useState(""),[c,d]=ge.useState("all"),[f,m]=ge.useState(!1),[g,v]=ge.useState([]),_=f?g:n,x=ge.useMemo(()=>{const E=s.trim().toLowerCase();return _.filter(j=>{const H=cs(j.event);return c==="all"||H.category===c}).filter(j=>{if(!E)return!0;const H=cs(j.event);return H.name.includes(E)||H.label.toLowerCase().includes(E)||String(j.value).includes(E)}).slice(0,250)},[c,s,_]);function w(){f||v(n),m(E=>!E)}return S.jsxs("section",{className:"space-y-4",children:[S.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Node lifecycle"}),S.jsx("h2",{className:"mt-1 text-2xl font-semibold",children:"Live events"}),S.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"Heights are event payloads; timing values retain their source units."})]}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{type:"button",onClick:w,className:"border-accent/35 text-accent hover:bg-accent/10 rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:f?"Resume":"Pause"}),S.jsx("button",{type:"button",onClick:l,className:"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:"Clear"})]})]}),S.jsxs("div",{className:"border-accent/20 bg-surface/70 flex flex-wrap gap-3 rounded-xl border p-4",children:[S.jsxs("label",{className:"min-w-56 flex-1",children:[S.jsx("span",{className:"sr-only",children:"Search events"}),S.jsx("input",{type:"search",value:s,onChange:E=>{u(E.target.value)},placeholder:"Search event names or values…",className:"border-accent/25 bg-background/70 text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0"})]}),S.jsxs("label",{children:[S.jsx("span",{className:"sr-only",children:"Filter event category"}),S.jsx("select",{value:c,onChange:E=>{d(E.target.value)},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent rounded-lg border px-3 py-2 text-sm focus:ring-0",children:zE.map(E=>S.jsx("option",{value:E.value,children:E.label},E.value))})]})]}),S.jsxs("div",{className:"border-accent/20 bg-surface/70 overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-accent/15 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[S.jsx("span",{children:f?"Paused snapshot":"Live stream"}),S.jsxs("span",{children:["Showing ",String(x.length)," of ",String(_.length)]})]}),S.jsx("div",{className:"max-h-[65vh] overflow-auto",children:x.length===0?S.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching events."}):S.jsx("ol",{className:"divide-y divide-white/5",children:x.map(E=>{const j=cs(E.event);return S.jsxs("li",{className:"grid items-start gap-2 px-4 py-3 text-xs sm:grid-cols-[8.5rem_10rem_minmax(0,1fr)]",children:[S.jsx("time",{dateTime:new Date(E.time).toISOString(),className:"text-textMuted font-mono tabular-nums",children:Or(E.time)}),S.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${EE[j.category]}`,children:j.name}),S.jsx("span",{className:"text-textPrimary font-mono tabular-nums",children:jy(E.event,E.value)})]},E.id)})})})]}),S.jsxs("details",{className:"border-accent/20 bg-surface/50 rounded-xl border",children:[S.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-4 py-3 text-sm",children:["Event contract (",String(Rr.length)," identifiers)"]}),S.jsx("div",{className:"grid gap-2 border-t border-white/5 p-4 sm:grid-cols-2 lg:grid-cols-3",children:Rr.map(E=>S.jsxs("div",{className:"text-xs",children:[S.jsx("span",{className:"text-textMuted font-mono",children:String(E.id).padStart(2,"0")}),S.jsx("span",{className:"text-textPrimary ml-2",children:E.name})]},E.id))})]})]})}const Q0={0:"bg-sky-500/15 text-sky-300",1:"bg-emerald-500/15 text-emerald-300",2:"bg-violet-500/15 text-violet-300",3:"bg-cyan-500/15 text-cyan-300",4:"bg-indigo-500/15 text-indigo-300",5:"bg-blue-500/15 text-blue-300",6:"bg-red-500/20 text-red-300",7:"bg-orange-500/20 text-orange-300",8:"bg-slate-500/20 text-slate-300",9:"bg-zinc-500/20 text-zinc-300"};function wE({logs:n,onClear:l}){const[s,u]=ge.useState(""),[c,d]=ge.useState("all"),[f,m]=ge.useState(!1),[g,v]=ge.useState([]),_=f?g:n,x=ge.useMemo(()=>{const E=s.trim().toLowerCase();return _.filter(j=>c==="all"||j.level===Number(c)).filter(j=>!E||j.message.toLowerCase().includes(E)||$0(j.level).name.includes(E)).slice(0,250)},[c,s,_]);function w(){f||v(n),m(E=>!E)}return S.jsxs("section",{className:"space-y-4",children:[S.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Diagnostic stream"}),S.jsx("h2",{className:"mt-1 text-2xl font-semibold",children:"Node logs"}),S.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"The newest 1,000 messages are retained in this browser session."})]}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{type:"button",onClick:w,className:"border-accent/35 text-accent hover:bg-accent/10 rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:f?"Resume":"Pause"}),S.jsx("button",{type:"button",onClick:l,className:"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:"Clear"})]})]}),S.jsxs("div",{className:"border-accent/20 bg-surface/70 flex flex-wrap gap-3 rounded-xl border p-4",children:[S.jsxs("label",{className:"min-w-56 flex-1",children:[S.jsx("span",{className:"sr-only",children:"Search logs"}),S.jsx("input",{type:"search",value:s,onChange:E=>{u(E.target.value)},placeholder:"Search messages…",className:"border-accent/25 bg-background/70 text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0"})]}),S.jsxs("label",{children:[S.jsx("span",{className:"sr-only",children:"Filter log level"}),S.jsxs("select",{value:c,onChange:E=>{d(E.target.value)},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent rounded-lg border px-3 py-2 text-sm focus:ring-0",children:[S.jsx("option",{value:"all",children:"All levels"}),Do.map(E=>S.jsx("option",{value:E.id,children:E.label},E.id))]})]})]}),S.jsxs("div",{className:"border-accent/20 bg-surface/70 overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-accent/15 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[S.jsx("span",{children:f?"Paused snapshot":"Live stream"}),S.jsxs("span",{children:["Showing ",String(x.length)," of ",String(_.length)]})]}),S.jsx("div",{classNa)DELIM" +R"DELIM(me:"max-h-[65vh] overflow-auto",children:x.length===0?S.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching log messages."}):S.jsx("ol",{className:"divide-y divide-white/5",children:x.map(E=>{const j=$0(E.level);return S.jsxs("li",{className:"grid gap-2 px-4 py-3 text-xs sm:grid-cols-[7.5rem_7.5rem_minmax(0,1fr)]",children:[S.jsx("time",{dateTime:new Date(E.time).toISOString(),className:"text-textMuted font-mono tabular-nums",children:Or(E.time,!1)}),S.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${Q0[E.level]??Q0[8]}`,children:j.name}),S.jsx("span",{className:"text-textPrimary min-w-0 font-mono leading-5 break-words whitespace-pre-wrap",children:E.message})]},E.id)})})})]})]})}const Qd=["line","area","bar"],V0=["line","step","area"],AE=["line","step","area"],Cy={"occurrence-count":{id:"occurrence-count",label:"Occurrences per bucket",description:"Number of frames observed in each one-second bucket.",unit:"occurrences",chartTypes:Qd},"occurrence-rate":{id:"occurrence-rate",label:"Occurrence rate",description:"Frames observed per second.",unit:"occurrences-per-second",chartTypes:Qd},"cumulative-occurrences":{id:"cumulative-occurrences",label:"Cumulative occurrences",description:"Running number of frames observed during this browser session.",unit:"occurrences",chartTypes:V0},"payload-latest":{id:"payload-latest",label:"Latest value",description:"Most recently observed payload value.",unit:"count",chartTypes:AE},"payload-average":{id:"payload-average",label:"Average value",description:"Average payload value within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-minimum":{id:"payload-minimum",label:"Minimum value",description:"Minimum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-maximum":{id:"payload-maximum",label:"Maximum value",description:"Maximum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-sum":{id:"payload-sum",label:"Value per bucket",description:"Sum of count payloads within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-cumulative":{id:"payload-cumulative",label:"Cumulative value",description:"Running sum of count payloads during this browser session.",unit:"count",chartTypes:V0},"payload-change-rate":{id:"payload-change-rate",label:"Height change rate",description:"Change in the latest observed height per second.",unit:"height-per-second",chartTypes:Qd}},bu=["occurrence-rate","occurrence-count","cumulative-occurrences"],ME=["payload-latest","payload-maximum","payload-change-rate",...bu],OE=["payload-average","payload-latest","payload-minimum","payload-maximum",...bu],NE=["payload-sum","payload-cumulative","payload-latest","payload-average",...bu];function Nl(n){return`event:${String(n)}`}function xi(n){return`log:${String(n)}`}const zo="native:top";function jE(n){switch(n){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";default:return"unknown"}}function DE(n){switch(n){case"height":return ME;case"duration":return OE;case"count":return NE;default:return bu}}function CE(n){switch(n){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function Ry(n){const l=cs(n),s=jE(l.valueKind);return{id:Nl(n),source:"event",sourceId:n,name:l.name,label:l.label,category:l.category,payloadKind:s,allowedMeasures:DE(s),defaultMeasure:CE(s),description:s==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${l.label} event with a ${s} payload.`}}const RE=[...Rr.map(n=>Ry(n.id)),...Do.map(n=>({id:xi(n.id),source:"log",sourceId:n.id,name:n.name,label:`${n.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:bu,defaultMeasure:"occurrence-rate",description:`${n.label} log message volume. Message text is not interpreted as numeric data.`})),{id:zo,source:"native",sourceId:"top",name:"canonical_top",label:"Canonical top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate"],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}],Zh=RE,UE=new Map(Zh.map(n=>[n.id,n]));function Za(n){const l=UE.get(n);if(l)return l;const s=/^event:(\d+)$/u.exec(n);return s?Ry(Number(s[1])):{id:n,source:"event",sourceId:-1,name:n,label:n,category:"unknown",payloadKind:"unknown",allowedMeasures:bu,defaultMeasure:"occurrence-rate",description:"Unknown signal; only occurrence measurements are available."}}function Ei(n,l){const s=Cy[l];if(l.startsWith("occurrence")||l==="cumulative-occurrences")return s;const u=l==="payload-change-rate"?"height-per-second":n.payloadKind==="height"?"height":n.payloadKind==="duration"?"milliseconds":"count";return{...s,unit:u}}function kE(n,l){return n.allowedMeasures.includes(l)}function ZE(n,l){return bE(n,l)??l}const LE=3600*1e3,HE=250,BE=1e3,qE=1e3;class K0{constructor(l){this.capacity=l,this.#e=Array.from({length:l})}capacity;#e;#t=0;#n=0;push(l){this.#e[this.#t]=l,this.#t=(this.#t+1)%this.capacity,this.#n=Math.min(this.#n+1,this.capacity)}clear(){this.#t=0,this.#n=0}newestFirst(){const l=[];for(let s=0;sthis.#A;subscribe=l=>(this.#t.add(l),()=>{this.#t.delete(l)});start(){this.#y||(this.tick(),this.#y=setInterval(()=>{this.tick()},1e3))}stop(){this.#y&&(clearInterval(this.#y),this.#y=null),this.#m&&(clearTimeout(this.#m),this.#m=null)}ingest(l,s=this.#e()){const u=this.#E(s);this.#g+=1,pE(l)?this.#j(l,u):gE(l)?this.#D(l,u):vE(l)&&(this.#S+=1),this.#w()}recordInvalidFrame(){this.#_+=1,this.#w()}recordNativeTop(l,s=this.#e()){const u=this.#E(s),c=this.#h[zo];c?.value===l&&u-c.time<15e3||(this.#M(zo,u,l),this.#O(u),this.#w())}clearLogs(){this.#n.clear(),this.flush()}clearEvents(){this.#l.clear(),this.flush()}reset(){this.#n.clear(),this.#l.clear(),this.#a.clear(),this.#i={},this.#u={},this.#s={},this.#c={},this.#r={},this.#h={},this.#p={},this.#f=this.#E(this.#e()),this.#g=0,this.#o=0,this.#b=0,this.#S=0,this.#_=0,this.#x=null,this.#z=null,this.#v=0,this.#T(this.#f),this.flush()}tick(){const l=this.#E(this.#e());this.#T(l),this.#O(l),this.#w()}flush(){this.#m&&(clearTimeout(this.#m),this.#m=null),this.#A=this.#N();for(const l of this.#t)l()}#j(l,s){this.#o+=1,this.#x=s,this.#v+=1,this.#n.push({...l,id:this.#v,receivedAt:s}),this.#M(xi(l.level),s,null)}#D(l,s){this.#b+=1,this.#z=s,this.#v+=1,this.#l.push({...l,id:this.#v,receivedAt:s}),this.#M(Nl(l.event),s,ZE(l.event,l.value))}#E(l){return Number.isFinite(l)?(this.#d=Math.max(this.#d,l),this.#d):this.#d}#M(l,s,u){const c=this.#T(s),d=c.signals.get(l)??GE();if(d.count+=1,co(this.#c,l,1),u!==null){d.samples+=1,d.sum+=u,d.minimum=d.minimum===null?u:Math.min(d.minimum,u),d.maximum=d.maximum===null?u:Math.max(d.maximum,u),(d.firstAt===null||s=d.lastAt)&&(d.last=u,d.lastAt=s),co(this.#r,l,u);const f=this.#h[l];(!f||s>=f.time)&&(this.#h[l]={value:u,time:s}),this.#p[l]=Math.max(this.#p[l]??u,u)}c.signals.set(l,d)}#T(l){const s=Math.floor(l/1e3)*1e3,u=this.#a.get(s);if(u)return u;const c={time:s,signals:new Map};return this.#a.set(s,c),c}#O(l){const s=l-LE;for(const[u,c]of this.#a)if(!(u>=s)){for(const[d,f]of c)DELIM" +R"DELIM(.signals)if(co(this.#i,d,f.count),co(this.#u,d,f.sum),f.last!==null&&f.lastAt!==null){const m=this.#s[d];(!m||f.lastAt>=m.time)&&(this.#s[d]={value:f.last,time:f.lastAt})}this.#a.delete(u)}}#w(){this.#m||(this.#m=setTimeout(()=>{this.#m=null,this.flush()},HE))}#N(){const l=[...this.#a.values()].sort((s,u)=>s.time-u.time);return{now:this.#E(this.#e()),sessionStartedAt:this.#f,totalFrames:this.#g,totalLogs:this.#o,totalEvents:this.#b,totalAcks:this.#S,invalidFrames:this.#_,buckets:l.map(s=>({time:s.time,signals:Object.fromEntries([...s.signals].map(([u,c])=>[u,{...c}]))})),priorSignalCounts:{...this.#i},priorSignalSums:{...this.#u},priorSignalLatest:X0(this.#s),signalTotals:{...this.#c},signalSums:{...this.#r},signalLatest:X0(this.#h),signalMaximums:{...this.#p},recentLogs:this.#n.newestFirst(),recentEvents:this.#l.newestFirst(),lastLogAt:this.#x,lastEventAt:this.#z}}}function $E(n,l,s,u,c=n[0]?.time??s){const d=s-u*1e3,f=d<=c,m=f?Math.floor(c/1e3)*1e3:Math.ceil(d/1e3)*1e3,g=f?c:m,v=Math.floor(s/1e3)*1e3,x=n.filter(E=>E.time>=m&&E.time<=v).reduce((E,j)=>E+(j.signals[l]?.count??0),0),w=Math.max(0,(s-g)/1e3);return w>0?x/w:0}function QE(n,l){const s=f=>$E(n.buckets,Nl(f),n.now,l,n.sessionStartedAt),u=s(2)+s(14);if(u>0)return{label:"Reorganizing",rate:u};const d=[{label:"Confirming blocks",rate:s(6)},{label:"Validating blocks",rate:s(5)},{label:"Archiving blocks",rate:s(3)},{label:"Synchronizing headers",rate:Math.max(s(0),s(1))}].reduce((f,m)=>m.rate>f.rate?m:f);return d.rate>0?d:{label:"Idle",rate:0}}const VE=6e4,KE=15*6e4,XE=18;async function JE(n,l){const s=await fetch(xS(n,"/blocks/tip/height"),{headers:{Accept:"text/plain"},signal:l});if(!s.ok)throw new Error(`Reference API request failed with status ${String(s.status)}`);const c=(await s.text()).trim();if(!/^\d+$/u.test(c))throw new TypeError("Reference API returned an invalid top height");const d=Number(c);if(!Number.isSafeInteger(d))throw new TypeError("Reference API returned an invalid top height");return{top:d,receivedAt:Date.now()}}function FE(n,l){return n!==null&&l-n>KE}const WE={idle:"border-slate-500/40 bg-slate-500/10 text-slate-300",connecting:"border-amber-500/40 bg-amber-500/10 text-amber-300",connected:"border-emerald-500/40 bg-emerald-500/10 text-emerald-300",reconnecting:"border-orange-500/40 bg-orange-500/10 text-orange-300"};function IE({phase:n,label:l}){return S.jsxs("span",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-xs tracking-wide uppercase ${WE[n]}`,children:[S.jsx("span",{className:"h-2 w-2 rounded-full bg-current","aria-hidden":"true"}),l]})}const PE={orange:"from-accent/25",red:"from-accentSecondary/25",green:"from-emerald-500/20",blue:"from-sky-500/20"};function oo({label:n,value:l,detail:s,accent:u="orange"}){return S.jsxs("article",{className:`border-accent/20 bg-surface/80 rounded-xl border bg-gradient-to-br ${PE[u]} to-transparent p-5`,children:[S.jsx("p",{className:"text-textMuted text-xs font-medium tracking-[0.14em] uppercase",children:n}),S.jsx("p",{className:"text-textPrimary mt-3 text-3xl font-semibold tracking-tight tabular-nums",children:l}),S.jsx("div",{className:"text-textMuted mt-2 min-h-5 text-xs",children:s})]})}function eT({localTop:n,referenceTop:l,referenceUrl:s}){if(n===null||l===null||l<=0)return null;const u=Math.max(0,l-n);if(u<=XE)return null;const c=Math.min(99.99,Math.max(0,n/l*100)),d=`${c.toFixed(2)}%`;return S.jsxs("section",{className:"border-accent/25 bg-surface/70 overflow-hidden rounded-xl border","aria-labelledby":"node-sync-progress-title",children:[S.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3 px-5 pt-5",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Node synchronization"}),S.jsx("h2",{id:"node-sync-progress-title",className:"mt-1 font-semibold",children:"Catching up to network top"})]}),S.jsx("p",{className:"text-accent font-mono text-xl font-semibold tabular-nums",children:d})]}),S.jsx("div",{className:"px-5 pt-4",children:S.jsx("div",{role:"progressbar","aria-label":"Node synchronization progress","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Number(c.toFixed(2)),"aria-valuetext":`${dl(u)} blocks remaining`,className:"bg-background h-3 overflow-hidden rounded-full border border-white/5",children:S.jsx("div",{className:"bg-accent h-full rounded-full transition-[width] duration-700",style:{width:`${String(c)}%`}})})}),S.jsxs("dl",{className:"mt-5 grid gap-px bg-white/5 text-sm sm:grid-cols-3",children:[S.jsx(Vd,{label:"Local top",value:dl(n)}),S.jsx(Vd,{label:"Network top",value:dl(l)}),S.jsx(Vd,{label:"Blocks remaining",value:dl(u)})]}),S.jsxs("p",{className:"bg-surface text-textMuted border-t border-white/5 px-5 py-2 text-[11px]",children:["Reference: ",Dy(s)]})]})}function Vd({label:n,value:l}){return S.jsxs("div",{className:"bg-surface px-5 py-3",children:[S.jsx("dt",{className:"text-textMuted text-xs",children:n}),S.jsx("dd",{className:"text-textPrimary mt-1 font-mono tabular-nums",children:l})]})}const su=16,lh=8,Lh=80,tT=[300,900,3600],ah=["line","step","area","bar"],bn=["#ffa022","#38bdf8","#34d399","#c084fc","#fb7185","#e879f9","#facc15","#60a5fa"],nT=kh(["occurrence-count","occurrence-rate","cumulative-occurrences","payload-latest","payload-average","payload-minimum","payload-maximum","payload-sum","payload-cumulative","payload-change-rate"]),lT=ps({id:us().min(1).max(100),signalId:us().min(1).max(100),measure:nT,color:us().regex(/^#[\da-f]{6}$/iu),label:us().max(80).optional()}).strict(),Uy=ps({id:us().min(1).max(100),title:us().trim().min(1).max(Lh),visualization:kh(ah),range:Uh([go(300),go(900),go(3600)]),series:Rh(lT).min(1).max(lh)}).strict(),aT=ps({version:go(1),charts:Rh(Uy).max(su)}).strict(),ky={id:"default-sync-pipeline",title:"Sync pipeline",visualization:"line",range:900,series:[ml("sync-header",Nl(0),"occurrence-rate",bn[3]),ml("sync-archive",Nl(3),"occurrence-rate",bn[0]),ml("sync-validate",Nl(5),"occurrence-rate",bn[1]),ml("sync-confirm",Nl(6),"occurrence-rate",bn[2])]},iT={id:"default-chain-progress",title:"Chain progress",visualization:"step",range:900,series:[ml("progress-top",zo,"payload-latest",bn[0]),ml("progress-organized",Nl(13),"payload-latest",bn[2]),ml("progress-confirmed",Nl(6),"payload-latest",bn[1])]},sT={id:"default-log-volume",title:"Log volume",visualization:"bar",range:900,series:[ml("logs-news",xi(1),"occurrence-rate",bn[2]),ml("logs-session",xi(2),"occurrence-rate",bn[3]),ml("logs-protocol",xi(3),"occurrence-rate",bn[1]),ml("logs-remote",xi(5),"occurrence-rate",bn[7]),ml("logs-fault",xi(6),"occurrence-rate",bn[4]),ml("logs-quitting",xi(7),"occurrence-rate",bn[0])]},Hh=[{id:"sync-pipeline",label:"Sync pipeline",description:"Header and block lifecycle throughput.",chart:ky},{id:"chain-progress",label:"Chain progress",description:"Canonical, organized, and confirmed heights.",chart:iT},{id:"log-volume",label:"Log volume",description:"Message rates grouped by log level.",chart:sT}],Zy="libbitcoinAdminDashboardCharts";let J0=0;function ml(n,l,s,u){return{id:n,signalId:l,measure:s,color:u}}function Eo(n){return J0+=1,`${n}-${Date.now().toString(36)}-${String(J0)}`}function Bh(n,l=!1){return{...n,id:l?Eo("chart"):n.id,series:n.series.map(s=>({...s,id:l?Eo("series"):s.id}))}}function vo(){return Hh.map(n=>Bh(n.chart))}function uT(n){const l=Hh.find(s=>s.id===n);return Bh(l?.chart??ky,!0)}function Ly(){return{id:Eo("chart"),title:"Custom chart",visualization:"line",range:900,series:[{id:Eo("series"),signalId:Nl(3),measure:"occurrence-rate",color:bn[0]}]}}function rT(n){const l=" copy",s=`${n.title.slice(0,Lh-l.length).trimEnd()}${l}`;return{...Bh(n,!0),title:s}}function ih(n){const l=new Set(n.series.map(s=>Ei(Za(s.signalId),s.measure).unit));return l.size===1?[...l][0]??null:null}function Hy(n){const l=Uy.safeParse(n);if(!l.success)return l.error.issues[0]?.message??"Invalid chart configuration";for(const s of n.series){const u=Za(s.signalId);if(!kE(u,s.)DELIM" +R"DELIM(measure))return`${Cy[s.measure].label} is not valid for ${u.label}.`;const c=Ei(u,s.measure);if(!c.chartTypes.includes(n.visualization))return`${c.label} cannot be displayed as a ${n.visualization} chart.`}return ih(n)===null?"All series on a chart must use compatible units.":null}function By(n){const l=aT.safeParse(n);return!l.success||new Set(l.data.charts.map(s=>s.id)).size!==l.data.charts.length||l.data.charts.some(s=>new Set(s.series.map(u=>u.id)).size!==s.series.length)?null:l.data.charts.every(s=>Hy(s)===null)?l.data.charts:null}function qy(){try{return globalThis.window?.localStorage??null}catch{return null}}function cT(n=qy()){try{const l=n?.getItem(Zy);return l?By(JSON.parse(l))??vo():vo()}catch{return vo()}}function oT(n,l=qy()){try{const s={version:1,charts:n};if(!By(s))return;l?.setItem(Zy,JSON.stringify(s))}catch{}}function qh(n,l){return n.signals[l]}function F0(n,l,s,u){let c=u==="count"?n.priorSignalCounts[l]??0:n.priorSignalSums[l]??0;for(const d of n.buckets){if(d.time>=s)break;const f=qh(d,l);c+=u==="count"?f?.count??0:f?.sum??0}return c}function fT(n,l,s){let u=n.priorSignalLatest[l]??null;for(const c of n.buckets){if(c.time>=s)break;const d=qh(c,l);d?.last!==null&&d?.last!==void 0&&d.lastAt!==null&&(u={value:d.last,time:d.lastAt})}return u}function dT(n,l){const s=l<=n.sessionStartedAt?Math.floor(n.sessionStartedAt/1e3)*1e3:Math.ceil(l/1e3)*1e3,u=Math.floor(n.now/1e3)*1e3,c=new Map(n.buckets.map(f=>[f.time,f])),d=[];for(let f=s;f<=u;f+=1e3)d.push(c.get(f)??{time:f,signals:{}});return d}function hT(n,l,s){const u=Math.max(n.time,s),c=Math.min(l,n.time+1e3);return Math.max(0,(c-u)/1e3)}function mT(n,l,s,u){const c=Za(u.signalId);let d=u.measure==="cumulative-occurrences"?F0(n,u.signalId,s,"count"):u.measure==="payload-cumulative"?F0(n,u.signalId,s,"sum"):0,f=fT(n,u.signalId,s);return l.map(m=>{const g=qh(m,u.signalId);switch(u.measure){case"occurrence-count":return g?.count??0;case"occurrence-rate":{const v=hT(m,n.now,n.sessionStartedAt);return v>0?(g?.count??0)/v:0}case"cumulative-occurrences":return d+=g?.count??0,d;case"payload-sum":return g&&g.samples>0?g.sum:null;case"payload-cumulative":return d+=g?.sum??0,d;case"payload-average":return g&&g.samples>0?g.sum/g.samples:null;case"payload-minimum":return g?.minimum??null;case"payload-maximum":return g?.maximum??null;case"payload-latest":return g?.last!==null&&g?.last!==void 0&&g.lastAt!==null?(f={value:g.last,time:g.lastAt},g.last):c.payloadKind==="height"?f?.value??null:null;case"payload-change-rate":{if(g?.last===null||g?.last===void 0||g.lastAt===null)return null;const v=f??(g.first!==null&&g.firstAt!==null?{value:g.first,time:g.firstAt}:null);if(f={value:g.last,time:g.lastAt},!v)return null;const _=(g.lastAt-v.time)/1e3;return _>0?(g.last-v.value)/_:null}}})}function pT(n,l){const s=n.now-l.range*1e3,u=dT(n,s),c=u[0]?.time??Math.floor(n.now/1e3)*1e3,d=l.series[0],f=Ei(Za(d.signalId),d.measure).unit,m=l.series.filter(g=>(n.signalTotals[g.signalId]??0)===0).map(g=>g.label??Za(g.signalId).label);return{data:[u.map(g=>g.time/1e3),...l.series.map(g=>mT(n,u,c,g))],unit:f,hasObservedData:m.length({...l}))}}function _T(){const n=new Map;for(const l of Zh){const s=n.get(l.category)??[];s.push(l),n.set(l.category,s)}return[...n]}const xT=_T();function zT({chart:n,mode:l,onCancel:s,onSave:u}){const[c,d]=ge.useState(()=>ST(n)),f=Hy(c),m=ih(c);ge.useEffect(()=>{function E(j){j.key==="Escape"&&s()}return globalThis.addEventListener("keydown",E),()=>{globalThis.removeEventListener("keydown",E)}},[s]);const g=ge.useMemo(()=>new Set(ah.filter(E=>c.series.every(j=>Ei(Za(j.signalId),j.measure).chartTypes.includes(E)))),[c.series]);function v(E,j){d(H=>({...H,series:H.series.map((I,W)=>W===E?j:I)}))}function _(E,j){const H=c.series[E],I=Za(j);v(E,{...H,signalId:j,measure:I.defaultMeasure})}function x(){if(c.series.length>=lh)return;const E=ih(c),j=Zh.find(W=>W.allowedMeasures.some(X=>E===null||Ei(W,X).unit===E));if(!j)return;const H=j.allowedMeasures.find(W=>E===null||Ei(j,W).unit===E)??j.defaultMeasure,I={id:`series-${Date.now().toString(36)}-${String(c.series.length+1)}`,signalId:j.id,measure:H,color:bn[c.series.length%bn.length]??bn[0]};d(W=>({...W,series:[...W.series,I]}))}function w(E){E.preventDefault(),!f&&u({...c,title:c.title.trim()})}return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/75 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:E=>{E.target===E.currentTarget&&s()},children:S.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"chart-editor-title",className:"border-accent/30 bg-surface max-h-[92vh] w-full max-w-4xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/60",children:[S.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Dashboard builder"}),S.jsx("h2",{id:"chart-editor-title",className:"mt-1 text-xl font-semibold",children:l==="add"?"Add chart":"Edit chart"})]}),S.jsx("button",{type:"button",onClick:s,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close chart editor",children:"×"})]}),l==="add"&&S.jsxs("div",{className:"border-accent/15 border-b p-5",children:[S.jsx("p",{className:"text-textMuted mb-3 text-xs font-medium tracking-wide uppercase",children:"Start from a template"}),S.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-5",children:[Hh.map(E=>S.jsxs("button",{type:"button",onClick:()=>{d(uT(E.id))},className:"border-accent/20 bg-background/50 hover:border-accent/60 rounded-lg border p-3 text-left",children:[S.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:E.label}),S.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:E.description})]},E.id)),S.jsxs("button",{type:"button",onClick:()=>{d(Ly())},className:"border-accent/20 bg-background/50 hover:border-accent/60 rounded-lg border p-3 text-left",children:[S.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:"Custom"}),S.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:"Begin with one editable series."})]})]})]}),S.jsxs("form",{onSubmit:w,className:"space-y-6 p-5",children:[S.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_11rem_11rem]",children:[S.jsxs("label",{className:"space-y-2",children:[S.jsx("span",{className:"text-sm font-medium",children:"Chart title"}),S.jsx("input",{value:c.title,maxLength:Lh,onChange:E=>{d(j=>({...j,title:E.target.value}))},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0"})]}),S.jsxs("label",{className:"space-y-2",children:[S.jsx("span",{className:"text-sm font-medium",children:"Chart type"}),S.jsx("select",{value:c.visualization,onChange:E=>{d(j=>({...j,visualization:E.target.value}))},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0",children:ah.map(E=>S.jsx("option",{value:E,disabled:!g.has(E),children:bT[E]},E))})]}),S.jsxs("label",{className:"space-y-2",children:[S.jsx("span",{className:"text-sm font-medium",children:"Time range"}),S.jsx("select",{value:c.)DELIM" +R"DELIM(range,onChange:E=>{d(j=>({...j,range:Number(E.target.value)}))},className:"border-accent/25 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 text-sm focus:ring-0",children:tT.map(E=>S.jsx("option",{value:E,children:yT[E]},E))})]})]}),S.jsxs("section",{className:"space-y-3",children:[S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[S.jsxs("div",{children:[S.jsx("h3",{className:"font-semibold",children:"Series"}),S.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:["One chart uses one axis unit",m===null?".":`: ${Gy(m)}.`]})]}),S.jsx("button",{type:"button",onClick:x,disabled:c.series.length>=lh,className:"border-accent/35 text-accent hover:bg-accent/10 disabled:text-textMuted rounded-lg border px-3 py-2 text-xs font-medium uppercase disabled:cursor-not-allowed disabled:opacity-50",children:"Add series"})]}),S.jsx("div",{className:"space-y-3",children:c.series.map((E,j)=>{const H=Za(E.signalId),I=Ei(H,E.measure);return S.jsxs("article",{className:"border-accent/15 bg-background/35 grid gap-3 rounded-xl border p-4 lg:grid-cols-[minmax(12rem,1.2fr)_minmax(11rem,1fr)_minmax(9rem,0.8fr)_3.5rem_auto]",children:[S.jsxs("label",{className:"space-y-1.5",children:[S.jsxs("span",{className:"text-textMuted text-xs",children:["Signal ",String(j+1)]}),S.jsx("select",{"aria-label":`Signal ${String(j+1)}`,value:E.signalId,onChange:W=>{_(j,W.target.value)},className:"border-accent/25 bg-surface text-textPrimary focus:border-accent w-full rounded-lg border px-2 py-2 text-sm focus:ring-0",children:xT.map(([W,X])=>S.jsx("optgroup",{label:W,children:X.map(Q=>S.jsx("option",{value:Q.id,children:Q.label},Q.id))},W))})]}),S.jsxs("label",{className:"space-y-1.5",children:[S.jsx("span",{className:"text-textMuted text-xs",children:"Measurement"}),S.jsx("select",{"aria-label":`Measurement ${String(j+1)}`,value:E.measure,onChange:W=>{v(j,{...E,measure:W.target.value})},className:"border-accent/25 bg-surface text-textPrimary focus:border-accent w-full rounded-lg border px-2 py-2 text-sm focus:ring-0",title:I.description,children:H.allowedMeasures.map(W=>S.jsx("option",{value:W,children:Ei(H,W).label},W))})]}),S.jsxs("label",{className:"space-y-1.5",children:[S.jsx("span",{className:"text-textMuted text-xs",children:"Display label"}),S.jsx("input",{"aria-label":`Display label ${String(j+1)}`,value:E.label??"",onChange:W=>{v(j,{...E,label:W.target.value||void 0})},placeholder:H.label,className:"border-accent/25 bg-surface text-textPrimary placeholder:text-textMuted/50 focus:border-accent w-full rounded-lg border px-2 py-2 text-sm focus:ring-0"})]}),S.jsxs("label",{className:"space-y-1.5",children:[S.jsx("span",{className:"text-textMuted text-xs",children:"Color"}),S.jsx("input",{"aria-label":`Series color ${String(j+1)}`,type:"color",value:E.color,onChange:W=>{v(j,{...E,color:W.target.value})},className:"border-accent/25 bg-surface h-10 w-full rounded-lg border p-1"})]}),S.jsx("button",{type:"button",onClick:()=>{d(W=>({...W,series:W.series.filter((X,Q)=>Q!==j)}))},disabled:c.series.length===1,"aria-label":`Remove series ${String(j+1)}`,className:"text-textMuted self-end rounded-lg px-3 py-2 text-sm hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-30",children:"Remove"})]},E.id)})})]}),f&&S.jsx("p",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-200",children:f}),S.jsxs("div",{className:"flex justify-end gap-2 border-t border-white/5 pt-4",children:[S.jsx("button",{type:"button",onClick:s,className:"text-textMuted hover:text-textPrimary rounded-lg px-4 py-2 text-sm",children:"Cancel"}),S.jsx("button",{type:"submit",disabled:f!==null,className:"bg-accent text-background hover:bg-accent/90 rounded-lg px-4 py-2 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-40",children:l==="add"?"Add chart":"Save changes"})]})]})]})})}const ET=!0,tn="u-",TT="uplot",wT=tn+"hz",AT=tn+"vt",MT=tn+"title",OT=tn+"wrap",NT=tn+"under",jT=tn+"over",DT=tn+"axis",ss=tn+"off",CT=tn+"select",RT=tn+"cursor-x",UT=tn+"cursor-y",kT=tn+"cursor-pt",ZT=tn+"legend",LT=tn+"live",HT=tn+"inline",BT=tn+"series",qT=tn+"marker",W0=tn+"label",GT=tn+"value",wr="width",Ar="height",zr="top",I0="bottom",au="left",Kd="right",Gh="#000",P0=Gh+"0",Xd="mousemove",ev="mousedown",Jd="mouseup",tv="mouseenter",nv="mouseleave",lv="dblclick",YT="resize",$T="scroll",av="change",To="dppxchange",Yh="--",Su=typeof window<"u",sh=Su?document:null,fu=Su?window:null,QT=Su?navigator:null;let Ie,fo;function uh(){let n=devicePixelRatio;Ie!=n&&(Ie=n,fo&&ch(av,fo,uh),fo=matchMedia(`(min-resolution: ${Ie-.001}dppx) and (max-resolution: ${Ie+.001}dppx)`),os(av,fo,uh),fu.dispatchEvent(new CustomEvent(To)))}function fl(n,l){if(l!=null){let s=n.classList;!s.contains(l)&&s.add(l)}}function rh(n,l){let s=n.classList;s.contains(l)&&s.remove(l)}function zt(n,l,s){n.style[l]=s+"px"}function Yl(n,l,s,u){let c=sh.createElement(n);return l!=null&&fl(c,l),s?.insertBefore(c,u),c}function Ml(n,l){return Yl("div",n,l)}const iv=new WeakMap;function ua(n,l,s,u,c){let d="translate("+l+"px,"+s+"px)",f=iv.get(n);d!=f&&(n.style.transform=d,iv.set(n,d),l<0||s<0||l>u||s>c?fl(n,ss):rh(n,ss))}const sv=new WeakMap;function uv(n,l,s){let u=l+s,c=sv.get(n);u!=c&&(sv.set(n,u),n.style.background=l,n.style.borderColor=s)}const rv=new WeakMap;function cv(n,l,s,u){let c=l+""+s,d=rv.get(n);c!=d&&(rv.set(n,c),n.style.height=s+"px",n.style.width=l+"px",n.style.marginLeft=u?-l/2+"px":0,n.style.marginTop=u?-s/2+"px":0)}const $h={passive:!0},VT={...$h,capture:!0};function os(n,l,s,u){l.addEventListener(n,s,u?VT:$h)}function ch(n,l,s,u){l.removeEventListener(n,s,$h)}Su&&uh();function $l(n,l,s,u){let c;s=s||0,u=u||l.length-1;let d=u<=2147483647;for(;u-s>1;)c=d?s+u>>1:pl((s+u)/2),l[c]{let d=-1,f=-1;for(let m=u;m<=c;m++)if(n(s[m])){d=m;break}for(let m=c;m>=u;m--)if(n(s[m])){f=m;break}return[d,f]}}const $y=n=>n!=null,Qy=n=>n!=null&&n>0,Co=Yy($y),KT=Yy(Qy);function XT(n,l,s,u=0,c=!1){let d=c?KT:Co,f=c?Qy:$y;[l,s]=d(n,l,s);let m=n[l],g=n[l];if(l>-1)if(u==1)m=n[l],g=n[s];else if(u==-1)m=n[s],g=n[l];else for(let v=l;v<=s;v++){let _=n[v];f(_)&&(_g&&(g=_))}return[m??gt,g??-gt]}function Ro(n,l,s,u){let c=dv(n),d=dv(l);n==l&&(c==-1?(n*=s,l/=s):(n/=s,l*=s));let f=s==10?La:Vy,m=c==1?pl:Ol,g=d==1?Ol:pl,v=m(f(en(n))),_=g(f(en(l))),x=hu(s,v),w=hu(s,_);return s==10&&(v<0&&(x=vt(x,-v)),_<0&&(w=vt(w,-_))),u||s==2?(n=x*c,l=w*d):(n=Fy(n,x),l=Uo(l,w)),[n,l]}function Qh(n,l,s,u){let c=Ro(n,l,s,u);return n==0&&(c[0]=0),l==0&&(c[1]=0),c}const Vh=.1,ov={mode:3,pad:Vh},Nr={pad:0,soft:null,mode:0},JT={min:Nr,max:Nr};function wo(n,l,s,u){return ko(s)?fv(n,l,s):(Nr.pad=s,Nr.soft=u?0:null,Nr.mode=u?3:0,fv(n,l,JT))}function Je(n,l){return n??l}function FT(n,l,s){for(l=Je(l,0),s=Je(s,n.length-1);l<=s;){if(n[l]!=null)return!0;l++}return!1}function fv(n,l,s){let u=s.min,c=s.max,d=Je(u.pad,0),f=Je(c.pad,0),m=Je(u.hard,-gt),g=Je(c.hard,gt),v=Je(u.soft,gt),_=Je(c.soft,-gt),x=Je(u.mode,0),w=Je(c.mode,0),E=l-n,j=La(E),H=Bn(en(n),en(l)),I=La(H),W=en(I-j);(E<1e-24||W>10)&&(E=0,(n==0||l==0)&&(E=1e-24,x==2&&v!=gt&&(d=0),w==2&&_!=-gt&&(f=0)));let X=E||H||1e3,Q=La(X),q=hu(10,pl(Q)),ae=X*(E==0?n==0?.1:1:d),le=vt(Fy(n-ae,q/10),24),ee=n>=v&&(x==1||x==3&&le<=v||x==2&&le>=v)?v:gt,ue=Bn(m,le=ee?ee:Ql(ee,le)),Me=X*(E==0?l==0?.1:1:f),ze=vt(Uo(l+Me,q/10),24),te=l<=_&&(w==1||w==3&&ze>=_||w==2&&ze<=_)?_:-gt,be=Ql(g,ze>te&&l<=te?te:Bn(te,ze));return ue==be&&ue==0&&(be=100),[ue,be]}const WT=new Intl.NumberFormat(Su?QT.language:"en-US"),Kh=n=>WT.format(n),gl=Math,yo=gl.PI,en=gl.abs,pl=gl.floor,Pt=gl.round,Ol=gl.ceil,Ql=gl.min,Bn=gl.max,hu=gl.pow,dv=gl.sign,La=gl.log10,Vy=gl.log2,IT=(n,l=1)=>gl.sinh(n)*l,Fd=(n,l=1)=>gl.asinh(n/l),gt=1/0;function hv(n){return(La((n^n>>31)-(n>>31))|0)+1}function oh(n,l,s){return Ql(Bn(n,l),s)}function Ky(n){return typeof n=="function"}function Ge(n){return Ky(n)?n:()=>n}const PT)DELIM" +R"DELIM(=()=>{},Xy=n=>n,Jy=(n,l)=>l,ew=n=>null,mv=n=>!0,pv=(n,l)=>n==l,tw=/\.\d*?(?=9{6,}|0{6,})/gm,hs=n=>{if(Iy(n)||Ai.has(n))return n;const l=`${n}`,s=l.match(tw);if(s==null)return n;let u=s[0].length-1;if(l.indexOf("e-")!=-1){let[c,d]=l.split("e");return+`${hs(c)}e${d}`}return vt(n,u)};function as(n,l){return hs(vt(hs(n/l))*l)}function Uo(n,l){return hs(Ol(hs(n/l))*l)}function Fy(n,l){return hs(pl(hs(n/l))*l)}function vt(n,l=0){if(Iy(n))return n;let s=10**l,u=n*s*(1+Number.EPSILON);return Pt(u)/s}const Ai=new Map;function Wy(n){return((""+n).split(".")[1]||"").length}function Ur(n,l,s,u){let c=[],d=u.map(Wy);for(let f=l;f=0?0:m)+(f>=d[v]?0:d[v]),w=n==10?_:vt(_,x);c.push(w),Ai.set(w,x)}}return c}const jr={},Xh=[],mu=[null,null],zi=Array.isArray,Iy=Number.isInteger,nw=n=>n===void 0;function gv(n){return typeof n=="string"}function ko(n){let l=!1;if(n!=null){let s=n.constructor;l=s==null||s==Object}return l}function lw(n){return n!=null&&typeof n=="object"}const aw=Object.getPrototypeOf(Uint8Array),Py="__proto__";function pu(n,l=ko){let s;if(zi(n)){let u=n.find(c=>c!=null);if(zi(u)||l(u)){s=Array(n.length);for(let c=0;cd){for(c=f-1;c>=0&&n[c]==null;)n[c--]=null;for(c=f+1;cf-m)],c=u[0].length,d=new Map;for(let f=0;f"u"?n=>Promise.resolve().then(n):queueMicrotask;function fw(n){let l=n[0],s=l.length,u=Array(s);for(let d=0;dl[d]-l[f]);let c=[];for(let d=0;d=u&&n[c]==null;)c--;if(c<=u)return!0;const d=Bn(1,pl((c-u+1)/l));for(let f=n[u],m=u+d;m<=c;m+=d){const g=n[m];if(g!=null){if(g<=f)return!1;f=g}}return!0}const eb=["January","February","March","April","May","June","July","August","September","October","November","December"],tb=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function nb(n){return n.slice(0,3)}const mw=tb.map(nb),pw=eb.map(nb),gw={MMMM:eb,MMM:pw,WWWW:tb,WWW:mw};function Er(n){return(n<10?"0":"")+n}function vw(n){return(n<10?"00":n<100?"0":"")+n}const yw={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,l)=>l.MMMM[n.getMonth()],MMM:(n,l)=>l.MMM[n.getMonth()],MM:n=>Er(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>Er(n.getDate()),D:n=>n.getDate(),WWWW:(n,l)=>l.WWWW[n.getDay()],WWW:(n,l)=>l.WWW[n.getDay()],HH:n=>Er(n.getHours()),H:n=>n.getHours(),h:n=>{let l=n.getHours();return l==0?12:l>12?l-12:l},AA:n=>n.getHours()>=12?"PM":"AM",aa:n=>n.getHours()>=12?"pm":"am",a:n=>n.getHours()>=12?"p":"a",mm:n=>Er(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>Er(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>vw(n.getMilliseconds())};function Jh(n,l){l=l||gw;let s=[],u=/\{([a-z]+)\}|[^{]+/gi,c;for(;c=u.exec(n);)s.push(c[0][0]=="{"?yw[c[1]]:c[0]);return d=>{let f="";for(let m=0;mn%1==0,Ao=[1,2,2.5,5],_w=Ur(10,-32,0,Ao),ab=Ur(10,0,32,Ao),xw=ab.filter(lb),is=_w.concat(ab),Fh=` +`,ib="{YYYY}",vv=Fh+ib,sb="{M}/{D}",Mr=Fh+sb,ho=Mr+"/{YY}",ub="{aa}",zw="{h}:{mm}",uu=zw+ub,yv=Fh+uu,bv=":{ss}",tt=null;function rb(n){let l=n*1e3,s=l*60,u=s*60,c=u*24,d=c*30,f=c*365,g=(n==1?Ur(10,0,3,Ao).filter(lb):Ur(10,-3,0,Ao)).concat([l,l*5,l*10,l*15,l*30,s,s*5,s*10,s*15,s*30,u,u*2,u*3,u*4,u*6,u*8,u*12,c,c*2,c*3,c*4,c*5,c*6,c*7,c*8,c*9,c*10,c*15,d,d*2,d*3,d*4,d*6,f,f*2,f*5,f*10,f*25,f*50,f*100]);const v=[[f,ib,tt,tt,tt,tt,tt,tt,1],[c*28,"{MMM}",vv,tt,tt,tt,tt,tt,1],[c,sb,vv,tt,tt,tt,tt,tt,1],[u,"{h}"+ub,ho,tt,Mr,tt,tt,tt,1],[s,uu,ho,tt,Mr,tt,tt,tt,1],[l,bv,ho+" "+uu,tt,Mr+" "+uu,tt,yv,tt,1],[n,bv+".{fff}",ho+" "+uu,tt,Mr+" "+uu,tt,yv,tt,1]];function _(x){return(w,E,j,H,I,W)=>{let X=[],Q=I>=f,q=I>=d&&I=c?c:I,ze=pl(j)-pl(le),te=ue+ze+Uo(le-ue,Me);X.push(te);let be=x(te),ce=be.getHours()+be.getMinutes()/s+be.getSeconds()/u,Ee=I/u,de=w.axes[E]._space,U=W/de;for(;te=vt(te+I,n==1?0:3),!(te>H);)if(Ee>1){let Y=pl(vt(ce+Ee,6))%24,Se=x(te).getHours()-Y;Se>1&&(Se=-1),te-=Se*u,ce=(ce+Ee)%24;let M=X[X.length-1];vt((te-M)/I,3)*U>=.7&&X.push(te)}else X.push(te)}return X}}return[g,v,_]}const[Ew,Tw,ww]=rb(1),[Aw,Mw,Ow]=rb(.001);Ur(2,-53,53,[1]);function Sv(n,l){return n.map(s=>s.map((u,c)=>c==0||c==8||u==null?u:l(c==1||s[8]==0?u:s[1]+u)))}function _v(n,l){return(s,u,c,d,f)=>{let m=l.find(j=>f>=j[0])||l[l.length-1],g,v,_,x,w,E;return u.map(j=>{let H=n(j),I=H.getFullYear(),W=H.getMonth(),X=H.getDate(),Q=H.getHours(),q=H.getMinutes(),ae=H.getSeconds(),le=I!=g&&m[2]||W!=v&&m[3]||X!=_&&m[4]||Q!=x&&m[5]||q!=w&&m[6]||ae!=E&&m[7]||m[1];return g=I,v=W,_=X,x=Q,w=q,E=ae,le(H)})}}function Nw(n,l){let s=Jh(l);return(u,c,d,f,m)=>c.map(g=>s(n(g)))}function Wd(n,l,s){return new Date(n,l,s)}function xv(n,l){return l(n)}const jw="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function zv(n,l){return(s,u,c,d)=>d==null?Yh:l(n(u))}function Dw(n,l){let s=n.series[l];return s.width?s.stroke(n,l):s.points.width?s.points.stroke(n,l):null}function Cw(n,l){return n.series[l].fill(n,l)}const Rw={show:!0,live:!0,isolate:!1,mount:PT,markers:{show:!0,width:2,stroke:Dw,fill:Cw,dash:"solid"},idx:null,idxs:null,values:[]};function Uw(n,l){let s=n.cursor.points,u=Ml(),c=s.size(n,l);zt(u,wr,c),zt(u,Ar,c);let d=c/-2;zt(u,"marginLeft",d),zt(u,"marginTop",d);let f=s.width(n,l,c);return f&&zt(u,"borderWidth",f),u}function kw(n,l){let s=n.series[l].points;return s._fill||s._stroke}function Zw(n,l){let s=n.series[l].points;return s._stroke||s._fill}function Lw(n,l){return n.series[l].points.size}const Id=[0,0];function Hw(n,l,s){return Id[0]=l,Id[1]=s,Id}function mo(n,l,s,u=!0){return c=>{c.button==0&&(!u||c.target==l)&&s(c)}}function Pd(n,l,s,u=!0){return c=>{(!u||c.target==l)&&s(c)}}const Bw={show:!0,x:!0,y:!0,lock:!1,move:Hw,points:{one:!1,show:Uw,size:Lw,width:0,stroke:Zw,fill:kw},bind:{mousedown:mo,mouseup:mo,click:mo,dblclick:mo,mousemove:Pd,mouseleave:Pd,mouseenter:Pd},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(n,l)=>{l.stopPropagation(),l.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(n,l,s,u,c)=>u-c,prox:-1,bias:0},hover:{skip:[v)DELIM" +R"DELIM(oid 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},cb={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Wh=Jt({},cb,{filter:Jy}),ob=Jt({},Wh,{size:10}),fb=Jt({},cb,{show:!1}),Ih='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',db="bold "+Ih,hb=1.5,Ev={show:!0,scale:"x",stroke:Gh,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:db,side:2,grid:Wh,ticks:ob,border:fb,font:Ih,lineGap:hb,rotate:0},qw="Value",Gw="Time",Tv={show:!0,scale:"x",auto:!1,sorted:1,min:gt,max:-gt,idxs:[]};function Yw(n,l,s,u,c){return l.map(d=>d==null?"":Kh(d))}function $w(n,l,s,u,c,d,f){let m=[],g=Ai.get(c)||0;s=f?s:vt(Uo(s,c),g);for(let v=s;v<=u;v=vt(v+c,g))m.push(Object.is(v,-0)?0:v);return m}function fh(n,l,s,u,c,d,f){const m=[],g=n.scales[n.axes[l].scale].log,v=g==10?La:Vy,_=pl(v(s));c=hu(g,_),g==10&&(c=is[$l(c,is)]);let x=s,w=c*g;g==10&&(w=is[$l(w,is)]);do m.push(x),x=x+c,g==10&&!Ai.has(x)&&(x=vt(x,Ai.get(c))),x>=w&&(c=x,w=c*g,g==10&&(w=is[$l(w,is)]));while(x<=u);return m}function Qw(n,l,s,u,c,d,f){let g=n.scales[n.axes[l].scale].asinh,v=u>g?fh(n,l,Bn(g,s),u,c):[g],_=u>=0&&s<=0?[0]:[];return(s<-g?fh(n,l,Bn(g,-u),-s,c):[g]).reverse().map(w=>-w).concat(_,v)}const mb=/./,Vw=/[12357]/,Kw=/[125]/,wv=/1/,dh=(n,l,s,u)=>n.map((c,d)=>l==4&&c==0||d%u==0&&s.test(c.toExponential()[c<0?1:0])?c:null);function Xw(n,l,s,u,c){let d=n.axes[s],f=d.scale,m=n.scales[f],g=n.valToPos,v=d._space,_=g(10,f),x=g(9,f)-_>=v?mb:g(7,f)-_>=v?Vw:g(5,f)-_>=v?Kw:wv;if(x==wv){let w=en(g(1,f)-_);if(wc,Ov={show:!0,auto:!0,sorted:0,gaps:pb,alpha:1,facets:[Jt({},Mv,{scale:"x"}),Jt({},Mv,{scale:"y"})]},Nv={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:pb,alpha:1,points:{show:Iw,filter:null},values:null,min:gt,max:-gt,idxs:[],path:null,clip:null};function Pw(n,l,s,u,c){return s/10}const gb={time:ET,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},e3=Jt({},gb,{time:!1,ori:1}),jv={};function vb(n,l){let s=jv[n];return s||(s={key:n,plots:[],sub(u){s.plots.push(u)},unsub(u){s.plots=s.plots.filter(c=>c!=u)},pub(u,c,d,f,m,g,v){for(let _=0;_{let W=f.pxRound;const X=v.dir*(v.ori==0?1:-1),Q=v.ori==0?_u:xu;let q,ae;X==1?(q=s,ae=u):(q=u,ae=s);let le=W(x(m[q],v,H,E)),ee=W(w(g[q],_,I,j)),ue=W(x(m[ae],v,H,E)),Me=W(w(d==1?_.max:_.min,_,I,j)),ze=new Path2D(c);return Q(ze,ue,Me),Q(ze,le,Me),Q(ze,le,ee),ze})}function Zo(n,l,s,u,c,d){let f=null;if(n.length>0){f=new Path2D;const m=l==0?Bo:tm;let g=s;for(let x=0;xw[0]){let E=w[0]-g;E>0&&m(f,g,u,E,u+d),g=w[1]}}let v=s+c-g,_=10;v>0&&m(f,g,u-_/2,v,u+d+_)}return f}function n3(n,l,s){let u=n[n.length-1];u&&u[0]==l?u[1]=s:n.push([l,s])}function em(n,l,s,u,c,d,f){let m=[],g=n.length;for(let v=c==1?s:u;v>=s&&v<=u;v+=c)if(l[v]===null){let x=v,w=v;if(c==1)for(;++v<=u&&l[v]===null;)w=v;else for(;--v>=s&&l[v]===null;)w=v;let E=d(n[x]),j=w==x?E:d(n[w]),H=x-c;E=f<=0&&H>=0&&H=0&&W>=0&&W=E&&m.push([E,j])}return m}function Dv(n){return n==0?Xy:n==1?Pt:l=>as(l,n)}function yb(n){let l=n==0?Lo:Ho,s=n==0?(c,d,f,m,g,v)=>{c.arcTo(d,f,m,g,v)}:(c,d,f,m,g,v)=>{c.arcTo(f,d,g,m,v)},u=n==0?(c,d,f,m,g)=>{c.rect(d,f,m,g)}:(c,d,f,m,g)=>{c.rect(f,d,g,m)};return(c,d,f,m,g,v=0,_=0)=>{v==0&&_==0?u(c,d,f,m,g):(v=Ql(v,m/2,g/2),_=Ql(_,m/2,g/2),l(c,d+v,f),s(c,d+m,f,d+m,f+g,v),s(c,d+m,f+g,d,f+g,_),s(c,d,f+g,d,f,_),s(c,d,f,d+m,f,v),c.closePath())}}const Lo=(n,l,s)=>{n.moveTo(l,s)},Ho=(n,l,s)=>{n.moveTo(s,l)},_u=(n,l,s)=>{n.lineTo(l,s)},xu=(n,l,s)=>{n.lineTo(s,l)},Bo=yb(0),tm=yb(1),bb=(n,l,s,u,c,d)=>{n.arc(l,s,u,c,d)},Sb=(n,l,s,u,c,d)=>{n.arc(s,l,u,c,d)},_b=(n,l,s,u,c,d,f)=>{n.bezierCurveTo(l,s,u,c,d,f)},xb=(n,l,s,u,c,d,f)=>{n.bezierCurveTo(s,l,c,u,f,d)};function zb(n){return(l,s,u,c,d)=>gs(l,s,(f,m,g,v,_,x,w,E,j,H,I)=>{let{pxRound:W,points:X}=f,Q,q;v.ori==0?(Q=Lo,q=bb):(Q=Ho,q=Sb);const ae=vt(X.width*Ie,3);let le=(X.size-X.width)/2*Ie,ee=vt(le*2,3),ue=new Path2D,Me=new Path2D,{left:ze,top:te,width:be,height:ce}=l.bbox;Bo(Me,ze-ee,te-ee,be+ee*2,ce+ee*2);const Ee=de=>{if(g[de]!=null){let U=W(x(m[de],v,H,E)),Y=W(w(g[de],_,I,j));Q(ue,U+le,Y),q(ue,U,Y,le,0,yo*2)}};if(d)d.forEach(Ee);else for(let de=u;de<=c;de++)Ee(de);return{stroke:ae>0?ue:null,fill:ue,clip:Me,flags:gu|hh}})}function Eb(n){return(l,s,u,c,d,f)=>{u!=c&&(d!=u&&f!=u&&n(l,s,u),d!=c&&f!=c&&n(l,s,c),n(l,s,f))}}const l3=Eb(_u),a3=Eb(xu);function Tb(n){const l=Je(n?.alignGaps,0);return(s,u,c,d)=>gs(s,u,(f,m,g,v,_,x,w,E,j,H,I)=>{[c,d]=Co(g,c,d);let W=f.pxRound,X=ce=>W(x(ce,v,H,E)),Q=ce=>W(w(ce,_,I,j)),q,ae;v.ori==0?(q=_u,ae=l3):(q=xu,ae=a3);const le=v.dir*(v.ori==0?1:-1),ee={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:gu},ue=ee.stroke;let Me=!1;if(d-c>=H*4){let ce=G=>s.posToVal(G,v.key,!0),Ee=null,de=null,U,Y,me,Oe=X(m[le==1?c:d]),Se=X(m[c]),M=X(m[d]),L=ce(le==1?Se+1:M-1);for(let G=le==1?c:d;G>=c&&G<=d;G+=le){let ie=m[G],pe=(le==1?ieL)?Oe:X(ie),ve=g[G];pe==Oe?ve!=null?(Y=ve,Ee==null?(q(ue,pe,Q(Y)),U=Ee=de=Y):Yde&&(de=Y)):ve===null&&(Me=!0):(Ee!=null&&ae(ue,Oe,Q(Ee),Q(de),Q(U),Q(Y)),ve!=null?(Y=ve,q(ue,pe,Q(Y)),Ee=de=U=Y):(Ee=de=null,ve===null&&(Me=!0)),Oe=pe,L=ce(Oe+le))}Ee!=null&&Ee!=de&&me!=Oe&&ae(ue,Oe,Q(Ee),Q(de),Q(U),Q(Y))}else for(let ce=le==1?c:d;ce>=c&&ce<=d;ce+=le){let Ee=g[ce];Ee===null?Me=!0:Ee!=null&&q(ue,X(m[ce]),Q(Ee))}let[te,be]=Ph(s,u);if(f.fill!=null||te!=0){let ce=ee.fill=new Path2D(ue),Ee=f.fillTo(s,u,f.min,f.max,te),de=Q(Ee),U=X(m[c]),Y=X(m[d]);le==-1&&([Y,U]=[U,Y]),q(ce,Y,de),q(ce,U,de)}if(!f.spanGaps){let ce=[];Me&&ce.push(...em(m,g,c,d,le,X,l)),ee.gaps=ce=f.gaps(s,u,c,d,ce),ee.clip=Zo(ce,v.ori,E,j,H,I)}return be!=0&&(ee.band=be==2?[Ha(s,u,c,d,ue,-1),Ha(s,u,c,d,ue,1)]:Ha(s,u,c,d,ue,be)),ee})}function i3(n){const l=Je(n.align,1),s=Je(n.ascDesc,!1),u=Je(n.alignGaps,0),c=Je(n.extend,!1);return(d,f,m,g)=>gs(d,f,(v,_,x,w,E,j,H,I,W,X,Q)=>{[m,g]=Co(x,m,g);let q=v.pxRound,{left:ae,width:le}=d.bbox,ee=Se=>q(j(Se,w,X,I)),ue=Se=>q(H(Se,E,Q,W)),Me=w.ori==0?_u:xu;const ze={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:gu},te=ze.stroke,be=w.dir*(w.ori==0?1:-1);let ce=ue(x[be==1?m:g]),Ee=ee(_[be==1?m:g]),de=Ee,U=Ee;c&&l==-1&&(U=ae,Me(te,U,ce)),Me(te,Ee,ce);for(let Se=be==1?m:g;Se>=m&&Se<=g;Se+=be){let M=x[Se];if(M==null)conti)DELIM" +R"DELIM(nue;let L=ee(_[Se]),G=ue(M);l==1?Me(te,L,ce):Me(te,de,G),Me(te,L,G),ce=G,de=L}let Y=de;c&&l==1&&(Y=ae+le,Me(te,Y,ce));let[me,Oe]=Ph(d,f);if(v.fill!=null||me!=0){let Se=ze.fill=new Path2D(te),M=v.fillTo(d,f,v.min,v.max,me),L=ue(M);Me(Se,Y,L),Me(Se,U,L)}if(!v.spanGaps){let Se=[];Se.push(...em(_,x,m,g,be,ee,u));let M=v.width*Ie/2,L=s||l==1?M:-M,G=s||l==-1?-M:M;Se.forEach(ie=>{ie[0]+=L,ie[1]+=G}),ze.gaps=Se=v.gaps(d,f,m,g,Se),ze.clip=Zo(Se,w.ori,I,W,X,Q)}return Oe!=0&&(ze.band=Oe==2?[Ha(d,f,m,g,te,-1),Ha(d,f,m,g,te,1)]:Ha(d,f,m,g,te,Oe)),ze})}function Cv(n,l,s,u,c,d,f=gt){if(n.length>1){let m=null;for(let g=0,v=1/0;g{}),{fill:x,stroke:w}=v;return(E,j,H,I)=>gs(E,j,(W,X,Q,q,ae,le,ee,ue,Me,ze,te)=>{let be=W.pxRound,ce=s,Ee=u*Ie,de=m*Ie,U=g*Ie,Y,me;q.ori==0?[Y,me]=d(E,j):[me,Y]=d(E,j);const Oe=q.dir*(q.ori==0?1:-1);let Se=q.ori==0?Bo:tm,M=q.ori==0?_:(oe,lt,Nt,Rl,ca,tl,oa)=>{_(oe,lt,Nt,ca,Rl,oa,tl)},L=Je(E.bands,Xh).find(oe=>oe.series[0]==j),G=L!=null?L.dir:0,ie=W.fillTo(E,j,W.min,W.max,G),xe=be(ee(ie,ae,te,Me)),pe,ve,mt,Ye=ze,nt=be(W.width*Ie),Nn=!1,el=null,jn=null,xn=null,Vl=null;x!=null&&(nt==0||w!=null)&&(Nn=!0,el=x.values(E,j,H,I),jn=new Map,new Set(el).forEach(oe=>{oe!=null&&jn.set(oe,new Path2D)}),nt>0&&(xn=w.values(E,j,H,I),Vl=new Map,new Set(xn).forEach(oe=>{oe!=null&&Vl.set(oe,new Path2D)})));let{x0:Kl,size:Ni}=v;if(Kl!=null&&Ni!=null){ce=1,X=Kl.values(E,j,H,I),Kl.unit==2&&(X=X.map(Nt=>E.posToVal(ue+Nt*ze,q.key,!0)));let oe=Ni.values(E,j,H,I);Ni.unit==2?ve=oe[0]*ze:ve=le(oe[0],q,ze,ue)-le(0,q,ze,ue),Ye=Cv(X,Q,le,q,ze,ue,Ye),mt=Ye-ve+Ee}else Ye=Cv(X,Q,le,q,ze,ue,Ye),mt=Ye*f+Ee,ve=Ye-mt;mt<1&&(mt=0),nt>=ve/2&&(nt=0),mt<5&&(be=Xy);let ji=mt>0,Dl=Ye-mt-(ji?nt:0);ve=be(oh(Dl,U,de)),pe=(ce==0?ve/2:ce==Oe?0:ve)-ce*Oe*((ce==0?Ee/2:0)+(ji?nt/2:0));const Ft={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Xl=Nn?null:new Path2D;let Cl=null;if(L!=null)Cl=E.data[L.series[1]];else{let{y0:oe,y1:lt}=v;oe!=null&<!=null&&(Q=lt.values(E,j,H,I),Cl=oe.values(E,j,H,I))}let ra=Y*ve,Te=me*ve;for(let oe=Oe==1?H:I;oe>=H&&oe<=I;oe+=Oe){let lt=Q[oe];if(lt==null)continue;if(Cl!=null){let rt=Cl[oe]??0;if(lt-rt==0)continue;xe=ee(rt,ae,te,Me)}let Nt=q.distr!=2||v!=null?X[oe]:oe,Rl=le(Nt,q,ze,ue),ca=ee(Je(lt,ie),ae,te,Me),tl=be(Rl-pe),oa=be(Bn(ca,xe)),Dn=be(Ql(ca,xe)),nn=oa-Dn;if(lt!=null){let rt=lt<0?Te:ra,Yt=lt<0?ra:Te;Nn?(nt>0&&xn[oe]!=null&&Se(Vl.get(xn[oe]),tl,Dn+pl(nt/2),ve,Bn(0,nn-nt),rt,Yt),el[oe]!=null&&Se(jn.get(el[oe]),tl,Dn+pl(nt/2),ve,Bn(0,nn-nt),rt,Yt)):Se(Xl,tl,Dn+pl(nt/2),ve,Bn(0,nn-nt),rt,Yt),M(E,j,oe,tl-nt/2,Dn,ve+nt,nn)}}return nt>0?Ft.stroke=Nn?Vl:Xl:Nn||(Ft._fill=W.width==0?W._fill:W._stroke??W._fill,Ft.width=0),Ft.fill=Nn?jn:Xl,Ft})}function u3(n,l){const s=Je(l?.alignGaps,0);return(u,c,d,f)=>gs(u,c,(m,g,v,_,x,w,E,j,H,I,W)=>{[d,f]=Co(v,d,f);let X=m.pxRound,Q=Y=>X(w(Y,_,I,j)),q=Y=>X(E(Y,x,W,H)),ae,le,ee;_.ori==0?(ae=Lo,ee=_u,le=_b):(ae=Ho,ee=xu,le=xb);const ue=_.dir*(_.ori==0?1:-1);let Me=Q(g[ue==1?d:f]),ze=Me,te=[],be=[];for(let Y=ue==1?d:f;Y>=d&&Y<=f;Y+=ue)if(v[Y]!=null){let Oe=g[Y],Se=Q(Oe);te.push(ze=Se),be.push(q(v[Y]))}const ce={stroke:n(te,be,ae,ee,le,X),fill:null,clip:null,band:null,gaps:null,flags:gu},Ee=ce.stroke;let[de,U]=Ph(u,c);if(m.fill!=null||de!=0){let Y=ce.fill=new Path2D(Ee),me=m.fillTo(u,c,m.min,m.max,de),Oe=q(me);ee(Y,ze,Oe),ee(Y,Me,Oe)}if(!m.spanGaps){let Y=[];Y.push(...em(g,v,d,f,ue,Q,s)),ce.gaps=Y=m.gaps(u,c,d,f,Y),ce.clip=Zo(Y,_.ori,j,H,I,W)}return U!=0&&(ce.band=U==2?[Ha(u,c,d,f,Ee,-1),Ha(u,c,d,f,Ee,1)]:Ha(u,c,d,f,Ee,U)),ce})}function r3(n){return u3(c3,n)}function c3(n,l,s,u,c,d){const f=n.length;if(f<2)return null;const m=new Path2D;if(s(m,n[0],l[0]),f==2)u(m,n[1],l[1]);else{let g=Array(f),v=Array(f-1),_=Array(f-1),x=Array(f-1);for(let w=0;w0!=v[w]>0?g[w]=0:(g[w]=3*(x[w-1]+x[w])/((2*x[w]+x[w-1])/v[w-1]+(x[w]+2*x[w-1])/v[w]),isFinite(g[w])||(g[w]=0));g[f-1]=v[f-2];for(let w=0;w{cn.pxRatio=Ie}));const o3=Tb(),f3=zb();function Uv(n,l,s,u){return(u?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((d,f)=>ph(d,f,l,s))}function d3(n,l){return n.map((s,u)=>u==0?{}:Jt({},l,s))}function ph(n,l,s,u){return Jt({},l==0?s:u,n)}function wb(n,l,s){return l==null?mu:[l,s]}const h3=wb;function m3(n,l,s){return l==null?mu:wo(l,s,Vh,!0)}function Ab(n,l,s,u){return l==null?mu:Ro(l,s,n.scales[u].log,!1)}const p3=Ab;function Mb(n,l,s,u){return l==null?mu:Qh(l,s,n.scales[u].log,!1)}const g3=Mb;function v3(n,l,s,u,c){let d=Bn(hv(n),hv(l)),f=l-n,m=$l(c/u*f,s);do{let g=s[m],v=u*g/f;if(v>=c&&d+(g<5?Ai.get(g):0)<=17)return[g,v]}while(++m(l=Pt((s=+c)*Ie))+"px"),[n,l,s]}function y3(n){n.show&&[n.font,n.labelFont].forEach(l=>{let s=vt(l[2]*Ie,1);l[0]=l[0].replace(/[0-9.]+px/,s+"px"),l[1]=s})}function cn(n,l,s){const u={mode:Je(n.mode,1)},c=u.mode;function d(p,y,z,T){let O=y.valToPct(p);return T+z*(y.dir==-1?1-O:O)}function f(p,y,z,T){let O=y.valToPct(p);return T+z*(y.dir==-1?O:1-O)}function m(p,y,z,T){return y.ori==0?d(p,y,z,T):f(p,y,z,T)}u.valToPosH=d,u.valToPosV=f;let g=!1;u.status=0;const v=u.root=Ml(TT);if(n.id!=null&&(v.id=n.id),fl(v,n.class),n.title){let p=Ml(MT,v);p.textContent=n.title}const _=Yl("canvas"),x=u.ctx=_.getContext("2d"),w=Ml(OT,v);os("click",w,p=>{p.target===j&&(Pe!=kn||at!=ea)&&Ve.click(u,p)},!0);const E=u.under=Ml(NT,w);w.appendChild(_);const j=u.over=Ml(jT,w);n=pu(n);const H=+Je(n.pxAlign,1),I=Dv(H);(n.plugins||[]).forEach(p=>{p.opts&&(n=p.opts(u,n)||n)});const W=n.ms||.001,X=u.series=c==1?Uv(n.series||[],Tv,Nv,!1):d3(n.series||[null],Ov),Q=u.axes=Uv(n.axes||[],Ev,Av,!0),q=u.scales={},ae=u.bands=n.bands||[];ae.forEach(p=>{p.fill=Ge(p.fill||null),p.dir=Je(p.dir,-1)});const le=c==2?X[1].facets[0].scale:X[0].scale,ee={axes:ju,series:Go},ue=(n.drawOrder||["axes","series"]).map(p=>ee[p]);function Me(p){const y=p.distr==3?z=>La(z>0?z:p.clamp(u,z,p.min,p.max,p.key)):p.distr==4?z=>Fd(z,p.asinh):p.distr==100?z=>p.fwd(z):z=>z;return z=>{let T=y(z),{_min:O,_max:C}=p,V=C-O;return(T-O)/V}}function ze(p){let y=q[p];if(y==null){let z=(n.scales||jr)[p]||jr;if(z.from!=null){ze(z.from);let T=Jt({},q[z.from],z,{key:p});T.valToPct=Me(T),q[p]=T}else{y=q[p]=Jt({},p==le?gb:e3,z),y.key=p;let T=y.time,O=y.range,C=zi(O);if((p!=le||c==2&&!T)&&(C&&(O[0]==null||O[1]==null)&&(O={min:O[0]==null?ov:{mode:1,hard:O[0],soft:O[0]},max:O[1]==null?ov:{mode:1,hard:O[1],soft:O[1]}},C=!1),!C&&ko(O))){let V=O;O=(P,ne,se)=>ne==null?mu:wo(ne,se,V)}y.range=Ge(O||(T?h3:p==le?y.distr==3?p3:y.distr==4?g3:wb:y.distr==3?Ab:y.distr==4?Mb:m3)),y.auto=Ge(C?!1:y.auto),y.clamp=Ge(y.clamp||Pw),y._min=y._max=null,y.valToPct=Me(y)}}}ze("x"),ze("y"),c==1&&X.forEach(p=>{ze(p.scale)}),Q.forEach(p=>{ze(p.scale)});for(let p in n.scales)ze(p);const te=q[le],be=te.distr;let ce,Ee;te.ori==0?(fl(v,wT),ce=d,Ee=f):(fl(v,AT),ce=f,Ee=d);const de={};for(let p in q){let y=q[p];(y.min!=null||y.max!=null)&&(de[p]={min:y.min,max:y.max},y.min=y.max=null)}const U=n.tzDate||(p=>new Date(Pt(p/W))),Y=n.fmtDate||Jh,me=W==1?ww(U):Ow(U),Oe=_v(U,Sv(W==1?Tw:Mw,Y)),Se=zv(U,xv(jw,Y)),M=[],L=u.legend=Jt({},Rw,n.legend),G=u.cursor=Jt({},Bw,{drag:{y:c==2}},n.cursor),ie=L.show,xe=G.show,pe=L.markers;L.idxs=M,pe.width=Ge(pe.width),pe.dash=Ge(pe.dash),pe.stroke=Ge(pe.stroke),pe.fill=Ge(pe.fill);let ve,mt,Ye,nt=[],Nn=[],el,jn=!1,xn={};if(L.live){const p=X[1]?X[1].values:nu)DELIM" +R"DELIM(ll;jn=p!=null,el=jn?p(u,1,0):{_:0};for(let y in el)xn[y]=Yh}if(ie)if(ve=Yl("table",ZT,v),Ye=Yl("tbody",null,ve),L.mount(u,ve),jn){mt=Yl("thead",null,ve,Ye);let p=Yl("tr",null,mt);Yl("th",null,p);for(var Vl in el)Yl("th",W0,p).textContent=Vl}else fl(ve,HT),L.live&&fl(ve,LT);const Kl={show:!0},Ni={show:!1};function ji(p,y){if(y==0&&(jn||!L.live||c==2))return mu;let z=[],T=Yl("tr",BT,Ye,Ye.childNodes[y]);fl(T,p.class),p.show||fl(T,ss);let O=Yl("th",null,T);if(pe.show){let P=Ml(qT,O);if(y>0){let ne=pe.width(u,y);ne&&(P.style.border=ne+"px "+pe.dash(u,y)+" "+pe.stroke(u,y)),P.style.background=pe.fill(u,y)}}let C=Ml(W0,O);p.label instanceof HTMLElement?C.appendChild(p.label):C.textContent=p.label,y>0&&(pe.show||(C.style.color=p.width>0?pe.stroke(u,y):pe.fill(u,y)),Ft("click",O,P=>{if(G._lock)return;nl(P);let ne=X.indexOf(p);if((P.ctrlKey||P.metaKey)!=L.isolate){let se=X.some((re,fe)=>fe>0&&fe!=ne&&re.show);X.forEach((re,fe)=>{fe>0&&Zn(fe,se?fe==ne?Kl:Ni:Kl,!0,Dt.setSeries)})}else Zn(ne,{show:!p.show},!0,Dt.setSeries)},!1),ha&&Ft(tv,O,P=>{G._lock||(nl(P),Zn(X.indexOf(p),Wa,!0,Dt.setSeries))},!1));for(var V in el){let P=Yl("td",GT,T);P.textContent="--",z.push(P)}return[T,z]}const Dl=new Map;function Ft(p,y,z,T=!0){const O=Dl.get(y)||{},C=G.bind[p](u,y,z,T);C&&(os(p,y,O[p]=C),Dl.set(y,O))}function Xl(p,y,z){const T=Dl.get(y)||{};for(let O in T)(p==null||O==p)&&(ch(O,y,T[O]),delete T[O]);p==null&&Dl.delete(y)}let Cl=0,ra=0,Te=0,oe=0,lt=0,Nt=0,Rl=lt,ca=Nt,tl=Te,oa=oe,Dn=0,nn=0,rt=0,Yt=0;u.bbox={};let on=!1,vs=!1,Ba=!1,fa=!1,da=!1,fn=!1;function qa(p,y,z){(z||p!=u.width||y!=u.height)&&Jl(p,y),Qa(!1),Ba=!0,vs=!0,Pl()}function Jl(p,y){u.width=Cl=Te=p,u.height=ra=oe=y,lt=Nt=0,Br(),zu();let z=u.bbox;Dn=z.left=as(lt*Ie,.5),nn=z.top=as(Nt*Ie,.5),rt=z.width=as(Te*Ie,.5),Yt=z.height=as(oe*Ie,.5)}const ys=3;function Di(){let p=!1,y=0;for(;!p;){y++;let z=$r(y),T=Qr(y);p=y==ys||z&&T,p||(Jl(u.width,u.height),vs=!0)}}function qo({width:p,height:y}){qa(p,y)}u.setSize=qo;function Br(){let p=!1,y=!1,z=!1,T=!1;Q.forEach((O,C)=>{if(O.show&&O._show){let{side:V,_size:P}=O,ne=V%2,se=O.label!=null?O.labelSize:0,re=P+se;re>0&&(ne?(Te-=re,V==3?(lt+=re,T=!0):z=!0):(oe-=re,V==0?(Nt+=re,p=!0):y=!0))}}),Gn[0]=p,Gn[1]=z,Gn[2]=y,Gn[3]=T,Te-=kl[1]+kl[3],lt+=kl[3],oe-=kl[2]+kl[0],Nt+=kl[0]}function zu(){let p=lt+Te,y=Nt+oe,z=lt,T=Nt;function O(C,V){switch(C){case 1:return p+=V,p-V;case 2:return y+=V,y-V;case 3:return z-=V,z+V;case 0:return T-=V,T+V}}Q.forEach((C,V)=>{if(C.show&&C._show){let P=C.side;C._pos=O(P,C._size),C.label!=null&&(C._lpos=O(P,C.labelSize))}})}if(G.dataIdx==null){let p=G.hover,y=p.skip=new Set(p.skip??[]);y.add(void 0);let z=p.prox=Ge(p.prox),T=p.bias??=0;G.dataIdx=(O,C,V,P)=>{if(C==0)return V;let ne=V,se=z(O,C,V,P)??gt,re=se>=0&&se0;)y.has(Ce[_e])||(Ue=_e);if(T==0||T==1)for(_e=V;Ne==null&&_e++se&&(ne=null);return ne}}const nl=p=>{G.event=p};G.idxs=M,G._lock=!1;let ln=G.points;ln.show=Ge(ln.show),ln.size=Ge(ln.size),ln.stroke=Ge(ln.stroke),ln.width=Ge(ln.width),ln.fill=Ge(ln.fill);const ll=u.focus=Jt({},n.focus||{alpha:.3},G.focus),ha=ll.prox>=0,ma=ha&&ln.one;let zn=[],Fl=[],pa=[];function Eu(p,y){let z=ln.show(u,y);if(z instanceof HTMLElement)return fl(z,kT),fl(z,p.class),ua(z,-10,-10,Te,oe),j.insertBefore(z,zn[y]),z}function Ul(p,y){if(c==1||y>0){let z=c==1&&q[p.scale].time,T=p.value;p.value=z?gv(T)?zv(U,xv(T,Y)):T||Se:T||Fw,p.label=p.label||(z?Gw:qw)}if(ma||y>0){p.width=p.width==null?1:p.width,p.paths=p.paths||o3||ew,p.fillTo=Ge(p.fillTo||t3),p.pxAlign=+Je(p.pxAlign,H),p.pxRound=Dv(p.pxAlign),p.stroke=Ge(p.stroke||null),p.fill=Ge(p.fill||null),p._stroke=p._fill=p._paths=p._focus=null;let z=Ww(Bn(1,p.width),1),T=p.points=Jt({},{size:z,width:Bn(1,z*.2),stroke:p.stroke,space:z*2,paths:f3,_stroke:null,_fill:null},p.points);T.show=Ge(T.show),T.filter=Ge(T.filter),T.fill=Ge(T.fill),T.stroke=Ge(T.stroke),T.paths=Ge(T.paths),T.pxAlign=p.pxAlign}if(ie){let z=ji(p,y);nt.splice(y,0,z[0]),Nn.splice(y,0,z[1]),L.values.push(null)}if(xe){M.splice(y,0,null);let z=null;ma?y==0&&(z=Eu(p,y)):y>0&&(z=Eu(p,y)),zn.splice(y,0,z),Fl.splice(y,0,0),pa.splice(y,0,0)}Ht("addSeries",y)}function Wt(p,y){y=y??X.length,p=c==1?ph(p,y,Tv,Nv):ph(p,y,{},Ov),X.splice(y,0,p),Ul(X[y],y)}u.addSeries=Wt;function En(p){if(X.splice(p,1),ie){L.values.splice(p,1),Nn.splice(p,1);let y=nt.splice(p,1)[0];Xl(null,y.firstChild),y.remove()}xe&&(M.splice(p,1),zn.splice(p,1)[0].remove(),Fl.splice(p,1),pa.splice(p,1)),Ht("delSeries",p)}u.delSeries=En;const Gn=[!1,!1,!1,!1];function Tu(p,y){if(p._show=p.show,p.show){let z=p.side%2,T=q[p.scale];T==null&&(p.scale=z?X[1].scale:le,T=q[p.scale]);let O=T.time;p.size=Ge(p.size),p.space=Ge(p.space),p.rotate=Ge(p.rotate),zi(p.incrs)&&p.incrs.forEach(V=>{!Ai.has(V)&&Ai.set(V,Wy(V))}),p.incrs=Ge(p.incrs||(T.distr==2?xw:O?W==1?Ew:Aw:is)),p.splits=Ge(p.splits||(O&&T.distr==1?me:T.distr==3?fh:T.distr==4?Qw:$w)),p.stroke=Ge(p.stroke),p.grid.stroke=Ge(p.grid.stroke),p.ticks.stroke=Ge(p.ticks.stroke),p.border.stroke=Ge(p.border.stroke);let C=p.values;p.values=zi(C)&&!zi(C[0])?Ge(C):O?zi(C)?_v(U,Sv(C,Y)):gv(C)?Nw(U,C):C||Oe:C||Yw,p.filter=Ge(p.filter||(T.distr>=3&&T.log==10?Xw:T.distr==3&&T.log==2?Jw:Jy)),p.font=kv(p.font),p.labelFont=kv(p.labelFont),p._size=p.size(u,null,y,0),p._space=p._rotate=p._incrs=p._found=p._splits=p._values=null,p._size>0&&(Gn[y]=!0,p._el=Ml(DT,w))}}function Ci(p,y,z,T){let[O,C,V,P]=z,ne=y%2,se=0;return ne==0&&(P||C)&&(se=y==0&&!O||y==2&&!V?Pt(Ev.size/3):0),ne==1&&(O||V)&&(se=y==1&&!C||y==3&&!P?Pt(Av.size/2):0),se}const qr=u.padding=(n.padding||[Ci,Ci,Ci,Ci]).map(p=>Ge(Je(p,Ci))),kl=u._padding=qr.map((p,y)=>p(u,y,Gn,0));let At,jt=null,bt=null;const Zl=c==1?X[0].idxs:null;let dn=null,vl=!1;function Lt(p,y){if(l=p??[],u.data=u._data=l,c==2){At=0;for(let z=1;z=0,fn=!0,Pl()}}u.setData=Lt;function bs(){vl=!0;let p,y;c==1&&(At>0?(jt=Zl[0]=0,bt=Zl[1]=At-1,p=l[0][jt],y=l[0][bt],be==2?(p=jt,y=bt):p==y&&(be==3?[p,y]=Ro(p,p,te.log,!1):be==4?[p,y]=Qh(p,p,te.log,!1):te.time?y=p+Pt(86400/W):[p,y]=wo(p,y,Vh,!0))):(jt=Zl[0]=p=null,bt=Zl[1]=y=null)),$n(le,p,y)}let Ri,Yn,Wl,wu,Ss,_s,Au,Ga,Ya,Et;function Cn(p,y,z,T,O,C){p??=P0,z??=Xh,T??="butt",O??=P0,C??="round",p!=Ri&&(x.strokeStyle=Ri=p),O!=Yn&&(x.fillStyle=Yn=O),y!=Wl&&(x.lineWidth=Wl=y),C!=Ss&&(x.lineJoin=Ss=C),T!=_s&&(x.lineCap=_s=T),z!=wu&&x.setLineDash(wu=z)}function Mu(p,y,z,T){y!=Yn&&(x.fillStyle=Yn=y),p!=Au&&(x.font=Au=p),z!=Ga&&(x.textAlign=Ga=z),T!=Ya&&(x.textBaseline=Ya=T)}function Ou(p,y,z,T,O=0){if(T.length>0&&p.auto(u,vl)&&(y==null||y.min==null)){let C=Je(jt,0),V=Je(bt,T.length-1),P=z.min==null?XT(T,C,V,O,p.distr==3):[z.min,z.max];p.min=Ql(p.min,z.min=P[0]),p.max=Bn(p.max,z.max=P[1])}}const xs={min:null,max:null};function Gr(){for(let T in q){let O=q[T];de[T]==null&&(O.min==null||de[le]!=null&&O.auto(u,vl))&&(de[T]=xs)}for(let T in q){let O=q[T];de[T]==null&&O.from!=null&&de[O.from]!=null&&(de[T]=xs)}de[le]!=null&&Qa(!0);let p={};for(let T in de){let O=de[T];if(O!=null){let C=p[T]=pu(q[T],lw);if(O.min!=null)Jt(C,O);else if(T!=le||c==2)if(At==0&&C.from==null){let V=C.range(u,null,null,T);C.min=V[0],C.max=V[1]}else C.min=gt,C.max=-gt}}if(At>0){X.forEach((T,O)=>{if(c==1){let C=T.scale,V=de[C];if(V==null)return;let P=p[C];if(O==0){let ne=P.range(u,P.min,P.max,C);P.min=ne[0],P.max=ne[1],jt=$l(P.min,l[0]),bt=$l(P.max,l[0]),bt-)DELIM" +R"DELIM(jt>1&&(l[0][jt]P.max&&bt--),T.min=dn[jt],T.max=dn[bt]}else T.show&&T.auto&&Ou(P,V,T,l[O],T.sorted);T.idxs[0]=jt,T.idxs[1]=bt}else if(O>0&&T.show&&T.auto){let[C,V]=T.facets,P=C.scale,ne=V.scale,[se,re]=l[O],fe=p[P],De=p[ne];fe!=null&&Ou(fe,de[P],C,se,C.sorted),De!=null&&Ou(De,de[ne],V,re,V.sorted),T.min=V.min,T.max=V.max}});for(let T in p){let O=p[T],C=de[T];if(O.from==null&&(C==null||C.min==null)){let V=O.range(u,O.min==gt?null:O.min,O.max==-gt?null:O.max,T);O.min=V[0],O.max=V[1]}}}for(let T in p){let O=p[T];if(O.from!=null){let C=p[O.from];if(C.min==null)O.min=O.max=null;else{let V=O.range(u,C.min,C.max,T);O.min=V[0],O.max=V[1]}}}let y={},z=!1;for(let T in p){let O=p[T],C=q[T];if(C.min!=O.min||C.max!=O.max){C.min=O.min,C.max=O.max;let V=C.distr;C._min=V==3?La(C.min):V==4?Fd(C.min,C.asinh):V==100?C.fwd(C.min):C.min,C._max=V==3?La(C.max):V==4?Fd(C.max,C.asinh):V==100?C.fwd(C.max):C.max,y[T]=z=!0}}if(z){X.forEach((T,O)=>{c==2?O>0&&y.y&&(T._paths=null):y[T.scale]&&(T._paths=null)});for(let T in y)Ba=!0,Ht("setScale",T);xe&&G.left>=0&&(fa=fn=!0)}for(let T in de)de[T]=null}function zs(p){let y=oh(jt-1,0,At-1),z=oh(bt+1,0,At-1);for(;p[y]==null&&y>0;)y--;for(;p[z]==null&&z0){let p=X.some(y=>y._focus)&&Et!=ll.alpha;p&&(x.globalAlpha=Et=ll.alpha),X.forEach((y,z)=>{if(z>0&&y.show&&(Rn(z,!1),Rn(z,!0),y._paths==null)){let T=Et;Et!=y.alpha&&(x.globalAlpha=Et=y.alpha);let O=c==2?[0,l[z][0].length-1]:zs(l[z]);y._paths=y.paths(u,z,O[0],O[1]),Et!=T&&(x.globalAlpha=Et=T)}}),X.forEach((y,z)=>{if(z>0&&y.show){let T=Et;Et!=y.alpha&&(x.globalAlpha=Et=y.alpha),y._paths!=null&&Es(z,!1);{let O=y._paths!=null?y._paths.gaps:null,C=y.points.show(u,z,jt,bt,O),V=y.points.filter(u,z,C,O);(C||V)&&(y.points._paths=y.points.paths(u,z,jt,bt,V),Es(z,!0))}Et!=T&&(x.globalAlpha=Et=T),Ht("drawSeries",z)}}),p&&(x.globalAlpha=Et=1)}}function Rn(p,y){let z=y?X[p].points:X[p];z._stroke=z.stroke(u,p),z._fill=z.fill(u,p)}function Es(p,y){let z=y?X[p].points:X[p],{stroke:T,fill:O,clip:C,flags:V,_stroke:P=z._stroke,_fill:ne=z._fill,_width:se=z.width}=z._paths;se=vt(se*Ie,3);let re=null,fe=se%2/2;y&&ne==null&&(ne=se>0?"#fff":P);let De=z.pxAlign==1&&fe>0;if(De&&x.translate(fe,fe),!y){let Qe=Dn-se/2,Ce=nn-se/2,Ue=rt+se,Ne=Yt+se;re=new Path2D,re.rect(Qe,Ce,Ue,Ne)}y?Il(P,se,z.dash,z.cap,ne,T,O,V,C):Yr(p,P,se,z.dash,z.cap,ne,T,O,V,re,C),De&&x.translate(-fe,-fe)}function Yr(p,y,z,T,O,C,V,P,ne,se,re){let fe=!1;ne!=0&&ae.forEach((De,Qe)=>{if(De.series[0]==p){let Ce=X[De.series[1]],Ue=l[De.series[1]],Ne=(Ce._paths||jr).band;zi(Ne)&&(Ne=De.dir==1?Ne[0]:Ne[1]);let _e,ct=null;Ce.show&&Ne&&FT(Ue,jt,bt)?(ct=De.fill(u,Qe)||C,_e=Ce._paths.clip):Ne=null,Il(y,z,T,O,ct,V,P,ne,se,re,_e,Ne),fe=!0}}),fe||Il(y,z,T,O,C,V,P,ne,se,re)}const Ts=gu|hh;function Il(p,y,z,T,O,C,V,P,ne,se,re,fe){Cn(p,y,z,T,O),(ne||se||fe)&&(x.save(),ne&&x.clip(ne),se&&x.clip(se)),fe?(P&Ts)==Ts?(x.clip(fe),re&&x.clip(re),ki(O,V),Ui(p,C,y)):P&hh?(ki(O,V),x.clip(fe),Ui(p,C,y)):P&gu&&(x.save(),x.clip(fe),re&&x.clip(re),ki(O,V),x.restore(),Ui(p,C,y)):(ki(O,V),Ui(p,C,y)),(ne||se||fe)&&x.restore()}function Ui(p,y,z){z>0&&(y instanceof Map?y.forEach((T,O)=>{x.strokeStyle=Ri=O,x.stroke(T)}):y!=null&&p&&x.stroke(y))}function ki(p,y){y instanceof Map?y.forEach((z,T)=>{x.fillStyle=Yn=T,x.fill(z)}):y!=null&&p&&x.fill(y)}function $a(p,y,z,T){let O=Q[p],C;if(T<=0)C=[0,0];else{let V=O._space=O.space(u,p,y,z,T),P=O._incrs=O.incrs(u,p,y,z,T,V);C=v3(y,z,P,T,V)}return O._found=C}function Nu(p,y,z,T,O,C,V,P,ne,se){let re=V%2/2;H==1&&x.translate(re,re),Cn(P,V,ne,se,P),x.beginPath();let fe,De,Qe,Ce,Ue=O+(T==0||T==3?-C:C);z==0?(De=O,Ce=Ue):(fe=O,Qe=Ue);for(let Ne=0;Ne{if(!z.show)return;let O=q[z.scale];if(O.min==null){z._show&&(y=!1,z._show=!1,Qa(!1));return}else z._show||(y=!1,z._show=!0,Qa(!1));let C=z.side,V=C%2,{min:P,max:ne}=O,[se,re]=$a(T,P,ne,V==0?Te:oe);if(re==0)return;let fe=O.distr==2,De=z._splits=z.splits(u,T,P,ne,se,re,fe),Qe=O.distr==2?De.map(_e=>dn[_e]):De,Ce=O.distr==2?dn[De[1]]-dn[De[0]]:se,Ue=z._values=z.values(u,z.filter(u,Qe,T,re,Ce),T,re,Ce);z._rotate=C==2?z.rotate(u,Ue,T,re):0;let Ne=z._size;z._size=Ol(z.size(u,Ue,T,p)),Ne!=null&&z._size!=Ne&&(y=!1)}),y}function Qr(p){let y=!0;return qr.forEach((z,T)=>{let O=z(u,T,Gn,p);O!=kl[T]&&(y=!1),kl[T]=O}),y}function ju(){for(let p=0;pdn[un]):Qe,Ue=re.distr==2?dn[Qe[1]]-dn[Qe[0]]:ne,Ne=y.ticks,_e=y.border,ct=Ne.show?Ne.size:0,St=Pt(ct*Ie),Ct=Pt((y.alignTo==2?y._size-ct-y.gap:y.gap)*Ie),et=y._rotate*-yo/180,it=I(y._pos*Ie),hn=(St+Ct)*P,Bt=it+hn;C=T==0?Bt:0,O=T==1?Bt:0;let wn=y.font[0],Qn=y.align==1?au:y.align==2?Kd:et>0?au:et<0?Kd:T==0?"center":z==3?Kd:au,an=et||T==1?"middle":z==2?zr:I0;Mu(wn,V,Qn,an);let $t=y.font[1]*y.lineGap,An=Qe.map(un=>I(m(un,re,fe,De))),Vn=y._values;for(let un=0;un{z>0&&(y._paths=null,p&&(c==1?(y.min=null,y.max=null):y.facets.forEach(T=>{T.min=null,T.max=null})))})}let ws=!1,Va=!1,Un=[];function Du(){Va=!1;for(let p=0;p0&&queueMicrotask(Du)}u.batch=Ka;function ga(){if(on&&(Gr(),on=!1),Ba&&(Di(),Ba=!1),vs){if(zt(E,au,lt),zt(E,zr,Nt),zt(E,wr,Te),zt(E,Ar,oe),zt(j,au,lt),zt(j,zr,Nt),zt(j,wr,Te),zt(j,Ar,oe),zt(w,wr,Cl),zt(w,Ar,ra),_.width=Pt(Cl*Ie),_.height=Pt(ra*Ie),Q.forEach(({_el:p,_show:y,_size:z,_pos:T,side:O})=>{if(p!=null)if(y){let C=O===3||O===0?z:0,V=O%2==1;zt(p,V?"left":"top",T-C),zt(p,V?"width":"height",z),zt(p,V?"top":"left",V?Nt:lt),zt(p,V?"height":"width",V?oe:Te),rh(p,ss)}else fl(p,ss)}),Ri=Yn=Wl=Ss=_s=Au=Ga=Ya=wu=null,Et=1,qi(!0),lt!=Rl||Nt!=ca||Te!=tl||oe!=oa){Qa(!1);let p=Te/tl,y=oe/oa;if(xe&&!fa&&G.left>=0){G.left*=p,G.top*=y,yl&&ua(yl,Pt(G.left),0,Te,oe),Tn&&ua(Tn,0,Pt(G.top),Te,oe);for(let z=0;z=0&&Fe.width>0){Fe.left*=p,Fe.width*=p,Fe.top*=y,Fe.height*=y;for(let z in Lu)zt(Ja,z,Fe[z])}Rl=lt,ca=Nt,tl=Te,oa=oe}Ht("setSize"),vs=!1}Cl>0&&ra>0&&(x.clearRect(0,0,_.width,_.height),Ht("drawClear"),ue.forEach(p=>p()),Ht("draw")),Fe.show&&da&&(Fa(Fe),da=!1),xe&&fa&&(ya(null,!0,!1),fa=!1),L.show&&L.live&&fn&&(ku(),fn=!1),g||(g=!0,u.status=1,Ht("ready")),vl=!1,ws=!1}u.redraw=(p,y)=>{Ba=y||!1,p!==!1?$n(le,te.min,te.max):Pl()};function As(p,y){let z=q[p];if(z.from==null){if(At==0){let T=z.range(u,y.min,y.max,p);y.min=T[0],y.max=T[1]}if(y.min>y.max){let T=y.min;y.min=y.max,y.max=T}if(At>1&&y.min!=null&&y.max!=null&&y.max-y.min<1e-16)return;p==le&&z.distr==2&&At>0&&(y.min=$l(y.min,l[0]),y.max=$l(y.max,l[0]),y.min==y.max&&y.max++),de[p]=y,on=!0,Pl()}}u.s)DELIM" +R"DELIM(etScale=As;let Zi,Ms,yl,Tn,Os,Xa,kn,ea,Li,Cu,Pe,at,Ll=!1;const Ve=G.drag;let yt=Ve.x,Mt=Ve.y;xe&&(G.x&&(Zi=Ml(RT,j)),G.y&&(Ms=Ml(UT,j)),te.ori==0?(yl=Zi,Tn=Ms):(yl=Ms,Tn=Zi),Pe=G.left,at=G.top);const Fe=u.select=Jt({show:!0,over:!0,left:0,width:0,top:0,height:0},n.select),Ja=Fe.show?Ml(CT,Fe.over?j:E):null;function Fa(p,y){if(Fe.show){for(let z in p)Fe[z]=p[z],z in Lu&&zt(Ja,z,p[z]);y!==!1&&Ht("setSelect")}}u.setSelect=Fa;function Ru(p){if(X[p].show)ie&&rh(nt[p],ss);else if(ie&&fl(nt[p],ss),xe){let z=ma?zn[0]:zn[p];z!=null&&ua(z,-10,-10,Te,oe)}}function $n(p,y,z){As(p,{min:y,max:z})}function Zn(p,y,z,T){y.focus!=null&&Vo(p),y.show!=null&&X.forEach((O,C)=>{C>0&&(p==C||p==null)&&(O.show=y.show,Ru(C),c==2?($n(O.facets[0].scale,null,null),$n(O.facets[1].scale,null,null)):$n(O.scale,null,null),Pl())}),z!==!1&&Ht("setSeries",p,y),T&&Pa("setSeries",u,p,y)}u.setSeries=Zn;function Vr(p,y){Jt(ae[p],y)}function Yo(p,y){p.fill=Ge(p.fill||null),p.dir=Je(p.dir,-1),y=y??ae.length,ae.splice(y,0,p)}function $o(p){p==null?ae.length=0:ae.splice(p,1)}u.addBand=Yo,u.setBand=Vr,u.delBand=$o;function Qo(p,y){X[p].alpha=y,xe&&zn[p]!=null&&(zn[p].style.opacity=y),ie&&nt[p]&&(nt[p].style.opacity=y)}let al,ta,va;const Wa={focus:!0};function Vo(p){if(p!=va){let y=p==null,z=ll.alpha!=1;X.forEach((T,O)=>{if(c==1||O>0){let C=y||O==0||O==p;T._focus=y?null:C,z&&Qo(O,C?1:ll.alpha)}}),va=p,z&&Pl()}}ie&&ha&&Ft(nv,ve,p=>{G._lock||(nl(p),va!=null&&Zn(null,Wa,!0,Dt.setSeries))});function bl(p,y,z){let T=q[y];z&&(p=p/Ie-(T.ori==1?Nt:lt));let O=Te;T.ori==1&&(O=oe,p=O-p),T.dir==-1&&(p=O-p);let C=T._min,V=T._max,P=p/O,ne=C+(V-C)*P,se=T.distr;return se==3?hu(10,ne):se==4?IT(ne,T.asinh):se==100?T.bwd(ne):ne}function Kr(p,y){let z=bl(p,le,y);return $l(z,l[0],jt,bt)}u.valToIdx=p=>$l(p,l[0]),u.posToIdx=Kr,u.posToVal=bl,u.valToPos=(p,y,z)=>q[y].ori==0?d(p,q[y],z?rt:Te,z?Dn:0):f(p,q[y],z?Yt:oe,z?nn:0),u.setCursor=(p,y,z)=>{Pe=p.left,at=p.top,ya(null,y,z)};function Xr(p,y){zt(Ja,au,Fe.left=p),zt(Ja,wr,Fe.width=y)}function Jr(p,y){zt(Ja,zr,Fe.top=p),zt(Ja,Ar,Fe.height=y)}let Hi=te.ori==0?Xr:Jr,Bi=te.ori==1?Xr:Jr;function Uu(){if(ie&&L.live)for(let p=c==2?1:0;p{M[T]=z}):nw(p.idx)||M.fill(p.idx),L.idx=M[0]),ie&&L.live){for(let z=0;z0||c==1&&!jn)&&Ko(z,M[z]);Uu()}fn=!1,y!==!1&&Ht("setLegend")}u.setLegend=ku;function Ko(p,y){let z=X[p],T=p==0&&be==2?dn:l[p],O;jn?O=z.values(u,p,y)??xn:(O=z.value(u,y==null?null:T[y],p,y),O=O==null?xn:{_:O}),L.values[p]=O}function ya(p,y,z){Li=Pe,Cu=at,[Pe,at]=G.move(u,Pe,at),G.left=Pe,G.top=at,xe&&(yl&&ua(yl,Pt(Pe),0,Te,oe),Tn&&ua(Tn,0,Pt(at),Te,oe));let T,O=jt>bt;al=gt,ta=null;let C=te.ori==0?Te:oe,V=te.ori==1?Te:oe;if(Pe<0||At==0||O){T=G.idx=null;for(let P=0;P0&&ct.show){let hn=et==null?-10:et==T?se:ce(c==1?l[0][et]:l[_e][0][et],te,C,0),Bt=it==null?-10:Ee(it,c==1?q[ct.scale]:q[ct.facets[1].scale],V,0);if(ha&&it!=null){let wn=te.ori==1?Pe:at,Qn=en(ll.dist(u,_e,et,Bt,wn));if(Qn=0?1:-1,Vn=$t>=0?1:-1;Vn==An&&(Vn==1?an==1?it>=$t:it<=$t:an==1?it<=$t:it>=$t)&&(al=Qn,ta=_e)}else al=Qn,ta=_e}}if(fn||ma){let wn,Qn;te.ori==0?(wn=hn,Qn=Bt):(wn=Bt,Qn=hn);let an,$t,An,Vn,sn,un,Mn=!0,na=ln.bbox;if(na!=null){Mn=!1;let mn=na(u,_e);An=mn.left,Vn=mn.top,an=mn.width,$t=mn.height}else An=wn,Vn=Qn,an=$t=ln.size(u,_e);if(un=ln.fill(u,_e),sn=ln.stroke(u,_e),ma)_e==ta&&al<=ll.prox&&(re=An,fe=Vn,De=an,Qe=$t,Ce=Mn,Ue=un,Ne=sn);else{let mn=zn[_e];mn!=null&&(Fl[_e]=An,pa[_e]=Vn,cv(mn,an,$t,Mn),uv(mn,un,sn),ua(mn,Ol(An),Ol(Vn),Te,oe))}}}}if(ma){let _e=ll.prox,ct=va==null?al<=_e:al>_e||ta!=va;if(fn||ct){let St=zn[0];St!=null&&(Fl[0]=re,pa[0]=fe,cv(St,De,Qe,Ce),uv(St,Ue,Ne),ua(St,Ol(re),Ol(fe),Te,oe))}}}if(Fe.show&&Ll)if(p!=null){let[P,ne]=Dt.scales,[se,re]=Dt.match,[fe,De]=p.cursor.sync.scales,Qe=p.cursor.drag;if(yt=Qe._x,Mt=Qe._y,yt||Mt){let{left:Ce,top:Ue,width:Ne,height:_e}=p.select,ct=p.scales[fe].ori,St=p.posToVal,Ct,et,it,hn,Bt,wn=P!=null&&se(P,fe),Qn=ne!=null&&re(ne,De);wn&&yt?(ct==0?(Ct=Ce,et=Ne):(Ct=Ue,et=_e),it=q[P],hn=ce(St(Ct,fe),it,C,0),Bt=ce(St(Ct+et,fe),it,C,0),Hi(Ql(hn,Bt),en(Bt-hn))):Hi(0,C),Qn&&Mt?(ct==1?(Ct=Ce,et=Ne):(Ct=Ue,et=_e),it=q[ne],hn=Ee(St(Ct,De),it,V,0),Bt=Ee(St(Ct+et,De),it,V,0),Bi(Ql(hn,Bt),en(Bt-hn))):Bi(0,V)}else Hu()}else{let P=en(Li-Os),ne=en(Cu-Xa);if(te.ori==1){let De=P;P=ne,ne=De}yt=Ve.x&&P>=Ve.dist,Mt=Ve.y&&ne>=Ve.dist;let se=Ve.uni;se!=null?yt&&Mt&&(yt=P>=se,Mt=ne>=se,!yt&&!Mt&&(ne>P?Mt=!0:yt=!0)):Ve.x&&Ve.y&&(yt||Mt)&&(yt=Mt=!0);let re,fe;yt&&(te.ori==0?(re=kn,fe=Pe):(re=ea,fe=at),Hi(Ql(re,fe),en(fe-re)),Mt||Bi(0,V)),Mt&&(te.ori==1?(re=kn,fe=Pe):(re=ea,fe=at),Bi(Ql(re,fe),en(fe-re)),yt||Hi(0,C)),!yt&&!Mt&&(Hi(0,0),Bi(0,0))}if(Ve._x=yt,Ve._y=Mt,p==null){if(z){if(tc!=null){let[P,ne]=Dt.scales;Dt.values[0]=P!=null?bl(te.ori==0?Pe:at,P):null,Dt.values[1]=ne!=null?bl(te.ori==1?Pe:at,ne):null}Pa(Xd,u,Pe,at,Te,oe,T)}if(ha){let P=z&&Dt.setSeries,ne=ll.prox;va==null?al<=ne&&Zn(ta,Wa,!0,P):al>ne?Zn(null,Wa,!0,P):ta!=va&&Zn(ta,Wa,!0,P)}}fn&&(L.idx=T,ku()),y!==!1&&Ht("setCursor")}let Hl=null;Object.defineProperty(u,"rect",{get(){return Hl==null&&qi(!1),Hl}});function qi(p=!1){p?Hl=null:(Hl=j.getBoundingClientRect(),Ht("syncRect",Hl))}function Fr(p,y,z,T,O,C,V){G._lock||Ll&&p!=null&&p.movementX==0&&p.movementY==0||(Zu(p,y,z,T,O,C,V,!1,p!=null),p!=null?ya(null,!0,!0):ya(y,!0,!1))}function Zu(p,y,z,T,O,C,V,P,ne){if(Hl==null&&qi(!1),nl(p),p!=null)z=p.clientX-Hl.left,T=p.clientY-Hl.top;else{if(z<0||T<0){Pe=-10,at=-10;return}let[se,re]=Dt.scales,fe=y.cursor.sync,[De,Qe]=fe.values,[Ce,Ue]=fe.scales,[Ne,_e]=Dt.match,ct=y.axes[0].side%2==1,St=te.ori==0?Te:oe,Ct=te.ori==1?Te:oe,et=ct?C:O,it=ct?O:C,hn=ct?T:z,Bt=ct?z:T;if(Ce!=null?z=Ne(se,Ce)?m(De,q[se],St,0):-10:z=St*(hn/et),Ue!=null?T=_e(re,Ue)?m(Qe,q[re],Ct,0):-10:T=Ct*(Bt/it),te.ori==1){let wn=z;z=T,T=wn}}ne&&(y==null||y.cursor.event.type==Xd)&&((z<=1||z>=Te-1)&&(z=as(z,Te)),(T<=1||T>=oe-1)&&(T=as(T,oe))),P?(Os=z,Xa=T,[kn,ea]=G.move(u,z,T)):(Pe=z,at=T)}const Lu={width:0,height:0,left:0,top:0};function Hu(){Fa(Lu,!1)}let Wr,Ir,Pr,ec;function Ns(p,y,z,T,O,C,V){Ll=!0,yt=Mt=Ve._x=Ve._y=!1,Zu(p,y,z,T,O,C,V,!0,!1),p!=null&&(Ft(Jd,sh,Ia,!1),Pa(ev,u,kn,ea,Te,oe,null));let{left:P,top:ne,width:se,height:re}=Fe;Wr=P,Ir=ne,Pr=se,ec=re}function Ia(p,y,z,T,O,C,V){Ll=Ve._x=Ve._y=!1,Zu(p,y,z,T,O,C,V,!1,!0);let{left:P,top:ne,width:se,height:re}=Fe,fe=se>0||re>0,De=Wr!=P||Ir!=ne||Pr!=se||ec!=re;if(fe&&De&&Fa(Fe),Ve.setScale&&fe&&De){let Qe=P,Ce=se,Ue=ne,Ne=re;if(te.ori==1&&(Qe=ne,Ce=re,Ue=P,Ne=se),yt&&$n(le,bl(Qe,le),bl(Qe+Ce,le)),Mt)for(let _e in q){let ct=q[_e];_e!=le&&ct.from==null&&ct.min!=gt&&$n(_e,bl(Ue+Ne,_e),bl(Ue,_e))}Hu()}else G.lock&&(G._lock=!G._lock,ya(y,!0,p!=null));p!=null&&(Xl(Jd,sh),Pa(Jd,u,Pe,at,Te,oe,null))}function Xo(p,y,z,T,O,C,V){if(G._lock)return;nl(p);let P=Ll;if(Ll){let ne=!0,se=!0,re=10,fe,De;te.ori==0?(fe=yt,De=Mt):(fe=Mt,De=yt),fe&&De&&(ne=Pe<=re||Pe>=Te-re,se=at<=re||at>=oe-re),fe&&ne&&(Pe=Pe{let O=Dt.match[2];z=O(u,y,z),z!=-1&&Zn(z,T,!0,!1)},xe&&(F)DELIM" +R"DELIM(t(ev,j,Ns),Ft(Xd,j,Fr),Ft(tv,j,p=>{nl(p),qi(!1)}),Ft(nv,j,Xo),Ft(lv,j,Bu),mh.add(u),u.syncRect=qi);const Gi=u.hooks=n.hooks||{};function Ht(p,y,z){Va?Un.push([p,y,z]):p in Gi&&Gi[p].forEach(T=>{T.call(null,u,y,z)})}(n.plugins||[]).forEach(p=>{for(let y in p.hooks)Gi[y]=(Gi[y]||[]).concat(p.hooks[y])});const Sa=(p,y,z)=>z,Dt=Jt({key:null,setSeries:!1,filters:{pub:mv,sub:mv},scales:[le,X[1]?X[1].scale:null],match:[pv,pv,Sa],values:[null,null]},G.sync);Dt.match.length==2&&Dt.match.push(Sa),G.sync=Dt;const tc=Dt.key,Gu=vb(tc);function Pa(p,y,z,T,O,C,V){Dt.filters.pub(p,y,z,T,O,C,V)&&Gu.pub(p,y,z,T,O,C,V)}Gu.sub(u);function nc(p,y,z,T,O,C,V){Dt.filters.sub(p,y,z,T,O,C,V)&&ba[p](null,y,z,T,O,C,V)}u.pub=nc;function Yi(){Gu.unsub(u),mh.delete(u),Dl.clear(),ch(To,fu,qu),v.remove(),ve?.remove(),Ht("destroy")}u.destroy=Yi;function _a(){Ht("init",n,l),Lt(l||n.data,!1),de[le]?As(le,de[le]):bs(),da=Fe.show&&(Fe.width>0||Fe.height>0),fa=fn=!0,qa(n.width,n.height)}return X.forEach(Ul),Q.forEach(Tu),s?s instanceof HTMLElement?(s.appendChild(v),_a()):s(u,_a):_a(),u}cn.assign=Jt;cn.fmtNum=Kh;cn.rangeNum=wo;cn.rangeLog=Ro;cn.rangeAsinh=Qh;cn.orient=gs;cn.pxRatio=Ie;cn.join=cw;cn.fmtDate=Jh,cn.tzDate=Sw;cn.sync=vb;{cn.addGap=n3,cn.clipGaps=Zo;let n=cn.paths={points:zb};n.linear=Tb,n.stepped=i3,n.bars=s3,n.spline=r3}function b3({data:n,series:l,height:s=280,emptyMessage:u="Waiting for live data…",valueSuffix:c="",zeroBased:d=!0,valueFormatter:f=z3,visualization:m="line",forceEmpty:g=!1}){const v=ge.useRef(null),_=ge.useRef(null),x=ge.useRef(!1),w=ge.useMemo(()=>x3(n),[n]),E=ge.useRef(w),j=!g&&n[0]?.length>0;return ge.useLayoutEffect(()=>{E.current=w},[w]),ge.useLayoutEffect(()=>{const H=v.current;if(!H)return;const I={width:Math.max(240,H.clientWidth),height:s,padding:[12,8,0,0],cursor:{drag:{x:!0,y:!1,setScale:!0},focus:{prox:24}},hooks:{setSelect:[Q=>{Q.select.width>0&&(x.current=!0)}]},legend:{show:!0,live:!0},scales:{x:{time:!0},y:{auto:!0,...d?{range:(Q,q,ae)=>[Math.min(0,q),ae===0?1:ae*1.08]}:{range:(Q,q,ae)=>{const le=ae-q,ee=le===0?Math.max(1,Math.abs(ae)*5e-4):le*.08;return[q-ee,ae+ee]}}}},axes:[{stroke:"#9f9f98",grid:{stroke:"#ffffff12",width:1},ticks:{stroke:"#ffffff20",width:1},font:"11px system-ui"},{size:72,stroke:"#9f9f98",grid:{stroke:"#ffffff12",width:1},ticks:{stroke:"#ffffff20",width:1},font:"11px system-ui",values:(Q,q)=>q.map(ae=>`${f(ae)}${c}`)}],series:[{},...l.map((Q,q)=>{const ae=m==="step"?cn.paths.stepped?.({align:1}):m==="bar"?S3(q,l.length):void 0;return{label:Q.label,stroke:Q.color,fill:m==="area"||m==="bar"?Q.fill??`${Q.color}24`:Q.fill,width:Q.width??2,paths:ae,points:{show:m==="line"?Q.points??!1:!1},value:(le,ee)=>ee===null?"—":`${f(ee)}${c}`}})]};x.current=!1;const W=new cn(I,E.current,H);_.current=W;const X=new ResizeObserver(Q=>{const q=Q[0]?.contentRect.width;q&&q>0&&W.setSize({width:Math.round(q),height:s})});return X.observe(H),()=>{X.disconnect(),W.destroy(),_.current=null}},[s,l,f,c,m,d]),ge.useEffect(()=>{const H=_.current;if(!H)return;const I=!x.current;H.setData(w,I),I||H.redraw()},[w]),S.jsxs("div",{className:"relative min-w-0",children:[S.jsx("div",{ref:v,className:"min-w-0 overflow-hidden"}),!j&&S.jsx("div",{className:"bg-surface text-textMuted pointer-events-none absolute inset-0 z-10 flex items-center justify-center text-sm",children:u})]})}function S3(n,l){const s=Math.max(1,l);return cn.paths.bars?.({size:[1,48/s,0],disp:{x0:{unit:1,values:u=>{const c=Zv(u,s),d=-c.groupWidth/2+c.barWidth*n;return Array.from(u.data[0],f=>f+d)}},size:{unit:1,values:u=>[Zv(u,s).barWidth]}}})}function Zv(n,l){const s=_3(n.data[0]),u=Math.abs(n.posToVal(48,"x")-n.posToVal(0,"x")),c=Math.min(s*.72,u);return{groupWidth:c,barWidth:c/l}}function _3(n){let l=Number.POSITIVE_INFINITY,s;for(const u of n)if(Number.isFinite(u)){if(s!==void 0){const c=Math.abs(u-s);c>0&&c=2)return n;const s=Date.now()/1e3,u=l[0]??s,c=[u-1,u],d=n.slice(1).map(f=>{const m=f[0]??null;return[m,m]});return[c,...d]}function z3(n){return Math.abs(n)>=1e6?`${(n/1e6).toFixed(1)}m`:Math.abs(n)>=1e3?`${(n/1e3).toFixed(1)}k`:Math.abs(n)>=10?n.toFixed(0):Math.abs(n)>=1?n.toFixed(1):n.toFixed(2)}const E3={300:"5m",900:"15m",3600:"1h"},T3=new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),w3=new Intl.NumberFormat(void 0,{maximumFractionDigits:2});function A3(n){return T3.format(n)}function M3(n){return w3.format(n)}function O3(n){return n==="height"||n==="occurrences"?A3:M3}function N3({metrics:n}){const[l,s]=ge.useState(cT),[u,c]=ge.useState(null),[d,f]=ge.useState(!1);ge.useEffect(()=>{oT(l)},[l]);function m(_){s(x=>u?.mode==="add"?x.length>=su?x:[...x,_]:x.map(w=>w.id===_.id?_:w)),c(null)}function g(_,x){s(w=>{const E=_+x;if(E<0||E>=w.length)return w;const j=[...w],H=j[_],I=j[E];return j[_]=I,j[E]=H,j})}function v(){if(!d){f(!0);return}s(vo()),f(!1)}return S.jsxs("section",{className:"space-y-4",children:[S.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Live telemetry"}),S.jsx("h2",{className:"mt-1 text-2xl font-semibold",children:"Custom charts"}),S.jsxs("p",{className:"text-textMuted mt-1 text-sm",children:["Session data only · ",String(l.length)," of ",String(su)," charts"]})]}),S.jsxs("div",{className:"flex flex-wrap gap-2",children:[S.jsx("button",{type:"button",onClick:()=>{f(!1),c({mode:"add",chart:Ly()})},disabled:l.length>=su,className:"bg-accent text-background hover:bg-accent/90 rounded-lg px-4 py-2 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-40",children:"Add chart"}),S.jsx("button",{type:"button",onClick:v,onBlur:()=>{f(!1)},className:`rounded-lg border px-4 py-2 text-sm ${d?"border-amber-400/60 text-amber-200":"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary"}`,children:d?"Confirm reset":"Reset defaults"})]})]}),l.length===0?S.jsxs("div",{className:"border-accent/20 bg-surface/60 rounded-xl border border-dashed px-6 py-16 text-center",children:[S.jsx("p",{className:"text-textPrimary font-medium",children:"No charts in this dashboard."}),S.jsx("p",{className:"text-textMuted mt-2 text-sm",children:"Add a custom chart or start from a template."})]}):S.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:l.map((_,x)=>S.jsx(j3,{chart:_,metrics:n,canMoveEarlier:x>0,canMoveLater:x{s(w=>w.filter(E=>E.id!==_.id))},onDuplicate:()=>{s(w=>w.length>=su?w:[...w,rT(_)])},onEdit:()=>{c({mode:"edit",chart:_})},onMoveEarlier:()=>{g(x,-1)},onMoveLater:()=>{g(x,1)}},_.id))}),u&&S.jsx(zT,{chart:u.chart,mode:u.mode,onCancel:()=>{c(null)},onSave:m},`${u.mode}-${u.chart.id}`)]})}function j3({chart:n,metrics:l,canMoveEarlier:s,canMoveLater:u,canDuplicate:c,onDelete:d,onDuplicate:f,onEdit:m,onMoveEarlier:g,onMoveLater:v}){const[_,x]=ge.useState(null),[w,E]=ge.useState(0),j=_??l,H=ge.useMemo(()=>pT(j,n),[n,j]),I=ge.useMemo(()=>n.series.map(Q=>({label:Q.label??Za(Q.signalId).label,color:Q.color})),[n.series]),W=O3(H.unit),X=`Waiting for ${n.series.length===1?I[0]?.label?.toLowerCase():"the selected signals"}…`;return S.jsxs("article",{className:"border-accent/20 bg-surface/70 min-w-0 overflow-hidden rounded-xl border",children:[S.jsx("header",{className:"border-accent/15 space-y-3 border-b px-4 py-4 sm:px-5",children:S.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("h3",{className:"truncate font-semibold",title:n.title,children:n.title}),S.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:[Gy(H.unit)," · ",E3[n.range]," · ",n.visualization,_?" · paused":""]})]}),S.jsxs("div",{className:"flex flex-wrap justify-end gap-1 text-xs",children:[S.jsx(ls,{label:_?"Resume chart":"Pause chart",onClick:()=>{x(Q=>Q?null:l)},children:_?"Re)DELIM" +R"DELIM(sume":"Pause"}),S.jsx(ls,{label:"Reset chart zoom",onClick:()=>{E(Q=>Q+1)},children:"Reset zoom"}),S.jsx(ls,{label:"Edit chart",onClick:m,children:"Edit"}),S.jsx(ls,{label:"Duplicate chart",onClick:f,disabled:!c,children:"Duplicate"}),S.jsx(ls,{label:`Move ${n.title} earlier`,onClick:g,disabled:!s,children:"←"}),S.jsx(ls,{label:`Move ${n.title} later`,onClick:v,disabled:!u,children:"→"}),S.jsx(ls,{label:"Delete chart",onClick:d,danger:!0,children:"Delete"})]})]})}),S.jsx("div",{className:"min-w-0 p-3 sm:p-5",children:S.jsx(b3,{data:H.data,series:I,visualization:n.visualization,zeroBased:vT(H.unit),valueFormatter:W,valueSuffix:gT(H.unit),forceEmpty:!H.hasObservedData,emptyMessage:X},w)}),H.unobservedLabels.length>0&&H.hasObservedData&&S.jsxs("footer",{className:"border-accent/10 text-textMuted border-t px-5 py-2 text-[11px]",children:["Not observed this session: ",H.unobservedLabels.join(", ")]})]})}function ls({label:n,children:l,onClick:s,disabled:u=!1,danger:c=!1}){return S.jsx("button",{type:"button","aria-label":n,onClick:s,disabled:u,className:`rounded px-2 py-1.5 disabled:cursor-not-allowed disabled:opacity-30 ${c?"text-textMuted hover:bg-red-500/10 hover:text-red-300":"text-textMuted hover:text-textPrimary hover:bg-white/5"}`,children:l})}const D3=[{event:0,label:"Header archived"},{event:3,label:"Block archived"},{event:5,label:"Block validated"},{event:6,label:"Block confirmed"},{event:13,label:"Block organized"},{event:14,label:"Block reorganized"}];function C3({adminStatus:n,endpoints:l,metrics:s,native:u,reference:c}){const d=QE(s,10),f=u.configuration,m=Nl(6),g=FE(c.receivedAt,s.now),v=[n.error?`Admin: ${n.error}`:null,u.status.error?`Native: ${u.status.error}`:null,u.transport==="none"&&u.restError?`Native REST: ${u.restError}`:null,g?"Sync reference: The last network top is stale; progress is unavailable":c.top===null&&c.error?`Sync reference: ${c.error}`:null,s.invalidFrames>0?`${String(s.invalidFrames)} malformed admin frame${s.invalidFrames===1?"":"s"} ignored`:null].filter(_=>_!==null);return S.jsxs("div",{className:"space-y-8",children:[v.length>0&&S.jsxs("section",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3",children:[S.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Transport notice"}),S.jsx("ul",{className:"text-textMuted mt-1 space-y-1 text-xs",children:v.map(_=>S.jsx("li",{children:_},_))})]}),!g&&S.jsx(eT,{localTop:u.top,referenceTop:c.top,referenceUrl:l.referenceUrl}),S.jsxs("section",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[S.jsx(oo,{label:"Canonical top",value:u.top===null?"—":dl(u.top),detail:u.transport==="none"?"Waiting for native API":`via ${u.transport==="websocket"?"native WebSocket":"REST fallback"}`,accent:"orange"}),S.jsx(oo,{label:"Current activity",value:d.label,detail:d.rate>0?`${xE(d.rate)} over the last 10 seconds`:"No lifecycle events in the last 10 seconds",accent:"green"}),S.jsx(oo,{label:"Highest confirmed",value:s.signalMaximums[m]===void 0?"—":dl(s.signalMaximums[m]),detail:`${dl(s.signalTotals[m]??0)} confirmations observed`,accent:"blue"}),S.jsx(oo,{label:"Collection uptime",value:_E(s.now-s.sessionStartedAt),detail:`${dl(s.totalEvents)} events · ${dl(s.totalLogs)} logs`,accent:"red"})]}),S.jsxs("section",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsx(Lv,{title:"Admin stream",endpoint:l.adminUrl,status:n,detail:n.lastMessageAt?`Last frame ${Or(n.lastMessageAt)}`:"Waiting for the first frame"}),S.jsx(Lv,{title:"Native interface",endpoint:l.nativeUrl,status:u.status,detail:u.receivedAt?`Last state ${Or(u.receivedAt)} · ${u.transport}`:"Waiting for node state"})]}),S.jsx(N3,{metrics:s}),S.jsxs("section",{className:"grid gap-4 xl:grid-cols-[1.1fr_0.9fr]",children:[S.jsxs("div",{className:"border-accent/20 bg-surface/70 rounded-xl border",children:[S.jsxs("header",{className:"border-accent/15 border-b px-5 py-4",children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Lifecycle heights"}),S.jsx("h2",{className:"mt-1 font-semibold",children:"Highest observed event values"})]}),S.jsx("div",{className:"grid gap-px bg-white/5 sm:grid-cols-2 lg:grid-cols-3",children:D3.map(({event:_,label:x})=>{const w=s.signalMaximums[Nl(_)];return S.jsxs("div",{className:"bg-surface px-5 py-4",children:[S.jsx("p",{className:"text-textMuted text-xs",children:x}),S.jsx("p",{className:"text-textPrimary mt-2 font-mono text-lg tabular-nums",children:w===void 0?"—":dl(w)})]},_)})})]}),S.jsxs("div",{className:"border-accent/20 bg-surface/70 rounded-xl border",children:[S.jsxs("header",{className:"border-accent/15 border-b px-5 py-4",children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Capabilities"}),S.jsx("h2",{className:"mt-1 font-semibold",children:"Native configuration"})]}),f?S.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 p-5 text-sm",children:[S.jsx(iu,{label:"Address index",enabled:f.address}),S.jsx(iu,{label:"Client filters",enabled:f.filter}),S.jsx(iu,{label:"Turbo",enabled:f.turbo}),S.jsx(iu,{label:"Witness",enabled:f.witness}),S.jsx(iu,{label:"Retarget",enabled:f.retarget}),S.jsx(iu,{label:"Difficulty",enabled:f.difficult}),S.jsxs("div",{className:"col-span-2 border-t border-white/5 pt-3",children:[S.jsx("span",{className:"text-textMuted",children:"Pruned below"}),S.jsx("span",{className:"text-textPrimary float-right font-mono",children:f.pruned>0?dl(f.pruned):"Not pruned"})]})]}):S.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:"Waiting for native configuration."})]})]}),S.jsx("section",{children:S.jsxs("div",{className:"border-accent/20 bg-surface/70 rounded-xl border",children:[S.jsx("header",{className:"border-accent/15 border-b px-5 py-4",children:S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Recent events"})}),s.recentEvents.length===0?S.jsx(R3,{text:"No events observed yet."}):S.jsx("ul",{className:"divide-y divide-white/5",children:s.recentEvents.slice(0,6).map(_=>S.jsxs("li",{className:"flex items-center gap-3 px-5 py-3 text-xs",children:[S.jsx("time",{className:"text-textMuted w-24 shrink-0 font-mono",children:Or(_.time)}),S.jsx("span",{className:"text-textPrimary min-w-0 flex-1 truncate font-mono",children:cs(_.event).name}),S.jsx("span",{className:"text-accent tabular-nums",children:jy(_.event,_.value)})]},_.id))})]})})]})}function Lv({title:n,endpoint:l,status:s,detail:u}){return S.jsxs("article",{className:"border-accent/20 bg-surface/70 min-w-0 rounded-xl border p-5",children:[S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-textMuted text-xs tracking-wide uppercase",children:n}),S.jsx("p",{className:"text-textPrimary mt-2 font-mono text-sm break-all",children:Dy(l)})]}),S.jsx(IE,{phase:s.phase,label:s.phase})]}),S.jsxs("div",{className:"text-textMuted mt-4 flex flex-wrap justify-between gap-2 border-t border-white/5 pt-3 text-xs",children:[S.jsx("span",{children:u}),S.jsxs("span",{children:[String(s.reconnects)," reconnect",s.reconnects===1?"":"s"]})]})]})}function iu({label:n,enabled:l}){return S.jsxs("div",{className:"flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-textMuted",children:n}),S.jsx("span",{className:l?"text-emerald-300":"text-textMuted",children:l?"Enabled":"Disabled"})]})}function R3({text:n}){return S.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:n})}var Hr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},U3=class extends Hr{#e;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const l=()=>n();return window.addEventListener("visibi)DELIM" +R"DELIM(litychange",l,!1),()=>{window.removeEventListener("visibilitychange",l)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(l=>{l(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},nm=new U3,k3={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)},Z3=class{#e=k3;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,l){return this.#e.setTimeout(n,l)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,l){return this.#e.setInterval(n,l)}clearInterval(n){this.#e.clearInterval(n)}},rs=new Z3;function L3(n){setTimeout(n,0)}var H3=typeof window>"u"||"Deno"in globalThis;function In(){}function B3(n,l){return typeof n=="function"?n(l):n}function gh(n){return typeof n=="number"&&n>=0&&n!==1/0}function Ob(n,l){return Math.max(n+(l||0)-Date.now(),0)}function wi(n,l){return typeof n=="function"?n(l):n}function hl(n,l){return typeof n=="function"?n(l):n}function Hv(n,l){const{type:s="all",exact:u,fetchStatus:c,predicate:d,queryKey:f,stale:m}=n;if(f){if(u){if(l.queryHash!==lm(f,l.options))return!1}else if(!vu(l.queryKey,f))return!1}if(s!=="all"){const g=l.isActive();if(s==="active"&&!g||s==="inactive"&&g)return!1}return!(typeof m=="boolean"&&l.isStale()!==m||c&&c!==l.state.fetchStatus||d&&!d(l))}function Bv(n,l){const{exact:s,status:u,predicate:c,mutationKey:d}=n;if(d){if(!l.options.mutationKey)return!1;if(s){if(kr(l.options.mutationKey)!==kr(d))return!1}else if(!vu(l.options.mutationKey,d))return!1}return!(u&&l.state.status!==u||c&&!c(l))}function lm(n,l){return(l?.queryKeyHashFn||kr)(n)}function kr(n){return JSON.stringify(n,(l,s)=>yh(s)?Object.keys(s).sort().reduce((u,c)=>(u[c]=s[c],u),{}):s)}function vu(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(n&&l&&typeof n=="object"&&typeof l=="object"){if(Array.isArray(n)&&Array.isArray(l)){for(let u=0;u500)return l;const u=qv(n)&&qv(l);if(!u&&!(yh(n)&&yh(l)))return l;const d=(u?n:Object.keys(n)).length,f=u?l:Object.keys(l),m=f.length,g=u?new Array(m):{};let v=0;for(let _=0;_{rs.setTimeout(l,n)})}function bh(n,l,s){return typeof s.structuralSharing=="function"?s.structuralSharing(n,l):s.structuralSharing!==!1?Nb(n,l):l}function Y3(n,l,s=0){const u=[...n,l];return s&&u.length>s?u.slice(1):u}function $3(n,l,s=0){const u=[l,...n];return s&&u.length>s?u.slice(0,-1):u}var am=Symbol();function jb(n,l){return!n.queryFn&&l?.initialPromise?()=>l.initialPromise:!n.queryFn||n.queryFn===am?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Db(n,l){return typeof n=="function"?n(...l):!!n}function Q3(n,l,s){let u=!1,c;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(c??=l(),u||(u=!0,c.aborted?s():c.addEventListener("abort",s,{once:!0})),c)}),n}var Zr=(()=>{let n=()=>H3;return{isServer(){return n()},setIsServer(l){n=l}}})();function Sh(){let n,l;const s=new Promise((c,d)=>{n=c,l=d});s.status="pending",s.catch(()=>{});function u(c){Object.assign(s,c),delete s.resolve,delete s.reject}return s.resolve=c=>{u({status:"fulfilled",value:c}),n(c)},s.reject=c=>{u({status:"rejected",reason:c}),l(c)},s}var V3=L3;function K3(){let n=[],l=0,s=m=>{m()},u=m=>{m()},c=V3;const d=m=>{l?n.push(m):c(()=>{s(m)})},f=()=>{const m=n;n=[],m.length&&c(()=>{u(()=>{m.forEach(g=>{s(g)})})})};return{batch:m=>{let g;l++;try{g=m()}finally{l--,l||f()}return g},batchCalls:m=>(...g)=>{d(()=>{m(...g)})},schedule:d,setNotifyFunction:m=>{s=m},setBatchNotifyFunction:m=>{u=m},setScheduler:m=>{c=m}}}var Sn=K3(),X3=class extends Hr{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const l=()=>n(!0),s=()=>n(!1);return window.addEventListener("online",l,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",l),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(s=>{s(n)}))}isOnline(){return this.#e}},Mo=new X3;function J3(n){return Math.min(1e3*2**n,3e4)}function Cb(n){return(n??"online")==="online"?Mo.isOnline():!0}var _h=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function Rb(n){let l=!1,s=0,u;const c=Sh(),d=()=>c.status!=="pending",f=H=>{if(!d()){const I=new _h(H);w(I),n.onCancel?.(I)}},m=()=>{l=!0},g=()=>{l=!1},v=()=>nm.isFocused()&&(n.networkMode==="always"||Mo.isOnline())&&n.canRun(),_=()=>Cb(n.networkMode)&&n.canRun(),x=H=>{d()||(u?.(),c.resolve(H))},w=H=>{d()||(u?.(),c.reject(H))},E=()=>new Promise(H=>{u=I=>{(d()||v())&&H(I)},n.onPause?.()}).then(()=>{u=void 0,d()||n.onContinue?.()}),j=()=>{if(d())return;let H;const I=s===0?n.initialPromise:void 0;try{H=I??n.fn()}catch(W){H=Promise.reject(W)}Promise.resolve(H).then(x).catch(W=>{if(d())return;const X=n.retry??(Zr.isServer()?0:3),Q=n.retryDelay??J3,q=typeof Q=="function"?Q(s,W):Q,ae=X===!0||typeof X=="number"&&sv()?void 0:E()).then(()=>{l?w(W):j()})})};return{promise:c,status:()=>c.status,cancel:f,continue:()=>(u?.(),c),cancelRetry:m,continueRetry:g,canStart:_,start:()=>(_()?j():E().then(j),c)}}var Ub=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gh(this.gcTime)&&(this.#e=rs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Zr.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(rs.clearTimeout(this.#e),this.#e=void 0)}};function F3(n){return{onFetch:(l,s)=>{const u=l.options,c=l.fetchOptions?.meta?.fetchMore?.direction,d=l.state.data?.pages||[],f=l.state.data?.pageParams||[];let m={pages:[],pageParams:[]},g=0;const v=async()=>{let _=!1;const x=j=>{Q3(j,()=>l.signal,()=>_=!0)},w=jb(l.options,l.fetchOptions),E=async(j,H,I)=>{if(_)return Promise.reject(l.signal.reason);if(H==null&&j.pages.length)return Promise.resolve(j);const X=(()=>{const le={client:l.client,queryKey:l.queryKey,pageParam:H,direction:I?"backward":"forward",meta:l.options.meta};return x(le),le})(),Q=await w(X),{maxPages:q}=l.options,ae=I?$3:Y3;return{pages:ae(j.pages,Q,q),pageParams:ae(j.pageParams,H,q)}};if(c&&d.length){const j=c==="backward",H=j?W3:Yv,I={pages:d,pageParams:f},W=H(u,I);m=await E(I,W,j)}else{const j=n??d.length;do{const H=g===0?f[0]??u.initialPageParam:Yv(u,m);if(g>0&&H==null)break;m=await E(m,H),g++}while(gl.options.persister?.(v,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal)DELIM" +R"DELIM(},s):l.fetchFn=v}}}function Yv(n,{pages:l,pageParams:s}){const u=l.length-1;return l.length>0?n.getNextPageParam(l[u],l,s[u],s):void 0}function W3(n,{pages:l,pageParams:s}){return l.length>0?n.getPreviousPageParam?.(l[0],l,s[0],s):void 0}var I3=class extends Ub{#e;#t;#n;#l;#a;#i;#u;#s;constructor(n){super(),this.#s=!1,this.#u=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#a=n.client,this.#l=this.#a.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=Qv(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(n){if(this.options={...this.#u,...n},n?._type&&(this.#e=n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const l=Qv(this.options);l.data!==void 0&&(this.setState($v(l.data,l.dataUpdatedAt)),this.#t=l)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#l.remove(this)}setData(n,l){const s=bh(this.state.data,n,this.options);return this.#r({data:s,type:"success",dataUpdatedAt:l?.updatedAt,manual:l?.manual}),s}setState(n){this.#r({type:"setState",state:n})}cancel(n){const l=this.#i?.promise;return this.#i?.cancel(n),l?l.then(In).catch(In):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(n=>hl(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===am||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>wi(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!Ob(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(l=>l.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(l=>l.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(l=>l!==n),this.observers.length||(this.#i&&(this.#s||this.#c()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}async fetch(n,l){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&l?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(n&&this.setOptions(n),!this.options.queryFn){const g=this.observers.find(v=>v.options.queryFn);g&&this.setOptions(g.options)}const s=new AbortController,u=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(this.#s=!0,s.signal)})},c=()=>{const g=jb(this.options,l),_=(()=>{const x={client:this.#a,queryKey:this.queryKey,meta:this.meta};return u(x),x})();return this.#s=!1,this.options.persister?this.options.persister(g,_,this):g(_)},f=(()=>{const g={fetchOptions:l,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:c};return u(g),g})();(this.#e==="infinite"?F3(this.options.pages):this.options.behavior)?.onFetch(f,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#r({type:"fetch",meta:f.fetchOptions?.meta}),this.#i=Rb({initialPromise:l?.initialPromise,fn:f.fetchFn,onCancel:g=>{g instanceof _h&&g.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(g,v)=>{this.#r({type:"failed",failureCount:g,error:v})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const g=await this.#i.start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),this.#l.config.onSuccess?.(g,this),this.#l.config.onSettled?.(g,this.state.error,this),g}catch(g){if(g instanceof _h){if(g.silent)return this.#i.promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw this.#r({type:"error",error:g}),this.#l.config.onError?.(g,this),this.#l.config.onSettled?.(this.state.data,g,this),g}finally{this.scheduleGc()}}#r(n){const l=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...kb(s.data,this.options),fetchMeta:n.meta??null};case"success":const u={...s,...$v(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?u:void 0,u;case"error":const c=n.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=l(this.state),Sn.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:n})})}};function kb(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Cb(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function $v(n,l){return{data:n,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Qv(n){const l=typeof n.initialData=="function"?n.initialData():n.initialData,s=l!==void 0,u=s?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:s?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var P3=class extends Hr{constructor(n,l){super(),this.options=l,this.#e=n,this.#s=null,this.#u=Sh(),this.bindMethods(),this.setOptions(l)}#e;#t=void 0;#n=void 0;#l=void 0;#a;#i;#u;#s;#c;#r;#h;#p;#f;#d;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Vv(this.#t,this.options)?this.#o():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xh(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xh(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#z(),this.#v(),this.#t.removeObserver(this)}setOptions(n){const l=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hl(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#m(),this.#t.setOptions(this.options),l._defaulted&&!vh(this.options,l)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const u=this.hasListeners();u&&Kv(this.#t,s,this.options,l)&&this.#o(),this.updateResult(),u&&(this.#t!==s||hl(this.options.enabled,this.#t)!==hl(l.enabled,this.#t)||wi(this.options.staleTime,this.#t)!==wi(l.staleTime,this.#t))&&this.#b)DELIM" +R"DELIM(();const c=this.#S();u&&(this.#t!==s||hl(this.options.enabled,this.#t)!==hl(l.enabled,this.#t)||c!==this.#d)&&this.#_(c)}getOptimisticResult(n){const l=this.#e.getQueryCache().build(this.#e,n),s=this.createResult(l,n);return tA(this,s)&&(this.#l=s,this.#i=this.options,this.#a=this.#t.state),s}getCurrentResult(){return this.#l}trackResult(n,l){return new Proxy(n,{get:(s,u)=>(this.trackProp(u),l?.(u),u==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#u.status==="pending"&&this.#u.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,u))})}trackProp(n){this.#g.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const l=this.#e.defaultQueryOptions(n),s=this.#e.getQueryCache().build(this.#e,l);return s.fetch().then(()=>this.createResult(s,l))}fetch(n){return this.#o({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#l))}#o(n){this.#m();let l=this.#t.fetch(this.options,n);return n?.throwOnError||(l=l.catch(In)),l}#b(){this.#z();const n=wi(this.options.staleTime,this.#t);if(Zr.isServer()||this.#l.isStale||!gh(n))return;const s=Ob(this.#l.dataUpdatedAt,n)+1;this.#p=rs.setTimeout(()=>{this.#l.isStale||this.updateResult()},s)}#S(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#_(n){this.#v(),this.#d=n,!(Zr.isServer()||hl(this.options.enabled,this.#t)===!1||!gh(this.#d)||this.#d===0)&&(this.#f=rs.setInterval(()=>{(this.options.refetchIntervalInBackground||nm.isFocused())&&this.#o()},this.#d))}#x(){this.#b(),this.#_(this.#S())}#z(){this.#p!==void 0&&(rs.clearTimeout(this.#p),this.#p=void 0)}#v(){this.#f!==void 0&&(rs.clearInterval(this.#f),this.#f=void 0)}createResult(n,l){const s=this.#t,u=this.options,c=this.#l,d=this.#a,f=this.#i,g=n!==s?n.state:this.#n,{state:v}=n;let _={...v},x=!1,w;if(l._optimisticResults){const ue=this.hasListeners(),Me=!ue&&Vv(n,l),ze=ue&&Kv(n,s,l,u);(Me||ze)&&(_={..._,...kb(v.data,n.options)}),l._optimisticResults==="isRestoring"&&(_.fetchStatus="idle")}let{error:E,errorUpdatedAt:j,status:H}=_;w=_.data;let I=!1;if(l.placeholderData!==void 0&&w===void 0&&H==="pending"){let ue;c?.isPlaceholderData&&l.placeholderData===f?.placeholderData?(ue=c.data,I=!0):ue=typeof l.placeholderData=="function"?l.placeholderData(this.#h?.state.data,this.#h):l.placeholderData,ue!==void 0&&(H="success",w=bh(c?.data,ue,l),x=!0)}if(l.select&&w!==void 0&&!I)if(c&&w===d?.data&&l.select===this.#c)w=this.#r;else try{this.#c=l.select,w=l.select(w),w=bh(c?.data,w,l),this.#r=w,this.#s=null}catch(ue){this.#s=ue}this.#s&&(E=this.#s,w=this.#r,j=Date.now(),H="error");const W=_.fetchStatus==="fetching",X=H==="pending",Q=H==="error",q=X&&W,ae=w!==void 0,ee={status:H,fetchStatus:_.fetchStatus,isPending:X,isSuccess:H==="success",isError:Q,isInitialLoading:q,isLoading:q,data:w,dataUpdatedAt:_.dataUpdatedAt,error:E,errorUpdatedAt:j,failureCount:_.fetchFailureCount,failureReason:_.fetchFailureReason,errorUpdateCount:_.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:_.dataUpdateCount>g.dataUpdateCount||_.errorUpdateCount>g.errorUpdateCount,isFetching:W,isRefetching:W&&!X,isLoadingError:Q&&!ae,isPaused:_.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:Q&&ae,isStale:im(n,l),refetch:this.refetch,promise:this.#u,isEnabled:hl(l.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const ue=ee.data!==void 0,Me=ee.status==="error"&&!ue,ze=ce=>{Me?ce.reject(ee.error):ue&&ce.resolve(ee.data)},te=()=>{const ce=this.#u=ee.promise=Sh();ze(ce)},be=this.#u;switch(be.status){case"pending":n.queryHash===s.queryHash&&ze(be);break;case"fulfilled":(Me||ee.data!==be.value)&&te();break;case"rejected":(!Me||ee.error!==be.reason)&&te();break}}return ee}updateResult(){const n=this.#l,l=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#i=this.options,this.#a.data!==void 0&&(this.#h=this.#t),vh(l,n))return;this.#l=l;const s=()=>{if(!n)return!0;const{notifyOnChangeProps:u}=this.options,c=typeof u=="function"?u():u;if(c==="all"||!c&&!this.#g.size)return!0;const d=new Set(c??this.#g);return this.options.throwOnError&&d.add("error"),Object.keys(this.#l).some(f=>{const m=f;return this.#l[m]!==n[m]&&d.has(m)})};this.#y({listeners:s()})}#m(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const l=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(l?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#y(n){Sn.batch(()=>{n.listeners&&this.listeners.forEach(l=>{l(this.#l)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function eA(n,l){return hl(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&hl(l.retryOnMount,n)===!1)}function Vv(n,l){return eA(n,l)||n.state.data!==void 0&&xh(n,l,l.refetchOnMount)}function xh(n,l,s){if(hl(l.enabled,n)!==!1&&wi(l.staleTime,n)!=="static"){const u=typeof s=="function"?s(n):s;return u==="always"||u!==!1&&im(n,l)}return!1}function Kv(n,l,s,u){return(n!==l||hl(u.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&im(n,s)}function im(n,l){return hl(l.enabled,n)!==!1&&n.isStaleByTime(wi(l.staleTime,n))}function tA(n,l){return!vh(n.getCurrentResult(),l)}var nA=class extends Ub{#e;#t;#n;#l;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||lA(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(l=>l!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(n){const l=()=>{this.#a({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=Rb({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(d,f)=>{this.#a({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#a({type:"pause"})},onContinue:l,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const u=this.state.status==="pending",c=!this.#l.canStart();try{if(u)l();else{this.#a({type:"pending",variables:n,isPaused:c}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,s);const f=await this.options.onMutate?.(n,s);f!==this.state.context&&this.#a({type:"pending",context:f,variables:n,isPaused:c})}const d=await this.#l.start();return await this.#n.config.onSuccess?.(d,n,this.state.context,this,s),await this.options.onSuccess?.(d,n,this.state.context,s),await this.#n.config.onSettled?.(d,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(d,null,n,this.state.context,s),this.#a({type:"success",data:d}),d}catch(d){try{await this.#n.config.onError?.(d,n,this.state.context,this,s)}catch(f){Promise.reject(f)}try{await this.options.onError?.(d,n,this.state.context,s)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,s)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,d,n,this.state.context,s)}catch(f){Promise.reject(f)}throw this.#a({type:"error",error:d}),d}finally{this.#n.runNext(this)}}#a(n){const l=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context)DELIM" +R"DELIM(,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=l(this.state),Sn.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function lA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var aA=class extends Hr{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(n,l,s){const u=new nA({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(l),state:s});return this.add(u),u}add(n){this.#e.add(n);const l=po(n);if(typeof l=="string"){const s=this.#t.get(l);s?s.push(n):this.#t.set(l,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const l=po(n);if(typeof l=="string"){const s=this.#t.get(l);if(s)if(s.length>1){const u=s.indexOf(n);u!==-1&&s.splice(u,1)}else s[0]===n&&this.#t.delete(l)}}this.notify({type:"removed",mutation:n})}canRun(n){const l=po(n);if(typeof l=="string"){const u=this.#t.get(l)?.find(c=>c.state.status==="pending");return!u||u===n}else return!0}runNext(n){const l=po(n);return typeof l=="string"?this.#t.get(l)?.find(u=>u!==n&&u.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Sn.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(n){const l={exact:!0,...n};return this.getAll().find(s=>Bv(l,s))}findAll(n={}){return this.getAll().filter(l=>Bv(n,l))}notify(n){Sn.batch(()=>{this.listeners.forEach(l=>{l(n)})})}resumePausedMutations(){const n=this.getAll().filter(l=>l.state.isPaused);return Sn.batch(()=>Promise.all(n.map(l=>l.continue().catch(In))))}};function po(n){return n.options.scope?.id}var iA=class extends Hr{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,l,s){const u=l.queryKey,c=l.queryHash??lm(u,l);let d=this.get(c);return d||(d=new I3({client:n,queryKey:u,queryHash:c,options:n.defaultQueryOptions(l),state:s,defaultOptions:n.getQueryDefaults(u)}),this.add(d)),d}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const l=this.#e.get(n.queryHash);l&&(n.destroy(),l===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Sn.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const l={exact:!0,...n};return this.getAll().find(s=>Hv(l,s))}findAll(n={}){const l=this.getAll();return Object.keys(n).length>0?l.filter(s=>Hv(n,s)):l}notify(n){Sn.batch(()=>{this.listeners.forEach(l=>{l(n)})})}onFocus(){Sn.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Sn.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},sA=class{#e;#t;#n;#l;#a;#i;#u;#s;constructor(n={}){this.#e=n.queryCache||new iA,this.#t=n.mutationCache||new aA,this.#n=n.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#u=nm.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Mo.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#u?.(),this.#u=void 0,this.#s?.(),this.#s=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const l=this.defaultQueryOptions({queryKey:n});return this.#e.get(l.queryHash)?.state.data}ensureQueryData(n){const l=this.defaultQueryOptions(n),s=this.#e.build(this,l),u=s.state.data;return u===void 0?this.fetchQuery(n):(n.revalidateIfStale&&s.isStaleByTime(wi(l.staleTime,s))&&this.prefetchQuery(l),Promise.resolve(u))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:l,state:s})=>{const u=s.data;return[l,u]})}setQueryData(n,l,s){const u=this.defaultQueryOptions({queryKey:n}),d=this.#e.get(u.queryHash)?.state.data,f=B3(l,d);if(f!==void 0)return this.#e.build(this,u).setData(f,{...s,manual:!0})}setQueriesData(n,l,s){return Sn.batch(()=>this.#e.findAll(n).map(({queryKey:u})=>[u,this.setQueryData(u,l,s)]))}getQueryState(n){const l=this.defaultQueryOptions({queryKey:n});return this.#e.get(l.queryHash)?.state}removeQueries(n){const l=this.#e;Sn.batch(()=>{l.findAll(n).forEach(s=>{l.remove(s)})})}resetQueries(n,l){const s=this.#e;return Sn.batch(()=>(s.findAll(n).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...n},l)))}cancelQueries(n,l={}){const s={revert:!0,...l},u=Sn.batch(()=>this.#e.findAll(n).map(c=>c.cancel(s)));return Promise.all(u).then(In).catch(In)}invalidateQueries(n,l={}){return Sn.batch(()=>(this.#e.findAll(n).forEach(s=>{s.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},l)))}refetchQueries(n,l={}){const s={...l,cancelRefetch:l.cancelRefetch??!0},u=Sn.batch(()=>this.#e.findAll(n).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let d=c.fetch(void 0,s);return s.throwOnError||(d=d.catch(In)),c.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(u).then(In)}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const s=this.#e.build(this,l);return s.isStaleByTime(wi(l.staleTime,s))?s.fetch(l):Promise.resolve(s.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(In).catch(In)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(In).catch(In)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Mo.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,l){this.#l.set(kr(n),{queryKey:n,defaultOptions:l})}getQueryDefaults(n){const l=[...this.#l.values()],s={};return l.forEach(u=>{vu(n,u.queryKey)&&Object.assign(s,u.defaultOptions)}),s}setMutationDefaults(n,l){this.#a.set(kr(n),{mutationKey:n,defaultOptions:l})}getMutationDefaults(n){const l=[...this.#a.values()],s={};return l.forEach(u=>{vu(n,u.mutationKey)&&Object.assign(s,u.defaultOptions)}),s}defaultQueryOptions(n){if(n._defaulted)return n;const l={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return l.queryHash||(l.queryHash=lm(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===am&&(l.enabled=!1),l}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Zb=ge.createContext(void 0),uA=n=>{const l=ge.useContext(Zb);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},rA=({client:n,children:l})=>(ge.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),S.jsx(Zb.Provider,{value:n,children:l})),Lb=ge.createContext(!1),cA=()=>ge.useContext(Lb);Lb.Provider;function oA(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var fA=ge.createContext(oA()),dA=()=>ge.useContext(fA),hA=(n,l,s)=>{const u=s?.state.error&&typeof n.throwOnError=="function"?Db(n.throwOnError,[s.state.error,s]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||u)&&(l.isReset()||(n.retryOnMount=!1))},mA=n=>{ge.useEffect(()=>{n.clearReset()},[n])},pA=({result:n,errorResetBoundary:l,)DELIM" +R"DELIM(throwOnError:s,query:u,suspense:c})=>n.isError&&!l.isReset()&&!n.isFetching&&u&&(c&&n.data===void 0||Db(s,[n.error,u])),gA=n=>{if(n.suspense){const s=c=>c==="static"?c:Math.max(c??1e3,1e3),u=n.staleTime;n.staleTime=typeof u=="function"?(...c)=>s(u(...c)):s(u),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},vA=(n,l)=>n.isLoading&&n.isFetching&&!l,yA=(n,l)=>n?.suspense&&l.isPending,Xv=(n,l,s)=>l.fetchOptimistic(n).catch(()=>{s.clearReset()});function bA(n,l,s){const u=cA(),c=dA(),d=uA(),f=d.defaultQueryOptions(n);d.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const m=d.getQueryCache().get(f.queryHash),g=n.subscribed!==!1;f._optimisticResults=u?"isRestoring":g?"optimistic":void 0,gA(f),hA(f,c,m),mA(c);const v=!d.getQueryCache().get(f.queryHash),[_]=ge.useState(()=>new l(d,f)),x=_.getOptimisticResult(f),w=!u&&g;if(ge.useSyncExternalStore(ge.useCallback(E=>{const j=w?_.subscribe(Sn.batchCalls(E)):In;return _.updateResult(),j},[_,w]),()=>_.getCurrentResult(),()=>_.getCurrentResult()),ge.useEffect(()=>{_.setOptions(f)},[f,_]),yA(f,x))throw Xv(f,_,c);if(pA({result:x,errorResetBoundary:c,throwOnError:f.throwOnError,query:m,suspense:f.suspense}))throw x.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(f,x),f.experimental_prefetchInRender&&!Zr.isServer()&&vA(x,u)&&(v?Xv(f,_,c):m?.promise)?.catch(In).finally(()=>{_.updateResult()}),f.notifyOnChangeProps?x:_.trackResult(x)}function Hb(n,l){return bA(n,P3)}const Jv={phase:"idle",attempt:0,reconnects:0,connectedAt:null,lastMessageAt:null,error:null};class Bb{#e;#t=Jv;#n=null;#l=new Set;#a=null;#i=null;#u=null;#s;#c=!1;constructor(l){this.#e={...l,connectTimeoutMs:l.connectTimeoutMs??5e3,retryMinimumMs:l.retryMinimumMs??1e3,retryMaximumMs:l.retryMaximumMs??3e4,heartbeatMs:l.heartbeatMs??24e4,jitterRatio:l.jitterRatio??.2,now:l.now??Date.now,random:l.random??Math.random,webSocketFactory:l.webSocketFactory??(s=>new WebSocket(s))},this.#s=this.#e.retryMinimumMs}getStatus=()=>this.#t;subscribeStatus=l=>(this.#l.add(l),()=>{this.#l.delete(l)});start(){this.#c||(this.#c=!0,this.#s=this.#e.retryMinimumMs,this.#r())}stop(){this.#c=!1,this.#g();const l=this.#n;if(this.#n=null,l)try{l.readyState===1&&this.#e.onBeforeStop?.(l),l.close()}catch{}this.#o(Jv)}send(l){if(this.#n?.readyState!==1)return!1;try{return this.#n.send(l),!0}catch{return!1}}#r(){if(!this.#c||this.#n)return;const l=this.#t.reconnects>0;this.#o({...this.#t,phase:l?"reconnecting":"connecting",attempt:this.#t.attempt+1,error:null});let s;try{s=this.#e.webSocketFactory(this.#e.url),this.#n=s}catch(u){this.#o({...this.#t,error:_A(u)}),this.#h();return}this.#a=setTimeout(()=>{if(this.#n===s){this.#o({...this.#t,error:"Connection timed out"});try{s.close()}catch{this.#n=null,this.#h()}}},this.#e.connectTimeoutMs),s.addEventListener("open",()=>{this.#n!==s||!this.#c||(this.#f(),this.#s=this.#e.retryMinimumMs,this.#o({...this.#t,phase:"connected",connectedAt:this.#e.now(),error:null}),this.#e.onOpen?.(s),this.#p(s))}),s.addEventListener("message",u=>{if(this.#n!==s||!this.#c)return;const c=SA(u.data);if(c===null)return;const d=this.#e.now();(this.#t.lastMessageAt===null||d-this.#t.lastMessageAt>=1e3)&&this.#o({...this.#t,lastMessageAt:d}),this.#e.onMessage(c)}),s.addEventListener("error",()=>{if(!(this.#n!==s||!this.#c)){this.#o({...this.#t,error:"WebSocket connection failed"});try{s.close()}catch{this.#n=null,this.#h()}}}),s.addEventListener("close",()=>{this.#n===s&&(this.#n=null,this.#f(),this.#d(),this.#c&&this.#h())})}#h(){if(!this.#c||this.#i)return;const l=1+(this.#e.random()*2-1)*this.#e.jitterRatio,s=Math.max(0,Math.round(this.#s*l));this.#s=Math.min(this.#s*2,this.#e.retryMaximumMs),this.#o({...this.#t,phase:"reconnecting",reconnects:this.#t.reconnects+1,connectedAt:null}),this.#i=setTimeout(()=>{this.#i=null,this.#r()},s)}#p(l){this.#d(),!(!this.#e.onHeartbeat||this.#e.heartbeatMs<=0)&&(this.#u=setInterval(()=>{this.#n===l&&l.readyState===1&&this.#e.onHeartbeat?.(l)},this.#e.heartbeatMs))}#f(){this.#a&&(clearTimeout(this.#a),this.#a=null)}#d(){this.#u&&(clearInterval(this.#u),this.#u=null)}#g(){this.#f(),this.#d(),this.#i&&(clearTimeout(this.#i),this.#i=null)}#o(l){this.#t=l;for(const s of this.#l)s()}}function SA(n){return typeof n=="string"?n:n instanceof ArrayBuffer?new TextDecoder().decode(n):null}function _A(n){return n instanceof Error?n.message:"Unable to create WebSocket"}class xA{#e;#t;#n=new Set;#l=new Set;#a;constructor(l,s={}){this.#e=s.logFilter??hE,this.#t=s.eventFilter??mE,this.#a=new Bb({url:ey(l),webSocketFactory:s.webSocketFactory,retryMinimumMs:s.retryMinimumMs,retryMaximumMs:s.retryMaximumMs,jitterRatio:s.jitterRatio,onOpen:u=>{this.#i(u)},onHeartbeat:u=>{this.#i(u)},onBeforeStop:u=>{u.send("/v1/log/subscribe?filter=0"),u.send("/v1/event/subscribe?filter=0")},onMessage:u=>{const c=yE(u);if(!c){for(const d of this.#l)d(u);return}for(const d of this.#n)d(c)}})}getStatus=()=>this.#a.getStatus();subscribeStatus=l=>this.#a.subscribeStatus(l);start(){this.#a.start()}stop(){this.#a.stop()}subscribeFrames(l){return this.#n.add(l),()=>{this.#n.delete(l)}}subscribeInvalidFrames(l){return this.#l.add(l),()=>{this.#l.delete(l)}}setFilters(l,s){this.#e=l,this.#t=s,this.#a.send(`/v1/log/subscribe?filter=${String(l)}`),this.#a.send(`/v1/event/subscribe?filter=${String(s)}`)}#i(l){l.send(`/v1/log/subscribe?filter=${String(this.#e)}`),l.send(`/v1/event/subscribe?filter=${String(this.#t)}`)}}const qb=ps({address:lu(),filter:lu(),turbo:lu(),witness:lu(),retarget:lu(),difficult:lu(),pruned:Ti().int().nonnegative()}),Gb=Ti().int().nonnegative();function zA(n){try{const l=JSON.parse(n),s=qb.safeParse(l);if(s.success)return{type:"configuration",payload:s.data};const u=Gb.safeParse(l);return u.success?{type:"top",payload:u.data}:null}catch{return null}}function Fv(n,l){return new URL(l,`${n.replace(/\/+$/u,"")}/`).toString()}async function Wv(n,l){const s=await fetch(n,{headers:{Accept:"application/json"},signal:l});if(!s.ok)throw new Error(`Native API request failed with status ${String(s.status)}`);return await s.json()}async function EA(n,l){const[s,u]=await Promise.all([Wv(Fv(n,"/v1/configuration?format=json"),l),Wv(Fv(n,"/v1/top?format=json"),l)]),c=qb.parse(s),d=Gb.parse(u);return{configuration:c,top:d,receivedAt:Date.now()}}const TA=15e3,wA={configuration:null,top:null,receivedAt:null,invalidFrames:0};class AA{#e=wA;#t=new Set;#n;#l;constructor(l,s={}){this.#l=s.now??Date.now,this.#n=new Bb({url:ey(l),webSocketFactory:s.webSocketFactory,retryMinimumMs:s.retryMinimumMs,retryMaximumMs:s.retryMaximumMs,jitterRatio:s.jitterRatio,heartbeatMs:s.topPollIntervalMs??TA,now:this.#l,onOpen:u=>{u.send("/v1/configuration?format=json"),u.send("/v1/top/subscribe?format=json")},onHeartbeat:u=>{u.send("/v1/top?format=json")},onBeforeStop:u=>{u.send("/v1/top/subscribe?format=json&stop=true")},onMessage:u=>{const c=zA(u);if(!c){this.#i({...this.#e,invalidFrames:this.#e.invalidFrames+1});return}this.#a(c)}})}getStatus=()=>this.#n.getStatus();subscribeStatus=l=>this.#n.subscribeStatus(l);getState=()=>this.#e;subscribeState=l=>(this.#t.add(l),()=>{this.#t.delete(l)});start(){this.#n.start()}stop(){this.#n.stop()}#a(l){const s=this.#l();this.#i(l.type==="top"?{...this.#e,top:l.payload,receivedAt:s}:{...this.#e,configuration:l.payload,receivedAt:s})}#i(l){this.#e=l;for(const s of this.#t)s()}}function MA(n,l){const s=ge.useMemo(()=>new xA(n),[n]),u=ge.useSyncExternalStore(s.subscribeStatus,s.getStatus,s.getStatus);return ge.useEffect(()=>{const c=s.subscribeFrames(f=>{l.ingest(f)}),d=s.subscribeInvalidFrames(()=>{l.recordInvalidFrame()});return s.start(),()=>{c(),d(),s.stop()}},[s,l]),u}function OA(n,l){const s=ge.useMemo(()=>new AA(n),[n]),u=ge.useMemo(()=>zS(n),[n]),c=ge.useSyncExternalStore(s.subscribeStatus,s.getStatus,s.getStatus),d=ge.useSyncExternalStore(s.subscribeState,s.getState,s.getState);ge.useEffect(()=>(s.start(),()=>{s.stop()}),[s]);const f=Hb({queryKey:["native-snapshot",n],queryFn:({signal:x})=>EA(n,x),ena)DELIM" +R"DELIM(bled:u&&c.phase!=="connected",refetchInterval:15e3,retry:!1}),m=d.top??f.data?.top??null,g=d.configuration??f.data?.configuration??null,v=d.receivedAt??f.data?.receivedAt??null,_=c.phase==="connected"&&(d.top!==null||d.configuration!==null)?"websocket":f.isSuccess?"rest":"none";return ge.useEffect(()=>{m!==null&&l.recordNativeTop(m,v??Date.now())},[l,v,m]),{status:c,live:d,top:m,configuration:g,receivedAt:v,transport:_,restError:f.error instanceof Error?f.error.message:null}}function NA(n){const l=Hb({queryKey:["reference-top",n],queryFn:({signal:s})=>JE(n,s),refetchInterval:VE});return{top:l.data?.top??null,receivedAt:l.data?.receivedAt??null,error:l.error instanceof Error?l.error.message:null}}const jA=[{id:"overview",label:"Overview"},{id:"logs",label:"Logs"},{id:"events",label:"Events"}];function DA(){const n=ge.useMemo(()=>new YE,[]),[l,s]=ge.useState(ES),[u,c]=ge.useState("overview"),[d,f]=ge.useState(!1),m=ge.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),g=MA(l.adminUrl,n),v=OA(l.nativeUrl,n),_=NA(l.referenceUrl);ge.useEffect(()=>(n.start(),()=>{n.stop()}),[n]);function x(E){TS(E),(E.adminUrl!==l.adminUrl||E.nativeUrl!==l.nativeUrl)&&n.reset(),s(E),f(!1)}function w(){wS();const E=ty();(E.adminUrl!==l.adminUrl||E.nativeUrl!==l.nativeUrl)&&n.reset(),s(E),f(!1)}return S.jsxs("div",{className:"bg-background text-textPrimary min-h-screen",children:[S.jsx("header",{className:"border-accent/25 bg-surface/95 sticky top-0 z-40 border-b backdrop-blur",children:S.jsx("div",{className:"mx-auto max-w-[96rem] px-4 sm:px-6",children:S.jsxs("div",{className:"flex min-h-16 flex-wrap items-center gap-x-6 gap-y-2 py-3",children:[S.jsxs("button",{type:"button",onClick:()=>{c("overview")},className:"mr-auto text-left",children:[S.jsx("p",{className:"text-accentSecondary text-[10px] font-medium tracking-[0.2em] uppercase",children:"Libbitcoin Server"}),S.jsx("h1",{className:"text-accent text-lg font-semibold tracking-tight",children:"Admin Dashboard"})]}),S.jsx("nav",{className:"order-3 flex w-full items-center gap-1 sm:order-none sm:w-auto",children:jA.map(E=>S.jsxs("button",{type:"button",onClick:()=>{c(E.id)},className:`rounded-lg px-3 py-2 text-sm transition ${u===E.id?"bg-accent/15 text-accent":"text-textMuted hover:text-textPrimary hover:bg-white/5"}`,children:[E.label,E.id==="logs"&&m.totalLogs>0&&S.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:m.totalLogs>999?"999+":String(m.totalLogs)}),E.id==="events"&&m.totalEvents>0&&S.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:m.totalEvents>999?"999+":String(m.totalEvents)})]},E.id))}),S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("div",{className:"hidden items-center gap-2 lg:flex","aria-label":"Connection summary",children:[S.jsx(Iv,{connected:g.phase==="connected",label:"Admin"}),S.jsx(Iv,{connected:v.transport!=="none",label:"Native"})]}),S.jsx("button",{type:"button",onClick:()=>{f(!0)},className:"border-accent/30 text-textMuted hover:border-accent hover:text-accent rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:"Endpoints"})]})]})})}),S.jsxs("main",{className:"mx-auto max-w-[96rem] min-w-0 px-4 py-8 sm:px-6",children:[u==="overview"&&S.jsx(C3,{adminStatus:g,endpoints:l,metrics:m,native:v,reference:_}),u==="logs"&&S.jsx(wE,{logs:m.recentLogs,onClear:()=>{n.clearLogs()}}),u==="events"&&S.jsx(TE,{events:m.recentEvents,onClear:()=>{n.clearEvents()}})]}),d&&S.jsx(AS,{configuration:l,onClose:()=>{f(!1)},onReset:w,onSave:x},`${l.adminUrl}|${l.nativeUrl}|${l.referenceUrl}`)]})}function Iv({connected:n,label:l}){return S.jsxs("span",{className:"text-textMuted inline-flex items-center gap-1.5 text-xs",children:[S.jsx("span",{className:`h-2 w-2 rounded-full ${n?"bg-emerald-400":"bg-amber-400"}`,"aria-hidden":"true"}),l]})}function CA({children:n}){const[l]=ge.useState(()=>new sA({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}));return S.jsxs(rA,{client:l,children:[n,null]})}const Yb=document.querySelector("#root");if(!Yb)throw new Error("Root element not found");bS.createRoot(Yb).render(S.jsx(fS.StrictMode,{children:S.jsx(CA,{children:S.jsx(DA,{})})})); )DELIM" )