@theoremjs/studio 0.3.4-next.548.gbb156b2 → 0.3.4-next.554.g84e62b0
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/README.md +54 -14
- package/agreement.js +22 -7
- package/compile.js +3 -1
- package/cookbooks/catalog.d.ts +18 -0
- package/cookbooks/catalog.js +84 -8
- package/cookbooks/mod.d.ts +1 -1
- package/draft.d.ts +2 -0
- package/mod.d.ts +1 -1
- package/package.json +4 -4
- package/page/assets/Banner-CypKeoPt.js +2 -0
- package/page/assets/BottomSheet-Dbh6A5Vl.js +1 -0
- package/page/assets/{Card-Ghe4ozhC.js → Card-DruykyeB.js} +1 -1
- package/page/assets/CheckboxInput-CFZ_Wq8-.js +2 -0
- package/page/assets/CodeBlock-CfVOtDeO.js +52 -0
- package/page/assets/CollapsibleGroup-FIawJRo4.js +1 -0
- package/page/assets/ConsoleFrame-o1h8eHpY.js +3 -0
- package/page/assets/ContextMenu-XBM6rqqH.js +2 -0
- package/page/assets/DateInput-B1ICJtHn.js +1 -0
- package/page/assets/{Dialog-BDUExlk_.js → Dialog-Sd04KQS2.js} +1 -1
- package/page/assets/EmptyState-C_uF9Wyj.js +1 -0
- package/page/assets/HoverCard-DMyWUvwP.js +1 -0
- package/page/assets/Icon-BqkS-pIq.js +3 -0
- package/page/assets/IconButton-DVUFx-8p.js +1 -0
- package/page/assets/ListItem-QF7KFt0h.js +1 -0
- package/page/assets/MenuBottomSheet-DB7k7yMt.js +1 -0
- package/page/assets/MenuBottomSheetActionList-3L0HS4Kf.js +1 -0
- package/page/assets/SchemaFields-DthGCSIM.js +1 -0
- package/page/assets/ScrollableArea-BHfY7sWH.js +1 -0
- package/page/assets/SegmentedControlItem-BBGRPrxp.js +1 -0
- package/page/assets/{Text-BsiAsowd.js → Text-BOqCfzZC.js} +2 -2
- package/page/assets/{TimestampHoverCard-CCnmnVlQ.js → TimestampHoverCard-CDCVpEWM.js} +1 -1
- package/page/assets/{ToolResultCharts-DQc5tTgc.js → ToolResultCharts-DG2VPRGs.js} +1 -1
- package/page/assets/Tooltip-BWs5DLrM.js +1 -0
- package/page/assets/TraceInspector-CSlGFNuh.js +1 -0
- package/page/assets/{TraceOverview-DqhP_wzg.js → TraceOverview-Ck6C_Ez_.js} +2 -2
- package/page/assets/{_virtual_studio-type-sources-CvOETQ24.js → _virtual_studio-type-sources-CxP3L28S.js} +139 -77
- package/page/assets/browser-engine-D6JZkPvV.js +11 -0
- package/page/assets/browser-transport-Dap3OD5q.js +47 -0
- package/page/assets/{crypto-Dd6XxhqK.js → crypto-CrMpJY2D.js} +1 -1
- package/page/assets/{embedding-space-view-BU2AjjAx.js → embedding-space-view-CN0VHXXH.js} +1 -1
- package/page/assets/{encode-files-CiyHxnUC.js → encode-files-BCf3-Q7y.js} +1 -1
- package/page/assets/{export-agent-D-Rj6FQy.js → export-agent-BOvhPd_f.js} +1 -1
- package/page/assets/fieldParts-B7DYLgh4.js +1 -0
- package/page/assets/focusableSelector-DXZeMU85.js +1 -0
- package/page/assets/{guardrail-tester-lZGPnEIR.js → guardrail-tester-DfZ1mIDQ.js} +2 -2
- package/page/assets/index-CM9UyI8f.js +146 -0
- package/page/assets/isRenderable-DHkzpAoQ.js +1 -0
- package/page/assets/{labels-provider-BObUoNKa.js → labels-provider-DkA22zkP.js} +1 -1
- package/page/assets/{live-messages-DuLSkEdL.js → live-messages-D1DPu8uD.js} +1 -1
- package/page/assets/plainDate-BHiJcj7o.js +1 -0
- package/page/assets/reader-BJZH_Cmn.js +7 -0
- package/page/assets/{shaped-data-DYOBdvLJ.js → shaped-data-AVV4e7rW.js} +1 -1
- package/page/assets/{stub-kLwOLu-h.js → stub-BMUhx6B5.js} +1 -1
- package/page/assets/studio-code-pane-CcvVwTrU.js +8 -0
- package/page/assets/{studio-console-DgsrR6Qy.js → studio-console-CT4dvZQc.js} +1 -1
- package/page/assets/studio-decision-CJKqP0sE.js +1 -0
- package/page/assets/studio-embedding-CmY144a3.js +2 -0
- package/page/assets/studio-host-console-E4-8fIww.js +2 -0
- package/page/assets/studio-labels-dSptB7mq.js +3 -0
- package/page/assets/studio-live-BH4AubX8.js +5 -0
- package/page/assets/{studio-map-D7QZ6RAm.js → studio-map-DIm07L5J.js} +1 -1
- package/page/assets/{studio-trace-replay-BSts3p2O.js → studio-trace-replay-C5Wa5BcR.js} +2 -2
- package/page/assets/{studio-type-checker-BNljIXdE.js → studio-type-checker-B_CHmWnf.js} +1 -1
- package/page/assets/{tool-schema--CLE7o0H.js → tool-schema-DCF2M0n_.js} +6 -6
- package/page/assets/{trace-patterns-CS99kExN.js → trace-patterns-D6TbkLLr.js} +1 -1
- package/page/assets/{trace-record-B2MF8flo.js → trace-record-Dtrz7WQ7.js} +1 -1
- package/page/assets/tree-Cy9xwG_l.js +3 -0
- package/page/assets/{turn-client-DXtNeRHG.js → turn-client-mCvAwEgO.js} +1 -1
- package/page/assets/types-CB42MysU.js +1 -0
- package/page/assets/{use-one-call-TAgOAnMo.js → use-one-call-t6S5-SaV.js} +1 -1
- package/page/assets/use-second-ticker-GWBt83pd.css +1 -0
- package/page/assets/use-trace-records-B1vrKQmA.js +1 -0
- package/page/assets/useAdaptivePresentation-Bma4-u1a.js +1 -0
- package/page/assets/useAnnounce-DTSHZvjg.js +1 -0
- package/page/assets/useClipboard-CbN9bb4J.js +1 -0
- package/page/assets/useDevWarning-Z9SoixOP.js +1 -0
- package/page/assets/useFocusReturnVisibility-BHKv5Jwr.js +1 -0
- package/page/assets/useMenuPress-DLG1QOiE.js +1 -0
- package/page/assets/useResolvedRequired-DbsOcDqy.js +1 -0
- package/page/assets/useScrollableArea-DuF_pz9m.js +1 -0
- package/page/assets/useTooltip-c097gL_-.js +1 -0
- package/page/assets/{workspace-Cb6PICiw.js → workspace-BFrc6kx2.js} +1 -1
- package/page/index.html +48 -41
- package/read-source.js +5 -4
- package/read-studio.mjs +99 -0
- package/requirements.d.ts +3 -0
- package/requirements.js +10 -0
- package/server/alerts.d.ts +23 -0
- package/server/alerts.js +82 -0
- package/server/draft-handler.d.ts +3 -0
- package/server/draft-handler.js +5 -1
- package/server/events.d.ts +38 -0
- package/server/events.js +95 -0
- package/server/handler.d.ts +11 -3
- package/server/handler.js +64 -8
- package/server/project-source.d.ts +6 -3
- package/server/project-source.js +45 -4
- package/server/project.js +25 -3
- package/server/save-session.d.ts +2 -0
- package/server/save-session.js +7 -1
- package/server/serve.d.ts +1 -1
- package/server/serve.js +174 -18
- package/server/test-key.d.ts +19 -2
- package/server/test-key.js +51 -74
- package/server/watch.d.ts +8 -0
- package/server/watch.js +16 -5
- package/start.mjs +95 -5
- package/ui/built/theme.css +2 -2
- package/ui/built/theme.css.d.ts +2 -2
- package/ui/built/theorem-studio.d.ts +2 -2
- package/ui/built/theorem-studio.js +3 -3
- package/ui/built/theorem-studio.variants.d.ts +2 -2
- package/ui/lib/page-errors.d.ts +13 -0
- package/ui/lib/page-errors.js +31 -0
- package/ui/profile-editor.js +1 -1
- package/ui/studio-runner.d.ts +1 -1
- package/ui/studio-runner.js +7 -3
- package/ui/studio-screen.js +23 -11
- package/page/assets/Banner-BP1TXM0J.js +0 -2
- package/page/assets/BottomSheet-BQPskY35.js +0 -1
- package/page/assets/CheckboxInput-C9kbVyhK.js +0 -2
- package/page/assets/CodeBlock-Kjgv83A6.js +0 -52
- package/page/assets/CollapsibleGroup-Bfnp4Aaz.js +0 -1
- package/page/assets/ConsoleFrame-Da49DUMV.js +0 -3
- package/page/assets/ContextMenu-DGeuOuIz.js +0 -2
- package/page/assets/DateInput-BJt-UTCy.js +0 -1
- package/page/assets/EmptyState-C8W4JKBZ.js +0 -1
- package/page/assets/HoverCard-C6thuzrf.js +0 -1
- package/page/assets/Icon-ZfFwTt8n.js +0 -3
- package/page/assets/IconButton-CG5klqF1.js +0 -1
- package/page/assets/ScrollableArea-C8AVuqnt.js +0 -1
- package/page/assets/Section-DJ97F7QE.js +0 -1
- package/page/assets/SegmentedControlItem-BLuJOusN.js +0 -1
- package/page/assets/Tooltip-CTEuMRLe.js +0 -1
- package/page/assets/TraceInspector-Cn7_V-2C.js +0 -1
- package/page/assets/browser-engine-BUuO2-Ve.js +0 -11
- package/page/assets/browser-transport-FDq0Q4Fx.js +0 -47
- package/page/assets/fieldParts-Cs6Amprh.js +0 -1
- package/page/assets/index-Bk_jhM4_.js +0 -145
- package/page/assets/reader-DJB6MzQf.js +0 -7
- package/page/assets/studio-code-pane-D7R84b_Y.js +0 -8
- package/page/assets/studio-decision-uyaB9Oo3.js +0 -1
- package/page/assets/studio-embedding-tRaNKz_n.js +0 -2
- package/page/assets/studio-host-console-DzpUuYer.js +0 -2
- package/page/assets/studio-labels-CByQ2z3Y.js +0 -3
- package/page/assets/studio-live-CWeuAs3g.js +0 -5
- package/page/assets/tree-CDqNZ8w-.js +0 -3
- package/page/assets/types-DTbqRZ5l.js +0 -1
- package/page/assets/use-second-ticker-CnxaP3LD.css +0 -1
- package/page/assets/use-trace-records-CZNBjTS0.js +0 -1
- package/page/assets/useAdaptivePresentation-BY_zvjIp.js +0 -1
- package/page/assets/useClipboard-B1amtN2V.js +0 -1
- package/page/assets/useDevWarning-Cna3kqg1.js +0 -1
- package/page/assets/useScrollableArea-vxuztwym.js +0 -1
- package/page/assets/useTooltip-rxACYEAC.js +0 -1
- /package/page/assets/{use-second-ticker-VX91zrxj.js → use-second-ticker-DhbZ0Soz.js} +0 -0
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ The command needs [Deno](https://deno.com). The installed `@theoremjs/studio`, `
|
|
|
46
46
|
To show the screen in your app, also install `@theoremjs/react` at the same version, and React 19 and the design packages at the versions `@theoremjs/react` lists in `peerDependencies`:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
npm install @theoremjs/react react react-dom @astryxdesign/core@0.7.
|
|
49
|
+
npm install @theoremjs/react react react-dom @astryxdesign/core@0.7.4 @astryxdesign/theme-neutral@0.7.4 @stylexjs/stylex@0.19.0
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
## Open your project
|
|
@@ -60,7 +60,7 @@ The command starts two servers that only this machine reaches: your project's se
|
|
|
60
60
|
Add `"studio": "theorem-studio"` to your scripts to run it as `npm run studio`.
|
|
61
61
|
|
|
62
62
|
```text
|
|
63
|
-
theorem-studio [setup] [--editor <command>] [--deno-config <file>] [--no-watch]
|
|
63
|
+
theorem-studio [setup] [--editor <command>] [--deno-config <file>] [--no-watch] [--quiet] [--offline] [--verbose]
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
| Option | What it does |
|
|
@@ -69,28 +69,68 @@ theorem-studio [setup] [--editor <command>] [--deno-config <file>] [--no-watch]
|
|
|
69
69
|
| `--editor <command>` | The editor the studio opens a line of your files in. Default: `$VISUAL` or `$EDITOR` when it opens a window, else `code`. |
|
|
70
70
|
| `--deno-config <file>` | The Deno config your project loads with. Default: the `deno.json` or `deno.jsonc` in the folder you ran the command in, else the studio's. |
|
|
71
71
|
| `--no-watch` | Do not watch the files the setup reads. The studio reads them again when you come back to it. |
|
|
72
|
+
| `--quiet` | Print nothing about the project. Without it, the command prints what loaded (the setup, its entry, each agent with its type and providers, the tools by kind), then each problem, difference and unregistered profile or tool the page flags, when the project opens and when the list changes, then one line for each provider's key, then one line for each run that fails and each error the page meets. A line that repeats the one before is printed once. A project with nothing to look at prints `theorem studio: nothing to look at`. |
|
|
73
|
+
| `--offline` | Do not check the keys. Without it, the command sends each provider its models use one request, the `check` its definition declares, and prints whether the key works, is refused, is empty, or could not be checked. It never prints a key. |
|
|
74
|
+
| `--verbose` | Also print a line for every run, as it answers. Without it, only a run that fails prints, with what it said. |
|
|
75
|
+
|
|
76
|
+
### Reading an open studio
|
|
77
|
+
|
|
78
|
+
Two more commands read a studio that is open on your project. They change nothing, so you, a script or a coding agent can run them at any time from another terminal:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
theorem-studio status [setup]
|
|
82
|
+
theorem-studio errors [setup] [--follow]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
| Command | What it prints |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| `status` | Where the studio is open, what it loaded, what each key check said, and what to look at now. |
|
|
88
|
+
| `errors` | The last 200 events the studio printed about the project (what to look at, each key that does not work, each run that fails, each error the page meets), each with its time. A run that ends well is not kept. |
|
|
89
|
+
| `errors --follow` | The same, then each new event as it comes, until the studio stops. |
|
|
90
|
+
|
|
91
|
+
With several setups open, name the one to read. The `agents` command runs the same commands through the studio you installed: `npx agents studio status`.
|
|
92
|
+
|
|
93
|
+
### The app's entry
|
|
94
|
+
|
|
95
|
+
The studio runs your agents the way your app runs them. Your app's entry point exports `theorem`, a `TurnWiring` from `@theoremjs/agents`, and your app's own server uses the same object:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
// server/theorem.ts
|
|
99
|
+
import type { TurnWiring } from '@theoremjs/agents';
|
|
100
|
+
|
|
101
|
+
export const theorem: TurnWiring = {
|
|
102
|
+
register: () => registerSupport(),
|
|
103
|
+
provider: { vault: { openai: Deno.env.get('OPENAI_API_KEY') ?? '' } },
|
|
104
|
+
prepare: (turn) => ({ ...turn, system: systemPromptFor(turn.host) }),
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
| Field | What the studio does with it |
|
|
109
|
+
|---|---|
|
|
110
|
+
| `register()` | Calls it once as it loads the project, before anything runs: register the project's profiles and tools here. It may be `async`. |
|
|
111
|
+
| `provider` | The keys, network, and limits every model call runs on. Without it, a run's model call fails for want of a key. |
|
|
112
|
+
| `prepare(turn)` | Gives it each text, image and speech turn, and runs the turn it returns: add the system prompt, history, credentials or `onStage` your app adds. The studio keeps the profile and the context the run was given. |
|
|
113
|
+
|
|
114
|
+
The studio's chat keeps its own conversation and never writes to your app's stores. `prepare` can change the history it is given.
|
|
115
|
+
|
|
116
|
+
The studio loads your entry in the environment you start it in. If the entry reads its keys as it loads, from `Deno.env` or a file an environment variable names, set them on the command that starts the studio, as you do for your app: `OPENAI_API_KEY=… theorem-studio`.
|
|
72
117
|
|
|
73
118
|
### What a setup file exports
|
|
74
119
|
|
|
75
|
-
|
|
120
|
+
The studio reads only these exports. `entry` is required; the others are optional.
|
|
76
121
|
|
|
77
122
|
| Export | What the studio does with it |
|
|
78
123
|
|---|---|
|
|
79
|
-
| `
|
|
80
|
-
| `provider` | The keys, network, and limits every model call runs on (`ProviderHostOptions` from `@theoremjs/agents/kernel`). Without it, a run's model call fails for want of a key. |
|
|
124
|
+
| `entry` | The path of your app's entry point, from the setup file: `export const entry = './server/theorem.ts'`. The studio loads its `theorem`, and reads the files it imports as part of the project. |
|
|
81
125
|
| `people`, `host` | Who a run's tools act for (below). |
|
|
82
|
-
| `questions` | What each decision profile asks, by the profile's id: `{ [profileId]: { [questionId]: DecisionQuestion } }`. |
|
|
126
|
+
| `questions` | What each decision profile asks, by the profile's id: `{ [profileId]: { [questionId]: DecisionQuestion } }`. When your app builds a profile's questions for each decision, export the builder your app passes to `createTheoremDecisionHandler` instead, `{ input?, build }`: the run shows a form for `input` above the state, and each answer shows the questions `build` made. The editor shows where the builder is and lists no questions. |
|
|
83
127
|
| `images` | The pictures each decision profile can send, by the profile's id. A decision sends only those its state or questions name: `{ [profileId]: { [reference]: DecisionAsset } }`, where a reference is the name its questions write, such as `'<ghs02>'`. |
|
|
84
128
|
|
|
85
|
-
|
|
129
|
+
A setup file that still exports `default()` or `provider` does not open: the command names the move to the entry.
|
|
86
130
|
|
|
87
|
-
|
|
131
|
+
### Keys a run uses
|
|
88
132
|
|
|
89
|
-
|
|
90
|
-
export const provider = {
|
|
91
|
-
vault: { openai: Deno.env.get('OPENAI_API_KEY') ?? '' },
|
|
92
|
-
};
|
|
93
|
-
```
|
|
133
|
+
A profile's model names a key slot. `theorem.provider.vault` holds a key for each slot, so a studio run signs with the key the same profile uses in your app. Load the keys however your start script does, and read them when the entry loads; the studio never writes them down.
|
|
94
134
|
|
|
95
135
|
For a key that comes from a secret store, a slot can hold a function instead. The studio calls it with the provider and slot when a call needs the key. A slot left out or empty fails that run with the slot's name, not a guess at another key.
|
|
96
136
|
|
|
@@ -199,7 +239,7 @@ The handler takes a Web `Request` and returns a `Response`. It serves no project
|
|
|
199
239
|
Without lent keys, the handler answers three requests:
|
|
200
240
|
|
|
201
241
|
- the guardrail probe, on a scripted model, so no model is called;
|
|
202
|
-
- the key test
|
|
242
|
+
- the key test: one request to the check the key's provider declares (`checkKey`), to public hosts only;
|
|
203
243
|
- the tool connection test, which reaches public hosts only.
|
|
204
244
|
|
|
205
245
|
Drafts then run in the browser, on the builder's own keys.
|
package/agreement.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import { resolveAllow, resolveDetect } from '@theoremjs/agents/guardrails';
|
|
8
|
+
import { BOUNDARIES, DETECTORS, resolveAllow, resolveDetect, TOOL_BOUNDARIES, } from '@theoremjs/agents/guardrails';
|
|
9
9
|
import { unsetValue } from '@theoremjs/agents/kernel';
|
|
10
10
|
import { STUDIO_POLICY_UNSET } from "./policy.js";
|
|
11
11
|
function isRecord(value) {
|
|
@@ -17,14 +17,23 @@ function isPolicyFill(path, ours, theirs) {
|
|
|
17
17
|
}
|
|
18
18
|
/** `held` without the table the kernel works out from its patterns. */
|
|
19
19
|
const uncompiled = ({ compiled: _, ...held }) => held;
|
|
20
|
+
/** `actions` at only the boundaries in `boundaries`. */
|
|
21
|
+
function onlyAt(actions, boundaries) {
|
|
22
|
+
return Object.fromEntries(boundaries.map((boundary) => [boundary, actions[boundary]]));
|
|
23
|
+
}
|
|
20
24
|
/**
|
|
21
|
-
* What the kernel reads `detect` as: each detector's action at each boundary, whose
|
|
22
|
-
* reads with, and what it lets through. Two settings the kernel reads the same are the
|
|
25
|
+
* What the kernel reads `detect` as: each detector's action at each boundary it reads, whose
|
|
26
|
+
* patterns it reads with, and what it lets through. Two settings the kernel reads the same are the
|
|
27
|
+
* same here. A host profile runs tools and no model turn, so it reads only the tool boundaries.
|
|
23
28
|
*/
|
|
24
|
-
function detectAsRead(detect) {
|
|
29
|
+
function detectAsRead(detect, boundaries) {
|
|
25
30
|
if (detect === undefined)
|
|
26
31
|
return undefined;
|
|
27
|
-
const { sources = {}, host = [], ...
|
|
32
|
+
const { sources = {}, host = [], ...resolved } = resolveDetect(detect);
|
|
33
|
+
const read = {
|
|
34
|
+
...resolved,
|
|
35
|
+
...Object.fromEntries(DETECTORS.map((detector) => [detector, onlyAt(resolved[detector], boundaries)])),
|
|
36
|
+
};
|
|
28
37
|
const allow = Object.entries(resolveAllow(detect)).map(([detector, held]) => [
|
|
29
38
|
detector,
|
|
30
39
|
{
|
|
@@ -35,7 +44,10 @@ function detectAsRead(detect) {
|
|
|
35
44
|
return {
|
|
36
45
|
...read,
|
|
37
46
|
sources: Object.fromEntries(Object.entries(sources).map(([detector, source]) => [detector, uncompiled(source)])),
|
|
38
|
-
host: Object.fromEntries(host.map(({ id, ...rule }) => [
|
|
47
|
+
host: Object.fromEntries(host.map(({ id, ...rule }) => [
|
|
48
|
+
id,
|
|
49
|
+
uncompiled({ ...rule, actions: onlyAt(rule.actions, boundaries) }),
|
|
50
|
+
])),
|
|
39
51
|
allow: Object.fromEntries(allow),
|
|
40
52
|
};
|
|
41
53
|
}
|
|
@@ -47,7 +59,10 @@ function asRead(profile) {
|
|
|
47
59
|
return profile;
|
|
48
60
|
return {
|
|
49
61
|
...profile,
|
|
50
|
-
guardrails: {
|
|
62
|
+
guardrails: {
|
|
63
|
+
...profile.guardrails,
|
|
64
|
+
detect: detectAsRead(profile.guardrails.detect, profile.type === 'host' ? TOOL_BOUNDARIES : BOUNDARIES),
|
|
65
|
+
},
|
|
51
66
|
};
|
|
52
67
|
}
|
|
53
68
|
/**
|
package/compile.js
CHANGED
|
@@ -1359,6 +1359,8 @@ function omitOutOfScope(profile) {
|
|
|
1359
1359
|
/** The draft's decision questions, each problem reported on the Decision facet. */
|
|
1360
1360
|
function compileQuestions(decision, report) {
|
|
1361
1361
|
const questions = Object.create(null);
|
|
1362
|
+
if (decision.questionsBuilt)
|
|
1363
|
+
return questions;
|
|
1362
1364
|
if (!decision.questions.length) {
|
|
1363
1365
|
report('decision', 'Add at least one question.', 'questions');
|
|
1364
1366
|
}
|
|
@@ -1592,7 +1594,7 @@ function compileDecision(draft, report, on) {
|
|
|
1592
1594
|
return {
|
|
1593
1595
|
profile,
|
|
1594
1596
|
customTools: [],
|
|
1595
|
-
questions,
|
|
1597
|
+
...(decision.questionsBuilt ? {} : { questions }),
|
|
1596
1598
|
...(Object.keys(images).length ? { images: { ...images } } : {}),
|
|
1597
1599
|
};
|
|
1598
1600
|
}
|
package/cookbooks/catalog.d.ts
CHANGED
|
@@ -58,11 +58,29 @@ export declare function addArchitectExample(workspace: StudioWorkspace): StudioW
|
|
|
58
58
|
/** A workspace of the code architect and its narrator, with the architect in the chat. */
|
|
59
59
|
export declare function createArchitectWorkspace(): StudioWorkspace;
|
|
60
60
|
export type CookbookId = 'research' | 'concierge' | 'architect' | 'live-concierge' | 'decision' | 'gemini-embedding-2' | 'narrator' | 'console';
|
|
61
|
+
/**
|
|
62
|
+
* Searchable pieces a cookbook recipe includes. Closed for chips and search.
|
|
63
|
+
* The cookbook screen shows the build kind (`system` → multi-agent, `agent` →
|
|
64
|
+
* agent) plus a short slice of these, with the rest collapsed as `+N`.
|
|
65
|
+
*/
|
|
66
|
+
export type CookbookIncludeTag = 'text' | 'decision' | 'live' | 'speech' | 'embedding' | 'host' | 'http-tools' | 'mcp-tools' | 'agent-tools' | 'function-tools' | 'guardrails' | 'post-tool';
|
|
67
|
+
/** Tags the cookbook screen and search project; do not invent chips in the UI. */
|
|
68
|
+
export interface CookbookTags {
|
|
69
|
+
includes: readonly CookbookIncludeTag[];
|
|
70
|
+
}
|
|
61
71
|
export interface CookbookEntry {
|
|
62
72
|
id: CookbookId;
|
|
63
73
|
kind: 'agent' | 'system';
|
|
74
|
+
/** Short phrase that grounds the recipe on the cookbook screen (e.g. verified research). */
|
|
75
|
+
verb: string;
|
|
64
76
|
label: string;
|
|
65
77
|
description: string;
|
|
78
|
+
tags: CookbookTags;
|
|
79
|
+
/**
|
|
80
|
+
* What this recipe actually demonstrates in its workspace — for MCP paste briefs.
|
|
81
|
+
* Only patterns present in the draft; do not invent.
|
|
82
|
+
*/
|
|
83
|
+
teaches: readonly string[];
|
|
66
84
|
question?: string;
|
|
67
85
|
createWorkspace: () => StudioWorkspace | Promise<StudioWorkspace>;
|
|
68
86
|
addToWorkspace: (workspace: StudioWorkspace) => StudioWorkspace | Promise<StudioWorkspace>;
|
package/cookbooks/catalog.js
CHANGED
|
@@ -598,8 +598,19 @@ export const COOKBOOKS = {
|
|
|
598
598
|
research: {
|
|
599
599
|
id: 'research',
|
|
600
600
|
kind: 'system',
|
|
601
|
+
verb: 'every claim checked',
|
|
601
602
|
label: 'Research scout',
|
|
602
|
-
description: '
|
|
603
|
+
description: 'Ask a hard question about models, papers, or memory. It searches the Hub, arXiv, and GitHub, cuts each page to the passages that bear on the question, and will not let a quote through unchecked.',
|
|
604
|
+
tags: {
|
|
605
|
+
includes: ['text', 'decision', 'http-tools', 'mcp-tools', 'guardrails', 'post-tool'],
|
|
606
|
+
},
|
|
607
|
+
teaches: [
|
|
608
|
+
'A multi-agent system: text agent `research.scout` plus decision agent `research.pagereader` (Jev).',
|
|
609
|
+
'Staging page-read tools at `post_tool` via `stageAgentKey`: `read_pages`, `read_model_card`, `read_dataset_card`, `read_readme`, and `read_library_docs` are filtered by the page-reader before the scout sees them.',
|
|
610
|
+
'Parallel tool calls (`tools.parallel: true`) across HTTP tools (arXiv, GitHub, Hub cards) and MCP tools (Exa `search_web` / `read_pages`, Context7 library docs, DeepWiki `ask_repo_docs`).',
|
|
611
|
+
'Guardrails that flag every detector on untrusted page text, with `allowedHosts` limited to the research hosts.',
|
|
612
|
+
'Turn behaviour with resume, auto-continue on length / stream_incomplete / provider_error, and steering.',
|
|
613
|
+
],
|
|
603
614
|
question: RESEARCH_FIRST_TURN_PROMPT,
|
|
604
615
|
createWorkspace: createResearchWorkspace,
|
|
605
616
|
addToWorkspace: addResearchExample,
|
|
@@ -607,56 +618,121 @@ export const COOKBOOKS = {
|
|
|
607
618
|
concierge: {
|
|
608
619
|
id: 'concierge',
|
|
609
620
|
kind: 'agent',
|
|
621
|
+
verb: 'travel from the facts',
|
|
610
622
|
label: 'Travel concierge',
|
|
611
|
-
description: '
|
|
623
|
+
description: 'Hand it a destination, a ticket, or a photo of your boarding pass. It checks weather, places, and currency before it plans — and never invents a forecast.',
|
|
624
|
+
tags: {
|
|
625
|
+
includes: ['text', 'http-tools', 'mcp-tools', 'function-tools', 'guardrails'],
|
|
626
|
+
},
|
|
627
|
+
teaches: [
|
|
628
|
+
'A text agent that takes attachments (images, PDF, text) and optional voice, then grounds weather, places, and currency in tools before it answers.',
|
|
629
|
+
'A turn-time tool loader (`t2Loader: discover_tools`) that can pull in extra demo tools during the turn.',
|
|
630
|
+
'Mixing HTTP tools (geocode, weather, currency, Wikipedia), MCP (`search_web`), and local function tools (distances, day plan, packing, budget).',
|
|
631
|
+
'Silent tool use in the system prompt: no narrating tool names; findings land in the reply.',
|
|
632
|
+
'Reply-side detect set to block sensitive and injection phrasing, with `allowedHosts` for the travel hosts.',
|
|
633
|
+
],
|
|
612
634
|
createWorkspace: workspaceOf(createExampleDraft),
|
|
613
635
|
addToWorkspace: addsDraft(createExampleDraft),
|
|
614
636
|
},
|
|
615
637
|
architect: {
|
|
616
638
|
id: 'architect',
|
|
617
639
|
kind: 'system',
|
|
640
|
+
verb: 'advise from the repo',
|
|
618
641
|
label: 'Code architect',
|
|
619
|
-
description: '
|
|
642
|
+
description: 'Point it at a repository or a library. It reads the docs and the code before it advises, then can send a Narrator to record a short spoken briefing of what it found.',
|
|
643
|
+
tags: {
|
|
644
|
+
includes: ['text', 'speech', 'http-tools', 'mcp-tools', 'agent-tools', 'guardrails'],
|
|
645
|
+
},
|
|
646
|
+
teaches: [
|
|
647
|
+
'A multi-agent system: text agent `code.architect` plus speech agent `studio.narrator`.',
|
|
648
|
+
'An agent tool (`narrate`) that lets the architect call the narrator and get audio back.',
|
|
649
|
+
'Grounding advice in repo and package tools before answering (`ask_repo_docs`, `read_repo_file`, `lookup_package`, Context7 `find_library` / `read_library_docs`).',
|
|
650
|
+
'Vendor docs over MCP (Microsoft, Cloudflare, AWS, Hugging Face, Astro) alongside web search.',
|
|
651
|
+
'A speech profile with a fixed spoken style for briefings.',
|
|
652
|
+
],
|
|
620
653
|
createWorkspace: createArchitectWorkspace,
|
|
621
654
|
addToWorkspace: addArchitectExample,
|
|
622
655
|
},
|
|
623
656
|
'live-concierge': {
|
|
624
657
|
id: 'live-concierge',
|
|
625
658
|
kind: 'agent',
|
|
659
|
+
verb: 'travel on the call',
|
|
626
660
|
label: 'Live concierge',
|
|
627
|
-
description: 'The concierge
|
|
661
|
+
description: 'The same concierge, on a voice call. It still grounds weather, places, and money in the tools — it just answers out loud, in short sentences.',
|
|
662
|
+
tags: {
|
|
663
|
+
includes: ['live', 'http-tools', 'mcp-tools', 'function-tools', 'guardrails'],
|
|
664
|
+
},
|
|
665
|
+
teaches: [
|
|
666
|
+
'The travel concierge tools on a `live` profile instead of text.',
|
|
667
|
+
'Spoken replies: short sentences, no markdown lists, still grounded in the same weather / places / currency tools.',
|
|
668
|
+
],
|
|
628
669
|
createWorkspace: workspaceOf(createLiveExampleDraft),
|
|
629
670
|
addToWorkspace: addsDraft(createLiveExampleDraft),
|
|
630
671
|
},
|
|
631
672
|
decision: {
|
|
632
673
|
id: 'decision',
|
|
633
674
|
kind: 'agent',
|
|
675
|
+
verb: 'ask the photograph',
|
|
634
676
|
label: 'Pantry',
|
|
635
|
-
description: 'Jev
|
|
677
|
+
description: 'Show Jev a pantry shelf. It draws boxes around what it finds and answers brunch questions from what is actually there — not from what it remembers.',
|
|
678
|
+
tags: {
|
|
679
|
+
includes: ['decision', 'guardrails'],
|
|
680
|
+
},
|
|
681
|
+
teaches: [
|
|
682
|
+
'A `decision` profile on TypeSafe Jev 1.14 with `images: true`.',
|
|
683
|
+
'Question kinds in one contract (`pantry.v1`): `box`, `noul`, and `choice`.',
|
|
684
|
+
'State image `photo` (the shelf) plus decision-owned reference images (`<ginger>`, `<apple_ripeness>`, `<union_jack>`) named from questions.',
|
|
685
|
+
'Box questions that locate things in `photo` or on a reference chart; choice for brunch from what is on the shelf.',
|
|
686
|
+
],
|
|
636
687
|
createWorkspace: workspaceOf(createDecisionExampleDraft),
|
|
637
688
|
addToWorkspace: addsDraft(createDecisionExampleDraft),
|
|
638
689
|
},
|
|
639
690
|
'gemini-embedding-2': {
|
|
640
691
|
id: 'gemini-embedding-2',
|
|
641
692
|
kind: 'agent',
|
|
693
|
+
verb: 'embed what you see',
|
|
642
694
|
label: 'Gemini Embeddings 2',
|
|
643
|
-
description: '
|
|
695
|
+
description: 'Drop in text, images, or files. Gemini Embeddings 2 turns them into vectors you can search and compare — multimodal, on the free preview.',
|
|
696
|
+
tags: {
|
|
697
|
+
includes: ['embedding'],
|
|
698
|
+
},
|
|
699
|
+
teaches: [
|
|
700
|
+
'An `embedding` profile on Gemini Embeddings 2 preview.',
|
|
701
|
+
'Multimodal inputs: every media kind that model accepts, capped at six files.',
|
|
702
|
+
'Output dimensionality set on the binding (`outputDimensionality: 768`).',
|
|
703
|
+
],
|
|
644
704
|
createWorkspace: workspaceOf(createGeminiEmbeddingExampleDraft),
|
|
645
705
|
addToWorkspace: addsDraft(createGeminiEmbeddingExampleDraft),
|
|
646
706
|
},
|
|
647
707
|
narrator: {
|
|
648
708
|
id: 'narrator',
|
|
649
709
|
kind: 'agent',
|
|
710
|
+
verb: 'hear the briefing',
|
|
650
711
|
label: 'Narrator',
|
|
651
|
-
description: '
|
|
712
|
+
description: 'Give it a short script in plain sentences. It reads the briefing aloud — warm, unhurried, as if it were speaking to one listener.',
|
|
713
|
+
tags: {
|
|
714
|
+
includes: ['speech', 'guardrails'],
|
|
715
|
+
},
|
|
716
|
+
teaches: [
|
|
717
|
+
'A standalone `speech` profile with guardrails included.',
|
|
718
|
+
'A fixed speech style string for how the briefing should sound.',
|
|
719
|
+
],
|
|
652
720
|
createWorkspace: workspaceOf(createNarratorExampleDraft),
|
|
653
721
|
addToWorkspace: addsDraft(createNarratorExampleDraft),
|
|
654
722
|
},
|
|
655
723
|
console: {
|
|
656
724
|
id: 'console',
|
|
657
725
|
kind: 'agent',
|
|
726
|
+
verb: 'tools, no model',
|
|
658
727
|
label: 'Tool console',
|
|
659
|
-
description: 'No model.
|
|
728
|
+
description: 'No language model in the loop. Press a tool, watch the result — HTTP, MCP, and functions side by side, for when you want the wiring without the chat.',
|
|
729
|
+
tags: {
|
|
730
|
+
includes: ['host', 'http-tools', 'mcp-tools', 'function-tools'],
|
|
731
|
+
},
|
|
732
|
+
teaches: [
|
|
733
|
+
'A `host` profile with no model — tools only.',
|
|
734
|
+
'A small set of demo tools spanning HTTP and other result shapes, run by hand from the console.',
|
|
735
|
+
],
|
|
660
736
|
createWorkspace: workspaceOf(createConsoleExampleDraft),
|
|
661
737
|
addToWorkspace: addsDraft(createConsoleExampleDraft),
|
|
662
738
|
},
|
package/cookbooks/mod.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { CookbookEntry, CookbookId, } from './catalog.ts';
|
|
1
|
+
export type { CookbookEntry, CookbookId, CookbookIncludeTag, CookbookTags, } from './catalog.ts';
|
|
2
2
|
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOKS, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace, DECISION_EXAMPLE_AGENT_ID, DECISION_EXAMPLE_STATE, DEMO_ARCHITECT_SYSTEM, DEMO_CONCIERGE_SYSTEM, DEMO_LIVE_CONCIERGE_SYSTEM, DEMO_RESEARCH_SYSTEM, decisionExampleAssets, decisionExampleDraft, exampleTools, RESEARCH_FIRST_TURN_PROMPT, RESEARCH_PAGE_READER_AGENT_ID, RESEARCH_PAGE_READER_STATE, RESEARCH_REPLY_SCHEMA_ID, RESEARCH_REPLY_SCHEMA_JSON, } from './catalog.ts';
|
|
3
3
|
export { cookbookOpening, cookbookTraceRecords } from './exchanges.ts';
|
|
4
4
|
export type { ProfileSliceOptions, StitchRecipe, ToolSliceField, ToolSliceOptions, } from './project.ts';
|
package/draft.d.ts
CHANGED
|
@@ -374,6 +374,8 @@ export interface DecisionDraft {
|
|
|
374
374
|
/** `null` is the studio's most. */
|
|
375
375
|
maxStateBytes: number | null;
|
|
376
376
|
questions: DecisionQuestionDraft[];
|
|
377
|
+
/** The application builds the questions for each decision, with the builder the setup's `questions` names. The draft holds none. */
|
|
378
|
+
questionsBuilt?: true;
|
|
377
379
|
images: DecisionImageDraft[];
|
|
378
380
|
}
|
|
379
381
|
/** Wording the author replaced, by labels key; a key left out keeps the kernel's line. */
|
package/mod.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { type StudioAsks, type WriteAsk, writeAsk, writeAskLine } from './asks.t
|
|
|
2
2
|
export { KNOWN_GEMINI_EMBEDDING_MODELS, KNOWN_OPENROUTER_EMBEDDING_MODELS, } from './browser-connection.ts';
|
|
3
3
|
export { type CompiledStudio, compileStudio, credentialHeaderProblem, credentialUrlProblem, type StudioCompileResult, type StudioIssue, type StudioProfileDefinition, type StudioTurnProfileDefinition, } from './compile.ts';
|
|
4
4
|
export { type CompiledWorkspace, compileWorkspace, type WorkspaceCompileResult, workspaceRunAgent, } from './compile-workspace.ts';
|
|
5
|
-
export type { CookbookEntry, CookbookId, GoogleBindingViolation, GoogleFreeTierGrounding, GoogleImageAspectRatio, GoogleImageInputMime, GoogleImageOutputMime, GoogleImagePins, GoogleImageResolution, GoogleLivePins, GoogleSpeechPins, GoogleSpeechVoice, GoogleThinkingLevel, GoogleVoiceInputMime, LocalBindingViolation, ProfileSliceOptions, StitchRecipe, ToolSliceField, ToolSliceOptions, } from './cookbooks/mod.ts';
|
|
5
|
+
export type { CookbookEntry, CookbookId, CookbookIncludeTag, CookbookTags, GoogleBindingViolation, GoogleFreeTierGrounding, GoogleImageAspectRatio, GoogleImageInputMime, GoogleImageOutputMime, GoogleImagePins, GoogleImageResolution, GoogleLivePins, GoogleSpeechPins, GoogleSpeechVoice, GoogleThinkingLevel, GoogleVoiceInputMime, LocalBindingViolation, ProfileSliceOptions, StitchRecipe, ToolSliceField, ToolSliceOptions, } from './cookbooks/mod.ts';
|
|
6
6
|
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOK_TOOL_HANDLERS, COOKBOOKS, cookbookOpening, cookbookTraceRecords, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace, DECISION_EXAMPLE_AGENT_ID, DECISION_EXAMPLE_STATE, DEMO_ALLOWED_HOSTS, DEMO_ARCHITECT_SYSTEM, DEMO_ARCHITECT_TOOLS, DEMO_CONCIERGE_SYSTEM, DEMO_CONCIERGE_TOOLS, DEMO_CONSOLE_TOOLS, DEMO_HTTP_SAMPLE_INPUT, DEMO_LIVE_CONCIERGE_SYSTEM, DEMO_RESEARCH_STAGE_READ_TOOLS, DEMO_RESEARCH_SYSTEM, DEMO_RESEARCH_TOOLS, DISCOVER_LOADED, decisionExampleAssets, decisionExampleDraft, demoHttpSampleInput, demoInputsSpec, demoToolSpecs, exampleTools, GEMINI_MODELS_URL, GOOGLE_BUILTIN_TOOLS, GOOGLE_FREE_TIER_GROUNDING, GOOGLE_IMAGE_ASPECT_RATIOS, GOOGLE_IMAGE_INPUT_MIMES, GOOGLE_IMAGE_OUTPUT_MIMES, GOOGLE_IMAGE_RESOLUTIONS, GOOGLE_NO_EFFORT_API_IDS, GOOGLE_NO_THINKING_API_IDS, GOOGLE_SINGLE_TURN_API_IDS, GOOGLE_SPEECH_FORMATS, GOOGLE_SPEECH_VOICES, GOOGLE_THINKING_LEVELS, GOOGLE_THINKING_REQUIRED_API_IDS, GOOGLE_VOICE_INPUT_MIMES, googleBindingViolation, googleEfforts, googleFreeTierBuiltins, localBindingViolation, OPENROUTER_BUILTIN_TOOLS, OPENROUTER_IMAGES_IGNORED_INPUTS, OPENROUTER_IMAGES_INPUT_MIMES, ollamaModelThinks, projectProfileSlice, projectToolSlice, RESEARCH_ALLOWED_HOSTS, RESEARCH_FIRST_TURN_PROMPT, RESEARCH_PAGE_READER_AGENT_ID, RESEARCH_PAGE_READER_STATE, RESEARCH_REPLY_SCHEMA_ID, RESEARCH_REPLY_SCHEMA_JSON, resolveCookbookSlice, stitchCookbook, } from './cookbooks/mod.ts';
|
|
7
7
|
export { agentToolTarget, COMPACTION_DRAFT_DEFAULTS, createBlankDraft, type DecisionCriterionDraft, type DecisionDraft, type DecisionImageDraft, type DecisionQuestionDraft, type DecisionQuestionType, defaultModelBinding, defaultToolSpec, draftAllows, draftFacets, draftKey, type EffortDraft, EXAMPLE_DECISION_STATE, EXAMPLE_EMBEDDING_QUERY, EXAMPLE_EMBEDDING_TEXT, EXAMPLE_SPAN_DECISION_STATE, exampleDecisionDraft, excludeFacet, type GuardrailsDraft, type IdentityDraft, type ImageDraft, type ImageReferenceDraft, INLINE_LABELS, type InputsDraft, type ItemRuleOnFail, includableFacets, includeFacet, type LabelsDraft, type LiveDraft, MODEL_LIMITS, type ModelBindingDraft, type ModelsDraft, newCriteria, newDecisionImage, newDecisionQuestion, newModelBinding, newOwnDetector, newPattern, newSlot, newSlotChoice, newToolSpec, type ObservabilityDraft, type OutputsDraft, type OwnDetectorDraft, type PatternDraft, type PatternSourceDraft, plantsCanary, removeModelBinding, type SlotChoiceDraft, type SlotDraft, type SpeechDraft, STUDIO_PROFILE_TYPES, type StudioDraft, type StudioProfileType, type StudioTurnProfileType, setProfileType, TIMER_MAX_MS, type ToolSpecDraft, type ToolsDraft, type TurnBehaviourDraft, takesContinueInstruction, updateModelBinding, } from './draft.ts';
|
|
8
8
|
export { EXAMPLE_EMBEDDING_FILES } from './example-embedding-files.ts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/studio",
|
|
3
|
-
"version": "0.3.4-next.
|
|
3
|
+
"version": "0.3.4-next.554.g84e62b0",
|
|
4
4
|
"description": "Theorem Studio: open a project's agents in a local studio on Deno, edit and run them, and save back to its files; or show the studio screen in a Vite app.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"zod": "^4.6.5",
|
|
80
|
-
"@theoremjs/agents": "0.3.4-next.
|
|
81
|
-
"@theoremjs/web": "0.3.4-next.
|
|
82
|
-
"@theoremjs/react": "0.3.4-next.
|
|
80
|
+
"@theoremjs/agents": "0.3.4-next.554.g84e62b0",
|
|
81
|
+
"@theoremjs/web": "0.3.4-next.554.g84e62b0",
|
|
82
|
+
"@theoremjs/react": "0.3.4-next.554.g84e62b0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
85
85
|
"@theoremjs/react": {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TraceInspector-CSlGFNuh.js","assets/rolldown-runtime-hePW80VL.js","assets/themeProps-3IqahpCr.js","assets/tokens.stylex-DkHf0P9C.js","assets/SegmentedControlItem-BBGRPrxp.js","assets/padding.stylex-B76907Zf.js","assets/VStack-CkVMcNiK.js","assets/mergeProps-ptS-gIMz.js","assets/StackItem-CQviqAfM.js","assets/useLayerDismissal-BAnTRYTt.js","assets/fieldParts-B7DYLgh4.js","assets/Icon-BqkS-pIq.js","assets/devWarning-DxuplmRl.js","assets/Text-BOqCfzZC.js","assets/sharedResizeObserver-4U9Xq5Oq.js","assets/preload-helper-DpV6A1kQ.js","assets/useMediaQuery-BCT0NUeZ.js","assets/useResolvedRequired-DbsOcDqy.js","assets/useAnnounce-DTSHZvjg.js","assets/Tooltip-BWs5DLrM.js","assets/useTooltip-c097gL_-.js","assets/focusOutline.stylex-BT0kfa4t.js","assets/IconButton-DVUFx-8p.js","assets/focusableSelector-DXZeMU85.js","assets/useDevWarning-Z9SoixOP.js","assets/createReactComponent-CZwsv6DD.js","assets/isRtlElement-BG33-k_H.js","assets/plainDate-BHiJcj7o.js","assets/DateInput-B1ICJtHn.js","assets/focusReturn-CTppP2k0.js","assets/Card-DruykyeB.js","assets/container.stylex-BmOi-8DQ.js","assets/ScrollableArea-BHfY7sWH.js","assets/useScrollableArea-DuF_pz9m.js","assets/chainEventHandlers-C6ttXGfW.js","assets/BottomSheet-Dbh6A5Vl.js","assets/useScrollLock-Dyf6PHJt.js","assets/use-trace-records-B1vrKQmA.js","assets/CheckboxInput-CFZ_Wq8-.js","assets/isRenderable-DHkzpAoQ.js","assets/IconAlertTriangle-BqAEqqdU.js","assets/arrive-DvbqpeRS.js","assets/IconShield-DDOh7Gr5.js","assets/shaped-data-AVV4e7rW.js","assets/host-patterns-F-KZIzkF.js","assets/trace-record-Dtrz7WQ7.js","assets/TraceOverview-Ck6C_Ez_.js","assets/labels-provider-DkA22zkP.js","assets/CodeBlock-CfVOtDeO.js","assets/useClipboard-CbN9bb4J.js","assets/index-CM9UyI8f.js","assets/browser-transport-Dap3OD5q.js","assets/Center-nHS1JSux.js","assets/IconSearch-BTx66a40.js","assets/schemas-BQ9Jydzb.js","assets/tool-schema-DCF2M0n_.js","assets/reader-BJZH_Cmn.js","assets/live-ingress-OuSlQ6q7.js","assets/trace-schema-9CdEyG6Q.js","assets/stub-BMUhx6B5.js","assets/tree-Cy9xwG_l.js","assets/types-CB42MysU.js","assets/useContainerReveal-BFy8N_QU.js","assets/Dialog-Sd04KQS2.js","assets/HoverCard-DMyWUvwP.js","assets/IconEye-BB5aY-wQ.js","assets/studio-labels-dSptB7mq.js","assets/turn-client-mCvAwEgO.js","assets/encode-files-BCf3-Q7y.js","assets/CollapsibleGroup-FIawJRo4.js","assets/crypto-CrMpJY2D.js","assets/workspace-BFrc6kx2.js","assets/lent-keys-C32ems-I.js","assets/editors-BJX_S59A.js","assets/studio-session-yEqFQo5o.js","assets/EmptyState-C_uF9Wyj.js","assets/use-second-ticker-DhbZ0Soz.js","assets/use-second-ticker-GWBt83pd.css","assets/ContextMenu-XBM6rqqH.js","assets/MenuBottomSheetActionList-3L0HS4Kf.js","assets/useMenuPress-DLG1QOiE.js","assets/ListItem-QF7KFt0h.js","assets/useAdaptivePresentation-Bma4-u1a.js","assets/useFocusReturnVisibility-BHKv5Jwr.js","assets/index-C9rhrCGT.css","assets/trace-patterns-D6TbkLLr.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{h as a}from"./tokens.stylex-DkHf0P9C.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{x as s}from"./fieldParts-B7DYLgh4.js";import{t as c}from"./isRenderable-DHkzpAoQ.js";import{t as l,x as u}from"./Icon-BqkS-pIq.js";import{b as d,d as f,f as p,g as m,h,l as g,n as _,p as v,t as y,u as b}from"./use-trace-records-B1vrKQmA.js";import{t as x}from"./preload-helper-DpV6A1kQ.js";import{n as S,t as C}from"./labels-provider-DkA22zkP.js";import{c as w,n as T,t as E}from"./IconButton-DVUFx-8p.js";import{t as D}from"./createReactComponent-CZwsv6DD.js";import{a as O}from"./ScrollableArea-BHfY7sWH.js";var k=D(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]),A=D(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),j=D(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),M=e(i(),1),N=t(),P=(0,M.lazy)(()=>x(()=>import(`./TraceInspector-CSlGFNuh.js`).then(e=>({default:e.TraceGuardrailsBody})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]))),F=(0,M.lazy)(()=>x(()=>import(`./TraceInspector-CSlGFNuh.js`).then(e=>({default:e.TraceFeedBody})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]))),I=(0,M.createContext)(`replace`);function L({value:e,children:t}){return(0,N.jsx)(I,{value:e,children:t})}function R({id:e,header:t,traces:n}){return(0,N.jsx)(g,{id:e,header:t,children:e=>(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(F,{traces:n,isWide:e})})})}function z(e,t,n){let r=S(),i=(0,M.useId)(),[a,o]=(0,M.useState)(!1),s=(0,M.use)(I),c={name:r(`@theorem.panel.trace.name`),show:r(`@theorem.panel.trace.show`),hide:r(`@theorem.panel.trace.hide`),resize:r(`@theorem.panel.trace.resize`)};if(e.observability?.record!==!0)return{toggle:null,view:null,labels:c,offered:!1};let u=n??a,d=n===void 0?(0,N.jsx)(p,{labels:c,icon:(0,N.jsx)(l,{icon:O}),panelId:i,open:u,onToggle:()=>o(e=>!e)}):null;return{toggle:d,view:u?B(s===`panel`,i,t,d):null,labels:c,offered:!0}}function B(e,t,n,r){let i=(0,N.jsxs)(f,{floating:!0,children:[(0,N.jsx)(U,{traces:n}),r]});return e?(0,N.jsx)(V,{id:t,header:i,traces:n}):(0,N.jsx)(R,{id:t,header:i,traces:n})}function V({id:e,header:t,traces:n}){let{ref:r,width:i}=m();return(0,N.jsxs)(`div`,{id:e,ref:r,style:{height:`100%`,position:`relative`},children:[t,(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(F,{traces:n,isWide:v(i)})})]})}function H(e){for(let t of e)for(let e of t.spans){let t=e.attributes[`gen_ai.agent.name`];if(typeof t==`string`&&t)return t}return`trace`}function U({traces:e}){let t=S(),n=y(e);if(n.length===0)return null;let r=t(`@theorem.panel.trace.download`);return(0,N.jsx)(E,{label:r,variant:`ghost`,tooltip:r,icon:(0,N.jsx)(l,{icon:j,size:`sm`}),onClick:()=>{let e=new Date().toISOString().replaceAll(`:`,`-`).slice(0,19),t=new Blob([JSON.stringify(n,null,2)],{type:`application/json`}),r=URL.createObjectURL(t),i=document.createElement(`a`);i.href=r,i.download=`${H(n)}-${e}.trace.json`,i.click(),URL.revokeObjectURL(r)}})}function W({inspector:e,children:t}){let n=(0,M.useRef)(null),r=h(n,!1),i=(0,M.useRef)(void 0),a=(0,M.useCallback)(e=>{n.current=e;let t=i.current;typeof t==`function`?t(e):t!=null&&(t.current=e)},[]);if(!(0,M.isValidElement)(t))return(0,N.jsx)(_,{view:e.view,children:t});i.current=t.props.ref;let o=e.view!=null;return(0,M.cloneElement)(t,{ref:a,end:(0,N.jsx)(b,{labels:e.labels,resizable:r.resizable,open:o,children:e.view})})}function G({inspector:e,children:t}){return(0,M.use)(I)===`panel`&&e.offered?(0,N.jsx)(W,{inspector:e,children:t}):(0,N.jsx)(_,{view:e.view,children:t})}function K({records:e,head:t}){return(0,N.jsx)(C,{children:(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(P,{records:e,head:t})})})}var q={info:`info`,warning:`warning`,error:`error`,success:`success`},ee={info:`accent`,warning:`warning`,error:`error`,success:`success`},J={root:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kMv6JI:`xjb2p0i`,$$css:!0},rootElevatedCard:{kaIpWk:`x1vf2byn`,$$css:!0},header:{k1xSpc:`x78zum5`,kGNEyG:`x1cy8zhl`,kwnvtZ:`x1a02dak`,k1C7PZ:`xak3so`,khm7nJ:`x4olc9o`,k8WAf4:`x8o8v82`,kg3NbH:`x1pzlopt`,$$css:!0},headerCardStandalone:{kaIpWk:`x1vf2byn`,$$css:!0},headerCardWithContent:{krdFHd:`xwxb7qi`,kfmiAY:`x13nour3`,kVL7Gh:`xbiv7yw`,kT0f0o:`x16uus16`,$$css:!0},headerCentered:{kGNEyG:`x6s0dn4`,$$css:!0},endArea:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kwnvtZ:`x1a02dak`,kjj79g:`x13a6bvl`,kOIVth:`x1txdalj`,kmuXW:`x2lah0s`,ks0D6T:`x193iq5w`,keTefX:`xvc5jky`,kqGvvJ:`x81ka23`,$$css:!0},chevron:{k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},chevronExpanded:{k3aq6I:`x19jd1h0`,$$css:!0}},Y={info:{kWkggS:`xgcxg3y`,$$css:!0},warning:{kWkggS:`x24i8r5`,$$css:!0},error:{kWkggS:`x1pritpl`,$$css:!0},success:{kWkggS:`xu13z74`,$$css:!0}};function te(e){return Object.prototype.hasOwnProperty.call(Y,e)}var ne={none:{kGVxlE:`x1gnnqk1`,$$css:!0},low:{kGVxlE:`x1i5ehqx`,$$css:!0},med:{kGVxlE:`x14hfi27`,$$css:!0},high:{kGVxlE:`x1kcpxr7`,$$css:!0}};function X({status:e,title:t,description:i,icon:f,isDismissable:p=!1,onDismiss:m,dismissLabel:h,endContent:g,container:_=`card`,elevation:v=`none`,collapsible:y=!0,children:b,xstyle:x,className:S,style:C,ref:E,onFocusCapture:D,onPointerDownCapture:O,...k}){let A=u(),[j,P]=(0,M.useState)(!1),F=typeof y==`object`&&y?y:{},{isEnabled:I,isOpen:L,toggle:R}=d({isCollapsible:y!==!1&&{...F,defaultIsOpen:F.defaultIsOpen??!1}}),z=(0,M.useRef)(null),B=(0,M.useId)(),V=q[e],H=ee[e],U=c(b),W=A(`@astryx.banner.dismiss`),G=h??W,K=h??(typeof t==`string`?A(`@astryx.banner.dismissTitled`,{dismiss:W,title:t}):W);if(j)return null;let X=(e,t)=>{e instanceof HTMLElement&&e!==document.body&&!t.contains(e)&&(z.current=e)},re=e=>{X(e.relatedTarget,e.currentTarget)},ie=e=>{X(document.activeElement,e.currentTarget)},ae=()=>{let e=z.current;P(!0),m?.(),e?.isConnected&&e.focus()},Z=I&&U,oe=c(g)||p||Z,se=c(g)||p,ce=!c(i)&&se,Q=U&&(!I||L),$=_===`card`;return(0,N.jsxs)(`div`,{ref:E,onFocusCapture:s(D,re),onPointerDownCapture:s(O,ie),...o(r(`banner-frame`,{container:_,elevation:v}),n(J.root,ne[v],$&&v!==`none`&&J.rootElevatedCard,x),S,C),...k,children:[(0,N.jsxs)(`div`,{...o(r(`banner`,{container:_,status:e}),n(J.header,ce&&J.headerCentered,te(e)&&Y[e],$&&(Q?J.headerCardWithContent:J.headerCardStandalone))),children:[(0,N.jsx)(`div`,{...c(f)?o(r(`banner-icon`,{status:e}),{className:`x78zum5 x6s0dn4 x2lah0s`}):{className:`x78zum5 x6s0dn4 x2lah0s`},"aria-hidden":`true`,children:c(f)?f:V==null?null:(0,N.jsx)(l,{icon:V,size:`md`,color:H,...r(`banner-icon`,{status:e})})}),(0,N.jsxs)(`div`,{...{0:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli`},1:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli xgualba`}}[!!c(g)|0],children:[(0,N.jsx)(`div`,{className:`x1ghz6dp xjb2p0i xcr08ib x2mo6ok x1kq96og x1tgivj0 xj0a0fe`,children:t}),c(i)&&(0,N.jsx)(`div`,{...o(r(`banner-description`),{className:`x1ghz6dp xjb2p0i x141an7d x1sodnla x1ltkj2j xv1l7n4 xj0a0fe`}),children:i})]}),oe&&(0,N.jsxs)(`div`,{...n(J.endArea,w.inset(a[`--spacing-2`])),children:[g,Z&&(0,N.jsx)(T,{variant:`ghost`,size:`sm`,label:A(L?`@astryx.banner.collapse`:`@astryx.banner.expand`),tooltip:A(L?`@astryx.banner.collapse`:`@astryx.banner.expand`),icon:(0,N.jsx)(l,{icon:`chevronDown`,size:`sm`,color:`inherit`,xstyle:[J.chevron,L&&J.chevronExpanded]}),onClick:R,"aria-expanded":L,"aria-controls":Q?B:void 0,isIconOnly:!0}),p&&(0,N.jsx)(T,{variant:`ghost`,size:`sm`,label:K,tooltip:G,icon:(0,N.jsx)(l,{icon:`close`,size:`sm`,color:`inherit`}),onClick:ae,isIconOnly:!0})]})]}),Q&&(0,N.jsx)(`div`,{id:Z?B:void 0,...o(r(`banner-content`,{container:_,status:e}),{0:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh`},1:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh x1k5g1gk x1eprgri`}}[!!$|0]),children:b})]})}X.displayName=`Banner`;export{z as a,G as i,K as n,A as o,L as r,k as s,X as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{c as n,l as r,n as i,u as a}from"./themeProps-3IqahpCr.js";import{h as o}from"./tokens.stylex-DkHf0P9C.js";import{_ as s,a as c,c as l,h as u,n as d,t as f,v as p}from"./padding.stylex-B76907Zf.js";import{t as m}from"./mergeProps-ptS-gIMz.js";import{a as h,c as g,i as ee,n as te,t as ne}from"./useLayerDismissal-BAnTRYTt.js";import{t as re}from"./focusReturn-CTppP2k0.js";import{i as _}from"./focusOutline.stylex-BT0kfa4t.js";import{t as v}from"./useMediaQuery-BCT0NUeZ.js";import{t as y}from"./useScrollLock-Dyf6PHJt.js";import{t as b}from"./useDevWarning-Z9SoixOP.js";import{t as x}from"./useScrollableArea-DuF_pz9m.js";import{t as S}from"./container.stylex-BmOi-8DQ.js";var C=t(a(),1),w=/^(\d+(?:\.\d+)?|\.\d+)(px|%)$/i;function T(e,t){if(typeof e==`number`)return Number.isFinite(e)&&e>0&&e<=1?e*t:null;let n=w.exec(e.trim());if(n===null)return null;let r=Number.parseFloat(n[1]);return r>0?n[2].toLowerCase()===`%`?r/100*t:r:null}function E(e){return T(e,1)!==null}function ie(e,t){let n=[];for(let r of e){let e=T(r,t);e!==null&&n.push(e)}return n}function ae(e,t,n=48){let r=[0,...t.filter(t=>t>0&&t<e).map(t=>e-t)].sort((e,t)=>e-t),i=[];for(let e of r){let t=i[i.length-1];(t===void 0||e-t>=n)&&i.push(e)}return i}function D(e,t){return t.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t,t[0])}var O=.3;function k(e,t){if(e.length<2||t<=0)return null;let n=e[e.length-1];return t-n<=.25*t?n:null}function A(e,t,n,r){let i=r!==null,a=i?t[t.length-2]:t[t.length-1],o=i?r:n,s=i?O:0;return e<=a?1:e>=o?s:1-(1-s)*((e-a)/(o-a))}function oe(e,t,n,r){let i=t;if(n>0){let e=t.filter(e=>e>=r);e.length>0&&(i=e)}else if(n<0){let e=t.filter(e=>e<=r);e.length>0&&(i=e)}return D(e,i)}var j=`--_sheet-keyboard-inset`,se=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]);function M(){return window.visualViewport?.height??window.innerHeight}function N(){return M()>=window.innerHeight-.5}function P(){let e=window.navigator.userAgent;return/iPad|iPhone|iPod/.test(e)||e.includes(`Macintosh`)&&window.navigator.maxTouchPoints>1}function F(e){return e instanceof HTMLTextAreaElement?!e.disabled&&!e.readOnly:e instanceof HTMLInputElement?!e.disabled&&!e.readOnly&&!se.has((e.getAttribute(`type`)??`text`).toLowerCase()):e instanceof HTMLElement&&e.matches(`[contenteditable]:not([contenteditable="false"])`)}function I(e,t){if(!(e instanceof Element))return null;let n=e.closest(`input, textarea, [contenteditable]:not([contenteditable="false"])`);if(t.contains(n)&&F(n))return n;let r=e.closest(`label`),i=r instanceof HTMLLabelElement?r.control:null;return t.contains(i)&&F(i)?i:null}function ce({bodyRef:e,bottomClearance:t,isEnabled:n,isFullyExpanded:r,isPageScrollLocked:i,isSheetTraveling:a,isOpen:o,isPresented:s,sheetRef:c}){let l=(0,C.useRef)(!1),u=(0,C.useRef)(!1),d=(0,C.useRef)(r),f=(0,C.useRef)(o);d.current=r,f.current=o,(0,C.useEffect)(()=>{if(!n||!a)return;let e=c.current,t=document.activeElement;e&&t instanceof HTMLElement&&t!==e&&e.contains(t)&&(u.current=l.current,e.focus({preventScroll:!0}))},[n,a,c]),(0,C.useEffect)(()=>{if(!n||!s||o)return;let e=c.current,t=document.activeElement;e&&t instanceof HTMLElement&&t!==e&&e.contains(t)&&(u.current=l.current,t.blur())},[n,o,s,c]),(0,C.useEffect)(()=>{let r=e.current,a=c.current;if(!n||!s||!r)return;let o=null,p=null,m=P(),h=()=>{r.style.setProperty(j,`0px`),o=null,p=null,l.current=!1,u.current=!1},g=(e,t)=>{if(typeof r.scrollBy!=`function`){r.scrollTop+=e;return}let n=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;r.scrollBy({top:e,behavior:t&&!n?`smooth`:`instant`})},ee=(e,n)=>{let i=r.getBoundingClientRect(),a=e.getBoundingClientRect(),o=M(),s=Math.max(0,i.bottom-o)>0?t:0,c=i.top,l=Math.min(i.bottom,o-s);l<=c||(a.bottom>l?g(a.bottom-l,n):a.top<c&&g(a.top-c,n))},te=e=>{let n=M();if(N()||Math.max(0,e.bodyBottom-n)===0){h();return}let i=Math.max(0,e.bodyBottom-(n-t));r.style.setProperty(j,`${i}px`)},ne=e=>{if(!d.current)return;let t=I(e.relatedTarget,r);if(t){t!==document.activeElement&&t.focus({preventScroll:!0});return}let n=I(e.target,r);f.current&&n&&!e.relatedTarget&&a?.focus({preventScroll:!0})},re=()=>{let e=document.activeElement;if(!d.current||!(e instanceof HTMLElement)||!r.contains(e)||!F(e)){if(u.current&&o){te(o);return}h();return}u.current=!1;let n=r.getBoundingClientRect(),a=M(),s=Math.max(0,n.bottom-a),c=s>0?t:0;o=s>0?{bodyBottom:n.bottom}:null,i&&s>0&&!l.current&&(p={x:window.scrollX,y:window.scrollY}),l.current=s>0;let f=s>0?Math.max(0,n.bottom-(a-c)):0;r.style.setProperty(j,`${f}px`),ee(e,s>0)},_=0,v=()=>{cancelAnimationFrame(_),_=requestAnimationFrame(re)},y=()=>{let e=p;if(e==null||window.scrollX===e.x&&window.scrollY===e.y)return;window.scrollTo(e.x,e.y);let t=document.activeElement;t instanceof HTMLElement&&r.contains(t)&&F(t)&&ee(t,!1)},b=typeof ResizeObserver>`u`?null:new ResizeObserver(v),x=()=>{if(!b)return;b.disconnect();let e=new Set([r]);a&&e.add(a);for(let t of r.children)e.add(t);let t=document.activeElement;if(t instanceof HTMLElement&&r.contains(t))for(let n=t;n&&n!==r;n=n.parentElement)e.add(n);for(let t of e)b.observe(t)},S=typeof MutationObserver>`u`?null:new MutationObserver(e=>{e.every(e=>e.type===`attributes`&&e.target===r)||(x(),v())}),C=()=>{x(),v()},w=()=>{u.current=l.current,v()},T=e=>{e.target===a&&e.propertyName===`transform`&&v()},E=window.visualViewport;return m&&document.addEventListener(`blur`,ne,!0),r.addEventListener(`focusin`,C),r.addEventListener(`focusout`,w),a?.addEventListener(`transitionend`,T),E?.addEventListener(`resize`,v),E?.addEventListener(`scroll`,v),window.addEventListener(`scroll`,y),window.addEventListener(`resize`,v),S?.observe(r,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),x(),v(),()=>{cancelAnimationFrame(_),m&&document.removeEventListener(`blur`,ne,!0),r.removeEventListener(`focusin`,C),r.removeEventListener(`focusout`,w),a?.removeEventListener(`transitionend`,T),E?.removeEventListener(`resize`,v),E?.removeEventListener(`scroll`,v),window.removeEventListener(`scroll`,y),window.removeEventListener(`resize`,v),b?.disconnect(),S?.disconnect(),r.style.removeProperty(j),l.current=!1,u.current=!1}},[e,t,n,i,s,c])}var le=.998/.0020000000000000018,ue=48,de=100,L=.4,fe=40;function R(e){return e.syntheticTouch===!0}var pe=.35,me=4,he=8;function ge(){typeof navigator<`u`&&typeof navigator.vibrate==`function`&&(we()||navigator.vibrate(8))}function _e(e,t){let n=t[0],r=Math.abs(e-n);for(let i of t){let t=Math.abs(e-i);t<r&&(r=t,n=i)}if(r>=fe)return e;let i=r/fe,a=1-i*i;return e+(n-e)*a}function ve(e,t,n){return Math.max(0,e-t-n)}function ye(e){let t=Number.parseFloat(getComputedStyle(e).paddingBlockEnd);return Number.isFinite(t)?t:0}function be(e){if(!e)return 0;let t=ye(e);return Math.max(0,e.scrollHeight-e.clientHeight-t)-e.scrollTop}function z(e){if(e.scrollHeight-e.clientHeight<=1)return!1;let{overflowY:t}=getComputedStyle(e);return t===`auto`||t===`scroll`}function xe(e,t){let n=[];for(let r=e instanceof Element?e:null;r!=null&&r!==t;r=r.parentElement)r instanceof HTMLElement&&z(r)&&n.push(r);return n.push(t),n}function B(e){return e.scrollTop<=0}function V(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-1}function Se(e){return e.every(B)}function Ce(e){return e.every(V)}function H(e,t,n){return Math.max(0,e-n-t)}function we(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Te({isOpen:e,canDismiss:t=!0,offscreenBlockEndInset:n=0,onDismiss:r,snapHeights:i,onSnap:a,onScrimOpacity:o}){let[s,c]=(0,C.useState)(0),[l,u]=(0,C.useState)(0),[d,f]=(0,C.useState)(!1),[p,m]=(0,C.useState)(!1),[h,g]=(0,C.useState)(0),[ee,te]=(0,C.useState)(0),[ne,re]=(0,C.useState)(0),_=(0,C.useRef)(0),y=(0,C.useRef)(0),[b,x]=(0,C.useState)(null),[S,w]=(0,C.useState)(!1),T=(0,C.useRef)(0),E=(0,C.useRef)(null),ie=(0,C.useRef)(null),D=(0,C.useRef)(n);D.current=Math.max(0,n);let O=(0,C.useCallback)(e=>{let t=Math.max(0,e);_.current=t,re(t)},[]),j=(0,C.useCallback)(e=>{let t=Math.max(0,e);Math.abs(t-T.current)>.5&&(T.current=t,te(t))},[]),se=(0,C.useCallback)(()=>{w(!0),E.current=null,x(null);let e=ie.current;ie.current=null,e!=null&&j(e)},[j]),M=(0,C.useCallback)((e,t,n,r,i,a,o)=>{let s=ve(e,n,a);o&&Math.abs(r-t)>.5&&!we()?(ie.current=s,E.current=i,x(i)):(ie.current=null,E.current=null,x(null),w(Math.abs(i-n)>.5),j(s))},[j]),N=(0,C.useRef)(0);d||(N.current=l);let P=(0,C.useRef)(e);P.current=e;let F=(0,C.useRef)(i);F.current=i;let I=(0,C.useRef)(r),ce=(0,C.useRef)(t),fe=(0,C.useRef)(a),z=(0,C.useRef)(o);(0,C.useEffect)(()=>{I.current=r,ce.current=t,fe.current=a,z.current=o});let B=(0,C.useRef)(null),V=(0,C.useRef)(0),Te=(0,C.useRef)(null),U=(0,C.useRef)(null),Ee=(0,C.useRef)(null);(0,C.useLayoutEffect)(()=>{if(!S)return;Te.current?.offsetHeight;let e=requestAnimationFrame(()=>{w(!1)});return()=>cancelAnimationFrame(e)},[S]);let De=(0,C.useCallback)(e=>{e<=0||!P.current||N.current>0||(V.current=e,g(t=>t===e?t:e))},[]),Oe=(0,C.useCallback)(e=>{if(Ee.current?.disconnect(),Ee.current=null,Te.current=e,!e||typeof ResizeObserver>`u`){e&&De(e.getBoundingClientRect().height);return}De(e.getBoundingClientRect().height);let t=new ResizeObserver(e=>{let t=e[0];if(t){let e=t.borderBoxSize?.[0]?.blockSize;De(e??t.target.getBoundingClientRect().height)}});t.observe(e),Ee.current=t},[De]);(0,C.useEffect)(()=>()=>Ee.current?.disconnect(),[]),(0,C.useEffect)(()=>{e&&(c(0),u(0),f(!1),m(!1),w(!1),O(0),y.current=0,T.current=0,E.current=null,ie.current=null,te(0),x(null))},[e,O]);let ke=(0,C.useCallback)(()=>V.current>0?V.current:Te.current?.getBoundingClientRect().height??0,[]),W=(0,C.useCallback)(e=>{let t=H(e,0,D.current),n=ae(t,F.current?.()??[]);return{offsets:n,peekOffset:k(n,t)}},[]),Ae=(0,C.useCallback)(()=>{let e=Te.current;if(!e)return V.current;let t=e.style.height;if(t===``)return e.getBoundingClientRect().height;e.style.height=``;let n=e.getBoundingClientRect().height;return e.style.height=t,n},[]),G=(0,C.useCallback)(()=>{if(!P.current||B.current!=null||E.current!=null)return;let e=Ae();if(e<=0)return;let{offsets:t,peekOffset:n}=W(e),r=Math.min(y.current,t.length-1),i=t[r],a=i===n?0:i,o=_.current;if(e===V.current&&Math.abs(i-N.current)<=.5&&Math.abs(a-o)<=.5)return;V.current=e,g(e),y.current=r,M(o,i,a,i,o,be(U.current),!1),O(a),u(i),fe.current?.(H(e,i,D.current));let s=t[t.length-1],c=H(e,s,D.current);z.current?.(A(i,t,s+c*L,n))},[Ae,M,O,W]);(0,C.useEffect)(()=>{if(e&&typeof window<`u`)return window.addEventListener(`resize`,G),window.addEventListener(`orientationchange`,G),()=>{window.removeEventListener(`resize`,G),window.removeEventListener(`orientationchange`,G)}},[e,G]);let je=(0,C.useRef)(!1);(0,C.useLayoutEffect)(()=>{je.current?G():je.current=!0},[G,i]);let Me=(0,C.useCallback)((e,t)=>{let n=Te.current;if(n==null)return;let r=e-t;n.style.transform=r===0?``:`translateY(${r}px)`},[]),K=(0,C.useCallback)(e=>{let t=B.current;if(t==null)return;B.current=null,e?.hasPointerCapture?.(t.pointerId)&&e.releasePointerCapture(t.pointerId),c(t.baseOffset),f(!1),m(!1),M(t.baseLayoutOffset,t.baseOffset,t.baseLayoutOffset,t.renderedOffset,t.layoutOffset,t.naturalEndGap,!0);let{offsets:n,peekOffset:r}=W(t.height),i=n[n.length-1],a=i+H(t.height,i,D.current)*L;z.current?.(A(t.baseOffset,n,a,r))},[M,W]);(0,C.useEffect)(()=>{let e=()=>K(),t=()=>{document.visibilityState===`hidden`&&K()};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,t)}},[K]);let Ne=(0,C.useCallback)((e,t,n,r,i,a,o,s,c,l)=>{let{offsets:d,peekOffset:f}=W(n),p=d[d.length-1],m=p+H(n,p,D.current)*L,h=i>ue?e+t*le:e,g=e=>{let t=e===f?0:e;M(o,e,t,s,c,l,!0),O(t),y.current=Math.max(0,d.indexOf(e)),u(e),fe.current?.(H(n,e,D.current)),z.current?.(A(e,d,m,f)),e!==a&&ge()};r>0&&h>m?ce.current?(M(o,a,o,o,o,l,!1),I.current()):g(p):g(oe(Math.min(Math.max(h,0),p),d,r,a))},[M,O,W]),q=(0,C.useCallback)((e,t,n)=>{let r=e.currentTarget,i=R(e);i||r.setPointerCapture?.(e.pointerId);let a=n??e.clientY,o=be(U.current),s=_.current;B.current={syntheticTouch:i,pointerId:e.pointerId,startCoord:a,lastCoord:e.clientY,lastTime:e.timeStamp,samples:[{t:e.timeStamp,y:e.clientY}],velocity:0,height:t,baseOffset:l,baseLayoutOffset:s,renderedOffset:l,layoutOffset:s,naturalEndGap:o,hasTraveled:!1},j(ve(s,s,o)),c(l),f(!0)},[l,j]),Pe=(0,C.useCallback)(e=>{e.button===0&&e.isPrimary&&(e.preventDefault(),q(e,ke()))},[q,ke]),Fe=(0,C.useCallback)(e=>{B.current!=null&&(e.preventDefault(),K(e.currentTarget))},[K]),J=(0,C.useCallback)(e=>{B.current?.syntheticTouch||B.current?.pointerId===e.pointerId&&K()},[K]),Y=(0,C.useCallback)(e=>{let t=B.current;if(!t||t.pointerId!==e.pointerId||t.syntheticTouch&&!R(e))return;let n=e.clientY-t.startCoord;if(e.timeStamp-t.lastTime>0){for(t.lastCoord=e.clientY,t.lastTime=e.timeStamp,t.samples.push({t:e.timeStamp,y:e.clientY});t.samples.length>2&&e.timeStamp-t.samples[0].t>de;)t.samples.shift();let n=t.samples[0],r=Math.min(e.timeStamp-n.t,de);t.velocity=r>0?(e.clientY-n.y)/r:0}let{offsets:r,peekOffset:i}=W(t.height),a=t.baseOffset+n,o=r[r.length-1],s;s=a<0?Math.max(-48,a*pe):a>o?a:_e(a,r);let l=s<t.baseOffset?0:t.baseLayoutOffset,u=l!==t.layoutOffset;t.renderedOffset=s,t.layoutOffset=l,N.current=s,Me(s,l),u&&c(s),!t.hasTraveled&&s!==t.baseOffset&&(t.hasTraveled=!0,m(!0)),j(ve(t.baseLayoutOffset,l,t.naturalEndGap));let d=r[r.length-1],f=d+H(t.height,d,D.current)*L;z.current?.(A(s,r,f,i))},[W,j,Me]),Ie=(0,C.useCallback)(e=>{let t=B.current;if(!t||t.pointerId!==e.pointerId||t.syntheticTouch&&!R(e))return;let n=e.currentTarget,r=e.clientY-t.startCoord,i=Math.max(0,t.baseOffset+r),a=r===0?0:r>0?1:-1,o=e.timeStamp-t.lastTime<de?t.velocity:0;B.current=null,t.syntheticTouch||n.releasePointerCapture?.(e.pointerId),f(!1),m(!1),Ne(i,o,t.height||1,a,Math.abs(r),t.baseOffset,t.baseLayoutOffset,t.renderedOffset,t.layoutOffset,t.naturalEndGap)},[Ne]),X=(0,C.useRef)(null),Le=(0,C.useCallback)(e=>{if(e.button!==0||!e.isPrimary)return;let t=xe(e.target,e.currentTarget);Se(t)?X.current={pointerId:e.pointerId,startCoord:e.clientY,scrollers:t}:X.current=null},[]),Z=(0,C.useCallback)(e=>{if(B.current){Y(e);return}let t=X.current;if(!t||t.pointerId!==e.pointerId)return;let n=e.clientY-t.startCoord;n>he&&Se(t.scrollers)?(X.current=null,q(e,ke(),t.startCoord),Y(e)):n<0&&(X.current=null)},[q,Y,ke]),Re=(0,C.useCallback)(e=>{X.current=null,!B.current?.syntheticTouch&&B.current&&Ie(e)},[Ie]),Q=(0,C.useRef)(null),ze=(0,C.useRef)(null),$=(0,C.useCallback)(e=>{Q.current=null,X.current=null,K(e)},[K]),Be=(0,C.useRef)(q),Ve=(0,C.useRef)(K),He=(0,C.useRef)($),Ue=(0,C.useRef)(Y),We=(0,C.useRef)(Ie),Ge=(0,C.useRef)(ke);(0,C.useEffect)(()=>{Be.current=q,Ve.current=K,He.current=$,Ue.current=Y,We.current=Ie,Ge.current=ke});let Ke=(0,C.useCallback)(e=>{let t=(e,t)=>({syntheticTouch:!0,pointerId:e.identifier,clientY:e.clientY,timeStamp:Date.now(),currentTarget:t,setPointerCapture:()=>{},releasePointerCapture:()=>{}}),n=e=>{let t=e.currentTarget;if(e.touches.length>1){He.current(t);return}let n=e.changedTouches[0];if(!n){Q.current=null;return}let r=xe(e.target,t),i=Se(r),a=Ce(r)&&N.current>0;Q.current={id:n.identifier,startY:n.clientY,scrollers:r,top:i,bottom:a,contentEndY:null,promotedAtContentEnd:!1}},r=e=>{let n=e.currentTarget;if(e.touches.length>1){He.current(n);return}let r=Q.current;if(B.current){let i=[...e.changedTouches].find(e=>e.identifier===B.current?.pointerId);if(!i)return;if(r?.promotedAtContentEnd&&r.contentEndY!=null){if(i.clientY>=r.contentEndY){r.contentEndY=null,r.promotedAtContentEnd=!1,Ve.current(n);return}Ue.current(t(i,n));return}e.preventDefault(),Ue.current(t(i,n));return}if(!r)return;let i=[...e.changedTouches].find(e=>e.identifier===r.id);if(!i)return;let a=i.clientY-r.startY,o=r.top&&a>he&&Se(r.scrollers),s=r.bottom&&a<-8&&Ce(r.scrollers);o||s?(e.preventDefault(),Q.current=null,Be.current(t(i,n),Ge.current(),r.startY),Ue.current(t(i,n))):((r.top&&a<0||r.bottom&&a>0)&&(r.top=!1,r.bottom=!1),N.current>0&&Ce(r.scrollers)?r.contentEndY==null?r.contentEndY=i.clientY:r.contentEndY-i.clientY>=me&&(r.promotedAtContentEnd=!0,Be.current(t(i,n),Ge.current(),r.contentEndY),Ue.current(t(i,n))):r.contentEndY=null)},i=e=>{Q.current=null;let n=B.current?.pointerId;if(n==null)return;let r=[...e.changedTouches].find(e=>e.identifier===n),i=e.currentTarget;r?We.current(t(r,i)):e.touches.length===0&&Ve.current(i)},a=U.current;if(a&&ze.current){let e=ze.current;a.removeEventListener(`touchstart`,e.start),a.removeEventListener(`touchmove`,e.move),a.removeEventListener(`touchend`,e.end),a.removeEventListener(`touchcancel`,e.end)}U.current=e,e?(e.addEventListener(`touchstart`,n,{passive:!0}),e.addEventListener(`touchmove`,r,{passive:!1}),e.addEventListener(`touchend`,i,{passive:!0}),e.addEventListener(`touchcancel`,i,{passive:!0}),ze.current={start:n,move:r,end:i}):ze.current=null},[]),qe=v(`(prefers-reduced-motion: reduce)`),Je=(0,C.useCallback)(e=>{if(T.current<=0)return;let t=ye(e),n=Math.max(0,e.scrollHeight-e.clientHeight-t),r=Math.max(0,e.scrollTop-n);r<T.current-.5&&j(r)},[j]),Ye=(0,C.useCallback)(e=>{B.current==null&&E.current==null&&Je(e.currentTarget)},[Je]),Xe=(0,C.useCallback)(e=>{e.isPrimary?Pe(e):$(e.currentTarget)},[Pe,$]),Ze=(0,C.useCallback)(e=>{e.isPrimary?Le(e):$(e.currentTarget)},[Le,$]),Qe=(0,C.useCallback)(e=>{e.touches.length>1&&$(e.currentTarget)},[$]),$e=(0,C.useCallback)(e=>{let t=B.current;t?.pointerId!==e.pointerId||t.syntheticTouch||K(e.currentTarget)},[K]),et=d?s:l;return{sheetRef:Oe,contentProps:(0,C.useMemo)(()=>({style:{transform:et===0?void 0:`translateY(${et}px)`,transition:e&&(d||S||qe)?`none`:void 0,touchAction:`pinch-zoom`,overscrollBehavior:`contain`}}),[et,d,e,S,qe]),handleProps:(0,C.useMemo)(()=>({style:{touchAction:`pinch-zoom`,cursor:`grab`},onContextMenu:Fe,onLostPointerCapture:J,onPointerDown:Xe,onPointerMove:Y,onPointerUp:Ie,onPointerCancel:$e,onTouchStart:Qe,onTouchMove:Qe}),[Ie,Fe,$e,Xe,Qe,J,Y]),bodyProps:(0,C.useMemo)(()=>({ref:Ke,onContextMenu:Fe,onLostPointerCapture:J,onPointerDown:Ze,onPointerMove:Z,onPointerUp:Re,onPointerCancel:Re,onScroll:Ye}),[Ke,Re,Ze,Z,Ye,Fe,J]),bodyElementRef:U,dragOffset:s,settledOffset:l,isDragging:d,isTraveling:p,activeOffsetRef:N,sheetHeight:h,scrollPreservationInset:ee,settlingLayoutOffset:b,settledLayoutOffset:ne,completeScrollAreaSettle:se}}var U=n(),Ee={hug:`92dvh`,capped:`62dvh`,tall:`92dvh`},De=48,Oe=48,ke=50;o[`--spacing-6`];function W(){return typeof window>`u`?0:window.innerHeight}function Ae(e){let t=``;for(let n of e??[])t+=`${typeof n}:${n}|`;return t}var G={sheet:{kfzvcC:`x67bb7w`,kB7OPa:`x9f619`,kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kAzted:`x2lwn1j`,kzqmXN:`xh8yej3`,ks0D6T:`x11gisft`,kWkggS:`x10xzikg`,kEafiO:`x11xkdxz`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,k2ei4v:`xgbv0en`,kVhnKS:`x1t7ytsu`,kGJrpR:`x1j92z86`,ke9TFa:`xw8tdv1`,k8ry5P:`x18b5jzi`,kBCPoo:`x1gejf6u`,krdFHd:`x81l70g`,kfmiAY:`x7hs6f1`,kGVxlE:`x1kcpxr7`,kI3sdo:`x1a2a7pz`,kVQacm:`xb3r6kr`,kGO01o:`x1wkw6tp`,k1K539:`x1if0o47`,k3aq6I:`xnn1q72 xhbqy3z`,kSiTet:`x1hc1fzr`,k1ekBW:`xwcsmn1`,kIyJzY:`x80gvsz`,kAMwcw:`xlr8y92`,k6sLGO:`x1q1rmc8`,k6CgDc:`xzg1mie`,$$css:!0},sheetClosing:{k3aq6I:`x1weeur4`,kAMwcw:`xv2sgk5`,$$css:!0},sheetFading:{kSiTet:`xg01cxk`,$$css:!0},sheetInactive:{kfzvcC:`x47corl`,$$css:!0},body:{kzQI83:`x1iyjqo2`,kAzted:`x2lwn1j`,kB7OPa:`x9f619`,kFalU9:`xge0x1e`,kInvED:`x1wfwxd8 x1nw7mhf`,kWkggS:`x10xzikg`,kGO01o:`x18d9i69`,$$css:!0},content:{k1xSpc:`xufnvkl`,kB7OPa:`x9f619`,kZKoxP:`x5yr21d`,kAzted:`x121v3j4`,$$css:!0},tallKeyboardBody:{kFlMNQ:`xrw9175`,k5JduY:`x1s928wv`,kc3QkE:`xhkezso`,k4zj60:`xu6fald`,kloYau:`x2q1x1w`,$$css:!0},budget:{kZKoxP:`x1tpcejd`,$$css:!0},hugHeight:{kZKoxP:`xg7h5cd`,kskxy:`x14bu9tk`,$$css:!0}};function je(e){return e.kind===`open`?e.entering?`entering`:null:e.kind===`retained`?e.motion===`covered`?null:e.motion:e.kind===`exiting`?`exiting`:null}function Me(e,t,n){if(e==null)return n(),()=>{};let r=!1,i=null,a=()=>{r||(r=!0,i!=null&&clearTimeout(i),e.removeEventListener(`transitionend`,o),e.removeEventListener(`transitioncancel`,o),n())},o=n=>{n.target===e&&n.propertyName===t&&a()};e.addEventListener(`transitionend`,o),e.addEventListener(`transitioncancel`,o);let s=getComputedStyle(e);if(e.style.transition.trim()===`none`||s.transition.trim()===`none`)return a(),()=>{};let c=s.transitionProperty.split(`,`).map(e=>e.trim()),l=s.transitionDuration.split(`,`).map(K),u=s.transitionDelay.split(`,`).map(K),d=!1,f=c.reduce((e,n,r)=>{if(n!==t&&n!==`all`)return e;let i=l[r%l.length],a=u[r%u.length];return i==null||a==null?(d=!0,e):Math.max(e,i+a)},0);return d?()=>{e.removeEventListener(`transitionend`,o),e.removeEventListener(`transitioncancel`,o)}:f<=0?(a(),()=>{}):(i=setTimeout(a,f+ke),()=>{i!=null&&clearTimeout(i),e.removeEventListener(`transitionend`,o),e.removeEventListener(`transitioncancel`,o)})}function K(e){let t=e.trim();if(!/^-?(?:\d+|\d*\.\d+)(?:ms|s)$/.test(t))return null;let n=Number.parseFloat(e);return t.endsWith(`ms`)?n:n*1e3}function Ne({ref:e,state:t,height:n,label:a,children:o,padding:g,snapPoints:te,className:ne,style:re,tabIndex:v,xstyle:y,isSwipeDismissAllowed:w=!0,isPageScrollLocked:T=!1,onDismiss:ae,onScrimOpacity:D,onElementChange:O,onMotionStart:k,onMotionComplete:A,...oe}){let j=(0,C.useRef)(null),se=(0,C.useRef)(t),M=(0,C.useRef)(!1),N=(0,C.useRef)(k),P=(0,C.useRef)(A),F=(0,C.useRef)(null),I=(0,C.useRef)(null),le=t.kind===`open`&&t.entering,ue=se.current,de=ue.kind===`open`&&ue.entering;le&&!de?M.current=ue.kind===`retained`:le||(M.current=!1),(0,C.useLayoutEffect)(()=>{se.current=t,N.current=k,P.current=A},[A,k,t]);let L=t.kind===`open`,fe=t.kind!==`hidden`,R=t.kind===`retained`,pe=R||t.kind===`exiting`,me=t.kind===`exiting`,he=R&&t.motion===`fading`,ge=R?t.alignmentOffset:0,_e=Ae(te),ve=(0,C.useRef)(te);ve.current=te;let{snapHeights:ye,ignoredSnapPointsMessage:be}=(0,C.useMemo)(()=>{if(_e===``)return{snapHeights:void 0,ignoredSnapPointsMessage:``};let e=(ve.current??[]).filter(e=>!E(e));return{snapHeights:()=>ie(ve.current??[],W()),ignoredSnapPointsMessage:e.length===0?``:`snapPoints ignored ${JSON.stringify(e)}. A snap point is a viewport fraction above 0 and up to 1 (0.5 is half the screen), a px length ('320px'), or a percentage ('50%').`}},[_e]);b(`BottomSheet`,be,be!==``);let{contentProps:z,handleProps:xe,bodyProps:B,bodyElementRef:V,sheetRef:Se,dragOffset:Ce,settledOffset:H,isDragging:we,isTraveling:ke,sheetHeight:K,scrollPreservationInset:Ne,settlingLayoutOffset:q,settledLayoutOffset:Pe,completeScrollAreaSettle:Fe}=Te({isOpen:L,canDismiss:w,offscreenBlockEndInset:De,onDismiss:ae,snapHeights:ye,onScrimOpacity:D}),{getViewportProps:J,getContentProps:Y}=x({axis:`both`,keyboardAccess:{owner:`contentOrViewport`,label:a},overscroll:`contain`,stickyContainment:`always`}),Ie=(0,C.useCallback)(e=>{Se(e),j.current=e,O?.(e)},[O,Se]);ce({bodyRef:V,bottomClearance:Oe,isEnabled:n===`tall`,isFullyExpanded:H===0,isPageScrollLocked:T,isSheetTraveling:ke,isOpen:L,isPresented:fe,sheetRef:j}),(0,C.useImperativeHandle)(e,()=>j.current,[]);let X=je(t);(0,C.useLayoutEffect)(()=>{if(X!=null){if(F.current=null,I.current=null,X===`entering`&&M.current)I.current=X;else return Me(j.current,X===`fading`?`opacity`:`transform`,()=>{F.current===X?P.current?.(X):I.current=X})}},[X]),(0,C.useLayoutEffect)(()=>{if(q!=null)return Me(j.current,`transform`,Fe)},[Fe,q]),(0,C.useEffect)(()=>{if(X!=null)return N.current?.(X),F.current=X,I.current===X&&(I.current=null,P.current?.(X)),()=>{F.current===X&&(F.current=null),I.current===X&&(I.current=null)}},[X]);let Le=g==null,Z=g??4,Re=s[Z],Q=typeof n==`string`&&n in Ee?Ee[n]:typeof n==`number`?`${n}px`:n,ze=K>0,$=z.style.transform,Be;if(ze){let e=we?Ce<H?0:Pe:q??Pe,t=(we?Ce:H)-e;Be=e>0||we||q!=null?`${Math.max(0,K-Math.max(0,e))}px`:void 0,$=t===0?void 0:`translateY(${t}px)`}let Ve=ge>0?[$,`translateY(${ge}px)`].filter(Boolean).join(` `):$,He=L?$:R?Ve:void 0,Ue=re?.transform;(0,C.useLayoutEffect)(()=>{if(we||Ue!=null)return;let e=j.current;e!=null&&(e.style.transform=He??``)});let We={transition:z.style.transition,touchAction:z.style.touchAction,overscrollBehavior:z.style.overscrollBehavior,height:Be};return(0,U.jsxs)(`div`,{...oe,ref:Ie,tabIndex:v??-1,...m(i(`bottom-sheet`),r(h.reset,ee.reset,G.sheet,l.reset,n===`hug`?G.hugHeight:G.budget,me&&G.sheetClosing,he&&G.sheetFading,pe&&G.sheetInactive,y),ne,{"--_sheet-budget":Q,...L?We:R||me?{height:Be}:{},...re}),children:[(0,U.jsx)(`div`,{className:`x10l6tqk x13vifvy x1o0tod xtijo5x x1vjfegm x78zum5 x6s0dn4 xl56j7k xvpftlf xafqdz2 x1j4r261 x1jm3nie x16khyan`,...xe,"aria-hidden":`true`,children:(0,U.jsx)(`div`,{className:`x1m747yf x11c6zpc xjspbzw x1m4xfpy`})}),(0,U.jsx)(`div`,{...J({...B,...m(r(_.focusVisible,G.body,n===`tall`&&G.tallKeyboardBody),Ne>0?{style:{paddingBlockEnd:`${Ne}px`}}:{})}),children:(0,U.jsx)(`div`,{...Y(r(G.content,...S(Le?{useThemeDefault:`bottom-sheet`}:{paddingInnerX:Re,paddingInnerY:Re,paddingOuterX:Re,paddingOuterY:Re}),!Le&&Z!==4&&u[Z],!Le&&Z!==4&&c[Z],!Le&&Z!==4&&d[Z],!Le&&Z!==4&&f[Z])),children:(0,U.jsx)(p,{children:o})})})]})}Ne.displayName=`BottomSheetPanel`;function q(){return(0,U.jsx)(`div`,{className:`xixxii4 x17y0mx6 x1ey2m1c x1kpxq89 x10xzikg xhtitgo x47corl x1cb67k9 xt2iwb0`,"data-sheet-edge-tint":``,"aria-hidden":`true`})}var Pe=(0,C.createContext)(null);Pe.displayName=`BottomSheetSwitcherContext`;var Fe=e({BottomSheet:()=>Q}),J={dialog:{kVAEAm:`xixxii4`,kpwlN0:`x10a8y8t`,kzqmXN:`x1o6l61p`,kZKoxP:`xtdtrs8`,ks0D6T:`x1x1rfll`,kskxy:`x7ab17h`,kogj98:`x1ghz6dp`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kVQacm:`x1rea2x4`,k1xSpc:`x1s85apg`,kI3sdo:`x1a2a7pz`,$$css:!0},dialogOpen:{k1xSpc:`x1lliihq`,$$css:!0},scrim:{kGyWv1:`xnixb3f`,k5sjJv:`xni466t xxiuuzi`,kND0Po:`xc0dz0a`,k9an0g:`x10buo38`,kb4ib:`x15h3t91`,kwHxkk:`x142juwg`,k4oj2o:`x15l12jy`,$$css:!0},dialogNonModalItem:{kfzvcC:`x47corl`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,$$css:!0},dialogNonModalItemTop:{kY2c9j:`x1vjfegm`,$$css:!0},scrimClosing:{kb4ib:`x1cz9k3x`,$$css:!0}};function Y(e,t){switch(e){case`active`:return{kind:`open`,entering:!1};case`entering`:return{kind:`open`,entering:!0};case`covered`:case`aligning`:case`fading`:return{kind:`retained`,motion:e,alignmentOffset:t};case`exiting`:return{kind:`exiting`};case`hidden`:return{kind:`hidden`}}}function Ie(e,t){let n=document.activeElement;if(n!=null&&e?.contains(n))return;let r=e?.querySelector(`[data-autofocus]`);r==null?t&&e?.focus({preventScroll:!0}):r.focus({preventScroll:!0})}function X(e){let t=e.ownerDocument.activeElement;t instanceof HTMLElement&&t!==e.ownerDocument.body&&t.blur(),e.showModal()}function Le(e){e.style.setProperty(`--_sheet-scrim-duration`,`0s`),e.style.setProperty(`--_sheet-scrim-opacity`,`0`),X(e),typeof getComputedStyle==`function`&&getComputedStyle(e,`::backdrop`).opacity,e.style.removeProperty(`--_sheet-scrim-duration`)}function Z({ref:e,isOpen:t,onOpenChange:n,label:r,children:i,height:a=`capped`,snapPoints:o,hasScrim:s=!0,finalFocusRef:c,purpose:l=`info`,xstyle:u,...d}){let f=(0,C.useRef)(null),p=(0,C.useRef)(null),m=(0,C.useRef)(null),[h,ee]=(0,C.useState)(t),_=t||h,v=t?{kind:`open`,entering:!1}:h?{kind:`exiting`}:{kind:`hidden`},x=(0,C.useCallback)(()=>{t&&l!==`required`&&n(!1)},[t,n,l]),S=(0,C.useCallback)(()=>{l===`info`&&n(!1)},[n,l]),w=(0,C.useCallback)(e=>{p.current=e},[]),T=(0,C.useCallback)(e=>{f.current?.style.setProperty(`--_sheet-scrim-opacity`,String(e))},[]);(0,C.useEffect)(()=>{let e=f.current;e!=null&&t&&(ee(!0),e.style.setProperty(`--_sheet-scrim-opacity`,`1`),e.open||(s?(m.current=document.activeElement,e.showModal()):e.show(),Ie(p.current,s)))},[s,t]),(0,C.useEffect)(()=>{!t&&h&&s&&T(0)},[T,s,t,h]);let E=(0,C.useCallback)(e=>{if(e!==`exiting`||t)return;let n=f.current;n?.open&&n.close(),ee(!1);let r=c?.current??m.current;r!=null&&re(r),m.current=null},[c,t]);g(),y(_&&s),b(`BottomSheet`,"requires a non-empty `label` for an accessible name; the open sheet has no built-in heading to derive one from.",t&&!r);let{shouldDismissOnCloseRequest:ie}=ne({isActive:_,escapeBehavior:t&&l!==`required`?`close`:`block`,onDismiss:x,getContainer:()=>f.current,isPresent:()=>f.current?.open??!1}),ae=(0,C.useCallback)(e=>{e.target===e.currentTarget&&(e.preventDefault(),ie()&&x())},[x,ie]),D=(0,C.useCallback)(e=>{s&&e.target===e.currentTarget&&S()},[S,s]);return(0,U.jsxs)(`dialog`,{...{0:{className:`xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1s85apg x1a2a7pz`},8:{className:`xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1a2a7pz x1lliihq`},4:{className:`xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a x10buo38 x15h3t91 x142juwg x15l12jy`},12:{className:`xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a x10buo38 x15h3t91 x142juwg x15l12jy`},2:{className:`xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1s85apg x1a2a7pz x1cz9k3x`},10:{className:`xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1a2a7pz x1lliihq x1cz9k3x`},6:{className:`xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a x10buo38 x142juwg x15l12jy x1cz9k3x`},14:{className:`xixxii4 x10a8y8t x1o6l61p xtdtrs8 x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a x10buo38 x142juwg x15l12jy x1cz9k3x`},1:{className:`xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1s85apg x1a2a7pz x47corl xfo81ep xh8yej3 x5yr21d`},9:{className:`xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1a2a7pz x1lliihq x47corl xfo81ep xh8yej3 x5yr21d`},5:{className:`xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a x10buo38 x15h3t91 x142juwg x15l12jy x47corl xfo81ep xh8yej3 x5yr21d`},13:{className:`xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a x10buo38 x15h3t91 x142juwg x15l12jy x47corl xfo81ep xh8yej3 x5yr21d`},3:{className:`xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1s85apg x1a2a7pz x1cz9k3x x47corl xfo81ep xh8yej3 x5yr21d`},11:{className:`xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1a2a7pz x1lliihq x1cz9k3x x47corl xfo81ep xh8yej3 x5yr21d`},7:{className:`xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1s85apg x1a2a7pz xnixb3f xni466t xxiuuzi xc0dz0a x10buo38 x142juwg x15l12jy x1cz9k3x x47corl xfo81ep xh8yej3 x5yr21d`},15:{className:`xixxii4 x10a8y8t x1x1rfll x7ab17h x1ghz6dp x1717udv xc342km xng3xce xjbqb8w x1rea2x4 x1a2a7pz x1lliihq xnixb3f xni466t xxiuuzi xc0dz0a x10buo38 x142juwg x15l12jy x1cz9k3x x47corl xfo81ep xh8yej3 x5yr21d`}}[!!_<<3|!!s<<2|!!(s&&!t&&h)<<1|!s],ref:f,"aria-label":r,"aria-hidden":!t&&h?`true`:void 0,"aria-modal":s&&t?`true`:void 0,role:l===`required`?`alertdialog`:void 0,inert:!t&&h?!0:void 0,onCancel:ae,onClick:D,children:[(0,U.jsx)(`div`,{className:`x10l6tqk x17y0mx6 x1ey2m1c x78zum5 xl56j7k x47corl`,children:(0,U.jsx)(Ne,{...d,ref:e,state:v,height:a,label:r,snapPoints:o,isSwipeDismissAllowed:l===`info`,isPageScrollLocked:_&&s,xstyle:u,onDismiss:S,onScrimOpacity:T,onElementChange:w,onMotionComplete:E,children:(0,U.jsx)(te,{children:i})})}),(0,U.jsx)(q,{})]})}function Re({switcher:e,ref:t,sheetId:n,label:i,children:a,height:o=`capped`,snapPoints:s,purpose:c=`info`,xstyle:l,...u}){let{activeSheet:d,hasScrim:f,onActiveSheetChange:p,getSheetPhase:h,getSheetAlignmentOffset:g,hostSheet:ee,isScrimOwner:ne,isFlowClosing:re,registerSheetElement:_,registerSheetDialog:v,registerSheetPurpose:y,onBeforeSheetPresent:x,isCoveredInTopLayer:S,onSheetEnterStart:w,onSheetTransitionComplete:T,onSheetScrimOpacityChange:E,dialogProps:ie,onDialogCancel:ae,onDialogClick:D,onDialogKeyDown:O}=e,k=typeof n==`string`&&n.length>0,A=k?h(n):`hidden`,oe=Y(A,k?g(n):0),j=A===`active`||A===`entering`,se=A===`covered`||A===`aligning`||A===`fading`||A===`exiting`,M=A!==`hidden`,N=A===`active`||A===`entering`,P=k&&ne(n),F=k&&ee===n,I=(0,C.useRef)(null),ce=(0,C.useRef)(null),le=(0,C.useRef)(null),ue=(0,C.useRef)(A),de=ue.current,L=(0,C.useRef)(!1);(0,C.useLayoutEffect)(()=>{ue.current=A},[A]);let fe=(0,C.useCallback)(()=>{c===`info`&&k&&d===n&&p(null)},[d,k,p,c,n]),R=(0,C.useCallback)(e=>{le.current=e,k&&_(n,e)},[k,_,n]),pe=(0,C.useCallback)(e=>{I.current=e,k&&v(n,e)},[k,v,n]),me=(0,C.useCallback)(e=>{e===`entering`&&k&&w(n)},[k,w,n]),he=(0,C.useCallback)(e=>{k&&T({sheetId:n,phase:e})},[k,T,n]),ge=(0,C.useCallback)(e=>{k&&E(n,e)},[k,E,n]);(0,C.useLayoutEffect)(()=>{if(k)return y(n,c),()=>y(n,null)},[k,c,y,n]),(0,C.useLayoutEffect)(()=>{let e=I.current;if(e==null||!k)return;if(!M){e.open&&e.close(),ce.current=null;return}let t=f?`modal`:`non-modal`;e.open&&ce.current!==t&&e.close(),e.open&&f&&j&&S(n)&&e.close(),e.open||(f?(x(n),P?X(e):Le(e)):e.show()),ce.current=t},[f,k,S,j,M,x,P,n]),(0,C.useLayoutEffect)(()=>()=>{let e=I.current;e?.open&&e.close()},[]),(0,C.useEffect)(()=>{if(j){let e=de===`active`||de===`entering`;(!L.current||!e)&&Ie(le.current,f),L.current=!0}else A===`hidden`&&(L.current=!1)},[f,j,A,de]),b(`BottomSheet`,"requires a non-empty `label` for an accessible name; the open sheet has no built-in heading to derive one from.",j&&!i);let{className:_e,style:ve,xstyle:ye,"aria-label":be,"aria-labelledby":z,id:xe,"data-testid":B,...V}=ie,Se=m(r(J.dialog,M&&J.dialogOpen,f&&J.scrim,f&&P&&re&&J.scrimClosing,!f&&J.dialogNonModalItem,!f&&N&&J.dialogNonModalItemTop,ye),_e,ve);return(0,U.jsxs)(`dialog`,{...V,...Se,id:F?xe:void 0,"data-testid":F?B:void 0,ref:pe,"aria-label":be??(z==null?i:void 0),"aria-labelledby":z,"aria-modal":f&&j?`true`:void 0,"aria-hidden":se?`true`:void 0,inert:se?!0:void 0,role:c===`required`?`alertdialog`:V.role,onCancel:ae,onClick:D,onKeyDown:O,children:[(0,U.jsx)(`div`,{...{0:{className:`x10l6tqk x17y0mx6 x1ey2m1c x78zum5 xl56j7k x47corl`},2:{className:`x10l6tqk x17y0mx6 x1ey2m1c xl56j7k x47corl x1s85apg`},1:{className:`x10l6tqk x17y0mx6 x1ey2m1c x78zum5 xl56j7k x47corl x1vjfegm`},3:{className:`x10l6tqk x17y0mx6 x1ey2m1c xl56j7k x47corl x1s85apg x1vjfegm`}}[!M<<1|!!N],hidden:!M,"aria-hidden":se?`true`:void 0,inert:se?!0:void 0,children:(0,U.jsx)(Ne,{...u,ref:t,state:oe,height:o,label:i,snapPoints:s,isSwipeDismissAllowed:c===`info`,isPageScrollLocked:f,xstyle:l,onDismiss:fe,onScrimOpacity:ge,onElementChange:R,onMotionStart:me,onMotionComplete:he,children:(0,U.jsx)(Pe,{value:null,children:(0,U.jsx)(te,{children:a})})})}),M&&(0,U.jsx)(q,{})]})}function Q(e){let t=(0,C.use)(Pe),n=e.sheetId,r=typeof n==`string`&&n.length>0;return b(`BottomSheet`,"requires a non-empty `sheetId` when nested in BottomSheetSwitcher; standalone `isOpen` / `onOpenChange` props are ignored there.",t!=null&&!r),b(`BottomSheet`,"`sheetId` only works inside BottomSheetSwitcher. Use `isOpen` and `onOpenChange` for a standalone sheet.",t==null&&n!=null),t==null?(0,U.jsx)(Z,{...e}):(0,U.jsx)(Re,{...e,switcher:t})}Q.displayName=`BottomSheet`;export{Fe as n,Q as t};
|
|
@@ -1 +1 @@
|
|
|
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{_ as a}from"./padding.stylex-B76907Zf.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{S as s}from"./Icon-
|
|
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{_ as a}from"./padding.stylex-B76907Zf.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{S as s}from"./Icon-BqkS-pIq.js";import{t as c}from"./container.stylex-BmOi-8DQ.js";var l=e(i(),1);function u(){return(0,l.use)(s).locale}var d=t(),f={card:{"--_card-radius":`x2kkz0m`,kaIpWk:`x153u1i6`,k7Eaqz:`xeuugli`,kVQacm:`x7giv3`,kGVxlE:`x1p8z4y0`,$$css:!0},withBorder:{kMzoRj:`x1litavf`,ksu8eU:`x1y0btm7`,kVAM5u:`x14i3s5s`,kZCmMZ:`xs19ii7`,kwRFfy:`x12frdag`,kLKAdn:`x1nex4ik`,kGO01o:`xbv1mwh`,$$css:!0},scrollable:{kVQacm:`xysyzu8`,$$css:!0}},p={default:{kWkggS:`x1de1mus`,$$css:!0},transparent:{kWkggS:`xjbqb8w`,$$css:!0},muted:{kWkggS:`xwmxj5m`,$$css:!0},blue:{kWkggS:`x1o0wnni`,$$css:!0},cyan:{kWkggS:`x1rgj867`,$$css:!0},gray:{kWkggS:`xspzpui`,$$css:!0},green:{kWkggS:`x1sqjeoo`,$$css:!0},orange:{kWkggS:`x1e9xt6e`,$$css:!0},pink:{kWkggS:`xnpoty2`,$$css:!0},purple:{kWkggS:`x16i6n6f`,$$css:!0},red:{kWkggS:`x1cibrc5`,$$css:!0},teal:{kWkggS:`x1jtji5o`,$$css:!0},yellow:{kWkggS:`x1bo7t0x`,$$css:!0}},m={none:{"--_card-elevation":`xw28qpl`,$$css:!0},low:{"--_card-elevation":`x1nn8khe`,$$css:!0},med:{"--_card-elevation":`x1ovzxg0`,$$css:!0},high:{"--_card-elevation":`xnpe7fx`,$$css:!0}},h={sizing:(e,t,n,r)=>[{kzqmXN:e==null?e:`x5lhr3w`,kZKoxP:t==null?t:`x16ye13r`,ks0D6T:n==null?n:`xf68679`,kAzted:r==null?r:`x82snj4`,$$css:!0},{"--x-width":(e=>typeof e==`number`?e+`px`:e??void 0)(e),"--x-height":(e=>typeof e==`number`?e+`px`:e??void 0)(t),"--x-maxWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(n),"--x-minHeight":(e=>typeof e==`number`?e+`px`:e??void 0)(r)}]};function g({width:e,height:t,maxWidth:i,minHeight:s,children:l,padding:u,variant:g=`default`,elevation:_=`none`,xstyle:v,className:y,style:b,ref:x,...S}){let C=t!=null&&t!==`auto`,w=u==null?void 0:a[u];return(0,d.jsx)(`div`,{ref:x,...o(r(`card`,{variant:g,elevation:_}),n(f.card,p[g],m[_],C&&f.scrollable,h.sizing(e??null,t??null,i??null,s??null),...c(w==null?{useThemeDefault:`card`}:{paddingInnerX:w,paddingInnerY:w,paddingOuterX:w,paddingOuterY:w}),g==="default"&&f.withBorder,v),y,b),...S,children:l})}g.displayName=`Card`;export{u as n,g as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Tooltip-BWs5DLrM.js","assets/rolldown-runtime-hePW80VL.js","assets/themeProps-3IqahpCr.js","assets/useLayerDismissal-BAnTRYTt.js","assets/useTooltip-c097gL_-.js","assets/tokens.stylex-DkHf0P9C.js","assets/padding.stylex-B76907Zf.js","assets/ItemSwipeLayer-Ckn4X6h9.js","assets/mergeProps-ptS-gIMz.js","assets/focusOutline.stylex-BT0kfa4t.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{b as s,l as c,s as l,t as u,x as d}from"./Icon-BqkS-pIq.js";import{c as f,d as p,f as m,i as h,n as g,t as _}from"./useResolvedRequired-DbsOcDqy.js";import{n as v,r as ee,t as y}from"./focusOutline.stylex-BT0kfa4t.js";import{n as te,o as ne,r as b}from"./useAnnounce-DTSHZvjg.js";import{t as re}from"./useTooltip-c097gL_-.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-BOqCfzZC.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-BWs5DLrM.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-Ckn4X6h9.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:l,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,l),children:i}):p?(0,N.jsx)(u,{...f,"aria-hidden":`true`,icon:`check`,size:ye[t],color:r?`disabled`:`accent`,xstyle:d,className:c,style:l}):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`?c(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,l())}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=d();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)(s,{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};
|