staffa 0.23.0 → 0.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/autocomplete.js +7 -2
- package/dist/components/field.js +3 -0
- package/dist/components/main.d.ts +9 -0
- package/dist/components/main.js +50 -2
- package/dist/components/textarea.js +30 -13
- package/dist/staffa.esm.js +1 -1
- package/package.json +2 -1
- package/skill/MainOptions.md +11 -0
- package/src/components/autocomplete.ts +8 -2
- package/src/components/field.ts +3 -0
- package/src/components/main.ts +56 -2
- package/src/components/textarea.ts +30 -13
|
@@ -306,11 +306,11 @@ export function autocomplete(opts) {
|
|
|
306
306
|
if (e.key === "ArrowDown") {
|
|
307
307
|
e.preventDefault();
|
|
308
308
|
$st.open = true;
|
|
309
|
-
|
|
309
|
+
moveTo(Math.min(max, $st.active + 1));
|
|
310
310
|
}
|
|
311
311
|
else if (e.key === "ArrowUp") {
|
|
312
312
|
e.preventDefault();
|
|
313
|
-
|
|
313
|
+
moveTo(Math.max(0, $st.active - 1));
|
|
314
314
|
}
|
|
315
315
|
else if (e.key === "Enter") {
|
|
316
316
|
// Always prevent default to avoid accidental form submission.
|
|
@@ -347,6 +347,11 @@ export function autocomplete(opts) {
|
|
|
347
347
|
remove(sel[sel.length - 1]);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
+
/** Highlight row `i`, scrolling the list to keep it in view. */
|
|
351
|
+
function moveTo(i) {
|
|
352
|
+
$st.active = i;
|
|
353
|
+
document.getElementById(`${menuId}-opt-${i}`)?.scrollIntoView({ block: "nearest" });
|
|
354
|
+
}
|
|
350
355
|
function onBlur() {
|
|
351
356
|
$st.open = false;
|
|
352
357
|
if (opts.multi) {
|
package/dist/components/field.js
CHANGED
|
@@ -33,6 +33,9 @@ A.insertGlobalCss({
|
|
|
33
33
|
// On a textarea the insets ride the bottom edge, so a growing box keeps its
|
|
34
34
|
// send button where the caret is rather than floating it mid-paragraph.
|
|
35
35
|
"&.s-inset-bottom > .s-inset_start, &.s-inset-bottom > .s-inset_end": "top:auto padding-bottom:0.35em",
|
|
36
|
+
// A column rather than a grid, so the textarea flexes within the box as it
|
|
37
|
+
// would directly in the field.
|
|
38
|
+
"&.s-inset-bottom:has(> .s-inset_start), &.s-inset-bottom:has(> .s-inset_end)": "display:flex flex-direction:column",
|
|
36
39
|
"> .s-inset_start > svg, > .s-inset_end > svg": "width:1.15em height:1.15em",
|
|
37
40
|
// A number input's spinner wants the very corner a trailing inset is in, and
|
|
38
41
|
// it is the inset that was asked for. (Firefox's is `appearance`-controlled.)
|
|
@@ -270,6 +270,15 @@ export interface MainOptions<R = Routes> {
|
|
|
270
270
|
* Live, like {@link MainOptions.maxWidth}.
|
|
271
271
|
*/
|
|
272
272
|
navWidth?: number;
|
|
273
|
+
/**
|
|
274
|
+
* Lets the user resize the nav sidebar by dragging the hairline between it
|
|
275
|
+
* and the content area, or with the arrow keys once it has focus. Defaults
|
|
276
|
+
* to `false`.
|
|
277
|
+
*
|
|
278
|
+
* A dragged width stands until {@link MainOptions.navWidth} changes, and
|
|
279
|
+
* stays between 120 px and half the shell.
|
|
280
|
+
*/
|
|
281
|
+
navResizable?: boolean;
|
|
273
282
|
/** Aberdeen attr/style string applied to the sidebar nav panel. */
|
|
274
283
|
navAttrs?: Attributes;
|
|
275
284
|
/** Aberdeen attr/style string applied to the narrow-screen full-page nav. */
|
package/dist/components/main.js
CHANGED
|
@@ -10,6 +10,8 @@ import { isDialogOpen } from "./dialog.js";
|
|
|
10
10
|
import { PAGE_MS, PanelStackController, SMALL_MAX_PX } from "./panels.js";
|
|
11
11
|
/** The default nav column, hairline included — see {@link MainOptions.navWidth}. */
|
|
12
12
|
const NAV_W = 200;
|
|
13
|
+
/** The narrowest a user can drag the nav column — see {@link MainOptions.navResizable}. */
|
|
14
|
+
const NAV_MIN_W = 120;
|
|
13
15
|
A.insertGlobalCss({
|
|
14
16
|
".s-main": {
|
|
15
17
|
// container-type so @container queries below can respond to shell width.
|
|
@@ -61,6 +63,12 @@ A.insertGlobalCss({
|
|
|
61
63
|
// A vertical hairline between sidebar and content, fading out at both ends —
|
|
62
64
|
// the vertical sibling of the menu's `hr.s-menu-sep`.
|
|
63
65
|
".s-nav-sep": "width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);",
|
|
66
|
+
// A resizable one is a handle, its hit area widened beyond the hairline.
|
|
67
|
+
".s-nav-sep[role=separator]": {
|
|
68
|
+
"&": "cursor:col-resize position:relative z-index:1 touch-action:none",
|
|
69
|
+
"&::before": "content:'' position:absolute inset: -0.6rem -4px;",
|
|
70
|
+
"&:hover, &:active, &:focus-visible": "background:$s-accent",
|
|
71
|
+
},
|
|
64
72
|
// min-height/min-width:0 override flex's `auto`, so <main> can shrink to its
|
|
65
73
|
// container instead of letting wide content push the body — and any sidebar
|
|
66
74
|
// — past the viewport edge. The transition is dormant except for the
|
|
@@ -138,6 +146,9 @@ export function main(opts = {}) {
|
|
|
138
146
|
// Whether the narrow-screen full-page nav is showing. Per shell, so nested or
|
|
139
147
|
// sibling `main()`s can't fight over it.
|
|
140
148
|
const $nav = A.proxy({ open: false });
|
|
149
|
+
// The sidebar column's width: `navWidth`, until the user drags it elsewhere.
|
|
150
|
+
const $navW = A.proxy({ px: NAV_W });
|
|
151
|
+
A(() => { $navW.px = opts.navWidth ?? NAV_W; });
|
|
141
152
|
// Whether the shell is narrow, at the same NARROW_PX the `@container` queries
|
|
142
153
|
// above use. One boolean for everything that must agree on the regime — the
|
|
143
154
|
// bar's layout, what the ☰ does, where a panel's chrome goes — so they can't
|
|
@@ -184,7 +195,7 @@ export function main(opts = {}) {
|
|
|
184
195
|
if (nav == null || !nav.items.length)
|
|
185
196
|
A("--s-nav-w: 0px");
|
|
186
197
|
else
|
|
187
|
-
A(`.s-nav-${navPos}`, `--s-nav-w: ${
|
|
198
|
+
A(`.s-nav-${navPos}`, `--s-nav-w: ${$navW.px}px`);
|
|
188
199
|
});
|
|
189
200
|
// Top bar: `[leading] [identity] …spacer… [trailing]`, each slot's contents
|
|
190
201
|
// depending on the room available and on what the current panel declared.
|
|
@@ -272,7 +283,10 @@ export function main(opts = {}) {
|
|
|
272
283
|
A(`nav.s-nav-panel.s-nav-${navPos}`, opts.navAttrs, () => {
|
|
273
284
|
drawMenu(nav.items);
|
|
274
285
|
});
|
|
275
|
-
|
|
286
|
+
if (opts.navResizable)
|
|
287
|
+
drawNavHandle(navPos, $navW);
|
|
288
|
+
else
|
|
289
|
+
A("div.s-nav-sep aria-hidden=true");
|
|
276
290
|
});
|
|
277
291
|
drawMainContent(opts, ctl);
|
|
278
292
|
});
|
|
@@ -445,6 +459,40 @@ function drawNavTrigger(nav, $nav) {
|
|
|
445
459
|
click: () => { $nav.open = !$nav.open; },
|
|
446
460
|
});
|
|
447
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* The hairline between sidebar and content as a window splitter: dragging it, or
|
|
464
|
+
* pressing ←/→ while it has focus, sets `$navW.px` — the sidebar's whole column.
|
|
465
|
+
*/
|
|
466
|
+
function drawNavHandle(navPos, $navW) {
|
|
467
|
+
// Which way the sidebar grows: away from the shell edge it sits against.
|
|
468
|
+
const dir = navPos === "right" ? -1 : 1;
|
|
469
|
+
A("div.s-nav-sep role=separator aria-orientation=vertical aria-label='Resize navigation' tabindex=0", () => {
|
|
470
|
+
A(() => A("aria-valuenow=", $navW.px));
|
|
471
|
+
const handle = A();
|
|
472
|
+
const resize = (px) => {
|
|
473
|
+
const max = handle.parentElement.clientWidth / 2;
|
|
474
|
+
$navW.px = Math.round(Math.max(NAV_MIN_W, Math.min(max, px)));
|
|
475
|
+
};
|
|
476
|
+
A("pointerdown=", (e) => {
|
|
477
|
+
if (e.button !== 0)
|
|
478
|
+
return;
|
|
479
|
+
e.preventDefault();
|
|
480
|
+
const x0 = e.clientX;
|
|
481
|
+
const w0 = $navW.px;
|
|
482
|
+
const move = (e) => resize(w0 + dir * (e.clientX - x0));
|
|
483
|
+
handle.setPointerCapture(e.pointerId);
|
|
484
|
+
handle.addEventListener("pointermove", move);
|
|
485
|
+
handle.addEventListener("lostpointercapture", () => handle.removeEventListener("pointermove", move), { once: true });
|
|
486
|
+
});
|
|
487
|
+
A("keydown=", (e) => {
|
|
488
|
+
const step = e.key === "ArrowRight" ? 10 : e.key === "ArrowLeft" ? -10 : 0;
|
|
489
|
+
if (!step)
|
|
490
|
+
return;
|
|
491
|
+
e.preventDefault();
|
|
492
|
+
resize($navW.px + dir * step);
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
}
|
|
448
496
|
/**
|
|
449
497
|
* The narrow-screen navigation: a full panel sliding in over the content from
|
|
450
498
|
* the left. Picking an item slides it back out as the chosen screen enters from
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import A from "aberdeen";
|
|
2
2
|
import { applyControlAttrs, drawField, drawInsets } from "./field.js";
|
|
3
3
|
A.insertGlobalCss({
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// how tall to be (`attrs: "h:8rem"`) hands
|
|
7
|
-
// field left to size itself
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
"textarea.s-input, .s-inset.s-inset-bottom": "flex: 0 1 100%; min-height:0",
|
|
4
|
+
// Start from the height the textarea asks for (its rows, or its text when
|
|
5
|
+
// growing), then grow or shrink to whatever room the field has left: a field
|
|
6
|
+
// told how tall to be (`attrs: "h:8rem"`) hands its height to the textarea,
|
|
7
|
+
// while a field left to size itself has no room to share out, so the textarea
|
|
8
|
+
// keeps its own height. The same rule rides the inset box below, which stands
|
|
9
|
+
// in for the control once a prefix/suffix gives it one.
|
|
10
|
+
"textarea.s-input, .s-inset.s-inset-bottom": "flex: 1 1 auto; min-height:0",
|
|
12
11
|
"textarea.s-input": "resize:vertical min-height:3em line-height:1.45",
|
|
13
|
-
// Sized to its text there is nothing to scroll
|
|
14
|
-
// a caller caps the height (`inputAttrs: "max-height:12em"`)
|
|
15
|
-
"textarea.s-input.s-autoGrow": "resize:none min-height:2.5em overflow-y:
|
|
12
|
+
// Sized to its text there is nothing to scroll; `fitToContent` turns scrolling
|
|
13
|
+
// on once a caller caps the height (`inputAttrs: "max-height:12em"`).
|
|
14
|
+
"textarea.s-input.s-autoGrow": "resize:none min-height:2.5em overflow-y:hidden",
|
|
16
15
|
});
|
|
17
16
|
/**
|
|
18
17
|
* A multi-line text input. Shares the field chrome and styling of
|
|
@@ -77,9 +76,27 @@ export function textarea(opts = {}) {
|
|
|
77
76
|
});
|
|
78
77
|
}
|
|
79
78
|
function fitToContent(el) {
|
|
80
|
-
|
|
79
|
+
// Measure a copy taken out of the flow: collapsing the textarea itself would
|
|
80
|
+
// scroll its caret into view of the collapsed box and shrink the page under
|
|
81
|
+
// it, so a capped textarea, or the page, would jump on every keystroke.
|
|
82
|
+
const probe = el.cloneNode();
|
|
83
|
+
probe.value = el.value;
|
|
84
|
+
Object.assign(probe.style, {
|
|
85
|
+
position: "absolute",
|
|
86
|
+
visibility: "hidden",
|
|
87
|
+
width: `${el.offsetWidth}px`,
|
|
88
|
+
height: "auto",
|
|
89
|
+
// Measure without a scrollbar: one would narrow the text and wrap it early.
|
|
90
|
+
overflowY: "",
|
|
91
|
+
});
|
|
92
|
+
el.after(probe);
|
|
81
93
|
// `scrollHeight` measures the padding box, while the height we set sizes the
|
|
82
94
|
// border box: add the borders back, or the text ends up two pixels too tall
|
|
83
95
|
// for its box and the textarea scrolls by that much.
|
|
84
|
-
|
|
96
|
+
const height = probe.scrollHeight + probe.offsetHeight - probe.clientHeight;
|
|
97
|
+
probe.remove();
|
|
98
|
+
el.style.height = `${height}px`;
|
|
99
|
+
// Scroll only once a `max-height` caps the box: `scrollHeight` is rounded, so
|
|
100
|
+
// an uncapped box can fall a fraction of a pixel short and show a bar.
|
|
101
|
+
el.style.overflowY = el.offsetHeight < height ? "auto" : "";
|
|
85
102
|
}
|
package/dist/staffa.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import F from"aberdeen";var d2=t=>`background: $s-bg linear-gradient(${t}, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%));`,R1=d2("170deg"),Z1=d2("180deg"),D1="staffa:darkMode",n2=F.proxy({value:_2()});function _2(){try{let t=localStorage.getItem(D1);if(t==="dark")return!0;if(t==="light")return!1}catch{}}function j2(t){n2.value=t;try{t===void 0?localStorage.removeItem(D1):localStorage.setItem(D1,t?"dark":"light")}catch{}}function c2(t=!1){let a=n2.value;return a===void 0&&!t?F.darkMode():a}F(()=>{c2()?F.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#0e0f12 --s-text:#e9eaec",".s-s.neutral":"--s-bg:#191b1f --s-text:#e9eaec",".s-s.neutral .s-s.neutral":"--s-bg:#23262b"}):F.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#eef0f3 --s-text:#1d1f24",".s-s.neutral, .s-s.neutral":"--s-bg:#ffffff --s-text:#1d1f24",".s-s.neutral .s-s.neutral":"--s-bg:#f6f7f9"})});F.setSpacingCssVars(1.1);F.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 p:$3 min-height:100dvh line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased text:$s-text "+R1,a:"color: $s-link-fg; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select, optgroup":"font:inherit color:inherit","input:where(:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=image],[type=submit],[type=button],[type=reset],[type=hidden])), textarea, select":"background:$s-bg border: 1px solid $s-faint; r:$s-radius-sm padding: 0.45em 0.65em; max-width:100%","input:where([type=checkbox],[type=radio])":"width:1.15em height:1.15em cursor:pointer","input[type=range]":"appearance:none background:transparent cursor:pointer vertical-align:middle","input[type=range]::-webkit-slider-runnable-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-progress":"height:4px r:99px background:$s-accent","input[type=range]::-webkit-slider-thumb":"appearance:none width:16px height:16px margin-top:-6px r:50% background:$s-accent","input[type=range]::-moz-range-thumb":"width:16px height:16px border:0 r:50% background:$s-accent","input[type=file]":"cursor:pointer",progress:"appearance:none border:0 height:6px r:99px background:$s-faint overflow:hidden vertical-align:middle","progress::-webkit-progress-bar":"background:$s-faint r:99px","progress::-webkit-progress-value":"background:$s-accent r:99px","progress::-moz-progress-bar":"background:$s-accent r:99px",meter:"vertical-align:middle",fieldset:"border: 1px solid $s-faint; r:$s-radius-sm padding:$2 min-width:0",legend:"padding: 0 $1; font-weight:600","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-text, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-text, $s-bg 92%); p:$3 r: $s-radius; overflow:auto","pre code":"background:transparent p:0","img, svg, video, canvas":"max-width:100% h:auto",hr:"border:0 border-top: 1px solid $s-faint;","::placeholder":"color: $s-muted; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-muted font-size:0.9em","@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":"transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important;"},":root":"--s-primary:#00a884 --s-danger:#dc5b41 --s-success:#00a884 --s-warning:#ef6b00 --s-link:#3f8cd8 --s-radius-sm:6px --s-radius:12px --s-radius-lg:18px --s-focus: color-mix(in srgb, $s-primary 38%, transparent); --s-gradient: linear-gradient(135deg, color-mix(in oklab, $s-primary, white 16%), color-mix(in oklab, $s-primary, black 14%));",":root, .s-s.neutral":"--s-accent:$s-primary --s-link-fg:$s-link",".s-s:not(.neutral)":"--s-bg:$s-primary border:0 --s-text:#eee --s-accent:#fff --s-link-fg:#eef --s-muted: color-mix(in srgb, #fff 70%, transparent); --s-faint: color-mix(in srgb, #fff 30%, transparent);",".s-s.danger":"--s-bg:$s-danger",".s-s.success":"--s-bg:$s-success",".s-s.warning":"--s-bg:$s-warning",".s-s.link":"--s-bg:$s-link",".s-s.primary":"--s-bg:$s-primary",":root, .s-s":"--s-muted: color-mix(in oklab, $s-text, $s-bg 42%); --s-faint: color-mix(in oklab, $s-text, $s-bg 80%); color:$s-text accent-color:$s-accent scrollbar-width:thin scrollbar-color: $s-faint transparent;",".s-s":R1+" r:$s-radius",":where(.s-s.neutral)":"border: 1px solid $s-faint;",".s-s::-webkit-scrollbar, .s-s ::-webkit-scrollbar":"width:10px height:10px",".s-s::-webkit-scrollbar-track, .s-s ::-webkit-scrollbar-track":"background:transparent",".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb":"background:$s-faint border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s.shadow.neutral:not(.s-btn)":"box-shadow: 0 4px 14px rgba(0,0,0,0.13);",".s-s.extra-shadow.neutral:not(.s-btn)":"box-shadow: 0 18px 50px rgba(0,0,0,0.28);",".s-s.shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 4px 14px color-mix(in srgb, $s-bg 30%, transparent);",".s-s.extra-shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 14px 40px color-mix(in srgb, $s-bg 40%, transparent);",".s-s.no-shadow":"box-shadow: none !important;",".s-s:not(.neutral).tonal, .s-s:not(.neutral).outlined":{"&":"--s-text:$s-bg --s-accent:$s-bg --s-link-fg:$s-bg --s-faint: color-mix(in srgb, $s-bg 30%, transparent); --s-muted: color-mix(in srgb, $s-bg 70%, transparent);",code:"background:transparent padding:0",pre:"background:transparent border: 1px solid $s-faint;"},".s-s:not(.neutral).tonal":"background: color-mix(in srgb, $s-bg 15%, transparent); border: 1px solid $s-faint;",".s-s:not(.neutral).outlined":"background: transparent; border: 1px solid color-mix(in srgb, $s-bg 45%, transparent);",".s-s:not(.neutral) .s-s.tonal, .s-s:not(.neutral) .s-s.outlined":"--s-text:#fff --s-accent:#fff --s-link-fg:#fff "+R1+" border-color: transparent;"});F.insertGlobalCss({".s-preload, .s-preload *, .s-preload *::before, .s-preload *::after":"transition: none !important; animation: none !important;"});if(typeof document<"u"&&typeof requestAnimationFrame=="function"){let t=document.documentElement;t.classList.add("s-preload"),requestAnimationFrame(()=>requestAnimationFrame(()=>t.classList.remove("s-preload")))}F.insertGlobalCss({":disabled, [aria-disabled=true]":"opacity:0.45 filter:saturate(0.6) user-select:none",":disabled, [aria-disabled=true], :disabled *, [aria-disabled=true] *":"pointer-events:none cursor:not-allowed"});var Q2="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";F.insertGlobalCss({[`${Q2}`]:{"&":"margin:0","&:not(:first-child)":"margin-top:$3"},"h1, h2, h3, h4, h5, h6":{"&":"line-height:1.15 font-weight:700 text-wrap:balance","&:not(:first-child)":"margin-top:1.4em"},h1:"font-size:2em font-weight:800 letter-spacing:-0.022em",h2:"font-size:1.55em letter-spacing:-0.018em",h3:"font-size:1.3em letter-spacing:-0.011em",h4:"font-size:1.1em",h5:"font-size:0.95em letter-spacing:0.005em",h6:"font-size:0.8em fg:$s-muted text-transform:uppercase letter-spacing:0.07em","ul, ol":{"&":"padding-left:1.5em","> li:not(:first-child), li > &:not(:first-child)":"margin-top:$1"},blockquote:"border-left: 3px solid $s-faint; padding-left: $3; fg: $s-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-faint; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-faint;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-muted font-size:0.9em margin-top:$1 text-align:center"});import B1 from"aberdeen";var b1=typeof navigator<"u"&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),J2={esc:"escape",space:" "},Y2={" ":"Space",escape:"Esc",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192"},w1=new WeakMap,R=[];function s2(){let t=B1();if(!t)throw new Error("Staffa: claimKeyboard needs a current element");return R.push(t),()=>{let a=R.indexOf(t);a>=0&&R.splice(a,1)}}function l2(t){let[,a,e,h]=/^(mod\+)?(shift\+)?(.*)$/i.exec(t),p=h.toLowerCase();if(p=J2[p]??p,!p||p.length>1&&/[-+]/.test(p))throw new Error(`Staffa: can't parse key "${t}" \u2014 write "k", "f2", "mod+k" or "mod+shift+f2"`);if(e&&p.toUpperCase()===p)throw new Error(`Staffa: "${t}" \u2014 write the shifted character itself ("?", not "shift+/")`);return(a?"mod+":"")+(e?"shift+":"")+p}function t0(t){if(t.altKey||(b1?t.ctrlKey:t.metaKey))return null;let a=t.key.toLowerCase(),e=t.shiftKey&&(a.length>1||t.key.toUpperCase()!==a);return((b1?t.metaKey:t.ctrlKey)?"mod+":"")+(e?"shift+":"")+a}function M2(t,a){if(!(a instanceof HTMLElement))return!1;let e=t.startsWith("mod+"),h=t.replace(/^(mod\+)?(shift\+)?/,"");if(h==="enter"&&a.closest("a[href]")!=null||!e&&(h==="enter"||h===" ")&&a.closest("button, summary, [role=button]")!=null)return!0;let p=a.tagName;return!e&&h!=="escape"&&(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||a.isContentEditable)}function x2(t,a){let e=R[R.length-1];return a.global===!0||!e||e.contains(t)}function a0(t){for(let a=R.length-1;a>=0;a--)if(R[a].contains(t))return R[a]}function v2(){return R[R.length-1]??document.body}function m2(t){let a=R[R.length-1];return a&&!(t&&a.contains(t))?a:t??document.body}var i2=!1;function e0(t){if(t.defaultPrevented||t.repeat||t.isComposing)return;let a=t0(t),e=t.target instanceof Element?t.target:null;if(!(a==null||M2(a,e)))for(let h=m2(e);h;h=h.parentElement){let p=w1.get(h)?.get(a);if(p&&x2(h,p)){p.press&&(t.preventDefault(),p.press(t));return}}}function u2(t){let a=new Map;for(let e=m2(t);e;e=e.parentElement){let h=w1.get(e);if(h)for(let[p,r]of h)!a.has(p)&&x2(e,r)&&!M2(p,t)&&a.set(p,r)}return[...a]}function O(t,a,e,h="normal"){let p=B1(),r=h==="global"?document.body:h==="local"?p:h==="normal"?(p&&a0(p))??document.body:h;if(!r)throw new Error("Staffa: a local key binding needs a current element");let o=l2(t),d=w1.get(r);d||w1.set(r,d=new Map);let n={description:a,press:e,global:h==="global",prev:d.get(o)};d.set(o,n),i2||(i2=!0,document.addEventListener("keydown",e0)),B1.clean(()=>{let c=d.get(o);if(c===n)n.prev?d.set(o,n.prev):d.delete(o);else for(;c;c=c.prev)if(c.prev===n){c.prev=n.prev;break}})}function D(t,a=!1){let e=l2(t),h=e.startsWith("mod+"),p=h?e.slice(4):e,r=p.startsWith("shift+"),o=r?p.slice(6):p,d=o.length===1?o.toUpperCase():o[0].toUpperCase()+o.slice(1);if(a){let c=o===" "?"Space":r||o.length>1?d:o;return(h?b1?"Meta+":"Control+":"")+(r?"Shift+":"")+c}let n=Y2[o]??d;return b1?(r?"\u21E7":"")+(h?"\u2318":"")+n:(h?"Ctrl+":"")+(r?"Shift+":"")+n}import t1 from"aberdeen";import I1 from"aberdeen";var H1=640,h0=0;function J(t="s"){return`${t}-${++h0}`}function l(t,...a){t!=null&&(typeof t=="function"?t(...a):I1("rich=",t))}var p0="a[href], button, input, select, textarea, [tabindex]",f2=t=>t instanceof HTMLElement&&!t.hasAttribute("disabled")&&t.getAttribute("aria-disabled")!=="true"&&t.tabIndex>=0&&t.getClientRects().length>0;function F1(t){return[...t.querySelectorAll(p0)].filter(f2)}function o1(t,a){let e=(a?[...t.querySelectorAll(a)].find(f2):void 0)??F1(t)[0];return e?.focus(),e!=null}function K(t){queueMicrotask(()=>I1(t))}var y2=["scroll","resize","transitionstart","animationstart"];function d1(t,a){let e="",h=0,p=0,r=()=>{let d=t instanceof Element?t.getBoundingClientRect():t,n=`${d.left} ${d.top} ${d.bottom} ${d.width}`;n!==e&&(e=n,a(d),p=0),h=++p>30?0:requestAnimationFrame(r)},o=()=>{p=0,h||r()};for(let d of y2)window.addEventListener(d,o,!0);return I1.clean(()=>{cancelAnimationFrame(h);for(let d of y2)window.removeEventListener(d,o,!0)}),r(),()=>{e="",o()}}import g from"aberdeen";import z from"aberdeen";import Z from"aberdeen";Z.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var n1=Z.proxy(void 0),U=null;function r0(t,a,e,h){let r=window.innerWidth,o=window.innerHeight,d=0,n=0;return h==="bottom"?(d=t.left+(t.width-a)/2,n=t.bottom+7,n+e>o-8&&(n=t.top-e-7)):h==="left"?(d=t.left-a-7,n=t.top+(t.height-e)/2,d<8&&(d=t.right+7)):h==="right"?(d=t.right+7,n=t.top+(t.height-e)/2,d+a>r-8&&(d=t.left-a-7)):(d=t.left+(t.width-a)/2,n=t.top-e-7,n<8&&(n=t.bottom+7)),{x:Math.max(8,Math.min(d,r-a-8)),y:Math.max(8,Math.min(n,o-e-8))}}function K1(){U&&clearTimeout(U),U=setTimeout(()=>{n1.value=void 0,U=null},100)}K(()=>{let t=n1.value;if(!t)return;let{opts:a,anchor:e}=t,h=a.placement??"top",p=Z("div.s-tt-tip.s-s.neutral.shadow role=tooltip",a.attrs,()=>{Z("mouseenter=",()=>{U&&(clearTimeout(U),U=null)}),Z("mouseleave=",K1),l(a.tip)});d1(e,r=>{if(r.bottom<0||r.top>window.innerHeight||r.right<0||r.left>window.innerWidth||e.closest("[inert]")){n1.value=void 0;return}let{x:o,y:d}=r0(r,p.offsetWidth,p.offsetHeight,h);p.style.left=o+"px",p.style.top=d+"px"})});function M1(t){let a=e=>{U&&(clearTimeout(U),U=null),n1.value={opts:t,anchor:e.currentTarget}};Z("mouseenter=",a),Z("mouseleave=",K1),Z("focusin=",e=>{e.target.matches?.(":focus-visible")&&a(e)}),Z("focusout=",K1),Z.clean(()=>{Z.unproxy(n1).value?.opts===t&&(n1.value=void 0)})}z.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:450 line-height:1.1 white-space:nowrap cursor:pointer text-decoration:none padding: $m2 $m3; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline: 3px solid $s-focus; outline-offset: 1px;","&:hover:not([aria-disabled=true])":"filter: brightness(1.06)","&.tonal:hover:not([aria-disabled=true]), &.outlined:hover:not([aria-disabled=true])":"background: color-mix(in srgb, $s-bg 24%, transparent);","&.neutral:hover:not([aria-disabled=true])":"filter:none background: color-mix(in srgb, $s-text 8%, $s-bg);","> svg":"width:1.25em height:1.25em","&:active:not(:disabled):not([aria-disabled=true])":"transform: translateY(1px)","&[aria-disabled=true]":"pointer-events:auto cursor:not-allowed","&.small, .small > &":"padding: $m1 $m2; font-size:0.85em border-radius:$s-radius-sm","&.large, .large > &":"font-size:1.4em border-radius:$s-radius-lg"},".s-icon-btn":{"&":"display:inline-flex align-items:center justify-content:center flex-shrink:0 width:2rem height:2rem p:0 border:0 background:transparent cursor:pointer fg:$s-muted r:$s-radius-sm line-height:1 font-size:1rem text-decoration:none transition: color 0.12s, background 0.12s;","> svg":"width:1.25em height:1.25em","&:hover:not(:disabled):not([aria-disabled=true])":"fg:$s-text background: color-mix(in srgb, $s-text 10%, transparent);","&:focus-visible":"outline: 3px solid $s-focus; outline-offset:1px","&[aria-disabled=true]":"pointer-events:auto cursor:not-allowed","&.small, .small > &":"width:1.6rem height:1.6rem font-size:0.8rem","&.large, .large > &":"width:2.4rem height:2.4rem font-size:1.2rem"},".s-btn.s-busy, .s-icon-btn.s-busy, .s-busy .s-btn[type=submit]":"pointer-events:none cursor:progress",".s-btn.s-busy::after, .s-icon-btn.s-busy::after, .s-busy .s-btn[type=submit]::after":"content:'' flex-shrink:0 width:1em height:1em r:50% border: 2px solid currentColor; border-top-color: transparent; animation: s-spin 0.7s linear infinite;",".s-icon-btn.s-busy > svg":"display:none","@keyframes s-spin":{to:"transform: rotate(360deg)"}});function x1(t){let a=t.href!=null?"a":"button",e=t.tooltip===!1?void 0:t.tooltip,h=t.ariaLabel??(typeof e=="string"?b2(e):void 0);z(`${a}.s-icon-btn`,t.attrs,()=>{g2(t,e!=null),z("aria-label=",h),w2(t.tooltip,t.key,h,t.disabled),l(t.icon)})}function g2(t,a=!1){t.href!=null?(z("role=button"),t.disabled?z("aria-disabled=true"):z("href=",t.href)):t.disabled&&a?(z("type=",t.type??"button"),z("aria-disabled=true tabindex=-1"),z("click=",e=>{e.preventDefault(),e.stopPropagation()})):(z("type=",t.type??"button"),t.disabled&&z("disabled=true")),t.click&&!t.disabled&&o0(t.click)}function o0(t){let a=z.proxy({value:!1});z(()=>{a.value&&z(".s-busy aria-busy=true")}),z("click=",e=>{if(a.value)return;let h=t(e);if(!h||typeof h.then!="function")return;a.value=!0;let p=()=>{a.value=!1};Promise.resolve(h).then(p,r=>{throw p(),r})})}function b2(t){return t.replace(/\*\*(.+?)\*\*|\*(.+?)\*|`(.+?)`|\[(.+?)\]\((.+?)\)/g,(a,e,h,p,r)=>e??h??p??r)}function w2(t,a,e,h){if(t!==!1&&(t!=null||a)&&M1({tip:()=>{l(t),a&&z("#",t==null?D(a):` \xB7 ${D(a)}`)}}),a&&!h){let p=z();z("aria-keyshortcuts=",D(a,!0)),O(a,e,()=>p.click())}}function B(t={}){let a=typeof t=="string"||typeof t=="function"?{content:t}:t,e=a.href!=null?"a":"button",h=a.tooltip===!1?void 0:a.tooltip,p=a.ariaLabel??(a.content==null&&typeof h=="string"?b2(h):void 0);z(`${e}.s-btn.s-s.shadow`,a.attrs,()=>{g2(a,h!=null),p&&z("aria-label=",p),w2(a.tooltip,a.key,typeof a.content=="string"?a.content:p,a.disabled),l(a.icon),l(a.content)})}import H2 from"aberdeen";H2.insertGlobalCss({".s-bgroup":{"&":"display:inline-flex align-items:stretch","&.s-spaced":"gap:$2 flex-wrap:wrap","&.s-vertical":"flex-direction:column","&.s-attached":"gap:0","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child)":"margin-left:-1px","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached:not(.s-vertical) > .s-btn:first-child:not(:last-child)":"border-top-right-radius:0 border-bottom-right-radius:0","&.s-attached:not(.s-vertical) > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-bottom-left-radius:0","&.s-attached.s-vertical > .s-btn:not(:first-child)":"margin-top:-1px","&.s-attached.s-vertical > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached.s-vertical > .s-btn:first-child:not(:last-child)":"border-bottom-left-radius:0 border-bottom-right-radius:0","&.s-attached.s-vertical > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-top-right-radius:0","&.s-attached > .s-btn:hover, &.s-attached > .s-btn:focus-visible":"z-index:1"}});function h1(t={}){let e=`.s-${t.layout??"attached"}${t.vertical?".s-vertical":""}`;H2(`div.s-bgroup${e} role=group`,t.attrs,()=>{if(t.buttons)for(let h of t.buttons)B(h);l(t.content)})}import p1 from"aberdeen";import k from"aberdeen";k.insertGlobalCss({".s-field":{"&":"display:flex flex-direction:column gap:$1","> label":"font-weight:600 font-size:0.9em fg:$s-text user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&[aria-invalid=true]":"border-color:$s-danger"},".s-inset":{"&":"display:contents --s-inset-start:0px --s-inset-end:0px","&:has(> .s-inset_start), &:has(> .s-inset_end)":"position:relative display:grid","> .s-input":"padding-inline-start: calc(0.7em + var(--s-inset-start)); padding-inline-end: calc(0.7em + var(--s-inset-end));","> .s-inset_start, > .s-inset_end":"position:absolute top:0 bottom:0 display:flex align-items:center gap:$1 fg:$s-muted","> .s-inset_start":"left:0.35em","> .s-inset_end":"right:0.35em","&.s-inset-bottom > .s-inset_start, &.s-inset-bottom > .s-inset_end":"top:auto padding-bottom:0.35em","> .s-inset_start > svg, > .s-inset_end > svg":"width:1.15em height:1.15em","&:has(> .s-inset_end) > input[type=number]":"appearance:textfield","&:has(> .s-inset_end) > input[type=number]::-webkit-inner-spin-button":"appearance:none margin:0"},".s-inset_start, .s-inset_end":"pointer-events:none",".s-inset_start :where(button, a, input, select, textarea, label, [tabindex])":"pointer-events:auto",".s-inset_end :where(button, a, input, select, textarea, label, [tabindex])":"pointer-events:auto"});function Y(t,a){let e=t.id??J("field"),h=()=>!!t.error;k("div.s-field",t.attrs,()=>{k(()=>{t.label!=null&&k("label for=",e,()=>{l(t.label),t.required&&k("span.s-req aria-hidden=true #*")})}),a(e,h),k(()=>{t.help!=null&&!t.error&&k("div.s-help",()=>l(t.help))}),k(()=>{t.error&&k("div.s-error role=alert #",t.error)})})}function c1(t,a,e,h){k("id=",a),t.name&&k("name=",t.name),k(()=>{t.disabled&&k("disabled=true")}),k(()=>{t.required&&k("aria-required=true")}),k(()=>k("aria-invalid=",e()?"true":"false")),h&&k("bind=",h)}function A1(t,a,e){k("div.s-inset",()=>{a&&k(".s-inset-bottom"),e(),A2(()=>t.prefix,"s-inset_start","--s-inset-start"),A2(()=>t.suffix,"s-inset_end","--s-inset-end")})}function A2(t,a,e){k(()=>{let h=t();if(h==null)return;let p=k(`div.${a}.small`,()=>l(h)),r=p.parentElement,o=new ResizeObserver(()=>r?.style.setProperty(e,`${p.offsetWidth}px`));o.observe(p),k.clean(()=>{o.disconnect(),r?.style.setProperty(e,"0px")})})}function U1(t={}){Y(t,(a,e)=>{A1(t,!1,()=>{p1("input.s-input",t.inputAttrs,()=>{p1("type=",t.type??"text"),t.placeholder!=null&&p1("placeholder=",t.placeholder),t.autocomplete!=null&&p1("autocomplete=",t.autocomplete),t.value!=null&&!t.bind&&p1("value=",t.value),t.input&&p1("input=",t.input),t.change&&p1("change=",t.change),c1(t,a,e,t.bind)})})})}var V2=200;g.insertGlobalCss({".s-backdrop":{"&":"position:fixed inset:0 z-index:200 display:block background: rgba(0,0,0,0.55); transition: opacity 0.4s ease-in-out;","&.hidden":"opacity:0 pointer-events:none"},".s-dialog":{"&":"position:fixed z-index:200 top:50% left:50% display:flex flex-direction:column transform:translate(-50%,-50%) min-width:min(20rem,90vw) max-width:min(90vw,44rem) max-height:min(88vh,800px) r: $s-radius-lg; overflow:hidden transition: opacity 0.2s ease-out, transform 0.2s ease-out;","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0 flex-shrink:0","> div":"p:$3 gap:$3 display:flex flex-direction:column overflow-y:auto flex:1 min-height:0","&.hidden":"opacity:0 pointer-events:none transform: translate(-50%, calc(-50% + 20px)); pointer-events:none"}});var i1=g.proxy({}),d0=0,W1=g.derive(()=>{let t=Object.keys(i1);if(t.length)return t[t.length-1]});function N1(){return W1.value!=null}K(()=>{g.onEach(i1,({resolve:t,opts:a},e)=>{let h=()=>{delete i1[e]};g.clean(()=>{a.onClose?.(),t()});let p=document.activeElement;g.clean(()=>{p instanceof HTMLElement&&document.contains(p)&&p.focus()});let r=g.derive(()=>W1.value!=e),o=g("div.s-backdrop create=hidden destroy=hidden .hidden=",r,"click=",()=>{a.allowCancel!==!1&&h()}),d=`s-dialog-title-${e}`,n=g("div.s-dialog.neutral.s-s.extra-shadow role=dialog create=hidden destroy=hidden",a.attrs,()=>{if(!a.keyboardTransparent){let V=g();g.clean(s2()),g("aria-modal=true"),g("keydown=",b=>n0(V,b))}let i=v2();g(()=>{let V=a.allowCancel!==!1;O("esc",V?"Close this dialog":void 0,V?h:()=>{},i)}),g(()=>{a.header!=null&&(g("aria-labelledby=",d),g("header.s-s.neutral id=",d,a.headerAttrs,()=>l(a.header)))}),g("div",a.contentAttrs,()=>{l(a.content,h)}),g(()=>{a.footer!=null&&g("footer.s-s.neutral",a.footerAttrs,()=>l(a.footer))})}),c=0;g(()=>{let i=Object.keys(i1).indexOf(e);i>=0&&(c=i),o.style.zIndex=`${V2+2*c}`,n.style.zIndex=`${V2+2*c+1}`}),requestAnimationFrame(()=>{g.peek(()=>W1.value)===e&&document.body.contains(n)&&o1(n)})},(t,a)=>+a)});function n0(t,a){if(a.key!=="Tab"||a.altKey||a.ctrlKey||a.metaKey)return;let e=F1(t),h=a.shiftKey?e[0]:e[e.length-1];!h||document.activeElement!==h||(a.preventDefault(),(a.shiftKey?e[e.length-1]:e[0]).focus())}function s1(t){let a=++d0;return t.cancelWithScope!==!1&&g.clean(()=>{delete i1[a]}),new Promise(e=>{i1[a]={resolve:e,opts:t}})}function c0(t,a={}){return s1({header:"Alert",allowCancel:!0,content:e=>{g("p",()=>{g("#",t)}),h1({layout:"spaced",attrs:"align-self:flex-end",content:()=>{B({content:"OK",click:e})}})},...a})}function i0(t,a={}){return new Promise(e=>{let h=!1;s1({header:"Confirm",allowCancel:!0,content:p=>{g("p",()=>{g("#",t)}),h1({layout:"spaced",attrs:"align-self:flex-end",content:()=>{B({content:"Cancel",attrs:".neutral",click:p}),B({content:"OK",click:()=>{h=!0,p()}})}})},...a,onClose:()=>{e(h),a.onClose?.()}})})}function s0(t,a="",e={}){return new Promise(h=>{let p=null;s1({header:"Input",allowCancel:!0,content:r=>{g("p",()=>{g("#",t)});let o=g.proxy({value:a});g("form display:contents",()=>{g("submit=",d=>{d.preventDefault(),p=o.value,r()}),U1({bind:g.ref(o,"value")}),h1({layout:"spaced",attrs:"align-self:flex-end",content:()=>{B({content:"Cancel",attrs:".neutral",type:"button",click:r}),B({content:"OK",type:"submit"})}})})},...e,onClose:()=>{h(p),e.onClose?.()}})})}t1.insertGlobalCss({".s-keyhelp":{"&":"display:flex flex-direction:column gap:$1 min-width:14rem","> div":"display:flex align-items:baseline justify-content:space-between gap:$4",kbd:"font-family:inherit font-size:0.85em fg:$s-muted white-space:nowrap border: 1px solid $s-faint; r:$s-radius-sm padding: 0 0.4em;"}});var V1=null;function G1(){if(V1){V1();return}let t=u2(document.activeElement);s1({header:"Keyboard shortcuts",cancelWithScope:!1,keyboardTransparent:!0,onClose:()=>{V1=null},content:a=>{V1=a;let e=h=>{h.repeat||["Control","Shift","Alt","Meta","Escape","?"].includes(h.key)||a()};document.addEventListener("keydown",e,!0),t1.clean(()=>document.removeEventListener("keydown",e,!0)),t1("div.s-keyhelp",()=>{for(let[h,p]of t)p.description!==void 0&&t1("div",()=>{t1("span",()=>l(p.description)),t1("kbd text=",D(h))})})}})}var k2=t1.proxy(!0);function l0(t){k2.value=t}t1(()=>{k2.value&&(O("?",void 0,G1,"global"),O("mod+?","This overview",G1,"global"))});import M from"aberdeen";M.insertGlobalCss({".s-ac":{"> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","> .s-control:focus-within":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus;","&[aria-invalid=true] > .s-control":"border-color:$s-danger",".s-chip":"display:inline-flex align-items:center gap:$1 font-size:0.85em background: color-mix(in oklab, $s-bg, $s-text 10%); border: 1px solid $s-faint; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-text background:$s-faint",input:"flex:1 min-width:6ch border:0 background:transparent color:inherit outline:none padding:0.25em"},".s-ac-menu.s-s":{"&":"position:fixed max-height:15rem overflow-y:auto list-style:none p:$1 margin:0",li:"margin:0",".s-option":"padding: 0.45em 0.6em; r:6px cursor:pointer transition: background 0.1s;",".s-option[aria-selected=true]":"background: color-mix(in srgb, $s-text 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-muted"}});var k1=M.proxy({cur:null});function M0(t,a){t.style.maxHeight="";let p=t.offsetHeight,r=window.innerHeight-a.bottom-4-8,o=a.top-4-8,d=p>r&&o>r;t.style.left=`${a.left}px`,t.style.width=`${a.width}px`,t.style.maxHeight=`${Math.min(p,Math.max(d?o:r,60))}px`,t.style.top=d?"auto":`${a.bottom+4}px`,t.style.bottom=d?`${window.innerHeight-a.top+4}px`:"auto"}K(()=>{let t=k1.cur;if(!t)return;let a,e=M("ul.s-ac-menu.s-s.neutral.shadow role=listbox",`id=${t.id} z-index:${t.zIndex}`,()=>{M("mousedown=",h=>h.preventDefault()),t.draw(),a?.()});a=d1(t.anchor,h=>M0(e,h))});function x0(t){let a=[];for(let e of t.matchAll(/\p{N}+|\p{Lu}+(?=\p{Lu}\p{Ll})|\p{Lu}?\p{Ll}+|\p{Lu}+/gu))a.push(e.index);return a}function L2(t,a){let e=a.toLowerCase().split(/\s+/).filter(Boolean).sort((r,o)=>o.length-r.length);if(!e.length)return!0;let h=x0(t),p=[];return e.every(r=>{let o=h.findIndex((d,n)=>!p[n]&&t.slice(d,d+r.length).toLowerCase()===r);return o<0?!1:(p[o]=!0,!0)})}function v0(t){return typeof t=="string"?{value:t,label:t}:{value:t.value,label:t.label??t.value}}function m0(t){let a=J("ac-menu"),e=M.proxy({query:"",open:!1,active:0}),h=()=>(typeof t.options=="function"?t.options():t.options).map(v0),p=()=>{let m=t.bind?.value;return m==null||m===""?[]:Array.isArray(m)?m:[m]},r=m=>h().find(H=>H.value===m)?.label??m,o=m=>m?h().find(H=>H.label.toLowerCase()===m.toLowerCase())?.value??m:"";if(!t.multi){let m=t.bind?M.peek(t.bind,"value"):void 0;typeof m=="string"&&m&&(e.query=M.peek(()=>r(m)))}let d=()=>{let m=new Set(p()),H=h();t.multi&&(H=H.filter(f=>!m.has(f.value)));let A=e.query.trim();return A&&(H=H.filter(f=>(t.match??L2)(f.label,A))),H},n=(m,H)=>{if(t.multi){let A=Array.isArray(t.bind?.value)?[...t.bind.value]:[];A.includes(m)||A.push(m),t.bind&&(t.bind.value=A),e.query=""}else t.bind&&(t.bind.value=m),e.query=r(m),e.open=!1;e.active=0,H?.focus()},c=m=>{if(!t.bind)return;let H=t.bind.value??[];t.bind.value=H.filter(A=>A!==m)},i,V=()=>{let m=d(),H=e.query.trim(),A=t.allowCustom!==!1&&H!==""&&!m.some(f=>f.label.toLowerCase()===H.toLowerCase());m.forEach((f,P)=>{M("li.s-option role=option",`id=${a}-opt-${P}`,()=>{M(()=>M("aria-selected=",e.active===P?"true":"false")),M("#",f.label),M("click=",()=>n(f.value,i)),M("mousemove=",()=>{e.active=P})})}),A&&M("li.s-option.s-add role=option",()=>{M("#",`Add "${H}"`),M("click=",()=>n(H,i))}),m.length===0&&!A&&M("li.s-empty #No matches")};Y(t,(m,H)=>{M("div.s-ac",t.inputAttrs,()=>{M(()=>M("aria-invalid=",H()?"true":"false"));let A=M("div.s-control",()=>{M("click=",()=>i?.focus()),M(()=>{if(t.multi)for(let f of p())M("span.s-chip",()=>{M("span #",M.peek(()=>r(f))),M("button type=button aria-label=",`Remove ${f}`,()=>{M("#\xD7"),M("click=",P=>{P.stopPropagation(),c(f),i?.focus()})})})}),i=M("input type=text role=combobox autocomplete=off",()=>{M("id=",m,`aria-controls=${a} aria-autocomplete=list`),t.placeholder!=null&&M("placeholder=",t.placeholder),t.disabled&&M("disabled=true"),t.required&&M("aria-required=true"),M("bind=",M.ref(e,"query")),M(()=>M("aria-expanded=",e.open?"true":"false")),M(()=>{let P=d()[e.active];M("aria-activedescendant=",e.open&&P?`${a}-opt-${e.active}`:"")}),M("input=",()=>{e.open=!0,e.active=0}),M("focus=",()=>{e.open=!0}),M("blur=",()=>{setTimeout(()=>E(),150)}),M("keydown=",f=>b(f,i))})});M(()=>{if(!e.open)return;let f=A.closest(".s-dialog")?350:150;k1.cur={id:a,anchor:A,zIndex:f,draw:V},M.clean(()=>{k1.cur?.id===a&&(k1.cur=null)})}),M(()=>{if(t.name)if(t.multi)for(let f of p())M("input type=hidden",()=>{M("name=",t.name),M("value=",f)});else M("input type=hidden",()=>{M("name=",t.name),M("value=",p()[0]??"")})})})});function b(m,H){let A=d(),f=A.length-1;if(m.key==="ArrowDown")m.preventDefault(),e.open=!0,e.active=Math.min(f,e.active+1);else if(m.key==="ArrowUp")m.preventDefault(),e.active=Math.max(0,e.active-1);else if(m.key==="Enter"){m.preventDefault();let P=e.query.trim(),j=e.open?A[e.active]:void 0;j?n(j.value,H):t.allowCustom!==!1&&(P||!t.multi)?n(o(P),H):e.open&&(e.open=!1)}else if(m.key==="Escape")e.open&&(m.preventDefault(),e.open=!1);else if(m.key==="Backspace"&&t.multi&&e.query===""){let P=p();P.length&&c(P[P.length-1])}}function E(){e.open=!1,t.multi?e.query="":t.allowCustom!==!1?n(o(e.query.trim())):e.query=r(p()[0]??"")}}import r1 from"aberdeen";import u0 from"aberdeen";var v1={size:24,color:"currentColor",strokeWidth:2,cap:"round",join:"round"};function y0(t,a){let e=a.size??v1.size,h=u0('svg.s-icon aria-hidden=true viewBox="0 0 24 24" fill=none',"width=",e,"height=",e,"stroke=",a.color??v1.color,"stroke-width=",a.strokeWidth??v1.strokeWidth,"stroke-linecap=",a.cap??v1.cap,"stroke-linejoin=",a.join??v1.join,a.attrs);h.innerHTML=t}function T(t){return(a={})=>y0(t,a)}var C2=T('<path d="m9 18 6-6-6-6" />');var z2=T('<circle cx="12" cy="12" r="10" />');var $2=T('<path d="M15 3h6v6" /><path d="M10 14 21 3" /><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />');var S2=T('<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" /><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />');var L1=T('<path d="M4 5h16" /><path d="M4 12h16" /><path d="M4 19h16" />');var P2=T('<path d="M12 17v5" /><path d="M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" /><path d="m2 2 20 20" /><path d="M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" />'),X1=T('<path d="M12 17v5" /><path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />');var E2=T('<path d="M22 2 2 22" />');var l1=T('<path d="M18 6 6 18" /><path d="m6 6 12 12" />');r1.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column overflow:hidden r: $s-radius-lg; position:relative","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0","> div":"p:$3 gap:$3","> header > .s-box-close":"margin-left:auto","> .s-box-close":"position:absolute top:$2 right:$2 z-index:1"}});function f0(t={}){let a=typeof t=="string"||typeof t=="function"?{content:t}:t;r1("section.s-box.s-s.neutral.shadow",a.attrs,()=>{r1(()=>{a.header!=null?r1("header.s-s.neutral",a.headerAttrs,()=>{l(a.header),typeof a.close=="function"&&O2(a.close)}):typeof a.close=="function"&&O2(a.close)}),r1("div",a.contentAttrs,()=>{l(a.content)}),r1(()=>{a.footer!=null&&r1("footer.s-s.neutral",a.footerAttrs,()=>l(a.footer))})})}function O2(t){x1({icon:l1,ariaLabel:"Close",click:t,attrs:".s-box-close"})}import _1 from"aberdeen";function g0(t){_1(()=>{let a=t.bind.value;h1({attrs:t.attrs,buttons:Object.entries(t.options).map(([e,h])=>({content:h,ariaLabel:typeof h=="function"?e:void 0,attrs:a===e?".primary":".neutral",click:()=>{t.bind.value=t.allowDeselect&&a===e?void 0:e}}))})}),t.name&&_1(()=>_1("input type=hidden name=",t.name,"value=",t.bind.value??""))}import S from"aberdeen";S.insertGlobalCss({".s-check":{"&":"display:flex flex-direction:column gap:$1","> label":"display:flex align-items:center gap:$2 cursor:pointer user-select:none","> label:has(input:disabled)":"cursor:not-allowed opacity:0.45 filter:saturate(0.6)",input:"cursor:inherit m:0"}});function b0(t={}){let a=t.id??J("check");S("div.s-check",t.attrs,()=>{S("label for=",a,()=>{S("input type=checkbox",t.inputAttrs,()=>{S("id=",a),t.name&&S("name=",t.name),t.checked&&!t.bind&&S("checked=true"),t.change&&S("change=",t.change),S(()=>{t.disabled&&S("disabled=true")}),S(()=>{t.required&&S("aria-required=true")}),t.bind&&S("bind=",t.bind)}),S(()=>{t.label!=null&&l(t.label),t.required&&S("span.s-req aria-hidden=true #*")})}),S(()=>{t.help!=null&&!t.error&&S("div.s-help",()=>l(t.help))}),S(()=>{t.error&&S("div.s-error role=alert #",t.error)})})}import W from"aberdeen";W.insertGlobalCss({".s-form":{"&":"display:flex flex-direction:column gap:$3","&.grid":"display:grid grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap:$3","&.grid > .s-wide, &.grid > footer":"grid-column: 1 / -1;","&.grid > .s-field":"align-self: start","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 flex-wrap:wrap margin-top:$1"}});function w0(t={}){let a=typeof t=="string"||typeof t=="function"?{content:t}:t,e=W.proxy({value:!1});W("form.s-form",a.attrs,()=>{W(()=>{W(".grid=",a.layout==="grid")}),W(()=>{e.value&&W(".s-busy aria-busy=true")}),W("submit=",h=>{if(h.preventDefault(),a.submit&&!e.value){let p=new FormData(h.target),r={};for(let d of new Set(p.keys())){let n=p.getAll(d);r[d]=n.length===1?n[0]:n}let o=a.submit(r,h);if(o&&typeof o.then=="function"){e.value=!0;let d=()=>{e.value=!1};Promise.resolve(o).then(d,n=>{throw d(),n})}}}),l(a.content),W(()=>{a.actions&&W("footer",a.actionsAttrs,()=>l(a.actions))})})}import x from"aberdeen";import{current as o2}from"aberdeen/route";import y from"aberdeen";import{matchCurrent as k0,current as z1,go as q2}from"aberdeen/route";import $ from"aberdeen";import{grow as H0,shrink as A0}from"aberdeen/transitions";$.insertGlobalCss({".s-toasts":"position:fixed bottom:$3 right:$3 z-index:400 display:flex flex-direction:column gap:$2 pointer-events:none max-width:min(90vw,24rem) w:24rem",".s-toast":{"&":"display:flex align-items:flex-start gap:$2 padding: $3; pointer-events:auto position:relative overflow:hidden",".s-toast-body":"display:flex flex-direction:column gap:$1 flex:1 min-width:0",".s-toast-title":"font-weight:700 line-height:1.3",".s-toast-close":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",".s-toast-close:hover":"fg:$s-text",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-text",".s-toast-progress":"position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%"}});var V0=0,m1=$.proxy({});K(()=>{$.peek(()=>$.isEmpty(m1))&&$.isEmpty(m1)||$("div.s-toasts",()=>{$.onEach(m1,t=>{let{opts:a,id:e}=t,h=a.type==="danger"||a.type==="warning"?"alert":"status",p=a.type==null||a.type==="neutral"?"neutral":a.type,r=a.duration??6e3,o,d=null,n=()=>{clearTimeout(o),d&&(d.style.transition="none",d.style.width="100%",d.offsetWidth,d.style.transition=`width ${r}ms linear`,d.style.width="0%"),o=setTimeout(()=>j1(e),r)},c=()=>{clearTimeout(o),o=void 0,d&&(d.style.transition="none",d.style.width="100%")};$.clean(()=>clearTimeout(o)),$(`div.s-toast.s-s.${p}.extra-shadow aria-live=polite role=${h}`,"create=",H0,"destroy=",A0,a.attrs,()=>{r>0&&($("mouseenter=",c),$("mouseleave=",n)),$("div.s-toast-body",()=>{$(()=>{a.title!=null&&$("div.s-toast-title",()=>l(a.title))}),$("div.s-toast-msg",()=>l(a.message))}),$(()=>{a.dismissible!==!1&&$("button.s-toast-close type=button aria-label=Dismiss",()=>{$("#\xD7"),$("click=",()=>j1(e))})}),r>0&&(d=$("div.s-toast-progress"))}),r>0&&requestAnimationFrame(n)})})});function j1(t){delete m1[t]}function C1(t){let a=++V0;return m1[a]={id:a,opts:t},()=>j1(a)}y.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 r:$s-radius-lg max-width: calc(100vw - 16px); overflow-y:auto max-height:min(80vh,28rem) transition: opacity 0.15s, transform 0.15s, visibility 0s;",".s-menu-list.hidden":"opacity:0 pointer-events:none transform:translateY(-6px) visibility:hidden transition: opacity 0.15s, transform 0.15s, visibility 0.15s;",".s-menu-item":"display:flex align-items:center gap:$2 w:100% scroll-margin:$2 padding: $m2 0; line-height:1.1 r:$s-radius cursor:pointer text-align:left font-weight:450 font-size:0.9em border:0 background:transparent fg:$s-text text-decoration:none transition: color 0.12s, transform 0.12s, text-shadow 0.12s;",".s-menu-item:focus-visible:not([aria-current=page]), .s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page])":"filter:none color: color-mix(in lab, $s-primary 33%, $s-text);",".s-menu-item:focus-visible":"outline-offset:-2px background: color-mix(in srgb, $s-accent 14%, transparent);",".s-menu-item[aria-current=page]":"color:$s-accent filter:none",".s-menu-list .s-menu-item":"padding-inline:$2",".s-menu-item[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"flex-shrink:0",".s-menu-list .s-menu-icon":"display:flex",".s-menu-list .s-menu-icon > svg":"width:1.25em height:1.25em","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-faint 18%, $s-faint 82%, transparent);",".s-menu-key":"margin-left:auto padding-left:$2 font-family:inherit font-size:0.8em opacity:0.55 white-space:nowrap flex-shrink:0","@media (hover: none) and (pointer: coarse)":{".s-menu-key":"display:none"},".s-menu-tt-key":"font-family:inherit font-size:0.85em opacity:0.7 white-space:nowrap",".s-tt-tip hr.s-menu-sep":"margin: 0.35em 0;",".s-menu-chevron":"margin-left:auto flex-shrink:0 display:flex transition: transform 0.15s ease;",".s-menu-key + .s-menu-chevron":"margin-left:0",".s-menu-chevron > svg":"width:1em height:1em",".s-menu-details":{"> summary":"list-style:none","> summary::-webkit-details-marker":"display:none","&::details-content":"interpolate-size:allow-keywords block-size:0 overflow-y:clip transition: block-size 0.15s ease, content-visibility 0.15s allow-discrete;","&[open]::details-content":"block-size:auto","&[open] > summary .s-menu-chevron":"transform:rotate(90deg)"},".s-menu-sub":"display:flex flex-direction:column gap:$1 padding-left:$3",".s-menu-inline":"display:flex flex-direction:column gap:$1"});function u1(t,a,e){y("keydown=",h=>{if(h.key==="Enter"&&!h.ctrlKey&&!h.metaKey&&!h.shiftKey&&!h.altKey&&h.target.tagName==="A"){queueMicrotask(()=>a?.());return}if(h.key!=="ArrowDown"&&h.key!=="ArrowUp"&&h.key!=="Home"&&h.key!=="End")return;h.preventDefault();let r=[...h.currentTarget.querySelectorAll(".s-menu-item")].filter(c=>c.getAttribute("aria-disabled")!=="true"&&!z0(c));if(!r.length)return;let o=r.indexOf(document.activeElement),d=h.key==="ArrowUp"?-1:1,n=h.key==="Home"?0:h.key==="End"?r.length-1:o<0?d>0?0:r.length-1:(o+d+r.length)%r.length;r[n].focus()}),R2(t,{onLeafSelect:a,keyHints:e,$hasCurrent:y.derive(()=>Q1(t))})}function R2(t,a){for(let e of t){if(typeof e=="string"||typeof e=="function"){l(e);continue}if("separator"in e){y("hr.s-menu-sep");continue}e.items?C0(e,a):L0(e,a)}}function L0(t,a){let e=!1,h=y(t.href?"a.s-menu-item data-panel=open":"button.s-menu-item type=button",t.attrs,()=>{t.href&&(y("href=",t.href),t.target&&y("target=",t.target),y(()=>{let p=!e;e=!0,J1(t)&&(y("aria-current=page"),requestAnimationFrame(()=>h.scrollIntoView({block:"nearest",behavior:p?"instant":"smooth"})))})),t.disabled&&y("aria-disabled=true"),t.key&&y("aria-keyshortcuts=",D(t.key,!0)),y("click=",p=>{if(t.disabled){p.preventDefault();return}a.onLeafSelect?.(),t.click?.(p)}),t.icon&&y("span.s-menu-icon",()=>l(t.icon)),l(t.label),B2(t,a)})}var D2=new Map;function T2(t,a){return D2.set(t,a),a}function C0(t,a){let e=t.href??Z2(t.items),h=e!=null?y.derive(()=>Y1(t)?T2(e,!0):a.$hasCurrent.value?T2(e,!1):D2.get(e)??!1):null;y("details.s-menu-details",()=>{h&&y(()=>{h.value&&y("open=true")}),y("summary.s-menu-item.s-menu-branch",t.attrs,()=>{t.disabled&&y("aria-disabled=true"),t.key&&y("aria-keyshortcuts=",D(t.key,!0)),y(()=>{J1(t)&&y("aria-current=page")}),y("click=",p=>{if(t.disabled){p.preventDefault();return}e!=null&&(p.preventDefault(),S0(e),q2(e)),t.click?.(p)}),t.icon&&y("span.s-menu-icon",()=>l(t.icon)),l(t.label),B2(t,a),y("span.s-menu-chevron aria-hidden=true",()=>C2())}),y("div.s-menu-sub",()=>R2(t.items,a))})}function z0(t){for(let a=t.closest("details");a;a=a.parentElement&&a.parentElement.closest("details"))if(!a.open&&t.closest("summary")?.parentElement!==a)return!0;return!1}function Q1(t){return t.some(a=>typeof a!="string"&&typeof a!="function"&&!("separator"in a)&&Y1(a))}function J1(t){if(t.href!=null&&k0(t.href))return!0;let a=t.match;if(a==null)return!1;let e=z1.path;if(typeof a=="function")return a(e);let h=a.replace(/\/+$/,"")||"/";return e===h||e.startsWith(h==="/"?"/":h+"/")}function Y1(t){if(J1(t))return!0;for(let a of t.items??[])if(!(typeof a=="string"||typeof a=="function"||"separator"in a)&&Y1(a))return!0;return!1}function Z2(t){for(let a of t){if(typeof a=="string"||typeof a=="function"||"separator"in a)continue;let e=a.href??(a.items?Z2(a.items):void 0);if(e!=null)return e}}function B2(t,a){let e=a.keyHints?void 0:t.key;t.key&&!e&&y("kbd.s-menu-key aria-hidden=true text=",D(t.key)),!(t.tooltip==null&&!e)&&M1({placement:"right",tip:()=>{l(t.tooltip),e&&(t.tooltip!=null&&y("hr.s-menu-sep"),y("kbd.s-menu-tt-key aria-hidden=true text=",D(e)))}})}function y1(t,a){y(()=>{for(let e of I2(t(),[]))O(e.key,e.label,h=>{F2(),a?.(),e.click?.(h),e.href!=null&&$0(e.href,e.target)})})}function I2(t,a){for(let e of t)typeof e=="string"||typeof e=="function"||"separator"in e||(e.key&&!e.disabled&&a.push(e),e.items&&I2(e.items,a));return a}function $0(t,a){let e=new URL(t,location.href);a?window.open(e.href,a,a==="_blank"?"noopener":""):e.origin!==location.origin?location.href=e.href:q2(t)}var $1=null;function S0(t){try{$1=new URL(t,location.href).pathname.replace(/\/+$/,"")||"/"}catch{$1=null}}function t2(t){return $1!==t?!1:($1=null,!0)}var a1=y.proxy({opts:null});function _(){let t=a1.opts?.anchor;a1.opts=null,t?.focus()}function S1(t){let a=a1.opts;return a!=null&&(t==null||a.anchor===t)}function F2(t){S1(t)&&_()}function P0(t,a){let e=t.offsetWidth,h=t.offsetHeight,p=window.innerWidth,r=window.innerHeight,o=4,d=a.left;d+e>p-8&&(d=Math.max(8,a.right-e));let n=a.bottom+o;n+h>r-8&&a.top-h-o>=8&&(n=a.top-h-o),t.style.left=Math.max(8,d)+"px",t.style.top=Math.max(8,n)+"px"}function E0(t){return[{label:"Open in new tab",icon:$2,click:()=>{window.open(t,"_blank","noopener")}},{label:"Copy link",icon:S2,click:()=>{O0(t)}}]}async function O0(t){let a=new URL(t,location.href).href;try{await navigator.clipboard.writeText(a),C1({message:"Link copied."})}catch{C1({message:"Couldn't copy the link.",type:"danger"})}}K(()=>{let t=a1.opts;if(!t)return;let a=y("div.s-menu-list.s-s.neutral.shadow create=hidden destroy=hidden",t.dropdownAttrs,()=>{u1(t.link!=null?[...E0(t.link),{separator:!0},...t.items]:t.items,_,!0)}),e=r=>{let o=r.target;!a.contains(o)&&(t.closeOnAnchorClick||!t.anchor.contains(o))&&_()},h=r=>{(r.key==="Escape"||r.key==="Tab")&&(r.preventDefault(),_())},p=y.peek(z1,"path");y(()=>{z1.path!==p&&!t2(z1.path)&&_()}),document.addEventListener("click",e,!0),document.addEventListener("keydown",h,!0),y.clean(()=>{document.removeEventListener("click",e,!0),document.removeEventListener("keydown",h,!0)}),d1(t.at?new DOMRect(t.at.x,t.at.y,0,0):t.anchor,r=>P0(a,r)),requestAnimationFrame(()=>{document.body.contains(a)&&o1(a,".s-menu-item[aria-current=page]")})});function T0(t){y("nav.s-menu-inline",t.attrs,()=>{y1(()=>t.items,()=>t.onLeafSelect?.()),u1(t.items,t.onLeafSelect)})}function a2(t){return a1.opts=t,_}function e2(t){y1(()=>t.items);let a=null;y.clean(()=>{a1.opts?.anchor===a&&_()}),y("contextmenu=",e=>{e.preventDefault(),a=e.currentTarget,a2({...t,anchor:a,at:{x:e.clientX,y:e.clientY},closeOnAnchorClick:!0})})}function q0(t){y1(()=>t.items);let a=null;y.clean(()=>{a1.opts?.anchor===a&&_()}),B({icon:L1,...t.button?.content==null?{ariaLabel:"Open menu"}:null,attrs:".neutral",...t.button,click:e=>{if(a=e.currentTarget,a1.opts?.anchor===a){_();return}a2({items:t.items,anchor:a,dropdownAttrs:t.dropdownAttrs})}})}import s,{OPAQUE as U2}from"aberdeen";import*as w from"aberdeen/route";import L from"aberdeen";var R0=T('<path d="m15 18-6-6 6-6"/>'),D0=T('<path d="m9 18 6-6-6-6"/>');L.insertGlobalCss({".s-strip":{"&":"position:relative display:flex min-width:0","> .s-strip-row":"display:flex align-items:center flex:1 min-width:0 overflow-x:auto overflow-y:hidden scrollbar-width:none scroll-behavior:smooth","> .s-strip-row::-webkit-scrollbar":"display:none","> .s-strip-btn":"position:absolute top:0 bottom:0 z-index:1 display:none align-items:center justify-content:center width:2.4em border:0 padding:0 cursor:pointer fg:$s-muted transition: color 0.15s;","> .s-strip-btn:hover":"fg:$s-text","> .s-strip-btn-left":"left:0 justify-content:flex-start background: linear-gradient(to right, $s-bg 45%, transparent)","> .s-strip-btn-right":"right:0 justify-content:flex-end background: linear-gradient(to left, $s-bg 45%, transparent)","&.s-can-left > .s-strip-btn-left, &.s-can-right > .s-strip-btn-right":"display:flex"},".s-tabs":{"&":"display:flex flex-direction:column gap:$3",".s-tabbar":"border-bottom: 1px solid $s-faint;",".s-tablist":"gap:$1 align-items:stretch margin-bottom:-1px",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-muted; font-weight:600 padding: 0.6em 0.9em; white-space:nowrap border-bottom: 3px solid transparent; transition: color 0.15s, background 0.15s, border-color 0.15s;",".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]":"color: $s-text;",".s-tab:focus-visible":"outline:none box-shadow: inset 0 0 0 2px $s-focus; r: $s-radius;",".s-tab[aria-selected=true]":"border-image: $s-gradient 1;",".s-tabpanel":"display:block"}});function P1(t){L("div.s-strip",t.attrs,()=>{let a=L("div.s-strip-row",t.stripAttrs,()=>l(t.content));K2(a,-1),K2(a,1),B0(a)})}function E1(t){let a=t.parentElement;if(!a||!t.isConnected)return;let e=parseFloat(getComputedStyle(a).fontSize)*2.6,h=t.getBoundingClientRect(),p=a.getBoundingClientRect(),r=h.left-p.left,o=h.right-p.right;r<e?a.scrollBy({left:r-e,behavior:"smooth"}):o>-e&&a.scrollBy({left:o+e,behavior:"smooth"})}function Z0(t){let a=J("tabs"),e=(r,o)=>r.id??String(o),h=t.bind??L.proxy(e(t.tabs[0]??{label:""},0));t.tabs.length>0&&!t.tabs.some((r,o)=>e(r,o)===L.peek(()=>h.value))&&(h.value=e(t.tabs[0],0));let p=(r,o)=>{r.disabled||(h.value=e(r,o))};L("div.s-tabs",t.attrs,()=>{P1({attrs:".s-tabbar",stripAttrs:".s-tablist role=tablist",content:()=>{t.tabs.forEach((r,o)=>{let d=e(r,o),n=L("button.s-tab type=button role=tab",()=>{L("id=",`${a}-tab-${d}`,"aria-controls=",`${a}-panel-${d}`),L(()=>{let c=h.value===d;L("aria-selected=",c?"true":"false"),L("tabindex=",c?"0":"-1"),c&&requestAnimationFrame(()=>E1(n))}),r.disabled&&L("disabled=true"),L("click=",()=>p(r,o)),L("keydown=",c=>I0(c,t.tabs,o,p)),l(r.icon),l(r.label)})})}}),L("div.s-tabpanel role=tabpanel",t.contentAttrs,()=>{L(()=>{let r=h.value,o=t.tabs.findIndex((n,c)=>e(n,c)===r),d=t.tabs[o]??t.tabs[0];d&&(L("id=",`${a}-panel-${e(d,o)}`,"aria-labelledby=",`${a}-tab-${e(d,o)}`),l(d.content))})})})}function K2(t,a){L(`button.s-strip-btn.s-strip-btn-${a<0?"left":"right"} type=button`,()=>{L("tabindex=-1 aria-hidden=true"),L("click=",()=>t.scrollBy({left:a*t.clientWidth*.8,behavior:"smooth"})),(a<0?R0:D0)({size:"1.1em"})})}function B0(t){let a=t.parentElement;if(!a||typeof ResizeObserver>"u")return;let e=()=>{let r=t.scrollWidth-t.clientWidth;a.classList.toggle("s-can-left",t.scrollLeft>1),a.classList.toggle("s-can-right",t.scrollLeft<r-1)};t.addEventListener("scroll",e,{passive:!0});let h=new ResizeObserver(e);h.observe(t);let p=typeof MutationObserver>"u"?void 0:new MutationObserver(r=>{for(let o of r){for(let d of o.addedNodes)d instanceof Element&&h.observe(d);for(let d of o.removedNodes)d instanceof Element&&h.unobserve(d)}e()});p?.observe(t,{childList:!0});for(let r of Array.from(t.children))h.observe(r);e(),L.clean(()=>{t.removeEventListener("scroll",e),h.disconnect(),p?.disconnect()})}function I0(t,a,e,h){let p=e;if(t.key==="ArrowRight"||t.key==="ArrowDown")p=(e+1)%a.length;else if(t.key==="ArrowLeft"||t.key==="ArrowUp")p=(e-1+a.length)%a.length;else if(t.key==="Home")p=0;else if(t.key==="End")p=a.length-1;else return;t.preventDefault();let r=p>=e?1:-1;for(let o=0;o<a.length;o++){let d=a[p];if(d&&!d.disabled){h(d,p),t.currentTarget?.parentElement?.children[p]?.focus();return}p=(p+r+a.length)%a.length}}var r2={integer(t){if(!/^(0|-?[1-9]\d*)$/.test(t))return;let a=Number(t);return Number.isSafeInteger(a)?a:void 0}};function N(t){let a=String(t).replace(/\/+$/,"");return a.startsWith("/")||(a=`/${a}`),a}function f1(t){let a=N(t);return a==="/"?[]:a.slice(1).split("/")}function W2(t){let a=f1(t),e=a.map((h,p)=>{if(!h.startsWith("[")||!h.endsWith("]"))return{kind:"lit",value:h};let r=/^\[\.\.\.([A-Za-z_$][\w$]*)\]$/.exec(h);if(r){if(p!==a.length-1)throw new Error(`Staffa: "${h}" must be the last segment of route "${t}"`);return{kind:"rest",name:r[1]}}let o=/^\[([A-Za-z_$][\w$]*)(?:=([A-Za-z_$][\w$]*))?\]$/.exec(h);if(!o)throw new Error(`Staffa: malformed param "${h}" in route "${t}"`);let[,d,n]=o;if(n&&!(n in r2))throw new Error(`Staffa: unknown matcher "${n}" in route "${t}" (known: ${Object.keys(r2).join(", ")})`);return{kind:"param",name:d,matcher:n}});return{key:t,segs:e}}function F0(t){try{return decodeURIComponent(t)}catch{return t}}function h2(t,a){let e={};for(let h=0;h<t.segs.length;h++){let p=t.segs[h];if(p.kind==="rest")return h>=a.length?null:(e[p.name]=a.slice(h).join("/"),e);if(h>=a.length)return null;let r=a[h];if(p.kind==="lit"){if(r!==p.value)return null}else if(p.matcher){let o=r2[p.matcher](r);if(o===void 0)return null;e[p.name]=o}else e[p.name]=F0(r)}return t.segs.length===a.length?e:null}var G=250,K0=300,U0=360,O1=540;s.insertGlobalCss({":root":`--s-panel-ms:${G}ms`,".s-panels":"flex:1 min-width:0 min-height:0 position:relative overflow:clip isolation:isolate "+Z1,".s-panel":{"&":"position:absolute top:0 bottom:0 left:0 display:flex flex-direction:column "+Z1+` z-index:2 transition: transform ${G}ms ease-out, opacity ${G}ms linear;`,"&.s-panel-sep::before":"content:'' position:absolute left:0 top:0.6rem bottom:0.6rem width:1px z-index:1 background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);","&.s-panel-new":"z-index:1","&.s-panel-closing":"z-index:0 opacity:0 pointer-events:none","&.s-panel-enter":"opacity:0","&.s-panel-hidden, &.s-panel-parked":"visibility:hidden"},".s-panel > .s-content":"flex:1 min-height:0 overflow-y:auto overflow-x:hidden p:$3",".s-panel-actions":"display:flex align-items:center justify-content:flex-end gap:$1 flex-shrink:0 padding: $3 $3 0;",".s-crumbs > .s-strip-row":"gap:$m1",".s-crumb":{"&":"flex: 1 0 4rem; font-size:0.85em line-height:1.5 fg:$s-muted text-decoration:none white-space:nowrap max-width:max-content overflow:hidden text-overflow:ellipsis transition: color 0.12s;","&.s-crumb-on":"font-weight:600 fg:$s-text","a&:hover":"filter:none color: color-mix(in lab, $s-primary 33%, $s-text);","svg.s-crumb-pin":"vertical-align:-0.12em margin-right:0.3em opacity:0.8 fill:currentColor","svg.s-crumb-unsaved":"vertical-align:0.08em margin-right:0.3em fill:currentColor"},"svg.s-crumb-sep":"flex-shrink:0 opacity:0.4",".s-main.s-shell-snap .s-panel":"transition:none",".s-panel-loading":{"&":"position:absolute inset:0 display:flex align-items:center justify-content:center gap:$1 pointer-events:none",i:"width:0.5rem height:0.5rem r:50% background:$s-muted opacity:0.45 animation: s-panel-pulse 1s ease-in-out infinite;","i:nth-child(2)":"animation-delay:0.15s","i:nth-child(3)":"animation-delay:0.3s"},"@keyframes s-panel-pulse":{"0%, 100%":"opacity:0.25 transform:scale(0.8)","50%":"opacity:0.7 transform:scale(1)"}});var p2=!1,T1=class{[U2]=!0;compiled;ancestors;opts;$state=s.proxy({live:[],focus:0});$open=s.proxy({});nextOrder=0;containerEl;geom;lastGeom;layoutQueued=!1;timers=new Set;exiting=new Set;intent=null;settling=null;lastSeen=null;queued=null;constructor(a){if(p2)throw new Error("Staffa: only one routed S.main() (one with `routes`) can be active at a time");p2=!0,this.opts=a,this.compiled=Object.entries(a.routes).map(([e,h])=>({...W2(e),draw:h})),this.ancestors=Object.entries(a.ancestors??{}).filter(e=>e[1]!=null).map(([e,h])=>({...W2(e),fn:h})),s(()=>{let e=this.computeTarget(),h={...w.current.search},p=w.current.hash;s.peek(()=>{let r=this.lastSeen;if(r&&r.path!==w.current.path){let o=this.$state.live.find(d=>d.path===r.path);o&&(o.search=r.search,o.hash=r.hash)}this.lastSeen={path:w.current.path,search:h,hash:p},this.propose(e),Array.isArray(w.current.state.panels)||Object.assign(w.current.state,this.stateFor({stack:this.paths(),focus:this.$state.focus}))})}),this.interceptLinks(),this.watchTitle(),this.guardTabClose(),s.clean(()=>{for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.queued?.settle(!1),this.queued=null,p2=!1})}resolve(a){let e=f1(a);for(let h of this.compiled){let p=h2(h,e);if(p)return{draw:h.draw,params:p}}return{draw:this.opts.notFound??G0,params:{}}}matches(a){let e=f1(a);return this.compiled.some(h=>h2(h,e)!=null)}deriveStack(a){let e=N(a),h=this.askAncestors(e),p=h?h.map(N):this.prefixesOf(e),r=[];for(let o of p)o!==e&&!r.includes(o)&&this.matches(o)&&r.push(o);return r.push(e),r}askAncestors(a){let e=f1(a);for(let h of this.ancestors){let p=h2(h,e);if(p)return h.fn(p,a)??void 0}}prefixesOf(a){let e=f1(a),h=[];for(let p=1;p<e.length;p++)h.push("/"+e.slice(0,p).join("/"));return h}pinnedIn(a,e){return a.filter(h=>e.includes(h)?!1:this.$state.live.find(p=>p.path===h)?.$panel.pinned===!0)}unsavedAt(a){return this.$state.live.find(e=>e.path===a)?.$panel.unsaved===!0}targetFor(a,e){let h=Array.isArray(e?.panels)?e.panels.map(String):null;if(h){let p=Array.isArray(e.parked)?e.parked.map(String):[],r=N(a),o=new Set([r]),d=c=>c.map(N).filter(i=>!o.has(i)&&!!o.add(i)),n=d(h);return{stack:[...n,r,...d(p)],focus:n.length}}return s.peek(()=>{let p=this.deriveStack(a).slice(0,-1),r=[...p,...this.pinnedIn(this.paths(),[...p,N(a)]),N(a)];return{stack:r,focus:r.length-1}})}computeTarget(){return this.targetFor(w.current.path,w.current.state)}paths(){return this.$state.live.map(a=>a.path)}propose(a){let e=this.$state.live.filter(h=>!a.stack.includes(h.path)&&h.$panel.unsaved).map(h=>h.path);e.length&&(a={stack:[...a.stack,...e],focus:a.focus}),!(N2(this.paths(),a.stack)&&a.focus===this.$state.focus)&&this.commit(a,w.current.nav)}commit(a,e){this.geom=void 0;let h=w.current.state.pinned,p=new Set(Array.isArray(h)?h.map(String):[]),r=new Map(this.$state.live.map(n=>[n.path,n])),o=[];for(let n of a.stack){let c=r.get(n);if(c){r.delete(n),o.push(c);continue}let i=this.createEntry(n,o.length<=a.focus,p.has(n));e!=="load"&&(i.enter=!0),o.push(i),this.$open[n]=i}let d;for(let n of this.$state.live)r.has(n.path)?this.beginClose(n,d):d=n.path;this.$state.live=o,this.$state.focus=Math.min(a.focus,o.length-1),this.scheduleLayout()}createEntry(a,e,h){let{draw:p,params:r}=this.resolve(a),o={[U2]:!0,order:this.nextOrder++,path:a,draw:p,$ui:s.proxy({holding:!1}),maxWidth:"medium",width:0};return o.$panel=s.proxy({stack:this,params:r,path:a,width:0,visible:e,pinned:h||void 0,close:()=>this.closePath(o.path),open:(d,n)=>this.navigate(d,{from:o.path,how:n})}),o}beginClose(a,e){a.closing=!0,a.anchor=e,a.$panel.visible=!1,delete this.$open[a.path]}playExit(a,e){if(!a.closing){e.remove();return}e.classList.add("s-panel-closing"),e.setAttribute("inert","");let h=a.placed?{el:e,anchor:a.anchor,ride:0}:null;h&&this.exiting.add(h),this.afterTransition(e,"opacity",()=>{h&&this.exiting.delete(h),e.remove()})}afterTransition(a,e,h){let p=!1,r=setTimeout(()=>d(),G+80);this.timers.add(r);let o=()=>{clearTimeout(r),this.timers.delete(r)},d=()=>{o(),p||(p=!0,h())},n=c=>i=>{i.target===a&&i.propertyName===e&&c()};a.addEventListener("transitionrun",n(o)),a.addEventListener("transitionend",n(d)),a.addEventListener("transitioncancel",n(d))}intended(){return this.intent??{stack:this.paths(),focus:this.$state.focus}}stateFor(a){return{panels:a.stack.slice(0,a.focus),parked:a.stack.slice(a.focus+1),pinned:this.pinnedPaths()}}pinnedPaths(){return this.$state.live.filter(a=>a.$panel.pinned).map(a=>a.path)}issue(a,e){return this.intent=a,this.settling?(this.queued?.settle(!1),new Promise(h=>{this.queued={run:e,settle:h}})):this.start(e)}start(a){let e=p=>{this.settling=null;let r=this.queued;return this.queued=null,p&&r?this.start(r.run).then(r.settle,()=>r.settle(!1)):(this.intent=null,r?.settle(!1)),p},h=Promise.resolve(a()).then(e,p=>(console.error(p),e(!1)));return this.settling=h,h}focusAt(a){let e=this.intended();if(a<0||a>=e.stack.length||a===e.focus)return Promise.resolve(!1);let h={stack:e.stack,focus:a},p=e.stack[a];return this.issue(h,()=>{let r=this.$state.live.find(o=>o.path===p);return w.go({path:p,search:r?.search,hash:r?.hash,state:this.stateFor(h)})})}back(){return s.peek(()=>{let a=this.intended();return a.focus===a.stack.length-1&&!this.unsavedAt(a.stack[a.focus])?this.closePath(a.stack[a.focus]??""):a.focus===0?Promise.resolve(!1):this.focusAt(a.focus-1)})}closePath(a){return s.peek(()=>{let e=this.intended(),h=e.stack.indexOf(N(a));if(h<0||e.stack.length<2||this.unsavedAt(e.stack[h]))return Promise.resolve(!1);let p=e.stack.filter((c,i)=>i!==h),r=h===e.focus?Math.max(0,h-1):e.focus-(h<e.focus?1:0),o={stack:p,focus:r};if(h===e.focus&&h===e.stack.length-1){let c=this.$state.live.find(b=>b.path===p[r]),i={};c?.search&&(i.search=c.search),c?.hash&&(i.hash=c.hash);let V=p.filter(b=>this.$state.live.find(E=>E.path===b)?.$panel.pinned===!0);return this.issue(o,()=>Promise.resolve(w.back({path:p[r],state:{panels:p.slice(0,r),parked:[]}},i)).then(b=>(b&&(w.current.state.pinned=V),b)))}let d=p[r],n=d!==e.stack[e.focus];return this.issue(o,()=>{let c=n?this.$state.live.find(i=>i.path===d):void 0;return w.go({path:d,search:n?c?.search:{...w.current.search},hash:n?c?.hash:w.current.hash,state:this.stateFor(o)})})})}navigate(a,{from:e,how:h,beneath:p}={}){let r=h??this.opts.linkNavigation,o=r==="open"?null:e??null,d=r==="replace";return s.peek(()=>{let n;try{n=new URL(a,location.href)}catch{return Promise.resolve(!1)}let c=N(n.pathname),i=this.intended(),V=p?-1:i.stack.indexOf(c),b;if(V>=0&&r!=="replace"&&r!=="open"){let f=this.pinnedIn(i.stack.slice(V+1),[]);b={stack:[...i.stack.slice(0,V+1),...f],focus:V}}else{let f=o==null?-1:i.stack.indexOf(o),j=(p?p.map(N):f<0?this.deriveStack(c).slice(0,-1):i.stack.slice(0,d?f:f+1)).filter((Q,v,u)=>Q!==c&&u.indexOf(Q)===v),I=[...j,...this.pinnedIn(i.stack,[...j,c,d?o:null])];b={stack:[...I,c],focus:I.length}}let E=V>=0?this.$state.live.find(f=>f.path===c):void 0,m=n.search?Object.fromEntries(new URLSearchParams(n.search)):E?.search??{},H=n.hash||E?.hash||"";if(b.focus===i.focus&&N2(b.stack,i.stack)&&n.search===location.search&&(n.hash||"")===(location.hash||""))return Promise.resolve(!0);let A=this.stateFor(b);return d?this.issue(b,()=>(w.current.path=c,w.current.search=m,w.current.hash=H,w.current.state=A,s.runQueue(),w.current.path===c)):this.issue(b,()=>w.go({path:c,search:m,hash:H,state:A}))})}pushPath(a,e){return s.peek(()=>{let h=this.intended();return this.navigate(a,{from:h.stack[h.focus],how:e?"replace":"push"})})}interceptLinks(){w.interceptLinks((a,e,h)=>{if(h instanceof KeyboardEvent&&(h.ctrlKey||h.metaKey||h.shiftKey||h.altKey))return!1;let p=e.getAttribute("data-panel")??void 0,r=e.closest(".s-panel"),o=r?this.$state.live.find(d=>d.el===r):e.closest(".s-panel-origin")?this.$state.live[this.$state.focus]:void 0;return this.navigate(a.href,{from:o?.path,how:p}),!0})}get currentPanel(){return this.$state.live[this.$state.focus]?.$panel}get panels(){return this.$state.live.map(a=>a.$panel)}get currentPanelIndex(){return this.$state.focus}pushPanel(a){return this.pushPath(a,!1)}replacePanel(a){return this.pushPath(a,!0)}openPanelStack(a,e){return this.navigate(a,{how:"open",beneath:e})}closePanel(a){return s.peek(()=>{let e=this.intended();return this.closePath(a??e.stack[e.focus]??"")})}setColumns(a){this.opts.columns!==a&&(this.opts.columns=a,this.scheduleLayout())}setAlignment(a){this.opts.alignment!==a&&(this.opts.alignment=a,this.scheduleLayout())}setLinkNavigation(a){this.opts.linkNavigation=a}drawCrumbs(){P1({attrs:".s-crumbs role=navigation aria-label=Breadcrumbs",content:()=>{s(()=>{let a=this.panels.map(p=>p.path),e=this.currentPanelIndex,h;for(let p=0;p<a.length;p++){p&&E2({size:"0.85em",attrs:".s-crumb-sep"});let r=this.drawCrumb(a[p],p,p===e);p===e&&(h=r)}requestAnimationFrame(()=>{h&&E1(h)})})}})}drawCrumb(a,e,h){let p=this.$state.live[e];return s(h?"span.s-crumb aria-current=page":"a.s-crumb",()=>{h||s("href=",a),s(()=>{p?.$panel.visible&&s(".s-crumb-on")}),s(()=>{p?.$panel.unsaved&&z2({size:"0.45em",attrs:".s-crumb-unsaved"})}),s(()=>{p?.$panel.pinned&&X1({size:"0.85em",attrs:".s-crumb-pin"})}),s(()=>{s("#",p?.$panel.title??p?.$ui.fallback??(a.split("/").pop()||a))}),e2({link:a,items:[{label:()=>{s(()=>{s("#",p?.$panel.pinned?"Unpin":"Pin")})},icon:()=>{s(()=>{(p?.$panel.pinned?P2:X1)()})},click:()=>{p&&this.togglePin(p)}},{label:"Close",icon:l1,disabled:p?.$panel.unsaved===!0,click:()=>{this.closePath(a)}}]})})}togglePin(a){a.$panel.pinned=!a.$panel.pinned||void 0,w.current.state.pinned=this.pinnedPaths()}watchTitle(){let a=document.title;s(()=>{let e=this.$state.live[this.$state.focus],h=e?.$panel.title??e?.$ui.fallback,p=typeof this.opts.title=="string"?this.opts.title:void 0,r=this.$state.live.some(d=>d.$panel.unsaved),o=h&&p?`${h} \xB7 ${p}`:h||p;o&&(document.title=(r?"\u2022 ":"")+o)}),s.clean(()=>{document.title=a})}guardTabClose(){if(typeof window>"u")return;let a=e=>{let h=this.$state.live.find(p=>p.$panel.unsaved);h&&(e.preventDefault(),e.returnValue=!0,this.flushLayout(),h.$panel.visible||this.focusAt(this.intended().stack.indexOf(h.path)))};s(()=>{this.$state.live.some(e=>e.$panel.unsaved)&&(window.addEventListener("beforeunload",a),s.clean(()=>window.removeEventListener("beforeunload",a)))})}drawColumns(){let a=s("div.s-panels role=main",()=>{this.containerEl=s(),s.onEach(this.$open,e=>this.drawPanel(e),e=>e.order)});if(typeof ResizeObserver<"u"){let e=new ResizeObserver(()=>this.layout());e.observe(a),s.clean(()=>e.disconnect())}s.clean(()=>{this.containerEl===a&&(this.containerEl=void 0)}),this.scheduleLayout()}drawPanel(a){let e;s(()=>{let h=a.$panel.maxWidth;a.maxWidth=h==="small"||h==="large"||h==="none"?h:"medium";let p=this.roomFor(a.maxWidth);p&&(a.width=p,s.peek(a.$panel,"width")!==p&&(a.$panel.width=p),e&&(e.style.width=`${p}px`,this.scheduleLayout()))}),e=s(`section.s-panel${a.width?` w:${a.width}px`:""}`,"destroy=",h=>this.playExit(a,h),()=>{s(()=>this.drawActions(a)),s("div.s-content",()=>{if(a.draw(a.$panel),w.persistScroll(a.path),s.peek(a.$panel,"title")==null){let h=N0(s());h&&s.peek(a.$ui,"fallback")!==h&&(a.$ui.fallback=h)}}),s(()=>{!a.$panel.loading||a.$ui.holding||s("div.s-panel-loading aria-hidden=true",()=>{s("i"),s("i"),s("i")})})}),a.el=e,a.placed=!1,e.style.transition="none",s.clean(()=>{a.el===e&&(a.el=void 0)}),s(()=>{a.$panel.loading,this.scheduleLayout()}),this.scheduleLayout()}drawActions(a){this.opts.$shell.narrow||a.$panel.actions==null||s("div.s-panel-actions",()=>l(a.$panel.actions))}scheduleLayout(){this.layoutQueued||(this.layoutQueued=!0,requestAnimationFrame(()=>this.flushLayout()))}flushLayout(){this.layoutQueued&&(this.layoutQueued=!1,this.layout())}measure(){let a=this.containerEl,e=a?a.getBoundingClientRect().width:0;if(!e)return;let h=Math.ceil(e/O1),p=e/h>=U0?e/h:Math.min(e,O1),r=o=>Math.min(o*p,e);return{area:e,size:{small:p,medium:r(2),large:r(3),none:e}}}geometry(){return this.geom??=this.measure()}roomFor(a){return this.geometry()?.size[a]??0}layout(){let a=this.containerEl,e=a?.closest(".s-main");if(!a||!e)return;let h=this.$state.live,p=h.length;if(!p||h.some(v=>!v.el))return;this.geom=void 0;let r=this.geometry();if(!r)return;let o=this.opts.columns==="single",d=this.lastGeom?.area!==r.area;d&&(this.lastGeom=r,e.classList.add("s-shell-snap"));let n=v=>r.size[v.maxWidth],c=Math.min(this.$state.focus,p-1),i=c,V=n(h[c]);if(!o)for(let v=c-1;v>=0;v--){let u=V+n(h[v]);if(u>r.area)break;V=u,i=v}let b=i>0?0:r.area-V,E=this.opts.alignment??"center",m=E==="spaced"?b/(c-i+2):0,H=E==="left"?0:E==="right"?b:E==="spaced"?m:b/2;for(let v=i;v<=c;v++)h[v].width=n(h[v]);for(let v of h)v.width||(v.width=n(v));let A=[],f=[],P=new Map,j=new Map;if(!d)for(let v of h)v.placed&&j.set(v,W0(v.el));let I=H,Q=0;for(let v=0;v<i;v++)I-=h[v].width;for(let v=0;v<p;v++){let u=h[v],C=u.el,e1=v>=i&&v<=c;v===c+1&&(I=Math.max(I,r.area)),(u.enter||!u.placed)&&(!u.$panel.loading||u.holdDone?u.$ui.holding=!1:u.$ui.holding||(u.$ui.holding=!0,this.holdEnter(u))),u.placed?(Q=parseFloat(C.style.left)-I,P.set(u.path,Q),Q&&!d&&(C.style.transition=`opacity ${G}ms linear`,C.style.transform=`translateX(${(j.get(u)??0)+Q}px)`,f.push(C)),C.style.left=`${I}px`,u.enter&&!u.$ui.holding&&this.releaseEnter(u)):(A.push(u),C.style.left=`${I}px`,u.enter&&e1&&(C.style.transform=`translateX(${Q}px)`,C.classList.add("s-panel-enter","s-panel-new"))),C.style.width=`${u.width}px`,I+=u.width+m,u.$panel.visible!==e1&&(u.$panel.visible=e1),u.$panel.width!==u.width&&(u.$panel.width=u.width),C.classList.toggle("s-panel-sep",e1&&v>i&&!m);let g1=v<i,X2=C.classList.contains("s-panel-hidden")||C.classList.contains("s-panel-parked");e1?C.classList.remove("s-panel-hidden","s-panel-parked"):X2||!u.placed||d?(C.classList.toggle("s-panel-hidden",g1),C.classList.toggle("s-panel-parked",!g1)):this.afterTransition(C,"transform",()=>{u.el!==C||!u.offstage||(C.classList.toggle("s-panel-hidden",g1),C.classList.toggle("s-panel-parked",!g1))}),u.offstage=!e1,C.toggleAttribute("inert",!e1)}for(let v of this.exiting){let u=v.anchor==null?void 0:P.get(v.anchor);u&&(v.ride-=u,v.el.style.transform=`translateX(${v.ride}px)`)}(A.length||f.length||d)&&a.offsetWidth,d&&e.classList.remove("s-shell-snap");for(let v of f)v.style.transition="",v.style.transform="";for(let v of A){let u=v.el;u.style.transition="",u.style.transform="",v.placed=!0,v.$ui.holding||this.releaseEnter(v)}}releaseEnter(a){a.enter=!1;let e=a.el;!e||!e.classList.contains("s-panel-enter")||(e.classList.remove("s-panel-enter"),this.afterTransition(e,"opacity",()=>e.classList.remove("s-panel-new")))}holdEnter(a){let e=setTimeout(()=>{this.timers.delete(e),a.holdDone=!0,a.$ui.holding&&(a.$ui.holding=!1,this.scheduleLayout())},K0);this.timers.add(e)}};function N2(t,a){return t.length===a.length&&t.every((e,h)=>e===a[h])}function W0(t){let a=getComputedStyle(t).transform;return a&&a!=="none"?new DOMMatrixReadOnly(a).m41:0}function N0(t){let a=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let e=a.nextNode();e;e=a.nextNode()){let h=e.textContent.trim();if(h)return h.length>48?`${h.slice(0,47).trimEnd()}\u2026`:h}}function G0(t){s("p fg:$s-muted",()=>s("#",`No panel at ${t.path}`))}var X0=200;x.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","body > &":"margin: calc(-1 * $3)","> header":"border:0 border-bottom: 1px solid $s-faint; r:0 position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-faint; fg:$s-muted","> header > .s-bar, > footer > .s-bar":"display:flex align-items:center width:100% margin-inline:auto gap:$3 padding: $2 $3;","> header .s-logo, > header .s-nav-trigger":"display:flex align-items:center flex-shrink:0","> header .s-nav-trigger":"margin-left:-0.375rem","> header .s-logo":"font-size:1.4em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent;","> header .s-titles":"display:flex flex-direction:column min-width:5rem flex: 0 1 auto;","> header .s-subtitle":"fg:$s-muted font-size:0.85em line-height:1.5 overflow:hidden text-overflow:ellipsis white-space:nowrap","> header .s-title":"font-weight:800 font-size:1.1em line-height:1.2 overflow:hidden text-overflow:ellipsis white-space:nowrap letter-spacing:-0.01em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent; width:fit-content max-width:100%","> header a.s-logo, > header a.s-title":"text-decoration:none filter:none cursor:pointer","> header .s-menu":"display:flex align-items:center justify-content:flex-end gap:$2 flex: 1 1 auto;",".s-body":"flex:1 overflow:clip display:flex flex-direction:row min-height:0 justify-content:center position:relative",".s-body-inner":"flex:1 min-width:0 display:flex flex-direction:row min-height:0","&.s-nav-right .s-body-inner":"flex-direction:row-reverse",".s-nav-sep":"width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);",".s-body main":`flex:1 min-width:0 min-height:0 overflow-x:hidden overflow-y:auto display:flex flex-direction:column transition: transform ${G}ms ease;`,".s-body main.s-slide-in":"transform: translateX(100%); transition:none",".s-body main > .s-content":"width:100% flex:1 p:$3",".s-body main.s-scroll-y":"margin-right:$3"},".s-nav-panel":{"&":"display:flex flex-direction:column overflow-y:auto flex-shrink:0 width: calc(var(--s-nav-w) - 1px); padding:$3 gap:$1"},".s-nav-page":{"&":`position:absolute inset:0 z-index:5 display:flex flex-direction:column overflow-y:auto overscroll-behavior:contain border:0 r:0 padding:$2 gap:$1 transition: transform ${G}ms ease, visibility 0s;`,"&.s-nav-page-off":`transform:translateX(-100%) pointer-events:none visibility:hidden transition: transform ${G}ms ease, visibility 0s ${G}ms;`,".s-menu-item":"padding: $2 $3; min-height:3rem font-size:1.05em gap:$3"},[`@container (max-width: ${H1}px)`]:{".s-main .s-nav-panel, .s-main .s-nav-sep":"display:none",".s-main > header > .s-bar":"gap:$1 padding: $1 $2;",".s-main .s-body main.s-scroll-y":"margin-right:0"},[`@container (max-width: ${O1}px)`]:{".s-content > .s-box":"margin-inline: calc(-1 * $3); r:0 border-inline:0"}});function _0(t={}){let a=t.nav,e=t.navPosition??"left",h=x.proxy({open:!1}),p=x.proxy({narrow:typeof document<"u"&&document.documentElement.clientWidth<=H1}),r=t.routes;if(r!=null&&t.content!=null)throw new Error("Staffa: S.main() takes either `content` or `routes`, not both");let o=r?new T1({routes:r,notFound:t.notFound,ancestors:t.ancestors,title:t.title,$shell:p}):null;o&&(x(()=>o.setColumns(t.columns)),x(()=>o.setAlignment(t.alignment)),x(()=>o.setLinkNavigation(t.linkNavigation)));let d=o&&t.home!==null?t.home??"/":null,n=()=>{t.maxWidth!=null&&x("max-width:",t.maxWidth)},c=x("div.s-main",t.attrs,()=>{x(()=>{a==null||!a.items.length?x("--s-nav-w: 0px"):x(`.s-nav-${e}`,`--s-nav-w: ${t.navWidth??X0}px`)}),x(()=>{(o!=null||t.title!=null||t.subtitle!=null||t.logo!=null||t.menu!=null||a!=null&&a.items.length>0)&&x("header.s-s.neutral",t.topbarAttrs,()=>{x("div.s-bar",()=>{x(n),x(()=>{if(p.narrow&&a!=null&&a.items.length){x("div.s-nav-trigger",()=>tt(a,h));return}t.logo!=null&&x(d!=null?"a.s-logo aria-label=Home":"div.s-logo",()=>{d!=null&&x("href=",d),l(t.logo)})}),x("div.s-titles",()=>{x(()=>{t.title!=null&&x(d!=null?"a.s-title":"div.s-title",()=>{d!=null&&x("href=",d),l(t.title)})}),Q0(t,o,a,p)});let V=x.derive(()=>p.narrow?o?.currentPanel?.actions:void 0);x(()=>{let b=V.value,E=b??t.menu;E!=null&&x(`div.s-menu${b!=null?".s-panel-origin":""}`,()=>l(E))})})})}),x("div.s-body",()=>{x("div.s-body-inner",()=>{x(n),x(()=>{a==null||!a.items.length||(x(`nav.s-nav-panel.s-nav-${e}`,t.navAttrs,()=>{u1(a.items)}),x("div.s-nav-sep aria-hidden=true"))}),ht(t,o)}),x(()=>{a!=null&&a.items.length&&h.open&&at(a,t.navPageAttrs,h,p)})}),x(()=>{t.footer!=null&&x("footer",()=>{x("div.s-bar",()=>{x(n),l(t.footer)})})})});return Y0(c,p),a!=null&&y1(()=>a.items,()=>{h.open=!1}),(a!=null||o)&&x(()=>{let i=b=>()=>{N1()||S1()||b()},V=()=>c.querySelector(".s-nav-trigger button");h.open?O("Esc","Close the navigation",i(()=>{h.open=!1,V()?.focus()}),"global"):o&&o.currentPanelIndex>0?O("Esc","Back to the previous panel",i(()=>{o.back()}),"global"):O("Esc","Jump to the navigation",i(()=>{let b=c.querySelector(".s-nav-panel");b?.offsetParent!=null?(b.querySelector("[aria-current=page]")??b.querySelector(".s-menu-item:not([aria-disabled=true])"))?.focus():V()?.click()}),"global")}),o??void 0}var q1=null;function j0(){q1?.()}function Q0(t,a,e,h){x(()=>{if(t.subtitle!=null&&(a==null||J0(a,e,h))){x("div.s-subtitle",()=>l(t.subtitle));return}a?.drawCrumbs()})}function J0(t,a,e){return e.narrow||a==null||t.panels.length>1?!1:Q1(a.items)}function Y0(t,a){if(typeof ResizeObserver>"u")return;let e=new ResizeObserver(h=>{let p=h[0]?.contentBoxSize?.[0],r=p?p.inlineSize:h[0]?.contentRect.width;r!=null&&(a.narrow=r<=H1)});e.observe(t),x.clean(()=>e.disconnect())}function tt(t,a){x1({icon:t.button?.icon??(()=>x(()=>(a.open?l1:L1)())),ariaLabel:t.button?.ariaLabel??"Open navigation",attrs:t.button?.attrs,click:()=>{a.open=!a.open}})}function at(t,a,e,h){let p=!1,r=()=>{p=!0,e.open=!1},o=x("nav.s-nav-page.s-s.neutral aria-label=Navigation create=s-nav-page-off destroy=s-nav-page-off",a,()=>u1(t.items,r));q1=r,x.clean(()=>{q1===r&&(q1=null)});let d=x.peek(o2,"path");x(()=>{o2.path!==d&&!t2(o2.path)&&r()});let n=o.closest(".s-main"),c=o.parentElement?.querySelector(":scope > .s-body-inner"),i=c?.querySelector(":scope > main");c?.setAttribute("inert",""),x(()=>{h.narrow||(e.open=!1)}),x.clean(()=>{c?.removeAttribute("inert"),p&&(i&&et(i),n?.querySelector(".s-nav-trigger button")?.focus())}),requestAnimationFrame(()=>{document.body.contains(o)&&o1(o,".s-menu-item[aria-current=page]")})}function et(t){t.classList.add("s-slide-in"),t.offsetWidth,t.classList.remove("s-slide-in")}function ht(t,a){if(a){a.drawColumns();return}let e=x("main",()=>{x("div.s-content",t.contentAttrs,()=>{l(t.content)})});pt(e)}function pt(t){if(typeof ResizeObserver>"u")return;let a=()=>t.classList.toggle("s-scroll-y",t.offsetWidth>t.clientWidth),e=new ResizeObserver(a);e.observe(t),t.firstElementChild&&e.observe(t.firstElementChild),a(),x.clean(()=>e.disconnect())}import q from"aberdeen";q.insertGlobalCss({".s-select_wrap":{"&":"position:relative display:block",select:"w:100% cursor:pointer padding-right:2.2em; appearance:none","&::after":"content: '\u25BE'; position:absolute right:0.7em top:50%; transform: translateY(-50%); pointer-events:none fg:$s-muted font-size:0.85em"}});function rt(t){Y(t,(a,e)=>{q("div.s-select_wrap",()=>{q("select.s-input",t.inputAttrs,()=>{c1(t,a,e),q("change=",h=>{t.bind&&(t.bind.value=h.target.value)}),q(()=>{let h=typeof t.options=="function"?t.options():t.options,p=t.bind?.value??"";t.placeholder!=null&&q("option",()=>{q("value= disabled=true hidden=true"),p||q("selected=true"),q("#",t.placeholder)});for(let r of h){let o=typeof r=="string"?{value:r,label:r}:{value:r.value,label:r.label??r.value};q("option",()=>{q("value=",o.value),o.value===p&&q("selected=true"),q("#",o.label)})}})})})})}import X from"aberdeen";X.insertGlobalCss({"textarea.s-input, .s-inset.s-inset-bottom":"flex: 0 1 100%; min-height:0","textarea.s-input":"resize:vertical min-height:3em line-height:1.45","textarea.s-input.s-autoGrow":"resize:none min-height:2.5em overflow-y:auto"});function ot(t={}){let a=t.autoGrow!==!1;Y(t,(e,h)=>{A1(t,!0,()=>{let p=X("textarea.s-input",t.inputAttrs,()=>{a?(X(".s-autoGrow"),X("input=",r=>{G2(r.currentTarget),t.input&&t.input(r)})):(X("rows=",t.rows??4),X("resize:",t.resize??(t.suffix?"none":"vertical")),t.input&&X("input=",t.input)),t.placeholder!=null&&X("placeholder=",t.placeholder),t.value!=null&&!t.bind&&X("value=",t.value),t.change&&X("change=",t.change),c1(t,e,h,t.bind)});a&&requestAnimationFrame(()=>G2(p))})})}function G2(t){t.style.height="auto",t.style.height=`${t.scrollHeight+t.offsetHeight-t.clientHeight}px`}export{e2 as addContextMenu,M1 as addTooltip,c0 as alert,m0 as autocomplete,O as bindKey,f0 as box,B as button,g0 as buttonChooser,h1 as buttonGroup,b0 as checkbox,F2 as closeFloatingMenu,j0 as closeNav,i0 as confirm,s1 as dialog,w0 as form,D as formatKey,c2 as getDarkMode,x1 as iconButton,N1 as isDialogOpen,S1 as isFloatingMenuOpen,_0 as main,L2 as matchWords,T0 as menu,q0 as menuButton,s0 as prompt,E1 as revealInStrip,P1 as scrollStrip,rt as select,j2 as setDarkMode,l0 as setKeyHelp,a2 as showFloatingMenu,G1 as showKeyHelp,Z0 as tabs,ot as textarea,U1 as textline,C1 as toast};
|
|
1
|
+
import K from"aberdeen";var d2=t=>`background: $s-bg linear-gradient(${t}, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%));`,R1=d2("170deg"),Z1=d2("180deg"),D1="staffa:darkMode",n2=K.proxy({value:j2()});function j2(){try{let t=localStorage.getItem(D1);if(t==="dark")return!0;if(t==="light")return!1}catch{}}function Q2(t){n2.value=t;try{t===void 0?localStorage.removeItem(D1):localStorage.setItem(D1,t?"dark":"light")}catch{}}function c2(t=!1){let a=n2.value;return a===void 0&&!t?K.darkMode():a}K(()=>{c2()?K.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#0e0f12 --s-text:#e9eaec",".s-s.neutral":"--s-bg:#191b1f --s-text:#e9eaec",".s-s.neutral .s-s.neutral":"--s-bg:#23262b"}):K.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#eef0f3 --s-text:#1d1f24",".s-s.neutral, .s-s.neutral":"--s-bg:#ffffff --s-text:#1d1f24",".s-s.neutral .s-s.neutral":"--s-bg:#f6f7f9"})});K.setSpacingCssVars(1.1);K.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 p:$3 min-height:100dvh line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased text:$s-text "+R1,a:"color: $s-link-fg; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select, optgroup":"font:inherit color:inherit","input:where(:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=image],[type=submit],[type=button],[type=reset],[type=hidden])), textarea, select":"background:$s-bg border: 1px solid $s-faint; r:$s-radius-sm padding: 0.45em 0.65em; max-width:100%","input:where([type=checkbox],[type=radio])":"width:1.15em height:1.15em cursor:pointer","input[type=range]":"appearance:none background:transparent cursor:pointer vertical-align:middle","input[type=range]::-webkit-slider-runnable-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-progress":"height:4px r:99px background:$s-accent","input[type=range]::-webkit-slider-thumb":"appearance:none width:16px height:16px margin-top:-6px r:50% background:$s-accent","input[type=range]::-moz-range-thumb":"width:16px height:16px border:0 r:50% background:$s-accent","input[type=file]":"cursor:pointer",progress:"appearance:none border:0 height:6px r:99px background:$s-faint overflow:hidden vertical-align:middle","progress::-webkit-progress-bar":"background:$s-faint r:99px","progress::-webkit-progress-value":"background:$s-accent r:99px","progress::-moz-progress-bar":"background:$s-accent r:99px",meter:"vertical-align:middle",fieldset:"border: 1px solid $s-faint; r:$s-radius-sm padding:$2 min-width:0",legend:"padding: 0 $1; font-weight:600","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-text, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-text, $s-bg 92%); p:$3 r: $s-radius; overflow:auto","pre code":"background:transparent p:0","img, svg, video, canvas":"max-width:100% h:auto",hr:"border:0 border-top: 1px solid $s-faint;","::placeholder":"color: $s-muted; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-muted font-size:0.9em","@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":"transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important;"},":root":"--s-primary:#00a884 --s-danger:#dc5b41 --s-success:#00a884 --s-warning:#ef6b00 --s-link:#3f8cd8 --s-radius-sm:6px --s-radius:12px --s-radius-lg:18px --s-focus: color-mix(in srgb, $s-primary 38%, transparent); --s-gradient: linear-gradient(135deg, color-mix(in oklab, $s-primary, white 16%), color-mix(in oklab, $s-primary, black 14%));",":root, .s-s.neutral":"--s-accent:$s-primary --s-link-fg:$s-link",".s-s:not(.neutral)":"--s-bg:$s-primary border:0 --s-text:#eee --s-accent:#fff --s-link-fg:#eef --s-muted: color-mix(in srgb, #fff 70%, transparent); --s-faint: color-mix(in srgb, #fff 30%, transparent);",".s-s.danger":"--s-bg:$s-danger",".s-s.success":"--s-bg:$s-success",".s-s.warning":"--s-bg:$s-warning",".s-s.link":"--s-bg:$s-link",".s-s.primary":"--s-bg:$s-primary",":root, .s-s":"--s-muted: color-mix(in oklab, $s-text, $s-bg 42%); --s-faint: color-mix(in oklab, $s-text, $s-bg 80%); color:$s-text accent-color:$s-accent scrollbar-width:thin scrollbar-color: $s-faint transparent;",".s-s":R1+" r:$s-radius",":where(.s-s.neutral)":"border: 1px solid $s-faint;",".s-s::-webkit-scrollbar, .s-s ::-webkit-scrollbar":"width:10px height:10px",".s-s::-webkit-scrollbar-track, .s-s ::-webkit-scrollbar-track":"background:transparent",".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb":"background:$s-faint border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s.shadow.neutral:not(.s-btn)":"box-shadow: 0 4px 14px rgba(0,0,0,0.13);",".s-s.extra-shadow.neutral:not(.s-btn)":"box-shadow: 0 18px 50px rgba(0,0,0,0.28);",".s-s.shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 4px 14px color-mix(in srgb, $s-bg 30%, transparent);",".s-s.extra-shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 14px 40px color-mix(in srgb, $s-bg 40%, transparent);",".s-s.no-shadow":"box-shadow: none !important;",".s-s:not(.neutral).tonal, .s-s:not(.neutral).outlined":{"&":"--s-text:$s-bg --s-accent:$s-bg --s-link-fg:$s-bg --s-faint: color-mix(in srgb, $s-bg 30%, transparent); --s-muted: color-mix(in srgb, $s-bg 70%, transparent);",code:"background:transparent padding:0",pre:"background:transparent border: 1px solid $s-faint;"},".s-s:not(.neutral).tonal":"background: color-mix(in srgb, $s-bg 15%, transparent); border: 1px solid $s-faint;",".s-s:not(.neutral).outlined":"background: transparent; border: 1px solid color-mix(in srgb, $s-bg 45%, transparent);",".s-s:not(.neutral) .s-s.tonal, .s-s:not(.neutral) .s-s.outlined":"--s-text:#fff --s-accent:#fff --s-link-fg:#fff "+R1+" border-color: transparent;"});K.insertGlobalCss({".s-preload, .s-preload *, .s-preload *::before, .s-preload *::after":"transition: none !important; animation: none !important;"});if(typeof document<"u"&&typeof requestAnimationFrame=="function"){let t=document.documentElement;t.classList.add("s-preload"),requestAnimationFrame(()=>requestAnimationFrame(()=>t.classList.remove("s-preload")))}K.insertGlobalCss({":disabled, [aria-disabled=true]":"opacity:0.45 filter:saturate(0.6) user-select:none",":disabled, [aria-disabled=true], :disabled *, [aria-disabled=true] *":"pointer-events:none cursor:not-allowed"});var J2="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";K.insertGlobalCss({[`${J2}`]:{"&":"margin:0","&:not(:first-child)":"margin-top:$3"},"h1, h2, h3, h4, h5, h6":{"&":"line-height:1.15 font-weight:700 text-wrap:balance","&:not(:first-child)":"margin-top:1.4em"},h1:"font-size:2em font-weight:800 letter-spacing:-0.022em",h2:"font-size:1.55em letter-spacing:-0.018em",h3:"font-size:1.3em letter-spacing:-0.011em",h4:"font-size:1.1em",h5:"font-size:0.95em letter-spacing:0.005em",h6:"font-size:0.8em fg:$s-muted text-transform:uppercase letter-spacing:0.07em","ul, ol":{"&":"padding-left:1.5em","> li:not(:first-child), li > &:not(:first-child)":"margin-top:$1"},blockquote:"border-left: 3px solid $s-faint; padding-left: $3; fg: $s-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-faint; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-faint;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-muted font-size:0.9em margin-top:$1 text-align:center"});import B1 from"aberdeen";var b1=typeof navigator<"u"&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),Y2={esc:"escape",space:" "},t0={" ":"Space",escape:"Esc",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192"},w1=new WeakMap,Z=[];function s2(){let t=B1();if(!t)throw new Error("Staffa: claimKeyboard needs a current element");return Z.push(t),()=>{let a=Z.indexOf(t);a>=0&&Z.splice(a,1)}}function l2(t){let[,a,e,h]=/^(mod\+)?(shift\+)?(.*)$/i.exec(t),p=h.toLowerCase();if(p=Y2[p]??p,!p||p.length>1&&/[-+]/.test(p))throw new Error(`Staffa: can't parse key "${t}" \u2014 write "k", "f2", "mod+k" or "mod+shift+f2"`);if(e&&p.toUpperCase()===p)throw new Error(`Staffa: "${t}" \u2014 write the shifted character itself ("?", not "shift+/")`);return(a?"mod+":"")+(e?"shift+":"")+p}function a0(t){if(t.altKey||(b1?t.ctrlKey:t.metaKey))return null;let a=t.key.toLowerCase(),e=t.shiftKey&&(a.length>1||t.key.toUpperCase()!==a);return((b1?t.metaKey:t.ctrlKey)?"mod+":"")+(e?"shift+":"")+a}function M2(t,a){if(!(a instanceof HTMLElement))return!1;let e=t.startsWith("mod+"),h=t.replace(/^(mod\+)?(shift\+)?/,"");if(h==="enter"&&a.closest("a[href]")!=null||!e&&(h==="enter"||h===" ")&&a.closest("button, summary, [role=button]")!=null)return!0;let p=a.tagName;return!e&&h!=="escape"&&(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||a.isContentEditable)}function x2(t,a){let e=Z[Z.length-1];return a.global===!0||!e||e.contains(t)}function e0(t){for(let a=Z.length-1;a>=0;a--)if(Z[a].contains(t))return Z[a]}function v2(){return Z[Z.length-1]??document.body}function m2(t){let a=Z[Z.length-1];return a&&!(t&&a.contains(t))?a:t??document.body}var i2=!1;function h0(t){if(t.defaultPrevented||t.repeat||t.isComposing)return;let a=a0(t),e=t.target instanceof Element?t.target:null;if(!(a==null||M2(a,e)))for(let h=m2(e);h;h=h.parentElement){let p=w1.get(h)?.get(a);if(p&&x2(h,p)){p.press&&(t.preventDefault(),p.press(t));return}}}function u2(t){let a=new Map;for(let e=m2(t);e;e=e.parentElement){let h=w1.get(e);if(h)for(let[p,r]of h)!a.has(p)&&x2(e,r)&&!M2(p,t)&&a.set(p,r)}return[...a]}function O(t,a,e,h="normal"){let p=B1(),r=h==="global"?document.body:h==="local"?p:h==="normal"?(p&&e0(p))??document.body:h;if(!r)throw new Error("Staffa: a local key binding needs a current element");let o=l2(t),d=w1.get(r);d||w1.set(r,d=new Map);let n={description:a,press:e,global:h==="global",prev:d.get(o)};d.set(o,n),i2||(i2=!0,document.addEventListener("keydown",h0)),B1.clean(()=>{let c=d.get(o);if(c===n)n.prev?d.set(o,n.prev):d.delete(o);else for(;c;c=c.prev)if(c.prev===n){c.prev=n.prev;break}})}function B(t,a=!1){let e=l2(t),h=e.startsWith("mod+"),p=h?e.slice(4):e,r=p.startsWith("shift+"),o=r?p.slice(6):p,d=o.length===1?o.toUpperCase():o[0].toUpperCase()+o.slice(1);if(a){let c=o===" "?"Space":r||o.length>1?d:o;return(h?b1?"Meta+":"Control+":"")+(r?"Shift+":"")+c}let n=t0[o]??d;return b1?(r?"\u21E7":"")+(h?"\u2318":"")+n:(h?"Ctrl+":"")+(r?"Shift+":"")+n}import t1 from"aberdeen";import I1 from"aberdeen";var H1=640,p0=0;function J(t="s"){return`${t}-${++p0}`}function M(t,...a){t!=null&&(typeof t=="function"?t(...a):I1("rich=",t))}var r0="a[href], button, input, select, textarea, [tabindex]",f2=t=>t instanceof HTMLElement&&!t.hasAttribute("disabled")&&t.getAttribute("aria-disabled")!=="true"&&t.tabIndex>=0&&t.getClientRects().length>0;function F1(t){return[...t.querySelectorAll(r0)].filter(f2)}function o1(t,a){let e=(a?[...t.querySelectorAll(a)].find(f2):void 0)??F1(t)[0];return e?.focus(),e!=null}function U(t){queueMicrotask(()=>I1(t))}var y2=["scroll","resize","transitionstart","animationstart"];function d1(t,a){let e="",h=0,p=0,r=()=>{let d=t instanceof Element?t.getBoundingClientRect():t,n=`${d.left} ${d.top} ${d.bottom} ${d.width}`;n!==e&&(e=n,a(d),p=0),h=++p>30?0:requestAnimationFrame(r)},o=()=>{p=0,h||r()};for(let d of y2)window.addEventListener(d,o,!0);return I1.clean(()=>{cancelAnimationFrame(h);for(let d of y2)window.removeEventListener(d,o,!0)}),r(),()=>{e="",o()}}import f from"aberdeen";import S from"aberdeen";import I from"aberdeen";I.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var n1=I.proxy(void 0),N=null;function o0(t,a,e,h){let r=window.innerWidth,o=window.innerHeight,d=0,n=0;return h==="bottom"?(d=t.left+(t.width-a)/2,n=t.bottom+7,n+e>o-8&&(n=t.top-e-7)):h==="left"?(d=t.left-a-7,n=t.top+(t.height-e)/2,d<8&&(d=t.right+7)):h==="right"?(d=t.right+7,n=t.top+(t.height-e)/2,d+a>r-8&&(d=t.left-a-7)):(d=t.left+(t.width-a)/2,n=t.top-e-7,n<8&&(n=t.bottom+7)),{x:Math.max(8,Math.min(d,r-a-8)),y:Math.max(8,Math.min(n,o-e-8))}}function K1(){N&&clearTimeout(N),N=setTimeout(()=>{n1.value=void 0,N=null},100)}U(()=>{let t=n1.value;if(!t)return;let{opts:a,anchor:e}=t,h=a.placement??"top",p=I("div.s-tt-tip.s-s.neutral.shadow role=tooltip",a.attrs,()=>{I("mouseenter=",()=>{N&&(clearTimeout(N),N=null)}),I("mouseleave=",K1),M(a.tip)});d1(e,r=>{if(r.bottom<0||r.top>window.innerHeight||r.right<0||r.left>window.innerWidth||e.closest("[inert]")){n1.value=void 0;return}let{x:o,y:d}=o0(r,p.offsetWidth,p.offsetHeight,h);p.style.left=o+"px",p.style.top=d+"px"})});function M1(t){let a=e=>{N&&(clearTimeout(N),N=null),n1.value={opts:t,anchor:e.currentTarget}};I("mouseenter=",a),I("mouseleave=",K1),I("focusin=",e=>{e.target.matches?.(":focus-visible")&&a(e)}),I("focusout=",K1),I.clean(()=>{I.unproxy(n1).value?.opts===t&&(n1.value=void 0)})}S.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:450 line-height:1.1 white-space:nowrap cursor:pointer text-decoration:none padding: $m2 $m3; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline: 3px solid $s-focus; outline-offset: 1px;","&:hover:not([aria-disabled=true])":"filter: brightness(1.06)","&.tonal:hover:not([aria-disabled=true]), &.outlined:hover:not([aria-disabled=true])":"background: color-mix(in srgb, $s-bg 24%, transparent);","&.neutral:hover:not([aria-disabled=true])":"filter:none background: color-mix(in srgb, $s-text 8%, $s-bg);","> svg":"width:1.25em height:1.25em","&:active:not(:disabled):not([aria-disabled=true])":"transform: translateY(1px)","&[aria-disabled=true]":"pointer-events:auto cursor:not-allowed","&.small, .small > &":"padding: $m1 $m2; font-size:0.85em border-radius:$s-radius-sm","&.large, .large > &":"font-size:1.4em border-radius:$s-radius-lg"},".s-icon-btn":{"&":"display:inline-flex align-items:center justify-content:center flex-shrink:0 width:2rem height:2rem p:0 border:0 background:transparent cursor:pointer fg:$s-muted r:$s-radius-sm line-height:1 font-size:1rem text-decoration:none transition: color 0.12s, background 0.12s;","> svg":"width:1.25em height:1.25em","&:hover:not(:disabled):not([aria-disabled=true])":"fg:$s-text background: color-mix(in srgb, $s-text 10%, transparent);","&:focus-visible":"outline: 3px solid $s-focus; outline-offset:1px","&[aria-disabled=true]":"pointer-events:auto cursor:not-allowed","&.small, .small > &":"width:1.6rem height:1.6rem font-size:0.8rem","&.large, .large > &":"width:2.4rem height:2.4rem font-size:1.2rem"},".s-btn.s-busy, .s-icon-btn.s-busy, .s-busy .s-btn[type=submit]":"pointer-events:none cursor:progress",".s-btn.s-busy::after, .s-icon-btn.s-busy::after, .s-busy .s-btn[type=submit]::after":"content:'' flex-shrink:0 width:1em height:1em r:50% border: 2px solid currentColor; border-top-color: transparent; animation: s-spin 0.7s linear infinite;",".s-icon-btn.s-busy > svg":"display:none","@keyframes s-spin":{to:"transform: rotate(360deg)"}});function x1(t){let a=t.href!=null?"a":"button",e=t.tooltip===!1?void 0:t.tooltip,h=t.ariaLabel??(typeof e=="string"?b2(e):void 0);S(`${a}.s-icon-btn`,t.attrs,()=>{g2(t,e!=null),S("aria-label=",h),w2(t.tooltip,t.key,h,t.disabled),M(t.icon)})}function g2(t,a=!1){t.href!=null?(S("role=button"),t.disabled?S("aria-disabled=true"):S("href=",t.href)):t.disabled&&a?(S("type=",t.type??"button"),S("aria-disabled=true tabindex=-1"),S("click=",e=>{e.preventDefault(),e.stopPropagation()})):(S("type=",t.type??"button"),t.disabled&&S("disabled=true")),t.click&&!t.disabled&&d0(t.click)}function d0(t){let a=S.proxy({value:!1});S(()=>{a.value&&S(".s-busy aria-busy=true")}),S("click=",e=>{if(a.value)return;let h=t(e);if(!h||typeof h.then!="function")return;a.value=!0;let p=()=>{a.value=!1};Promise.resolve(h).then(p,r=>{throw p(),r})})}function b2(t){return t.replace(/\*\*(.+?)\*\*|\*(.+?)\*|`(.+?)`|\[(.+?)\]\((.+?)\)/g,(a,e,h,p,r)=>e??h??p??r)}function w2(t,a,e,h){if(t!==!1&&(t!=null||a)&&M1({tip:()=>{M(t),a&&S("#",t==null?B(a):` \xB7 ${B(a)}`)}}),a&&!h){let p=S();S("aria-keyshortcuts=",B(a,!0)),O(a,e,()=>p.click())}}function F(t={}){let a=typeof t=="string"||typeof t=="function"?{content:t}:t,e=a.href!=null?"a":"button",h=a.tooltip===!1?void 0:a.tooltip,p=a.ariaLabel??(a.content==null&&typeof h=="string"?b2(h):void 0);S(`${e}.s-btn.s-s.shadow`,a.attrs,()=>{g2(a,h!=null),p&&S("aria-label=",p),w2(a.tooltip,a.key,typeof a.content=="string"?a.content:p,a.disabled),M(a.icon),M(a.content)})}import H2 from"aberdeen";H2.insertGlobalCss({".s-bgroup":{"&":"display:inline-flex align-items:stretch","&.s-spaced":"gap:$2 flex-wrap:wrap","&.s-vertical":"flex-direction:column","&.s-attached":"gap:0","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child)":"margin-left:-1px","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached:not(.s-vertical) > .s-btn:first-child:not(:last-child)":"border-top-right-radius:0 border-bottom-right-radius:0","&.s-attached:not(.s-vertical) > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-bottom-left-radius:0","&.s-attached.s-vertical > .s-btn:not(:first-child)":"margin-top:-1px","&.s-attached.s-vertical > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached.s-vertical > .s-btn:first-child:not(:last-child)":"border-bottom-left-radius:0 border-bottom-right-radius:0","&.s-attached.s-vertical > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-top-right-radius:0","&.s-attached > .s-btn:hover, &.s-attached > .s-btn:focus-visible":"z-index:1"}});function h1(t={}){let e=`.s-${t.layout??"attached"}${t.vertical?".s-vertical":""}`;H2(`div.s-bgroup${e} role=group`,t.attrs,()=>{if(t.buttons)for(let h of t.buttons)F(h);M(t.content)})}import p1 from"aberdeen";import k from"aberdeen";k.insertGlobalCss({".s-field":{"&":"display:flex flex-direction:column gap:$1","> label":"font-weight:600 font-size:0.9em fg:$s-text user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&[aria-invalid=true]":"border-color:$s-danger"},".s-inset":{"&":"display:contents --s-inset-start:0px --s-inset-end:0px","&:has(> .s-inset_start), &:has(> .s-inset_end)":"position:relative display:grid","> .s-input":"padding-inline-start: calc(0.7em + var(--s-inset-start)); padding-inline-end: calc(0.7em + var(--s-inset-end));","> .s-inset_start, > .s-inset_end":"position:absolute top:0 bottom:0 display:flex align-items:center gap:$1 fg:$s-muted","> .s-inset_start":"left:0.35em","> .s-inset_end":"right:0.35em","&.s-inset-bottom > .s-inset_start, &.s-inset-bottom > .s-inset_end":"top:auto padding-bottom:0.35em","&.s-inset-bottom:has(> .s-inset_start), &.s-inset-bottom:has(> .s-inset_end)":"display:flex flex-direction:column","> .s-inset_start > svg, > .s-inset_end > svg":"width:1.15em height:1.15em","&:has(> .s-inset_end) > input[type=number]":"appearance:textfield","&:has(> .s-inset_end) > input[type=number]::-webkit-inner-spin-button":"appearance:none margin:0"},".s-inset_start, .s-inset_end":"pointer-events:none",".s-inset_start :where(button, a, input, select, textarea, label, [tabindex])":"pointer-events:auto",".s-inset_end :where(button, a, input, select, textarea, label, [tabindex])":"pointer-events:auto"});function Y(t,a){let e=t.id??J("field"),h=()=>!!t.error;k("div.s-field",t.attrs,()=>{k(()=>{t.label!=null&&k("label for=",e,()=>{M(t.label),t.required&&k("span.s-req aria-hidden=true #*")})}),a(e,h),k(()=>{t.help!=null&&!t.error&&k("div.s-help",()=>M(t.help))}),k(()=>{t.error&&k("div.s-error role=alert #",t.error)})})}function c1(t,a,e,h){k("id=",a),t.name&&k("name=",t.name),k(()=>{t.disabled&&k("disabled=true")}),k(()=>{t.required&&k("aria-required=true")}),k(()=>k("aria-invalid=",e()?"true":"false")),h&&k("bind=",h)}function A1(t,a,e){k("div.s-inset",()=>{a&&k(".s-inset-bottom"),e(),A2(()=>t.prefix,"s-inset_start","--s-inset-start"),A2(()=>t.suffix,"s-inset_end","--s-inset-end")})}function A2(t,a,e){k(()=>{let h=t();if(h==null)return;let p=k(`div.${a}.small`,()=>M(h)),r=p.parentElement,o=new ResizeObserver(()=>r?.style.setProperty(e,`${p.offsetWidth}px`));o.observe(p),k.clean(()=>{o.disconnect(),r?.style.setProperty(e,"0px")})})}function U1(t={}){Y(t,(a,e)=>{A1(t,!1,()=>{p1("input.s-input",t.inputAttrs,()=>{p1("type=",t.type??"text"),t.placeholder!=null&&p1("placeholder=",t.placeholder),t.autocomplete!=null&&p1("autocomplete=",t.autocomplete),t.value!=null&&!t.bind&&p1("value=",t.value),t.input&&p1("input=",t.input),t.change&&p1("change=",t.change),c1(t,a,e,t.bind)})})})}var V2=200;f.insertGlobalCss({".s-backdrop":{"&":"position:fixed inset:0 z-index:200 display:block background: rgba(0,0,0,0.55); transition: opacity 0.4s ease-in-out;","&.hidden":"opacity:0 pointer-events:none"},".s-dialog":{"&":"position:fixed z-index:200 top:50% left:50% display:flex flex-direction:column transform:translate(-50%,-50%) min-width:min(20rem,90vw) max-width:min(90vw,44rem) max-height:min(88vh,800px) r: $s-radius-lg; overflow:hidden transition: opacity 0.2s ease-out, transform 0.2s ease-out;","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0 flex-shrink:0","> div":"p:$3 gap:$3 display:flex flex-direction:column overflow-y:auto flex:1 min-height:0","&.hidden":"opacity:0 pointer-events:none transform: translate(-50%, calc(-50% + 20px)); pointer-events:none"}});var i1=f.proxy({}),n0=0,N1=f.derive(()=>{let t=Object.keys(i1);if(t.length)return t[t.length-1]});function W1(){return N1.value!=null}U(()=>{f.onEach(i1,({resolve:t,opts:a},e)=>{let h=()=>{delete i1[e]};f.clean(()=>{a.onClose?.(),t()});let p=document.activeElement;f.clean(()=>{p instanceof HTMLElement&&document.contains(p)&&p.focus()});let r=f.derive(()=>N1.value!=e),o=f("div.s-backdrop create=hidden destroy=hidden .hidden=",r,"click=",()=>{a.allowCancel!==!1&&h()}),d=`s-dialog-title-${e}`,n=f("div.s-dialog.neutral.s-s.extra-shadow role=dialog create=hidden destroy=hidden",a.attrs,()=>{if(!a.keyboardTransparent){let V=f();f.clean(s2()),f("aria-modal=true"),f("keydown=",H=>c0(V,H))}let s=v2();f(()=>{let V=a.allowCancel!==!1;O("esc",V?"Close this dialog":void 0,V?h:()=>{},s)}),f(()=>{a.header!=null&&(f("aria-labelledby=",d),f("header.s-s.neutral id=",d,a.headerAttrs,()=>M(a.header)))}),f("div",a.contentAttrs,()=>{M(a.content,h)}),f(()=>{a.footer!=null&&f("footer.s-s.neutral",a.footerAttrs,()=>M(a.footer))})}),c=0;f(()=>{let s=Object.keys(i1).indexOf(e);s>=0&&(c=s),o.style.zIndex=`${V2+2*c}`,n.style.zIndex=`${V2+2*c+1}`}),requestAnimationFrame(()=>{f.peek(()=>N1.value)===e&&document.body.contains(n)&&o1(n)})},(t,a)=>+a)});function c0(t,a){if(a.key!=="Tab"||a.altKey||a.ctrlKey||a.metaKey)return;let e=F1(t),h=a.shiftKey?e[0]:e[e.length-1];!h||document.activeElement!==h||(a.preventDefault(),(a.shiftKey?e[e.length-1]:e[0]).focus())}function s1(t){let a=++n0;return t.cancelWithScope!==!1&&f.clean(()=>{delete i1[a]}),new Promise(e=>{i1[a]={resolve:e,opts:t}})}function i0(t,a={}){return s1({header:"Alert",allowCancel:!0,content:e=>{f("p",()=>{f("#",t)}),h1({layout:"spaced",attrs:"align-self:flex-end",content:()=>{F({content:"OK",click:e})}})},...a})}function s0(t,a={}){return new Promise(e=>{let h=!1;s1({header:"Confirm",allowCancel:!0,content:p=>{f("p",()=>{f("#",t)}),h1({layout:"spaced",attrs:"align-self:flex-end",content:()=>{F({content:"Cancel",attrs:".neutral",click:p}),F({content:"OK",click:()=>{h=!0,p()}})}})},...a,onClose:()=>{e(h),a.onClose?.()}})})}function l0(t,a="",e={}){return new Promise(h=>{let p=null;s1({header:"Input",allowCancel:!0,content:r=>{f("p",()=>{f("#",t)});let o=f.proxy({value:a});f("form display:contents",()=>{f("submit=",d=>{d.preventDefault(),p=o.value,r()}),U1({bind:f.ref(o,"value")}),h1({layout:"spaced",attrs:"align-self:flex-end",content:()=>{F({content:"Cancel",attrs:".neutral",type:"button",click:r}),F({content:"OK",type:"submit"})}})})},...e,onClose:()=>{h(p),e.onClose?.()}})})}t1.insertGlobalCss({".s-keyhelp":{"&":"display:flex flex-direction:column gap:$1 min-width:14rem","> div":"display:flex align-items:baseline justify-content:space-between gap:$4",kbd:"font-family:inherit font-size:0.85em fg:$s-muted white-space:nowrap border: 1px solid $s-faint; r:$s-radius-sm padding: 0 0.4em;"}});var V1=null;function G1(){if(V1){V1();return}let t=u2(document.activeElement);s1({header:"Keyboard shortcuts",cancelWithScope:!1,keyboardTransparent:!0,onClose:()=>{V1=null},content:a=>{V1=a;let e=h=>{h.repeat||["Control","Shift","Alt","Meta","Escape","?"].includes(h.key)||a()};document.addEventListener("keydown",e,!0),t1.clean(()=>document.removeEventListener("keydown",e,!0)),t1("div.s-keyhelp",()=>{for(let[h,p]of t)p.description!==void 0&&t1("div",()=>{t1("span",()=>M(p.description)),t1("kbd text=",B(h))})})}})}var k2=t1.proxy(!0);function M0(t){k2.value=t}t1(()=>{k2.value&&(O("?",void 0,G1,"global"),O("mod+?","This overview",G1,"global"))});import x from"aberdeen";x.insertGlobalCss({".s-ac":{"> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","> .s-control:focus-within":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus;","&[aria-invalid=true] > .s-control":"border-color:$s-danger",".s-chip":"display:inline-flex align-items:center gap:$1 font-size:0.85em background: color-mix(in oklab, $s-bg, $s-text 10%); border: 1px solid $s-faint; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-text background:$s-faint",input:"flex:1 min-width:6ch border:0 background:transparent color:inherit outline:none padding:0.25em"},".s-ac-menu.s-s":{"&":"position:fixed max-height:15rem overflow-y:auto list-style:none p:$1 margin:0",li:"margin:0",".s-option":"padding: 0.45em 0.6em; r:6px cursor:pointer transition: background 0.1s;",".s-option[aria-selected=true]":"background: color-mix(in srgb, $s-text 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-muted"}});var k1=x.proxy({cur:null});function x0(t,a){t.style.maxHeight="";let p=t.offsetHeight,r=window.innerHeight-a.bottom-4-8,o=a.top-4-8,d=p>r&&o>r;t.style.left=`${a.left}px`,t.style.width=`${a.width}px`,t.style.maxHeight=`${Math.min(p,Math.max(d?o:r,60))}px`,t.style.top=d?"auto":`${a.bottom+4}px`,t.style.bottom=d?`${window.innerHeight-a.top+4}px`:"auto"}U(()=>{let t=k1.cur;if(!t)return;let a,e=x("ul.s-ac-menu.s-s.neutral.shadow role=listbox",`id=${t.id} z-index:${t.zIndex}`,()=>{x("mousedown=",h=>h.preventDefault()),t.draw(),a?.()});a=d1(t.anchor,h=>x0(e,h))});function v0(t){let a=[];for(let e of t.matchAll(/\p{N}+|\p{Lu}+(?=\p{Lu}\p{Ll})|\p{Lu}?\p{Ll}+|\p{Lu}+/gu))a.push(e.index);return a}function L2(t,a){let e=a.toLowerCase().split(/\s+/).filter(Boolean).sort((r,o)=>o.length-r.length);if(!e.length)return!0;let h=v0(t),p=[];return e.every(r=>{let o=h.findIndex((d,n)=>!p[n]&&t.slice(d,d+r.length).toLowerCase()===r);return o<0?!1:(p[o]=!0,!0)})}function m0(t){return typeof t=="string"?{value:t,label:t}:{value:t.value,label:t.label??t.value}}function u0(t){let a=J("ac-menu"),e=x.proxy({query:"",open:!1,active:0}),h=()=>(typeof t.options=="function"?t.options():t.options).map(m0),p=()=>{let v=t.bind?.value;return v==null||v===""?[]:Array.isArray(v)?v:[v]},r=v=>h().find(g=>g.value===v)?.label??v,o=v=>v?h().find(g=>g.label.toLowerCase()===v.toLowerCase())?.value??v:"";if(!t.multi){let v=t.bind?x.peek(t.bind,"value"):void 0;typeof v=="string"&&v&&(e.query=x.peek(()=>r(v)))}let d=()=>{let v=new Set(p()),g=h();t.multi&&(g=g.filter(A=>!v.has(A.value)));let w=e.query.trim();return w&&(g=g.filter(A=>(t.match??L2)(A.label,w))),g},n=(v,g)=>{if(t.multi){let w=Array.isArray(t.bind?.value)?[...t.bind.value]:[];w.includes(v)||w.push(v),t.bind&&(t.bind.value=w),e.query=""}else t.bind&&(t.bind.value=v),e.query=r(v),e.open=!1;e.active=0,g?.focus()},c=v=>{if(!t.bind)return;let g=t.bind.value??[];t.bind.value=g.filter(w=>w!==v)},s,V=()=>{let v=d(),g=e.query.trim(),w=t.allowCustom!==!1&&g!==""&&!v.some(A=>A.label.toLowerCase()===g.toLowerCase());v.forEach((A,z)=>{x("li.s-option role=option",`id=${a}-opt-${z}`,()=>{x(()=>x("aria-selected=",e.active===z?"true":"false")),x("#",A.label),x("click=",()=>n(A.value,s)),x("mousemove=",()=>{e.active=z})})}),w&&x("li.s-option.s-add role=option",()=>{x("#",`Add "${g}"`),x("click=",()=>n(g,s))}),v.length===0&&!w&&x("li.s-empty #No matches")};Y(t,(v,g)=>{x("div.s-ac",t.inputAttrs,()=>{x(()=>x("aria-invalid=",g()?"true":"false"));let w=x("div.s-control",()=>{x("click=",()=>s?.focus()),x(()=>{if(t.multi)for(let A of p())x("span.s-chip",()=>{x("span #",x.peek(()=>r(A))),x("button type=button aria-label=",`Remove ${A}`,()=>{x("#\xD7"),x("click=",z=>{z.stopPropagation(),c(A),s?.focus()})})})}),s=x("input type=text role=combobox autocomplete=off",()=>{x("id=",v,`aria-controls=${a} aria-autocomplete=list`),t.placeholder!=null&&x("placeholder=",t.placeholder),t.disabled&&x("disabled=true"),t.required&&x("aria-required=true"),x("bind=",x.ref(e,"query")),x(()=>x("aria-expanded=",e.open?"true":"false")),x(()=>{let z=d()[e.active];x("aria-activedescendant=",e.open&&z?`${a}-opt-${e.active}`:"")}),x("input=",()=>{e.open=!0,e.active=0}),x("focus=",()=>{e.open=!0}),x("blur=",()=>{setTimeout(()=>D(),150)}),x("keydown=",A=>H(A,s))})});x(()=>{if(!e.open)return;let A=w.closest(".s-dialog")?350:150;k1.cur={id:a,anchor:w,zIndex:A,draw:V},x.clean(()=>{k1.cur?.id===a&&(k1.cur=null)})}),x(()=>{if(t.name)if(t.multi)for(let A of p())x("input type=hidden",()=>{x("name=",t.name),x("value=",A)});else x("input type=hidden",()=>{x("name=",t.name),x("value=",p()[0]??"")})})})});function H(v,g){let w=d(),A=w.length-1;if(v.key==="ArrowDown")v.preventDefault(),e.open=!0,L(Math.min(A,e.active+1));else if(v.key==="ArrowUp")v.preventDefault(),L(Math.max(0,e.active-1));else if(v.key==="Enter"){v.preventDefault();let z=e.query.trim(),T=e.open?w[e.active]:void 0;T?n(T.value,g):t.allowCustom!==!1&&(z||!t.multi)?n(o(z),g):e.open&&(e.open=!1)}else if(v.key==="Escape")e.open&&(v.preventDefault(),e.open=!1);else if(v.key==="Backspace"&&t.multi&&e.query===""){let z=p();z.length&&c(z[z.length-1])}}function L(v){e.active=v,document.getElementById(`${a}-opt-${v}`)?.scrollIntoView({block:"nearest"})}function D(){e.open=!1,t.multi?e.query="":t.allowCustom!==!1?n(o(e.query.trim())):e.query=r(p()[0]??"")}}import r1 from"aberdeen";import y0 from"aberdeen";var v1={size:24,color:"currentColor",strokeWidth:2,cap:"round",join:"round"};function f0(t,a){let e=a.size??v1.size,h=y0('svg.s-icon aria-hidden=true viewBox="0 0 24 24" fill=none',"width=",e,"height=",e,"stroke=",a.color??v1.color,"stroke-width=",a.strokeWidth??v1.strokeWidth,"stroke-linecap=",a.cap??v1.cap,"stroke-linejoin=",a.join??v1.join,a.attrs);h.innerHTML=t}function q(t){return(a={})=>f0(t,a)}var C2=q('<path d="m9 18 6-6-6-6" />');var z2=q('<circle cx="12" cy="12" r="10" />');var $2=q('<path d="M15 3h6v6" /><path d="M10 14 21 3" /><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />');var S2=q('<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" /><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />');var L1=q('<path d="M4 5h16" /><path d="M4 12h16" /><path d="M4 19h16" />');var E2=q('<path d="M12 17v5" /><path d="M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" /><path d="m2 2 20 20" /><path d="M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" />'),X1=q('<path d="M12 17v5" /><path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" />');var P2=q('<path d="M22 2 2 22" />');var l1=q('<path d="M18 6 6 18" /><path d="m6 6 12 12" />');r1.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column overflow:hidden r: $s-radius-lg; position:relative","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0","> div":"p:$3 gap:$3","> header > .s-box-close":"margin-left:auto","> .s-box-close":"position:absolute top:$2 right:$2 z-index:1"}});function g0(t={}){let a=typeof t=="string"||typeof t=="function"?{content:t}:t;r1("section.s-box.s-s.neutral.shadow",a.attrs,()=>{r1(()=>{a.header!=null?r1("header.s-s.neutral",a.headerAttrs,()=>{M(a.header),typeof a.close=="function"&&O2(a.close)}):typeof a.close=="function"&&O2(a.close)}),r1("div",a.contentAttrs,()=>{M(a.content)}),r1(()=>{a.footer!=null&&r1("footer.s-s.neutral",a.footerAttrs,()=>M(a.footer))})})}function O2(t){x1({icon:l1,ariaLabel:"Close",click:t,attrs:".s-box-close"})}import _1 from"aberdeen";function b0(t){_1(()=>{let a=t.bind.value;h1({attrs:t.attrs,buttons:Object.entries(t.options).map(([e,h])=>({content:h,ariaLabel:typeof h=="function"?e:void 0,attrs:a===e?".primary":".neutral",click:()=>{t.bind.value=t.allowDeselect&&a===e?void 0:e}}))})}),t.name&&_1(()=>_1("input type=hidden name=",t.name,"value=",t.bind.value??""))}import P from"aberdeen";P.insertGlobalCss({".s-check":{"&":"display:flex flex-direction:column gap:$1","> label":"display:flex align-items:center gap:$2 cursor:pointer user-select:none","> label:has(input:disabled)":"cursor:not-allowed opacity:0.45 filter:saturate(0.6)",input:"cursor:inherit m:0"}});function w0(t={}){let a=t.id??J("check");P("div.s-check",t.attrs,()=>{P("label for=",a,()=>{P("input type=checkbox",t.inputAttrs,()=>{P("id=",a),t.name&&P("name=",t.name),t.checked&&!t.bind&&P("checked=true"),t.change&&P("change=",t.change),P(()=>{t.disabled&&P("disabled=true")}),P(()=>{t.required&&P("aria-required=true")}),t.bind&&P("bind=",t.bind)}),P(()=>{t.label!=null&&M(t.label),t.required&&P("span.s-req aria-hidden=true #*")})}),P(()=>{t.help!=null&&!t.error&&P("div.s-help",()=>M(t.help))}),P(()=>{t.error&&P("div.s-error role=alert #",t.error)})})}import W from"aberdeen";W.insertGlobalCss({".s-form":{"&":"display:flex flex-direction:column gap:$3","&.grid":"display:grid grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap:$3","&.grid > .s-wide, &.grid > footer":"grid-column: 1 / -1;","&.grid > .s-field":"align-self: start","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 flex-wrap:wrap margin-top:$1"}});function H0(t={}){let a=typeof t=="string"||typeof t=="function"?{content:t}:t,e=W.proxy({value:!1});W("form.s-form",a.attrs,()=>{W(()=>{W(".grid=",a.layout==="grid")}),W(()=>{e.value&&W(".s-busy aria-busy=true")}),W("submit=",h=>{if(h.preventDefault(),a.submit&&!e.value){let p=new FormData(h.target),r={};for(let d of new Set(p.keys())){let n=p.getAll(d);r[d]=n.length===1?n[0]:n}let o=a.submit(r,h);if(o&&typeof o.then=="function"){e.value=!0;let d=()=>{e.value=!1};Promise.resolve(o).then(d,n=>{throw d(),n})}}}),M(a.content),W(()=>{a.actions&&W("footer",a.actionsAttrs,()=>M(a.actions))})})}import i from"aberdeen";import{current as o2}from"aberdeen/route";import y from"aberdeen";import{matchCurrent as L0,current as z1,go as q2}from"aberdeen/route";import E from"aberdeen";import{grow as A0,shrink as V0}from"aberdeen/transitions";E.insertGlobalCss({".s-toasts":"position:fixed bottom:$3 right:$3 z-index:400 display:flex flex-direction:column gap:$2 pointer-events:none max-width:min(90vw,24rem) w:24rem",".s-toast":{"&":"display:flex align-items:flex-start gap:$2 padding: $3; pointer-events:auto position:relative overflow:hidden",".s-toast-body":"display:flex flex-direction:column gap:$1 flex:1 min-width:0",".s-toast-title":"font-weight:700 line-height:1.3",".s-toast-close":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",".s-toast-close:hover":"fg:$s-text",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-text",".s-toast-progress":"position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%"}});var k0=0,m1=E.proxy({});U(()=>{E.peek(()=>E.isEmpty(m1))&&E.isEmpty(m1)||E("div.s-toasts",()=>{E.onEach(m1,t=>{let{opts:a,id:e}=t,h=a.type==="danger"||a.type==="warning"?"alert":"status",p=a.type==null||a.type==="neutral"?"neutral":a.type,r=a.duration??6e3,o,d=null,n=()=>{clearTimeout(o),d&&(d.style.transition="none",d.style.width="100%",d.offsetWidth,d.style.transition=`width ${r}ms linear`,d.style.width="0%"),o=setTimeout(()=>j1(e),r)},c=()=>{clearTimeout(o),o=void 0,d&&(d.style.transition="none",d.style.width="100%")};E.clean(()=>clearTimeout(o)),E(`div.s-toast.s-s.${p}.extra-shadow aria-live=polite role=${h}`,"create=",A0,"destroy=",V0,a.attrs,()=>{r>0&&(E("mouseenter=",c),E("mouseleave=",n)),E("div.s-toast-body",()=>{E(()=>{a.title!=null&&E("div.s-toast-title",()=>M(a.title))}),E("div.s-toast-msg",()=>M(a.message))}),E(()=>{a.dismissible!==!1&&E("button.s-toast-close type=button aria-label=Dismiss",()=>{E("#\xD7"),E("click=",()=>j1(e))})}),r>0&&(d=E("div.s-toast-progress"))}),r>0&&requestAnimationFrame(n)})})});function j1(t){delete m1[t]}function C1(t){let a=++k0;return m1[a]={id:a,opts:t},()=>j1(a)}y.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 r:$s-radius-lg max-width: calc(100vw - 16px); overflow-y:auto max-height:min(80vh,28rem) transition: opacity 0.15s, transform 0.15s, visibility 0s;",".s-menu-list.hidden":"opacity:0 pointer-events:none transform:translateY(-6px) visibility:hidden transition: opacity 0.15s, transform 0.15s, visibility 0.15s;",".s-menu-item":"display:flex align-items:center gap:$2 w:100% scroll-margin:$2 padding: $m2 0; line-height:1.1 r:$s-radius cursor:pointer text-align:left font-weight:450 font-size:0.9em border:0 background:transparent fg:$s-text text-decoration:none transition: color 0.12s, transform 0.12s, text-shadow 0.12s;",".s-menu-item:focus-visible:not([aria-current=page]), .s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page])":"filter:none color: color-mix(in lab, $s-primary 33%, $s-text);",".s-menu-item:focus-visible":"outline-offset:-2px background: color-mix(in srgb, $s-accent 14%, transparent);",".s-menu-item[aria-current=page]":"color:$s-accent filter:none",".s-menu-list .s-menu-item":"padding-inline:$2",".s-menu-item[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"flex-shrink:0",".s-menu-list .s-menu-icon":"display:flex",".s-menu-list .s-menu-icon > svg":"width:1.25em height:1.25em","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-faint 18%, $s-faint 82%, transparent);",".s-menu-key":"margin-left:auto padding-left:$2 font-family:inherit font-size:0.8em opacity:0.55 white-space:nowrap flex-shrink:0","@media (hover: none) and (pointer: coarse)":{".s-menu-key":"display:none"},".s-menu-tt-key":"font-family:inherit font-size:0.85em opacity:0.7 white-space:nowrap",".s-tt-tip hr.s-menu-sep":"margin: 0.35em 0;",".s-menu-chevron":"margin-left:auto flex-shrink:0 display:flex transition: transform 0.15s ease;",".s-menu-key + .s-menu-chevron":"margin-left:0",".s-menu-chevron > svg":"width:1em height:1em",".s-menu-details":{"> summary":"list-style:none","> summary::-webkit-details-marker":"display:none","&::details-content":"interpolate-size:allow-keywords block-size:0 overflow-y:clip transition: block-size 0.15s ease, content-visibility 0.15s allow-discrete;","&[open]::details-content":"block-size:auto","&[open] > summary .s-menu-chevron":"transform:rotate(90deg)"},".s-menu-sub":"display:flex flex-direction:column gap:$1 padding-left:$3",".s-menu-inline":"display:flex flex-direction:column gap:$1"});function u1(t,a,e){y("keydown=",h=>{if(h.key==="Enter"&&!h.ctrlKey&&!h.metaKey&&!h.shiftKey&&!h.altKey&&h.target.tagName==="A"){queueMicrotask(()=>a?.());return}if(h.key!=="ArrowDown"&&h.key!=="ArrowUp"&&h.key!=="Home"&&h.key!=="End")return;h.preventDefault();let r=[...h.currentTarget.querySelectorAll(".s-menu-item")].filter(c=>c.getAttribute("aria-disabled")!=="true"&&!$0(c));if(!r.length)return;let o=r.indexOf(document.activeElement),d=h.key==="ArrowUp"?-1:1,n=h.key==="Home"?0:h.key==="End"?r.length-1:o<0?d>0?0:r.length-1:(o+d+r.length)%r.length;r[n].focus()}),R2(t,{onLeafSelect:a,keyHints:e,$hasCurrent:y.derive(()=>Q1(t))})}function R2(t,a){for(let e of t){if(typeof e=="string"||typeof e=="function"){M(e);continue}if("separator"in e){y("hr.s-menu-sep");continue}e.items?z0(e,a):C0(e,a)}}function C0(t,a){let e=!1,h=y(t.href?"a.s-menu-item data-panel=open":"button.s-menu-item type=button",t.attrs,()=>{t.href&&(y("href=",t.href),t.target&&y("target=",t.target),y(()=>{let p=!e;e=!0,J1(t)&&(y("aria-current=page"),requestAnimationFrame(()=>h.scrollIntoView({block:"nearest",behavior:p?"instant":"smooth"})))})),t.disabled&&y("aria-disabled=true"),t.key&&y("aria-keyshortcuts=",B(t.key,!0)),y("click=",p=>{if(t.disabled){p.preventDefault();return}a.onLeafSelect?.(),t.click?.(p)}),t.icon&&y("span.s-menu-icon",()=>M(t.icon)),M(t.label),B2(t,a)})}var D2=new Map;function T2(t,a){return D2.set(t,a),a}function z0(t,a){let e=t.href??Z2(t.items),h=e!=null?y.derive(()=>Y1(t)?T2(e,!0):a.$hasCurrent.value?T2(e,!1):D2.get(e)??!1):null;y("details.s-menu-details",()=>{h&&y(()=>{h.value&&y("open=true")}),y("summary.s-menu-item.s-menu-branch",t.attrs,()=>{t.disabled&&y("aria-disabled=true"),t.key&&y("aria-keyshortcuts=",B(t.key,!0)),y(()=>{J1(t)&&y("aria-current=page")}),y("click=",p=>{if(t.disabled){p.preventDefault();return}e!=null&&(p.preventDefault(),E0(e),q2(e)),t.click?.(p)}),t.icon&&y("span.s-menu-icon",()=>M(t.icon)),M(t.label),B2(t,a),y("span.s-menu-chevron aria-hidden=true",()=>C2())}),y("div.s-menu-sub",()=>R2(t.items,a))})}function $0(t){for(let a=t.closest("details");a;a=a.parentElement&&a.parentElement.closest("details"))if(!a.open&&t.closest("summary")?.parentElement!==a)return!0;return!1}function Q1(t){return t.some(a=>typeof a!="string"&&typeof a!="function"&&!("separator"in a)&&Y1(a))}function J1(t){if(t.href!=null&&L0(t.href))return!0;let a=t.match;if(a==null)return!1;let e=z1.path;if(typeof a=="function")return a(e);let h=a.replace(/\/+$/,"")||"/";return e===h||e.startsWith(h==="/"?"/":h+"/")}function Y1(t){if(J1(t))return!0;for(let a of t.items??[])if(!(typeof a=="string"||typeof a=="function"||"separator"in a)&&Y1(a))return!0;return!1}function Z2(t){for(let a of t){if(typeof a=="string"||typeof a=="function"||"separator"in a)continue;let e=a.href??(a.items?Z2(a.items):void 0);if(e!=null)return e}}function B2(t,a){let e=a.keyHints?void 0:t.key;t.key&&!e&&y("kbd.s-menu-key aria-hidden=true text=",B(t.key)),!(t.tooltip==null&&!e)&&M1({placement:"right",tip:()=>{M(t.tooltip),e&&(t.tooltip!=null&&y("hr.s-menu-sep"),y("kbd.s-menu-tt-key aria-hidden=true text=",B(e)))}})}function y1(t,a){y(()=>{for(let e of I2(t(),[]))O(e.key,e.label,h=>{F2(),a?.(),e.click?.(h),e.href!=null&&S0(e.href,e.target)})})}function I2(t,a){for(let e of t)typeof e=="string"||typeof e=="function"||"separator"in e||(e.key&&!e.disabled&&a.push(e),e.items&&I2(e.items,a));return a}function S0(t,a){let e=new URL(t,location.href);a?window.open(e.href,a,a==="_blank"?"noopener":""):e.origin!==location.origin?location.href=e.href:q2(t)}var $1=null;function E0(t){try{$1=new URL(t,location.href).pathname.replace(/\/+$/,"")||"/"}catch{$1=null}}function t2(t){return $1!==t?!1:($1=null,!0)}var a1=y.proxy({opts:null});function j(){let t=a1.opts?.anchor;a1.opts=null,t?.focus()}function S1(t){let a=a1.opts;return a!=null&&(t==null||a.anchor===t)}function F2(t){S1(t)&&j()}function P0(t,a){let e=t.offsetWidth,h=t.offsetHeight,p=window.innerWidth,r=window.innerHeight,o=4,d=a.left;d+e>p-8&&(d=Math.max(8,a.right-e));let n=a.bottom+o;n+h>r-8&&a.top-h-o>=8&&(n=a.top-h-o),t.style.left=Math.max(8,d)+"px",t.style.top=Math.max(8,n)+"px"}function O0(t){return[{label:"Open in new tab",icon:$2,click:()=>{window.open(t,"_blank","noopener")}},{label:"Copy link",icon:S2,click:()=>{T0(t)}}]}async function T0(t){let a=new URL(t,location.href).href;try{await navigator.clipboard.writeText(a),C1({message:"Link copied."})}catch{C1({message:"Couldn't copy the link.",type:"danger"})}}U(()=>{let t=a1.opts;if(!t)return;let a=y("div.s-menu-list.s-s.neutral.shadow create=hidden destroy=hidden",t.dropdownAttrs,()=>{u1(t.link!=null?[...O0(t.link),{separator:!0},...t.items]:t.items,j,!0)}),e=r=>{let o=r.target;!a.contains(o)&&(t.closeOnAnchorClick||!t.anchor.contains(o))&&j()},h=r=>{(r.key==="Escape"||r.key==="Tab")&&(r.preventDefault(),j())},p=y.peek(z1,"path");y(()=>{z1.path!==p&&!t2(z1.path)&&j()}),document.addEventListener("click",e,!0),document.addEventListener("keydown",h,!0),y.clean(()=>{document.removeEventListener("click",e,!0),document.removeEventListener("keydown",h,!0)}),d1(t.at?new DOMRect(t.at.x,t.at.y,0,0):t.anchor,r=>P0(a,r)),requestAnimationFrame(()=>{document.body.contains(a)&&o1(a,".s-menu-item[aria-current=page]")})});function q0(t){y("nav.s-menu-inline",t.attrs,()=>{y1(()=>t.items,()=>t.onLeafSelect?.()),u1(t.items,t.onLeafSelect)})}function a2(t){return a1.opts=t,j}function e2(t){y1(()=>t.items);let a=null;y.clean(()=>{a1.opts?.anchor===a&&j()}),y("contextmenu=",e=>{e.preventDefault(),a=e.currentTarget,a2({...t,anchor:a,at:{x:e.clientX,y:e.clientY},closeOnAnchorClick:!0})})}function R0(t){y1(()=>t.items);let a=null;y.clean(()=>{a1.opts?.anchor===a&&j()}),F({icon:L1,...t.button?.content==null?{ariaLabel:"Open menu"}:null,attrs:".neutral",...t.button,click:e=>{if(a=e.currentTarget,a1.opts?.anchor===a){j();return}a2({items:t.items,anchor:a,dropdownAttrs:t.dropdownAttrs})}})}import l,{OPAQUE as U2}from"aberdeen";import*as b from"aberdeen/route";import C from"aberdeen";var D0=q('<path d="m15 18-6-6 6-6"/>'),Z0=q('<path d="m9 18 6-6-6-6"/>');C.insertGlobalCss({".s-strip":{"&":"position:relative display:flex min-width:0","> .s-strip-row":"display:flex align-items:center flex:1 min-width:0 overflow-x:auto overflow-y:hidden scrollbar-width:none scroll-behavior:smooth","> .s-strip-row::-webkit-scrollbar":"display:none","> .s-strip-btn":"position:absolute top:0 bottom:0 z-index:1 display:none align-items:center justify-content:center width:2.4em border:0 padding:0 cursor:pointer fg:$s-muted transition: color 0.15s;","> .s-strip-btn:hover":"fg:$s-text","> .s-strip-btn-left":"left:0 justify-content:flex-start background: linear-gradient(to right, $s-bg 45%, transparent)","> .s-strip-btn-right":"right:0 justify-content:flex-end background: linear-gradient(to left, $s-bg 45%, transparent)","&.s-can-left > .s-strip-btn-left, &.s-can-right > .s-strip-btn-right":"display:flex"},".s-tabs":{"&":"display:flex flex-direction:column gap:$3",".s-tabbar":"border-bottom: 1px solid $s-faint;",".s-tablist":"gap:$1 align-items:stretch margin-bottom:-1px",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-muted; font-weight:600 padding: 0.6em 0.9em; white-space:nowrap border-bottom: 3px solid transparent; transition: color 0.15s, background 0.15s, border-color 0.15s;",".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]":"color: $s-text;",".s-tab:focus-visible":"outline:none box-shadow: inset 0 0 0 2px $s-focus; r: $s-radius;",".s-tab[aria-selected=true]":"border-image: $s-gradient 1;",".s-tabpanel":"display:block"}});function E1(t){C("div.s-strip",t.attrs,()=>{let a=C("div.s-strip-row",t.stripAttrs,()=>M(t.content));K2(a,-1),K2(a,1),I0(a)})}function P1(t){let a=t.parentElement;if(!a||!t.isConnected)return;let e=parseFloat(getComputedStyle(a).fontSize)*2.6,h=t.getBoundingClientRect(),p=a.getBoundingClientRect(),r=h.left-p.left,o=h.right-p.right;r<e?a.scrollBy({left:r-e,behavior:"smooth"}):o>-e&&a.scrollBy({left:o+e,behavior:"smooth"})}function B0(t){let a=J("tabs"),e=(r,o)=>r.id??String(o),h=t.bind??C.proxy(e(t.tabs[0]??{label:""},0));t.tabs.length>0&&!t.tabs.some((r,o)=>e(r,o)===C.peek(()=>h.value))&&(h.value=e(t.tabs[0],0));let p=(r,o)=>{r.disabled||(h.value=e(r,o))};C("div.s-tabs",t.attrs,()=>{E1({attrs:".s-tabbar",stripAttrs:".s-tablist role=tablist",content:()=>{t.tabs.forEach((r,o)=>{let d=e(r,o),n=C("button.s-tab type=button role=tab",()=>{C("id=",`${a}-tab-${d}`,"aria-controls=",`${a}-panel-${d}`),C(()=>{let c=h.value===d;C("aria-selected=",c?"true":"false"),C("tabindex=",c?"0":"-1"),c&&requestAnimationFrame(()=>P1(n))}),r.disabled&&C("disabled=true"),C("click=",()=>p(r,o)),C("keydown=",c=>F0(c,t.tabs,o,p)),M(r.icon),M(r.label)})})}}),C("div.s-tabpanel role=tabpanel",t.contentAttrs,()=>{C(()=>{let r=h.value,o=t.tabs.findIndex((n,c)=>e(n,c)===r),d=t.tabs[o]??t.tabs[0];d&&(C("id=",`${a}-panel-${e(d,o)}`,"aria-labelledby=",`${a}-tab-${e(d,o)}`),M(d.content))})})})}function K2(t,a){C(`button.s-strip-btn.s-strip-btn-${a<0?"left":"right"} type=button`,()=>{C("tabindex=-1 aria-hidden=true"),C("click=",()=>t.scrollBy({left:a*t.clientWidth*.8,behavior:"smooth"})),(a<0?D0:Z0)({size:"1.1em"})})}function I0(t){let a=t.parentElement;if(!a||typeof ResizeObserver>"u")return;let e=()=>{let r=t.scrollWidth-t.clientWidth;a.classList.toggle("s-can-left",t.scrollLeft>1),a.classList.toggle("s-can-right",t.scrollLeft<r-1)};t.addEventListener("scroll",e,{passive:!0});let h=new ResizeObserver(e);h.observe(t);let p=typeof MutationObserver>"u"?void 0:new MutationObserver(r=>{for(let o of r){for(let d of o.addedNodes)d instanceof Element&&h.observe(d);for(let d of o.removedNodes)d instanceof Element&&h.unobserve(d)}e()});p?.observe(t,{childList:!0});for(let r of Array.from(t.children))h.observe(r);e(),C.clean(()=>{t.removeEventListener("scroll",e),h.disconnect(),p?.disconnect()})}function F0(t,a,e,h){let p=e;if(t.key==="ArrowRight"||t.key==="ArrowDown")p=(e+1)%a.length;else if(t.key==="ArrowLeft"||t.key==="ArrowUp")p=(e-1+a.length)%a.length;else if(t.key==="Home")p=0;else if(t.key==="End")p=a.length-1;else return;t.preventDefault();let r=p>=e?1:-1;for(let o=0;o<a.length;o++){let d=a[p];if(d&&!d.disabled){h(d,p),t.currentTarget?.parentElement?.children[p]?.focus();return}p=(p+r+a.length)%a.length}}var r2={integer(t){if(!/^(0|-?[1-9]\d*)$/.test(t))return;let a=Number(t);return Number.isSafeInteger(a)?a:void 0}};function G(t){let a=String(t).replace(/\/+$/,"");return a.startsWith("/")||(a=`/${a}`),a}function f1(t){let a=G(t);return a==="/"?[]:a.slice(1).split("/")}function N2(t){let a=f1(t),e=a.map((h,p)=>{if(!h.startsWith("[")||!h.endsWith("]"))return{kind:"lit",value:h};let r=/^\[\.\.\.([A-Za-z_$][\w$]*)\]$/.exec(h);if(r){if(p!==a.length-1)throw new Error(`Staffa: "${h}" must be the last segment of route "${t}"`);return{kind:"rest",name:r[1]}}let o=/^\[([A-Za-z_$][\w$]*)(?:=([A-Za-z_$][\w$]*))?\]$/.exec(h);if(!o)throw new Error(`Staffa: malformed param "${h}" in route "${t}"`);let[,d,n]=o;if(n&&!(n in r2))throw new Error(`Staffa: unknown matcher "${n}" in route "${t}" (known: ${Object.keys(r2).join(", ")})`);return{kind:"param",name:d,matcher:n}});return{key:t,segs:e}}function K0(t){try{return decodeURIComponent(t)}catch{return t}}function h2(t,a){let e={};for(let h=0;h<t.segs.length;h++){let p=t.segs[h];if(p.kind==="rest")return h>=a.length?null:(e[p.name]=a.slice(h).join("/"),e);if(h>=a.length)return null;let r=a[h];if(p.kind==="lit"){if(r!==p.value)return null}else if(p.matcher){let o=r2[p.matcher](r);if(o===void 0)return null;e[p.name]=o}else e[p.name]=K0(r)}return t.segs.length===a.length?e:null}var X=250,U0=300,N0=360,O1=540;l.insertGlobalCss({":root":`--s-panel-ms:${X}ms`,".s-panels":"flex:1 min-width:0 min-height:0 position:relative overflow:clip isolation:isolate "+Z1,".s-panel":{"&":"position:absolute top:0 bottom:0 left:0 display:flex flex-direction:column "+Z1+` z-index:2 transition: transform ${X}ms ease-out, opacity ${X}ms linear;`,"&.s-panel-sep::before":"content:'' position:absolute left:0 top:0.6rem bottom:0.6rem width:1px z-index:1 background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);","&.s-panel-new":"z-index:1","&.s-panel-closing":"z-index:0 opacity:0 pointer-events:none","&.s-panel-enter":"opacity:0","&.s-panel-hidden, &.s-panel-parked":"visibility:hidden"},".s-panel > .s-content":"flex:1 min-height:0 overflow-y:auto overflow-x:hidden p:$3",".s-panel-actions":"display:flex align-items:center justify-content:flex-end gap:$1 flex-shrink:0 padding: $3 $3 0;",".s-crumbs > .s-strip-row":"gap:$m1",".s-crumb":{"&":"flex: 1 0 4rem; font-size:0.85em line-height:1.5 fg:$s-muted text-decoration:none white-space:nowrap max-width:max-content overflow:hidden text-overflow:ellipsis transition: color 0.12s;","&.s-crumb-on":"font-weight:600 fg:$s-text","a&:hover":"filter:none color: color-mix(in lab, $s-primary 33%, $s-text);","svg.s-crumb-pin":"vertical-align:-0.12em margin-right:0.3em opacity:0.8 fill:currentColor","svg.s-crumb-unsaved":"vertical-align:0.08em margin-right:0.3em fill:currentColor"},"svg.s-crumb-sep":"flex-shrink:0 opacity:0.4",".s-main.s-shell-snap .s-panel":"transition:none",".s-panel-loading":{"&":"position:absolute inset:0 display:flex align-items:center justify-content:center gap:$1 pointer-events:none",i:"width:0.5rem height:0.5rem r:50% background:$s-muted opacity:0.45 animation: s-panel-pulse 1s ease-in-out infinite;","i:nth-child(2)":"animation-delay:0.15s","i:nth-child(3)":"animation-delay:0.3s"},"@keyframes s-panel-pulse":{"0%, 100%":"opacity:0.25 transform:scale(0.8)","50%":"opacity:0.7 transform:scale(1)"}});var p2=!1,T1=class{[U2]=!0;compiled;ancestors;opts;$state=l.proxy({live:[],focus:0});$open=l.proxy({});nextOrder=0;containerEl;geom;lastGeom;layoutQueued=!1;timers=new Set;exiting=new Set;intent=null;settling=null;lastSeen=null;queued=null;constructor(a){if(p2)throw new Error("Staffa: only one routed S.main() (one with `routes`) can be active at a time");p2=!0,this.opts=a,this.compiled=Object.entries(a.routes).map(([e,h])=>({...N2(e),draw:h})),this.ancestors=Object.entries(a.ancestors??{}).filter(e=>e[1]!=null).map(([e,h])=>({...N2(e),fn:h})),l(()=>{let e=this.computeTarget(),h={...b.current.search},p=b.current.hash;l.peek(()=>{let r=this.lastSeen;if(r&&r.path!==b.current.path){let o=this.$state.live.find(d=>d.path===r.path);o&&(o.search=r.search,o.hash=r.hash)}this.lastSeen={path:b.current.path,search:h,hash:p},this.propose(e),Array.isArray(b.current.state.panels)||Object.assign(b.current.state,this.stateFor({stack:this.paths(),focus:this.$state.focus}))})}),this.interceptLinks(),this.watchTitle(),this.guardTabClose(),l.clean(()=>{for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.queued?.settle(!1),this.queued=null,p2=!1})}resolve(a){let e=f1(a);for(let h of this.compiled){let p=h2(h,e);if(p)return{draw:h.draw,params:p}}return{draw:this.opts.notFound??X0,params:{}}}matches(a){let e=f1(a);return this.compiled.some(h=>h2(h,e)!=null)}deriveStack(a){let e=G(a),h=this.askAncestors(e),p=h?h.map(G):this.prefixesOf(e),r=[];for(let o of p)o!==e&&!r.includes(o)&&this.matches(o)&&r.push(o);return r.push(e),r}askAncestors(a){let e=f1(a);for(let h of this.ancestors){let p=h2(h,e);if(p)return h.fn(p,a)??void 0}}prefixesOf(a){let e=f1(a),h=[];for(let p=1;p<e.length;p++)h.push("/"+e.slice(0,p).join("/"));return h}pinnedIn(a,e){return a.filter(h=>e.includes(h)?!1:this.$state.live.find(p=>p.path===h)?.$panel.pinned===!0)}unsavedAt(a){return this.$state.live.find(e=>e.path===a)?.$panel.unsaved===!0}targetFor(a,e){let h=Array.isArray(e?.panels)?e.panels.map(String):null;if(h){let p=Array.isArray(e.parked)?e.parked.map(String):[],r=G(a),o=new Set([r]),d=c=>c.map(G).filter(s=>!o.has(s)&&!!o.add(s)),n=d(h);return{stack:[...n,r,...d(p)],focus:n.length}}return l.peek(()=>{let p=this.deriveStack(a).slice(0,-1),r=[...p,...this.pinnedIn(this.paths(),[...p,G(a)]),G(a)];return{stack:r,focus:r.length-1}})}computeTarget(){return this.targetFor(b.current.path,b.current.state)}paths(){return this.$state.live.map(a=>a.path)}propose(a){let e=this.$state.live.filter(h=>!a.stack.includes(h.path)&&h.$panel.unsaved).map(h=>h.path);e.length&&(a={stack:[...a.stack,...e],focus:a.focus}),!(W2(this.paths(),a.stack)&&a.focus===this.$state.focus)&&this.commit(a,b.current.nav)}commit(a,e){this.geom=void 0;let h=b.current.state.pinned,p=new Set(Array.isArray(h)?h.map(String):[]),r=new Map(this.$state.live.map(n=>[n.path,n])),o=[];for(let n of a.stack){let c=r.get(n);if(c){r.delete(n),o.push(c);continue}let s=this.createEntry(n,o.length<=a.focus,p.has(n));e!=="load"&&(s.enter=!0),o.push(s),this.$open[n]=s}let d;for(let n of this.$state.live)r.has(n.path)?this.beginClose(n,d):d=n.path;this.$state.live=o,this.$state.focus=Math.min(a.focus,o.length-1),this.scheduleLayout()}createEntry(a,e,h){let{draw:p,params:r}=this.resolve(a),o={[U2]:!0,order:this.nextOrder++,path:a,draw:p,$ui:l.proxy({holding:!1}),maxWidth:"medium",width:0};return o.$panel=l.proxy({stack:this,params:r,path:a,width:0,visible:e,pinned:h||void 0,close:()=>this.closePath(o.path),open:(d,n)=>this.navigate(d,{from:o.path,how:n})}),o}beginClose(a,e){a.closing=!0,a.anchor=e,a.$panel.visible=!1,delete this.$open[a.path]}playExit(a,e){if(!a.closing){e.remove();return}e.classList.add("s-panel-closing"),e.setAttribute("inert","");let h=a.placed?{el:e,anchor:a.anchor,ride:0}:null;h&&this.exiting.add(h),this.afterTransition(e,"opacity",()=>{h&&this.exiting.delete(h),e.remove()})}afterTransition(a,e,h){let p=!1,r=setTimeout(()=>d(),X+80);this.timers.add(r);let o=()=>{clearTimeout(r),this.timers.delete(r)},d=()=>{o(),p||(p=!0,h())},n=c=>s=>{s.target===a&&s.propertyName===e&&c()};a.addEventListener("transitionrun",n(o)),a.addEventListener("transitionend",n(d)),a.addEventListener("transitioncancel",n(d))}intended(){return this.intent??{stack:this.paths(),focus:this.$state.focus}}stateFor(a){return{panels:a.stack.slice(0,a.focus),parked:a.stack.slice(a.focus+1),pinned:this.pinnedPaths()}}pinnedPaths(){return this.$state.live.filter(a=>a.$panel.pinned).map(a=>a.path)}issue(a,e){return this.intent=a,this.settling?(this.queued?.settle(!1),new Promise(h=>{this.queued={run:e,settle:h}})):this.start(e)}start(a){let e=p=>{this.settling=null;let r=this.queued;return this.queued=null,p&&r?this.start(r.run).then(r.settle,()=>r.settle(!1)):(this.intent=null,r?.settle(!1)),p},h=Promise.resolve(a()).then(e,p=>(console.error(p),e(!1)));return this.settling=h,h}focusAt(a){let e=this.intended();if(a<0||a>=e.stack.length||a===e.focus)return Promise.resolve(!1);let h={stack:e.stack,focus:a},p=e.stack[a];return this.issue(h,()=>{let r=this.$state.live.find(o=>o.path===p);return b.go({path:p,search:r?.search,hash:r?.hash,state:this.stateFor(h)})})}back(){return l.peek(()=>{let a=this.intended();return a.focus===a.stack.length-1&&!this.unsavedAt(a.stack[a.focus])?this.closePath(a.stack[a.focus]??""):a.focus===0?Promise.resolve(!1):this.focusAt(a.focus-1)})}closePath(a){return l.peek(()=>{let e=this.intended(),h=e.stack.indexOf(G(a));if(h<0||e.stack.length<2||this.unsavedAt(e.stack[h]))return Promise.resolve(!1);let p=e.stack.filter((c,s)=>s!==h),r=h===e.focus?Math.max(0,h-1):e.focus-(h<e.focus?1:0),o={stack:p,focus:r};if(h===e.focus&&h===e.stack.length-1){let c=this.$state.live.find(H=>H.path===p[r]),s={};c?.search&&(s.search=c.search),c?.hash&&(s.hash=c.hash);let V=p.filter(H=>this.$state.live.find(L=>L.path===H)?.$panel.pinned===!0);return this.issue(o,()=>Promise.resolve(b.back({path:p[r],state:{panels:p.slice(0,r),parked:[]}},s)).then(H=>(H&&(b.current.state.pinned=V),H)))}let d=p[r],n=d!==e.stack[e.focus];return this.issue(o,()=>{let c=n?this.$state.live.find(s=>s.path===d):void 0;return b.go({path:d,search:n?c?.search:{...b.current.search},hash:n?c?.hash:b.current.hash,state:this.stateFor(o)})})})}navigate(a,{from:e,how:h,beneath:p}={}){let r=h??this.opts.linkNavigation,o=r==="open"?null:e??null,d=r==="replace";return l.peek(()=>{let n;try{n=new URL(a,location.href)}catch{return Promise.resolve(!1)}let c=G(n.pathname),s=this.intended(),V=p?-1:s.stack.indexOf(c),H;if(V>=0&&r!=="replace"&&r!=="open"){let w=this.pinnedIn(s.stack.slice(V+1),[]);H={stack:[...s.stack.slice(0,V+1),...w],focus:V}}else{let w=o==null?-1:s.stack.indexOf(o),z=(p?p.map(G):w<0?this.deriveStack(c).slice(0,-1):s.stack.slice(0,d?w:w+1)).filter((Q,m,u)=>Q!==c&&u.indexOf(Q)===m),T=[...z,...this.pinnedIn(s.stack,[...z,c,d?o:null])];H={stack:[...T,c],focus:T.length}}let L=V>=0?this.$state.live.find(w=>w.path===c):void 0,D=n.search?Object.fromEntries(new URLSearchParams(n.search)):L?.search??{},v=n.hash||L?.hash||"";if(H.focus===s.focus&&W2(H.stack,s.stack)&&n.search===location.search&&(n.hash||"")===(location.hash||""))return Promise.resolve(!0);let g=this.stateFor(H);return d?this.issue(H,()=>(b.current.path=c,b.current.search=D,b.current.hash=v,b.current.state=g,l.runQueue(),b.current.path===c)):this.issue(H,()=>b.go({path:c,search:D,hash:v,state:g}))})}pushPath(a,e){return l.peek(()=>{let h=this.intended();return this.navigate(a,{from:h.stack[h.focus],how:e?"replace":"push"})})}interceptLinks(){b.interceptLinks((a,e,h)=>{if(h instanceof KeyboardEvent&&(h.ctrlKey||h.metaKey||h.shiftKey||h.altKey))return!1;let p=e.getAttribute("data-panel")??void 0,r=e.closest(".s-panel"),o=r?this.$state.live.find(d=>d.el===r):e.closest(".s-panel-origin")?this.$state.live[this.$state.focus]:void 0;return this.navigate(a.href,{from:o?.path,how:p}),!0})}get currentPanel(){return this.$state.live[this.$state.focus]?.$panel}get panels(){return this.$state.live.map(a=>a.$panel)}get currentPanelIndex(){return this.$state.focus}pushPanel(a){return this.pushPath(a,!1)}replacePanel(a){return this.pushPath(a,!0)}openPanelStack(a,e){return this.navigate(a,{how:"open",beneath:e})}closePanel(a){return l.peek(()=>{let e=this.intended();return this.closePath(a??e.stack[e.focus]??"")})}setColumns(a){this.opts.columns!==a&&(this.opts.columns=a,this.scheduleLayout())}setAlignment(a){this.opts.alignment!==a&&(this.opts.alignment=a,this.scheduleLayout())}setLinkNavigation(a){this.opts.linkNavigation=a}drawCrumbs(){E1({attrs:".s-crumbs role=navigation aria-label=Breadcrumbs",content:()=>{l(()=>{let a=this.panels.map(p=>p.path),e=this.currentPanelIndex,h;for(let p=0;p<a.length;p++){p&&P2({size:"0.85em",attrs:".s-crumb-sep"});let r=this.drawCrumb(a[p],p,p===e);p===e&&(h=r)}requestAnimationFrame(()=>{h&&P1(h)})})}})}drawCrumb(a,e,h){let p=this.$state.live[e];return l(h?"span.s-crumb aria-current=page":"a.s-crumb",()=>{h||l("href=",a),l(()=>{p?.$panel.visible&&l(".s-crumb-on")}),l(()=>{p?.$panel.unsaved&&z2({size:"0.45em",attrs:".s-crumb-unsaved"})}),l(()=>{p?.$panel.pinned&&X1({size:"0.85em",attrs:".s-crumb-pin"})}),l(()=>{l("#",p?.$panel.title??p?.$ui.fallback??(a.split("/").pop()||a))}),e2({link:a,items:[{label:()=>{l(()=>{l("#",p?.$panel.pinned?"Unpin":"Pin")})},icon:()=>{l(()=>{(p?.$panel.pinned?E2:X1)()})},click:()=>{p&&this.togglePin(p)}},{label:"Close",icon:l1,disabled:p?.$panel.unsaved===!0,click:()=>{this.closePath(a)}}]})})}togglePin(a){a.$panel.pinned=!a.$panel.pinned||void 0,b.current.state.pinned=this.pinnedPaths()}watchTitle(){let a=document.title;l(()=>{let e=this.$state.live[this.$state.focus],h=e?.$panel.title??e?.$ui.fallback,p=typeof this.opts.title=="string"?this.opts.title:void 0,r=this.$state.live.some(d=>d.$panel.unsaved),o=h&&p?`${h} \xB7 ${p}`:h||p;o&&(document.title=(r?"\u2022 ":"")+o)}),l.clean(()=>{document.title=a})}guardTabClose(){if(typeof window>"u")return;let a=e=>{let h=this.$state.live.find(p=>p.$panel.unsaved);h&&(e.preventDefault(),e.returnValue=!0,this.flushLayout(),h.$panel.visible||this.focusAt(this.intended().stack.indexOf(h.path)))};l(()=>{this.$state.live.some(e=>e.$panel.unsaved)&&(window.addEventListener("beforeunload",a),l.clean(()=>window.removeEventListener("beforeunload",a)))})}drawColumns(){let a=l("div.s-panels role=main",()=>{this.containerEl=l(),l.onEach(this.$open,e=>this.drawPanel(e),e=>e.order)});if(typeof ResizeObserver<"u"){let e=new ResizeObserver(()=>this.layout());e.observe(a),l.clean(()=>e.disconnect())}l.clean(()=>{this.containerEl===a&&(this.containerEl=void 0)}),this.scheduleLayout()}drawPanel(a){let e;l(()=>{let h=a.$panel.maxWidth;a.maxWidth=h==="small"||h==="large"||h==="none"?h:"medium";let p=this.roomFor(a.maxWidth);p&&(a.width=p,l.peek(a.$panel,"width")!==p&&(a.$panel.width=p),e&&(e.style.width=`${p}px`,this.scheduleLayout()))}),e=l(`section.s-panel${a.width?` w:${a.width}px`:""}`,"destroy=",h=>this.playExit(a,h),()=>{l(()=>this.drawActions(a)),l("div.s-content",()=>{if(a.draw(a.$panel),b.persistScroll(a.path),l.peek(a.$panel,"title")==null){let h=G0(l());h&&l.peek(a.$ui,"fallback")!==h&&(a.$ui.fallback=h)}}),l(()=>{!a.$panel.loading||a.$ui.holding||l("div.s-panel-loading aria-hidden=true",()=>{l("i"),l("i"),l("i")})})}),a.el=e,a.placed=!1,e.style.transition="none",l.clean(()=>{a.el===e&&(a.el=void 0)}),l(()=>{a.$panel.loading,this.scheduleLayout()}),this.scheduleLayout()}drawActions(a){this.opts.$shell.narrow||a.$panel.actions==null||l("div.s-panel-actions",()=>M(a.$panel.actions))}scheduleLayout(){this.layoutQueued||(this.layoutQueued=!0,requestAnimationFrame(()=>this.flushLayout()))}flushLayout(){this.layoutQueued&&(this.layoutQueued=!1,this.layout())}measure(){let a=this.containerEl,e=a?a.getBoundingClientRect().width:0;if(!e)return;let h=Math.ceil(e/O1),p=e/h>=N0?e/h:Math.min(e,O1),r=o=>Math.min(o*p,e);return{area:e,size:{small:p,medium:r(2),large:r(3),none:e}}}geometry(){return this.geom??=this.measure()}roomFor(a){return this.geometry()?.size[a]??0}layout(){let a=this.containerEl,e=a?.closest(".s-main");if(!a||!e)return;let h=this.$state.live,p=h.length;if(!p||h.some(m=>!m.el))return;this.geom=void 0;let r=this.geometry();if(!r)return;let o=this.opts.columns==="single",d=this.lastGeom?.area!==r.area;d&&(this.lastGeom=r,e.classList.add("s-shell-snap"));let n=m=>r.size[m.maxWidth],c=Math.min(this.$state.focus,p-1),s=c,V=n(h[c]);if(!o)for(let m=c-1;m>=0;m--){let u=V+n(h[m]);if(u>r.area)break;V=u,s=m}let H=s>0?0:r.area-V,L=this.opts.alignment??"center",D=L==="spaced"?H/(c-s+2):0,v=L==="left"?0:L==="right"?H:L==="spaced"?D:H/2;for(let m=s;m<=c;m++)h[m].width=n(h[m]);for(let m of h)m.width||(m.width=n(m));let g=[],w=[],A=new Map,z=new Map;if(!d)for(let m of h)m.placed&&z.set(m,W0(m.el));let T=v,Q=0;for(let m=0;m<s;m++)T-=h[m].width;for(let m=0;m<p;m++){let u=h[m],$=u.el,e1=m>=s&&m<=c;m===c+1&&(T=Math.max(T,r.area)),(u.enter||!u.placed)&&(!u.$panel.loading||u.holdDone?u.$ui.holding=!1:u.$ui.holding||(u.$ui.holding=!0,this.holdEnter(u))),u.placed?(Q=parseFloat($.style.left)-T,A.set(u.path,Q),Q&&!d&&($.style.transition=`opacity ${X}ms linear`,$.style.transform=`translateX(${(z.get(u)??0)+Q}px)`,w.push($)),$.style.left=`${T}px`,u.enter&&!u.$ui.holding&&this.releaseEnter(u)):(g.push(u),$.style.left=`${T}px`,u.enter&&e1&&($.style.transform=`translateX(${Q}px)`,$.classList.add("s-panel-enter","s-panel-new"))),$.style.width=`${u.width}px`,T+=u.width+D,u.$panel.visible!==e1&&(u.$panel.visible=e1),u.$panel.width!==u.width&&(u.$panel.width=u.width),$.classList.toggle("s-panel-sep",e1&&m>s&&!D);let g1=m<s,_2=$.classList.contains("s-panel-hidden")||$.classList.contains("s-panel-parked");e1?$.classList.remove("s-panel-hidden","s-panel-parked"):_2||!u.placed||d?($.classList.toggle("s-panel-hidden",g1),$.classList.toggle("s-panel-parked",!g1)):this.afterTransition($,"transform",()=>{u.el!==$||!u.offstage||($.classList.toggle("s-panel-hidden",g1),$.classList.toggle("s-panel-parked",!g1))}),u.offstage=!e1,$.toggleAttribute("inert",!e1)}for(let m of this.exiting){let u=m.anchor==null?void 0:A.get(m.anchor);u&&(m.ride-=u,m.el.style.transform=`translateX(${m.ride}px)`)}(g.length||w.length||d)&&a.offsetWidth,d&&e.classList.remove("s-shell-snap");for(let m of w)m.style.transition="",m.style.transform="";for(let m of g){let u=m.el;u.style.transition="",u.style.transform="",m.placed=!0,m.$ui.holding||this.releaseEnter(m)}}releaseEnter(a){a.enter=!1;let e=a.el;!e||!e.classList.contains("s-panel-enter")||(e.classList.remove("s-panel-enter"),this.afterTransition(e,"opacity",()=>e.classList.remove("s-panel-new")))}holdEnter(a){let e=setTimeout(()=>{this.timers.delete(e),a.holdDone=!0,a.$ui.holding&&(a.$ui.holding=!1,this.scheduleLayout())},U0);this.timers.add(e)}};function W2(t,a){return t.length===a.length&&t.every((e,h)=>e===a[h])}function W0(t){let a=getComputedStyle(t).transform;return a&&a!=="none"?new DOMMatrixReadOnly(a).m41:0}function G0(t){let a=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let e=a.nextNode();e;e=a.nextNode()){let h=e.textContent.trim();if(h)return h.length>48?`${h.slice(0,47).trimEnd()}\u2026`:h}}function X0(t){l("p fg:$s-muted",()=>l("#",`No panel at ${t.path}`))}var G2=200,_0=120;i.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","body > &":"margin: calc(-1 * $3)","> header":"border:0 border-bottom: 1px solid $s-faint; r:0 position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-faint; fg:$s-muted","> header > .s-bar, > footer > .s-bar":"display:flex align-items:center width:100% margin-inline:auto gap:$3 padding: $2 $3;","> header .s-logo, > header .s-nav-trigger":"display:flex align-items:center flex-shrink:0","> header .s-nav-trigger":"margin-left:-0.375rem","> header .s-logo":"font-size:1.4em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent;","> header .s-titles":"display:flex flex-direction:column min-width:5rem flex: 0 1 auto;","> header .s-subtitle":"fg:$s-muted font-size:0.85em line-height:1.5 overflow:hidden text-overflow:ellipsis white-space:nowrap","> header .s-title":"font-weight:800 font-size:1.1em line-height:1.2 overflow:hidden text-overflow:ellipsis white-space:nowrap letter-spacing:-0.01em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent; width:fit-content max-width:100%","> header a.s-logo, > header a.s-title":"text-decoration:none filter:none cursor:pointer","> header .s-menu":"display:flex align-items:center justify-content:flex-end gap:$2 flex: 1 1 auto;",".s-body":"flex:1 overflow:clip display:flex flex-direction:row min-height:0 justify-content:center position:relative",".s-body-inner":"flex:1 min-width:0 display:flex flex-direction:row min-height:0","&.s-nav-right .s-body-inner":"flex-direction:row-reverse",".s-nav-sep":"width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);",".s-nav-sep[role=separator]":{"&":"cursor:col-resize position:relative z-index:1 touch-action:none","&::before":"content:'' position:absolute inset: -0.6rem -4px;","&:hover, &:active, &:focus-visible":"background:$s-accent"},".s-body main":`flex:1 min-width:0 min-height:0 overflow-x:hidden overflow-y:auto display:flex flex-direction:column transition: transform ${X}ms ease;`,".s-body main.s-slide-in":"transform: translateX(100%); transition:none",".s-body main > .s-content":"width:100% flex:1 p:$3",".s-body main.s-scroll-y":"margin-right:$3"},".s-nav-panel":{"&":"display:flex flex-direction:column overflow-y:auto flex-shrink:0 width: calc(var(--s-nav-w) - 1px); padding:$3 gap:$1"},".s-nav-page":{"&":`position:absolute inset:0 z-index:5 display:flex flex-direction:column overflow-y:auto overscroll-behavior:contain border:0 r:0 padding:$2 gap:$1 transition: transform ${X}ms ease, visibility 0s;`,"&.s-nav-page-off":`transform:translateX(-100%) pointer-events:none visibility:hidden transition: transform ${X}ms ease, visibility 0s ${X}ms;`,".s-menu-item":"padding: $2 $3; min-height:3rem font-size:1.05em gap:$3"},[`@container (max-width: ${H1}px)`]:{".s-main .s-nav-panel, .s-main .s-nav-sep":"display:none",".s-main > header > .s-bar":"gap:$1 padding: $1 $2;",".s-main .s-body main.s-scroll-y":"margin-right:0"},[`@container (max-width: ${O1}px)`]:{".s-content > .s-box":"margin-inline: calc(-1 * $3); r:0 border-inline:0"}});function j0(t={}){let a=t.nav,e=t.navPosition??"left",h=i.proxy({open:!1}),p=i.proxy({px:G2});i(()=>{p.px=t.navWidth??G2});let r=i.proxy({narrow:typeof document<"u"&&document.documentElement.clientWidth<=H1}),o=t.routes;if(o!=null&&t.content!=null)throw new Error("Staffa: S.main() takes either `content` or `routes`, not both");let d=o?new T1({routes:o,notFound:t.notFound,ancestors:t.ancestors,title:t.title,$shell:r}):null;d&&(i(()=>d.setColumns(t.columns)),i(()=>d.setAlignment(t.alignment)),i(()=>d.setLinkNavigation(t.linkNavigation)));let n=d&&t.home!==null?t.home??"/":null,c=()=>{t.maxWidth!=null&&i("max-width:",t.maxWidth)},s=i("div.s-main",t.attrs,()=>{i(()=>{a==null||!a.items.length?i("--s-nav-w: 0px"):i(`.s-nav-${e}`,`--s-nav-w: ${p.px}px`)}),i(()=>{(d!=null||t.title!=null||t.subtitle!=null||t.logo!=null||t.menu!=null||a!=null&&a.items.length>0)&&i("header.s-s.neutral",t.topbarAttrs,()=>{i("div.s-bar",()=>{i(c),i(()=>{if(r.narrow&&a!=null&&a.items.length){i("div.s-nav-trigger",()=>at(a,h));return}t.logo!=null&&i(n!=null?"a.s-logo aria-label=Home":"div.s-logo",()=>{n!=null&&i("href=",n),M(t.logo)})}),i("div.s-titles",()=>{i(()=>{t.title!=null&&i(n!=null?"a.s-title":"div.s-title",()=>{n!=null&&i("href=",n),M(t.title)})}),J0(t,d,a,r)});let H=i.derive(()=>r.narrow?d?.currentPanel?.actions:void 0);i(()=>{let L=H.value,D=L??t.menu;D!=null&&i(`div.s-menu${L!=null?".s-panel-origin":""}`,()=>M(D))})})})}),i("div.s-body",()=>{i("div.s-body-inner",()=>{i(c),i(()=>{a==null||!a.items.length||(i(`nav.s-nav-panel.s-nav-${e}`,t.navAttrs,()=>{u1(a.items)}),t.navResizable?et(e,p):i("div.s-nav-sep aria-hidden=true"))}),rt(t,d)}),i(()=>{a!=null&&a.items.length&&h.open&&ht(a,t.navPageAttrs,h,r)})}),i(()=>{t.footer!=null&&i("footer",()=>{i("div.s-bar",()=>{i(c),M(t.footer)})})})});return tt(s,r),a!=null&&y1(()=>a.items,()=>{h.open=!1}),(a!=null||d)&&i(()=>{let V=L=>()=>{W1()||S1()||L()},H=()=>s.querySelector(".s-nav-trigger button");h.open?O("Esc","Close the navigation",V(()=>{h.open=!1,H()?.focus()}),"global"):d&&d.currentPanelIndex>0?O("Esc","Back to the previous panel",V(()=>{d.back()}),"global"):O("Esc","Jump to the navigation",V(()=>{let L=s.querySelector(".s-nav-panel");L?.offsetParent!=null?(L.querySelector("[aria-current=page]")??L.querySelector(".s-menu-item:not([aria-disabled=true])"))?.focus():H()?.click()}),"global")}),d??void 0}var q1=null;function Q0(){q1?.()}function J0(t,a,e,h){i(()=>{if(t.subtitle!=null&&(a==null||Y0(a,e,h))){i("div.s-subtitle",()=>M(t.subtitle));return}a?.drawCrumbs()})}function Y0(t,a,e){return e.narrow||a==null||t.panels.length>1?!1:Q1(a.items)}function tt(t,a){if(typeof ResizeObserver>"u")return;let e=new ResizeObserver(h=>{let p=h[0]?.contentBoxSize?.[0],r=p?p.inlineSize:h[0]?.contentRect.width;r!=null&&(a.narrow=r<=H1)});e.observe(t),i.clean(()=>e.disconnect())}function at(t,a){x1({icon:t.button?.icon??(()=>i(()=>(a.open?l1:L1)())),ariaLabel:t.button?.ariaLabel??"Open navigation",attrs:t.button?.attrs,click:()=>{a.open=!a.open}})}function et(t,a){let e=t==="right"?-1:1;i("div.s-nav-sep role=separator aria-orientation=vertical aria-label='Resize navigation' tabindex=0",()=>{i(()=>i("aria-valuenow=",a.px));let h=i(),p=r=>{let o=h.parentElement.clientWidth/2;a.px=Math.round(Math.max(_0,Math.min(o,r)))};i("pointerdown=",r=>{if(r.button!==0)return;r.preventDefault();let o=r.clientX,d=a.px,n=c=>p(d+e*(c.clientX-o));h.setPointerCapture(r.pointerId),h.addEventListener("pointermove",n),h.addEventListener("lostpointercapture",()=>h.removeEventListener("pointermove",n),{once:!0})}),i("keydown=",r=>{let o=r.key==="ArrowRight"?10:r.key==="ArrowLeft"?-10:0;o&&(r.preventDefault(),p(a.px+e*o))})})}function ht(t,a,e,h){let p=!1,r=()=>{p=!0,e.open=!1},o=i("nav.s-nav-page.s-s.neutral aria-label=Navigation create=s-nav-page-off destroy=s-nav-page-off",a,()=>u1(t.items,r));q1=r,i.clean(()=>{q1===r&&(q1=null)});let d=i.peek(o2,"path");i(()=>{o2.path!==d&&!t2(o2.path)&&r()});let n=o.closest(".s-main"),c=o.parentElement?.querySelector(":scope > .s-body-inner"),s=c?.querySelector(":scope > main");c?.setAttribute("inert",""),i(()=>{h.narrow||(e.open=!1)}),i.clean(()=>{c?.removeAttribute("inert"),p&&(s&&pt(s),n?.querySelector(".s-nav-trigger button")?.focus())}),requestAnimationFrame(()=>{document.body.contains(o)&&o1(o,".s-menu-item[aria-current=page]")})}function pt(t){t.classList.add("s-slide-in"),t.offsetWidth,t.classList.remove("s-slide-in")}function rt(t,a){if(a){a.drawColumns();return}let e=i("main",()=>{i("div.s-content",t.contentAttrs,()=>{M(t.content)})});ot(e)}function ot(t){if(typeof ResizeObserver>"u")return;let a=()=>t.classList.toggle("s-scroll-y",t.offsetWidth>t.clientWidth),e=new ResizeObserver(a);e.observe(t),t.firstElementChild&&e.observe(t.firstElementChild),a(),i.clean(()=>e.disconnect())}import R from"aberdeen";R.insertGlobalCss({".s-select_wrap":{"&":"position:relative display:block",select:"w:100% cursor:pointer padding-right:2.2em; appearance:none","&::after":"content: '\u25BE'; position:absolute right:0.7em top:50%; transform: translateY(-50%); pointer-events:none fg:$s-muted font-size:0.85em"}});function dt(t){Y(t,(a,e)=>{R("div.s-select_wrap",()=>{R("select.s-input",t.inputAttrs,()=>{c1(t,a,e),R("change=",h=>{t.bind&&(t.bind.value=h.target.value)}),R(()=>{let h=typeof t.options=="function"?t.options():t.options,p=t.bind?.value??"";t.placeholder!=null&&R("option",()=>{R("value= disabled=true hidden=true"),p||R("selected=true"),R("#",t.placeholder)});for(let r of h){let o=typeof r=="string"?{value:r,label:r}:{value:r.value,label:r.label??r.value};R("option",()=>{R("value=",o.value),o.value===p&&R("selected=true"),R("#",o.label)})}})})})})}import _ from"aberdeen";_.insertGlobalCss({"textarea.s-input, .s-inset.s-inset-bottom":"flex: 1 1 auto; min-height:0","textarea.s-input":"resize:vertical min-height:3em line-height:1.45","textarea.s-input.s-autoGrow":"resize:none min-height:2.5em overflow-y:hidden"});function nt(t={}){let a=t.autoGrow!==!1;Y(t,(e,h)=>{A1(t,!0,()=>{let p=_("textarea.s-input",t.inputAttrs,()=>{a?(_(".s-autoGrow"),_("input=",r=>{X2(r.currentTarget),t.input&&t.input(r)})):(_("rows=",t.rows??4),_("resize:",t.resize??(t.suffix?"none":"vertical")),t.input&&_("input=",t.input)),t.placeholder!=null&&_("placeholder=",t.placeholder),t.value!=null&&!t.bind&&_("value=",t.value),t.change&&_("change=",t.change),c1(t,e,h,t.bind)});a&&requestAnimationFrame(()=>X2(p))})})}function X2(t){let a=t.cloneNode();a.value=t.value,Object.assign(a.style,{position:"absolute",visibility:"hidden",width:`${t.offsetWidth}px`,height:"auto",overflowY:""}),t.after(a);let e=a.scrollHeight+a.offsetHeight-a.clientHeight;a.remove(),t.style.height=`${e}px`,t.style.overflowY=t.offsetHeight<e?"auto":""}export{e2 as addContextMenu,M1 as addTooltip,i0 as alert,u0 as autocomplete,O as bindKey,g0 as box,F as button,b0 as buttonChooser,h1 as buttonGroup,w0 as checkbox,F2 as closeFloatingMenu,Q0 as closeNav,s0 as confirm,s1 as dialog,H0 as form,B as formatKey,c2 as getDarkMode,x1 as iconButton,W1 as isDialogOpen,S1 as isFloatingMenuOpen,j0 as main,L2 as matchWords,q0 as menu,R0 as menuButton,l0 as prompt,P1 as revealInStrip,E1 as scrollStrip,dt as select,Q2 as setDarkMode,M0 as setKeyHelp,a2 as showFloatingMenu,G1 as showKeyHelp,B0 as tabs,nt as textarea,U1 as textline,C1 as toast};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "staffa",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "An opinionated component library for the Aberdeen reactive UI library.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"build:skill": "rm -rf skill ; mkdir skill && readme-tsdoc --create src/index.ts --file skill/REFERENCE.md --split && awk '/^@@include /{while((getline line < $2)>0) print line; close($2); next} 1' skill-template.md > skill/SKILL.md && rm skill/REFERENCE.md",
|
|
30
30
|
"typecheck": "tsc --noEmit && tsc -p demo --noEmit",
|
|
31
31
|
"prepack": "npm run build && npm run build:skill && npx shotest test && npx shotest collect",
|
|
32
|
+
"postpublish": "git update-ref refs/tps/deployed HEAD",
|
|
32
33
|
"test": "shotest test"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
package/skill/MainOptions.md
CHANGED
|
@@ -322,6 +322,17 @@ Live, like `MainOptions.maxWidth`.
|
|
|
322
322
|
|
|
323
323
|
**Type:** `number`
|
|
324
324
|
|
|
325
|
+
### mainOptions.navResizable · member
|
|
326
|
+
|
|
327
|
+
Lets the user resize the nav sidebar by dragging the hairline between it
|
|
328
|
+
and the content area, or with the arrow keys once it has focus. Defaults
|
|
329
|
+
to `false`.
|
|
330
|
+
|
|
331
|
+
A dragged width stands until `MainOptions.navWidth` changes, and
|
|
332
|
+
stays between 120 px and half the shell.
|
|
333
|
+
|
|
334
|
+
**Type:** `boolean`
|
|
335
|
+
|
|
325
336
|
### mainOptions.navAttrs · member
|
|
326
337
|
|
|
327
338
|
Aberdeen attr/style string applied to the sidebar nav panel.
|
|
@@ -367,10 +367,10 @@ export function autocomplete(opts: AutocompleteOptions): void {
|
|
|
367
367
|
if (e.key === "ArrowDown") {
|
|
368
368
|
e.preventDefault();
|
|
369
369
|
$st.open = true;
|
|
370
|
-
|
|
370
|
+
moveTo(Math.min(max, $st.active + 1));
|
|
371
371
|
} else if (e.key === "ArrowUp") {
|
|
372
372
|
e.preventDefault();
|
|
373
|
-
|
|
373
|
+
moveTo(Math.max(0, $st.active - 1));
|
|
374
374
|
} else if (e.key === "Enter") {
|
|
375
375
|
// Always prevent default to avoid accidental form submission.
|
|
376
376
|
e.preventDefault();
|
|
@@ -402,6 +402,12 @@ export function autocomplete(opts: AutocompleteOptions): void {
|
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
+
/** Highlight row `i`, scrolling the list to keep it in view. */
|
|
406
|
+
function moveTo(i: number) {
|
|
407
|
+
$st.active = i;
|
|
408
|
+
document.getElementById(`${menuId}-opt-${i}`)?.scrollIntoView({ block: "nearest" });
|
|
409
|
+
}
|
|
410
|
+
|
|
405
411
|
function onBlur() {
|
|
406
412
|
$st.open = false;
|
|
407
413
|
if (opts.multi) {
|
package/src/components/field.ts
CHANGED
|
@@ -86,6 +86,9 @@ A.insertGlobalCss({
|
|
|
86
86
|
// On a textarea the insets ride the bottom edge, so a growing box keeps its
|
|
87
87
|
// send button where the caret is rather than floating it mid-paragraph.
|
|
88
88
|
"&.s-inset-bottom > .s-inset_start, &.s-inset-bottom > .s-inset_end": "top:auto padding-bottom:0.35em",
|
|
89
|
+
// A column rather than a grid, so the textarea flexes within the box as it
|
|
90
|
+
// would directly in the field.
|
|
91
|
+
"&.s-inset-bottom:has(> .s-inset_start), &.s-inset-bottom:has(> .s-inset_end)": "display:flex flex-direction:column",
|
|
89
92
|
"> .s-inset_start > svg, > .s-inset_end > svg": "width:1.15em height:1.15em",
|
|
90
93
|
// A number input's spinner wants the very corner a trailing inset is in, and
|
|
91
94
|
// it is the inset that was asked for. (Firefox's is `appearance`-controlled.)
|
package/src/components/main.ts
CHANGED
|
@@ -281,6 +281,15 @@ export interface MainOptions<R = Routes> {
|
|
|
281
281
|
* Live, like {@link MainOptions.maxWidth}.
|
|
282
282
|
*/
|
|
283
283
|
navWidth?: number;
|
|
284
|
+
/**
|
|
285
|
+
* Lets the user resize the nav sidebar by dragging the hairline between it
|
|
286
|
+
* and the content area, or with the arrow keys once it has focus. Defaults
|
|
287
|
+
* to `false`.
|
|
288
|
+
*
|
|
289
|
+
* A dragged width stands until {@link MainOptions.navWidth} changes, and
|
|
290
|
+
* stays between 120 px and half the shell.
|
|
291
|
+
*/
|
|
292
|
+
navResizable?: boolean;
|
|
284
293
|
/** Aberdeen attr/style string applied to the sidebar nav panel. */
|
|
285
294
|
navAttrs?: Attributes;
|
|
286
295
|
/** Aberdeen attr/style string applied to the narrow-screen full-page nav. */
|
|
@@ -289,6 +298,8 @@ export interface MainOptions<R = Routes> {
|
|
|
289
298
|
|
|
290
299
|
/** The default nav column, hairline included — see {@link MainOptions.navWidth}. */
|
|
291
300
|
const NAV_W = 200;
|
|
301
|
+
/** The narrowest a user can drag the nav column — see {@link MainOptions.navResizable}. */
|
|
302
|
+
const NAV_MIN_W = 120;
|
|
292
303
|
|
|
293
304
|
A.insertGlobalCss({
|
|
294
305
|
".s-main": {
|
|
@@ -341,6 +352,12 @@ A.insertGlobalCss({
|
|
|
341
352
|
// A vertical hairline between sidebar and content, fading out at both ends —
|
|
342
353
|
// the vertical sibling of the menu's `hr.s-menu-sep`.
|
|
343
354
|
".s-nav-sep": "width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-faint 18%, $s-faint 82%, transparent);",
|
|
355
|
+
// A resizable one is a handle, its hit area widened beyond the hairline.
|
|
356
|
+
".s-nav-sep[role=separator]": {
|
|
357
|
+
"&": "cursor:col-resize position:relative z-index:1 touch-action:none",
|
|
358
|
+
"&::before": "content:'' position:absolute inset: -0.6rem -4px;",
|
|
359
|
+
"&:hover, &:active, &:focus-visible": "background:$s-accent",
|
|
360
|
+
},
|
|
344
361
|
// min-height/min-width:0 override flex's `auto`, so <main> can shrink to its
|
|
345
362
|
// container instead of letting wide content push the body — and any sidebar
|
|
346
363
|
// — past the viewport edge. The transition is dormant except for the
|
|
@@ -470,6 +487,9 @@ export function main<R extends RouteTable<R>>(opts: MainOptions<R> = {}): PanelS
|
|
|
470
487
|
// Whether the narrow-screen full-page nav is showing. Per shell, so nested or
|
|
471
488
|
// sibling `main()`s can't fight over it.
|
|
472
489
|
const $nav = A.proxy({ open: false });
|
|
490
|
+
// The sidebar column's width: `navWidth`, until the user drags it elsewhere.
|
|
491
|
+
const $navW = A.proxy({ px: NAV_W });
|
|
492
|
+
A(() => { $navW.px = opts.navWidth ?? NAV_W; });
|
|
473
493
|
// Whether the shell is narrow, at the same NARROW_PX the `@container` queries
|
|
474
494
|
// above use. One boolean for everything that must agree on the regime — the
|
|
475
495
|
// bar's layout, what the ☰ does, where a panel's chrome goes — so they can't
|
|
@@ -515,7 +535,7 @@ export function main<R extends RouteTable<R>>(opts: MainOptions<R> = {}): PanelS
|
|
|
515
535
|
// here subscribes this scope alone, never the shell entire (see `nav`).
|
|
516
536
|
A(() => {
|
|
517
537
|
if (nav == null || !nav.items.length) A("--s-nav-w: 0px");
|
|
518
|
-
else A(`.s-nav-${navPos}`, `--s-nav-w: ${
|
|
538
|
+
else A(`.s-nav-${navPos}`, `--s-nav-w: ${$navW.px}px`);
|
|
519
539
|
});
|
|
520
540
|
|
|
521
541
|
// Top bar: `[leading] [identity] …spacer… [trailing]`, each slot's contents
|
|
@@ -602,7 +622,8 @@ export function main<R extends RouteTable<R>>(opts: MainOptions<R> = {}): PanelS
|
|
|
602
622
|
A(`nav.s-nav-panel.s-nav-${navPos}`, opts.navAttrs, () => {
|
|
603
623
|
drawMenu(nav.items);
|
|
604
624
|
});
|
|
605
|
-
|
|
625
|
+
if (opts.navResizable) drawNavHandle(navPos, $navW);
|
|
626
|
+
else A("div.s-nav-sep aria-hidden=true");
|
|
606
627
|
});
|
|
607
628
|
drawMainContent(opts, ctl);
|
|
608
629
|
});
|
|
@@ -783,6 +804,39 @@ function drawNavTrigger(nav: MenuOptions, $nav: { open: boolean }): void {
|
|
|
783
804
|
});
|
|
784
805
|
}
|
|
785
806
|
|
|
807
|
+
/**
|
|
808
|
+
* The hairline between sidebar and content as a window splitter: dragging it, or
|
|
809
|
+
* pressing ←/→ while it has focus, sets `$navW.px` — the sidebar's whole column.
|
|
810
|
+
*/
|
|
811
|
+
function drawNavHandle(navPos: "left" | "right", $navW: { px: number }): void {
|
|
812
|
+
// Which way the sidebar grows: away from the shell edge it sits against.
|
|
813
|
+
const dir = navPos === "right" ? -1 : 1;
|
|
814
|
+
A("div.s-nav-sep role=separator aria-orientation=vertical aria-label='Resize navigation' tabindex=0", () => {
|
|
815
|
+
A(() => A("aria-valuenow=", $navW.px));
|
|
816
|
+
const handle = A() as HTMLElement;
|
|
817
|
+
const resize = (px: number) => {
|
|
818
|
+
const max = handle.parentElement!.clientWidth / 2;
|
|
819
|
+
$navW.px = Math.round(Math.max(NAV_MIN_W, Math.min(max, px)));
|
|
820
|
+
};
|
|
821
|
+
A("pointerdown=", (e: PointerEvent) => {
|
|
822
|
+
if (e.button !== 0) return;
|
|
823
|
+
e.preventDefault();
|
|
824
|
+
const x0 = e.clientX;
|
|
825
|
+
const w0 = $navW.px;
|
|
826
|
+
const move = (e: PointerEvent) => resize(w0 + dir * (e.clientX - x0));
|
|
827
|
+
handle.setPointerCapture(e.pointerId);
|
|
828
|
+
handle.addEventListener("pointermove", move);
|
|
829
|
+
handle.addEventListener("lostpointercapture", () => handle.removeEventListener("pointermove", move), { once: true });
|
|
830
|
+
});
|
|
831
|
+
A("keydown=", (e: KeyboardEvent) => {
|
|
832
|
+
const step = e.key === "ArrowRight" ? 10 : e.key === "ArrowLeft" ? -10 : 0;
|
|
833
|
+
if (!step) return;
|
|
834
|
+
e.preventDefault();
|
|
835
|
+
resize($navW.px + dir * step);
|
|
836
|
+
});
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
|
|
786
840
|
/**
|
|
787
841
|
* The narrow-screen navigation: a full panel sliding in over the content from
|
|
788
842
|
* the left. Picking an item slides it back out as the chosen screen enters from
|
|
@@ -32,18 +32,17 @@ export interface TextareaOptions extends FieldOptions, InsetOptions {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
A.insertGlobalCss({
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
// how tall to be (`attrs: "h:8rem"`) hands
|
|
38
|
-
// field left to size itself
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
"textarea.s-input, .s-inset.s-inset-bottom": "flex: 0 1 100%; min-height:0",
|
|
35
|
+
// Start from the height the textarea asks for (its rows, or its text when
|
|
36
|
+
// growing), then grow or shrink to whatever room the field has left: a field
|
|
37
|
+
// told how tall to be (`attrs: "h:8rem"`) hands its height to the textarea,
|
|
38
|
+
// while a field left to size itself has no room to share out, so the textarea
|
|
39
|
+
// keeps its own height. The same rule rides the inset box below, which stands
|
|
40
|
+
// in for the control once a prefix/suffix gives it one.
|
|
41
|
+
"textarea.s-input, .s-inset.s-inset-bottom": "flex: 1 1 auto; min-height:0",
|
|
43
42
|
"textarea.s-input": "resize:vertical min-height:3em line-height:1.45",
|
|
44
|
-
// Sized to its text there is nothing to scroll
|
|
45
|
-
// a caller caps the height (`inputAttrs: "max-height:12em"`)
|
|
46
|
-
"textarea.s-input.s-autoGrow": "resize:none min-height:2.5em overflow-y:
|
|
43
|
+
// Sized to its text there is nothing to scroll; `fitToContent` turns scrolling
|
|
44
|
+
// on once a caller caps the height (`inputAttrs: "max-height:12em"`).
|
|
45
|
+
"textarea.s-input.s-autoGrow": "resize:none min-height:2.5em overflow-y:hidden",
|
|
47
46
|
});
|
|
48
47
|
|
|
49
48
|
/**
|
|
@@ -105,9 +104,27 @@ export function textarea(opts: TextareaOptions = {}): void {
|
|
|
105
104
|
}
|
|
106
105
|
|
|
107
106
|
function fitToContent(el: HTMLTextAreaElement): void {
|
|
108
|
-
|
|
107
|
+
// Measure a copy taken out of the flow: collapsing the textarea itself would
|
|
108
|
+
// scroll its caret into view of the collapsed box and shrink the page under
|
|
109
|
+
// it, so a capped textarea, or the page, would jump on every keystroke.
|
|
110
|
+
const probe = el.cloneNode() as HTMLTextAreaElement;
|
|
111
|
+
probe.value = el.value;
|
|
112
|
+
Object.assign(probe.style, {
|
|
113
|
+
position: "absolute",
|
|
114
|
+
visibility: "hidden",
|
|
115
|
+
width: `${el.offsetWidth}px`,
|
|
116
|
+
height: "auto",
|
|
117
|
+
// Measure without a scrollbar: one would narrow the text and wrap it early.
|
|
118
|
+
overflowY: "",
|
|
119
|
+
});
|
|
120
|
+
el.after(probe);
|
|
109
121
|
// `scrollHeight` measures the padding box, while the height we set sizes the
|
|
110
122
|
// border box: add the borders back, or the text ends up two pixels too tall
|
|
111
123
|
// for its box and the textarea scrolls by that much.
|
|
112
|
-
|
|
124
|
+
const height = probe.scrollHeight + probe.offsetHeight - probe.clientHeight;
|
|
125
|
+
probe.remove();
|
|
126
|
+
el.style.height = `${height}px`;
|
|
127
|
+
// Scroll only once a `max-height` caps the box: `scrollHeight` is rounded, so
|
|
128
|
+
// an uncapped box can fall a fraction of a pixel short and show a bar.
|
|
129
|
+
el.style.overflowY = el.offsetHeight < height ? "auto" : "";
|
|
113
130
|
}
|