@engenty/wizards-runtime 0.19.1 → 0.20.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/apps/runtime/dist/agents/architect.js +4 -4
- package/apps/runtime/dist/agents/studio-assistant.js +2 -31
- package/apps/runtime/dist/app.js +4 -4
- package/apps/runtime/dist/assistant/knows.js +2 -2
- package/apps/runtime/dist/auth/index.js +1 -1
- package/apps/runtime/dist/authoring/example.js +1 -1
- package/apps/runtime/dist/authoring/guide.js +35 -6
- package/apps/runtime/dist/broker/account.js +85 -16
- package/apps/runtime/dist/broker/call.js +137 -37
- package/apps/runtime/dist/broker/log.js +19 -5
- package/apps/runtime/dist/broker/rwx.js +12 -9
- package/apps/runtime/dist/connectors/index.js +52 -11
- package/apps/runtime/dist/connectors/person-connections.js +279 -0
- package/apps/runtime/dist/connectors/person-sign-ins.js +74 -3
- package/apps/runtime/dist/connectors/same-service.js +14 -0
- package/apps/runtime/dist/connectors/space-choice.js +116 -0
- package/apps/runtime/dist/connectors/space-connections.js +40 -2
- package/apps/runtime/dist/db/client.js +8 -0
- package/apps/runtime/dist/db/kept-accounts.js +88 -0
- package/apps/runtime/dist/db/migrations/tenant/0075_person_connection.sql +25 -0
- package/apps/runtime/dist/db/migrations/tenant/0076_clients_in_spaces.sql +28 -0
- package/apps/runtime/dist/db/migrations/tenant/0077_client_spaces_at_root.sql +21 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0075_snapshot.json +7859 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0076_snapshot.json +7859 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0077_snapshot.json +7859 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +21 -0
- package/apps/runtime/dist/db/schema.js +67 -16
- package/apps/runtime/dist/docs/dev/api.md +8 -8
- package/apps/runtime/dist/docs/dev/wizard-format/index.md +3 -1
- package/apps/runtime/dist/elements/caller.js +1 -1
- package/apps/runtime/dist/elements/knowledge.js +5 -5
- package/apps/runtime/dist/elements/wizards.js +7 -11
- package/apps/runtime/dist/engine/notices.js +13 -1
- package/apps/runtime/dist/engine/requirements.js +116 -3
- package/apps/runtime/dist/engine/run-needs.js +58 -0
- package/apps/runtime/dist/engine/runner.js +209 -16
- package/apps/runtime/dist/engine/starts.js +9 -0
- package/apps/runtime/dist/engine/types.js +5 -1
- package/apps/runtime/dist/harness/claude.js +3 -1
- package/apps/runtime/dist/manage.js +1 -1
- package/apps/runtime/dist/mcp/tools.js +3 -3
- package/apps/runtime/dist/plugins/runs.js +2 -1
- package/apps/runtime/dist/prompts/authoring.md +13 -3
- package/apps/runtime/dist/prompts/goose.md +0 -5
- package/apps/runtime/dist/routes/api.js +9 -4
- package/apps/runtime/dist/routes/client-contract.js +2 -2
- package/apps/runtime/dist/routes/client-spaces.js +1 -16
- package/apps/runtime/dist/routes/connections.js +6 -1
- package/apps/runtime/dist/routes/marketplace.js +27 -7
- package/apps/runtime/dist/routes/plugins.js +1 -1
- package/apps/runtime/dist/routes/runs.js +157 -11
- package/apps/runtime/dist/routes/studio.js +42 -5
- package/apps/runtime/dist/services/client-portal.js +58 -49
- package/apps/runtime/dist/services/client-spaces.js +57 -125
- package/apps/runtime/dist/services/links.js +3 -3
- package/apps/runtime/dist/services/marketplace.js +6 -2
- package/apps/runtime/dist/services/members-studio.js +1 -1
- package/apps/runtime/dist/services/query-vectors.js +1 -1
- package/apps/runtime/dist/services/runs.js +19 -20
- package/apps/runtime/dist/services/space-parent.js +4 -11
- package/apps/runtime/dist/services/spaces.js +56 -47
- package/apps/runtime/dist/services/work-ai.js +3 -3
- package/apps/runtime/dist/store/index.js +28 -8
- package/apps/runtime/dist/store/shared-lists.js +2 -2
- package/apps/runtime/dist/sync/hub.js +9 -5
- package/apps/runtime/dist/tools/connector.js +4 -2
- package/apps/web/dist/assets/{AboutDialog-BUWu36Mb.js → AboutDialog-QWzpEK8M.js} +1 -1
- package/apps/web/dist/assets/{BlockEditor-1-EvUIta.js → BlockEditor-C44bI_ih.js} +1 -1
- package/apps/web/dist/assets/{Bundle-RNkjBwAL.js → Bundle-DZyQ1FP7.js} +1 -1
- package/apps/web/dist/assets/CapabilitiesPage-DAr0-gN1.js +2 -0
- package/apps/web/dist/assets/{ChangelogDialog-C_ZZLRZT.js → ChangelogDialog-CdHqJV2P.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-BEJKIMd0.js → CodeEditor-BRufUwu0.js} +1 -1
- package/apps/web/dist/assets/ConnectorsSection-BO6jHrYU.js +1 -0
- package/apps/web/dist/assets/EditorPage-Bx-fKnsY.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-ptI86Ogs.js → FlowPreview-aj58c-gH.js} +1 -1
- package/apps/web/dist/assets/{LangSwitch-BNa_H8AR.js → LangSwitch-BNkytlus.js} +1 -1
- package/apps/web/dist/assets/Marketplace-D3hdvrkz.js +2 -0
- package/apps/web/dist/assets/NewWizardChannels-fveQcQlY.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-BTX1g2t1.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-DwF6KdQy.js +1 -0
- package/apps/web/dist/assets/ProtocolSection-YnJcMN9E.js +1 -0
- package/apps/web/dist/assets/PublicRunner-Bp4DxTrD.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-YF0RkR7P.js → ReadOnly-C6qmTD35.js} +1 -1
- package/apps/web/dist/assets/{Results-DJRLiVo0.js → Results-BNuuBiwU.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-CSpTNJp-.js → RunDrawer-CMgN-XTB.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-CuUB26YJ.js +2 -0
- package/apps/web/dist/assets/SetupPage-llGzMVeH.js +1 -0
- package/apps/web/dist/assets/{SharePage-OiKEnmL1.js → SharePage-CgQp_PT6.js} +1 -1
- package/apps/web/dist/assets/SkillEditor-ARx8QPGp.js +1 -0
- package/apps/web/dist/assets/Skills-frfXXEcF.js +9 -0
- package/apps/web/dist/assets/SpacePage-Dv6ocsc_.js +2 -0
- package/apps/web/dist/assets/StudioHome-B0bZRm1L.js +1 -0
- package/apps/web/dist/assets/TableEditor-CfzTLmJF.js +7 -0
- package/apps/web/dist/assets/{UpdateCheck-BpdsLIOc.js → UpdateCheck-D3QhfI5c.js} +2 -2
- package/apps/web/dist/assets/{brand-ByQY-UcL.js → brand-DKuVyYhH.js} +1 -1
- package/apps/web/dist/assets/changelog-Db3nvWao.js +1 -0
- package/apps/web/dist/assets/{code-editor-B8zG80PA.js → code-editor-BLwDuQLI.js} +2 -2
- package/apps/web/dist/assets/host-C-AAp8Bz.js +69 -0
- package/apps/web/dist/assets/i18n-Dyi0kvaA.js +55 -0
- package/apps/web/dist/assets/{index-D18zQ05f.css → index-CduFlFCp.css} +1 -1
- package/apps/web/dist/assets/index-CtE0rJEL.js +102 -0
- package/apps/web/dist/assets/{read-aloud-spC7eEBp.js → read-aloud-DGS8mWgC.js} +1 -1
- package/apps/web/dist/assets/session-EIDP3Wzc.js +1 -0
- package/apps/web/dist/assets/theme-B46aPLtX.js +14 -0
- package/apps/web/dist/assets/ui-DSgksc1H.js +16 -0
- package/apps/web/dist/assets/{useMutation-CoEdB_9_.js → useMutation-fT44ij_b.js} +1 -1
- package/apps/web/dist/assets/{viewers-BmcrgvXX.js → viewers-DvA5VsXw.js} +2 -2
- package/apps/web/dist/index.html +18 -13
- package/apps/web/dist/mcp/flow.html +62 -62
- package/node_modules/@engenty/wizards-shared/dist/catalog-prompt.js +2 -2
- package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +67 -0
- package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +10324 -7
- package/node_modules/@engenty/wizards-shared/dist/definition.js +32 -6
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +17 -23
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +17 -23
- package/node_modules/@engenty/wizards-shared/dist/json-schema.js +3 -3
- package/node_modules/@engenty/wizards-shared/dist/marketplace-search.js +7 -1
- package/node_modules/@engenty/wizards-shared/dist/marketplace.d.ts +9 -2
- package/node_modules/@engenty/wizards-shared/dist/page-data.d.ts +72 -0
- package/node_modules/@engenty/wizards-shared/dist/page-data.js +5 -0
- package/node_modules/@engenty/wizards-shared/dist/page-look.d.ts +17 -0
- package/node_modules/@engenty/wizards-shared/dist/page-look.js +118 -0
- package/node_modules/@engenty/wizards-shared/dist/page-styles.d.ts +6 -0
- package/node_modules/@engenty/wizards-shared/dist/page-styles.js +98 -0
- package/node_modules/@engenty/wizards-shared/dist/page-texts.d.ts +36 -0
- package/node_modules/@engenty/wizards-shared/dist/page-texts.js +119 -0
- package/node_modules/@engenty/wizards-shared/dist/requires.js +2 -0
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +54 -1
- package/node_modules/@engenty/wizards-shared/dist/run.js +23 -0
- package/node_modules/@engenty/wizards-shared/dist/runner-texts.d.ts +27 -1
- package/node_modules/@engenty/wizards-shared/dist/runner-texts.js +26 -0
- package/node_modules/@engenty/wizards-shared/dist/store.d.ts +24 -1
- package/node_modules/@engenty/wizards-shared/dist/transition.d.ts +2 -1
- package/node_modules/@engenty/wizards-shared/dist/transition.js +5 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-text.js +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/CapabilitiesPage-fgTP28Mn.js +0 -2
- package/apps/web/dist/assets/ConnectorsSection-iLrduYak.js +0 -1
- package/apps/web/dist/assets/EditorPage-CRZte0O1.js +0 -3
- package/apps/web/dist/assets/Marketplace-9aGWG2pJ.js +0 -2
- package/apps/web/dist/assets/NewWizardChannels-BFDm9vCT.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-ueGFlLDo.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-DtDd7k_O.js +0 -1
- package/apps/web/dist/assets/PreviewPane-CEltrf_-.js +0 -7
- package/apps/web/dist/assets/ProtocolSection-Bb3c44Te.js +0 -1
- package/apps/web/dist/assets/PublicRunner-BaTg24s3.js +0 -1
- package/apps/web/dist/assets/SettingsPage--_ap3omw.js +0 -2
- package/apps/web/dist/assets/SetupPage-ELKHbmnE.js +0 -1
- package/apps/web/dist/assets/SkillEditor-C1_zwNOQ.js +0 -1
- package/apps/web/dist/assets/Skills-_pLGtOjH.js +0 -9
- package/apps/web/dist/assets/SpacePage-r4EbxEJe.js +0 -2
- package/apps/web/dist/assets/StudioHome-CwvxI29m.js +0 -1
- package/apps/web/dist/assets/changelog-Dt-V-BKp.js +0 -1
- package/apps/web/dist/assets/host-Ckjz94Ea.js +0 -69
- package/apps/web/dist/assets/i18n-ClCOlfx2.js +0 -55
- package/apps/web/dist/assets/index-BHKh0A9F.js +0 -10
- package/apps/web/dist/assets/runners-DNqzwMQ0.js +0 -1
- package/apps/web/dist/assets/session-Dd9duhPc.js +0 -1
- package/apps/web/dist/assets/theme-DumM6FI_.js +0 -14
- package/apps/web/dist/assets/ui-BjhZhw8x.js +0 -16
|
@@ -1 +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{$ as r,
|
|
1
|
+
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,Sr as i,Zt as a,_t as o,gt as s,mt as c,xt as l}from"./ui-DSgksc1H.js";import{d as u}from"./marked.esm-BfGIZK7F.js";import{h as d,n as f,s as p,st as m,vt as h}from"./i18n-Dyi0kvaA.js";var g={name:`folder-up`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]};g.node;var _=u(g),v={name:`mic-off`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]};v.node;var y=u(v),b={name:`phone-off`,size:24,node:[[`path`,{d:`M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272`,key:`1wngk7`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}],[`path`,{d:`M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473`,key:`10hv5p`}]]};b.node;var x=u(b),S={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};S.node;var C=u(S),w=e(n(),1);async function T(){let{account:e}=await(await fetch(c(`/api/auth/sign-out`),{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:`{}`})).json().catch(()=>({}));if(!e){window.location.reload();return}let t=document.createElement(`form`);t.method=`POST`,t.action=e,document.body.append(t),t.submit()}function E({name:e,until:t}){let n=new Intl.DateTimeFormat(f,{timeStyle:`short`}).format(new Date(t));return(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-x-3 gap-y-1 bg-amber-tint px-4 py-2 text-center text-[0.8125rem] text-ink`,children:[(0,w.jsx)(`span`,{children:p(`impersonation.banner`,{name:e,time:n})}),(0,w.jsx)(`button`,{type:`button`,className:`font-medium underline underline-offset-2 hover:text-ink-2`,onClick:()=>void T(),children:p(`impersonation.back`)})]})}function D(){let e=i({queryKey:[`impersonation`],queryFn:()=>r.get(`/api/public/impersonation`),staleTime:6e4,retry:!1});return e.data?(0,w.jsx)(E,{name:e.data.name,until:e.data.until}):null}var O=e(t(),1),k=[`classifier`,`low`],A=12e3;function j(e){o(`think`)&&r.post(`/api/runs/${e}/device`,{think:{classes:k,maxChars:A}}).catch(()=>void 0)}async function M(e,t){if(t.kind!==`think`)return;let n;try{let e=await s(`think`,{system:t.system,prompt:t.prompt,schema:t.schema});n={text:String(e?.text??``)}}catch(e){n={error:e.message.slice(0,500)}}await r.post(`/api/runs/${e}/device/${t.id}`,n).catch(()=>void 0)}var N=45e3,P=3e4,F=2e3,I=1e4,L=e=>e instanceof a&&(e.status===0||e.status===502||e.status===503||e.status===504);function R(e,t,n){let r=e.ahead?.[t];return r?{...e,step:r.step,values:n,unsent:void 0,known:n,prefill:{},pageData:void 0,options:void 0,cards:void 0,decidedFields:void 0,closed:{},progress:r.progress,canBack:!1,answered:e.step?[...e.answered,e.step]:e.answered,ask:null,question:null,shown:[],lists:[],error:null}:e}function z(e){let[t,n]=(0,O.useState)(null),[i,o]=(0,O.useState)(null),[s,l]=(0,O.useState)(!1),[u,f]=(0,O.useState)(!1),[p,h]=(0,O.useState)({}),[g,_]=(0,O.useState)(null),[v,y]=(0,O.useState)(null),b=(0,O.useRef)([]),x=(0,O.useRef)(Math.random().toString(36).slice(2,12)),S=(0,O.useRef)(!1),C=(0,O.useRef)(0),w=(0,O.useRef)(0),T=(0,O.useRef)(null),E=(0,O.useRef)(e=>{e.rev<C.current||(T.current=e,b.current.length||(_(null),n(e)))});(0,O.useEffect)(()=>{if(n(null),_(null),l(!1),b.current=[],C.current=0,w.current=0,T.current=null,!e)return;let t=!1,i=0,o,s=null,u=Date.now(),d=()=>{t=!0,s?.close(),l(!0)},f=async()=>{try{let n=await r.get(`/api/runs/${e}`);t||E.current(n)}catch(e){e instanceof a&&e.status===404&&d()}},p=()=>{if(clearTimeout(o),s?.close(),t)return;let n=new EventSource(c(`/api/runs/${e}/stream`),{withCredentials:!0});s=n,u=Date.now(),j(e),n.addEventListener(`device`,t=>{u=Date.now(),M(e,JSON.parse(t.data))}),n.addEventListener(`view`,e=>{i=0,u=Date.now(),E.current(JSON.parse(e.data))}),n.addEventListener(`ping`,()=>{u=Date.now()}),n.onerror=()=>{n.close(),t||s!==n||(s=null,f(),i=Math.min(i+1,6),o=setTimeout(p,500*2**i))}},m=()=>{t||document.visibilityState!==`visible`||(!s||s.readyState===EventSource.CLOSED||Date.now()-u>N?(i=0,p()):f())},h=setInterval(()=>{!t&&s&&Date.now()-u>N&&(i=0,p())},15e3),g=()=>{!t&&document.visibilityState===`visible`&&r.post(`/api/runs/${e}/seen`).catch(()=>void 0)},v=setInterval(g,P);return g(),p(),document.addEventListener(`visibilitychange`,g),document.addEventListener(`visibilitychange`,m),window.addEventListener(`pageshow`,m),window.addEventListener(`online`,m),()=>{t=!0,clearTimeout(o),clearInterval(h),clearInterval(v),document.removeEventListener(`visibilitychange`,g),document.removeEventListener(`visibilitychange`,m),window.removeEventListener(`pageshow`,m),window.removeEventListener(`online`,m),s?.close()}},[e]);let D=(0,O.useCallback)(async(t,n)=>{if(!e)return!1;f(!0),o(null),h({});try{return await r.post(`/api/runs/${e}/${t}`,n),!0}catch(e){return e instanceof a&&e.status===422&&Array.isArray(e.body?.fields)&&h(Object.fromEntries(e.body.fields.map(e=>[e.field,e.message]))),o(e.message),!1}finally{f(!1)}},[e]),k=(0,O.useCallback)(async t=>{let n=setTimeout(()=>y(e=>e??`slow`),F),i=1e3;try{for(;;)try{let n=await r.post(`/api/runs/${e}/pages/${t.stepId}`,{values:t.values,seq:t.seq,tab:x.current});return C.current=Math.max(C.current,n.rev??0),y(e=>e===`offline`?`slow`:e),!0}catch(n){if(L(n)){y(`offline`),await new Promise(e=>setTimeout(e,i)),i=Math.min(i*2,I);continue}n instanceof a&&n.status===422&&Array.isArray(n.body?.fields)&&h(Object.fromEntries(n.body.fields.map(e=>[e.field,e.message]))),o(n.message),await r.put(`/api/runs/${e}/pages/${t.stepId}/unsent`,{values:t.values}).catch(()=>void 0);let s=await r.get(`/api/runs/${e}`).catch(()=>null);return s&&(T.current=s),!1}}finally{clearTimeout(n)}},[e]),A=(0,O.useCallback)(async()=>{if(S.current)return;S.current=!0;try{for(;b.current.length;){let e=b.current[0];if(!await k(e)){let e=b.current;b.current=[];for(let t of e)t.settle(!1);break}b.current.shift(),e.settle(!0)}}finally{S.current=!1}y(null);let e=T.current;e&&e.rev>=C.current&&(_(null),n(e))},[k]),z=(0,O.useCallback)(async(n,r)=>{let i=g??t;if(!e||!i)return!1;let a={...i.values,...r},s=i.ahead&&i.status===`waiting_input`?m(i.ahead,n,a):null;w.current=Math.max(w.current,T.current?.pagesSent??i.pagesSent??0)+1;let c=()=>void 0,l=new Promise(e=>{c=e});if(b.current.push({stepId:n,values:r,seq:w.current,settle:c}),o(null),h({}),s)return _(R(i,s,a)),A(),!0;f(!0),A();let u=await l;return f(!1),u},[e,g,t,A]);return d(t?.translation?.labels),{view:g??t,notFound:s,error:i,busy:u,fieldErrors:p,saving:v,submitPage:z,accept:(e,t,n)=>D(`reviews/${e}`,{type:`accept`,edits:t,note:n}),decline:(e,t)=>D(`reviews/${e}`,{type:`decline`,note:t}),regenerate:(e,t,n,r)=>D(`reviews/${e}`,{type:`regenerate`,target:t,note:n,items:r?.length?r:void 0}),back:()=>D(`back`),withdraw:()=>D(`cancel`),retry:()=>D(`retry`),translateResult:e=>D(`translate-result`,{stepId:e}),setLang:e=>D(`lang`,{lang:e})}}function B({runId:e,onNotFound:t,...n}){let r=z(e);return(0,O.useEffect)(()=>{r.notFound&&t?.()},[r.notFound,t]),r.notFound&&t?null:(0,w.jsx)(l,{run:r,...n})}var V=`wz.readAloud`,H=typeof window<`u`&&`speechSynthesis`in window&&`SpeechSynthesisUtterance`in window;function U(){try{return localStorage.getItem(V)===`1`}catch{return!1}}function W(e){try{localStorage.setItem(V,e?`1`:`0`)}catch{}}function G(e){let t=window.speechSynthesis.getVoices(),n=e.slice(0,2);return t.find(t=>t.lang===e&&t.default)??t.find(t=>t.lang===e)??t.find(e=>e.lang.startsWith(n)&&e.default)??t.find(e=>e.lang.startsWith(n))??null}function K(e,t=f,n=!1){if(!H||!e.trim())return;let r=window.speechSynthesis;n&&r.cancel();let i=h(t),a=new SpeechSynthesisUtterance(e.trim().slice(0,2e3));a.lang=i;let o=G(i);o&&(a.voice=o),r.speak(a)}function q(e,t=f){if(!H||!e.trim())return Promise.resolve();let n=window.speechSynthesis;n.cancel();let r=h(t),i=new SpeechSynthesisUtterance(e.trim().slice(0,4e3));i.lang=r;let a=G(r);return a&&(i.voice=a),new Promise(e=>{i.onend=()=>e(),i.onerror=()=>e(),n.speak(i)})}function J(e){return e.replace(/```[\s\S]*?```/g,``).replace(/!\[[^\]]*\]\([^)]*\)/g,``).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/https?:\/\/\S+/g,``).replace(/^#+\s*/gm,``).replace(/^\s*[-*]\s+/gm,``).replace(/[*_`>|]/g,``).replace(/\n{2,}/g,`. `).replace(/\s+/g,` `).trim()}function Y(){H&&window.speechSynthesis.cancel()}function X(){let[e,t]=(0,O.useState)(()=>H&&U()),n=(0,O.useCallback)(e=>{t(e),W(e),e||Y()},[]);return(0,O.useEffect)(()=>{H&&window.speechSynthesis.getVoices()},[]),(0,O.useEffect)(()=>()=>Y(),[]),[e,n]}function Z(e,t,n,r){let i=(0,O.useRef)(null);(0,O.useEffect)(()=>{if(!e){i.current=null;return}let a=n.map(e=>e.key);if(!i.current){i.current=new Set(a);let e=[...n].reverse().find(e=>e.who===`bot`&&e.spoken!==!1);if(e){let n=r(e.key);n&&K(n,t,!0)}return}let o=n.filter(e=>!i.current?.has(e.key));for(let e of a)i.current.add(e);o.some(e=>e.who===`me`)&&Y();for(let e of o)if(e.who===`bot`&&e.spoken!==!1){let n=r(e.key);n&&K(n,t)}},[e,t,n,r])}export{X as a,z as c,C as d,x as f,J as i,E as l,_ as m,Y as n,Z as o,y as p,q as r,B as s,H as t,D as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,o as n,z as r}from"./i18n-Dyi0kvaA.js";import{$ as i,Sr as a,Z as o,Zt as s,lt as c,mt as l,ni as u,st as d}from"./ui-DSgksc1H.js";import{n as f}from"./jsx-runtime-C3cWAN_r.js";var p={account:{kind:`release`,default:!0,label:`Account in a local install`,hint:`Linking, Settings → Account, the offer to sign in.`},twoWaySync:{kind:`release`,default:!0,label:`Two-way sync with the cloud`,hint:`A local install with an account keeps its spaces in step with the organization in the cloud, both ways: wizards, knowledge, data and files.`},liveChanges:{kind:`release`,default:!0,label:`Live changes in the studio`,hint:`An open studio shows what changed elsewhere (another member, a run, the AI, the sync) without a reload.`},unsetConnectors:{kind:`release`,default:!1,label:`Connectors without an OAuth client`,hint:`Built-in connectors are shown although their client is not set up.`},site:{kind:`release`,default:!1,label:`Link to the website in the setup`,hint:`The local install's setup links the product's site.`},teamPlans:{kind:`release`,default:!1,label:`Organization plans`,hint:`The organization page in the cloud studio, and plans that carry this switch on the account pages.`},organizationSettings:{kind:`release`,default:!1,label:`Organization settings in the studio`,hint:`Settings › Organisation in the cloud studio: the organization's name, its members and invitations, changed there instead of on the account pages.`},channelVoice:{kind:`release`,default:!1,label:`Live voice`,hint:`Wizards run as a spoken conversation in the browser: offered when building and sharing.`},channelVideo:{kind:`release`,default:!1,label:`Video call`,hint:`Wizards run as a video call in the browser: offered when building and sharing.`},pages:{kind:`release`,default:!1,label:`Public page`,hint:`A space's page at the organization's address on wizards.page: its part in the space, the share dialog's switch.`},wordpress:{kind:`release`,default:!1,label:`WordPress plugin`,hint:`The plugin for WordPress sites, and a wizard as a package for one: offered in the share dialog and under Settings → Integrate.`},skills:{kind:`release`,default:!0,label:`Skills`,hint:`Skills, a place of their own in the app bar: from skills.sh, uploaded or written; always on in every AI step, or read by a wizard when it needs one.`},plugins:{kind:`release`,default:!1,label:`Plugins in the settings`,hint:`Settings › Plugins, also before any plugin is installed. Installing a plugin turns it on.`},goose:{kind:`plan`,default:!0,label:`Goose`,hint:`The studio's assistant: its chat at the foot of the page and in the sidebar.`},workMode:{kind:`release`,default:!1,label:`Work mode`,hint:"The switch between Studio and Work in the app bar, and Work's chats. Client comes with the public page (`pages`)."},workWip:{kind:`release`,default:!1,label:`Work – WiP`,hint:`Work's places that aren't built yet, in the app bar under the chats: engenties, files, data, results and the bell.`},modelTiers:{kind:`release`,default:!1,label:`Model tiers`,hint:`The organization's model tier: steps may name a maker, calls say what they are for, and the studio shows what each class runs on in the tier.`},ownKeysGateway:{kind:`release`,default:!1,label:`Own API keys through the gateway`,hint:`The organization's own accounts at the providers live in the Manage-App, and every cloud call goes through the gateway, which runs it on such an account or on credits. Keys saved in the cloud studio move there once.`},customDomains:{kind:`release`,default:!1,label:`Own domains`,hint:`Settings › Allgemein: the organization's wizards under a domain of its own, once a TXT record confirms it.`},broker:{kind:`release`,default:!0,label:`Broker`,hint:`RWX rules per space: who may read, write and execute what; enforced at every reader.`},dockerEgress:{kind:`release`,default:!1,label:`Docker sandbox through the broker`,hint:`A Docker sandbox reaches the internet only through the runtime: the hosts its run may reach and the package registries, each connection in the log.`},capabilities:{kind:`release`,default:!0,label:`Capabilities`,hint:`One place in the app bar for Skills and Verbindungen: the space's connections with sign-in, audience and rules, each person's own sign-ins, the broker's Protokoll, Entdecken.`},clientSpaces:{kind:`release`,default:!1,label:`Client spaces`,hint:`A space's clients, each in a client space under it: their own data, results and chats, the firm's setup read from the space (docs/plans/client-spaces.md).`},orgSpaces:{kind:`release`,default:!0,label:`Organization, spaces and folders`,hint:`The organization's own space as the root, Mein Space per person, every other space under the root; the path bar with the space menu instead of the space tile; Ordner in Work (docs/plans/org-spaces.md).`},knowledgeTree:{kind:`plan`,default:!0,label:`Knowledge as a knowledge base`,hint:`Knowledge's start page with one Add menu, folders in its menu and categories as a tab, the block editor for pages (docs/plans/knowledge-base.md).`},knowledgeMedia:{kind:`release`,default:!1,label:`Pictures in Wissen by what they show`,hint:`Pictures and PDF pages are embedded as pictures where the embedding model takes them (EmbeddingGemma 2), so a search finds a photo by what it shows (docs/plans/media-and-files.md).`},gatewaySearch:{kind:`release`,default:!1,label:`Web search through the gateway`,hint:`web_search through the gateway's /v1/web/search for every model and client, in place of the model's own search. On once the gateway has its provider's key.`},dateien:{kind:`release`,default:!1,label:`Dateien`,hint:`File trees another party owns, mounted in a space and indexed where they live: a folder on this computer first (docs/plans/media-and-files.md).`},kernel:{kind:`release`,default:!1,label:`Wizards made of step files`,hint:`Version 0.3.0 of the format: a file with what a wizard needs and its map, and one function per step. The kernel moves its runs (docs/plans/kernel.md).`},durableRuns:{kind:`release`,default:!1,label:`Runs that last days`,hint:`Runs that wait for days and survive a restart: a clock or a signal wakes them, and a deadline holds automatic steps. What a step did outside happens once, an AI step goes on where it was and can stop to ask a person. Retries over time and onFail; out of credits waits for a top-up.`},startTriggers:{kind:`release`,default:!1,label:`Starts by itself`,hint:`A wizard that runs on a schedule: the share dialog's section, the clock, the bell (docs/plans/starts.md).`},fastCreate:{kind:`release`,default:!1,label:`Fast first draft`,hint:`A new wizard's first pages within seconds: one quick model call writes the text form, each page is saved as it arrives, and the architect finishes the rest while the person looks (docs/plans/fast-creation.md, Part 3).`},codeSteps:{kind:`release`,default:!1,label:`Code steps`,hint:`A step that runs a function from the wizard's files with no model: maths, reshaping, scoring. With it, function tools in the wizard's files that a step's model calls (docs/plans/wizard-code.md). The architect knows both, and a run with them starts (docs/plans/code-step.md).`},runConnections:{kind:`release`,default:!1,label:`Connections a run finds`,hint:`A run finds the account for what its wizard needs: a person's own account from another wizard, and the space's connections for the need (docs/plans/run-connections.md).`},ownKeys:{kind:`plan`,default:!0,label:`Own API keys`,hint:`The organization puts its providers' keys into the cloud studio instead of running on credits.`},personSignIn:{kind:`plan`,default:!0,label:`Each person signs in to a connection`,hint:`A space's connection may have each person sign in with their own account. Without it a connection signs in as the space.`}};function m(e,t){let n=e?.[t];return typeof n==`boolean`?n:Object.hasOwn(p,t)?p[t].default:!1}function h(e=p){let t={};for(let[n,r]of Object.entries(e))t[n]=r.default;return t}var g=e(f(),1);function _(e){return Object.fromEntries(r.filter(t=>e[t]?.startsWith(`apple:`)).map(e=>[e,``]))}function v(e){return e.split(/\s+/).map(e=>e.match(/[\p{L}\p{N}]/u)?.[0]??``).join(``).slice(0,2).toUpperCase()}function y(){let e=T().data?.limits.spaces;return e===null||(e??1)>1}function b(){return T().data?.limits.build??!0}function x(){let e=T().data,t=M().space?.studio??!1;return!e||e.limits.create||m(e.features,`capabilities`)&&e.limits.build&&t}function S(){let e=T().data;return!e||e.mode===`local`||e.tenant.role!==`member`}function C(){let e=u();return n=>{t(n),e.setQueryData([`me`],e=>e&&{...e,lang:n}),i.put(`/api/studio/lang`,{lang:n}).catch(()=>void 0)}}function w(e){let r=u();(0,g.useEffect)(()=>{if(!e)return;if(e.lang){t(e.lang);return}let a=n();a&&(r.setQueryData([`me`],e=>e&&{...e,lang:a}),i.put(`/api/studio/lang`,{lang:a}).catch(()=>void 0))},[e,r])}function T(){return a({queryKey:[`me`],queryFn:async()=>{try{return await i.get(`/api/studio/me`)}catch(e){if(e instanceof s&&e.status===401)return null;throw e}},staleTime:3e4})}function E(e=!0){return a({queryKey:o.spaces(),queryFn:()=>i.get(`/api/studio/spaces`),enabled:e})}var D=`wz.space`;function O(){try{return localStorage.getItem(D)}catch{return null}}var k=O(),A=new Set;function j(e){k=e;try{localStorage.setItem(D,e)}catch{}for(let e of A)e()}function M(){let e=E(),t=(0,g.useSyncExternalStore)(e=>(A.add(e),()=>A.delete(e)),()=>k),n=e.data??[];return{space:n.find(e=>e.id===t)??n[0]??null,spaces:n,select:j,loading:e.isLoading}}function N(e,t){return a({queryKey:[`cloud`,e],queryFn:()=>i.get(`/api/studio/wizards/${e}/cloud`),enabled:t})}function P(e){return e instanceof s&&e.body?.code===`read_only`?e.message:null}async function F(){let{account:e}=await(await fetch(l(`/api/auth/sign-out`),{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:`{}`})).json().catch(()=>({}));if(!e){window.location.href=`${d}/`;return}let t=document.createElement(`form`);t.method=`POST`,t.action=e;let n=document.createElement(`input`);n.type=`hidden`,n.name=`return`,n.value=`${window.location.origin}${d}/`,t.append(n),document.body.append(t),t.submit()}function I(e=L(),t){let n=new URLSearchParams({return:e});c!==d&&n.set(`organization`,c.slice(d.length+1)),t?.trim()&&n.set(`wish`,t.trim()),window.location.href=l(`/api/auth/login?${n}`)}function L(){let e=new URLSearchParams(window.location.search);e.delete(`signin`);let t=e.toString();return`${window.location.pathname}${t?`?${t}`:``}`}var R=`wizards.wish`,z=1;function B(e){try{localStorage.setItem(R,JSON.stringify({text:e,at:Date.now()}))}catch{}}function V(){try{let e=JSON.parse(localStorage.getItem(R)??`null`);if(typeof e?.text==`string`&&typeof e.at==`number`&&Date.now()-e.at<z*864e5)return e.text}catch{}return null}function H(){try{localStorage.removeItem(R)}catch{}}export{E as _,P as a,m as b,w as c,S as d,y as f,C as g,T as h,V as i,N as l,x as m,v as n,I as o,b as p,B as r,F as s,H as t,M as u,_ as v,h as y};
|
|
@@ -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,An as i,At as a,Bn as o,Bt as s,Cn as c,Ct as l,Dn as u,Dt as d,En as f,Et as p,Fn as m,Ft as h,Gt as g,It as _,Jt as v,Kt as y,Lt as b,Mn as x,Mt as S,Nt as C,On as w,Pt as T,Rn as E,Rt as D,St as O,Tt as k,Un as A,Vn as j,Yt as M,Zt as N,_t as P,an as F,bn as ee,cn as te,cr as ne,dn as I,fn as re,gn as L,gt as ie,hn as ae,kt as oe,lr as se,mt as ce,p as le,pn as ue,qt as de,sr as fe,tr as pe,un as me,wn as he,wt as ge,xn as R,zt as _e}from"./ui-DSgksc1H.js";import{t as ve}from"./react-dom-BwXff0Px.js";import{c as ye,d as z,l as be,u as xe}from"./marked.esm-BfGIZK7F.js";import{n as Se,r as Ce,t as we}from"./volume-2-Br71vpS5.js";import{a as Te,c as Ee,d as De,f as Oe,m as ke,o as Ae,p as je,t as Me}from"./read-aloud-DGS8mWgC.js";import{n as Ne,o as Pe,s as Fe,u as Ie}from"./brand-DKuVyYhH.js";import{t as Le}from"./phone-CG7Bz_ZL.js";import{t as Re}from"./plug-CHvl1GhO.js";import{t as ze}from"./engenty-Cy7MbUxR.js";import{$ as Be,$t as Ve,B as He,Bt as Ue,Gt as We,Qt as Ge,Vt as B,Wt as Ke,k as qe,mt as Je,n as V,nn as Ye,s as H,t as Xe,tn as U,u as Ze}from"./i18n-Dyi0kvaA.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=z(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=z(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=z(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=z(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=z(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=z(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(ve(),1),mt={mail:tt,folder:ke,chat:j,plug:Re,globe:Se},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)(de,{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)(L,{className:`size-7 text-ember`}),(0,K.jsx)(`h3`,{className:`mt-4 font-display font-semibold text-[1.125rem]`,children:H(`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:R(`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)(w,{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)(F,{variant:`ghost`,busy:a,onClick:()=>{o(!0),r.post(`/api/runs/${e}/share/jobs/${t.id}/cancel`).catch(()=>void 0)},children:H(`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:R(`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)(xe,{className:`size-6`}):(0,K.jsx)(he,{className:`size-6`})}),(0,K.jsx)(`h3`,{className:`mt-4 font-display font-semibold text-[1.125rem]`,children:H(s?`shareRun.done`:t.status===`cancelled`?`shareRun.cancelled`:`shareRun.failed`)}),s&&t.result?(0,K.jsx)(oe,{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)(ye,{className:`size-4`}),` `,H(`share.open`)]}):null]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3`,children:[n?(0,K.jsx)(F,{variant:`ghost`,onClick:n,children:H(s?`shareRun.again`:`shareRun.backToForm`)}):(0,K.jsx)(`span`,{}),(0,K.jsx)(F,{onClick:i,children:H(`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:R(`h-1 rounded-full`,n<t?`bg-moss`:n===t?`bg-ember`:`bg-paper-3`)}),(0,K.jsxs)(`div`,{className:R(`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)(re,{children:H(`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:R(`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:R(`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:d[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)(re,{required:e.required,hint:e.help,children:e.label}),e.kind===`textarea`?(0,K.jsx)(ee,{minRows:3,maxRows:12,value:t,placeholder:e.placeholder,onChange:e=>i(e.target.value)}):e.kind===`select`&&a?.length?(0,K.jsx)(ae,{value:t,onChange:i,options:a,placeholder:``}):(0,K.jsx)(I,{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?H(`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:H(`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 u=(0,G.useMemo)(()=>_t(e),[e]),[d,f]=(0,G.useState)(()=>n?.picked??Object.fromEntries(u.map(e=>[e.from,e.formats[0]]))),[p,m]=(0,G.useState)(()=>n?.values??Object.fromEntries(t.fields.map(e=>[e.id,e.value??``]))),[h,g]=(0,G.useState)({}),[_,v]=(0,G.useState)({}),[y,b]=(0,G.useState)(null),[x,S]=(0,G.useState)(!1),C=t.fields.filter(e=>e.fromAccount).map(e=>e.id);(0,G.useEffect)(()=>{if(!s)return;let e=!0;for(let n of C)r.get(`/api/runs/${a}/share/targets/${encodeURIComponent(t.key)}/choices/${n}?lang=${V}`).then(t=>e&&g(e=>({...e,[n]:t.choices.length?t.choices:null})),()=>e&&g(e=>({...e,[n]:null})));return()=>{e=!1}},[s,a,t.key]);let w=[...o?[H(`shareRun.stepAccount`)]:[],H(`shareRun.stepForm`),H(`shareRun.stepSend`)],E=async()=>{S(!0),v({}),b(null);let e=t.takes===`files`?u.flatMap(e=>d[e.from]?[{from:e.from,format:d[e.from]}]:[]):[];try{i(await r.post(`/api/runs/${a}/share/jobs`,{target:t.key,items:e,values:p,lang:V}),{values:p,picked:d})}catch(e){let t=e instanceof N&&e.status===422?e.body?.fields:null;t?(v(t),t._account&&l(!0)):b(e.message)}finally{S(!1)}};return o&&c?(0,K.jsxs)(`div`,{className:`animate-rise`,children:[(0,K.jsx)(gt,{steps:w,now:0}),(0,K.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-2 leading-relaxed`,children:H(`shareRun.accountHint`)}),(0,K.jsx)(T,{runId:a,connection:t.connection??void 0}),_._account?(0,K.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:_._account}):null,(0,K.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,K.jsxs)(F,{disabled:!s,onClick:()=>l(!1),children:[H(`run.next`),` `,(0,K.jsx)(ne,{className:`size-4`})]})})]}):(0,K.jsxs)(`form`,{className:`animate-rise`,onSubmit:e=>{e.preventDefault(),E()},children:[(0,K.jsx)(gt,{steps:w,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:H(`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:H(`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)(Ce,{className:`mt-0.5 size-4 shrink-0 text-ember-strong`}),` `,H(`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:()=>m(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:p[e.id]??``,choices:h[e.id],error:_[e.id],onChange:t=>m(n=>({...n,[e.id]:t}))},e.id)),t.takes===`files`&&u.length?(0,K.jsx)(vt,{deliverables:u,picked:d,error:_._files,onPick:(e,t)=>f(n=>({...n,[e]:t}))}):null,y?(0,K.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:y}):null]}),(0,K.jsx)(`div`,{className:`action-bar mt-6 flex justify-end`,children:(0,K.jsxs)(F,{type:`submit`,busy:x,children:[(0,K.jsx)(rt,{className:`size-4`}),` `,H(t.agent?`shareRun.start`:`shareRun.send`)]})})]})}function xt(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:H(`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,[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)({at:`home`}),[l,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)({}),h=e.shareJob?.status===`running`?e.shareJob:null,g=(0,G.useCallback)(async()=>{try{u(await r.get(`/api/runs/${n}/share/targets?lang=${V}`)),f(null)}catch(e){f(e.message)}},[n]),_=()=>{o(!0),c(h?{at:`job`,id:h.id,key:null}:{at:`home`}),g()};(0,G.useEffect)(()=>{a&&s.at===`target`&&g()},[a,s.at,e,g]);let v=e.shareJob?.status;(0,G.useEffect)(()=>{a&&v&&v!==`running`&&g()},[a,v,g]);let y=s.at===`target`||s.at===`job`?l?.targets.find(e=>e.key===s.key):void 0,b=s.at===`job`?e.shareJob?.id===s.id?e.shareJob:l?.jobs.find(e=>e.id===s.id):void 0,x=s.at===`home`||s.at===`job`&&b?.status===`running`?null:()=>c({at:`home`});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(F,{variant:`secondary`,onClick:_,children:[h?(0,K.jsx)(L,{className:`size-4`}):(0,K.jsx)(i,{className:`size-4`}),` `,H(`shareRun.button`)]}),(0,K.jsx)(te,{open:a,onClose:()=>o(!1),wide:!0,title:(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[x?(0,K.jsx)(me,{label:H(`run.back`),onClick:x,className:`-my-1.5 -ml-2`,children:(0,K.jsx)(se,{className:`size-4`})}):null,s.at===`link`?H(`shareRun.linkTitle`):y?.name??b?.name??H(`shareRun.title`)]}),children:s.at===`link`?(0,K.jsx)(Ot,{view:e,title:t,onWithdrawn:()=>c({at:`home`})}):s.at===`target`&&y?(0,K.jsx)(bt,{view:e,target:y,draft:p[y.key],onStarted:(e,t)=>{m(e=>({...e,[y.key]:t})),c({at:`job`,id:e.id,key:y.key})}},y.key):s.at===`job`&&b?(0,K.jsx)(ht,{runId:n,job:b,onAgain:s.key?()=>c({at:`target`,key:s.key}):null,onHome:()=>c({at:`home`})}):d?(0,K.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:d}):l?(0,K.jsx)(Et,{overview:l,onLink:()=>c({at:`link`}),onTarget:e=>c({at:`target`,key:e}),onJob:e=>c({at:`job`,id:e,key:null})}):(0,K.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,K.jsx)(L,{})})})]})}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:R(`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)(pe,{className:`size-4 shrink-0 text-ink-4 transition group-hover:text-ember-strong`}):null]}),o=R(`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(V,{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:A,name:H(`share.link`),description:H(`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:H(`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??H(`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)(L,{className:`size-3.5 shrink-0 text-ember`}):(0,K.jsx)(`span`,{className:R(`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 a=e.id,[o,s]=(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(o)return;let e=!0;return r.post(`/api/runs/${a}/share`).then(t=>e&&s(t)).catch(t=>e&&d(t.message)),()=>{e=!1}},[a,o]);let f=async()=>{await r.del(`/api/runs/${a}/share`),n()},p=()=>{o&&(navigator.clipboard.writeText(o.url),l(!0),setTimeout(()=>l(!1),1500))},m=P(`share`)||typeof navigator<`u`&&`share`in navigator,h=o?.expiresAt?new Intl.DateTimeFormat(V,{dateStyle:`long`}).format(new Date(o.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}):o?(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)(A,{className:`size-4 shrink-0 text-ink-3`}),(0,K.jsx)(`input`,{readOnly:!0,value:o.url,onFocus:e=>e.target.select(),"aria-label":H(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,K.jsxs)(F,{size:`sm`,onClick:p,children:[c?(0,K.jsx)(xe,{className:`size-3.5`}):(0,K.jsx)(be,{className:`size-3.5`}),H(c?`share.copied`:`share.copy`)]})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[xt(o.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(P(`share`)?ie(`share`,{link:o.url,title:t}):navigator.share({title:t,url:o.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)(i,{className:`size-5`})}),H(`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?H(`shareRun.until`,{date:h}):H(`shareRun.kept`)}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void f(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:H(`shareRun.withdraw`)})]})]}):(0,K.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,K.jsx)(L,{})})}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:R(`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)(L,{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:R(`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 i=e.state===`live`,a=e.state===`connecting`,[s,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(!1);(0,G.useEffect)(()=>{l(i?Date.now():null)},[i]);let p=async()=>{d(!1),await e.start(),n&&await e.startCamera()},m=()=>{e.stop(),d(!0)},h=n||e.camera,g=[...e.captions].reverse().find(e=>e.who===`bot`),_=[...e.captions].reverse().find(e=>e.who===`me`),v=e.speaking?H(`talk.speaking`):e.listening?H(`talk.listening`):i?H(`talk.live`):a?H(`talk.connecting`):u?H(`video.ended`):``;return(0,K.jsxs)(`section`,{className:R(`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??``}),v?(0,K.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[i?(0,K.jsx)(`span`,{className:R(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,v]}):null,(0,K.jsx)(At,{since:s})]}),(0,K.jsxs)(`div`,{className:R(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,h?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!h&&i&&e.captions.length?`h-[38%]`:h?``:`flex-1`),children:[(0,K.jsxs)(`div`,{className:R(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!h&&`hidden`),children:[(0,K.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:R(`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:H(`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:[H(`video.you`),e.muted?(0,K.jsx)(je,{className:`ml-1.5 inline size-3`}):null]})]}),(0,K.jsxs)(`div`,{className:R(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,h?`bg-neutral-900`:`bg-transparent`,h&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,K.jsx)(`div`,{className:R(`rounded-full transition-shadow duration-500`,!h&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!h&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,K.jsx)(Ne,{kind:t?.wizard.avatar??`round`,costume:t?.wizard.costume,size:h?140:200,fluffy:!0,interactive:!1})}),h?(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]})]}),i&&!h?(0,K.jsx)(Mt,{voice:e}):i&&(g||_)?(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:[_?(0,K.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:_.text}):null,g?(0,K.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:g.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:i?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(jt,{label:H(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,K.jsx)(je,{className:`size-5`}):(0,K.jsx)(o,{className:`size-5`})}),(0,K.jsx)(jt,{label:H(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,K.jsx)(c,{className:`size-5`}):(0,K.jsx)(st,{className:`size-5`})}),e.camera&&kt?(0,K.jsx)(jt,{label:H(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,K.jsx)(f,{className:`size-5`})}):null,(0,K.jsx)(jt,{label:H(`video.leave`),danger:!0,onClick:m,children:(0,K.jsx)(Oe,{className:`size-5`})})]}):(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:a||!t?.talk,onClick:()=>void p(),className:`flex h-12 items-center gap-2 rounded-full bg-emerald-500 px-6 font-medium text-[0.9375rem] text-white transition hover:brightness-110 disabled:opacity-50`,children:[a?(0,K.jsx)(L,{className:`size-4`}):n?(0,K.jsx)(c,{className:`size-5`}):(0,K.jsx)(o,{className:`size-5`}),H(u?`video.rejoin`:n?`video.join`:`talk.start`)]}),!u&&!e.error?(0,K.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:H(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var Pt=e=>qe[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: ${Xe(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 j=(0,G.useRef)(n);j.current=n;let M=(0,G.useRef)(``),N=(0,G.useCallback)(e=>{let t=E.current;t&&t.readyState===`open`&&t.send(JSON.stringify(e))},[]),P=(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)},[]),F=(0,G.useCallback)(()=>{for(let e of S.current?.getTracks()??[])e.stop();S.current=null,x.current&&(x.current.srcObject=null),m(!1)},[]),ee=(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`?H(`talk.cameraDenied`):e.message)}},[]),te=(0,G.useCallback)(async()=>{let e=h===`user`?`environment`:`user`;F(),await ee(e)},[h,F,ee]),ne=(0,G.useCallback)(()=>{v(e=>{for(let t of O.current?.getAudioTracks()??[])t.enabled=e;return!e})},[]),I=(0,G.useCallback)(()=>{F(),E.current?.close(),E.current=null,T.current?.close(),T.current=null;for(let e of O.current?.getTracks()??[])e.stop();O.current=null,D.current&&=(D.current.srcObject=null,D.current.remove(),null),M.current=``,u(!1),f(!1),v(!1),o(`off`)},[F]);(0,G.useEffect)(()=>()=>I(),[I]);let re=(0,G.useCallback)(async(t,n)=>{let i=k.current,a=A.current,o=j.current;switch(t){case`get_state`:return i?Rt(i,a,w.current):`no run`;case`look`:{let e=P();return e?(N({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:`[camera] what the person shows right now`},{type:`input_image`,image_url:e}]}}),`a picture arrived as the next message`):`the camera is off; ask the person to switch it on`}case`take_photo`:{if(!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=P();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,P,N]),L=(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?P():null;e&&(C.current=Date.now(),N({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:`[camera] what the person shows while speaking`},{type:`input_image`,image_url:e}]}}));break}case`input_audio_buffer.speech_stopped`:f(!1);break;case`response.output_audio_transcript.done`:case`conversation.item.input_audio_transcription.completed`:{let e=String(t.transcript??``).trim();if(e){let n=t.type===`response.output_audio_transcript.done`?`bot`:`me`;b(t=>[...t.slice(-199),{id:`${Date.now()}:${n}`,who:n,text:e}])}break}case`response.function_call_arguments.done`:{let e=String(t.name??``),n=String(t.call_id??``),r={};try{r=JSON.parse(String(t.arguments??`{}`))}catch{}re(e,r).then(e=>{N({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:n,output:e}}),N({type:`response.create`})});break}case`error`:c(String(t.error?.message??`error`))}},s.onopen=()=>{o(`live`);let e=k.current;e&&(M.current=Rt(e,A.current,w.current),N({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:`[state]\n${M.current}\n\nGreet the person in one sentence and ask the first open field.`}]}}),N({type:`response.create`}))},s.onclose=()=>{T.current===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(`${H(`talk.failed`)} (${d.status})`);await i.setRemoteDescription({type:`answer`,sdp:await d.text()})}catch(e){I(),c(e.name===`NotAllowedError`?H(`chat.micDenied`):e.message),o(`error`)}}},[e,re,P,N,I]);return(0,G.useEffect)(()=>{if(a!==`live`||!t)return;let e=Rt(t,i,p);if(e===M.current)return;let n=M.current;M.current=e,N({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:`[state]\n${e}`}]}}),(t.status===`running`&&n.startsWith(`status: running`)&&!n.includes(`working on: `)||t.status!==`running`||n.split(`
|
|
13
|
+
`)[1]!==e.split(`
|
|
14
|
+
`)[1])&&N({type:`response.create`})},[a,t,i,p,N]),{state:a,error:s,speaking:l,listening:d,start:L,stop:I,camera:p,facing:h,startCamera:ee,stopCamera:F,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},[]);Ae(!!r?.readAloud,r?.lang??V,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)(Ne,{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:R(`animate-rise`,e.bare?`w-full pt-1`:`rounded-2xl rounded-tl-md text-[0.9375rem] text-ink leading-relaxed`,!e.bare&&(e.wide?R(`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)(m,{className:`size-3`}),` `,H(`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":H(`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:R(`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)(L,{className:`size-4`}):null,t]})}function qt({initial:e=``,placeholder:t,multiline:n,inputProps:r,busy:i,disabled:a,inputRef:s,onSend:l}){let[d,f]=(0,G.useState)(e),p=(0,G.useRef)(null),m=s??p,h=(0,G.useContext)(J),_=le(d,f,{endpoint:h?`/api/runs/${h.runId}/transcribe`:void 0}),v=!!h&&_.supported&&!a;(0,G.useEffect)(()=>{if(!v)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.shiftKey&&e.key.toLowerCase()===`m`&&(e.preventDefault(),_.toggle())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v,_.toggle]),(0,G.useEffect)(()=>{!g&&!a&&m.current?.focus()},[a,m]);let y=()=>{i||a||(_.listening&&_.toggle(),l(d)!==!1&&f(``))},b=_.listening?H(`chat.listening`):_.processing?H(`chat.transcribing`):t,x=h?.voice??null,S=!!h?.call,C=h&&!S&&(Me||v||x)?(0,K.jsxs)(`div`,{className:`mb-1 flex shrink-0 items-center`,children:[x?(0,K.jsx)(me,{label:H(x.state===`live`?`talk.stop`:x.state===`connecting`?`talk.connecting`:`talk.start`),"aria-pressed":x.state===`live`,disabled:x.state===`connecting`,onClick:()=>x.state===`live`?x.stop():void x.start(),className:R(`size-9`,x.state===`live`&&`bg-rose-tint text-rose hover:bg-rose-tint hover:text-rose`,x.state===`off`&&h.talk&&`bg-primary text-primary-foreground hover:bg-primary`),children:x.state===`connecting`?(0,K.jsx)(L,{className:`size-4`}):x.state===`live`?(0,K.jsx)(Oe,{className:`size-4`}):(0,K.jsx)(Le,{className:`size-4`})}):null,x?.state===`live`?(0,K.jsx)(me,{label:H(x.camera?`talk.cameraOff`:`talk.camera`),"aria-pressed":x.camera,onClick:()=>x.camera?x.stopCamera():void x.startCamera(),className:R(`size-9`,x.camera&&`text-ink`),children:x.camera?(0,K.jsx)(c,{className:`size-4`}):(0,K.jsx)(st,{className:`size-4`})}):null,Me?(0,K.jsx)(me,{label:H(h.readAloud?`chat.readAloudOff`:`chat.readAloud`),"aria-pressed":h.readAloud,onClick:()=>h.setReadAloud(!h.readAloud),className:R(`size-9`,h.readAloud&&`text-ink`),children:h.readAloud?(0,K.jsx)(we,{className:`size-4`}):(0,K.jsx)(lt,{className:`size-4`})}):null,v?(0,K.jsx)(me,{label:H(_.listening?`chat.dictateStop`:`chat.dictate`),"aria-pressed":_.listening,disabled:_.processing,onClick:_.toggle,className:R(`size-9`,_.listening&&`bg-rose-tint text-rose hover:bg-rose-tint hover:text-rose`),children:_.processing?(0,K.jsx)(L,{className:`size-4`}):_.listening?(0,K.jsx)(u,{className:`size-3.5 animate-pulse-dot fill-current`}):(0,K.jsx)(o,{className:`size-4`})}):null]}):null;return(0,K.jsxs)(`form`,{className:`pb-3`,onSubmit:e=>{e.preventDefault(),y()},children:[x&&!S?(0,K.jsx)(`video`,{ref:x.video,muted:!0,playsInline:!0,autoPlay:!0,className:R(`mb-2 ml-auto w-32 rounded-xl bg-black object-cover shadow-soft ring-1 ring-border-soft`,x.camera?`block`:`hidden`)}):null,(0,K.jsxs)(`div`,{className:R(`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`,a&&`opacity-60`),children:[C,n?(0,K.jsx)(ee,{ref:m,minRows:1,maxRows:6,value:d,disabled:a,placeholder:b,autoCapitalize:`sentences`,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||g||e.nativeEvent.isComposing||(e.preventDefault(),y())},className:`min-h-11 border-0 bg-transparent py-2.5 shadow-none focus:ring-0`}):(0,K.jsx)(`input`,{ref:m,...r,value:d,disabled:a,placeholder:b,enterKeyHint:`send`,onChange:e=>f(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":H(`chat.send`),title:H(`chat.send`),disabled:i||a,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:i?(0,K.jsx)(L,{className:`size-4`}):(0,K.jsx)(fe,{className:`size-4`})})]}),_.error?(0,K.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-rose`,children:_.error===`denied`?H(`chat.micDenied`):_.error}):S?null:x?.error?(0,K.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-rose`,children:x.error}):x?.state===`live`?(0,K.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-ink-3`,children:x.speaking?H(`talk.speaking`):x.listening?H(`talk.listening`):H(`talk.live`)}):h?.talk&&x?.state===`off`?(0,K.jsx)(`p`,{className:`mt-1.5 px-3 text-[0.75rem] text-ink-3`,children:H(`talk.hint`)}):null]})}function Q({placeholder:e=H(`chat.above`)}){return(0,K.jsx)(Ut,{children:(0,K.jsx)(qt,{disabled:!0,placeholder:e,onSend:()=>!1})})}function Jt(e){let t=qe[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?H(`chat.required`):null;let r=String(t).trim();if(e.kind===`email`&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))return H(`chat.badEmail`);if(e.kind===`url`)try{new URL(r)}catch{return H(`chat.badUrl`)}return e.kind===`number`&&Ue(r)===null?H(`chat.badNumber`):Array.isArray(t)&&e.multiple&&e.min&&t.length<e.min?H(`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:H(`chat.connected`)});if(e.kind===`list`)return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(xe,{className:`size-4`}),` `,H(`chat.checked`)]});if(e.kind===`toggle`)return(0,K.jsx)(K.Fragment,{children:H(t===!0?`run.yes`:`run.no`)});if(Yt(t))return(0,K.jsx)(`span`,{className:`italic opacity-80`,children:H(`chat.skipped`)});switch(e.kind){case`multiselect`:return(0,K.jsx)(K.Fragment,{children:t.map(Ze).join(`, `)});case`select`:return(0,K.jsx)(K.Fragment,{children:Ze(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(V,{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:ce(`/api/runs/${n}/assets/${t}`),alt:``,className:R(`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)(E,{className:`size-4`}),` `,H(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)(o,{className:`size-4`}),` `,H(`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:H(`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&&!Be(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`,H(`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=>!Be(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]),a=e.known??{},[o,s]=(0,G.useState)(()=>l(n,e)),[c,u]=(0,G.useState)(()=>n.fields.some(t=>e.values[t.id]!==void 0)?Je(an(n,e),e.known??{},l(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),_=Je(i,a,o),v=_.filter(e=>c.includes(e.id)),y=_.find(e=>!c.includes(e.id)),b=i.length===1?i[0]:void 0,x=v.at(-1),C=x?()=>u(e=>e.filter(e=>e!==x.id)):void 0;(0,G.useEffect)(()=>{let e=Object.keys(t.fieldErrors),n=Je(i,a,o),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 w=e=>{t.submitPage(n.id,e).then(g)},T=(0,G.useContext)(J),E=(0,G.useRef)(o);E.current=o;let D=T?.bindPage,O=(0,G.useRef)(w);O.current=w,(0,G.useEffect)(()=>{if(!D)return;let e=Je(i,a,o);return D({step:n,fields:e,values:o,setField:(t,n)=>{let r=e.find(e=>e.id===t);return r?Xt(r,n)||(s(e=>({...e,[t]:n})),u(e=>e.includes(t)?e:[...e,t]),f({}),null):`no such field on this page`},submit:()=>O.current(E.current)}),()=>D(null)},[D,n,i,a,o]);let k=e=>{if(!y)return!1;let t=Xt(y,e);if(t)return f({[y.id]:t}),!1;let n={...o,[y.id]:e},r=[...c,y.id];return s(n),u(r),f({}),Je(i,a,n).some(e=>!r.includes(e.id))||w(n),!0},A=[...r.map(e=>c.length?{...e,onEdit:void 0}:e),...tn(n,`now:${n.id}`,o,e.id,v,b).map((e,t,n)=>t===n.length-1&&e.who===`me`&&y?{...e,onEdit:C}:e)];y?(Jt(y)===`control`?A.push(q(`now:${n.id}:${y.id}:control`,(0,K.jsx)(S,{field:y,value:o[y.id],values:o,runId:e.id,view:e,closed:e.closed?.[y.id],onChange:e=>s(t=>({...t,[y.id]:e})),onBusy:m}),{wide:!0})):b||A.push(q(`now:${n.id}:${y.id}`,(0,K.jsx)(Qt,{field:y}))),d[y.id]&&A.push(q(`now:${n.id}:${y.id}:error`,d[y.id],{tone:`error`}))):t.busy||h?A.push(q(`sending`,(0,K.jsx)(Gt,{}))):t.error&&A.push(q(`send-error`,t.error,{tone:`error`}));let j=(0,K.jsx)(Q,{});if(h||!y&&c.length>0&&t.busy)j=(0,K.jsx)(Q,{placeholder:H(`run.working`)});else if(!y)A.push(X(`now:${n.id}:go`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Z,{primary:!0,busy:t.busy,onClick:()=>w(o),children:n.cta||H(`run.next`)}),C?(0,K.jsx)(Z,{onClick:C,disabled:t.busy,children:H(`run.back`)}):null]})));else{let r=Jt(y),i=!y.required&&y.kind!==`connection`&&y.kind!==`list`?(0,K.jsx)(Z,{onClick:()=>k(void 0),children:H(`chat.skip`)}):null;if(r===`typed`){i&&A.push(X(`now:${n.id}:${y.id}:replies`,i));let e=o[y.id];j=(0,K.jsx)(Ut,{children:(0,K.jsx)(qt,{initial:Yt(e)?``:String(e),multiline:y.kind===`textarea`,placeholder:y.placeholder||(b?y.label:H(`chat.placeholder`)),inputProps:sn(y),busy:t.busy,onSend:e=>k(Zt(y,e))},y.id)})}else if(r===`tapped`)A.push(q(`now:${n.id}:${y.id}:replies`,(0,K.jsx)(cn,{field:y,view:e,value:o[y.id],onAnswer:k}),{bare:!0}));else{let e=_.filter(e=>!c.includes(e.id)).length===1;A.push(X(`now:${n.id}:${y.id}:replies`,(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Z,{primary:!0,disabled:p,onClick:()=>k(o[y.id]),children:e&&n.cta?n.cta:H(`chat.send`)}),i]})))}}return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:e.wizard.avatar,costume:e.wizard.costume,lines:A}),j]})}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 C(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:H(`run.no`)}),(0,K.jsx)(Z,{on:n===!0,disabled:i.has(`true`),onClick:()=>r(!0),children:H(`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:Ze(e)},e)),(0,K.jsx)(Z,{primary:!0,disabled:e.required&&!a.length,onClick:()=>r(a),children:a.length||e.required?H(`chat.send`):H(`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:Ze(e)},e)),e.required?null:(0,K.jsx)(Z,{onClick:()=>r(void 0),children:H(`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:R(`flex max-w-full flex-col gap-1`,s?`w-full`:`w-96`),"data-say-text":t?.message??e.step?.title??H(`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??H(`run.working`)}),(0,K.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:H(`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)(w,{className:`size-3.5 shrink-0 animate-breathe text-ember`}),(0,K.jsx)(`span`,{className:`truncate`,children:Xe(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:ce(`/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)(M,{runId:e,driving:u,caption:Xe(t),hint:H(`browser.driving`),onBroken:()=>i(t.id),className:`mt-1.5`,action:(0,K.jsxs)(`button`,{type:`button`,disabled:s,onClick:()=>void d(),className:R(`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)(De,{className:`size-3.5`}):(0,K.jsx)($e,{className:`size-3.5`}),H(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:o}){let s=e.shown.filter(e=>e.output),[c,l]=(0,G.useState)(s.length===1?s[0].step.id:null),u=(0,G.useRef)(null),d=[...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}),...s.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)(a,{base:`/api/runs/${e.id}`,step:t,output:r,onSurfaceAction:n.regenerate?()=>{l(t.id),u.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)(h,{runId:e.id,list:t}):(0,K.jsx)(b,{runId:e.id,list:t,editable:!0})]}),{wide:!0}))];t.error&&d.push(q(`review-error`,t.error,{tone:`error`}));let f=n.regenerate&&s.length>0;return d.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)(xe,{className:`size-4`}),` `,H(n.approve?`run.approve`:`run.accept`)]}),n.approve?(0,K.jsx)(Z,{busy:t.busy,onClick:()=>void t.decline(n.id),children:H(`run.decline`)}):null,f&&s.length>1?s.map(({step:e})=>(0,K.jsx)(Z,{on:c===e.id,onClick:()=>l(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:d}),f?(0,K.jsx)(Ut,{children:(0,K.jsx)(qt,{multiline:!0,inputRef:u,busy:t.busy,placeholder:s.length>1&&!c?H(`run.feedbackPick`):H(`run.feedbackPlaceholder`),disabled:!c,onSend:e=>{let r=e.trim();return!r||!c?!1:(o(r),t.regenerate(n.id,c,r),!0)}})}):(0,K.jsx)(Q,{})]})}function gn({view:e,run:t,step:n,before:r,onRestart:i}){let o=e.shown.filter(e=>e.output),c=`/api/runs/${e.id}`,l=[...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}),...o.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)(p,{base:c,stepId:e.id,formats:n,title:r??e.title}),children:r??e.title}),(0,K.jsx)(a,{base:c,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:H(`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)(_,{runId:e.id,list:t}),children:t.label??t.def.title}),(0,K.jsx)(b,{runId:e.id,list:t,editable:!0})]}),{wide:!0}))];return l.push(X(`result:replies`,(0,K.jsxs)(K.Fragment,{children:[o.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)(x,{className:`size-4`}),` `,H(`run.again`)]}):null,e.canBack?(0,K.jsx)(Z,{onClick:()=>void t.back(),disabled:t.busy,children:H(`run.back`)}):null,e.keeps?(0,K.jsx)(`span`,{className:`ml-1`,children:(0,K.jsx)(s,{runId:e.id})}):null]}))),(0,K.jsx)(Y,{avatar:e.wizard.avatar,costume:e.wizard.costume,lines:l})}function _n({runId:e,onRestart:t,onNotFound:n,onView:r,header:i,footer:a,talk:o=!1,call:s=!1}){let c=Ee(e),{view:l}=c,[u,d]=(0,G.useState)(null),f=zt(e,l,c,u);(0,G.useEffect)(()=>{r?.(l)},[l,r]),(0,G.useEffect)(()=>{c.notFound&&n?.()},[c.notFound,n]);let[p,m]=Te(),h=(0,G.useMemo)(()=>({runId:e,lang:l?.lang??V,readAloud:p,setReadAloud:m,voice:l?.talk?f:null,talk:o,call:!!s,bindPage:d}),[e,l?.lang,l?.talk,p,m,f,o,s]);y(l?.status===`running`&&!l.ask),ge(l);let[g,_]=(0,G.useState)({}),[b,S]=(0,G.useState)(null);(0,G.useEffect)(()=>{l&&l.status!==`running`&&S(null)},[l]);let C;if(c.notFound)C=n?null:(0,K.jsx)(`div`,{className:`py-24 text-center text-ink-3`,children:H(`run.notFound`)});else if(!l)C=(0,K.jsx)(`div`,{className:`flex justify-center py-24 text-ink-4`,children:(0,K.jsx)(L,{})});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)C=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,q(`elsewhere:${l.answeredBy}`,H(l.answeredBy===`team`?`run.answeredByTeam`:`run.answeredByOther`))]}),(0,K.jsx)(Q,{})]});else if(l.connect?.length&&(l.status===`waiting_input`||l.status===`sleeping`))C=(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)(_e,{view:l}),{wide:!0})]}),(0,K.jsx)(Q,{})]});else if(l.status===`running`&&l.ask)C=(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)(de,{runId:l.id,ask:l.ask}),{wide:!0})]}),(0,K.jsx)(Q,{})]});else if(n&&l.question)C=(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)(v,{runId:l.id,question:l.question}),{wide:!0})]}),(0,K.jsx)(Q,{})]});else if(l.status===`running`)C=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,...b?[Bt(`note`,b)]:[],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:H(`run.working`)})]});else if(l.status===`sleeping`||l.status===`waiting_signal`)C=(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`?O(l.wakeAt,l.pause,l.signIn):k(l.waitsFor,l.wakeAt)),...l.signIn&&`connection`in l.signIn?[q(`sign-in`,(0,K.jsx)(D,{view:l}))]:[]]}),(0,K.jsx)(Q,{placeholder:H(`run.leavePage`)})]});else if(l.status===`failed`)C=(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:H(`run.failed`)}),l.error?(0,K.jsx)(`span`,{className:`mt-0.5 block`,children:(0,K.jsx)(ue,{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)(x,{className:`size-4`}),` `,H(`run.retry`)]}),l.canBack?(0,K.jsx)(Z,{onClick:()=>void c.back(),disabled:c.busy,children:H(`run.back`)}):null]}))]}),(0,K.jsx)(Q,{})]});else if(l.status===`cancelled`)C=(0,K.jsx)(Y,{avatar:l.wizard.avatar,costume:l.wizard.costume,lines:[...r,q(`cancelled`,H(`run.cancelled`)),...t?[X(`cancelled:replies`,(0,K.jsxs)(Z,{primary:!0,onClick:t,children:[(0,K.jsx)(x,{className:`size-4`}),` `,H(`run.again`)]}))]:[]]});else if(e?.type===`form`)C=(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(`|`);C=(0,K.jsx)(hn,{view:l,run:c,step:e,before:r,asked:g[e.id]??[],onNote:t=>{S(t),_(n=>({...n,[e.id]:[...n[e.id]??[],t]}))}},`${e.id}:${t}`)}else C=e?.type===`result`?(0,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:h,children:(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col lg:flex-row`,children:[(0,K.jsx)(Nt,{voice:f,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:C})})]})}):(0,K.jsx)(J.Provider,{value:h,children:(0,K.jsx)(Wt,{header:i,footer:a,children:C})})}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)(ze,{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)(ze,{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=U().regex(/^#[0-9a-fA-F]{6}$/,`a colour as #rrggbb`),Nn=Ve({accent:Mn.optional(),background:Mn.optional(),text:Mn.optional()}).extend({scheme:B([`light`,`dark`])}),Pn=Ve({radius:B([`sharp`,`soft`,`round`]).optional(),cards:B([`solid`,`outline`,`glass`]).optional(),headings:B([`normal`,`uppercase`]).optional()}),Fn=Ve({id:U().min(1).max(40)}).catchall(Ye([U().max(40),Ge(),We()])),In=U().min(1).max(60).regex(/^[A-Za-z0-9 -]+$/,`a font by its family name, or brand`);Ve({id:U().regex(He,`a theme id: lowercase letters, digits and dashes`),name:U().min(1).max(80),version:U().regex(/^\d+\.\d+\.\d+$/).default(`1.0.0`),base:B(kn).default(`brand`),colors:Ke(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:Ve({heading:In.optional(),text:In.optional()}).optional(),shape:Pn.optional(),effects:Ke(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(`/`)?ce(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){Pe(e?.pinned?e.dark?`dark`:`light`:null),Fe(e?.prefer??null);let t=Ie(),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};
|