diff --git a/console/embedded/admin_css.cpp b/console/embedded/admin_css.cpp index 9472cf97..05d15508 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;--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} +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-amber-950:oklch(27.9% .077 45.635);--color-emerald-200:oklch(90.5% .093 164.15);--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-emerald-950:oklch(26.2% .051 172.552);--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}@support)DELIM" +R"DELIM(s (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-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}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[60\]{z-index:60}.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:)DELIM" +R"DELIM(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)}.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\/35{border-color:#fcbb0059}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/35{border-color:color-mix(in oklab,var(--color-amber-400) 35%,transparent)}}.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-400\/35{border-color:#00d29459}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/35{border-color:color-mix(in oklab,var(--color-emerald-400) 35%,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-amber-950\/95{background-color:#461901f2}@supports (color:color-mix(in lab,red,red)){.bg-amber-950\/95{background-color:color-mix(in oklab,var(--color-amber-950) 95%,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}@su)DELIM" +R"DELIM(pports (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-emerald-950\/95{background-color:#002c22f2}@supports (color:color-mix(in lab,red,red)){.bg-emerald-950\/95{background-color:color-mix(in oklab,var(--color-emerald-950) 95%,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)}.leading-none{--tw-leading:1;line-height:1}.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)DELIM" +R"DELIM({color:var(--color-cyan-300)}.text-emerald-200{color:var(--color-emerald-200)}.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-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.text-white\/75{color:#ffffffbf}@supports (color:color-mix(in lab,red,red)){.text-white\/75{color:color-mix(in oklab,var(--color-white) 75%,transparent)}}.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, 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}.hover\:text-white:hover{color:var(--color-white)}}.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\:left-auto{left:auto}.sm\:order-none{order:0}.sm\:w-96{width:calc(var(--spacing) * 96)}.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})DELIM" +R"DELIM(@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{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 f8e16182..fe5ad3e8 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 l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))u(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"&&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{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 ty(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ld={exports:{}},xr={};var d0;function mS(){if(d0)return xr;d0=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 p in c)p!=="key"&&(d[p]=c[p])}else d=c;return c=d.ref,{$$typeof:n,type:u,key:f,ref:c!==void 0?c:null,props:d}}return xr.Fragment=l,xr.jsx=s,xr.jsxs=s,xr}var h0;function pS(){return h0||(h0=1,Ld.exports=mS()),Ld.exports}var S=pS(),Hd={exports:{}},Re={};var m0;function gS(){if(m0)return Re;m0=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"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),T=Symbol.iterator;function w(M){return M===null||typeof M!="object"?null:(M=T&&M[T]||M["@@iterator"],typeof M=="function"?M:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,$={};function W(M,L,G){this.props=M,this.context=L,this.refs=$,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 K(){}K.prototype=W.prototype;function V(M,L,G){this.props=M,this.context=L,this.refs=$,this.updater=G||j}var q=V.prototype=new K;q.constructor=V,H(q,W.prototype),q.isPureReactComponent=!0;var ae=Array.isArray;function te(){}var P={H:null,A:null,T:null,S:null},se=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 ne(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 he(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(te,te):(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,_e){var ge=typeof M;(ge==="undefined"||ge==="boolean")&&(M=null);var ve=!1;if(M===null)ve=!0;else switch(ge){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(M.$$typeof){case n:case l:ve=!0;break;case x:return ve=M._init,U(ve(M._payload),L,G,ie,_e)}}if(ve)return _e=_e(M),ve=ie===""?"."+Ee(M,0):ie,ae(_e)?(G="",ve!=null&&(G=ve.replace(ce,"$&/")+"/"),U(_e,L,G,"",function(nt){return nt})):_e!=null&&(ne(_e)&&(_e=ze(_e,G+(_e.key==null||M&&M.key===_e.key?"":(""+_e.key).replace(ce,"$&/")+"/")+ve)),L.push(_e)),1;ve=0;var mt=ie===""?".":ie+":";if(ae(M))for(var Ge=0;Ge>>1,Se=U[Ne];if(0>>1;Nec(G,pe))iec(_e,G)?(U[Ne]=_e,U[ie]=pe,Ne=ie):(U[Ne]=G,U[L]=pe,Ne=L);else if(iec(_e,pe))U[Ne]=_e,U[ie]=pe,Ne=ie;else break e}}return Y}function c(U,Y){var pe=U.sortIndex-Y.sortIndex;return pe!==0?pe: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,p=f.now();n.unstable_now=function(){return f.now()-p}}var g=[],v=[],x=1,_=null,T=3,w=!1,j=!1,H=!1,$=!1,W=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,V=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,te||(te=!0,be());else{var Y=s(v);Y!==null&&he(ae,Y.startTime-U)}}var te=!1,P=-1,se=5,Me=-1;function ze(){return $?!0:!(n.unstable_now()-MeU&&ze());){var Ne=_.callback;if(typeof Ne=="function"){_.callback=null,T=_.priorityLevel;var Se=Ne(_.expirationTime<=U);if(U=n.unstable_now(),typeof Se=="function"){_.callback=Se,q(U),Y=!0;break t}_===s(g)&&u(g),q(U)}else u(g);_=s(g)}if(_!==null)Y=!0;else{var M=s(v);M!==null&&he(ae,M.startTime-U),Y=!1}}break e}finally{_=null,T=pe,w=!1}Y=void 0}}finally{Y?be():te=!1}}}var be;if(typeof V=="function")be=function(){V(ne)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Ee=ce.port2;ce.port1.onmessage=ne,be=function(){Ee.postMessage(null)}}else be=function(){W(ne,0)};function he(U,Y){P=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||125Ne?(U.sortIndex=pe,l(v,U),s(g)===null&&U===s(v)&&(H?(K(P),P=-1):H=!0,he(ae,pe-Ne))):(U.sortIndex=Se,l(g,U),j||w||(j=!0,te||(te=!0,be()))),U},n.unstable_shouldYield=ze,n.unstable_wrapCallback=function(U){var Y=T;return function(){var pe=T;T=Y;try{return U.apply(this,arguments)}finally{T=pe}}}})($d)),$d}var v0;function bS(){return v0||(v0=1,qd.exports=yS()),qd.exports}var Gd={exports:{}},Nn={};var y0;function SS(){if(y0)return Nn;y0=1;var n=Eh();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=SS(),Gd.exports}var S0;function _S(){if(S0)return _r;S0=1;var n=bS(),l=Eh(),s=xS();function u(e){var t="https://react.dev/errors/"+e;if(1Se||(e.current=Ne[Se],Ne[Se]=null,Se--)}function G(e,t){Se++,Ne[Se]=e.current,e.current=t}var ie=M(null),_e=M(null),ge=M(null),ve=M(null);function mt(e,t){switch(G(ge,t),G(_e,e),G(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ug(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ug(t),e=kg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(ie),G(ie,e)}function Ge(){L(ie),L(_e),L(ge)}function nt(e){e.memoizedState!==null&&G(ve,e);var t=ie.current,a=kg(t,e.type);t!==a&&(G(_e,e),G(ie,a))}function On(e){_e.current===e&&(L(ie),L(_e)),ve.current===e&&(L(ve),vr._currentValue=pe)}var tl,jn;function _n(e){if(tl===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);tl=t&&t[1]||"",jn=-1)":-1r||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` +`);for(r=i=0;ir||A[i]!==k[r]){var Q=` +`+A[i].replace(" at new "," at ");return e.displayName&&Q.includes("")&&(Q=Q.replace("",e.displayName)),Q}while(1<=i&&0<=r);break}}}finally{Vl=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?_n(a):""}function Oi(e,t){switch(e.tag){case 26:case 27:case 5:return _n(e.type);case 16:return _n("Lazy");case 13:return e.child!==t&&t!==null?_n("Suspense Fallback"):_n("Suspense");case 19:return _n("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 _n("Activity");default:return""}}function ji(e){try{var t="",a=null;do t+=Oi(e,a),a=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+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(` +`+i.stack}}var Dl=Object.prototype.hasOwnProperty,Ft=n.unstable_scheduleCallback,Xl=n.unstable_cancelCallback,Cl=n.unstable_shouldYield,ra=n.unstable_requestPaint,we=n.unstable_now,oe=n.unstable_getCurrentPriorityLevel,lt=n.unstable_ImmediatePriority,Ot=n.unstable_UserBlockingPriority,Rl=n.unstable_NormalPriority,ca=n.unstable_LowPriority,nl=n.unstable_IdlePriority,oa=n.log,Dn=n.unstable_setDisableYieldValue,nn=null,rt=null;function Gt(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 8192:case 16384:case 32768:case 655)DELIM" +R"DELIM(36: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 $o(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 ll(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?ws(e,h,Cn(t)):a!=null?ws(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 Gr(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)){_s(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),_s(e)}function ws(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"),Ns=!1;if(wn)try{var Xa={};Object.defineProperty(Xa,"passive",{get:function(){Ns=!0}}),window.addEventListener("test",Xa,Xa),window.removeEventListener("test",Xa,Xa)}catch{Ns=!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 $i(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"||!Os&&$i(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=Oe(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=wn&&"documentMode"in document&&11>=document.documentMode,it=null,hn=null,Bt=null,Tn=!1;function Vn(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Tn||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],J);if(Xe===null){ye===null&&(ye=qe);break}e&&ye&&Xe.alternate===null&&t(D,ye),O=o(Xe,O,Ze),Ke===null?Te=Xe:Ke.sibling=Xe,Ke=Xe,ye=qe}if(Ze===R.length)return a(D,ye),Ye&&za(D,Ze),T)DELIM" +R"DELIM(e;if(ye===null){for(;ZeZe?(qe=ye,ye=null):qe=ye.sibling;var xi=Z(D,ye,Xe.value,J);if(xi===null){ye===null&&(ye=qe);break}e&&ye&&xi.alternate===null&&t(D,ye),O=o(xi,O,Ze),Ke===null?Te=xi:Ke.sibling=xi,Ke=xi,ye=qe}if(Xe.done)return a(D,ye),Ye&&za(D,Ze),Te;if(ye===null){for(;!Xe.done;Ze++,Xe=R.next())Xe=I(D,Xe.value,J),Xe!==null&&(O=o(Xe,O,Ze),Ke===null?Te=Xe:Ke.sibling=Xe,Ke=Xe);return Ye&&za(D,Ze),Te}for(ye=i(ye);!Xe.done;Ze++,Xe=R.next())Xe=B(ye,D,Ze,Xe.value,J),Xe!==null&&(e&&Xe.alternate!==null&&ye.delete(Xe.key===null?Ze:Xe.key),O=o(Xe,O,Ze),Ke===null?Te=Xe:Ke.sibling=Xe,Ke=Xe);return e&&ye.forEach(function(hS){return t(D,hS)}),Ye&&za(D,Ze),Te}function dt(D,O,R,J){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 w:e:{for(var Te=R.key;O!==null;){if(O.key===Te){if(Te=R.type,Te===H){if(O.tag===7){a(D,O.sibling),J=r(O,R.props.children),J.return=D,D=J;break e}}else if(O.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===se&&Fi(Te)===O.type){a(D,O.sibling),J=r(O,R.props),Xu(J,R),J.return=D,D=J;break e}a(D,O);break}else t(D,O);O=O.sibling}R.type===H?(J=Qi(R.props.children,D.mode,J,R.key),J.return=D,D=J):(J=rc(R.type,R.key,R.props,null,D.mode,J),Xu(J,R),J.return=D,D=J)}return h(D);case j:e:{for(Te=R.key;O!==null;){if(O.key===Te)if(O.tag===4&&O.stateNode.containerInfo===R.containerInfo&&O.stateNode.implementation===R.implementation){a(D,O.sibling),J=r(O,R.children||[]),J.return=D,D=J;break e}else{a(D,O);break}else t(D,O);O=O.sibling}J=tf(R,D.mode,J),J.return=D,D=J}return h(D);case se:return R=Fi(R),dt(D,O,R,J)}if(he(R))return me(D,O,R,J);if(be(R)){if(Te=be(R),typeof Te!="function")throw Error(u(150));return R=Te.call(R),je(D,O,R,J)}if(typeof R.then=="function")return dt(D,O,pc(R),J);if(R.$$typeof===V)return dt(D,O,fc(D,R),J);gc(D,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,O!==null&&O.tag===6?(a(D,O.sibling),J=r(O,R),J.return=D,D=J):(a(D,O),J=ef(R,D.mode,J),J.return=D,D=J),h(D)):a(D,O)}return function(D,O,R,J){try{Ku=0;var Te=dt(D,O,R,J);return Bs=null,Te}catch(ye){if(ye===Hs||ye===hc)throw ye;var Ke=sl(29,ye,null,D.mode);return Ke.lanes=J,Ke.return=D,Ke}}}var Ii=Tm(!0),Am=Tm(!1),ai=!1;function mf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pf(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),om(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 gf(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 vf=!1;function Fu(){if(vf){var e=Ls;if(e!==null)throw e}}function Wu(e,t,a,i){vf=!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 Q=e.alternate;Q!==null&&(Q=Q.updateQueue,b=Q.lastBaseUpdate,b!==h&&(b===null?Q.firstBaseUpdate=k:b.next=k,Q.lastBaseUpdate=A))}if(o!==null){var I=r.baseState;h=0,Q=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&&(vf=!0),Q!==null&&(Q=Q.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var me=e,je=b;Z=t;var dt=a;switch(je.tag){case 1:if(me=je.payload,typeof me=="function"){I=me.call(dt,I,Z);break e}I=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=je.payload,Z=typeof me=="function"?me.call(dt,I,Z):me,Z==null)break e;I=_({},I,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},Q===null?(k=Q=B,A=I):Q=Q.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);Q===null&&(A=I),r.baseState=A,r.firstBaseUpdate=k,r.lastBaseUpdate=Q,o===null&&(r.shared.lanes=0),fi|=h,e.lanes=h,e.memoizedState=I}}function Mm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Nm(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,kf(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 Q=n1(A,i);er(e,t,Q,fl(e))}else er(e,t,i,fl(e))}catch(I){er(e,t,{then:function(){},status:"rejected",reason:I},fl())}finally{Y.p=o,h!==null&&b.types!==null&&(h.types=b.types),U.T=h}}function r1(){}function Rf(e,t,a,i){if(e.tag!==5)throw Error(u(476));var r=up(e).queue;sp(e,r,t,pe,a===null?r1:function(){return rp(e),a(i)})}function up(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:pe},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 rp(e){var t=up(e);t.next===null&&(t=e.alternate.memoizedState),er(e,t.next.queue,{},fl())}function Uf(){return gn(vr)}function cp(){return $t().memoizedState}function op(){return $t().memoizedState}function c1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=fl();e=ii(a);var i=si(t,e,a);i!==null&&(In(i,t,a),Ju(i,t,a)),t={cache:of()},e.payload=t;return}t=t.return}}function o1(e,t,a){var i=fl();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Tc(e)?dp(t,a):(a=Io(e,t,a,i),a!==null&&(In(a,e,i),hp(a,t,i)))}function fp(e,t,a){var i=fl();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(Tc(e))dp(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=Io(e,t,r,i),a!==null)return In(a,e,i),hp(a,t,i),!0}return!1}function kf(e,t,a,i){if(i={lane:2,revertLane:md(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Tc(e)){if(t)throw Error(u(479))}else t=Io(e,a,i,2),t!==null&&In(t,e,2)}function Tc(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function dp(e,t){$s=bc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function hp(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:_c,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 mp={readContext:gn,use:_c,useCallback:function(e,t){return Ln().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:Wm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ec(4194308,4,tp.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){Gt(!0);try{e()}finally{Gt(!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){Gt(!0);try{a(t)}finally{Gt(!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=o1.bind(null,ke,e),[i.memoizedState,e]},useRef:function(e){var t=Ln();return e={current:e},t.memoizedState=e},useState:function(e){e=Nf(e);var t=e.queue,a=fp.bind(null,ke,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Df,useDeferredValue:function(e,t){var a=Ln();return Cf(a,e,t)},useTransition:function(){var e=Nf(!1);return e=sp.bind(null,ke,e.queue,!0,!1),Ln().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=ke,r=Ln();if(Ye){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),pt===null)throw Error(u(349));(Be&127)!==0||Um(i,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Wm(Zm.bind(null,i,o,e),[e]),i.flags|=2048,Ys(9,{destroy:void 0},km.bind(null,i,o,a,t),null),a},useId:function(){var e=Ln(),t=pt.identifierPrefix;if(Ye){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&&Na(t)}}return _t(t),Ff(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Na(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=ge.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||Cg(e.nodeValue,a)),e||ni(t,!0)}else e=Vc(e).createTextNode(i),e[Wt]=t,t.stateNode=e}return _t(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;_t(t),e=!1}else a=sf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(rl(t),t):(rl(t),null);if((t.flags&128)!==0)throw Error(u(558))}return _t(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 Error(u(318));if(r=t.memoizedState,r)DELIM" +R"DELIM(=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;_t(t),r=!1}else r=sf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(rl(t),t):(rl(t),null)}return rl(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),_t(t),null);case 4:return Ge(),e===null&&yd(t.stateNode.containerInfo),_t(t),null;case 10:return wa(t.type),_t(t),null;case 19:if(L(qt),i=t.memoizedState,i===null)return _t(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;)fm(a,e),a=a.sibling;return G(qt,qt.current&1|2),Ye&&za(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&we()>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 _t(t),null}else 2*we()-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=we(),e.sibling=null,a=qt.current,G(qt,r?a&1|2:a&1),Ye&&za(t,i.treeForkCount),e):(_t(t),null);case 22:case 23:return rl(t),bf(),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&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(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),wa(Qt),_t(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function p1(e,t){switch(lf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wa(Qt),Ge(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return On(t),null;case 31:if(t.memoizedState!==null){if(rl(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(rl(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 Ge(),null;case 10:return wa(t.type),null;case 22:case 23:return rl(t),bf(),e!==null&&L(Ji),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return wa(Qt),null;case 25:return null;default:return null}}function Lp(e,t){switch(lf(t),t.tag){case 3:wa(Qt),Ge();break;case 26:case 27:case 5:On(t);break;case 4:Ge();break;case 31:t.memoizedState!==null&&rl(t);break;case 13:rl(t);break;case 19:L(qt);break;case 10:wa(t.type);break;case 22:case 23:rl(t),bf(),e!==null&&L(Ji);break;case 24:wa(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(Q){ut(r,A,Q)}}}i=i.next}while(i!==o)}}catch(Q){ut(t,t.return,Q)}}function Hp(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Nm(t,a)}catch(i){ut(e,e.return,i)}}}function Bp(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 qp(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 Wf(e,t,a){try{var i=e.stateNode;Z1(i,e.type,a,t),i[En]=t}catch(r){ut(e,e.return,r)}}function $p(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&gi(e.type)||e.tag===4}function If(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$p(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 Pf(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(Pf(e,t,a),e=e.sibling;e!==null;)Pf(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 Gp(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 Oa=!1,Xt=!1,ed=!1,Yp=typeof WeakSet=="function"?WeakSet:Set,rn=null;function g1(e,t){if(e=e.containerInfo,xd=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,Q=0,I=e,Z=null;t:for(;;){for(var B;I!==a||r!==0&&I.nodeType!==3||(b=h+r),I!==o||i!==0&&I.nodeType!==3||(A=h+i),I.nodeType===3&&(h+=I.nodeValue.length),(B=I.firstChild)!==null;)Z=I,I=B;for(;;){if(I===e)break t;if(Z===a&&++k===r&&(b=h),Z===o&&++Q===i&&(A=h),(B=I.nextSibling)!==null)break;I=Z,Z=I.parentNode}I=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=Fg("link","href",r).get(i+(a.href||""));if(h){for(var b=0;bdt&&(h=dt,dt=je,je=h);var D=xe(b,je),O=xe(b,dt);if(D&&O&&(B.rangeCount!==1||B.anchorNode!==D.node||B.anchorOffset!==D.offset||B.focusNode!==O.node||B.focusOffset!==O.offset)){var R=I.createRange();R.setStart(D.node,D.offset),B.removeAllRanges(),je>dt?(B.addRange(R),B.extend(O.node,O.offset)):(R.setEnd(O.node,O.offset),B.addRange(R))}}}}for(I=[],B=b;B=B.parentNode;)B.nodeType===1&&I.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=ud,ud=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,tg(o.current),Ip(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,bg(e,t)}}function xg(e,t,a){t=xl(a,t),t=Bf(e.stateNode,t,2),e=si(e,t,2),e!==null&&(ll(e,2),sa(e))}function ut(e,t,a){if(e.tag===3)xg(e,e,a);else for(;t!==null;){if(t.tag===3){xg(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=xl(a,e),a=_p(2),i=si(t,a,2),i!==null&&(zp(a,i,t,e),ll(i,2),sa(i));break}}t=t.return}}function fd(e,t,a){var i=e.pingCache;if(i===null){i=e.pingCache=new b1;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)||(ld=!0,r.add(a),e=E1.bind(null,e,t,a),t.then(e,e))}function E1(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>we()-Uc?(We&2)===0&&Fs(e,0):ad|=a,Xs===Be&&(Xs=0)),sa(e)}function _g(e,t){t===0&&(t=Br()),e=Yi(e,t),e!==null&&(ll(e,t),sa(e))}function w1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),_g(e,a)}function T1(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),_g(e,a)}function A1(e,t){return Ft(e,t)}var $c=null,Is=null,dd=!1,Gc=!1,hd=!1,pi=0;function sa(e){e!==Is&&e.next===null&&(Is===null?$c=Is=e:Is=Is.next=e),Gc=!0,dd||(dd=!0,N1())}function fr(e,t){if(!hd&&Gc){hd=!0;do for(var a=!1,i=$c;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,Tg(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,Tg(i,o));i=i.next}while(a);hd=!1}}function M1(){zg()}function zg(){Gc=dd=!1;var e=0;pi!==0&&H1()&&(e=pi);for(var t=we(),a=null,i=$c;i!==null;){var r=i.next,o=Eg(i,t);o===0?(i.next=null,a===null?$c=r:a.next=r,r===null&&(Is=a)):(a=i,(e!==0||(o&3)!==0)&&(Gc=!0)),i=r}It!==0&&It!==5||fr(e),pi!==0&&(pi=0)}function Eg(e,t){for(var a=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0b)break;var Q=A.transferSize,I=A.initiatorType;Q&&Rg(I)&&(A=A.responseEnd,h+=Q*(A"u"?null:document;function Vg(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+'"]'),Qg.has(r)||(Qg.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 X1(e){ka.D(e),Vg("dns-prefetch",e,null)}function J1(e,t){ka.C(e,t),Vg("preconnect",e,t)}function F1(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=_({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 W1(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=_({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 I1(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=_({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Al.get(o))&&Nd(e,a);var A=h=i.createElement("link");Lt(A),yn(A,"link",e),A._p=new Promise(function(k,Q){A.onload=k,A.onerror=Q}),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 P1(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=_({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 eS(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=a.querySelector(gr(r)),o||(e=_({s)DELIM" +R"DELIM(rc: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 Kg(e,t,a,i){var r=(r=ge.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||tS(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 Xg(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function tS(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 Jg(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=_({},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=Xg(a),(r=Al.get(r))&&Nd(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=_({},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 nS(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 Ig(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function lS(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=Xg(i),(r=Al.get(r))&&Nd(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 jd=0;function aS(e,t){return e.stylesheets&&e.count===0&&Ic(e,e.stylesheets),0jd?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(iS,e),Wc=null,Fc.call(e))}function iS(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(),Bd.exports=_S(),Bd.exports}var ES=zS();const wS=ty(ES),ny="libbitcoinAdminDashboardBrowserNotifications";function ly(){try{return globalThis.window?.localStorage??null}catch{return null}}function wh(){const n=globalThis.Notification;return typeof n=="function"?n:null}function ay(){return wh()?.permission??"unsupported"}async function TS(){const n=wh();return n?n.permission!=="default"?n.permission:n.requestPermission():"unsupported"}function AS(n=ly()){try{return ay()==="granted"&&n?.getItem(ny)==="true"}catch{return!1}}function MS(n,l=ly()){try{l?.setItem(ny,String(n))}catch{}}function NS(n,l){const s=wh();if(!s||s.permission!=="granted")return!1;try{return new s(n,l),!0}catch{return!1}}const Th="libbitcoinAdminDashboardEndpoints",OS="https://blockstream.info/api";function Ah(){try{return globalThis.window?.localStorage??null}catch{return null}}function jS(){return globalThis.window?.location.origin??"http://localhost"}function $n(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 DS(n,l){return new URL(l.replace(/^\/+/u,""),`${$n(n)}/`).toString()}function iy(n){const l=new URL($n(n));return l.protocol=l.protocol==="https:"?"wss:":"ws:",l.pathname="/",l.search="",l.hash="",l.toString()}function CS(n,l=jS()){return new URL($n(n)).origin===new URL(l).origin}function sy(){return{adminUrl:$n("http://172.20.208.1:8080"),nativeUrl:$n("http://172.20.208.1:80"),referenceUrl:$n(OS)}}function RS(n=Ah()){const l=sy();try{const s=n?.getItem(Th);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"?$n(c.adminUrl):l.adminUrl,nativeUrl:typeof c.nativeUrl=="string"?$n(c.nativeUrl):l.nativeUrl,referenceUrl:typeof c.referenceUrl=="string"?$n(c.referenceUrl):l.referenceUrl}}catch{return l}}function US(n,l=Ah()){const s={adminUrl:$n(n.adminUrl),nativeUrl:$n(n.nativeUrl),referenceUrl:$n(n.referenceUrl)};try{l?.setItem(Th,JSON.stringify(s))}catch{}}function kS(n=Ah()){try{n?.removeItem(Th)}catch{}}function ZS({configuration:n,browserNotificationsEnabled:l,onClose:s,onBrowserNotificationsEnabledChange:u,onReset:c,onSave:d}){const[f,p]=fe.useState(n.adminUrl),[g,v]=fe.useState(n.nativeUrl),[x,_]=fe.useState(n.referenceUrl),[T,w]=fe.useState(null),[j,H]=fe.useState(ay),[$,W]=fe.useState(!1),[K,V]=fe.useState(null),q=l&&j==="granted";async function ae(){if(q){u(!1);return}W(!0),V(null);try{const P=await TS();H(P),P==="granted"?u(!0):P==="denied"&&V("Permission was denied. It can be changed in your browser settings.")}catch{V("The browser could not enable notifications.")}finally{W(!1)}}function te(P){P.preventDefault();try{d({adminUrl:$n(f),nativeUrl:$n(g),referenceUrl:$n(x)})}catch(se){w(se instanceof Error?se.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:P=>{P.target===P.currentTarget&&s()},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:s,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close endpoint settings",children:"×"})]}),S.jsxs("form",{onSubmit:te,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:f,onChange:P=>{p(P.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:g,onChange:P=>{v(P.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:x,onChange:P=>{_(P.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.jsxs("div",{className:"border-accent/20 bg-background/35 space-y-3 rounded-xl border p-4",children:[S.jsxs("div",{children:[S.jsx("h3",{className:"text-textPrimary text-sm font-medium",children:"Browser notifications"}),S.jsx("p",{id:"browser-notifications-help",className:"text-textMuted mt-1 text-xs",children:HS(j,q,$)})]}),S.jsx("button",{type:"button","aria-describedby":"browser-notifications-help",disabled:$||j==="unsupported"||j==="denied",onClick:()=>{ae()},className:"border-accent/30 text-textMuted hover:border-accent hover:text-accent rounded-lg border p)DELIM" +R"DELIM(x-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",children:LS(j,q,$)}),K&&S.jsx("p",{className:"text-sm text-red-300",role:"alert",children:K})]}),T&&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:T}),S.jsxs("div",{className:"flex flex-wrap justify-between gap-3 pt-2",children:[S.jsx("button",{type:"button",onClick:c,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:s,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"})]})]})]})]})})}function LS(n,l,s){return s?"Requesting permission…":n==="unsupported"?"Notifications unavailable":n==="denied"?"Blocked by browser":l?"Disable notifications":"Enable notifications"}function HS(n,l,s){return s?"Waiting for your browser permission choice.":n==="unsupported"?"This browser does not support system notifications.":n==="denied"?"Notifications are blocked. Allow them in your browser settings to enable this feature.":l?"System notifications will appear when the node enters or leaves the synchronized range.":"Get a system notification when the node enters or leaves the synchronized range."}var _0;function F(n,l,s){function u(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),l(p,g);const v=f.prototype,x=Object.keys(v);for(let _=0;_s?.Parent&&p instanceof s.Parent?!0:p?._zod?.traits?.has(n)}),Object.defineProperty(f,"name",{value:n}),f}class cu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class uy extends Error{constructor(l){super(`Encountered unidirectional transform during encode: ${l}`),this.name="ZodEncodeError"}}(_0=globalThis).__zod_globalConfig??(_0.__zod_globalConfig={});const Mh=globalThis.__zod_globalConfig;function fs(n){return Mh}function ry(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 th(n,l){return typeof l=="bigint"?l.toString():l}function Nh(n){return{get value(){{const l=n();return Object.defineProperty(this,"value",{value:l}),l}}}}function Oh(n){return n==null}function jh(n){const l=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;return n.slice(l,s)}function BS(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 $S=Nh(()=>{if(Mh.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 oy(n){return Dr(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const GS=new Set(["string","number","symbol"]);function du(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ni(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 YS(n){return Object.keys(n).filter(l=>n[l]._zod.optin==="optional"&&n[l]._zod.optout==="optional")}const QS={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 VS(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 p in l){if(!(p in s.shape))throw new Error(`Unrecognized key: "${p}"`);l[p]&&(f[p]=s.shape[p])}return ms(this,"shape",f),f},checks:[]});return Ni(n,d)}function KS(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 p in l){if(!(p in s.shape))throw new Error(`Unrecognized key: "${p}"`);l[p]&&delete f[p]}return ms(this,"shape",f),f},checks:[]});return Ni(n,d)}function XS(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 Ni(n,c)}function JS(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 Ni(n,s)}function FS(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 Ni(n,s)}function WS(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 p=l._zod.def.shape,g={...p};if(s)for(const v in s){if(!(v in p))throw new Error(`Unrecognized key: "${v}"`);s[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 ms(this,"shape",g),g},checks:[]});return Ni(l,f)}function IS(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 Ni(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,...p}=n;return p.path??(p.path=[]),p.message=u,l?.reportInput&&(p.input=f),p}function Dh(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 dy=(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,th,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},hy=F("$ZodError",dy),my=F("$ZodError",dy,{Parent:Error});function ex(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 tx(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(p=>u({issues:p},[...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 p=[...d,...f.path];if(p.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 p=new(c?.Err??n)(f.issues.map(g=>ds(g,d,fs())));throw cy(p,c?.callee),p}return f.value},Rh=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 p=new(c?.Err??n)(f.issues.map(g=>ds(g,d,fs())));throw cy(p,c?.callee),p}return f.value},No=n=>(l,s,u)=>{const c=u?{...u,async:!1}:{async:!1},d=l._zod.run({value:s,issues:[]},c);if(d instanceof Promise)throw new cu;return d.issues.length?{success:!1,error:new(n??hy)(d.issues.map(f=>ds(f,c,fs())))}:{success:!0,data:d.value}},nx=No(my),Oo=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}},lx=Oo(my),ax=n=>(l,s,u)=>{const c=u?{...u,direction:"backward"}:{direction:"backward"};return Ch(n)(l,s,c)},ix=n=>(l,s,u)=>Ch(n)(l,s,u),sx=n=>async(l,s,u)=>{const c=u?{...u,direction:"backward"}:{direction:"backward"};return Rh(n)(l,s,c)},ux=n=>async(l,s,u)=>Rh(n)(l,s,u),rx=n=>(l,s,u)=>{const c=u?{...u,direction:"backward"}:{direction:"backward"};return No(n)(l,s,c)},cx=n=>(l,s,u)=>No(n)(l,s,u),ox=n=>async(l,s,u)=>{const c=u?{...u,direction:"backward"}:{direction:"backward"};return Oo(n)(l,s,c)},fx=n=>async(l,s,u)=>Oo(n)(l,s,u),dx=/^[cC][0-9a-z]{6,}$/,hx=/^[0-9a-z]+$/,mx=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,px=/^[0-9a-vA-V]{20}$/,gx=/^[A-Za-z0-9]{27}$/,vx=/^[a-zA-Z0-9_-]{21}$/,yx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bx=/^([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})$/,w0=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)$/,Sx=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _x(){return new RegExp(xx,"u")}const zx=/^(?:(?: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])$/,Ex=/^(([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}|:))$/,wx=/^((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])$/,Tx=/^(([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])$/,Ax=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,py=/^[A-Za-z0-9_-]*$/,Mx=/^https?$/,Nx=/^\+[1-9]\d{6,14}$/,gy="(?:(?:\\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])))",Ox=new RegExp(`^${gy}$`);function vy(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 jx(n){return new RegExp(`^${vy(n)}$`)}function Dx(n){const l=vy({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(`^${gy}T(?:${u})$`)}const Cx=n=>{const l=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${l}$`)},Rx=/^-?\d+$/,Ux=/^-?\d+(?:\.\d+)?$/,kx=/^(?:true|false)$/i,Zx=/^[^A-Z]*$/,Lx=/^[^a-z]*$/,el=F("$ZodCheck",(n,l)=>{var s;n._zod??(n._zod={}),n._zod.def=l,(s=n._zod).onattach??(s.onattach=[])}),yy={number:"number",bigint:"bigint",object:"date"},by=F("$ZodCheckLessThan",(n,l)=>{el.init(n,l);const s=yy[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{el.init(n,l);const s=yy[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})}}),Hx=F("$ZodCheckMultipleOf",(n,l)=>{el.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):BS(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})}}),Bx=F("$ZodCheckNumberFormat",(n,l)=>{el.init(n,l),l.format=l.format||"float64";const s=l.format?.includes("int"),u=s?"int":"number",[c,d]=QS[l.format];n._zod.onattach.push(f=>{const p=f._zod.bag;p.format=l.format,p.minimum=c,p.maximum=d,s&&(p.pattern=Rx)}),n._zod.check=f=>{const p=f.value;if(s){if(!Number.isInteger(p)){f.issues.push({expected:u,format:l.format,code:"invalid_type",continue:!1,input:p,inst:n});return}if(!Number.isSafeInteger(p)){p>0?f.issues.push({i)DELIM" +R"DELIM(nput:p,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:p,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}}pd&&f.issues.push({origin:"number",input:p,code:"too_big",maximum:d,inclusive:!0,inst:n,continue:!l.abort})}}),qx=F("$ZodCheckMaxLength",(n,l)=>{var s;el.init(n,l),(s=n._zod.def).when??(s.when=u=>{const c=u.value;return!Oh(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=Dh(c);u.issues.push({origin:f,code:"too_big",maximum:l.maximum,inclusive:!0,input:c,inst:n,continue:!l.abort})}}),$x=F("$ZodCheckMinLength",(n,l)=>{var s;el.init(n,l),(s=n._zod.def).when??(s.when=u=>{const c=u.value;return!Oh(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=Dh(c);u.issues.push({origin:f,code:"too_small",minimum:l.minimum,inclusive:!0,input:c,inst:n,continue:!l.abort})}}),Gx=F("$ZodCheckLengthEquals",(n,l)=>{var s;el.init(n,l),(s=n._zod.def).when??(s.when=u=>{const c=u.value;return!Oh(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=Dh(c),p=d>l.length;u.issues.push({origin:f,...p?{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=F("$ZodCheckStringFormat",(n,l)=>{var s,u;el.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()}:{},inst:n,continue:!l.abort})}):(u=n._zod).check??(u.check=()=>{})}),Yx=F("$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})}}),Qx=F("$ZodCheckLowerCase",(n,l)=>{l.pattern??(l.pattern=Zx),jo.init(n,l)}),Vx=F("$ZodCheckUpperCase",(n,l)=>{l.pattern??(l.pattern=Lx),jo.init(n,l)}),Kx=F("$ZodCheckIncludes",(n,l)=>{el.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})}}),Xx=F("$ZodCheckStartsWith",(n,l)=>{el.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})}}),Jx=F("$ZodCheckEndsWith",(n,l)=>{el.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})}}),Fx=F("$ZodCheckOverwrite",(n,l)=>{el.init(n,l),n._zod.check=s=>{s.value=l.tx(s.value)}});class Wx{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(` +`))}}const Ix={major:4,minor:4,patch:3},kt=F("$ZodType",(n,l)=>{var s;n??(n={}),n._zod.def=l,n._zod.bag=n._zod.bag||{},n._zod.version=Ix;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,p,g)=>{let v=ru(f),x;for(const _ of p){if(_._zod.def.when){if(PS(f)||!_._zod.def.when(f))continue}else if(v)continue;const T=f.issues.length,w=_._zod.check(f);if(w instanceof Promise&&g?.async===!1)throw new cu;if(x||w instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await w,f.issues.length!==T&&(v||(v=ru(f,T)))});else{if(f.issues.length===T)continue;v||(v=ru(f,T))}}return x?x.then(()=>f):f},d=(f,p,g)=>{if(ru(f))return f.aborted=!0,f;const v=c(p,u,g);if(v instanceof Promise){if(g.async===!1)throw new cu;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 cu;return g.then(v=>c(v,u,p))}return c(g,u,p)}}ht(n,"~standard",()=>({validate:c=>{try{const d=nx(n,c);return d.success?{value:d.data}:{issues:d.error?.issues}}catch{return lx(n,c).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),Uh=F("$ZodString",(n,l)=>{kt.init(n,l),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??Cx(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}}),Tt=F("$ZodStringFormat",(n,l)=>{jo.init(n,l),Uh.init(n,l)}),Px=F("$ZodGUID",(n,l)=>{l.pattern??(l.pattern=bx),Tt.init(n,l)}),e_=F("$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=w0(u))}else l.pattern??(l.pattern=w0());Tt.init(n,l)}),t_=F("$ZodEmail",(n,l)=>{l.pattern??(l.pattern=Sx),Tt.init(n,l)}),n_=F("$ZodURL",(n,l)=>{Tt.init(n,l),n._zod.check=s=>{try{const u=s.value.trim();if(!l.normalize&&l.protocol?.source===Mx.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})}}}),l_=F("$ZodEmoji",(n,l)=>{l.pattern??(l.pattern=_x()),Tt.init(n,l)}),a_=F("$ZodNanoID",(n,l)=>{l.pattern??(l.pattern=vx),Tt.init(n,l)}),i_=F("$ZodCUID",(n,l)=>{l.pattern??()DELIM" +R"DELIM(l.pattern=dx),Tt.init(n,l)}),s_=F("$ZodCUID2",(n,l)=>{l.pattern??(l.pattern=hx),Tt.init(n,l)}),u_=F("$ZodULID",(n,l)=>{l.pattern??(l.pattern=mx),Tt.init(n,l)}),r_=F("$ZodXID",(n,l)=>{l.pattern??(l.pattern=px),Tt.init(n,l)}),c_=F("$ZodKSUID",(n,l)=>{l.pattern??(l.pattern=gx),Tt.init(n,l)}),o_=F("$ZodISODateTime",(n,l)=>{l.pattern??(l.pattern=Dx(l)),Tt.init(n,l)}),f_=F("$ZodISODate",(n,l)=>{l.pattern??(l.pattern=Ox),Tt.init(n,l)}),d_=F("$ZodISOTime",(n,l)=>{l.pattern??(l.pattern=jx(l)),Tt.init(n,l)}),h_=F("$ZodISODuration",(n,l)=>{l.pattern??(l.pattern=yx),Tt.init(n,l)}),m_=F("$ZodIPv4",(n,l)=>{l.pattern??(l.pattern=zx),Tt.init(n,l),n._zod.bag.format="ipv4"}),p_=F("$ZodIPv6",(n,l)=>{l.pattern??(l.pattern=Ex),Tt.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})}}}),g_=F("$ZodCIDRv4",(n,l)=>{l.pattern??(l.pattern=wx),Tt.init(n,l)}),v_=F("$ZodCIDRv6",(n,l)=>{l.pattern??(l.pattern=Tx),Tt.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 xy(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const y_=F("$ZodBase64",(n,l)=>{l.pattern??(l.pattern=Ax),Tt.init(n,l),n._zod.bag.contentEncoding="base64",n._zod.check=s=>{xy(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:n,continue:!l.abort})}});function b_(n){if(!py.test(n))return!1;const l=n.replace(/[-_]/g,u=>u==="-"?"+":"/"),s=l.padEnd(Math.ceil(l.length/4)*4,"=");return xy(s)}const S_=F("$ZodBase64URL",(n,l)=>{l.pattern??(l.pattern=py),Tt.init(n,l),n._zod.bag.contentEncoding="base64url",n._zod.check=s=>{b_(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:n,continue:!l.abort})}}),x_=F("$ZodE164",(n,l)=>{l.pattern??(l.pattern=Nx),Tt.init(n,l)});function __(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}}const z_=F("$ZodJWT",(n,l)=>{Tt.init(n,l),n._zod.check=s=>{__(s.value,l.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:n,continue:!l.abort})}}),_y=F("$ZodNumber",(n,l)=>{kt.init(n,l),n._zod.pattern=n._zod.bag.pattern??Ux,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}}),E_=F("$ZodNumberFormat",(n,l)=>{Bx.init(n,l),_y.init(n,l)}),w_=F("$ZodBoolean",(n,l)=>{kt.init(n,l),n._zod.pattern=kx,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}}),T_=F("$ZodUnknown",(n,l)=>{kt.init(n,l),n._zod.parse=s=>s}),A_=F("$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 T0(n,l,s){n.issues.length&&l.issues.push(...fy(s,n.issues)),l.value[s]=n.value}const M_=F("$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;fT0(v,s,f))):T0(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(...fy(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 zy(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=YS(n.shape);return{...n,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(s)}}function Ey(n,l,s,u,c,d){const f=[],p=c.keySet,g=c.catchall._zod,v=g.def.type,x=g.optin==="optional",_=g.optout==="optional";for(const T in l){if(T==="__proto__"||p.has(T))continue;if(v==="never"){f.push(T);continue}const w=g.run({value:l[T],issues:[]},u);w instanceof Promise?n.push(w.then(j=>So(j,s,T,l,x,_))):So(w,s,T,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 N_=F("$ZodObject",(n,l)=>{if(kt.init(n,l),!Object.getOwnPropertyDescriptor(l,"shape")?.get){const p=l.shape;Object.defineProperty(l,"shape",{get:()=>{const g={...p};return Object.defineProperty(l,"shape",{value:g}),g}})}const u=Nh(()=>zy(l));ht(n._zod,"propValues",()=>{const p=l.shape,g={};for(const v in p){const x=p[v]._zod;if(x.values){g[v]??(g[v]=new Set);for(const _ of x.values)g[v].add(_)}}return g});const c=bo,d=l.catchall;let f;n._zod.parse=(p,g)=>{f??(f=u.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=[],_=f.shape;for(const T of f.keys){const w=_[T],j=w._zod.optin==="optional",H=w._zod.optout==="optional",$=w._zod.run({value:v[T],issues:[]},g);$ instanceof Promise?x.push($.then(W=>So(W,p,T,v,j,H))):So($,p,T,v,j,H)}return d?Ey(x,v,p,g,u.value,n):x.length?Promise.all(x).then(()=>p):p}}),O_=F("$ZodObjectJIT",(n,l)=>{N_.init(n,l);const s=n._zod.parse,u=Nh(()=>zy(l)),c=T=>{const w=new Wx(["shape","payload","ctx"]),j=u.value,H=V=>{const q=E0(V);return`shape[${q}]._zod.run({ value: input[${q}], issues: [] }, ctx)`};w.write("const input = payload.value;");const $=Object.create(null);let W=0;for(const V of j.keys)$[V]=`key_${W++}`;w.write("const newResult = {};");for(const V of j.keys){const q=$[V],ae=E0(V),te=T[V],P=te?._zod?.optin==="optional",se=te?._zod?.optout==="optional";w.write(`const ${q} = ${H(V)};`),P&&se?w.write(` if (${q}.issues.length) { if (${ae} in input) { payload.issues = payload.issues.concat(${q}.issues.map(iss => ({ @@ -79,7 +79,7 @@ R"DELIM(nst fx=J("$ZodJWT",(n,l)=>{wt.init(n,l),n._zod.check=s=>{ox(s.value,l.al newResult[${ae}] = ${q}.value; } - `):ee?E.write(` + `):P?w.write(` if (${q}.issues.length) { payload.issues = payload.issues.concat(${q}.issues.map(iss => ({ ...iss, @@ -95,7 +95,7 @@ R"DELIM(nst fx=J("$ZodJWT",(n,l)=>{wt.init(n,l),n._zod.check=s=>{ox(s.value,l.al newResult[${ae}] = ${q}.value; } - `):E.write(` + `):w.write(` const ${q}_present = ${ae} in input; if (${q}.issues.length) { payload.issues = payload.issues.concat(${q}.issues.map(iss => ({ @@ -116,39 +116,40 @@ R"DELIM(nst fx=J("$ZodJWT",(n,l)=>{wt.init(n,l),n._zod.check=s=>{ox(s.value,l.al if (${q}.value === undefined) { newResult[${ae}] = undefined; } else { - newResult[${ae}] = ${q}.value; + n)DELIM" +R"DELIM(ewResult[${ae}] = ${q}.value; } } - `)}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("/")}/ + `)}w.write("payload.value = newResult;"),w.write("return payload;");const K=w.compile();return(V,q)=>K(T,V,q)};let d;const f=bo,p=!Mh.jitless,v=p&&$S.value,x=l.catchall;let _;n._zod.parse=(T,w)=>{_??(_=u.value);const j=T.value;return f(j)?p&&v&&w?.async===!1&&w.jitless!==!0?(d||(d=c(l.shape)),T=d(T,w),x?Ey([],j,T,w,_,n):T):s(T,w):(T.issues.push({expected:"object",code:"invalid_type",input:j,inst:n}),T)}});function A0(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 j_=F("$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=>jh(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 p of l.options){const g=p._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(p=>A0(p,u,n,c)):A0(f,u,n,c)}}),D_=F("$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])=>M0(s,g,v)):M0(s,d,f)}});function nh(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=nh(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;up.l&&p.r).map(([p])=>p);if(d.length&&c&&n.issues.push({...c,keys:d}),ru(n))return n;const f=nh(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 C_=F("$ZodEnum",(n,l)=>{kt.init(n,l);const s=ry(l.entries),u=new Set(s);n._zod.values=u,n._zod.pattern=new RegExp(`^(${s.filter(c=>GS.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}}),R_=F("$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}}),U_=F("$ZodTransform",(n,l)=>{kt.init(n,l),n._zod.optin="optional",n._zod.parse=(s,u)=>{if(u.direction==="backward")throw new uy(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 N0(n,l){return l===void 0&&(n.issues.length||n.fallback)?{issues:[],value:void 0}:n}const wy=F("$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(`^(${jh(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=>N0(f,c)):N0(d,c)}return s.value===void 0?s:l.innerType._zod.run(s,u)}}),k_=F("$ZodExactOptional",(n,l)=>{wy.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)}),Z_=F("$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(`^(${jh(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)}),L_=F("$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=>O0(d,l)):O0(c,l)}});function O0(n,l){return n.value===void 0&&(n.value=l.defaultValue),n}const H_=F("$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))}),B_=F("$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=>j0(d,n)):j0(c,n)}});function j0(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 q_=F("$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)}}),$_=F("$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 G_=F("$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==="b)DELIM" +R"DELIM(ackward")return l.innerType._zod.run(s,u);const c=l.innerType._zod.run(s,u);return c instanceof Promise?c.then(D0):D0(c)}});function D0(n){return n.value=Object.freeze(n.value),n}const Y_=F("$ZodCustom",(n,l)=>{el.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=>C0(d,s,u,n));C0(c,s,u,n)}});function C0(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 R0;class Q_{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 V_(){return new Q_}(R0=globalThis).__zod_globalRegistry??(R0.__zod_globalRegistry=V_());const wr=globalThis.__zod_globalRegistry;function K_(n,l){return new n({type:"string",...Ae(l)})}function X_(n,l){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Ae(l)})}function U0(n,l){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(l)})}function J_(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(l)})}function F_(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(l)})}function W_(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(l)})}function I_(n,l){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(l)})}function P_(n,l){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Ae(l)})}function e2(n,l){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(l)})}function t2(n,l){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(l)})}function n2(n,l){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(l)})}function l2(n,l){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(l)})}function a2(n,l){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(l)})}function i2(n,l){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(l)})}function s2(n,l){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(l)})}function u2(n,l){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(l)})}function r2(n,l){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(l)})}function c2(n,l){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(l)})}function o2(n,l){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(l)})}function f2(n,l){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(l)})}function d2(n,l){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(l)})}function h2(n,l){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(l)})}function m2(n,l){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(l)})}function p2(n,l){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(l)})}function g2(n,l){return new n({type:"string",format:"date",check:"string_format",...Ae(l)})}function v2(n,l){return new n({type:"string",format:"time",check:"string_format",precision:null,...Ae(l)})}function y2(n,l){return new n({type:"string",format:"duration",check:"string_format",...Ae(l)})}function b2(n,l){return new n({type:"number",checks:[],...Ae(l)})}function S2(n,l){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(l)})}function x2(n,l){return new n({type:"boolean",...Ae(l)})}function _2(n){return new n({type:"unknown"})}function z2(n,l){return new n({type:"never",...Ae(l)})}function k0(n,l){return new by({check:"less_than",...Ae(l),value:n,inclusive:!1})}function Yd(n,l){return new by({check:"less_than",...Ae(l),value:n,inclusive:!0})}function Z0(n,l){return new Sy({check:"greater_than",...Ae(l),value:n,inclusive:!1})}function Qd(n,l){return new Sy({check:"greater_than",...Ae(l),value:n,inclusive:!0})}function L0(n,l){return new Hx({check:"multiple_of",...Ae(l),value:n})}function Ty(n,l){return new qx({check:"max_length",...Ae(l),maximum:n})}function xo(n,l){return new $x({check:"min_length",...Ae(l),minimum:n})}function Ay(n,l){return new Gx({check:"length_equals",...Ae(l),length:n})}function E2(n,l){return new Yx({check:"string_format",format:"regex",...Ae(l),pattern:n})}function w2(n){return new Qx({check:"string_format",format:"lowercase",...Ae(n)})}function T2(n){return new Vx({check:"string_format",format:"uppercase",...Ae(n)})}function A2(n,l){return new Kx({check:"string_format",format:"includes",...Ae(l),includes:n})}function M2(n,l){return new Xx({check:"string_format",format:"starts_with",...Ae(l),prefix:n})}function N2(n,l){return new Jx({check:"string_format",format:"ends_with",...Ae(l),suffix:n})}function yu(n){return new Fx({check:"overwrite",tx:n})}function O2(n){return yu(l=>l.normalize(n))}function j2(){return yu(n=>n.trim())}function D2(){return yu(n=>n.toLowerCase())}function C2(){return yu(n=>n.toUpperCase())}function R2(){return yu(n=>qS(n))}function U2(n,l,s){return new n({type:"array",element:l,...Ae(s)})}function k2(n,l,s){return new n({type:"custom",check:"custom",fn:l,...Ae(s)})}function Z2(n,l){const s=L2(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 L2(n,l){const s=new el({check:"custom",...Ae(l)});return s._zod.check=n,s}function My(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??wr,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 xn(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 p=n._zod.toJSONSchema?.();if(p)f.schema=p;else{const x={...s,schemaPath:[...s.schemaPath,n],path:s.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(l,f.schema,x);else{const T=f.schema,w=l.processors[c.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${c.type}`);w(n,l,T,x)}const _=n._zod.parent;_&&(f.ref||(f.ref=_),xn(_,l,x),l.seen.get(_).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 Ny(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 p=n.metadataRegistry.get(f[0])?.id;if(p){const g=u.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 )DELIM" +R"DELIM(together.`);u.set(p,f[0])}}const c=f=>{const p=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const _=n.external.registry.get(f[0])?.id,T=n.external.uri??(j=>j);if(_)return{ref:T(_)};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]===s)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 _ in x)delete x[_];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("/")}/ -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,{})})})); +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of n.seen.entries()){const p=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(p.cycle){d(f);continue}if(p.count>1&&n.reused==="ref"){d(f);continue}}}function Oy(n,l){const s=n.seen.get(l);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const u=p=>{const g=n.seen.get(p);if(g.ref===null)return;const v=g.def??g.schema,x={...v},_=g.ref;if(g.ref=null,_){u(_);const w=n.seen.get(_),j=w.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,x),p._zod.parent===_)for(const $ in v)$==="$ref"||$==="allOf"||$ in x||delete v[$];if(j.$ref&&w.def)for(const $ in v)$==="$ref"||$==="allOf"||$ in w.def&&JSON.stringify(v[$])===JSON.stringify(w.def[$])&&delete v[$]}const T=p._zod.parent;if(T&&T!==_){u(T);const w=n.seen.get(T);if(w?.schema.$ref&&(v.$ref=w.schema.$ref,w.def))for(const j in v)j==="$ref"||j==="allOf"||j in w.def&&JSON.stringify(v[j])===JSON.stringify(w.def[j])&&delete v[j]}n.override({zodSchema:p,jsonSchema:v,path:g.path??[]})};for(const p of[...n.seen.entries()].reverse())u(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(l)?.id;if(!p)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(p)}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 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:{...l["~standard"],jsonSchema:{input:_o(l,"input",n.processors),output:_o(l,"output",n.processors)}},enumerable:!1,writable:!1}),p}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 H2=(n,l={})=>s=>{const u=My({...s,processors:l});return xn(n,u),Ny(u,n),Oy(u,n)},_o=(n,l,s={})=>u=>{const{libraryOptions:c,target:d}=u??{},f=My({...c??{},target:d,io:l,processors:s});return xn(n,f),Ny(f,n),Oy(f,n)},B2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},q2=(n,l,s,u)=>{const c=s;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=B2[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(_=>({...l.target==="draft-07"||l.target==="draft-04"||l.target==="openapi-3.0"?{type:"string"}:{},pattern:_.source}))])}},$2=(n,l,s,u)=>{const c=s,{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 _=typeof x=="number"&&x>=(d??Number.NEGATIVE_INFINITY),T=typeof v=="number"&&v<=(f??Number.POSITIVE_INFINITY),w=l.target==="draft-04"||l.target==="openapi-3.0";_?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)},G2=(n,l,s,u)=>{s.type="boolean"},Y2=(n,l,s,u)=>{s.not={}},Q2=(n,l,s,u)=>{},V2=(n,l,s,u)=>{const c=n._zod.def,d=ry(c.entries);d.every(f=>typeof f=="number")&&(s.type="number"),d.every(f=>typeof f=="string")&&(s.type="string"),s.enum=d},K2=(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},X2=(n,l,s,u)=>{if(l.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},J2=(n,l,s,u)=>{if(l.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},F2=(n,l,s,u)=>{const c=s,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=xn(d.element,l,{...u,path:[...u.path,"items"]})},W2=(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]=xn(f[v],l,{...u,path:[...u.path,"properties",v]});const p=new Set(Object.keys(f)),g=new Set([...p].filter(v=>{const x=d.shape[v]._zod;return l.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=xn(d.catchall,l,{...u,path:[...u.path,"additionalProperties"]})):l.io==="output"&&(c.additionalProperties=!1)},I2=(n,l,s,u)=>{const c=n._zod.def,d=c.inclusive===!1,f=c.options.map((p,g)=>xn(p,l,{...u,path:[...u.path,d?"oneOf":"anyOf",g]}));d?s.oneOf=f:s.anyOf=f},P2=(n,l,s,u)=>{const c=n._zod.def,d=xn(c.left,l,{...u,path:[...u.path,"allOf",0]}),f=xn(c.right,l,{...u,path:[...u.path,"allOf",1]}),p=v=>"allOf"in v&&Object.keys(v).length===1,g=[...p(d)?d.allOf:[d],...p(f)?f.allOf:[f]];s.allOf=g},ez=(n,l,s,u)=>{const c=n._zod.def,d=xn(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"}]},tz=(n,l,s,u)=>{const c=n._zod.def;xn(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.inn)DELIM" +R"DELIM(erType},nz=(n,l,s,u)=>{const c=n._zod.def;xn(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.innerType,s.default=JSON.parse(JSON.stringify(c.defaultValue))},lz=(n,l,s,u)=>{const c=n._zod.def;xn(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)))},az=(n,l,s,u)=>{const c=n._zod.def;xn(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},iz=(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;xn(f,l,u);const p=l.seen.get(n);p.ref=f},sz=(n,l,s,u)=>{const c=n._zod.def;xn(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.innerType,s.readOnly=!0},jy=(n,l,s,u)=>{const c=n._zod.def;xn(c.innerType,l,u);const d=l.seen.get(n);d.ref=c.innerType},uz=F("ZodISODateTime",(n,l)=>{o_.init(n,l),Nt.init(n,l)});function rz(n){return p2(uz,n)}const cz=F("ZodISODate",(n,l)=>{f_.init(n,l),Nt.init(n,l)});function oz(n){return g2(cz,n)}const fz=F("ZodISOTime",(n,l)=>{d_.init(n,l),Nt.init(n,l)});function dz(n){return v2(fz,n)}const hz=F("ZodISODuration",(n,l)=>{h_.init(n,l),Nt.init(n,l)});function mz(n){return y2(hz,n)}const pz=(n,l)=>{hy.init(n,l),n.name="ZodError",Object.defineProperties(n,{format:{value:s=>tx(n,s)},flatten:{value:s=>ex(n,s)},addIssue:{value:s=>{n.issues.push(s),n.message=JSON.stringify(n.issues,th,2)}},addIssues:{value:s=>{n.issues.push(...s),n.message=JSON.stringify(n.issues,th,2)}},isEmpty:{get(){return n.issues.length===0}}})},jl=F("ZodError",pz,{Parent:Error}),gz=Ch(jl),vz=Rh(jl),yz=No(jl),bz=Oo(jl),Sz=ax(jl),xz=ix(jl),_z=sx(jl),zz=ux(jl),Ez=rx(jl),wz=cx(jl),Tz=ox(jl),Az=fx(jl),H0=new WeakMap;function Lr(n,l,s){const u=Object.getPrototypeOf(n);let c=H0.get(u);if(c||(c=new Set,H0.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 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=F("ZodType",(n,l)=>(kt.init(n,l),Object.assign(n["~standard"],{jsonSchema:{input:_o(n,"input"),output:_o(n,"output")}}),n.toJSONSchema=H2(n,{}),n.def=l,n.type=l.type,Object.defineProperty(n,"_def",{value:l}),n.parse=(s,u)=>gz(n,s,u,{callee:n.parse}),n.safeParse=(s,u)=>yz(n,s,u),n.parseAsync=async(s,u)=>vz(n,s,u,{callee:n.parseAsync}),n.safeParseAsync=async(s,u)=>bz(n,s,u),n.spa=n.safeParseAsync,n.encode=(s,u)=>Sz(n,s,u),n.decode=(s,u)=>xz(n,s,u),n.encodeAsync=async(s,u)=>_z(n,s,u),n.decodeAsync=async(s,u)=>zz(n,s,u),n.safeEncode=(s,u)=>Ez(n,s,u),n.safeDecode=(s,u)=>wz(n,s,u),n.safeEncodeAsync=async(s,u)=>Tz(n,s,u),n.safeDecodeAsync=async(s,u)=>Az(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 Ni(this,s,u)},brand(){return this},register(s,u){return s.add(this,u),this},refine(s,u){return this.check(bE(s,u))},superRefine(s,u){return this.check(SE(s,u))},overwrite(s){return this.check(yu(s))},optional(){return G0(this)},exactOptional(){return sE(this)},nullable(){return Y0(this)},nullish(){return G0(Y0(this))},nonoptional(s){return dE(this,s)},array(){return kh(this)},or(s){return Zh([this,s])},and(s){return tE(this,s)},transform(s){return Q0(this,aE(s))},default(s){return cE(this,s)},prefault(s){return fE(this,s)},catch(s){return mE(this,s)},pipe(s){return Q0(this,s)},readonly(){return vE(this)},describe(s){const u=this.clone();return wr.add(u,{description:s}),u},meta(...s){if(s.length===0)return wr.get(this);const u=this.clone();return wr.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 wr.get(n)?.description},configurable:!0}),n)),Dy=F("_ZodString",(n,l)=>{Uh.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(u,c,d)=>q2(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(E2(...u))},includes(...u){return this.check(A2(...u))},startsWith(...u){return this.check(M2(...u))},endsWith(...u){return this.check(N2(...u))},min(...u){return this.check(xo(...u))},max(...u){return this.check(Ty(...u))},length(...u){return this.check(Ay(...u))},nonempty(...u){return this.check(xo(1,...u))},lowercase(u){return this.check(w2(u))},uppercase(u){return this.check(T2(u))},trim(){return this.check(j2())},normalize(...u){return this.check(O2(...u))},toLowerCase(){return this.check(D2())},toUpperCase(){return this.check(C2())},slugify(){return this.check(R2())}})}),Mz=F("ZodString",(n,l)=>{Uh.init(n,l),Dy.init(n,l),n.email=s=>n.check(X_(Nz,s)),n.url=s=>n.check(P_(Oz,s)),n.jwt=s=>n.check(m2(Qz,s)),n.emoji=s=>n.check(e2(jz,s)),n.guid=s=>n.check(U0(B0,s)),n.uuid=s=>n.check(J_(ro,s)),n.uuidv4=s=>n.check(F_(ro,s)),n.uuidv6=s=>n.check(W_(ro,s)),n.uuidv7=s=>n.check(I_(ro,s)),n.nanoid=s=>n.check(t2(Dz,s)),n.guid=s=>n.check(U0(B0,s)),n.cuid=s=>n.check(n2(Cz,s)),n.cuid2=s=>n.check(l2(Rz,s)),n.ulid=s=>n.check(a2(Uz,s)),n.base64=s=>n.check(f2($z,s)),n.base64url=s=>n.check(d2(Gz,s)),n.xid=s=>n.check(i2(kz,s)),n.ksuid=s=>n.check(s2(Zz,s)),n.ipv4=s=>n.check(u2(Lz,s)),n.ipv6=s=>n.check(r2(Hz,s)),n.cidrv4=s=>n.check(c2(Bz,s)),n.cidrv6=s=>n.check(o2(qz,s)),n.e164=s=>n.check(h2(Yz,s)),n.datetime=s=>n.check(rz(s)),n.date=s=>n.check(oz(s)),n.time=s=>n.check(dz(s)),n.duration=s=>n.check(mz(s))});function us(n){return K_(Mz,n)}const Nt=F("ZodStringFormat",(n,l)=>{Tt.init(n,l),Dy.init(n,l)}),Nz=F("ZodEmail",(n,l)=>{t_.init(n,l),Nt.init(n,l)}),B0=F("ZodGUID",(n,l)=>{Px.init(n,l),Nt.init(n,l)}),ro=F("ZodUUID",(n,l)=>{e_.init(n,l),Nt.init(n,l)}),Oz=F("ZodURL",(n,l)=>{n_.init(n,l),Nt.init(n,l)}),jz=F("ZodEmoji",(n,l)=>{l_.init(n,l),Nt.init(n,l)}),Dz=F("ZodNanoID",(n,l)=>{a_.init(n,l),Nt.init(n,l)}),Cz=F("ZodCUID",(n,l)=>{i_.init(n,l),Nt.init(n,l)}),Rz=F("ZodCUID2",(n,l)=>{s_.init(n,l),Nt.init(n,l)}),Uz=F("ZodULID",(n,l)=>{u_.init(n,l),Nt.init(n,l)}),kz=F("ZodXID",(n,l)=>{r_.init(n,l),Nt.init(n,l)}),Zz=F("ZodKSUID",(n,l)=>{c_.init(n,l),Nt.init(n,l)}),Lz=F("ZodIPv4",(n,l)=>{m_.init(n,l),Nt.init(n,l)}),Hz=F("ZodIPv6",(n,l)=>{p_.init(n,l),Nt.init(n,l)}),Bz=F("ZodCIDRv4",(n,l)=>{g_.init(n,l),Nt.init(n,l)}),qz=F("ZodCIDRv6",(n,l)=>{v_.init(n,l),Nt.init(n,l)}),$z=F("ZodBase64",(n,l)=>{y_.init(n,l),Nt.init(n,l)}),Gz=F("ZodBase64URL",(n,l)=>{S_.init(n,l),Nt.init(n,l)}),Yz=F("ZodE164",(n,l)=>{x_.init(n,l),Nt.init(n,l)}),Qz=F("ZodJWT",(n,l)=>{z_.init(n,l),Nt.init(n,l)}),Cy=F("ZodNumber",(n,l)=>{_y.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(u,c,d)=>$2(n,u,c),Lr(n,"ZodNumber",{gt(u,c){return this.check(Z0(u,c))},gte(u,c){return this.check(Qd(u,c))},min(u,c){return this.check(Qd(u,c))},lt(u,c){return this.check(k0(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(q0(u))},safe(u){return this.check(q0(u))},positive(u){return this.check(Z0(0,u))},nonnegative(u){return this.check(Qd(0,u))},negative(u){return this.check(k0(0,u))},nonpositive(u){return this.check(Yd(0,u))},multipleOf(u,c){return this.check(L0(u,c))},step(u,c){return this.check(L0(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 wi(n){return b2(Cy,n)}const Vz=F("ZodNumberFormat",(n,l)=>{E_.init(n,l),Cy.init(n,l)});function q0(n){return S2(Vz,n)}cons)DELIM" +R"DELIM(t Kz=F("ZodBoolean",(n,l)=>{w_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>G2(n,s,u)});function lu(n){return x2(Kz,n)}const Xz=F("ZodUnknown",(n,l)=>{T_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>Q2()});function $0(){return _2(Xz)}const Jz=F("ZodNever",(n,l)=>{A_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>Y2(n,s,u)});function Fz(n){return z2(Jz,n)}const Wz=F("ZodArray",(n,l)=>{M_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>F2(n,s,u,c),n.element=l.element,Lr(n,"ZodArray",{min(s,u){return this.check(xo(s,u))},nonempty(s){return this.check(xo(1,s))},max(s,u){return this.check(Ty(s,u))},length(s,u){return this.check(Ay(s,u))},unwrap(){return this.element}})});function kh(n,l){return U2(Wz,n,l)}const Iz=F("ZodObject",(n,l)=>{O_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>W2(n,s,u,c),ht(n,"shape",()=>l.shape),Lr(n,"ZodObject",{keyof(){return Lh(Object.keys(this._zod.def.shape))},catchall(s){return this.clone({...this._zod.def,catchall:s})},passthrough(){return this.clone({...this._zod.def,catchall:$0()})},loose(){return this.clone({...this._zod.def,catchall:$0()})},strict(){return this.clone({...this._zod.def,catchall:Fz()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(s){return XS(this,s)},safeExtend(s){return JS(this,s)},merge(s){return FS(this,s)},pick(s){return VS(this,s)},omit(s){return KS(this,s)},partial(...s){return WS(Ry,this,s[0])},required(...s){return IS(Uy,this,s[0])}})});function ps(n,l){const s={type:"object",shape:n??{},...Ae(l)};return new Iz(s)}const Pz=F("ZodUnion",(n,l)=>{j_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>I2(n,s,u,c),n.options=l.options});function Zh(n,l){return new Pz({type:"union",options:n,...Ae(l)})}const eE=F("ZodIntersection",(n,l)=>{D_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>P2(n,s,u,c)});function tE(n,l){return new eE({type:"intersection",left:n,right:l})}const lh=F("ZodEnum",(n,l)=>{C_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(u,c,d)=>V2(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 lh({...l,checks:[],...Ae(c),entries:d})},n.exclude=(u,c)=>{const d={...l.entries};for(const f of u)if(s.has(f))delete d[f];else throw new Error(`Key ${f} not found in enum`);return new lh({...l,checks:[],...Ae(c),entries:d})}});function Lh(n,l){const s=Array.isArray(n)?Object.fromEntries(n.map(u=>[u,u])):n;return new lh({type:"enum",entries:s,...Ae(l)})}const nE=F("ZodLiteral",(n,l)=>{R_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>K2(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 nE({type:"literal",values:Array.isArray(n)?n:[n],...Ae(l)})}const lE=F("ZodTransform",(n,l)=>{U_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>J2(n,s),n._zod.parse=(s,u)=>{if(u.direction==="backward")throw new uy(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 aE(n){return new lE({type:"transform",transform:n})}const Ry=F("ZodOptional",(n,l)=>{wy.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>jy(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function G0(n){return new Ry({type:"optional",innerType:n})}const iE=F("ZodExactOptional",(n,l)=>{k_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>jy(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function sE(n){return new iE({type:"optional",innerType:n})}const uE=F("ZodNullable",(n,l)=>{Z_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>ez(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function Y0(n){return new uE({type:"nullable",innerType:n})}const rE=F("ZodDefault",(n,l)=>{L_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>nz(n,s,u,c),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function cE(n,l){return new rE({type:"default",innerType:n,get defaultValue(){return typeof l=="function"?l():oy(l)}})}const oE=F("ZodPrefault",(n,l)=>{H_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>lz(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function fE(n,l){return new oE({type:"prefault",innerType:n,get defaultValue(){return typeof l=="function"?l():oy(l)}})}const Uy=F("ZodNonOptional",(n,l)=>{B_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>tz(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function dE(n,l){return new Uy({type:"nonoptional",innerType:n,...Ae(l)})}const hE=F("ZodCatch",(n,l)=>{q_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>az(n,s,u,c),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function mE(n,l){return new hE({type:"catch",innerType:n,catchValue:typeof l=="function"?l:()=>l})}const pE=F("ZodPipe",(n,l)=>{$_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>iz(n,s,u,c),n.in=l.in,n.out=l.out});function Q0(n,l){return new pE({type:"pipe",in:n,out:l})}const gE=F("ZodReadonly",(n,l)=>{G_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>sz(n,s,u,c),n.unwrap=()=>n._zod.def.innerType});function vE(n){return new gE({type:"readonly",innerType:n})}const yE=F("ZodCustom",(n,l)=>{Y_.init(n,l),Zt.init(n,l),n._zod.processJSONSchema=(s,u,c)=>X2(n,s)});function bE(n,l={}){return k2(yE,n,l)}function SE(n,l){return Z2(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 )DELIM" +R"DELIM(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"}],xE=ps({level:wi().int().nonnegative(),time:wi().int().nonnegative(),message:us()}),_E=ps({event:wi().int().nonnegative(),value:wi().nonnegative(),time:wi().int().nonnegative()}),zE=ps({previous:wi().nonnegative()}),EE=Zh([xE,_E,zE]),wE=2**Do.length-1,TE=2**Rr.length-1;function AE(n){return"level"in n}function ME(n){return"event"in n}function NE(n){return"previous"in n}function OE(n){try{const l=JSON.parse(n),s=EE.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 V0(n){return Do[n]??{id:n,name:`level_${String(n)}`,label:`Level ${String(n)}`}}function jE(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 DE=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function ou(n,l=2){return new Intl.NumberFormat(void 0,{maximumFractionDigits:l}).format(n)}function Bn(n){return DE.format(n)}function Nr(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 CE(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>0?`${String(c)}m ${String(d)}s`:`${String(d)}s`}function ky(n,l){switch(cs(n).valueKind){case"height":return`height ${Bn(l)}`;case"seconds":return`${ou(l)} s`;case"milliseconds":return`${ou(l)} ms`;case"microseconds":return`${ou(l)} µs`;case"count":return Bn(l);default:return String(l)}}function RE(n){return n>=100?`${ou(n,0)}/s`:n>=10?`${ou(n,1)}/s`:`${ou(n,2)}/s`}function Zy(n){try{const l=new URL(n),s=l.pathname==="/"?"":l.pathname.replace(/\/$/u,"");return`${l.host}${s}`}catch{return n}}const UE=[{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"}],kE={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 ZE({events:n,onClear:l}){const[s,u]=fe.useState(""),[c,d]=fe.useState("all"),[f,p]=fe.useState(!1),[g,v]=fe.useState([]),x=f?g:n,_=fe.useMemo(()=>{const w=s.trim().toLowerCase();return x.filter(j=>{const H=cs(j.event);return c==="all"||H.category===c}).filter(j=>{if(!w)return!0;const H=cs(j.event);return H.name.includes(w)||H.label.toLowerCase().includes(w)||String(j.value).includes(w)}).slice(0,250)},[c,s,x]);function T(){f||v(n),p(w=>!w)}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: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"}),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:w=>{u(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"})]}),S.jsxs("label",{children:[S.jsx("span",{className:"sr-only",children:"Filter event category"}),S.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:UE.map(w=>S.jsx("option",{value:w.value,children:w.label},w.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(_.length)," of ",String(x.length)]})]}),S.jsx("div",{className:"max-h-[65vh] overflow-auto",children:_.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:_.map(w=>{const j=cs(w.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(w.time).toISOString(),className:"text-textMuted font-mono tabular-nums",children:Nr(w.time)}),S.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${kE[j.category]}`,children:j.name}),S.jsx("span",{className:"text-textPrimary font-mono tabular-nums",children:ky(w.event,w.value)})]},w.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(w=>S.jsxs("div",{className:"text-xs",children:[S.jsx("span",{className:"text-textMuted font-mono",children:String(w.id).padStart(2,"0")}),S.jsx("span",{className:"text-textPrimary ml-2",children:w.name})]},w.id))})]})]})}const K0={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 LE({logs:n,onClear:l}){const[s,u]=fe.useState(""),[c,d]=fe.useState("all"),[f,p]=fe.useState(!1),[g,v]=fe.useState([]),x=f?g:n,_=fe.useMemo(()=>{const w=s.trim().toLowerCase();return x.filter(j=>c==="all"||j.level===Number(c)).filter(j=>!w||j.message.toLowerCase().in)DELIM" +R"DELIM(cludes(w)||V0(j.level).name.includes(w)).slice(0,250)},[c,s,x]);function T(){f||v(n),p(w=>!w)}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: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"}),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:w=>{u(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"})]}),S.jsxs("label",{children:[S.jsx("span",{className:"sr-only",children:"Filter log level"}),S.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:[S.jsx("option",{value:"all",children:"All levels"}),Do.map(w=>S.jsx("option",{value:w.id,children:w.label},w.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(_.length)," of ",String(x.length)]})]}),S.jsx("div",{className:"max-h-[65vh] overflow-auto",children:_.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:_.map(w=>{const j=V0(w.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(w.time).toISOString(),className:"text-textMuted font-mono tabular-nums",children:Nr(w.time,!1)}),S.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${K0[w.level]??K0[8]}`,children:j.name}),S.jsx("span",{className:"text-textPrimary min-w-0 font-mono leading-5 break-words whitespace-pre-wrap",children:w.message})]},w.id)})})})]})]})}const Vd=["line","area","bar"],X0=["line","step","area"],HE=["line","step","area"],Ly={"occurrence-count":{id:"occurrence-count",label:"Occurrences per bucket",description:"Number of frames observed in each one-second bucket.",unit:"occurrences",chartTypes:Vd},"occurrence-rate":{id:"occurrence-rate",label:"Occurrence rate",description:"Frames observed per second.",unit:"occurrences-per-second",chartTypes:Vd},"cumulative-occurrences":{id:"cumulative-occurrences",label:"Cumulative occurrences",description:"Running number of frames observed during this browser session.",unit:"occurrences",chartTypes:X0},"payload-latest":{id:"payload-latest",label:"Latest value",description:"Most recently observed payload value.",unit:"count",chartTypes:HE},"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:X0},"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:Vd}},bu=["occurrence-rate","occurrence-count","cumulative-occurrences"],BE=["payload-latest","payload-maximum","payload-change-rate",...bu],qE=["payload-average","payload-latest","payload-minimum","payload-maximum",...bu],$E=["payload-sum","payload-cumulative","payload-latest","payload-average",...bu];function Ol(n){return`event:${String(n)}`}function _i(n){return`log:${String(n)}`}const zo="native:top";function GE(n){switch(n){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";default:return"unknown"}}function YE(n){switch(n){case"height":return BE;case"duration":return qE;case"count":return $E;default:return bu}}function QE(n){switch(n){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function Hy(n){const l=cs(n),s=GE(l.valueKind);return{id:Ol(n),source:"event",sourceId:n,name:l.name,label:l.label,category:l.category,payloadKind:s,allowedMeasures:YE(s),defaultMeasure:QE(s),description:s==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${l.label} event with a ${s} payload.`}}const VE=[...Rr.map(n=>Hy(n.id)),...Do.map(n=>({id:_i(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."}],Hh=VE,KE=new Map(Hh.map(n=>[n.id,n]));function Za(n){const l=KE.get(n);if(l)return l;const s=/^event:(\d+)$/u.exec(n);return s?Hy(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=Ly[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 XE(n,l){return n.allowedMeasures.includes(l)}function JE(n,l){return jE(n,l)??l}const FE=3600*1e3,WE=250,IE=1e3,PE=1e3;class J0{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,AE(l)?this.#j(l,u):ME(l)?this.#D(l,u):NE(l)&&(this.#S+=1),this.#T()}recordInvalidFrame(){this.#x+=1,this.#T()}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.#N(u),this.#T())}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.#x=0,this.#_=null,this.#z=null,this.#v=0,this.#w(this.#f),this.flush()}tick(){const l=this.#E(this.#e());this.#w(l),this.#N(l),this.#T()}flush(){this.#m&&(clearTimeout(this.#m),this.#m=null),this.#A=this.#O();for(const l of this.#t)l()}#j(l,s){this.#o+=1,this.#_=s,this.#v+=1,this.#n.push({...l,id:this.#v,receivedAt:s}),this.#M(_i(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(Ol(l.event),s,JE(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.#w(s),d=c.signals.get(l)??ew();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)}#w(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}#N(l){const s=l-FE;for(const[u,c]of this.#a)if(!(u>=s)){for(const[d,f]of c.signals)if(co(this.#i,d,f.count),co(this.#u,d,f.sum),f.last!==null&&f.lastAt!==null){const p=this.#s[d];(!p||f.lastAt>=p.time)&&(this.#s[d]={value:f.last,time:f.lastAt})}this.#a.delete(u)}}#T(){this.#m||(this.#m=setTimeout(()=>{this.#m=null,this.flush()},WE))}#O(){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.#x,buckets:l.map(s=>({time:s.time,signals:Object.fromEntries([...s.signals].map(([u,c])=>[u,{...c}]))})),priorSignalCounts:{...this.#i},priorSignalSums:{...this.#u},priorSignalLatest:F0(this.#s),signalTotals:{...this.#c},signalSums:{...this.#r},signalLatest:F0(this.#h),signalMaximums:{...this.#p},recentLogs:this.#n.newestFirst(),recentEvents:this.#l.newestFirst(),lastLogAt:this.#_,lastEventAt:this.#z}}}function nw(n,l,s,u,c=n[0]?.time??s){const d=s-u*1e3,f=d<=c,p=f?Math.floor(c/1e3)*1e3:Math.ceil(d/1e3)*1e3,g=f?c:p,v=Math.floor(s/1e3)*1e3,_=n.filter(w=>w.time>=p&&w.time<=v).reduce((w,j)=>w+(j.signals[l]?.count??0),0),T=Math.max(0,(s-g)/1e3);return T>0?_/T:0}function lw(n,l){const s=f=>nw(n.buckets,Ol(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,p)=>p.rate>f.rate?p:f);return d.rate>0?d:{label:"Idle",rate:0}}const aw=6e4,iw=15*6e4,Co=18;async function sw(n,l){const s=await fetch(DS(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 By(n,l){return n!==null&&l-n>iw}const uw={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 rw({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 ${uw[n]}`,children:[S.jsx("span",{className:"h-2 w-2 rounded-full bg-current","aria-hidden":"true"}),l]})}const cw={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 ${cw[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 ow({localTop:n,referenceTop:l,referenceUrl:s}){if(n===null||l===null||l<=0)return null;const u=Math.max(0,l-n);if(u<=Co)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":`${Bn(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(Kd,{label:"Local top",value:Bn(n)}),S.jsx(Kd,{label:"Network top",value:Bn(l)}),S.jsx(Kd,{label:"Blocks remaining",value:Bn(u)})]}),S.jsxs("p",{className:"bg-surface text-textMuted border-t border-white/5 px-5 py-2 text-[11px]",children:["Reference: ",Zy(s)]})]})}function Kd({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,ah=8,Bh=80,fw=[300,900,3600],ih=["line","step","area","bar"],bn=["#ffa022","#38bdf8","#34d399","#c084fc","#fb7185","#e879f9","#facc15","#60a5fa"],dw=Lh(["occurrence-count","occurrence-rate","cumulative-occurrences","payload-latest","payload-average","payload-minimum","payload-maximum","payload-sum","payload-cumulative","payload-change-rate"]),hw=ps({id:us().min(1).max(100),signalId:us().min(1).max(100),measure:dw,color:us().regex(/^#[\da-f]{6}$/iu),label:us().max(80).optional()}).strict(),qy=ps({id:us().min(1).max(100),title:us().trim().min(1).max(Bh),visual)DELIM" +R"DELIM(ization:Lh(ih),range:Zh([go(300),go(900),go(3600)]),series:kh(hw).min(1).max(ah)}).strict(),mw=ps({version:go(1),charts:kh(qy).max(su)}).strict(),$y={id:"default-sync-pipeline",title:"Sync pipeline",visualization:"line",range:900,series:[ml("sync-header",Ol(0),"occurrence-rate",bn[3]),ml("sync-archive",Ol(3),"occurrence-rate",bn[0]),ml("sync-validate",Ol(5),"occurrence-rate",bn[1]),ml("sync-confirm",Ol(6),"occurrence-rate",bn[2])]},pw={id:"default-chain-progress",title:"Chain progress",visualization:"step",range:900,series:[ml("progress-top",zo,"payload-latest",bn[0]),ml("progress-organized",Ol(13),"payload-latest",bn[2]),ml("progress-confirmed",Ol(6),"payload-latest",bn[1])]},gw={id:"default-log-volume",title:"Log volume",visualization:"bar",range:900,series:[ml("logs-news",_i(1),"occurrence-rate",bn[2]),ml("logs-session",_i(2),"occurrence-rate",bn[3]),ml("logs-protocol",_i(3),"occurrence-rate",bn[1]),ml("logs-remote",_i(5),"occurrence-rate",bn[7]),ml("logs-fault",_i(6),"occurrence-rate",bn[4]),ml("logs-quitting",_i(7),"occurrence-rate",bn[0])]},qh=[{id:"sync-pipeline",label:"Sync pipeline",description:"Header and block lifecycle throughput.",chart:$y},{id:"chain-progress",label:"Chain progress",description:"Canonical, organized, and confirmed heights.",chart:pw},{id:"log-volume",label:"Log volume",description:"Message rates grouped by log level.",chart:gw}],Gy="libbitcoinAdminDashboardCharts";let W0=0;function ml(n,l,s,u){return{id:n,signalId:l,measure:s,color:u}}function Eo(n){return W0+=1,`${n}-${Date.now().toString(36)}-${String(W0)}`}function $h(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 qh.map(n=>$h(n.chart))}function vw(n){const l=qh.find(s=>s.id===n);return $h(l?.chart??$y,!0)}function Yy(){return{id:Eo("chart"),title:"Custom chart",visualization:"line",range:900,series:[{id:Eo("series"),signalId:Ol(3),measure:"occurrence-rate",color:bn[0]}]}}function yw(n){const l=" copy",s=`${n.title.slice(0,Bh-l.length).trimEnd()}${l}`;return{...$h(n,!0),title:s}}function sh(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 Qy(n){const l=qy.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(!XE(u,s.measure))return`${Ly[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 sh(n)===null?"All series on a chart must use compatible units.":null}function Vy(n){const l=mw.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=>Qy(s)===null)?l.data.charts:null}function Ky(){try{return globalThis.window?.localStorage??null}catch{return null}}function bw(n=Ky()){try{const l=n?.getItem(Gy);return l?Vy(JSON.parse(l))??vo():vo()}catch{return vo()}}function Sw(n,l=Ky()){try{const s={version:1,charts:n};if(!Vy(s))return;l?.setItem(Gy,JSON.stringify(s))}catch{}}function Gh(n,l){return n.signals[l]}function I0(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=Gh(d,l);c+=u==="count"?f?.count??0:f?.sum??0}return c}function xw(n,l,s){let u=n.priorSignalLatest[l]??null;for(const c of n.buckets){if(c.time>=s)break;const d=Gh(c,l);d?.last!==null&&d?.last!==void 0&&d.lastAt!==null&&(u={value:d.last,time:d.lastAt})}return u}function _w(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 zw(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 Ew(n,l,s,u){const c=Za(u.signalId);let d=u.measure==="cumulative-occurrences"?I0(n,u.signalId,s,"count"):u.measure==="payload-cumulative"?I0(n,u.signalId,s,"sum"):0,f=xw(n,u.signalId,s);return l.map(p=>{const g=Gh(p,u.signalId);switch(u.measure){case"occurrence-count":return g?.count??0;case"occurrence-rate":{const v=zw(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 ww(n,l){const s=n.now-l.range*1e3,u=_w(n,s),c=u[0]?.time??Math.floor(n.now/1e3)*1e3,d=l.series[0],f=Ei(Za(d.signalId),d.measure).unit,p=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=>Ew(n,u,c,g))],unit:f,hasObservedData:p.length({...l}))}}function jw(){const n=new Map;for(const l of Hh){const s=n.get(l.category)??[];s.push(l),n.set(l.category,s)}return[...n]}const Dw=jw();function Cw({chart:n,mode:l,onCancel:s,onSave:u}){const[c,d]=fe.useState(()=>Ow(n)),f=Qy(c),p=sh(c);fe.useEffect(()=>{function w(j){j.key==="Escape"&&s()}return globalThis.addEventListener("keydown",w),()=>{globalThis.removeEventListener("keydown",w)}},[s]);const g=fe.useMemo(()=>new Set(ih.filter(w=>c.series.every(j=>Ei(Za(j.signalId),j.measure).chartTypes.includes(w)))),[c.series]);function v(w,j){d(H=>({...H,series:H.series.map(($,W)=>W===w?j:$)}))}function x(w,j){const H=c.series[w],$=Za(j);v(w,{...H,signalId:j,measure:$.defaultMeasure})}function _(){if(c.series.length>=ah)return;const w=sh(c),j=Hh.find(W=>W.allowedMeasures.some(K=>w===null||Ei(W,K).unit===w));if(!j)return;const H=j.allowedMeasures.find(W=>w===null||Ei(j,W).unit===w)??j.defaultMeasure,$={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,$]}))}function T(w){w.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:w=>{w.target===w.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-e)DELIM" +R"DELIM(ditor-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:[qh.map(w=>S.jsxs("button",{type:"button",onClick:()=>{d(vw(w.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:w.label}),S.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:w.description})]},w.id)),S.jsxs("button",{type:"button",onClick:()=>{d(Yy())},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:T,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:Bh,onChange:w=>{d(j=>({...j,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"})]}),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:w=>{d(j=>({...j,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:ih.map(w=>S.jsx("option",{value:w,disabled:!g.has(w),children:Nw[w]},w))})]}),S.jsxs("label",{className:"space-y-2",children:[S.jsx("span",{className:"text-sm font-medium",children:"Time range"}),S.jsx("select",{value:c.range,onChange:w=>{d(j=>({...j,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:fw.map(w=>S.jsx("option",{value:w,children:Mw[w]},w))})]})]}),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",p===null?".":`: ${Xy(p)}.`]})]}),S.jsx("button",{type:"button",onClick:_,disabled:c.series.length>=ah,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((w,j)=>{const H=Za(w.signalId),$=Ei(H,w.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:w.signalId,onChange:W=>{x(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:Dw.map(([W,K])=>S.jsx("optgroup",{label:W,children:K.map(V=>S.jsx("option",{value:V.id,children:V.label},V.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:w.measure,onChange:W=>{v(j,{...w,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:$.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:w.label??"",onChange:W=>{v(j,{...w,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:w.color,onChange:W=>{v(j,{...w,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((K,V)=>V!==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"})]},w.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 Rw=!0,tn="u-",Uw="uplot",kw=tn+"hz",Zw=tn+"vt",Lw=tn+"title",Hw=tn+"wrap",Bw=tn+"under",qw=tn+"over",$w=tn+"axis",ss=tn+"off",Gw=tn+"select",Yw=tn+"cursor-x",Qw=tn+"cursor-y",Vw=tn+"cursor-pt",Kw=tn+"legend",Xw=tn+"live",Jw=tn+"inline",Fw=tn+"series",Ww=tn+"marker",P0=tn+"label",Iw=tn+"value",Tr="width",Ar="height",zr="top",ev="bottom",au="left",Xd="right",Yh="#000",tv=Yh+"0",Jd="mousemove",nv="mousedown",Fd="mouseup",lv="mouseenter",av="mouseleave",iv="dblclick",Pw="resize",eT="scroll",sv="change",wo="dppxchange",Qh="--",Su=typeof window<"u",uh=Su?document:null,fu=Su?window:null,tT=Su?navigator:null;let Ie,fo;function rh(){let n=devicePixelRatio;Ie!=n&&(Ie=n,fo&&oh(sv,fo,rh),fo=matchMedia(`(min-resolution: ${Ie-.001}dppx) and (max-resolution: ${Ie+.001}dppx)`),os(sv,fo,rh),fu.dispatchEvent(new CustomEvent(wo)))}function dl(n,l){if(l!=null){let s=n.classList;!s.contains(l)&&s.add(l)}}function ch(n,l){let s=n.classList;s.contains(l)&&s.remove(l)}function zt(n,l,s){n.style[l]=s+"px"}function Gl(n,l,s,u){let c=uh.createElement(n);return l!=null&&dl(c,l),s?.insertBefore(c,u),c}function Ml(n,l){return Gl("div",n,l)}const uv=new WeakMap;function ua(n,l,s,u,c){let d="translate("+l+"px,"+s+"px)",f=uv.get(n);d!=f&&(n.style.transform=d,uv.set(n,d),l<0||s<0||l>u||s>c?dl(n,ss):ch(n,ss))}const rv=new WeakMap;function cv(n,l,s){let u=l+s,c=rv.get(n);u!=c&&(rv.set(n,u),n.style.background=l,n.style.borderColor=s)}const ov=new WeakMap;function fv(n,l,s,u){let c=l+""+s,d=ov.get(n);c!=d&&(ov.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 Vh={passive:!0},nT={...Vh,capture:!0};function os(n,l,s,u){l.addEventListener(n,s,)DELIM" +R"DELIM(u?nT:Vh)}function oh(n,l,s,u){l.removeEventListener(n,s,Vh)}Su&&rh();function Yl(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 p=u;p<=c;p++)if(n(s[p])){d=p;break}for(let p=c;p>=u;p--)if(n(s[p])){f=p;break}return[d,f]}}const Fy=n=>n!=null,Wy=n=>n!=null&&n>0,Ro=Jy(Fy),lT=Jy(Wy);function aT(n,l,s,u=0,c=!1){let d=c?lT:Ro,f=c?Wy:Fy;[l,s]=d(n,l,s);let p=n[l],g=n[l];if(l>-1)if(u==1)p=n[l],g=n[s];else if(u==-1)p=n[s],g=n[l];else for(let v=l;v<=s;v++){let x=n[v];f(x)&&(xg&&(g=x))}return[p??gt,g??-gt]}function Uo(n,l,s,u){let c=mv(n),d=mv(l);n==l&&(c==-1?(n*=s,l/=s):(n/=s,l*=s));let f=s==10?La:Iy,p=c==1?pl:Nl,g=d==1?Nl:pl,v=p(f(en(n))),x=g(f(en(l))),_=hu(s,v),T=hu(s,x);return s==10&&(v<0&&(_=vt(_,-v)),x<0&&(T=vt(T,-x))),u||s==2?(n=_*c,l=T*d):(n=nb(n,_),l=ko(l,T)),[n,l]}function Kh(n,l,s,u){let c=Uo(n,l,s,u);return n==0&&(c[0]=0),l==0&&(c[1]=0),c}const Xh=.1,dv={mode:3,pad:Xh},Or={pad:0,soft:null,mode:0},iT={min:Or,max:Or};function To(n,l,s,u){return Zo(s)?hv(n,l,s):(Or.pad=s,Or.soft=u?0:null,Or.mode=u?3:0,hv(n,l,iT))}function Je(n,l){return n??l}function sT(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 hv(n,l,s){let u=s.min,c=s.max,d=Je(u.pad,0),f=Je(c.pad,0),p=Je(u.hard,-gt),g=Je(c.hard,gt),v=Je(u.soft,gt),x=Je(c.soft,-gt),_=Je(u.mode,0),T=Je(c.mode,0),w=l-n,j=La(w),H=qn(en(n),en(l)),$=La(H),W=en($-j);(w<1e-24||W>10)&&(w=0,(n==0||l==0)&&(w=1e-24,_==2&&v!=gt&&(d=0),T==2&&x!=-gt&&(f=0)));let K=w||H||1e3,V=La(K),q=hu(10,pl(V)),ae=K*(w==0?n==0?.1:1:d),te=vt(nb(n-ae,q/10),24),P=n>=v&&(_==1||_==3&&te<=v||_==2&&te>=v)?v:gt,se=qn(p,te=P?P:Ql(P,te)),Me=K*(w==0?l==0?.1:1:f),ze=vt(ko(l+Me,q/10),24),ne=l<=x&&(T==1||T==3&&ze>=x||T==2&&ze<=x)?x:-gt,be=Ql(g,ze>ne&&l<=ne?ne:qn(ne,ze));return se==be&&se==0&&(be=100),[se,be]}const uT=new Intl.NumberFormat(Su?tT.language:"en-US"),Jh=n=>uT.format(n),gl=Math,yo=gl.PI,en=gl.abs,pl=gl.floor,Pt=gl.round,Nl=gl.ceil,Ql=gl.min,qn=gl.max,hu=gl.pow,mv=gl.sign,La=gl.log10,Iy=gl.log2,rT=(n,l=1)=>gl.sinh(n)*l,Wd=(n,l=1)=>gl.asinh(n/l),gt=1/0;function pv(n){return(La((n^n>>31)-(n>>31))|0)+1}function fh(n,l,s){return Ql(qn(n,l),s)}function Py(n){return typeof n=="function"}function $e(n){return Py(n)?n:()=>n}const cT=()=>{},eb=n=>n,tb=(n,l)=>l,oT=n=>null,gv=n=>!0,vv=(n,l)=>n==l,fT=/\.\d*?(?=9{6,}|0{6,})/gm,hs=n=>{if(ab(n)||Ai.has(n))return n;const l=`${n}`,s=l.match(fT);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 ko(n,l){return hs(Nl(hs(n/l))*l)}function nb(n,l){return hs(pl(hs(n/l))*l)}function vt(n,l=0){if(ab(n))return n;let s=10**l,u=n*s*(1+Number.EPSILON);return Pt(u)/s}const Ai=new Map;function lb(n){return((""+n).split(".")[1]||"").length}function Ur(n,l,s,u){let c=[],d=u.map(lb);for(let f=l;f=0?0:p)+(f>=d[v]?0:d[v]),T=n==10?x:vt(x,_);c.push(T),Ai.set(T,_)}}return c}const jr={},Fh=[],mu=[null,null],zi=Array.isArray,ab=Number.isInteger,dT=n=>n===void 0;function yv(n){return typeof n=="string"}function Zo(n){let l=!1;if(n!=null){let s=n.constructor;l=s==null||s==Object}return l}function hT(n){return n!=null&&typeof n=="object"}const mT=Object.getPrototypeOf(Uint8Array),ib="__proto__";function pu(n,l=Zo){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-p)],c=u[0].length,d=new Map;for(let f=0;f"u"?n=>Promise.resolve().then(n):queueMicrotask;function xT(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=qn(1,pl((c-u+1)/l));for(let f=n[u],p=u+d;p<=c;p+=d){const g=n[p];if(g!=null){if(g<=f)return!1;f=g}}return!0}const sb=["January","February","March","April","May","June","July","August","September","October","November","December"],ub=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function rb(n){return n.slice(0,3)}const ET=ub.map(rb),wT=sb.map(rb),TT={MMMM:sb,MMM:wT,WWWW:ub,WWW:ET};function Er(n){return(n<10?"0":"")+n}function AT(n){return(n<10?"00":n<100?"0":"")+n}const MT={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=>AT(n.getMilliseconds())};function Wh(n,l){l=l||TT;let s=[],u=/\{([a-z]+)\}|[^{]+/gi,c;for(;c=u.exec(n);)s.push(c[0][0]=="{"?MT[c[1]]:c[0]);return d=>{let f="";for(let p=0;pn%1==0,Ao=[1,2,2.5,5],jT=Ur(10,-32,0,Ao),ob=Ur(10,0,32,Ao),DT=ob.filter(cb),is=jT.concat(ob),Ih=` +`,fb="{YYYY}",bv=Ih+fb,db="{M}/{D}",Mr=Ih+db,ho=Mr+"/{YY}",hb="{aa}",CT="{h}:{mm}",uu=CT+hb,Sv=Ih+uu,xv=":{ss}",tt=null;function mb(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(cb):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,fb,tt,tt,tt,tt,tt,tt,1],[c*28,"{MMM}",bv,tt,tt,tt,tt,tt,1],[c,db,bv,tt,tt,tt,tt,tt,1],[u,"{h}"+hb,ho,tt,Mr,tt,tt,tt,1],[s,uu,ho,tt,Mr,tt,tt,tt,1],[l,xv,ho+" "+uu,tt,Mr+" "+uu,tt,Sv,tt,1],[n,xv+".{fff}",ho+" "+uu,tt,Mr+" "+uu,tt,Sv,tt,1]];function x(_){return(T,w,j,H,$,W)=>{let K=[],V=$>=f,q=$>=d&&$=c?c:$,ze=pl(j)-pl(te),ne=se+ze+ko(te-se,Me);K.push(ne);let be=_(ne),ce=be.getHours()+be.getMinutes()/s+be.getSeconds()/u,Ee=$/u,he=T.axes[w]._space,U=W/he;for(;ne=vt(ne+$,n==1?0:3),!(ne>H);)if(Ee>1){let Y=pl(vt(ce+Ee,6))%24,Se=_(ne).getHours()-Y;Se>1&&(Se=-1),ne-=Se*u,ce=(ce+Ee)%24;let M=K[K.length-1];vt((ne-M)/$,3)*U>=.7&&K.push(ne)}else K.push(ne)}return K}}return[g,v,x]}const[RT,UT,kT]=mb(1),[ZT,LT,HT]=mb(.001);Ur(2,-53,53,[1]);function _v(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 zv(n,l){return(s,u,c,d,f)=>{let p=l.find(j=>f>=j[0])||l[l.length-1],g,v,x,_,T,w;return u.map(j=>{let H=n(j),$=H.getFullYear(),W=H.getMonth(),K=H.getDate(),V=H.getHours(),q=H.getMinutes(),ae=H.getSeconds(),te=$!=g&&p[2]||W!=v&&p[3]||K!=x&&p[4]||V!=_&&p[5]||q!=T&&p[6]||ae!=w&&p[7]||p[1];return g=$,v=W,x=K,_=V,T=q,w=ae,te(H)})}}function BT(n,l){let s=Wh(l);return(u,c,d,f,p)=>c.map(g=>s(n(g)))}function Id(n,l,s){return new Date(n,l,s)}function Ev(n,l){return l(n)}const qT="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function wv(n,l){return(s,u,c,d)=>d==null?Qh:l(n(u))}function $T(n,l){let s=n.series[l];return s.width?s.stroke(n,l):s.points.width?s.points.stroke(n,l):null}function GT(n,l){return n.series[l].fill(n,l)}const YT={show:!0,live:!0,isolate:!1,mount:cT,markers:{show:!0,width:2,stroke:$T,fill:GT,dash:"solid"},idx:null,idxs:null,values:[]};function QT(n,l){let s=n.cursor.points,u=Ml(),c=s.size(n,l);zt(u,Tr,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 VT(n,l){let s=n.series[l].points;return s._fill||s._stroke}function KT(n,l){let s=n.series[l].points;return s._stroke||s._fill}function XT(n,l){return n.series[l].points.size}const Pd=[0,0];function JT(n,l,s){return Pd[0]=l,Pd[1]=s,Pd}function mo(n,l,s,u=!0){return c=>{c.button==0&&(!u||c.target==l)&&s(c)}}function eh(n,l,s,u=!0){return c=>{(!u||c.target==l)&&s(c)}}const FT={show:!0,x:!0,y:!0,lock:!1,move:JT,points:{one:!1,show:QT,size:XT,width:0,stroke:KT,fill:VT},bind:{mousedown:mo,mouseup:mo,click:mo,dblclick:mo,mousemove:eh,mouseleave:eh,mouseenter:eh},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:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},pb={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},Ph=Jt({},pb,{filter:tb}),gb=Jt({},Ph,{size:10}),vb=Jt({},pb,{show:!1}),em='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"',yb="bold "+em,bb=1.5,Tv={show:!0,scale:"x",stroke:Yh,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:yb,side:2,grid:Ph,ticks:gb,border:vb,font:em,lineGap:bb,rotate:0},WT="Value",IT="Time",Av={show:!0,scale:"x",auto:!1,sorted:1,min:gt,max:-gt,idxs:[]};function PT(n,l,s,u,c){return l.map(d=>d==null?"":Jh(d))}function e3(n,l,s,u,c,d,f){let p=[],g=Ai.get(c)||0;s=f?s:vt(ko(s,c),g);for(let v=s;v<=u;v=vt(v+c,g))p.push(Object.is(v,-0)?0:v);return p}function dh(n,l,s,u,c,d,f){const p=[],g=n.scales[n.axes[l].scale].log,v=g==10?La:Iy,x=pl(v(s));c=hu(g,x),g==10&&(c=is[Yl(c,is)]);let _=s,T=c*g;g==10&&(T=is[Yl(T,is)]);do p.push(_),_=_+c,g==10&&!Ai.has(_)&&(_=vt(_,Ai.get(c))),_>=T&&(c=_,T=c*g,g==10&&(T=is[Yl(T,is)]));while(_<=u);return p}function t3(n,l,s,u,c,d,f){let g=n.scales[n.axes[l].scale].asinh,v=u>g?dh(n,l,qn(g,s),u,c):[g],x=u>=0&&s<=0?[0]:[];return(s<-g?dh(n,l,qn(g,-u),-s,c):[g]).reverse().map(T=>-T).concat(x,v)}const Sb=/./,n3=/[12357]/,l3=/[125]/,Mv=/1/,hh=(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 a3(n,l,s,u,c){let d=n.axes[s],f=d.scale,p=n.scales[f],g=n.valToPos,v=d._space,x=g(10,f),_=g(9,f)-x>=v?Sb:g(7,f)-x>=v?n3:g(5,f)-x>=v?l3:Mv;if(_==Mv){let T=en(g(1,f)-x);if(Tc,jv={show:!0,auto:!0,sorted:0,gaps:xb,alpha:1,facets:[Jt({},Ov,{scale:"x"}),Jt({},Ov,{scale:"y"})]},Dv={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:xb,alpha:1,points:{show:r3,filter:null},values:null,min:gt,max:-gt,idxs:[],path:null,clip:null};function c3(n,l,s,u,c){return s/10}const _b={time:Rw,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},o3=Jt({},_b,{time:!1,ori:1}),Cv={};function zb(n,l){let s=Cv[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,p,g,v){for(let x=0;x{let W=f.pxRound;const K=v.dir*(v.ori==0?1:-1),V=v.ori==0?xu:_u;let q,ae;K==1?(q=s,ae=u):(q=u,ae=s);let te=W(_(p[q],v,H,w)),P=W(T(g[q],x,$,j)),se=W(_(p[ae],v,H,w)),Me=W(T(d==1?x.max:x.min,x,$,j)),ze=new Path2D(c);return V(ze,se,Me),V(ze,te,Me),V(ze,te,P),ze})}function Lo(n,l,s,u,c,d){let f=null;if(n.length>0){f=new Path2D;const p=l==0?qo:lm;let g=s;for(let _=0;_T[0]){let w=T[0]-g;w>0&&p(f,g,u,w,u+d),g=T[1]}}let v=s+c-g,x=10;v>0&&p(f,g,u-x/2,v,u+d+x)}return f}function d3(n,l,s){let u=n[n.length-1];u&&u[0]==l?u[1]=s:n.push([l,s])}function nm(n,l,s,u,c,d,f){let p=[],g=n.length;for(let v=c==1?s:u;v>=s&&v<=u;v+=c)if(l[v]===null){let _=v,T=v;if(c==1)for(;++v<=u&&l[v]===null;)T=v;else for(;--v>=s&&l[v]===null;)T=v;let w=d(n[_]),j=T==_?w:d(n[T]),H=_-c;w=f<=0&&H>=0&&H=0&&W>=0&&W=w&&p.push([w,j])}return p}function Rv(n){return n==0?eb:n==1?Pt:l=>as(l,n)}function Eb(n){let l=n==0?Ho:Bo,s=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)},u=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?u(c,d,f,p,g):(v=Ql(v,p/2,g/2),x=Ql(x,p/2,g/2),l(c,d+v,f),s(c,d+p,f,d+p,f+g,v),s(c,d+p,f+g,d,f+g,x),s(c,d,f+g,d,f,x),s(c,d,f,d+p,f,v),c.closePath())}}const Ho=(n,l,s)=>{n.moveTo(l,s)},Bo=(n,l,s)=>{n.moveTo(s,l)},xu=(n,l,s)=>{n.lineTo(l,s)},_u=(n,l,s)=>{n.lineTo(s,l)},qo=Eb(0),lm=Eb(1),wb=(n,l,s,u,c,d)=>{n.arc(l,s,u,c,d)},Tb=(n,l,s,u,c,d)=>{n.arc(s,l,u,c,d)},Ab=(n,l,s,u,c,d,f)=>{n.bezierCurveTo(l,s,u,c,d,f)},Mb=(n,l,s,u,c,d,f)=>{n.bezierCurveTo(s,l,c,u,f,d)};function Nb(n){return(l,s,u,c,d)=>gs(l,s,(f,p,g,v,x,_,T,w,j,H,$)=>{let{pxRound:W,points:K}=f,V,q;v.ori==0?(V=Ho,q=wb):(V=Bo,q=Tb);const ae=vt(K.width*Ie,3);let te=(K.size-K.wid)DELIM" +R"DELIM(th)/2*Ie,P=vt(te*2,3),se=new Path2D,Me=new Path2D,{left:ze,top:ne,width:be,height:ce}=l.bbox;qo(Me,ze-P,ne-P,be+P*2,ce+P*2);const Ee=he=>{if(g[he]!=null){let U=W(_(p[he],v,H,w)),Y=W(T(g[he],x,$,j));V(se,U+te,Y),q(se,U,Y,te,0,yo*2)}};if(d)d.forEach(Ee);else for(let he=u;he<=c;he++)Ee(he);return{stroke:ae>0?se:null,fill:se,clip:Me,flags:gu|mh}})}function Ob(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 h3=Ob(xu),m3=Ob(_u);function jb(n){const l=Je(n?.alignGaps,0);return(s,u,c,d)=>gs(s,u,(f,p,g,v,x,_,T,w,j,H,$)=>{[c,d]=Ro(g,c,d);let W=f.pxRound,K=ce=>W(_(ce,v,H,w)),V=ce=>W(T(ce,x,$,j)),q,ae;v.ori==0?(q=xu,ae=h3):(q=_u,ae=m3);const te=v.dir*(v.ori==0?1:-1),P={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:gu},se=P.stroke;let Me=!1;if(d-c>=H*4){let ce=G=>s.posToVal(G,v.key,!0),Ee=null,he=null,U,Y,pe,Ne=K(p[te==1?c:d]),Se=K(p[c]),M=K(p[d]),L=ce(te==1?Se+1:M-1);for(let G=te==1?c:d;G>=c&&G<=d;G+=te){let ie=p[G],ge=(te==1?ieL)?Ne:K(ie),ve=g[G];ge==Ne?ve!=null?(Y=ve,Ee==null?(q(se,ge,V(Y)),U=Ee=he=Y):Yhe&&(he=Y)):ve===null&&(Me=!0):(Ee!=null&&ae(se,Ne,V(Ee),V(he),V(U),V(Y)),ve!=null?(Y=ve,q(se,ge,V(Y)),Ee=he=U=Y):(Ee=he=null,ve===null&&(Me=!0)),Ne=ge,L=ce(Ne+te))}Ee!=null&&Ee!=he&&pe!=Ne&&ae(se,Ne,V(Ee),V(he),V(U),V(Y))}else for(let ce=te==1?c:d;ce>=c&&ce<=d;ce+=te){let Ee=g[ce];Ee===null?Me=!0:Ee!=null&&q(se,K(p[ce]),V(Ee))}let[ne,be]=tm(s,u);if(f.fill!=null||ne!=0){let ce=P.fill=new Path2D(se),Ee=f.fillTo(s,u,f.min,f.max,ne),he=V(Ee),U=K(p[c]),Y=K(p[d]);te==-1&&([Y,U]=[U,Y]),q(ce,Y,he),q(ce,U,he)}if(!f.spanGaps){let ce=[];Me&&ce.push(...nm(p,g,c,d,te,K,l)),P.gaps=ce=f.gaps(s,u,c,d,ce),P.clip=Lo(ce,v.ori,w,j,H,$)}return be!=0&&(P.band=be==2?[Ha(s,u,c,d,se,-1),Ha(s,u,c,d,se,1)]:Ha(s,u,c,d,se,be)),P})}function p3(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,p,g)=>gs(d,f,(v,x,_,T,w,j,H,$,W,K,V)=>{[p,g]=Ro(_,p,g);let q=v.pxRound,{left:ae,width:te}=d.bbox,P=Se=>q(j(Se,T,K,$)),se=Se=>q(H(Se,w,V,W)),Me=T.ori==0?xu:_u;const ze={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:gu},ne=ze.stroke,be=T.dir*(T.ori==0?1:-1);let ce=se(_[be==1?p:g]),Ee=P(x[be==1?p:g]),he=Ee,U=Ee;c&&l==-1&&(U=ae,Me(ne,U,ce)),Me(ne,Ee,ce);for(let Se=be==1?p:g;Se>=p&&Se<=g;Se+=be){let M=_[Se];if(M==null)continue;let L=P(x[Se]),G=se(M);l==1?Me(ne,L,ce):Me(ne,he,G),Me(ne,L,G),ce=G,he=L}let Y=he;c&&l==1&&(Y=ae+te,Me(ne,Y,ce));let[pe,Ne]=tm(d,f);if(v.fill!=null||pe!=0){let Se=ze.fill=new Path2D(ne),M=v.fillTo(d,f,v.min,v.max,pe),L=se(M);Me(Se,Y,L),Me(Se,U,L)}if(!v.spanGaps){let Se=[];Se.push(...nm(x,_,p,g,be,P,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,p,g,Se),ze.clip=Lo(Se,T.ori,$,W,K,V)}return Ne!=0&&(ze.band=Ne==2?[Ha(d,f,p,g,ne,-1),Ha(d,f,p,g,ne,1)]:Ha(d,f,p,g,ne,Ne)),ze})}function Uv(n,l,s,u,c,d,f=gt){if(n.length>1){let p=null;for(let g=0,v=1/0;g{}),{fill:_,stroke:T}=v;return(w,j,H,$)=>gs(w,j,(W,K,V,q,ae,te,P,se,Me,ze,ne)=>{let be=W.pxRound,ce=s,Ee=u*Ie,he=p*Ie,U=g*Ie,Y,pe;q.ori==0?[Y,pe]=d(w,j):[pe,Y]=d(w,j);const Ne=q.dir*(q.ori==0?1:-1);let Se=q.ori==0?qo:lm,M=q.ori==0?x:(oe,lt,Ot,Rl,ca,nl,oa)=>{x(oe,lt,Ot,ca,Rl,oa,nl)},L=Je(w.bands,Fh).find(oe=>oe.series[0]==j),G=L!=null?L.dir:0,ie=W.fillTo(w,j,W.min,W.max,G),_e=be(P(ie,ae,ne,Me)),ge,ve,mt,Ge=ze,nt=be(W.width*Ie),On=!1,tl=null,jn=null,_n=null,Vl=null;_!=null&&(nt==0||T!=null)&&(On=!0,tl=_.values(w,j,H,$),jn=new Map,new Set(tl).forEach(oe=>{oe!=null&&jn.set(oe,new Path2D)}),nt>0&&(_n=T.values(w,j,H,$),Vl=new Map,new Set(_n).forEach(oe=>{oe!=null&&Vl.set(oe,new Path2D)})));let{x0:Kl,size:Oi}=v;if(Kl!=null&&Oi!=null){ce=1,K=Kl.values(w,j,H,$),Kl.unit==2&&(K=K.map(Ot=>w.posToVal(se+Ot*ze,q.key,!0)));let oe=Oi.values(w,j,H,$);Oi.unit==2?ve=oe[0]*ze:ve=te(oe[0],q,ze,se)-te(0,q,ze,se),Ge=Uv(K,V,te,q,ze,se,Ge),mt=Ge-ve+Ee}else Ge=Uv(K,V,te,q,ze,se,Ge),mt=Ge*f+Ee,ve=Ge-mt;mt<1&&(mt=0),nt>=ve/2&&(nt=0),mt<5&&(be=eb);let ji=mt>0,Dl=Ge-mt-(ji?nt:0);ve=be(fh(Dl,U,he)),ge=(ce==0?ve/2:ce==Ne?0:ve)-ce*Ne*((ce==0?Ee/2:0)+(ji?nt/2:0));const Ft={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Xl=On?null:new Path2D;let Cl=null;if(L!=null)Cl=w.data[L.series[1]];else{let{y0:oe,y1:lt}=v;oe!=null&<!=null&&(V=lt.values(w,j,H,$),Cl=oe.values(w,j,H,$))}let ra=Y*ve,we=pe*ve;for(let oe=Ne==1?H:$;oe>=H&&oe<=$;oe+=Ne){let lt=V[oe];if(lt==null)continue;if(Cl!=null){let rt=Cl[oe]??0;if(lt-rt==0)continue;_e=P(rt,ae,ne,Me)}let Ot=q.distr!=2||v!=null?K[oe]:oe,Rl=te(Ot,q,ze,se),ca=P(Je(lt,ie),ae,ne,Me),nl=be(Rl-ge),oa=be(qn(ca,_e)),Dn=be(Ql(ca,_e)),nn=oa-Dn;if(lt!=null){let rt=lt<0?we:ra,Gt=lt<0?ra:we;On?(nt>0&&_n[oe]!=null&&Se(Vl.get(_n[oe]),nl,Dn+pl(nt/2),ve,qn(0,nn-nt),rt,Gt),tl[oe]!=null&&Se(jn.get(tl[oe]),nl,Dn+pl(nt/2),ve,qn(0,nn-nt),rt,Gt)):Se(Xl,nl,Dn+pl(nt/2),ve,qn(0,nn-nt),rt,Gt),M(w,j,oe,nl-nt/2,Dn,ve+nt,nn)}}return nt>0?Ft.stroke=On?Vl:Xl:On||(Ft._fill=W.width==0?W._fill:W._stroke??W._fill,Ft.width=0),Ft.fill=On?jn:Xl,Ft})}function v3(n,l){const s=Je(l?.alignGaps,0);return(u,c,d,f)=>gs(u,c,(p,g,v,x,_,T,w,j,H,$,W)=>{[d,f]=Ro(v,d,f);let K=p.pxRound,V=Y=>K(T(Y,x,$,j)),q=Y=>K(w(Y,_,W,H)),ae,te,P;x.ori==0?(ae=Ho,P=xu,te=Ab):(ae=Bo,P=_u,te=Mb);const se=x.dir*(x.ori==0?1:-1);let Me=V(g[se==1?d:f]),ze=Me,ne=[],be=[];for(let Y=se==1?d:f;Y>=d&&Y<=f;Y+=se)if(v[Y]!=null){let Ne=g[Y],Se=V(Ne);ne.push(ze=Se),be.push(q(v[Y]))}const ce={stroke:n(ne,be,ae,P,te,K),fill:null,clip:null,band:null,gaps:null,flags:gu},Ee=ce.stroke;let[he,U]=tm(u,c);if(p.fill!=null||he!=0){let Y=ce.fill=new Path2D(Ee),pe=p.fillTo(u,c,p.min,p.max,he),Ne=q(pe);P(Y,ze,Ne),P(Y,Me,Ne)}if(!p.spanGaps){let Y=[];Y.push(...nm(g,v,d,f,se,V,s)),ce.gaps=Y=p.gaps(u,c,d,f,Y),ce.clip=Lo(Y,x.ori,j,H,$,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 y3(n){return v3(b3,n)}function b3(n,l,s,u,c,d){const f=n.length;if(f<2)return null;const p=new Path2D;if(s(p,n[0],l[0]),f==2)u(p,n[1],l[1]);else{let g=Array(f),v=Array(f-1),x=Array(f-1),_=Array(f-1);for(let T=0;T0!=v[T]>0?g[T]=0:(g[T]=3*(_[T-1]+_[T])/((2*_[T]+_[T-1])/v[T-1]+(_[T]+2*_[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 S3=jb(),x3=Nb();function Zv(n,l,s,u){return(u?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((d,f)=>gh(d,f,l,s))}function _3(n,l){return n.map((s,u)=>u==0?{}:Jt({},l,s))}function gh(n,l,s,u){return Jt({},l==0?s:u,n)}function Db(n,l,s){return l==null?mu:[l,s]}const z3=Db;function E3(n,l,s){return l==null?mu:To(l,s,Xh,!0)}function Cb(n,l,s,u){return l==null?mu:Uo(l,s,n.scales[u].log,!1)}const w3=Cb;function Rb(n,l,s,u){return l==null?mu:Kh(l,s,n.scales[u].log,!1)}const T3=Rb;function A3(n,l,s,u,c){let d=qn(pv(n),pv(l)),f=l-n,p=Yl(c/u*f,s);do{let g=s[p],v=u*g/f;if(v>=c&&d+(g<5?Ai.get(g):0)<=17)return[g,v]}while(++p(l=Pt((s=+c)*Ie))+"px"),[n,l,s]}function M3(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(m,y,z,E){let N=y.valToPct(m);return E+z*(y.dir==-1?1-N:N)}function f(m,y,z,E){let N=y.valToPct(m);return E+z*(y.dir==-1?N:1-N)}function p(m,y,z,E){return y.ori==)DELIM" +R"DELIM(0?d(m,y,z,E):f(m,y,z,E)}u.valToPosH=d,u.valToPosV=f;let g=!1;u.status=0;const v=u.root=Ml(Uw);if(n.id!=null&&(v.id=n.id),dl(v,n.class),n.title){let m=Ml(Lw,v);m.textContent=n.title}const x=Gl("canvas"),_=u.ctx=x.getContext("2d"),T=Ml(Hw,v);os("click",T,m=>{m.target===j&&(Pe!=kn||at!=ea)&&Ve.click(u,m)},!0);const w=u.under=Ml(Bw,T);T.appendChild(x);const j=u.over=Ml(qw,T);n=pu(n);const H=+Je(n.pxAlign,1),$=Rv(H);(n.plugins||[]).forEach(m=>{m.opts&&(n=m.opts(u,n)||n)});const W=n.ms||.001,K=u.series=c==1?Zv(n.series||[],Av,Dv,!1):_3(n.series||[null],jv),V=u.axes=Zv(n.axes||[],Tv,Nv,!0),q=u.scales={},ae=u.bands=n.bands||[];ae.forEach(m=>{m.fill=$e(m.fill||null),m.dir=Je(m.dir,-1)});const te=c==2?K[1].facets[0].scale:K[0].scale,P={axes:ju,series:Go},se=(n.drawOrder||["axes","series"]).map(m=>P[m]);function Me(m){const y=m.distr==3?z=>La(z>0?z:m.clamp(u,z,m.min,m.max,m.key)):m.distr==4?z=>Wd(z,m.asinh):m.distr==100?z=>m.fwd(z):z=>z;return z=>{let E=y(z),{_min:N,_max:C}=m,X=C-N;return(E-N)/X}}function ze(m){let y=q[m];if(y==null){let z=(n.scales||jr)[m]||jr;if(z.from!=null){ze(z.from);let E=Jt({},q[z.from],z,{key:m});E.valToPct=Me(E),q[m]=E}else{y=q[m]=Jt({},m==te?_b:o3,z),y.key=m;let E=y.time,N=y.range,C=zi(N);if((m!=te||c==2&&!E)&&(C&&(N[0]==null||N[1]==null)&&(N={min:N[0]==null?dv:{mode:1,hard:N[0],soft:N[0]},max:N[1]==null?dv:{mode:1,hard:N[1],soft:N[1]}},C=!1),!C&&Zo(N))){let X=N;N=(ee,le,ue)=>le==null?mu:To(le,ue,X)}y.range=$e(N||(E?z3:m==te?y.distr==3?w3:y.distr==4?T3:Db:y.distr==3?Cb:y.distr==4?Rb:E3)),y.auto=$e(C?!1:y.auto),y.clamp=$e(y.clamp||c3),y._min=y._max=null,y.valToPct=Me(y)}}}ze("x"),ze("y"),c==1&&K.forEach(m=>{ze(m.scale)}),V.forEach(m=>{ze(m.scale)});for(let m in n.scales)ze(m);const ne=q[te],be=ne.distr;let ce,Ee;ne.ori==0?(dl(v,kw),ce=d,Ee=f):(dl(v,Zw),ce=f,Ee=d);const he={};for(let m in q){let y=q[m];(y.min!=null||y.max!=null)&&(he[m]={min:y.min,max:y.max},y.min=y.max=null)}const U=n.tzDate||(m=>new Date(Pt(m/W))),Y=n.fmtDate||Wh,pe=W==1?kT(U):HT(U),Ne=zv(U,_v(W==1?UT:LT,Y)),Se=wv(U,Ev(qT,Y)),M=[],L=u.legend=Jt({},YT,n.legend),G=u.cursor=Jt({},FT,{drag:{y:c==2}},n.cursor),ie=L.show,_e=G.show,ge=L.markers;L.idxs=M,ge.width=$e(ge.width),ge.dash=$e(ge.dash),ge.stroke=$e(ge.stroke),ge.fill=$e(ge.fill);let ve,mt,Ge,nt=[],On=[],tl,jn=!1,_n={};if(L.live){const m=K[1]?K[1].values:null;jn=m!=null,tl=jn?m(u,1,0):{_:0};for(let y in tl)_n[y]=Qh}if(ie)if(ve=Gl("table",Kw,v),Ge=Gl("tbody",null,ve),L.mount(u,ve),jn){mt=Gl("thead",null,ve,Ge);let m=Gl("tr",null,mt);Gl("th",null,m);for(var Vl in tl)Gl("th",P0,m).textContent=Vl}else dl(ve,Jw),L.live&&dl(ve,Xw);const Kl={show:!0},Oi={show:!1};function ji(m,y){if(y==0&&(jn||!L.live||c==2))return mu;let z=[],E=Gl("tr",Fw,Ge,Ge.childNodes[y]);dl(E,m.class),m.show||dl(E,ss);let N=Gl("th",null,E);if(ge.show){let ee=Ml(Ww,N);if(y>0){let le=ge.width(u,y);le&&(ee.style.border=le+"px "+ge.dash(u,y)+" "+ge.stroke(u,y)),ee.style.background=ge.fill(u,y)}}let C=Ml(P0,N);m.label instanceof HTMLElement?C.appendChild(m.label):C.textContent=m.label,y>0&&(ge.show||(C.style.color=m.width>0?ge.stroke(u,y):ge.fill(u,y)),Ft("click",N,ee=>{if(G._lock)return;ll(ee);let le=K.indexOf(m);if((ee.ctrlKey||ee.metaKey)!=L.isolate){let ue=K.some((re,de)=>de>0&&de!=le&&re.show);K.forEach((re,de)=>{de>0&&Zn(de,ue?de==le?Kl:Oi:Kl,!0,Dt.setSeries)})}else Zn(le,{show:!m.show},!0,Dt.setSeries)},!1),ha&&Ft(lv,N,ee=>{G._lock||(ll(ee),Zn(K.indexOf(m),Wa,!0,Dt.setSeries))},!1));for(var X in tl){let ee=Gl("td",Iw,E);ee.textContent="--",z.push(ee)}return[E,z]}const Dl=new Map;function Ft(m,y,z,E=!0){const N=Dl.get(y)||{},C=G.bind[m](u,y,z,E);C&&(os(m,y,N[m]=C),Dl.set(y,N))}function Xl(m,y,z){const E=Dl.get(y)||{};for(let N in E)(m==null||N==m)&&(oh(N,y,E[N]),delete E[N]);m==null&&Dl.delete(y)}let Cl=0,ra=0,we=0,oe=0,lt=0,Ot=0,Rl=lt,ca=Ot,nl=we,oa=oe,Dn=0,nn=0,rt=0,Gt=0;u.bbox={};let on=!1,vs=!1,Ba=!1,fa=!1,da=!1,fn=!1;function qa(m,y,z){(z||m!=u.width||y!=u.height)&&Jl(m,y),Qa(!1),Ba=!0,vs=!0,Pl()}function Jl(m,y){u.width=Cl=we=m,u.height=ra=oe=y,lt=Ot=0,Br(),zu();let z=u.bbox;Dn=z.left=as(lt*Ie,.5),nn=z.top=as(Ot*Ie,.5),rt=z.width=as(we*Ie,.5),Gt=z.height=as(oe*Ie,.5)}const ys=3;function Di(){let m=!1,y=0;for(;!m;){y++;let z=Yr(y),E=Qr(y);m=y==ys||z&&E,m||(Jl(u.width,u.height),vs=!0)}}function $o({width:m,height:y}){qa(m,y)}u.setSize=$o;function Br(){let m=!1,y=!1,z=!1,E=!1;V.forEach((N,C)=>{if(N.show&&N._show){let{side:X,_size:ee}=N,le=X%2,ue=N.label!=null?N.labelSize:0,re=ee+ue;re>0&&(le?(we-=re,X==3?(lt+=re,E=!0):z=!0):(oe-=re,X==0?(Ot+=re,m=!0):y=!0))}}),Gn[0]=m,Gn[1]=z,Gn[2]=y,Gn[3]=E,we-=kl[1]+kl[3],lt+=kl[3],oe-=kl[2]+kl[0],Ot+=kl[0]}function zu(){let m=lt+we,y=Ot+oe,z=lt,E=Ot;function N(C,X){switch(C){case 1:return m+=X,m-X;case 2:return y+=X,y-X;case 3:return z-=X,z+X;case 0:return E-=X,E+X}}V.forEach((C,X)=>{if(C.show&&C._show){let ee=C.side;C._pos=N(ee,C._size),C.label!=null&&(C._lpos=N(ee,C.labelSize))}})}if(G.dataIdx==null){let m=G.hover,y=m.skip=new Set(m.skip??[]);y.add(void 0);let z=m.prox=$e(m.prox),E=m.bias??=0;G.dataIdx=(N,C,X,ee)=>{if(C==0)return X;let le=X,ue=z(N,C,X,ee)??gt,re=ue>=0&&ue0;)y.has(Ce[xe])||(Ue=xe);if(E==0||E==1)for(xe=X;Oe==null&&xe++ue&&(le=null);return le}}const ll=m=>{G.event=m};G.idxs=M,G._lock=!1;let ln=G.points;ln.show=$e(ln.show),ln.size=$e(ln.size),ln.stroke=$e(ln.stroke),ln.width=$e(ln.width),ln.fill=$e(ln.fill);const al=u.focus=Jt({},n.focus||{alpha:.3},G.focus),ha=al.prox>=0,ma=ha&&ln.one;let zn=[],Fl=[],pa=[];function Eu(m,y){let z=ln.show(u,y);if(z instanceof HTMLElement)return dl(z,Vw),dl(z,m.class),ua(z,-10,-10,we,oe),j.insertBefore(z,zn[y]),z}function Ul(m,y){if(c==1||y>0){let z=c==1&&q[m.scale].time,E=m.value;m.value=z?yv(E)?wv(U,Ev(E,Y)):E||Se:E||s3,m.label=m.label||(z?IT:WT)}if(ma||y>0){m.width=m.width==null?1:m.width,m.paths=m.paths||S3||oT,m.fillTo=$e(m.fillTo||f3),m.pxAlign=+Je(m.pxAlign,H),m.pxRound=Rv(m.pxAlign),m.stroke=$e(m.stroke||null),m.fill=$e(m.fill||null),m._stroke=m._fill=m._paths=m._focus=null;let z=u3(qn(1,m.width),1),E=m.points=Jt({},{size:z,width:qn(1,z*.2),stroke:m.stroke,space:z*2,paths:x3,_stroke:null,_fill:null},m.points);E.show=$e(E.show),E.filter=$e(E.filter),E.fill=$e(E.fill),E.stroke=$e(E.stroke),E.paths=$e(E.paths),E.pxAlign=m.pxAlign}if(ie){let z=ji(m,y);nt.splice(y,0,z[0]),On.splice(y,0,z[1]),L.values.push(null)}if(_e){M.splice(y,0,null);let z=null;ma?y==0&&(z=Eu(m,y)):y>0&&(z=Eu(m,y)),zn.splice(y,0,z),Fl.splice(y,0,0),pa.splice(y,0,0)}Ht("addSeries",y)}function Wt(m,y){y=y??K.length,m=c==1?gh(m,y,Av,Dv):gh(m,y,{},jv),K.splice(y,0,m),Ul(K[y],y)}u.addSeries=Wt;function En(m){if(K.splice(m,1),ie){L.values.splice(m,1),On.splice(m,1);let y=nt.splice(m,1)[0];Xl(null,y.firstChild),y.remove()}_e&&(M.splice(m,1),zn.splice(m,1)[0].remove(),Fl.splice(m,1),pa.splice(m,1)),Ht("delSeries",m)}u.delSeries=En;const Gn=[!1,!1,!1,!1];function wu(m,y){if(m._show=m.show,m.show){let z=m.side%2,E=q[m.scale];E==null&&(m.scale=z?K[1].scale:te,E=q[m.scale]);let N=E.time;m.size=$e(m.size),m.space=$e(m.space),m.rotate=$e(m.rotate),zi(m.incrs)&&m.incrs.forEach(X=>{!Ai.has(X)&&Ai.set(X,lb(X))}),m.incrs=$e(m.incrs||(E.distr==2?DT:N?W==1?RT:ZT:is)),m.splits=$e(m.splits||(N&&E.distr==1?pe:E.distr==3?dh:E.distr==4?t3:e3)),m.stroke=$e(m.stroke),m.grid.stroke=$e(m.grid.stroke),m.ticks.stroke=$e(m.ticks.stroke),m.border.stroke=$e(m.border.stroke);let C=m.values;m.values=zi(C)&&!zi(C[0])?$e(C):N?zi(C)?zv(U,_v(C,Y)):yv(C)?BT(U,C):C||Ne:C||PT,m.filter=$e(m.filter||(E.distr>=3&&E.log==10?a3:E.distr==3&&E.log==2?i3:tb)),m.font=Lv(m.font),m.labelFont=Lv(m.labelFont),m._size=m.size(u,null,y,0),m)DELIM" +R"DELIM(._space=m._rotate=m._incrs=m._found=m._splits=m._values=null,m._size>0&&(Gn[y]=!0,m._el=Ml($w,T))}}function Ci(m,y,z,E){let[N,C,X,ee]=z,le=y%2,ue=0;return le==0&&(ee||C)&&(ue=y==0&&!N||y==2&&!X?Pt(Tv.size/3):0),le==1&&(N||X)&&(ue=y==1&&!C||y==3&&!ee?Pt(Nv.size/2):0),ue}const qr=u.padding=(n.padding||[Ci,Ci,Ci,Ci]).map(m=>$e(Je(m,Ci))),kl=u._padding=qr.map((m,y)=>m(u,y,Gn,0));let At,jt=null,bt=null;const Zl=c==1?K[0].idxs:null;let dn=null,vl=!1;function Lt(m,y){if(l=m??[],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 m,y;c==1&&(At>0?(jt=Zl[0]=0,bt=Zl[1]=At-1,m=l[0][jt],y=l[0][bt],be==2?(m=jt,y=bt):m==y&&(be==3?[m,y]=Uo(m,m,ne.log,!1):be==4?[m,y]=Kh(m,m,ne.log,!1):ne.time?y=m+Pt(86400/W):[m,y]=To(m,y,Xh,!0))):(jt=Zl[0]=m=null,bt=Zl[1]=y=null)),Qn(te,m,y)}let Ri,Yn,Wl,Tu,Ss,xs,Au,$a,Ga,Et;function Cn(m,y,z,E,N,C){m??=tv,z??=Fh,E??="butt",N??=tv,C??="round",m!=Ri&&(_.strokeStyle=Ri=m),N!=Yn&&(_.fillStyle=Yn=N),y!=Wl&&(_.lineWidth=Wl=y),C!=Ss&&(_.lineJoin=Ss=C),E!=xs&&(_.lineCap=xs=E),z!=Tu&&_.setLineDash(Tu=z)}function Mu(m,y,z,E){y!=Yn&&(_.fillStyle=Yn=y),m!=Au&&(_.font=Au=m),z!=$a&&(_.textAlign=$a=z),E!=Ga&&(_.textBaseline=Ga=E)}function Nu(m,y,z,E,N=0){if(E.length>0&&m.auto(u,vl)&&(y==null||y.min==null)){let C=Je(jt,0),X=Je(bt,E.length-1),ee=z.min==null?aT(E,C,X,N,m.distr==3):[z.min,z.max];m.min=Ql(m.min,z.min=ee[0]),m.max=qn(m.max,z.max=ee[1])}}const _s={min:null,max:null};function $r(){for(let E in q){let N=q[E];he[E]==null&&(N.min==null||he[te]!=null&&N.auto(u,vl))&&(he[E]=_s)}for(let E in q){let N=q[E];he[E]==null&&N.from!=null&&he[N.from]!=null&&(he[E]=_s)}he[te]!=null&&Qa(!0);let m={};for(let E in he){let N=he[E];if(N!=null){let C=m[E]=pu(q[E],hT);if(N.min!=null)Jt(C,N);else if(E!=te||c==2)if(At==0&&C.from==null){let X=C.range(u,null,null,E);C.min=X[0],C.max=X[1]}else C.min=gt,C.max=-gt}}if(At>0){K.forEach((E,N)=>{if(c==1){let C=E.scale,X=he[C];if(X==null)return;let ee=m[C];if(N==0){let le=ee.range(u,ee.min,ee.max,C);ee.min=le[0],ee.max=le[1],jt=Yl(ee.min,l[0]),bt=Yl(ee.max,l[0]),bt-jt>1&&(l[0][jt]ee.max&&bt--),E.min=dn[jt],E.max=dn[bt]}else E.show&&E.auto&&Nu(ee,X,E,l[N],E.sorted);E.idxs[0]=jt,E.idxs[1]=bt}else if(N>0&&E.show&&E.auto){let[C,X]=E.facets,ee=C.scale,le=X.scale,[ue,re]=l[N],de=m[ee],De=m[le];de!=null&&Nu(de,he[ee],C,ue,C.sorted),De!=null&&Nu(De,he[le],X,re,X.sorted),E.min=X.min,E.max=X.max}});for(let E in m){let N=m[E],C=he[E];if(N.from==null&&(C==null||C.min==null)){let X=N.range(u,N.min==gt?null:N.min,N.max==-gt?null:N.max,E);N.min=X[0],N.max=X[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 X=N.range(u,C.min,C.max,E);N.min=X[0],N.max=X[1]}}}let y={},z=!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 X=C.distr;C._min=X==3?La(C.min):X==4?Wd(C.min,C.asinh):X==100?C.fwd(C.min):C.min,C._max=X==3?La(C.max):X==4?Wd(C.max,C.asinh):X==100?C.fwd(C.max):C.max,y[E]=z=!0}}if(z){K.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);_e&&G.left>=0&&(fa=fn=!0)}for(let E in he)he[E]=null}function zs(m){let y=fh(jt-1,0,At-1),z=fh(bt+1,0,At-1);for(;m[y]==null&&y>0;)y--;for(;m[z]==null&&z0){let m=K.some(y=>y._focus)&&Et!=al.alpha;m&&(_.globalAlpha=Et=al.alpha),K.forEach((y,z)=>{if(z>0&&y.show&&(Rn(z,!1),Rn(z,!0),y._paths==null)){let E=Et;Et!=y.alpha&&(_.globalAlpha=Et=y.alpha);let N=c==2?[0,l[z][0].length-1]:zs(l[z]);y._paths=y.paths(u,z,N[0],N[1]),Et!=E&&(_.globalAlpha=Et=E)}}),K.forEach((y,z)=>{if(z>0&&y.show){let E=Et;Et!=y.alpha&&(_.globalAlpha=Et=y.alpha),y._paths!=null&&Es(z,!1);{let N=y._paths!=null?y._paths.gaps:null,C=y.points.show(u,z,jt,bt,N),X=y.points.filter(u,z,C,N);(C||X)&&(y.points._paths=y.points.paths(u,z,jt,bt,X),Es(z,!0))}Et!=E&&(_.globalAlpha=Et=E),Ht("drawSeries",z)}}),m&&(_.globalAlpha=Et=1)}}function Rn(m,y){let z=y?K[m].points:K[m];z._stroke=z.stroke(u,m),z._fill=z.fill(u,m)}function Es(m,y){let z=y?K[m].points:K[m],{stroke:E,fill:N,clip:C,flags:X,_stroke:ee=z._stroke,_fill:le=z._fill,_width:ue=z.width}=z._paths;ue=vt(ue*Ie,3);let re=null,de=ue%2/2;y&&le==null&&(le=ue>0?"#fff":ee);let De=z.pxAlign==1&&de>0;if(De&&_.translate(de,de),!y){let Qe=Dn-ue/2,Ce=nn-ue/2,Ue=rt+ue,Oe=Gt+ue;re=new Path2D,re.rect(Qe,Ce,Ue,Oe)}y?Il(ee,ue,z.dash,z.cap,le,E,N,X,C):Gr(m,ee,ue,z.dash,z.cap,le,E,N,X,re,C),De&&_.translate(-de,-de)}function Gr(m,y,z,E,N,C,X,ee,le,ue,re){let de=!1;le!=0&&ae.forEach((De,Qe)=>{if(De.series[0]==m){let Ce=K[De.series[1]],Ue=l[De.series[1]],Oe=(Ce._paths||jr).band;zi(Oe)&&(Oe=De.dir==1?Oe[0]:Oe[1]);let xe,ct=null;Ce.show&&Oe&&sT(Ue,jt,bt)?(ct=De.fill(u,Qe)||C,xe=Ce._paths.clip):Oe=null,Il(y,z,E,N,ct,X,ee,le,ue,re,xe,Oe),de=!0}}),de||Il(y,z,E,N,C,X,ee,le,ue,re)}const ws=gu|mh;function Il(m,y,z,E,N,C,X,ee,le,ue,re,de){Cn(m,y,z,E,N),(le||ue||de)&&(_.save(),le&&_.clip(le),ue&&_.clip(ue)),de?(ee&ws)==ws?(_.clip(de),re&&_.clip(re),ki(N,X),Ui(m,C,y)):ee&mh?(ki(N,X),_.clip(de),Ui(m,C,y)):ee&gu&&(_.save(),_.clip(de),re&&_.clip(re),ki(N,X),_.restore(),Ui(m,C,y)):(ki(N,X),Ui(m,C,y)),(le||ue||de)&&_.restore()}function Ui(m,y,z){z>0&&(y instanceof Map?y.forEach((E,N)=>{_.strokeStyle=Ri=N,_.stroke(E)}):y!=null&&m&&_.stroke(y))}function ki(m,y){y instanceof Map?y.forEach((z,E)=>{_.fillStyle=Yn=E,_.fill(z)}):y!=null&&m&&_.fill(y)}function Ya(m,y,z,E){let N=V[m],C;if(E<=0)C=[0,0];else{let X=N._space=N.space(u,m,y,z,E),ee=N._incrs=N.incrs(u,m,y,z,E,X);C=A3(y,z,ee,E,X)}return N._found=C}function Ou(m,y,z,E,N,C,X,ee,le,ue){let re=X%2/2;H==1&&_.translate(re,re),Cn(ee,X,le,ue,ee),_.beginPath();let de,De,Qe,Ce,Ue=N+(E==0||E==3?-C:C);z==0?(De=N,Ce=Ue):(de=N,Qe=Ue);for(let Oe=0;Oe{if(!z.show)return;let N=q[z.scale];if(N.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,X=C%2,{min:ee,max:le}=N,[ue,re]=Ya(E,ee,le,X==0?we:oe);if(re==0)return;let de=N.distr==2,De=z._splits=z.splits(u,E,ee,le,ue,re,de),Qe=N.distr==2?De.map(xe=>dn[xe]):De,Ce=N.distr==2?dn[De[1]]-dn[De[0]]:ue,Ue=z._values=z.values(u,z.filter(u,Qe,E,re,Ce),E,re,Ce);z._rotate=C==2?z.rotate(u,Ue,E,re):0;let Oe=z._size;z._size=Nl(z.size(u,Ue,E,m)),Oe!=null&&z._size!=Oe&&(y=!1)}),y}function Qr(m){let y=!0;return qr.forEach((z,E)=>{let N=z(u,E,Gn,m);N!=kl[E]&&(y=!1),kl[E]=N}),y}function ju(){for(let m=0;mdn[un]):Qe,Ue=re.distr==2?dn[Qe[1]]-dn[Qe[0]]:le,Oe=y.ticks,xe=y.border,ct=Oe.show?Oe.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=$(y._pos*Ie),hn=(St+Ct)*ee,Bt=it+hn;C=E==0?Bt:0,N=E==1?Bt:0;let Tn=y.font[0],Vn=y.align==1?au:y.align==2?Xd:et>0?au:et<0?Xd:E==0?"center":z==3?Xd:au,an=et||E==1?"middle":z==2?zr:ev;Mu(Tn,X,Vn,an);let Yt=y.font[1]*y.lineGap,An=Qe.map(un=>$(p(un,re,de,De))),Kn=y._values;for(let un=0;un{z>0&&(y._paths=null,m&&(c==1?(y.min=null,y.max=null):y.facets.forEach(E=>{E.min=null,E.max=null})))})}let Ts=!1,Va=!1,Un=[];function Du(){Va=!1;for(let m=0;m0&&queueMicrotask(Du)}u.batch=Ka;function ga(){if(on&&($r(),on=!1),Ba&&(Di(),Ba=!1),vs){if(zt(w,au,lt),zt(w,zr,Ot),zt(w,Tr,we),zt(w,Ar,oe),zt(j,au,lt),zt(j,zr,Ot),zt(j,Tr,we),zt(j,Ar,oe),zt(T,Tr,Cl),zt(T,Ar,ra),x.width=Pt(Cl*Ie),x.height=Pt(ra*Ie),V.forEach(({_el:m,_show:y,_size:z,_pos:E,side:N})=>{if(m!=null)if(y){let C=N===3||N===0?z:0,X=N%2==1;zt(m,X?"left":"top",E-C),zt(m,X?"width":"height",z),zt(m,X?"top":"left",X?Ot:lt),zt(m,X?"height":"width",X?oe:we),ch(m,ss)}else dl(m,ss)}),Ri=Yn=Wl=Ss=xs=Au=$a=Ga=Tu=null,Et=1,qi(!0),lt!=Rl||Ot!=ca||we!=nl||oe!=oa){Qa(!1);let m=we/nl,y=oe/oa;if(_e&&!fa&&G.left>=0){G.left*=m,G.top*=y,yl&&ua(yl,Pt(G.left),0,we,oe),wn&&ua(wn,0,Pt(G.top),we,oe);for(let z=0;z=0&&Fe.width>0){Fe.left*=m,Fe.width*=m,Fe.top*=y,Fe.height*=y;for(let z in Lu)zt(Ja,z,Fe[z])}Rl=lt,ca=Ot,nl=we,oa=oe}Ht("setSize"),vs=!1}Cl>0&&ra>0&&(_.clearRect(0,0,x.width,x.height),Ht("drawClear"),se.forEach(m=>m()),Ht("draw")),Fe.show&&da&&(Fa(Fe),da=!1),_e&&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,Ts=!1}u.redraw=(m,y)=>{Ba=y||!1,m!==!1?Qn(te,ne.min,ne.max):Pl()};function As(m,y){let z=q[m];if(z.from==null){if(At==0){let E=z.range(u,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(At>1&&y.min!=null&&y.max!=null&&y.max-y.min<1e-16)return;m==te&&z.distr==2&&At>0&&(y.min=Yl(y.min,l[0]),y.max=Yl(y.max,l[0]),y.min==y.max&&y.max++),he[m]=y,on=!0,Pl()}}u.setScale=As;let Zi,Ms,yl,wn,Ns,Xa,kn,ea,Li,Cu,Pe,at,Ll=!1;const Ve=G.drag;let yt=Ve.x,Mt=Ve.y;_e&&(G.x&&(Zi=Ml(Yw,j)),G.y&&(Ms=Ml(Qw,j)),ne.ori==0?(yl=Zi,wn=Ms):(yl=Ms,wn=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(Gw,Fe.over?j:w):null;function Fa(m,y){if(Fe.show){for(let z in m)Fe[z]=m[z],z in Lu&&zt(Ja,z,m[z]);y!==!1&&Ht("setSelect")}}u.setSelect=Fa;function Ru(m){if(K[m].show)ie&&ch(nt[m],ss);else if(ie&&dl(nt[m],ss),_e){let z=ma?zn[0]:zn[m];z!=null&&ua(z,-10,-10,we,oe)}}function Qn(m,y,z){As(m,{min:y,max:z})}function Zn(m,y,z,E){y.focus!=null&&Ko(m),y.show!=null&&K.forEach((N,C)=>{C>0&&(m==C||m==null)&&(N.show=y.show,Ru(C),c==2?(Qn(N.facets[0].scale,null,null),Qn(N.facets[1].scale,null,null)):Qn(N.scale,null,null),Pl())}),z!==!1&&Ht("setSeries",m,y),E&&Pa("setSeries",u,m,y)}u.setSeries=Zn;function Vr(m,y){Jt(ae[m],y)}function Yo(m,y){m.fill=$e(m.fill||null),m.dir=Je(m.dir,-1),y=y??ae.length,ae.splice(y,0,m)}function Qo(m){m==null?ae.length=0:ae.splice(m,1)}u.addBand=Yo,u.setBand=Vr,u.delBand=Qo;function Vo(m,y){K[m].alpha=y,_e&&zn[m]!=null&&(zn[m].style.opacity=y),ie&&nt[m]&&(nt[m].style.opacity=y)}let il,ta,va;const Wa={focus:!0};function Ko(m){if(m!=va){let y=m==null,z=al.alpha!=1;K.forEach((E,N)=>{if(c==1||N>0){let C=y||N==0||N==m;E._focus=y?null:C,z&&Vo(N,C?1:al.alpha)}}),va=m,z&&Pl()}}ie&&ha&&Ft(av,ve,m=>{G._lock||(ll(m),va!=null&&Zn(null,Wa,!0,Dt.setSeries))});function bl(m,y,z){let E=q[y];z&&(m=m/Ie-(E.ori==1?Ot:lt));let N=we;E.ori==1&&(N=oe,m=N-m),E.dir==-1&&(m=N-m);let C=E._min,X=E._max,ee=m/N,le=C+(X-C)*ee,ue=E.distr;return ue==3?hu(10,le):ue==4?rT(le,E.asinh):ue==100?E.bwd(le):le}function Kr(m,y){let z=bl(m,te,y);return Yl(z,l[0],jt,bt)}u.valToIdx=m=>Yl(m,l[0]),u.posToIdx=Kr,u.posToVal=bl,u.valToPos=(m,y,z)=>q[y].ori==0?d(m,q[y],z?rt:we,z?Dn:0):f(m,q[y],z?Gt:oe,z?nn:0),u.setCursor=(m,y,z)=>{Pe=m.left,at=m.top,ya(null,y,z)};function Xr(m,y){zt(Ja,au,Fe.left=m),zt(Ja,Tr,Fe.width=y)}function Jr(m,y){zt(Ja,zr,Fe.top=m),zt(Ja,Ar,Fe.height=y)}let Hi=ne.ori==0?Xr:Jr,Bi=ne.ori==1?Xr:Jr;function Uu(){if(ie&&L.live)for(let m=c==2?1:0;m{M[E]=z}):dT(m.idx)||M.fill(m.idx),L.idx=M[0]),ie&&L.live){for(let z=0;z0||c==1&&!jn)&&Xo(z,M[z]);Uu()}fn=!1,y!==!1&&Ht("setLegend")}u.setLegend=ku;function Xo(m,y){let z=K[m],E=m==0&&be==2?dn:l[m],N;jn?N=z.values(u,m,y)??_n:(N=z.value(u,y==null?null:E[y],m,y),N=N==null?_n:{_:N}),L.values[m]=N}function ya(m,y,z){Li=Pe,Cu=at,[Pe,at]=G.move(u,Pe,at),G.left=Pe,G.top=at,_e&&(yl&&ua(yl,Pt(Pe),0,we,oe),wn&&ua(wn,0,Pt(at),we,oe));let E,N=jt>bt;il=gt,ta=null;let C=ne.ori==0?we:oe,X=ne.ori==1?we:oe;if(Pe<0||At==0||N){E=G.idx=null;for(let ee=0;ee0&&ct.show){let hn=et==null?-10:et==E?ue:ce(c==1?l[0][et]:l[xe][0][et],ne,C,0),Bt=it==null?-10:Ee(it,c==1?q[ct.scale]:q[ct.facets[1].scale],X,0);if(ha&&it!=null){let Tn=ne.ori==1?Pe:at,Vn=en(al.dist(u,xe,et,Bt,Tn));if(Vn=0?1:-1,Kn=Yt>=0?1:-1;Kn==An&&(Kn==1?an==1?it>=Yt:it<=Yt:an==1?it<=Yt:it>=Yt)&&(il=Vn,ta=xe)}else il=Vn,ta=xe}}if(fn||ma){let Tn,Vn;ne.ori==0?(Tn=hn,Vn=Bt):(Tn=Bt,Vn=hn);let an,Yt,An,Kn,sn,un,Mn=!0,na=ln.bbox;if(na!=null){Mn=!1;let mn=na(u,xe);An=mn.left,Kn=mn.top,an=mn.width,Yt=mn.height}else An=Tn,Kn=Vn,an=Yt=ln.size(u,xe);if(un=ln.fill(u,xe),sn=ln.stroke(u,xe),ma)xe==ta&&il<=al.prox&&(re=An,de=Kn,De=an,Qe=Yt,Ce=Mn,Ue=un,Oe=sn);else{let mn=zn[xe];mn!=null&&(Fl[xe]=An,pa[xe]=Kn,fv(mn,an,Yt,Mn),cv(mn,un,sn),ua(mn,Nl(An),Nl(Kn),we,oe))}}}}if(ma){let xe=al.prox,ct=va==null?il<=xe:il>xe||ta!=va;if(fn||ct){let St=zn[0];St!=null&&(Fl[0]=re,pa[0]=de,fv(St,De,Qe,Ce),cv(St,Ue,Oe),ua(St,Nl(re),Nl(de),we,oe))}}}if(Fe.show&&Ll)if(m!=null){let[ee,le]=Dt.scales,[ue,re]=Dt.match,[de,De]=m.cursor.sync.scales,Qe=m.cursor.drag;if(yt=Qe._x,Mt=Qe._y,yt||Mt){let{left:Ce,top:Ue,width:Oe,height:xe}=m.select,ct=m.scales[de].ori,St=m.posToVal,Ct,et,it,hn,Bt,Tn=ee!=null&&ue(ee,de),Vn=le!=null&&re(le,De);Tn&&yt?(ct==0?(Ct=Ce,et=Oe):(Ct=Ue,et=xe),it=q[ee],hn=ce(St(Ct,de),it,C,0),Bt=ce(St(Ct+et,de),it,C,0),Hi(Ql(hn,Bt),en(Bt-hn))):Hi(0,C),Vn&&Mt?(ct==1?(Ct=Ce,et=Oe):(Ct=Ue,et=xe),it=q[le],hn=Ee(St(Ct,De),it,X,0),Bt=Ee(St(Ct+et,De),it,X,0),Bi(Ql(hn,Bt),en(Bt-hn))):Bi(0,X)}else Hu()}else{let ee=en(Li-Ns),le=en(Cu-Xa);if(ne.ori==1){let De=ee;ee=le,le=De}yt=Ve.x&&ee>=Ve.dist,Mt=Ve.y&&le>=Ve.dist;let ue=Ve.uni;ue!=null?yt&&Mt&&(yt=ee>=ue,Mt=le>=ue,!yt&&!Mt&&(le>ee?Mt=!0:yt=!0)):Ve.x&&Ve.y&&(yt||Mt)&&(yt=Mt=!0);let re,de;yt&&(ne.ori==0?(re=kn,de=Pe):(re=ea,de=at),Hi(Ql(re,de),en(de-re)),Mt||Bi(0,X)),Mt&&(ne.ori==1?(re=kn,de=Pe):(re=ea,de=at),Bi(Ql(re,de),en(de-re)),yt||Hi(0,C)),!yt&&!Mt&&(Hi(0,0),Bi(0,0))}if(Ve._x=yt,Ve._y=Mt,m==null){if(z){if(tc!=null){let[ee,le]=Dt.scales;Dt.values[0]=ee!=null?bl(ne.ori==0?Pe:at,ee):null,Dt.values[1]=le!=null?bl(ne.ori==1?Pe:at,le):null}Pa(Jd,u,Pe,at,we,oe,E)}if(ha){let ee=z&&Dt.setSeries,le=al.prox;va==null?il<=le&&Zn(ta,Wa,)DELIM" +R"DELIM(!0,ee):il>le?Zn(null,Wa,!0,ee):ta!=va&&Zn(ta,Wa,!0,ee)}}fn&&(L.idx=E,ku()),y!==!1&&Ht("setCursor")}let Hl=null;Object.defineProperty(u,"rect",{get(){return Hl==null&&qi(!1),Hl}});function qi(m=!1){m?Hl=null:(Hl=j.getBoundingClientRect(),Ht("syncRect",Hl))}function Fr(m,y,z,E,N,C,X){G._lock||Ll&&m!=null&&m.movementX==0&&m.movementY==0||(Zu(m,y,z,E,N,C,X,!1,m!=null),m!=null?ya(null,!0,!0):ya(y,!0,!1))}function Zu(m,y,z,E,N,C,X,ee,le){if(Hl==null&&qi(!1),ll(m),m!=null)z=m.clientX-Hl.left,E=m.clientY-Hl.top;else{if(z<0||E<0){Pe=-10,at=-10;return}let[ue,re]=Dt.scales,de=y.cursor.sync,[De,Qe]=de.values,[Ce,Ue]=de.scales,[Oe,xe]=Dt.match,ct=y.axes[0].side%2==1,St=ne.ori==0?we:oe,Ct=ne.ori==1?we:oe,et=ct?C:N,it=ct?N:C,hn=ct?E:z,Bt=ct?z:E;if(Ce!=null?z=Oe(ue,Ce)?p(De,q[ue],St,0):-10:z=St*(hn/et),Ue!=null?E=xe(re,Ue)?p(Qe,q[re],Ct,0):-10:E=Ct*(Bt/it),ne.ori==1){let Tn=z;z=E,E=Tn}}le&&(y==null||y.cursor.event.type==Jd)&&((z<=1||z>=we-1)&&(z=as(z,we)),(E<=1||E>=oe-1)&&(E=as(E,oe))),ee?(Ns=z,Xa=E,[kn,ea]=G.move(u,z,E)):(Pe=z,at=E)}const Lu={width:0,height:0,left:0,top:0};function Hu(){Fa(Lu,!1)}let Wr,Ir,Pr,ec;function Os(m,y,z,E,N,C,X){Ll=!0,yt=Mt=Ve._x=Ve._y=!1,Zu(m,y,z,E,N,C,X,!0,!1),m!=null&&(Ft(Fd,uh,Ia,!1),Pa(nv,u,kn,ea,we,oe,null));let{left:ee,top:le,width:ue,height:re}=Fe;Wr=ee,Ir=le,Pr=ue,ec=re}function Ia(m,y,z,E,N,C,X){Ll=Ve._x=Ve._y=!1,Zu(m,y,z,E,N,C,X,!1,!0);let{left:ee,top:le,width:ue,height:re}=Fe,de=ue>0||re>0,De=Wr!=ee||Ir!=le||Pr!=ue||ec!=re;if(de&&De&&Fa(Fe),Ve.setScale&&de&&De){let Qe=ee,Ce=ue,Ue=le,Oe=re;if(ne.ori==1&&(Qe=le,Ce=re,Ue=ee,Oe=ue),yt&&Qn(te,bl(Qe,te),bl(Qe+Ce,te)),Mt)for(let xe in q){let ct=q[xe];xe!=te&&ct.from==null&&ct.min!=gt&&Qn(xe,bl(Ue+Oe,xe),bl(Ue,xe))}Hu()}else G.lock&&(G._lock=!G._lock,ya(y,!0,m!=null));m!=null&&(Xl(Fd,uh),Pa(Fd,u,Pe,at,we,oe,null))}function Jo(m,y,z,E,N,C,X){if(G._lock)return;ll(m);let ee=Ll;if(Ll){let le=!0,ue=!0,re=10,de,De;ne.ori==0?(de=yt,De=Mt):(de=Mt,De=yt),de&&De&&(le=Pe<=re||Pe>=we-re,ue=at<=re||at>=oe-re),de&&le&&(Pe=Pe{let N=Dt.match[2];z=N(u,y,z),z!=-1&&Zn(z,E,!0,!1)},_e&&(Ft(nv,j,Os),Ft(Jd,j,Fr),Ft(lv,j,m=>{ll(m),qi(!1)}),Ft(av,j,Jo),Ft(iv,j,Bu),ph.add(u),u.syncRect=qi);const $i=u.hooks=n.hooks||{};function Ht(m,y,z){Va?Un.push([m,y,z]):m in $i&&$i[m].forEach(E=>{E.call(null,u,y,z)})}(n.plugins||[]).forEach(m=>{for(let y in m.hooks)$i[y]=($i[y]||[]).concat(m.hooks[y])});const Sa=(m,y,z)=>z,Dt=Jt({key:null,setSeries:!1,filters:{pub:gv,sub:gv},scales:[te,K[1]?K[1].scale:null],match:[vv,vv,Sa],values:[null,null]},G.sync);Dt.match.length==2&&Dt.match.push(Sa),G.sync=Dt;const tc=Dt.key,$u=zb(tc);function Pa(m,y,z,E,N,C,X){Dt.filters.pub(m,y,z,E,N,C,X)&&$u.pub(m,y,z,E,N,C,X)}$u.sub(u);function nc(m,y,z,E,N,C,X){Dt.filters.sub(m,y,z,E,N,C,X)&&ba[m](null,y,z,E,N,C,X)}u.pub=nc;function Gi(){$u.unsub(u),ph.delete(u),Dl.clear(),oh(wo,fu,qu),v.remove(),ve?.remove(),Ht("destroy")}u.destroy=Gi;function xa(){Ht("init",n,l),Lt(l||n.data,!1),he[te]?As(te,he[te]):bs(),da=Fe.show&&(Fe.width>0||Fe.height>0),fa=fn=!0,qa(n.width,n.height)}return K.forEach(Ul),V.forEach(wu),s?s instanceof HTMLElement?(s.appendChild(v),xa()):s(u,xa):xa(),u}cn.assign=Jt;cn.fmtNum=Jh;cn.rangeNum=To;cn.rangeLog=Uo;cn.rangeAsinh=Kh;cn.orient=gs;cn.pxRatio=Ie;cn.join=bT;cn.fmtDate=Wh,cn.tzDate=OT;cn.sync=zb;{cn.addGap=d3,cn.clipGaps=Lo;let n=cn.paths={points:Nb};n.linear=jb,n.stepped=p3,n.bars=g3,n.spline=y3}function N3({data:n,series:l,height:s=280,emptyMessage:u="Waiting for live data…",valueSuffix:c="",zeroBased:d=!0,valueFormatter:f=C3,visualization:p="line",forceEmpty:g=!1}){const v=fe.useRef(null),x=fe.useRef(null),_=fe.useRef(!1),T=fe.useMemo(()=>D3(n),[n]),w=fe.useRef(T),j=!g&&n[0]?.length>0;return fe.useLayoutEffect(()=>{w.current=T},[T]),fe.useLayoutEffect(()=>{const H=v.current;if(!H)return;const $={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:[V=>{V.select.width>0&&(_.current=!0)}]},legend:{show:!0,live:!0},scales:{x:{time:!0},y:{auto:!0,...d?{range:(V,q,ae)=>[Math.min(0,q),ae===0?1:ae*1.08]}:{range:(V,q,ae)=>{const te=ae-q,P=te===0?Math.max(1,Math.abs(ae)*5e-4):te*.08;return[q-P,ae+P]}}}},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:(V,q)=>q.map(ae=>`${f(ae)}${c}`)}],series:[{},...l.map((V,q)=>{const ae=p==="step"?cn.paths.stepped?.({align:1}):p==="bar"?O3(q,l.length):void 0;return{label:V.label,stroke:V.color,fill:p==="area"||p==="bar"?V.fill??`${V.color}24`:V.fill,width:V.width??2,paths:ae,points:{show:p==="line"?V.points??!1:!1},value:(te,P)=>P===null?"—":`${f(P)}${c}`}})]};_.current=!1;const W=new cn($,w.current,H);x.current=W;const K=new ResizeObserver(V=>{const q=V[0]?.contentRect.width;q&&q>0&&W.setSize({width:Math.round(q),height:s})});return K.observe(H),()=>{K.disconnect(),W.destroy(),x.current=null}},[s,l,f,c,p,d]),fe.useEffect(()=>{const H=x.current;if(!H)return;const $=!_.current;H.setData(T,$),$||H.redraw()},[T]),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 O3(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=Hv(u,s),d=-c.groupWidth/2+c.barWidth*n;return Array.from(u.data[0],f=>f+d)}},size:{unit:1,values:u=>[Hv(u,s).barWidth]}}})}function Hv(n,l){const s=j3(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 j3(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 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 R3={300:"5m",900:"15m",3600:"1h"},U3=new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),k3=new Intl.NumberFormat(void 0,{maximumFractionDigits:2});function Z3(n){return U3.format(n)}function L3(n){return k3.format(n)}function H3(n){return n==="height"||n==="occurrences"?Z3:L3}function B3({metrics:n}){const[l,s]=fe.useState(bw),[u,c]=fe.useState(null),[d,f]=fe.useState(!1);fe.useEffect(()=>{Sw(l)},[l]);function p(x){s(_=>u?.mode==="add"?_.length>=su?_:[..._,x]:_.map(T=>T.id===x.id?x:T)),c(null)}function g(x,_){s(T=>{const w=x+_;if(w<0||w>=T.length)return T;const j=[...T],H=j[x],$=j[w];return j[x]=$,j[w]=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:Yy()})},disabled:l.length>=su,className:"bg-accen)DELIM" +R"DELIM(t 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(q3,{chart:x,metrics:n,canMoveEarlier:_>0,canMoveLater:_{s(T=>T.filter(w=>w.id!==x.id))},onDuplicate:()=>{s(T=>T.length>=su?T:[...T,yw(x)])},onEdit:()=>{c({mode:"edit",chart:x})},onMoveEarlier:()=>{g(_,-1)},onMoveLater:()=>{g(_,1)}},x.id))}),u&&S.jsx(Cw,{chart:u.chart,mode:u.mode,onCancel:()=>{c(null)},onSave:p},`${u.mode}-${u.chart.id}`)]})}function q3({chart:n,metrics:l,canMoveEarlier:s,canMoveLater:u,canDuplicate:c,onDelete:d,onDuplicate:f,onEdit:p,onMoveEarlier:g,onMoveLater:v}){const[x,_]=fe.useState(null),[T,w]=fe.useState(0),j=x??l,H=fe.useMemo(()=>ww(j,n),[n,j]),$=fe.useMemo(()=>n.series.map(V=>({label:V.label??Za(V.signalId).label,color:V.color})),[n.series]),W=H3(H.unit),K=`Waiting for ${n.series.length===1?$[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:[Xy(H.unit)," · ",R3[n.range]," · ",n.visualization,x?" · paused":""]})]}),S.jsxs("div",{className:"flex flex-wrap justify-end gap-1 text-xs",children:[S.jsx(ls,{label:x?"Resume chart":"Pause chart",onClick:()=>{_(V=>V?null:l)},children:x?"Resume":"Pause"}),S.jsx(ls,{label:"Reset chart zoom",onClick:()=>{w(V=>V+1)},children:"Reset zoom"}),S.jsx(ls,{label:"Edit chart",onClick:p,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(N3,{data:H.data,series:$,visualization:n.visualization,zeroBased:Aw(H.unit),valueFormatter:W,valueSuffix:Tw(H.unit),forceEmpty:!H.hasObservedData,emptyMessage:K},T)}),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 $3=[{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 G3({adminStatus:n,endpoints:l,metrics:s,native:u,reference:c}){const d=lw(s,10),f=u.configuration,p=Ol(6),g=By(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(x=>x!==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(x=>S.jsx("li",{children:x},x))})]}),!g&&S.jsx(ow,{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?"—":Bn(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?`${RE(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[p]===void 0?"—":Bn(s.signalMaximums[p]),detail:`${Bn(s.signalTotals[p]??0)} confirmations observed`,accent:"blue"}),S.jsx(oo,{label:"Collection uptime",value:CE(s.now-s.sessionStartedAt),detail:`${Bn(s.totalEvents)} events · ${Bn(s.totalLogs)} logs`,accent:"red"})]}),S.jsxs("section",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsx(Bv,{title:"Admin stream",endpoint:l.adminUrl,status:n,detail:n.lastMessageAt?`Last frame ${Nr(n.lastMessageAt)}`:"Waiting for the first frame"}),S.jsx(Bv,{title:"Native interface",endpoint:l.nativeUrl,status:u.status,detail:u.receivedAt?`Last state ${Nr(u.receivedAt)} · ${u.transport}`:"Waiting for node state"})]}),S.jsx(B3,{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:$3.map(({event:x,label:_})=>{const T=s.signalMaximums[Ol(x)];return S.jsxs("div",{className:"bg-surface px-5 py-4",children:[S.jsx("p",{className:"text-textMuted text-xs",children:_}),S.jsx("p",{className:"text-textPrimary mt-2 font-mono text-lg tabular-nums",children:T===void 0?"—":Bn(T)})]},x)})})]}),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?Bn(f.pruned):"Not pruned"})]})]}):S.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:"Wa)DELIM" +R"DELIM(iting 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(Y3,{text:"No events observed yet."}):S.jsx("ul",{className:"divide-y divide-white/5",children:s.recentEvents.slice(0,6).map(x=>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:Nr(x.time)}),S.jsx("span",{className:"text-textPrimary min-w-0 flex-1 truncate font-mono",children:cs(x.event).name}),S.jsx("span",{className:"text-accent tabular-nums",children:ky(x.event,x.value)})]},x.id))})]})})]})}function Bv({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:Zy(l)})]}),S.jsx(rw,{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 Y3({text:n}){return S.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:n})}const Q3=8e3;function V3({localTop:n,referenceTop:l,referenceReceivedAt:s,now:u,browserNotificationsEnabled:c}){const d=fe.useRef(null),[f,p]=fe.useState(null);if(fe.useEffect(()=>{const v=X3(n,l,s,u);if(!v)return;const x=d.current;if(d.current=v.state,!(x===null||x===v.state)&&(p(v),c)){const _=K3(v);NS(_.title,{body:_.body,tag:"libbitcoin-sync-status"})}},[c,n,u,s,l]),fe.useEffect(()=>{if(!f)return;const v=setTimeout(()=>{p(x=>x===f?null:x)},Q3);return()=>{clearTimeout(v)}},[f]),!f)return null;const g=f.state==="synchronized";return S.jsx("aside",{role:"status","aria-live":"polite","aria-atomic":"true",className:`fixed right-4 bottom-4 left-4 z-[60] rounded-xl border p-4 shadow-2xl shadow-black/50 sm:left-auto sm:w-96 ${g?"border-emerald-400/35 bg-emerald-950/95":"border-amber-400/35 bg-amber-950/95"}`,children:S.jsxs("div",{className:"flex items-start gap-4",children:[S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("p",{className:g?"font-semibold text-emerald-200":"font-semibold text-amber-200",children:g?"Node synchronized":"Node fell behind"}),S.jsx("p",{className:"mt-1 text-sm text-white/75",children:g?`Canonical top is within ${String(Co)} blocks of the network reference.`:`Canonical top is ${Bn(f.blocksBehind)} blocks behind the network reference.`})]}),S.jsx("button",{type:"button","aria-label":"Dismiss synchronization notification",onClick:()=>{p(null)},className:"text-lg leading-none text-white/60 hover:text-white",children:"×"})]})})}function K3(n){return n.state==="synchronized"?{title:"Libbitcoin node synchronized",body:`Canonical top is within ${String(Co)} blocks of the network reference.`}:{title:"Libbitcoin node fell behind",body:`Canonical top is ${Bn(n.blocksBehind)} blocks behind the network reference.`}}function X3(n,l,s,u){if(n===null||l===null||l<=0||By(s,u))return null;const c=Math.max(0,l-n);return{state:c<=Co?"synchronized":"behind",blocksBehind:c}}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(){}},J3=class extends Hr{#e;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const l=()=>n();return window.addEventListener("visibilitychange",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"}},am=new J3,F3={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)},W3=class{#e=F3;#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 W3;function I3(n){setTimeout(n,0)}var P3=typeof window>"u"||"Deno"in globalThis;function Pn(){}function eA(n,l){return typeof n=="function"?n(l):n}function vh(n){return typeof n=="number"&&n>=0&&n!==1/0}function Ub(n,l){return Math.max(n+(l||0)-Date.now(),0)}function Ti(n,l){return typeof n=="function"?n(l):n}function hl(n,l){return typeof n=="function"?n(l):n}function qv(n,l){const{type:s="all",exact:u,fetchStatus:c,predicate:d,queryKey:f,stale:p}=n;if(f){if(u){if(l.queryHash!==im(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 p=="boolean"&&l.isStale()!==p||c&&c!==l.state.fetchStatus||d&&!d(l))}function $v(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 im(n,l){return(l?.queryKeyHashFn||kr)(n)}function kr(n){return JSON.stringify(n,(l,s)=>bh(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=Gv(n)&&Gv(l);if(!u&&!(bh(n)&&bh(l)))return l;const d=(u?n:Object.keys(n)).length,f=u?l:Object.keys(l),p=f.length,g=u?new Array(p):{};let v=0;for(let x=0;x{rs.setTimeout(l,n)})}function Sh(n,l,s){return typeof s.structuralSharing=="function"?s.structuralSharing(n,l):s.structuralSharing!==!1?kb(n,l):l}function lA(n,l,s=0){const u=[...n,l];return s&&u.length>s?u.slice(1):u}function aA(n,l,s=0){const u=[l,...n];return s&&u.length>s?u.slice(0,-1):u}var sm=Symbol();fun)DELIM" +R"DELIM(ction Zb(n,l){return!n.queryFn&&l?.initialPromise?()=>l.initialPromise:!n.queryFn||n.queryFn===sm?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Lb(n,l){return typeof n=="function"?n(...l):!!n}function iA(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=()=>P3;return{isServer(){return n()},setIsServer(l){n=l}}})();function xh(){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 sA=I3;function uA(){let n=[],l=0,s=p=>{p()},u=p=>{p()},c=sA;const d=p=>{l?n.push(p):c(()=>{s(p)})},f=()=>{const p=n;n=[],p.length&&c(()=>{u(()=>{p.forEach(g=>{s(g)})})})};return{batch:p=>{let g;l++;try{g=p()}finally{l--,l||f()}return g},batchCalls:p=>(...g)=>{d(()=>{p(...g)})},schedule:d,setNotifyFunction:p=>{s=p},setBatchNotifyFunction:p=>{u=p},setScheduler:p=>{c=p}}}var Sn=uA(),rA=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 rA;function cA(n){return Math.min(1e3*2**n,3e4)}function Hb(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 Bb(n){let l=!1,s=0,u;const c=xh(),d=()=>c.status!=="pending",f=H=>{if(!d()){const $=new _h(H);T($),n.onCancel?.($)}},p=()=>{l=!0},g=()=>{l=!1},v=()=>am.isFocused()&&(n.networkMode==="always"||Mo.isOnline())&&n.canRun(),x=()=>Hb(n.networkMode)&&n.canRun(),_=H=>{d()||(u?.(),c.resolve(H))},T=H=>{d()||(u?.(),c.reject(H))},w=()=>new Promise(H=>{u=$=>{(d()||v())&&H($)},n.onPause?.()}).then(()=>{u=void 0,d()||n.onContinue?.()}),j=()=>{if(d())return;let H;const $=s===0?n.initialPromise:void 0;try{H=$??n.fn()}catch(W){H=Promise.reject(W)}Promise.resolve(H).then(_).catch(W=>{if(d())return;const K=n.retry??(Zr.isServer()?0:3),V=n.retryDelay??cA,q=typeof V=="function"?V(s,W):V,ae=K===!0||typeof K=="number"&&sv()?void 0:w()).then(()=>{l?T(W):j()})})};return{promise:c,status:()=>c.status,cancel:f,continue:()=>(u?.(),c),cancelRetry:p,continueRetry:g,canStart:x,start:()=>(x()?j():w().then(j),c)}}var qb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vh(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 oA(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 p={pages:[],pageParams:[]},g=0;const v=async()=>{let x=!1;const _=j=>{iA(j,()=>l.signal,()=>x=!0)},T=Zb(l.options,l.fetchOptions),w=async(j,H,$)=>{if(x)return Promise.reject(l.signal.reason);if(H==null&&j.pages.length)return Promise.resolve(j);const K=(()=>{const te={client:l.client,queryKey:l.queryKey,pageParam:H,direction:$?"backward":"forward",meta:l.options.meta};return _(te),te})(),V=await T(K),{maxPages:q}=l.options,ae=$?aA:lA;return{pages:ae(j.pages,V,q),pageParams:ae(j.pageParams,H,q)}};if(c&&d.length){const j=c==="backward",H=j?fA:Qv,$={pages:d,pageParams:f},W=H(u,$);p=await w($,W,j)}else{const j=n??d.length;do{const H=g===0?f[0]??u.initialPageParam:Qv(u,p);if(g>0&&H==null)break;p=await w(p,H),g++}while(gl.options.persister?.(v,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},s):l.fetchFn=v}}}function Qv(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 fA(n,{pages:l,pageParams:s}){return l.length>0?n.getPreviousPageParam?.(l[0],l,s[0],s):void 0}var dA=class extends qb{#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=Kv(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=Kv(this.options);l.data!==void 0&&(this.setState(Vv(l.data,l.dataUpdatedAt)),this.#t=l)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#l.remove(this)}setData(n,l){const s=Sh(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(Pn).catch(Pn):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===sm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Ti(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:!Ub(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=Zb(this.options,l),x=(()=>{const _={client:this.#a,queryKey:this.queryKey,meta:this.meta};return u(_),_})();return this.#s=!1,this.options.persister?this.options.persister(g,x,this):g(x)},f=(()=>{const g={fetchOptions:l,options:this.options,que)DELIM" +R"DELIM(ryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:c};return u(g),g})();(this.#e==="infinite"?oA(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=Bb({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,...$b(s.data,this.options),fetchMeta:n.meta??null};case"success":const u={...s,...Vv(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 $b(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hb(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Vv(n,l){return{data:n,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Kv(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 hA=class extends Hr{constructor(n,l){super(),this.options=l,this.#e=n,this.#s=null,this.#u=xh(),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),Xv(this.#t,this.options)?this.#o():this.updateResult(),this.#_())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zh(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zh(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&&!yh(this.options,l)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const u=this.hasListeners();u&&Jv(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)||Ti(this.options.staleTime,this.#t)!==Ti(l.staleTime,this.#t))&&this.#b();const c=this.#S();u&&(this.#t!==s||hl(this.options.enabled,this.#t)!==hl(l.enabled,this.#t)||c!==this.#d)&&this.#x(c)}getOptimisticResult(n){const l=this.#e.getQueryCache().build(this.#e,n),s=this.createResult(l,n);return pA(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(Pn)),l}#b(){this.#z();const n=Ti(this.options.staleTime,this.#t);if(Zr.isServer()||this.#l.isStale||!vh(n))return;const s=Ub(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}#x(n){this.#v(),this.#d=n,!(Zr.isServer()||hl(this.options.enabled,this.#t)===!1||!vh(this.#d)||this.#d===0)&&(this.#f=rs.setInterval(()=>{(this.options.refetchIntervalInBackground||am.isFocused())&&this.#o()},this.#d))}#_(){this.#b(),this.#x(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 x={...v},_=!1,T;if(l._optimisticResults){const se=this.hasListeners(),Me=!se&&Xv(n,l),ze=se&&Jv(n,s,l,u);(Me||ze)&&(x={...x,...$b(v.data,n.options)}),l._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:w,errorUpdatedAt:j,status:H}=x;T=x.data;let $=!1;if(l.placeholderData!==void 0&&T===void 0&&H==="pending"){let se;c?.isPlaceholderData&&l.placeholderData===f?.placeholderData?(se=c.data,$=!0):se=typeof l.placeholderData=="function"?l.placeholderData(this.#h?.state.data,this.#h):l.placeholderData,se!==void 0&&(H="success",T=Sh(c?.data,se,l),_=!0)}if(l.select&&T!==void 0&&!$)if(c&&T===d?.data&&l.select===this.#c)T=this.#r;else try{this.#c=l.select,T=l.select(T),T=Sh(c?.data,T,l),this.#r=T,this.#s=null}catch(se){this.#s=se}this.#s&&(w=this.#s,T=this.#r,j=Date.now(),H="error");const W=x.fetchStatus==="fetching",K=H==="pending",V=H==="error",q=K&&W,ae=T!==void 0,P={status:H,fetchStatus:x.fetchStatus,isPending:K,isSuccess:H==="success",isError:V,isInitialLoading:q,isLoading:q,data:T,dataUpdatedAt:x.dataUpdatedAt,error:w,errorUpdatedAt:j,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:x.dataUpdateCount>g.dataUpdateCount||x.errorUpdateCount>g.errorUpdateCount,isFetching:W,isRefetching:W&&!K,isLoadingError:V&&!ae,isPaused:x.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:V&&ae,isStale:um(n,l),refetch:this.refetch,promise:this.#u,isEnabled:hl(l.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const se=P.data!==void 0,Me=P.status==="error"&&!se,ze=ce=>{Me?ce.reject(P.error):se&&ce.resolve(P.data)},ne=()=>{const ce=this.#u=P.promise=xh();ze(ce)},be=this.#u;switch(be.status){)DELIM" +R"DELIM(case"pending":n.queryHash===s.queryHash&&ze(be);break;case"fulfilled":(Me||P.data!==be.value)&&ne();break;case"rejected":(!Me||P.error!==be.reason)&&ne();break}}return P}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),yh(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 p=f;return this.#l[p]!==n[p]&&d.has(p)})};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.#_()}#y(n){Sn.batch(()=>{n.listeners&&this.listeners.forEach(l=>{l(this.#l)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function mA(n,l){return hl(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&hl(l.retryOnMount,n)===!1)}function Xv(n,l){return mA(n,l)||n.state.data!==void 0&&zh(n,l,l.refetchOnMount)}function zh(n,l,s){if(hl(l.enabled,n)!==!1&&Ti(l.staleTime,n)!=="static"){const u=typeof s=="function"?s(n):s;return u==="always"||u!==!1&&um(n,l)}return!1}function Jv(n,l,s,u){return(n!==l||hl(u.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&um(n,s)}function um(n,l){return hl(l.enabled,n)!==!1&&n.isStaleByTime(Ti(l.staleTime,n))}function pA(n,l){return!yh(n.getCurrentResult(),l)}var gA=class extends qb{#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||vA(),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=Bb({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,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 vA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yA=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 gA({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=>$v(l,s))}findAll(n={}){return this.getAll().filter(l=>$v(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(Pn))))}};function po(n){return n.options.scope?.id}var bA=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??im(u,l);let d=this.get(c);return d||(d=new dA({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=>qv(l,s))}findAll(n={}){const l=this.getAll();return Object.keys(n).length>0?l.filter(s=>qv(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 bA,this.#t=n.mutationCache||new yA,this.#n=n.defaultOptions||{},this.#l=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#u=am.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 thi)DELIM" +R"DELIM(s.#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(Ti(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=eA(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(Pn).catch(Pn)}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(Pn)),c.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(u).then(Pn)}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const s=this.#e.build(this,l);return s.isStaleByTime(Ti(l.staleTime,s))?s.fetch(l):Promise.resolve(s.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Pn).catch(Pn)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Pn).catch(Pn)}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=im(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===sm&&(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()}},Gb=fe.createContext(void 0),xA=n=>{const l=fe.useContext(Gb);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},_A=({client:n,children:l})=>(fe.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),S.jsx(Gb.Provider,{value:n,children:l})),Yb=fe.createContext(!1),zA=()=>fe.useContext(Yb);Yb.Provider;function EA(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var wA=fe.createContext(EA()),TA=()=>fe.useContext(wA),AA=(n,l,s)=>{const u=s?.state.error&&typeof n.throwOnError=="function"?Lb(n.throwOnError,[s.state.error,s]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||u)&&(l.isReset()||(n.retryOnMount=!1))},MA=n=>{fe.useEffect(()=>{n.clearReset()},[n])},NA=({result:n,errorResetBoundary:l,throwOnError:s,query:u,suspense:c})=>n.isError&&!l.isReset()&&!n.isFetching&&u&&(c&&n.data===void 0||Lb(s,[n.error,u])),OA=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))}},jA=(n,l)=>n.isLoading&&n.isFetching&&!l,DA=(n,l)=>n?.suspense&&l.isPending,Fv=(n,l,s)=>l.fetchOptimistic(n).catch(()=>{s.clearReset()});function CA(n,l,s){const u=zA(),c=TA(),d=xA(),f=d.defaultQueryOptions(n);d.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const p=d.getQueryCache().get(f.queryHash),g=n.subscribed!==!1;f._optimisticResults=u?"isRestoring":g?"optimistic":void 0,OA(f),AA(f,c,p),MA(c);const v=!d.getQueryCache().get(f.queryHash),[x]=fe.useState(()=>new l(d,f)),_=x.getOptimisticResult(f),T=!u&&g;if(fe.useSyncExternalStore(fe.useCallback(w=>{const j=T?x.subscribe(Sn.batchCalls(w)):Pn;return x.updateResult(),j},[x,T]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),fe.useEffect(()=>{x.setOptions(f)},[f,x]),DA(f,_))throw Fv(f,x,c);if(NA({result:_,errorResetBoundary:c,throwOnError:f.throwOnError,query:p,suspense:f.suspense}))throw _.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(f,_),f.experimental_prefetchInRender&&!Zr.isServer()&&jA(_,u)&&(v?Fv(f,x,c):p?.promise)?.catch(Pn).finally(()=>{x.updateResult()}),f.notifyOnChangeProps?_:x.trackResult(_)}function Qb(n,l){return CA(n,hA)}const Wv={phase:"idle",attempt:0,reconnects:0,connectedAt:null,lastMessageAt:null,error:null};class Vb{#e;#t=Wv;#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(Wv)}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:UA(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=RA(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)DELIM" +R"DELIM(*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 RA(n){return typeof n=="string"?n:n instanceof ArrayBuffer?new TextDecoder().decode(n):null}function UA(n){return n instanceof Error?n.message:"Unable to create WebSocket"}class kA{#e;#t;#n=new Set;#l=new Set;#a;constructor(l,s={}){this.#e=s.logFilter??wE,this.#t=s.eventFilter??TE,this.#a=new Vb({url:iy(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=OE(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 Kb=ps({address:lu(),filter:lu(),turbo:lu(),witness:lu(),retarget:lu(),difficult:lu(),pruned:wi().int().nonnegative()}),Xb=wi().int().nonnegative();function ZA(n){try{const l=JSON.parse(n),s=Kb.safeParse(l);if(s.success)return{type:"configuration",payload:s.data};const u=Xb.safeParse(l);return u.success?{type:"top",payload:u.data}:null}catch{return null}}function Iv(n,l){return new URL(l,`${n.replace(/\/+$/u,"")}/`).toString()}async function Pv(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 LA(n,l){const[s,u]=await Promise.all([Pv(Iv(n,"/v1/configuration?format=json"),l),Pv(Iv(n,"/v1/top?format=json"),l)]),c=Kb.parse(s),d=Xb.parse(u);return{configuration:c,top:d,receivedAt:Date.now()}}const HA=15e3,BA={configuration:null,top:null,receivedAt:null,invalidFrames:0};class qA{#e=BA;#t=new Set;#n;#l;constructor(l,s={}){this.#l=s.now??Date.now,this.#n=new Vb({url:iy(l),webSocketFactory:s.webSocketFactory,retryMinimumMs:s.retryMinimumMs,retryMaximumMs:s.retryMaximumMs,jitterRatio:s.jitterRatio,heartbeatMs:s.topPollIntervalMs??HA,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 $A(n,l){const s=fe.useMemo(()=>new kA(n),[n]),u=fe.useSyncExternalStore(s.subscribeStatus,s.getStatus,s.getStatus);return fe.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 GA(n,l){const s=fe.useMemo(()=>new qA(n),[n]),u=fe.useMemo(()=>CS(n),[n]),c=fe.useSyncExternalStore(s.subscribeStatus,s.getStatus,s.getStatus),d=fe.useSyncExternalStore(s.subscribeState,s.getState,s.getState);fe.useEffect(()=>(s.start(),()=>{s.stop()}),[s]);const f=Qb({queryKey:["native-snapshot",n],queryFn:({signal:_})=>LA(n,_),enabled:u&&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 fe.useEffect(()=>{p!==null&&l.recordNativeTop(p,v??Date.now())},[l,v,p]),{status:c,live:d,top:p,configuration:g,receivedAt:v,transport:x,restError:f.error instanceof Error?f.error.message:null}}function YA(n){const l=Qb({queryKey:["reference-top",n],queryFn:({signal:s})=>sw(n,s),refetchInterval:aw});return{top:l.data?.top??null,receivedAt:l.data?.receivedAt??null,error:l.error instanceof Error?l.error.message:null}}const QA=[{id:"overview",label:"Overview"},{id:"logs",label:"Logs"},{id:"events",label:"Events"}];function VA(){const n=fe.useMemo(()=>new tw,[]),[l,s]=fe.useState(RS),[u,c]=fe.useState("overview"),[d,f]=fe.useState(!1),[p,g]=fe.useState(AS),v=fe.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),x=$A(l.adminUrl,n),_=GA(l.nativeUrl,n),T=YA(l.referenceUrl);fe.useEffect(()=>(n.start(),()=>{n.stop()}),[n]);function w($){US($),($.adminUrl!==l.adminUrl||$.nativeUrl!==l.nativeUrl)&&n.reset(),s($),f(!1)}function j(){kS();const $=sy();($.adminUrl!==l.adminUrl||$.nativeUrl!==l.nativeUrl)&&n.reset(),s($),f(!1)}function H($){MS($),g($)}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:QA.map($=>S.jsxs("button",{type:"button",onClick:()=>{c($.id)},className:`rounded-lg px-3 py-2 text-sm transition ${u===$.id?"bg-accent/15 text-accent":"text-textMuted hover:text-textPrimary hover:bg-white/5"}`,children:[$.label,$.id==="logs"&&v.totalLogs>0&&S.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:v.totalLogs>999?"999+":String(v.totalLogs)}),$.id==="events"&&v.totalEvents>0&&S.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:v.totalEvents>999?"999+":String(v.totalEvents)})]},$.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(ey,{connected:x.phase==="connected",label:"Admin"}),S.jsx(ey,{connected:_.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(G3,{adminStatus:x,endpoints:l,metrics:v,native:_,reference:T}),u==="logs"&&S.jsx(LE,{logs:v.recentLogs,onClear:()=>{n.clearLogs()}}),u==="events"&&S.jsx(ZE,{events:v.recentEvents,onClear:()=>{n.clearEvents()}})]}),S.jsx(V3,{localTop:_.top,referenceTop:T.top,referenceReceivedAt:T.receivedAt,now:v.now)DELIM" +R"DELIM(,browserNotificationsEnabled:p},`${l.nativeUrl}|${l.referenceUrl}`),d&&S.jsx(ZS,{configuration:l,browserNotificationsEnabled:p,onClose:()=>{f(!1)},onReset:j,onSave:w,onBrowserNotificationsEnabledChange:H},`${l.adminUrl}|${l.nativeUrl}|${l.referenceUrl}`)]})}function ey({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 KA({children:n}){const[l]=fe.useState(()=>new SA({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}));return S.jsxs(_A,{client:l,children:[n,null]})}const Jb=document.querySelector("#root");if(!Jb)throw new Error("Root element not found");wS.createRoot(Jb).render(S.jsx(vS.StrictMode,{children:S.jsx(KA,{children:S.jsx(VA,{})})})); )DELIM" )