@theoremjs/studio 0.3.4-next.767.gb6b8d79 → 0.3.4-next.775.g5f0bb29
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/package.json +6 -6
- package/page/assets/CheckboxInput-BIFNQqbA.js +2 -0
- package/page/assets/{CodeBlock-DzXH_9DF.js → CodeBlock-PkWvyBvu.js} +2 -2
- package/page/assets/CollapsibleGroup-Dfbkt6Hp.js +1 -0
- package/page/assets/ConsoleFrame-BVEFqivX.js +3 -0
- package/page/assets/DateInput-D8vNhNrf.js +1 -0
- package/page/assets/FieldStatus-CSAKvGxp.js +1 -0
- package/page/assets/HStack-cOiUht-L.js +1 -0
- package/page/assets/Icon-BWzSKxTK.js +3 -0
- package/page/assets/IconButton-CerBBPke.js +1 -0
- package/page/assets/{ListItem-MWWVygeh.js → ListItem-DrfoLYVQ.js} +1 -1
- package/page/assets/{MenuBottomSheet-DHHFwrX2.js → MenuBottomSheet-B0DPU8JO.js} +1 -1
- package/page/assets/{MenuBottomSheetActionList-CYZ56fty.js → MenuBottomSheetActionList-CG8160ZS.js} +1 -1
- package/page/assets/{OverflowList-CsAj89UP.js → OverflowList-BoqbSk8e.js} +1 -1
- package/page/assets/SchemaFields-Dwraq_--.js +1 -0
- package/page/assets/SidePanel-DLgOJwvB.js +2 -0
- package/page/assets/Spinner--TVdDovX.js +1 -0
- package/page/assets/Stack-DPSs1dBF.js +1 -0
- package/page/assets/StackItem-YZCLellt.js +1 -0
- package/page/assets/TextInput-6ChkOVD6.js +1 -0
- package/page/assets/{TimestampHoverCard-BNDnoAyp.js → TimestampHoverCard-G3Y6IWqf.js} +1 -1
- package/page/assets/ToolResultCharts-CB1SGg8J.js +1 -0
- package/page/assets/{Toolbar-BDW6J7QA.js → Toolbar-B4_kHYjv.js} +1 -1
- package/page/assets/TraceInspector-C0LTBfVr.js +1 -0
- package/page/assets/{TraceOverview-3TC0yf85.js → TraceOverview-BY38HKBw.js} +4 -4
- package/page/assets/VStack-CEcm-qoM.js +1 -0
- package/page/assets/VisuallyHidden-BdRLF-8h.js +1 -0
- package/page/assets/{browser-engine-CMbqiA6o.js → browser-engine-BWDlGtMc.js} +3 -3
- package/page/assets/{browser-transport-D-kfBycp.js → browser-transport-BbEN2A1B.js} +3 -3
- package/page/assets/editor.api-BldS301e.js +908 -0
- package/page/assets/{export-agent-SKuzsCut.js → export-agent-DFTb8H8_.js} +3 -3
- package/page/assets/fieldParts-CNKpMZ7U.js +1 -0
- package/page/assets/{guardrail-tester-CaSlReMa.js → guardrail-tester-CnFsnpR-.js} +2 -2
- package/page/assets/{highlightRanges-yrVxbmkN.js → highlightRanges-DvvjZZAv.js} +1 -1
- package/page/assets/index-CL2Rgk4q.js +150 -0
- package/page/assets/index-hzhWkDKG.css +1 -0
- package/page/assets/inputStyles.stylex-uYr8_KtT.js +1 -0
- package/page/assets/json-code-CZUkGQFJ.js +3 -0
- package/page/assets/json.worker-DdeUAmHa.js +65 -0
- package/page/assets/json.worker-eZ5CgyQq.js +1 -0
- package/page/assets/jsonMode-DYGImCy6.js +29 -0
- package/page/assets/jsonMode-jMDxUeWM.css +1 -0
- package/page/assets/{labels-provider-Dc-AJqPH.js → labels-provider-BcEDhptf.js} +2 -2
- package/page/assets/prompt-row-DbdkBgdJ.js +71 -0
- package/page/assets/{register-CDgivxvX.js → register-BLInT6S0.js} +2 -2
- package/page/assets/studio-code-pane-CZi0x9Wf.js +10 -0
- package/page/assets/{studio-console-DGGdlBUn.js → studio-console-CYE4Q0ni.js} +1 -1
- package/page/assets/{studio-decision-BwhZcZi3.js → studio-decision-CG3lbrnY.js} +1 -1
- package/page/assets/studio-embedding-BybazSlW.js +2 -0
- package/page/assets/studio-host-console-Z6xzeNV8.js +2 -0
- package/page/assets/studio-labels-CYRoj7-O.js +3 -0
- package/page/assets/studio-live-oETsPtix.js +5 -0
- package/page/assets/{studio-map-D-CNsPgj.js → studio-map-BkAsawd9.js} +1 -1
- package/page/assets/studio-monaco-BkNqudm7.css +1 -0
- package/page/assets/studio-monaco-C20o5PnA.js +34 -0
- package/page/assets/{studio-trace-replay-CLslqTKN.js → studio-trace-replay-CRMChilN.js} +3 -3
- package/page/assets/trace-patterns-86-gKv3I.js +1 -0
- package/page/assets/{typescript-20GgZ8PJ.js → typescript-CF1Ntufd.js} +1 -1
- package/page/assets/use-one-call-2FKIU3wN.js +1 -0
- package/page/assets/useAnnounce-DlZth-he.js +1 -0
- package/page/assets/useAnnounceRenderedText-BrbiKE4-.js +1 -0
- package/page/assets/{useClipboard-BC4cMFBa.js → useClipboard-DeMRGvqJ.js} +1 -1
- package/page/assets/{useKeyboardHint-BBkDGjRh.js → useKeyboardHint-BIqbBlHw.js} +1 -1
- package/page/assets/useLocale-DrfYfZTs.js +1 -0
- package/page/assets/useMenuDrillIn-DOLSnkWq.js +1 -0
- package/page/assets/usePressFeedback-CBSbXJuo.js +1 -0
- package/page/assets/useResolvedRequired-CAelf7J-.js +1 -0
- package/page/index.html +35 -28
- package/ui/built/theme.css +25 -0
- package/ui/built/theorem-studio.js +25 -0
- package/ui/code/json-code.d.ts +12 -0
- package/ui/code/json-code.js +130 -0
- package/ui/code/studio-code.js +2 -9
- package/ui/code/studio-monaco.d.ts +4 -0
- package/ui/code/studio-monaco.js +18 -0
- package/ui/inspector.d.ts +10 -2
- package/ui/inspector.js +12 -3
- package/ui/lib/tab-fills.d.ts +3 -2
- package/ui/profile-editor.js +12 -11
- package/ui/studio-theme.js +26 -0
- package/ui/studio.css +20 -4
- package/page/assets/CheckboxInput-MMjt4mDv.js +0 -2
- package/page/assets/CollapsibleGroup-C5fLYcux.js +0 -1
- package/page/assets/ConsoleFrame-1zBq8Aef.js +0 -3
- package/page/assets/DateInput-BfmlGmw1.js +0 -1
- package/page/assets/Icon-3c9WmPTH.js +0 -3
- package/page/assets/IconButton-BeI1pXEZ.js +0 -1
- package/page/assets/SchemaFields-D0W9vuLc.js +0 -1
- package/page/assets/SidePanel-D5woAYFH.js +0 -2
- package/page/assets/StackItem-CQviqAfM.js +0 -1
- package/page/assets/TextInput-Dq9voagQ.js +0 -1
- package/page/assets/ToolResultCharts-TPkKdyQt.js +0 -1
- package/page/assets/TraceInspector-DJLaxle-.js +0 -1
- package/page/assets/VStack-CkVMcNiK.js +0 -1
- package/page/assets/editor.api-Cd3ViPQa.js +0 -908
- package/page/assets/fieldParts-BnDYE6oM.js +0 -1
- package/page/assets/index-BcMQ291i.js +0 -149
- package/page/assets/index-DZ3ArAk6.css +0 -1
- package/page/assets/prompt-row-DhGOXTVR.js +0 -71
- package/page/assets/studio-code-pane-DucGib9w.js +0 -10
- package/page/assets/studio-embedding-C8BulZi2.js +0 -2
- package/page/assets/studio-host-console-C8zLZsl2.js +0 -2
- package/page/assets/studio-labels-DHrOBSMz.js +0 -3
- package/page/assets/studio-live-D0PISMYH.js +0 -5
- package/page/assets/studio-monaco-CbKf90i6.css +0 -1
- package/page/assets/studio-monaco-xfyfezQS.js +0 -34
- package/page/assets/trace-patterns-D5Rcl0G4.js +0 -1
- package/page/assets/use-one-call-x1Gm_JQc.js +0 -1
- package/page/assets/useAnnounce-DOkF3CS1.js +0 -1
- package/page/assets/useAnnounceRenderedText-BaMlDax-.js +0 -1
- package/page/assets/useLocale-D8GRz3lz.js +0 -1
- package/page/assets/useMenuDrillIn-CmUoRV2h.js +0 -1
- package/page/assets/useResolvedRequired-68GOSl0j.js +0 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Field, inputStatusBorderStyles, inputStatusFocusWithinStyles, inputWrapperStyles, } from '@astryxdesign/core/Field';
|
|
3
|
+
import { HStack } from '@astryxdesign/core/Stack';
|
|
4
|
+
import { jsonDefaults } from 'monaco-editor/languages/features/json/register';
|
|
5
|
+
import { useEffect, useId, useRef } from 'react';
|
|
6
|
+
import { tabFills } from "../lib/tab-fills.js";
|
|
7
|
+
import { editor, serveMonacoWorkers, studioMonacoTheme } from "./studio-monaco.js";
|
|
8
|
+
const LINE_HEIGHT = 20;
|
|
9
|
+
const PADDING = 8;
|
|
10
|
+
// why: the kernel checks what a schema says; Monaco only says where the JSON breaks.
|
|
11
|
+
jsonDefaults.setDiagnosticsOptions({
|
|
12
|
+
validate: true,
|
|
13
|
+
allowComments: false,
|
|
14
|
+
comments: 'error',
|
|
15
|
+
trailingCommas: 'error',
|
|
16
|
+
schemaValidation: 'ignore',
|
|
17
|
+
schemaRequest: 'ignore',
|
|
18
|
+
});
|
|
19
|
+
jsonDefaults.setModeConfiguration({
|
|
20
|
+
documentFormattingEdits: true,
|
|
21
|
+
documentRangeFormattingEdits: true,
|
|
22
|
+
diagnostics: true,
|
|
23
|
+
foldingRanges: true,
|
|
24
|
+
selectionRanges: true,
|
|
25
|
+
tokens: true,
|
|
26
|
+
});
|
|
27
|
+
const workers = serveMonacoWorkers();
|
|
28
|
+
const FIELD_OPTIONS = {
|
|
29
|
+
language: 'json',
|
|
30
|
+
automaticLayout: true,
|
|
31
|
+
// why: under EditContext a focused field took no Cmd+A.
|
|
32
|
+
editContext: false,
|
|
33
|
+
fixedOverflowWidgets: true,
|
|
34
|
+
folding: true,
|
|
35
|
+
fontFamily: 'var(--font-family-code)',
|
|
36
|
+
fontSize: 12,
|
|
37
|
+
formatOnPaste: true,
|
|
38
|
+
glyphMargin: false,
|
|
39
|
+
guides: { bracketPairs: false, indentation: false },
|
|
40
|
+
hideCursorInOverviewRuler: true,
|
|
41
|
+
lineDecorationsWidth: 0,
|
|
42
|
+
lineHeight: LINE_HEIGHT,
|
|
43
|
+
lineNumbers: 'off',
|
|
44
|
+
lineNumbersMinChars: 0,
|
|
45
|
+
links: false,
|
|
46
|
+
minimap: { enabled: false },
|
|
47
|
+
occurrencesHighlight: 'off',
|
|
48
|
+
overviewRulerBorder: false,
|
|
49
|
+
overviewRulerLanes: 0,
|
|
50
|
+
padding: { top: PADDING, bottom: PADDING },
|
|
51
|
+
quickSuggestions: false,
|
|
52
|
+
renderLineHighlight: 'none',
|
|
53
|
+
// why: the field is as tall as its text, so the wheel belongs to the panel around it.
|
|
54
|
+
scrollbar: {
|
|
55
|
+
alwaysConsumeMouseWheel: false,
|
|
56
|
+
handleMouseWheel: false,
|
|
57
|
+
horizontal: 'hidden',
|
|
58
|
+
vertical: 'hidden',
|
|
59
|
+
},
|
|
60
|
+
scrollBeyondLastLine: false,
|
|
61
|
+
selectionHighlight: false,
|
|
62
|
+
showFoldingControls: 'mouseover',
|
|
63
|
+
stickyScroll: { enabled: false },
|
|
64
|
+
suggestOnTriggerCharacters: false,
|
|
65
|
+
tabSize: 2,
|
|
66
|
+
wordBasedSuggestions: 'off',
|
|
67
|
+
wordWrap: 'on',
|
|
68
|
+
wrappingIndent: 'indent',
|
|
69
|
+
};
|
|
70
|
+
/** JSON as code, in a field as tall as its text. */
|
|
71
|
+
export function JsonCode({ label, value, placeholder, fills, status, onChange }) {
|
|
72
|
+
const id = useId();
|
|
73
|
+
const node = useRef(null);
|
|
74
|
+
const code = useRef(undefined);
|
|
75
|
+
const latest = useRef({ value, placeholder, fills, onChange });
|
|
76
|
+
latest.current = { value, placeholder, fills, onChange };
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const host = node.current;
|
|
79
|
+
if (!host)
|
|
80
|
+
return;
|
|
81
|
+
let disposed = false;
|
|
82
|
+
void workers.then(() => {
|
|
83
|
+
if (disposed)
|
|
84
|
+
return;
|
|
85
|
+
const field = editor.create(host, {
|
|
86
|
+
...FIELD_OPTIONS,
|
|
87
|
+
ariaLabel: label,
|
|
88
|
+
placeholder: latest.current.placeholder,
|
|
89
|
+
theme: studioMonacoTheme(),
|
|
90
|
+
value: latest.current.value,
|
|
91
|
+
});
|
|
92
|
+
code.current = field;
|
|
93
|
+
const fit = () => {
|
|
94
|
+
const shown = field.getValue() === '' ? latest.current.placeholder : undefined;
|
|
95
|
+
const lines = shown?.split('\n').length ?? 1;
|
|
96
|
+
const blank = lines * LINE_HEIGHT + 2 * PADDING;
|
|
97
|
+
host.style.height = `${String(Math.max(field.getContentHeight(), blank))}px`;
|
|
98
|
+
};
|
|
99
|
+
field.onDidContentSizeChange(fit);
|
|
100
|
+
field.onDidChangeModelContent(() => {
|
|
101
|
+
const next = field.getValue();
|
|
102
|
+
if (next !== latest.current.value)
|
|
103
|
+
latest.current.onChange(next);
|
|
104
|
+
});
|
|
105
|
+
field.onKeyDown((event) => {
|
|
106
|
+
const { value: text, fills: example, onChange: change } = latest.current;
|
|
107
|
+
tabFills(text, example, change)(event.browserEvent);
|
|
108
|
+
});
|
|
109
|
+
fit();
|
|
110
|
+
});
|
|
111
|
+
return () => {
|
|
112
|
+
disposed = true;
|
|
113
|
+
code.current?.dispose();
|
|
114
|
+
code.current = undefined;
|
|
115
|
+
};
|
|
116
|
+
}, [label]);
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (code.current && code.current.getValue() !== value)
|
|
119
|
+
code.current.setValue(value);
|
|
120
|
+
}, [value]);
|
|
121
|
+
return (_jsx(Field, { label: label, isLabelHidden: true, inputID: id, status: status, children: _jsx(HStack
|
|
122
|
+
// why: Astryx's own input styles hold a media-query shadow its `xstyle` type refuses.
|
|
123
|
+
, {
|
|
124
|
+
// why: Astryx's own input styles hold a media-query shadow its `xstyle` type refuses.
|
|
125
|
+
xstyle: [
|
|
126
|
+
inputWrapperStyles.base,
|
|
127
|
+
status && inputStatusBorderStyles[status.type],
|
|
128
|
+
status && inputStatusFocusWithinStyles[status.type],
|
|
129
|
+
], className: "json-code", children: _jsx("div", { ref: node, id: id, className: "json-code-host" }) }) }));
|
|
130
|
+
}
|
package/ui/code/studio-code.js
CHANGED
|
@@ -67,16 +67,9 @@ export function StudioCode({ text, hold, isReadOnly = false, issues, onApply })
|
|
|
67
67
|
// Colour only, until the visitor types. The typechecker is a compiler in
|
|
68
68
|
// a worker, so it stays out of this import.
|
|
69
69
|
await import('monaco-editor/languages/definitions/typescript/register');
|
|
70
|
-
|
|
71
|
-
self.MonacoEnvironment = {
|
|
72
|
-
getWorker() {
|
|
73
|
-
return new editorWorker();
|
|
74
|
-
},
|
|
75
|
-
};
|
|
70
|
+
await monaco.serveMonacoWorkers();
|
|
76
71
|
if (life.disposed || !host.isConnected)
|
|
77
72
|
return;
|
|
78
|
-
const dark = document.documentElement.dataset.theme === 'dark' ||
|
|
79
|
-
globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
80
73
|
const uri = monaco.Uri.parse('file:///agent.ts');
|
|
81
74
|
monaco.editor.getModel(uri)?.dispose();
|
|
82
75
|
const model = monaco.editor.createModel(printed.current, 'typescript', uri);
|
|
@@ -84,7 +77,7 @@ export function StudioCode({ text, hold, isReadOnly = false, issues, onApply })
|
|
|
84
77
|
model,
|
|
85
78
|
readOnly: readOnly.current,
|
|
86
79
|
language: 'typescript',
|
|
87
|
-
theme:
|
|
80
|
+
theme: monaco.studioMonacoTheme(),
|
|
88
81
|
minimap: { enabled: false },
|
|
89
82
|
fontSize: 13,
|
|
90
83
|
wordWrap: 'on',
|
|
@@ -41,4 +41,8 @@ import 'monaco-editor/editor/contrib/wordHighlighter/browser/wordHighlighter';
|
|
|
41
41
|
import 'monaco-editor/editor/contrib/wordOperations/browser/wordOperations';
|
|
42
42
|
import 'monaco-editor/editor/contrib/wordPartOperations/browser/wordPartOperations';
|
|
43
43
|
import 'monaco-editor/features/find/register';
|
|
44
|
+
/** Gives Monaco its workers: JSON's own, and the editor's for the rest. */
|
|
45
|
+
export declare function serveMonacoWorkers(): Promise<void>;
|
|
46
|
+
/** The Monaco theme for the page's colour scheme. */
|
|
47
|
+
export declare function studioMonacoTheme(): "vs-dark" | "vs";
|
|
44
48
|
export { editor, languages, MarkerSeverity, Uri };
|
package/ui/code/studio-monaco.js
CHANGED
|
@@ -45,4 +45,22 @@ import 'monaco-editor/editor/contrib/wordHighlighter/browser/wordHighlighter';
|
|
|
45
45
|
import 'monaco-editor/editor/contrib/wordOperations/browser/wordOperations';
|
|
46
46
|
import 'monaco-editor/editor/contrib/wordPartOperations/browser/wordPartOperations';
|
|
47
47
|
import 'monaco-editor/features/find/register';
|
|
48
|
+
/** Gives Monaco its workers: JSON's own, and the editor's for the rest. */
|
|
49
|
+
export async function serveMonacoWorkers() {
|
|
50
|
+
const [{ default: EditorWorker }, { default: JsonWorker }] = await Promise.all([
|
|
51
|
+
import('monaco-editor/editor/editor.worker?worker'),
|
|
52
|
+
import('monaco-editor/languages/features/json/json.worker?worker'),
|
|
53
|
+
]);
|
|
54
|
+
self.MonacoEnvironment = {
|
|
55
|
+
getWorker(_id, label) {
|
|
56
|
+
return label === 'json' ? new JsonWorker() : new EditorWorker();
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** The Monaco theme for the page's colour scheme. */
|
|
61
|
+
export function studioMonacoTheme() {
|
|
62
|
+
const dark = document.documentElement.dataset.theme === 'dark' ||
|
|
63
|
+
globalThis.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
64
|
+
return dark ? 'vs-dark' : 'vs';
|
|
65
|
+
}
|
|
48
66
|
export { editor, languages, MarkerSeverity, Uri };
|
package/ui/inspector.d.ts
CHANGED
|
@@ -147,12 +147,20 @@ export declare function TextAreaRow(props: FieldRowProps & {
|
|
|
147
147
|
placeholder?: string;
|
|
148
148
|
hint?: string;
|
|
149
149
|
rows?: number;
|
|
150
|
-
|
|
151
|
-
/** A status of the row's own, such as text that is not JSON; the field's issues win. */
|
|
150
|
+
/** A status of the row's own; the field's issues win. */
|
|
152
151
|
status?: InputStatus;
|
|
153
152
|
action?: ReactNode;
|
|
154
153
|
onChange: (next: string) => void;
|
|
155
154
|
}): import("react").JSX.Element;
|
|
155
|
+
/** JSON under its label, as code. Plain text holds its place until the editor has loaded. */
|
|
156
|
+
export declare function JsonRow(props: FieldRowProps & {
|
|
157
|
+
value: string;
|
|
158
|
+
placeholder?: string;
|
|
159
|
+
hint?: string;
|
|
160
|
+
/** A status of the row's own, such as text that is not JSON; the field's issues win. */
|
|
161
|
+
status?: InputStatus;
|
|
162
|
+
onChange: (next: string) => void;
|
|
163
|
+
}): import("react").JSX.Element;
|
|
156
164
|
/** A number the kernel leaves unset when cleared: it gives `null`, shown as what leaving it out does. */
|
|
157
165
|
export declare function NumberRow(props: FieldRowProps & {
|
|
158
166
|
value: number | null;
|
package/ui/inspector.js
CHANGED
|
@@ -23,7 +23,7 @@ import { Tooltip } from '@astryxdesign/core/Tooltip';
|
|
|
23
23
|
import { VStack } from '@astryxdesign/core/VStack';
|
|
24
24
|
import { IconArrowBackUp, IconCheck, IconCode, IconCopy, IconPlus, IconX, } from '@tabler/icons-react';
|
|
25
25
|
import { fieldMeta } from '@theoremjs/agents';
|
|
26
|
-
import { useContext, useState } from 'react';
|
|
26
|
+
import { lazy, Suspense, useContext, useState } from 'react';
|
|
27
27
|
import { draftKey, originLabel, originPlace, originShortLabel, STUDIO_PROFILE_TYPES, } from "../mod.js";
|
|
28
28
|
import { ISSUE_ROW_ATTRIBUTE, ListBadges, SaidOrigin, useFieldStatus, useRowOrigin, } from "./inspector-context.js";
|
|
29
29
|
import { entriesOf, entriesText } from "./lib/entries.js";
|
|
@@ -209,10 +209,19 @@ export function WideRow({ label, path, isRequired, hasIssue, action, children, }
|
|
|
209
209
|
* `placeholder` (for wording, the kernel's own default line) for Tab to take up, else `hint`.
|
|
210
210
|
*/
|
|
211
211
|
export function TextAreaRow(props) {
|
|
212
|
-
const { label, path, value, placeholder, hint, rows = 3,
|
|
212
|
+
const { label, path, value, placeholder, hint, rows = 3, onChange } = props;
|
|
213
213
|
const { status: fieldStatus, required, unset, control } = useFieldRow(props);
|
|
214
214
|
const status = fieldStatus ?? props.status;
|
|
215
|
-
return (_jsx(WideRow, { label: label, path: path, isRequired: required, hasIssue: fieldStatus !== undefined, action: props.action, children: _jsx(TextArea, { ...control, status: status, rows: rows,
|
|
215
|
+
return (_jsx(WideRow, { label: label, path: path, isRequired: required, hasIssue: fieldStatus !== undefined, action: props.action, children: _jsx(TextArea, { ...control, status: status, rows: rows, value: value, placeholder: placeholder ?? hint ?? unset, onKeyDown: tabFills(value, placeholder, onChange), onChange: onChange }) }));
|
|
216
|
+
}
|
|
217
|
+
const JsonCode = lazy(() => import("./code/json-code.js").then((code) => ({ default: code.JsonCode })));
|
|
218
|
+
/** JSON under its label, as code. Plain text holds its place until the editor has loaded. */
|
|
219
|
+
export function JsonRow(props) {
|
|
220
|
+
const { label, path, value, placeholder, hint, onChange } = props;
|
|
221
|
+
const { status: fieldStatus, required, unset, control } = useFieldRow(props);
|
|
222
|
+
const status = fieldStatus ?? props.status;
|
|
223
|
+
const blank = placeholder ?? hint ?? unset;
|
|
224
|
+
return (_jsx(WideRow, { label: label, path: path, isRequired: required, hasIssue: fieldStatus !== undefined, children: _jsx(Suspense, { fallback: _jsx(TextArea, { ...control, status: status, rows: (value || blank || '').split('\n').length, hasSpellCheck: false, value: value, placeholder: blank, onChange: onChange }), children: _jsx(JsonCode, { label: label, value: value, placeholder: blank, fills: placeholder, status: status, onChange: onChange }) }) }));
|
|
216
225
|
}
|
|
217
226
|
/** A number the kernel leaves unset when cleared: it gives `null`, shown as what leaving it out does. */
|
|
218
227
|
export function NumberRow(props) {
|
package/ui/lib/tab-fills.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
type TabPress = Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'key' | 'metaKey' | 'preventDefault' | 'shiftKey'>;
|
|
2
2
|
/**
|
|
3
3
|
* Tab in an empty field takes its placeholder up as the text, to edit rather than retype. Only for a
|
|
4
4
|
* placeholder that is a value (an example, or the default it stands for); anywhere else Tab moves on.
|
|
5
5
|
*/
|
|
6
|
-
export declare function tabFills(value: string, placeholder: string | undefined, onChange: (next: string) => void): (event:
|
|
6
|
+
export declare function tabFills(value: string, placeholder: string | undefined, onChange: (next: string) => void): (event: TabPress) => void;
|
|
7
|
+
export {};
|
package/ui/profile-editor.js
CHANGED
|
@@ -24,7 +24,7 @@ import { Thumbnail } from '@astryxdesign/core/Thumbnail';
|
|
|
24
24
|
import { Token } from '@astryxdesign/core/Token';
|
|
25
25
|
import { Tooltip } from '@astryxdesign/core/Tooltip';
|
|
26
26
|
import { VStack } from '@astryxdesign/core/VStack';
|
|
27
|
-
import { IconAbc, IconAdjustmentsHorizontal, IconAlertTriangle, IconAlignLeft, IconAntennaBars1, IconAntennaBars2, IconAntennaBars3, IconAntennaBars4, IconAntennaBars5, IconAntennaBarsOff, IconArrowDown, IconArrowLeft, IconArrowUp, IconBan, IconBandage, IconBiohazard, IconBolt, IconBraces, IconBulb, IconBulbOff, IconCertificate, IconCheck, IconChevronRight, IconCircleDashed, IconClock, IconDatabase, IconDeviceDesktop, IconEraser, IconEye, IconEyeOff, IconFeather, IconFlag, IconFlame, IconFlask, IconFold, IconGauge, IconHandOff, IconHandStop, IconHeadset, IconHourglass, IconHttpDelete, IconHttpGet, IconHttpPatch, IconHttpPost, IconHttpPut, IconInfoCircle, IconInputAi, IconKey, IconLayersUnion, IconLockOpen, IconLogin, IconMessage, IconMessageQuestion, IconMicrophone, IconPackage, IconPaperclip, IconPencil, IconPlayerPause, IconPlayerPlay, IconPlayerStop, IconPlayerTrackNext, IconPlugConnected, IconPlus, IconRefresh, IconRegex, IconRuler, IconSearch, IconSend, IconServer, IconShieldLock, IconShieldOff, IconShieldSearch, IconSquareRoundedNumber0, IconSquareRoundedNumber2, IconTool, IconTrash, IconUser, IconUserCheck, IconWaveSine, IconWriting, IconX, } from '@tabler/icons-react';
|
|
27
|
+
import { IconAbc, IconAdjustmentsHorizontal, IconAlertTriangle, IconAlignLeft, IconAntennaBars1, IconAntennaBars2, IconAntennaBars3, IconAntennaBars4, IconAntennaBars5, IconAntennaBarsOff, IconArrowDown, IconArrowLeft, IconArrowUp, IconBan, IconBandage, IconBiohazard, IconBolt, IconBraces, IconBulb, IconBulbOff, IconCertificate, IconCheck, IconChevronRight, IconCircleDashed, IconClock, IconDatabase, IconDeviceDesktop, IconEraser, IconEye, IconEyeOff, IconFeather, IconFileOff, IconFlag, IconFlame, IconFlask, IconFold, IconGauge, IconHandOff, IconHandStop, IconHeadset, IconHourglass, IconHttpDelete, IconHttpGet, IconHttpPatch, IconHttpPost, IconHttpPut, IconInfoCircle, IconInputAi, IconKey, IconLayersUnion, IconLockOpen, IconLogin, IconMessage, IconMessageQuestion, IconMicrophone, IconPackage, IconPaperclip, IconPencil, IconPlayerPause, IconPlayerPlay, IconPlayerStop, IconPlayerTrackNext, IconPlugConnected, IconPlus, IconRefresh, IconRegex, IconRuler, IconSearch, IconSend, IconServer, IconShieldLock, IconShieldOff, IconShieldSearch, IconSquareRoundedNumber0, IconSquareRoundedNumber2, IconTool, IconTrash, IconUser, IconUserCheck, IconWaveSine, IconWriting, IconX, } from '@tabler/icons-react';
|
|
28
28
|
import { ATTACHMENT_ACCEPT_MIMES, CONTINUE_STOP_KINDS, fieldMeta, HTTP_METHODS, IMAGE_ATTACHMENT_ACCEPT_MIMES, labelDefault, PROFILE_HANDLE_MAX_CHARS, PROFILE_ID_MAX_CHARS, profileGraphFacet, SPEECH_AUDIO_FORMATS, THINKING_LEVELS, VOICE_ACCEPT_MIMES, } from '@theoremjs/agents';
|
|
29
29
|
import { BOUNDARIES, BOUNDARY_META, DETECT_ACTION_META, DETECT_ACTIONS, DETECTOR_BOUNDARIES, DETECTOR_GROUP_META, DETECTOR_GROUPS, DETECTOR_META, DETECTORS, TOOL_BOUNDARIES, TOOL_KINDS, } from '@theoremjs/agents/guardrails';
|
|
30
30
|
import { MODEL_SELECT_MIN_MODELS } from '@theoremjs/agents/interface';
|
|
@@ -33,7 +33,7 @@ import { acceptSections, agentToolTarget, bindingSlots, COMPACTION_DRAFT_DEFAULT
|
|
|
33
33
|
import { SECTION_HINTS } from "../section-notes.js";
|
|
34
34
|
import { AddProviderButton } from "./add-provider.js";
|
|
35
35
|
import { IconGoogle, IconOpenAi, IconOpenRouter, IconTypeSafe } from "./brand-icons.js";
|
|
36
|
-
import { ChoiceRow, EntriesRow, InspectorGroupTitle, InspectorRow, InspectorSection, ListRow, NamesInput, NamesRow, NumberRow, OriginLine, OwnField, SegmentedRow, SetInCode, SliderRow, SwitchRow, TextAreaRow, TextRow, WideRow, } from "./inspector.js";
|
|
36
|
+
import { ChoiceRow, EntriesRow, InspectorGroupTitle, InspectorRow, InspectorSection, JsonRow, ListRow, NamesInput, NamesRow, NumberRow, OriginLine, OwnField, SegmentedRow, SetInCode, SliderRow, SwitchRow, TextAreaRow, TextRow, WideRow, } from "./inspector.js";
|
|
37
37
|
import { GuardrailTest, LeavePage, ListBadges, LocalConnection, NodeIssues, QuestionLink, RowOrigins, RunsOn, SaidOrigin, useFieldStatus, useRowOrigin, WorkspaceContext, } from "./inspector-context.js";
|
|
38
38
|
import { CONTEXT_PLACEHOLDER, contextErrorOf, usePageValues } from "./lib/studio-page.js";
|
|
39
39
|
import { useProject } from "./lib/studio-project.js";
|
|
@@ -193,9 +193,9 @@ const VALUE_HINT = {
|
|
|
193
193
|
other: 'Press to state this value.',
|
|
194
194
|
};
|
|
195
195
|
const OPTION_CHAT_WIDTH = 320;
|
|
196
|
-
/** Whether a person picks the option in
|
|
196
|
+
/** Whether a person picks the option in the interface and, when they do, what they read of it. */
|
|
197
197
|
function OptionChatFields({ option, canShow, onChange, }) {
|
|
198
|
-
return (_jsxs(VStack, { gap: 1, children: [canShow && (_jsx(SwitchRow, { label: "Shown in
|
|
198
|
+
return (_jsxs(VStack, { gap: 1, children: [canShow && (_jsx(SwitchRow, { label: "Shown in interface", path: "inputs.options", field: "options", value: option.isShownInChat, onChange: (isShownInChat) => {
|
|
199
199
|
onChange({ isShownInChat });
|
|
200
200
|
} })), option.isShownInChat && (_jsxs(_Fragment, { children: [_jsx(TextRow, { label: "Label", path: "inputs.options.*.label", value: option.label, placeholder: option.name.trim() || undefined, onChange: (label) => {
|
|
201
201
|
onChange({ label });
|
|
@@ -211,7 +211,7 @@ function OptionRow({ option, at, canShow, stated, onState, onChange, onRemove, }
|
|
|
211
211
|
const row = `Option ${String(at + 1)}`;
|
|
212
212
|
return (_jsxs(VStack, { gap: 0, paddingBlockEnd: 2, className: "option-row", children: [_jsxs(HStack, { gap: 1, vAlign: "center", children: [_jsx(StackItem, { size: "fill", children: _jsx(TextInput, { label: `${row} name`, isLabelHidden: true, size: "sm", status: status, value: option.name, placeholder: "plan", onChange: (name) => {
|
|
213
213
|
onChange({ name });
|
|
214
|
-
} }) }), (canShow || option.isShownInChat) && (_jsx(Popover, { placement: "below", alignment: "end", width: OPTION_CHAT_WIDTH, label: `${row} in
|
|
214
|
+
} }) }), (canShow || option.isShownInChat) && (_jsx(Popover, { placement: "below", alignment: "end", width: OPTION_CHAT_WIDTH, label: `${row} in interface`, content: _jsx(OptionChatFields, { option: option, canShow: canShow, onChange: onChange }), children: _jsx(IconButton, { label: `${row} ${option.isShownInChat ? 'shown' : 'not shown'} in interface`, tooltip: option.isShownInChat ? 'Shown in interface' : 'Not shown in interface', variant: "ghost", size: "sm", icon: _jsx(Icon, { icon: IconPencil, size: "sm" }) }) })), _jsx(IconButton, { label: `Remove ${row.toLowerCase()}`, variant: "ghost", size: "sm", icon: _jsx(Icon, { icon: IconX, size: "sm" }), onClick: onRemove })] }), _jsx(NamesInput, { label: `${row} values`, value: option.choices.map(({ value }) => value), placeholder: "free", overflow: "none", marked: stated, onMark: onState, markHint: VALUE_HINT, onChange: (values) => {
|
|
215
215
|
onChange({ choices: optionChoices(values, option.choices) });
|
|
216
216
|
} })] }));
|
|
217
217
|
}
|
|
@@ -761,7 +761,7 @@ function InputContextSection({ inputs, set }) {
|
|
|
761
761
|
function ContextPreviewRow() {
|
|
762
762
|
const [values, setValues] = usePageValues(useContext(WorkspaceContext)?.self ?? '');
|
|
763
763
|
const error = contextErrorOf(values.contextJson);
|
|
764
|
-
return (_jsx(
|
|
764
|
+
return (_jsx(JsonRow, { label: "Preview", path: "inputs.context", isRequired: false, value: values.contextJson, placeholder: CONTEXT_PLACEHOLDER, status: error ? { type: 'error', message: error } : undefined, onChange: (contextJson) => {
|
|
765
765
|
setValues({ ...values, contextJson });
|
|
766
766
|
} }));
|
|
767
767
|
}
|
|
@@ -1090,7 +1090,7 @@ function OutputShapeSection({ outputs, set, structured, }) {
|
|
|
1090
1090
|
set({ mode });
|
|
1091
1091
|
} }), structured && (_jsxs(_Fragment, { children: [_jsx(TextRow, { label: "Schema id", path: "outputs.structured", field: "schemaId", isRequired: true, value: outputs.schemaId, placeholder: "reply", onChange: (schemaId) => {
|
|
1092
1092
|
set({ schemaId });
|
|
1093
|
-
} }), _jsx(
|
|
1093
|
+
} }), _jsx(JsonRow, { label: "JSON Schema", path: "outputs.structured", field: "schemaJson", isRequired: true, value: outputs.schemaJson, placeholder: SCHEMA_PLACEHOLDER, onChange: (schemaJson) => {
|
|
1094
1094
|
set({ schemaJson });
|
|
1095
1095
|
} })] }))] }));
|
|
1096
1096
|
}
|
|
@@ -2031,7 +2031,7 @@ function TestCredentialRow({ value, onChange, }) {
|
|
|
2031
2031
|
}
|
|
2032
2032
|
/** The input an HTTP tool's test sends. */
|
|
2033
2033
|
function SampleInputRow({ value, onChange }) {
|
|
2034
|
-
return (_jsx(
|
|
2034
|
+
return (_jsx(JsonRow, { label: "Sample input", path: "studio.sampleInput", value: value, placeholder: "{}", onChange: onChange }));
|
|
2035
2035
|
}
|
|
2036
2036
|
function TestConnectionButton({ isLoading, onClick }) {
|
|
2037
2037
|
return (_jsx(HStack, { children: _jsx(Button, { label: "Test connection", variant: "secondary", size: "sm", icon: _jsx(Icon, { icon: IconPlugConnected, size: "sm" }), isLoading: isLoading, onClick: onClick }) }));
|
|
@@ -2119,9 +2119,9 @@ function ToolSection({ draft, setDraft, tool, set, }) {
|
|
|
2119
2119
|
}
|
|
2120
2120
|
/** The tool's input and output schemas. */
|
|
2121
2121
|
function ContractSection({ tool, set }) {
|
|
2122
|
-
return (_jsxs(InspectorSection, { title: "Contract", hint: SECTION_HINTS.contract, children: [_jsx(
|
|
2122
|
+
return (_jsxs(InspectorSection, { title: "Contract", hint: SECTION_HINTS.contract, children: [_jsx(JsonRow, { label: "Input", path: "registerTool.inputSchema", field: "inputJson", value: tool.inputJson, onChange: (inputJson) => {
|
|
2123
2123
|
set({ inputJson });
|
|
2124
|
-
} }), _jsx(
|
|
2124
|
+
} }), _jsx(JsonRow, { label: "Output", path: "registerTool.outputSchema", field: "outputJson", value: tool.outputJson, onChange: (outputJson) => {
|
|
2125
2125
|
set({ outputJson });
|
|
2126
2126
|
} })] }));
|
|
2127
2127
|
}
|
|
@@ -2146,7 +2146,7 @@ function ActivitySection({ tool, set }) {
|
|
|
2146
2146
|
function StubSection({ tool, set }) {
|
|
2147
2147
|
return (_jsxs(InspectorSection, { title: "Stub", path: "studio.stubOutput", children: [_jsx(SwitchRow, { label: "Page answers", path: "registerTool.answeredBy", value: tool.answeredBy === 'page', onChange: (page) => {
|
|
2148
2148
|
set({ answeredBy: page ? 'page' : undefined });
|
|
2149
|
-
} }), _jsx(
|
|
2149
|
+
} }), _jsx(JsonRow, { label: "Returns", path: "studio.stubOutput", field: "stubOutputJson", value: tool.stubOutputJson ?? '', hint: "Left blank, a stand-in built from the output schema.", onChange: (stubOutputJson) => {
|
|
2150
2150
|
set({ stubOutputJson });
|
|
2151
2151
|
} })] }));
|
|
2152
2152
|
}
|
|
@@ -2312,6 +2312,7 @@ const LABEL_AREA_ICONS = {
|
|
|
2312
2312
|
context: IconLayersUnion,
|
|
2313
2313
|
structured: IconBraces,
|
|
2314
2314
|
compaction: IconFold,
|
|
2315
|
+
turn: IconFileOff,
|
|
2315
2316
|
};
|
|
2316
2317
|
const LABEL_AUDIENCES = [
|
|
2317
2318
|
{
|
package/ui/studio-theme.js
CHANGED
|
@@ -29,6 +29,32 @@ export const studioTheme = defineTheme({
|
|
|
29
29
|
'--font-size-5xl': '2.75rem',
|
|
30
30
|
},
|
|
31
31
|
components: {
|
|
32
|
+
// why: a dialog is short and sits at Astryx's padding, so the studio's larger type crowds it.
|
|
33
|
+
// It keeps Astryx's own ladder; the `--text-*` tokens resolve at the root, so they are restated
|
|
34
|
+
// here to read it. Its shadow drops the neutral theme's ring, and the page goes further back.
|
|
35
|
+
dialog: {
|
|
36
|
+
base: {
|
|
37
|
+
'--font-size-xs': '0.625rem',
|
|
38
|
+
'--font-size-sm': '0.75rem',
|
|
39
|
+
'--font-size-base': '0.875rem',
|
|
40
|
+
'--font-size-lg': '1.0625rem',
|
|
41
|
+
'--font-size-xl': '1.25rem',
|
|
42
|
+
'--font-size-2xl': '1.5rem',
|
|
43
|
+
'--text-body-size': 'var(--font-size-base)',
|
|
44
|
+
'--text-code-size': 'var(--font-size-base)',
|
|
45
|
+
'--text-label-size': 'var(--font-size-base)',
|
|
46
|
+
'--text-large-size': 'var(--font-size-lg)',
|
|
47
|
+
'--text-supporting-size': 'var(--font-size-sm)',
|
|
48
|
+
'--text-heading-1-size': 'var(--font-size-2xl)',
|
|
49
|
+
'--text-heading-2-size': 'var(--font-size-xl)',
|
|
50
|
+
'--text-heading-3-size': 'var(--font-size-lg)',
|
|
51
|
+
'--text-heading-4-size': 'var(--font-size-base)',
|
|
52
|
+
'--text-heading-5-size': 'var(--font-size-sm)',
|
|
53
|
+
'--text-heading-6-size': 'var(--font-size-xs)',
|
|
54
|
+
boxShadow: '0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%))',
|
|
55
|
+
'::backdrop': { backgroundColor: 'light-dark(#00000080, #000000BF)' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
32
58
|
// why: Astryx fixes every toast at 400px, so a short message sits in a wide empty box. Let it
|
|
33
59
|
// size to its text; the viewport lines toasts up on the end edge, so the toast stays there.
|
|
34
60
|
toast: {
|
package/ui/studio.css
CHANGED
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
box-shadow: none;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
/* What acts on a row stays out of sight until the row is pointed at; an option in
|
|
34
|
+
/* What acts on a row stays out of sight until the row is pointed at; an option in the interface keeps its mark. */
|
|
35
35
|
.option-row button[aria-label^="Remove"],
|
|
36
|
-
.option-row button[aria-label$="not shown in
|
|
36
|
+
.option-row button[aria-label$="not shown in interface"] {
|
|
37
37
|
opacity: 0;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.option-row:hover button[aria-label^="Remove"],
|
|
41
|
-
.option-row:hover button[aria-label$="not shown in
|
|
41
|
+
.option-row:hover button[aria-label$="not shown in interface"],
|
|
42
42
|
.option-row:focus-within button[aria-label^="Remove"],
|
|
43
|
-
.option-row:focus-within button[aria-label$="not shown in
|
|
43
|
+
.option-row:focus-within button[aria-label$="not shown in interface"],
|
|
44
44
|
.option-row button[aria-expanded="true"] {
|
|
45
45
|
opacity: 1;
|
|
46
46
|
}
|
|
@@ -64,6 +64,22 @@
|
|
|
64
64
|
white-space: normal;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/* JSON in a field sits on the field's own surface. */
|
|
68
|
+
.json-code {
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.json-code-host {
|
|
73
|
+
flex: 1;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.json-code .monaco-editor,
|
|
78
|
+
.json-code .monaco-editor-background,
|
|
79
|
+
.json-code .monaco-editor .margin {
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
}
|
|
82
|
+
|
|
67
83
|
/* The guardrail examples scroll sideways with no bar under them. */
|
|
68
84
|
.scrollbar-none {
|
|
69
85
|
scrollbar-width: none;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Tooltip-DrSpWxD8.js","assets/rolldown-runtime-hePW80VL.js","assets/themeProps-3IqahpCr.js","assets/useLayerDismissal-BAnTRYTt.js","assets/useTooltip-BaCjTHk-.js","assets/tokens.stylex-BpCwr7Mf.js","assets/padding.stylex-B76907Zf.js","assets/ItemSwipeLayer-BzVkYf4E.js","assets/mergeProps-ptS-gIMz.js","assets/focusOutline.stylex-B9nWSXsG.js","assets/useMediaQuery-BCT0NUeZ.js","assets/isRtlElement-BG33-k_H.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{t as a}from"./mergeProps-ptS-gIMz.js";import{t as o}from"./isRenderable-DHkzpAoQ.js";import{S as s,c,t as l,u,x as d}from"./Icon-3c9WmPTH.js";import{c as f,d as p,f as m,i as h,n as g,t as _}from"./useResolvedRequired-68GOSl0j.js";import{n as v,r as ee,t as y}from"./focusOutline.stylex-B9nWSXsG.js";import{n as te,o as ne,r as b}from"./useAnnounce-DOkF3CS1.js";import{t as re}from"./useTooltip-BaCjTHk-.js";import{_ as ie,a as x,c as S,d as C,f as ae,g as oe,h as w,i as se,l as ce,m as T,n as le,o as ue,p as E,r as D,s as O,u as k}from"./Text-B74VhVA7.js";import{t as A}from"./preload-helper-DpV6A1kQ.js";import{t as j}from"./useDevWarning-Z9SoixOP.js";var M=e(i(),1),N=t(),P=(0,M.lazy)(async()=>A(()=>import(`./Tooltip-DrSpWxD8.js`).then(e=>e.n).then(e=>({default:e.Tooltip})),__vite__mapDeps([0,1,2,3,4,5,6])));function F(e){return e===`display-1`||e===`display-2`||e===`display-3`}var I={1:`h1`,2:`h2`,3:`h3`,4:`h4`,5:`h5`,6:`h6`};function L({level:e,type:t,weight:i,accessibilityLevel:o,color:s=`primary`,display:c=`block`,maxLines:l=0,hasTruncateTooltip:u=!0,wordBreak:d,textWrap:f,justify:p=`start`,hasCapsize:m=!1,hasStrikethrough:h=!1,xstyle:g,className:_,style:v,children:ee,ref:y,...te}){let ne=I[e],b=o&&o!==e?{"aria-level":o}:{},re=d??(l===1?`break-all`:`break-word`),A=l>0||m?`block`:c,j=t&&F(t)?t:void 0,L=se({maxLines:u===!1?0:l}),R=typeof u==`string`?u:`above`,z=l>0&&u!==!1&&L.isTruncated,B=(0,M.useRef)(null),V=D(y,L.ref,B),H=l>1?{WebkitLineClamp:l}:void 0;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ne,{ref:V,...a(r(`heading`,{level:e,color:s,type:t,weight:i}),n(ue[le(s)],j?ae[j]:C[e],j&&S[j],i&&oe[i],l===1?T.singleLine:l>1?T.multiLine:ce[A],l>0&&ie[re],f&&E[f],p!==`start`&&k[p],m&&x.enabled,h&&O.strikethrough,g),_,{...v,...H}),...b,...te,children:ee}),z&&(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(P,{anchorRef:B,content:(0,N.jsx)(`span`,{...n(w.content),children:L.fullText}),placement:R})})]})}L.displayName=`Heading`;var R={horizontal:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kzqmXN:`xh8yej3`,$$css:!0},vertical:{k1xSpc:`x3nfvp2`,kXwgrk:`xdt5ytf`,kGNEyG:`x6s0dn4`,kZKoxP:`x5yr21d`,$$css:!0}},z={horizontalLine:{kZKoxP:`xsyqizj`,kzQI83:`x1iyjqo2`,kmuXW:`xs83m0k`,$$css:!0},verticalLine:{kzqmXN:`xjk4fl7`,kzQI83:`x1iyjqo2`,kmuXW:`xs83m0k`,$$css:!0},subtle:{kWkggS:`x1m4xfpy`,$$css:!0},strong:{kWkggS:`x7njt3n`,$$css:!0}},B={horizontal:{keTefX:`xojxgvx`,k71WvV:`x1fcf3bl`,kzqmXN:`xx6qvi6`,$$css:!0},vertical:{keoZOQ:`x1sa9bsh`,k1K539:`x6h7pi7`,kZKoxP:`x12qplqi`,$$css:!0}};function V({orientation:e=`horizontal`,label:t,variant:i=`subtle`,isFullBleed:s=!1,xstyle:c,className:l,style:u,ref:d,"aria-label":f,"aria-labelledby":p,...m}){let h=e===`horizontal`,g=o(t),_=(0,M.useId)(),v=p??(g&&f==null?_:void 0);return(0,N.jsxs)(`div`,{ref:d,...m,role:`separator`,"aria-orientation":e,"aria-label":f,"aria-labelledby":v,...a(r(`divider`,{variant:i,orientation:e}),n(h?R.horizontal:R.vertical,s&&(h?B.horizontal:B.vertical),c),l,u),children:[(0,N.jsx)(`div`,{...n(h?z.horizontalLine:z.verticalLine,z[i])}),g&&(0,N.jsx)(`div`,{id:_,...{0:{className:`x2lah0s xrrkdod x141an7d x1ltkj2j xv1l7n4`},1:{className:`x2lah0s x141an7d x1ltkj2j xv1l7n4 xnjsko4 x8o8v82`}}[!h|0],children:t}),g&&(0,N.jsx)(`div`,{...n(h?z.horizontalLine:z.verticalLine,z[i])})]})}V.displayName=`Divider`;var H=(0,M.createContext)(null);H.displayName=`ItemDescriptionContext`;var U=[`noopener`,`noreferrer`];function W(e,t){if(e!==`_blank`)return{target:e,rel:t};let n=t?.split(/\s+/).filter(Boolean)??[];for(let e of U)n.includes(e)||n.push(e);return{target:e,rel:n.join(` `)}}var de=(0,M.lazy)(async()=>A(()=>import(`./ItemSwipeLayer-BzVkYf4E.js`),__vite__mapDeps([7,1,2,8,9,5,10,11]))),fe=new Set([`option`,`tab`,`row`,`gridcell`,`columnheader`,`rowheader`,`treeitem`]),G=new Set([`listitem`]),K={root:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x1txdalj`,"--_item-inset-inline":`xw1s368`,kg3NbH:`xaip428`,kVAEAm:`x1n2onr6`,kB7OPa:`x9f619`,k9WMMc:`x1yc453h`,kaIpWk:`xh6dtrn`,$$css:!0},alignStart:{kGNEyG:`x1cy8zhl`,$$css:!0},alignFirstLine:{kGNEyG:`x1pha0wt`,$$css:!0},interactive:{kkrTdU:`x1ypdohk x16khyan`,k1ekBW:`x15406qy`,kIyJzY:`xkvfbh3`,kAMwcw:`xlr8y92`,$$css:!0},highlighted:{kWkggS:`x1lmrjuc`,$$css:!0},selected:{kWkggS:`xgcxg3y`,$$css:!0},disabled:{kkrTdU:`xt0e3qv`,kfzvcC:`x47corl`,$$css:!0},linkRoot:{kMwMTN:`x1heor9g`,kybGjl:`x1hl2dhg`,$$css:!0},inlineLabel:{kmuXW:`x2lah0s`,$$css:!0},inlineDescription:{kmuXW:`xs83m0k`,k7Eaqz:`xeuugli`,$$css:!0},label:{kMwMTN:`x5tbw38`,kGuDYH:`xjm74w1`,kLWn49:`xw6l6zx`,$$css:!0},labelSingleTruncate:{kVQacm:`xb3r6kr`,kg5iWk:`xlyipyv`,khDVqt:`xuxw1ft`,$$css:!0},labelMultiTruncate:{kVQacm:`xb3r6kr`,k1xSpc:`x104kibb`,kgKLqz:`x1ua5tub`,$$css:!0},description:{kMwMTN:`x1gb3s7i`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,$$css:!0},descriptionSingleTruncate:{kVQacm:`xb3r6kr`,kg5iWk:`xlyipyv`,khDVqt:`xuxw1ft`,$$css:!0},descriptionMultiTruncate:{kVQacm:`xb3r6kr`,k1xSpc:`x104kibb`,kgKLqz:`x1ua5tub`,$$css:!0},swipeRoot:{kHBbk8:`xc8icb0`,kFalU9:`xx69xxh`,k3aq6I:`x1kncwj0`,k1ekBW:`xuo13n2`,kIyJzY:`x15p14ac`,kAMwcw:`x158wxwp`,$$css:!0}},pe={lineClamp:e=>[{kJFfOR:e==null?e:`x1yhjpo9`,$$css:!0},{"--x-WebkitLineClamp":e??void 0}]},q={compact:{k8WAf4:`xu0wf1k`,$$css:!0},balanced:{k8WAf4:`xce4md1`,$$css:!0},spacious:{k8WAf4:`x8o8v82`,"--_item-inset-inline":`x1ytau7y`,$$css:!0}};function J({as:e=`div`,marker:t,startContent:i,label:s,description:c,endContent:l,align:u=`center`,density:d=`balanced`,labelLines:f,descriptionLines:m,layout:h=`stacked`,onClick:g,interactiveRef:_,href:v,target:y,rel:re,isHighlighted:ie=!1,isSelected:x=!1,isDisabled:S=!1,swipeActions:C,swipeBehavior:ae=`reveal`,xstyle:oe,className:w,style:se,ref:ce,role:T,...le}){let ue=te(),E=b(),O=_!=null,k=(0,M.useRef)(null),{onClick:A}=p({containerRef:k,interactiveRef:_??void 0,disabled:S});j(`Item`,"`interactiveRef` is mutually exclusive with `onClick`/`href`. In delegation mode the row only forwards clicks to the referenced control, so `onClick`/`href` are ignored. Drop one of them.",O&&(g!=null||v!=null));let P=g!=null||v!=null||O,{target:F,rel:I}=W(y,re),L=T!=null,R=typeof e!=`string`&&v!=null,z=C?.leading??[],B=C?.trailing??[],V=C!=null&&(z.length>0||B.length>0)&&!S&&!O&&!R&&(T==null||G.has(T));j(`Item`,'`swipeBehavior="commit"` fires only the outermost entry of a side; the other entries have no touch path. Give a committing side one entry, or use `swipeBehavior="reveal"`.',V&&ae===`commit`&&(z.length>1||B.length>1));let U=(0,M.useRef)(null),J=(0,M.useRef)(null),me=(0,M.useCallback)(e=>{J.current=e},[]),Y=R?{href:S?void 0:v,target:S?void 0:F,rel:S?void 0:I}:null,he=T!=null&&fe.has(T),ge=(0,M.useId)(),_e=o(c),ve=typeof s==`string`,ye=typeof c==`string`,be=f==null?ve?K.labelSingleTruncate:null:f===1?K.labelSingleTruncate:K.labelMultiTruncate,X=h===`inline`&&c!=null,Z=m==null?ye||X?K.descriptionSingleTruncate:null:m===1?K.descriptionSingleTruncate:K.descriptionMultiTruncate,Q=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{...n(K.label,X&&K.inlineLabel,be,f!=null&&f>1&&pe.lineClamp(f)),children:s}),c!=null&&(0,N.jsx)(`span`,{id:_e?ge:void 0,...n(K.description,X&&K.inlineDescription,Z,m!=null&&m>1&&pe.lineClamp(m)),children:c})]}),xe=e=>{S||e.target.closest(`button, a, input, select, textarea`)||g?.(e)},Se=(0,N.jsxs)(N.Fragment,{children:[t,i!=null&&(0,N.jsx)(`span`,{...{0:{className:`x3psx0u x78zum5`},1:{className:`x3psx0u x78zum5 x6s0dn4 x4jt1l0 xk9ib7f x1xb3ux x1899uy6 x1xcinxp`}}[u===`first-line`|0],children:i}),L||O?(0,N.jsx)(`span`,{...{0:{className:`x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h`},2:{className:`x78zum5 x98rzlu xeuugli x1yc453h x1q0g3np x6s0dn4 x1lfs0n9`},1:{className:`x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo`},3:{className:`x78zum5 x98rzlu xeuugli x1yc453h x1q0g3np x6s0dn4 x1lfs0n9 xbyyjgo`}}[!!X<<1|!!S],children:Q}):v!=null&&!R?(0,N.jsx)(E,{href:v,target:F,rel:I,"aria-disabled":S||void 0,tabIndex:S?-1:void 0,...{0:{className:`xmper1u x16khyan x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz`},2:{className:`xmper1u x16khyan x1heor9g x78zum5 x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz x1q0g3np x6s0dn4 x1lfs0n9`},1:{className:`xmper1u x16khyan x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz xbyyjgo`},3:{className:`xmper1u x16khyan x1heor9g x78zum5 x98rzlu xeuugli x1yc453h x1hl2dhg x1a2a7pz x1q0g3np x6s0dn4 x1lfs0n9 xbyyjgo`}}[!!X<<1|!!S],children:Q}):g==null?(0,N.jsx)(`span`,{...{0:{className:`x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h`},2:{className:`x78zum5 x98rzlu xeuugli x1yc453h x1q0g3np x6s0dn4 x1lfs0n9`},1:{className:`x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h xbyyjgo`},3:{className:`x78zum5 x98rzlu xeuugli x1yc453h x1q0g3np x6s0dn4 x1lfs0n9 xbyyjgo`}}[!!X<<1|!!S],children:Q}):(0,N.jsx)(`button`,{type:`button`,onClick:g,disabled:S,...{0:{className:`xmper1u x16khyan x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz`},2:{className:`xmper1u x16khyan x1heor9g x78zum5 x98rzlu xeuugli x1yc453h x1a2a7pz x1q0g3np x6s0dn4 x1lfs0n9`},1:{className:`xmper1u x16khyan x1heor9g x78zum5 xdt5ytf x98rzlu xeuugli x1yc453h x1a2a7pz xbyyjgo`},3:{className:`xmper1u x16khyan x1heor9g x78zum5 x98rzlu xeuugli x1yc453h x1a2a7pz x1q0g3np x6s0dn4 x1lfs0n9 xbyyjgo`}}[!!X<<1|!!S],children:Q}),l!=null&&(0,N.jsx)(`span`,{...{0:{className:`x3psx0u x78zum5 xvc5jky`},2:{className:`x3psx0u x78zum5 xvc5jky x6s0dn4 x4jt1l0 xk9ib7f x1xb3ux x1899uy6 x1xcinxp`},1:{className:`x3psx0u x78zum5 xvc5jky xbyyjgo`},3:{className:`x3psx0u x78zum5 xvc5jky x6s0dn4 x4jt1l0 xk9ib7f x1xb3ux x1899uy6 x1xcinxp xbyyjgo`}}[(u===`first-line`)<<1|!!S],children:l})]}),Ce=D(ce,k),we=D(O?Ce:ce,V?U:void 0),Te=O?A:L?g:P?xe:void 0,Ee=V&&Te!=null?e=>{J.current?.shouldSuppressClick()!==!0&&Te(e)}:Te,De=V?{onPointerDown:e=>J.current?.handlers.onPointerDown(e),onPointerMove:e=>J.current?.handlers.onPointerMove(e),onPointerUp:e=>J.current?.handlers.onPointerUp(e),onPointerCancel:e=>J.current?.handlers.onPointerCancel(e),onClickCapture:e=>J.current?.handlers.onClickCapture(e),onKeyDown:e=>J.current?.handlers.onKeyDown(e)}:void 0;return(0,N.jsxs)(e,{ref:we,...le,...De,...Y,"aria-selected":he&&x||void 0,"aria-current":le[`aria-current`]??(x&&!he?!0:void 0),"aria-disabled":S||void 0,...P?ue:void 0,...a(r(`item`,{density:d,align:u}),ee.focusWithin(K.root,q[d],u===`start`&&K.alignStart,u===`first-line`&&K.alignFirstLine,P&&K.interactive,P&&ne.backgroundColor,R&&K.linkRoot,ie&&K.highlighted,x&&K.selected,S&&!L&&K.disabled,V&&K.swipeRoot,oe),w,se),role:T,onClick:Ee,children:[(0,N.jsx)(H,{value:_e?ge:null,children:Se}),V&&(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(de,{rootRef:U,onBridge:me,leading:z,trailing:B,behavior:ae})})]})}J.displayName=`Item`;var me={x1odsvnm:`x1odsvnm`,$$css:!0},Y={box:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmuXW:`x2lah0s`,kMzoRj:`x1litavf`,ksu8eU:`x1y0btm7`,kaIpWk:`xx3sua9`,k1ekBW:`xts7igz`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},unchecked:{kMwMTN:`xqwr325`,kVAM5u:`xvy26l8 xilc7fp`,kWkggS:`x10xzikg xeultfy`,$$css:!0},checked:{kMwMTN:`x17wrial`,kVAM5u:`xad5do x1ozl1p1`,kWkggS:`x1ewilqj x17srpfb`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kVAM5u:`x14i3s5s x61roa7`,$$css:!0},disabledUnchecked:{kWkggS:`xwmxj5m xqxnq6d`,$$css:!0},checkmark:{k1xSpc:`x1s85apg`,kMwMTN:`x17wrial xs5hli`,$$css:!0},checkmarkVisible:{k1xSpc:`x1lliihq`,$$css:!0},indeterminateMark:{k1xSpc:`x1s85apg`,kWkggS:`x1azo05 xwvh9j7`,kaIpWk:`xjspbzw`,$$css:!0},indeterminateMarkVisible:{k1xSpc:`x1lliihq`,$$css:!0}},he={sm:{kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`xvy4d1p`,kZKoxP:`xxk0z11`,$$css:!0}},ge={sm:{kzqmXN:`xsmyaan`,kZKoxP:`x1kpxq89`,$$css:!0},md:{kzqmXN:`x6jxa94`,kZKoxP:`x1v9usgg`,$$css:!0}},_e={sm:{kzqmXN:`x1fsd2vl`,kZKoxP:`x36qwtl`,$$css:!0},md:{kzqmXN:`xsmyaan`,kZKoxP:`x36qwtl`,$$css:!0}};function ve({state:e,size:t=`md`,isDisabled:i=!1,children:s,ref:c,className:l,style:u,xstyle:d,...f}){let p=e===`checked`,m=e===`indeterminate`,h=p||m;return(0,N.jsx)(`span`,{...f,ref:c,"aria-hidden":`true`,...a(r(`checkbox-indicator`,{size:t,checked:p?`checked`:m?`indeterminate`:null,disabled:i?`disabled`:null}),n(Y.box,he[t],h?Y.checked:Y.unchecked,i&&Y.disabled,i&&!h&&Y.disabledUnchecked,d),l,u),children:o(s)?s:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`svg`,{viewBox:`0 0 10 10`,...a(r(`checkbox-indicator-check`,{size:t}),n(Y.checkmark,ge[t],p&&Y.checkmarkVisible)),children:(0,N.jsx)(`path`,{d:`M8.5 2.5L4 7.5L1.5 5`,stroke:`currentColor`,strokeWidth:`1.5`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,N.jsx)(`span`,{...a(r(`checkbox-indicator-dash`,{size:t}),n(Y.indeterminateMark,_e[t],m&&Y.indeterminateMarkVisible))})]})})}ve.displayName=`CheckboxIndicator`;var ye={sm:`sm`,md:`sm`},be={slot:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmuXW:`x2lah0s`,kzqmXN:`xcdlrvm`,kZKoxP:`x1l36t39`,$$css:!0},enabled:{kMwMTN:`xqwr325`,$$css:!0},disabled:{kMwMTN:`xqa6c3m`,$$css:!0}};function X({state:e,size:t=`md`,isDisabled:r=!1,children:i,ref:s,className:c,style:u,xstyle:d,...f}){let p=e===`checked`;return o(i)?(0,N.jsx)(`span`,{...f,ref:s,"aria-hidden":`true`,...a(n(be.slot,r?be.disabled:be.enabled,d),c,u),children:i}):p?(0,N.jsx)(l,{...f,"aria-hidden":`true`,icon:`check`,size:ye[t],color:r?`disabled`:`accent`,xstyle:d,className:c,style:u}):null}X.displayName=`CheckIndicator`;var Z={circle:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmuXW:`x2lah0s`,kMzoRj:`x1litavf`,ksu8eU:`x1y0btm7`,kaIpWk:`xjspbzw`,k1ekBW:`xts7igz`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},unchecked:{kVAM5u:`xvy26l8 xilc7fp`,kWkggS:`x10xzikg xeultfy`,$$css:!0},checked:{kVAM5u:`xad5do x1ozl1p1`,kWkggS:`x1ewilqj x17srpfb`,$$css:!0},disabled:{kSiTet:`xbyyjgo`,kVAM5u:`x14i3s5s x61roa7`,$$css:!0},disabledUnchecked:{kWkggS:`xwmxj5m xqxnq6d`,$$css:!0},dot:{kaIpWk:`xjspbzw`,kWkggS:`x1azo05 xwvh9j7`,$$css:!0}},Q={sm:{kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`xvy4d1p`,kZKoxP:`xxk0z11`,$$css:!0}},xe={sm:{kzqmXN:`x1xc55vz`,kZKoxP:`xdk7pt`,$$css:!0},md:{kzqmXN:`x1fsd2vl`,kZKoxP:`x170jfvy`,$$css:!0}};function Se({state:e,size:t=`md`,isDisabled:i=!1,children:s,ref:c,className:l,style:u,xstyle:d,...f}){let p=e!==`unchecked`;return(0,N.jsx)(`span`,{...f,ref:c,"aria-hidden":`true`,...a(r(`radio-indicator`,{size:t,checked:p?`checked`:null,disabled:i?`disabled`:null}),n(Z.circle,Q[t],p?Z.checked:Z.unchecked,i&&Z.disabled,i&&!p&&Z.disabledUnchecked,d),l,u),children:o(s)?s:p&&(0,N.jsx)(`span`,{...a(r(`radio-indicator-dot`,{size:t}),n(Z.dot,xe[t]))})})}Se.displayName=`RadioIndicator`;var Ce={check:X,checkbox:ve,radio:Se};function we(e){return e==null?null:typeof e==`string`?u(e):e}function Te(e){return we(e)?.indicators??null}function Ee(e,t){return Te(t)?.[e]??Ce[e]}function De(e){return Ee(e,c())}function Oe(e,t=!1){let n=(0,M.useCallback)(t=>{let n=e.current?.firstElementChild;n instanceof HTMLElement&&Object.assign(n.style,t?y:v)},[e]),r=(0,M.useCallback)(e=>{if(t)return;let r=e.target;r instanceof HTMLElement&&!r.matches(`:focus-visible`)||n(!0)},[t,n]),i=(0,M.useCallback)(()=>n(!1),[n]);return(0,M.useMemo)(()=>({focusProps:{onFocus:r,onBlur:i}}),[r,i])}var $={container:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x1txdalj`,$$css:!0},containerLabelHidden:{kOIVth:`xxhr3t`,$$css:!0},checkboxWrapper:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmuXW:`x2lah0s`,kHBbk8:`xc8icb0`,$$css:!0},indicatorPressOverlay:{k5JduY:`x1s928wv`,kwXMNM:`x1j6awrg`,kv0HGH:`xarstr8`,kUfP38:`xtb6wbx`,kloYau:`x2q1x1w`,ks3ayO:`xyhc2n1 xzywxsk x1gybruy`,kNctxI:`x1ikgzpo xsozn46`,$$css:!0},input:{kVAEAm:`x10l6tqk`,k87sOh:`xwa60dl`,kogj98:`x1ghz6dp`,kmVPX3:`x1717udv`,kSiTet:`xg01cxk`,kkrTdU:`x1ypdohk x16khyan`,kY2c9j:`x1vjfegm`,$$css:!0},inputCoarse:{kjFi6P:`xkagaj0`,kHzOjL:`x80b3aj`,$$css:!0},inputDisabled:{kkrTdU:`xt0e3qv`,$$css:!0}},ke={sm:{kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`xvy4d1p`,kZKoxP:`xxk0z11`,$$css:!0}},Ae={width:e=>[{kzqmXN:e==null?e:`x5lhr3w`,$$css:!0},{"--x-width":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function je({id:e,label:t,isLabelHidden:i=!1,description:o,onChange:c,changeAction:l,isLoading:u=!1,value:p,isDisabled:v=!1,htmlName:ee,disabledMessage:y,isReadOnly:b=!1,isOptional:ie=!1,isRequired:x=!1,size:S=`md`,onFocus:C,onBlur:ae,labelIcon:oe,status:w,width:se,xstyle:ce,className:T,style:le,ref:ue,"aria-describedby":E,...O}){let k=te(),A=(0,M.useId)(),j=e||A,P=(0,M.useId)(),F=(0,M.useId)(),I=_({isRequired:x,isOptional:ie}),[,L]=(0,M.useTransition)(),[R,z]=(0,M.useOptimistic)(p),B=u||R!==p,V=v&&!!y,H=re({placement:`above`,focusTrigger:`always`,isEnabled:V}),U=De(`checkbox`),W=(0,M.useRef)(null),de=s();f(B,de(`@astryx.spinner.loading`),W);let{focusProps:fe}=Oe(W),G=R===`indeterminate`,K=R===!0,pe=(0,M.useCallback)(e=>{e&&(e.indeterminate=G)},[G]),q=[];E&&q.push(E),o&&q.push(P),w?.message&&q.push(F),V&&q.push(H.describedBy);let J=q.length>0?q.join(` `):void 0;return(0,N.jsxs)(`div`,{...a(r(`checkbox-input`,{size:S}),n(se!=null&&Ae.width(se),ce),T,le),children:[(0,N.jsxs)(`div`,{ref:e=>{H.interactionRef(e)},...v?void 0:k,...n($.container,i&&$.containerLabelHidden,!v&&me,!v&&ne.pressedAlpha),children:[(0,N.jsxs)(`div`,{...n($.checkboxWrapper,ke[S],!v&&$.indicatorPressOverlay),...fe,children:[(0,N.jsx)(`input`,{...O,ref:D(ue,pe,H.positionRef),id:j,type:`checkbox`,name:v?void 0:ee,checked:K,"aria-disabled":v?`true`:void 0,form:v?``:void 0,onClick:v?void 0:O.onClick,readOnly:b,required:x,"aria-required":I?`true`:void 0,onChange:e=>{if(v||B||b){e.target.indeterminate=G;return}let t=e.target.checked;c?.(t,e),l&&!e.defaultPrevented&&L(async()=>{z(t),await l(t,e)})},onFocus:C,onBlur:ae,"aria-readonly":b||void 0,"aria-describedby":J,"aria-invalid":w?.type===`error`||void 0,"aria-busy":B||void 0,...n($.input,m.centerInline(`-50%`),$.inputCoarse,ke[S],v&&$.inputDisabled)}),(0,N.jsx)(`span`,{ref:W,className:`xjp7ctv`,children:(0,N.jsx)(U,{state:G?`indeterminate`:K?`checked`:`unchecked`,size:S,isDisabled:v,children:B?(0,N.jsx)(d,{size:`sm`,shade:`inherit`}):null})})]}),(0,N.jsx)(`div`,{className:`x78zum5 xdt5ytf`,children:(0,N.jsx)(h,{...r(`checkbox-label`),label:t,inputID:j,isLabelHidden:i,isDisabled:v,isOptional:ie,isRequired:x,labelIcon:oe,description:o,descriptionID:P})})]}),w?.message&&(0,N.jsx)(g,{type:w.type,message:w.message,id:F,variant:`detached`}),V&&H.renderTooltip(y)]})}je.displayName=`CheckboxInput`;export{J as a,V as c,me as i,L as l,Oe as n,W as o,De as r,H as s,je as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{t as a}from"./mergeProps-ptS-gIMz.js";import{t as o}from"./Icon-3c9WmPTH.js";import{r as s}from"./focusOutline.stylex-B9nWSXsG.js";import{n as c,o as l}from"./useAnnounce-DOkF3CS1.js";import{E as u,T as d,w as f}from"./SidePanel-D5woAYFH.js";var p=e(i(),1),m=t(),h={root:{kzqmXN:`xh8yej3`,$$css:!0},trigger:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`x1qughib`,kzqmXN:`xh8yej3`,kkrTdU:`x1ypdohk x16khyan`,kMv6JI:`x9ynric`,kGuDYH:`x18juvz8`,k63SB2:`x2mo6ok`,kMwMTN:`x1tgivj0`,k9WMMc:`x1yc453h`,k8WAf4:`xt970qd`,$$css:!0},triggerDisabled:{kkrTdU:`xt0e3qv`,kSiTet:`xbyyjgo`,$$css:!0},chevron:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmuXW:`x2lah0s`,kzqmXN:`xta46cu`,kZKoxP:`x1seg80s`,kGuDYH:`x18juvz8`,k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,$$css:!0},chevronOpen:{k3aq6I:`x19jd1h0`,$$css:!0},chevronClosed:{k3aq6I:`x7p49u4`,$$css:!0},chevronStart:{k71WvV:`x1pezmd8`,$$css:!0},chevronStartOpen:{k3aq6I:`x1iffjtl x1nxqau`,$$css:!0},chevronStartClosed:{k3aq6I:`x7p49u4 xaafvuh`,$$css:!0},contentHidden:{k1xSpc:`x1s85apg`,$$css:!0},content:{kLKAdn:`xfsso4q`,kMv6JI:`x9ynric`,kGuDYH:`xjm74w1`,k63SB2:`xxovm9e`,kLWn49:`xw6l6zx`,kMwMTN:`x1tgivj0`,$$css:!0},divided:{kEafiO:`x11xkdxz x1g31smg`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,$$css:!0}},g={triggerCompact:{k8WAf4:`xu0wf1k`,$$css:!0},triggerBalanced:{k8WAf4:`xce4md1`,$$css:!0},triggerSpacious:{k8WAf4:`x8o8v82`,$$css:!0},contentCompact:{kGO01o:`xy143xn`,$$css:!0},contentBalanced:{kGO01o:`x1wesfrj`,$$css:!0},contentSpacious:{kGO01o:`xvmdzux`,$$css:!0}},_={compact:g.triggerCompact,balanced:g.triggerBalanced,spacious:g.triggerSpacious},v={compact:g.contentCompact,balanced:g.contentBalanced,spacious:g.contentSpacious};function y({trigger:e,children:t,defaultIsOpen:i,isOpen:d,isDisabled:g=!1,onOpenChange:y,chevronPosition:b,value:x,ref:S,xstyle:C,className:w,style:T,...E}){let D=c(),{isOpen:O,toggle:k}=f({isCollapsible:d===void 0?{defaultIsOpen:i??!0,onOpenChange:y}:{isOpen:d,onOpenChange:y},value:x}),A=()=>{g||k()},j=(0,p.use)(u),M=j?.hasDividers??!1,N=j?.density??null,P=b??j?.chevronPosition??`end`,F=P===`start`,I=(0,p.useId)(),L=(0,m.jsx)(o,{icon:F?`chevronRight`:`chevronDown`,size:`sm`,color:`secondary`,xstyle:[h.chevron,F&&h.chevronStart,F?O?h.chevronStartOpen:h.chevronStartClosed:O?h.chevronOpen:h.chevronClosed]});return(0,m.jsxs)(`div`,{ref:S,...a(r(`collapsible`,{density:N??void 0,divided:M?`divided`:null}),n(h.root,M&&h.divided,C),w,T),...E,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:A,"aria-disabled":g||void 0,"aria-expanded":O,"aria-controls":I,tabIndex:g?-1:void 0,...g?void 0:D,...a(r(`collapsible-trigger`,{density:N??void 0,chevronPosition:P,open:O?`open`:null,disabled:g?`disabled`:null}),s.focusVisible(h.trigger,N!=null&&_[N],!g&&l.pressedBackgroundColor,g&&h.triggerDisabled)),children:[F&&L,(0,m.jsx)(`span`,{className:`x1b2iylo xwgcxoh x1iyjqo2`,children:e}),!F&&L]}),(0,m.jsx)(`div`,{id:I,...a(r(`collapsible-content`,{density:N??void 0,open:O?`open`:null}),n(h.content,N!=null&&v[N],!O&&h.contentHidden)),children:j==null?t:(0,m.jsx)(u,{value:null,children:t})})]})}y.displayName=`Collapsible`;var b={wrapper:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,$$css:!0}};function x(e){return e==null?[]:Array.isArray(e)?e:[e]}function S({type:e=`single`,defaultValue:t,value:i,onChange:o,hasDividers:s=!1,density:c,chevronPosition:l,children:f,ref:h,xstyle:g,className:_,style:v,...y}){let S=i!==void 0,[C,w]=(0,p.useState)(()=>x(t)),T=(0,p.useMemo)(()=>S?x(i):C,[i,C,S]),E=(0,p.useCallback)(e=>T.includes(e),[T]),D=(0,p.useCallback)(t=>{let n;n=e===`single`?T.includes(t)?[]:[t]:T.includes(t)?T.filter(e=>e!==t):[...T,t],S||w(n),o&&o(e===`single`?n[0]??``:n)},[e,T,S,o]),O=(0,p.useMemo)(()=>({isOpen:E,toggle:D}),[E,D]),k=c??(s?`balanced`:null),A=(0,p.useMemo)(()=>({hasDividers:s,density:k,chevronPosition:l??null}),[s,k,l]),j=s?(0,m.jsx)(`div`,{ref:h,...a(r(`collapsible-group`,{density:k??void 0}),n(b.wrapper,g),_,v),...y,children:f}):f;return(0,m.jsx)(d,{value:O,children:(0,m.jsx)(u,{value:A,children:j})})}S.displayName=`CollapsibleGroup`;export{y as n,S as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,u as n}from"./themeProps-3IqahpCr.js";import{a as r,i}from"./useAnnounceRenderedText-BaMlDax-.js";import{t as a}from"./VStack-CkVMcNiK.js";import{n as o,t as s}from"./StackItem-CQviqAfM.js";import{p as c}from"./fieldParts-BnDYE6oM.js";import{t as l}from"./Icon-3c9WmPTH.js";import{i as u}from"./useResolvedRequired-68GOSl0j.js";import{_ as d,a as f,b as ee,c as te,f as p,g as ne,i as m,l as h}from"./SidePanel-D5woAYFH.js";import{t as g}from"./Text-B74VhVA7.js";import{n as _}from"./labels-provider-Dc-AJqPH.js";import{t as re}from"./useLocale-D8GRz3lz.js";import{n as v,t as ie}from"./IconButton-BeI1pXEZ.js";import{n as ae}from"./row-keys-WByP9Hsh.js";import{i as y,r as b,t as x}from"./TextInput-Dq9voagQ.js";import{t as oe}from"./Center-CgO0c-qo.js";import{a as S,o as se}from"./shaped-data-D15FDUcH.js";import{t as C}from"./Card-D_40unTk.js";import{n as w}from"./trace-patterns-D5Rcl0G4.js";import{A as ce,H as le,M as ue,N as T,P as E,V as de,W as fe,en as pe,rt as me,st as he}from"./index-BcMQ291i.js";var D=e(n(),1),O=new Set([`image/png`,`image/jpeg`]),k=`image/png,image/jpeg`;function A(e,t){let n=e.replace(/\.[^.]*$/,``).toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``)||`image`,r=`<${n}>`;for(let e=2;t.includes(r);e+=1)r=`<${n}_${String(e)}>`;return r}async function j(e){if(!O.has(e.type))return null;let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return{mimeType:e.type,data:btoa(n)}}function M(e){return`data:${e.mimeType};base64,${e.data}`}function N(e,t){return typeof e==`string`?e===t:Array.isArray(e)?e.some(e=>N(e,t)):typeof e==`object`&&e?Object.values(e).some(e=>N(e,t)):!1}function P(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>N(t,e)))}function F(e,t,n){let r=A(e,[...Object.keys(t),...n.map(e=>`<${e}>`)]);return{key:r.slice(1,-1),reference:r}}function I(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function L(e,t){let{images:n,state:r}=t;for(let[i,a]of e){let{key:e,reference:o}=F(i.name,{...t.host,...n},Object.keys(r));n={...n,[o]:a},r={...r,[e]:o}}return{images:n,state:r}}function R(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=Array.isArray(n)?n[Number(e)]:n[e]}return n}function ge(e,t,n){let r=n===void 0||n in e?n:R(t,n);if(typeof r==`string`&&r in e)return e[r];let i=Object.values(e);return n===void 0&&i.length===1?i[0]:void 0}function _e(e,t,n){return{x:e.left*t,y:e.top*n,width:(e.right-e.left)*t,height:(e.bottom-e.top)*n,line:Math.max(2,Math.round(Math.min(t,n)/200))}}var ve=.45;async function ye(e,t,n){let r=new Image;r.src=e,await r.decode();let i=document.createElement(`canvas`);i.width=r.naturalWidth,i.height=r.naturalHeight;let a=i.getContext(`2d`);if(!a)return e;let o=_e(t,i.width,i.height);return a.drawImage(r,0,0),a.fillStyle=n.shade,a.globalAlpha=ve,a.beginPath(),a.rect(0,0,i.width,i.height),a.rect(o.x,o.y,o.width,o.height),a.fill(`evenodd`),a.globalAlpha=1,a.strokeStyle=n.outline,a.lineWidth=o.line,a.strokeRect(o.x,o.y,o.width,o.height),i.toDataURL(`image/png`)}function be(e){let t=e.right-e.left,n=e.bottom-e.top;return{width:100/t,height:100/n,left:-e.left/t*100,top:-e.top/n*100}}function xe(e){return e.every(e=>typeof e==`string`)}function z(e){return e==null||typeof e==`string`?``:typeof e==`number`?0:typeof e==`boolean`?!1:Array.isArray(e)?[]:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,z(t)]))}function Se(e){let t=e[0];if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=Object.keys(t);return n.length===0||n.length>4||!e.every(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).join()===n.join()&&Object.values(e).every(e=>typeof e!=`object`||!e))?null:n.map(t=>{let n=e.map(e=>String(e[t]??``).length),r=Math.max(t.length,...n);return{key:t,weight:Math.min(4,Math.max(1,Math.round(r/10)))}})}var B=t();function Ce(e){return e===null?[]:Array.isArray(e)?e:[e]}function V(){let e=_(),[t,n]=(0,D.useState)(null);return{read:async e=>{n(null);let t=[];for(let r of Ce(e)){let e=await j(r);e?t.push([r,e]):n(r.name)}return t},status:t===null?void 0:{type:`error`,message:e(`@theorem.decision.image_bad`,{file:t})}}}function we({onImages:e}){let t=_(),{read:n,status:r}=V();return(0,B.jsx)(T,{label:t(`@theorem.decision.add_image`),isLabelHidden:!0,mode:`dropzone`,isMultiple:!0,accept:k,value:null,placeholder:t(`@theorem.decision.add_image_hint`),status:r,statusVariant:`detached`,onChange:t=>{n(t).then(t=>{t.length>0&&e(t)})}})}var Te={search:()=>[],bootstrap:()=>[]},Ee=48;function H(e,t,n){return Math.min(Math.max(e.split(`
|
|
2
|
-
`).length,t),n)}var U=(0,D.createContext)({images:{},onImages:()=>{}});function De({value:e,label:t,isLabelHidden:n}){let r=_(),{images:i,onImages:a}=(0,D.useContext)(U),{read:c,status:l}=V(),[u,d]=(0,D.useState)(!1),f=Object.hasOwn(i,e)?M(i[e]):void 0;return(0,B.jsxs)(o,{gap:2,vAlign:`center`,children:[(0,B.jsx)(he,{src:f,alt:t,label:e,onClick:f?()=>d(!0):void 0}),f?(0,B.jsx)(me,{isOpen:u,onOpenChange:d,media:{src:f,alt:t,caption:e},hasZoom:!0}):null,(0,B.jsx)(s,{size:`fill`,children:(0,B.jsx)(T,{label:t,isLabelHidden:n,accept:k,value:null,placeholder:r(`@theorem.decision.replace_image`),status:l,statusVariant:`detached`,onChange:t=>{c(t).then(([t])=>{t&&a({...i,[e]:t[1]})})}})})]})}function W({value:e,onChange:t,label:n,isLabelHidden:r}){let{images:i}=(0,D.useContext)(U),[a]=(0,D.useState)(()=>typeof e==`string`&&(e.length>Ee||e.includes(`
|
|
3
|
-
`))),[o]=(0,D.useState)(()=>typeof e==`string`&&Object.hasOwn(i,e));if(o&&typeof e==`string`)return(0,B.jsx)(De,{value:e,label:n,isLabelHidden:r});if(typeof e==`boolean`)return(0,B.jsx)(ue,{label:n,value:e,onChange:t});if(typeof e==`number`)return(0,B.jsx)(fe,{label:n,isLabelHidden:r,size:`sm`,value:e,isWheelEnabled:!1,onChange:t});if(e===null)return(0,B.jsx)(x,{label:n,isLabelHidden:r,size:`sm`,value:``,placeholder:`null`,isDisabled:!0,onChange:()=>{}});let s=String(e);return a?(0,B.jsx)(E,{label:n,isLabelHidden:r,size:`sm`,rows:H(s,2,12),value:s,onChange:t}):(0,B.jsx)(x,{label:n,isLabelHidden:r,size:`sm`,value:s,onChange:t})}function G({label:e,isRequired:t,description:n,children:r}){let i=(0,D.useId)();return(0,B.jsxs)(a,{gap:2,role:`group`,"aria-labelledby":i,children:[(0,B.jsx)(u,{label:e,inputID:``,labelID:i,isGroupLabel:!0,isRequired:t,description:n}),r]})}function K({children:e,...t}){return(0,B.jsx)(G,{...t,children:(0,B.jsx)(`div`,{style:{paddingInlineStart:12,borderInlineStart:`1px solid var(--color-border)`},children:e})})}function q({field:e,onAdd:t}){let n=_();return(0,B.jsx)(o,{children:(0,B.jsx)(v,{label:n(`@theorem.decision.add_item`,{field:e}),size:`sm`,variant:`ghost`,icon:(0,B.jsx)(pe,{size:14}),onClick:t})})}function J({index:e,onRemove:t}){let n=_();return(0,B.jsx)(ie,{label:n(`@theorem.decision.remove_item`,{item:n(`@theorem.data.item`,{index:String(e+1)})}),size:`sm`,variant:`ghost`,icon:(0,B.jsx)(c,{size:14}),onClick:t})}function Y({value:e,onChange:t}){return(0,B.jsx)(a,{gap:3,children:Object.entries(e).map(([n,r])=>(0,B.jsx)(X,{label:S(n),value:r,onChange:r=>t({...e,[n]:r})},n))})}function Oe({value:e,onChange:t,label:n}){let r=_(),i=ae(e);if(xe(e))return(0,B.jsx)(le,{label:n,size:`sm`,value:e.map((e,t)=>({id:`${String(t)}:${e}`,label:e})),searchSource:Te,hasCreate:!0,debounceMs:0,placeholder:r(`@theorem.decision.add_value`),onChange:e=>t(e.map(e=>e.label))});let c=Se(e),l=(0,B.jsx)(q,{field:n,onAdd:()=>t([...e,z(e.at(-1))])}),u=n=>(0,B.jsx)(J,{index:n,onRemove:()=>{i.drop(n),t(e.filter((e,t)=>t!==n))}});if(c){let r={display:`grid`,gap:8,alignItems:`start`,gridTemplateColumns:`${c.map(e=>`minmax(0, ${String(e.weight)}fr)`).join(` `)} auto`},a=e;return(0,B.jsxs)(G,{label:n,children:[(0,B.jsxs)(`div`,{style:r,"aria-hidden":!0,children:[c.map(e=>(0,B.jsx)(g,{type:`supporting`,color:`secondary`,maxLines:1,children:S(e.key)},e.key)),(0,B.jsx)(`span`,{style:{width:28}})]}),i.rows.map(({index:e,key:n})=>{let i=a[e];return(0,B.jsxs)(`div`,{style:r,children:[c.map(n=>(0,B.jsx)(W,{label:`${S(n.key)} ${String(e+1)}`,isLabelHidden:!0,value:i[n.key]??null,onChange:r=>t(a.map((t,i)=>i===e?{...t,[n.key]:r}:t))},n.key)),u(e)]},n)}),l]})}return(0,B.jsx)(K,{label:n,children:(0,B.jsxs)(a,{gap:3,children:[i.rows.map(({item:n,index:i,key:a})=>{let c=r(`@theorem.data.item`,{index:String(i+1)}),l=n=>t(e.map((e,t)=>t===i?n:e));return(0,B.jsxs)(o,{gap:2,vAlign:`start`,children:[(0,B.jsx)(s,{size:`fill`,children:se(n)?(0,B.jsx)(W,{label:c,isLabelHidden:!0,value:n,onChange:l}):(0,B.jsx)(X,{label:c,value:n,onChange:l})}),u(i)]},a)}),l]})})}function X({value:e,onChange:t,label:n}){return Array.isArray(e)?(0,B.jsx)(Oe,{label:n,value:e,onChange:t}):typeof e==`object`&&e?(0,B.jsx)(K,{label:n,children:(0,B.jsx)(Y,{value:e,onChange:t})}):(0,B.jsx)(W,{label:n,value:e,onChange:t})}function ke({value:e,onChange:t,label:n}){return typeof e==`object`&&e&&!Array.isArray(e)?(0,B.jsx)(Y,{value:e,onChange:t}):(0,B.jsx)(X,{label:n,value:e,onChange:t})}var Ae={"--theorem-console-card":`var(--color-background-muted)`},Z=`(width < 768px)`,Q=(0,D.createContext)(!0);function je(){return(0,D.useSyncExternalStore)(e=>{let t=globalThis.matchMedia(Z);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},()=>globalThis.matchMedia(Z).matches,()=>!1)}function Me({flush:e,wide:t,maxWidth:n,children:r}){let i=(0,B.jsx)(oe,{axis:`horizontal`,width:`100%`,minHeight:`100%`,children:(0,B.jsx)(a,{width:`100%`,maxWidth:t?void 0:n,gap:3,padding:4,children:r})});return e?(0,B.jsx)(a,{height:`100%`,paddingInlineStart:3,style:{...Ae,paddingInlineEnd:p(3)},children:(0,B.jsx)(C,{variant:`transparent`,height:`100%`,padding:0,style:{overflowY:`auto`},children:i})}):(0,B.jsx)(m,{inset:`all`,padding:0,isScrollable:!0,children:i})}function Ne({inspector:e,maxWidth:t,flush:n=!1,columns:a=!1,requestLabel:o,className:s,style:c,children:l}){let u=(0,D.useRef)(null),d=e.toggle?(0,B.jsx)(h,{floating:!0,children:e.toggle}):void 0;return(0,B.jsx)(ce,{inspector:e,children:(0,B.jsx)(r,{ref:u,height:`fill`,className:s,style:{position:`relative`,...c},header:d,content:(0,B.jsx)(i,{padding:0,isScrollable:!1,children:(0,B.jsx)(Pe,{layoutRef:u,flush:n,columns:a,maxWidth:t,requestLabel:o,children:l})})})})}function Pe({layoutRef:e,flush:t,columns:n,maxWidth:r,requestLabel:i,children:a}){let o=je(),s=D.Children.toArray(a).length,c=n&&s>1;return c&&!o?(0,B.jsx)($,{requestLabel:i,layoutRef:e,children:a}):(0,B.jsx)(Me,{flush:t,wide:c,maxWidth:r,children:a})}function $({requestLabel:e=`Request`,layoutRef:t,children:n}){let a=_(),o=(0,D.useRef)(null),[s]=(0,D.useState)(()=>t.current?.clientWidth??0),c=ne({defaultSize:s>0?Math.round(s*.4):`40%`,minSize:280,maxSize:d(70,{min:ee(280)}),containerRef:o}),[l,u]=D.Children.toArray(n),p={name:e,show:e,hide:e,resize:a(`@theorem.panel.resize`,{name:e})};return(0,B.jsx)(Q,{value:!1,children:(0,B.jsx)(r,{ref:o,height:`fill`,start:(0,B.jsx)(te,{side:`start`,className:`theorem-console-request`,labels:p,resizable:c,open:!0,children:(0,B.jsx)(f,{label:e,children:l})}),content:(0,B.jsx)(i,{padding:0,isScrollable:!1,children:(0,B.jsx)(m,{inset:`beside`,className:`theorem-console-response`,children:u})})})})}function Fe({children:e}){return(0,B.jsx)(C,{variant:`muted`,padding:0,className:`theorem-console-card`,style:w,children:(0,B.jsx)(Q,{value:!1,children:e})})}function Ie({label:e,fill:t=!1,children:n}){return(0,D.use)(Q)?(0,B.jsx)(C,{variant:`muted`,padding:t?0:4,className:`theorem-console-card`,style:w,children:t?n:(0,B.jsx)(a,{height:`100%`,gap:3,children:n})}):t?n:(0,B.jsx)(f,{label:e,padding:4,children:n})}function Le(e){return t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e())}}function Re({title:e,onRun:t,children:n,...r}){let i=_(),s=(0,D.use)(Q),c=(0,B.jsxs)(a,{gap:3,padding:s?void 0:4,onKeyDown:Le(t),children:[(0,B.jsxs)(o,{gap:2,hAlign:`between`,vAlign:`center`,children:[(0,B.jsx)(g,{type:`supporting`,color:`secondary`,as:`h3`,children:e}),r.onView?(0,B.jsx)(de,{label:i(`@theorem.data.json`),tooltip:i(r.view===`json`?`@theorem.decision.fields`:`@theorem.data.json`),size:`sm`,isIconOnly:!0,isDisabled:!r.hasFields,icon:(0,B.jsx)(l,{icon:b,size:`sm`}),pressedIcon:(0,B.jsx)(l,{icon:y,size:`sm`}),isPressed:r.view===`json`,onPressedChange:e=>{r.onView(e?`json`:`fields`)}}):r.actions]}),n]});return s?(0,B.jsx)(C,{variant:`muted`,padding:4,className:`theorem-console-card`,style:w,children:c}):c}var ze={"--font-family-body":`var(--font-family-code)`};function Be({label:e,text:t,isInvalid:n,onChange:r}){return(0,B.jsx)(E,{label:e,isLabelHidden:!0,value:t,onChange:r,rows:H(t,8,24),hasSpellCheck:!1,status:n?{type:`error`}:void 0,controlStyle:ze})}function Ve({note:e,isReady:t,isRunning:n,runLabel:r,runningLabel:i,stopLabel:a,onRun:s,onStop:c}){return(0,B.jsxs)(o,{gap:3,hAlign:`between`,vAlign:`center`,children:[(0,B.jsx)(g,{type:`supporting`,color:`secondary`,style:t?void 0:{color:`var(--color-error)`},hasTabularNumbers:!0,children:e}),(0,B.jsxs)(o,{gap:2,vAlign:`center`,children:[n?(0,B.jsx)(v,{label:a,variant:`ghost`,onClick:c}):null,(0,B.jsx)(v,{label:n?i:r,variant:`primary`,isLoading:n,isDisabled:!t,onClick:s})]})]})}function He(){let e=re();return(0,D.useMemo)(()=>{let t=new Intl.NumberFormat(e,{style:`unit`,unit:`byte`,unitDisplay:`narrow`}),n=new Intl.NumberFormat(e,{style:`unit`,unit:`kilobyte`,unitDisplay:`narrow`,maximumFractionDigits:1});return e=>e<1024?t.format(e):n.format(e/1024)},[e])}export{I as S,be as _,Ie as a,ye as b,q as c,J as d,ke as f,ge as g,we as h,Re as i,K as l,H as m,Fe as n,Ve as o,U as p,Be as r,He as s,Ne as t,G as u,L as v,P as x,M as y};
|