@engenty/wizards-runtime 0.20.5 → 0.21.0
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 +3 -3
- package/apps/runtime/dist/agents/studio-assistant.js +7 -3
- package/apps/runtime/dist/agents/subscription.js +20 -25
- package/apps/runtime/dist/app.js +4 -1
- package/apps/runtime/dist/cli/clients.js +6 -24
- package/apps/runtime/dist/cli/connect.js +2 -1
- package/apps/runtime/dist/cli/environment.js +3 -0
- package/apps/runtime/dist/cli/machine.js +1 -70
- package/apps/runtime/dist/cli/main.js +2 -1
- package/apps/runtime/dist/cli/ollama.js +7 -254
- package/apps/runtime/dist/cli/setup.js +12 -9
- package/apps/runtime/dist/decision-model.js +1 -4
- package/apps/runtime/dist/docs/dev/licensing.md +20 -9
- package/apps/runtime/dist/docs/user-guide/command-line.md +5 -2
- package/apps/runtime/dist/elements/outside.js +2 -1
- package/apps/runtime/dist/engine/code-step.js +1 -1
- package/apps/runtime/dist/engine/decide.js +2 -2
- package/apps/runtime/dist/engine/device.js +3 -2
- package/apps/runtime/dist/engine/input.js +1 -1
- package/apps/runtime/dist/engine/runner.js +1 -1
- package/apps/runtime/dist/engine/steps.js +27 -8
- package/apps/runtime/dist/engine/surface.js +1 -1
- package/apps/runtime/dist/engine/template.js +1 -1
- package/apps/runtime/dist/env.js +1 -0
- package/apps/runtime/dist/harness/apple.js +4 -3
- package/apps/runtime/dist/harness/clients.js +117 -0
- package/apps/runtime/dist/harness/index.js +32 -87
- package/apps/runtime/dist/harness/model.js +32 -270
- package/apps/runtime/dist/harness/prompt.js +6 -120
- package/apps/runtime/dist/harness/types.js +5 -3
- package/apps/runtime/dist/local-call.js +6 -0
- package/apps/runtime/dist/local-models.js +53 -177
- package/apps/runtime/dist/mcp/bridge.js +12 -55
- package/apps/runtime/dist/mcp/elements.js +39 -4
- package/apps/runtime/dist/mcp/handler.js +12 -0
- package/apps/runtime/dist/mcp/run-pages.js +238 -0
- package/apps/runtime/dist/mcp/run-tasks.js +157 -0
- package/apps/runtime/dist/mcp/runs.js +129 -0
- package/apps/runtime/dist/mcp/tools.js +4 -95
- package/apps/runtime/dist/models.js +82 -32
- package/apps/runtime/dist/motion-graphics/step.js +2 -2
- package/apps/runtime/dist/prompts/mcp.md +4 -1
- package/apps/runtime/dist/render/downloads.js +1 -1
- package/apps/runtime/dist/render/shaped.js +1 -1
- package/apps/runtime/dist/routes/model-setup.js +77 -0
- package/apps/runtime/dist/routes/studio.js +8 -251
- package/apps/runtime/dist/services/space-categories.js +1 -1
- package/apps/runtime/dist/services/work-ai.js +11 -5
- package/apps/runtime/dist/texts.js +4 -6
- package/apps/runtime/dist/tools/connections.js +3 -0
- package/apps/runtime/dist/tools/harness.js +124 -0
- package/apps/web/dist/assets/AboutDialog-BSdAA4Wi.js +1 -0
- package/apps/web/dist/assets/{BlockEditor-CgjXTWly.js → BlockEditor-0noqMcAl.js} +1 -1
- package/apps/web/dist/assets/Bundle-Ctrq7lHH.js +1 -0
- package/apps/web/dist/assets/CapabilitiesPage-CZlVhBmU.js +2 -0
- package/apps/web/dist/assets/ChangelogDialog-BLCYV4jT.js +1 -0
- package/apps/web/dist/assets/{CodeEditor-2LyHbSre.js → CodeEditor-CpRn9BZq.js} +1 -1
- package/apps/web/dist/assets/ConnectorsSection-B4rRDlFo.js +1 -0
- package/apps/web/dist/assets/EditorPage-CXN-_zzG.js +3 -0
- package/apps/web/dist/assets/FlowPreview-DjQvcWxs.js +1 -0
- package/apps/web/dist/assets/LangSwitch-BuzsLp16.js +1 -0
- package/apps/web/dist/assets/LocalModels-BDfP2v5-.js +1 -0
- package/apps/web/dist/assets/Marketplace-4baBNzEc.js +2 -0
- package/apps/web/dist/assets/NewWizardChannels-B_xHm-bI.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-BmZAY4zi.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-fZq3WiTk.js +1 -0
- package/apps/web/dist/assets/ProtocolSection-v9wIxisg.js +1 -0
- package/apps/web/dist/assets/PublicRunner-BCh0VzAT.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-CbvEK0rz.js → ReadOnly-13stkvNz.js} +1 -1
- package/apps/web/dist/assets/Results-4gmguYzH.js +1 -0
- package/apps/web/dist/assets/RunDrawer-CeEldWRn.js +1 -0
- package/apps/web/dist/assets/SettingsPage-BsKRRlfP.js +2 -0
- package/apps/web/dist/assets/SetupPage-FgA5Kl8z.js +1 -0
- package/apps/web/dist/assets/SharePage-BlBW4oxl.js +1 -0
- package/apps/web/dist/assets/SkillEditor-9QSskfmY.js +1 -0
- package/apps/web/dist/assets/Skills-DdUAyNhR.js +9 -0
- package/apps/web/dist/assets/SpacePage-CHkNPuqt.js +2 -0
- package/apps/web/dist/assets/StudioHome-BwPD-inc.js +1 -0
- package/apps/web/dist/assets/TableEditor-Du1DhbEC.js +7 -0
- package/apps/web/dist/assets/UpdateCheck-DPr9NXq_.js +2 -0
- package/apps/web/dist/assets/brand-DY3lzrOd.js +2 -0
- package/apps/web/dist/assets/changelog-BSdb22c3.js +1 -0
- package/apps/web/dist/assets/code-editor-Bep_LzQ5.js +2 -0
- package/apps/web/dist/assets/host-DiZQ_uws.js +1 -0
- package/apps/web/dist/assets/host-Dw-sMUSd.js +54 -0
- package/apps/web/dist/assets/i18n-DVrYWJaj.js +55 -0
- package/apps/web/dist/assets/index-C2gxK14s.css +1 -0
- package/apps/web/dist/assets/index-lQ4JYHYQ.js +102 -0
- package/apps/web/dist/assets/oss-credits-BHy69wkx.js +1 -0
- package/apps/web/dist/assets/{read-aloud-CRFt5q6k.js → read-aloud-CBycd8TA.js} +1 -1
- package/apps/web/dist/assets/{session-RDdtfee2.js → session-BYLtgklo.js} +1 -1
- package/apps/web/dist/assets/terminal-DmGdMags.js +16 -0
- package/apps/web/dist/assets/texts-ClKS2xhh.js +1 -0
- package/apps/web/dist/assets/theme-DFDOMsVo.js +14 -0
- package/apps/web/dist/assets/ui-CW2I3ecu.js +1 -0
- package/apps/web/dist/assets/ui-DfVpZYIW.js +16 -0
- package/apps/web/dist/assets/{useMutation-BSffqL6W.js → useMutation-BnkuLlQC.js} +1 -1
- package/apps/web/dist/assets/viewers-C6FfRwG1.js +2 -0
- package/apps/web/dist/index.html +18 -16
- package/apps/web/dist/mcp/flow.html +129 -129
- package/bin/bot-tunnel.mjs +375 -0
- package/bin/bot.mjs +494 -69
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.js +1 -1
- package/node_modules/@engenty/chatviews/dist/chat/a2ui.d.ts +48 -0
- package/node_modules/@engenty/chatviews/dist/chat/a2ui.js +514 -0
- package/node_modules/@engenty/chatviews/dist/chat/check.d.ts +18 -0
- package/node_modules/@engenty/chatviews/dist/chat/check.js +97 -0
- package/node_modules/@engenty/chatviews/dist/chat/index.d.ts +3 -0
- package/node_modules/@engenty/chatviews/dist/chat/index.js +4 -0
- package/node_modules/@engenty/chatviews/dist/chat/library.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/chat/library.js +314 -0
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.js +1 -1
- package/node_modules/@engenty/chatviews/dist/react/chat.d.ts +33 -0
- package/node_modules/@engenty/chatviews/dist/react/chat.js +150 -0
- package/node_modules/@engenty/chatviews/dist/react/field-looks.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/field-looks.js +47 -0
- package/node_modules/@engenty/chatviews/dist/react/markdown.d.ts +5 -0
- package/node_modules/@engenty/chatviews/dist/react/markdown.js +11 -0
- package/node_modules/@engenty/chatviews/dist/react/no-devtools.d.ts +0 -0
- package/node_modules/@engenty/chatviews/dist/react/no-devtools.js +8 -0
- package/node_modules/@engenty/chatviews/dist/react/surface.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/surface.js +552 -0
- package/node_modules/@engenty/chatviews/dist/react/texts.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/texts.js +42 -0
- package/node_modules/@engenty/chatviews/dist/react/ui.d.ts +112 -0
- package/node_modules/@engenty/chatviews/dist/react/ui.js +212 -0
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.js +1 -1
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.js +1 -1
- package/node_modules/@engenty/chatviews/package.json +19 -0
- package/node_modules/@engenty/decision-model/dist/client.d.ts +76 -0
- package/node_modules/@engenty/decision-model/dist/client.js +188 -0
- package/node_modules/@engenty/decision-model/dist/index.d.ts +6 -0
- package/node_modules/@engenty/decision-model/dist/index.js +5 -0
- package/node_modules/@engenty/decision-model/dist/local.d.ts +11 -0
- package/node_modules/@engenty/decision-model/dist/local.js +116 -0
- package/node_modules/@engenty/decision-model/dist/resolve.d.ts +26 -0
- package/node_modules/@engenty/decision-model/dist/resolve.js +53 -0
- package/node_modules/@engenty/decision-model/dist/types.d.ts +80 -0
- package/node_modules/@engenty/decision-model/dist/types.js +6 -0
- package/node_modules/@engenty/decision-model/dist/validate.d.ts +9 -0
- package/node_modules/@engenty/decision-model/dist/validate.js +50 -0
- package/node_modules/@engenty/decision-model/dist/ways.d.ts +42 -0
- package/node_modules/@engenty/decision-model/dist/ways.js +72 -0
- package/node_modules/@engenty/decision-model/package.json +9 -0
- package/node_modules/@engenty/local-models/dist/bridge/index.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/bridge/index.js +117 -0
- package/node_modules/@engenty/local-models/dist/clients/antigravity.d.ts +37 -0
- package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/antigravity.js +72 -17
- package/node_modules/@engenty/local-models/dist/clients/chat.d.ts +89 -0
- package/node_modules/@engenty/local-models/dist/clients/chat.js +22 -0
- package/node_modules/@engenty/local-models/dist/clients/claude.d.ts +32 -0
- package/node_modules/@engenty/local-models/dist/clients/claude.js +239 -0
- package/node_modules/@engenty/local-models/dist/clients/client.d.ts +31 -0
- package/node_modules/@engenty/local-models/dist/clients/client.js +2 -0
- package/node_modules/@engenty/local-models/dist/clients/codex.d.ts +35 -0
- package/node_modules/@engenty/local-models/dist/clients/codex.js +254 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.d.ts +35 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.js +192 -0
- package/node_modules/@engenty/local-models/dist/clients/detect.d.ts +18 -0
- package/node_modules/@engenty/local-models/dist/clients/detect.js +34 -0
- package/node_modules/@engenty/local-models/dist/clients/env.d.ts +66 -0
- package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/env.js +62 -31
- package/node_modules/@engenty/local-models/dist/clients/failure.d.ts +26 -0
- package/node_modules/@engenty/local-models/dist/clients/failure.js +35 -0
- package/node_modules/@engenty/local-models/dist/clients/index.d.ts +15 -0
- package/node_modules/@engenty/local-models/dist/clients/index.js +18 -0
- package/node_modules/@engenty/local-models/dist/clients/model.d.ts +129 -0
- package/node_modules/@engenty/local-models/dist/clients/model.js +225 -0
- package/node_modules/@engenty/local-models/dist/clients/prompt.d.ts +36 -0
- package/node_modules/@engenty/local-models/dist/clients/prompt.js +123 -0
- package/node_modules/@engenty/local-models/dist/clients/run.d.ts +15 -0
- package/node_modules/@engenty/local-models/dist/clients/run.js +41 -0
- package/node_modules/@engenty/local-models/dist/index.d.ts +4 -0
- package/node_modules/@engenty/local-models/dist/index.js +4 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/api.d.ts +49 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/api.js +101 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/load.d.ts +12 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/load.js +100 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/server.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/server.js +29 -0
- package/node_modules/@engenty/local-models/dist/mlx/helper.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/mlx/helper.js +149 -0
- package/node_modules/@engenty/local-models/dist/mlx/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/mlx/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/mlx/server.d.ts +19 -0
- package/node_modules/@engenty/local-models/dist/mlx/server.js +82 -0
- package/node_modules/@engenty/local-models/dist/mlx/store.d.ts +16 -0
- package/node_modules/@engenty/local-models/dist/mlx/store.js +153 -0
- package/node_modules/@engenty/local-models/dist/ollama/api.d.ts +37 -0
- package/node_modules/@engenty/local-models/dist/ollama/api.js +147 -0
- package/node_modules/@engenty/local-models/dist/ollama/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/ollama/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/ollama/model.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/ollama/model.js +302 -0
- package/node_modules/@engenty/local-models/dist/ollama/server.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/ollama/server.js +45 -0
- package/node_modules/@engenty/local-models/dist/probe.d.ts +57 -0
- package/node_modules/@engenty/local-models/dist/probe.js +174 -0
- package/node_modules/@engenty/local-models/dist/servers/index.d.ts +6 -0
- package/node_modules/@engenty/local-models/dist/servers/index.js +12 -0
- package/node_modules/@engenty/local-models/dist/servers/server.d.ts +84 -0
- package/node_modules/@engenty/local-models/dist/servers/server.js +38 -0
- package/node_modules/@engenty/local-models/package.json +16 -0
- package/node_modules/@engenty/model-setup/dist/catalog.d.ts +36 -0
- package/node_modules/@engenty/model-setup/dist/catalog.js +81 -0
- package/node_modules/@engenty/model-setup/dist/index.d.ts +3 -0
- package/node_modules/@engenty/model-setup/dist/index.js +3 -0
- package/node_modules/@engenty/model-setup/dist/offered.d.ts +7 -0
- package/node_modules/@engenty/model-setup/dist/offered.js +64 -0
- package/node_modules/@engenty/model-setup/dist/react/client.d.ts +46 -0
- package/node_modules/@engenty/model-setup/dist/react/client.js +147 -0
- package/node_modules/@engenty/model-setup/dist/react/columns.d.ts +78 -0
- package/node_modules/@engenty/model-setup/dist/react/columns.js +99 -0
- package/node_modules/@engenty/model-setup/dist/react/host.d.ts +31 -0
- package/node_modules/@engenty/model-setup/dist/react/host.js +48 -0
- package/node_modules/@engenty/model-setup/dist/react/index.d.ts +7 -0
- package/node_modules/@engenty/model-setup/dist/react/index.js +7 -0
- package/node_modules/@engenty/model-setup/dist/react/keys.d.ts +48 -0
- package/node_modules/@engenty/model-setup/dist/react/keys.js +74 -0
- package/node_modules/@engenty/model-setup/dist/react/local-models.d.ts +23 -0
- package/node_modules/@engenty/model-setup/dist/react/local-models.js +134 -0
- package/node_modules/@engenty/model-setup/dist/react/servers.d.ts +4 -0
- package/node_modules/@engenty/model-setup/dist/react/servers.js +13 -0
- package/node_modules/@engenty/model-setup/dist/react/terminal.d.ts +13 -0
- package/node_modules/@engenty/model-setup/dist/react/terminal.js +79 -0
- package/node_modules/@engenty/model-setup/dist/react/tone.d.ts +13 -0
- package/node_modules/@engenty/model-setup/dist/react/tone.js +66 -0
- package/node_modules/@engenty/model-setup/dist/server/apps.d.ts +12 -0
- package/node_modules/@engenty/model-setup/dist/server/apps.js +22 -0
- package/node_modules/@engenty/model-setup/dist/server/clients.d.ts +55 -0
- package/node_modules/@engenty/model-setup/dist/server/clients.js +96 -0
- package/node_modules/@engenty/model-setup/dist/server/index.d.ts +8 -0
- package/node_modules/@engenty/model-setup/dist/server/index.js +8 -0
- package/node_modules/@engenty/model-setup/dist/server/install.d.ts +24 -0
- package/node_modules/@engenty/model-setup/dist/server/install.js +68 -0
- package/node_modules/@engenty/model-setup/dist/server/lmstudio.d.ts +9 -0
- package/node_modules/@engenty/model-setup/dist/server/lmstudio.js +52 -0
- package/node_modules/@engenty/model-setup/dist/server/local-models.d.ts +47 -0
- package/node_modules/@engenty/model-setup/dist/server/local-models.js +164 -0
- package/node_modules/@engenty/model-setup/dist/server/models.d.ts +12 -0
- package/node_modules/@engenty/model-setup/dist/server/models.js +16 -0
- package/node_modules/@engenty/model-setup/dist/server/ollama.d.ts +22 -0
- package/node_modules/@engenty/model-setup/dist/server/ollama.js +146 -0
- package/node_modules/@engenty/model-setup/dist/server/routes.d.ts +51 -0
- package/node_modules/@engenty/model-setup/dist/server/routes.js +211 -0
- package/node_modules/@engenty/model-setup/dist/server/server-apps.d.ts +14 -0
- package/node_modules/@engenty/model-setup/dist/server/server-apps.js +24 -0
- package/node_modules/@engenty/model-setup/dist/server/terminal.d.ts +43 -0
- package/node_modules/@engenty/model-setup/dist/server/terminal.js +222 -0
- package/node_modules/@engenty/model-setup/dist/texts.d.ts +222 -0
- package/node_modules/@engenty/model-setup/dist/texts.js +222 -0
- package/node_modules/@engenty/model-setup/dist/types.d.ts +111 -0
- package/node_modules/@engenty/model-setup/dist/types.js +2 -0
- package/node_modules/@engenty/model-setup/package.json +12 -0
- package/node_modules/@engenty/search-index/dist/catalog-lexical.d.ts +14 -0
- package/node_modules/@engenty/search-index/dist/catalog-lexical.js +165 -0
- package/node_modules/@engenty/search-index/dist/catalog-rank.d.ts +33 -0
- package/node_modules/@engenty/search-index/dist/catalog-rank.js +99 -0
- package/node_modules/@engenty/search-index/dist/catalog-search.d.ts +40 -0
- package/node_modules/@engenty/search-index/dist/catalog-search.js +161 -0
- package/node_modules/@engenty/search-index/dist/chunks.d.ts +17 -0
- package/node_modules/@engenty/search-index/dist/chunks.js +164 -0
- package/node_modules/@engenty/search-index/dist/contracts.d.ts +135 -0
- package/node_modules/@engenty/search-index/dist/contracts.js +9 -0
- package/node_modules/@engenty/search-index/dist/embedder.d.ts +31 -0
- package/node_modules/@engenty/search-index/dist/embedder.js +82 -0
- package/node_modules/@engenty/search-index/dist/embedders/gemini.d.ts +11 -0
- package/node_modules/@engenty/search-index/dist/embedders/gemini.js +54 -0
- package/node_modules/@engenty/search-index/dist/embedders/index.d.ts +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/index.js +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/ollama.d.ts +12 -0
- package/node_modules/@engenty/search-index/dist/embedders/ollama.js +43 -0
- package/node_modules/@engenty/search-index/dist/embedders/openai.d.ts +11 -0
- package/node_modules/@engenty/search-index/dist/embedders/openai.js +36 -0
- package/node_modules/@engenty/search-index/dist/embedders/shared.d.ts +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/shared.js +26 -0
- package/node_modules/@engenty/search-index/dist/embedders/ways.d.ts +16 -0
- package/node_modules/@engenty/search-index/dist/embedders/ways.js +90 -0
- package/node_modules/@engenty/search-index/dist/index.d.ts +10 -0
- package/node_modules/@engenty/search-index/dist/index.js +10 -0
- package/node_modules/@engenty/search-index/dist/payload.d.ts +13 -0
- package/node_modules/@engenty/search-index/dist/payload.js +51 -0
- package/node_modules/@engenty/search-index/dist/registry.d.ts +25 -0
- package/node_modules/@engenty/search-index/dist/registry.js +56 -0
- package/node_modules/@engenty/search-index/dist/scoring.d.ts +10 -0
- package/node_modules/@engenty/search-index/dist/scoring.js +45 -0
- package/node_modules/@engenty/search-index/dist/strategy.d.ts +6 -0
- package/node_modules/@engenty/search-index/dist/strategy.js +25 -0
- package/node_modules/@engenty/search-index/package.json +10 -0
- package/node_modules/@engenty/tool-harness/dist/harness.d.ts +70 -0
- package/node_modules/@engenty/tool-harness/dist/harness.js +170 -0
- package/node_modules/@engenty/tool-harness/dist/index.d.ts +5 -0
- package/node_modules/@engenty/tool-harness/dist/index.js +5 -0
- package/node_modules/@engenty/tool-harness/dist/judge.d.ts +8 -0
- package/node_modules/@engenty/tool-harness/dist/judge.js +39 -0
- package/node_modules/@engenty/tool-harness/dist/levels.d.ts +18 -0
- package/node_modules/@engenty/tool-harness/dist/levels.js +47 -0
- package/node_modules/@engenty/tool-harness/dist/model.d.ts +6 -0
- package/node_modules/@engenty/tool-harness/dist/model.js +60 -0
- package/node_modules/@engenty/tool-harness/dist/schema.d.ts +26 -0
- package/node_modules/@engenty/tool-harness/dist/schema.js +57 -0
- package/node_modules/@engenty/tool-harness/package.json +9 -0
- package/node_modules/@engenty/wizards-shared/dist/catalog-prompt.js +2 -1
- package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +10 -10
- package/node_modules/@engenty/wizards-shared/dist/definition.js +4 -4
- package/node_modules/@engenty/wizards-shared/dist/run-schema.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -1
- package/node_modules/@engenty/wizards-shared/dist/run.js +4 -0
- package/node_modules/@engenty/wizards-shared/dist/store.js +2 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-agents.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-agents.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-text.js +2 -2
- package/package.json +13 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/runtime/dist/agents/chat-clients.js +0 -344
- package/apps/runtime/dist/harness/claude.js +0 -141
- package/apps/runtime/dist/harness/codex.js +0 -222
- package/apps/runtime/dist/harness/cursor.js +0 -89
- package/apps/runtime/dist/harness/terminal.js +0 -201
- package/apps/web/dist/assets/AboutDialog-DM_2-iLP.js +0 -1
- package/apps/web/dist/assets/Bundle-C0u5HUZL.js +0 -1
- package/apps/web/dist/assets/CapabilitiesPage-DxRUERr-.js +0 -2
- package/apps/web/dist/assets/ChangelogDialog-Cyn3LAch.js +0 -1
- package/apps/web/dist/assets/ConnectorsSection-BYOrwccO.js +0 -1
- package/apps/web/dist/assets/EditorPage-BFUQzJpN.js +0 -3
- package/apps/web/dist/assets/FlowPreview-BXf4EKjU.js +0 -1
- package/apps/web/dist/assets/LangSwitch-BLB7dDce.js +0 -1
- package/apps/web/dist/assets/Marketplace-B3NoH5Va.js +0 -2
- package/apps/web/dist/assets/NewWizardChannels-DhmYe2C8.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-MGKJVDp2.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-RawpCO9J.js +0 -1
- package/apps/web/dist/assets/ProtocolSection-B1MshkAx.js +0 -1
- package/apps/web/dist/assets/PublicRunner-COatyxMi.js +0 -1
- package/apps/web/dist/assets/Results-DI4EHtkh.js +0 -1
- package/apps/web/dist/assets/RunDrawer-xXcbQ9wP.js +0 -1
- package/apps/web/dist/assets/SettingsPage-BcqqYDqw.js +0 -2
- package/apps/web/dist/assets/SetupPage-DG3fJ6fk.js +0 -1
- package/apps/web/dist/assets/SharePage-Drntg_oj.js +0 -1
- package/apps/web/dist/assets/SkillEditor-Ca_bzmjD.js +0 -1
- package/apps/web/dist/assets/Skills-BcgxuD15.js +0 -9
- package/apps/web/dist/assets/SpacePage-CzQAEQj8.js +0 -2
- package/apps/web/dist/assets/StudioHome-DWTDTslp.js +0 -1
- package/apps/web/dist/assets/TableEditor-DirMDIGk.js +0 -7
- package/apps/web/dist/assets/UpdateCheck-C6GlE6Am.js +0 -2
- package/apps/web/dist/assets/brand-BIT7AumL.js +0 -2
- package/apps/web/dist/assets/changelog-CMovB3yB.js +0 -1
- package/apps/web/dist/assets/code-editor-CufyaUFC.js +0 -2
- package/apps/web/dist/assets/host-DNvnJXoi.js +0 -69
- package/apps/web/dist/assets/i18n-WXeVnv7i.js +0 -55
- package/apps/web/dist/assets/index-D1iL3986.css +0 -1
- package/apps/web/dist/assets/index-DOq0CvXM.js +0 -102
- package/apps/web/dist/assets/oss-credits-C4SGbRkz.js +0 -1
- package/apps/web/dist/assets/theme-23bNrOQh.js +0 -14
- package/apps/web/dist/assets/ui-DkEhb2Rt.js +0 -16
- package/apps/web/dist/assets/viewers-CmGDpBjn.js +0 -2
- /package/apps/web/dist/assets/{host-BrP-ENHg.css → terminal-BrP-ENHg.css} +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={en:{"harness.appHere":`The {app} app is on this computer: {name} signs in with the same {sub}.`,"harness.authKey":`Signed in with an API key from your shell, not the subscription. Sign in here so it runs on your {sub}.`,"harness.authNone":`Not signed in yet.`,"harness.authSubscription":`Signed in with your {sub}.`,"harness.found":`{name} {version} found`,"harness.hint":`Text runs on {name} on this computer, using your {sub}. No key needed. Images, video and audio still need a key.`,"harness.hintImages":`Text and images run on {name} on this computer, using your {sub}. No key needed. Video and audio still need a key.`,"harness.install":`Or in your own terminal:`,"harness.installButton":`Install {name}`,"harness.installEnded":`The installation ended, but {name} isn’t there. The output above says why.`,"harness.installing":`{name} is installing in the terminal below – it takes about a minute. Then you sign in.`,"harness.loginEnded":`The sign-in ended, but {name} isn’t signed in. Try again.`,"harness.missing":`{name} isn’t installed on this computer.`,"harness.notInstalled":`not installed`,"harness.ready":`signed in`,"harness.signedOut":`not signed in`,"harness.signIn":`Sign in here`,"harness.signInInteractive":`{name} starts below. Choose to sign in with your {sub} there, then finish in the browser. The terminal closes once you’re signed in.`,"harness.signingIn":`The sign-in runs in the terminal below – your browser opens for it. The terminal closes once you’re signed in.`,"harness.sub.claude":`Claude subscription`,"harness.sub.codex":`ChatGPT subscription`,"harness.sub.antigravity":`Google AI subscription`,"harness.sub.cursor":`Cursor subscription`,"harness.desc.claude":`On your Claude subscription – no key needed.`,"harness.desc.codex":`On your ChatGPT subscription – no key needed.`,"harness.desc.antigravity":`On your Google AI subscription – no key needed.`,"harness.desc.cursor":`On your Cursor subscription – no key needed.`,"local.keyGet":`Get a key`,"local.keyRemove":`Delete`,"local.keySet":`stored`,"local.keyWorks":`Works. Your wizards write with {model}.`,"local.keyWorksOther":`Works. Your wizards keep writing with {model}.`,"local.keyWorksPlain":`Works.`,"local.keys":`Keys`,"local.keysHint":`One key is enough. Test checks it with the provider. Keys stay in this computer’s keychain, never in the database.`,"local.modelsLater":`Which model does which job can be changed later under Settings → Models.`,"local.serverWhere":`another computer’s, say`,"local.address":`Address`,"server.desc":`A model on this computer, without an account.`,"server.heading":`Choose a model`,"server.here":`on this computer`,"server.hint":`Choose a model. {name} loads it only then, for the test, and it takes memory while it is loaded.`,"local.recheck":`Check again`,"local.sourceOwn":`Your own keys`,"local.test":`Test`,"local.testFailed":`The test didn’t work: {error}`,"local.testHint":`One short call checks that the model can be reached.`,"local.testOk":`Answered in {s} s on {ref}: “{reply}”`,"setup.h.done":`Connected.`,"setup.h.install":`Install {name}`,"setup.h.keys":`Enter a key`,"setup.h.signIn":`Sign in to {name}`,"setup.h.test":`One short test`,"setup.noHarness":`No AI client is installed yet. Choose one and it installs right here, or enter your own keys.`,"setup.less":`Show less`,"setup.more":`Show more`,"setup.ready":`All set.`,"setup.recommended":`Recommended`,"setup.stage.connect":`Connect`,"setup.stage.done":`Done`,"setup.stage.test":`Test`,"setup.back":`Back`,"setup.cancel":`Cancel`,"setup.close":`Close`,"setup.keyBad":`The key wasn’t accepted. Check it and try again.`,"models.local.downloadOnly":`Download`,"models.local.notHere":`{name} isn’t on this computer. It runs open models here.`,"models.local.stopped":`{name} is installed but isn’t running.`,"models.local.install":`Install {name}`,"models.local.start":`Start {name}`,"models.local.starts.ollama":`Ollama is starting. On a Mac it may ask for your password once.`,"models.local.starts.lmstudio":`LM Studio is starting. The first time, go through its own start in its window.`,"models.local.startFailed":`{name} didn’t start: {error}`,"models.local.trouble.locked":`{name} asks for an API token. Switch that off in its server settings.`,"models.local.trouble.old":`This {name} is too old. Update it and try again.`,"models.local.get":`Get {name}`,"models.local.here":`On this computer`,"models.local.hereNone":`No model for this yet.`,"models.local.offered":`To download`,"models.local.offeredNone":`The list of models to download isn’t reachable right now.`,"models.local.other":`Another model for {name}`,"models.local.example":`e.g. {model}`,"models.local.use":`Use`,"models.local.inUse":`in use`,"models.local.download":`Download and use`,"models.local.starting":`Loading…`,"models.local.progress":`{done} of {total} MB`,"models.local.downloadUnreachable":`{name} isn’t running on this computer. Start it and try again.`,"models.local.downloadFailed":`The download didn’t work: {error}`,"models.local.remove":`Remove from {name}`,"models.local.removeThere":`Models are removed in {name} itself.`,"models.local.removeConfirm":`Remove “{name}” from {server}? This frees {size} GB.`,"models.local.size":`{size} GB`,"models.local.suggested":`suggested`,"models.local.tooBig":`needs about {memory} GB memory`,"models.local.loaded":`loaded`,"models.local.cap.vision":`images`,"models.local.cap.audio":`sound`,"models.local.cap.tools":`tools`,"models.cap.text":`Text & reasoning`,"models.cap.search":`Knowledge search`,"models.cap.decision":`Decisions`,"models.local.removeYes":`Remove`,"models.local.removeFailed":`{name} didn’t remove the model: {error}`},de:{"harness.appHere":`Die {app}-App ist auf diesem Computer: {name} meldet sich mit demselben {sub} an.`,"harness.authKey":`Angemeldet mit einem API-Key aus deiner Shell, nicht mit dem Abo. Melde dich hier an, damit es über dein {sub} läuft.`,"harness.authNone":`Noch nicht angemeldet.`,"harness.authSubscription":`Angemeldet mit deinem {sub}.`,"harness.found":`{name} {version} gefunden`,"harness.hint":`Texte schreibt {name} auf diesem Computer, mit deinem {sub}. Kein API-Key nötig. Bilder, Videos und Audio brauchen weiter einen API-Key.`,"harness.hintImages":`Texte und Bilder erzeugt {name} auf diesem Computer, mit deinem {sub}. Kein API-Key nötig. Videos und Audio brauchen weiter einen API-Key.`,"harness.install":`Oder in deinem eigenen Terminal:`,"harness.installButton":`{name} installieren`,"harness.installEnded":`Die Installation ist fertig, aber {name} ist nicht da. Warum, steht oben.`,"harness.installing":`{name} wird im Terminal unten installiert – das dauert etwa eine Minute. Danach meldest du es an.`,"harness.loginEnded":`Die Anmeldung wurde beendet, ohne dass {name} angemeldet ist.`,"harness.missing":`{name} ist auf diesem Computer nicht installiert.`,"harness.notInstalled":`nicht installiert`,"harness.ready":`angemeldet`,"harness.signedOut":`nicht angemeldet`,"harness.signIn":`Hier anmelden`,"harness.signInInteractive":`Unten startet {name}. Wähle dort die Anmeldung mit deinem {sub} und melde dich im Browser an. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.signingIn":`Die Anmeldung läuft im Terminal unten – dein Browser öffnet sich dafür. Das Terminal schließt sich, sobald die Anmeldung da ist.`,"harness.sub.claude":`Claude-Abo`,"harness.sub.codex":`ChatGPT-Abo`,"harness.sub.antigravity":`Google-AI-Abo`,"harness.sub.cursor":`Cursor-Abo`,"harness.desc.claude":`Mit deinem Claude-Abo – kein API-Key nötig.`,"harness.desc.codex":`Mit deinem ChatGPT-Abo – kein API-Key nötig.`,"harness.desc.antigravity":`Mit deinem Google-AI-Abo – kein API-Key nötig.`,"harness.desc.cursor":`Mit deinem Cursor-Abo – kein API-Key nötig.`,"local.keyGet":`Key holen`,"local.keyRemove":`Entfernen`,"local.keySet":`hinterlegt`,"local.keyWorks":`Funktioniert. Deine Wizards schreiben mit {model}.`,"local.keyWorksOther":`Funktioniert. Deine Wizards schreiben weiter mit {model}.`,"local.keyWorksPlain":`Funktioniert.`,"local.keys":`API-Keys`,"local.keysHint":`Ein API-Key reicht. Testen prüft ihn beim Anbieter. Die Keys liegen im Schlüsselbund dieses Geräts, nie in der Datenbank.`,"local.modelsLater":`Welches Modell was übernimmt, lässt sich später unter Einstellungen → Modelle ändern.`,"local.serverWhere":`etwa eines anderen Computers`,"local.address":`Adresse`,"server.desc":`Ein Modell auf diesem Computer, ohne Konto.`,"server.heading":`Modell wählen`,"server.here":`auf diesem Computer`,"server.hint":`Wähle ein Modell. Erst dann lädt {name} es, für den Test, und es belegt Arbeitsspeicher, solange es geladen ist.`,"local.recheck":`Erneut prüfen`,"local.sourceOwn":`Eigene API-Keys`,"local.test":`Testen`,"local.testFailed":`Der Test hat nicht geklappt: {error}`,"local.testHint":`Ein kurzer Aufruf prüft, ob das Modell erreichbar ist.`,"local.testOk":`Antwort in {s} s über {ref}: „{reply}“`,"setup.h.done":`Verbunden`,"setup.h.install":`{name} installieren`,"setup.h.keys":`API-Key eintragen`,"setup.h.signIn":`{name} anmelden`,"setup.h.test":`Ein kurzer Test`,"setup.noHarness":`Noch kein KI-Client installiert. Wähle einen aus – er wird dann hier installiert. Oder trage eigene API-Keys ein.`,"setup.less":`Weniger anzeigen`,"setup.more":`Mehr anzeigen`,"setup.ready":`Alles bereit.`,"setup.recommended":`Empfohlen`,"setup.stage.connect":`Verbinden`,"setup.stage.done":`Fertig`,"setup.stage.test":`Testen`,"setup.back":`Zurück`,"setup.cancel":`Abbrechen`,"setup.close":`Schließen`,"setup.keyBad":`Der Key wurde nicht angenommen.`,"models.local.downloadOnly":`Laden`,"models.local.notHere":`{name} ist nicht auf diesem Computer. Es führt offene Modelle hier aus.`,"models.local.stopped":`{name} ist installiert, läuft aber nicht.`,"models.local.install":`{name} installieren`,"models.local.start":`{name} starten`,"models.local.starts.ollama":`Ollama startet. Auf einem Mac fragt es eventuell einmal nach deinem Passwort.`,"models.local.starts.lmstudio":`LM Studio startet. Beim ersten Mal richtest du es zuerst in seinem Fenster ein.`,"models.local.startFailed":`{name} ist nicht gestartet: {error}`,"models.local.trouble.locked":`{name} verlangt ein API-Token. Schalte das in seinen Server-Einstellungen ab.`,"models.local.trouble.old":`Dieses {name} ist zu alt. Aktualisiere es und versuch es noch einmal.`,"models.local.get":`{name} holen`,"models.local.here":`Auf diesem Computer`,"models.local.hereNone":`Noch kein Modell dafür.`,"models.local.offered":`Zum Laden`,"models.local.offeredNone":`Die Liste der Modelle zum Laden ist gerade nicht erreichbar.`,"models.local.other":`Ein anderes Modell für {name}`,"models.local.example":`z. B. {model}`,"models.local.use":`Verwenden`,"models.local.inUse":`in Verwendung`,"models.local.download":`Laden und verwenden`,"models.local.starting":`Lädt …`,"models.local.progress":`{done} von {total} MB`,"models.local.downloadUnreachable":`{name} läuft nicht auf diesem Computer. Starte es und versuch es noch einmal.`,"models.local.downloadFailed":`Das Laden hat nicht geklappt: {error}`,"models.local.remove":`Aus {name} entfernen`,"models.local.removeThere":`Modelle entfernst du in {name} selbst.`,"models.local.removeConfirm":`„{name}“ aus {server} entfernen? Das gibt {size} GB frei.`,"models.local.size":`{size} GB`,"models.local.suggested":`empfohlen`,"models.local.tooBig":`braucht etwa {memory} GB Arbeitsspeicher`,"models.local.loaded":`geladen`,"models.local.cap.vision":`Bilder`,"models.local.cap.audio":`Ton`,"models.local.cap.tools":`Werkzeuge`,"models.cap.text":`Text & Denken`,"models.cap.search":`Wissen durchsuchen`,"models.cap.decision":`Entscheidungen`,"models.local.removeYes":`Entfernen`,"models.local.removeFailed":`{name} hat das Modell nicht entfernt: {error}`}};function t(t,n,r){let i=e[t][n];return r?i.replace(/\{(\w+)\}/g,(e,t)=>String(r[t]??e)):i}var n={"common.close":`Close`,"run.less":`Less`,"run.more":`More`,"run.share":`Share`,"share.copied":`Copied`,"run.yes":`Yes`,"run.no":`No`,"surface.allDone":`All done`,"surface.close":`Close`,"surface.done":`{done} of {total}`,"surface.file":`File`,"surface.files":`{n} files`,"surface.foundIn":`Found in`,"surface.openFile":`Open`,"surface.required":`This one is still empty.`,"surface.sentBy":`Sent by {name}`},r=(e,t)=>t?e.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??e)):e,i=(e,t)=>r(n[e],t),a=()=>`en`;function o(e){e.text&&(i=e.text),e.lang&&(a=e.lang)}function s(e,t){return i(e,t)}function c(){return a()}export{t as a,e as i,s as n,c as r,o as t};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/400-CyB00QFz.css","assets/500-DqciRChS.css","assets/600-B9Zp6bBy.css","assets/700-5l7ov3HZ.css","assets/400-n8m3eWIv.css","assets/500-BrSlhPjT.css","assets/600-CfY_-NCo.css","assets/700-CGFQ5xCB.css","assets/400-C1aMvkWZ.css","assets/500-XHIL5p_x.css","assets/600-BpnjcFCp.css","assets/700-BwKwxaTT.css","assets/400-CvPzio2w.css","assets/500-vjb4iIph.css","assets/600-BMp88EpG.css","assets/700-CReDayoA.css","assets/400-C-EAXind.css","assets/500-BacxruX7.css","assets/600-Bv31zJWL.css","assets/700-D1QH7Wga.css","assets/400-an-Q8PSH.css","assets/500-Dk7ZdhaB.css","assets/600-Bu09rnu5.css","assets/700-CEuaYRw2.css","assets/400-BpGVy8f9.css","assets/500-DjLsfQf4.css","assets/600-BvFs-CRM.css","assets/700-BXdZ1Wt4.css","assets/400-Bx8aXxdn.css","assets/500-ueODFTvD.css","assets/600-CX1ZBIY5.css","assets/700-B057BQ0n.css","assets/400-W7eSYfM-.css","assets/500--5BQEKwF.css","assets/600-B1b7x6MC.css","assets/700-pQg9ODXE.css","assets/400-NJi9pVr7.css","assets/400-fDO2E_2J.css","assets/500-Bp7rE3sO.css","assets/600-D7AGNg1U.css","assets/700-CBDkNWxO.css","assets/400-DiVWFxeN.css","assets/400-CWy8yahC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{$ as r,Cn as i,Ct as a,Dt as o,En as s,Et as c,Ft as l,Gn as u,Gt as d,It as f,Jt as p,Kn as m,Kt as h,Lt as g,Mt as _,Nt as v,Pt as y,Qt as b,Rn as x,Rt as S,St as C,Tt as w,Wn as T,Wt as E,Xt as D,_t as O,dn as k,gt as A,hn as ee,jt as j,kt as M,ln as N,mt as P,on as F,p as te,pn as ne,qt as I,sn as re,un as ie,vn as ae,wn as oe,wt as se,xn as ce,zt as le}from"./ui-DfVpZYIW.js";import{t as ue}from"./react-dom-BwXff0Px.js";import{c as de,d as L,l as fe,u as pe}from"./marked.esm-BfGIZK7F.js";import{n as me,r as he,t as ge}from"./volume-2-Br71vpS5.js";import{a as _e,c as ve,d as ye,f as be,m as xe,o as Se,p as Ce,t as we}from"./read-aloud-CBycd8TA.js";import{l as Te,n as Ee,p as De,u as Oe}from"./brand-DY3lzrOd.js";import{t as ke}from"./phone-CG7Bz_ZL.js";import{t as Ae}from"./plug-CHvl1GhO.js";import{t as je}from"./engenty-Cy7MbUxR.js";import{$ as Me,$t as Ne,B as Pe,Bt as Fe,Gt as Ie,Qt as Le,Vt as Re,Wt as ze,k as Be,mt as Ve,n as R,nn as He,s as z,t as Ue,tn as B,u as We}from"./i18n-DVrYWJaj.js";import{_ as V,c as Ge,d as Ke,f as H,g as qe,i as Je,l as Ye,o as Xe,s as Ze,t as U}from"./ui-CW2I3ecu.js";import{t as W}from"./preload-helper-Cj7BV335.js";var Qe={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`}]]};Qe.node;var $e=L(Qe),et={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};et.node;var tt=L(et),nt={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};nt.node;var rt=L(nt),it={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};it.node;var at=L(it),ot={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`}]]};ot.node;var st=L(ot),ct={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`}]]};ct.node;var lt=L(ct),ut=3e3,dt=new Set;function ft(e,t,n){let r=`${e.family}\n${e.url}`;if(dt.has(r))return;dt.add(r);let i=!1,a=setTimeout(()=>i||n(),ut),o=()=>{i=!0,clearTimeout(a)},s=()=>{o(),n()};if(e.stylesheet){let n=document.createElement(`link`);n.rel=`stylesheet`,n.href=t,n.onerror=s,n.onload=()=>{document.fonts.load(`1em "${e.family.replace(/"/g,``)}"`).then(e=>e.length?o():s(),s)},document.head.append(n)}else new FontFace(e.family,`url("${t.replace(/["\\\n]/g,encodeURIComponent)}")`,{display:`swap`,weight:`100 900`}).load().then(e=>{document.fonts.add(e),o()},s)}var G=e(t(),1),pt=e(ue(),1),mt={mail:tt,folder:xe,chat:oe,plug:Ae,globe:me},K=e(n(),1);function ht({runId:e,job:t,onAgain:n,onHome:i}){let[a,o]=(0,G.useState)(!1);if(t.status===`running`&&t.ask)return(0,K.jsx)(h,{runId:e,ask:t.ask},t.ask.id);if(t.status===`running`){let n=t.events.slice(-5);return(0,K.jsxs)(`div`,{className:`animate-rise`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center py-6 text-center`,children:[(0,K.jsx)(H,{className:`size-7 text-ember`}),(0,K.jsx)(`h3`,{className:`mt-4 font-display font-semibold text-[1.125rem]`,children:z(`shareRun.working`)}),(0,K.jsx)(`div`,{className:`mt-4 flex min-h-[5.5rem] w-full max-w-sm flex-col gap-1.5`,children:n.map((e,t)=>(0,K.jsxs)(`div`,{className:V(`flex items-center justify-center gap-2 text-[0.8125rem]`,t===n.length-1?`text-ink-2`:`text-ink-4`),children:[t===n.length-1?(0,K.jsx)(k,{className:`size-3.5 shrink-0 animate-breathe text-ember`}):null,(0,K.jsx)(`span`,{className:`truncate`,children:e.message})]},e.at+e.message))})]}),(0,K.jsx)(`div`,{className:`flex justify-center`,children:(0,K.jsx)(U,{variant:`ghost`,busy:a,onClick:()=>{o(!0),r.post(`/api/runs/${e}/share/jobs/${t.id}/cancel`).catch(()=>void 0)},children:z(`common.cancel`)})})]})}let s=t.status===`done`;return(0,K.jsxs)(`div`,{className:`animate-rise`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center py-4 text-center`,children:[(0,K.jsx)(`div`,{className:V(`flex size-12 items-center justify-center rounded-full`,s?`bg-moss-tint text-moss`:`bg-rose-tint text-rose`),children:s?(0,K.jsx)(pe,{className:`size-6`}):(0,K.jsx)(re,{className:`size-6`})}),(0,K.jsx)(`h3`,{className:`mt-4 font-display font-semibold text-[1.125rem]`,children:z(s?`shareRun.done`:t.status===`cancelled`?`shareRun.cancelled`:`shareRun.failed`)}),s&&t.result?(0,K.jsx)(b,{text:t.result.summary,className:`mt-2 max-w-md text-[0.875rem] text-ink-2`}):t.error?(0,K.jsx)(`p`,{className:`mt-2 max-w-md text-[0.875rem] text-ink-2 leading-relaxed`,children:t.error}):null,s&&t.result?.url?(0,K.jsxs)(`a`,{href:t.result.url,target:`_blank`,rel:`noreferrer`,className:`mt-4 inline-flex h-10 items-center gap-2 rounded-full bg-paper-2 px-4 font-medium text-[0.875rem] text-ink hover:bg-paper-3 coarse:h-11`,children:[(0,K.jsx)(de,{className:`size-4`}),` `,z(`share.open`)]}):null]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3`,children:[n?(0,K.jsx)(U,{variant:`ghost`,onClick:n,children:z(s?`shareRun.again`:`shareRun.backToForm`)}):(0,K.jsx)(`span`,{}),(0,K.jsx)(U,{onClick:i,children:z(`shareRun.elsewhere`)})]})]})}function gt({steps:e,now:t}){return(0,K.jsx)(`ol`,{className:`mb-6 flex gap-2`,children:e.map((e,n)=>(0,K.jsxs)(`li`,{className:`min-w-0 flex-1`,"aria-current":n===t?`step`:void 0,children:[(0,K.jsx)(`div`,{className:V(`h-1 rounded-full`,n<t?`bg-moss`:n===t?`bg-ember`:`bg-paper-3`)}),(0,K.jsxs)(`div`,{className:V(`mt-1.5 truncate font-medium text-[0.75rem]`,n<t?`text-moss`:n===t?`text-ember-strong`:`text-ink-4`),children:[n+1,` · `,e]})]},e))})}function _t(e){return[...e.shown.filter(e=>e.output&&e.formats.length).map(e=>({from:e.step.id,label:e.label??e.step.title,formats:e.formats})),...e.lists.filter(e=>e.formats.length).map(e=>({from:`lists.${e.def.id}`,label:e.label??e.def.title,formats:e.formats}))]}function vt({deliverables:e,picked:t,onPick:n,error:r}){return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Ge,{children:z(`shareRun.files`)}),(0,K.jsx)(`ul`,{className:`overflow-hidden rounded-lg ring-1 ring-input`,children:e.map(e=>{let r=!!t[e.from];return(0,K.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 border-border-soft border-b bg-card px-3 py-2.5 last:border-0`,children:[(0,K.jsxs)(`label`,{className:`flex min-w-0 flex-1 basis-40 cursor-pointer items-center gap-2.5 text-[0.875rem] coarse:min-h-11`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:r,onChange:t=>n(e.from,t.target.checked?e.formats[0]:null),className:`size-4 shrink-0 accent-[var(--ember)] coarse:size-5`}),(0,K.jsx)(`span`,{className:V(`truncate`,!r&&`text-ink-3`),children:e.label})]}),r?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.formats.map(r=>(0,K.jsx)(`button`,{type:`button`,"aria-pressed":t[e.from]===r,onClick:()=>n(e.from,r),className:V(`h-7 rounded-full px-2.5 font-medium text-[0.75rem] ring-1 transition coarse:h-9 coarse:px-3`,t[e.from]===r?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-3 ring-input hover:text-ink`),children:o[r]},r))}):null]},e.from)})}),r?(0,K.jsx)(`p`,{className:`mt-1.5 text-[0.8125rem] text-rose`,children:r}):null]})}function yt({field:e,value:t,choices:n,error:r,onChange:i}){let a=e.fromAccount?n:e.options;return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Ge,{required:e.required,hint:e.help,children:e.label}),e.kind===`textarea`?(0,K.jsx)(qe,{minRows:3,maxRows:12,value:t,placeholder:e.placeholder,onChange:e=>i(e.target.value)}):e.kind===`select`&&a?.length?(0,K.jsx)(Ke,{value:t,onChange:i,options:a,placeholder:``}):(0,K.jsx)(Ze,{type:e.kind===`url`?`url`:`text`,inputMode:e.kind===`emails`?`email`:void 0,autoCapitalize:e.kind===`text`?void 0:`off`,autoComplete:`off`,spellCheck:e.kind===`text`,value:t,disabled:e.fromAccount&&n===void 0,placeholder:e.fromAccount&&n===void 0?z(`common.loading`):e.placeholder,onChange:e=>i(e.target.value)}),e.fromAccount&&n===null?(0,K.jsx)(`p`,{className:`mt-1.5 text-[0.8125rem] text-ink-3`,children:z(`shareRun.choicesFailed`)}):null,r?(0,K.jsx)(`p`,{className:`mt-1.5 text-[0.8125rem] text-rose`,children:r}):null]})}function bt({view:e,target:t,draft:n,onStarted:i}){let a=e.id,o=!!t.connection,s=!t.connection||!!t.connection.account,[c,l]=(0,G.useState)(!s);(0,G.useEffect)(()=>{s||l(!0)},[s]);let d=(0,G.useMemo)(()=>_t(e),[e]),[f,p]=(0,G.useState)(()=>n?.picked??Object.fromEntries(d.map(e=>[e.from,e.formats[0]]))),[m,h]=(0,G.useState)(()=>n?.values??Object.fromEntries(t.fields.map(e=>[e.id,e.value??``]))),[g,_]=(0,G.useState)({}),[y,b]=(0,G.useState)({}),[x,S]=(0,G.useState)(null),[C,w]=(0,G.useState)(!1),T=t.fields.filter(e=>e.fromAccount).map(e=>e.id);(0,G.useEffect)(()=>{if(!s)return;let e=!0;for(let n of T)r.get(`/api/runs/${a}/share/targets/${encodeURIComponent(t.key)}/choices/${n}?lang=${R}`).then(t=>e&&_(e=>({...e,[n]:t.choices.length?t.choices:null})),()=>e&&_(e=>({...e,[n]:null})));return()=>{e=!1}},[s,a,t.key]);let E=[...o?[z(`shareRun.stepAccount`)]:[],z(`shareRun.stepForm`),z(`shareRun.stepSend`)],O=async()=>{w(!0),b({}),S(null);let e=t.takes===`files`?d.flatMap(e=>f[e.from]?[{from:e.from,format:f[e.from]}]:[]):[];try{i(await r.post(`/api/runs/${a}/share/jobs`,{target:t.key,items:e,values:m,lang:R}),{values:m,picked:f})}catch(e){let t=e instanceof D&&e.status===422?e.body?.fields:null;t?(b(t),t._account&&l(!0)):S(e.message)}finally{w(!1)}};return o&&c?(0,K.jsxs)(`div`,{className:`animate-rise`,children:[(0,K.jsx)(gt,{steps:E,now:0}),(0,K.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-2 leading-relaxed`,children:z(`shareRun.accountHint`)}),(0,K.jsx)(v,{runId:a,connection:t.connection??void 0}),y._account?(0,K.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:y._account}):null,(0,K.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,K.jsxs)(U,{disabled:!s,onClick:()=>l(!1),children:[z(`run.next`),` `,(0,K.jsx)(u,{className:`size-4`})]})})]}):(0,K.jsxs)(`form`,{className:`animate-rise`,onSubmit:e=>{e.preventDefault(),O()},children:[(0,K.jsx)(gt,{steps:E,now:+!!o}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[o&&t.connection?.account?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-paper-2 px-3 py-2 text-[0.8125rem]`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate text-ink-2`,children:z(`shareRun.as`,{account:t.connection.account.label})}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>l(!0),className:`shrink-0 text-ink-3 hover:text-ink coarse:min-h-11`,children:z(`shareRun.changeAccount`)})]}):null,t.agent?(0,K.jsxs)(`p`,{className:`flex items-start gap-2.5 rounded-lg bg-ember-tint px-3 py-2.5 text-[0.8125rem] text-ink-2 leading-relaxed`,children:[(0,K.jsx)(he,{className:`mt-0.5 size-4 shrink-0 text-ember-strong`}),` `,z(`shareRun.agentHint`)]}):null,t.presets.length?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.presets.map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>h(t=>({...t,...e.values})),className:`h-9 rounded-full bg-card px-3.5 font-medium text-[0.8125rem] text-ink-2 ring-1 ring-input transition hover:text-ink hover:ring-ember coarse:h-11`,children:e.label},e.label))}):null,t.fields.map(e=>(0,K.jsx)(yt,{field:e,value:m[e.id]??``,choices:g[e.id],error:y[e.id],onChange:t=>h(n=>({...n,[e.id]:t}))},e.id)),t.takes===`files`&&d.length?(0,K.jsx)(vt,{deliverables:d,picked:f,error:y._files,onPick:(e,t)=>p(n=>({...n,[e]:t}))}):null,x?(0,K.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:x}):null]}),(0,K.jsx)(`div`,{className:`action-bar mt-6 flex justify-end`,children:(0,K.jsxs)(U,{type:`submit`,busy:C,children:[(0,K.jsx)(rt,{className:`size-4`}),` `,z(t.agent?`shareRun.start`:`shareRun.send`)]})})]})}function xt(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:z(`shareRun.email`),href:`mailto:?subject=${r}&body=${r}%0A%0A${n}`},{id:`x`,label:`X`,href:`https://x.com/intent/post?text=${r}&url=${n}`},{id:`linkedin`,label:`LinkedIn`,href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`},{id:`whatsapp`,label:`WhatsApp`,href:`https://wa.me/?text=${r}%20${n}`},{id:`facebook`,label:`Facebook`,href:`https://www.facebook.com/sharer/sharer.php?u=${n}`}]}var St={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function Ct({view:e,title:t}){let n=e.id,[i,a]=(0,G.useState)(!1),[o,s]=(0,G.useState)({at:`home`}),[c,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)({}),h=e.shareJob?.status===`running`?e.shareJob:null,g=(0,G.useCallback)(async()=>{try{l(await r.get(`/api/runs/${n}/share/targets?lang=${R}`)),d(null)}catch(e){d(e.message)}},[n]),_=()=>{a(!0),s(h?{at:`job`,id:h.id,key:null}:{at:`home`}),g()};(0,G.useEffect)(()=>{i&&o.at===`target`&&g()},[i,o.at,e,g]);let v=e.shareJob?.status;(0,G.useEffect)(()=>{i&&v&&v!==`running`&&g()},[i,v,g]);let y=o.at===`target`||o.at===`job`?c?.targets.find(e=>e.key===o.key):void 0,b=o.at===`job`?e.shareJob?.id===o.id?e.shareJob:c?.jobs.find(e=>e.id===o.id):void 0,x=o.at===`home`||o.at===`job`&&b?.status===`running`?null:()=>s({at:`home`});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(U,{variant:`secondary`,onClick:_,children:[h?(0,K.jsx)(H,{className:`size-4`}):(0,K.jsx)(ne,{className:`size-4`}),` `,z(`shareRun.button`)]}),(0,K.jsx)(Je,{open:i,onClose:()=>a(!1),wide:!0,title:(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[x?(0,K.jsx)(Xe,{label:z(`run.back`),onClick:x,className:`-my-1.5 -ml-2`,children:(0,K.jsx)(m,{className:`size-4`})}):null,o.at===`link`?z(`shareRun.linkTitle`):y?.name??b?.name??z(`shareRun.title`)]}),children:o.at===`link`?(0,K.jsx)(Ot,{view:e,title:t,onWithdrawn:()=>s({at:`home`})}):o.at===`target`&&y?(0,K.jsx)(bt,{view:e,target:y,draft:f[y.key],onStarted:(e,t)=>{p(e=>({...e,[y.key]:t})),s({at:`job`,id:e.id,key:y.key})}},y.key):o.at===`job`&&b?(0,K.jsx)(ht,{runId:n,job:b,onAgain:o.key?()=>s({at:`target`,key:o.key}):null,onHome:()=>s({at:`home`})}):u?(0,K.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:u}):c?(0,K.jsx)(Et,{overview:c,onLink:()=>s({at:`link`}),onTarget:e=>s({at:`target`,key:e}),onJob:e=>s({at:`job`,id:e,key:null})}):(0,K.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,K.jsx)(H,{})})})]})}function wt({icon:e,name:t,description:n,onClick:r,selected:i}){let a=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:V(`flex size-11 shrink-0 items-center justify-center rounded-full bg-paper-2 text-ink-2 transition`,r&&`group-hover:bg-ember-tint group-hover:text-ember-strong`,i&&`bg-ember-tint text-ember-strong`),children:(0,K.jsx)(e,{className:`size-5`})}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`block truncate font-medium text-[0.9375rem]`,children:t}),(0,K.jsx)(`span`,{className:`block text-[0.8125rem] text-ink-3 leading-snug`,children:n})]}),r?(0,K.jsx)(x,{className:`size-4 shrink-0 text-ink-4 transition group-hover:text-ember-strong`}):null]}),o=V(`group flex items-center gap-3 rounded-xl bg-card p-3 text-left ring-1 ring-input transition`,r&&`hover:ring-ember`,i&&`ring-2 ring-ember`);return r?(0,K.jsx)(`button`,{type:`button`,onClick:r,className:o,children:a}):(0,K.jsx)(`div`,{className:o,children:a})}function Tt(e){return new Intl.DateTimeFormat(R,{dateStyle:`short`,timeStyle:`short`}).format(new Date(e))}function Et({overview:e,onLink:t,onTarget:n,onJob:r}){let i=e.jobs.filter(e=>e.status!==`cancelled`);return(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`div`,{className:`grid gap-2.5 sm:grid-cols-2`,children:[(0,K.jsx)(wt,{icon:s,name:z(`share.link`),description:z(`shareRun.linkHint`),onClick:t}),e.targets.map(e=>(0,K.jsx)(wt,{icon:mt[e.icon],name:e.name,description:e.description,onClick:()=>n(e.key)},e.key))]}),i.length?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-2 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:z(`shareRun.recent`)}),(0,K.jsx)(`ul`,{className:`overflow-hidden rounded-lg ring-1 ring-border-soft`,children:i.slice(0,5).map(e=>(0,K.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:`flex w-full items-center gap-2.5 px-3 py-2 text-left text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,children:[(0,K.jsx)(Dt,{job:e}),(0,K.jsx)(`span`,{className:`shrink-0 font-medium`,children:e.name}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-3`,children:e.result?.summary??e.error??z(`shareRun.working`)}),(0,K.jsx)(`span`,{className:`shrink-0 text-ink-4 tabular-nums`,children:Tt(e.createdAt)})]})},e.id))})]}):null]})}function Dt({job:e}){return e.status===`running`?(0,K.jsx)(H,{className:`size-3.5 shrink-0 text-ember`}):(0,K.jsx)(`span`,{className:V(`size-2 shrink-0 rounded-full`,e.status===`done`?`bg-moss`:e.status===`failed`?`bg-rose`:`bg-ink-4`)})}function Ot({view:e,title:t,onWithdrawn:n}){let i=e.id,[a,o]=(0,G.useState)(e.shareUrl?{url:e.shareUrl,expiresAt:e.expiresAt}:null),[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(null);(0,G.useEffect)(()=>{if(a)return;let e=!0;return r.post(`/api/runs/${i}/share`).then(t=>e&&o(t)).catch(t=>e&&d(t.message)),()=>{e=!1}},[i,a]);let f=async()=>{await r.del(`/api/runs/${i}/share`),n()},p=()=>{a&&(navigator.clipboard.writeText(a.url),l(!0),setTimeout(()=>l(!1),1500))},m=O(`share`)||typeof navigator<`u`&&`share`in navigator,h=a?.expiresAt?new Intl.DateTimeFormat(R,{dateStyle:`long`}).format(new Date(a.expiresAt)):null;return u?(0,K.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:u}):a?(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,K.jsx)(s,{className:`size-4 shrink-0 text-ink-3`}),(0,K.jsx)(`input`,{readOnly:!0,value:a.url,onFocus:e=>e.target.select(),"aria-label":z(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,K.jsxs)(U,{size:`sm`,onClick:p,children:[c?(0,K.jsx)(pe,{className:`size-3.5`}):(0,K.jsx)(fe,{className:`size-3.5`}),z(c?`share.copied`:`share.copy`)]})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[xt(a.url,t).map(e=>(0,K.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,K.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 font-semibold text-[0.9375rem] transition hover:bg-paper-3`,children:e.id===`mail`?(0,K.jsx)(tt,{className:`size-5`}):St[e.id]}),e.label]},e.id)),m?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>void(O(`share`)?A(`share`,{link:a.url,title:t}):navigator.share({title:t,url:a.url})).catch(()=>void 0),className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,K.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,K.jsx)(ne,{className:`size-5`})}),z(`shareRun.more`)]}):null]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,K.jsx)(`span`,{children:h?z(`shareRun.until`,{date:h}):z(`shareRun.kept`)}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void f(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:z(`shareRun.withdraw`)})]})]}):(0,K.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,K.jsx)(H,{})})}var kt=typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches;function At({since:e}){let[t,n]=(0,G.useState)(Date.now());if((0,G.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,K.jsxs)(`span`,{className:`font-mono text-[0.8125rem] text-white/60 tabular-nums`,children:[i,`:`,a]})}function jt({label:e,on:t,danger:n,busy:r,onClick:i,children:a}){return(0,K.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":t,disabled:r,onClick:i,className:V(`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,K.jsx)(H,{className:`size-5`}):a})}function Mt({voice:e}){let t=(0,G.useRef)(null),{captions:n}=e;return(0,G.useEffect)(()=>{n.length&&t.current?.scrollIntoView({block:`end`})},[n]),n.length?(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 sm:px-5`,children:(0,K.jsxs)(`ol`,{className:`mx-auto flex max-w-[720px] flex-col gap-2 py-2`,children:[n.map(e=>(0,K.jsx)(`li`,{className:V(`text-[0.9375rem] leading-snug`,e.who===`bot`?`text-white/95`:`text-right text-white/50`),children:e.text},e.id)),(0,K.jsx)(`div`,{ref:t})]})}):null}function Nt({voice:e,view:t,video:n,className:r}){let a=e.state===`live`,o=e.state===`connecting`,[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(!1);(0,G.useEffect)(()=>{c(a?Date.now():null)},[a]);let d=async()=>{u(!1),await e.start(),n&&await e.startCamera()},f=()=>{e.stop(),u(!0)},p=n||e.camera,m=[...e.captions].reverse().find(e=>e.who===`bot`),h=[...e.captions].reverse().find(e=>e.who===`me`),g=e.speaking?z(`talk.speaking`):e.listening?z(`talk.listening`):a?z(`talk.live`):o?z(`talk.connecting`):l?z(`video.ended`):``;return(0,K.jsxs)(`section`,{className:V(`relative flex min-h-0 flex-col bg-neutral-950 text-white`,`safe-top`,r),children:[(0,K.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-3 px-4 sm:px-5`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1 truncate font-display font-semibold text-[1rem] tracking-tight`,children:t?.wizard.title??``}),g?(0,K.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[a?(0,K.jsx)(`span`,{className:V(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,g]}):null,(0,K.jsx)(At,{since:s})]}),(0,K.jsxs)(`div`,{className:V(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,p?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!p&&a&&e.captions.length?`h-[38%]`:p?``:`flex-1`),children:[(0,K.jsxs)(`div`,{className:V(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!p&&`hidden`),children:[(0,K.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:V(`absolute inset-0 h-full w-full object-cover`,e.facing===`user`&&`-scale-x-100`,e.camera?`block`:`hidden`)}),e.camera?null:(0,K.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 text-white/50`,children:[(0,K.jsx)(st,{className:`size-8`}),(0,K.jsx)(`span`,{className:`text-[0.8125rem]`,children:z(`video.cameraOff`)})]}),(0,K.jsxs)(`span`,{className:`absolute bottom-2 left-3 rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:[z(`video.you`),e.muted?(0,K.jsx)(Ce,{className:`ml-1.5 inline size-3`}):null]})]}),(0,K.jsxs)(`div`,{className:V(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,p?`bg-neutral-900`:`bg-transparent`,p&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,K.jsx)(`div`,{className:V(`rounded-full transition-shadow duration-500`,!p&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!p&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,K.jsx)(Ee,{kind:t?.wizard.avatar??`round`,costume:t?.wizard.costume,size:p?140:200,fluffy:!0,interactive:!1})}),p?(0,K.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&&!p?(0,K.jsx)(Mt,{voice:e}):a&&(m||h)?(0,K.jsx)(`div`,{className:`shrink-0 px-4 pb-2 sm:px-5`,children:(0,K.jsxs)(`div`,{className:`mx-auto max-w-[720px] space-y-1 text-center`,children:[h?(0,K.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:h.text}):null,m?(0,K.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:m.text}):null]})}):null,e.error?(0,K.jsx)(`p`,{className:`shrink-0 px-5 pb-2 text-center text-[0.8125rem] text-rose`,children:e.error}):null,(0,K.jsx)(`div`,{className:`flex shrink-0 items-center justify-center gap-3 px-4 pt-1 pb-4`,children:a?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(jt,{label:z(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,K.jsx)(Ce,{className:`size-5`}):(0,K.jsx)(i,{className:`size-5`})}),(0,K.jsx)(jt,{label:z(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,K.jsx)(F,{className:`size-5`}):(0,K.jsx)(st,{className:`size-5`})}),e.camera&&kt?(0,K.jsx)(jt,{label:z(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,K.jsx)(N,{className:`size-5`})}):null,(0,K.jsx)(jt,{label:z(`video.leave`),danger:!0,onClick:f,children:(0,K.jsx)(be,{className:`size-5`})})]}):(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:o||!t?.talk,onClick:()=>void d(),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,K.jsx)(H,{className:`size-4`}):n?(0,K.jsx)(F,{className:`size-5`}):(0,K.jsx)(i,{className:`size-5`}),z(l?`video.rejoin`:n?`video.join`:`talk.start`)]}),!l&&!e.error?(0,K.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:z(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var Pt=e=>Be[e.kind]!==`device`,Ft=1024,It=4e3;function Lt(e,t){return e?e.length>t?`${e.slice(0,t)} …`:e:``}function Rt(e,t,n=!1){let r=[`status: ${e.status}`,`camera: ${n?`on`:`off`}`];if(e.ask)return r.push(e.ask.kind===`confirm`?e.ask.again?`question: "${e.ask.action.summary}" in ${e.ask.service} was interrupted and may have happened already; answer_ask allows doing it again or skips it`:`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(`
|
|
3
|
+
`);if(e.question)return r.push(`question: "${e.question}"; ask the person, then answer_question with their words`),r.join(`
|
|
4
|
+
`);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: ${Ue(t)}`),r.join(`
|
|
5
|
+
`)}if(e.status===`sleeping`)return r.push(e.pause?.kind===`credits`?`out of credits; it goes on by itself once the account is topped up`:e.pause?.kind===`sign_in`?`${e.pause.service} needs a new sign-in; it goes on by itself after that`:`waiting until: ${e.wakeAt??`soon`}; it goes on by itself, nothing to do`),r.join(`
|
|
6
|
+
`);if(e.status===`waiting_signal`)return r.push(`waiting for an event${e.waitsFor?` from ${e.waitsFor}`:``}${e.wakeAt?`, until ${e.wakeAt} at the latest`:``}; it goes on by itself, nothing to do`),r.join(`
|
|
7
|
+
`);if(e.status===`done`){r.push(`done. made:`);for(let{step:t,output:n}of e.shown)r.push(`- ${t.title}: ${Lt(n?.text,400)||`(a file, on the screen)`}`);return r.join(`
|
|
8
|
+
`)}if(e.status===`failed`)return r.push(`failed: ${e.error??``}; go_back or the person retries on the screen`),r.join(`
|
|
9
|
+
`);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=Pt(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?` = ${Lt(String(Array.isArray(n)?n.join(`, `):n),120)}`:` = (open)`}`)}return r.join(`
|
|
10
|
+
`)}if(e.step?.type===`review`){r.push(`review: ${e.step.title}`),e.step.approve&&r.push(`this review asks for a decision: approve or decline`);for(let{step:t,output:n}of e.shown)r.push(`- ${t.id} "${t.title}": ${Lt(n?.text,600)||`(a picture or file, on the screen)`}`);return r.push(`regenerate allowed: ${e.step.regenerate?`yes`:`no`}`),r.join(`
|
|
11
|
+
`)}return r.push(`step: ${e.step?.title??``}`),r.join(`
|
|
12
|
+
`)}function zt(e,t,n,i){let[a,o]=(0,G.useState)(`off`),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(!1),[d,f]=(0,G.useState)(!1),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(`environment`),[_,v]=(0,G.useState)(!1),[y,b]=(0,G.useState)([]),x=(0,G.useRef)(null),S=(0,G.useRef)(null),C=(0,G.useRef)(0),w=(0,G.useRef)(!1);w.current=p;let T=(0,G.useRef)(null),E=(0,G.useRef)(null),D=(0,G.useRef)(null),O=(0,G.useRef)(null),k=(0,G.useRef)(t);k.current=t;let A=(0,G.useRef)(i);A.current=i;let ee=(0,G.useRef)(n);ee.current=n;let j=(0,G.useRef)(``),M=(0,G.useCallback)(e=>{let t=E.current;t&&t.readyState===`open`&&t.send(JSON.stringify(e))},[]),N=(0,G.useCallback)(()=>{let e=x.current;if(!w.current||!e||e.videoWidth===0)return null;let t=Math.min(1,Ft/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)},[]),P=(0,G.useCallback)(()=>{for(let e of S.current?.getTracks()??[])e.stop();S.current=null,x.current&&(x.current.srcObject=null),m(!1)},[]),F=(0,G.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`?z(`talk.cameraDenied`):e.message)}},[]),te=(0,G.useCallback)(async()=>{let e=h===`user`?`environment`:`user`;P(),await F(e)},[h,P,F]),ne=(0,G.useCallback)(()=>{v(e=>{for(let t of O.current?.getAudioTracks()??[])t.enabled=e;return!e})},[]),I=(0,G.useCallback)(()=>{P(),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),j.current=``,u(!1),f(!1),v(!1),o(`off`)},[P]);(0,G.useEffect)(()=>()=>I(),[I]);let re=(0,G.useCallback)(async(t,n)=>{let i=k.current,a=A.current,o=ee.current;switch(t){case`get_state`:return i?Rt(i,a,w.current):`no run`;case`look`:{let e=N();return e?(M({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(!a)return`no page is open`;let t=a.fields.find(e=>e.id===String(n.field??``));if(t?.kind!==`image`)return`no such photo field on this page`;let i=N();if(!i)return`the camera is off; ask the person to switch it on`;try{let n=await(await fetch(i)).blob(),o=new File([n],`photo-${Date.now()}.jpg`,{type:`image/jpeg`}),s=await r.upload(`/api/runs/${e}/uploads`,o),c=a.values[t.id],l=t.multiple?[...Array.isArray(c)?c:c?[c]:[],s.id]:s.id,u=a.setField(t.id,l);return u?`refused: ${u}`:`the photo is in the field`}catch(e){return`failed: ${e.message}`}}case`set_field`:{if(!a)return`no page is open`;let e=a.setField(String(n.field??``),n.value);return e?`refused: ${e}`:`kept`}case`submit_page`:{if(!a)return`no page is open`;let e=a.fields.filter(e=>e.required&&Pt(e)&&e.kind!==`toggle`&&(a.values[e.id]===void 0||a.values[e.id]===null||a.values[e.id]===``));return e.length?`still open: ${e.map(e=>e.id).join(`, `)}`:(a.submit(),`sent; wait for the next state`)}case`accept_review`:return i?.step?.type===`review`?await o.accept(i.step.id)?`accepted`:o.error??`refused`:`no review is open`;case`decline_review`:return i?.step?.type!==`review`||!i.step.approve?`no review asks for a decision`:await o.decline(i.step.id,n.note?String(n.note):void 0)?`declined`:o.error??`refused`;case`regenerate`:return i?.step?.type===`review`?await o.regenerate(i.step.id,String(n.target??``),String(n.note??``))?`the wizard makes it again; wait`:o.error??`refused`:`no review is open`;case`answer_ask`:if(!i?.ask)return`no question is open`;try{return await r.post(`/api/runs/${e}/ask/${i.ask.id}`,{type:n.allow?`done`:`skip`}),n.allow?`allowed`:`skipped`}catch(e){return`refused: ${e.message}`}case`answer_question`:if(!i?.question)return`no question is open`;try{return await r.post(`/api/runs/${e}/question`,{answer:String(n.answer??``)}),`answered`}catch(e){return`refused: ${e.message}`}case`go_back`:return await o.back()?`went back; wait for the state`:o.error??`refused`;default:return`unknown tool ${t}`}},[e,N,M]),ie=(0,G.useCallback)(async()=>{if(!T.current){c(null),b([]),o(`connecting`);try{let t=await r.post(`/api/runs/${e}/talk`),n=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});O.current=n;let i=new RTCPeerConnection;T.current=i;let a=document.createElement(`audio`);a.autoplay=!0,a.setAttribute(`playsinline`,``),document.body.append(a),D.current=a,i.ontrack=e=>{a.srcObject=e.streams[0]};for(let e of n.getTracks())i.addTrack(e,n);let s=i.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>It?N():null;e&&(C.current=Date.now(),M({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{}re(e,r).then(e=>{M({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:n,output:e}}),M({type:`response.create`})});break}case`error`:c(String(t.error?.message??`error`))}},s.onopen=()=>{o(`live`);let e=k.current;e&&(j.current=Rt(e,A.current,w.current),M({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:`[state]\n${j.current}\n\nGreet the person in one sentence and ask the first open field.`}]}}),M({type:`response.create`}))},s.onclose=()=>{T.current===i&&I()};let l=await i.createOffer();await i.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(`${z(`talk.failed`)} (${d.status})`);await i.setRemoteDescription({type:`answer`,sdp:await d.text()})}catch(e){I(),c(e.name===`NotAllowedError`?z(`chat.micDenied`):e.message),o(`error`)}}},[e,re,N,M,I]);return(0,G.useEffect)(()=>{if(a!==`live`||!t)return;let e=Rt(t,i,p);if(e===j.current)return;let n=j.current;j.current=e,M({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(`
|
|
13
|
+
`)[1]!==e.split(`
|
|
14
|
+
`)[1])&&M({type:`response.create`})},[a,t,i,p,M]),{state:a,error:s,speaking:l,listening:d,start:ie,stop:I,camera:p,facing:h,startCamera:F,stopCamera:P,flipCamera:te,muted:_,toggleMute:ne,captions:y,video:x}}var q=(e,t,n)=>({key:e,who:`bot`,node:t,...n}),Bt=(e,t,n)=>({key:e,who:`me`,node:t,...n}),Vt=(0,G.createContext)(null),J=(0,G.createContext)(null);function Ht(){return(0,G.useContext)(J)?.voice??null}function Ut({children:e}){let t=(0,G.useContext)(Vt);return t?(0,pt.createPortal)(e,t):null}function Wt({header:e,footer:t,children:n}){let[r,i]=(0,G.useState)(null),a=(0,G.useRef)(null),o=(0,G.useRef)(null),s=(0,G.useRef)(!0);return(0,G.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,K.jsx)(Vt.Provider,{value:r,children:(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[e,(0,K.jsx)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,K.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,K.jsxs)(`div`,{className:`shrink-0 border-border-soft border-t bg-background`,onPointerDownCapture:()=>{s.current=!0},onKeyDownCapture:()=>{s.current=!0},children:[(0,K.jsx)(`div`,{ref:i,className:`mx-auto w-full max-w-[760px] px-3 pt-3 sm:px-6`}),t]})]})})}function Y({avatar:e,costume:t,lines:n}){let r=(0,G.useContext)(J),i=(0,G.useMemo)(()=>n.map(e=>({key:e.key,who:e.who,spoken:!e.bare&&!e.wide})),[n]),a=(0,G.useCallback)(e=>{let t=document.querySelector(`[data-say="${CSS.escape(e)}"]`);return t?.querySelector(`[data-say-text]`)?.getAttribute(`data-say-text`)??t?.innerText??null},[]);Se(!!r?.readAloud,r?.lang??R,i,a);let o=[];for(let e of n){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((n,r)=>n.who===`bot`?(0,K.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,K.jsx)(`div`,{className:`sticky top-1 shrink-0 pt-0.5`,children:(0,K.jsx)(Ee,{kind:e,costume:t,size:30,interactive:r>=o.length-2})}),(0,K.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1.5`,children:n.lines.map(e=>(0,K.jsx)(`div`,{"data-anchor":e.anchor?``:void 0,"data-say":e.key,className:V(`animate-rise`,e.bare?`w-full pt-1`:`rounded-2xl rounded-tl-md text-[0.9375rem] text-ink leading-relaxed`,!e.bare&&(e.wide?V(`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))})]},n.lines[0].key):n.lines.map(e=>(0,K.jsxs)(`div`,{className:`flex animate-rise flex-col items-end gap-1 pl-10`,children:[(0,K.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,K.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,K.jsx)(ae,{className:`size-3`}),` `,z(`chat.change`)]}):null]},e.key)))}function Gt(){return(0,K.jsx)(`span`,{className:`inline-flex items-center gap-1 py-1.5`,role:`status`,"aria-label":z(`run.working`),children:[0,1,2].map(e=>(0,K.jsx)(`span`,{className:`size-1.5 animate-typing rounded-full bg-ink-3`,style:{animationDelay:`${e*160}ms`}},e))})}function Kt({children:e}){return(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:e})}var X=(e,t)=>q(e,(0,K.jsx)(Kt,{children:t}),{bare:!0});function Z({onClick:e,children:t,primary:n,on:r,disabled:i,busy:a}){return(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":r,disabled:i||a,onClick:e,className:V(`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,K.jsx)(H,{className:`size-4`}):null,t]})}function qt({initial:e=``,placeholder:t,multiline:n,inputProps:r,busy:a,disabled:o,inputRef:s,onSend:c}){let[l,u]=(0,G.useState)(e),d=(0,G.useRef)(null),f=s??d,p=(0,G.useContext)(J),m=te(l,u,{endpoint:p?`/api/runs/${p.runId}/transcribe`:void 0}),h=!!p&&m.supported&&!o;(0,G.useEffect)(()=>{if(!h)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.shiftKey&&e.key.toLowerCase()===`m`&&(e.preventDefault(),m.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,m.toggle]),(0,G.useEffect)(()=>{!E&&!o&&f.current?.focus()},[o,f]);let g=()=>{a||o||(m.listening&&m.toggle(),c(l)!==!1&&u(``))},_=m.listening?z(`chat.listening`):m.processing?z(`chat.transcribing`):t,v=p?.voice??null,y=!!p?.call,b=p&&!y&&(we||h||v)?(0,K.jsxs)(`div`,{className:`mb-1 flex shrink-0 items-center`,children:[v?(0,K.jsx)(Xe,{label:z(v.state===`live`?`talk.stop`:v.state===`connecting`?`talk.connecting`:`talk.start`),"aria-pressed":v.state===`live`,disabled:v.state===`connecting`,onClick:()=>v.state===`live`?v.stop():void v.start(),className:V(`size-9`,v.state===`live`&&`bg-rose-tint text-rose hover:bg-rose-tint hover:text-rose`,v.state===`off`&&p.talk&&`bg-primary text-primary-foreground hover:bg-primary`),children:v.state===`connecting`?(0,K.jsx)(H,{className:`size-4`}):v.state===`live`?(0,K.jsx)(be,{className:`size-4`}):(0,K.jsx)(ke,{className:`size-4`})}):null,v?.state===`live`?(0,K.jsx)(Xe,{label:z(v.camera?`talk.cameraOff`:`talk.camera`),"aria-pressed":v.camera,onClick:()=>v.camera?v.stopCamera():void v.startCamera(),className:V(`size-9`,v.camera&&`text-ink`),children:v.camera?(0,K.jsx)(F,{className:`size-4`}):(0,K.jsx)(st,{className:`size-4`})}):null,we?(0,K.jsx)(Xe,{label:z(p.readAloud?`chat.readAloudOff`:`chat.readAloud`),"aria-pressed":p.readAloud,onClick:()=>p.setReadAloud(!p.readAloud),className:V(`size-9`,p.readAloud&&`text-ink`),children:p.readAloud?(0,K.jsx)(ge,{className:`size-4`}):(0,K.jsx)(lt,{className:`size-4`})}):null,h?(0,K.jsx)(Xe,{label:z(m.listening?`chat.dictateStop`:`chat.dictate`),"aria-pressed":m.listening,disabled:m.processing,onClick:m.toggle,className:V(`size-9`,m.listening&&`bg-rose-tint text-rose hover:bg-rose-tint hover:text-rose`),children:m.processing?(0,K.jsx)(H,{className:`size-4`}):m.listening?(0,K.jsx)(ie,{className:`size-3.5 animate-pulse-dot fill-current`}):(0,K.jsx)(i,{className:`size-4`})}):null]}):null;return(0,K.jsxs)(`form`,{className:`pb-3`,onSubmit:e=>{e.preventDefault(),g()},children:[v&&!y?(0,K.jsx)(`video`,{ref:v.video,muted:!0,playsInline:!0,autoPlay:!0,className:V(`mb-2 ml-auto w-32 rounded-xl bg-black object-cover shadow-soft ring-1 ring-border-soft`,v.camera?`block`:`hidden`)}):null,(0,K.jsxs)(`div`,{className:V(`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:[b,n?(0,K.jsx)(qe,{ref:f,minRows:1,maxRows:6,value:l,disabled:o,placeholder:_,autoCapitalize:`sentences`,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||E||e.nativeEvent.isComposing||(e.preventDefault(),g())},className:`min-h-11 border-0 bg-transparent py-2.5 shadow-none focus:ring-0`}):(0,K.jsx)(`input`,{ref:f,...r,value:l,disabled:o,placeholder:_,enterKeyHint:`send`,onChange:e=>u(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,K.jsx)(`button`,{type:`submit`,"aria-label":z(`chat.send`),title:z(`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,K.jsx)(H,{className:`size-4`}):(0,K.jsx)(T,{className:`size-4`})})]}),m.error?(0,K.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-rose`,children:m.error===`denied`?z(`chat.micDenied`):m.error}):y?null:v?.error?(0,K.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-rose`,children:v.error}):v?.state===`live`?(0,K.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-ink-3`,children:v.speaking?z(`talk.speaking`):v.listening?z(`talk.listening`):z(`talk.live`)}):p?.talk&&v?.state===`off`?(0,K.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-ink-3`,children:z(`talk.hint`)}):null]})}function Q({placeholder:e=z(`chat.above`)}){return(0,K.jsx)(Ut,{children:(0,K.jsx)(qt,{disabled:!0,placeholder:e,onSend:()=>!1})})}function Jt(e){let t=Be[e.kind];return t===`typed`&&!e.scan?`typed`:t===`tapped`?`tapped`:`control`}var Yt=e=>e==null||e===``||Array.isArray(e)&&e.length===0;function Xt(e,t){let n=e.kind===`toggle`||e.kind===`connection`||e.kind===`list`;if(Yt(t))return e.required&&!n?z(`chat.required`):null;let r=String(t).trim();if(e.kind===`email`&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))return z(`chat.badEmail`);if(e.kind===`url`)try{new URL(r)}catch{return z(`chat.badUrl`)}return e.kind===`number`&&Fe(r)===null?z(`chat.badNumber`):Array.isArray(t)&&e.multiple&&e.min&&t.length<e.min?z(`run.filesMin`,{n:t.length,min:e.min}):null}function Zt(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 Qt({field:e}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`font-medium`,children:e.label}),e.help?(0,K.jsx)(`span`,{className:`mt-0.5 block text-[0.8125rem] text-ink-3`,children:e.help}):null]})}function $t({step:e,only:t}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`font-medium`,children:e.title}),e.description?(0,K.jsx)(`span`,{className:`mt-0.5 block text-ink-2`,children:e.description}):null,t?.help?(0,K.jsx)(`span`,{className:`mt-1 block text-[0.8125rem] text-ink-3`,children:t.help}):null]})}function en({field:e,value:t,runId:n}){if(e.kind===`connection`)return(0,K.jsx)(K.Fragment,{children:typeof t==`string`&&t?t:z(`chat.connected`)});if(e.kind===`list`)return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(pe,{className:`size-4`}),` `,z(`chat.checked`)]});if(e.kind===`toggle`)return(0,K.jsx)(K.Fragment,{children:z(t===!0?`run.yes`:`run.no`)});if(Yt(t))return(0,K.jsx)(`span`,{className:`italic opacity-80`,children:z(`chat.skipped`)});switch(e.kind){case`multiselect`:return(0,K.jsx)(K.Fragment,{children:t.map(We).join(`, `)});case`select`:return(0,K.jsx)(K.Fragment,{children:We(String(t))});case`date`:{let e=new Date(`${String(t)}T00:00`);return(0,K.jsx)(K.Fragment,{children:Number.isNaN(e.getTime())?String(t):new Intl.DateTimeFormat(R,{dateStyle:`long`}).format(e)})}case`color`:return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`size-4 rounded-full ring-1 ring-white/50`,style:{background:String(t)}}),String(t)]});case`image`:case`signature`:return(0,K.jsx)(`span`,{className:`-mx-1.5 flex flex-wrap gap-1.5`,children:(Array.isArray(t)?t:[String(t)]).map(t=>(0,K.jsx)(`img`,{src:P(`/api/runs/${n}/assets/${t}`),alt:``,className:V(`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,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(ce,{className:`size-4`}),` `,z(e===1?`chat.file`:`chat.files`,{n:e})]})}case`audio`:{let e=t.seconds;return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(i,{className:`size-4`}),` `,z(`chat.voice`),e?` · ${Math.round(e)} s`:``]})}case`location`:{let e=t;return(0,K.jsx)(K.Fragment,{children:e.label||`${e.lat?.toFixed(5)}, ${e.lng?.toFixed(5)}`})}case`items`:return(0,K.jsx)(K.Fragment,{children:z(`chat.rows`,{n:Array.isArray(t)?t.length:0})});default:return(0,K.jsx)(K.Fragment,{children:String(t)})}}function tn(e,t,n,r,i,a){let o=[q(t,(0,K.jsx)($t,{step:e,only:a}))];for(let e of i)a||o.push(q(`${t}:${e.id}`,(0,K.jsx)(Qt,{field:e}))),o.push(Bt(`${t}:${e.id}:a`,(0,K.jsx)(en,{field:e,value:n[e.id],runId:r})));return o}var nn=(e,t)=>e.fields.filter(e=>!e.when&&!Me(e)||t[e.id]!==void 0&&t[e.id]!==null);function rn(e,t){let n=[];e.wizard.description&&n.push(q(`hello`,e.wizard.description)),e.wizard.intro&&n.push(q(`intro`,e.wizard.intro));for(let[t,r]of e.answered.entries()){let i=`${t}:${r.id}`;if(r.type===`form`){let t=r.fields.length===1?r.fields[0]:void 0;n.push(...tn(r,i,e.values,e.id,nn(r,e.values),t))}else r.type===`review`&&(n.push(q(i,(0,K.jsx)(`span`,{className:`font-medium`,children:r.title}))),n.push(Bt(`${i}:a`,z(`run.accept`))))}let r=n.at(-1);return t&&r?.who===`me`&&(n[n.length-1]={...r,onEdit:t}),n}function an(e,t){return e.fields.filter(e=>!Me(e)||t.decidedFields?.includes(e.id)).map(e=>t.options?.[e.id]?.length?{...e,options:t.options[e.id]}:e)}function on({view:e,run:t,step:n,before:r}){let i=(0,G.useMemo)(()=>an(n,e),[n,e]),o=e.known??{},[s,c]=(0,G.useState)(()=>a(n,e)),[l,u]=(0,G.useState)(()=>n.fields.some(t=>e.values[t.id]!==void 0)?Ve(an(n,e),e.known??{},a(n,e)).slice(0,-1).map(e=>e.id):[]),[d,f]=(0,G.useState)({}),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(!1),_=Ve(i,o,s),v=_.filter(e=>l.includes(e.id)),y=_.find(e=>!l.includes(e.id)),b=i.length===1?i[0]:void 0,x=v.at(-1),S=x?()=>u(e=>e.filter(e=>e!==x.id)):void 0;(0,G.useEffect)(()=>{let e=Object.keys(t.fieldErrors),n=Ve(i,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,G.useContext)(J),T=(0,G.useRef)(s);T.current=s;let E=w?.bindPage,D=(0,G.useRef)(C);D.current=C,(0,G.useEffect)(()=>{if(!E)return;let e=Ve(i,o,s);return E({step:n,fields:e,values:s,setField:(t,n)=>{let r=e.find(e=>e.id===t);return r?Xt(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,i,o,s]);let O=e=>{if(!y)return!1;let t=Xt(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({}),Ve(i,o,n).some(e=>!r.includes(e.id))||C(n),!0},k=[...r.map(e=>l.length?{...e,onEdit:void 0}:e),...tn(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?(Jt(y)===`control`?k.push(q(`now:${n.id}:${y.id}:control`,(0,K.jsx)(j,{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||k.push(q(`now:${n.id}:${y.id}`,(0,K.jsx)(Qt,{field:y}))),d[y.id]&&k.push(q(`now:${n.id}:${y.id}:error`,d[y.id],{tone:`error`}))):t.busy||h?k.push(q(`sending`,(0,K.jsx)(Gt,{}))):t.error&&k.push(q(`send-error`,t.error,{tone:`error`}));let A=(0,K.jsx)(Q,{});if(h||!y&&l.length>0&&t.busy)A=(0,K.jsx)(Q,{placeholder:z(`run.working`)});else if(!y)k.push(X(`now:${n.id}:go`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Z,{primary:!0,busy:t.busy,onClick:()=>C(s),children:n.cta||z(`run.next`)}),S?(0,K.jsx)(Z,{onClick:S,disabled:t.busy,children:z(`run.back`)}):null]})));else{let r=Jt(y),i=!y.required&&y.kind!==`connection`&&y.kind!==`list`?(0,K.jsx)(Z,{onClick:()=>O(void 0),children:z(`chat.skip`)}):null;if(r===`typed`){i&&k.push(X(`now:${n.id}:${y.id}:replies`,i));let e=s[y.id];A=(0,K.jsx)(Ut,{children:(0,K.jsx)(qt,{initial:Yt(e)?``:String(e),multiline:y.kind===`textarea`,placeholder:y.placeholder||(b?y.label:z(`chat.placeholder`)),inputProps:sn(y),busy:t.busy,onSend:e=>O(Zt(y,e))},y.id)})}else if(r===`tapped`)k.push(q(`now:${n.id}:${y.id}:replies`,(0,K.jsx)(cn,{field:y,view:e,value:s[y.id],onAnswer:O}),{bare:!0}));else{let e=_.filter(e=>!l.includes(e.id)).length===1;k.push(X(`now:${n.id}:${y.id}:replies`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Z,{primary:!0,disabled:p,onClick:()=>O(s[y.id]),children:e&&n.cta?n.cta:z(`chat.send`)}),i]})))}}return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:e.wizard.avatar,costume:e.wizard.costume,lines:k}),A]})}function sn(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 _(e)}}function cn({field:e,view:t,value:n,onAnswer:r}){let i=new Set(t.closed?.[e.id]?.values.map(String)),[a,o]=(0,G.useState)(Array.isArray(n)?n:[]);if(e.kind===`toggle`)return(0,K.jsxs)(Kt,{children:[(0,K.jsx)(Z,{on:n===!1,disabled:i.has(`false`),onClick:()=>r(!1),children:z(`run.no`)}),(0,K.jsx)(Z,{on:n===!0,disabled:i.has(`true`),onClick:()=>r(!0),children:z(`run.yes`)})]});let s=e.options??[];return e.kind===`multiselect`?(0,K.jsxs)(Kt,{children:[s.map(e=>(0,K.jsx)(Z,{on:a.includes(e),onClick:()=>o(t=>t.includes(e)?t.filter(t=>t!==e):s.filter(n=>n===e||t.includes(n))),children:We(e)},e)),(0,K.jsx)(Z,{primary:!0,disabled:e.required&&!a.length,onClick:()=>r(a),children:a.length||e.required?z(`chat.send`):z(`chat.skip`)})]}):(0,K.jsxs)(Kt,{children:[s.map(e=>(0,K.jsx)(Z,{on:n===e,disabled:i.has(e),onClick:()=>r(e),children:We(e)},e)),e.required?null:(0,K.jsx)(Z,{onClick:()=>r(void 0),children:z(`chat.skip`)})]})}function ln({view:e}){let t=(0,G.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,i]=(0,G.useState)(Date.now());(0,G.useEffect)(()=>{let e=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(e)},[]);let a=e.events.filter(e=>(e.type===`tool`||e.type===`info`)&&new Date(e.at).getTime()>=n-500),o=a.at(-1),s=[...a].reverse().find(dn),c=[...new Set(a.map(e=>e.asset).filter(e=>!!e))];return(0,K.jsxs)(`div`,{className:V(`flex max-w-full flex-col gap-1`,s?`w-full`:`w-96`),"data-say-text":t?.message??e.step?.title??z(`run.working`),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(Gt,{}),(0,K.jsx)(`span`,{className:`font-medium`,children:t?.message??e.step?.title??z(`run.working`)}),(0,K.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:z(`run.elapsed`,{s:Math.max(0,Math.round((r-n)/1e3))})})]}),o&&o!==s?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-ink-3`,children:[(0,K.jsx)(k,{className:`size-3.5 shrink-0 animate-breathe text-ember`}),(0,K.jsx)(`span`,{className:`truncate`,children:Ue(o)})]}):null,s&&e.status===`running`?(0,K.jsx)(pn,{runId:e.id,event:s}):null,c.length?(0,K.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1.5`,children:c.slice(-6).map(t=>(0,K.jsx)(`img`,{src:P(`/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 un=new Set([`opens`,`clicks`,`clicksOn`,`types`,`typesText`,`selects`,`scrolls`,`presses`,`goesBack`,`waitsForPage`,`fastLoop`,`looksAtPage`,`personDrives`,`agentDrives`]);function dn(e){return!!e.note&&un.has(e.note.code)}var fn=1e4;function pn({runId:e,event:t}){let[n,i]=(0,G.useState)(null),[a,o]=(0,G.useState)(`agent`),[s,c]=(0,G.useState)(!1),l=t.note?.code;if((0,G.useEffect)(()=>{l===`personDrives`?o(`person`):l===`agentDrives`&&o(`agent`)},[l]),(0,G.useEffect)(()=>{let t=()=>r.get(`/api/runs/${e}/browser/seat`).then(e=>o(e.seat)).catch(()=>void 0);if(t(),a!==`person`)return;let n=setInterval(t,fn);return()=>clearInterval(n)},[e,a]),n!==null&&n>=t.id)return null;let u=a===`person`,d=async()=>{c(!0);try{let t=await r.post(`/api/runs/${e}/browser/seat`,{to:u?`agent`:`person`});o(t.seat)}catch{}finally{c(!1)}};return(0,K.jsx)(p,{runId:e,driving:u,caption:Ue(t),hint:z(`browser.driving`),onBroken:()=>i(t.id),className:`mt-1.5`,action:(0,K.jsxs)(`button`,{type:`button`,disabled:s,onClick:()=>void d(),className:V(`flex h-8 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] shadow-soft transition-colors disabled:opacity-60`,u?`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:[u?(0,K.jsx)(ye,{className:`size-3.5`}):(0,K.jsx)($e,{className:`size-3.5`}),z(u?`browser.handBack`:`browser.takeOver`)]})},n??0)}function mn({children:e,end:t}){return(0,K.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`h3`,{className:`font-display font-semibold text-[1rem]`,children:e}),t]})}function hn({view:e,run:t,step:n,before:r,asked:i,onNote:a}){let o=e.shown.filter(e=>e.output),[s,c]=(0,G.useState)(o.length===1?o[0].step.id:null),l=(0,G.useRef)(null),u=[...r,...i.map((e,t)=>Bt(`review:${n.id}:asked:${t}`,e)),q(`review:${n.id}`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`font-medium`,children:n.title}),n.description?(0,K.jsx)(`span`,{className:`mt-0.5 block text-ink-2`,children:n.description}):null]}),{anchor:!0}),...o.map(({step:t,output:r})=>q(`review:${n.id}:${t.id}`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(mn,{children:t.title}),(0,K.jsx)(M,{base:`/api/runs/${e.id}`,step:t,output:r,onSurfaceAction:n.regenerate?()=>{c(t.id),l.current?.focus()}:void 0})]}),{wide:!0})),...e.lists.map(t=>q(`review:${n.id}:list:${t.def.id}`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(mn,{children:t.def.title}),t.def.check?(0,K.jsx)(y,{runId:e.id,list:t}):(0,K.jsx)(f,{runId:e.id,list:t,editable:!0})]}),{wide:!0}))];t.error&&u.push(q(`review-error`,t.error,{tone:`error`}));let d=n.regenerate&&o.length>0;return u.push(X(`review:${n.id}:replies`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(Z,{primary:!0,busy:t.busy,onClick:()=>void t.accept(n.id),children:[(0,K.jsx)(pe,{className:`size-4`}),` `,z(n.approve?`run.approve`:`run.accept`)]}),n.approve?(0,K.jsx)(Z,{busy:t.busy,onClick:()=>void t.decline(n.id),children:z(`run.decline`)}):null,d&&o.length>1?o.map(({step:e})=>(0,K.jsx)(Z,{on:s===e.id,onClick:()=>c(e.id),children:e.title},e.id)):null]}))),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:e.wizard.avatar,costume:e.wizard.costume,lines:u}),d?(0,K.jsx)(Ut,{children:(0,K.jsx)(qt,{multiline:!0,inputRef:l,busy:t.busy,placeholder:o.length>1&&!s?z(`run.feedbackPick`):z(`run.feedbackPlaceholder`),disabled:!s,onSend:e=>{let r=e.trim();return!r||!s?!1:(a(r),t.regenerate(n.id,s,r),!0)}})}):(0,K.jsx)(Q,{})]})}function gn({view:e,run:t,step:n,before:r,onRestart:i}){let a=e.shown.filter(e=>e.output),o=`/api/runs/${e.id}`,s=[...r,q(`result:${n.id}`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`font-display font-semibold text-[1.0625rem]`,children:n.title}),n.message?(0,K.jsx)(`span`,{className:`mt-0.5 block text-ink-2`,children:n.message}):null]}),{anchor:!0}),...a.map(({step:e,output:t,formats:n,label:r})=>q(`result:${e.id}`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(mn,{end:(0,K.jsx)(c,{base:o,stepId:e.id,formats:n,title:r??e.title}),children:r??e.title}),(0,K.jsx)(M,{base:o,step:e,output:t}),t?.assets?.some(e=>e.ai)?(0,K.jsx)(`p`,{className:`mt-3 text-[0.75rem] text-ink-3 leading-relaxed`,children:z(`ai.publish`)}):null]}),{wide:!0})),...e.lists.map(t=>q(`result:list:${t.def.id}`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(mn,{end:(0,K.jsx)(l,{runId:e.id,list:t}),children:t.label??t.def.title}),(0,K.jsx)(f,{runId:e.id,list:t,editable:!0})]}),{wide:!0}))];return s.push(X(`result:replies`,(0,K.jsxs)(K.Fragment,{children:[a.length?(0,K.jsx)(Ct,{view:e,title:`${n.title} · ${e.wizard.title}`}):null,i?(0,K.jsxs)(Z,{onClick:i,children:[(0,K.jsx)(ee,{className:`size-4`}),` `,z(`run.again`)]}):null,e.canBack?(0,K.jsx)(Z,{onClick:()=>void t.back(),disabled:t.busy,children:z(`run.back`)}):null,e.keeps?(0,K.jsx)(`span`,{className:`ml-1`,children:(0,K.jsx)(le,{runId:e.id})}):null]}))),(0,K.jsx)(Y,{avatar:e.wizard.avatar,costume:e.wizard.costume,lines:s})}function _n({runId:e,onRestart:t,onNotFound:n,onView:r,header:i,footer:a,talk:o=!1,call:s=!1}){let c=ve(e),{view:l}=c,[u,f]=(0,G.useState)(null),p=zt(e,l,c,u);(0,G.useEffect)(()=>{r?.(l)},[l,r]),(0,G.useEffect)(()=>{c.notFound&&n?.()},[c.notFound,n]);let[m,_]=_e(),v=(0,G.useMemo)(()=>({runId:e,lang:l?.lang??R,readAloud:m,setReadAloud:_,voice:l?.talk?p:null,talk:o,call:!!s,bindPage:f}),[e,l?.lang,l?.talk,m,_,p,o,s]);d(l?.status===`running`&&!l.ask),se(l);let[y,b]=(0,G.useState)({}),[x,T]=(0,G.useState)(null);(0,G.useEffect)(()=>{l&&l.status!==`running`&&T(null)},[l]);let E;if(c.notFound)E=n?null:(0,K.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:z(`run.notFound`)});else if(!l)E=(0,K.jsx)(`div`,{className:`flex justify-center py-24 text-ink-4`,children:(0,K.jsx)(H,{})});else{let e=l.step,n=l.status===`waiting_input`,r=rn(l,l.canBack&&n&&!c.busy?()=>void c.back():void 0);if(l.answeredBy)E=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,q(`elsewhere:${l.answeredBy}`,z(l.answeredBy===`team`?`run.answeredByTeam`:`run.answeredByOther`))]}),(0,K.jsx)(Q,{})]});else if(l.connect?.length&&(l.status===`waiting_input`||l.status===`sleeping`))E=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,q(`connect`,(0,K.jsx)(S,{view:l}),{wide:!0})]}),(0,K.jsx)(Q,{})]});else if(l.status===`running`&&l.ask)E=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,q(`ask:${l.ask.id}`,(0,K.jsx)(h,{runId:l.id,ask:l.ask}),{wide:!0})]}),(0,K.jsx)(Q,{})]});else if(n&&l.question)E=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,q(`question:${l.question}`,(0,K.jsx)(I,{runId:l.id,question:l.question}),{wide:!0})]}),(0,K.jsx)(Q,{})]});else if(l.status===`running`)E=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,...x?[Bt(`note`,x)]:[],q(`working:${e?.id}`,(0,K.jsx)(ln,{view:l}),{wide:l.events.some(t=>t.stepId===e?.id&&dn(t))?`most`:void 0})]}),(0,K.jsx)(Q,{placeholder:z(`run.working`)})]});else if(l.status===`sleeping`||l.status===`waiting_signal`)E=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,q(`sleeping`,l.status===`sleeping`?C(l.wakeAt,l.pause,l.signIn):w(l.waitsFor,l.wakeAt)),...l.signIn&&`connection`in l.signIn?[q(`sign-in`,(0,K.jsx)(g,{view:l}))]:[]]}),(0,K.jsx)(Q,{placeholder:z(`run.leavePage`)})]});else if(l.status===`failed`)E=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,q(`failed`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`font-medium`,children:z(`run.failed`)}),l.error?(0,K.jsx)(`span`,{className:`mt-0.5 block`,children:(0,K.jsx)(Ye,{text:l.error})}):null]}),{tone:`error`}),X(`failed:replies`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(Z,{primary:!0,busy:c.busy,onClick:()=>void c.retry(),children:[(0,K.jsx)(ee,{className:`size-4`}),` `,z(`run.retry`)]}),l.canBack?(0,K.jsx)(Z,{onClick:()=>void c.back(),disabled:c.busy,children:z(`run.back`)}):null]}))]}),(0,K.jsx)(Q,{})]});else if(l.status===`cancelled`)E=(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,q(`cancelled`,z(`run.cancelled`)),...t?[X(`cancelled:replies`,(0,K.jsxs)(Z,{primary:!0,onClick:t,children:[(0,K.jsx)(ee,{className:`size-4`}),` `,z(`run.again`)]}))]:[]]});else if(e?.type===`form`)E=(0,K.jsx)(on,{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(`|`);E=(0,K.jsx)(hn,{view:l,run:c,step:e,before:r,asked:y[e.id]??[],onNote:t=>{T(t),b(n=>({...n,[e.id]:[...n[e.id]??[],t]}))}},`${e.id}:${t}`)}else E=e?.type===`result`?(0,K.jsx)(gn,{view:l,run:c,step:e,before:r,onRestart:t}):(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:r})}return s?(0,K.jsx)(J.Provider,{value:v,children:(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col lg:flex-row`,children:[(0,K.jsx)(Nt,{voice:p,view:l,video:s===`video`,className:`h-[46dvh] shrink-0 lg:h-auto lg:min-h-0 lg:flex-1`}),(0,K.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,K.jsx)(Wt,{footer:a,children:E})})]})}):(0,K.jsx)(J.Provider,{value:v,children:(0,K.jsx)(Wt,{header:i,footer:a,children:E})})}function $(e){let t=Math.sin(e*127.1+311.7)*43758.5453;return t-Math.floor(t)}function vn(e){let t=Array.from({length:7},(t,n)=>({a:(n+.2+$(e+n)*.5)/7.2*(Math.PI/2),len:200*(.84+.16*$(e+n+20))})),n=t.map(e=>`M0 0L${(Math.cos(e.a)*e.len).toFixed(1)} ${(Math.sin(e.a)*e.len).toFixed(1)}`);for(let e=1;e<=9;e++){let r=200*(e/9.6)**1.08;t.slice(1).forEach((e,i)=>{let a=t[i],o=Math.min(r,a.len),s=Math.min(r,e.len),c=(a.a+e.a)/2,l=r*.86;i===0&&n.push(`M${(Math.cos(a.a)*o).toFixed(1)} ${(Math.sin(a.a)*o).toFixed(1)}`),n.push(`Q${(Math.cos(c)*l).toFixed(1)} ${(Math.sin(c)*l).toFixed(1)} ${(Math.cos(e.a)*s).toFixed(1)} ${(Math.sin(e.a)*s).toFixed(1)}`)})}return n.join(``)}var yn={left:vn(1),right:vn(9)};function bn({side:e,className:t}){return(0,K.jsx)(`svg`,{className:t??`wizard-web wizard-web-${e}`,viewBox:`0 0 200 200`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:yn[e],fill:`none`,stroke:`currentColor`,strokeLinecap:`round`})})}function xn(){return(0,K.jsxs)(`div`,{className:`wizard-spider`,children:[(0,K.jsx)(`div`,{className:`wizard-spider-thread`}),(0,K.jsxs)(`svg`,{viewBox:`-30 -10 60 60`,"aria-hidden":`true`,children:[(0,K.jsx)(`g`,{stroke:`currentColor`,strokeWidth:`2.6`,strokeLinecap:`round`,fill:`none`,children:[0,1,2,3].map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`path`,{d:`M0 ${8+e*5} Q-16 ${-2+e*6} -24 ${14+e*6}`}),(0,K.jsx)(`path`,{d:`M0 ${8+e*5} Q16 ${-2+e*6} 24 ${14+e*6}`})]},e))}),(0,K.jsx)(`ellipse`,{cx:`0`,cy:`22`,rx:`11`,ry:`14`,fill:`currentColor`}),(0,K.jsx)(`circle`,{cx:`0`,cy:`6`,r:`7`,fill:`currentColor`}),(0,K.jsx)(`circle`,{cx:`-2.6`,cy:`7`,r:`1.6`,className:`wizard-spider-eye`}),(0,K.jsx)(`circle`,{cx:`2.6`,cy:`7`,r:`1.6`,className:`wizard-spider-eye`})]})]})}function Sn({side:e}){let t=Array.from({length:9},(e,t)=>{let n=(t+.5)/9*(Math.PI/2),r=70+$(t+40)*110,i=Math.cos(n)*r,a=Math.sin(n)*r,o=Math.cos(n)*r*.55,s=Math.sin(n)*r*.55,c=14+$(t+50)*16;return`M0 0L${i.toFixed(1)} ${a.toFixed(1)}M${o.toFixed(1)} ${s.toFixed(1)}l${(Math.cos(n+.6)*c).toFixed(1)} ${(Math.sin(n+.6)*c).toFixed(1)}M${o.toFixed(1)} ${s.toFixed(1)}l${(Math.cos(n-.6)*c).toFixed(1)} ${(Math.sin(n-.6)*c).toFixed(1)}`}).join(``);return(0,K.jsx)(`svg`,{className:`wizard-frost wizard-web-${e}`,viewBox:`0 0 200 200`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:t,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`})})}function Cn({kind:e}){let t=e===`stars`?28:22;return(0,K.jsx)(`div`,{className:`wizard-particles wizard-particles-${e}`,children:Array.from({length:t},(t,n)=>(0,K.jsx)(`span`,{style:{left:`${($(n+1)*100).toFixed(2)}%`,top:e===`stars`?`${($(n+2)*100).toFixed(2)}%`:void 0,animationDuration:`${(e===`stars`?2.5:9)+$(n+3)*8}s`,animationDelay:`${(-$(n+4)*16).toFixed(2)}s`,scale:(.6+$(n+5)*.9).toFixed(2),"--hue":`${Math.round($(n+6)*360)}`}},n))})}var wn=[{kind:`round`,top:16,size:64,seconds:17,delay:1},{kind:`drop`,top:42,size:48,seconds:21,delay:7},{kind:`tower`,top:26,size:56,seconds:19,delay:12.5}],Tn=[{kind:`flame`,side:`right`,seconds:14,delay:2},{kind:`sprout`,side:`left`,seconds:16,delay:9}];function En({costume:e,motion:t}){return t===`peek`?(0,K.jsx)(K.Fragment,{children:Tn.map(t=>(0,K.jsx)(`div`,{className:`wizard-peek wizard-peek-${t.side}`,style:{animationDuration:`${t.seconds}s`,animationDelay:`${t.delay}s`},children:(0,K.jsx)(je,{kind:t.kind,costume:e,size:96})},t.kind))}):(0,K.jsx)(K.Fragment,{children:wn.map(t=>(0,K.jsx)(`div`,{className:`wizard-bat`,style:{top:`${t.top}%`,animationDuration:`${t.seconds}s`,animationDelay:`${t.delay}s`},children:(0,K.jsx)(`div`,{className:`wizard-bat-bob`,children:(0,K.jsx)(je,{kind:t.kind,costume:e,size:t.size})})},t.kind))})}var Dn=[`witch`,`devil`,`bat`,`pumpkin`];function On({effects:e,contained:t}){let n=(e??[]).filter(e=>[`corners`,`particles`,`figures`,`fog`].includes(e.id));if(!n.length)return null;let r=(e,t)=>typeof e[t]==`string`?String(e[t]):``;return(0,K.jsxs)(K.Fragment,{children:[n.some(e=>e.id===`fog`)?(0,K.jsx)(`div`,{"aria-hidden":`true`,className:t?`wizard-fog wizard-fx-contained`:`wizard-fog`}):null,(0,K.jsx)(`div`,{"aria-hidden":`true`,className:t?`wizard-fx wizard-fx-contained`:`wizard-fx`,children:n.map((e,t)=>{let n=`${e.id}-${t}`;if(e.id===`corners`){let t=r(e,`kind`)||`webs`;return t===`frost`?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Sn,{side:`left`}),(0,K.jsx)(Sn,{side:`right`})]},n):t===`webs`?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(bn,{side:`left`}),(0,K.jsx)(bn,{side:`right`}),(0,K.jsx)(xn,{})]},n):null}if(e.id===`particles`){let t=r(e,`kind`)||`embers`;return[`embers`,`snow`,`confetti`,`stars`].includes(t)?(0,K.jsx)(Cn,{kind:t},n):null}if(e.id===`figures`){let t=r(e,`costume`);return(0,K.jsx)(En,{costume:Dn.includes(t)?t:void 0,motion:r(e,`motion`)||`fly`},n)}return null})})]})}var kn=[`brand`,`host`,`default`],An=[...kn,`engenty`,`wizard`,`wizards`],jn=[`Inter`,`Figtree`,`DM Sans`,`Nunito`,`Fredoka`,`Bricolage Grotesque`,`Fraunces`,`Playfair Display`,`Lora`,`Young Serif`,`Caveat`,`Creepster`,`Nosifer`],Mn=B().regex(/^#[0-9a-fA-F]{6}$/,`a colour as #rrggbb`),Nn=Ne({accent:Mn.optional(),background:Mn.optional(),text:Mn.optional()}).extend({scheme:Re([`light`,`dark`])}),Pn=Ne({radius:Re([`sharp`,`soft`,`round`]).optional(),cards:Re([`solid`,`outline`,`glass`]).optional(),headings:Re([`normal`,`uppercase`]).optional()}),Fn=Ne({id:B().min(1).max(40)}).catchall(He([B().max(40),Le(),Ie()])),In=B().min(1).max(60).regex(/^[A-Za-z0-9 -]+$/,`a font by its family name, or brand`);Ne({id:B().regex(Pe,`a theme id: lowercase letters, digits and dashes`),name:B().min(1).max(80),version:B().regex(/^\d+\.\d+\.\d+$/).default(`1.0.0`),base:Re(kn).default(`brand`),colors:ze(Nn).min(1).max(2).refine(e=>new Set(e.map(e=>e.scheme)).size===e.length,{message:`Each scheme once: light, dark.`}).optional(),fonts:Ne({heading:In.optional(),text:In.optional()}).optional(),shape:Pn.optional(),effects:ze(Fn).max(8).optional()});function Ln(e,t){if(!t.has(e))return e;for(let n=2;;n++){let r=`${e.slice(0,44)}-${n}`;if(!t.has(r))return r}}function Rn(e){let t=e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,48);return t&&!An.includes(t)?t:`look`}function zn(e,t){let n=e?.colors?.find(e=>e.scheme===t);if(!n)return;let{scheme:r,...i}=n;return i}var Bn=`ui-sans-serif, system-ui, sans-serif`,Vn=`ui-serif, Georgia, serif`,Hn=/serif|fraunces|playfair|lora|garamond|antiqua|baskerville|caslon|bodoni|didot|times|georgia|merriweather|tiempos/i,Un=e=>Hn.test(e)&&!/sans/i.test(e),Wn=e=>Un(e)?`Lora`:`Inter`;function Gn(e,t=[]){let n=t.some(t=>t.family===e)?`"${Wn(e)}", `:``;return`"${e.replace(/"/g,``)}", ${n}${Un(e)?Vn:Bn}`}function Kn(e,t){let n=e.modes?.[t];return{accent:n?.accent??e.accent,background:n?.background??e.background,text:n?.text??null}}var qn={Inter:()=>[W(()=>Promise.resolve({}),__vite__mapDeps([0])),W(()=>Promise.resolve({}),__vite__mapDeps([1])),W(()=>Promise.resolve({}),__vite__mapDeps([2])),W(()=>Promise.resolve({}),__vite__mapDeps([3]))],Figtree:()=>[W(()=>Promise.resolve({}),__vite__mapDeps([4])),W(()=>Promise.resolve({}),__vite__mapDeps([5])),W(()=>Promise.resolve({}),__vite__mapDeps([6])),W(()=>Promise.resolve({}),__vite__mapDeps([7]))],"DM Sans":()=>[W(()=>Promise.resolve({}),__vite__mapDeps([8])),W(()=>Promise.resolve({}),__vite__mapDeps([9])),W(()=>Promise.resolve({}),__vite__mapDeps([10])),W(()=>Promise.resolve({}),__vite__mapDeps([11]))],Nunito:()=>[W(()=>Promise.resolve({}),__vite__mapDeps([12])),W(()=>Promise.resolve({}),__vite__mapDeps([13])),W(()=>Promise.resolve({}),__vite__mapDeps([14])),W(()=>Promise.resolve({}),__vite__mapDeps([15]))],Fredoka:()=>[W(()=>Promise.resolve({}),__vite__mapDeps([16])),W(()=>Promise.resolve({}),__vite__mapDeps([17])),W(()=>Promise.resolve({}),__vite__mapDeps([18])),W(()=>Promise.resolve({}),__vite__mapDeps([19]))],"Bricolage Grotesque":()=>[W(()=>Promise.resolve({}),__vite__mapDeps([20])),W(()=>Promise.resolve({}),__vite__mapDeps([21])),W(()=>Promise.resolve({}),__vite__mapDeps([22])),W(()=>Promise.resolve({}),__vite__mapDeps([23]))],Fraunces:()=>[W(()=>Promise.resolve({}),__vite__mapDeps([24])),W(()=>Promise.resolve({}),__vite__mapDeps([25])),W(()=>Promise.resolve({}),__vite__mapDeps([26])),W(()=>Promise.resolve({}),__vite__mapDeps([27]))],"Playfair Display":()=>[W(()=>Promise.resolve({}),__vite__mapDeps([28])),W(()=>Promise.resolve({}),__vite__mapDeps([29])),W(()=>Promise.resolve({}),__vite__mapDeps([30])),W(()=>Promise.resolve({}),__vite__mapDeps([31]))],Lora:()=>[W(()=>Promise.resolve({}),__vite__mapDeps([32])),W(()=>Promise.resolve({}),__vite__mapDeps([33])),W(()=>Promise.resolve({}),__vite__mapDeps([34])),W(()=>Promise.resolve({}),__vite__mapDeps([35]))],"Young Serif":()=>[W(()=>Promise.resolve({}),__vite__mapDeps([36]))],Caveat:()=>[W(()=>Promise.resolve({}),__vite__mapDeps([37])),W(()=>Promise.resolve({}),__vite__mapDeps([38])),W(()=>Promise.resolve({}),__vite__mapDeps([39])),W(()=>Promise.resolve({}),__vite__mapDeps([40]))],Creepster:()=>[W(()=>Promise.resolve({}),__vite__mapDeps([41]))],Nosifer:()=>[W(()=>Promise.resolve({}),__vite__mapDeps([42]))]},Jn=new Set;function Yn(e){e&&!Jn.has(e)&&e in qn&&(Jn.add(e),Promise.all(qn[e]()).catch(()=>Jn.delete(e)))}function Xn(e){ft(e,e.url.startsWith(`/`)?P(e.url):e.url,()=>Yn(Wn(e.family)))}function Zn(e,t){let n=e.faces??[],r=!!e.modes,i=Kn({accent:e.accent??null,background:e.background??null,modes:e.modes??null},r?t:e.dark?`dark`:`light`),a=r?t===`dark`:!!e.dark,o=[[`--raw-primary`,i.accent],[`--raw-second`,e.second],[`--raw-background`,i.background],[`--brand-stage`,i.background?a?i.background:`oklch(from ${i.background} 0.3 clamp(0.02, calc(c * 3), 0.1) h)`:null],[`--ink`,i.text],[`--f-display`,e.display?Gn(e.display,n):null],[`--f-ui`,e.body?Gn(e.body,n):null],[`font-synthesis-weight`,e.display||e.body?`none`:null]],s=[...Object.entries(e.shape??{}).filter(([,e])=>e).map(([e,t])=>`shape-${e}-${t}`),...(e.effects??[]).flatMap(e=>e.id===`glow`?[`fx-glow`]:e.id===`pattern`?[`fx-pattern-${e.kind??`dots`}`]:[])];return{props:o.filter(e=>!!e[1]),marks:s,dark:a,themed:r}}function Qn(e){return!!(e&&!e.pinned&&e.modes?.light&&e.modes.dark)}function $n(e){for(let t of e.faces??[])Xn(t);Yn(e.display),Yn(e.body)}function er(e){Te(e?.pinned?e.dark?`dark`:`light`:null),Oe(e?.prefer??null);let t=De(),n=JSON.stringify(e??{});(0,G.useEffect)(()=>{let e=JSON.parse(n),r=document.documentElement;$n(e);let{props:i,marks:a,themed:o}=Zn(e,t);for(let[e,t]of i)r.style.setProperty(e,t);r.classList.add(...a);let s=r.classList.contains(`dark`);return!o&&e.dark&&!e.pinned&&r.classList.add(`dark`),()=>{for(let[e]of i)r.style.removeProperty(e);r.classList.remove(...a),!o&&e.dark&&!e.pinned&&!s&&r.classList.remove(`dark`)}},[n,t])}function tr(e,t){let n=JSON.stringify(e??{});if((0,G.useEffect)(()=>{$n(JSON.parse(n))},[n]),!e)return null;let r=e.pinned||!e.prefer?e.dark?`dark`:`light`:e.prefer,{props:i,marks:a,dark:o}=Zn(e,t&&Qn(e)?t:r);return{className:[`wizard-themed`,...a,o?`dark`:``].filter(Boolean).join(` `),style:Object.fromEntries(i)}}export{gt as C,tt as E,vt as S,at as T,X as _,Yn as a,wt as b,zn as c,On as d,_n as f,Y as g,Z as h,Xn as i,Rn as l,Q as m,er as n,jn as o,Wt as p,tr as r,Ln as s,Qn as t,bn as u,Ht as v,mt as w,yt as x,Ct as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./jsx-runtime-C3cWAN_r.js";import{n as r}from"./texts-ClKS2xhh.js";var i=e(t(),1),a=e(n(),1);function o(...e){return e.filter(Boolean).join(` `)}var s={primary:`bg-primary text-primary-foreground hover:brightness-[1.06] active:brightness-95 shadow-[0_1px_0_oklch(0%_0_0/0.08)]`,secondary:`bg-card text-ink border border-border hover:bg-paper-2`,ghost:`text-ink-2 hover:text-ink hover:bg-accent`,quiet:`bg-paper-2 text-ink hover:bg-paper-3`,danger:`text-rose hover:bg-rose-tint`},c=(0,i.forwardRef)(function({variant:e=`primary`,size:t=`md`,busy:n,className:r,children:i,disabled:c,...l},u){return(0,a.jsxs)(`button`,{ref:u,type:`button`,"data-variant":e,disabled:c||n,className:o(`inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50`,t===`sm`&&`h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4`,t===`md`&&`h-10 px-4 text-sm coarse:h-11`,t===`lg`&&`h-12 px-6 text-[0.9375rem]`,s[e],e===`primary`&&`wizard-button`,r),...l,children:[n?(0,a.jsx)(x,{className:`size-4`}):null,i]})});function l({label:e,className:t,children:n,...r}){return(0,a.jsx)(`button`,{type:`button`,"aria-label":e,title:e,className:o(`inline-flex size-9 shrink-0 items-center justify-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink disabled:opacity-40 coarse:size-11`,t),...r,children:n})}var u=`wizard-field rounded-lg border border-input bg-card px-3.5 text-[0.9375rem] text-ink shadow-[inset_0_1px_0_oklch(0%_0_0/0.02)] outline-none transition placeholder:text-ink-4 focus:border-focus focus:ring-4 focus:ring-focus-glow disabled:opacity-60`;function d(e){return/(^|\s)w-/.test(e??``)?null:`w-full`}var f=(0,i.forwardRef)(function({className:e,...t},n){return(0,a.jsx)(`input`,{ref:n,className:o(u,d(e),`h-11`,e),...t})});function p(e){return(0,a.jsx)(`input`,{type:`color`,className:`swatch size-11 shrink-0 cursor-pointer rounded-lg border border-input bg-card p-1`,...e})}var m=(0,i.forwardRef)(function({className:e,minRows:t=3,maxRows:n=14,onChange:r,...s},c){let l=(0,i.useRef)(null),f=()=>{let e=l.current;if(!e)return;let r=Number.parseFloat(getComputedStyle(e).lineHeight)||22;e.style.height=`auto`;let i=r*n+20;e.style.height=`${Math.min(Math.max(e.scrollHeight,r*t+20),i)}px`,e.style.overflowY=e.scrollHeight>i?`auto`:`hidden`};return(0,i.useLayoutEffect)(f),(0,a.jsx)(`textarea`,{ref:e=>{l.current=e,typeof c==`function`?c(e):c&&(c.current=e)},className:o(u,d(e),`resize-none py-2.5 leading-[1.5]`,e),onChange:e=>{f(),r?.(e)},...s})});function h({value:e,onChange:t,options:n,className:r,placeholder:i}){return(0,a.jsxs)(`div`,{className:o(`relative`,r),children:[(0,a.jsxs)(`select`,{value:e,onChange:e=>t(e.target.value),className:o(u,`h-11 w-full appearance-none pr-9`),children:[i===void 0?null:(0,a.jsx)(`option`,{value:``,children:i}),n.map(e=>(0,a.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),(0,a.jsx)(`svg`,{className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 size-4 text-ink-3`,viewBox:`0 0 16 16`,fill:`none`,children:(0,a.jsx)(`path`,{d:`M4 6l4 4 4-4`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})]})}function g({value:e,onChange:t,options:n,multi:r,disabled:i,label:s}){let c=new Set(Array.isArray(e)?e:e?[e]:[]);return(0,a.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let l=c.has(e);return(0,a.jsx)(`button`,{type:`button`,"aria-pressed":l,disabled:i?.includes(e),onClick:()=>{if(r){let r=new Set(c);l?r.delete(e):r.add(e),t(n.filter(e=>r.has(e)))}else t(e)},className:o(`h-10 rounded-full border px-4 text-sm transition disabled:pointer-events-none disabled:opacity-60 disabled:line-through coarse:h-11`,l?`border-ember bg-ember-tint text-ink`:`border-input bg-card text-ink-2 hover:border-ink-4 hover:text-ink`),children:s?s(e):e},e)})})}var _=`cubic-bezier(0.3, 0.7, 0.2, 1)`;function v({value:e,onChange:t,options:n,label:r}){let s=(0,i.useRef)(new Map),[c,l]=(0,i.useState)(null);return(0,i.useLayoutEffect)(()=>{let t=s.current.get(e);if(!t)return;let n=()=>l({x:t.offsetLeft,w:t.offsetWidth});n();let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},[e]),(0,a.jsxs)(`div`,{role:`tablist`,"aria-label":r,className:`relative inline-flex items-center rounded-full bg-paper-2 p-0.5 ring-1 ring-border-soft`,children:[c?(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-0.5 bottom-0.5 left-0 rounded-full bg-card shadow-sm motion-reduce:transition-none`,style:{width:c.w,transform:`translateX(${c.x}px)`,transition:`transform 300ms ${_}, width 300ms ${_}`}}):null,n.map(n=>{let r=n.id===e;return(0,a.jsx)(`button`,{ref:e=>{e?s.current.set(n.id,e):s.current.delete(n.id)},type:`button`,role:`tab`,"aria-selected":r,disabled:n.disabled&&!r,onClick:()=>t(n.id),className:o(`relative h-8 whitespace-nowrap rounded-full px-4 font-medium text-[0.875rem] transition-colors motion-reduce:transition-none coarse:h-9`,r?`text-ink`:n.disabled?`cursor-not-allowed text-ink-4`:`text-ink-3 hover:text-ink-2`),children:n.label},n.id)})]})}function y({checked:e,onChange:t,label:n,disabled:r}){return(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,disabled:r,onClick:()=>t(!e),className:o(`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition before:absolute before:-inset-x-1 before:-inset-y-2.5 before:content-[''] disabled:pointer-events-none disabled:opacity-60`,e?`bg-primary`:`bg-paper-3`),children:(0,a.jsx)(`span`,{className:o(`inline-block size-5 rounded-full bg-white shadow-sm transition-transform`,e?`translate-x-[22px]`:`translate-x-[2px]`)})})}function b({children:e,hint:t,required:n}){return(0,a.jsxs)(`div`,{className:`mb-2`,children:[(0,a.jsxs)(`div`,{className:`font-medium text-[0.875rem] text-ink`,children:[e,n?(0,a.jsx)(`span`,{className:`ml-1 text-ember`,children:`*`}):null]}),t?(0,a.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:t}):null]})}function x({className:e}){return(0,a.jsxs)(`svg`,{className:o(`size-5 animate-spin`,e),viewBox:`0 0 24 24`,fill:`none`,children:[(0,a.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:`0.2`,strokeWidth:`3`}),(0,a.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}function S({className:e,children:t,...n}){return(0,a.jsx)(`div`,{className:o(`wizard-card rounded-xl bg-card shadow-soft ring-1 ring-border-soft`,e),...n,children:t})}function C({children:e,tone:t=`neutral`,icon:n,title:r}){return(0,a.jsxs)(`span`,{title:r,className:o(`inline-flex h-6 items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 font-medium text-[0.75rem]`,t===`neutral`&&`bg-paper-2 text-ink-2`,t===`live`&&`bg-moss-tint text-moss`,t===`warn`&&`bg-amber-tint text-ink-2`,t===`ember`&&`bg-ember-tint text-ember-strong`),children:[n??(t===`live`?(0,a.jsx)(`span`,{className:`size-1.5 rounded-full bg-moss`}):null),e]})}function w({open:e,onClose:t,title:n,children:s,wide:c,bare:u,height:d=`auto`}){let f=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let t=f.current;t&&(e&&!t.open?(t.showModal(),t.querySelector(`[data-autofocus]`)?.focus()):!e&&t.open&&t.close())},[e]),(0,i.useEffect)(()=>{let t=f.current;if(!t||!e||u||d===`tall`)return;let n=0,r=()=>{n=Math.max(n,t.getBoundingClientRect().height),t.style.minHeight=`${Math.min(n,window.innerHeight-32)}px`},i=new ResizeObserver(r);return i.observe(t),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r),t.style.minHeight=``}},[e,u,d]),(0,a.jsx)(`dialog`,{ref:f,onClose:t,onClick:e=>{e.target===f.current&&t()},className:o(`m-auto p-0 text-ink backdrop:bg-[oklch(20%_0.01_60/0.28)] backdrop:backdrop-blur-[2px]`,`max-sm:m-0 max-sm:h-dvh max-sm:max-h-none max-sm:w-full max-sm:max-w-none`,u?`w-[calc(100%-48px)] overflow-visible bg-transparent`:`max-h-[calc(100dvh-32px)] w-[calc(100%-32px)] overflow-y-auto overscroll-contain rounded-2xl bg-card shadow-overlay max-sm:rounded-none max-sm:pt-[env(safe-area-inset-top)] max-sm:pb-[env(safe-area-inset-bottom)]`,c===`full`?`sm:max-w-7xl`:c===`page`?`sm:max-w-4xl`:c?`sm:max-w-2xl`:`sm:max-w-md`,!u&&d===`tall`&&`sm:h-[min(calc(100dvh-32px),56rem)]`),children:e&&u?s:e?(0,a.jsxs)(`div`,{className:`p-5 sm:p-7`,children:[n?(0,a.jsxs)(`div`,{className:`mb-5 flex items-start justify-between gap-3`,children:[(0,a.jsx)(`h2`,{className:`min-w-0 font-display font-semibold text-xl`,children:n}),(0,a.jsx)(l,{label:r(`common.close`),onClick:t,className:`-mt-1.5 -mr-2`,children:(0,a.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,className:`size-4`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})})})]}):null,s]}):null})}function T({children:e}){return(0,a.jsx)(`div`,{className:`py-16 text-center text-ink-3`,children:e})}function E({text:e}){return e.split(/(https?:\/\/[^\s)]+)/).map((e,t)=>t%2?(0,a.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`font-medium text-ink underline underline-offset-2`,children:new URL(e).host},e):e)}export{o as _,T as a,b as c,h as d,x as f,m as g,v as h,w as i,E as l,y as m,S as n,l as o,p,C as r,f as s,c as t,g as u};
|