@qilin-agent/client-ui-primitives 3.1.3 → 3.1.4

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/lib/index.js CHANGED
@@ -1,44 +1,48 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import css from "./StateDot.module.css";
4
2
  import { Fragment as Fragment$1, cloneElement, createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
5
- import css$1 from "./TextShimmer.module.css";
6
- import css$2 from "./DisclosureRow.module.css";
7
- import css$3 from "./Button.module.css";
8
- import css$4 from "./Pill.module.css";
9
- import css$5 from "./SegmentedControl.module.css";
10
- import css$6 from "./Tag.module.css";
11
- import css$7 from "./Switch.module.css";
12
- import css$8 from "./Checkbox.module.css";
13
- import css$9 from "./Input.module.css";
3
+ import css from "./settings-form/SettingsForm.module.css";
4
+ import clsx from "clsx";
5
+ import css$1 from "./Tag.module.css";
6
+ import css$2 from "./settings-form/fields.module.css";
7
+ import { createSnapshotStore } from "@qilin-agent/client-store";
8
+ import css$3 from "./CommandText.module.css";
9
+ import css$4 from "./StateDot.module.css";
10
+ import css$5 from "./TextShimmer.module.css";
11
+ import css$6 from "./DisclosureRow.module.css";
12
+ import css$7 from "./Button.module.css";
13
+ import css$8 from "./Pill.module.css";
14
+ import css$9 from "./SegmentedControl.module.css";
15
+ import css$10 from "./Switch.module.css";
16
+ import css$11 from "./Checkbox.module.css";
17
+ import css$12 from "./Input.module.css";
14
18
  import { createPortal } from "react-dom";
15
- import css$10 from "./ShortcutKeys.module.css";
16
- import css$11 from "./Menu.module.css";
17
- import css$12 from "./Tooltip.module.css";
18
- import css$13 from "./HoverCard.module.css";
19
- import css$14 from "./Modal.module.css";
20
- import css$15 from "./OnboardingSurface.module.css";
21
- import css$16 from "./RiskConfirmation.module.css";
22
- import css$17 from "./ConnectionIndicator.module.css";
23
- import css$18 from "./FileTypeIcon.module.css";
19
+ import css$13 from "./ShortcutKeys.module.css";
20
+ import css$14 from "./Menu.module.css";
21
+ import css$15 from "./Tooltip.module.css";
22
+ import css$16 from "./HoverCard.module.css";
23
+ import css$17 from "./Modal.module.css";
24
+ import css$18 from "./OnboardingSurface.module.css";
25
+ import css$19 from "./RiskConfirmation.module.css";
26
+ import css$20 from "./ConnectionIndicator.module.css";
27
+ import css$21 from "./FileTypeIcon.module.css";
24
28
  import { siAliexpress, siApple, siBaidu, siBilibili, siCsdn, siDuckduckgo, siEbay, siFacebook, siGithub, siGitlab, siGoogle, siInstagram, siJuejin, siMdnwebdocs, siNetflix, siNpm, siPypi, siQq, siQuora, siReddit, siSinaweibo, siSpotify, siStackoverflow, siTaobao, siTelegram, siTiktok, siV2ex, siWechat, siWhatsapp, siWikipedia, siX, siYcombinator, siYoutube, siZhihu } from "simple-icons";
25
29
  import { pathPartsOf } from "@qilin-agent/util-workspace-path";
26
- import css$19 from "./PathLabel.module.css";
27
- import css$20 from "./user-text.module.css";
30
+ import css$22 from "./PathLabel.module.css";
31
+ import css$23 from "./user-text.module.css";
28
32
  import markdownCss from "./markdown/MarkdownText.module.css";
29
- import css$21 from "./Toast.module.css";
30
- import css$22 from "./JsonTree.module.css";
33
+ import css$24 from "./Toast.module.css";
34
+ import css$25 from "./JsonTree.module.css";
31
35
  import Anser from "anser";
32
- import css$23 from "./TerminalBlock.module.css";
36
+ import css$26 from "./TerminalBlock.module.css";
33
37
  import { createCssVariablesTheme, createHighlighterCoreSync } from "shiki/core";
34
38
  import { createJavaScriptRegexEngine, defaultJavaScriptRegexConstructor } from "shiki/engine/javascript";
35
39
  import langTs from "@shikijs/langs/typescript";
36
40
  import langBash from "@shikijs/langs/shellscript";
37
41
  import langJson from "@shikijs/langs/json";
38
- import css$24 from "./ReadBlock.module.css";
42
+ import css$27 from "./ReadBlock.module.css";
39
43
  import { structuredPatch } from "diff";
40
- import css$25 from "./DiffBlock.module.css";
41
- import css$26 from "./SearchBlock.module.css";
44
+ import css$28 from "./DiffBlock.module.css";
45
+ import css$29 from "./SearchBlock.module.css";
42
46
  import { fromMarkdown } from "mdast-util-from-markdown";
43
47
  import { gfmFromMarkdown } from "mdast-util-gfm";
44
48
  import { mathFromMarkdown } from "mdast-util-math";
@@ -50,61 +54,70 @@ import { classifyCharacter } from "micromark-util-classify-character";
50
54
  import { codes, constants, types } from "micromark-util-symbol";
51
55
  import { factorySpace } from "micromark-factory-space";
52
56
  import { normalizeUri } from "micromark-util-sanitize-uri";
53
- import css$27 from "./markdown/CodeBlock.module.css";
54
- import css$28 from "./markdown/mermaid.module.css";
57
+ import css$30 from "./markdown/CodeBlock.module.css";
58
+ import css$31 from "./markdown/mermaid.module.css";
55
59
  import katex from "katex";
56
- import css$29 from "./ImageLightbox.module.css";
57
- import css$30 from "./ImagePreview.module.css";
60
+ import css$32 from "./ImageLightbox.module.css";
61
+ import css$33 from "./ImagePreview.module.css";
58
62
  import "katex/dist/katex.min.css";
59
- import css$31 from "./WebBlock.module.css";
60
- import css$32 from "./markdown/JsonBlock.module.css";
61
- import css$33 from "./MenuGroup.module.css";
62
- import css$34 from "./MenuSurface.module.css";
63
- //#region lib/types/StateDot.js
64
- /** Outer 3x3 matrix cells (2px pixels on a 10px grid), clockwise from top-left. */
65
- const MATRIX_CELLS = [
66
- [0, 0],
67
- [4, 0],
68
- [8, 0],
69
- [8, 4],
70
- [8, 8],
71
- [4, 8],
72
- [0, 8],
73
- [0, 4]
74
- ];
63
+ import css$34 from "./WebBlock.module.css";
64
+ import css$35 from "./markdown/JsonBlock.module.css";
65
+ import css$36 from "./MenuGroup.module.css";
66
+ import css$37 from "./MenuSurface.module.css";
67
+ //#region lib/types/settings-form/SettingsForm.js
68
+ /**
69
+ * One plugin's settings form as its page on the Plugins page shows it: the
70
+ * read-only notice when the deployment stores settings read-only, the
71
+ * plugin's controls, and the save that writes every staged edit. The page
72
+ * draws the plugin's title and one-liner itself.
73
+ *
74
+ * Only a save writes. Leaving the page drops every staged edit, so the form
75
+ * discards on unmount and offers no discard control. A form whose namespace
76
+ * the Host stopped serving says so in place of its controls rather than
77
+ * showing fields nothing would accept.
78
+ */
75
79
  /**
76
- * Render a state dot.
77
- * @param props.state - which of `done`, `warning`, `ongoing`, `error`, or `idle` to show.
78
- * @param props.size - outer diameter in px (default 10, the figma size).
79
- * @param props.className - extra class for layout placement.
80
- * @returns the dot element (aria-hidden; pair with text for accessibility).
80
+ * Render one plugin's settings form.
81
+ * @param props - the form's copy and state, its controls, and the save and discard actions.
82
+ * @returns the form, or the unavailable line while the namespace is not served.
81
83
  */
82
- function StateDot({ state, size = 10, className }) {
83
- if (state === "ongoing") return jsx("svg", {
84
- className: clsx(css.matrix, className),
85
- "data-state": "ongoing",
86
- width: size,
87
- height: size,
88
- viewBox: "0 0 10 10",
89
- shapeRendering: "crispEdges",
90
- "aria-hidden": "true",
91
- children: MATRIX_CELLS.map(([x, y], index) => jsx("rect", {
92
- className: css.cell,
93
- x,
94
- y,
95
- width: "2",
96
- height: "2",
97
- style: { animationDelay: `${(index - MATRIX_CELLS.length) * 125}ms` }
98
- }, `${x}-${y}`))
84
+ function SettingsForm(props) {
85
+ const { state, labels } = props;
86
+ const discard = useRef(props.onDiscard);
87
+ discard.current = props.onDiscard;
88
+ useEffect(() => () => {
89
+ discard.current();
90
+ }, []);
91
+ if (!state.available) return jsx("p", {
92
+ className: css.unavailable,
93
+ role: "status",
94
+ children: labels.unavailable
99
95
  });
100
- return jsx("span", {
101
- className: clsx(css.dot, className),
102
- "data-state": state,
103
- style: {
104
- width: size,
105
- height: size
106
- },
107
- "aria-hidden": "true"
96
+ const blocked = !state.dirty || state.invalid || state.saving;
97
+ return jsxs("div", {
98
+ className: css.form,
99
+ children: [
100
+ !state.writable ? jsx("p", {
101
+ className: css.readOnly,
102
+ role: "status",
103
+ children: labels.readOnly
104
+ }) : null,
105
+ props.children,
106
+ jsxs("div", {
107
+ className: css.footer,
108
+ children: [state.failed ? jsx("p", {
109
+ className: css.failed,
110
+ role: "status",
111
+ children: labels.saveFailed
112
+ }) : null, jsx("button", {
113
+ type: "button",
114
+ className: css.save,
115
+ disabled: blocked,
116
+ onClick: props.onSave,
117
+ children: state.saving ? labels.saving : labels.save
118
+ })]
119
+ })
120
+ ]
108
121
  });
109
122
  }
110
123
  //#endregion
@@ -1888,13 +1901,536 @@ const IconPinFillRegular = ({ size = 16, className }) => jsxs("svg", {
1888
1901
  })]
1889
1902
  });
1890
1903
  //#endregion
1904
+ //#region lib/types/Tag.js
1905
+ /**
1906
+ * Render a read-only tag.
1907
+ * @param props.tone - which palette to use (default `outline`).
1908
+ * @param props.className - extra class for layout placement.
1909
+ * @param props.children - the localized label, owned by the render site.
1910
+ * @returns the tag element.
1911
+ */
1912
+ function Tag({ tone = "outline", className, children }) {
1913
+ return jsx("span", {
1914
+ className: clsx(css$1.tag, className),
1915
+ "data-tone": tone,
1916
+ children
1917
+ });
1918
+ }
1919
+ //#endregion
1920
+ //#region lib/types/settings-form/fields.js
1921
+ /**
1922
+ * The controls of a settings form. Each renders one field's label, its staged
1923
+ * text, whether saving would leave an override, and — when one stands — the
1924
+ * reset that stages a clear back to the composition layer. Nothing here
1925
+ * writes: a control reports what the user typed, and the form's save is the
1926
+ * single point where a draft becomes a document mutation.
1927
+ */
1928
+ /**
1929
+ * A staged value field. `numeric` only hints the keypad: which drafts a field
1930
+ * accepts is decided by its spec, so the control never silently rewrites what
1931
+ * the user typed.
1932
+ * @param props - the field's copy, its staged text, and the edit actions.
1933
+ * @returns the labelled control.
1934
+ */
1935
+ function SettingsValueField(props) {
1936
+ const [helpOpen, setHelpOpen] = useState(false);
1937
+ const helpId = `${props.id}-help`;
1938
+ const messageId = `${props.id}-message`;
1939
+ const hasMessage = props.invalid || Boolean(props.hint);
1940
+ const description = [hasMessage ? messageId : "", helpOpen ? helpId : ""].filter(Boolean).join(" ");
1941
+ return jsxs("div", {
1942
+ className: css$2.field,
1943
+ children: [
1944
+ jsxs("div", {
1945
+ className: css$2.head,
1946
+ children: [jsxs("div", {
1947
+ className: css$2.labelGroup,
1948
+ children: [jsx("label", {
1949
+ className: css$2.label,
1950
+ htmlFor: props.id,
1951
+ children: props.label
1952
+ }), props.help !== void 0 ? jsx("button", {
1953
+ type: "button",
1954
+ className: css$2.helpButton,
1955
+ "aria-label": props.help.label,
1956
+ "aria-expanded": helpOpen,
1957
+ "aria-controls": helpId,
1958
+ onClick: () => {
1959
+ setHelpOpen(!helpOpen);
1960
+ },
1961
+ children: jsx(IconInfoOutline14, { size: 12 })
1962
+ }) : null]
1963
+ }), props.overridden ? jsxs("span", {
1964
+ className: css$2.badges,
1965
+ children: [jsx(Tag, {
1966
+ tone: "neutral",
1967
+ children: props.overriddenLabel
1968
+ }), jsx("button", {
1969
+ type: "button",
1970
+ className: css$2.reset,
1971
+ disabled: props.disabled,
1972
+ onClick: props.onReset,
1973
+ children: props.resetLabel
1974
+ })]
1975
+ }) : null]
1976
+ }),
1977
+ jsx("input", {
1978
+ id: props.id,
1979
+ className: css$2.input,
1980
+ type: "text",
1981
+ ...props.numeric === true ? { inputMode: "numeric" } : {},
1982
+ ...props.invalid ? { "aria-invalid": true } : {},
1983
+ "aria-describedby": description || void 0,
1984
+ value: props.text,
1985
+ placeholder: props.placeholder ?? "",
1986
+ disabled: props.disabled,
1987
+ onChange: (event) => {
1988
+ props.onEdit(event.target.value);
1989
+ }
1990
+ }),
1991
+ hasMessage ? jsx("p", {
1992
+ id: messageId,
1993
+ className: props.invalid ? css$2.invalid : css$2.hint,
1994
+ children: props.invalid ? props.invalidLabel : props.hint
1995
+ }) : null,
1996
+ props.help !== void 0 && helpOpen ? jsx("div", {
1997
+ id: helpId,
1998
+ className: css$2.help,
1999
+ role: "region",
2000
+ "aria-label": props.help.label,
2001
+ children: props.help.content
2002
+ }) : null
2003
+ ]
2004
+ });
2005
+ }
2006
+ /**
2007
+ * A write-only credential control. The value never rides a response, so the
2008
+ * control reports only whether one is configured and starts blank; a blank
2009
+ * draft writes nothing, which keeps the stored key rather than clearing it.
2010
+ * The control asks browsers not to autofill saved login passwords.
2011
+ * @param props - the field's copy, its staged text, and the configured state.
2012
+ * @returns the labelled control.
2013
+ */
2014
+ function SettingsSecretField(props) {
2015
+ return jsxs("div", {
2016
+ className: css$2.field,
2017
+ children: [
2018
+ jsxs("div", {
2019
+ className: css$2.head,
2020
+ children: [jsx("label", {
2021
+ className: css$2.label,
2022
+ htmlFor: props.id,
2023
+ children: props.label
2024
+ }), jsx("span", {
2025
+ className: css$2.badges,
2026
+ children: jsx(Tag, {
2027
+ tone: props.configured ? "neutral" : "quiet",
2028
+ children: props.stateLabel
2029
+ })
2030
+ })]
2031
+ }),
2032
+ jsx("input", {
2033
+ id: props.id,
2034
+ className: css$2.input,
2035
+ type: "password",
2036
+ autoComplete: "new-password",
2037
+ value: props.text,
2038
+ disabled: props.disabled,
2039
+ onChange: (event) => {
2040
+ props.onEdit(event.target.value);
2041
+ }
2042
+ }),
2043
+ jsx("p", {
2044
+ className: css$2.hint,
2045
+ children: props.hint
2046
+ })
2047
+ ]
2048
+ });
2049
+ }
2050
+ //#endregion
2051
+ //#region lib/types/settings-form/form-model.js
2052
+ /**
2053
+ * The staged form model behind a plugin's settings page.
2054
+ *
2055
+ * A card stages what the user types and writes it only when they save. Each
2056
+ * settings write is a durable, revision-fenced document mutation, so a control
2057
+ * that committed as it settled turned one edit into a write the user never
2058
+ * asked for and could not preview; staged text makes what is on screen exactly
2059
+ * what a save would store.
2060
+ *
2061
+ * A field shows its effective value — the user layer over the composition
2062
+ * layer over the schema default — and whether the user layer carries it. That
2063
+ * presence, not a value comparison, is what marks a field overridden: an
2064
+ * override equal to the composition default is still an override.
2065
+ */
2066
+ /**
2067
+ * A whole-number field. An empty draft clears the field; any other draft that
2068
+ * is not a finite number blocks the save.
2069
+ * @param field - field name inside the namespace section.
2070
+ * @returns the field's conversion spec.
2071
+ */
2072
+ function settingsNumberField(field) {
2073
+ return {
2074
+ field,
2075
+ format: (value) => typeof value === "number" ? String(value) : "",
2076
+ parse: (text) => {
2077
+ const trimmed = text.trim();
2078
+ if (trimmed === "") return { kind: "clear" };
2079
+ const parsed = Number(trimmed);
2080
+ return Number.isFinite(parsed) ? {
2081
+ kind: "set",
2082
+ value: parsed
2083
+ } : void 0;
2084
+ }
2085
+ };
2086
+ }
2087
+ /**
2088
+ * A free-text field. An empty draft clears the field, so emptying the control
2089
+ * and saving is the same gesture as resetting it.
2090
+ * @param field - field name inside the namespace section.
2091
+ * @returns the field's conversion spec.
2092
+ */
2093
+ function settingsTextField(field) {
2094
+ return {
2095
+ field,
2096
+ format: (value) => typeof value === "string" ? value : "",
2097
+ parse: (text) => {
2098
+ const trimmed = text.trim();
2099
+ return trimmed === "" ? { kind: "clear" } : {
2100
+ kind: "set",
2101
+ value: trimmed
2102
+ };
2103
+ }
2104
+ };
2105
+ }
2106
+ /**
2107
+ * Stages one card's edits over one settings namespace and writes them on save.
2108
+ *
2109
+ * The form publishes through a snapshot store because slot components read
2110
+ * through a snapshot selector, while both the scope and the local drafts
2111
+ * change underneath; every projection is rebuilt from the two together.
2112
+ */
2113
+ var SettingsFormModel = class {
2114
+ scope;
2115
+ specs;
2116
+ secretSpecs;
2117
+ staged = /* @__PURE__ */ new Map();
2118
+ listeners = /* @__PURE__ */ new Set();
2119
+ baseline;
2120
+ unsubscribe;
2121
+ saving = false;
2122
+ failed = false;
2123
+ /**
2124
+ * @param scope - the shared configuration form for this card's namespace.
2125
+ * @param specs - the section fields this card edits.
2126
+ * @param secrets - the card's write-only controls, written outside the section.
2127
+ */
2128
+ constructor(scope, specs, secrets = []) {
2129
+ this.scope = scope;
2130
+ this.specs = new Map(specs.map((spec) => [spec.field, spec]));
2131
+ this.secretSpecs = new Map(secrets.map((spec) => [spec.field, spec]));
2132
+ this.unsubscribe = scope.subscribe(() => {
2133
+ this.publish();
2134
+ });
2135
+ }
2136
+ /**
2137
+ * Publish a projection of this form, rebuilt whenever the scope or a draft changes.
2138
+ * @param project - build the card's state from the form's current reads.
2139
+ * @returns the store the card's component reads through its bound selector.
2140
+ */
2141
+ bind(project) {
2142
+ const store = createSnapshotStore(project());
2143
+ this.listeners.add(() => {
2144
+ store.set(project());
2145
+ });
2146
+ return store;
2147
+ }
2148
+ /**
2149
+ * Read the card-level state: what the Host serves, and what a save would do.
2150
+ * @returns the form state every card shares.
2151
+ */
2152
+ shell() {
2153
+ const snapshot = this.scope.getSnapshot();
2154
+ const plan = this.plan();
2155
+ return {
2156
+ available: snapshot.status === "ready",
2157
+ writable: snapshot.writable,
2158
+ dirty: plan.length > 0,
2159
+ invalid: plan.some((item) => item.run === void 0 && item.op === void 0),
2160
+ saving: this.saving,
2161
+ failed: this.failed
2162
+ };
2163
+ }
2164
+ /**
2165
+ * Read one control's state.
2166
+ * @param field - field name of a section field or of a write-only control.
2167
+ * @returns the draft text, whether a save would leave an override, and whether it is invalid.
2168
+ */
2169
+ field(field) {
2170
+ const staged = this.staged.get(field);
2171
+ if (this.secretSpecs.has(field)) return {
2172
+ text: staged?.text ?? "",
2173
+ overridden: false,
2174
+ invalid: false
2175
+ };
2176
+ const spec = this.spec(field);
2177
+ if (staged === void 0) return {
2178
+ text: spec.format(this.sectionValue(field)),
2179
+ overridden: this.stored(field),
2180
+ invalid: false
2181
+ };
2182
+ const write = staged.clear ? { kind: "clear" } : spec.parse(staged.text);
2183
+ return {
2184
+ text: staged.text,
2185
+ overridden: write?.kind === "set",
2186
+ invalid: write === void 0
2187
+ };
2188
+ }
2189
+ /**
2190
+ * Build the edit, reset, save, and discard actions bound to this form.
2191
+ * @returns the actions a card's slot entry injects.
2192
+ */
2193
+ actions() {
2194
+ return {
2195
+ edit: (field, text) => {
2196
+ this.stage(field, {
2197
+ text,
2198
+ clear: false
2199
+ });
2200
+ },
2201
+ resetField: (field) => {
2202
+ this.stage(field, {
2203
+ text: this.spec(field).format(this.baseValue(field)),
2204
+ clear: true
2205
+ });
2206
+ },
2207
+ save: () => {
2208
+ this.save();
2209
+ },
2210
+ discard: () => {
2211
+ if (this.staged.size === 0 && !this.failed) return;
2212
+ this.staged.clear();
2213
+ this.baseline = void 0;
2214
+ this.failed = false;
2215
+ this.publish();
2216
+ }
2217
+ };
2218
+ }
2219
+ /**
2220
+ * Write every staged edit, then re-seed from what the Host accepted.
2221
+ *
2222
+ * The Host is the only authority on whether a value was accepted — its
2223
+ * validators own the constraints no schema can express — so the outcome is
2224
+ * read back from the section rather than predicted here. A save that did not
2225
+ * land keeps its drafts, so the user can correct them instead of retyping.
2226
+ * @returns settlement after every write and the read-back.
2227
+ */
2228
+ async save() {
2229
+ const plan = this.plan();
2230
+ if (!plan.length || this.saving || !this.scope.getSnapshot().writable || plan.some((item) => item.run === void 0 && item.op === void 0)) return;
2231
+ this.saving = true;
2232
+ this.failed = false;
2233
+ this.publish();
2234
+ try {
2235
+ const ops = plan.flatMap((item) => item.op === void 0 ? [] : [item.op]);
2236
+ let landed = !ops.length || await this.scope.mutate(ops, this.baseline?.revision);
2237
+ if (!landed) {
2238
+ this.failed = true;
2239
+ return;
2240
+ }
2241
+ for (const item of plan) if (item.run) landed = await item.run() && landed;
2242
+ if (landed) {
2243
+ this.staged.clear();
2244
+ this.baseline = void 0;
2245
+ }
2246
+ this.failed = !landed;
2247
+ } catch (_error) {
2248
+ this.failed = true;
2249
+ } finally {
2250
+ this.saving = false;
2251
+ this.publish();
2252
+ }
2253
+ }
2254
+ /** Release the form's accepted-value subscription. */
2255
+ dispose() {
2256
+ this.unsubscribe();
2257
+ this.listeners.clear();
2258
+ }
2259
+ /**
2260
+ * Every staged edit a save would write. An entry whose draft is not a value
2261
+ * its field accepts carries no write: the form is still dirty, and the save
2262
+ * refuses rather than dropping the edit.
2263
+ * @returns the planned writes, in the order the fields were staged.
2264
+ */
2265
+ plan() {
2266
+ const plan = [];
2267
+ for (const [field, staged] of this.staged) {
2268
+ const secret = this.secretSpecs.get(field);
2269
+ if (secret !== void 0) {
2270
+ const value = staged.text.trim();
2271
+ if (value !== "") plan.push({
2272
+ field,
2273
+ run: () => secret.write(value)
2274
+ });
2275
+ continue;
2276
+ }
2277
+ const spec = this.spec(field);
2278
+ if (staged.clear) {
2279
+ if (this.stored(field)) plan.push({
2280
+ field,
2281
+ op: {
2282
+ op: "unset",
2283
+ path: [field]
2284
+ }
2285
+ });
2286
+ continue;
2287
+ }
2288
+ if (staged.text === spec.format(this.sectionValue(field))) continue;
2289
+ const write = spec.parse(staged.text);
2290
+ if (write === void 0) plan.push({ field });
2291
+ else if (write.kind === "clear") plan.push({
2292
+ field,
2293
+ op: {
2294
+ op: "unset",
2295
+ path: [field]
2296
+ }
2297
+ });
2298
+ else plan.push({
2299
+ field,
2300
+ op: {
2301
+ op: "set",
2302
+ path: [field],
2303
+ value: write.value
2304
+ }
2305
+ });
2306
+ }
2307
+ return plan;
2308
+ }
2309
+ stage(field, edit) {
2310
+ this.baseline ??= this.scope.getSnapshot();
2311
+ this.staged.set(field, edit);
2312
+ this.failed = false;
2313
+ this.publish();
2314
+ }
2315
+ spec(field) {
2316
+ const spec = this.specs.get(field);
2317
+ if (spec === void 0) throw new Error(`plugin card has no field ${field}`);
2318
+ return spec;
2319
+ }
2320
+ snapshotOf() {
2321
+ return this.scope.getSnapshot();
2322
+ }
2323
+ sectionValue(field) {
2324
+ return this.snapshotOf().value?.[field];
2325
+ }
2326
+ baseValue(field) {
2327
+ return this.snapshotOf().base?.[field];
2328
+ }
2329
+ userLayer() {
2330
+ return this.snapshotOf().user;
2331
+ }
2332
+ stored(field) {
2333
+ const user = this.userLayer();
2334
+ return user !== void 0 && Object.hasOwn(user, field);
2335
+ }
2336
+ publish() {
2337
+ for (const listener of this.listeners) listener();
2338
+ }
2339
+ };
2340
+ //#endregion
2341
+ //#region lib/types/CommandText.js
2342
+ /** Selectable command text with keyboard access while horizontally overflowing. */
2343
+ /**
2344
+ * Render command text without adding Tab stops for content that fits.
2345
+ * @param props - Text, localized scrollport name, and owner styling.
2346
+ * @returns A horizontal text scrollport, named and keyboard-focusable only when overflowing.
2347
+ */
2348
+ function CommandText({ text, label, className }) {
2349
+ const ref = useRef(null);
2350
+ const [overflow, setOverflow] = useState(false);
2351
+ useLayoutEffect(() => {
2352
+ const element = ref.current;
2353
+ /* v8 ignore next -- the span is rendered unconditionally. */
2354
+ if (element === null) return void 0;
2355
+ const measure = () => {
2356
+ setOverflow(element.scrollWidth > element.clientWidth);
2357
+ };
2358
+ measure();
2359
+ const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(measure);
2360
+ observer?.observe(element);
2361
+ const fonts = "fonts" in element.ownerDocument ? element.ownerDocument.fonts : void 0;
2362
+ fonts?.addEventListener("loadingdone", measure);
2363
+ return () => {
2364
+ observer?.disconnect();
2365
+ fonts?.removeEventListener("loadingdone", measure);
2366
+ };
2367
+ }, [text]);
2368
+ return jsx("span", {
2369
+ ref,
2370
+ className: clsx(css$3.text, className),
2371
+ "data-command-text": true,
2372
+ tabIndex: overflow ? 0 : void 0,
2373
+ role: overflow ? "group" : void 0,
2374
+ "aria-label": overflow ? label : void 0,
2375
+ children: text
2376
+ });
2377
+ }
2378
+ //#endregion
2379
+ //#region lib/types/StateDot.js
2380
+ /** Outer 3x3 matrix cells (2px pixels on a 10px grid), clockwise from top-left. */
2381
+ const MATRIX_CELLS = [
2382
+ [0, 0],
2383
+ [4, 0],
2384
+ [8, 0],
2385
+ [8, 4],
2386
+ [8, 8],
2387
+ [4, 8],
2388
+ [0, 8],
2389
+ [0, 4]
2390
+ ];
2391
+ /**
2392
+ * Render a state dot.
2393
+ * @param props.state - which of `done`, `warning`, `ongoing`, `error`, or `idle` to show.
2394
+ * @param props.size - outer diameter in px (default 10, the figma size).
2395
+ * @param props.className - extra class for layout placement.
2396
+ * @returns the dot element (aria-hidden; pair with text for accessibility).
2397
+ */
2398
+ function StateDot({ state, size = 10, className }) {
2399
+ if (state === "ongoing") return jsx("svg", {
2400
+ className: clsx(css$4.matrix, className),
2401
+ "data-state": "ongoing",
2402
+ width: size,
2403
+ height: size,
2404
+ viewBox: "0 0 10 10",
2405
+ shapeRendering: "crispEdges",
2406
+ "aria-hidden": "true",
2407
+ children: MATRIX_CELLS.map(([x, y], index) => jsx("rect", {
2408
+ className: css$4.cell,
2409
+ x,
2410
+ y,
2411
+ width: "2",
2412
+ height: "2",
2413
+ style: { animationDelay: `${(index - MATRIX_CELLS.length) * 125}ms` }
2414
+ }, `${x}-${y}`))
2415
+ });
2416
+ return jsx("span", {
2417
+ className: clsx(css$4.dot, className),
2418
+ "data-state": state,
2419
+ style: {
2420
+ width: size,
2421
+ height: size
2422
+ },
2423
+ "aria-hidden": "true"
2424
+ });
2425
+ }
2426
+ //#endregion
1891
2427
  //#region lib/types/TextShimmer.js
1892
2428
  /** Text activity animation shared by a row and its nested text fragments. */
1893
2429
  const DecorativeCopy = createContext(void 0);
1894
2430
  function TextContent({ children, className }) {
1895
2431
  const generated = useContext(DecorativeCopy) === true && typeof children === "string";
1896
2432
  return jsx("span", {
1897
- className: clsx(css$1.text, className),
2433
+ className: clsx(css$5.text, className),
1898
2434
  "data-shimmer-text": generated ? children : void 0,
1899
2435
  children: generated ? null : children
1900
2436
  });
@@ -1914,24 +2450,24 @@ const TextShimmer = memo(function TextShimmer({ children, active = false, classN
1914
2450
  });
1915
2451
  const content = typeof children === "string" ? jsx(TextContent, { children }) : children;
1916
2452
  return jsxs("span", {
1917
- className: clsx(css$1.root, className),
2453
+ className: clsx(css$5.root, className),
1918
2454
  "data-shimmer": active || void 0,
1919
2455
  children: [jsx(DecorativeCopy.Provider, {
1920
2456
  value: false,
1921
2457
  children: jsx("span", {
1922
- className: clsx(css$1.content, contentClassName),
2458
+ className: clsx(css$5.content, contentClassName),
1923
2459
  children: content
1924
2460
  })
1925
2461
  }), active && jsx("span", {
1926
- className: css$1.decoration,
2462
+ className: css$5.decoration,
1927
2463
  "aria-hidden": "true",
1928
2464
  inert: "",
1929
2465
  children: jsx("span", {
1930
- className: css$1.sweep,
2466
+ className: css$5.sweep,
1931
2467
  children: jsx(DecorativeCopy.Provider, {
1932
2468
  value: true,
1933
2469
  children: jsx("span", {
1934
- className: clsx(css$1.content, css$1.highlight, contentClassName),
2470
+ className: clsx(css$5.content, css$5.highlight, contentClassName),
1935
2471
  children: content
1936
2472
  })
1937
2473
  })
@@ -1959,15 +2495,15 @@ const DisclosureRow = memo(function DisclosureRow({ icon, title, open, expandabl
1959
2495
  onToggle();
1960
2496
  };
1961
2497
  const collapsedLeading = previewChevron ? jsxs(Fragment, { children: [jsx("span", {
1962
- className: css$2.iconIdle,
2498
+ className: css$6.iconIdle,
1963
2499
  children: icon
1964
- }), jsx(IconChevronDownOutline14, { className: clsx(chevronClassName, css$2.chevronHover) })] }) : icon;
2500
+ }), jsx(IconChevronDownOutline14, { className: clsx(chevronClassName, css$6.chevronHover) })] }) : icon;
1965
2501
  const leading = open ? jsx(IconChevronUpOutline14, { className: chevronClassName }) : collapsedLeading;
1966
2502
  return jsxs("div", {
1967
- className: clsx(css$2.root, className),
2503
+ className: clsx(css$6.root, className),
1968
2504
  "data-open": open || void 0,
1969
2505
  children: [jsxs("div", {
1970
- className: clsx(css$2.row, rowClassName),
2506
+ className: clsx(css$6.row, rowClassName),
1971
2507
  "data-disclosure-row": true,
1972
2508
  "data-expandable": rowExpands || void 0,
1973
2509
  role: rowExpands ? "button" : void 0,
@@ -1977,19 +2513,19 @@ const DisclosureRow = memo(function DisclosureRow({ icon, title, open, expandabl
1977
2513
  onKeyDown: rowExpands ? toggleFromKeyboard : void 0,
1978
2514
  children: [expandable && !rowExpands ? jsx("button", {
1979
2515
  type: "button",
1980
- className: clsx(css$2.leading, leadingClassName),
2516
+ className: clsx(css$6.leading, leadingClassName),
1981
2517
  "aria-expanded": open,
1982
2518
  onClick: toggleFromLeading,
1983
2519
  children: leading
1984
2520
  }) : jsx("span", {
1985
- className: clsx(css$2.leading, leadingClassName),
2521
+ className: clsx(css$6.leading, leadingClassName),
1986
2522
  children: leading
1987
2523
  }), jsxs(TextShimmer, {
1988
2524
  active: running,
1989
2525
  className: contentClassName,
1990
2526
  contentClassName: contentLayoutClassName,
1991
2527
  children: [jsx(TextShimmer, {
1992
- className: clsx(css$2.title, titleClassName),
2528
+ className: clsx(css$6.title, titleClassName),
1993
2529
  children: title
1994
2530
  }), (keepContentWhenOpen || !open) && collapsedContent]
1995
2531
  })]
@@ -2008,10 +2544,10 @@ const DisclosureRow = memo(function DisclosureRow({ icon, title, open, expandabl
2008
2544
  function Button({ variant = "ghost", size = "md", icon, className, children, ...rest }) {
2009
2545
  return jsxs("button", {
2010
2546
  type: "button",
2011
- className: clsx(css$3.button, css$3[variant], css$3[size], className),
2547
+ className: clsx(css$7.button, css$7[variant], css$7[size], className),
2012
2548
  ...rest,
2013
2549
  children: [icon != null && jsx("span", {
2014
- className: css$3.icon,
2550
+ className: css$7.icon,
2015
2551
  children: icon
2016
2552
  }), children]
2017
2553
  });
@@ -2026,12 +2562,12 @@ function Button({ variant = "ghost", size = "md", icon, className, children, ...
2026
2562
  */
2027
2563
  function Pill({ active = false, className, children, onClick, ...rest }) {
2028
2564
  if (!onClick) return jsx("span", {
2029
- className: clsx(css$4.pill, active && css$4.active, className),
2565
+ className: clsx(css$8.pill, active && css$8.active, className),
2030
2566
  children
2031
2567
  });
2032
2568
  return jsx("button", {
2033
2569
  type: "button",
2034
- className: clsx(css$4.pill, css$4.interactive, active && css$4.active, className),
2570
+ className: clsx(css$8.pill, css$8.interactive, active && css$8.active, className),
2035
2571
  onClick,
2036
2572
  ...rest,
2037
2573
  children
@@ -2096,11 +2632,11 @@ function SegmentedControl({ id, value, options, onChange, label, disabled = fals
2096
2632
  ref: list,
2097
2633
  role: "tablist",
2098
2634
  "aria-label": label,
2099
- className: clsx(css$5.control, className),
2635
+ className: clsx(css$9.control, className),
2100
2636
  style: indicator,
2101
2637
  children: [jsx("span", {
2102
2638
  "aria-hidden": "true",
2103
- className: css$5.indicator
2639
+ className: css$9.indicator
2104
2640
  }), options.map((option) => {
2105
2641
  const active = option.value === value;
2106
2642
  return jsx("button", {
@@ -2112,7 +2648,7 @@ function SegmentedControl({ id, value, options, onChange, label, disabled = fals
2112
2648
  tabIndex: active ? 0 : -1,
2113
2649
  disabled: disabled || option.disabled === true,
2114
2650
  title: option.title,
2115
- className: css$5.tab,
2651
+ className: css$9.tab,
2116
2652
  onClick: () => {
2117
2653
  if (!active) onChange(option.value);
2118
2654
  },
@@ -2123,22 +2659,6 @@ function SegmentedControl({ id, value, options, onChange, label, disabled = fals
2123
2659
  });
2124
2660
  }
2125
2661
  //#endregion
2126
- //#region lib/types/Tag.js
2127
- /**
2128
- * Render a read-only tag.
2129
- * @param props.tone - which palette to use (default `outline`).
2130
- * @param props.className - extra class for layout placement.
2131
- * @param props.children - the localized label, owned by the render site.
2132
- * @returns the tag element.
2133
- */
2134
- function Tag({ tone = "outline", className, children }) {
2135
- return jsx("span", {
2136
- className: clsx(css$6.tag, className),
2137
- "data-tone": tone,
2138
- children
2139
- });
2140
- }
2141
- //#endregion
2142
2662
  //#region lib/types/Switch.js
2143
2663
  /**
2144
2664
  * Render a toggle switch.
@@ -2159,11 +2679,11 @@ function Switch({ checked, onChange, label, disabled = false, title, className }
2159
2679
  "aria-label": label,
2160
2680
  title,
2161
2681
  disabled,
2162
- className: clsx(css$7.switch, className),
2682
+ className: clsx(css$10.switch, className),
2163
2683
  onClick: () => {
2164
2684
  onChange(!checked);
2165
2685
  },
2166
- children: jsx("span", { className: css$7.thumb })
2686
+ children: jsx("span", { className: css$10.thumb })
2167
2687
  });
2168
2688
  }
2169
2689
  //#endregion
@@ -2181,7 +2701,7 @@ function Switch({ checked, onChange, label, disabled = false, title, className }
2181
2701
  */
2182
2702
  function Checkbox({ checked, onChange, label, disabled = false, title, className }) {
2183
2703
  return jsxs("label", {
2184
- className: clsx(css$8.checkbox, className),
2704
+ className: clsx(css$11.checkbox, className),
2185
2705
  title,
2186
2706
  children: [jsx("input", {
2187
2707
  type: "checkbox",
@@ -2203,13 +2723,13 @@ function Checkbox({ checked, onChange, label, disabled = false, title, className
2203
2723
  */
2204
2724
  const Input = forwardRef(function Input({ icon, className, ...rest }, ref) {
2205
2725
  return jsxs("span", {
2206
- className: clsx(css$9.wrap, className),
2726
+ className: clsx(css$12.wrap, className),
2207
2727
  children: [icon != null && jsx("span", {
2208
- className: css$9.icon,
2728
+ className: css$12.icon,
2209
2729
  children: icon
2210
2730
  }), jsx("input", {
2211
2731
  ref,
2212
- className: css$9.input,
2732
+ className: css$12.input,
2213
2733
  ...rest
2214
2734
  })]
2215
2735
  });
@@ -2423,9 +2943,9 @@ function useModalLayer(dialog, open, onClose) {
2423
2943
  */
2424
2944
  function ShortcutKeys({ keys, variant = "plain", className }) {
2425
2945
  return jsx("span", {
2426
- className: clsx(css$10.keys, variant === "tooltip" && css$10.tooltip, variant === "tooltip" && keys.includes("+") && css$10.joined, className),
2946
+ className: clsx(css$13.keys, variant === "tooltip" && css$13.tooltip, variant === "tooltip" && keys.includes("+") && css$13.joined, className),
2427
2947
  children: keys.map((key, index) => jsx("kbd", {
2428
- className: key === "+" ? css$10.separator : css$10.key,
2948
+ className: key === "+" ? css$13.separator : css$13.key,
2429
2949
  children: key
2430
2950
  }, index))
2431
2951
  });
@@ -2449,32 +2969,32 @@ function ShortcutKeys({ keys, variant = "plain", className }) {
2449
2969
  */
2450
2970
  function MenuItemButton({ children, shortcut, icon, disabled = false, danger = false, separatorBefore = false, onSelect }) {
2451
2971
  return jsxs("div", {
2452
- className: css$11.itemWrap,
2972
+ className: css$14.itemWrap,
2453
2973
  children: [separatorBefore && jsx("div", {
2454
- className: css$11.separator,
2974
+ className: css$14.separator,
2455
2975
  role: "separator"
2456
2976
  }), jsxs("button", {
2457
2977
  type: "button",
2458
2978
  role: "menuitem",
2459
- className: clsx(css$11.item, danger && css$11.danger),
2979
+ className: clsx(css$14.item, danger && css$14.danger),
2460
2980
  disabled,
2461
2981
  "aria-keyshortcuts": shortcut?.aria,
2462
2982
  onClick: onSelect,
2463
2983
  children: [
2464
2984
  icon !== void 0 && jsx("span", {
2465
- className: css$11.itemIcon,
2985
+ className: css$14.itemIcon,
2466
2986
  children: icon
2467
2987
  }),
2468
2988
  jsx("span", {
2469
- className: css$11.itemLabel,
2989
+ className: css$14.itemLabel,
2470
2990
  children
2471
2991
  }),
2472
2992
  shortcut !== void 0 && jsx("span", {
2473
2993
  "aria-hidden": "true",
2474
- className: css$11.shortcut,
2994
+ className: css$14.shortcut,
2475
2995
  children: jsx(ShortcutKeys, {
2476
2996
  keys: shortcut.keys,
2477
- className: css$11.shortcutKeys
2997
+ className: css$14.shortcutKeys
2478
2998
  })
2479
2999
  })
2480
3000
  ]
@@ -2746,11 +3266,11 @@ function Menu({ open, anchor, items, selectedId, selectedIds, onSelect, onClose,
2746
3266
  const scrollable = !items.some((entry) => !isSeparator(entry) && !isLabel(entry) && entry.submenu !== void 0 && entry.submenu.length > 0);
2747
3267
  const renderEntry = (entry) => {
2748
3268
  if (isSeparator(entry)) return jsx("div", {
2749
- className: css$11.separator,
3269
+ className: css$14.separator,
2750
3270
  role: "separator"
2751
3271
  }, entry.id);
2752
3272
  if (isLabel(entry)) return jsx("div", {
2753
- className: css$11.label,
3273
+ className: css$14.label,
2754
3274
  role: "presentation",
2755
3275
  children: entry.text
2756
3276
  }, entry.id);
@@ -2758,7 +3278,7 @@ function Menu({ open, anchor, items, selectedId, selectedIds, onSelect, onClose,
2758
3278
  const subOpen = hasSub && openSubmenuId === entry.id;
2759
3279
  const selected = entry.id === selectedId || selectedIds?.includes(entry.id) === true;
2760
3280
  return jsxs("div", {
2761
- className: css$11.itemWrap,
3281
+ className: css$14.itemWrap,
2762
3282
  onMouseEnter: () => {
2763
3283
  setOpenSubmenuId(hasSub ? entry.id : null);
2764
3284
  },
@@ -2768,7 +3288,7 @@ function Menu({ open, anchor, items, selectedId, selectedIds, onSelect, onClose,
2768
3288
  children: [jsxs("button", {
2769
3289
  type: "button",
2770
3290
  role: "menuitem",
2771
- className: clsx(css$11.item, selected && (selection === "fill" ? css$11.selectedFill : css$11.selected), entry.danger === true && css$11.danger),
3291
+ className: clsx(css$14.item, selected && (selection === "fill" ? css$14.selectedFill : css$14.selected), entry.danger === true && css$14.danger),
2772
3292
  disabled: entry.disabled,
2773
3293
  "aria-keyshortcuts": entry.shortcut?.aria,
2774
3294
  "aria-haspopup": hasSub ? "menu" : void 0,
@@ -2786,30 +3306,30 @@ function Menu({ open, anchor, items, selectedId, selectedIds, onSelect, onClose,
2786
3306
  },
2787
3307
  children: [
2788
3308
  entry.icon !== void 0 && jsx("span", {
2789
- className: css$11.itemIcon,
3309
+ className: css$14.itemIcon,
2790
3310
  children: entry.icon
2791
3311
  }),
2792
3312
  jsx("span", {
2793
- className: css$11.itemLabel,
3313
+ className: css$14.itemLabel,
2794
3314
  children: entry.label
2795
3315
  }),
2796
3316
  entry.shortcut !== void 0 && jsx("span", {
2797
3317
  "aria-hidden": "true",
2798
- className: css$11.shortcut,
3318
+ className: css$14.shortcut,
2799
3319
  children: jsx(ShortcutKeys, {
2800
3320
  keys: entry.shortcut.keys,
2801
- className: css$11.shortcutKeys
3321
+ className: css$14.shortcutKeys
2802
3322
  })
2803
3323
  }),
2804
- selected && selection === "check" && jsx(IconCheckOutline16, { className: css$11.check })
3324
+ selected && selection === "check" && jsx(IconCheckOutline16, { className: css$14.check })
2805
3325
  ]
2806
3326
  }), subOpen && entry.submenu !== void 0 && jsx("div", {
2807
- className: clsx(css$11.submenu, compact && css$11.compactList),
3327
+ className: clsx(css$14.submenu, compact && css$14.compactList),
2808
3328
  role: "menu",
2809
3329
  children: entry.submenu.map((sub) => jsxs("button", {
2810
3330
  type: "button",
2811
3331
  role: "menuitem",
2812
- className: css$11.item,
3332
+ className: css$14.item,
2813
3333
  disabled: sub.disabled,
2814
3334
  "aria-keyshortcuts": sub.shortcut?.aria,
2815
3335
  onClick: () => {
@@ -2818,19 +3338,19 @@ function Menu({ open, anchor, items, selectedId, selectedIds, onSelect, onClose,
2818
3338
  },
2819
3339
  children: [
2820
3340
  sub.icon !== void 0 && jsx("span", {
2821
- className: css$11.itemIcon,
3341
+ className: css$14.itemIcon,
2822
3342
  children: sub.icon
2823
3343
  }),
2824
3344
  jsx("span", {
2825
- className: css$11.itemLabel,
3345
+ className: css$14.itemLabel,
2826
3346
  children: sub.label
2827
3347
  }),
2828
3348
  sub.shortcut !== void 0 && jsx("span", {
2829
3349
  "aria-hidden": "true",
2830
- className: css$11.shortcut,
3350
+ className: css$14.shortcut,
2831
3351
  children: jsx(ShortcutKeys, {
2832
3352
  keys: sub.shortcut.keys,
2833
- className: css$11.shortcutKeys
3353
+ className: css$14.shortcutKeys
2834
3354
  })
2835
3355
  })
2836
3356
  ]
@@ -2840,25 +3360,25 @@ function Menu({ open, anchor, items, selectedId, selectedIds, onSelect, onClose,
2840
3360
  };
2841
3361
  const list = open && jsxs("div", {
2842
3362
  ref: listRef,
2843
- className: clsx(css$11.list, dense && css$11.denseList, compact && css$11.compactList, scrollable && css$11.scrollable, portal && css$11.portal, side === "top" && !portal && css$11.sideTop, align === "end" && !portal && css$11.alignEnd),
3363
+ className: clsx(css$14.list, dense && css$14.denseList, compact && css$14.compactList, scrollable && css$14.scrollable, portal && css$14.portal, side === "top" && !portal && css$14.sideTop, align === "end" && !portal && css$14.alignEnd),
2844
3364
  style: portal ? fixedPos ?? MEASURE_STYLE : void 0,
2845
3365
  role: "menu",
2846
3366
  onClick: (e) => {
2847
3367
  e.stopPropagation();
2848
3368
  },
2849
3369
  children: [jsx("div", {
2850
- className: css$11.viewport,
3370
+ className: css$14.viewport,
2851
3371
  role: "presentation",
2852
3372
  children: items.map(renderEntry)
2853
3373
  }), footer !== void 0 && footer.length > 0 && jsx("div", {
2854
- className: css$11.footer,
3374
+ className: css$14.footer,
2855
3375
  role: "presentation",
2856
3376
  children: footer.map(renderEntry)
2857
3377
  })]
2858
3378
  });
2859
3379
  return jsxs("span", {
2860
3380
  ref: rootRef,
2861
- className: clsx(css$11.root, className),
3381
+ className: clsx(css$14.root, className),
2862
3382
  onPointerEnter: closeOnPointerLeave ? cancelClose : void 0,
2863
3383
  onPointerLeave: closeOnPointerLeave ? () => {
2864
3384
  if (open) armClose();
@@ -3255,7 +3775,7 @@ function Tooltip({ label, shortcutKeys, side = "right", delayMs = 0, disabled =
3255
3775
  };
3256
3776
  const bubbleNode = visible && !suppressed && jsxs("span", {
3257
3777
  ref: bubble,
3258
- className: css$12.bubble,
3778
+ className: css$15.bubble,
3259
3779
  "data-side": placement,
3260
3780
  "data-portal": portal || void 0,
3261
3781
  "data-has-shortcut": shortcutKeys?.length ? true : void 0,
@@ -3267,7 +3787,7 @@ function Tooltip({ label, shortcutKeys, side = "right", delayMs = 0, disabled =
3267
3787
  role: "tooltip",
3268
3788
  "aria-label": shortcutKeys?.length ? [resolvedLabel, shortcutKeys.join(" ")].filter(Boolean).join(" ") : void 0,
3269
3789
  children: [resolvedLabel && jsx("span", {
3270
- className: css$12.label,
3790
+ className: css$15.label,
3271
3791
  children: resolvedLabel
3272
3792
  }), shortcutKeys !== void 0 && shortcutKeys.length > 0 && jsx(ShortcutKeys, {
3273
3793
  keys: shortcutKeys,
@@ -3473,7 +3993,7 @@ function HoverCard({ anchor, content, openDelayMs = 500, disabled = false, copyT
3473
3993
  const copyable = copyText !== void 0;
3474
3994
  const card = open && pos !== null && !suppressed && jsx("div", {
3475
3995
  ref: cardRef,
3476
- className: clsx(css$13.card, inline && css$13.media, copyable && css$13.copyable, copied && css$13.feedback),
3996
+ className: clsx(css$16.card, inline && css$16.media, copyable && css$16.copyable, copied && css$16.feedback),
3477
3997
  style: {
3478
3998
  ...pos,
3479
3999
  minHeight: copied && copyHeightRef.current !== null ? copyHeightRef.current : void 0
@@ -3494,14 +4014,14 @@ function HoverCard({ anchor, content, openDelayMs = 500, disabled = false, copyT
3494
4014
  copy(copyText);
3495
4015
  } : void 0,
3496
4016
  children: copied ? jsx("span", {
3497
- className: css$13.copied,
4017
+ className: css$16.copied,
3498
4018
  "aria-hidden": "true",
3499
4019
  children: copiedLabel
3500
4020
  }) : content
3501
4021
  });
3502
4022
  return jsxs("span", {
3503
4023
  ref: rootRef,
3504
- className: clsx(css$13.root, inline && css$13.inline),
4024
+ className: clsx(css$16.root, inline && css$16.inline),
3505
4025
  onFocus: inline ? (event) => {
3506
4026
  if (!disabled && event.target.matches(":focus-visible")) {
3507
4027
  cancelClose();
@@ -3540,7 +4060,7 @@ function HoverCard({ anchor, content, openDelayMs = 500, disabled = false, copyT
3540
4060
  children: anchor
3541
4061
  }),
3542
4062
  open && !suppressed && copyable && jsx("span", {
3543
- className: css$13.status,
4063
+ className: css$16.status,
3544
4064
  role: "status",
3545
4065
  children: copied ? copiedLabel : ""
3546
4066
  }),
@@ -3575,11 +4095,11 @@ function Modal({ open, onClose, title, closeLabel, description, children, footer
3575
4095
  useModalLayer(dialog, open, onClose);
3576
4096
  if (!open) return null;
3577
4097
  return createPortal(jsxs("div", {
3578
- className: css$14.root,
4098
+ className: css$17.root,
3579
4099
  role: "presentation",
3580
4100
  onKeyDownCapture,
3581
4101
  children: [jsx("div", {
3582
- className: css$14.mask,
4102
+ className: css$17.mask,
3583
4103
  style: backdropBlur ? void 0 : { backdropFilter: "none" },
3584
4104
  "aria-hidden": "true",
3585
4105
  onClick: onClose
@@ -3587,37 +4107,37 @@ function Modal({ open, onClose, title, closeLabel, description, children, footer
3587
4107
  ref: dialog,
3588
4108
  tabIndex: -1,
3589
4109
  "data-shortcut-modal": shortcutModal,
3590
- className: clsx(css$14.dialog, className),
4110
+ className: clsx(css$17.dialog, className),
3591
4111
  role: "dialog",
3592
4112
  "aria-modal": "true",
3593
4113
  "aria-label": title,
3594
4114
  children: headless ? children : jsxs(Fragment, { children: [jsxs("div", {
3595
- className: clsx(css$14.content, contentClassName),
4115
+ className: clsx(css$17.content, contentClassName),
3596
4116
  children: [
3597
4117
  jsxs("div", {
3598
- className: css$14.header,
4118
+ className: css$17.header,
3599
4119
  children: [jsx("h2", {
3600
- className: css$14.title,
4120
+ className: css$17.title,
3601
4121
  children: title
3602
4122
  }), jsx("button", {
3603
4123
  type: "button",
3604
- className: css$14.close,
4124
+ className: css$17.close,
3605
4125
  "aria-label": closeLabel,
3606
4126
  onClick: onClose,
3607
4127
  children: jsx(IconCloseOutline16, { size: 14 })
3608
4128
  })]
3609
4129
  }),
3610
4130
  description !== void 0 && description !== "" && jsx("p", {
3611
- className: css$14.description,
4131
+ className: css$17.description,
3612
4132
  children: description
3613
4133
  }),
3614
4134
  children !== void 0 && jsx("div", {
3615
- className: css$14.body,
4135
+ className: css$17.body,
3616
4136
  children
3617
4137
  })
3618
4138
  ]
3619
4139
  }), footer !== void 0 && jsx("div", {
3620
- className: css$14.footer,
4140
+ className: css$17.footer,
3621
4141
  children: footer
3622
4142
  })] })
3623
4143
  })]
@@ -3641,13 +4161,13 @@ function OnboardingSurface({ children }) {
3641
4161
  };
3642
4162
  }, []);
3643
4163
  return createPortal(jsxs("div", {
3644
- className: css$15.onboardingOverlay,
4164
+ className: css$18.onboardingOverlay,
3645
4165
  role: "presentation",
3646
4166
  children: [jsx("div", {
3647
- className: css$15.onboardingMask,
4167
+ className: css$18.onboardingMask,
3648
4168
  "aria-hidden": "true"
3649
4169
  }), jsx("div", {
3650
- className: css$15.onboardingStage,
4170
+ className: css$18.onboardingStage,
3651
4171
  children
3652
4172
  })]
3653
4173
  }), document.body);
@@ -3668,28 +4188,28 @@ function RiskConfirmation({ open, title, description, acknowledgeLabel, cancelLa
3668
4188
  onClose: onCancel,
3669
4189
  title,
3670
4190
  closeLabel,
3671
- className: css$16.confirmation ?? "",
3672
- contentClassName: css$16.confirmationContent ?? "",
4191
+ className: css$19.confirmation ?? "",
4192
+ contentClassName: css$19.confirmationContent ?? "",
3673
4193
  footer: jsxs(Fragment, { children: [jsx(Button, {
3674
4194
  variant: "outline",
3675
- className: css$16.modalAction,
4195
+ className: css$19.modalAction,
3676
4196
  onClick: onCancel,
3677
4197
  children: cancelLabel
3678
4198
  }), jsx(Button, {
3679
4199
  variant: "primary",
3680
- className: css$16.confirmAction,
4200
+ className: css$19.confirmAction,
3681
4201
  disabled: disabled || !acknowledged,
3682
4202
  onClick: onConfirm,
3683
4203
  children: confirmLabel
3684
4204
  })] }),
3685
4205
  children: [jsxs("div", {
3686
- className: css$16.warning,
4206
+ className: css$19.warning,
3687
4207
  children: [jsx(IconWarningOutline16, {
3688
4208
  size: 18,
3689
- className: css$16.warningIcon
4209
+ className: css$19.warningIcon
3690
4210
  }), jsx("p", { children: description })]
3691
4211
  }), jsxs("label", {
3692
- className: css$16.acknowledgement,
4212
+ className: css$19.acknowledgement,
3693
4213
  children: [jsx("input", {
3694
4214
  type: "checkbox",
3695
4215
  checked: acknowledged,
@@ -3737,47 +4257,47 @@ function ConnectionIndicator({ state, disconnectedLabel, connectingLabel, recove
3737
4257
  };
3738
4258
  }, [state, rendered]);
3739
4259
  if (rendered === void 0) return null;
3740
- const leavingClass = leaving ? ` ${css$17.leaving}` : "";
4260
+ const leavingClass = leaving ? ` ${css$20.leaving}` : "";
3741
4261
  if (rendered === "recovered") return jsxs("div", {
3742
- className: `${css$17.indicator} ${css$17.success}${leavingClass}`,
4262
+ className: `${css$20.indicator} ${css$20.success}${leavingClass}`,
3743
4263
  role: "status",
3744
4264
  "aria-label": recoveredLabel,
3745
4265
  children: [jsx("span", {
3746
- className: css$17.icon,
4266
+ className: css$20.icon,
3747
4267
  "aria-hidden": "true",
3748
4268
  children: jsx(IconCheckOutline16, { size: 14 })
3749
4269
  }), jsx("span", {
3750
- className: css$17.label,
4270
+ className: css$20.label,
3751
4271
  children: recoveredLabel
3752
4272
  })]
3753
4273
  });
3754
4274
  const connecting = rendered === "connecting";
3755
4275
  return jsxs("button", {
3756
4276
  type: "button",
3757
- className: `${css$17.indicator} ${css$17.warning}${leavingClass}`,
4277
+ className: `${css$20.indicator} ${css$20.warning}${leavingClass}`,
3758
4278
  "data-phase": rendered,
3759
4279
  "aria-label": connecting ? restartActionLabel : reconnectActionLabel,
3760
4280
  onClick: onReconnect,
3761
4281
  children: [jsx("span", {
3762
- className: css$17.icon,
4282
+ className: css$20.icon,
3763
4283
  "aria-hidden": "true",
3764
4284
  children: connecting ? jsx(IconLoadingOutline16, {
3765
4285
  size: 14,
3766
- className: css$17.spinner
4286
+ className: css$20.spinner
3767
4287
  }) : jsx(IconRefreshOutline14, { size: 14 })
3768
4288
  }), jsx("span", {
3769
- className: css$17.label,
4289
+ className: css$20.label,
3770
4290
  children: connecting ? jsxs(Fragment, { children: [connectingLabel, jsxs("span", {
3771
- className: css$17.dots,
4291
+ className: css$20.dots,
3772
4292
  "aria-hidden": "true",
3773
4293
  children: [
3774
4294
  jsx("span", { children: "." }),
3775
4295
  jsx("span", {
3776
- className: css$17.secondDot,
4296
+ className: css$20.secondDot,
3777
4297
  children: "."
3778
4298
  }),
3779
4299
  jsx("span", {
3780
- className: css$17.thirdDot,
4300
+ className: css$20.thirdDot,
3781
4301
  children: "."
3782
4302
  })
3783
4303
  ]
@@ -3836,9 +4356,9 @@ function cellTransform(left) {
3836
4356
  */
3837
4357
  /** Cinnabar body gradient, top to bottom: the seal's warm lit upper edge. */
3838
4358
  const BODY_STOPS = [
3839
- "#d4503d",
3840
- "#c3402f",
3841
- "#a23526"
4359
+ "#c94a40",
4360
+ "#b7352c",
4361
+ "#8f2a21"
3842
4362
  ];
3843
4363
  /** Warm white of the glyphs against the cinnabar body. */
3844
4364
  const GLYPH_FILL = "#fff5eb";
@@ -4602,7 +5122,7 @@ function FileTypeIcon(props) {
4602
5122
  type: resolvedType,
4603
5123
  size,
4604
5124
  className
4605
- }) : glyph(resolvedType, size, clsx(css$18.icon, css$18[resolvedType], className));
5125
+ }) : glyph(resolvedType, size, clsx(css$21.icon, css$21[resolvedType], className));
4606
5126
  }
4607
5127
  //#endregion
4608
5128
  //#region lib/types/SiteGlyph.js
@@ -4915,17 +5435,17 @@ function PathLabel({ path, className, ...attributes }) {
4915
5435
  return jsx("span", {
4916
5436
  ...attributes,
4917
5437
  ref: boxRef,
4918
- className: clsx(css$19.path, className),
5438
+ className: clsx(css$22.path, className),
4919
5439
  title: path,
4920
5440
  "data-path-label": true,
4921
5441
  children: jsxs("span", {
4922
5442
  ref: textRef,
4923
- className: css$19.text,
5443
+ className: css$22.text,
4924
5444
  children: [directory !== "" && jsx("span", {
4925
- className: css$19.directory,
5445
+ className: css$22.directory,
4926
5446
  children: directory
4927
5447
  }), jsx("span", {
4928
- className: css$19.name,
5448
+ className: css$22.name,
4929
5449
  children: name
4930
5450
  })]
4931
5451
  })
@@ -4993,7 +5513,7 @@ function projectUserText(text, sessionLabels, slashNames = [], slashKind = "skil
4993
5513
  let cursor = 0;
4994
5514
  const pushPlain = (from, to) => {
4995
5515
  parts.push(jsx("span", {
4996
- className: css$20.plainRun,
5516
+ className: css$23.plainRun,
4997
5517
  children: text.slice(from, to)
4998
5518
  }, `t${from}`));
4999
5519
  };
@@ -5006,14 +5526,14 @@ function projectUserText(text, sessionLabels, slashNames = [], slashKind = "skil
5006
5526
  const contents = jsxs(Fragment, { children: [referenceKind !== void 0 && jsx(ReferenceIcon, {
5007
5527
  kind: referenceKind,
5008
5528
  size: 16,
5009
- className: css$20.refIcon
5529
+ className: css$23.refIcon
5010
5530
  }), displayLabel] });
5011
5531
  const open = references === void 0 ? void 0 : referenceKind === "file" ? () => {
5012
5532
  references.openFile(label.slice(1).replace(/^"|"$/gu, ""));
5013
5533
  } : referenceKind === void 0 && slashKind === "skill" ? () => {
5014
5534
  references.openSkill(label.slice(1));
5015
5535
  } : void 0;
5016
- const className = clsx(css$20.refChip, referenceKind === void 0 && css$20.slashChip);
5536
+ const className = clsx(css$23.refChip, referenceKind === void 0 && css$23.slashChip);
5017
5537
  parts.push(open === void 0 ? jsx("span", {
5018
5538
  className,
5019
5539
  "data-ref-chip": referenceKind ?? slashKind,
@@ -5033,7 +5553,7 @@ function projectUserText(text, sessionLabels, slashNames = [], slashKind = "skil
5033
5553
  cursor = end;
5034
5554
  }
5035
5555
  if (parts.length === 0) return jsx("span", {
5036
- className: css$20.plainRun,
5556
+ className: css$23.plainRun,
5037
5557
  children: text
5038
5558
  });
5039
5559
  if (cursor < text.length) pushPlain(cursor, text.length);
@@ -5092,22 +5612,22 @@ function Toast({ text, icon, tone, anchor, holdMs = HOLD_MS, onDone }) {
5092
5612
  };
5093
5613
  }, [anchor]);
5094
5614
  return createPortal(jsxs("div", {
5095
- className: css$21.toast,
5615
+ className: css$24.toast,
5096
5616
  role: "alert",
5097
5617
  style: {
5098
5618
  ...left === null ? {} : { left },
5099
5619
  "--qilin-toast-hold": `${String(holdMs)}ms`
5100
5620
  },
5101
5621
  children: [tone === "success" ? jsx("span", {
5102
- className: `${css$21.icon} ${css$21.success}`,
5622
+ className: `${css$24.icon} ${css$24.success}`,
5103
5623
  "aria-hidden": true,
5104
5624
  children: jsx(IconCheckOutline16, {})
5105
5625
  }) : icon !== void 0 && jsx("span", {
5106
- className: css$21.icon,
5626
+ className: css$24.icon,
5107
5627
  "aria-hidden": true,
5108
5628
  children: icon
5109
5629
  }), jsx("span", {
5110
- className: css$21.text,
5630
+ className: css$24.text,
5111
5631
  children: text
5112
5632
  })]
5113
5633
  }), document.body);
@@ -5304,8 +5824,28 @@ function rankByName(items, rawQuery) {
5304
5824
  * @returns true only inside the macOS Electron shell.
5305
5825
  */
5306
5826
  function isDarwinDesktop() {
5827
+ if (typeof document === "undefined") return false;
5307
5828
  return document.documentElement.dataset.platform === "darwin";
5308
5829
  }
5830
+ /**
5831
+ * Subscribe to `data-platform` flips on `<html>` for decisions made outside
5832
+ * render (apply-world projections that cannot re-read the DOM per frame).
5833
+ * The listener fires on attribute changes after this call, not for the
5834
+ * current value — pair it with a fresh `isDarwinDesktop()` read.
5835
+ * @param listener - Called on every `data-platform` attribute change.
5836
+ * @returns Disposer that stops watching.
5837
+ */
5838
+ function watchDarwinDesktop(listener) {
5839
+ if (typeof document === "undefined") return () => {};
5840
+ const observer = new MutationObserver(listener);
5841
+ observer.observe(document.documentElement, {
5842
+ attributes: true,
5843
+ attributeFilter: ["data-platform"]
5844
+ });
5845
+ return () => {
5846
+ observer.disconnect();
5847
+ };
5848
+ }
5309
5849
  //#endregion
5310
5850
  //#region lib/types/JsonTree.js
5311
5851
  const OBJECT_PREVIEW_LIMIT = 4;
@@ -5381,7 +5921,7 @@ function JsonCopyAction({ store, target, persistent, labels, onCopy, onClose })
5381
5921
  const object = typeof target.value === "object" && target.value !== null;
5382
5922
  const copyTitle = state === "copied" ? labels.copied : state === "failed" ? labels.copyFailed : object ? labels.copyPrettyJson : labels.copyValue;
5383
5923
  return jsx("span", {
5384
- className: css$22.copySlot,
5924
+ className: css$25.copySlot,
5385
5925
  children: (persistent || snapshot !== void 0) && jsx(Menu, {
5386
5926
  open: snapshot?.menuOpen === true,
5387
5927
  compact: true,
@@ -5390,7 +5930,7 @@ function JsonCopyAction({ store, target, persistent, labels, onCopy, onClose })
5390
5930
  anchor: jsx("button", {
5391
5931
  ref: buttonRef,
5392
5932
  type: "button",
5393
- className: css$22.actionButton,
5933
+ className: css$25.actionButton,
5394
5934
  "data-json-copy-button": true,
5395
5935
  "data-state": state,
5396
5936
  "aria-label": copyTitle,
@@ -5429,35 +5969,35 @@ function bracketOf(value) {
5429
5969
  }
5430
5970
  function previewPrimitive(value) {
5431
5971
  if (value === null) return jsx("span", {
5432
- className: css$22.keywordValue,
5972
+ className: css$25.keywordValue,
5433
5973
  children: "null"
5434
5974
  });
5435
5975
  if (typeof value === "string") return jsx("span", {
5436
- className: css$22.stringValue,
5976
+ className: css$25.stringValue,
5437
5977
  children: JSON.stringify(value)
5438
5978
  });
5439
5979
  if (typeof value === "number") return jsx("span", {
5440
- className: css$22.numberValue,
5980
+ className: css$25.numberValue,
5441
5981
  children: String(value)
5442
5982
  });
5443
5983
  if (typeof value === "boolean") return jsx("span", {
5444
- className: css$22.keywordValue,
5984
+ className: css$25.keywordValue,
5445
5985
  children: String(value)
5446
5986
  });
5447
5987
  if (typeof value === "bigint") return jsx("span", {
5448
- className: css$22.otherValue,
5988
+ className: css$25.otherValue,
5449
5989
  children: value.toString()
5450
5990
  });
5451
5991
  if (typeof value === "undefined") return jsx("span", {
5452
- className: css$22.otherValue,
5992
+ className: css$25.otherValue,
5453
5993
  children: "undefined"
5454
5994
  });
5455
5995
  if (typeof value === "symbol") return jsx("span", {
5456
- className: css$22.otherValue,
5996
+ className: css$25.otherValue,
5457
5997
  children: value.description ?? "Symbol"
5458
5998
  });
5459
5999
  if (typeof value === "function") return jsx("span", {
5460
- className: css$22.otherValue,
6000
+ className: css$25.otherValue,
5461
6001
  children: value.name || "Function"
5462
6002
  });
5463
6003
  return null;
@@ -5471,71 +6011,71 @@ function previewValue(value, depth) {
5471
6011
  const [open, close] = bracketOf(value);
5472
6012
  return jsxs(Fragment, { children: [
5473
6013
  jsx("span", {
5474
- className: css$22.punctuation,
6014
+ className: css$25.punctuation,
5475
6015
  children: open
5476
6016
  }),
5477
6017
  depth >= PREVIEW_DEPTH_LIMIT ? jsx("span", {
5478
- className: css$22.previewEllipsis,
6018
+ className: css$25.previewEllipsis,
5479
6019
  children: "…"
5480
6020
  }) : visible.map(([key, item], index) => jsxs("span", { children: [
5481
6021
  index > 0 && jsx("span", {
5482
- className: css$22.punctuation,
6022
+ className: css$25.punctuation,
5483
6023
  children: ", "
5484
6024
  }),
5485
6025
  !array && jsxs(Fragment, { children: [jsx("span", {
5486
- className: css$22.previewProperty,
6026
+ className: css$25.previewProperty,
5487
6027
  children: key
5488
6028
  }), jsx("span", {
5489
- className: css$22.punctuation,
6029
+ className: css$25.punctuation,
5490
6030
  children: ": "
5491
6031
  })] }),
5492
6032
  previewValue(item, depth + 1)
5493
6033
  ] }, key)),
5494
6034
  depth < PREVIEW_DEPTH_LIMIT && entries.length > limit && jsx("span", {
5495
- className: css$22.previewEllipsis,
6035
+ className: css$25.previewEllipsis,
5496
6036
  children: ", …"
5497
6037
  }),
5498
6038
  jsx("span", {
5499
- className: css$22.punctuation,
6039
+ className: css$25.punctuation,
5500
6040
  children: close
5501
6041
  })
5502
6042
  ] });
5503
6043
  }
5504
6044
  function primitiveValue(value) {
5505
6045
  if (value === null) return jsx("span", {
5506
- className: css$22.keywordValue,
6046
+ className: css$25.keywordValue,
5507
6047
  children: "null"
5508
6048
  });
5509
6049
  if (typeof value === "string") return jsx("span", {
5510
- className: css$22.stringValue,
6050
+ className: css$25.stringValue,
5511
6051
  children: JSON.stringify(value)
5512
6052
  });
5513
6053
  if (typeof value === "boolean") return jsx("span", {
5514
- className: css$22.keywordValue,
6054
+ className: css$25.keywordValue,
5515
6055
  children: String(value)
5516
6056
  });
5517
6057
  if (typeof value === "number") return jsx("span", {
5518
- className: css$22.numberValue,
6058
+ className: css$25.numberValue,
5519
6059
  children: String(value)
5520
6060
  });
5521
6061
  if (typeof value === "bigint") return jsx("span", {
5522
- className: css$22.numberValue,
6062
+ className: css$25.numberValue,
5523
6063
  children: `${value.toString()}n`
5524
6064
  });
5525
6065
  if (value instanceof Date) return jsx("span", {
5526
- className: css$22.otherValue,
6066
+ className: css$25.otherValue,
5527
6067
  children: value.toISOString()
5528
6068
  });
5529
6069
  if (typeof value === "function") return jsxs("span", {
5530
- className: css$22.otherValue,
6070
+ className: css$25.otherValue,
5531
6071
  children: ["function() ", "{ }"]
5532
6072
  });
5533
6073
  if (typeof value === "undefined") return jsx("span", {
5534
- className: css$22.otherValue,
6074
+ className: css$25.otherValue,
5535
6075
  children: "undefined"
5536
6076
  });
5537
6077
  return jsx("span", {
5538
- className: css$22.otherValue,
6078
+ className: css$25.otherValue,
5539
6079
  children: value.toString()
5540
6080
  });
5541
6081
  }
@@ -5563,7 +6103,7 @@ function moveFocus(button, direction) {
5563
6103
  function NodeField({ field, expandable, onToggle }) {
5564
6104
  if (field === void 0) return null;
5565
6105
  return jsxs("span", {
5566
- className: clsx(css$22.label, expandable && css$22.clickableLabel),
6106
+ className: clsx(css$25.label, expandable && css$25.clickableLabel),
5567
6107
  onClick: expandable ? onToggle : void 0,
5568
6108
  children: [fieldText(field), ":"]
5569
6109
  });
@@ -5600,7 +6140,7 @@ function JsonString({ collapsedStringLines, stringWrapping, field, labels, lastE
5600
6140
  if (!expanded) return;
5601
6141
  const raw = rawRef.current;
5602
6142
  const clips = [];
5603
- const tree = raw.closest(`.${css$22.root}`);
6143
+ const tree = raw.closest(`.${css$25.root}`);
5604
6144
  for (let parent = tree.parentElement; parent !== null; parent = parent.parentElement) if (/auto|scroll|hidden|clip/.test(getComputedStyle(parent).overflowY)) clips.push(parent);
5605
6145
  const measure = () => {
5606
6146
  let top = 0;
@@ -5629,33 +6169,33 @@ function JsonString({ collapsedStringLines, stringWrapping, field, labels, lastE
5629
6169
  if (expanded) {
5630
6170
  const fieldId = `${contentsId}-field`;
5631
6171
  return jsxs("div", {
5632
- className: css$22.stringField,
6172
+ className: css$25.stringField,
5633
6173
  "data-expanded": true,
5634
6174
  children: [
5635
6175
  field !== void 0 && jsxs("span", {
5636
6176
  id: fieldId,
5637
- className: css$22.label,
6177
+ className: css$25.label,
5638
6178
  children: [fieldText(field), ":"]
5639
6179
  }),
5640
6180
  jsx("pre", {
5641
6181
  ref: rawRef,
5642
6182
  id: contentsId,
5643
- className: css$22.stringRaw,
6183
+ className: css$25.stringRaw,
5644
6184
  "data-wrap": wrapped,
5645
6185
  tabIndex: 0,
5646
6186
  "aria-labelledby": field === void 0 ? void 0 : fieldId,
5647
6187
  children: value
5648
6188
  }),
5649
6189
  !lastElement && jsx("span", {
5650
- className: css$22.punctuation,
6190
+ className: css$25.punctuation,
5651
6191
  children: ","
5652
6192
  }),
5653
6193
  jsxs("div", {
5654
- className: css$22.stringActions,
6194
+ className: css$25.stringActions,
5655
6195
  children: [
5656
6196
  stringWrapping !== void 0 && jsx("button", {
5657
6197
  type: "button",
5658
- className: css$22.actionButton,
6198
+ className: css$25.actionButton,
5659
6199
  "aria-label": stringWrapping.label,
5660
6200
  title: stringWrapping.label,
5661
6201
  "aria-pressed": wrapped,
@@ -5669,7 +6209,7 @@ function JsonString({ collapsedStringLines, stringWrapping, field, labels, lastE
5669
6209
  }),
5670
6210
  jsx("button", {
5671
6211
  type: "button",
5672
- className: css$22.actionButton,
6212
+ className: css$25.actionButton,
5673
6213
  "aria-label": labels.collapseNode,
5674
6214
  title: labels.collapseNode,
5675
6215
  "aria-expanded": true,
@@ -5695,18 +6235,18 @@ function JsonString({ collapsedStringLines, stringWrapping, field, labels, lastE
5695
6235
  });
5696
6236
  }
5697
6237
  return jsxs(Fragment, { children: [renderCopy?.(), jsx("span", {
5698
- className: css$22.stringField,
6238
+ className: css$25.stringField,
5699
6239
  "data-expanded": expanded,
5700
6240
  children: jsxs("span", {
5701
6241
  ref: contentRef,
5702
6242
  id: contentsId,
5703
- className: css$22.stringText,
6243
+ className: css$25.stringText,
5704
6244
  children: [
5705
6245
  truncated && jsx("span", {
5706
- className: css$22.stringToggleSlot,
6246
+ className: css$25.stringToggleSlot,
5707
6247
  children: jsxs("button", {
5708
6248
  type: "button",
5709
- className: css$22.stringToggle,
6249
+ className: css$25.stringToggle,
5710
6250
  "aria-label": labels.expandNode,
5711
6251
  "aria-expanded": false,
5712
6252
  "aria-controls": contentsId,
@@ -5721,12 +6261,12 @@ function JsonString({ collapsedStringLines, stringWrapping, field, labels, lastE
5721
6261
  })
5722
6262
  }),
5723
6263
  field !== void 0 && jsxs("span", {
5724
- className: css$22.label,
6264
+ className: css$25.label,
5725
6265
  children: [fieldText(field), ":"]
5726
6266
  }),
5727
6267
  primitiveValue(value),
5728
6268
  !lastElement && jsx("span", {
5729
- className: css$22.punctuation,
6269
+ className: css$25.punctuation,
5730
6270
  children: ","
5731
6271
  })
5732
6272
  ]
@@ -5757,7 +6297,7 @@ function JsonTreeNode({ collapsedStringLines, stringWrapping, field, initialExpa
5757
6297
  }
5758
6298
  };
5759
6299
  const row = (children, ariaExpanded) => jsxs("div", {
5760
- className: css$22.row,
6300
+ className: css$25.row,
5761
6301
  role: "treeitem",
5762
6302
  "aria-expanded": ariaExpanded,
5763
6303
  onMouseOver: (event) => {
@@ -5792,7 +6332,7 @@ function JsonTreeNode({ collapsedStringLines, stringWrapping, field, initialExpa
5792
6332
  }),
5793
6333
  primitiveValue(value),
5794
6334
  !lastElement && jsx("span", {
5795
- className: css$22.punctuation,
6335
+ className: css$25.punctuation,
5796
6336
  children: ","
5797
6337
  })
5798
6338
  ] }));
@@ -5804,22 +6344,22 @@ function JsonTreeNode({ collapsedStringLines, stringWrapping, field, initialExpa
5804
6344
  onToggle: toggle
5805
6345
  }),
5806
6346
  jsx("span", {
5807
- className: css$22.punctuation,
6347
+ className: css$25.punctuation,
5808
6348
  children: open
5809
6349
  }),
5810
6350
  jsx("span", {
5811
- className: css$22.punctuation,
6351
+ className: css$25.punctuation,
5812
6352
  children: close
5813
6353
  }),
5814
6354
  !lastElement && jsx("span", {
5815
- className: css$22.punctuation,
6355
+ className: css$25.punctuation,
5816
6356
  children: ","
5817
6357
  })
5818
6358
  ] }));
5819
6359
  return row(jsxs(Fragment, { children: [
5820
6360
  jsx("span", {
5821
6361
  ref: expanderRef,
5822
- className: clsx(css$22.expander, expanded ? css$22.collapseIcon : css$22.expandIcon),
6362
+ className: clsx(css$25.expander, expanded ? css$25.collapseIcon : css$25.expandIcon),
5823
6363
  "data-json-expander": true,
5824
6364
  role: "button",
5825
6365
  "aria-label": expanded ? labels.collapseNode : labels.expandNode,
@@ -5833,7 +6373,7 @@ function JsonTreeNode({ collapsedStringLines, stringWrapping, field, initialExpa
5833
6373
  onKeyDown: onExpanderKeyDown
5834
6374
  }),
5835
6375
  jsxs("span", {
5836
- className: css$22.summary,
6376
+ className: css$25.summary,
5837
6377
  children: [
5838
6378
  jsx(NodeField, {
5839
6379
  field,
@@ -5841,11 +6381,11 @@ function JsonTreeNode({ collapsedStringLines, stringWrapping, field, initialExpa
5841
6381
  onToggle: toggle
5842
6382
  }),
5843
6383
  jsx("span", {
5844
- className: css$22.preview,
6384
+ className: css$25.preview,
5845
6385
  children: previewValue(value, 0)
5846
6386
  }),
5847
6387
  !lastElement && jsx("span", {
5848
- className: css$22.punctuation,
6388
+ className: css$25.punctuation,
5849
6389
  children: ","
5850
6390
  })
5851
6391
  ]
@@ -5853,7 +6393,7 @@ function JsonTreeNode({ collapsedStringLines, stringWrapping, field, initialExpa
5853
6393
  expanded && jsx("ul", {
5854
6394
  id: contentsId,
5855
6395
  role: "group",
5856
- className: css$22.children,
6396
+ className: css$25.children,
5857
6397
  children: entries.map(([key, item], index) => jsx(JsonTreeNode, {
5858
6398
  collapsedStringLines,
5859
6399
  stringWrapping,
@@ -5985,17 +6525,17 @@ function JsonTree({ data, label, className, collapsedStringLines = 3, stringWrap
5985
6525
  onClose: clearCopyTarget
5986
6526
  }) : void 0;
5987
6527
  return jsx("div", {
5988
- className: clsx(css$22.root, className),
6528
+ className: clsx(css$25.root, className),
5989
6529
  style: { "--json-tree-collapsed-lines": collapsedStringLines },
5990
6530
  onMouseOver: handleRootMouseOver,
5991
6531
  onMouseLeave: () => {
5992
6532
  if (!copyStore.get()?.menuOpen) clearCopyTarget();
5993
6533
  },
5994
6534
  children: expandTopLevel ? jsxs("div", {
5995
- className: css$22.expandedTopLevel,
6535
+ className: css$25.expandedTopLevel,
5996
6536
  children: [
5997
6537
  jsxs("div", {
5998
- className: clsx(css$22.row, css$22.topLevelBracket),
6538
+ className: clsx(css$25.row, css$25.topLevelBracket),
5999
6539
  "data-json-root-row": true,
6000
6540
  onMouseOver: (event) => {
6001
6541
  event.stopPropagation();
@@ -6008,13 +6548,13 @@ function JsonTree({ data, label, className, collapsedStringLines = 3, stringWrap
6008
6548
  path: [],
6009
6549
  value: data
6010
6550
  }), jsx("span", {
6011
- className: css$22.punctuation,
6551
+ className: css$25.punctuation,
6012
6552
  children: rootOpen
6013
6553
  })]
6014
6554
  }),
6015
6555
  jsx("div", {
6016
6556
  "aria-label": label,
6017
- className: clsx(css$22.container, css$22.expandedTopLevelContainer),
6557
+ className: clsx(css$25.container, css$25.expandedTopLevelContainer),
6018
6558
  role: "tree",
6019
6559
  children: rootEntries.map(([key, value], index) => jsx(JsonTreeNode, {
6020
6560
  collapsedStringLines,
@@ -6032,16 +6572,16 @@ function JsonTree({ data, label, className, collapsedStringLines = 3, stringWrap
6032
6572
  }, key))
6033
6573
  }),
6034
6574
  jsx("div", {
6035
- className: clsx(css$22.row, css$22.topLevelBracket),
6575
+ className: clsx(css$25.row, css$25.topLevelBracket),
6036
6576
  children: jsx("span", {
6037
- className: css$22.punctuation,
6577
+ className: css$25.punctuation,
6038
6578
  children: rootClose
6039
6579
  })
6040
6580
  })
6041
6581
  ]
6042
6582
  }) : jsx("div", {
6043
6583
  "aria-label": label,
6044
- className: css$22.container,
6584
+ className: css$25.container,
6045
6585
  role: "tree",
6046
6586
  children: jsx(JsonTreeNode, {
6047
6587
  collapsedStringLines,
@@ -6579,67 +7119,68 @@ function TerminalBlock({ command, cwd, home, output, exitCode, signal, running =
6579
7119
  const { hidden, capped, headLines, tailLines } = headTailCap(lines.length, maxLines, expanded);
6580
7120
  const body = !running || !empty;
6581
7121
  return jsxs("div", {
6582
- className: clsx(css$23.block, className),
7122
+ className: clsx(css$26.block, className),
6583
7123
  "data-terminal": "",
6584
7124
  "data-running": running ? "" : void 0,
6585
7125
  "data-body": body ? "" : void 0,
6586
7126
  children: [jsxs("div", {
6587
- className: css$23.header,
7127
+ className: css$26.header,
6588
7128
  children: [
6589
7129
  jsxs("div", {
6590
- className: css$23.prompt,
7130
+ className: css$26.prompt,
6591
7131
  children: [jsx("span", {
6592
- className: css$23.runStateLabel,
7132
+ className: css$26.runStateLabel,
6593
7133
  children: state.label
6594
7134
  }), commandLines.map((line, index) => jsxs("div", {
6595
- className: css$23.promptLine,
7135
+ className: css$26.promptLine,
6596
7136
  children: [
6597
7137
  index === 0 && jsx(StateDot, {
6598
7138
  state: state.state,
6599
- className: css$23.runState
7139
+ className: css$26.runState
6600
7140
  }),
6601
7141
  jsx("span", {
6602
- className: css$23.cwd,
7142
+ className: css$26.cwd,
6603
7143
  children: index > 0 || cwd === void 0 ? "$" : promptLabel(cwd, home)
6604
7144
  }),
6605
- jsx("span", {
6606
- className: css$23.command,
6607
- children: line
7145
+ jsx(CommandText, {
7146
+ className: css$26.command,
7147
+ text: line,
7148
+ label: copy.commandLine(index + 1)
6608
7149
  })
6609
7150
  ]
6610
7151
  }, index))]
6611
7152
  }),
6612
7153
  status !== void 0 && jsx(Pill, {
6613
- className: css$23.status,
7154
+ className: css$26.status,
6614
7155
  children: status
6615
7156
  }),
6616
7157
  !running && !empty && jsx("button", {
6617
7158
  type: "button",
6618
- className: css$23.copyButton,
7159
+ className: css$26.copyButton,
6619
7160
  onClick: onCopy,
6620
7161
  children: copied ? copy.copied : copy.copy
6621
7162
  })
6622
7163
  ]
6623
7164
  }), body && (empty ? jsx("div", {
6624
- className: css$23.empty,
7165
+ className: css$26.empty,
6625
7166
  children: copy.noOutput
6626
7167
  }) : jsxs("div", {
6627
- className: css$23.output,
7168
+ className: css$26.output,
6628
7169
  children: [
6629
7170
  (capped ? lines.slice(0, headLines) : lines).map((line, index) => jsx("div", {
6630
- className: css$23.line,
7171
+ className: css$26.line,
6631
7172
  children: renderLine$1(line)
6632
7173
  }, index)),
6633
7174
  hidden > 0 && jsx("button", {
6634
7175
  type: "button",
6635
- className: css$23.expand,
7176
+ className: css$26.expand,
6636
7177
  "aria-expanded": expanded,
6637
7178
  "aria-label": expanded ? copy.collapseAria : copy.expandAria(hidden),
6638
7179
  onClick: onToggle,
6639
7180
  children: expanded ? copy.collapse : copy.expand(hidden)
6640
7181
  }),
6641
7182
  capped && lines.slice(lines.length - tailLines).map((line, index) => jsx("div", {
6642
- className: css$23.line,
7183
+ className: css$26.line,
6643
7184
  children: renderLine$1(line)
6644
7185
  }, index))
6645
7186
  ]
@@ -6812,6 +7353,13 @@ const regexEngine = createJavaScriptRegexEngine({
6812
7353
  forgiving: true,
6813
7354
  regexConstructor: (pattern) => defaultJavaScriptRegexConstructor(pattern, { lazyCompileLength: Number.POSITIVE_INFINITY })
6814
7355
  });
7356
+ /**
7357
+ * Lines at least this many UTF-16 units long render as one uncolored token.
7358
+ * TextMate scanning cost grows superlinearly with line length (a 20,000-unit
7359
+ * string literal blocks the main thread for seconds), and minified or
7360
+ * generated lines are where that length occurs.
7361
+ */
7362
+ const TOKENIZE_MAX_LINE_LENGTH = 1e3;
6815
7363
  let singleton;
6816
7364
  /** Representative paths through every boot grammar, compiled before user content is timed. */
6817
7365
  const BOOT_GRAMMAR_WARMUPS = [
@@ -6919,7 +7467,8 @@ function highlightToHtml(code, lang) {
6919
7467
  if (!ensureGrammar(resolved)) return void 0;
6920
7468
  return highlighter().codeToHtml(code, {
6921
7469
  lang: resolved,
6922
- theme: "css-variables"
7470
+ theme: "css-variables",
7471
+ tokenizeMaxLineLength: TOKENIZE_MAX_LINE_LENGTH
6923
7472
  });
6924
7473
  }
6925
7474
  /** vscode-textmate FontStyle bits shiki folds into `text-decoration` values. */
@@ -7012,6 +7561,7 @@ var StreamingHighlightSession = class {
7012
7561
  return highlighter().codeToTokensBase(text, {
7013
7562
  lang: resolved,
7014
7563
  theme: "css-variables",
7564
+ tokenizeMaxLineLength: TOKENIZE_MAX_LINE_LENGTH,
7015
7565
  ...this.state === void 0 ? {} : { grammarState: this.state }
7016
7566
  });
7017
7567
  }
@@ -7091,7 +7641,8 @@ function highlightLines(code, lang) {
7091
7641
  if (!ensureGrammar(resolved)) return void 0;
7092
7642
  const { tokens } = highlighter().codeToTokens(code, {
7093
7643
  lang: resolved,
7094
- theme: "css-variables"
7644
+ theme: "css-variables",
7645
+ tokenizeMaxLineLength: TOKENIZE_MAX_LINE_LENGTH
7095
7646
  });
7096
7647
  const last = tokens[tokens.length - 1];
7097
7648
  return (tokens.length > 1 && last !== void 0 && last.length === 0 ? tokens.slice(0, -1) : tokens).map((line) => line.map((token) => ({
@@ -7217,51 +7768,51 @@ function ReadBlock({ label, labels, lines, totalLines, lang, maxLines = 16, clas
7217
7768
  const tailLines = maxLines - headLines;
7218
7769
  const windowed = lines.length < totalLines;
7219
7770
  const rows = (slice) => slice.map(([line, spans]) => jsxs("div", {
7220
- className: css$24.line,
7771
+ className: css$27.line,
7221
7772
  children: [jsx("span", {
7222
- className: css$24.gutter,
7773
+ className: css$27.gutter,
7223
7774
  "aria-hidden": true,
7224
7775
  children: line.number
7225
7776
  }), jsx("span", {
7226
- className: css$24.content,
7777
+ className: css$27.content,
7227
7778
  children: spans === void 0 ? line.text : renderSpans(spans)
7228
7779
  })]
7229
7780
  }, line.number));
7230
7781
  const paired = lines.map((line, index) => [line, highlighted?.[index]]);
7231
7782
  return jsxs("div", {
7232
7783
  ref: rootRef,
7233
- className: clsx(css$24.block, className),
7784
+ className: clsx(css$27.block, className),
7234
7785
  "data-read": "",
7235
7786
  children: [jsxs("div", {
7236
- className: css$24.banner,
7787
+ className: css$27.banner,
7237
7788
  children: [jsx("div", {
7238
- className: css$24.label,
7789
+ className: css$27.label,
7239
7790
  children: label ?? ""
7240
7791
  }), jsxs("div", {
7241
- className: css$24.action,
7792
+ className: css$27.action,
7242
7793
  children: [
7243
7794
  windowed && jsx("span", {
7244
- className: css$24.count,
7795
+ className: css$27.count,
7245
7796
  children: labels.window(lines.length, totalLines)
7246
7797
  }),
7247
7798
  jsx("span", {
7248
- className: css$24.lang,
7799
+ className: css$27.lang,
7249
7800
  children: lang ?? ""
7250
7801
  }),
7251
7802
  lines.length > 0 && jsx("button", {
7252
7803
  type: "button",
7253
- className: css$24.copyButton,
7804
+ className: css$27.copyButton,
7254
7805
  onClick: onCopy,
7255
7806
  children: copied ? labels.copied : labels.copy
7256
7807
  })
7257
7808
  ]
7258
7809
  })]
7259
7810
  }), jsxs("div", {
7260
- className: css$24.body,
7811
+ className: css$27.body,
7261
7812
  children: [
7262
7813
  rows(capped ? paired.slice(0, headLines) : paired),
7263
7814
  hidden > 0 && jsx(FoldToggle, {
7264
- className: css$24.expand,
7815
+ className: css$27.expand,
7265
7816
  expanded,
7266
7817
  hidden,
7267
7818
  labels,
@@ -7283,11 +7834,11 @@ function assertNever(value) {
7283
7834
  }
7284
7835
  /** The dim class per row kind (path/gap chrome vs the diff's own +/- colors). */
7285
7836
  const ROW_CLASS = {
7286
- path: css$25.path,
7287
- del: css$25.del,
7288
- add: css$25.add,
7289
- context: css$25.context,
7290
- gap: css$25.gap
7837
+ path: css$28.path,
7838
+ del: css$28.del,
7839
+ add: css$28.add,
7840
+ context: css$28.context,
7841
+ gap: css$28.gap
7291
7842
  };
7292
7843
  /** Bound synchronous edit-graph search; one replacement consumes two edits. */
7293
7844
  const MAX_DIFF_EDIT_LENGTH = 256;
@@ -7425,37 +7976,37 @@ function DiffBlock({ diffs, labels, maxLines = 16, className }) {
7425
7976
  const head = capped ? rows.slice(0, headLines) : rows;
7426
7977
  const tail = capped ? rows.slice(rows.length - tailLines) : [];
7427
7978
  return jsxs("div", {
7428
- className: clsx(css$25.block, className),
7979
+ className: clsx(css$28.block, className),
7429
7980
  "data-diff": "",
7430
7981
  children: [
7431
7982
  jsx("button", {
7432
7983
  type: "button",
7433
- className: css$25.copyButton,
7984
+ className: css$28.copyButton,
7434
7985
  onClick: onCopy,
7435
7986
  children: copied ? labels.copied : labels.copy
7436
7987
  }),
7437
7988
  jsxs("div", {
7438
- className: css$25.body,
7989
+ className: css$28.body,
7439
7990
  children: [
7440
7991
  head.map((row, index) => jsx("div", {
7441
- className: clsx(css$25.line, ROW_CLASS[row.kind]),
7992
+ className: clsx(css$28.line, ROW_CLASS[row.kind]),
7442
7993
  children: row.text
7443
7994
  }, index)),
7444
7995
  hidden > 0 && jsx(FoldToggle, {
7445
- className: css$25.expand,
7996
+ className: css$28.expand,
7446
7997
  expanded,
7447
7998
  hidden,
7448
7999
  labels,
7449
8000
  onToggle
7450
8001
  }),
7451
8002
  tail.map((row, index) => jsx("div", {
7452
- className: clsx(css$25.line, ROW_CLASS[row.kind]),
8003
+ className: clsx(css$28.line, ROW_CLASS[row.kind]),
7453
8004
  children: row.text
7454
8005
  }, index))
7455
8006
  ]
7456
8007
  }),
7457
8008
  jsxs("div", {
7458
- className: css$25.footer,
8009
+ className: css$28.footer,
7459
8010
  children: [
7460
8011
  "└ +",
7461
8012
  added,
@@ -7591,56 +8142,56 @@ function SearchBlock(props) {
7591
8142
  const tail = tailHeader === void 0 ? naturalTail : naturalTail.slice(1);
7592
8143
  const renderRow = (row) => {
7593
8144
  if (row.type === "path") return jsx("div", {
7594
- className: css$26.line,
8145
+ className: css$29.line,
7595
8146
  children: row.path
7596
8147
  });
7597
8148
  if (row.type === "match") return jsxs("div", {
7598
- className: css$26.line,
8149
+ className: css$29.line,
7599
8150
  children: [jsxs("span", {
7600
- className: css$26.lineNumber,
8151
+ className: css$29.lineNumber,
7601
8152
  children: [row.lineNumber, ": "]
7602
8153
  }), row.line]
7603
8154
  });
7604
8155
  return jsxs("button", {
7605
8156
  type: "button",
7606
- className: css$26.fileHeader,
8157
+ className: css$29.fileHeader,
7607
8158
  "aria-expanded": !row.collapsed,
7608
8159
  onClick: () => {
7609
8160
  toggleFile(row.index);
7610
8161
  },
7611
8162
  children: [jsx("span", {
7612
- className: css$26.filePath,
8163
+ className: css$29.filePath,
7613
8164
  children: row.path
7614
8165
  }), jsx("span", {
7615
- className: css$26.fileCount,
8166
+ className: css$29.fileCount,
7616
8167
  children: row.count
7617
8168
  })]
7618
8169
  });
7619
8170
  };
7620
8171
  return jsxs("div", {
7621
- className: clsx(css$26.block, className),
8172
+ className: clsx(css$29.block, className),
7622
8173
  "data-search": props.kind,
7623
8174
  children: [jsxs("div", {
7624
- className: css$26.header,
8175
+ className: css$29.header,
7625
8176
  children: [jsx("span", {
7626
- className: css$26.summary,
8177
+ className: css$29.summary,
7627
8178
  children: summaryText(props, shown, truncated, total)
7628
8179
  }), !empty && jsx("button", {
7629
8180
  type: "button",
7630
- className: css$26.copyButton,
8181
+ className: css$29.copyButton,
7631
8182
  onClick: onCopy,
7632
8183
  children: copied ? props.labels.copied : props.labels.copy
7633
8184
  })]
7634
8185
  }), empty ? jsx("div", {
7635
- className: css$26.empty,
8186
+ className: css$29.empty,
7636
8187
  children: props.labels.noResults
7637
8188
  }) : jsxs("div", {
7638
- className: css$26.body,
8189
+ className: css$29.body,
7639
8190
  children: [
7640
8191
  head.map((row) => jsx("div", { children: renderRow(row) }, rowKey(row))),
7641
8192
  hidden > 0 && jsx("button", {
7642
8193
  type: "button",
7643
- className: css$26.expand,
8194
+ className: css$29.expand,
7644
8195
  "aria-expanded": expanded,
7645
8196
  "aria-label": expanded ? props.labels.collapseAria : props.labels.expandAria(hidden),
7646
8197
  onClick: onToggle,
@@ -8468,7 +9019,7 @@ function CodeBlock({ code, lang, streaming, className, contentRef, lineNumbers =
8468
9019
  });
8469
9020
  }, [copied, trimmed]);
8470
9021
  const body = streamedBody !== void 0 ? streamedBody : html === void 0 ? jsx("pre", {
8471
- className: css$27.plain,
9022
+ className: css$30.plain,
8472
9023
  children: jsx("code", { children: sourceLines === void 0 ? trimmed : sourceLines.map((line, index) => jsxs(Fragment$1, { children: [index > 0 && "\n", jsx("span", {
8473
9024
  className: "line",
8474
9025
  children: line
@@ -8476,22 +9027,22 @@ function CodeBlock({ code, lang, streaming, className, contentRef, lineNumbers =
8476
9027
  }) : jsx("div", { dangerouslySetInnerHTML: { __html: html } });
8477
9028
  return jsxs("div", {
8478
9029
  ref: rootRef,
8479
- className: clsx(css$27.block, "md-code-block", lineNumbers && css$27.numbered, className),
9030
+ className: clsx(css$30.block, "md-code-block", lineNumbers && css$30.numbered, className),
8480
9031
  "data-line-numbers": lineNumbers || void 0,
8481
9032
  style: sourceLines === void 0 ? void 0 : { "--dsl-code-block-line-number-width": `${Math.max(2, String(sourceLines.length).length)}ch` },
8482
9033
  children: [showHeader && jsx("div", {
8483
- className: css$27.bannerWrap,
9034
+ className: css$30.bannerWrap,
8484
9035
  children: jsxs("div", {
8485
- className: css$27.banner,
9036
+ className: css$30.banner,
8486
9037
  "data-code-block-banner": true,
8487
9038
  children: [jsx("div", {
8488
- className: css$27.infostring,
9039
+ className: css$30.infostring,
8489
9040
  children: lang ?? ""
8490
9041
  }), jsx("div", {
8491
- className: css$27.action,
9042
+ className: css$30.action,
8492
9043
  children: jsx("button", {
8493
9044
  type: "button",
8494
- className: css$27.copyButton,
9045
+ className: css$30.copyButton,
8495
9046
  onClick: onCopy,
8496
9047
  children: copied ? copiedLabel : copyLabel
8497
9048
  })
@@ -8499,7 +9050,7 @@ function CodeBlock({ code, lang, streaming, className, contentRef, lineNumbers =
8499
9050
  })
8500
9051
  }), jsx("div", {
8501
9052
  ref: contentRef,
8502
- className: css$27.content,
9053
+ className: css$30.content,
8503
9054
  "data-code-block-content": true,
8504
9055
  children: body
8505
9056
  })]
@@ -8650,15 +9201,15 @@ function MermaidDiagram({ code, copyLabel, copiedLabel, diagramLabel, enlargedLa
8650
9201
  };
8651
9202
  }, [code, domId]);
8652
9203
  if (state.status === "loading") return jsx("div", {
8653
- className: css$28.stage,
9204
+ className: css$31.stage,
8654
9205
  "data-mermaid-loading": true,
8655
9206
  "aria-hidden": "true"
8656
9207
  });
8657
9208
  if (state.status === "error") return jsxs("div", {
8658
- className: css$28.error,
9209
+ className: css$31.error,
8659
9210
  role: "alert",
8660
9211
  children: [jsx("span", {
8661
- className: css$28.errorLine,
9212
+ className: css$31.errorLine,
8662
9213
  children: state.message
8663
9214
  }), jsx(CodeBlock, {
8664
9215
  code: `${code}\n`,
@@ -8667,7 +9218,7 @@ function MermaidDiagram({ code, copyLabel, copiedLabel, diagramLabel, enlargedLa
8667
9218
  })]
8668
9219
  });
8669
9220
  const stage = jsx("div", {
8670
- className: css$28.stage,
9221
+ className: css$31.stage,
8671
9222
  "data-mermaid-diagram": true,
8672
9223
  dangerouslySetInnerHTML: { __html: state.svg },
8673
9224
  onClick: () => {
@@ -8682,13 +9233,13 @@ function MermaidDiagram({ code, copyLabel, copiedLabel, diagramLabel, enlargedLa
8682
9233
  });
8683
9234
  if (zoom === null) return stage;
8684
9235
  return jsxs(Fragment, { children: [stage, createPortal(jsx("div", {
8685
- className: css$28.zoomOverlay,
9236
+ className: css$31.zoomOverlay,
8686
9237
  onClick: () => {
8687
9238
  setZoom(null);
8688
9239
  },
8689
9240
  role: "presentation",
8690
9241
  children: jsx("div", {
8691
- className: css$28.zoomStage,
9242
+ className: css$31.zoomStage,
8692
9243
  dangerouslySetInnerHTML: { __html: zoom },
8693
9244
  onClick: (event) => {
8694
9245
  event.stopPropagation();
@@ -8882,25 +9433,25 @@ function ImageLightbox({ src, alt, labels, onClose }) {
8882
9433
  };
8883
9434
  }, [onClose]);
8884
9435
  return createPortal(jsxs("div", {
8885
- className: css$29.backdrop,
9436
+ className: css$32.backdrop,
8886
9437
  role: "dialog",
8887
9438
  "aria-modal": "true",
8888
9439
  "aria-label": labels.dialog,
8889
9440
  children: [
8890
9441
  jsx("div", {
8891
- className: css$29.mask,
9442
+ className: css$32.mask,
8892
9443
  "aria-hidden": "true",
8893
9444
  onMouseDown: onClose
8894
9445
  }),
8895
9446
  jsx("img", {
8896
- className: css$29.image,
9447
+ className: css$32.image,
8897
9448
  src,
8898
9449
  alt
8899
9450
  }),
8900
9451
  jsx("button", {
8901
9452
  ref: closeRef,
8902
9453
  type: "button",
8903
- className: css$29.close,
9454
+ className: css$32.close,
8904
9455
  "aria-label": labels.close,
8905
9456
  onClick: onClose,
8906
9457
  children: jsx(IconCloseOutline16, { size: 16 })
@@ -8927,14 +9478,14 @@ function ImagePreview({ src, alt, loadingLabel, failedLabel }) {
8927
9478
  function Preview({ src, alt, loadingLabel, failedLabel }) {
8928
9479
  const [state, setState] = useState("loading");
8929
9480
  return jsxs("span", {
8930
- className: css$30.frame,
9481
+ className: css$33.frame,
8931
9482
  children: [state !== "failed" && jsx("img", {
8932
9483
  src,
8933
9484
  alt,
8934
9485
  loading: "lazy",
8935
9486
  decoding: "async",
8936
9487
  referrerPolicy: "no-referrer",
8937
- className: css$30.image,
9488
+ className: css$33.image,
8938
9489
  "data-ready": state === "ready" || void 0,
8939
9490
  onLoad: () => {
8940
9491
  setState("ready");
@@ -8943,7 +9494,7 @@ function Preview({ src, alt, loadingLabel, failedLabel }) {
8943
9494
  setState("failed");
8944
9495
  }
8945
9496
  }), state !== "ready" && jsxs("span", {
8946
- className: css$30.status,
9497
+ className: css$33.status,
8947
9498
  role: "status",
8948
9499
  children: [state === "loading" && jsx(IconLoadingOutline16, { size: 16 }), jsx("span", { children: state === "loading" ? loadingLabel : failedLabel })]
8949
9500
  })]
@@ -9714,7 +10265,7 @@ function SafeLink({ url, label, className }) {
9714
10265
  children: [jsx(LinkIcon, {
9715
10266
  kind: "url",
9716
10267
  href,
9717
- className: css$31.linkIcon
10268
+ className: css$34.linkIcon
9718
10269
  }), label]
9719
10270
  });
9720
10271
  }
@@ -9729,20 +10280,20 @@ function SafeLink({ url, label, className }) {
9729
10280
  */
9730
10281
  function SourceItem({ source, ordinal }) {
9731
10282
  return jsxs("li", {
9732
- className: css$31.source,
10283
+ className: css$34.source,
9733
10284
  value: ordinal,
9734
10285
  children: [
9735
10286
  jsx(SafeLink, {
9736
10287
  url: source.url,
9737
10288
  label: linkLabel(source.url, source.title),
9738
- className: css$31.sourceLink
10289
+ className: css$34.sourceLink
9739
10290
  }),
9740
10291
  source.snippet !== void 0 && source.snippet !== "" && jsx("div", {
9741
- className: css$31.snippet,
10292
+ className: css$34.snippet,
9742
10293
  children: source.snippet
9743
10294
  }),
9744
10295
  source.publishedAt !== void 0 && source.publishedAt !== "" && jsx("div", {
9745
- className: css$31.published,
10296
+ className: css$34.published,
9746
10297
  children: source.publishedAt
9747
10298
  })
9748
10299
  ]
@@ -9757,28 +10308,28 @@ function SourceItem({ source, ordinal }) {
9757
10308
  function WebSearchBlock({ answer, sources, truncated, labels, className }) {
9758
10309
  const empty = (answer === void 0 || answer === "") && sources.length === 0;
9759
10310
  return jsxs("div", {
9760
- className: clsx(css$31.block, className),
10311
+ className: clsx(css$34.block, className),
9761
10312
  "data-web": "search",
9762
10313
  children: [
9763
10314
  answer !== void 0 && answer !== "" && jsx("div", {
9764
- className: css$31.answer,
10315
+ className: css$34.answer,
9765
10316
  children: jsx(MarkdownText, {
9766
10317
  text: answer,
9767
10318
  labels: labels.markdown
9768
10319
  })
9769
10320
  }),
9770
10321
  empty ? jsx("div", {
9771
- className: css$31.empty,
10322
+ className: css$34.empty,
9772
10323
  children: labels.noResults
9773
10324
  }) : jsx("ol", {
9774
- className: css$31.sources,
10325
+ className: css$34.sources,
9775
10326
  children: sources.map((source, index) => jsx(SourceItem, {
9776
10327
  source,
9777
10328
  ordinal: index + 1
9778
10329
  }, index))
9779
10330
  }),
9780
10331
  truncated && jsx("div", {
9781
- className: css$31.truncated,
10332
+ className: css$34.truncated,
9782
10333
  children: labels.sourcesTruncated
9783
10334
  })
9784
10335
  ]
@@ -9791,23 +10342,23 @@ function WebSearchBlock({ answer, sources, truncated, labels, className }) {
9791
10342
  */
9792
10343
  function WebFetchBlock({ url, statusCode, truncated, labels, className }) {
9793
10344
  return jsxs("div", {
9794
- className: clsx(css$31.block, css$31.fetch, className),
10345
+ className: clsx(css$34.block, css$34.fetch, className),
9795
10346
  "data-web": "fetch",
9796
10347
  children: [jsx(SafeLink, {
9797
10348
  url,
9798
10349
  label: url,
9799
- className: css$31.fetchUrl
10350
+ className: css$34.fetchUrl
9800
10351
  }), jsxs("div", {
9801
- className: css$31.fetchMeta,
10352
+ className: css$34.fetchMeta,
9802
10353
  children: [jsxs("span", {
9803
- className: css$31.status,
10354
+ className: css$34.status,
9804
10355
  children: [
9805
10356
  labels.http,
9806
10357
  " ",
9807
10358
  statusCode
9808
10359
  ]
9809
10360
  }), truncated && jsx("span", {
9810
- className: css$31.truncated,
10361
+ className: css$34.truncated,
9811
10362
  children: labels.contentTruncated
9812
10363
  })]
9813
10364
  })]
@@ -9841,10 +10392,10 @@ function JsonBlock({ label, payload, defaultOpen = false, truncatedLabel }) {
9841
10392
  truncatedLabel
9842
10393
  ]);
9843
10394
  return jsxs("div", {
9844
- className: css$32.root,
10395
+ className: css$35.root,
9845
10396
  children: [jsxs("button", {
9846
10397
  type: "button",
9847
- className: css$32.toggle,
10398
+ className: css$35.toggle,
9848
10399
  onClick: () => {
9849
10400
  setOpen((v) => !v);
9850
10401
  },
@@ -9854,7 +10405,7 @@ function JsonBlock({ label, payload, defaultOpen = false, truncatedLabel }) {
9854
10405
  label
9855
10406
  ]
9856
10407
  }), open && jsx("pre", {
9857
- className: css$32.body,
10408
+ className: css$35.body,
9858
10409
  children: body
9859
10410
  })]
9860
10411
  });
@@ -9944,17 +10495,17 @@ function MenuGroup({ label, children }) {
9944
10495
  role: "group",
9945
10496
  "aria-labelledby": headingId,
9946
10497
  "data-menu-group": "",
9947
- className: css$33.group,
10498
+ className: css$36.group,
9948
10499
  children: [
9949
10500
  jsx("span", {
9950
10501
  "aria-hidden": "true",
9951
10502
  "data-menu-group-start": "",
9952
- className: css$33.start
10503
+ className: css$36.start
9953
10504
  }),
9954
10505
  jsx("div", {
9955
10506
  id: headingId,
9956
10507
  "data-menu-group-heading": "",
9957
- className: css$33.heading,
10508
+ className: css$36.heading,
9958
10509
  children: label
9959
10510
  }),
9960
10511
  children
@@ -10070,20 +10621,20 @@ const MenuSurface = forwardRef(function MenuSurface({ compact = false, className
10070
10621
  ...props,
10071
10622
  ref,
10072
10623
  "data-menu-material": "translucent",
10073
- className: clsx(css$34.surface, compact && css$34.compact, className),
10624
+ className: clsx(css$37.surface, compact && css$37.compact, className),
10074
10625
  style: {
10075
10626
  ...style,
10076
10627
  ...anchorStyle
10077
10628
  },
10078
10629
  children: [jsx("div", {
10079
10630
  "aria-hidden": "true",
10080
- className: css$34.material
10631
+ className: css$37.material
10081
10632
  }), children]
10082
10633
  }), createPortal(jsx("div", {
10083
10634
  ref: backingRef,
10084
10635
  "aria-hidden": "true",
10085
10636
  "data-menu-backing": "",
10086
- className: clsx(css$34.backing, compact && css$34.compact),
10637
+ className: clsx(css$37.backing, compact && css$37.compact),
10087
10638
  style: {
10088
10639
  ...anchorStyle,
10089
10640
  visibility: style?.visibility
@@ -10091,6 +10642,6 @@ const MenuSurface = forwardRef(function MenuSurface({ compact = false, className
10091
10642
  }), document.body)] });
10092
10643
  });
10093
10644
  //#endregion
10094
- export { Button, Checkbox, CodeBlock, ConnectionIndicator, DEFAULT_DIFF_MAX_LINES, DEFAULT_READ_MAX_LINES, DEFAULT_SEARCH_MAX_LINES, DEFAULT_TERMINAL_MAX_LINES, DiffBlock, DisclosureRow, FileTypeIcon, HoverCard, IconAgentPresetOutline16, IconAlarmClockOutline16, IconApiOutline14, IconArchiveOutline20, IconBranchOutline16, IconBrowseOutline16, IconCheckOutline14, IconCheckOutline16, IconChecklistOutline14, IconChevronDownOutline14, IconChevronLeftOutline14, IconChevronRightOutline14, IconChevronUpOutline14, IconClockOutline16, IconCloseFill14, IconCloseOutline16, IconCodeOutline16, IconCompactOutline16, IconContextInjectionOutline16, IconCopyOutline16, IconCordisPluginOutline14, IconDarkOutline16, IconDataOutline16, IconDatabaseOutline16, IconDislikeFill16, IconDislikeOutline16, IconDownloadOutline16, IconEditOutline16, IconEllipsisOutline16, IconEnhanceOutline16, IconFolderClose16, IconFolderOpen16, IconFolderOpenOutline16, IconFollowsystemOutline16, IconFullscreenOutline16, IconGaugeOutline16, IconGlobeOutline14, IconGoalOutline16, IconInfoOutline14, IconInspectOutline12, IconLightOutline16, IconLikeFill16, IconLikeOutline16, IconLinkOutline14, IconLinkOutline16, IconListPenOutline16, IconLoadingOutline16, IconLogoutOutline16, IconMicrophoneOutline16, IconNewChatOutline16, IconPanelLeftOutline16, IconPaperPlaneOutline14, IconPaperclipOutline16, IconPauseOutline16, IconPersonalizationOutline16, IconPinFillRegular, IconPinOutlineRegular, IconPlanOutline14, IconPlayOutline16, IconPluginPinwheelOutline16, IconPlusOutline16, IconProjectAddOutline16, IconQuestionOutline14, IconQueueOutline14, IconRefreshOutline14, IconRefreshOutline16, IconRightUpOutline14, IconRightUpOutline16, IconSearchOutline16, IconSendOutline14, IconSendOutline16, IconSettingsOutline14, IconSettingsOutline16, IconShareOutline16, IconShieldOutline16, IconSkillOutline16, IconSparkle16, IconStopFill16, IconTerminalOutline16, IconThinkOutline14, IconThinkOutline16, IconTrashOutline16, IconTreeCorner8x10, IconTriangleRightFill14, IconUserOutline16, IconWarningOutline16, IconWrapLinesOutline16, ImageLightbox, Input, JsonBlock, JsonTree, LinkIcon, MarkdownDelegateProvider, MarkdownText, Menu, MenuGroup, MenuItemButton, MenuSurface, Modal, OnboardingSurface, PathLabel, Pill, QilinSeal, ReadBlock, ReferenceIcon, RiskConfirmation, SHIELD_OUTLINE_PATH, SHIELD_OUTLINE_STROKE, SearchBlock, SegmentedControl, ShortcutKeys, StateDot, Switch, Tag, TerminalBlock, TextShimmer, Toast, Tooltip, WebBlock, classifyFileType, classifyLinkPath, closeTopModal, diffTotals, extractMarkdownPlainText, fileExtension, fileSizeRoundedText, fileSizeText, focusWithoutRing, isBehindModal, isDarwinDesktop, modalSelector, observeComposition, observeStickyMenuGroups, overlayTopMargin, projectUserText, rankByName, relativeTime, useAnchoredMaxHeight, useAnchoredPosition, useCopyFeedback, useDismissOnOutsidePointer, useModalLayer, writeClipboard };
10645
+ export { Button, Checkbox, CodeBlock, CommandText, ConnectionIndicator, DEFAULT_DIFF_MAX_LINES, DEFAULT_READ_MAX_LINES, DEFAULT_SEARCH_MAX_LINES, DEFAULT_TERMINAL_MAX_LINES, DiffBlock, DisclosureRow, FileTypeIcon, HoverCard, IconAgentPresetOutline16, IconAlarmClockOutline16, IconApiOutline14, IconArchiveOutline20, IconBranchOutline16, IconBrowseOutline16, IconCheckOutline14, IconCheckOutline16, IconChecklistOutline14, IconChevronDownOutline14, IconChevronLeftOutline14, IconChevronRightOutline14, IconChevronUpOutline14, IconClockOutline16, IconCloseFill14, IconCloseOutline16, IconCodeOutline16, IconCompactOutline16, IconContextInjectionOutline16, IconCopyOutline16, IconCordisPluginOutline14, IconDarkOutline16, IconDataOutline16, IconDatabaseOutline16, IconDislikeFill16, IconDislikeOutline16, IconDownloadOutline16, IconEditOutline16, IconEllipsisOutline16, IconEnhanceOutline16, IconFolderClose16, IconFolderOpen16, IconFolderOpenOutline16, IconFollowsystemOutline16, IconFullscreenOutline16, IconGaugeOutline16, IconGlobeOutline14, IconGoalOutline16, IconInfoOutline14, IconInspectOutline12, IconLightOutline16, IconLikeFill16, IconLikeOutline16, IconLinkOutline14, IconLinkOutline16, IconListPenOutline16, IconLoadingOutline16, IconLogoutOutline16, IconMicrophoneOutline16, IconNewChatOutline16, IconPanelLeftOutline16, IconPaperPlaneOutline14, IconPaperclipOutline16, IconPauseOutline16, IconPersonalizationOutline16, IconPinFillRegular, IconPinOutlineRegular, IconPlanOutline14, IconPlayOutline16, IconPluginPinwheelOutline16, IconPlusOutline16, IconProjectAddOutline16, IconQuestionOutline14, IconQueueOutline14, IconRefreshOutline14, IconRefreshOutline16, IconRightUpOutline14, IconRightUpOutline16, IconSearchOutline16, IconSendOutline14, IconSendOutline16, IconSettingsOutline14, IconSettingsOutline16, IconShareOutline16, IconShieldOutline16, IconSkillOutline16, IconSparkle16, IconStopFill16, IconTerminalOutline16, IconThinkOutline14, IconThinkOutline16, IconTrashOutline16, IconTreeCorner8x10, IconTriangleRightFill14, IconUserOutline16, IconWarningOutline16, IconWrapLinesOutline16, ImageLightbox, Input, JsonBlock, JsonTree, LinkIcon, MarkdownDelegateProvider, MarkdownText, Menu, MenuGroup, MenuItemButton, MenuSurface, Modal, OnboardingSurface, PathLabel, Pill, QilinSeal, ReadBlock, ReferenceIcon, RiskConfirmation, SHIELD_OUTLINE_PATH, SHIELD_OUTLINE_STROKE, SearchBlock, SegmentedControl, SettingsForm, SettingsFormModel, SettingsSecretField, SettingsValueField, ShortcutKeys, StateDot, Switch, Tag, TerminalBlock, TextShimmer, Toast, Tooltip, WebBlock, classifyFileType, classifyLinkPath, closeTopModal, diffTotals, extractMarkdownPlainText, fileExtension, fileSizeRoundedText, fileSizeText, focusWithoutRing, isBehindModal, isDarwinDesktop, modalSelector, observeComposition, observeStickyMenuGroups, overlayTopMargin, projectUserText, rankByName, relativeTime, settingsNumberField, settingsTextField, useAnchoredMaxHeight, useAnchoredPosition, useCopyFeedback, useDismissOnOutsidePointer, useModalLayer, watchDarwinDesktop, writeClipboard };
10095
10646
 
10096
10647
  //# sourceMappingURL=index.js.map