wizards 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/apps/runtime/dist/agents/studio-assistant.js +67 -20
  2. package/apps/runtime/dist/docs/dev/plugins/reference.md +7 -4
  3. package/apps/runtime/dist/docs/dev/plugins/reloading.md +3 -3
  4. package/apps/runtime/dist/docs/dev/plugins/runners.md +9 -12
  5. package/apps/runtime/dist/docs/dev/plugins/server.md +3 -1
  6. package/apps/runtime/dist/docs/dev/plugins/space.md +19 -1
  7. package/apps/runtime/dist/docs/dev/plugins/studio.md +43 -6
  8. package/apps/runtime/dist/docs/dev/plugins/styling.md +8 -1
  9. package/apps/runtime/dist/docs/user/space.md +4 -4
  10. package/apps/runtime/dist/docs/user/test-and-share.md +22 -58
  11. package/apps/runtime/dist/engine/steps.js +3 -2
  12. package/apps/runtime/dist/engine/template.js +14 -10
  13. package/apps/runtime/dist/film/project.js +15 -3
  14. package/apps/runtime/dist/plugins/loader.js +38 -2
  15. package/apps/runtime/dist/routes/studio.js +28 -1
  16. package/apps/runtime/dist/services/brand.js +61 -1
  17. package/apps/runtime/dist/services/projects.js +19 -10
  18. package/apps/runtime/dist/tools/plugin.js +11 -3
  19. package/apps/web/dist/assets/AboutDialog-CH1rQdia.js +1 -0
  20. package/apps/web/dist/assets/{ChangelogDialog-DynvQuuR.js → ChangelogDialog-78MQLHfA.js} +1 -1
  21. package/apps/web/dist/assets/ChatView-DLJfy69U.js +10 -0
  22. package/apps/web/dist/assets/EditorPage-BYrZokVk.js +3 -0
  23. package/apps/web/dist/assets/{FlowPreview-BZLnG7GV.js → FlowPreview-xIWPdOCV.js} +1 -1
  24. package/apps/web/dist/assets/{Harness-CNh3nbB_.js → Harness-CsDhNLSW.js} +2 -2
  25. package/apps/web/dist/assets/NewWizardChannels-JB3V6DCL.js +1 -0
  26. package/apps/web/dist/assets/NewWizardPage-Bkh-hjSe.js +7 -0
  27. package/apps/web/dist/assets/OnboardingPage-Diw1ILjC.js +1 -0
  28. package/apps/web/dist/assets/ProjectPage-FgoZDzPI.js +1 -0
  29. package/apps/web/dist/assets/PublicRunner-ClT6B7t5.js +1 -0
  30. package/apps/web/dist/assets/{ReadOnly-DTjv2Jzm.js → ReadOnly-DQPHmvS0.js} +1 -1
  31. package/apps/web/dist/assets/RunDrawer-DAwTEyjM.js +4 -0
  32. package/apps/web/dist/assets/{RunnerView-BPPmlv9z.js → RunnerView-B_tJroFM.js} +1 -1
  33. package/apps/web/dist/assets/SettingsPage-BsMN-XQs.js +1 -0
  34. package/apps/web/dist/assets/SetupPage-C7FuIpSt.js +1 -0
  35. package/apps/web/dist/assets/SharePage-CbFe83L9.js +1 -0
  36. package/apps/web/dist/assets/changelog-mYclku73.js +1 -0
  37. package/apps/web/dist/assets/{circle-alert-CVOH4wAv.js → circle-alert-DCBV7n5k.js} +1 -1
  38. package/apps/web/dist/assets/{esm-BfXdeWaI.js → esm-BhIeKBJY.js} +1 -1
  39. package/apps/web/dist/assets/index-CmxVazOf.css +1 -0
  40. package/apps/web/dist/assets/index-fflYi8P1.js +14 -0
  41. package/apps/web/dist/assets/{lock-DHBh62LA.js → lock-DlzTfwxP.js} +1 -1
  42. package/apps/web/dist/assets/{phone-Bt1cyWpY.js → phone-BFD815nc.js} +1 -1
  43. package/apps/web/dist/assets/{settings-menu-ace1vI3i.js → settings-menu-C5Y8SOhG.js} +1 -1
  44. package/apps/web/dist/assets/ui-DTuixH4y.js +134 -0
  45. package/apps/web/dist/assets/{upload-CCEq88l4.js → upload-BEf5-d6X.js} +1 -1
  46. package/apps/web/dist/index.html +4 -5
  47. package/apps/web/dist/mcp/flow.html +2 -2
  48. package/node_modules/@engenty-wizards/plugin-sdk/dist/index.d.ts +36 -2
  49. package/node_modules/@engenty-wizards/plugin-sdk/dist/studio.d.ts +44 -1
  50. package/node_modules/@engenty-wizards/shared/dist/feature-flags.d.ts +18 -0
  51. package/node_modules/@engenty-wizards/shared/dist/feature-flags.js +18 -0
  52. package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +22 -6
  53. package/node_modules/@engenty-wizards/shared/dist/projects.js +20 -0
  54. package/package.json +1 -1
  55. package/apps/web/dist/assets/AboutDialog-CPQiN7H9.js +0 -1
  56. package/apps/web/dist/assets/ChatView-CKo_9IZD.js +0 -10
  57. package/apps/web/dist/assets/EditorPage-CDIJXC4T.js +0 -3
  58. package/apps/web/dist/assets/NewWizardChannels-C1Ss9UMY.js +0 -1
  59. package/apps/web/dist/assets/NewWizardPage-2qLAbvDL.js +0 -7
  60. package/apps/web/dist/assets/OnboardingPage-C1FJwEsT.js +0 -1
  61. package/apps/web/dist/assets/ProjectPage-CGuLUuOs.js +0 -1
  62. package/apps/web/dist/assets/PublicRunner-BKw1lOW4.js +0 -1
  63. package/apps/web/dist/assets/RunDrawer-D1I5xqVf.js +0 -4
  64. package/apps/web/dist/assets/SettingsPage-zbomQfGy.js +0 -1
  65. package/apps/web/dist/assets/SetupPage-D3F7M6Pz.js +0 -1
  66. package/apps/web/dist/assets/SharePage-BY49IJgT.js +0 -1
  67. package/apps/web/dist/assets/changelog-DYZC2E6q.js +0 -1
  68. package/apps/web/dist/assets/index-B9xVkr2X.css +0 -1
  69. package/apps/web/dist/assets/index-BH0PYgov.js +0 -15
  70. package/apps/web/dist/assets/logo-C4V2_3Ar.js +0 -1
  71. package/apps/web/dist/assets/ui-D2SqIZeQ.js +0 -133
  72. package/modules/calls/dist/client.css +0 -3
  73. package/modules/calls/dist/client.js +0 -1
  74. package/modules/calls/engenty.plugin.json +0 -8
  75. package/modules/calls/migrations/0001_init.sql +0 -26
  76. package/modules/calls/package.json +0 -25
  77. package/modules/calls/src/openai.ts +0 -155
  78. package/modules/calls/src/plugin.ts +0 -407
  79. package/modules/calls/src/rules.ts +0 -226
  80. package/modules/calls/src/schema.ts +0 -39
  81. package/modules/calls/src/session.ts +0 -353
  82. package/modules/calls/src/store.ts +0 -124
  83. package/modules/calls/src/twilio.ts +0 -90
  84. package/modules/calls/tsconfig.json +0 -10
  85. package/modules/calls/ui/Settings.tsx +0 -137
  86. package/modules/calls/ui/app.ts +0 -50
  87. package/modules/calls/ui/messages.ts +0 -81
  88. package/modules/calls/ui/parts.tsx +0 -36
  89. package/modules/calls/ui/plugin.tsx +0 -15
  90. package/modules/sms/dist/client.css +0 -3
  91. package/modules/sms/dist/client.js +0 -1
  92. package/modules/sms/engenty.plugin.json +0 -8
  93. package/modules/sms/migrations/0001_init.sql +0 -26
  94. package/modules/sms/package.json +0 -24
  95. package/modules/sms/src/plugin.ts +0 -329
  96. package/modules/sms/src/schema.ts +0 -26
  97. package/modules/sms/src/store.ts +0 -140
  98. package/modules/sms/src/surface.ts +0 -70
  99. package/modules/sms/src/twilio.ts +0 -130
  100. package/modules/sms/tsconfig.json +0 -10
  101. package/modules/sms/ui/Settings.tsx +0 -113
  102. package/modules/sms/ui/Share.tsx +0 -60
  103. package/modules/sms/ui/app.ts +0 -51
  104. package/modules/sms/ui/messages.ts +0 -70
  105. package/modules/sms/ui/parts.tsx +0 -36
  106. package/modules/sms/ui/plugin.tsx +0 -20
  107. package/modules/whatsapp/dist/client.css +0 -3
  108. package/modules/whatsapp/dist/client.js +0 -1
  109. package/modules/whatsapp/engenty.plugin.json +0 -8
  110. package/modules/whatsapp/migrations/0001_init.sql +0 -30
  111. package/modules/whatsapp/package.json +0 -24
  112. package/modules/whatsapp/src/graph.ts +0 -271
  113. package/modules/whatsapp/src/inbound.ts +0 -143
  114. package/modules/whatsapp/src/plugin.ts +0 -374
  115. package/modules/whatsapp/src/schema.ts +0 -32
  116. package/modules/whatsapp/src/store.ts +0 -156
  117. package/modules/whatsapp/src/surface.ts +0 -127
  118. package/modules/whatsapp/tsconfig.json +0 -10
  119. package/modules/whatsapp/ui/Settings.tsx +0 -141
  120. package/modules/whatsapp/ui/Share.tsx +0 -60
  121. package/modules/whatsapp/ui/app.ts +0 -54
  122. package/modules/whatsapp/ui/messages.ts +0 -80
  123. package/modules/whatsapp/ui/parts.tsx +0 -36
  124. package/modules/whatsapp/ui/plugin.tsx +0 -20
@@ -166,13 +166,22 @@ export interface PluginGenerateRequest<T = undefined> {
166
166
  maxOutputTokens?: number;
167
167
  /** Default: two minutes. */
168
168
  signal?: AbortSignal;
169
+ /**
170
+ * Pictures (PNG, JPEG, WebP, GIF) and PDFs the model looks at with the prompt: a screenshot to
171
+ * build after, a brand guide. Text files go into the prompt as text.
172
+ */
173
+ files?: {
174
+ data: Uint8Array;
175
+ mediaType: string;
176
+ name?: string;
177
+ }[];
169
178
  }
170
179
  export interface PluginGenerateResult<T = undefined> {
171
180
  text: string;
172
181
  /** Set when the request had a `schema`. */
173
182
  object: T;
174
183
  }
175
- /** What a plugin adds to every agent step of a space's wizards. */
184
+ /** What a plugin adds to the AI steps of a space's wizards: every agent step, unless `steps` says. */
176
185
  export interface PluginSpaceContext {
177
186
  /**
178
187
  * A block of the step's instructions, after what the space says about itself and its
@@ -182,6 +191,27 @@ export interface PluginSpaceContext {
182
191
  block(space: PluginSpace): string | null | Promise<string | null>;
183
192
  /** Tools the step gets with the block, named `<plugin>_<name>` for the model. */
184
193
  tools?: PluginTool[];
194
+ /**
195
+ * The steps that get it: `agent` (default), `html` — the steps that write a document or a
196
+ * dashboard as HTML, which get the block without the tools.
197
+ */
198
+ steps?: ("agent" | "html")[];
199
+ }
200
+ /** A space's brand as the studio's Info & Marke has it: what a plugin draws or writes in its look. */
201
+ export interface PluginBrand {
202
+ /** The title end users see. */
203
+ name: string;
204
+ /** The colours in order: the first is the accent. */
205
+ colors: {
206
+ name: string;
207
+ value: string;
208
+ }[];
209
+ /** The fonts, each with what it is for ("Headings") and the weights the brand uses. */
210
+ fonts: {
211
+ family: string;
212
+ role: string;
213
+ weights: number[];
214
+ }[];
185
215
  }
186
216
  /** A text a plugin puts into a space's search index, beside the space's documents. */
187
217
  export interface PluginIndexEntry {
@@ -900,7 +930,7 @@ export interface PluginServerApi {
900
930
  }>;
901
931
  };
902
932
  registerTool<S extends z.ZodType>(tool: PluginTool<S>): void;
903
- /** A block and tools for every agent step of a space's wizards. */
933
+ /** A block and tools for every agent step of a space's wizards, or a block for its HTML steps. */
904
934
  registerSpaceContext(context: PluginSpaceContext): void;
905
935
  /** A tool of the space assistant. */
906
936
  registerAssistantTool<S extends z.ZodType>(tool: PluginAssistantTool<S>): void;
@@ -920,6 +950,10 @@ export interface PluginServerApi {
920
950
  index: PluginIndex;
921
951
  /** Wissen of a space: pages, tables and files the plugin writes, with their Kategorien. */
922
952
  spaceData: PluginSpaceData;
953
+ spaces: {
954
+ /** The space's brand, of the current tenant; null for a space it does not have. */
955
+ brand(space: string): Promise<PluginBrand | null>;
956
+ };
923
957
  web: PluginWeb;
924
958
  documents: PluginDocuments;
925
959
  /**
@@ -2,7 +2,7 @@ import type { ComponentType } from "react";
2
2
  /**
3
3
  * What the studio hands a plugin's studio half: the built `client.js` the studio loads after
4
4
  * sign-in. Its default export registers pages, entries of the app bar, sections of the settings
5
- * and of the space page, and cards of the space assistant's chat. React, the router and the
5
+ * and of the space page, parts of the space page, and cards of the space assistant's chat. React, the router and the
6
6
  * studio's own components come from the studio (docs/content/dev/plugins), so the page a plugin
7
7
  * draws is part of the same app.
8
8
  */
@@ -56,6 +56,26 @@ export interface StudioSpaceSection {
56
56
  hint?: () => string;
57
57
  component: ComponentType;
58
58
  }
59
+ /**
60
+ * A part of the space page of the plugin's own, beside Info & Marke, Wissen, Daten and
61
+ * Ergebnisse: an entry in the parts' menu and a page at `/space/<id>`. The component draws the
62
+ * whole part; `useSpaceMenu` fills the part's menu with what it draws.
63
+ */
64
+ export interface StudioSpacePart {
65
+ /** Its address: `/space/<id>`. Lower case, digits and `-`; never one of the studio's parts. */
66
+ id: string;
67
+ label: () => string;
68
+ icon: Icon;
69
+ /** The part it follows in the menu; after `data` when left out. */
70
+ after?: Exclude<StudioSpaceGroup, "results">;
71
+ component: ComponentType;
72
+ }
73
+ /** An entry of a plugin part's menu: it jumps to the element with that id. */
74
+ export interface StudioSpaceMenuEntry {
75
+ id: string;
76
+ label: string;
77
+ icon?: Icon;
78
+ }
59
79
  /** What a runner's section of the share dialog is handed: the wizard the dialog is about. */
60
80
  export interface StudioShareSectionProps {
61
81
  wizard: {
@@ -89,6 +109,22 @@ export interface StudioAssistantCard {
89
109
  tool: string;
90
110
  component: ComponentType<StudioAssistantCardProps<any>>;
91
111
  }
112
+ /** A space's brand as Info & Marke has it: what a plugin draws in its look. */
113
+ export interface StudioBrand {
114
+ /** The title end users see. */
115
+ name: string;
116
+ /** The colours in order: the first is the accent. */
117
+ colors: {
118
+ name: string;
119
+ value: string;
120
+ }[];
121
+ /** The fonts, each with what it is for ("Headings") and the weights the brand uses. */
122
+ fonts: {
123
+ family: string;
124
+ role: string;
125
+ weights: number[];
126
+ }[];
127
+ }
92
128
  /** The space the studio shows: what all its wizards share. */
93
129
  export interface StudioSpace {
94
130
  id: string;
@@ -96,6 +132,7 @@ export interface StudioSpace {
96
132
  name: string;
97
133
  /** Synced from a local install, or on a runtime where nothing is built: shown, not changed. */
98
134
  readOnly: boolean;
135
+ brand: StudioBrand;
99
136
  }
100
137
  /** A row under the assistant's hello: a question the person asks with one click. */
101
138
  export interface StudioAssistantSuggestion {
@@ -170,6 +207,7 @@ export interface StudioPluginContext {
170
207
  registerNav(entry: StudioNavEntry): void;
171
208
  registerSettingsSection(section: StudioSettingsSection): void;
172
209
  registerSpaceSection(section: StudioSpaceSection): void;
210
+ registerSpacePart(part: StudioSpacePart): void;
173
211
  registerShareSection(section: StudioShareSection): void;
174
212
  registerAssistantCard(card: StudioAssistantCard): void;
175
213
  /**
@@ -177,6 +215,11 @@ export interface StudioPluginContext {
177
215
  * again when the person picks another space.
178
216
  */
179
217
  useSpace(): StudioSpace | null;
218
+ /**
219
+ * A hook for a plugin's space part: the entries of the part's menu, each jumping to the element
220
+ * of its id in what the part draws. The menu marks the one in view.
221
+ */
222
+ useSpaceMenu(entries: StudioSpaceMenuEntry[]): void;
180
223
  /**
181
224
  * A hook: where the page stands, as the trail after the logo in the top bar ("Termine /
182
225
  * Kalender"), said there instead of a heading of the page's own. Set while the page is shown.
@@ -45,6 +45,24 @@ export declare const FEATURES: {
45
45
  readonly label: "Team plans";
46
46
  readonly hint: "The team page in the cloud studio, and plans that carry this switch on the account pages.";
47
47
  };
48
+ readonly brandSections: {
49
+ readonly kind: "release";
50
+ readonly default: false;
51
+ readonly label: "Sections in Info & Marke";
52
+ readonly hint: "Sections of logos and of colours, gradients and patterns among them.";
53
+ };
54
+ readonly brandRules: {
55
+ readonly kind: "release";
56
+ readonly default: false;
57
+ readonly label: "Rules in Info & Marke";
58
+ readonly hint: "Rules for how the logos, the colours and the type may be used.";
59
+ };
60
+ readonly typography: {
61
+ readonly kind: "release";
62
+ readonly default: false;
63
+ readonly label: "Typography in Info & Marke";
64
+ readonly hint: "The brand's fonts, their licences and a type scale.";
65
+ };
48
66
  readonly ownKeys: {
49
67
  readonly kind: "plan";
50
68
  readonly default: true;
@@ -37,6 +37,24 @@ export const FEATURES = {
37
37
  label: "Team plans",
38
38
  hint: "The team page in the cloud studio, and plans that carry this switch on the account pages.",
39
39
  },
40
+ brandSections: {
41
+ kind: "release",
42
+ default: false,
43
+ label: "Sections in Info & Marke",
44
+ hint: "Sections of logos and of colours, gradients and patterns among them.",
45
+ },
46
+ brandRules: {
47
+ kind: "release",
48
+ default: false,
49
+ label: "Rules in Info & Marke",
50
+ hint: "Rules for how the logos, the colours and the type may be used.",
51
+ },
52
+ typography: {
53
+ kind: "release",
54
+ default: false,
55
+ label: "Typography in Info & Marke",
56
+ hint: "The brand's fonts, their licences and a type scale.",
57
+ },
40
58
  ownKeys: {
41
59
  kind: "plan",
42
60
  default: true,
@@ -30,16 +30,14 @@ export interface BrandColor {
30
30
  export declare const COLOR_SECTION_KINDS: readonly ["colors", "gradients", "patterns"];
31
31
  export type ColorSectionKind = (typeof COLOR_SECTION_KINDS)[number];
32
32
  /**
33
- * Further colours of one use, as a brand guide groups them: "Illustration – for drawings and
34
- * charts". Optional. A section holds colours, gradients or patterns (`kind`, colours when none).
35
- * Colours in no section are the standard ones: they come first, and the first of them is the
36
- * accent.
33
+ * Further colours of one use, as a brand guide groups them: "Illustration". Optional. A section
34
+ * holds colours, gradients or patterns (`kind`, colours when none); each of them says itself what
35
+ * it is for. Colours in no section are the standard ones: they come first, and the first of them
36
+ * is the accent.
37
37
  */
38
38
  export interface ColorSection {
39
39
  id: string;
40
40
  title: string;
41
- /** When to use what is in it. */
42
- description: string;
43
41
  kind?: ColorSectionKind;
44
42
  }
45
43
  export declare const GRADIENT_TYPES: readonly ["linear", "radial", "conic"];
@@ -48,6 +46,8 @@ export type GradientType = (typeof GRADIENT_TYPES)[number];
48
46
  export interface BrandGradient {
49
47
  id: string;
50
48
  name: string;
49
+ /** What it is for and how to use it, as a colour's name says it. */
50
+ description?: string;
51
51
  /** The gradients section it is in. */
52
52
  section: string;
53
53
  type: GradientType;
@@ -62,6 +62,8 @@ export interface BrandGradient {
62
62
  export interface BrandPattern {
63
63
  id: string;
64
64
  name: string;
65
+ /** What it is for and how to use it. */
66
+ description?: string;
65
67
  /** The patterns section it is in. */
66
68
  section: string;
67
69
  /** The project file (kind `pattern`) with the picture. */
@@ -109,6 +111,11 @@ export interface BrandRule {
109
111
  }
110
112
  /** Rules as a model reads them: the sign said in words, numbered ones counted. */
111
113
  export declare function ruleLines(rules: BrandRule[]): string;
114
+ /** What a font's licence can allow it for, among what the wizards make. */
115
+ export declare const FONT_USES: readonly ["web", "documents", "print", "images", "video"];
116
+ export type FontUse = (typeof FONT_USES)[number];
117
+ /** How a model reads a use. */
118
+ export declare const FONT_USE_WORDS: Record<FontUse, string>;
112
119
  /** A typeface of the brand and what it is for: "Space Grotesk – headings". */
113
120
  export interface BrandFont {
114
121
  id: string;
@@ -118,7 +125,16 @@ export interface BrandFont {
118
125
  role: string;
119
126
  /** The weights the brand uses: 400, 600, … */
120
127
  weights: number[];
128
+ /** Its licence as the admin names it: "SIL Open Font License", "Adobe Fonts". */
129
+ license?: string;
130
+ /**
131
+ * All the licence allows it for; none: not said. What a step makes for another use is set in
132
+ * a system font.
133
+ */
134
+ uses?: FontUse[];
121
135
  }
136
+ /** The font's licence as a model reads it: ", licence …, may only be used for …". */
137
+ export declare function fontLicenseWords(f: Pick<BrandFont, "license" | "uses">): string;
122
138
  /** A text style of the type scale: "Headline XL – Space Grotesk 600, 48 px, line 90 %, −4 %". */
123
139
  export interface TextStyle {
124
140
  id: string;
@@ -180,6 +180,26 @@ export function ruleLines(rules) {
180
180
  })
181
181
  .join("\n");
182
182
  }
183
+ /** What a font's licence can allow it for, among what the wizards make. */
184
+ export const FONT_USES = ["web", "documents", "print", "images", "video"];
185
+ /** How a model reads a use. */
186
+ export const FONT_USE_WORDS = {
187
+ web: "web pages and widgets",
188
+ documents: "documents (PDF, Word, slides)",
189
+ print: "print",
190
+ images: "images and social graphics",
191
+ video: "video",
192
+ };
193
+ /** The font's licence as a model reads it: ", licence …, may only be used for …". */
194
+ export function fontLicenseWords(f) {
195
+ return [
196
+ f.license ? `licence ${f.license}` : "",
197
+ f.uses?.length ? `may only be used for ${f.uses.map((u) => FONT_USE_WORDS[u]).join(", ")}` : "",
198
+ ]
199
+ .filter(Boolean)
200
+ .map((x) => `, ${x}`)
201
+ .join("");
202
+ }
183
203
  export const FONT_WEIGHTS = [300, 400, 500, 600, 700, 800];
184
204
  /** A text style as a model and a person read it: "Space Grotesk 600, 48 px, line 90 %, tracking −4 %". */
185
205
  export function textStyleLine(style, fonts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wizards",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Make a wish. Get your wizard. It guides you step by step. Let AI do the work. Runs on your machine, on the AI subscription you already have.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "homepage": "https://engenty.ai",
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{t as r}from"./logo-C4V2_3Ar.js";import{t as i}from"./preload-helper-CNEI7N0N.js";import{$t as a,At as o,Et as s,Mt as c,Ot as l,gt as u,ht as d,in as f,mt as p,pt as m,wt as h,xt as g}from"./ui-D2SqIZeQ.js";import{ft as _,pt as v,wt as y}from"./index-BH0PYgov.js";import{c as b,f as x}from"./settings-menu-ace1vI3i.js";import{ReleaseNotes as S,loadReleases as C,releaseDate as w,releaseLabel as T}from"./ChangelogDialog-DynvQuuR.js";var E=e(t(),1),D=[{name:`engenty wizards`,description:{de:`KI-Wizards aus einer Beschreibung, mit einem Link geteilt.`,en:`AI wizards built from a description, shared with a link.`},homepage:`https://github.com/engenty/wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:{de:`Konnektoren, Datentabellen, Suche und die Engenties stammen aus dem engenty-Framework.`,en:`Connectors, data tables, search and the engenties come from the engenty framework.`},homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],O=[{name:`Mastra`,description:{de:`Agent-Framework hinter den KI-Schritten.`,en:`Agent framework behind the AI steps.`},homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:{de:`Modell-Aufrufe für Text, Bild, Video und Sprache.`,en:`Model calls for text, image, video and speech.`},homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:{de:`MCP-Server zum Bauen von Wizards, MCP-Client für Werkzeuge der Schritte.`,en:`MCP server for building wizards, MCP client for the steps' tools.`},homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:{de:`HTTP-API der Runtime.`,en:`The runtime's HTTP API.`},homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:{de:`Schema und Migrationen der Datenbanken.`,en:`Schema and migrations of the databases.`},homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:{de:`Eine Datenbank je Mandant, lokal als Datei oder bei Turso.`,en:`One database per tenant, a local file or at Turso.`},homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:{de:`Browser-Schritte sowie PDF- und PNG-Export.`,en:`Browser steps and the PDF and PNG export.`},homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`agentOS`,description:{de:`Sandbox für Code-Schritte ohne Docker.`,en:`Sandbox for code steps without Docker.`},homepage:`https://github.com/rivet-dev/agentos`,license:`Apache-2.0`},{name:`React`,description:{de:`UI-Bibliothek der Web-App.`,en:`UI library of the web app.`},homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:{de:`Build-Werkzeug der Web-App.`,en:`Build tool of the web app.`},homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:{de:`Styling der Oberfläche.`,en:`Styling of the interface.`},homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:{de:`Das Diagramm der Schritte im Editor.`,en:`The diagram of steps in the editor.`},homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:{de:`Server-Daten in der Web-App.`,en:`Server data in the web app.`},homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:{de:`Das Terminal auf der Seite, in dem sich KI-Clients anmelden.`,en:`The terminal on the page where AI clients sign in.`},homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:{de:`Icons.`,en:`Icons.`},homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:{de:`Schrift der Oberfläche.`,en:`Typeface of the interface.`},homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:{de:`Schrift der Überschriften.`,en:`Typeface of the headings.`},homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:{de:`Erzeugt den Changelog aus den Commits.`,en:`Generates the changelog from the commits.`},homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],k=e(n(),1),A=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function j({name:e,homepage:t,version:n,license:r,description:i}){return(0,k.jsxs)(`li`,{className:`py-2.5`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,k.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,k.jsx)(a,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,k.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,k.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,k.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:r})]}),i?(0,k.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:i}):null]})}function M({title:e,hint:t,children:n}){return(0,k.jsxs)(`section`,{className:`mt-6`,children:[(0,k.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,k.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function N({credits:e}){return(0,k.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,k.jsx)(j,{name:e.name,homepage:e.homepage,license:e.license,description:e.description[l]},e.name))})}function P({label:e,packages:t}){return(0,k.jsxs)(`div`,{className:`mt-4`,children:[(0,k.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,k.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,k.jsx)(j,{...e},e.name))})]})}function F({active:e}){let[t,n]=(0,E.useState)(null),[r,a]=(0,E.useState)(``);(0,E.useEffect)(()=>{if(!e||t)return;let r=!1;return i(()=>import(`./oss-credits-BQQX0kvk.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,E.useEffect)(()=>{e||a(``)},[e]);let s=r.trim().toLowerCase(),c=e=>s?e.filter(e=>A(s,e.name,e.license,e.description.de,e.description.en)):e,l=e=>s?e.filter(e=>A(s,e.name,e.license,e.version)):e,d=c(D),f=c(O),m=t?[{id:`shared`,label:o(`about.creditsShared`),packages:l(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:l(e.packages)}))].filter(e=>e.packages.length>0):[],h=d.length===0&&f.length===0&&m.length===0;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:o(`about.creditsHint`)}),(0,k.jsx)(u,{type:`search`,value:r,placeholder:o(`about.search`),onChange:e=>a(e.target.value)}),d.length>0?(0,k.jsx)(M,{title:o(`about.creditsProduct`),children:(0,k.jsx)(N,{credits:d})}):null,f.length>0?(0,k.jsx)(M,{title:o(`about.creditsBuiltWith`),children:(0,k.jsx)(N,{credits:f})}):null,t===null?(0,k.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,k.jsx)(g,{})}):m.length>0?(0,k.jsx)(M,{title:o(`about.creditsDeps`),hint:s?void 0:o(`about.creditsDepsHint`),children:m.map(e=>(0,k.jsx)(P,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&h?(0,k.jsx)(p,{children:o(`about.noMatches`)}):null]})}var I=[`new`,`earlier`,`credits`],L=e=>o(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),R=e=>e===1?o(`about.change`):o(`about.changes`,{n:e});function z({open:e,onClose:t,me:n}){let i=n?.mode===`local`,{data:a,latest:l}=v(i&&e),[u,p]=(0,E.useState)(null),[D,O]=(0,E.useState)(`new`),A=x(I.indexOf(D)),j=a?.newer&&l?l:y;(0,E.useEffect)(()=>{if(!e)return;let t=!1;return p(null),C(j===`0.4.0`?void 0:j).then(e=>{t||p(e)}),()=>{t=!0}},[e,j]);let M=u?.find(e=>e.version===`v${j}`)??u?.[0]??null,N=u?.filter(e=>e!==M)??[],P=i?a?.kind??null:`cloud`;return(0,k.jsxs)(m,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,k.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,k.jsx)(d,{label:o(`common.close`),onClick:t,children:(0,k.jsx)(c,{className:`size-4`})})}),(0,k.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,k.jsx)(r,{size:96}),(0,k.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,k.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,k.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,k.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[o(`about.version`,{v:y}),P?` · ${o(`about.kind.${P}`)}`:``]})]}),i?(0,k.jsx)(`div`,{className:`mt-5`,children:(0,k.jsx)(_,{enabled:e})}):null,(0,k.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,k.jsx)(h,{value:D,onChange:O,options:I.map(e=>({id:e,label:L(e)})),label:o(`about.title`)})}),(0,k.jsxs)(`div`,{className:s(`mt-5`,b(A)),children:[D===`new`?u===null?(0,k.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,k.jsx)(g,{})}):M?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[T(M),(0,k.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:w(M)})]}),(0,k.jsx)(`div`,{className:`mt-3`,children:(0,k.jsx)(S,{release:M})})]}):(0,k.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:o(`about.changelogEmpty`)}):null,D===`earlier`?(0,k.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:N.map(e=>(0,k.jsxs)(`details`,{className:`group/r py-2`,children:[(0,k.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,k.jsx)(f,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,k.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:T(e)}),(0,k.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:w(e)}),(0,k.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:R(e.commits.length)})]}),(0,k.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,k.jsx)(S,{release:e})})]},e.version??`unreleased`))}):null,D===`credits`?(0,k.jsx)(F,{active:!0}):null]},D)]})}export{z as AboutDialog};
@@ -1,10 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{A as r,At as i,B as a,C as o,D as s,Dt as c,Et as l,Ft as u,Gt as d,Ht as f,It as p,Lt as m,M as h,N as g,Nt as _,Ot as v,P as y,Rt as b,S as x,Tt as S,Y as C,at as w,c as T,ht as E,it as D,j as O,k,ln as A,ot as j,pn as M,qt as N,rt as P,sn as F,tt as I,u as L,vt as ee,x as R,xt as z,y as B}from"./ui-D2SqIZeQ.js";import{t as te}from"./phone-Bt1cyWpY.js";import{$t as ne,Ht as re,It as ie,_n as ae,bt as oe,t as se,tn as ce,xt as le,yt as ue}from"./index-BH0PYgov.js";import{n as de}from"./RunnerView-BPPmlv9z.js";var fe={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};fe.node;var pe=M(fe),me={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};me.node;var he=M(me),ge={name:`video-off`,size:24,node:[[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};ge.node;var V=M(ge),_e={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};_e.node;var ve=M(_e),ye=ae(),H=e(t(),1),U=e(n(),1),be=typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches;function xe({since:e}){let[t,n]=(0,H.useState)(Date.now());if((0,H.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),!e)return null;let r=Math.max(0,Math.floor((t-e)/1e3)),i=String(Math.floor(r/60)).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return(0,U.jsxs)(`span`,{className:`font-mono text-[0.8125rem] text-white/60 tabular-nums`,children:[i,`:`,a]})}function W({label:e,on:t,danger:n,busy:r,onClick:i,children:a}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":t,disabled:r,onClick:i,className:l(`flex size-12 items-center justify-center rounded-full transition disabled:opacity-50`,n?`bg-rose text-white hover:brightness-110`:t===!1?`bg-white text-neutral-900 hover:bg-white/90`:`bg-white/15 text-white hover:bg-white/25`),children:r?(0,U.jsx)(z,{className:`size-5`}):a})}function Se({voice:e}){let t=(0,H.useRef)(null),{captions:n}=e;return(0,H.useEffect)(()=>{n.length&&t.current?.scrollIntoView({block:`end`})},[n]),n.length?(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 sm:px-5`,children:(0,U.jsxs)(`ol`,{className:`mx-auto flex max-w-[720px] flex-col gap-2 py-2`,children:[n.map(e=>(0,U.jsx)(`li`,{className:l(`text-[0.9375rem] leading-snug`,e.who===`bot`?`text-white/95`:`text-right text-white/50`),children:e.text},e.id)),(0,U.jsx)(`div`,{ref:t})]})}):null}function Ce({voice:e,view:t,video:n,className:r}){let a=e.state===`live`,o=e.state===`connecting`,[s,c]=(0,H.useState)(null),[d,f]=(0,H.useState)(!1);(0,H.useEffect)(()=>{c(a?Date.now():null)},[a]);let p=async()=>{f(!1),await e.start(),n&&await e.startCamera()},m=()=>{e.stop(),f(!0)},h=n||e.camera,g=[...e.captions].reverse().find(e=>e.who===`bot`),v=[...e.captions].reverse().find(e=>e.who===`me`),y=e.speaking?i(`talk.speaking`):e.listening?i(`talk.listening`):a?i(`talk.live`):o?i(`talk.connecting`):d?i(`video.ended`):``;return(0,U.jsxs)(`section`,{className:l(`relative flex min-h-0 flex-col bg-neutral-950 text-white`,`safe-top`,r),children:[(0,U.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-3 px-4 sm:px-5`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1 truncate font-display font-semibold text-[1rem] tracking-tight`,children:t?.wizard.title??``}),y?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[a?(0,U.jsx)(`span`,{className:l(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,y]}):null,(0,U.jsx)(xe,{since:s})]}),(0,U.jsxs)(`div`,{className:l(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,h?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!h&&a&&e.captions.length?`h-[38%]`:h?``:`flex-1`),children:[(0,U.jsxs)(`div`,{className:l(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!h&&`hidden`),children:[(0,U.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:l(`absolute inset-0 h-full w-full object-cover`,e.facing===`user`&&`-scale-x-100`,e.camera?`block`:`hidden`)}),e.camera?null:(0,U.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 text-white/50`,children:[(0,U.jsx)(V,{className:`size-8`}),(0,U.jsx)(`span`,{className:`text-[0.8125rem]`,children:i(`video.cameraOff`)})]}),(0,U.jsxs)(`span`,{className:`absolute bottom-2 left-3 rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:[i(`video.you`),e.muted?(0,U.jsx)(ce,{className:`ml-1.5 inline size-3`}):null]})]}),(0,U.jsxs)(`div`,{className:l(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,h?`bg-neutral-900`:`bg-transparent`,h&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,U.jsx)(`div`,{className:l(`rounded-full transition-shadow duration-500`,!h&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!h&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,U.jsx)(ie,{kind:t?.wizard.avatar??`round`,size:h?140:200,fluffy:!0,interactive:!1})}),h?(0,U.jsx)(`span`,{className:`absolute bottom-2 left-3 max-w-[85%] truncate rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:t?.wizard.title??``}):null]})]}),a&&!h?(0,U.jsx)(Se,{voice:e}):a&&(g||v)?(0,U.jsx)(`div`,{className:`shrink-0 px-4 pb-2 sm:px-5`,children:(0,U.jsxs)(`div`,{className:`mx-auto max-w-[720px] space-y-1 text-center`,children:[v?(0,U.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:v.text}):null,g?(0,U.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:g.text}):null]})}):null,e.error?(0,U.jsx)(`p`,{className:`shrink-0 px-5 pb-2 text-center text-[0.8125rem] text-rose`,children:e.error}):null,(0,U.jsx)(`div`,{className:`flex shrink-0 items-center justify-center gap-3 px-4 pt-1 pb-4`,children:a?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(W,{label:i(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,U.jsx)(ce,{className:`size-5`}):(0,U.jsx)(N,{className:`size-5`})}),(0,U.jsx)(W,{label:i(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,U.jsx)(_,{className:`size-5`}):(0,U.jsx)(V,{className:`size-5`})}),e.camera&&be?(0,U.jsx)(W,{label:i(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,U.jsx)(u,{className:`size-5`})}):null,(0,U.jsx)(W,{label:i(`video.leave`),danger:!0,onClick:m,children:(0,U.jsx)(ne,{className:`size-5`})})]}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:o||!t?.talk,onClick:()=>void p(),className:`flex h-12 items-center gap-2 rounded-full bg-emerald-500 px-6 font-medium text-[0.9375rem] text-white transition hover:brightness-110 disabled:opacity-50`,children:[o?(0,U.jsx)(z,{className:`size-4`}):n?(0,U.jsx)(_,{className:`size-5`}):(0,U.jsx)(N,{className:`size-5`}),i(d?`video.rejoin`:n?`video.join`:`talk.start`)]}),!d&&!e.error?(0,U.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:i(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var we=e=>a[e.kind]!==`device`,Te=1024,Ee=4e3;function De(e,t){return e?e.length>t?`${e.slice(0,t)} …`:e:``}function Oe(e,t,n=!1){let r=[`status: ${e.status}`,`camera: ${n?`on`:`off`}`];if(e.ask)return r.push(e.ask.kind===`confirm`?`question: the step wants to "${e.ask.action.summary}" in ${e.ask.service}; answer_ask allows or skips it`:`question: a sign-in at ${e.ask.site.host}; the person types it on the screen, wait`),r.join(`
2
- `);if(e.status===`running`){let t=[...e.events].reverse().find(e=>e.type===`tool`||e.type===`info`||e.type===`step_started`);return r.push(`working on: ${e.step?.title??``}`),t&&r.push(`doing: ${c(t)}`),r.join(`
3
- `)}if(e.status===`done`){r.push(`done. made:`);for(let{step:t,output:n}of e.shown)r.push(`- ${t.title}: ${De(n?.text,400)||`(a file, on the screen)`}`);return r.join(`
4
- `)}if(e.status===`failed`)return r.push(`failed: ${e.error??``}; go_back or the person retries on the screen`),r.join(`
5
- `);if(t){r.push(`page: ${t.step.title}`);for(let e of t.fields){let n=t.values[e.id],i=n!=null&&n!==``,a=we(e)?`by voice`:e.kind===`image`?`with the camera (take_photo) or on the screen`:`on the screen only`,o=e.options?.length?`; options: ${e.options.join(` | `)}`:``;r.push(`- field ${e.id} (${e.kind}${e.required?`, required`:``}, ${a}): ${e.label}${e.help?` – ${e.help}`:``}${o}${i?` = ${De(String(Array.isArray(n)?n.join(`, `):n),120)}`:` = (open)`}`)}return r.join(`
6
- `)}if(e.step?.type===`review`){r.push(`review: ${e.step.title}`);for(let{step:t,output:n}of e.shown)r.push(`- ${t.id} "${t.title}": ${De(n?.text,600)||`(a picture or file, on the screen)`}`);return r.push(`regenerate allowed: ${e.step.regenerate?`yes`:`no`}`),r.join(`
7
- `)}return r.push(`step: ${e.step?.title??``}`),r.join(`
8
- `)}function ke(e,t,n,r){let[a,o]=(0,H.useState)(`off`),[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(`environment`),[_,v]=(0,H.useState)(!1),[y,b]=(0,H.useState)([]),x=(0,H.useRef)(null),S=(0,H.useRef)(null),C=(0,H.useRef)(0),w=(0,H.useRef)(!1);w.current=p;let T=(0,H.useRef)(null),E=(0,H.useRef)(null),D=(0,H.useRef)(null),O=(0,H.useRef)(null),k=(0,H.useRef)(t);k.current=t;let A=(0,H.useRef)(r);A.current=r;let j=(0,H.useRef)(n);j.current=n;let M=(0,H.useRef)(``),N=(0,H.useCallback)(e=>{let t=E.current;t&&t.readyState===`open`&&t.send(JSON.stringify(e))},[]),P=(0,H.useCallback)(()=>{let e=x.current;if(!w.current||!e||e.videoWidth===0)return null;let t=Math.min(1,Te/e.videoWidth),n=document.createElement(`canvas`);return n.width=Math.round(e.videoWidth*t),n.height=Math.round(e.videoHeight*t),n.getContext(`2d`)?.drawImage(e,0,0,n.width,n.height),n.toDataURL(`image/jpeg`,.75)},[]),F=(0,H.useCallback)(()=>{for(let e of S.current?.getTracks()??[])e.stop();S.current=null,x.current&&(x.current.srcObject=null),m(!1)},[]),I=(0,H.useCallback)(async e=>{if(S.current)return;let t=e??`environment`;try{let e=await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:t},width:{ideal:1280}},audio:!1});S.current=e;let n=e.getVideoTracks()[0]?.getSettings().facingMode;g(n===`user`||n===`environment`?n:t),x.current&&(x.current.srcObject=e,await x.current.play().catch(()=>void 0)),m(!0)}catch(e){c(e.name===`NotAllowedError`?i(`talk.cameraDenied`):e.message)}},[]),ee=(0,H.useCallback)(async()=>{let e=h===`user`?`environment`:`user`;F(),await I(e)},[h,F,I]),R=(0,H.useCallback)(()=>{v(e=>{for(let t of O.current?.getAudioTracks()??[])t.enabled=e;return!e})},[]),z=(0,H.useCallback)(()=>{F(),E.current?.close(),E.current=null,T.current?.close(),T.current=null;for(let e of O.current?.getTracks()??[])e.stop();O.current=null,D.current&&=(D.current.srcObject=null,D.current.remove(),null),M.current=``,u(!1),f(!1),v(!1),o(`off`)},[F]);(0,H.useEffect)(()=>()=>z(),[z]);let B=(0,H.useCallback)(async(t,n)=>{let r=k.current,i=A.current,a=j.current;switch(t){case`get_state`:return r?Oe(r,i,w.current):`no run`;case`look`:{let e=P();return e?(N({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:`[camera] what the person shows right now`},{type:`input_image`,image_url:e}]}}),`a picture arrived as the next message`):`the camera is off; ask the person to switch it on`}case`take_photo`:{if(!i)return`no page is open`;let t=i.fields.find(e=>e.id===String(n.field??``));if(t?.kind!==`image`)return`no such photo field on this page`;let r=P();if(!r)return`the camera is off; ask the person to switch it on`;try{let n=await(await fetch(r)).blob(),a=new File([n],`photo-${Date.now()}.jpg`,{type:`image/jpeg`}),o=await L.upload(`/api/runs/${e}/uploads`,a),s=i.values[t.id],c=t.multiple?[...Array.isArray(s)?s:s?[s]:[],o.id]:o.id,l=i.setField(t.id,c);return l?`refused: ${l}`:`the photo is in the field`}catch(e){return`failed: ${e.message}`}}case`set_field`:{if(!i)return`no page is open`;let e=i.setField(String(n.field??``),n.value);return e?`refused: ${e}`:`kept`}case`submit_page`:{if(!i)return`no page is open`;let e=i.fields.filter(e=>e.required&&we(e)&&e.kind!==`toggle`&&(i.values[e.id]===void 0||i.values[e.id]===null||i.values[e.id]===``));return e.length?`still open: ${e.map(e=>e.id).join(`, `)}`:(i.submit(),`sent; wait for the next state`)}case`accept_review`:return r?.step?.type===`review`?await a.accept(r.step.id)?`accepted`:a.error??`refused`:`no review is open`;case`regenerate`:return r?.step?.type===`review`?await a.regenerate(r.step.id,String(n.target??``),String(n.note??``))?`the wizard makes it again; wait`:a.error??`refused`:`no review is open`;case`answer_ask`:if(!r?.ask)return`no question is open`;try{return await L.post(`/api/runs/${e}/ask/${r.ask.id}`,{type:n.allow?`done`:`skip`}),n.allow?`allowed`:`skipped`}catch(e){return`refused: ${e.message}`}case`go_back`:return await a.back()?`went back; wait for the state`:a.error??`refused`;default:return`unknown tool ${t}`}},[e,P,N]),te=(0,H.useCallback)(async()=>{if(!T.current){c(null),b([]),o(`connecting`);try{let t=await L.post(`/api/runs/${e}/talk`),n=await navigator.mediaDevices.getUserMedia({audio:!0});O.current=n;let r=new RTCPeerConnection;T.current=r;let a=document.createElement(`audio`);a.autoplay=!0,a.setAttribute(`playsinline`,``),document.body.append(a),D.current=a,r.ontrack=e=>{a.srcObject=e.streams[0]};for(let e of n.getTracks())r.addTrack(e,n);let s=r.createDataChannel(`oai-events`);E.current=s,s.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}switch(t.type){case`output_audio_buffer.started`:u(!0);break;case`output_audio_buffer.stopped`:case`output_audio_buffer.cleared`:u(!1);break;case`input_audio_buffer.speech_started`:{f(!0);let e=Date.now()-C.current>Ee?P():null;e&&(C.current=Date.now(),N({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:`[camera] what the person shows while speaking`},{type:`input_image`,image_url:e}]}}));break}case`input_audio_buffer.speech_stopped`:f(!1);break;case`response.output_audio_transcript.done`:case`conversation.item.input_audio_transcription.completed`:{let e=String(t.transcript??``).trim();if(e){let n=t.type===`response.output_audio_transcript.done`?`bot`:`me`;b(t=>[...t.slice(-199),{id:`${Date.now()}:${n}`,who:n,text:e}])}break}case`response.function_call_arguments.done`:{let e=String(t.name??``),n=String(t.call_id??``),r={};try{r=JSON.parse(String(t.arguments??`{}`))}catch{}B(e,r).then(e=>{N({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:n,output:e}}),N({type:`response.create`})});break}case`error`:c(String(t.error?.message??`error`))}},s.onopen=()=>{o(`live`);let e=k.current;e&&(M.current=Oe(e,A.current,w.current),N({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:`[state]\n${M.current}\n\nGreet the person in one sentence and ask the first open field.`}]}}),N({type:`response.create`}))},s.onclose=()=>{T.current===r&&z()};let l=await r.createOffer();await r.setLocalDescription(l);let d=await fetch(t.endpoint,{method:`POST`,headers:{authorization:`Bearer ${t.clientSecret}`,"content-type":`application/sdp`},body:l.sdp});if(!d.ok)throw Error(`${i(`talk.failed`)} (${d.status})`);await r.setRemoteDescription({type:`answer`,sdp:await d.text()})}catch(e){z(),c(e.name===`NotAllowedError`?i(`chat.micDenied`):e.message),o(`error`)}}},[e,B,P,N,z]);return(0,H.useEffect)(()=>{if(a!==`live`||!t)return;let e=Oe(t,r,p);if(e===M.current)return;let n=M.current;M.current=e,N({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:`[state]\n${e}`}]}}),(t.status===`running`&&n.startsWith(`status: running`)&&!n.includes(`working on: `)||t.status!==`running`||n.split(`
9
- `)[1]!==e.split(`
10
- `)[1])&&N({type:`response.create`})},[a,t,r,p,N]),{state:a,error:s,speaking:l,listening:d,start:te,stop:z,camera:p,facing:h,startCamera:I,stopCamera:F,flipCamera:ee,muted:_,toggleMute:R,captions:y,video:x}}var G=(e,t,n)=>({key:e,who:`bot`,node:t,...n}),K=(e,t,n)=>({key:e,who:`me`,node:t,...n}),Ae=(0,H.createContext)(null),q=(0,H.createContext)(null);function je(){return(0,H.useContext)(q)?.voice??null}function Me({children:e}){let t=(0,H.useContext)(Ae);return t?(0,ye.createPortal)(e,t):null}function Ne({header:e,footer:t,children:n}){let[r,i]=(0,H.useState)(null),a=(0,H.useRef)(null),o=(0,H.useRef)(null),s=(0,H.useRef)(!0);return(0,H.useLayoutEffect)(()=>{let e=a.current,t=o.current;if(!e||!t)return;let n=e.scrollTop,r=()=>{e.scrollHeight-e.scrollTop-e.clientHeight<120?s.current=!0:e.scrollTop<n&&(s.current=!1),n=e.scrollTop},i=null,c=new ResizeObserver(()=>{let r=t.querySelector(`[data-anchor]`);r&&r!==i?(i=r,e.scrollTop+=r.getBoundingClientRect().top-e.getBoundingClientRect().top-12,s.current=!1,n=e.scrollTop):s.current&&(e.scrollTop=e.scrollHeight)});return e.scrollTop=e.scrollHeight,e.addEventListener(`scroll`,r,{passive:!0}),c.observe(t),c.observe(e),()=>{c.disconnect(),e.removeEventListener(`scroll`,r)}},[]),(0,U.jsx)(Ae.Provider,{value:r,children:(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[e,(0,U.jsx)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,U.jsx)(`div`,{ref:o,className:`mx-auto flex w-full max-w-[760px] flex-col gap-3 px-3 pt-5 pb-4 sm:px-6`,children:n})}),(0,U.jsxs)(`div`,{className:`shrink-0 border-border-soft border-t bg-background`,onPointerDownCapture:()=>{s.current=!0},onKeyDownCapture:()=>{s.current=!0},children:[(0,U.jsx)(`div`,{ref:i,className:`mx-auto w-full max-w-[760px] px-3 pt-3 sm:px-6`}),t]})]})})}function J({avatar:e,lines:t}){let n=(0,H.useContext)(q),r=(0,H.useMemo)(()=>t.map(e=>({key:e.key,who:e.who,spoken:!e.bare&&!e.wide})),[t]),a=(0,H.useCallback)(e=>{let t=document.querySelector(`[data-say="${CSS.escape(e)}"]`);return t?.querySelector(`[data-say-text]`)?.getAttribute(`data-say-text`)??t?.innerText??null},[]);le(!!n?.readAloud,n?.lang??v,r,a);let o=[];for(let e of t){let t=o.at(-1);t&&t.who===`bot`&&e.who===`bot`?t.lines.push(e):o.push({who:e.who,lines:[e]})}return o.map((t,n)=>t.who===`bot`?(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,U.jsx)(`div`,{className:`sticky top-1 shrink-0 pt-0.5`,children:(0,U.jsx)(ie,{kind:e,size:30,interactive:n>=o.length-2})}),(0,U.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1.5`,children:t.lines.map(e=>(0,U.jsx)(`div`,{"data-anchor":e.anchor?``:void 0,"data-say":e.key,className:l(`animate-rise`,e.bare?`w-full pt-1`:`rounded-2xl rounded-tl-md text-[0.9375rem] text-ink leading-relaxed`,!e.bare&&(e.wide?l(`w-full bg-card p-4 shadow-soft ring-1 ring-border-soft`,e.wide===`most`&&`md:w-4/5`):`max-w-[min(36rem,100%)] bg-card px-4 py-2.5 shadow-soft ring-1 ring-border-soft`),e.tone===`error`&&`bg-rose-tint text-rose shadow-none ring-0`),children:e.node},e.key))})]},t.lines[0].key):t.lines.map(e=>(0,U.jsxs)(`div`,{className:`flex animate-rise flex-col items-end gap-1 pl-10`,children:[(0,U.jsx)(`div`,{className:`max-w-[min(32rem,100%)] whitespace-pre-wrap break-words rounded-2xl rounded-br-md bg-primary px-4 py-2.5 text-[0.9375rem] text-primary-foreground leading-relaxed`,children:e.node}),e.onEdit?(0,U.jsxs)(`button`,{type:`button`,onClick:e.onEdit,className:`inline-flex items-center gap-1 px-1 text-[0.75rem] text-ink-4 transition hover:text-ink-2 coarse:min-h-9`,children:[(0,U.jsx)(f,{className:`size-3`}),` `,i(`chat.change`)]}):null]},e.key)))}function Pe(){return(0,U.jsx)(`span`,{className:`inline-flex items-center gap-1 py-1.5`,role:`status`,"aria-label":i(`run.working`),children:[0,1,2].map(e=>(0,U.jsx)(`span`,{className:`size-1.5 animate-typing rounded-full bg-ink-3`,style:{animationDelay:`${e*160}ms`}},e))})}function Y({children:e}){return(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:e})}var X=(e,t)=>G(e,(0,U.jsx)(Y,{children:t}),{bare:!0});function Z({onClick:e,children:t,primary:n,on:r,disabled:i,busy:a}){return(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":r,disabled:i||a,onClick:e,className:l(`inline-flex h-10 items-center gap-1.5 rounded-full px-4 font-medium text-[0.875rem] transition active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50 coarse:h-11`,n?`bg-primary text-primary-foreground hover:brightness-[1.06]`:r?`bg-ember-tint text-ink ring-1 ring-ember`:`bg-card text-ink-2 ring-1 ring-input hover:text-ink hover:ring-ink-4`),children:[a?(0,U.jsx)(z,{className:`size-4`}):null,t]})}function Fe({initial:e=``,placeholder:t,multiline:n,inputProps:r,busy:a,disabled:o,inputRef:s,onSend:c}){let[u,d]=(0,H.useState)(e),f=(0,H.useRef)(null),m=s??f,h=(0,H.useContext)(q),g=T(u,d,{endpoint:h?`/api/runs/${h.runId}/transcribe`:void 0}),v=!!h&&g.supported&&!o;(0,H.useEffect)(()=>{if(!v)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.shiftKey&&e.key.toLowerCase()===`m`&&(e.preventDefault(),g.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v,g.toggle]),(0,H.useEffect)(()=>{!P&&!o&&m.current?.focus()},[o,m]);let y=()=>{a||o||(g.listening&&g.toggle(),c(u)!==!1&&d(``))},b=g.listening?i(`chat.listening`):g.processing?i(`chat.transcribing`):t,x=h?.voice??null,C=!!h?.call,w=h&&!C&&(ue||v||x)?(0,U.jsxs)(`div`,{className:`mb-1 flex shrink-0 items-center`,children:[x?(0,U.jsx)(E,{label:i(x.state===`live`?`talk.stop`:x.state===`connecting`?`talk.connecting`:`talk.start`),"aria-pressed":x.state===`live`,disabled:x.state===`connecting`,onClick:()=>x.state===`live`?x.stop():void x.start(),className:l(`size-9`,x.state===`live`&&`bg-rose-tint text-rose hover:bg-rose-tint hover:text-rose`,x.state===`off`&&h.talk&&`bg-primary text-primary-foreground hover:bg-primary`),children:x.state===`connecting`?(0,U.jsx)(z,{className:`size-4`}):x.state===`live`?(0,U.jsx)(ne,{className:`size-4`}):(0,U.jsx)(te,{className:`size-4`})}):null,x?.state===`live`?(0,U.jsx)(E,{label:i(x.camera?`talk.cameraOff`:`talk.camera`),"aria-pressed":x.camera,onClick:()=>x.camera?x.stopCamera():void x.startCamera(),className:l(`size-9`,x.camera&&`text-ink`),children:x.camera?(0,U.jsx)(_,{className:`size-4`}):(0,U.jsx)(V,{className:`size-4`})}):null,ue?(0,U.jsx)(E,{label:i(h.readAloud?`chat.readAloudOff`:`chat.readAloud`),"aria-pressed":h.readAloud,onClick:()=>h.setReadAloud(!h.readAloud),className:l(`size-9`,h.readAloud&&`text-ink`),children:h.readAloud?(0,U.jsx)(re,{className:`size-4`}):(0,U.jsx)(ve,{className:`size-4`})}):null,v?(0,U.jsx)(E,{label:i(g.listening?`chat.dictateStop`:`chat.dictate`),"aria-pressed":g.listening,disabled:g.processing,onClick:g.toggle,className:l(`size-9`,g.listening&&`bg-rose-tint text-rose hover:bg-rose-tint hover:text-rose`),children:g.processing?(0,U.jsx)(z,{className:`size-4`}):g.listening?(0,U.jsx)(p,{className:`size-3.5 animate-pulse-dot fill-current`}):(0,U.jsx)(N,{className:`size-4`})}):null]}):null;return(0,U.jsxs)(`form`,{className:`pb-3`,onSubmit:e=>{e.preventDefault(),y()},children:[x&&!C?(0,U.jsx)(`video`,{ref:x.video,muted:!0,playsInline:!0,autoPlay:!0,className:l(`mb-2 ml-auto w-32 rounded-xl bg-black object-cover shadow-soft ring-1 ring-border-soft`,x.camera?`block`:`hidden`)}):null,(0,U.jsxs)(`div`,{className:l(`flex items-end gap-1 rounded-[1.375rem] border border-input bg-card pr-1.5 pl-1 transition focus-within:border-focus focus-within:ring-4 focus-within:ring-focus-glow`,o&&`opacity-60`),children:[w,n?(0,U.jsx)(S,{ref:m,minRows:1,maxRows:6,value:u,disabled:o,placeholder:b,autoCapitalize:`sentences`,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!P&&!e.nativeEvent.isComposing&&(e.preventDefault(),y())},className:`min-h-11 border-0 bg-transparent py-2.5 shadow-none focus:ring-0`}):(0,U.jsx)(`input`,{ref:m,...r,value:u,disabled:o,placeholder:b,enterKeyHint:`send`,onChange:e=>d(e.target.value),className:`h-11 min-w-0 flex-1 bg-transparent px-3 text-[0.9375rem] text-ink outline-none placeholder:text-ink-4`}),(0,U.jsx)(`button`,{type:`submit`,"aria-label":i(`chat.send`),title:i(`chat.send`),disabled:a||o,className:`mb-1 flex size-9 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground transition hover:brightness-[1.06] disabled:opacity-40`,children:a?(0,U.jsx)(z,{className:`size-4`}):(0,U.jsx)(A,{className:`size-4`})})]}),g.error?(0,U.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-rose`,children:g.error===`denied`?i(`chat.micDenied`):g.error}):C?null:x?.error?(0,U.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-rose`,children:x.error}):x?.state===`live`?(0,U.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-ink-3`,children:x.speaking?i(`talk.speaking`):x.listening?i(`talk.listening`):i(`talk.live`)}):h?.talk&&x?.state===`off`?(0,U.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-ink-3`,children:i(`talk.hint`)}):null]})}function Q({placeholder:e=i(`chat.above`)}){return(0,U.jsx)(Me,{children:(0,U.jsx)(Fe,{disabled:!0,placeholder:e,onSend:()=>!1})})}function Ie(e){let t=a[e.kind];return t===`typed`&&!e.scan?`typed`:t===`tapped`?`tapped`:`control`}var Le=e=>e==null||e===``||Array.isArray(e)&&e.length===0;function Re(e,t){let n=e.kind===`toggle`||e.kind===`connection`||e.kind===`list`;if(Le(t))return e.required&&!n?i(`chat.required`):null;let r=String(t).trim();if(e.kind===`email`&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))return i(`chat.badEmail`);if(e.kind===`url`)try{new URL(r)}catch{return i(`chat.badUrl`)}return e.kind===`number`&&!Number.isFinite(Number(r.replace(`,`,`.`)))?i(`chat.badNumber`):Array.isArray(t)&&e.multiple&&e.min&&t.length<e.min?i(`run.filesMin`,{n:t.length,min:e.min}):null}function ze(e,t){let n=e.kind===`textarea`?t.replace(/\s+$/,``):t.trim();if(n)return e.kind===`url`&&!/^[a-z][a-z0-9+.-]*:/i.test(n)?`https://${n}`:n}function Be({field:e}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e.label}),e.help?(0,U.jsx)(`span`,{className:`mt-0.5 block text-[0.8125rem] text-ink-3`,children:e.help}):null]})}function Ve({step:e,only:t}){return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e.title}),e.description?(0,U.jsx)(`span`,{className:`mt-0.5 block text-ink-2`,children:e.description}):null,t?.help?(0,U.jsx)(`span`,{className:`mt-1 block text-[0.8125rem] text-ink-3`,children:t.help}):null]})}function He({field:e,value:t,runId:n}){if(e.kind===`connection`)return(0,U.jsx)(U.Fragment,{children:typeof t==`string`&&t?t:i(`chat.connected`)});if(e.kind===`list`)return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,U.jsx)(F,{className:`size-4`}),` `,i(`chat.checked`)]});if(e.kind===`toggle`)return(0,U.jsx)(U.Fragment,{children:i(t===!0?`run.yes`:`run.no`)});if(Le(t))return(0,U.jsx)(`span`,{className:`italic opacity-80`,children:i(`chat.skipped`)});switch(e.kind){case`multiselect`:return(0,U.jsx)(U.Fragment,{children:t.join(`, `)});case`date`:{let e=new Date(`${String(t)}T00:00`);return(0,U.jsx)(U.Fragment,{children:Number.isNaN(e.getTime())?String(t):new Intl.DateTimeFormat(v,{dateStyle:`long`}).format(e)})}case`color`:return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`size-4 rounded-full ring-1 ring-white/50`,style:{background:String(t)}}),String(t)]});case`image`:case`signature`:return(0,U.jsx)(`span`,{className:`-mx-1.5 flex flex-wrap gap-1.5`,children:(Array.isArray(t)?t:[String(t)]).map(t=>(0,U.jsx)(`img`,{src:B(`/api/runs/${n}/assets/${t}`),alt:``,className:l(`h-16 rounded-lg bg-white`,e.kind===`image`?`w-16 object-cover`:`object-contain px-1`)},t))});case`file`:{let e=Array.isArray(t)?t.length:1;return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,U.jsx)(d,{className:`size-4`}),` `,i(e===1?`chat.file`:`chat.files`,{n:e})]})}case`audio`:{let e=t.seconds;return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,U.jsx)(N,{className:`size-4`}),` `,i(`chat.voice`),e?` · ${Math.round(e)} s`:``]})}case`location`:{let e=t;return(0,U.jsx)(U.Fragment,{children:e.label||`${e.lat?.toFixed(5)}, ${e.lng?.toFixed(5)}`})}case`items`:return(0,U.jsx)(U.Fragment,{children:i(`chat.rows`,{n:Array.isArray(t)?t.length:0})});default:return(0,U.jsx)(U.Fragment,{children:String(t)})}}function Ue(e,t,n,r,i,a){let o=[G(t,(0,U.jsx)(Ve,{step:e,only:a}))];for(let e of i)a||o.push(G(`${t}:${e.id}`,(0,U.jsx)(Be,{field:e}))),o.push(K(`${t}:${e.id}:a`,(0,U.jsx)(He,{field:e,value:n[e.id],runId:r})));return o}var We=(e,t)=>e.fields.filter(e=>!e.when&&!C(e)||t[e.id]!==void 0&&t[e.id]!==null);function Ge(e,t){let n=[];e.wizard.description&&n.push(G(`hello`,e.wizard.description)),e.wizard.intro&&n.push(G(`intro`,e.wizard.intro));for(let[t,r]of e.answered.entries()){let a=`${t}:${r.id}`;if(r.type===`page`){let t=r.fields.length===1?r.fields[0]:void 0;n.push(...Ue(r,a,e.values,e.id,We(r,e.values),t))}else r.type===`review`&&(n.push(G(a,(0,U.jsx)(`span`,{className:`font-medium`,children:r.title}))),n.push(K(`${a}:a`,i(`run.accept`))))}let r=n.at(-1);return t&&r?.who===`me`&&(n[n.length-1]={...r,onEdit:t}),n}function Ke(e,t){return e.fields.filter(e=>!C(e)||t.decidedFields?.includes(e.id)).map(e=>t.options?.[e.id]?.length?{...e,options:t.options[e.id]}:e)}function qe({view:e,run:t,step:n,before:r}){let a=(0,H.useMemo)(()=>Ke(n,e),[n,e]),o=e.known??{},[s,c]=(0,H.useState)(()=>R(n,e)),[l,u]=(0,H.useState)(()=>n.fields.some(t=>e.values[t.id]!==void 0)?I(Ke(n,e),e.known??{},R(n,e)).slice(0,-1).map(e=>e.id):[]),[d,f]=(0,H.useState)({}),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(!1),_=I(a,o,s),v=_.filter(e=>l.includes(e.id)),y=_.find(e=>!l.includes(e.id)),b=a.length===1?a[0]:void 0,x=v.at(-1),S=x?()=>u(e=>e.filter(e=>e!==x.id)):void 0;(0,H.useEffect)(()=>{let e=Object.keys(t.fieldErrors),n=I(a,o,s),r=n.findIndex(t=>e.includes(t.id));r>=0&&(u(n.slice(0,r).map(e=>e.id)),f(t.fieldErrors))},[t.fieldErrors]);let C=e=>{t.submitPage(n.id,e).then(g)},w=(0,H.useContext)(q),T=(0,H.useRef)(s);T.current=s;let E=w?.bindPage,D=(0,H.useRef)(C);D.current=C,(0,H.useEffect)(()=>{if(!E)return;let e=I(a,o,s);return E({step:n,fields:e,values:s,setField:(t,n)=>{let r=e.find(e=>e.id===t);return r?Re(r,n)||(c(e=>({...e,[t]:n})),u(e=>e.includes(t)?e:[...e,t]),f({}),null):`no such field on this page`},submit:()=>D.current(T.current)}),()=>E(null)},[E,n,a,o,s]);let O=e=>{if(!y)return!1;let t=Re(y,e);if(t)return f({[y.id]:t}),!1;let n={...s,[y.id]:e},r=[...l,y.id];return c(n),u(r),f({}),I(a,o,n).some(e=>!r.includes(e.id))||C(n),!0},A=[...r.map(e=>l.length?{...e,onEdit:void 0}:e),...Ue(n,`now:${n.id}`,s,e.id,v,b).map((e,t,n)=>t===n.length-1&&e.who===`me`&&y?{...e,onEdit:S}:e)];y?(Ie(y)===`control`?A.push(G(`now:${n.id}:${y.id}:control`,(0,U.jsx)(k,{field:y,value:s[y.id],values:s,runId:e.id,view:e,closed:e.closed?.[y.id],onChange:e=>c(t=>({...t,[y.id]:e})),onBusy:m}),{wide:!0})):b||A.push(G(`now:${n.id}:${y.id}`,(0,U.jsx)(Be,{field:y}))),d[y.id]&&A.push(G(`now:${n.id}:${y.id}:error`,d[y.id],{tone:`error`}))):t.busy||h?A.push(G(`sending`,(0,U.jsx)(Pe,{}))):t.error&&A.push(G(`send-error`,t.error,{tone:`error`}));let j=(0,U.jsx)(Q,{});if(h||!y&&l.length>0&&t.busy)j=(0,U.jsx)(Q,{placeholder:i(`run.working`)});else if(!y)A.push(X(`now:${n.id}:go`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Z,{primary:!0,busy:t.busy,onClick:()=>C(s),children:n.cta||i(`run.next`)}),S?(0,U.jsx)(Z,{onClick:S,disabled:t.busy,children:i(`run.back`)}):null]})));else{let r=Ie(y),a=!y.required&&y.kind!==`connection`&&y.kind!==`list`?(0,U.jsx)(Z,{onClick:()=>O(void 0),children:i(`chat.skip`)}):null;if(r===`typed`){a&&A.push(X(`now:${n.id}:${y.id}:replies`,a));let e=s[y.id];j=(0,U.jsx)(Me,{children:(0,U.jsx)(Fe,{initial:Le(e)?``:String(e),multiline:y.kind===`textarea`,placeholder:y.placeholder||(b?y.label:i(`chat.placeholder`)),inputProps:Je(y),busy:t.busy,onSend:e=>O(ze(y,e))},y.id)})}else if(r===`tapped`)A.push(G(`now:${n.id}:${y.id}:replies`,(0,U.jsx)(Ye,{field:y,view:e,value:s[y.id],onAnswer:O}),{bare:!0}));else{let e=_.filter(e=>!l.includes(e.id)).length===1;A.push(X(`now:${n.id}:${y.id}:replies`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Z,{primary:!0,disabled:p,onClick:()=>O(s[y.id]),children:e&&n.cta?n.cta:i(`chat.send`)}),a]})))}}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(J,{avatar:e.wizard.avatar,lines:A}),j]})}function Je(e){switch(e.kind){case`number`:return{inputMode:`decimal`,autoComplete:`off`};case`email`:return{type:`email`,inputMode:`email`,autoComplete:`email`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1};case`url`:return{inputMode:`url`,autoComplete:`url`,autoCapitalize:`off`,autoCorrect:`off`,spellCheck:!1};case`date`:return{type:`date`};default:return r(e)}}function Ye({field:e,view:t,value:n,onAnswer:r}){let a=new Set(t.closed?.[e.id]?.values.map(String)),[o,s]=(0,H.useState)(Array.isArray(n)?n:[]);if(e.kind===`toggle`)return(0,U.jsxs)(Y,{children:[(0,U.jsx)(Z,{on:n===!1,disabled:a.has(`false`),onClick:()=>r(!1),children:i(`run.no`)}),(0,U.jsx)(Z,{on:n===!0,disabled:a.has(`true`),onClick:()=>r(!0),children:i(`run.yes`)})]});let c=e.options??[];return e.kind===`multiselect`?(0,U.jsxs)(Y,{children:[c.map(e=>(0,U.jsx)(Z,{on:o.includes(e),onClick:()=>s(t=>t.includes(e)?t.filter(t=>t!==e):c.filter(n=>n===e||t.includes(n))),children:e},e)),(0,U.jsx)(Z,{primary:!0,disabled:e.required&&!o.length,onClick:()=>r(o),children:o.length||e.required?i(`chat.send`):i(`chat.skip`)})]}):(0,U.jsxs)(Y,{children:[c.map(e=>(0,U.jsx)(Z,{on:n===e,disabled:a.has(e),onClick:()=>r(e),children:e},e)),e.required?null:(0,U.jsx)(Z,{onClick:()=>r(void 0),children:i(`chat.skip`)})]})}function Xe({view:e}){let t=(0,H.useMemo)(()=>[...e.events].reverse().find(t=>t.type===`step_started`&&t.stepId===e.step?.id),[e.events,e.step?.id]),n=t?new Date(t.at).getTime():Date.now(),[r,a]=(0,H.useState)(Date.now());(0,H.useEffect)(()=>{let e=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(e)},[]);let o=e.events.filter(e=>(e.type===`tool`||e.type===`info`)&&new Date(e.at).getTime()>=n-500),s=o.at(-1),u=[...o].reverse().find(Qe),d=[...new Set(o.map(e=>e.asset).filter(e=>!!e))];return(0,U.jsxs)(`div`,{className:l(`flex max-w-full flex-col gap-1`,u?`w-full`:`w-96`),"data-say-text":t?.message??e.step?.title??i(`run.working`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(Pe,{}),(0,U.jsx)(`span`,{className:`font-medium`,children:t?.message??e.step?.title??i(`run.working`)}),(0,U.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:i(`run.elapsed`,{s:Math.max(0,Math.round((r-n)/1e3))})})]}),s&&s!==u?(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-ink-3`,children:[(0,U.jsx)(m,{className:`size-3.5 shrink-0 animate-breathe text-ember`}),(0,U.jsx)(`span`,{className:`truncate`,children:c(s)})]}):null,u&&e.status===`running`?(0,U.jsx)(et,{runId:e.id,event:u}):null,d.length?(0,U.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1.5`,children:d.slice(-6).map(t=>(0,U.jsx)(`img`,{src:B(`/api/runs/${e.id}/assets/${t}`),alt:``,className:`size-14 rounded-lg bg-paper-2 object-cover ring-1 ring-border-soft`},t))}):null]})}var Ze=new Set([`opens`,`clicks`,`clicksOn`,`types`,`typesText`,`selects`,`scrolls`,`presses`,`goesBack`,`waitsForPage`,`fastLoop`,`looksAtPage`,`personDrives`,`agentDrives`]);function Qe(e){return!!e.note&&Ze.has(e.note.code)}var $e=1e4;function et({runId:e,event:t}){let[n,r]=(0,H.useState)(null),[a,o]=(0,H.useState)(`agent`),[s,u]=(0,H.useState)(!1),d=t.note?.code;if((0,H.useEffect)(()=>{d===`personDrives`?o(`person`):d===`agentDrives`&&o(`agent`)},[d]),(0,H.useEffect)(()=>{let t=()=>L.get(`/api/runs/${e}/browser/seat`).then(e=>o(e.seat)).catch(()=>void 0);if(t(),a!==`person`)return;let n=setInterval(t,$e);return()=>clearInterval(n)},[e,a]),n!==null&&n>=t.id)return null;let f=a===`person`,p=async()=>{u(!0);try{let t=await L.post(`/api/runs/${e}/browser/seat`,{to:f?`agent`:`person`});o(t.seat)}catch{}finally{u(!1)}};return(0,U.jsx)(j,{runId:e,driving:f,caption:c(t),hint:i(`browser.driving`),onBroken:()=>r(t.id),className:`mt-1.5`,action:(0,U.jsxs)(`button`,{type:`button`,disabled:s,onClick:()=>void p(),className:l(`flex h-8 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] shadow-soft transition-colors disabled:opacity-60`,f?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-card/90 text-ink ring-1 ring-border-soft backdrop-blur hover:bg-card`),children:[f?(0,U.jsx)(he,{className:`size-3.5`}):(0,U.jsx)(pe,{className:`size-3.5`}),i(f?`browser.handBack`:`browser.takeOver`)]})},n??0)}function $({children:e,end:t}){return(0,U.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,U.jsx)(`h3`,{className:`font-display font-semibold text-[1rem]`,children:e}),t]})}function tt({view:e,run:t,step:n,before:r,asked:a,onNote:o}){let c=e.shown.filter(e=>e.output),[l,u]=(0,H.useState)(c.length===1?c[0].step.id:null),d=(0,H.useRef)(null),f=[...r,...a.map((e,t)=>K(`review:${n.id}:asked:${t}`,e)),G(`review:${n.id}`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`font-medium`,children:n.title}),n.description?(0,U.jsx)(`span`,{className:`mt-0.5 block text-ink-2`,children:n.description}):null]}),{anchor:!0}),...c.map(({step:t,output:r})=>G(`review:${n.id}:${t.id}`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{children:t.title}),(0,U.jsx)(s,{base:`/api/runs/${e.id}`,step:t,output:r,onSurfaceAction:n.regenerate?()=>{u(t.id),d.current?.focus()}:void 0})]}),{wide:!0})),...e.lists.map(t=>G(`review:${n.id}:list:${t.def.id}`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{children:t.def.title}),t.def.check?(0,U.jsx)(O,{runId:e.id,list:t}):(0,U.jsx)(g,{runId:e.id,list:t,editable:!0})]}),{wide:!0}))];t.error&&f.push(G(`review-error`,t.error,{tone:`error`}));let p=n.regenerate&&c.length>0;return f.push(X(`review:${n.id}:replies`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Z,{primary:!0,busy:t.busy,onClick:()=>void t.accept(n.id),children:[(0,U.jsx)(F,{className:`size-4`}),` `,i(`run.accept`)]}),p&&c.length>1?c.map(({step:e})=>(0,U.jsx)(Z,{on:l===e.id,onClick:()=>u(e.id),children:e.title},e.id)):null]}))),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(J,{avatar:e.wizard.avatar,lines:f}),p?(0,U.jsx)(Me,{children:(0,U.jsx)(Fe,{multiline:!0,inputRef:d,busy:t.busy,placeholder:c.length>1&&!l?i(`run.feedbackPick`):i(`run.feedbackPlaceholder`),disabled:!l,onSend:e=>{let r=e.trim();return!r||!l?!1:(o(r),t.regenerate(n.id,l,r),!0)}})}):(0,U.jsx)(Q,{})]})}function nt({view:e,run:t,step:n,before:r,onRestart:a}){let c=e.shown.filter(e=>e.output),l=`/api/runs/${e.id}`,u=[...r,G(`result:${n.id}`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`font-display font-semibold text-[1.0625rem]`,children:n.title}),n.message?(0,U.jsx)(`span`,{className:`mt-0.5 block text-ink-2`,children:n.message}):null]}),{anchor:!0}),...c.map(({step:e,output:t,formats:n,label:r})=>G(`result:${e.id}`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{end:(0,U.jsx)(o,{base:l,stepId:e.id,formats:n,title:r??e.title}),children:r??e.title}),(0,U.jsx)(s,{base:l,step:e,output:t}),t?.assets?.some(e=>e.ai)?(0,U.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-3 leading-relaxed`,children:i(`ai.publish`)}):null]}),{wide:!0})),...e.lists.map(t=>G(`result:list:${t.def.id}`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{end:(0,U.jsx)(h,{runId:e.id,list:t}),children:t.label??t.def.title}),(0,U.jsx)(g,{runId:e.id,list:t,editable:!0})]}),{wide:!0}))];return u.push(X(`result:replies`,(0,U.jsxs)(U.Fragment,{children:[c.length?(0,U.jsx)(se,{runId:e.id,title:`${n.title} · ${e.wizard.title}`,initial:e.shareUrl?{url:e.shareUrl,expiresAt:e.expiresAt}:null}):null,a?(0,U.jsxs)(Z,{onClick:a,children:[(0,U.jsx)(b,{className:`size-4`}),` `,i(`run.again`)]}):null,e.canBack?(0,U.jsx)(Z,{onClick:()=>void t.back(),disabled:t.busy,children:i(`run.back`)}):null,e.keeps?(0,U.jsx)(`span`,{className:`ml-1`,children:(0,U.jsx)(y,{runId:e.id})}):null]}))),(0,U.jsx)(J,{avatar:e.wizard.avatar,lines:u})}function rt({runId:e,onRestart:t,onView:n,header:r,footer:a,talk:o=!1,call:s=!1}){let c=de(e),{view:l}=c,[u,d]=(0,H.useState)(null),f=ke(e,l,c,u);(0,H.useEffect)(()=>{n?.(l)},[l,n]);let[p,m]=oe(),h=(0,H.useMemo)(()=>({runId:e,lang:l?.lang??v,readAloud:p,setReadAloud:m,voice:l?.talk?f:null,talk:o,call:!!s,bindPage:d}),[e,l?.lang,l?.talk,p,m,f,o,s]);D(l?.status===`running`&&!l.ask),x(l);let[g,_]=(0,H.useState)({}),[y,S]=(0,H.useState)(null);(0,H.useEffect)(()=>{l&&l.status!==`running`&&S(null)},[l]);let C;if(c.notFound)C=(0,U.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:i(`run.notFound`)});else if(!l)C=(0,U.jsx)(`div`,{className:`flex justify-center py-24 text-ink-4`,children:(0,U.jsx)(z,{})});else{let e=l.step,n=l.status===`waiting_input`,r=Ge(l,l.canBack&&n&&!c.busy?()=>void c.back():void 0);if(l.status===`running`&&l.ask)C=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(J,{avatar:l.wizard.avatar,lines:[...r,G(`ask:${l.ask.id}`,(0,U.jsx)(w,{runId:l.id,ask:l.ask}),{wide:!0})]}),(0,U.jsx)(Q,{})]});else if(l.status===`running`)C=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(J,{avatar:l.wizard.avatar,lines:[...r,...y?[K(`note`,y)]:[],G(`working:${e?.id}`,(0,U.jsx)(Xe,{view:l}),{wide:l.events.some(t=>t.stepId===e?.id&&Qe(t))?`most`:void 0})]}),(0,U.jsx)(Q,{placeholder:i(`run.working`)})]});else if(l.status===`failed`)C=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(J,{avatar:l.wizard.avatar,lines:[...r,G(`failed`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`font-medium`,children:i(`run.failed`)}),l.error?(0,U.jsx)(`span`,{className:`mt-0.5 block`,children:(0,U.jsx)(ee,{text:l.error})}):null]}),{tone:`error`}),X(`failed:replies`,(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Z,{primary:!0,busy:c.busy,onClick:()=>void c.retry(),children:[(0,U.jsx)(b,{className:`size-4`}),` `,i(`run.retry`)]}),l.canBack?(0,U.jsx)(Z,{onClick:()=>void c.back(),disabled:c.busy,children:i(`run.back`)}):null]}))]}),(0,U.jsx)(Q,{})]});else if(l.status===`cancelled`)C=(0,U.jsx)(J,{avatar:l.wizard.avatar,lines:[...r,G(`cancelled`,i(`run.cancelled`)),...t?[X(`cancelled:replies`,(0,U.jsxs)(Z,{primary:!0,onClick:t,children:[(0,U.jsx)(b,{className:`size-4`}),` `,i(`run.again`)]}))]:[]]});else if(e?.type===`page`)C=(0,U.jsx)(qe,{view:l,run:c,step:e,before:r},e.id);else if(e?.type===`review`){let t=l.shown.map(e=>e.output?.at??``).join(`|`);C=(0,U.jsx)(tt,{view:l,run:c,step:e,before:r,asked:g[e.id]??[],onNote:t=>{S(t),_(n=>({...n,[e.id]:[...n[e.id]??[],t]}))}},`${e.id}:${t}`)}else C=e?.type===`result`?(0,U.jsx)(nt,{view:l,run:c,step:e,before:r,onRestart:t}):(0,U.jsx)(J,{avatar:l.wizard.avatar,lines:r})}return s?(0,U.jsx)(q.Provider,{value:h,children:(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col lg:flex-row`,children:[(0,U.jsx)(Ce,{voice:f,view:l,video:s===`video`,className:`h-[46dvh] shrink-0 lg:h-auto lg:min-h-0 lg:flex-1`}),(0,U.jsx)(`aside`,{className:`flex min-h-0 flex-1 flex-col border-border-soft border-t lg:w-[420px] lg:flex-none lg:border-t-0 lg:border-l`,children:(0,U.jsx)(Ne,{footer:a,children:C})})]})}):(0,U.jsx)(q.Provider,{value:h,children:(0,U.jsx)(Ne,{header:r,footer:a,children:C})})}export{J as a,Z as i,Ne as n,X as o,Q as r,je as s,rt as t};