From 77ec2ffb76a1c045354d19c947c65d8dd1c42a2c Mon Sep 17 00:00:00 2001 From: BOB450 Date: Thu, 30 Jul 2026 02:12:53 -0600 Subject: [PATCH] Initial version of the admin site Replaced placeholder with first version of the embedded admin site. --- console/embedded/admin_css.cpp | 15 +- console/embedded/admin_ecma.cpp | 284 ++++++++++++++------------------ console/embedded/admin_html.cpp | 47 +++--- 3 files changed, 150 insertions(+), 196 deletions(-) diff --git a/console/embedded/admin_css.cpp b/console/embedded/admin_css.cpp index db2e9add..811ad77c 100644 --- a/console/embedded/admin_css.cpp +++ b/console/embedded/admin_css.cpp @@ -23,13 +23,14 @@ namespace server { // Simple test css for embedded page, links in font. DEFINE_EMBEDDED_PAGE(admin_pages, char, css, -R"(#log, #events -{ - font-family: monospace; - height: 70vh; - overflow-y: scroll; - white-space: pre-wrap; -})") +R"DELIM(.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-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;--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-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,cur)DELIM" +R"DELIM(rentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.order-3{order:3}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-auto{margin-right:auto}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-)DELIM" +R"DELIM(flex}.h-2{height:calc(var(--spacing) * 2)}.h-full{height:100%}.max-h-\[65vh\]{max-height:65vh}.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-\[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}.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-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-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 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)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-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-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-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\/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-blue-500\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/15{background-color:color-mix(in oklab,var(--color-blue-500) 15%,transparent)}}.bg-current{background-color:currentColor}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-indigo-500\/15{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\/)DELIM" +R"DELIM(50{background-color:#1f211c80}.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)}.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)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.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}.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-300{color:var(--color-amber-300)}.text-background{color:#272822}.text-blue-300{color:var(--color-blue-300)}.text-cyan-300{color:var(--color-cyan-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-indigo-300{color:var(--color-indigo-300)}.text-orange-300{color:var(--color-orange-300)}.text-red-300{color:var(--color-red-300)}.text-sky-300{color:var(--color-sky-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-violet-300{color:var(--color-violet-300)}.text-zinc-300{color:var(--color-zinc-300)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\/50{--tw-shadow-color:#00000080}@supports (color:color-mix(in lab,red,red)){.shadow-black\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.placeholder\:text-textMuted\/60::placeholder{color:#cfcfcf99}@media(hover:hover){.hover\:border)DELIM" +R"DELIM(-accent:hover{border-color:#ffa022}.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-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-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)}@media(min-width:40rem){.sm\:order-none{order:0}.sm\:w-auto{width:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[7\.5rem_7\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:7.5rem 7.5rem minmax(0,1fr)}.sm\:grid-cols-\[8\.5rem_10rem_minmax\(0\,1fr\)\]{grid-template-columns:8.5rem 10rem minmax(0,1fr)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}}@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))}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[1\.1fr_0\.9fr\]{grid-template-columns:1.1fr .9fr}}}:root{color-scheme:dark;font-synthesis:none;text-rendering:optimizelegibility}body{min-width:calc(var(--spacing) * 80);font-family:var(--font-sans);color:#ededed;background-color:#272822;margin:0;overflow-x:hidden}button,input,select{font:inherit}::selection{color:#272822;background-color:#ffa022}*{scrollbar-color:#c85637 #1f211c;scrollbar-width:thin}.uplot{color:#cfcfcf;font-family:ui-sans-serif,system-ui,sans-serif}.uplot .u-legend{margin-bottom:.75rem;font-size:.75rem}.uplot .u-legend .u-series{padding:.2rem .45rem}.uplot .u-select{background:#ffa0221f;border:1px solid #ffa02259}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{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} +)DELIM" + +) } // namespace server } // namespace libbitcoin diff --git a/console/embedded/admin_ecma.cpp b/console/embedded/admin_ecma.cpp index 7c0315fc..846fc040 100644 --- a/console/embedded/admin_ecma.cpp +++ b/console/embedded/admin_ecma.cpp @@ -23,176 +23,132 @@ namespace server { // Simple test ecma script for embedded page. DEFINE_EMBEDDED_PAGE(admin_pages, char, ecma, -R"(document.addEventListener('DOMContentLoaded', function() -{ - // Contract: network::levels ordinals (version 1). - const levels = - [ - 'application', 'news', 'session', 'protocol', 'proxy', - 'remote', 'fault', 'quitting', 'objects', 'verbose' - ]; - - // Contract: node::events ordinals (version 1). - const events = - [ - 'header_archived', 'header_organized', 'header_reorganized', - 'block_archived', 'block_buffered', 'block_validated', - 'block_confirmed', 'block_unconfirmable', 'validate_bypassed', - 'confirm_bypassed', 'tx_archived', 'tx_validated', 'tx_invalidated', - 'block_organized', 'block_reorganized', 'template_issued', - 'snapshot_secs', 'prune_msecs', 'reload_msecs', 'block_usecs', - 'ancestry_msecs', 'filter_msecs', 'filterhashes_msecs', - 'filterchecks_msecs', 'ecdsa_secs', 'schnorr_secs', 'silent_secs', - 'unknown' - ]; - - const status = document.getElementById('status'); - - // Bounded output pane: frames append lines (cheap), the dom renders at - // most once per animation frame, retention is capped to scrollback. - function pane(id, scrollback = 1000) - { - const element = document.getElementById(id); - const lines = []; - let pending = false; - - function render() - { - pending = false; - element.textContent = lines.join(''); - element.scrollTop = element.scrollHeight; +R"DELIM((function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const h of c)if(h.type==="childList")for(const f of h.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function u(c){const h={};return c.integrity&&(h.integrity=c.integrity),c.referrerPolicy&&(h.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?h.credentials="include":c.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function s(c){if(c.ep)return;c.ep=!0;const h=u(c);fetch(c.href,h)}})();function zv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xh={exports:{}},or={};var Z0;function S1(){if(Z0)return or;Z0=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function u(s,c,h){var f=null;if(h!==void 0&&(f=""+h),c.key!==void 0&&(f=""+c.key),"key"in c){h={};for(var p in c)p!=="key"&&(h[p]=c[p])}else h=c;return c=h.ref,{$$typeof:n,type:s,key:f,ref:c!==void 0?c:null,props:h}}return or.Fragment=a,or.jsx=u,or.jsxs=u,or}var k0;function _1(){return k0||(k0=1,xh.exports=S1()),xh.exports}var M=_1(),zh={exports:{}},Re={};var H0;function x1(){if(H0)return Re;H0=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),E=Symbol.iterator;function N(A){return A===null||typeof A!="object"?null:(A=E&&A[E]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},J=Object.assign,F={};function P(A,H,B){this.props=A,this.context=H,this.refs=F,this.updater=B||C}P.prototype.isReactComponent={},P.prototype.setState=function(A,H){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,H,"setState")},P.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function Y(){}Y.prototype=P.prototype;function I(A,H,B){this.props=A,this.context=H,this.refs=F,this.updater=B||C}var G=I.prototype=new Y;G.constructor=I,J(G,P.prototype),G.isPureReactComponent=!0;var ie=Array.isArray;function ne(){}var le={H:null,A:null,T:null,S:null},se=Object.prototype.hasOwnProperty;function we(A,H,B){var ae=B.ref;return{$$typeof:n,type:A,key:H,ref:ae!==void 0?ae:null,props:B}}function xe(A,H){return we(A.type,H,A.props)}function ee(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function ye(A){var H={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(B){return H[B]})}var ce=/\/+/g;function ze(A,H){return typeof A=="object"&&A!==null&&A.key!=null?ye(""+A.key):H.toString(36)}function he(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(ne,ne):(A.status="pending",A.then(function(H){A.status==="pending"&&(A.status="fulfilled",A.value=H)},function(H){A.status==="pending"&&(A.status="rejected",A.reason=H)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function U(A,H,B,ae,_e){var pe=typeof A;(pe==="undefined"||pe==="boolean")&&(A=null);var ge=!1;if(A===null)ge=!0;else switch(pe){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(A.$$typeof){case n:case a:ge=!0;break;case z:return ge=A._init,U(ge(A._payload),H,B,ae,_e)}}if(ge)return _e=_e(A),ge=ae===""?"."+ze(A,0):ae,ie(_e)?(B="",ge!=null&&(B=ge.replace(ce,"$&/")+"/"),U(_e,H,B,"",function(nt){return nt})):_e!=null&&(ee(_e)&&(_e=xe(_e,B+(_e.key==null||A&&A.key===_e.key?"":(""+_e.key).replace(ce,"$&/")+"/")+ge)),H.push(_e)),1;ge=0;var mt=ae===""?".":ae+":";if(ie(A))for(var Ge=0;Ge>>1,be=U[Oe];if(0>>1;Oec(B,me))aec(_e,B)?(U[Oe]=_e,U[ae]=me,Oe=ae):(U[Oe]=B,U[H]=me,Oe=H);else if(aec(_e,me))U[Oe]=_e,U[ae]=me,Oe=ae;else break e}}return q}function c(U,q){var me=U.sortIndex-q.sortIndex;return me!==0?me:U.id-q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;n.unstable_now=function(){return h.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var v=[],g=[],z=1,S=null,E=3,N=!1,C=!1,J=!1,F=!1,P=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function G(U){for(var q=u(g);q!==null;){if(q.callback===null)s(g);else if(q.startTime<=U)s(g),q.sortIndex=q.expirationTime,a(v,q);else break;q=u(g)}}function ie(U){if(J=!1,G(U),!C)if(u(v)!==null)C=!0,ne||(ne=!0,ye());else{var q=u(g);q!==null&&he(ie,q.startTime-U)}}var ne=!1,le=-1,se=5,we=-1;function xe(){return F?!0:!(n.unstable_now()-weU&&xe());){var Oe=S.callback;if(typeof Oe=="function"){S.callback=null,E=S.priorityLevel;var be=Oe(S.expirationTime<=U);if(U=n.unstable_now(),typeof be=="function"){S.callback=be,G(U),q=!0;break t}S===u(v)&&s(v),G(U)}else s(v);S=u(v)}if(S!==null)q=!0;else{var A=u(g);A!==null&&he(ie,A.startTime-U),q=!1}}break e}finally{S=null,E=me,N=!1}q=void 0}}finally{q?ye():ne=!1}}}var ye;if(typeof I=="function")ye=function(){I(ee)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,ze=ce.port2;ce.port1.onmessage=ee,ye=function(){ze.postMessage(null)}}else ye=function(){P(ee,0)};function he(U,q){le=P(function(){U(n.unstable_now())},q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_forceFrameRate=function(U){0>U||125Oe?(U.sortIndex=me,a(g,U),u(v)===null&&U===u(g)&&(J?(Y(le),le=-1):J=!0,he(ie,me-Oe))):(U.sortIndex=be,a(v,U),C||N||(C=!0,ne||(ne=!0,ye()))),U},n.unstable_shouldYield=xe,n.unstable_wrapCallback=function(U){var q=E;return function(){var me=E;E=q;try{return U.apply(this,arguments)}finally{E=me}}}})(Ah)),Ah}var q0;function T1(){return q0||(q0=1,Th.exports=E1()),Th.exports}var wh={exports:{}},wn={};var Q0;function A1(){if(Q0)return wn;Q0=1;var n=ld();function a(v){var g="https://react.dev/errors/"+v;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),wh.exports=A1(),wh.exports}var Y0;function O1(){if(Y0)return fr;Y0=1;var n=T1(),a=ld(),u=w1();function s(e){var t="https://react.dev/errors/"+e;if(1be||(e.current=Oe[be],Oe[be]=null,be--)}function B(e,t){be++,Oe[be]=e.current,e.current=t}var ae=A(null),_e=A(null),pe=A(null),ge=A(null);function mt(e,t){switch(B(pe,t),B(_e,e),B(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?i0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=i0(t),e=u0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ae),B(ae,e)}function Ge(){H(ae),H(_e),H(pe)}function nt(e){e.memoizedState!==null&&B(ge,e);var t=ae.current,l=u0(t,e.type);t!==l&&(B(_e,e),B(ae,l))}function Mn(e){_e.current===e&&(H(ae),H(_e)),ge.current===e&&(H(ge),ur._currentValue=me)}var In,Nn;function Sn(e){if(In===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);In=t&&t[1]||"",Nn=-1)":-1r||T[i]!==Z[r]){var Q=` +`+T[i].replace(" at new "," at ");return e.displayName&&Q.includes("")&&(Q=Q.replace("",e.displayName)),Q}while(1<=i&&0<=r);break}}}finally{ql=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Sn(l):""}function Ei(e,t){switch(e.tag){case 26:case 27:case 5:return Sn(e.type);case 16:return Sn("Lazy");case 13:return e.child!==t&&t!==null?Sn("Suspense Fallback"):Sn("Suspense");case 19:return Sn("SuspenseList");case 0:case 15:return Ql(e.type,!1);case 11:return Ql(e.type.render,!1);case 1:return Ql(e.type,!0);case 31:return Sn("Activity");default:return""}}function Ti(e){try{var t="",l=null;do t+=Ei(e,l),l=e,e=e.return;while(e);return t}catch(i){return` +Error generating stack: `+i.message+` +`+i.stack}}var wl=Object.prototype.hasOwnProperty,Ft=n.unstable_scheduleCallback,Gl=n.unstable_cancelCallback,Ol=n.unstable_shouldYield,ia=n.unstable_requestPaint,Ee=n.unstable_now,oe=n.unstable_getCurrentPriorityLevel,lt=n.unstable_ImmediatePriority,Nt=n.unstable_UserBlockingPriority,Ml=n.unstable_NormalPriority,ua=n.unstable_LowPriority,Pn=n.unstable_IdlePriority,sa=n.log,Dn=n.unstable_setDisableYieldValue,nn=null,rt=null;function Gt(e){if(typeof sa=="function"&&Dn(e),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(nn,e)}catch{}}var cn=Math.clz32?Math.clz32:ra,su=Math.log,Za=Math.LN2;function ra(e){return e>>>=0,e===0?32:31-(su(e)/Za|0)|0}var ca=256,on=262144,ka=4194304;function Yl(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 ru(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var r=0,o=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var b=i&134217727;return b!==0?(i=b&~o,i!==0?r=Yl(i):(d&=b,d!==0?r=Yl(d):l||(l=b&~e,l!==0&&(r=Yl(l))))):(b=i&~o,b!==0?r=Yl(b):d!==0?r=Yl(d):l||(l=i&~e,l!==0&&(r=Yl(l)))),r===0?0:t!==0&&t!==r&&(t&o)===0&&(o=r&-r,l=t&-t,o>=l||o===32&&(l&4194048)!==0)?t:r}function Ai(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ao(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 Mr(){var e=ka;return ka<<=1,(ka&62914560)===0&&(ka=4194304),e}function hs(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function el(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ln(e,t,l,i,r,o){var d=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var b=e.entanglements,T=e.expirationTimes,Z=e.hiddenUpdates;for(l=d&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var wo=/[\n"\\]/g;function Cn(e){return e.replace(wo,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function mu(e,t,l,i,r,o,d,b){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+jn(t)):e.value!==""+jn(t)&&(e.value=""+jn(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?pu(e,d,jn(t)):l!=null?pu(e,d,jn(l)):i!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+jn(b):e.removeAttribute("name")}function jr(e,t,l,i,r,o,d,b){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||l!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){hu(e);return}l=l!=null?""+jn(l):"",t=t!=null?""+jn(t):l,b||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=b?e.checked:!!i,e.defaultChecked=!!i,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),hu(e)}function pu(e,t,l){t==="number"&&du(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Kl(e,t,l,i){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bu=!1;if(zn)try{var Ya={};Object.defineProperty(Ya,"passive",{get:function(){bu=!0}}),window.addEventListener("test",Ya,Ya),window.removeEventListener("test",Ya,Ya)}catch{bu=!1}var Un=null,Jl=null,ji=null;function xs(){if(ji)return ji;var e,t=Jl,l=t.length,i,r="value"in Un?Un.value:Un.textContent,o=r.length;for(e=0;e=Xa),Ns=" ",ga=!1;function Zi(e,t){switch(e){case"keyup":return Gr.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kt(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var va=!1;function jt(e,t){switch(e){case"compositionend":return kt(t);case"keypress":return t.which!==32?null:(ga=!0,Ns);case"textInput":return e=t.data,e===Ns&&ga?null:e;default:return null}}function Yr(e,t){if(va)return e==="compositionend"||!Su&&Zi(e,t)?(e=xs(),ji=Jl=Un=null,va=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Me(l)}}function ct(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ct(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function St(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=du(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=du(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=zn&&"documentMode"in document&&11>=document.documentMode,it=null,hn=null,Ht=null,En=!1;function Gn(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;En||it==null||it!==du(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}),Ht&&Ue(Ht,i)||(Ht=i,i=Rc(hn,"onSelect"),0>=d,r-=d,Il=1<<32-cn(t)+r|l<ke?(qe=ve,ve=null):qe=ve.sibling;var Xe=k(D,ve,R[ke],$);if(Xe===null){ve===null&&(ve=qe);break}e&&ve&&Xe.alternate===null&&t(D,ve),O=o(Xe,O,ke),Ke===null?Te=Xe:Ke.sibling=Xe,Ke=Xe,ve=qe}if(ke===R.leng)DELIM" +R"DELIM(th)return l(D,ve),Ye&&Sa(D,ke),Te;if(ve===null){for(;keke?(qe=ve,ve=null):qe=ve.sibling;var vi=k(D,ve,Xe.value,$);if(vi===null){ve===null&&(ve=qe);break}e&&ve&&vi.alternate===null&&t(D,ve),O=o(vi,O,ke),Ke===null?Te=vi:Ke.sibling=vi,Ke=vi,ve=qe}if(Xe.done)return l(D,ve),Ye&&Sa(D,ke),Te;if(ve===null){for(;!Xe.done;ke++,Xe=R.next())Xe=K(D,Xe.value,$),Xe!==null&&(O=o(Xe,O,ke),Ke===null?Te=Xe:Ke.sibling=Xe,Ke=Xe);return Ye&&Sa(D,ke),Te}for(ve=i(ve);!Xe.done;ke++,Xe=R.next())Xe=L(ve,D,ke,Xe.value,$),Xe!==null&&(e&&Xe.alternate!==null&&ve.delete(Xe.key===null?ke:Xe.key),O=o(Xe,O,ke),Ke===null?Te=Xe:Ke.sibling=Xe,Ke=Xe);return e&&ve.forEach(function(b1){return t(D,b1)}),Ye&&Sa(D,ke),Te}function ht(D,O,R,$){if(typeof R=="object"&&R!==null&&R.type===J&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case N:e:{for(var Te=R.key;O!==null;){if(O.key===Te){if(Te=R.type,Te===J){if(O.tag===7){l(D,O.sibling),$=r(O,R.props.children),$.return=D,D=$;break e}}else if(O.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===se&&Yi(Te)===O.type){l(D,O.sibling),$=r(O,R.props),ks($,R),$.return=D,D=$;break e}l(D,O);break}else t(D,O);O=O.sibling}R.type===J?($=Li(R.props.children,D.mode,$,R.key),$.return=D,D=$):($=Wr(R.type,R.key,R.props,null,D.mode,$),ks($,R),$.return=D,D=$)}return d(D);case C: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){l(D,O.sibling),$=r(O,R.children||[]),$.return=D,D=$;break e}else{l(D,O);break}else t(D,O);O=O.sibling}$=Lo(R,D.mode,$),$.return=D,D=$}return d(D);case se:return R=Yi(R),ht(D,O,R,$)}if(he(R))return de(D,O,R,$);if(ye(R)){if(Te=ye(R),typeof Te!="function")throw Error(s(150));return R=Te.call(R),Ne(D,O,R,$)}if(typeof R.then=="function")return ht(D,O,ac(R),$);if(R.$$typeof===I)return ht(D,O,ec(D,R),$);ic(D,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,O!==null&&O.tag===6?(l(D,O.sibling),$=r(O,R),$.return=D,D=$):(l(D,O),$=Ho(R,D.mode,$),$.return=D,D=$),d(D)):l(D,O)}return function(D,O,R,$){try{Zs=0;var Te=ht(D,O,R,$);return Nu=null,Te}catch(ve){if(ve===Mu||ve===nc)throw ve;var Ke=ll(29,ve,null,D.mode);return Ke.lanes=$,Ke.return=D,Ke}}}var $i=Fd(!0),Wd=Fd(!1),ei=!1;function Wo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Io(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 ti(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ni(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(We&2)!==0){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=Fr(e),Rd(e,null,l),t}return Jr(e,i,t,l),Fr(e)}function Hs(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,oa(e,l)}}function Po(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var r=null,o=null;if(l=l.firstBaseUpdate,l!==null){do{var d={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};o===null?r=o=d:o=o.next=d,l=l.next}while(l!==null);o===null?r=o=t:o=o.next=t}else r=o=t;l={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var ef=!1;function Ls(){if(ef){var e=Ou;if(e!==null)throw e}}function Bs(e,t,l,i){ef=!1;var r=e.updateQueue;ei=!1;var o=r.firstBaseUpdate,d=r.lastBaseUpdate,b=r.shared.pending;if(b!==null){r.shared.pending=null;var T=b,Z=T.next;T.next=null,d===null?o=Z:d.next=Z,d=T;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,b=Q.lastBaseUpdate,b!==d&&(b===null?Q.firstBaseUpdate=Z:b.next=Z,Q.lastBaseUpdate=T))}if(o!==null){var K=r.baseState;d=0,Q=Z=T=null,b=o;do{var k=b.lane&-536870913,L=k!==b.lane;if(L?(Be&k)===k:(i&k)===k){k!==0&&k===wu&&(ef=!0),Q!==null&&(Q=Q.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var de=e,Ne=b;k=t;var ht=l;switch(Ne.tag){case 1:if(de=Ne.payload,typeof de=="function"){K=de.call(ht,K,k);break e}K=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=Ne.payload,k=typeof de=="function"?de.call(ht,K,k):de,k==null)break e;K=S({},K,k);break e;case 2:ei=!0}}k=b.callback,k!==null&&(e.flags|=64,L&&(e.flags|=8192),L=r.callbacks,L===null?r.callbacks=[k]:L.push(k))}else L={lane:k,tag:b.tag,payload:b.payload,callback:b.callback,next:null},Q===null?(Z=Q=L,T=K):Q=Q.next=L,d|=k;if(b=b.next,b===null){if(b=r.shared.pending,b===null)break;L=b,b=L.next,L.next=null,r.lastBaseUpdate=L,r.shared.pending=null}}while(!0);Q===null&&(T=K),r.baseState=T,r.firstBaseUpdate=Z,r.lastBaseUpdate=Q,o===null&&(r.shared.lanes=0),si|=d,e.lanes=d,e.memoizedState=K}}function Id(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function Pd(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;eo?o:8;var d=U.T,b={};U.T=b,Sf(e,!1,t,l);try{var T=r(),Z=U.S;if(Z!==null&&Z(b,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var Q=rb(T,i);Gs(e,t,Q,rl(e))}else Gs(e,t,i,rl(e))}catch(K){Gs(e,t,{then:function(){},status:"rejected",reason:K},rl())}finally{q.p=o,d!==null&&b.types!==null&&(d.types=b.types),U.T=d}}function mb(){}function yf(e,t,l,i){if(e.tag!==5)throw Error(s(476));var r=Dm(e).queue;Nm(e,r,t,me,l===null?mb:function(){return jm(e),l(i)})}function Dm(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:Ea,lastRenderedState:me},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function jm(e){var t=Dm(e);t.next===null&&(t=e.alternate.memoizedState),Gs(e,t.next.queue,{},rl())}function bf(){return pn(ur)}function Cm(){return Bt().memoizedState}function Rm(){return Bt().memoizedState}function pb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=rl();e=ti(l);var i=ni(t,e,l);i!==null&&(Jn(i,t,l),Hs(i,t,l)),t={cache:Ko()},e.payload=t;return}t=t.return}}function gb(e,t,l){var i=rl();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},pc(e)?Zm(t,l):(l=Zo(e,t,l,i),l!==null&&(Jn(l,e,i),km(l,t,i)))}function Um(e,t,l){var i=rl();Gs(e,t,l,i)}function Gs(e,t,l,i){var r={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(pc(e))Zm(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var d=t.lastRenderedState,b=o(d,l);if(r.hasEagerState=!0,r.eagerState=b,Ce(b,d))return Jr(e,t,r,0),pt===null&&Xr(),!1}catch{}if(l=Zo(e,t,r,i),l!==null)return Jn(l,e,i),km(l,t,i),!0}return!1}function Sf(e,t,l,i){if(i={lane:2,revertLane:If(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(s(479))}else t=Zo(e,l,i,2),t!==null&&Jn(t,e,2)}function pc(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function Zm(e,t){ju=rc=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function km(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,oa(e,l)}}var Ys={readContext:pn,use:fc,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};Ys.useEffectEvent=Rt;var Hm={readContext:pn,use:fc,useCallback:function(e,t){return kn().memoizedState=[e,t===void 0?null:t],e},useContext:pn,useEffect:_m,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,dc(4194308,4,Tm.bind(null,t,e),l)},useLayoutEffect:function(e,t){return dc(4194308,4,e,t)},useInsertionEffect:function(e,t){dc(4,2,e,t)},useMemo:function(e,t){var l=kn();t=t===void 0?null:t;var i=e();if(Ki){Gt(!0);try{e()}finally{Gt(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=kn();if(l!==void 0){var r=l(t);if(Ki){Gt(!0);try{l(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=gb.bind(null,Ze,e),[i.memoizedState,e]},useRef:function(e){var t=kn();return e={current:e},t.memoizedState=e},useState:function(e){e=df(e);var t=e.queue,l=Um.bind(null,Ze,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:gf,useDeferredValue:function(e,t){var l=kn();return vf(l,e,t)},useTransition:function(){var e=df(!1);return e=Nm.bind(null,Ze,e.queue,!0,!1),kn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ze,r=kn();if(Ye){if(l===void 0)throw Error(s(407));l=l()}else{if(l=t(),pt===null)throw Error(s(349));(Be&127)!==0||im(i,t,l)}r.memoizedState=l;var o={value:l,getSnapshot:t};return r.queue=o,_m(sm.bind(null,i,o,e),[e]),i.flags|=2048,Ru(9,{destroy:void 0},um.bind(null,i,o,l,t),null),l},useId:function(){var e=kn(),t=pt.identifierPrefix;if(Ye){var l=Pl,i=Il;l=(i&~(1<<32-cn(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=cc++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?d.createElement("select",{is:i.is}):d.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?d.createElement(r,{is:i.is}):d.createElement(r)}}o[Wt]=t,o[xn]=i;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=o;e:switch(vn(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Aa(t)}}return xt(t),Rf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Aa(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=pe.current,Tu(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,r=mn,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[Wt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||l0(e.nodeValue,l)),e||Ia(t,!0)}else e=Uc(e).createTextNode(i),e[Wt]=t,t.stateNode=e}return xt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=Tu(t),l!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[Wt]=t}else Bi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else l=Go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(il(t),t):(il(t),null);if((t.flags&128)!==0)throw Error(s(558))}return xt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Tu(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Err)DELIM" +R"DELIM(or(s(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));r[Wt]=t}else Bi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),r=!1}else r=Go(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(il(t),t):(il(t),null)}return il(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Sc(t,t.updateQueue),xt(t),null);case 4:return Ge(),e===null&&nh(t.stateNode.containerInfo),xt(t),null;case 10:return xa(t.type),xt(t),null;case 19:if(H(Lt),i=t.memoizedState,i===null)return xt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)$s(i,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=sc(e),o!==null){for(t.flags|=128,$s(i,!1),e=o.updateQueue,t.updateQueue=e,Sc(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Ud(l,e),l=l.sibling;return B(Lt,Lt.current&1|2),Ye&&Sa(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Ee()>Tc&&(t.flags|=128,r=!0,$s(i,!1),t.lanes=4194304)}else{if(!r)if(e=sc(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Sc(t,e),$s(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ye)return xt(t),null}else 2*Ee()-i.renderingStartTime>Tc&&l!==536870912&&(t.flags|=128,r=!0,$s(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=Ee(),e.sibling=null,l=Lt.current,B(Lt,r?l&1|2:l&1),Ye&&Sa(t,i.treeForkCount),e):(xt(t),null);case 22:case 23:return il(t),nf(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),l=t.updateQueue,l!==null&&Sc(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&H(Gi),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),xa(Vt),xt(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function _b(e,t){switch(qo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(Vt),Ge(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Mn(t),null;case 31:if(t.memoizedState!==null){if(il(t),t.alternate===null)throw Error(s(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(il(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(Lt),null;case 4:return Ge(),null;case 10:return xa(t.type),null;case 22:case 23:return il(t),nf(),e!==null&&H(Gi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(Vt),null;case 25:return null;default:return null}}function rp(e,t){switch(qo(t),t.tag){case 3:xa(Vt),Ge();break;case 26:case 27:case 5:Mn(t);break;case 4:Ge();break;case 31:t.memoizedState!==null&&il(t);break;case 13:il(t);break;case 19:H(Lt);break;case 10:xa(t.type);break;case 22:case 23:il(t),nf(),e!==null&&H(Gi);break;case 24:xa(Vt)}}function Ks(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var r=i.next;l=r;do{if((l.tag&e)===e){i=void 0;var o=l.create,d=l.inst;i=o(),d.destroy=i}l=l.next}while(l!==r)}}catch(b){st(t,t.return,b)}}function ii(e,t,l){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var o=r.next;i=o;do{if((i.tag&e)===e){var d=i.inst,b=d.destroy;if(b!==void 0){d.destroy=void 0,r=t;var T=l,Z=b;try{Z()}catch(Q){st(r,T,Q)}}}i=i.next}while(i!==o)}}catch(Q){st(t,t.return,Q)}}function cp(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Pd(t,l)}catch(i){st(e,e.return,i)}}}function op(e,t,l){l.props=Xi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){st(e,t,i)}}function Xs(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(r){st(e,t,r)}}function ea(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(r){st(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(r){st(e,t,r)}else l.current=null}function fp(e){var t=e.type,l=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(r){st(e,e.return,r)}}function Uf(e,t,l){try{var i=e.stateNode;Gb(i,e.type,l,t),i[xn]=t}catch(r){st(e,e.return,r)}}function hp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&hi(e.type)||e.tag===4}function Zf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&hi(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 kf(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Rn));else if(i!==4&&(i===27&&hi(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(kf(e,t,l),e=e.sibling;e!==null;)kf(e,t,l),e=e.sibling}function _c(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(i!==4&&(i===27&&hi(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(_c(e,t,l),e=e.sibling;e!==null;)_c(e,t,l),e=e.sibling}function dp(e){var t=e.stateNode,l=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);vn(t,i,l),t[Wt]=e,t[xn]=l}catch(o){st(e,e.return,o)}}var wa=!1,Xt=!1,Hf=!1,mp=typeof WeakSet=="function"?WeakSet:Set,rn=null;function xb(e,t){if(e=e.containerInfo,ih=Qc,e=St(e),Ct(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{l.nodeType,o.nodeType}catch{l=null;break e}var d=0,b=-1,T=-1,Z=0,Q=0,K=e,k=null;t:for(;;){for(var L;K!==l||r!==0&&K.nodeType!==3||(b=d+r),K!==o||i!==0&&K.nodeType!==3||(T=d+i),K.nodeType===3&&(d+=K.nodeValue.length),(L=K.firstChild)!==null;)k=K,K=L;for(;;){if(K===e)break t;if(k===l&&++Z===r&&(b=d),k===o&&++Q===i&&(T=d),(L=K.nextSibling)!==null)break;K=k,k=K.parentNode}K=L}l=b===-1||T===-1?null:{start:b,end:T}}else l=null}l=l||{start:0,end:0}}else l=null;for(uh={focusedElem:e,selectionRange:l},Qc=!1,rn=t;rn!==null;)if(t=rn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,rn=e;else for(;rn!==null;){switch(t=rn,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),vn(o,i,l),o[Wt]=e,Zt(o),i=o;break e;case"link":var d=S0("link","href",r).get(i+(l.href||""));if(d){for(var b=0;bht&&(d=ht,ht=Ne,Ne=d);var D=Se(b,Ne),O=Se(b,ht);if(D&&O&&(L.rangeCount!==1||L.anchorNode!==D.node||L.anchorOffset!==D.offset||L.focusNode!==O.node||L.focusOffset!==O.offset)){var R=K.createRange();R.setStart(D.node,D.offset),L.removeAllRanges(),Ne>ht?(L.addRange(R),L.extend(O.node,O.offset)):(R.setEnd(O.node,O.offset),L.addRange(R))}}}}for(K=[],L=b;L=L.parentNode;)L.nodeType===1&&K.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;bl?32:l,U.T=null,l=Vf,Vf=null;var o=ci,d=ja;if(It=0,Lu=ci=null,ja=0,(We&6)!==0)throw Error(s(331));var b=We;if(We|=4,Tp(o.current),xp(o,o.current,d,l),We=b,er(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(nn,o)}catch{}return!0}finally{q.p=r,U.T=i,Gp(e,t)}}function Vp(e,t,l){t=vl(l,t),t=Ef(e.stateNode,t,2),e=ni(e,t,2),e!==null&&(el(e,2),ta(e))}function st(e,t,l){if(e.tag===3)Vp(e,e,l);else for(;t!==null;){if(t.tag===3){Vp(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ri===null||!ri.has(i))){e=vl(l,e),l=$m(2),i=ni(t,l,2),i!==null&&(Km(l,i,t,e),el(i,2),ta(i));break}}t=t.return}}function Jf(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new Tb;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(l)||(qf=!0,r.add(l),e=Nb.bind(null,e,t,l),t.then(e,e))}function Nb(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,pt===e&&(Be&l)===l&&(Ut===4||Ut===3&&(Be&62914560)===Be&&300>Ee()-Ec?(We&2)===0&&Bu(e,0):Qf|=l,Hu===Be&&(Hu=0)),ta(e)}function $p(e,t){t===0&&(t=Mr()),e=Hi(e,t),e!==null&&(el(e,t),ta(e))}function Db(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),$p(e,l)}function jb(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(l=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),$p(e,l)}function Cb(e,t){return Ft(e,t)}var Dc=null,Qu=null,Ff=!1,jc=!1,Wf=!1,fi=0;function ta(e){e!==Qu&&e.next===null&&(Qu===null?Dc=Qu=e:Qu=Qu.next=e),jc=!0,Ff||(Ff=!0,Ub())}function er(e,t){if(!Wf&&jc){Wf=!0;do for(var l=!1,i=Dc;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var o=0;else{var d=i.suspendedLanes,b=i.pingedLanes;o=(1<<31-cn(42|e)+1)-1,o&=r&~(d&~b),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(l=!0,Fp(i,o))}else o=Be,o=ru(i,i===pt?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Ai(i,o)||(l=!0,Fp(i,o));i=i.next}while(l);Wf=!1}}function Rb(){Kp()}function Kp(){jc=Ff=!1;var e=0;fi!==0&&Vb()&&(e=fi);for(var t=Ee(),l=null,i=Dc;i!==null;){var r=i.next,o=Xp(i,t);o===0?(i.next=null,l===null?Dc=r:l.next=r,r===null&&(Qu=l)):(l=i,(e!==0||(o&3)!==0)&&(jc=!0)),i=r}It!==0&&It!==5||er(e),fi!==0&&(fi=0)}function Xp(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0b)break;var Q=T.transferSize,K=T.initiatorType;Q&&a0(K)&&(T=T.responseEnd,d+=Q*(T"u"?null:document;function g0(e,t,l){var i=Gu;if(i&&typeof t=="string"&&t){var r=Cn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof l=="string"&&(r+='[crossorigin="'+l+'"]'),p0.has(r)||(p0.add(r),e={rel:e,crossOrigin:l,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),vn(t,"link",e),Zt(t),i.head.appendChild(t)))}}function e1(e){Ca.D(e),g0("dns-prefetch",e,null)}function t1(e,t){Ca.C(e,t),g0("preconnect",e,t)}function n1(e,t,l){Ca.L(e,t,l);var i=Gu;if(i&&e&&t){var r='link[rel="preload"][as="'+Cn(t)+'"]';t==="image"&&l&&l.imageSrcSet?(r+='[imagesrcset="'+Cn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(r+='[imagesizes="'+Cn(l.imageSizes)+'"]')):r+='[href="'+Cn(e)+'"]';var o=r;switch(t){case"style":o=Yu(e);break;case"script":o=Vu(e)}zl.has(o)||(e=S({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),zl.set(o,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(ar(o))||t==="script"&&i.querySelector(ir(o))||(t=i.createElement("link"),vn(t,"link",e),Zt(t),i.head.appendChild(t)))}}function l1(e,t){Ca.m(e,t);var l=Gu;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Cn(i)+'"][href="'+Cn(e)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Vu(e)}if(!zl.has(o)&&(e=S({rel:"modulepreload",href:e},t),zl.set(o,e),l.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ir(o)))return}i=l.createElement("link"),vn(i,"link",e),Zt(i),l.head.appendChild(i)}}}function a1(e,t,l){Ca.S(e,t,l);var i=Gu;if(i&&e){var r=dl(i).hoistableStyles,o=Yu(e);t=t||"default";var d=r.get(o);if(!d){var b={loading:0,preload:null};if(d=i.querySelector(ar(o)))b.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},l),(l=zl.get(o))&&dh(e,l);var T=d=i.createElement("link");Zt(T),vn(T,"link",e),T._p=new Promise(function(Z,Q){T.onload=Z,T.onerror=Q}),T.addEventListener("load",function(){b.loading|=1}),T.addEventListener("error",function(){b.loading|=2}),b.loading|=4,kc(d,t,i)}d={type:"stylesheet",instance:d,count:1,state:b},r.set(o,d)}}}function i1(e,t){Ca.X(e,t);var l=Gu;if(l&&e){var i=dl(l).hoistableScripts,r=Vu(e),o=i.get(r);o||(o=l.querySelector(ir(r)),o||(e=S({src:e,async:!0},t),(t=zl.get(r))&&mh(e,t),o=l.createElement("script"),Zt(o),vn(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function u1(e,t){Ca.M(e,t);var l=Gu;if(l&&e){var i=dl(l).hoistableScripts,r=Vu(e),o=i.get(r);o||(o=)DELIM" +R"DELIM(l.querySelector(ir(r)),o||(e=S({src:e,async:!0,type:"module"},t),(t=zl.get(r))&&mh(e,t),o=l.createElement("script"),Zt(o),vn(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}function v0(e,t,l,i){var r=(r=pe.current)?Zc(r):null;if(!r)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Yu(l.href),l=dl(r).hoistableStyles,i=l.get(t),i||(i={type:"style",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Yu(l.href);var o=dl(r).hoistableStyles,d=o.get(e);if(d||(r=r.ownerDocument||r,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,d),(o=r.querySelector(ar(e)))&&!o._p&&(d.instance=o,d.state.loading=5),zl.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},zl.set(e,l),o||s1(r,e,l,d.state))),t&&i===null)throw Error(s(528,""));return d}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Vu(l),l=dl(r).hoistableScripts,i=l.get(t),i||(i={type:"script",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Yu(e){return'href="'+Cn(e)+'"'}function ar(e){return'link[rel="stylesheet"]['+e+"]"}function y0(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function s1(e,t,l,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),vn(t,"link",l),Zt(t),e.head.appendChild(t))}function Vu(e){return'[src="'+Cn(e)+'"]'}function ir(e){return"script[async]"+e}function b0(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Cn(l.href)+'"]');if(i)return t.instance=i,Zt(i),i;var r=S({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Zt(i),vn(i,"style",r),kc(i,l.precedence,e),t.instance=i;case"stylesheet":r=Yu(l.href);var o=e.querySelector(ar(r));if(o)return t.state.loading|=4,t.instance=o,Zt(o),o;i=y0(l),(r=zl.get(r))&&dh(i,r),o=(e.ownerDocument||e).createElement("link"),Zt(o);var d=o;return d._p=new Promise(function(b,T){d.onload=b,d.onerror=T}),vn(o,"link",i),t.state.loading|=4,kc(o,l.precedence,e),t.instance=o;case"script":return o=Vu(l.src),(r=e.querySelector(ir(o)))?(t.instance=r,Zt(r),r):(i=l,(r=zl.get(o))&&(i=S({},l),mh(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Zt(r),vn(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,kc(i,l.precedence,e));return t.instance}function kc(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,d=0;d title"):null)}function r1(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function x0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function c1(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var r=Yu(i.href),o=t.querySelector(ar(r));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Lc.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=o,Zt(o);return}o=t.ownerDocument||t,i=y0(i),(r=zl.get(r))&&dh(i,r),o=o.createElement("link"),Zt(o);var d=o;d._p=new Promise(function(b,T){d.onload=b,d.onerror=T}),vn(o,"link",i),l.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Lc.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ph=0;function o1(e,t){return e.stylesheets&&e.count===0&&qc(e,e.stylesheets),0ph?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function Lc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Bc=null;function qc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Bc=new Map,t.forEach(f1,e),Bc=null,Lc.call(e))}function f1(e,t){if(!(t.state.loading&4)){var l=Bc.get(e);if(l)var i=l.get(null);else{l=new Map,Bc.set(e,l);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Eh.exports=O1(),Eh.exports}var N1=M1();const D1=zv(N1),ad="libbitcoinAdminDashboardEndpoints";function j1(){return globalThis.window?.location.origin??"http://localhost"}function aa(n){const a=n.trim();if(!a)throw new Error("Endpoint URL is required");const u=/^[a-z][a-z\d+\-.]*:\/\//iu.test(a)?a:`http://${a}`,s=new URL(u);if(s.protocol!=="http:"&&s.protocol!=="https:")throw new Error("Endpoint must use HTTP or HTTPS");return s.pathname=s.pathname.replace(/\/+$/u,"")||"/",s.search="",s.hash="",s.toString().replace(/\/$/u,"")}function Ev(n){const a=new URL(aa(n));return a.protocol=a.protocol==="https:"?"wss:":"ws:",a.pathname="/",a.search="",a.hash="",a.toString()}function C1(n,a=j1()){return new URL(aa(n)).origin===new URL(a).origin}function Tv(){return{adminUrl:aa("http://172.20.208.1:8080"),nativeUrl:aa("http://172.20.208.1:80")}}function R1(){const n=Tv(),u=globalThis.window?.localStorage.getItem(ad);if(!u)return n;try{const s=JSON.parse(u);if(!s||typeof s!="object"||Array.isArray(s))return n;const c=s;return{adminUrl:typeof c.adminUrl=="string"?aa(c.adminUrl):n.adminUrl,nativeUrl:typeof c.nativeUrl=="string"?aa(c.nativeUrl):n.nativeUrl}}catch{return n}}function U1(n){const a={adminUrl:aa(n.adminUrl),nativeUrl:aa(n.nativeUrl)};globalThis.window?.localStorage.setItem(ad,JSON.stringify(a))}function Z1(){globalThis.window?.localStorage.removeItem(ad)}function k1({configuration:n,onClose:a,onReset:u,onSave:s}){const[c,h]=De.useState(n.adminUrl),[f,p]=De.useState(n.nativeUrl),[v,g]=De.useState(null);function z(S){S.preventDefault();try{s({adminUrl:aa(c),nativeUrl:aa(f)})}catch(E){g(E instanceof Error?E.message:"Invalid endpoint configuration")}}return M.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:S=>{S.target===S.currentTarget&&a()},children:M.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"endpoint-settings-title",className:"border-accent/30 bg-surface w-full max-w-xl rounded-2xl border shadow-2xl shadow-black/50",children:[M.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Runtime configuration"}),M.jsx("h2",{id:"endpoint-settings-title",className:"mt-1 text-xl font-semibold",children:"Node endpoints"})]}),M.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close endpoint settings",children:"×"})]}),M.jsxs("form",{onSubmit:z,className:"space-y-5 p-5",children:[M.jsxs("label",{className:"block space-y-2",children:[M.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Admin endpoint"}),M.jsx("input",{value:c,onChange:S=>{h(S.target.value)},className:"border-accent/30 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:admin-port",autoComplete:"url"})]}),M.jsxs("label",{className:"block space-y-2",children:[M.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Native endpoint"}),M.jsx("input",{value:f,onChange:S=>{p(S.target.value)},className:"border-accent/30 bg-background/70 text-textPrimary focus:border-accent w-full rounded-lg border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:native-port",autoComplete:"url"})]}),v&&M.jsx("p",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-300",children:v}),M.jsxs("div",{className:"flex flex-wrap justify-between gap-3 pt-2",children:[M.jsx("button",{type:"button",onClick:u,className:"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary rounded-lg border px-4 py-2 text-sm",children:"Reset defaults"}),M.jsxs("div",{className:"flex gap-2",children:[M.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-textPrimary rounded-lg px-4 py-2 text-sm",children:"Cancel"}),M.jsx("button",{type:"submit",className:"bg-accent text-background hover:bg-accent/90 rounded-lg px-4 py-2 text-sm font-semibold",children:"Save and reconnect"})]})]})]})]})})}var $0;function X(n,a,u){function s(p,v){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:v,constr:f,traits:new Set},enumerable:!1}),p._zod.traits.has(n))return;p._zod.traits.add(n),a(p,v);const g=f.prototype,z=Object.keys(g);for(let S=0;Su?.Parent&&p instanceof u.Parent?!0:p?._zod?.traits?.has(n)}),Object.defineProperty(f,"name",{value:n}),f}class Iu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Av extends Error{constructor(a){super(`Encountered unidirectional transform during encode: ${a}`),this.name="ZodEncodeError"}}($0=globalThis).__zod_globalConfig??($0.__zod_globalConfig={});const id=globalThis.__zod_globalConfig;function nu(n){return id}function wv(n){const a=Object.values(n).filter(s=>typeof s=="number");return Object.entries(n).filter(([s,c])=>a.indexOf(+s)===-1).map(([s,c])=>c)}function kh(n,a){return typeof a=="bigint"?a.toString():a}function ud(n){return{get value(){{const a=n();return Object.defineProperty(this,"value",{value:a}),a}}}}function sd(n){return n==null}function rd(n){const a=n.startsWith("^")?1:0,u=n.endsWith("$")?n.length-1:n.length;return n.slice(a,u)}function H1(n,a){const u=n/a,s=Math.round(u),c=Number.EPSILON*Math.max(Math.abs(u),1);return Math.abs(u-s){};function ao(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const B1=ud(()=>{if(id.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function xr(n){if(ao(n)===!1)return!1;const a=n.constructor;if(a===void 0||typeof a!="function")return!0;const u=a.prototype;return!(ao(u)===!1||Object.prototype.hasOwnProperty.call(u,"isPrototypeOf")===!1)}function Mv(n){return xr(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const q1=new Set(["string","number","symbol"]);function ho(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zi(n,a,u){const s=new n._zod.constr(a??n._zod.def);return(!a||u?.parent)&&(s._zod.parent=n),s}function Ae(n){const a=n;if(!a)return{};if(typeof a=="string")return{error:()=>a};if(a?.message!==void 0){if(a?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");a.error=a.message}return delete a.message,typeof a.error=="string"?{...a,error:()=>a.error}:a}function Q1(n){return Object.keys(n).filter(a=>n[a]._zod.optin==="optional"&&n[a]._zod.optout==="optional")}const G1={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 Y1(n,a){const u=n._zod.def,s=u.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const h=xi(n._zod.def,{get shape(){const f={};for(const p in a){if(!(p in u.shape))throw new Error(`Unrecognized key: "${p}"`);a[p]&&(f[p]=u.shape[p])}return iu(this,"shape",f),f},checks:[]});return zi(n,h)}function V1(n,a){const u=n._zod.def,s=u.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const h=xi(n._zod.def,{get shape(){const f={...n._zod.def.shape};for(const p in a){if(!(p in u.shape))throw new Error(`Unrecognized key: "${p}"`);a[p]&&delete f[p]}return iu(this,"shape",f),f},checks:[]});return zi(n,h)}function $1(n,a){if(!xr(a))throw new Error("Invalid input to extend: expected a plain object");const u=n._zod.def.checks;if(u&&u.length>0){const h=n._zod.def.shape;for(const f in a)if(Object.getOwnPropertyDescriptor(h,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const c=xi(n._zod.def,{get shape(){const h={...n._zod.def.shape,...a};return iu(this,"shape",h),h}});return zi(n,c)}function K1(n,a){if(!xr(a))throw new Error("Invalid input to safeExtend: expected a plain object");const u=xi(n._zod.def,{get shape(){const s={...n._zod.def.shape,...a};return iu(this,"shape",s),s}});return zi(n,u)}function X1(n,a){if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const u=xi(n._zod.def,{get shape(){const s={...n._zod.def.shape,...a._zod.def.shape};return iu(this,"shape",s),s},get catchall(){return a._zod.def.catchall},checks:a._zod.def.checks??[]});return zi(n,u)}function J1(n,a,u){const c=a._zod.def.checks;if(c&&c.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const f=xi(a._zod.def,{get shape(){const p=a._zod.def.shape,v={...p};if(u)for(const g in u){if(!(g in p))throw new Error(`Unrecognized key: "${g}"`);u[g]&&(v[g]=n?new n({type:"optional",innerType:p[g]}):p[g])}else for(const g in p)v[g]=n?new n({type:"optional",innerType:p[g]}):p[g];return iu(this,"shape",v),v},checks:[]});return zi(a,f)}function F1(n,a,u){const s=xi(a._zod.def,{get shape(){const c=a._zod.def.shape,h={...c};if(u)for(const f in u){if(!(f in h))throw new Error(`Unrecognized key: "${f}"`);u[f]&&(h[f]=new n({type:"nonoptional",innerType:c[f]}))}else for(const f in c)h[f]=new n({type:"nonoptional",innerType:c[f]});return iu(this,"shape",h),h}});return zi(a,s)}function Wu(n,a=0){if(n.aborted===!0)return!0;for(let u=a;u{var s;return(s=u).path??(s.path=[]),u.path.unshift(n),u})}function Jc(n){return typeof n=="string"?n:n?.message}function lu(n,a,u){const s=n.message?n.message:Jc(n.inst?._zod.def?.error?.(n))??Jc(a?.error?.(n))??Jc(u.customError?.(n))??Jc(u.localeError?.(n))??"Invalid input",{inst:c,continue:h,input:f,...p}=n;return p.path??(p.path=[]),p.message=s,a?.reportInput&&(p.input=f),p}function cd(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function zr(...n){const[a,u,s]=n;return typeof a=="string"?{message:a,code:"custom",input:u,inst:s}:{...a}}const Dv=(n,a)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:a,enumerable:!1}),n.message=JSON.stringify(a,kh,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},jv=X("$ZodError",Dv),Cv=X("$ZodError",Dv,{Parent:Error});function I1(n,a=u=>u.message){const u={},s=[];for(const c of n.issues)c.path.length>0?(u[c.path[0]]=u[c.path[0]]||[],u[c.path[0]].push(a(c))):s.push(a(c));return{formErrors:s,fieldErrors:u}}function P1(n,a=u=>u.message){const u={_errors:[]},s=(c,h=[])=>{for(const f of c.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(p=>s({issues:p},[...h,...f.path]));else if(f.code==="invalid_key")s({issues:f.issues},[...h,...f.path]);else if(f.code==="invalid_element")s({issues:f.issues},[...h,...f.path]);else{const p=[...h,...f.path];if(p.length===0)u._errors.push(a(f));else{let v=u,g=0;for(;g(a,u,s,c)=>{const h=s?{...s,async:!1}:{async:!1},f=a._zod.run({value:u,issues:[]},h);if(f instanceof Promise)throw new Iu;if(f.issues.length){const p=new(c?.Err??n)(f.issues.map(v=>lu(v,h,nu())));throw Ov(p,c?.callee),p}return f.value},fd=n=>async(a,u,s,c)=>{const h=s?{...s,async:!0}:{async:!0};let f=a._zod.run({value:u,issues:[]},h);if(f instanceof Promise&&(f=await f),f.issues.length){const p=new(c?.Err??n)(f.issues.map(v=>lu(v,h,nu())));throw Ov(p,c?.callee),p}return f.value},mo=n=>(a,u,s)=>{const c=s?{...s,async:!1}:{async:!1},h=a._zod.run({value:u,issues:[]},c);if(h instanceof Promise)throw new Iu;return h.issues.length?{success:!1,error:new(n??jv)(h.issues.map(f=>lu(f,c,nu())))}:{success:!0,data:h.value}},eS=mo(Cv),po=n=>async(a,u,s)=>{const c=s?{...s,async:!0}:{async:!0};let h=a._zod.run({value:u,issues:[]},c);return h instanceof Promise&&(h=await h),h.issues.length?{success:!1,error:new n(h.issues.map(f=>lu(f,c,nu())))}:{success:!0,data:h.value}},tS=po(Cv),nS=n=>(a,u,s)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return od(n)(a,u,c)},lS=n=>(a,u,s)=>od(n)(a,u,s),aS=n=>async(a,u,s)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return fd(n)(a,u,c)},iS=n=>async(a,u,s)=>fd(n)(a,u,s),uS=n=>(a,u,s)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return mo(n)(a,u,c)},sS=n=>(a,u,s)=>mo(n)(a,u,s),rS=n=>async(a,u,s)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return po(n)(a,u,c)},cS=n=>async(a,u,s)=>po(n)(a,u,s),oS=/^[cC][0-9a-z]{6,}$/,fS=/^[0-9a-z]+$/,hS=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dS=/^[0-9a-vA-V]{20}$/,mS=/^[A-Za-z0-9]{27}$/,pS=/^)DELIM" +R"DELIM([a-zA-Z0-9_-]{21}$/,gS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vS=/^([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})$/,J0=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)$/,yS=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function SS(){return new RegExp(bS,"u")}const _S=/^(?:(?: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])$/,xS=/^(([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}|:))$/,zS=/^((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])$/,ES=/^(([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])$/,TS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rv=/^[A-Za-z0-9_-]*$/,AS=/^https?$/,wS=/^\+[1-9]\d{6,14}$/,Uv="(?:(?:\\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])))",OS=new RegExp(`^${Uv}$`);function Zv(n){const a="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${a}`:n.precision===0?`${a}:[0-5]\\d`:`${a}:[0-5]\\d\\.\\d{${n.precision}}`:`${a}(?::[0-5]\\d(?:\\.\\d+)?)?`}function MS(n){return new RegExp(`^${Zv(n)}$`)}function NS(n){const a=Zv({precision:n.precision}),u=["Z"];n.local&&u.push(""),n.offset&&u.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${a}(?:${u.join("|")})`;return new RegExp(`^${Uv}T(?:${s})$`)}const DS=n=>{const a=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${a}$`)},jS=/^-?\d+$/,CS=/^-?\d+(?:\.\d+)?$/,RS=/^(?:true|false)$/i,US=/^[^A-Z]*$/,ZS=/^[^a-z]*$/,Wn=X("$ZodCheck",(n,a)=>{var u;n._zod??(n._zod={}),n._zod.def=a,(u=n._zod).onattach??(u.onattach=[])}),kv={number:"number",bigint:"bigint",object:"date"},Hv=X("$ZodCheckLessThan",(n,a)=>{Wn.init(n,a);const u=kv[typeof a.value];n._zod.onattach.push(s=>{const c=s._zod.bag,h=(a.inclusive?c.maximum:c.exclusiveMaximum)??Number.POSITIVE_INFINITY;a.value{(a.inclusive?s.value<=a.value:s.value{Wn.init(n,a);const u=kv[typeof a.value];n._zod.onattach.push(s=>{const c=s._zod.bag,h=(a.inclusive?c.minimum:c.exclusiveMinimum)??Number.NEGATIVE_INFINITY;a.value>h&&(a.inclusive?c.minimum=a.value:c.exclusiveMinimum=a.value)}),n._zod.check=s=>{(a.inclusive?s.value>=a.value:s.value>a.value)||s.issues.push({origin:u,code:"too_small",minimum:typeof a.value=="object"?a.value.getTime():a.value,input:s.value,inclusive:a.inclusive,inst:n,continue:!a.abort})}}),kS=X("$ZodCheckMultipleOf",(n,a)=>{Wn.init(n,a),n._zod.onattach.push(u=>{var s;(s=u._zod.bag).multipleOf??(s.multipleOf=a.value)}),n._zod.check=u=>{if(typeof u.value!=typeof a.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof u.value=="bigint"?u.value%a.value===BigInt(0):H1(u.value,a.value)===0)||u.issues.push({origin:typeof u.value,code:"not_multiple_of",divisor:a.value,input:u.value,inst:n,continue:!a.abort})}}),HS=X("$ZodCheckNumberFormat",(n,a)=>{Wn.init(n,a),a.format=a.format||"float64";const u=a.format?.includes("int"),s=u?"int":"number",[c,h]=G1[a.format];n._zod.onattach.push(f=>{const p=f._zod.bag;p.format=a.format,p.minimum=c,p.maximum=h,u&&(p.pattern=jS)}),n._zod.check=f=>{const p=f.value;if(u){if(!Number.isInteger(p)){f.issues.push({expected:s,format:a.format,code:"invalid_type",continue:!1,input:p,inst:n});return}if(!Number.isSafeInteger(p)){p>0?f.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:s,inclusive:!0,continue:!a.abort}):f.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:s,inclusive:!0,continue:!a.abort});return}}ph&&f.issues.push({origin:"number",input:p,code:"too_big",maximum:h,inclusive:!0,inst:n,continue:!a.abort})}}),LS=X("$ZodCheckMaxLength",(n,a)=>{var u;Wn.init(n,a),(u=n._zod.def).when??(u.when=s=>{const c=s.value;return!sd(c)&&c.length!==void 0}),n._zod.onattach.push(s=>{const c=s._zod.bag.maximum??Number.POSITIVE_INFINITY;a.maximum{const c=s.value;if(c.length<=a.maximum)return;const f=cd(c);s.issues.push({origin:f,code:"too_big",maximum:a.maximum,inclusive:!0,input:c,inst:n,continue:!a.abort})}}),BS=X("$ZodCheckMinLength",(n,a)=>{var u;Wn.init(n,a),(u=n._zod.def).when??(u.when=s=>{const c=s.value;return!sd(c)&&c.length!==void 0}),n._zod.onattach.push(s=>{const c=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;a.minimum>c&&(s._zod.bag.minimum=a.minimum)}),n._zod.check=s=>{const c=s.value;if(c.length>=a.minimum)return;const f=cd(c);s.issues.push({origin:f,code:"too_small",minimum:a.minimum,inclusive:!0,input:c,inst:n,continue:!a.abort})}}),qS=X("$ZodCheckLengthEquals",(n,a)=>{var u;Wn.init(n,a),(u=n._zod.def).when??(u.when=s=>{const c=s.value;return!sd(c)&&c.length!==void 0}),n._zod.onattach.push(s=>{const c=s._zod.bag;c.minimum=a.length,c.maximum=a.length,c.length=a.length}),n._zod.check=s=>{const c=s.value,h=c.length;if(h===a.length)return;const f=cd(c),p=h>a.length;s.issues.push({origin:f,...p?{code:"too_big",maximum:a.length}:{code:"too_small",minimum:a.length},inclusive:!0,exact:!0,input:s.value,inst:n,continue:!a.abort})}}),go=X("$ZodCheckStringFormat",(n,a)=>{var u,s;Wn.init(n,a),n._zod.onattach.push(c=>{const h=c._zod.bag;h.format=a.format,a.pattern&&(h.patterns??(h.patterns=new Set),h.patterns.add(a.pattern))}),a.pattern?(u=n._zod).check??(u.check=c=>{a.pattern.lastIndex=0,!a.pattern.test(c.value)&&c.issues.push({origin:"string",code:"invalid_format",format:a.format,input:c.value,...a.pattern?{pattern:a.pattern.toString()}:{},inst:n,continue:!a.abort})}):(s=n._zod).check??(s.check=()=>{})}),QS=X("$ZodCheckRegex",(n,a)=>{go.init(n,a),n._zod.check=u=>{a.pattern.lastIndex=0,!a.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:"regex",input:u.value,pattern:a.pattern.toString(),inst:n,continue:!a.abort})}}),GS=X("$ZodCheckLowerCase",(n,a)=>{a.pattern??(a.pattern=US),go.init(n,a)}),YS=X("$ZodCheckUpperCase",(n,a)=>{a.pattern??(a.pattern=ZS),go.init(n,a)}),VS=X("$ZodCheckIncludes",(n,a)=>{Wn.init(n,a);const u=ho(a.includes),s=new RegExp(typeof a.position=="number"?`^.{${a.position}}${u}`:u);a.pattern=s,n._zod.onattach.push(c=>{const h=c._zod.bag;h.patterns??(h.patterns=new Set),h.patterns.add(s)}),n._zod.check=c=>{c.value.includes(a.includes,a.position)||c.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:a.includes,input:c.value,inst:n,continue:!a.abort})}}),$S=X("$ZodCheckStartsWith",(n,a)=>{Wn.init(n,a);const u=new RegExp(`^${ho(a.prefix)}.*`);a.pattern??(a.pattern=u),n._zod.onattach.push(s=>{const c)DELIM" +R"DELIM(=s._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(u)}),n._zod.check=s=>{s.value.startsWith(a.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:a.prefix,input:s.value,inst:n,continue:!a.abort})}}),KS=X("$ZodCheckEndsWith",(n,a)=>{Wn.init(n,a);const u=new RegExp(`.*${ho(a.suffix)}$`);a.pattern??(a.pattern=u),n._zod.onattach.push(s=>{const c=s._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(u)}),n._zod.check=s=>{s.value.endsWith(a.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:a.suffix,input:s.value,inst:n,continue:!a.abort})}}),XS=X("$ZodCheckOverwrite",(n,a)=>{Wn.init(n,a),n._zod.check=u=>{u.value=a.tx(u.value)}});class JS{constructor(a=[]){this.content=[],this.indent=0,this&&(this.args=a)}indented(a){this.indent+=1,a(this),this.indent-=1}write(a){if(typeof a=="function"){a(this,{execution:"sync"}),a(this,{execution:"async"});return}const s=a.split(` +`).filter(f=>f),c=Math.min(...s.map(f=>f.length-f.trimStart().length)),h=s.map(f=>f.slice(c)).map(f=>" ".repeat(this.indent*2)+f);for(const f of h)this.content.push(f)}compile(){const a=Function,u=this?.args,c=[...(this?.content??[""]).map(h=>` ${h}`)];return new a(...u,c.join(` +`))}}const FS={major:4,minor:4,patch:3},qt=X("$ZodType",(n,a)=>{var u;n??(n={}),n._zod.def=a,n._zod.bag=n._zod.bag||{},n._zod.version=FS;const s=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&s.unshift(n);for(const c of s)for(const h of c._zod.onattach)h(n);if(s.length===0)(u=n._zod).deferred??(u.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const c=(f,p,v)=>{let g=Wu(f),z;for(const S of p){if(S._zod.def.when){if(W1(f)||!S._zod.def.when(f))continue}else if(g)continue;const E=f.issues.length,N=S._zod.check(f);if(N instanceof Promise&&v?.async===!1)throw new Iu;if(z||N instanceof Promise)z=(z??Promise.resolve()).then(async()=>{await N,f.issues.length!==E&&(g||(g=Wu(f,E)))});else{if(f.issues.length===E)continue;g||(g=Wu(f,E))}}return z?z.then(()=>f):f},h=(f,p,v)=>{if(Wu(f))return f.aborted=!0,f;const g=c(p,s,v);if(g instanceof Promise){if(v.async===!1)throw new Iu;return g.then(z=>n._zod.parse(z,v))}return n._zod.parse(g,v)};n._zod.run=(f,p)=>{if(p.skipChecks)return n._zod.parse(f,p);if(p.direction==="backward"){const g=n._zod.parse({value:f.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(z=>h(z,f,p)):h(g,f,p)}const v=n._zod.parse(f,p);if(v instanceof Promise){if(p.async===!1)throw new Iu;return v.then(g=>c(g,s,p))}return c(v,s,p)}}dt(n,"~standard",()=>({validate:c=>{try{const h=eS(n,c);return h.success?{value:h.data}:{issues:h.error?.issues}}catch{return tS(n,c).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),hd=X("$ZodString",(n,a)=>{qt.init(n,a),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??DS(n._zod.bag),n._zod.parse=(u,s)=>{if(a.coerce)try{u.value=String(u.value)}catch{}return typeof u.value=="string"||u.issues.push({expected:"string",code:"invalid_type",input:u.value,inst:n}),u}}),At=X("$ZodStringFormat",(n,a)=>{go.init(n,a),hd.init(n,a)}),WS=X("$ZodGUID",(n,a)=>{a.pattern??(a.pattern=vS),At.init(n,a)}),IS=X("$ZodUUID",(n,a)=>{if(a.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[a.version];if(s===void 0)throw new Error(`Invalid UUID version: "${a.version}"`);a.pattern??(a.pattern=J0(s))}else a.pattern??(a.pattern=J0());At.init(n,a)}),PS=X("$ZodEmail",(n,a)=>{a.pattern??(a.pattern=yS),At.init(n,a)}),e_=X("$ZodURL",(n,a)=>{At.init(n,a),n._zod.check=u=>{try{const s=u.value.trim();if(!a.normalize&&a.protocol?.source===AS.source&&!/^https?:\/\//i.test(s)){u.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:u.value,inst:n,continue:!a.abort});return}const c=new URL(s);a.hostname&&(a.hostname.lastIndex=0,a.hostname.test(c.hostname)||u.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:a.hostname.source,input:u.value,inst:n,continue:!a.abort})),a.protocol&&(a.protocol.lastIndex=0,a.protocol.test(c.protocol.endsWith(":")?c.protocol.slice(0,-1):c.protocol)||u.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:a.protocol.source,input:u.value,inst:n,continue:!a.abort})),a.normalize?u.value=c.href:u.value=s;return}catch{u.issues.push({code:"invalid_format",format:"url",input:u.value,inst:n,continue:!a.abort})}}}),t_=X("$ZodEmoji",(n,a)=>{a.pattern??(a.pattern=SS()),At.init(n,a)}),n_=X("$ZodNanoID",(n,a)=>{a.pattern??(a.pattern=pS),At.init(n,a)}),l_=X("$ZodCUID",(n,a)=>{a.pattern??(a.pattern=oS),At.init(n,a)}),a_=X("$ZodCUID2",(n,a)=>{a.pattern??(a.pattern=fS),At.init(n,a)}),i_=X("$ZodULID",(n,a)=>{a.pattern??(a.pattern=hS),At.init(n,a)}),u_=X("$ZodXID",(n,a)=>{a.pattern??(a.pattern=dS),At.init(n,a)}),s_=X("$ZodKSUID",(n,a)=>{a.pattern??(a.pattern=mS),At.init(n,a)}),r_=X("$ZodISODateTime",(n,a)=>{a.pattern??(a.pattern=NS(a)),At.init(n,a)}),c_=X("$ZodISODate",(n,a)=>{a.pattern??(a.pattern=OS),At.init(n,a)}),o_=X("$ZodISOTime",(n,a)=>{a.pattern??(a.pattern=MS(a)),At.init(n,a)}),f_=X("$ZodISODuration",(n,a)=>{a.pattern??(a.pattern=gS),At.init(n,a)}),h_=X("$ZodIPv4",(n,a)=>{a.pattern??(a.pattern=_S),At.init(n,a),n._zod.bag.format="ipv4"}),d_=X("$ZodIPv6",(n,a)=>{a.pattern??(a.pattern=xS),At.init(n,a),n._zod.bag.format="ipv6",n._zod.check=u=>{try{new URL(`http://[${u.value}]`)}catch{u.issues.push({code:"invalid_format",format:"ipv6",input:u.value,inst:n,continue:!a.abort})}}}),m_=X("$ZodCIDRv4",(n,a)=>{a.pattern??(a.pattern=zS),At.init(n,a)}),p_=X("$ZodCIDRv6",(n,a)=>{a.pattern??(a.pattern=ES),At.init(n,a),n._zod.check=u=>{const s=u.value.split("/");try{if(s.length!==2)throw new Error;const[c,h]=s;if(!h)throw new Error;const f=Number(h);if(`${f}`!==h)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${c}]`)}catch{u.issues.push({code:"invalid_format",format:"cidrv6",input:u.value,inst:n,continue:!a.abort})}}});function Bv(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const g_=X("$ZodBase64",(n,a)=>{a.pattern??(a.pattern=TS),At.init(n,a),n._zod.bag.contentEncoding="base64",n._zod.check=u=>{Bv(u.value)||u.issues.push({code:"invalid_format",format:"base64",input:u.value,inst:n,continue:!a.abort})}});function v_(n){if(!Rv.test(n))return!1;const a=n.replace(/[-_]/g,s=>s==="-"?"+":"/"),u=a.padEnd(Math.ceil(a.length/4)*4,"=");return Bv(u)}const y_=X("$ZodBase64URL",(n,a)=>{a.pattern??(a.pattern=Rv),At.init(n,a),n._zod.bag.contentEncoding="base64url",n._zod.check=u=>{v_(u.value)||u.issues.push({code:"invalid_format",format:"base64url",input:u.value,inst:n,continue:!a.abort})}}),b_=X("$ZodE164",(n,a)=>{a.pattern??(a.pattern=wS),At.init(n,a)});function S_(n,a=null){try{const u=n.split(".");if(u.length!==3)return!1;const[s]=u;if(!s)return!1;const c=JSON.parse(atob(s));return!("typ"in c&&c?.typ!=="JWT"||!c.alg||a&&(!("alg"in c)||c.alg!==a))}catch{return!1}}const __=X("$ZodJWT",(n,a)=>{At.init(n,a),n._zod.check=u=>{S_(u.value,a.alg)||u.issues.push({code:"invalid_format",format:"jwt",input:u.value,inst:n,continue:!a.abort})}}),qv=X("$ZodNumber",(n,a)=>{qt.init(n,a),n._zod.pattern=n._zod.bag.pattern??CS,n._zod.parse=(u,s)=>{if(a.coerce)try{u.value=Number(u.value)}catch{}const c=u.value;if(typeof c=="number"&&!Number.isNaN(c)&&Number.isFinite(c))return u;const h=typeof c=="number"?Number.isNaN(c)?"NaN":Number.isFinite(c)?void 0:"Infinity":void 0;return u.issues.push({expected:"number",code:"invalid_type",input:c,inst:n,...h?{received:h}:{}}),u}}),x_=X("$ZodNumberFormat",(n,a)=>{HS.init(n,a),qv.init(n,a)}),z_=X("$ZodBoolean",(n,a)=>{qt.init(n,a),n._zod.pattern=RS,n._zod.parse=(u,s)=>{if(a.coerce)try{u.value=!!u.value}catch{}const c=u.value;return typeof c=="boolean"||u.issues.push({expected:"boolean",code:"invalid_type",input:c,inst:n}),u}}),E_=X("$ZodUnknown",(n,a)=>{qt.init(n,a),n._zod.parse=u=>u}),T_=X("$ZodNever",(n,a)=>{qt.init(n,a),n._zod.parse=(u,s)=>(u.issues.push({expected:"never",c)DELIM" +R"DELIM(ode:"invalid_type",input:u.value,inst:n}),u)});function F0(n,a,u){n.issues.length&&a.issues.push(...Nv(u,n.issues)),a.value[u]=n.value}const A_=X("$ZodArray",(n,a)=>{qt.init(n,a),n._zod.parse=(u,s)=>{const c=u.value;if(!Array.isArray(c))return u.issues.push({expected:"array",code:"invalid_type",input:c,inst:n}),u;u.value=Array(c.length);const h=[];for(let f=0;fF0(g,u,f))):F0(v,u,f)}return h.length?Promise.all(h).then(()=>u):u}});function io(n,a,u,s,c,h){const f=u in s;if(n.issues.length){if(c&&h&&!f)return;a.issues.push(...Nv(u,n.issues))}if(!f&&!c){n.issues.length||a.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[u]});return}n.value===void 0?f&&(a.value[u]=void 0):a.value[u]=n.value}function Qv(n){const a=Object.keys(n.shape);for(const s of a)if(!n.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const u=Q1(n.shape);return{...n,keys:a,keySet:new Set(a),numKeys:a.length,optionalKeys:new Set(u)}}function Gv(n,a,u,s,c,h){const f=[],p=c.keySet,v=c.catchall._zod,g=v.def.type,z=v.optin==="optional",S=v.optout==="optional";for(const E in a){if(E==="__proto__"||p.has(E))continue;if(g==="never"){f.push(E);continue}const N=v.run({value:a[E],issues:[]},s);N instanceof Promise?n.push(N.then(C=>io(C,u,E,a,z,S))):io(N,u,E,a,z,S)}return f.length&&u.issues.push({code:"unrecognized_keys",keys:f,input:a,inst:h}),n.length?Promise.all(n).then(()=>u):u}const w_=X("$ZodObject",(n,a)=>{if(qt.init(n,a),!Object.getOwnPropertyDescriptor(a,"shape")?.get){const p=a.shape;Object.defineProperty(a,"shape",{get:()=>{const v={...p};return Object.defineProperty(a,"shape",{value:v}),v}})}const s=ud(()=>Qv(a));dt(n._zod,"propValues",()=>{const p=a.shape,v={};for(const g in p){const z=p[g]._zod;if(z.values){v[g]??(v[g]=new Set);for(const S of z.values)v[g].add(S)}}return v});const c=ao,h=a.catchall;let f;n._zod.parse=(p,v)=>{f??(f=s.value);const g=p.value;if(!c(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:n}),p;p.value={};const z=[],S=f.shape;for(const E of f.keys){const N=S[E],C=N._zod.optin==="optional",J=N._zod.optout==="optional",F=N._zod.run({value:g[E],issues:[]},v);F instanceof Promise?z.push(F.then(P=>io(P,p,E,g,C,J))):io(F,p,E,g,C,J)}return h?Gv(z,g,p,v,s.value,n):z.length?Promise.all(z).then(()=>p):p}}),O_=X("$ZodObjectJIT",(n,a)=>{w_.init(n,a);const u=n._zod.parse,s=ud(()=>Qv(a)),c=E=>{const N=new JS(["shape","payload","ctx"]),C=s.value,J=I=>{const G=X0(I);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};N.write("const input = payload.value;");const F=Object.create(null);let P=0;for(const I of C.keys)F[I]=`key_${P++}`;N.write("const newResult = {};");for(const I of C.keys){const G=F[I],ie=X0(I),ne=E[I],le=ne?._zod?.optin==="optional",se=ne?._zod?.optout==="optional";N.write(`const ${G} = ${J(I)};`),le&&se?N.write(` + if (${G}.issues.length) { + if (${ie} in input) { + payload.issues = payload.issues.concat(${G}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${ie}, ...iss.path] : [${ie}] + }))); + } } - - return function(line) - { - lines.push(line); - if (lines.length > scrollback) - lines.splice(0, lines.length - scrollback); - - if (!pending) - { - pending = true; - requestAnimationFrame(render); - } - }; - } - - const logPane = pane('log'); - const eventPane = pane('events'); - - // One socket, upgraded on the page's own endpoint. - const socket = new WebSocket( - (location.protocol === 'https:' ? 'wss://' : 'ws://') + - location.host + '/'); - - // Renders a checkbox set; the url parameter carries the channel mask. - function channel(names, containerId, param, target) - { - const boxes = []; - const container = document.getElementById(containerId); - const initial = Number(new URLSearchParams(location.search) - .get(param) ?? 0); - - // Filter mask from checkboxes (2 ** ordinal, exact below 2 ** 53). - function mask() - { - return boxes.reduce((sum, box, bit) => - sum + (box.checked ? 2 ** bit : 0), 0); + + if (${G}.value === undefined) { + if (${ie} in input) { + newResult[${ie}] = undefined; + } + } else { + newResult[${ie}] = ${G}.value; } - - function subscribe() - { - // Mask state rides the page url (bookmarkable, survives refresh). - const url = new URLSearchParams(location.search); - url.set(param, mask()); - history.replaceState(null, '', location.pathname + '?' + url); - - if (socket.readyState === WebSocket.OPEN) - socket.send(target + '?filter=' + mask()); + + `):le?N.write(` + if (${G}.issues.length) { + payload.issues = payload.issues.concat(${G}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${ie}, ...iss.path] : [${ie}] + }))); } - - names.forEach((name, bit) => - { - const label = document.createElement('label'); - const box = document.createElement('input'); - box.type = 'checkbox'; - box.checked = (initial / 2 ** bit) % 2 >= 1; - box.addEventListener('change', subscribe); - label.append(box, ' ', name, ' '); - container.append(label); - boxes.push(box); - }); - - return { boxes, subscribe }; - } - - const logs = channel(levels, 'levels', 'filter', '/v1/log/subscribe'); - const kinds = channel(events, 'kinds', 'events', '/v1/event/subscribe'); - - // Tab switching. - const logTab = document.getElementById('log-tab'); - const eventTab = document.getElementById('event-tab'); - - document.getElementById('show-log').addEventListener('click', () => - { - logTab.hidden = false; - eventTab.hidden = true; - }); - - document.getElementById('show-events').addEventListener('click', () => - { - logTab.hidden = true; - eventTab.hidden = false; - }); - - socket.addEventListener('open', () => - { - status.textContent = 'connected'; - logs.subscribe(); - kinds.subscribe(); - }); - - socket.addEventListener('close', () => - { - status.textContent = 'disconnected'; - }); - - socket.addEventListener('message', (frame) => - { - const message = JSON.parse(frame.data); - - // Ack: previous filter (confirmation only, rough page ignores it). - if ('previous' in message) - return; - - // Log frame: time is zulu milliseconds (js native), second granular. - if ('level' in message) - { - // Dump frames deselected client-side (in-flight on old filter). - if (!logs.boxes[message.level]?.checked) - return; - - const time = new Date(message.time).toLocaleTimeString(); - logPane(time + ' [' + levels[message.level] + '] ' + - message.message); - return; + + if (${G}.value === undefined) { + if (${ie} in input) { + newResult[${ie}] = undefined; + } + } else { + newResult[${ie}] = ${G}.value; + } + + `):N.write(` + const ${G}_present = ${ie} in input; + if (${G}.issues.length) { + payload.issues = payload.issues.concat(${G}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${ie}, ...iss.path] : [${ie}] + }))); + } + if (!${G}_present && !${G}.issues.length) { + payload.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: undefined, + path: [${ie}] + }); } - // Event frame: time is zulu milliseconds (js native), value is - // event-defined data (height, timespan in named units, etc.). - if ('event' in message) - { - // Dump frames deselected client-side (in-flight on old filter). - if (!kinds.boxes[message.event]?.checked) - return; - - const time = new Date(message.time).toLocaleTimeString() + '.' + - String(message.time % 1000).padStart(3, '0'); - eventPane(time + ' [' + events[message.event] + '] ' + - message.value + '\n'); + if (${G}_present) { + if (${G}.value === undefined) { + newResult[${ie}] = undefined; + } else { + newResult[${ie}] = ${G}.value; + } } - }); -});)") + + `)}N.write("payload.value = newResult;"),N.write("return payload;");const Y=N.compile();return(I,G)=>Y(E,I,G)};let h;const f=ao,p=!id.jitless,g=p&&B1.value,z=a.catchall;let S;n._zod.parse=(E,N)=>{S??(S=s.value);const C=E.value;return f(C)?p&&g&&N?.async===!1&&N.jitless!==!0?(h||(h=c(a.shape)),E=h(E,N),z?Gv([],C,E,N,S,n):E):u(E,N):(E.issues.push({expected:"object",code:"invalid_type",input:C,inst:n}),E)}});function W0(n,a,u,s){for(const h of n)if(h.issues.length===0)return a.value=h.value,a;const c=n.filter(h=>!Wu(h));return c.length===1?(a.value=c[0].value,c[0]):(a.issues.push({code:"invalid_union",input:a.value,inst:u,errors:n.map(h=>h.issues.map(f=>lu(f,s,nu())))}),a)}const M_=X("$ZodUnion",(n,a)=>{qt.init(n,a),dt(n._zod,"optin",()=>a.options.some(s=>s._zod.optin==="optional")?"optional":void 0),dt(n._zod,"optout",()=>a.options.some(s=>s._zod.optout==="optional")?"optional":void 0),dt(n._zod,"values",()=>{if(a.options.every(s=>s._zod.values))return new Set(a.options.flatMap(s=>Array.from(s._zod.values)))}),dt(n._zod,"pattern",()=>{if(a.options.every(s=>s._zod.pattern)){const s=a.options.map(c=>c._zod.pattern);return new RegExp(`^(${s.map(c=>rd(c.source)).join("|")})$`)}});const u=a.options.length===1?a.options[0]._zod.run:null;n._zod.parse=(s,c)=>{if(u)return u(s,c);let h=!1;const f=[];for(const p of a.options){const v=p._zod.run({value:s.value,issues:[]},c);if(v instanceof Promise)f.push(v),h=!0;else{if(v.issues.length===0)return v;f.push(v)}}return h?Promise.all(f).then(p=>W0(p,s,n,c)):W0(f,s,n,c)}}),N_=X("$ZodIntersection",(n,a)=>{qt.init(n,a),n._zod.parse=(u,s)=>{const c=u.value,h=a.left._zod.run({value:c,issues:[]},s),f=a.right._zod.run({value:c,issues:[]},s);return h instanceof Promise||f instanceof Promise?Promise.all([h,f]).then(([v,g])=>I0(u,v,g)):I0(u,h,f)}});function Hh(n,a){if(n===a)return{valid:!0,data:n};if(n instanceof Date&&a instanceof Date&&+n==+a)return{valid:!0,data:n};if(xr(n)&&xr(a)){const u=Object.keys(a),s=Object.keys(n).filter(h=>u.indexOf(h)!==-1),c={...n,...a};for(const h of s){const f=Hh(n[h],a[h]);if(!f.valid)return{valid:!1,mergeErrorPath:[h,...f.mergeErrorPath]};c[h]=f.data}return{valid:!0,data:c}}if(Array.isArray(n)&&Array.isArray(a)){if(n.length!==a.length)return{valid:!1,mergeErrorPath:[]};const u=[];for(let s=0;sp.l&&p.r).map(([p])=>p);if(h.length&&c&&n.issues.push({...c,keys:h}),Wu(n))return n;const f=Hh(a.value,u.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return n.value=f.data,n}const D_=X("$ZodEnum",(n,a)=>{qt.init(n,a);const u=wv(a.entries),s=new Set(u);n._zod.values=s,n._zod.pattern=new RegExp(`^(${u.filter(c=>q1.has(typeof c)).map(c=>typeof c=="string"?ho(c):c.toString()).join("|")})$`),n._zod.parse=(c,h)=>{const f=c.value;return s.has(f)||c.issues.push({code)DELIM" +R"DELIM(:"invalid_value",values:u,input:f,inst:n}),c}}),j_=X("$ZodTransform",(n,a)=>{qt.init(n,a),n._zod.optin="optional",n._zod.parse=(u,s)=>{if(s.direction==="backward")throw new Av(n.constructor.name);const c=a.transform(u.value,u);if(s.async)return(c instanceof Promise?c:Promise.resolve(c)).then(f=>(u.value=f,u.fallback=!0,u));if(c instanceof Promise)throw new Iu;return u.value=c,u.fallback=!0,u}});function P0(n,a){return a===void 0&&(n.issues.length||n.fallback)?{issues:[],value:void 0}:n}const Yv=X("$ZodOptional",(n,a)=>{qt.init(n,a),n._zod.optin="optional",n._zod.optout="optional",dt(n._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,void 0]):void 0),dt(n._zod,"pattern",()=>{const u=a.innerType._zod.pattern;return u?new RegExp(`^(${rd(u.source)})?$`):void 0}),n._zod.parse=(u,s)=>{if(a.innerType._zod.optin==="optional"){const c=u.value,h=a.innerType._zod.run(u,s);return h instanceof Promise?h.then(f=>P0(f,c)):P0(h,c)}return u.value===void 0?u:a.innerType._zod.run(u,s)}}),C_=X("$ZodExactOptional",(n,a)=>{Yv.init(n,a),dt(n._zod,"values",()=>a.innerType._zod.values),dt(n._zod,"pattern",()=>a.innerType._zod.pattern),n._zod.parse=(u,s)=>a.innerType._zod.run(u,s)}),R_=X("$ZodNullable",(n,a)=>{qt.init(n,a),dt(n._zod,"optin",()=>a.innerType._zod.optin),dt(n._zod,"optout",()=>a.innerType._zod.optout),dt(n._zod,"pattern",()=>{const u=a.innerType._zod.pattern;return u?new RegExp(`^(${rd(u.source)}|null)$`):void 0}),dt(n._zod,"values",()=>a.innerType._zod.values?new Set([...a.innerType._zod.values,null]):void 0),n._zod.parse=(u,s)=>u.value===null?u:a.innerType._zod.run(u,s)}),U_=X("$ZodDefault",(n,a)=>{qt.init(n,a),n._zod.optin="optional",dt(n._zod,"values",()=>a.innerType._zod.values),n._zod.parse=(u,s)=>{if(s.direction==="backward")return a.innerType._zod.run(u,s);if(u.value===void 0)return u.value=a.defaultValue,u;const c=a.innerType._zod.run(u,s);return c instanceof Promise?c.then(h=>eg(h,a)):eg(c,a)}});function eg(n,a){return n.value===void 0&&(n.value=a.defaultValue),n}const Z_=X("$ZodPrefault",(n,a)=>{qt.init(n,a),n._zod.optin="optional",dt(n._zod,"values",()=>a.innerType._zod.values),n._zod.parse=(u,s)=>(s.direction==="backward"||u.value===void 0&&(u.value=a.defaultValue),a.innerType._zod.run(u,s))}),k_=X("$ZodNonOptional",(n,a)=>{qt.init(n,a),dt(n._zod,"values",()=>{const u=a.innerType._zod.values;return u?new Set([...u].filter(s=>s!==void 0)):void 0}),n._zod.parse=(u,s)=>{const c=a.innerType._zod.run(u,s);return c instanceof Promise?c.then(h=>tg(h,n)):tg(c,n)}});function tg(n,a){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:a}),n}const H_=X("$ZodCatch",(n,a)=>{qt.init(n,a),n._zod.optin="optional",dt(n._zod,"optout",()=>a.innerType._zod.optout),dt(n._zod,"values",()=>a.innerType._zod.values),n._zod.parse=(u,s)=>{if(s.direction==="backward")return a.innerType._zod.run(u,s);const c=a.innerType._zod.run(u,s);return c instanceof Promise?c.then(h=>(u.value=h.value,h.issues.length&&(u.value=a.catchValue({...u,error:{issues:h.issues.map(f=>lu(f,s,nu()))},input:u.value}),u.issues=[],u.fallback=!0),u)):(u.value=c.value,c.issues.length&&(u.value=a.catchValue({...u,error:{issues:c.issues.map(h=>lu(h,s,nu()))},input:u.value}),u.issues=[],u.fallback=!0),u)}}),L_=X("$ZodPipe",(n,a)=>{qt.init(n,a),dt(n._zod,"values",()=>a.in._zod.values),dt(n._zod,"optin",()=>a.in._zod.optin),dt(n._zod,"optout",()=>a.out._zod.optout),dt(n._zod,"propValues",()=>a.in._zod.propValues),n._zod.parse=(u,s)=>{if(s.direction==="backward"){const h=a.out._zod.run(u,s);return h instanceof Promise?h.then(f=>Fc(f,a.in,s)):Fc(h,a.in,s)}const c=a.in._zod.run(u,s);return c instanceof Promise?c.then(h=>Fc(h,a.out,s)):Fc(c,a.out,s)}});function Fc(n,a,u){return n.issues.length?(n.aborted=!0,n):a._zod.run({value:n.value,issues:n.issues,fallback:n.fallback},u)}const B_=X("$ZodReadonly",(n,a)=>{qt.init(n,a),dt(n._zod,"propValues",()=>a.innerType._zod.propValues),dt(n._zod,"values",()=>a.innerType._zod.values),dt(n._zod,"optin",()=>a.innerType?._zod?.optin),dt(n._zod,"optout",()=>a.innerType?._zod?.optout),n._zod.parse=(u,s)=>{if(s.direction==="backward")return a.innerType._zod.run(u,s);const c=a.innerType._zod.run(u,s);return c instanceof Promise?c.then(ng):ng(c)}});function ng(n){return n.value=Object.freeze(n.value),n}const q_=X("$ZodCustom",(n,a)=>{Wn.init(n,a),qt.init(n,a),n._zod.parse=(u,s)=>u,n._zod.check=u=>{const s=u.value,c=a.fn(s);if(c instanceof Promise)return c.then(h=>lg(h,u,s,n));lg(c,u,s,n)}});function lg(n,a,u,s){if(!n){const c={code:"custom",input:u,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(c.params=s._zod.def.params),a.issues.push(zr(c))}}var ag;class Q_{constructor(){this._map=new WeakMap,this._idmap=new Map}add(a,...u){const s=u[0];return this._map.set(a,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,a),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(a){const u=this._map.get(a);return u&&typeof u=="object"&&"id"in u&&this._idmap.delete(u.id),this._map.delete(a),this}get(a){const u=a._zod.parent;if(u){const s={...this.get(u)??{}};delete s.id;const c={...s,...this._map.get(a)};return Object.keys(c).length?c:void 0}return this._map.get(a)}has(a){return this._map.has(a)}}function G_(){return new Q_}(ag=globalThis).__zod_globalRegistry??(ag.__zod_globalRegistry=G_());const pr=globalThis.__zod_globalRegistry;function Y_(n,a){return new n({type:"string",...Ae(a)})}function V_(n,a){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Ae(a)})}function ig(n,a){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Ae(a)})}function $_(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Ae(a)})}function K_(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ae(a)})}function X_(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ae(a)})}function J_(n,a){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ae(a)})}function F_(n,a){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Ae(a)})}function W_(n,a){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Ae(a)})}function I_(n,a){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ae(a)})}function P_(n,a){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Ae(a)})}function e2(n,a){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ae(a)})}function t2(n,a){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Ae(a)})}function n2(n,a){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Ae(a)})}function l2(n,a){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ae(a)})}function a2(n,a){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ae(a)})}function i2(n,a){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ae(a)})}function u2(n,a){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ae(a)})}function s2(n,a){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ae(a)})}function r2(n,a){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Ae(a)})}function c2(n,a){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Ae(a)})}function o2(n,a){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Ae(a)})}function f2(n,a){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Ae(a)})}function h2(n,a){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ae(a)})}function d2(n,a){return new n({type:"string",format:"date",check:"string_format",...Ae(a)})}fun)DELIM" +R"DELIM(ction m2(n,a){return new n({type:"string",format:"time",check:"string_format",precision:null,...Ae(a)})}function p2(n,a){return new n({type:"string",format:"duration",check:"string_format",...Ae(a)})}function g2(n,a){return new n({type:"number",checks:[],...Ae(a)})}function v2(n,a){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Ae(a)})}function y2(n,a){return new n({type:"boolean",...Ae(a)})}function b2(n){return new n({type:"unknown"})}function S2(n,a){return new n({type:"never",...Ae(a)})}function ug(n,a){return new Hv({check:"less_than",...Ae(a),value:n,inclusive:!1})}function Oh(n,a){return new Hv({check:"less_than",...Ae(a),value:n,inclusive:!0})}function sg(n,a){return new Lv({check:"greater_than",...Ae(a),value:n,inclusive:!1})}function Mh(n,a){return new Lv({check:"greater_than",...Ae(a),value:n,inclusive:!0})}function rg(n,a){return new kS({check:"multiple_of",...Ae(a),value:n})}function Vv(n,a){return new LS({check:"max_length",...Ae(a),maximum:n})}function uo(n,a){return new BS({check:"min_length",...Ae(a),minimum:n})}function $v(n,a){return new qS({check:"length_equals",...Ae(a),length:n})}function _2(n,a){return new QS({check:"string_format",format:"regex",...Ae(a),pattern:n})}function x2(n){return new GS({check:"string_format",format:"lowercase",...Ae(n)})}function z2(n){return new YS({check:"string_format",format:"uppercase",...Ae(n)})}function E2(n,a){return new VS({check:"string_format",format:"includes",...Ae(a),includes:n})}function T2(n,a){return new $S({check:"string_format",format:"starts_with",...Ae(a),prefix:n})}function A2(n,a){return new KS({check:"string_format",format:"ends_with",...Ae(a),suffix:n})}function rs(n){return new XS({check:"overwrite",tx:n})}function w2(n){return rs(a=>a.normalize(n))}function O2(){return rs(n=>n.trim())}function M2(){return rs(n=>n.toLowerCase())}function N2(){return rs(n=>n.toUpperCase())}function D2(){return rs(n=>L1(n))}function j2(n,a,u){return new n({type:"array",element:a,...Ae(u)})}function C2(n,a,u){return new n({type:"custom",check:"custom",fn:a,...Ae(u)})}function R2(n,a){const u=U2(s=>(s.addIssue=c=>{if(typeof c=="string")s.issues.push(zr(c,s.value,u._zod.def));else{const h=c;h.fatal&&(h.continue=!1),h.code??(h.code="custom"),h.input??(h.input=s.value),h.inst??(h.inst=u),h.continue??(h.continue=!u._zod.def.abort),s.issues.push(zr(h))}},n(s.value,s)),a);return u}function U2(n,a){const u=new Wn({check:"custom",...Ae(a)});return u._zod.check=n,u}function Kv(n){let a=n?.target??"draft-2020-12";return a==="draft-4"&&(a="draft-04"),a==="draft-7"&&(a="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??pr,target:a,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function bn(n,a,u={path:[],schemaPath:[]}){var s;const c=n._zod.def,h=a.seen.get(n);if(h)return h.count++,u.schemaPath.includes(n)&&(h.cycle=u.path),h.schema;const f={schema:{},count:1,cycle:void 0,path:u.path};a.seen.set(n,f);const p=n._zod.toJSONSchema?.();if(p)f.schema=p;else{const z={...u,schemaPath:[...u.schemaPath,n],path:u.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(a,f.schema,z);else{const E=f.schema,N=a.processors[c.type];if(!N)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${c.type}`);N(n,a,E,z)}const S=n._zod.parent;S&&(f.ref||(f.ref=S),bn(S,a,z),a.seen.get(S).isParent=!0)}const v=a.metadataRegistry.get(n);return v&&Object.assign(f.schema,v),a.io==="input"&&Hn(n)&&(delete f.schema.examples,delete f.schema.default),a.io==="input"&&"_prefault"in f.schema&&((s=f.schema).default??(s.default=f.schema._prefault)),delete f.schema._prefault,a.seen.get(n).schema}function Xv(n,a){const u=n.seen.get(a);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const f of n.seen.entries()){const p=n.metadataRegistry.get(f[0])?.id;if(p){const v=s.get(p);if(v&&v!==f[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(p,f[0])}}const c=f=>{const p=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const S=n.external.registry.get(f[0])?.id,E=n.external.uri??(C=>C);if(S)return{ref:E(S)};const N=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=N,{defId:N,ref:`${E("__shared")}#/${p}/${N}`}}if(f[1]===u)return{ref:"#"};const g=`#/${p}/`,z=f[1].schema.id??`__schema${n.counter++}`;return{defId:z,ref:g+z}},h=f=>{if(f[1].schema.$ref)return;const p=f[1],{ref:v,defId:g}=c(f);p.def={...p.schema},g&&(p.defId=g);const z=p.schema;for(const S in z)delete z[S];z.$ref=v};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 p=f[1];if(a===f[0]){h(f);continue}if(n.external){const g=n.external.registry.get(f[0])?.id;if(a!==f[0]&&g){h(f);continue}}if(n.metadataRegistry.get(f[0])?.id){h(f);continue}if(p.cycle){h(f);continue}if(p.count>1&&n.reused==="ref"){h(f);continue}}}function Jv(n,a){const u=n.seen.get(a);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=p=>{const v=n.seen.get(p);if(v.ref===null)return;const g=v.def??v.schema,z={...g},S=v.ref;if(v.ref=null,S){s(S);const N=n.seen.get(S),C=N.schema;if(C.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(C)):Object.assign(g,C),Object.assign(g,z),p._zod.parent===S)for(const F in g)F==="$ref"||F==="allOf"||F in z||delete g[F];if(C.$ref&&N.def)for(const F in g)F==="$ref"||F==="allOf"||F in N.def&&JSON.stringify(g[F])===JSON.stringify(N.def[F])&&delete g[F]}const E=p._zod.parent;if(E&&E!==S){s(E);const N=n.seen.get(E);if(N?.schema.$ref&&(g.$ref=N.schema.$ref,N.def))for(const C in g)C==="$ref"||C==="allOf"||C in N.def&&JSON.stringify(g[C])===JSON.stringify(N.def[C])&&delete g[C]}n.override({zodSchema:p,jsonSchema:g,path:v.path??[]})};for(const p of[...n.seen.entries()].reverse())s(p[0]);const c={};if(n.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?c.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?c.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const p=n.external.registry.get(a)?.id;if(!p)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(p)}Object.assign(c,u.def??u.schema);const h=n.metadataRegistry.get(a)?.id;h!==void 0&&c.id===h&&delete c.id;const f=n.external?.defs??{};for(const p of n.seen.entries()){const v=p[1];v.def&&v.defId&&(v.def.id===v.defId&&delete v.def.id,f[v.defId]=v.def)}n.external||Object.keys(f).length>0&&(n.target==="draft-2020-12"?c.$defs=f:c.definitions=f);try{const p=JSON.parse(JSON.stringify(c));return Object.defineProperty(p,"~standard",{value:{...a["~standard"],jsonSchema:{input:so(a,"input",n.processors),output:so(a,"output",n.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function Hn(n,a){const u=a??{seen:new Set};if(u.seen.has(n))return!1;u.seen.add(n);const s=n._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return Hn(s.element,u);if(s.type==="set")return Hn(s.valueType,u);if(s.type==="lazy")return Hn(s.getter(),u);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return Hn(s.innerType,u);if(s.type==="intersection")return Hn(s.left,u)||Hn(s.right,u);if(s.type==="record"||s.type==="map")return Hn(s.keyType,u)||Hn(s.valueType,u);if(s.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:Hn(s.in,u)||Hn(s.out,u);if(s.type==="object"){for(const c in s.shape)if(Hn(s.shape[c],u))return!0;retu)DELIM" +R"DELIM(rn!1}if(s.type==="union"){for(const c of s.options)if(Hn(c,u))return!0;return!1}if(s.type==="tuple"){for(const c of s.items)if(Hn(c,u))return!0;return!!(s.rest&&Hn(s.rest,u))}return!1}const Z2=(n,a={})=>u=>{const s=Kv({...u,processors:a});return bn(n,s),Xv(s,n),Jv(s,n)},so=(n,a,u={})=>s=>{const{libraryOptions:c,target:h}=s??{},f=Kv({...c??{},target:h,io:a,processors:u});return bn(n,f),Xv(f,n),Jv(f,n)},k2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},H2=(n,a,u,s)=>{const c=u;c.type="string";const{minimum:h,maximum:f,format:p,patterns:v,contentEncoding:g}=n._zod.bag;if(typeof h=="number"&&(c.minLength=h),typeof f=="number"&&(c.maxLength=f),p&&(c.format=k2[p]??p,c.format===""&&delete c.format,p==="time"&&delete c.format),g&&(c.contentEncoding=g),v&&v.size>0){const z=[...v];z.length===1?c.pattern=z[0].source:z.length>1&&(c.allOf=[...z.map(S=>({...a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},L2=(n,a,u,s)=>{const c=u,{minimum:h,maximum:f,format:p,multipleOf:v,exclusiveMaximum:g,exclusiveMinimum:z}=n._zod.bag;typeof p=="string"&&p.includes("int")?c.type="integer":c.type="number";const S=typeof z=="number"&&z>=(h??Number.NEGATIVE_INFINITY),E=typeof g=="number"&&g<=(f??Number.POSITIVE_INFINITY),N=a.target==="draft-04"||a.target==="openapi-3.0";S?N?(c.minimum=z,c.exclusiveMinimum=!0):c.exclusiveMinimum=z:typeof h=="number"&&(c.minimum=h),E?N?(c.maximum=g,c.exclusiveMaximum=!0):c.exclusiveMaximum=g:typeof f=="number"&&(c.maximum=f),typeof v=="number"&&(c.multipleOf=v)},B2=(n,a,u,s)=>{u.type="boolean"},q2=(n,a,u,s)=>{u.not={}},Q2=(n,a,u,s)=>{},G2=(n,a,u,s)=>{const c=n._zod.def,h=wv(c.entries);h.every(f=>typeof f=="number")&&(u.type="number"),h.every(f=>typeof f=="string")&&(u.type="string"),u.enum=h},Y2=(n,a,u,s)=>{if(a.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},V2=(n,a,u,s)=>{if(a.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},$2=(n,a,u,s)=>{const c=u,h=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=bn(h.element,a,{...s,path:[...s.path,"items"]})},K2=(n,a,u,s)=>{const c=u,h=n._zod.def;c.type="object",c.properties={};const f=h.shape;for(const g in f)c.properties[g]=bn(f[g],a,{...s,path:[...s.path,"properties",g]});const p=new Set(Object.keys(f)),v=new Set([...p].filter(g=>{const z=h.shape[g]._zod;return a.io==="input"?z.optin===void 0:z.optout===void 0}));v.size>0&&(c.required=Array.from(v)),h.catchall?._zod.def.type==="never"?c.additionalProperties=!1:h.catchall?h.catchall&&(c.additionalProperties=bn(h.catchall,a,{...s,path:[...s.path,"additionalProperties"]})):a.io==="output"&&(c.additionalProperties=!1)},X2=(n,a,u,s)=>{const c=n._zod.def,h=c.inclusive===!1,f=c.options.map((p,v)=>bn(p,a,{...s,path:[...s.path,h?"oneOf":"anyOf",v]}));h?u.oneOf=f:u.anyOf=f},J2=(n,a,u,s)=>{const c=n._zod.def,h=bn(c.left,a,{...s,path:[...s.path,"allOf",0]}),f=bn(c.right,a,{...s,path:[...s.path,"allOf",1]}),p=g=>"allOf"in g&&Object.keys(g).length===1,v=[...p(h)?h.allOf:[h],...p(f)?f.allOf:[f]];u.allOf=v},F2=(n,a,u,s)=>{const c=n._zod.def,h=bn(c.innerType,a,s),f=a.seen.get(n);a.target==="openapi-3.0"?(f.ref=c.innerType,u.nullable=!0):u.anyOf=[h,{type:"null"}]},W2=(n,a,u,s)=>{const c=n._zod.def;bn(c.innerType,a,s);const h=a.seen.get(n);h.ref=c.innerType},I2=(n,a,u,s)=>{const c=n._zod.def;bn(c.innerType,a,s);const h=a.seen.get(n);h.ref=c.innerType,u.default=JSON.parse(JSON.stringify(c.defaultValue))},P2=(n,a,u,s)=>{const c=n._zod.def;bn(c.innerType,a,s);const h=a.seen.get(n);h.ref=c.innerType,a.io==="input"&&(u._prefault=JSON.parse(JSON.stringify(c.defaultValue)))},ex=(n,a,u,s)=>{const c=n._zod.def;bn(c.innerType,a,s);const h=a.seen.get(n);h.ref=c.innerType;let f;try{f=c.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}u.default=f},tx=(n,a,u,s)=>{const c=n._zod.def,h=c.in._zod.traits.has("$ZodTransform"),f=a.io==="input"?h?c.out:c.in:c.out;bn(f,a,s);const p=a.seen.get(n);p.ref=f},nx=(n,a,u,s)=>{const c=n._zod.def;bn(c.innerType,a,s);const h=a.seen.get(n);h.ref=c.innerType,u.readOnly=!0},Fv=(n,a,u,s)=>{const c=n._zod.def;bn(c.innerType,a,s);const h=a.seen.get(n);h.ref=c.innerType},lx=X("ZodISODateTime",(n,a)=>{r_.init(n,a),Mt.init(n,a)});function ax(n){return h2(lx,n)}const ix=X("ZodISODate",(n,a)=>{c_.init(n,a),Mt.init(n,a)});function ux(n){return d2(ix,n)}const sx=X("ZodISOTime",(n,a)=>{o_.init(n,a),Mt.init(n,a)});function rx(n){return m2(sx,n)}const cx=X("ZodISODuration",(n,a)=>{f_.init(n,a),Mt.init(n,a)});function ox(n){return p2(cx,n)}const fx=(n,a)=>{jv.init(n,a),n.name="ZodError",Object.defineProperties(n,{format:{value:u=>P1(n,u)},flatten:{value:u=>I1(n,u)},addIssue:{value:u=>{n.issues.push(u),n.message=JSON.stringify(n.issues,kh,2)}},addIssues:{value:u=>{n.issues.push(...u),n.message=JSON.stringify(n.issues,kh,2)}},isEmpty:{get(){return n.issues.length===0}}})},Al=X("ZodError",fx,{Parent:Error}),hx=od(Al),dx=fd(Al),mx=mo(Al),px=po(Al),gx=nS(Al),vx=lS(Al),yx=aS(Al),bx=iS(Al),Sx=uS(Al),_x=sS(Al),xx=rS(Al),zx=cS(Al),cg=new WeakMap;function wr(n,a,u){const s=Object.getPrototypeOf(n);let c=cg.get(s);if(c||(c=new Set,cg.set(s,c)),!c.has(a)){c.add(a);for(const h in u){const f=u[h];Object.defineProperty(s,h,{configurable:!0,enumerable:!1,get(){const p=f.bind(this);return Object.defineProperty(this,h,{configurable:!0,writable:!0,enumerable:!0,value:p}),p},set(p){Object.defineProperty(this,h,{configurable:!0,writable:!0,enumerable:!0,value:p})}})}}}const Qt=X("ZodType",(n,a)=>(qt.init(n,a),Object.assign(n["~standard"],{jsonSchema:{input:so(n,"input"),output:so(n,"output")}}),n.toJSONSchema=Z2(n,{}),n.def=a,n.type=a.type,Object.defineProperty(n,"_def",{value:a}),n.parse=(u,s)=>hx(n,u,s,{callee:n.parse}),n.safeParse=(u,s)=>mx(n,u,s),n.parseAsync=async(u,s)=>dx(n,u,s,{callee:n.parseAsync}),n.safeParseAsync=async(u,s)=>px(n,u,s),n.spa=n.safeParseAsync,n.encode=(u,s)=>gx(n,u,s),n.decode=(u,s)=>vx(n,u,s),n.encodeAsync=async(u,s)=>yx(n,u,s),n.decodeAsync=async(u,s)=>bx(n,u,s),n.safeEncode=(u,s)=>Sx(n,u,s),n.safeDecode=(u,s)=>_x(n,u,s),n.safeEncodeAsync=async(u,s)=>xx(n,u,s),n.safeDecodeAsync=async(u,s)=>zx(n,u,s),wr(n,"ZodType",{check(...u){const s=this.def;return this.clone(xi(s,{checks:[...s.checks??[],...u.map(c=>typeof c=="function"?{_zod:{check:c,def:{check:"custom"},onattach:[]}}:c)]}),{parent:!0})},with(...u){return this.check(...u)},clone(u,s){return zi(this,u,s)},brand(){return this},register(u,s){return u.add(this,s),this},refine(u,s){return this.check(vz(u,s))},superRefine(u,s){return this.check(yz(u,s))},overwrite(u){return this.check(rs(u))},optional(){return dg(this)},exactOptional(){return az(this)},nullable(){return mg(this)},nullish(){return dg(mg(this))},nonoptional(u){return oz(this,u)},array(){return Jx(this)},or(u){return Pv([this,u])},and(u){return Px(this,u)},transform(u){return pg(this,nz(u))},default(u){return sz(this,u)},prefault(u){return cz(this,u)},catch(u){return hz(this,u)},pipe(u){return pg(this,u)},readonly(){return pz(this)},describe(u){const s=this.clone();return pr.add(s,{description:u}),s},meta(...u){if(u.length===0)return pr.get(this);const s=this.clone();return pr.add(s,u[0]),s},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(u){return u(this)}}),Object.defineProperty(n,"description",{get(){return pr.get(n)?.description},configurable:!0}),n)),Wv=X("_ZodString",(n,a)=>{hd.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(s,c,h)=>H2(n,s,c);const u=n._zod.bag;n.format=u.format??null,n.minLength=u.minimum??null,n.maxLength=u.maximum??null,wr(n,"_ZodString",{regex(...s){return this.check(_2(...s))},includes(...s){return this.check(E2(...s))},startsWith(...s){return this.check(T2(...s))},endsWith(...s){return this.check(A2(...s))},min(...s){return this.check(uo(...s))DELIM" +R"DELIM()},max(...s){return this.check(Vv(...s))},length(...s){return this.check($v(...s))},nonempty(...s){return this.check(uo(1,...s))},lowercase(s){return this.check(x2(s))},uppercase(s){return this.check(z2(s))},trim(){return this.check(O2())},normalize(...s){return this.check(w2(...s))},toLowerCase(){return this.check(M2())},toUpperCase(){return this.check(N2())},slugify(){return this.check(D2())}})}),Ex=X("ZodString",(n,a)=>{hd.init(n,a),Wv.init(n,a),n.email=u=>n.check(V_(Ax,u)),n.url=u=>n.check(F_(wx,u)),n.jwt=u=>n.check(f2(Qx,u)),n.emoji=u=>n.check(W_(Ox,u)),n.guid=u=>n.check(ig(og,u)),n.uuid=u=>n.check($_(Wc,u)),n.uuidv4=u=>n.check(K_(Wc,u)),n.uuidv6=u=>n.check(X_(Wc,u)),n.uuidv7=u=>n.check(J_(Wc,u)),n.nanoid=u=>n.check(I_(Mx,u)),n.guid=u=>n.check(ig(og,u)),n.cuid=u=>n.check(P_(Nx,u)),n.cuid2=u=>n.check(e2(Dx,u)),n.ulid=u=>n.check(t2(jx,u)),n.base64=u=>n.check(r2(Lx,u)),n.base64url=u=>n.check(c2(Bx,u)),n.xid=u=>n.check(n2(Cx,u)),n.ksuid=u=>n.check(l2(Rx,u)),n.ipv4=u=>n.check(a2(Ux,u)),n.ipv6=u=>n.check(i2(Zx,u)),n.cidrv4=u=>n.check(u2(kx,u)),n.cidrv6=u=>n.check(s2(Hx,u)),n.e164=u=>n.check(o2(qx,u)),n.datetime=u=>n.check(ax(u)),n.date=u=>n.check(ux(u)),n.time=u=>n.check(rx(u)),n.duration=u=>n.check(ox(u))});function Tx(n){return Y_(Ex,n)}const Mt=X("ZodStringFormat",(n,a)=>{At.init(n,a),Wv.init(n,a)}),Ax=X("ZodEmail",(n,a)=>{PS.init(n,a),Mt.init(n,a)}),og=X("ZodGUID",(n,a)=>{WS.init(n,a),Mt.init(n,a)}),Wc=X("ZodUUID",(n,a)=>{IS.init(n,a),Mt.init(n,a)}),wx=X("ZodURL",(n,a)=>{e_.init(n,a),Mt.init(n,a)}),Ox=X("ZodEmoji",(n,a)=>{t_.init(n,a),Mt.init(n,a)}),Mx=X("ZodNanoID",(n,a)=>{n_.init(n,a),Mt.init(n,a)}),Nx=X("ZodCUID",(n,a)=>{l_.init(n,a),Mt.init(n,a)}),Dx=X("ZodCUID2",(n,a)=>{a_.init(n,a),Mt.init(n,a)}),jx=X("ZodULID",(n,a)=>{i_.init(n,a),Mt.init(n,a)}),Cx=X("ZodXID",(n,a)=>{u_.init(n,a),Mt.init(n,a)}),Rx=X("ZodKSUID",(n,a)=>{s_.init(n,a),Mt.init(n,a)}),Ux=X("ZodIPv4",(n,a)=>{h_.init(n,a),Mt.init(n,a)}),Zx=X("ZodIPv6",(n,a)=>{d_.init(n,a),Mt.init(n,a)}),kx=X("ZodCIDRv4",(n,a)=>{m_.init(n,a),Mt.init(n,a)}),Hx=X("ZodCIDRv6",(n,a)=>{p_.init(n,a),Mt.init(n,a)}),Lx=X("ZodBase64",(n,a)=>{g_.init(n,a),Mt.init(n,a)}),Bx=X("ZodBase64URL",(n,a)=>{y_.init(n,a),Mt.init(n,a)}),qx=X("ZodE164",(n,a)=>{b_.init(n,a),Mt.init(n,a)}),Qx=X("ZodJWT",(n,a)=>{__.init(n,a),Mt.init(n,a)}),Iv=X("ZodNumber",(n,a)=>{qv.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(s,c,h)=>L2(n,s,c),wr(n,"ZodNumber",{gt(s,c){return this.check(sg(s,c))},gte(s,c){return this.check(Mh(s,c))},min(s,c){return this.check(Mh(s,c))},lt(s,c){return this.check(ug(s,c))},lte(s,c){return this.check(Oh(s,c))},max(s,c){return this.check(Oh(s,c))},int(s){return this.check(fg(s))},safe(s){return this.check(fg(s))},positive(s){return this.check(sg(0,s))},nonnegative(s){return this.check(Mh(0,s))},negative(s){return this.check(ug(0,s))},nonpositive(s){return this.check(Oh(0,s))},multipleOf(s,c){return this.check(rg(s,c))},step(s,c){return this.check(rg(s,c))},finite(){return this}});const u=n._zod.bag;n.minValue=Math.max(u.minimum??Number.NEGATIVE_INFINITY,u.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(u.maximum??Number.POSITIVE_INFINITY,u.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(u.format??"").includes("int")||Number.isSafeInteger(u.multipleOf??.5),n.isFinite=!0,n.format=u.format??null});function bi(n){return g2(Iv,n)}const Gx=X("ZodNumberFormat",(n,a)=>{x_.init(n,a),Iv.init(n,a)});function fg(n){return v2(Gx,n)}const Yx=X("ZodBoolean",(n,a)=>{z_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>B2(n,u,s)});function Ku(n){return y2(Yx,n)}const Vx=X("ZodUnknown",(n,a)=>{E_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>Q2()});function hg(){return b2(Vx)}const $x=X("ZodNever",(n,a)=>{T_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>q2(n,u,s)});function Kx(n){return S2($x,n)}const Xx=X("ZodArray",(n,a)=>{A_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>$2(n,u,s,c),n.element=a.element,wr(n,"ZodArray",{min(u,s){return this.check(uo(u,s))},nonempty(u){return this.check(uo(1,u))},max(u,s){return this.check(Vv(u,s))},length(u,s){return this.check($v(u,s))},unwrap(){return this.element}})});function Jx(n,a){return j2(Xx,n,a)}const Fx=X("ZodObject",(n,a)=>{O_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>K2(n,u,s,c),dt(n,"shape",()=>a.shape),wr(n,"ZodObject",{keyof(){return ez(Object.keys(this._zod.def.shape))},catchall(u){return this.clone({...this._zod.def,catchall:u})},passthrough(){return this.clone({...this._zod.def,catchall:hg()})},loose(){return this.clone({...this._zod.def,catchall:hg()})},strict(){return this.clone({...this._zod.def,catchall:Kx()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(u){return $1(this,u)},safeExtend(u){return K1(this,u)},merge(u){return X1(this,u)},pick(u){return Y1(this,u)},omit(u){return V1(this,u)},partial(...u){return J1(ey,this,u[0])},required(...u){return F1(ty,this,u[0])}})});function vo(n,a){const u={type:"object",shape:n??{},...Ae(a)};return new Fx(u)}const Wx=X("ZodUnion",(n,a)=>{M_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>X2(n,u,s,c),n.options=a.options});function Pv(n,a){return new Wx({type:"union",options:n,...Ae(a)})}const Ix=X("ZodIntersection",(n,a)=>{N_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>J2(n,u,s,c)});function Px(n,a){return new Ix({type:"intersection",left:n,right:a})}const Lh=X("ZodEnum",(n,a)=>{D_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(s,c,h)=>G2(n,s,c),n.enum=a.entries,n.options=Object.values(a.entries);const u=new Set(Object.keys(a.entries));n.extract=(s,c)=>{const h={};for(const f of s)if(u.has(f))h[f]=a.entries[f];else throw new Error(`Key ${f} not found in enum`);return new Lh({...a,checks:[],...Ae(c),entries:h})},n.exclude=(s,c)=>{const h={...a.entries};for(const f of s)if(u.has(f))delete h[f];else throw new Error(`Key ${f} not found in enum`);return new Lh({...a,checks:[],...Ae(c),entries:h})}});function ez(n,a){const u=Array.isArray(n)?Object.fromEntries(n.map(s=>[s,s])):n;return new Lh({type:"enum",entries:u,...Ae(a)})}const tz=X("ZodTransform",(n,a)=>{j_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>V2(n,u),n._zod.parse=(u,s)=>{if(s.direction==="backward")throw new Av(n.constructor.name);u.addIssue=h=>{if(typeof h=="string")u.issues.push(zr(h,u.value,a));else{const f=h;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=u.value),f.inst??(f.inst=n),u.issues.push(zr(f))}};const c=a.transform(u.value,u);return c instanceof Promise?c.then(h=>(u.value=h,u.fallback=!0,u)):(u.value=c,u.fallback=!0,u)}});function nz(n){return new tz({type:"transform",transform:n})}const ey=X("ZodOptional",(n,a)=>{Yv.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>Fv(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function dg(n){return new ey({type:"optional",innerType:n})}const lz=X("ZodExactOptional",(n,a)=>{C_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>Fv(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function az(n){return new lz({type:"optional",innerType:n})}const iz=X("ZodNullable",(n,a)=>{R_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>F2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function mg(n){return new iz({type:"nullable",innerType:n})}const uz=X("ZodDefault",(n,a)=>{U_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>I2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function sz(n,a){return new uz({type:"default",innerType:n,get defaultValue(){return typeof a=="function"?a():Mv(a)}})}const rz=X("ZodPrefault",(n,a)=>{Z_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>P2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function cz(n,a){return new rz({type:"prefault",innerType:n,get defaultValue(){return typeof a=="function"?a():Mv(a)}})}const ty=X("ZodNonOptional",(n,a)=>{k_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>W2(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function oz(n,a){return new ty({ty)DELIM" +R"DELIM(pe:"nonoptional",innerType:n,...Ae(a)})}const fz=X("ZodCatch",(n,a)=>{H_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>ex(n,u,s,c),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function hz(n,a){return new fz({type:"catch",innerType:n,catchValue:typeof a=="function"?a:()=>a})}const dz=X("ZodPipe",(n,a)=>{L_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>tx(n,u,s,c),n.in=a.in,n.out=a.out});function pg(n,a){return new dz({type:"pipe",in:n,out:a})}const mz=X("ZodReadonly",(n,a)=>{B_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>nx(n,u,s,c),n.unwrap=()=>n._zod.def.innerType});function pz(n){return new mz({type:"readonly",innerType:n})}const gz=X("ZodCustom",(n,a)=>{q_.init(n,a),Qt.init(n,a),n._zod.processJSONSchema=(u,s,c)=>Y2(n,u)});function vz(n,a={}){return C2(gz,n,a)}function yz(n,a){return R2(n,a)}const dd=[{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"}],ns=[{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"}],bz=vo({level:bi().int().nonnegative(),time:bi().int().nonnegative(),message:Tx()}),Sz=vo({event:bi().int().nonnegative(),value:bi().nonnegative(),time:bi().int().nonnegative()}),_z=vo({previous:bi().nonnegative()}),xz=Pv([bz,Sz,_z]),zz=2**dd.length-1,Ez=2**ns.length-1;function Tz(n){return"level"in n}function Az(n){return"event"in n}function wz(n){return"previous"in n}function Oz(n){try{const a=JSON.parse(n),u=xz.safeParse(a);return u.success?u.data:null}catch{return null}}function Pu(n){return ns[n]??{id:n,name:`event_${String(n)}`,label:`Event ${String(n)}`,category:"chain",valueKind:"unknown"}}function gg(n){return dd[n]??{id:n,name:`level_${String(n)}`,label:`Level ${String(n)}`}}function Mz(n,a){const u=Pu(n);if(u.category!=="timing")return null;switch(u.valueKind){case"seconds":return a*1e3;case"milliseconds":return a;case"microseconds":return a/1e3;default:return null}}const Nz=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function es(n,a=2){return new Intl.NumberFormat(void 0,{maximumFractionDigits:a}).format(n)}function la(n){return Nz.format(n)}function br(n,a=!0){const u=new Date(n);if(!Number.isFinite(u.getTime()))return"Invalid time";const s=u.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return a?`${s}.${String(u.getMilliseconds()).padStart(3,"0")}`:s}function Dz(n){const a=Math.max(0,Math.floor(n/1e3)),u=Math.floor(a/86400),s=Math.floor(a%86400/3600),c=Math.floor(a%3600/60),h=a%60;return u>0?`${String(u)}d ${String(s)}h`:s>0?`${String(s)}h ${String(c)}m`:c>0?`${String(c)}m ${String(h)}s`:`${String(h)}s`}function jz(n,a){switch(Pu(n).valueKind){case"height":return`height ${la(a)}`;case"seconds":return`${es(a)} s`;case"milliseconds":return`${es(a)} ms`;case"microseconds":return`${es(a)} µs`;case"count":return la(a);default:return String(a)}}function Cz(n){return n>=100?`${es(n,0)}/s`:n>=10?`${es(n,1)}/s`:`${es(n,2)}/s`}function Rz(n){try{const a=new URL(n),u=a.pathname==="/"?"":a.pathname.replace(/\/$/u,"");return`${a.host}${u}`}catch{return n}}const Uz=[{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"}],Zz={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 kz({events:n,onClear:a}){const[u,s]=De.useState(""),[c,h]=De.useState("all"),[f,p]=De.useState(!1),[v,g]=De.useState([]),z=f?v:n,S=De.useMemo(()=>{const N=u.trim().toLowerCase();return z.filter(C=>{const J=Pu(C.event);return c==="all"||J.category===c}).filter(C=>{if(!N)return!0;const J=Pu(C.event);return J.name.includes(N)||J.label.toLowerCase().includes(N)||String(C.value).includes(N)}).slice(0,250)},[c,u,z]);function E(){f||g(n),p(N=>!N)}return M.jsxs("section",{className:"space-y-4",children:[M.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Node lifecycle"}),M.jsx("h2",{className:"mt-1 text-2xl font-semibold",children:"Live events"}),M.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"Heights are event payloads; timing values retain their source units."})]}),M.jsxs("div",{className:"flex gap-2",children:[M.jsx("button",{type:"button",onClick:E,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"}),M.jsx("button",{type:"button",onClick:a,className:"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:"Clear"})]})]}),M.jsxs("div",{className:"border-accent/20 bg-surface/70 flex flex-wrap gap-3 rounded-xl border p-4",children:[M.jsxs)DELIM" +R"DELIM(("label",{className:"min-w-56 flex-1",children:[M.jsx("span",{className:"sr-only",children:"Search events"}),M.jsx("input",{type:"search",value:u,onChange:N=>{s(N.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"})]}),M.jsxs("label",{children:[M.jsx("span",{className:"sr-only",children:"Filter event category"}),M.jsx("select",{value:c,onChange:N=>{h(N.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:Uz.map(N=>M.jsx("option",{value:N.value,children:N.label},N.value))})]})]}),M.jsxs("div",{className:"border-accent/20 bg-surface/70 overflow-hidden rounded-xl border",children:[M.jsxs("div",{className:"border-accent/15 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[M.jsx("span",{children:f?"Paused snapshot":"Live stream"}),M.jsxs("span",{children:["Showing ",String(S.length)," of ",String(z.length)]})]}),M.jsx("div",{className:"max-h-[65vh] overflow-auto",children:S.length===0?M.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching events."}):M.jsx("ol",{className:"divide-y divide-white/5",children:S.map(N=>{const C=Pu(N.event);return M.jsxs("li",{className:"grid items-start gap-2 px-4 py-3 text-xs sm:grid-cols-[8.5rem_10rem_minmax(0,1fr)]",children:[M.jsx("time",{dateTime:new Date(N.time).toISOString(),className:"text-textMuted font-mono tabular-nums",children:br(N.time)}),M.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${Zz[C.category]}`,children:C.name}),M.jsx("span",{className:"text-textPrimary font-mono tabular-nums",children:jz(N.event,N.value)})]},N.id)})})})]}),M.jsxs("details",{className:"border-accent/20 bg-surface/50 rounded-xl border",children:[M.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-4 py-3 text-sm",children:["Event contract (",String(ns.length)," identifiers)"]}),M.jsx("div",{className:"grid gap-2 border-t border-white/5 p-4 sm:grid-cols-2 lg:grid-cols-3",children:ns.map(N=>M.jsxs("div",{className:"text-xs",children:[M.jsx("span",{className:"text-textMuted font-mono",children:String(N.id).padStart(2,"0")}),M.jsx("span",{className:"text-textPrimary ml-2",children:N.name})]},N.id))})]})]})}const vg={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 Hz({logs:n,onClear:a}){const[u,s]=De.useState(""),[c,h]=De.useState("all"),[f,p]=De.useState(!1),[v,g]=De.useState([]),z=f?v:n,S=De.useMemo(()=>{const N=u.trim().toLowerCase();return z.filter(C=>c==="all"||C.level===Number(c)).filter(C=>!N||C.message.toLowerCase().includes(N)||gg(C.level).name.includes(N)).slice(0,250)},[c,u,z]);function E(){f||g(n),p(N=>!N)}return M.jsxs("section",{className:"space-y-4",children:[M.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Diagnostic stream"}),M.jsx("h2",{className:"mt-1 text-2xl font-semibold",children:"Node logs"}),M.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"The newest 1,000 messages are retained in this browser session."})]}),M.jsxs("div",{className:"flex gap-2",children:[M.jsx("button",{type:"button",onClick:E,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"}),M.jsx("button",{type:"button",onClick:a,className:"border-textMuted/25 text-textMuted hover:border-accentSecondary hover:text-accentSecondary rounded-lg border px-3 py-2 text-xs font-medium tracking-wide uppercase",children:"Clear"})]})]}),M.jsxs("div",{className:"border-accent/20 bg-surface/70 flex flex-wrap gap-3 rounded-xl border p-4",children:[M.jsxs("label",{className:"min-w-56 flex-1",children:[M.jsx("span",{className:"sr-only",children:"Search logs"}),M.jsx("input",{type:"search",value:u,onChange:N=>{s(N.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"})]}),M.jsxs("label",{children:[M.jsx("span",{className:"sr-only",children:"Filter log level"}),M.jsxs("select",{value:c,onChange:N=>{h(N.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:[M.jsx("option",{value:"all",children:"All levels"}),dd.map(N=>M.jsx("option",{value:N.id,children:N.label},N.id))]})]})]}),M.jsxs("div",{className:"border-accent/20 bg-surface/70 overflow-hidden rounded-xl border",children:[M.jsxs("div",{className:"border-accent/15 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[M.jsx("span",{children:f?"Paused snapshot":"Live stream"}),M.jsxs("span",{children:["Showing ",String(S.length)," of ",String(z.length)]})]}),M.jsx("div",{className:"max-h-[65vh] overflow-auto",children:S.length===0?M.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching log messages."}):M.jsx("ol",{className:"divide-y divide-white/5",children:S.map(N=>{const C=gg(N.level);return M.jsxs("li",{className:"grid gap-2 px-4 py-3 text-xs sm:grid-cols-[7.5rem_7.5rem_minmax(0,1fr)]",children:[M.jsx("time",{dateTime:new Date(N.time).toISOString(),className:"text-textMuted font-mono tabular-nums",children:br(N.time,!1)}),M.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${vg[N.level]??vg[8]}`,children:C.name}),M.jsx("span",{className:"text-textPrimary min-w-0 font-mono leading-5 break-words whitespace-pre-wrap",children:N.message})]},N.id)})})})]})]})}const Lz=3600*1e3,Bz=250,qz=1e3,Qz=1e3;function yg(){return Array.from({length:ns.length},()=>0)}class bg{constructor(a){this.capacity=a,this.#e=Array.from({length:a})}capacity;#e;#t=0;#n=0;push(a){this.#e[this.#t]=a,this.#t=(this.#t+1)%this.capacity,this.#n=Math.min(this.#n+1,this.capacity)}clear(){this.#t=0,this.#n=0}newestFirst(){const a=[];for(let u=0;uthis.#_;subscribe=a=>(this.#t.add(a),()=>{this.#t.delete(a)});start(){this.#y||(this.tick(),this.#y=setInterval(()=>{this.tick()},1e3))}stop(){this.#y&&(clearInterval(this.#y),this.#y=null),this.#m&&(clearTimeout(this.#m),this.#m=null)}ingest(a){this.#p+=1,Tz(a)?this.#x(a):Az(a)?this.#T(a):wz(a)&&(this.#g+=1),this.#E()}recordInvalidFrame(){this.#o+=1,this.#E()}recordNativeTop(a,u=this.#e()){const s=this.#a.at(-1);s?.height===a&&u-s.time<15e3||(this.#a.push({height:a,time:u}),this.#A(u),this.#E())}clearLogs(){this.#n.clear(),this.flush()}clearEvents(){this.#l.clear(),this.flush()}reset(){this.#n.clear(),this.#l.clear(),this.#i.clear(),this.#a=[],this.#s=yg(),this.#u={},this.#r={},this.#c={},this.#f=this.#e(),this.#p=0,this.#d=0,this.#h=0,this.#g=0,this.#o=0,this.#b=null,this.#S=null,this.#v=0,this.#z(this.#f),this.flush()}tick(){const a=this.#e();this.#z(a),this.#A(a),this.#E()}flush(){this.#m&&(clearTimeout(this.#m),this.#m=null),this.#_=this.#w();for(const a of this.#t)a()}#x(a){this.#d+=1,this.#b=a.time,this.#v+=1,this.#n.push({...a,id:this.#v})}#T(a){this.#h+=1,this.#S=a.time)DELIM" +R"DELIM(,this.#v+=1,this.#l.push({...a,id:this.#v}),this.#s[a.event]=(this.#s[a.event]??0)+1,ns.at(a.event)?.valueKind==="height"&&(this.#u[a.event]=a.value,this.#r[a.event]=Math.max(this.#r[a.event]??0,a.value));const s=this.#z(a.time);switch(a.event){case 0:{s.rates.headerArchived+=1;break}case 1:{s.rates.headerOrganized+=1;break}case 2:{s.rates.headerReorganized+=1;break}case 3:{s.rates.blockArchived+=1;break}case 5:{s.rates.blockValidated+=1;break}case 6:{s.rates.blockConfirmed+=1;break}case 13:{s.rates.blockOrganized+=1;break}case 14:{s.rates.blockReorganized+=1;break}}const c=Mz(a.event,a.value);if(c!==null){const h=s.timings.get(a.event)??{sum:0,count:0};h.sum+=c,h.count+=1,s.timings.set(a.event,h),this.#c[a.event]={event:a.event,milliseconds:c,time:a.time,rawValue:a.value}}}#z(a){const u=Math.floor(a/1e3)*1e3,s=this.#i.get(u);if(s)return s;const c={time:u,rates:{headerArchived:0,headerOrganized:0,headerReorganized:0,blockArchived:0,blockValidated:0,blockConfirmed:0,blockOrganized:0,blockReorganized:0},timings:new Map};return this.#i.set(u,c),c}#A(a){const u=a-Lz;for(const c of this.#i.keys())cc.time>=u);s>1?this.#a.splice(0,s-1):s===-1&&this.#a.length>1&&this.#a.splice(0,this.#a.length-1)}#E(){this.#m||(this.#m=setTimeout(()=>{this.#m=null,this.flush()},Bz))}#w(){const a=[...this.#i.values()].sort((u,s)=>u.time-s.time);return{now:this.#e(),sessionStartedAt:this.#f,totalFrames:this.#p,totalLogs:this.#d,totalEvents:this.#h,totalAcks:this.#g,invalidFrames:this.#o,eventTotals:[...this.#s],latestHeightByEvent:{...this.#u},maximumHeightByEvent:{...this.#r},latestTimingByEvent:{...this.#c},rateSeries:a.map(u=>({time:u.time,...u.rates})),timingSeries:a.map(u=>({time:u.time,block:hr(u.timings.get(19)),ancestry:hr(u.timings.get(20)),filter:hr(u.timings.get(21)),filterHashes:hr(u.timings.get(22)),filterChecks:hr(u.timings.get(23))})),topSeries:[...this.#a],recentLogs:this.#n.newestFirst(),recentEvents:this.#l.newestFirst(),lastLogAt:this.#b,lastEventAt:this.#S}}}function hr(n){return n?n.sum/n.count:null}function Yz(n,a,u,s){const c=u-s*1e3,h=n.filter(g=>g.time>=c&&g.time<=u);if(h.length===0)return 0;const f=h.reduce((g,z)=>g+z[a],0),p=h[0]?.time??u,v=Math.floor((u-Math.max(c,p))/1e3)+1;return f/Math.max(1,Math.min(s,v))}function Vz(n,a,u){const s=p=>Yz(n,p,a,u),c=s("headerReorganized")+s("blockReorganized");if(c>0)return{label:"Reorganizing",rate:c};const f=[{label:"Confirming blocks",rate:s("blockConfirmed")},{label:"Validating blocks",rate:s("blockValidated")},{label:"Archiving blocks",rate:s("blockArchived")},{label:"Synchronizing headers",rate:Math.max(s("headerArchived"),s("headerOrganized"))}].reduce((p,v)=>v.rate>p.rate?v:p);return f.rate>0?f:{label:"Idle",rate:0}}const $z={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 Kz({phase:n,label:a}){return M.jsxs("span",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-xs tracking-wide uppercase ${$z[n]}`,children:[M.jsx("span",{className:"h-2 w-2 rounded-full bg-current","aria-hidden":"true"}),a]})}const Xz={orange:"from-accent/25",red:"from-accentSecondary/25",green:"from-emerald-500/20",blue:"from-sky-500/20"};function Ic({label:n,value:a,detail:u,accent:s="orange"}){return M.jsxs("article",{className:`border-accent/20 bg-surface/80 rounded-xl border bg-gradient-to-br ${Xz[s]} to-transparent p-5`,children:[M.jsx("p",{className:"text-textMuted text-xs font-medium tracking-[0.14em] uppercase",children:n}),M.jsx("p",{className:"text-textPrimary mt-3 text-3xl font-semibold tracking-tight tabular-nums",children:a}),M.jsx("div",{className:"text-textMuted mt-2 min-h-5 text-xs",children:u})]})}const Jz=!0,tn="u-",Fz="uplot",Wz=tn+"hz",Iz=tn+"vt",Pz=tn+"title",eE=tn+"wrap",tE=tn+"under",nE=tn+"over",lE=tn+"axis",Pi=tn+"off",aE=tn+"select",iE=tn+"cursor-x",uE=tn+"cursor-y",sE=tn+"cursor-pt",rE=tn+"legend",cE=tn+"live",oE=tn+"inline",fE=tn+"series",hE=tn+"marker",Sg=tn+"label",dE=tn+"value",gr="width",vr="height",dr="top",_g="bottom",Xu="left",Nh="right",md="#000",xg=md+"0",Dh="mousemove",zg="mousedown",jh="mouseup",Eg="mouseenter",Tg="mouseleave",Ag="dblclick",mE="resize",pE="scroll",wg="change",ro="dppxchange",pd="--",cs=typeof window<"u",Bh=cs?document:null,ts=cs?window:null,gE=cs?navigator:null;let Ie,Pc;function qh(){let n=devicePixelRatio;Ie!=n&&(Ie=n,Pc&&Gh(wg,Pc,qh),Pc=matchMedia(`(min-resolution: ${Ie-.001}dppx) and (max-resolution: ${Ie+.001}dppx)`),tu(wg,Pc,qh),ts.dispatchEvent(new CustomEvent(ro)))}function cl(n,a){if(a!=null){let u=n.classList;!u.contains(a)&&u.add(a)}}function Qh(n,a){let u=n.classList;u.contains(a)&&u.remove(a)}function zt(n,a,u){n.style[a]=u+"px"}function Hl(n,a,u,s){let c=Bh.createElement(n);return a!=null&&cl(c,a),u?.insertBefore(c,s),c}function El(n,a){return Hl("div",n,a)}const Og=new WeakMap;function na(n,a,u,s,c){let h="translate("+a+"px,"+u+"px)",f=Og.get(n);h!=f&&(n.style.transform=h,Og.set(n,h),a<0||u<0||a>s||u>c?cl(n,Pi):Qh(n,Pi))}const Mg=new WeakMap;function Ng(n,a,u){let s=a+u,c=Mg.get(n);s!=c&&(Mg.set(n,s),n.style.background=a,n.style.borderColor=u)}const Dg=new WeakMap;function jg(n,a,u,s){let c=a+""+u,h=Dg.get(n);c!=h&&(Dg.set(n,c),n.style.height=u+"px",n.style.width=a+"px",n.style.marginLeft=s?-a/2+"px":0,n.style.marginTop=s?-u/2+"px":0)}const gd={passive:!0},vE={...gd,capture:!0};function tu(n,a,u,s){a.addEventListener(n,u,s?vE:gd)}function Gh(n,a,u,s){a.removeEventListener(n,u,gd)}cs&&qh();function Ll(n,a,u,s){let c;u=u||0,s=s||a.length-1;let h=s<=2147483647;for(;s-u>1;)c=h?u+s>>1:fl((u+s)/2),a[c]{let h=-1,f=-1;for(let p=s;p<=c;p++)if(n(u[p])){h=p;break}for(let p=c;p>=s;p--)if(n(u[p])){f=p;break}return[h,f]}}const ly=n=>n!=null,ay=n=>n!=null&&n>0,yo=ny(ly),yE=ny(ay);function bE(n,a,u,s=0,c=!1){let h=c?yE:yo,f=c?ay:ly;[a,u]=h(n,a,u);let p=n[a],v=n[a];if(a>-1)if(s==1)p=n[a],v=n[u];else if(s==-1)p=n[u],v=n[a];else for(let g=a;g<=u;g++){let z=n[g];f(z)&&(zv&&(v=z))}return[p??gt,v??-gt]}function bo(n,a,u,s){let c=Ug(n),h=Ug(a);n==a&&(c==-1?(n*=u,a/=u):(n/=u,a*=u));let f=u==10?Ra:iy,p=c==1?fl:Tl,v=h==1?Tl:fl,g=p(f(en(n))),z=v(f(en(a))),S=ls(u,g),E=ls(u,z);return u==10&&(g<0&&(S=vt(S,-g)),z<0&&(E=vt(E,-z))),s||u==2?(n=S*c,a=E*h):(n=cy(n,S),a=So(a,E)),[n,a]}function vd(n,a,u,s){let c=bo(n,a,u,s);return n==0&&(c[0]=0),a==0&&(c[1]=0),c}const yd=.1,Cg={mode:3,pad:yd},Sr={pad:0,soft:null,mode:0},SE={min:Sr,max:Sr};function co(n,a,u,s){return _o(u)?Rg(n,a,u):(Sr.pad=u,Sr.soft=s?0:null,Sr.mode=s?3:0,Rg(n,a,SE))}function Je(n,a){return n??a}function _E(n,a,u){for(a=Je(a,0),u=Je(u,n.length-1);a<=u;){if(n[a]!=null)return!0;a++}return!1}function Rg(n,a,u){let s=u.min,c=u.max,h=Je(s.pad,0),f=Je(c.pad,0),p=Je(s.hard,-gt),v=Je(c.hard,gt),g=Je(s.soft,gt),z=Je(c.soft,-gt),S=Je(s.mode,0),E=Je(c.mode,0),N=a-n,C=Ra(N),J=Ln(en(n),en(a)),F=Ra(J),P=en(F-C);(N<1e-24||P>10)&&(N=0,(n==0||a==0)&&(N=1e-24,S==2&&g!=gt&&(h=0),E==2&&z!=-gt&&(f=0)));let Y=N||J||1e3,I=Ra(Y),G=ls(10,fl(I)),ie=Y*(N==0?n==0?.1:1:h),ne=vt(cy(n-ie,G/10),24),le=n>=g&&(S==1||S==3&&ne<=g||S==2&&ne>=g)?g:gt,se=Ln(p,ne=le?le:Bl(le,ne)),we=Y*(N==0?a==0?.1:1:f),xe=vt(So(a+we,G/10),24),ee=a<=z&&(E==1||E==3&&xe>=z||E==2&&xe<=z)?z:-gt,ye=Bl(v,xe>ee&&a<=ee?ee:Ln(ee,xe));return se==ye&&se==0&&(ye=100),[se,ye]}const xE=new Intl.NumberFormat(cs?gE.language:"en-US"),bd=n=>xE.format(n),hl=Math,lo=hl.PI,en=hl.abs,fl=hl.floor,Pt=hl.round,Tl=hl.ceil,Bl=hl.min,Ln=hl.max,ls=hl.pow,Ug=hl.sign,Ra=hl.log10,iy=hl.log2,zE=(n,a=1)=>hl.sinh(n)*a,Ch=(n,a=1)=>hl.asinh(n/a),gt=1/0;function Zg(n){return(Ra((n^n>>31)-(n>>31))|0)+1}function Yh(n,a,u){return Bl(Ln(n,a),u)}function uy(n){return typeof n=="function"}function Qe(n){return uy(n)?n:()=>n}const EE=()=>{},sy=n=>n,ry=(n,a)=)DELIM" +R"DELIM(>a,TE=n=>null,kg=n=>!0,Hg=(n,a)=>n==a,AE=/\.\d*?(?=9{6,}|0{6,})/gm,au=n=>{if(fy(n)||_i.has(n))return n;const a=`${n}`,u=a.match(AE);if(u==null)return n;let s=u[0].length-1;if(a.indexOf("e-")!=-1){let[c,h]=a.split("e");return+`${au(c)}e${h}`}return vt(n,s)};function Wi(n,a){return au(vt(au(n/a))*a)}function So(n,a){return au(Tl(au(n/a))*a)}function cy(n,a){return au(fl(au(n/a))*a)}function vt(n,a=0){if(fy(n))return n;let u=10**a,s=n*u*(1+Number.EPSILON);return Pt(s)/u}const _i=new Map;function oy(n){return((""+n).split(".")[1]||"").length}function Er(n,a,u,s){let c=[],h=s.map(oy);for(let f=a;f=0?0:p)+(f>=h[g]?0:h[g]),E=n==10?z:vt(z,S);c.push(E),_i.set(E,S)}}return c}const _r={},Sd=[],as=[null,null],yi=Array.isArray,fy=Number.isInteger,wE=n=>n===void 0;function Lg(n){return typeof n=="string"}function _o(n){let a=!1;if(n!=null){let u=n.constructor;a=u==null||u==Object}return a}function OE(n){return n!=null&&typeof n=="object"}const ME=Object.getPrototypeOf(Uint8Array),hy="__proto__";function is(n,a=_o){let u;if(yi(n)){let s=n.find(c=>c!=null);if(yi(s)||a(s)){u=Array(n.length);for(let c=0;ch){for(c=f-1;c>=0&&n[c]==null;)n[c--]=null;for(c=f+1;cf-p)],c=s[0].length,h=new Map;for(let f=0;f"u"?n=>Promise.resolve().then(n):queueMicrotask;function ZE(n){let a=n[0],u=a.length,s=Array(u);for(let h=0;ha[h]-a[f]);let c=[];for(let h=0;h=s&&n[c]==null;)c--;if(c<=s)return!0;const h=Ln(1,fl((c-s+1)/a));for(let f=n[s],p=s+h;p<=c;p+=h){const v=n[p];if(v!=null){if(v<=f)return!1;f=v}}return!0}const dy=["January","February","March","April","May","June","July","August","September","October","November","December"],my=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function py(n){return n.slice(0,3)}const LE=my.map(py),BE=dy.map(py),qE={MMMM:dy,MMM:BE,WWWW:my,WWW:LE};function mr(n){return(n<10?"0":"")+n}function QE(n){return(n<10?"00":n<100?"0":"")+n}const GE={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,a)=>a.MMMM[n.getMonth()],MMM:(n,a)=>a.MMM[n.getMonth()],MM:n=>mr(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>mr(n.getDate()),D:n=>n.getDate(),WWWW:(n,a)=>a.WWWW[n.getDay()],WWW:(n,a)=>a.WWW[n.getDay()],HH:n=>mr(n.getHours()),H:n=>n.getHours(),h:n=>{let a=n.getHours();return a==0?12:a>12?a-12:a},AA:n=>n.getHours()>=12?"PM":"AM",aa:n=>n.getHours()>=12?"pm":"am",a:n=>n.getHours()>=12?"p":"a",mm:n=>mr(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>mr(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>QE(n.getMilliseconds())};function _d(n,a){a=a||qE;let u=[],s=/\{([a-z]+)\}|[^{]+/gi,c;for(;c=s.exec(n);)u.push(c[0][0]=="{"?GE[c[1]]:c[0]);return h=>{let f="";for(let p=0;pn%1==0,oo=[1,2,2.5,5],$E=Er(10,-32,0,oo),vy=Er(10,0,32,oo),KE=vy.filter(gy),Ii=$E.concat(vy),xd=` +`,yy="{YYYY}",Bg=xd+yy,by="{M}/{D}",yr=xd+by,eo=yr+"/{YY}",Sy="{aa}",XE="{h}:{mm}",Fu=XE+Sy,qg=xd+Fu,Qg=":{ss}",tt=null;function _y(n){let a=n*1e3,u=a*60,s=u*60,c=s*24,h=c*30,f=c*365,v=(n==1?Er(10,0,3,oo).filter(gy):Er(10,-3,0,oo)).concat([a,a*5,a*10,a*15,a*30,u,u*5,u*10,u*15,u*30,s,s*2,s*3,s*4,s*6,s*8,s*12,c,c*2,c*3,c*4,c*5,c*6,c*7,c*8,c*9,c*10,c*15,h,h*2,h*3,h*4,h*6,f,f*2,f*5,f*10,f*25,f*50,f*100]);const g=[[f,yy,tt,tt,tt,tt,tt,tt,1],[c*28,"{MMM}",Bg,tt,tt,tt,tt,tt,1],[c,by,Bg,tt,tt,tt,tt,tt,1],[s,"{h}"+Sy,eo,tt,yr,tt,tt,tt,1],[u,Fu,eo,tt,yr,tt,tt,tt,1],[a,Qg,eo+" "+Fu,tt,yr+" "+Fu,tt,qg,tt,1],[n,Qg+".{fff}",eo+" "+Fu,tt,yr+" "+Fu,tt,qg,tt,1]];function z(S){return(E,N,C,J,F,P)=>{let Y=[],I=F>=f,G=F>=h&&F=c?c:F,xe=fl(C)-fl(ne),ee=se+xe+So(ne-se,we);Y.push(ee);let ye=S(ee),ce=ye.getHours()+ye.getMinutes()/u+ye.getSeconds()/s,ze=F/s,he=E.axes[N]._space,U=P/he;for(;ee=vt(ee+F,n==1?0:3),!(ee>J);)if(ze>1){let q=fl(vt(ce+ze,6))%24,be=S(ee).getHours()-q;be>1&&(be=-1),ee-=be*s,ce=(ce+ze)%24;let A=Y[Y.length-1];vt((ee-A)/F,3)*U>=.7&&Y.push(ee)}else Y.push(ee)}return Y}}return[v,g,z]}const[JE,FE,WE]=_y(1),[IE,PE,eT]=_y(.001);Er(2,-53,53,[1]);function Gg(n,a){return n.map(u=>u.map((s,c)=>c==0||c==8||s==null?s:a(c==1||u[8]==0?s:u[1]+s)))}function Yg(n,a){return(u,s,c,h,f)=>{let p=a.find(C=>f>=C[0])||a[a.length-1],v,g,z,S,E,N;return s.map(C=>{let J=n(C),F=J.getFullYear(),P=J.getMonth(),Y=J.getDate(),I=J.getHours(),G=J.getMinutes(),ie=J.getSeconds(),ne=F!=v&&p[2]||P!=g&&p[3]||Y!=z&&p[4]||I!=S&&p[5]||G!=E&&p[6]||ie!=N&&p[7]||p[1];return v=F,g=P,z=Y,S=I,E=G,N=ie,ne(J)})}}function tT(n,a){let u=_d(a);return(s,c,h,f,p)=>c.map(v=>u(n(v)))}function Rh(n,a,u){return new Date(n,a,u)}function Vg(n,a){return a(n)}const nT="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function $g(n,a){return(u,s,c,h)=>h==null?pd:a(n(s))}function lT(n,a){let u=n.series[a];return u.width?u.stroke(n,a):u.points.width?u.points.stroke(n,a):null}function aT(n,a){return n.series[a].fill(n,a)}const iT={show:!0,live:!0,isolate:!1,mount:EE,markers:{show:!0,width:2,stroke:lT,fill:aT,dash:"solid"},idx:null,idxs:null,values:[]};function uT(n,a){let u=n.cursor.points,s=El(),c=u.size(n,a);zt(s,gr,c),zt(s,vr,c);let h=c/-2;zt(s,"marginLeft",h),zt(s,"marginTop",h);let f=u.width(n,a,c);return f&&zt(s,"borderWidth",f),s}function sT(n,a){let u=n.series[a].points;return u._fill||u._stroke}function rT(n,a){let u=n.series[a].points;return u._stroke||u._fill}function cT(n,a){return n.series[a].points.size}const Uh=[0,0];function oT(n,a,u){return Uh[0]=a,Uh[1]=u,Uh}function to(n,a,u,s=!0){return c=>{c.button==0&&(!s||c.target==a)&&u(c)}}function Zh(n,a,u,s=!0){return c=>{(!s||c.target==a)&&u(c)}}const fT={show:!0,x:!0,y:!0,lock:!1,move:oT,points:{one:!1,show:uT,size:cT,width:0,stroke:rT,fill:sT},bind:{mousedown:to,mouseup:to,click:to,dblclick:to,mousemove:Zh,mouseleave:Zh,mouseenter:Zh},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(n,a)=>{a.stopPropagation(),a.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(n,a,u,s,c)=>s-c,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},)DELIM" +R"DELIM(left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},xy={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},zd=Jt({},xy,{filter:ry}),zy=Jt({},zd,{size:10}),Ey=Jt({},xy,{show:!1}),Ed='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"',Ty="bold "+Ed,Ay=1.5,Kg={show:!0,scale:"x",stroke:md,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:Ty,side:2,grid:zd,ticks:zy,border:Ey,font:Ed,lineGap:Ay,rotate:0},hT="Value",dT="Time",Xg={show:!0,scale:"x",auto:!1,sorted:1,min:gt,max:-gt,idxs:[]};function mT(n,a,u,s,c){return a.map(h=>h==null?"":bd(h))}function pT(n,a,u,s,c,h,f){let p=[],v=_i.get(c)||0;u=f?u:vt(So(u,c),v);for(let g=u;g<=s;g=vt(g+c,v))p.push(Object.is(g,-0)?0:g);return p}function Vh(n,a,u,s,c,h,f){const p=[],v=n.scales[n.axes[a].scale].log,g=v==10?Ra:iy,z=fl(g(u));c=ls(v,z),v==10&&(c=Ii[Ll(c,Ii)]);let S=u,E=c*v;v==10&&(E=Ii[Ll(E,Ii)]);do p.push(S),S=S+c,v==10&&!_i.has(S)&&(S=vt(S,_i.get(c))),S>=E&&(c=S,E=c*v,v==10&&(E=Ii[Ll(E,Ii)]));while(S<=s);return p}function gT(n,a,u,s,c,h,f){let v=n.scales[n.axes[a].scale].asinh,g=s>v?Vh(n,a,Ln(v,u),s,c):[v],z=s>=0&&u<=0?[0]:[];return(u<-v?Vh(n,a,Ln(v,-s),-u,c):[v]).reverse().map(E=>-E).concat(z,g)}const wy=/./,vT=/[12357]/,yT=/[125]/,Jg=/1/,$h=(n,a,u,s)=>n.map((c,h)=>a==4&&c==0||h%s==0&&u.test(c.toExponential()[c<0?1:0])?c:null);function bT(n,a,u,s,c){let h=n.axes[u],f=h.scale,p=n.scales[f],v=n.valToPos,g=h._space,z=v(10,f),S=v(9,f)-z>=g?wy:v(7,f)-z>=g?vT:v(5,f)-z>=g?yT:Jg;if(S==Jg){let E=en(v(1,f)-z);if(Ec,Ig={show:!0,auto:!0,sorted:0,gaps:Oy,alpha:1,facets:[Jt({},Wg,{scale:"x"}),Jt({},Wg,{scale:"y"})]},Pg={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:Oy,alpha:1,points:{show:zT,filter:null},values:null,min:gt,max:-gt,idxs:[],path:null,clip:null};function ET(n,a,u,s,c){return u/10}const My={time:Jz,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},TT=Jt({},My,{time:!1,ori:1}),ev={};function Ny(n,a){let u=ev[n];return u||(u={key:n,plots:[],sub(s){u.plots.push(s)},unsub(s){u.plots=u.plots.filter(c=>c!=s)},pub(s,c,h,f,p,v,g){for(let z=0;z{let P=f.pxRound;const Y=g.dir*(g.ori==0?1:-1),I=g.ori==0?os:fs;let G,ie;Y==1?(G=u,ie=s):(G=s,ie=u);let ne=P(S(p[G],g,J,N)),le=P(E(v[G],z,F,C)),se=P(S(p[ie],g,J,N)),we=P(E(h==1?z.max:z.min,z,F,C)),xe=new Path2D(c);return I(xe,se,we),I(xe,ne,we),I(xe,ne,le),xe})}function xo(n,a,u,s,c,h){let f=null;if(n.length>0){f=new Path2D;const p=a==0?To:wd;let v=u;for(let S=0;SE[0]){let N=E[0]-v;N>0&&p(f,v,s,N,s+h),v=E[1]}}let g=u+c-v,z=10;g>0&&p(f,v,s-z/2,g,s+h+z)}return f}function wT(n,a,u){let s=n[n.length-1];s&&s[0]==a?s[1]=u:n.push([a,u])}function Ad(n,a,u,s,c,h,f){let p=[],v=n.length;for(let g=c==1?u:s;g>=u&&g<=s;g+=c)if(a[g]===null){let S=g,E=g;if(c==1)for(;++g<=s&&a[g]===null;)E=g;else for(;--g>=u&&a[g]===null;)E=g;let N=h(n[S]),C=E==S?N:h(n[E]),J=S-c;N=f<=0&&J>=0&&J=0&&P>=0&&P=N&&p.push([N,C])}return p}function tv(n){return n==0?sy:n==1?Pt:a=>Wi(a,n)}function Dy(n){let a=n==0?zo:Eo,u=n==0?(c,h,f,p,v,g)=>{c.arcTo(h,f,p,v,g)}:(c,h,f,p,v,g)=>{c.arcTo(f,h,v,p,g)},s=n==0?(c,h,f,p,v)=>{c.rect(h,f,p,v)}:(c,h,f,p,v)=>{c.rect(f,h,v,p)};return(c,h,f,p,v,g=0,z=0)=>{g==0&&z==0?s(c,h,f,p,v):(g=Bl(g,p/2,v/2),z=Bl(z,p/2,v/2),a(c,h+g,f),u(c,h+p,f,h+p,f+v,g),u(c,h+p,f+v,h,f+v,z),u(c,h,f+v,h,f,z),u(c,h,f,h+p,f,g),c.closePath())}}const zo=(n,a,u)=>{n.moveTo(a,u)},Eo=(n,a,u)=>{n.moveTo(u,a)},os=(n,a,u)=>{n.lineTo(a,u)},fs=(n,a,u)=>{n.lineTo(u,a)},To=Dy(0),wd=Dy(1),jy=(n,a,u,s,c,h)=>{n.arc(a,u,s,c,h)},Cy=(n,a,u,s,c,h)=>{n.arc(u,a,s,c,h)},Ry=(n,a,u,s,c,h,f)=>{n.bezierCurveTo(a,u,s,c,h,f)},Uy=(n,a,u,s,c,h,f)=>{n.bezierCurveTo(u,a,c,s,f,h)};function Zy(n){return(a,u,s,c,h)=>uu(a,u,(f,p,v,g,z,S,E,N,C,J,F)=>{let{pxRound:P,points:Y}=f,I,G;g.ori==0?(I=zo,G=jy):(I=Eo,G=Cy);const ie=vt(Y.width*Ie,3);let ne=(Y.size-Y.width)/2*Ie,le=vt(ne*2,3),se=new Path2D,we=new Path2D,{left:xe,top:ee,width:ye,height:ce}=a.bbox;To(we,xe-le,ee-le,ye+le*2,ce+le*2);const ze=he=>{if(v[he]!=null){let U=P(S(p[he],g,J,N)),q=P(E(v[he],z,F,C));I(se,U+ne,q),G(se,U,q,ne,0,lo*2)}};if(h)h.forEach(ze);else for(let he=s;he<=c;he++)ze(he);return{stroke:ie>0?se:null,fill:se,clip:we,flags:us|Kh}})}function ky(n){return(a,u,s,c,h,f)=>{s!=c&&(h!=s&&f!=s&&n(a,u,s),h!=c&&f!=c&&n(a,u,c),n(a,u,f))}}const OT=ky(os),MT=ky(fs);function Hy(n){const a=Je(n?.alignGaps,0);return(u,s,c,h)=>uu(u,s,(f,p,v,g,z,S,E,N,C,J,F)=>{[c,h]=yo(v,c,h);let P=f.pxRound,Y=ce=>P(S(ce,g,J,N)),I=ce=>P(E(ce,z,F,C)),G,ie;g.ori==0?(G=os,ie=OT):(G=fs,ie=MT);const ne=g.dir*(g.ori==0?1:-1),le={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:us},se=le.stroke;let we=!1;if(h-c>=J*4){let ce=B=>u.posToVal(B,g.key,!0),ze=null,he=null,U,q,me,Oe=Y(p[ne==1?c:h]),be=Y(p[c]),A=Y(p[h]),H=ce(ne==1?be+1:A-1);for(let B=ne==1?c:h;B>=c&&B<=h;B+=ne){let ae=p[B],pe=(ne==1?aeH)?Oe:Y(ae),ge=v[B];pe==Oe?ge!=null?(q=ge,ze==null?(G(se,pe,I(q)),U=ze=he=q):qhe&&(he=q)):ge===null&&(we=!0):(ze!=null&&ie(se,Oe,I(ze),I(he),I(U),I(q)),ge!=null?(q=ge,G(se,pe,I(q)),ze=he=U=q):(ze=he=null,ge===null&&(we=!0)),Oe=pe,H=ce(Oe+ne))}ze!=null&&ze!=he&&me!=Oe&&ie(se,Oe,I(ze),I(he),I(U),I(q))}else for(let ce=ne==1?c:h;ce>=c&&ce<=h;ce+=ne){let ze=v[ce];ze===null?we=!0:ze!=null&&G(se,Y(p[ce]),I(ze))}let[ee,ye]=Td(u,s);if(f.fill!=null||ee!=0){let ce=le.fill=new Path2D(se),ze=f.fillTo(u,s,f.min,f.max,ee),he=I(ze),U=Y(p[c]),q=Y(p[h]);ne==-1&&([q,U]=[U,q]),G(ce,q,he),G(ce,U,he)}if(!f.spanGaps){let ce=[];we&&ce.push(...Ad(p,v,c,h,ne,Y,a)),le.gaps=ce=f.gaps(u,s,c,h,ce),le.clip=xo(ce,g.ori,N,C,J,F)}return ye!=0&&(le.band=ye==2?[Ua(u,s,c,h,se,-1),Ua(u,s,c,h,se,1)]:Ua(u,s,c,h,se,ye)),le})}function NT(n){const a=Je(n.align,1),u=Je(n.ascDesc,!1),s=Je(n.alignGaps,0),c=Je(n.extend,!1);return(h,f,p,v)=>uu(h,f,(g,z,S,E,N,C,J,F,P,Y,I)=>{[p,v]=yo(S,p,v);let G=g.pxRound,{left:ie,width:ne}=h.bbox,le=be=>G(C(be,E,Y,F)),se=be=>G(J(be,N,I,P)),we=E.ori==0?os:fs;const xe={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:us},ee=xe.stroke,ye=E.dir*(E.ori==0?1:-1);let ce=se(S[ye==1?p:v]),ze=le(z[ye==1?p:v]),he=ze,U=ze;c&&a==-1&&(U=ie,we(ee,U,ce)),we(ee,ze,ce);for(let be=ye==1?p:v;be>=p&&be<=v;be+=ye){let A=S[be];if(A==null)continue;let H=le(z[be]),B=se()DELIM" +R"DELIM(A);a==1?we(ee,H,ce):we(ee,he,B),we(ee,H,B),ce=B,he=H}let q=he;c&&a==1&&(q=ie+ne,we(ee,q,ce));let[me,Oe]=Td(h,f);if(g.fill!=null||me!=0){let be=xe.fill=new Path2D(ee),A=g.fillTo(h,f,g.min,g.max,me),H=se(A);we(be,q,H),we(be,U,H)}if(!g.spanGaps){let be=[];be.push(...Ad(z,S,p,v,ye,le,s));let A=g.width*Ie/2,H=u||a==1?A:-A,B=u||a==-1?-A:A;be.forEach(ae=>{ae[0]+=H,ae[1]+=B}),xe.gaps=be=g.gaps(h,f,p,v,be),xe.clip=xo(be,E.ori,F,P,Y,I)}return Oe!=0&&(xe.band=Oe==2?[Ua(h,f,p,v,ee,-1),Ua(h,f,p,v,ee,1)]:Ua(h,f,p,v,ee,Oe)),xe})}function nv(n,a,u,s,c,h,f=gt){if(n.length>1){let p=null;for(let v=0,g=1/0;v{}),{fill:S,stroke:E}=g;return(N,C,J,F)=>uu(N,C,(P,Y,I,G,ie,ne,le,se,we,xe,ee)=>{let ye=P.pxRound,ce=u,ze=s*Ie,he=p*Ie,U=v*Ie,q,me;G.ori==0?[q,me]=h(N,C):[me,q]=h(N,C);const Oe=G.dir*(G.ori==0?1:-1);let be=G.ori==0?To:wd,A=G.ori==0?z:(oe,lt,Nt,Ml,ua,Pn,sa)=>{z(oe,lt,Nt,ua,Ml,sa,Pn)},H=Je(N.bands,Sd).find(oe=>oe.series[0]==C),B=H!=null?H.dir:0,ae=P.fillTo(N,C,P.min,P.max,B),_e=ye(le(ae,ie,ee,we)),pe,ge,mt,Ge=xe,nt=ye(P.width*Ie),Mn=!1,In=null,Nn=null,Sn=null,ql=null;S!=null&&(nt==0||E!=null)&&(Mn=!0,In=S.values(N,C,J,F),Nn=new Map,new Set(In).forEach(oe=>{oe!=null&&Nn.set(oe,new Path2D)}),nt>0&&(Sn=E.values(N,C,J,F),ql=new Map,new Set(Sn).forEach(oe=>{oe!=null&&ql.set(oe,new Path2D)})));let{x0:Ql,size:Ei}=g;if(Ql!=null&&Ei!=null){ce=1,Y=Ql.values(N,C,J,F),Ql.unit==2&&(Y=Y.map(Nt=>N.posToVal(se+Nt*xe,G.key,!0)));let oe=Ei.values(N,C,J,F);Ei.unit==2?ge=oe[0]*xe:ge=ne(oe[0],G,xe,se)-ne(0,G,xe,se),Ge=nv(Y,I,ne,G,xe,se,Ge),mt=Ge-ge+ze}else Ge=nv(Y,I,ne,G,xe,se,Ge),mt=Ge*f+ze,ge=Ge-mt;mt<1&&(mt=0),nt>=ge/2&&(nt=0),mt<5&&(ye=sy);let Ti=mt>0,wl=Ge-mt-(Ti?nt:0);ge=ye(Yh(wl,U,he)),pe=(ce==0?ge/2:ce==Oe?0:ge)-ce*Oe*((ce==0?ze/2:0)+(Ti?nt/2:0));const Ft={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Gl=Mn?null:new Path2D;let Ol=null;if(H!=null)Ol=N.data[H.series[1]];else{let{y0:oe,y1:lt}=g;oe!=null&<!=null&&(I=lt.values(N,C,J,F),Ol=oe.values(N,C,J,F))}let ia=q*ge,Ee=me*ge;for(let oe=Oe==1?J:F;oe>=J&&oe<=F;oe+=Oe){let lt=I[oe];if(lt==null)continue;if(Ol!=null){let rt=Ol[oe]??0;if(lt-rt==0)continue;_e=le(rt,ie,ee,we)}let Nt=G.distr!=2||g!=null?Y[oe]:oe,Ml=ne(Nt,G,xe,se),ua=le(Je(lt,ae),ie,ee,we),Pn=ye(Ml-pe),sa=ye(Ln(ua,_e)),Dn=ye(Bl(ua,_e)),nn=sa-Dn;if(lt!=null){let rt=lt<0?Ee:ia,Gt=lt<0?ia:Ee;Mn?(nt>0&&Sn[oe]!=null&&be(ql.get(Sn[oe]),Pn,Dn+fl(nt/2),ge,Ln(0,nn-nt),rt,Gt),In[oe]!=null&&be(Nn.get(In[oe]),Pn,Dn+fl(nt/2),ge,Ln(0,nn-nt),rt,Gt)):be(Gl,Pn,Dn+fl(nt/2),ge,Ln(0,nn-nt),rt,Gt),A(N,C,oe,Pn-nt/2,Dn,ge+nt,nn)}}return nt>0?Ft.stroke=Mn?ql:Gl:Mn||(Ft._fill=P.width==0?P._fill:P._stroke??P._fill,Ft.width=0),Ft.fill=Mn?Nn:Gl,Ft})}function jT(n,a){const u=Je(a?.alignGaps,0);return(s,c,h,f)=>uu(s,c,(p,v,g,z,S,E,N,C,J,F,P)=>{[h,f]=yo(g,h,f);let Y=p.pxRound,I=q=>Y(E(q,z,F,C)),G=q=>Y(N(q,S,P,J)),ie,ne,le;z.ori==0?(ie=zo,le=os,ne=Ry):(ie=Eo,le=fs,ne=Uy);const se=z.dir*(z.ori==0?1:-1);let we=I(v[se==1?h:f]),xe=we,ee=[],ye=[];for(let q=se==1?h:f;q>=h&&q<=f;q+=se)if(g[q]!=null){let Oe=v[q],be=I(Oe);ee.push(xe=be),ye.push(G(g[q]))}const ce={stroke:n(ee,ye,ie,le,ne,Y),fill:null,clip:null,band:null,gaps:null,flags:us},ze=ce.stroke;let[he,U]=Td(s,c);if(p.fill!=null||he!=0){let q=ce.fill=new Path2D(ze),me=p.fillTo(s,c,p.min,p.max,he),Oe=G(me);le(q,xe,Oe),le(q,we,Oe)}if(!p.spanGaps){let q=[];q.push(...Ad(v,g,h,f,se,I,u)),ce.gaps=q=p.gaps(s,c,h,f,q),ce.clip=xo(q,z.ori,C,J,F,P)}return U!=0&&(ce.band=U==2?[Ua(s,c,h,f,ze,-1),Ua(s,c,h,f,ze,1)]:Ua(s,c,h,f,ze,U)),ce})}function CT(n){return jT(RT,n)}function RT(n,a,u,s,c,h){const f=n.length;if(f<2)return null;const p=new Path2D;if(u(p,n[0],a[0]),f==2)s(p,n[1],a[1]);else{let v=Array(f),g=Array(f-1),z=Array(f-1),S=Array(f-1);for(let E=0;E0!=g[E]>0?v[E]=0:(v[E]=3*(S[E-1]+S[E])/((2*S[E]+S[E-1])/g[E-1]+(S[E]+2*S[E-1])/g[E]),isFinite(v[E])||(v[E]=0));v[f-1]=g[f-2];for(let E=0;E{On.pxRatio=Ie}));const UT=Hy(),ZT=Zy();function av(n,a,u,s){return(s?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((h,f)=>Jh(h,f,a,u))}function kT(n,a){return n.map((u,s)=>s==0?{}:Jt({},a,u))}function Jh(n,a,u,s){return Jt({},a==0?u:s,n)}function Ly(n,a,u){return a==null?as:[a,u]}const HT=Ly;function LT(n,a,u){return a==null?as:co(a,u,yd,!0)}function By(n,a,u,s){return a==null?as:bo(a,u,n.scales[s].log,!1)}const BT=By;function qy(n,a,u,s){return a==null?as:vd(a,u,n.scales[s].log,!1)}const qT=qy;function QT(n,a,u,s,c){let h=Ln(Zg(n),Zg(a)),f=a-n,p=Ll(c/s*f,u);do{let v=u[p],g=s*v/f;if(g>=c&&h+(v<5?_i.get(v):0)<=17)return[v,g]}while(++p(a=Pt((u=+c)*Ie))+"px"),[n,a,u]}function GT(n){n.show&&[n.font,n.labelFont].forEach(a=>{let u=vt(a[2]*Ie,1);a[0]=a[0].replace(/[0-9.]+px/,u+"px"),a[1]=u})}function On(n,a,u){const s={mode:Je(n.mode,1)},c=s.mode;function h(m,y,_,x){let w=y.valToPct(m);return x+_*(y.dir==-1?1-w:w)}function f(m,y,_,x){let w=y.valToPct(m);return x+_*(y.dir==-1?w:1-w)}function p(m,y,_,x){return y.ori==0?h(m,y,_,x):f(m,y,_,x)}s.valToPosH=h,s.valToPosV=f;let v=!1;s.status=0;const g=s.root=El(Fz);if(n.id!=null&&(g.id=n.id),cl(g,n.class),n.title){let m=El(Pz,g);m.textContent=n.title}const z=Hl("canvas"),S=s.ctx=z.getContext("2d"),E=El(eE,g);tu("click",E,m=>{m.target===C&&(Pe!=Un||at!=Jl)&&$e.click(s,m)},!0);const N=s.under=El(tE,E);E.appendChild(z);const C=s.over=El(nE,E);n=is(n);const J=+Je(n.pxAlign,1),F=tv(J);(n.plugins||[]).forEach(m=>{m.opts&&(n=m.opts(s,n)||n)});const P=n.ms||.001,Y=s.series=c==1?av(n.series||[],Xg,Pg,!1):kT(n.series||[null],Ig),I=s.axes=av(n.axes||[],Kg,Fg,!0),G=s.scales={},ie=s.bands=n.bands||[];ie.forEach(m=>{m.fill=Qe(m.fill||null),m.dir=Je(m.dir,-1)});const ne=c==2?Y[1].facets[0].scale:Y[0].scale,le={axes:Ss,series:wo},se=(n.drawOrder||["axes","series"]).map(m=>le[m]);function we(m){const y=m.distr==3?_=>Ra(_>0?_:m.clamp(s,_,m.min,m.max,m.key)):m.distr==4?_=>Ch(_,m.asinh):m.distr==100?_=>m.fwd(_):_=>_;return _=>{let x=y(_),{_min:w,_max:j}=m,V=j-w;return(x-w)/V}}function xe(m){let y=G[m];if(y==null){let _=(n.scales||_r)[m]||_r;if(_.from!=null){xe(_.from);let x=Jt({},G[_.from],_,{key:m});x.valToPct=we(x),G[m]=x}else{y=G[m]=Jt({},m==ne?My:TT,_),y.key=m;let x=y.time,w=y.range,j=yi(w);if((m!=ne||c==2&&!x)&&(j&&(w[0]==null||w[1]==null)&&(w={min:w[0]==null?Cg:{mode:1,hard:w[0],soft:w[0]},max:w[1]==null?Cg:{mode:1,hard:w[1],soft:w[1]}},j=!1),!j&&_o(w))){let V=w;w=(W,te,ue)=>te==null?as:co(te,ue,V)}y.range=Qe(w||(x?HT:m==ne?y.distr==3?BT:y.distr==4?qT:Ly:y.distr==3?By:y.distr==4?qy:LT)),y.auto=Qe(j?!1:y.auto),y.clamp=Qe(y.clamp||ET),y._min=y._max=null,y.valToPct=we(y)}}}xe("x"),xe("y"),c==1&&Y.forEach(m=>{xe(m.scale)}),I.forEach(m=>{xe(m.scale)});for(let m in n.scales)xe(m);const ee=G[ne],ye=ee.distr;let ce,ze;ee.ori==0?(cl(g,Wz),ce=h,ze=f):(cl(g,Iz),ce=f,ze=h);const he={};for(let m in G){let y=G[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/P))),q=n.fmtDate||_d,me=P==1?WE(U):eT(U),Oe=Yg(U,Gg(P==1?FE:PE,q)),be=$g(U,Vg(nT,q)),A=[],H=s.legend=Jt({},iT,n.legend),B=s.cursor=Jt({},fT,{drag:{y:c==2}},n.cursor),ae=H.show,_e=B.show,pe=H.markers;H.idxs=A,pe.width=Qe(pe.width),pe.dash=Qe(pe.dash),pe.stroke=Qe(pe.stroke),pe.fill=Qe(pe.fill);let ge,mt,Ge,nt=[],Mn=[],In,Nn=!1,Sn={};if(H.live){const m=Y[1]?Y[1].values:null;Nn=m!=null,In=Nn?m(s,1)DELIM" +R"DELIM(,0):{_:0};for(let y in In)Sn[y]=pd}if(ae)if(ge=Hl("table",rE,g),Ge=Hl("tbody",null,ge),H.mount(s,ge),Nn){mt=Hl("thead",null,ge,Ge);let m=Hl("tr",null,mt);Hl("th",null,m);for(var ql in In)Hl("th",Sg,m).textContent=ql}else cl(ge,oE),H.live&&cl(ge,cE);const Ql={show:!0},Ei={show:!1};function Ti(m,y){if(y==0&&(Nn||!H.live||c==2))return as;let _=[],x=Hl("tr",fE,Ge,Ge.childNodes[y]);cl(x,m.class),m.show||cl(x,Pi);let w=Hl("th",null,x);if(pe.show){let W=El(hE,w);if(y>0){let te=pe.width(s,y);te&&(W.style.border=te+"px "+pe.dash(s,y)+" "+pe.stroke(s,y)),W.style.background=pe.fill(s,y)}}let j=El(Sg,w);m.label instanceof HTMLElement?j.appendChild(m.label):j.textContent=m.label,y>0&&(pe.show||(j.style.color=m.width>0?pe.stroke(s,y):pe.fill(s,y)),Ft("click",w,W=>{if(B._lock)return;el(W);let te=Y.indexOf(m);if((W.ctrlKey||W.metaKey)!=H.isolate){let ue=Y.some((re,fe)=>fe>0&&fe!=te&&re.show);Y.forEach((re,fe)=>{fe>0&&Zn(fe,ue?fe==te?Ql:Ei:Ql,!0,jt.setSeries)})}else Zn(te,{show:!m.show},!0,jt.setSeries)},!1),oa&&Ft(Eg,w,W=>{B._lock||(el(W),Zn(Y.indexOf(m),Ka,!0,jt.setSeries))},!1));for(var V in In){let W=Hl("td",dE,x);W.textContent="--",_.push(W)}return[x,_]}const wl=new Map;function Ft(m,y,_,x=!0){const w=wl.get(y)||{},j=B.bind[m](s,y,_,x);j&&(tu(m,y,w[m]=j),wl.set(y,w))}function Gl(m,y,_){const x=wl.get(y)||{};for(let w in x)(m==null||w==m)&&(Gh(w,y,x[w]),delete x[w]);m==null&&wl.delete(y)}let Ol=0,ia=0,Ee=0,oe=0,lt=0,Nt=0,Ml=lt,ua=Nt,Pn=Ee,sa=oe,Dn=0,nn=0,rt=0,Gt=0;s.bbox={};let cn=!1,su=!1,Za=!1,ra=!1,ca=!1,on=!1;function ka(m,y,_){(_||m!=s.width||y!=s.height)&&Yl(m,y),qa(!1),Za=!0,su=!0,Xl()}function Yl(m,y){s.width=Ol=Ee=m,s.height=ia=oe=y,lt=Nt=0,Mr(),hs();let _=s.bbox;Dn=_.left=Wi(lt*Ie,.5),nn=_.top=Wi(Nt*Ie,.5),rt=_.width=Wi(Ee*Ie,.5),Gt=_.height=Wi(oe*Ie,.5)}const ru=3;function Ai(){let m=!1,y=0;for(;!m;){y++;let _=Cr(y),x=Rr(y);m=y==ru||_&&x,m||(Yl(s.width,s.height),su=!0)}}function Ao({width:m,height:y}){ka(m,y)}s.setSize=Ao;function Mr(){let m=!1,y=!1,_=!1,x=!1;I.forEach((w,j)=>{if(w.show&&w._show){let{side:V,_size:W}=w,te=V%2,ue=w.label!=null?w.labelSize:0,re=W+ue;re>0&&(te?(Ee-=re,V==3?(lt+=re,x=!0):_=!0):(oe-=re,V==0?(Nt+=re,m=!0):y=!0))}}),Bn[0]=m,Bn[1]=_,Bn[2]=y,Bn[3]=x,Ee-=Dl[1]+Dl[3],lt+=Dl[3],oe-=Dl[2]+Dl[0],Nt+=Dl[0]}function hs(){let m=lt+Ee,y=Nt+oe,_=lt,x=Nt;function w(j,V){switch(j){case 1:return m+=V,m-V;case 2:return y+=V,y-V;case 3:return _-=V,_+V;case 0:return x-=V,x+V}}I.forEach((j,V)=>{if(j.show&&j._show){let W=j.side;j._pos=w(W,j._size),j.label!=null&&(j._lpos=w(W,j.labelSize))}})}if(B.dataIdx==null){let m=B.hover,y=m.skip=new Set(m.skip??[]);y.add(void 0);let _=m.prox=Qe(m.prox),x=m.bias??=0;B.dataIdx=(w,j,V,W)=>{if(j==0)return V;let te=V,ue=_(w,j,V,W)??gt,re=ue>=0&&ue0;)y.has(Ce[Se])||(Ue=Se);if(x==0||x==1)for(Se=V;Me==null&&Se++ue&&(te=null);return te}}const el=m=>{B.event=m};B.idxs=A,B._lock=!1;let ln=B.points;ln.show=Qe(ln.show),ln.size=Qe(ln.size),ln.stroke=Qe(ln.stroke),ln.width=Qe(ln.width),ln.fill=Qe(ln.fill);const tl=s.focus=Jt({},n.focus||{alpha:.3},B.focus),oa=tl.prox>=0,fa=oa&&ln.one;let _n=[],Vl=[],ha=[];function ds(m,y){let _=ln.show(s,y);if(_ instanceof HTMLElement)return cl(_,sE),cl(_,m.class),na(_,-10,-10,Ee,oe),C.insertBefore(_,_n[y]),_}function Nl(m,y){if(c==1||y>0){let _=c==1&&G[m.scale].time,x=m.value;m.value=_?Lg(x)?$g(U,Vg(x,q)):x||be:x||_T,m.label=m.label||(_?dT:hT)}if(fa||y>0){m.width=m.width==null?1:m.width,m.paths=m.paths||UT||TE,m.fillTo=Qe(m.fillTo||AT),m.pxAlign=+Je(m.pxAlign,J),m.pxRound=tv(m.pxAlign),m.stroke=Qe(m.stroke||null),m.fill=Qe(m.fill||null),m._stroke=m._fill=m._paths=m._focus=null;let _=xT(Ln(1,m.width),1),x=m.points=Jt({},{size:_,width:Ln(1,_*.2),stroke:m.stroke,space:_*2,paths:ZT,_stroke:null,_fill:null},m.points);x.show=Qe(x.show),x.filter=Qe(x.filter),x.fill=Qe(x.fill),x.stroke=Qe(x.stroke),x.paths=Qe(x.paths),x.pxAlign=m.pxAlign}if(ae){let _=Ti(m,y);nt.splice(y,0,_[0]),Mn.splice(y,0,_[1]),H.values.push(null)}if(_e){A.splice(y,0,null);let _=null;fa?y==0&&(_=ds(m,y)):y>0&&(_=ds(m,y)),_n.splice(y,0,_),Vl.splice(y,0,0),ha.splice(y,0,0)}kt("addSeries",y)}function Wt(m,y){y=y??Y.length,m=c==1?Jh(m,y,Xg,Pg):Jh(m,y,{},Ig),Y.splice(y,0,m),Nl(Y[y],y)}s.addSeries=Wt;function xn(m){if(Y.splice(m,1),ae){H.values.splice(m,1),Mn.splice(m,1);let y=nt.splice(m,1)[0];Gl(null,y.firstChild),y.remove()}_e&&(A.splice(m,1),_n.splice(m,1)[0].remove(),Vl.splice(m,1),ha.splice(m,1)),kt("delSeries",m)}s.delSeries=xn;const Bn=[!1,!1,!1,!1];function ms(m,y){if(m._show=m.show,m.show){let _=m.side%2,x=G[m.scale];x==null&&(m.scale=_?Y[1].scale:ne,x=G[m.scale]);let w=x.time;m.size=Qe(m.size),m.space=Qe(m.space),m.rotate=Qe(m.rotate),yi(m.incrs)&&m.incrs.forEach(V=>{!_i.has(V)&&_i.set(V,oy(V))}),m.incrs=Qe(m.incrs||(x.distr==2?KE:w?P==1?JE:IE:Ii)),m.splits=Qe(m.splits||(w&&x.distr==1?me:x.distr==3?Vh:x.distr==4?gT:pT)),m.stroke=Qe(m.stroke),m.grid.stroke=Qe(m.grid.stroke),m.ticks.stroke=Qe(m.ticks.stroke),m.border.stroke=Qe(m.border.stroke);let j=m.values;m.values=yi(j)&&!yi(j[0])?Qe(j):w?yi(j)?Yg(U,Gg(j,q)):Lg(j)?tT(U,j):j||Oe:j||mT,m.filter=Qe(m.filter||(x.distr>=3&&x.log==10?bT:x.distr==3&&x.log==2?ST:ry)),m.font=iv(m.font),m.labelFont=iv(m.labelFont),m._size=m.size(s,null,y,0),m._space=m._rotate=m._incrs=m._found=m._splits=m._values=null,m._size>0&&(Bn[y]=!0,m._el=El(lE,E))}}function wi(m,y,_,x){let[w,j,V,W]=_,te=y%2,ue=0;return te==0&&(W||j)&&(ue=y==0&&!w||y==2&&!V?Pt(Kg.size/3):0),te==1&&(w||V)&&(ue=y==1&&!j||y==3&&!W?Pt(Fg.size/2):0),ue}const Nr=s.padding=(n.padding||[wi,wi,wi,wi]).map(m=>Qe(Je(m,wi))),Dl=s._padding=Nr.map((m,y)=>m(s,y,Bn,0));let wt,Dt=null,bt=null;const jl=c==1?Y[0].idxs:null;let fn=null,dl=!1;function Zt(m,y){if(a=m??[],s.data=s._data=a,c==2){wt=0;for(let _=1;_=0,on=!0,Xl()}}s.setData=Zt;function cu(){dl=!0;let m,y;c==1&&(wt>0?(Dt=jl[0]=0,bt=jl[1]=wt-1,m=a[0][Dt],y=a[0][bt],ye==2?(m=Dt,y=bt):m==y&&(ye==3?[m,y]=bo(m,m,ee.log,!1):ye==4?[m,y]=vd(m,m,ee.log,!1):ee.time?y=m+Pt(86400/P):[m,y]=co(m,y,yd,!0))):(Dt=jl[0]=m=null,bt=jl[1]=y=null)),Qn(ne,m,y)}let Oi,qn,$l,ps,ou,fu,gs,Ha,La,Et;function jn(m,y,_,x,w,j){m??=xg,_??=Sd,x??="butt",w??=xg,j??="round",m!=Oi&&(S.strokeStyle=Oi=m),w!=qn&&(S.fillStyle=qn=w),y!=$l&&(S.lineWidth=$l=y),j!=ou&&(S.lineJoin=ou=j),x!=fu&&(S.lineCap=fu=x),_!=ps&&S.setLineDash(ps=_)}function vs(m,y,_,x){y!=qn&&(S.fillStyle=qn=y),m!=gs&&(S.font=gs=m),_!=Ha&&(S.textAlign=Ha=_),x!=La&&(S.textBaseline=La=x)}function ys(m,y,_,x,w=0){if(x.length>0&&m.auto(s,dl)&&(y==null||y.min==null)){let j=Je(Dt,0),V=Je(bt,x.length-1),W=_.min==null?bE(x,j,V,w,m.distr==3):[_.min,_.max];m.min=Bl(m.min,_.min=W[0]),m.max=Ln(m.max,_.max=W[1])}}const hu={min:null,max:null};function Dr(){for(let x in G){let w=G[x];he[x]==null&&(w.min==null||he[ne]!=null&&w.auto(s,dl))&&(he[x]=hu)}for(let x in G){let w=G[x];he[x]==null&&w.from!=null&&he[w.from]!=null&&(he[x]=hu)}he[ne]!=null&&qa(!0);let m={};for(let x in he){let w=he[x];if(w!=null){let j=m[x]=is(G[x],OE);if(w.min!=null)Jt(j,w);else if(x!=ne||c==2)if(wt==0&&j.from==null){let V=j.range(s,null,null,x);j.min=V[0],j.max=V[1]}else j.min=gt,j.max=-gt}}if(wt>0){Y.forEach((x,w)=>{if(c==1){let j=x.scale,V=he[j];if(V==null)return;let W=m[j];if(w==0){let te=W.range(s,W.min,W.max,j);W.min=te[0],W.max=te[1],Dt=Ll(W.min,a[0]),bt=Ll(W.max,a[0]),bt-Dt>1&&(a[0][Dt]W.max&&bt--),x.min=fn[Dt],x.max=fn[bt]}else x.show&&x.auto&&ys(W,V,x,a[w],x.sorted);x.idxs[0]=Dt,x.idxs[1]=bt}else if(w>0&&x.show&&x.auto){let[j,V]=x.facets,W=j.scale,te=V.scale,[ue,re]=a[w],fe=m[W],je=m[te];fe!=null&&ys(fe,he[W],j,ue,j.sorted),je!=null&&ys(je,he[te],V,re,V.sorted),x.min=V.min,x.max=V.max}});for(let x in m){let w=m[x],j=he[x];if(w.from==null&&(j==null||j.min==null)){let V=w.range(s,w.min==gt?null:w.min,w.max==-gt?null:w.max,x);w.min=V[0],w.max=V[1]}}}for(let x in m){let w=m[x];if(w.from!=null){let j=m[w.from];if(j.min==null)w.min=w.max=null;else{let V=w.range(s,j.min,j.max,x);w.min=V[0],w.max=V[1]}}}let y={},_=!1;for(let x in m){let w=m[x],j=G[x];if(j.min!=w.min||j.max!=w.max){j.min=w.min,j.max=w.max;let V=j.distr;j._min=V==3?Ra(j.min):V==4?Ch(j.min,j.asinh):V==100?j.fwd(j.min):j.min,j._max=V==3?Ra(j.max):V==4?Ch(j.max,j.asinh):V==100?j.fwd(j.max):j.max,y[x]=_=!0}}if(_){Y.forEach((x,w)=>{c==2?w>0&&y.y&&(x._paths=null):y[x.scale]&&(x._paths=null)});for(let x in y)Za=!0,kt("setScale",x);_e&&B.left>=0&&(ra=on=!0)}for(let x in he)he[x]=null}function du(m){let y=Yh(Dt-1,0,wt-1),_=Yh(bt+1,0,wt-1);for(;m[y]==null&&y>0;)y--;for(;m[_]==null&&_0){let m=Y.some(y=>y._focus)&&Et!=tl.alpha;m&&(S.globalAlpha=Et=tl.alpha),Y.forEach((y,_)=>{if(_>0&&y.show&&(Cn(_,!1),Cn(_,!0),y._paths==null)){let x=Et;Et!=y.alpha&&(S.globalAlpha=Et=y.alpha);let w=c==2?[0,a[_][0].length-1]:du(a[_]);y._paths=y.paths(s,_,w[0],w[1]),Et!=x&&(S.globalAlpha=Et=x)}}),Y.forEach((y,_)=>{if(_>0&&y.show){let x=Et;Et!=y.alpha&&(S.globalAlpha=Et=y.alpha),y._paths!=null&&mu(_,!1);{let w=y._paths!=null?y._paths.gaps:null,j=y.points.show(s,_,Dt,bt,w),V=y.points.filter(s,_,j,w);(j||V)&&(y.points._paths=y.points.paths(s,_,Dt,bt,V),mu(_,!0))}Et!=x&&(S.globalAlpha=Et=x),kt("drawSeries",_)}}),m&&(S.globalAlpha=Et=1)}}function Cn(m,y){let _=y?Y[m].points:Y[m];_._stroke=_.stroke(s,m),_._fill=_.fill(s,m)}function mu(m,y){let _=y?Y[m].points:Y[m],{stroke:x,fill:w,clip:j,flags:V,_stroke:W=_._stroke,_fill:te=_._fill,_width:ue=_.width}=_._paths;ue=vt(ue*Ie,3);let re=null,fe=ue%2/2;y&&te==null&&(te=ue>0?"#fff":W);let je=_.pxAlign==1&&fe>0;if(je&&S.translate(fe,fe),!y){let Ve=Dn-ue/2,Ce=nn-ue/2,Ue=rt+ue,Me=Gt+ue;re=new Path2D,re.rect(Ve,Ce,Ue,Me)}y?Kl(W,ue,_.dash,_.cap,te,x,w,V,j):jr(m,W,ue,_.dash,_.cap,te,x,w,V,re,j),je&&S.translate(-fe,-fe)}function jr(m,y,_,x,w,j,V,W,te,ue,re){let fe=!1;te!=0&&ie.forEach((je,Ve)=>{if(je.series[0]==m){let Ce=Y[je.series[1]],Ue=a[je.series[1]],Me=(Ce._paths||_r).band;yi(Me)&&(Me=je.dir==1?Me[0]:Me[1]);let Se,ct=null;Ce.show&&Me&&_E(Ue,Dt,bt)?(ct=je.fill(s,Ve)||j,Se=Ce._paths.clip):Me=null,Kl(y,_,x,w,ct,V,W,te,ue,re,Se,Me),fe=!0}}),fe||Kl(y,_,x,w,j,V,W,te,ue,re)}const pu=us|Kh;function Kl(m,y,_,x,w,j,V,W,te,ue,re,fe){jn(m,y,_,x,w),(te||ue||fe)&&(S.save(),te&&S.clip(te),ue&&S.clip(ue)),fe?(W&pu)==pu?(S.clip(fe),re&&S.clip(re),Ni(w,V),Mi(m,j,y)):W&Kh?(Ni(w,V),S.clip(fe),Mi(m,j,y)):W&us&&(S.save(),S.clip(fe),re&&S.clip(re),Ni(w,V),S.restore(),Mi(m,j,y)):(Ni(w,V),Mi(m,j,y)),(te||ue||fe)&&S.restore()}function Mi(m,y,_){_>0&&(y instanceof Map?y.forEach((x,w)=>{S.strokeStyle=Oi=w,S.stroke(x)}):y!=null&&m&&S.stroke(y))}function Ni(m,y){y instanceof Map?y.forEach((_,x)=>{S.fillStyle=qn=x,S.fill(_)}):y!=null&&m&&S.fill(y)}function Ba(m,y,_,x){let w=I[m],j;if(x<=0)j=[0,0];else{let V=w._space=w.space(s,m,y,_,x),W=w._incrs=w.incrs(s,m,y,_,x,V);j=QT(y,_,W,x,V)}return w._found=j}function bs(m,y,_,x,w,j,V,W,te,ue){let re=V%2/2;J==1&&S.translate(re,re),jn(W,V,te,ue,W),S.beginPath();let fe,je,Ve,Ce,Ue=w+(x==0||x==3?-j:j);_==0?(je=w,Ce=Ue):(fe=w,Ve=Ue);for(let Me=0;Me{if(!_.show)return;let w=G[_.scale];if(w.min==null){_._show&&(y=!1,_._show=!1,qa(!1));return}else _._show||(y=!1,_._show=!0,qa(!1));let j=_.side,V=j%2,{min:W,max:te}=w,[ue,re]=Ba(x,W,te,V==0?Ee:oe);if(re==0)return;let fe=w.distr==2,je=_._splits=_.splits(s,x,W,te,ue,re,fe),Ve=w.distr==2?je.map(Se=>fn[Se]):je,Ce=w.distr==2?fn[je[1]]-fn[je[0]]:ue,Ue=_._values=_.values(s,_.filter(s,Ve,x,re,Ce),x,re,Ce);_._rotate=j==2?_.rotate(s,Ue,x,re):0;let Me=_._size;_._size=Tl(_.size(s,Ue,x,m)),Me!=null&&_._size!=Me&&(y=!1)}),y}function Rr(m){let y=!0;return Nr.forEach((_,x)=>{let w=_(s,x,Bn,m);w!=Dl[x]&&(y=!1),Dl[x]=w}),y}function Ss(){for(let m=0;mfn[sn]):Ve,Ue=re.distr==2?fn[Ve[1]]-fn[Ve[0]]:te,Me=y.ticks,Se=y.border,ct=Me.show?Me.size:0,St=Pt(ct*Ie),Ct=Pt((y.alignTo==2?y._size-ct-y.gap:y.gap)*Ie),et=y._rotate*-lo/180,it=F(y._pos*Ie),hn=(St+Ct)*W,Ht=it+hn;j=x==0?Ht:0,w=x==1?Ht:0;let En=y.font[0],Gn=y.align==1?Xu:y.align==2?Nh:et>0?Xu:et<0?Nh:x==0?"center":_==3?Nh:Xu,an=et||x==1?"middle":_==2?dr:_g;vs(En,V,Gn,an);let Yt=y.font[1]*y.lineGap,Tn=Ve.map(sn=>F(p(sn,re,fe,je))),Yn=y._values;for(let sn=0;sn{_>0&&(y._paths=null,m&&(c==1?(y.min=null,y.max=null):y.facets.forEach(x=>{x.min=null,x.max=null})))})}let gu=!1,Qa=!1,Rn=[];function _s(){Qa=!1;for(let m=0;m0&&queueMicrotask(_s)}s.batch=Ga;function da(){if(cn&&(Dr(),cn=!1),Za&&(Ai(),Za=!1),su){if(zt(N,Xu,lt),zt(N,dr,Nt),zt(N,gr,Ee),zt(N,vr,oe),zt(C,Xu,lt),zt(C,dr,Nt),zt(C,gr,Ee),zt(C,vr,oe),zt(E,gr,Ol),zt(E,vr,ia),z.width=Pt(Ol*Ie),z.height=Pt(ia*Ie),I.forEach(({_el:m,_show:y,_size:_,_pos:x,side:w})=>{if(m!=null)if(y){let j=w===3||w===0?_:0,V=w%2==1;zt(m,V?"left":"top",x-j),zt(m,V?"width":"height",_),zt(m,V?"top":"left",V?Nt:lt),zt(m,V?"height":"width",V?oe:Ee),Qh(m,Pi)}else cl(m,Pi)}),Oi=qn=$l=ou=fu=gs=Ha=La=ps=null,Et=1,Ui(!0),lt!=Ml||Nt!=ua||Ee!=Pn||oe!=sa){qa(!1);let m=Ee/Pn,y=oe/sa;if(_e&&!ra&&B.left>=0){B.left*=m,B.top*=y,ml&&na(ml,Pt(B.left),0,Ee,oe),zn&&na(zn,0,Pt(B.top),Ee,oe);for(let _=0;_<_n.length;_++){let x=_n[_];x!=null&&(Vl[_]*=m,ha[_]*=y,na(x,Tl(Vl[_]),Tl(ha[_]),Ee,oe))}}if(Fe.show&&!ca&&Fe.left>=0&&Fe.width>0){Fe.left*=m,Fe.width*=m,Fe.top*=y,Fe.height*=y;for(let _ in ws)zt(Va,_,Fe[_])}Ml=lt,ua=Nt,Pn=Ee,sa=oe}kt("setSize"),su=!1}Ol>0&&ia>0&&(S.clearRect(0,0,z.width,z.height),kt("drawClear"),se.forEach(m=>m()),kt("draw")),Fe.show&&ca&&($a(Fe),ca=!1),_e&&ra&&(pa(null,!0,!1),ra=!1),H.show&&H.live&&on&&(Ts(),on=!1),v||(v=!0,s.status=1,kt("ready")),dl=!1,gu=!1}s.redraw=(m,y)=>{Za=y||!1,m!==!1?Qn(ne,ee.min,ee.max):Xl()};function vu(m,y){let _=G[m];if(_.from==null){if(wt==0){let x=_.range(s,y.min,y.max,m);y.min=x[0],y.max=x[1]}if(y.min>y.max){let x=y.min;y.min=y.max,y.max=x}if(wt>1&&y.min!=null&&y.max!=null&&y.max-y.min<1e-16)return;m==ne&&_.distr==2&&wt>0&&(y.min=Ll(y.min,a[0]),y.max=Ll(y.max,a[0]),y.min==y.max&&y.max++),he[m]=y,cn=!0,Xl()}}s.setScale=vu;let Di,yu,ml,z)DELIM" +R"DELIM(n,bu,Ya,Un,Jl,ji,xs,Pe,at,Cl=!1;const $e=B.drag;let yt=$e.x,Ot=$e.y;_e&&(B.x&&(Di=El(iE,C)),B.y&&(yu=El(uE,C)),ee.ori==0?(ml=Di,zn=yu):(ml=yu,zn=Di),Pe=B.left,at=B.top);const Fe=s.select=Jt({show:!0,over:!0,left:0,width:0,top:0,height:0},n.select),Va=Fe.show?El(aE,Fe.over?C:N):null;function $a(m,y){if(Fe.show){for(let _ in m)Fe[_]=m[_],_ in ws&&zt(Va,_,m[_]);y!==!1&&kt("setSelect")}}s.setSelect=$a;function zs(m){if(Y[m].show)ae&&Qh(nt[m],Pi);else if(ae&&cl(nt[m],Pi),_e){let _=fa?_n[0]:_n[m];_!=null&&na(_,-10,-10,Ee,oe)}}function Qn(m,y,_){vu(m,{min:y,max:_})}function Zn(m,y,_,x){y.focus!=null&&Do(m),y.show!=null&&Y.forEach((w,j)=>{j>0&&(m==j||m==null)&&(w.show=y.show,zs(j),c==2?(Qn(w.facets[0].scale,null,null),Qn(w.facets[1].scale,null,null)):Qn(w.scale,null,null),Xl())}),_!==!1&&kt("setSeries",m,y),x&&Ja("setSeries",s,m,y)}s.setSeries=Zn;function Ur(m,y){Jt(ie[m],y)}function Oo(m,y){m.fill=Qe(m.fill||null),m.dir=Je(m.dir,-1),y=y??ie.length,ie.splice(y,0,m)}function Mo(m){m==null?ie.length=0:ie.splice(m,1)}s.addBand=Oo,s.setBand=Ur,s.delBand=Mo;function No(m,y){Y[m].alpha=y,_e&&_n[m]!=null&&(_n[m].style.opacity=y),ae&&nt[m]&&(nt[m].style.opacity=y)}let nl,Fl,ma;const Ka={focus:!0};function Do(m){if(m!=ma){let y=m==null,_=tl.alpha!=1;Y.forEach((x,w)=>{if(c==1||w>0){let j=y||w==0||w==m;x._focus=y?null:j,_&&No(w,j?1:tl.alpha)}}),ma=m,_&&Xl()}}ae&&oa&&Ft(Tg,ge,m=>{B._lock||(el(m),ma!=null&&Zn(null,Ka,!0,jt.setSeries))});function pl(m,y,_){let x=G[y];_&&(m=m/Ie-(x.ori==1?Nt:lt));let w=Ee;x.ori==1&&(w=oe,m=w-m),x.dir==-1&&(m=w-m);let j=x._min,V=x._max,W=m/w,te=j+(V-j)*W,ue=x.distr;return ue==3?ls(10,te):ue==4?zE(te,x.asinh):ue==100?x.bwd(te):te}function Zr(m,y){let _=pl(m,ne,y);return Ll(_,a[0],Dt,bt)}s.valToIdx=m=>Ll(m,a[0]),s.posToIdx=Zr,s.posToVal=pl,s.valToPos=(m,y,_)=>G[y].ori==0?h(m,G[y],_?rt:Ee,_?Dn:0):f(m,G[y],_?Gt:oe,_?nn:0),s.setCursor=(m,y,_)=>{Pe=m.left,at=m.top,pa(null,y,_)};function kr(m,y){zt(Va,Xu,Fe.left=m),zt(Va,gr,Fe.width=y)}function Hr(m,y){zt(Va,dr,Fe.top=m),zt(Va,vr,Fe.height=y)}let Ci=ee.ori==0?kr:Hr,Ri=ee.ori==1?kr:Hr;function Es(){if(ae&&H.live)for(let m=c==2?1:0;m{A[x]=_}):wE(m.idx)||A.fill(m.idx),H.idx=A[0]),ae&&H.live){for(let _=0;_0||c==1&&!Nn)&&jo(_,A[_]);Es()}on=!1,y!==!1&&kt("setLegend")}s.setLegend=Ts;function jo(m,y){let _=Y[m],x=m==0&&ye==2?fn:a[m],w;Nn?w=_.values(s,m,y)??Sn:(w=_.value(s,y==null?null:x[y],m,y),w=w==null?Sn:{_:w}),H.values[m]=w}function pa(m,y,_){ji=Pe,xs=at,[Pe,at]=B.move(s,Pe,at),B.left=Pe,B.top=at,_e&&(ml&&na(ml,Pt(Pe),0,Ee,oe),zn&&na(zn,0,Pt(at),Ee,oe));let x,w=Dt>bt;nl=gt,Fl=null;let j=ee.ori==0?Ee:oe,V=ee.ori==1?Ee:oe;if(Pe<0||wt==0||w){x=B.idx=null;for(let W=0;W0&&ct.show){let hn=et==null?-10:et==x?ue:ce(c==1?a[0][et]:a[Se][0][et],ee,j,0),Ht=it==null?-10:ze(it,c==1?G[ct.scale]:G[ct.facets[1].scale],V,0);if(oa&&it!=null){let En=ee.ori==1?Pe:at,Gn=en(tl.dist(s,Se,et,Ht,En));if(Gn=0?1:-1,Yn=Yt>=0?1:-1;Yn==Tn&&(Yn==1?an==1?it>=Yt:it<=Yt:an==1?it<=Yt:it>=Yt)&&(nl=Gn,Fl=Se)}else nl=Gn,Fl=Se}}if(on||fa){let En,Gn;ee.ori==0?(En=hn,Gn=Ht):(En=Ht,Gn=hn);let an,Yt,Tn,Yn,un,sn,An=!0,Wl=ln.bbox;if(Wl!=null){An=!1;let dn=Wl(s,Se);Tn=dn.left,Yn=dn.top,an=dn.width,Yt=dn.height}else Tn=En,Yn=Gn,an=Yt=ln.size(s,Se);if(sn=ln.fill(s,Se),un=ln.stroke(s,Se),fa)Se==Fl&&nl<=tl.prox&&(re=Tn,fe=Yn,je=an,Ve=Yt,Ce=An,Ue=sn,Me=un);else{let dn=_n[Se];dn!=null&&(Vl[Se]=Tn,ha[Se]=Yn,jg(dn,an,Yt,An),Ng(dn,sn,un),na(dn,Tl(Tn),Tl(Yn),Ee,oe))}}}}if(fa){let Se=tl.prox,ct=ma==null?nl<=Se:nl>Se||Fl!=ma;if(on||ct){let St=_n[0];St!=null&&(Vl[0]=re,ha[0]=fe,jg(St,je,Ve,Ce),Ng(St,Ue,Me),na(St,Tl(re),Tl(fe),Ee,oe))}}}if(Fe.show&&Cl)if(m!=null){let[W,te]=jt.scales,[ue,re]=jt.match,[fe,je]=m.cursor.sync.scales,Ve=m.cursor.drag;if(yt=Ve._x,Ot=Ve._y,yt||Ot){let{left:Ce,top:Ue,width:Me,height:Se}=m.select,ct=m.scales[fe].ori,St=m.posToVal,Ct,et,it,hn,Ht,En=W!=null&&ue(W,fe),Gn=te!=null&&re(te,je);En&&yt?(ct==0?(Ct=Ce,et=Me):(Ct=Ue,et=Se),it=G[W],hn=ce(St(Ct,fe),it,j,0),Ht=ce(St(Ct+et,fe),it,j,0),Ci(Bl(hn,Ht),en(Ht-hn))):Ci(0,j),Gn&&Ot?(ct==1?(Ct=Ce,et=Me):(Ct=Ue,et=Se),it=G[te],hn=ze(St(Ct,je),it,V,0),Ht=ze(St(Ct+et,je),it,V,0),Ri(Bl(hn,Ht),en(Ht-hn))):Ri(0,V)}else Os()}else{let W=en(ji-bu),te=en(xs-Ya);if(ee.ori==1){let je=W;W=te,te=je}yt=$e.x&&W>=$e.dist,Ot=$e.y&&te>=$e.dist;let ue=$e.uni;ue!=null?yt&&Ot&&(yt=W>=ue,Ot=te>=ue,!yt&&!Ot&&(te>W?Ot=!0:yt=!0)):$e.x&&$e.y&&(yt||Ot)&&(yt=Ot=!0);let re,fe;yt&&(ee.ori==0?(re=Un,fe=Pe):(re=Jl,fe=at),Ci(Bl(re,fe),en(fe-re)),Ot||Ri(0,V)),Ot&&(ee.ori==1?(re=Un,fe=Pe):(re=Jl,fe=at),Ri(Bl(re,fe),en(fe-re)),yt||Ci(0,j)),!yt&&!Ot&&(Ci(0,0),Ri(0,0))}if($e._x=yt,$e._y=Ot,m==null){if(_){if(Yr!=null){let[W,te]=jt.scales;jt.values[0]=W!=null?pl(ee.ori==0?Pe:at,W):null,jt.values[1]=te!=null?pl(ee.ori==1?Pe:at,te):null}Ja(Dh,s,Pe,at,Ee,oe,x)}if(oa){let W=_&&jt.setSeries,te=tl.prox;ma==null?nl<=te&&Zn(Fl,Ka,!0,W):nl>te?Zn(null,Ka,!0,W):Fl!=ma&&Zn(Fl,Ka,!0,W)}}on&&(H.idx=x,Ts()),y!==!1&&kt("setCursor")}let Rl=null;Object.defineProperty(s,"rect",{get(){return Rl==null&&Ui(!1),Rl}});function Ui(m=!1){m?Rl=null:(Rl=C.getBoundingClientRect(),kt("syncRect",Rl))}function Lr(m,y,_,x,w,j,V){B._lock||Cl&&m!=null&&m.movementX==0&&m.movementY==0||(As(m,y,_,x,w,j,V,!1,m!=null),m!=null?pa(null,!0,!0):pa(y,!0,!1))}function As(m,y,_,x,w,j,V,W,te){if(Rl==null&&Ui(!1),el(m),m!=null)_=m.clientX-Rl.left,x=m.clientY-Rl.top;else{if(_<0||x<0){Pe=-10,at=-10;return}let[ue,re]=jt.scales,fe=y.cursor.sync,[je,Ve]=fe.values,[Ce,Ue]=fe.scales,[Me,Se]=jt.match,ct=y.axes[0].side%2==1,St=ee.ori==0?Ee:oe,Ct=ee.ori==1?Ee:oe,et=ct?j:w,it=ct?w:j,hn=ct?x:_,Ht=ct?_:x;if(Ce!=null?_=Me(ue,Ce)?p(je,G[ue],St,0):-10:_=St*(hn/et),Ue!=null?x=Se(re,Ue)?p(Ve,G[re],Ct,0):-10:x=Ct*(Ht/it),ee.ori==1){let En=_;_=x,x=En}}te&&(y==null||y.cursor.event.type==Dh)&&((_<=1||_>=Ee-1)&&(_=Wi(_,Ee)),(x<=1||x>=oe-1)&&(x=Wi(x,oe))),W?(bu=_,Ya=x,[Un,Jl]=B.move(s,_,x)):(Pe=_,at=x)}const ws={width:0,height:0,left:0,top:0};function Os(){$a(ws,!1)}let Br,qr,Qr,Gr;function Su(m,y,_,x,w,j,V){Cl=!0,yt=Ot=$e._x=$e._y=!1,As(m,y,_,x,w,j,V,!0,!1),m!=null&&(Ft(jh,Bh,Xa,!1),Ja(zg,s,Un,Jl,Ee,oe,null));let{left:W,top:te,width:ue,height:re}=Fe;Br=W,qr=te,Qr=ue,Gr=re}function Xa(m,y,_,x,w,j,V){Cl=$e._x=$e._y=!1,As(m,y,_,x,w,j,V,!1,!0);let{left:W,top:te,width:ue,height:re}=Fe,fe=ue>0||re>0,je=Br!=W||qr!=te||Qr!=ue||Gr!=re;if(fe&&je&&$a(Fe),$e.setScale&&fe&&je){let Ve=W,Ce=ue,Ue=te,Me=re;if(ee.ori==1&&(Ve=te,Ce=re,Ue=W,Me=ue),yt&&Qn(ne,pl(Ve,ne),pl(Ve+Ce,ne)),Ot)for(let Se in G){let ct=G[Se];Se!=ne&&ct.from==null&&ct.min!=gt&&Qn(Se,pl(Ue+Me,Se),pl(Ue,Se))}Os()}else B.lock&&(B._lock=!B._lock,pa(y,!0,m!=null));m!=null&&(Gl(jh,Bh),Ja(jh,s,Pe,at,Ee,oe,null))}function Co(m,y,_,x,w,j,V){if(B._lock)return;el(m);let W=Cl;if(Cl){let te=!0,ue=!0,re=10,fe,je;ee.ori==0?(fe=yt,je=Ot):(fe=Ot,je=yt),fe&&je&&(te=Pe<=re||Pe>=Ee-re,ue=at<=re||at>=oe-re),fe&&te&&(Pe=Pe{let w=jt.match[2];_=w(s,y,_),_!=-1&&Zn(_,x,!0,!1)},_e&&(Ft(zg,C,Su),Ft(Dh,C,Lr),Ft)DELIM" +R"DELIM((Eg,C,m=>{el(m),Ui(!1)}),Ft(Tg,C,Co),Ft(Ag,C,Ms),Xh.add(s),s.syncRect=Ui);const Zi=s.hooks=n.hooks||{};function kt(m,y,_){Qa?Rn.push([m,y,_]):m in Zi&&Zi[m].forEach(x=>{x.call(null,s,y,_)})}(n.plugins||[]).forEach(m=>{for(let y in m.hooks)Zi[y]=(Zi[y]||[]).concat(m.hooks[y])});const va=(m,y,_)=>_,jt=Jt({key:null,setSeries:!1,filters:{pub:kg,sub:kg},scales:[ne,Y[1]?Y[1].scale:null],match:[Hg,Hg,va],values:[null,null]},B.sync);jt.match.length==2&&jt.match.push(va),B.sync=jt;const Yr=jt.key,Ds=Ny(Yr);function Ja(m,y,_,x,w,j,V){jt.filters.pub(m,y,_,x,w,j,V)&&Ds.pub(m,y,_,x,w,j,V)}Ds.sub(s);function Vr(m,y,_,x,w,j,V){jt.filters.sub(m,y,_,x,w,j,V)&&ga[m](null,y,_,x,w,j,V)}s.pub=Vr;function ki(){Ds.unsub(s),Xh.delete(s),wl.clear(),Gh(ro,ts,Ns),g.remove(),ge?.remove(),kt("destroy")}s.destroy=ki;function ya(){kt("init",n,a),Zt(a||n.data,!1),he[ne]?vu(ne,he[ne]):cu(),ca=Fe.show&&(Fe.width>0||Fe.height>0),ra=on=!0,ka(n.width,n.height)}return Y.forEach(Nl),I.forEach(ms),u?u instanceof HTMLElement?(u.appendChild(g),ya()):u(s,ya):ya(),s}On.assign=Jt;On.fmtNum=bd;On.rangeNum=co;On.rangeLog=bo;On.rangeAsinh=vd;On.orient=uu;On.pxRatio=Ie;On.join=RE;On.fmtDate=_d,On.tzDate=VE;On.sync=Ny;{On.addGap=wT,On.clipGaps=xo;let n=On.paths={points:Zy};n.linear=Hy,n.stepped=NT,n.bars=DT,n.spline=CT}function uv({data:n,series:a,height:u=280,emptyMessage:s="Waiting for live data…",valueSuffix:c="",zeroBased:h=!0,valueFormatter:f=VT}){const p=De.useRef(null),v=De.useRef(null),g=De.useMemo(()=>YT(n),[n]),z=De.useRef(g),S=n[0]?.length>0;return De.useLayoutEffect(()=>{const E=p.current;if(!E)return;const N={width:Math.max(240,E.clientWidth),height:u,padding:[12,8,0,0],cursor:{drag:{x:!0,y:!1,setScale:!0},focus:{prox:24}},legend:{show:!0,live:!0},scales:{x:{time:!0},y:{auto:!0,...h?{range:(F,P,Y)=>[Math.min(0,P),Y===0?1:Y*1.08]}:{range:(F,P,Y)=>{const I=Y-P,G=I===0?Math.max(1,Math.abs(Y)*5e-4):I*.08;return[P-G,Y+G]}}}},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:(F,P)=>P.map(Y=>`${f(Y)}${c}`)}],series:[{},...a.map(F=>({label:F.label,stroke:F.color,fill:F.fill,width:F.width??2,points:{show:F.points??!1},value:(P,Y)=>Y===null?"—":`${f(Y)}${c}`}))]},C=new On(N,z.current,E);v.current=C;const J=new ResizeObserver(F=>{const P=F[0]?.contentRect.width;P&&P>0&&C.setSize({width:Math.round(P),height:u})});return J.observe(E),()=>{J.disconnect(),C.destroy(),v.current=null}},[u,a,f,c,h]),De.useEffect(()=>{v.current?.setData(g)},[g]),M.jsxs("div",{className:"relative min-w-0",children:[M.jsx("div",{ref:p,className:"min-w-0 overflow-hidden"}),!S&&M.jsx("div",{className:"bg-surface text-textMuted pointer-events-none absolute inset-0 z-10 flex items-center justify-center text-sm",children:s})]})}function YT(n){const a=n[0];if(a.length>=2)return n;const u=Date.now()/1e3,s=a[0]??u,c=[s-1,s],h=n.slice(1).map(f=>{const p=f[0]??null;return[p,p]});return[c,...h]}function VT(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 $T=[{label:"Header archived",color:"#c084fc"},{label:"Header organized",color:"#e879f9"},{label:"Header reorganized",color:"#fb7185"},{label:"Block archived",color:"#ffa022",fill:"#ffa02214"},{label:"Block validated",color:"#38bdf8"},{label:"Block confirmed",color:"#34d399"}],KT=[{label:"Canonical top",color:"#ffa022",fill:"#ffa02218",points:!0}],XT=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function JT(n){return XT.format(n)}const FT=[{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 WT({adminStatus:n,endpoints:a,metrics:u,native:s,range:c,onRangeChange:h}){const f=Vz(u.rateSeries,u.now,10),p=De.useMemo(()=>e3(u,c),[u,c]),v=De.useMemo(()=>t3(u,c),[u,c]),g=s.configuration,z=[n.error?`Admin: ${n.error}`:null,s.status.error?`Native: ${s.status.error}`:null,s.transport==="none"&&s.restError?`Native REST: ${s.restError}`:null,u.invalidFrames>0?`${String(u.invalidFrames)} malformed admin frame${u.invalidFrames===1?"":"s"} ignored`:null].filter(S=>S!==null);return M.jsxs("div",{className:"space-y-8",children:[z.length>0&&M.jsxs("section",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3",children:[M.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Transport notice"}),M.jsx("ul",{className:"text-textMuted mt-1 space-y-1 text-xs",children:z.map(S=>M.jsx("li",{children:S},S))})]}),M.jsxs("section",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[M.jsx(Ic,{label:"Canonical top",value:s.top===null?"—":la(s.top),detail:s.transport==="none"?"Waiting for native API":`via ${s.transport==="websocket"?"native WebSocket":"REST fallback"}`,accent:"orange"}),M.jsx(Ic,{label:"Current activity",value:f.label,detail:f.rate>0?`${Cz(f.rate)} over the last 10 seconds`:"No lifecycle events in the last 10 seconds",accent:"green"}),M.jsx(Ic,{label:"Highest confirmed",value:u.maximumHeightByEvent[6]===void 0?"—":la(u.maximumHeightByEvent[6]),detail:`${la(u.eventTotals[6]??0)} confirmations observed`,accent:"blue"}),M.jsx(Ic,{label:"Collection uptime",value:Dz(u.now-u.sessionStartedAt),detail:`${la(u.totalEvents)} events · ${la(u.totalLogs)} logs`,accent:"red"})]}),M.jsxs("section",{className:"grid gap-4 lg:grid-cols-2",children:[M.jsx(sv,{title:"Admin stream",endpoint:a.adminUrl,status:n,detail:n.lastMessageAt?`Last frame ${br(n.lastMessageAt)}`:"Waiting for the first frame"}),M.jsx(sv,{title:"Native interface",endpoint:a.nativeUrl,status:s.status,detail:s.receivedAt?`Last state ${br(s.receivedAt)} · ${s.transport}`:"Waiting for node state"})]}),M.jsxs("section",{className:"space-y-4",children:[M.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-accentSecondary text-xs font-medium tracking-[0.16em] uppercase",children:"Live telemetry"}),M.jsx("h2",{className:"mt-1 text-2xl font-semibold",children:"Node activity"})]}),M.jsx(IT,{value:c,onChange:h})]}),M.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[M.jsx(rv,{title:"Block processing throughput",subtitle:"Events per second.",children:M.jsx(uv,{data:p,series:$T,valueSuffix:"/s"})}),M.jsx(rv,{title:"Canonical chain top",subtitle:"Confirmed top reported by the native interface.",children:M.jsx(uv,{data:v,series:KT,zeroBased:!1,valueFormatter:JT,emptyMessage:"Waiting for a native top…"})})]})]}),M.jsxs("section",{className:"grid gap-4 xl:grid-cols-[1.1fr_0.9fr]",children:[M.jsxs("div",{className:"border-accent/20 bg-surface/70 rounded-xl border",children:[M.jsxs("header",{className:"border-accent/15 border-b px-5 py-4",children:[M.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Lifecycle heights"}),M.jsx("h2",{className:"mt-1 font-semibold",children:"Highest observed event values"})]}),M.jsx("div",{className:"grid gap-px bg-white/5 sm:grid-cols-2 lg:grid-cols-3",children:FT.map(({event:S,label:E})=>M.jsxs("div",{className:"bg-surface px-5 py-4",children:[M.jsx("p",{className:"text-textMuted text-xs",children:E}),M.jsx("p",{className:"text-textPrimary mt-2 font-mono text-lg tabular-nums",children:u.maximumHeightByEvent[S]===void 0?"—":la(u.maximumHeightByEvent[S])})]},S))})]}),M.jsxs("div",{className:"border-accent/20 bg-surface/70 rounded-xl border",children:[M.jsxs("header",{className:"border-accent/15 border-b px-5 py-4",children:[M.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Capabilities"}),M.jsx("h2",{className:"mt-1 font-semibold",children:"Native configuration"})]}),g?M.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 p-5 text-sm",chil)DELIM" +R"DELIM(dren:[M.jsx(Ju,{label:"Address index",enabled:g.address}),M.jsx(Ju,{label:"Compact filters",enabled:g.filter}),M.jsx(Ju,{label:"Turbo",enabled:g.turbo}),M.jsx(Ju,{label:"Witness",enabled:g.witness}),M.jsx(Ju,{label:"Retarget",enabled:g.retarget}),M.jsx(Ju,{label:"Difficulty",enabled:g.difficult}),M.jsxs("div",{className:"col-span-2 border-t border-white/5 pt-3",children:[M.jsx("span",{className:"text-textMuted",children:"Pruned below"}),M.jsx("span",{className:"text-textPrimary float-right font-mono",children:g.pruned>0?la(g.pruned):"Not pruned"})]})]}):M.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:"Waiting for native configuration."})]})]}),M.jsx("section",{children:M.jsxs("div",{className:"border-accent/20 bg-surface/70 rounded-xl border",children:[M.jsx("header",{className:"border-accent/15 border-b px-5 py-4",children:M.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Recent events"})}),u.recentEvents.length===0?M.jsx(PT,{text:"No events observed yet."}):M.jsx("ul",{className:"divide-y divide-white/5",children:u.recentEvents.slice(0,6).map(S=>M.jsxs("li",{className:"flex items-center gap-3 px-5 py-3 text-xs",children:[M.jsx("time",{className:"text-textMuted w-24 shrink-0 font-mono",children:br(S.time)}),M.jsx("span",{className:"text-textPrimary min-w-0 flex-1 truncate font-mono",children:Pu(S.event).name}),M.jsx("span",{className:"text-accent tabular-nums",children:la(S.value)})]},S.id))})]})})]})}function sv({title:n,endpoint:a,status:u,detail:s}){return M.jsxs("article",{className:"border-accent/20 bg-surface/70 min-w-0 rounded-xl border p-5",children:[M.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[M.jsxs("div",{children:[M.jsx("p",{className:"text-textMuted text-xs tracking-wide uppercase",children:n}),M.jsx("p",{className:"text-textPrimary mt-2 font-mono text-sm break-all",children:Rz(a)})]}),M.jsx(Kz,{phase:u.phase,label:u.phase})]}),M.jsxs("div",{className:"text-textMuted mt-4 flex flex-wrap justify-between gap-2 border-t border-white/5 pt-3 text-xs",children:[M.jsx("span",{children:s}),M.jsxs("span",{children:[String(u.reconnects)," reconnect",u.reconnects===1?"":"s"]})]})]})}function rv({title:n,subtitle:a,children:u}){return M.jsxs("article",{className:"border-accent/20 bg-surface/70 min-w-0 overflow-hidden rounded-xl border",children:[M.jsxs("header",{className:"border-accent/15 border-b px-5 py-4",children:[M.jsx("h3",{className:"font-semibold",children:n}),M.jsx("p",{className:"text-textMuted mt-1 text-xs leading-5",children:a})]}),M.jsx("div",{className:"min-w-0 p-3 sm:p-5",children:u})]})}function IT({value:n,onChange:a}){return M.jsx("div",{className:"border-accent/20 bg-surface/70 inline-flex rounded-lg border p-1",children:[[300,"5m"],[900,"15m"],[3600,"1h"]].map(([u,s])=>M.jsx("button",{type:"button",onClick:()=>{a(u)},className:`rounded-md px-3 py-1.5 text-xs font-medium ${n===u?"bg-accent text-background":"text-textMuted hover:text-textPrimary"}`,children:s},u))})}function Ju({label:n,enabled:a}){return M.jsxs("div",{className:"flex items-center justify-between gap-3",children:[M.jsx("span",{className:"text-textMuted",children:n}),M.jsx("span",{className:a?"text-emerald-300":"text-textMuted",children:a?"Enabled":"Disabled"})]})}function PT({text:n}){return M.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:n})}function e3(n,a){const u=n.now-a*1e3,s=n.rateSeries.filter(c=>c.time>=u);return[s.map(c=>c.time/1e3),s.map(c=>c.headerArchived),s.map(c=>c.headerOrganized),s.map(c=>c.headerReorganized),s.map(c=>c.blockArchived),s.map(c=>c.blockValidated),s.map(c=>c.blockConfirmed)]}function t3(n,a){const u=n.now-a*1e3,s=n.topSeries.filter(h=>h.time>=u),c=n.topSeries.at(-1);if(s.length===0&&c&&s.push({time:u,height:c.height}),s.length>0){const h=s.at(-1);h&&n.now-h.time>=1e3&&s.push({time:n.now,height:h.height})}return[s.map(h=>h.time/1e3),s.map(h=>h.height)]}var Or=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(){}},n3=class extends Or{#e;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const a=()=>n();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(a=>{a(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Od=new n3,l3={setTimeout:(n,a)=>setTimeout(n,a),clearTimeout:n=>clearTimeout(n),setInterval:(n,a)=>setInterval(n,a),clearInterval:n=>clearInterval(n)},a3=class{#e=l3;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,a){return this.#e.setTimeout(n,a)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,a){return this.#e.setInterval(n,a)}clearInterval(n){this.#e.clearInterval(n)}},eu=new a3;function i3(n){setTimeout(n,0)}var u3=typeof window>"u"||"Deno"in globalThis;function Fn(){}function s3(n,a){return typeof n=="function"?n(a):n}function Fh(n){return typeof n=="number"&&n>=0&&n!==1/0}function Qy(n,a){return Math.max(n+(a||0)-Date.now(),0)}function Si(n,a){return typeof n=="function"?n(a):n}function ol(n,a){return typeof n=="function"?n(a):n}function cv(n,a){const{type:u="all",exact:s,fetchStatus:c,predicate:h,queryKey:f,stale:p}=n;if(f){if(s){if(a.queryHash!==Md(f,a.options))return!1}else if(!ss(a.queryKey,f))return!1}if(u!=="all"){const v=a.isActive();if(u==="active"&&!v||u==="inactive"&&v)return!1}return!(typeof p=="boolean"&&a.isStale()!==p||c&&c!==a.state.fetchStatus||h&&!h(a))}function ov(n,a){const{exact:u,status:s,predicate:c,mutationKey:h}=n;if(h){if(!a.options.mutationKey)return!1;if(u){if(Tr(a.options.mutationKey)!==Tr(h))return!1}else if(!ss(a.options.mutationKey,h))return!1}return!(s&&a.state.status!==s||c&&!c(a))}function Md(n,a){return(a?.queryKeyHashFn||Tr)(n)}function Tr(n){return JSON.stringify(n,(a,u)=>Ih(u)?Object.keys(u).sort().reduce((s,c)=>(s[c]=u[c],s),{}):u)}function ss(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(n&&a&&typeof n=="object"&&typeof a=="object"){if(Array.isArray(n)&&Array.isArray(a)){for(let s=0;s500)return a;const s=fv(n)&&fv(a);if(!s&&!(Ih(n)&&Ih(a)))return a;const h=(s?n:Object.keys(n)).length,f=s?a:Object.keys(a),p=f.length,v=s?new Array(p):{};let g=0;for(let z=0;z{eu.setTimeout(a,n)})}function Ph(n,a,u){return typeof u.structuralSharing=="function"?u.structuralSharing(n,a):u.structuralSharing!==!1?Gy(n,a):a}function o3(n,a,u=0){const s=[...n,a];return u&&s.length>u?s.slice(1):s}function f3(n)DELIM" +R"DELIM(,a,u=0){const s=[a,...n];return u&&s.length>u?s.slice(0,-1):s}var Nd=Symbol();function Yy(n,a){return!n.queryFn&&a?.initialPromise?()=>a.initialPromise:!n.queryFn||n.queryFn===Nd?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Vy(n,a){return typeof n=="function"?n(...a):!!n}function h3(n,a,u){let s=!1,c;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(c??=a(),s||(s=!0,c.aborted?u():c.addEventListener("abort",u,{once:!0})),c)}),n}var Ar=(()=>{let n=()=>u3;return{isServer(){return n()},setIsServer(a){n=a}}})();function ed(){let n,a;const u=new Promise((c,h)=>{n=c,a=h});u.status="pending",u.catch(()=>{});function s(c){Object.assign(u,c),delete u.resolve,delete u.reject}return u.resolve=c=>{s({status:"fulfilled",value:c}),n(c)},u.reject=c=>{s({status:"rejected",reason:c}),a(c)},u}var d3=i3;function m3(){let n=[],a=0,u=p=>{p()},s=p=>{p()},c=d3;const h=p=>{a?n.push(p):c(()=>{u(p)})},f=()=>{const p=n;n=[],p.length&&c(()=>{s(()=>{p.forEach(v=>{u(v)})})})};return{batch:p=>{let v;a++;try{v=p()}finally{a--,a||f()}return v},batchCalls:p=>(...v)=>{h(()=>{p(...v)})},schedule:h,setNotifyFunction:p=>{u=p},setBatchNotifyFunction:p=>{s=p},setScheduler:p=>{c=p}}}var yn=m3(),p3=class extends Or{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const a=()=>n(!0),u=()=>n(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",u)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(u=>{u(n)}))}isOnline(){return this.#e}},fo=new p3;function g3(n){return Math.min(1e3*2**n,3e4)}function $y(n){return(n??"online")==="online"?fo.isOnline():!0}var td=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function Ky(n){let a=!1,u=0,s;const c=ed(),h=()=>c.status!=="pending",f=J=>{if(!h()){const F=new td(J);E(F),n.onCancel?.(F)}},p=()=>{a=!0},v=()=>{a=!1},g=()=>Od.isFocused()&&(n.networkMode==="always"||fo.isOnline())&&n.canRun(),z=()=>$y(n.networkMode)&&n.canRun(),S=J=>{h()||(s?.(),c.resolve(J))},E=J=>{h()||(s?.(),c.reject(J))},N=()=>new Promise(J=>{s=F=>{(h()||g())&&J(F)},n.onPause?.()}).then(()=>{s=void 0,h()||n.onContinue?.()}),C=()=>{if(h())return;let J;const F=u===0?n.initialPromise:void 0;try{J=F??n.fn()}catch(P){J=Promise.reject(P)}Promise.resolve(J).then(S).catch(P=>{if(h())return;const Y=n.retry??(Ar.isServer()?0:3),I=n.retryDelay??g3,G=typeof I=="function"?I(u,P):I,ie=Y===!0||typeof Y=="number"&&ug()?void 0:N()).then(()=>{a?E(P):C()})})};return{promise:c,status:()=>c.status,cancel:f,continue:()=>(s?.(),c),cancelRetry:p,continueRetry:v,canStart:z,start:()=>(z()?C():N().then(C),c)}}var Xy=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fh(this.gcTime)&&(this.#e=eu.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Ar.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(eu.clearTimeout(this.#e),this.#e=void 0)}};function v3(n){return{onFetch:(a,u)=>{const s=a.options,c=a.fetchOptions?.meta?.fetchMore?.direction,h=a.state.data?.pages||[],f=a.state.data?.pageParams||[];let p={pages:[],pageParams:[]},v=0;const g=async()=>{let z=!1;const S=C=>{h3(C,()=>a.signal,()=>z=!0)},E=Yy(a.options,a.fetchOptions),N=async(C,J,F)=>{if(z)return Promise.reject(a.signal.reason);if(J==null&&C.pages.length)return Promise.resolve(C);const Y=(()=>{const ne={client:a.client,queryKey:a.queryKey,pageParam:J,direction:F?"backward":"forward",meta:a.options.meta};return S(ne),ne})(),I=await E(Y),{maxPages:G}=a.options,ie=F?f3:o3;return{pages:ie(C.pages,I,G),pageParams:ie(C.pageParams,J,G)}};if(c&&h.length){const C=c==="backward",J=C?y3:dv,F={pages:h,pageParams:f},P=J(s,F);p=await N(F,P,C)}else{const C=n??h.length;do{const J=v===0?f[0]??s.initialPageParam:dv(s,p);if(v>0&&J==null)break;p=await N(p,J),v++}while(va.options.persister?.(g,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},u):a.fetchFn=g}}}function dv(n,{pages:a,pageParams:u}){const s=a.length-1;return a.length>0?n.getNextPageParam(a[s],a,u[s],u):void 0}function y3(n,{pages:a,pageParams:u}){return a.length>0?n.getPreviousPageParam?.(a[0],a,u[0],u):void 0}var b3=class extends Xy{#e;#t;#n;#l;#i;#a;#s;#u;constructor(n){super(),this.#u=!1,this.#s=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#i=n.client,this.#l=this.#i.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=pv(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.#a?.promise}setOptions(n){if(this.options={...this.#s,...n},n?._type&&(this.#e=n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=pv(this.options);a.data!==void 0&&(this.setState(mv(a.data,a.dataUpdatedAt)),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#l.remove(this)}setData(n,a){const u=Ph(this.state.data,n,this.options);return this.#c({data:u,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),u}setState(n){this.#c({type:"setState",state:n})}cancel(n){const a=this.#a?.promise;return this.#a?.cancel(n),a?a.then(Fn).catch(Fn):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=>ol(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Nd||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Si(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:!Qy(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(a=>a!==n),this.observers.length||(this.#a&&(this.#u||this.#r()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}#r(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#c({type:"invalidate"})}async fetch(n,a){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(n&&this.setOptions(n),!this.options.queryFn){const v=this.observers.find(g=>g.options.queryFn);v&&this.setOptions(v.options)}const u=new AbortController,s=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(this.#u=!0,u.signal)})},c=()=>{const v=Yy(this.options,a),z=(()=>{const S={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(S),S})();return this.#u=!1,this.options.persister?this.options.p)DELIM" +R"DELIM(ersister(v,z,this):v(z)},f=(()=>{const v={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:c};return s(v),v})();(this.#e==="infinite"?v3(this.options.pages):this.options.behavior)?.onFetch(f,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#c({type:"fetch",meta:f.fetchOptions?.meta}),this.#a=Ky({initialPromise:a?.initialPromise,fn:f.fetchFn,onCancel:v=>{v instanceof td&&v.revert&&this.setState({...this.#n,fetchStatus:"idle"}),u.abort()},onFail:(v,g)=>{this.#c({type:"failed",failureCount:v,error:g})},onPause:()=>{this.#c({type:"pause"})},onContinue:()=>{this.#c({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const v=await this.#a.start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),this.#l.config.onSuccess?.(v,this),this.#l.config.onSettled?.(v,this.state.error,this),v}catch(v){if(v instanceof td){if(v.silent)return this.#a.promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw this.#c({type:"error",error:v}),this.#l.config.onError?.(v,this),this.#l.config.onSettled?.(this.state.data,v,this),v}finally{this.scheduleGc()}}#c(n){const a=u=>{switch(n.type){case"failed":return{...u,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...u,fetchStatus:"paused"};case"continue":return{...u,fetchStatus:"fetching"};case"fetch":return{...u,...Jy(u.data,this.options),fetchMeta:n.meta??null};case"success":const s={...u,...mv(n.data,n.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?s:void 0,s;case"error":const c=n.error;return{...u,error:c,errorUpdateCount:u.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:u.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...u,isInvalidated:!0};case"setState":return{...u,...n.state}}};this.state=a(this.state),yn.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:n})})}};function Jy(n,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$y(a.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function mv(n,a){return{data:n,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pv(n){const a=typeof n.initialData=="function"?n.initialData():n.initialData,u=a!==void 0,s=u?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:u?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:u?"success":"pending",fetchStatus:"idle"}}var S3=class extends Or{constructor(n,a){super(),this.options=a,this.#e=n,this.#u=null,this.#s=ed(),this.bindMethods(),this.setOptions(a)}#e;#t=void 0;#n=void 0;#l=void 0;#i;#a;#s;#u;#r;#c;#f;#p;#d;#h;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),gv(this.#t,this.options)?this.#o():this.updateResult(),this.#m())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return nd(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return nd(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#_(),this.#t.removeObserver(this)}setOptions(n){const a=this.options,u=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ol(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),a._defaulted&&!Wh(this.options,a)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&vv(this.#t,u,this.options,a)&&this.#o(),this.updateResult(),s&&(this.#t!==u||ol(this.options.enabled,this.#t)!==ol(a.enabled,this.#t)||Si(this.options.staleTime,this.#t)!==Si(a.staleTime,this.#t))&&this.#b();const c=this.#S();s&&(this.#t!==u||ol(this.options.enabled,this.#t)!==ol(a.enabled,this.#t)||c!==this.#h)&&this.#v(c)}getOptimisticResult(n){const a=this.#e.getQueryCache().build(this.#e,n),u=this.createResult(a,n);return x3(this,u)&&(this.#l=u,this.#a=this.options,this.#i=this.#t.state),u}getCurrentResult(){return this.#l}trackResult(n,a){return new Proxy(n,{get:(u,s)=>(this.trackProp(s),a?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,s))})}trackProp(n){this.#g.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const a=this.#e.defaultQueryOptions(n),u=this.#e.getQueryCache().build(this.#e,a);return u.fetch().then(()=>this.createResult(u,a))}fetch(n){return this.#o({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#l))}#o(n){this.#x();let a=this.#t.fetch(this.options,n);return n?.throwOnError||(a=a.catch(Fn)),a}#b(){this.#y();const n=Si(this.options.staleTime,this.#t);if(Ar.isServer()||this.#l.isStale||!Fh(n))return;const u=Qy(this.#l.dataUpdatedAt,n)+1;this.#p=eu.setTimeout(()=>{this.#l.isStale||this.updateResult()},u)}#S(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(n){this.#_(),this.#h=n,!(Ar.isServer()||ol(this.options.enabled,this.#t)===!1||!Fh(this.#h)||this.#h===0)&&(this.#d=eu.setInterval(()=>{(this.options.refetchIntervalInBackground||Od.isFocused())&&this.#o()},this.#h))}#m(){this.#b(),this.#v(this.#S())}#y(){this.#p!==void 0&&(eu.clearTimeout(this.#p),this.#p=void 0)}#_(){this.#d!==void 0&&(eu.clearInterval(this.#d),this.#d=void 0)}createResult(n,a){const u=this.#t,s=this.options,c=this.#l,h=this.#i,f=this.#a,v=n!==u?n.state:this.#n,{state:g}=n;let z={...g},S=!1,E;if(a._optimisticResults){const se=this.hasListeners(),we=!se&&gv(n,a),xe=se&&vv(n,u,a,s);(we||xe)&&(z={...z,...Jy(g.data,n.options)}),a._optimisticResults==="isRestoring"&&(z.fetchStatus="idle")}let{error:N,errorUpdatedAt:C,status:J}=z;E=z.data;let F=!1;if(a.placeholderData!==void 0&&E===void 0&&J==="pending"){let se;c?.isPlaceholderData&&a.placeholderData===f?.placeholderData?(se=c.data,F=!0):se=typeof a.placeholderData=="function"?a.placeholderData(this.#f?.state.data,this.#f):a.placeholderData,se!==void 0&&(J="success",E=Ph(c?.data,se,a),S=!0)}if(a.select&&E!==void 0&&!F)if(c&&E===h?.data&&a.select===this.#r)E=this.#c;else try{this.#r=a.select,E=a.select(E),E=Ph(c?.data,E,a),this.#c=E,this.#u=null}catch(se){this.#u=se}this.#u&&(N=this.#u,E=this.#c,C=Date.now(),J="error");const P=z.fetchStatus==="fetching",Y=J==="pending",I=J==="error",G=Y&&P,ie=E!==void 0,le={status:J,fetchStatus:z.fetchStatus,isPending:Y,isSuccess:J==="success",isError:I,isInitialLoading:G,isLoading:G,data:E,dataUpdatedAt:z.dataUpdatedAt,error:N,errorUpdatedAt:C,failureCount:z.fetchFailureCount,failureReason:z.fetchFailureReason,errorUpdateCount:z.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:z.dataUpdateCount>v.dataUpdateCount||z.errorUpdateCount>v.errorUpdateCount,isFetching:P,isRefetching:P&&!Y,isLoadingError:I&&!ie,isPaused:z.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:I&&ie,isStale:Dd(n,a),refetch:this.refetch,promise:this.#s,isEnabled:ol(a.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const se=le.data!==void 0,we=le.status==="error"&&!se,xe=ce=>{we?ce.reject(le.error):se&&ce.resolve(l)DELIM" +R"DELIM(e.data)},ee=()=>{const ce=this.#s=le.promise=ed();xe(ce)},ye=this.#s;switch(ye.status){case"pending":n.queryHash===u.queryHash&&xe(ye);break;case"fulfilled":(we||le.data!==ye.value)&&ee();break;case"rejected":(!we||le.error!==ye.reason)&&ee();break}}return le}updateResult(){const n=this.#l,a=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#f=this.#t),Wh(a,n))return;this.#l=a;const u=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,c=typeof s=="function"?s():s;if(c==="all"||!c&&!this.#g.size)return!0;const h=new Set(c??this.#g);return this.options.throwOnError&&h.add("error"),Object.keys(this.#l).some(f=>{const p=f;return this.#l[p]!==n[p]&&h.has(p)})};this.#T({listeners:u()})}#x(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const a=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(a?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#m()}#T(n){yn.batch(()=>{n.listeners&&this.listeners.forEach(a=>{a(this.#l)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function _3(n,a){return ol(a.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&ol(a.retryOnMount,n)===!1)}function gv(n,a){return _3(n,a)||n.state.data!==void 0&&nd(n,a,a.refetchOnMount)}function nd(n,a,u){if(ol(a.enabled,n)!==!1&&Si(a.staleTime,n)!=="static"){const s=typeof u=="function"?u(n):u;return s==="always"||s!==!1&&Dd(n,a)}return!1}function vv(n,a,u,s){return(n!==a||ol(s.enabled,n)===!1)&&(!u.suspense||n.state.status!=="error")&&Dd(n,u)}function Dd(n,a){return ol(a.enabled,n)!==!1&&n.isStaleByTime(Si(a.staleTime,n))}function x3(n,a){return!Wh(n.getCurrentResult(),a)}var z3=class extends Xy{#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||E3(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(a=>a!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(n){const a=()=>{this.#i({type:"continue"})},u={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=Ky({fn:()=>this.options.mutationFn?this.options.mutationFn(n,u):Promise.reject(new Error("No mutationFn found")),onFail:(h,f)=>{this.#i({type:"failed",failureCount:h,error:f})},onPause:()=>{this.#i({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",c=!this.#l.canStart();try{if(s)a();else{this.#i({type:"pending",variables:n,isPaused:c}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,u);const f=await this.options.onMutate?.(n,u);f!==this.state.context&&this.#i({type:"pending",context:f,variables:n,isPaused:c})}const h=await this.#l.start();return await this.#n.config.onSuccess?.(h,n,this.state.context,this,u),await this.options.onSuccess?.(h,n,this.state.context,u),await this.#n.config.onSettled?.(h,null,this.state.variables,this.state.context,this,u),await this.options.onSettled?.(h,null,n,this.state.context,u),this.#i({type:"success",data:h}),h}catch(h){try{await this.#n.config.onError?.(h,n,this.state.context,this,u)}catch(f){Promise.reject(f)}try{await this.options.onError?.(h,n,this.state.context,u)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,h,this.state.variables,this.state.context,this,u)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,h,n,this.state.context,u)}catch(f){Promise.reject(f)}throw this.#i({type:"error",error:h}),h}finally{this.#n.runNext(this)}}#i(n){const a=u=>{switch(n.type){case"failed":return{...u,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...u,isPaused:!0};case"continue":return{...u,isPaused:!1};case"pending":return{...u,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...u,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...u,data:void 0,error:n.error,failureCount:u.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=a(this.state),yn.batch(()=>{this.#t.forEach(u=>{u.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function E3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var T3=class extends Or{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(n,a,u){const s=new z3({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(a),state:u});return this.add(s),s}add(n){this.#e.add(n);const a=no(n);if(typeof a=="string"){const u=this.#t.get(a);u?u.push(n):this.#t.set(a,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const a=no(n);if(typeof a=="string"){const u=this.#t.get(a);if(u)if(u.length>1){const s=u.indexOf(n);s!==-1&&u.splice(s,1)}else u[0]===n&&this.#t.delete(a)}}this.notify({type:"removed",mutation:n})}canRun(n){const a=no(n);if(typeof a=="string"){const s=this.#t.get(a)?.find(c=>c.state.status==="pending");return!s||s===n}else return!0}runNext(n){const a=no(n);return typeof a=="string"?this.#t.get(a)?.find(s=>s!==n&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yn.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(n){const a={exact:!0,...n};return this.getAll().find(u=>ov(a,u))}findAll(n={}){return this.getAll().filter(a=>ov(n,a))}notify(n){yn.batch(()=>{this.listeners.forEach(a=>{a(n)})})}resumePausedMutations(){const n=this.getAll().filter(a=>a.state.isPaused);return yn.batch(()=>Promise.all(n.map(a=>a.continue().catch(Fn))))}};function no(n){return n.options.scope?.id}var A3=class extends Or{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,a,u){const s=a.queryKey,c=a.queryHash??Md(s,a);let h=this.get(c);return h||(h=new b3({client:n,queryKey:s,queryHash:c,options:n.defaultQueryOptions(a),state:u,defaultOptions:n.getQueryDefaults(s)}),this.add(h)),h}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const a=this.#e.get(n.queryHash);a&&(n.destroy(),a===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){yn.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const a={exact:!0,...n};return this.getAll().find(u=>cv(a,u))}findAll(n={}){const a=this.getAll();return Object.keys(n).length>0?a.filter(u=>cv(n,u)):a}notify(n){yn.batch(()=>{this.listeners.forEach(a=>{a(n)})})}onFocus(){yn.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){yn.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},w3=class{#e;#t;#n;#l;#i;#a;#s;#u;constructor(n={}){this.#e=n.queryCache||new A3,this.#t=n.mutationCache||new T3,this.#n=n.defaultOptions||{},this.#l=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=Od.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#u=fo.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,thi)DELIM" +R"DELIM(s.#a===0&&(this.#s?.(),this.#s=void 0,this.#u?.(),this.#u=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const a=this.defaultQueryOptions({queryKey:n});return this.#e.get(a.queryHash)?.state.data}ensureQueryData(n){const a=this.defaultQueryOptions(n),u=this.#e.build(this,a),s=u.state.data;return s===void 0?this.fetchQuery(n):(n.revalidateIfStale&&u.isStaleByTime(Si(a.staleTime,u))&&this.prefetchQuery(a),Promise.resolve(s))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:a,state:u})=>{const s=u.data;return[a,s]})}setQueryData(n,a,u){const s=this.defaultQueryOptions({queryKey:n}),h=this.#e.get(s.queryHash)?.state.data,f=s3(a,h);if(f!==void 0)return this.#e.build(this,s).setData(f,{...u,manual:!0})}setQueriesData(n,a,u){return yn.batch(()=>this.#e.findAll(n).map(({queryKey:s})=>[s,this.setQueryData(s,a,u)]))}getQueryState(n){const a=this.defaultQueryOptions({queryKey:n});return this.#e.get(a.queryHash)?.state}removeQueries(n){const a=this.#e;yn.batch(()=>{a.findAll(n).forEach(u=>{a.remove(u)})})}resetQueries(n,a){const u=this.#e;return yn.batch(()=>(u.findAll(n).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...n},a)))}cancelQueries(n,a={}){const u={revert:!0,...a},s=yn.batch(()=>this.#e.findAll(n).map(c=>c.cancel(u)));return Promise.all(s).then(Fn).catch(Fn)}invalidateQueries(n,a={}){return yn.batch(()=>(this.#e.findAll(n).forEach(u=>{u.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},a)))}refetchQueries(n,a={}){const u={...a,cancelRefetch:a.cancelRefetch??!0},s=yn.batch(()=>this.#e.findAll(n).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let h=c.fetch(void 0,u);return u.throwOnError||(h=h.catch(Fn)),c.state.fetchStatus==="paused"?Promise.resolve():h}));return Promise.all(s).then(Fn)}fetchQuery(n){const a=this.defaultQueryOptions(n);a.retry===void 0&&(a.retry=!1);const u=this.#e.build(this,a);return u.isStaleByTime(Si(a.staleTime,u))?u.fetch(a):Promise.resolve(u.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Fn).catch(Fn)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Fn).catch(Fn)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return fo.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,a){this.#l.set(Tr(n),{queryKey:n,defaultOptions:a})}getQueryDefaults(n){const a=[...this.#l.values()],u={};return a.forEach(s=>{ss(n,s.queryKey)&&Object.assign(u,s.defaultOptions)}),u}setMutationDefaults(n,a){this.#i.set(Tr(n),{mutationKey:n,defaultOptions:a})}getMutationDefaults(n){const a=[...this.#i.values()],u={};return a.forEach(s=>{ss(n,s.mutationKey)&&Object.assign(u,s.defaultOptions)}),u}defaultQueryOptions(n){if(n._defaulted)return n;const a={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return a.queryHash||(a.queryHash=Md(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Nd&&(a.enabled=!1),a}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Fy=De.createContext(void 0),O3=n=>{const a=De.useContext(Fy);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},M3=({client:n,children:a})=>(De.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),M.jsx(Fy.Provider,{value:n,children:a})),Wy=De.createContext(!1),N3=()=>De.useContext(Wy);Wy.Provider;function D3(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var j3=De.createContext(D3()),C3=()=>De.useContext(j3),R3=(n,a,u)=>{const s=u?.state.error&&typeof n.throwOnError=="function"?Vy(n.throwOnError,[u.state.error,u]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||s)&&(a.isReset()||(n.retryOnMount=!1))},U3=n=>{De.useEffect(()=>{n.clearReset()},[n])},Z3=({result:n,errorResetBoundary:a,throwOnError:u,query:s,suspense:c})=>n.isError&&!a.isReset()&&!n.isFetching&&s&&(c&&n.data===void 0||Vy(u,[n.error,s])),k3=n=>{if(n.suspense){const u=c=>c==="static"?c:Math.max(c??1e3,1e3),s=n.staleTime;n.staleTime=typeof s=="function"?(...c)=>u(s(...c)):u(s),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},H3=(n,a)=>n.isLoading&&n.isFetching&&!a,L3=(n,a)=>n?.suspense&&a.isPending,yv=(n,a,u)=>a.fetchOptimistic(n).catch(()=>{u.clearReset()});function B3(n,a,u){const s=N3(),c=C3(),h=O3(),f=h.defaultQueryOptions(n);h.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const p=h.getQueryCache().get(f.queryHash),v=n.subscribed!==!1;f._optimisticResults=s?"isRestoring":v?"optimistic":void 0,k3(f),R3(f,c,p),U3(c);const g=!h.getQueryCache().get(f.queryHash),[z]=De.useState(()=>new a(h,f)),S=z.getOptimisticResult(f),E=!s&&v;if(De.useSyncExternalStore(De.useCallback(N=>{const C=E?z.subscribe(yn.batchCalls(N)):Fn;return z.updateResult(),C},[z,E]),()=>z.getCurrentResult(),()=>z.getCurrentResult()),De.useEffect(()=>{z.setOptions(f)},[f,z]),L3(f,S))throw yv(f,z,c);if(Z3({result:S,errorResetBoundary:c,throwOnError:f.throwOnError,query:p,suspense:f.suspense}))throw S.error;return h.getDefaultOptions().queries?._experimental_afterQuery?.(f,S),f.experimental_prefetchInRender&&!Ar.isServer()&&H3(S,s)&&(g?yv(f,z,c):p?.promise)?.catch(Fn).finally(()=>{z.updateResult()}),f.notifyOnChangeProps?S:z.trackResult(S)}function q3(n,a){return B3(n,S3)}const bv={phase:"idle",attempt:0,reconnects:0,connectedAt:null,lastMessageAt:null,error:null};class Iy{#e;#t=bv;#n=null;#l=new Set;#i=null;#a=null;#s=null;#u;#r=!1;constructor(a){this.#e={...a,connectTimeoutMs:a.connectTimeoutMs??5e3,retryMinimumMs:a.retryMinimumMs??1e3,retryMaximumMs:a.retryMaximumMs??3e4,heartbeatMs:a.heartbeatMs??24e4,jitterRatio:a.jitterRatio??.2,now:a.now??Date.now,random:a.random??Math.random,webSocketFactory:a.webSocketFactory??(u=>new WebSocket(u))},this.#u=this.#e.retryMinimumMs}getStatus=()=>this.#t;subscribeStatus=a=>(this.#l.add(a),()=>{this.#l.delete(a)});start(){this.#r||(this.#r=!0,this.#u=this.#e.retryMinimumMs,this.#c())}stop(){this.#r=!1,this.#g();const a=this.#n;if(this.#n=null,a)try{a.readyState===1&&this.#e.onBeforeStop?.(a),a.close()}catch{}this.#o(bv)}send(a){if(this.#n?.readyState!==1)return!1;try{return this.#n.send(a),!0}catch{return!1}}#c(){if(!this.#r||this.#n)return;const a=this.#t.reconnects>0;this.#o({...this.#t,phase:a?"reconnecting":"connecting",attempt:this.#t.attempt+1,error:null});let u;try{u=this.#e.webSocketFactory(this.#e.url),this.#n=u}catch(s){this.#o({...this.#t,error:G3(s)}),this.#f();return}this.#i=setTimeout(()=>{if(this.#n===u){this.#o({...this.#t,error:"Connection timed out"});try{u.close()}catch{this.#n=null,this.#f()}}},this.#e.connectTimeoutMs),u.addEventListener("open",()=>{this.#n!==u||!this.#r||(this.#d(),this.#u=this.#e.retryMinimumMs,this.#o({...this.#t,phase:"connected",connectedAt:this.#e.now(),error:null}),this.#e.onOpen?.(u),this.#p(u))}),u.addEventListener("message",s=>{if(this.#n!==u||!this.#r)return;const c=Q3(s.data);if(c===null)return;const h=this.#e.now();(this.#t.lastMessageAt===null||h-this.#t.lastMessageAt>=1e3)&&this.#o({...this.#t,lastMessageAt:h}),this.#e.onMessage(c)}),u.addEventListener("error",()=>{if(!(this.#n!==u||!this.#r)){this.#o({...this.#t,error:"WebSocket connection failed"});try{u.close()}catch{this.#n=null,this.#f()}}}),u.addEventListener("close",()=>{this.#n===u&&(this.#n=null,this.#d(),this.#h(),this.#r&&this.#f())})}#f(){if(!this.#r||this.#a)return;const a=1+(this.#e.rand)DELIM" +R"DELIM(om()*2-1)*this.#e.jitterRatio,u=Math.max(0,Math.round(this.#u*a));this.#u=Math.min(this.#u*2,this.#e.retryMaximumMs),this.#o({...this.#t,phase:"reconnecting",reconnects:this.#t.reconnects+1,connectedAt:null}),this.#a=setTimeout(()=>{this.#a=null,this.#c()},u)}#p(a){this.#h(),!(!this.#e.onHeartbeat||this.#e.heartbeatMs<=0)&&(this.#s=setInterval(()=>{this.#n===a&&a.readyState===1&&this.#e.onHeartbeat?.(a)},this.#e.heartbeatMs))}#d(){this.#i&&(clearTimeout(this.#i),this.#i=null)}#h(){this.#s&&(clearInterval(this.#s),this.#s=null)}#g(){this.#d(),this.#h(),this.#a&&(clearTimeout(this.#a),this.#a=null)}#o(a){this.#t=a;for(const u of this.#l)u()}}function Q3(n){return typeof n=="string"?n:n instanceof ArrayBuffer?new TextDecoder().decode(n):null}function G3(n){return n instanceof Error?n.message:"Unable to create WebSocket"}class Y3{#e;#t;#n=new Set;#l=new Set;#i;constructor(a,u={}){this.#e=u.logFilter??zz,this.#t=u.eventFilter??Ez,this.#i=new Iy({url:Ev(a),webSocketFactory:u.webSocketFactory,retryMinimumMs:u.retryMinimumMs,retryMaximumMs:u.retryMaximumMs,jitterRatio:u.jitterRatio,onOpen:s=>{this.#a(s)},onHeartbeat:s=>{this.#a(s)},onBeforeStop:s=>{s.send("/v1/log/subscribe?filter=0"),s.send("/v1/event/subscribe?filter=0")},onMessage:s=>{const c=Oz(s);if(!c){for(const h of this.#l)h(s);return}for(const h of this.#n)h(c)}})}getStatus=()=>this.#i.getStatus();subscribeStatus=a=>this.#i.subscribeStatus(a);start(){this.#i.start()}stop(){this.#i.stop()}subscribeFrames(a){return this.#n.add(a),()=>{this.#n.delete(a)}}subscribeInvalidFrames(a){return this.#l.add(a),()=>{this.#l.delete(a)}}setFilters(a,u){this.#e=a,this.#t=u,this.#i.send(`/v1/log/subscribe?filter=${String(a)}`),this.#i.send(`/v1/event/subscribe?filter=${String(u)}`)}#a(a){a.send(`/v1/log/subscribe?filter=${String(this.#e)}`),a.send(`/v1/event/subscribe?filter=${String(this.#t)}`)}}const Py=vo({address:Ku(),filter:Ku(),turbo:Ku(),witness:Ku(),retarget:Ku(),difficult:Ku(),pruned:bi().int().nonnegative()}),eb=bi().int().nonnegative();function V3(n){try{const a=JSON.parse(n),u=Py.safeParse(a);if(u.success)return{type:"configuration",payload:u.data};const s=eb.safeParse(a);return s.success?{type:"top",payload:s.data}:null}catch{return null}}function Sv(n,a){return new URL(a,`${n.replace(/\/+$/u,"")}/`).toString()}async function _v(n,a){const u=await fetch(n,{headers:{Accept:"application/json"},signal:a});if(!u.ok)throw new Error(`Native API request failed with status ${String(u.status)}`);return await u.json()}async function $3(n,a){const[u,s]=await Promise.all([_v(Sv(n,"/v1/configuration?format=json"),a),_v(Sv(n,"/v1/top?format=json"),a)]),c=Py.parse(u),h=eb.parse(s);return{configuration:c,top:h,receivedAt:Date.now()}}const K3=15e3,X3={configuration:null,top:null,receivedAt:null,invalidFrames:0};class J3{#e=X3;#t=new Set;#n;#l;constructor(a,u={}){this.#l=u.now??Date.now,this.#n=new Iy({url:Ev(a),webSocketFactory:u.webSocketFactory,retryMinimumMs:u.retryMinimumMs,retryMaximumMs:u.retryMaximumMs,jitterRatio:u.jitterRatio,heartbeatMs:u.topPollIntervalMs??K3,now:this.#l,onOpen:s=>{s.send("/v1/configuration?format=json"),s.send("/v1/top/subscribe?format=json")},onHeartbeat:s=>{s.send("/v1/top?format=json")},onBeforeStop:s=>{s.send("/v1/top/subscribe?format=json&stop=true")},onMessage:s=>{const c=V3(s);if(!c){this.#a({...this.#e,invalidFrames:this.#e.invalidFrames+1});return}this.#i(c)}})}getStatus=()=>this.#n.getStatus();subscribeStatus=a=>this.#n.subscribeStatus(a);getState=()=>this.#e;subscribeState=a=>(this.#t.add(a),()=>{this.#t.delete(a)});start(){this.#n.start()}stop(){this.#n.stop()}#i(a){const u=this.#l();this.#a(a.type==="top"?{...this.#e,top:a.payload,receivedAt:u}:{...this.#e,configuration:a.payload,receivedAt:u})}#a(a){this.#e=a;for(const u of this.#t)u()}}function F3(n,a){const u=De.useMemo(()=>new Y3(n),[n]),s=De.useSyncExternalStore(u.subscribeStatus,u.getStatus,u.getStatus);return De.useEffect(()=>{const c=u.subscribeFrames(f=>{a.ingest(f)}),h=u.subscribeInvalidFrames(()=>{a.recordInvalidFrame()});return u.start(),()=>{c(),h(),u.stop()}},[u,a]),s}function W3(n,a){const u=De.useMemo(()=>new J3(n),[n]),s=De.useMemo(()=>C1(n),[n]),c=De.useSyncExternalStore(u.subscribeStatus,u.getStatus,u.getStatus),h=De.useSyncExternalStore(u.subscribeState,u.getState,u.getState);De.useEffect(()=>(u.start(),()=>{u.stop()}),[u]);const f=q3({queryKey:["native-snapshot",n],queryFn:({signal:S})=>$3(n,S),enabled:s&&c.phase!=="connected",refetchInterval:15e3,retry:!1}),p=h.top??f.data?.top??null,v=h.configuration??f.data?.configuration??null,g=h.receivedAt??f.data?.receivedAt??null,z=c.phase==="connected"&&(h.top!==null||h.configuration!==null)?"websocket":f.isSuccess?"rest":"none";return De.useEffect(()=>{p!==null&&a.recordNativeTop(p,g??Date.now())},[a,g,p]),{status:c,live:h,top:p,configuration:v,receivedAt:g,transport:z,restError:f.error instanceof Error?f.error.message:null}}const I3=[{id:"overview",label:"Overview"},{id:"logs",label:"Logs"},{id:"events",label:"Events"}];function P3(){const n=De.useMemo(()=>new Gz,[]),[a,u]=De.useState(R1),[s,c]=De.useState("overview"),[h,f]=De.useState(900),[p,v]=De.useState(!1),g=De.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),z=F3(a.adminUrl,n),S=W3(a.nativeUrl,n);De.useEffect(()=>(n.start(),()=>{n.stop()}),[n]);function E(C){U1(C),n.reset(),u(C),v(!1)}function N(){Z1();const C=Tv();n.reset(),u(C),v(!1)}return M.jsxs("div",{className:"bg-background text-textPrimary min-h-screen",children:[M.jsx("header",{className:"border-accent/25 bg-surface/95 sticky top-0 z-40 border-b backdrop-blur",children:M.jsx("div",{className:"mx-auto max-w-[96rem] px-4 sm:px-6",children:M.jsxs("div",{className:"flex min-h-16 flex-wrap items-center gap-x-6 gap-y-2 py-3",children:[M.jsxs("button",{type:"button",onClick:()=>{c("overview")},className:"mr-auto text-left",children:[M.jsx("p",{className:"text-accentSecondary text-[10px] font-medium tracking-[0.2em] uppercase",children:"Libbitcoin Server"}),M.jsx("h1",{className:"text-accent text-lg font-semibold tracking-tight",children:"Admin Dashboard"})]}),M.jsx("nav",{className:"order-3 flex w-full items-center gap-1 sm:order-none sm:w-auto",children:I3.map(C=>M.jsxs("button",{type:"button",onClick:()=>{c(C.id)},className:`rounded-lg px-3 py-2 text-sm transition ${s===C.id?"bg-accent/15 text-accent":"text-textMuted hover:text-textPrimary hover:bg-white/5"}`,children:[C.label,C.id==="logs"&&g.totalLogs>0&&M.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:g.totalLogs>999?"999+":String(g.totalLogs)}),C.id==="events"&&g.totalEvents>0&&M.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:g.totalEvents>999?"999+":String(g.totalEvents)})]},C.id))}),M.jsxs("div",{className:"flex items-center gap-3",children:[M.jsxs("div",{className:"hidden items-center gap-2 lg:flex","aria-label":"Connection summary",children:[M.jsx(xv,{connected:z.phase==="connected",label:"Admin"}),M.jsx(xv,{connected:S.transport!=="none",label:"Native"})]}),M.jsx("button",{type:"button",onClick:()=>{v(!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"})]})]})})}),M.jsxs("main",{className:"mx-auto max-w-[96rem] min-w-0 px-4 py-8 sm:px-6",children:[s==="overview"&&M.jsx(WT,{adminStatus:z,endpoints:a,metrics:g,native:S,range:h,onRangeChange:f}),s==="logs"&&M.jsx(Hz,{logs:g.recentLogs,onClear:()=>{n.clearLogs()}}),s==="events"&&M.jsx(kz,{events:g.recentEvents,onClear:()=>{n.clearEvents()}})]}),p&&M.jsx(k1,{configuration:a,onClose:()=>{v(!1)},onReset:N,onSave:E},`${a.adminUrl}|${a.nativeUrl}`)]})}function xv({connected:n,label:a}){return M.jsxs("span",{className:"text-textMuted inline-flex items-center gap-1.5 text-xs",children:[M.jsx("span",{className:`h-2 w-2 rounded-full ${n?"bg-emerald-400":"bg-amber-400"}`,"aria-hidden":"true"}),a]})}function eA)DELIM" +R"DELIM(({children:n}){const[a]=De.useState(()=>new w3({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}));return M.jsxs(M3,{client:a,children:[n,null]})}const tb=document.querySelector("#root");if(!tb)throw new Error("Root element not found");D1.createRoot(tb).render(M.jsx(z1.StrictMode,{children:M.jsx(eA,{children:M.jsx(P3,{})})})); +)DELIM" + +) } // namespace server } // namespace libbitcoin diff --git a/console/embedded/admin_html.cpp b/console/embedded/admin_html.cpp index 51cfff7c..13fff6db 100644 --- a/console/embedded/admin_html.cpp +++ b/console/embedded/admin_html.cpp @@ -23,31 +23,28 @@ namespace server { // Simple test html for embedded page, links in css and page icon. DEFINE_EMBEDDED_PAGE(admin_pages, char, html, -R"( - - Libbitcoin Server - - - - - - -

Admin Console

-
- - -
-
-
-

-    
- -
disconnected
- -)") +R"DELIM( + + + + + + + + Libbitcoin Server Admin + + + + +
+ + +)DELIM" + +) } // namespace server } // namespace libbitcoin