@engenty/wizards-runtime 0.14.2 → 0.15.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/studio-assistant.js +50 -3
- package/apps/runtime/dist/app.js +9 -2
- package/apps/runtime/dist/broker/call.js +2 -0
- package/apps/runtime/dist/broker/host.js +1 -0
- package/apps/runtime/dist/broker/rwx.js +38 -4
- package/apps/runtime/dist/db/migrations/tenant/0040_rwx_elements.sql +21 -0
- package/apps/runtime/dist/db/migrations/tenant/0041_broker_log_client.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0040_snapshot.json +5153 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0041_snapshot.json +5160 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +14 -0
- package/apps/runtime/dist/db/schema.js +2 -0
- package/apps/runtime/dist/docs/dev/api.md +24 -2
- package/apps/runtime/dist/docs/dev/architecture.md +13 -2
- package/apps/runtime/dist/elements/caller.js +45 -0
- package/apps/runtime/dist/elements/catalogue.js +14 -0
- package/apps/runtime/dist/elements/connections.js +60 -0
- package/apps/runtime/dist/elements/gate.js +81 -0
- package/apps/runtime/dist/elements/knowledge.js +139 -0
- package/apps/runtime/dist/elements/outside.js +103 -0
- package/apps/runtime/dist/elements/specs.js +102 -0
- package/apps/runtime/dist/elements/wizards.js +59 -0
- package/apps/runtime/dist/env.js +5 -2
- package/apps/runtime/dist/mcp/elements.js +88 -0
- package/apps/runtime/dist/mcp/handler.js +2 -0
- package/apps/runtime/dist/mcp/scopes.js +5 -0
- package/apps/runtime/dist/prompts/authoring.md +2 -2
- package/apps/runtime/dist/prompts/tools.md +3 -0
- package/apps/runtime/dist/routes/api.js +2 -2
- package/apps/runtime/dist/routes/elements.js +76 -0
- package/apps/runtime/dist/services/work-ai.js +27 -19
- package/apps/runtime/dist/services/work-connections.js +2 -2
- package/apps/runtime/dist/tools/index.js +5 -4
- package/apps/runtime/dist/tools/skills.js +80 -54
- package/apps/runtime/dist/tools/space.js +8 -152
- package/apps/web/dist/assets/{AboutDialog-Cag3RJuT.js → AboutDialog-DaWEIHFN.js} +1 -1
- package/apps/web/dist/assets/{CapabilitiesPage-BQYiN0gT.js → CapabilitiesPage-Dt91U_sK.js} +2 -2
- package/apps/web/dist/assets/{ChangelogDialog-D_dQOMIq.js → ChangelogDialog-Do7pwmFv.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-nxoOt8ge.js → CodeEditor-Cdox-51M.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-C4_8LsQN.js → EditorPage-DS_a5K3s.js} +1 -1
- package/apps/web/dist/assets/{FlowPreview-aMfwcPul.js → FlowPreview-BPS86xzA.js} +1 -1
- package/apps/web/dist/assets/{LangSwitch-DpD0inR4.js → LangSwitch-BRHbi_Sd.js} +1 -1
- package/apps/web/dist/assets/{Marketplace-CpzD9pNQ.js → Marketplace-CS7JTgiv.js} +2 -2
- package/apps/web/dist/assets/{NewWizardChannels-CcE3UMVb.js → NewWizardChannels-D-OLsex6.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-BzN7zrQx.js → NewWizardPage-BM_pkk41.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-ztHT01ah.js → OnboardingPage-Cpn5pubC.js} +1 -1
- package/apps/web/dist/assets/{PreviewPane-BabMbBZI.js → PreviewPane-BOk1-yO4.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-D-JmtqCi.js → PublicRunner-CgzMZb0r.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-GAORKKqV.js → ReadOnly-8DEx-ly3.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-BKAiYmXl.js → SettingsPage-CcrknFcI.js} +2 -2
- package/apps/web/dist/assets/{SetupPage-C1EZZHIp.js → SetupPage-D5nzjgPU.js} +1 -1
- package/apps/web/dist/assets/{SharePage-N80EhoD7.js → SharePage-PKHX8a8a.js} +1 -1
- package/apps/web/dist/assets/{SkillEditor-CqQMg2MC.js → SkillEditor-BsXTqNli.js} +1 -1
- package/apps/web/dist/assets/{Skills-CnhpgoOA.js → Skills-C_X1ZsKg.js} +1 -1
- package/apps/web/dist/assets/{SpacePage-CRR8JvV1.js → SpacePage-wZGqUoSQ.js} +2 -2
- package/apps/web/dist/assets/{UpdateCheck-CfXZBQNv.js → UpdateCheck-D6x7MqEl.js} +2 -2
- package/apps/web/dist/assets/changelog-M-eOBqgu.js +1 -0
- package/apps/web/dist/assets/{circle-alert-C8Ma-bPY.js → circle-alert-DJbCyxcg.js} +1 -1
- package/apps/web/dist/assets/{circle-check-Bu9Z3mlJ.js → circle-check-jqtsKi_b.js} +1 -1
- package/apps/web/dist/assets/{code-editor-CfTGqOpp.js → code-editor-BpCEnf8H.js} +2 -2
- package/apps/web/dist/assets/{code-xml-B4kLFZSj.js → code-xml-q88cSTV8.js} +1 -1
- package/apps/web/dist/assets/{connection-sign-in-B2D0O8W-.js → connection-sign-in-UJ6xk-TD.js} +1 -1
- package/apps/web/dist/assets/{eye-BpoKpIdt.js → eye-CgkvVlba.js} +1 -1
- package/apps/web/dist/assets/{host-BlKXX7YK.js → host-Bd_bon_c.js} +7 -7
- package/apps/web/dist/assets/{i18n-BJ7Ld6O6.js → i18n-0fUKyVRE.js} +1 -1
- package/apps/web/dist/assets/{index-66tE1oti.js → index-DOgwxnto.js} +3 -3
- package/apps/web/dist/assets/{phone-Ctvf-Am-.js → phone-CjPvZ0nk.js} +1 -1
- package/apps/web/dist/assets/{read-aloud-Da_RSm2S.js → read-aloud-CLXo_asN.js} +1 -1
- package/apps/web/dist/assets/{runners-CyIvJIHr.js → runners-BoPaPsjN.js} +1 -1
- package/apps/web/dist/assets/{scroll-text-ChrjRu9Y.js → scroll-text-2BhJO_W7.js} +1 -1
- package/apps/web/dist/assets/{session-SXPtTWRK.js → session-CpYa5hwd.js} +1 -1
- package/apps/web/dist/assets/{theme-Br1S0j5h.js → theme-Bj3wNQR0.js} +1 -1
- package/apps/web/dist/assets/{ui-Uqnx1UpK.js → ui-CktezodE.js} +1 -1
- package/apps/web/dist/assets/{upload-BchUnQGV.js → upload-CHGCFVZK.js} +1 -1
- package/apps/web/dist/assets/{useMutation-DEkZhp5c.js → useMutation-7_FOHoEl.js} +1 -1
- package/apps/web/dist/assets/{volume-2-CU_oy81Z.js → volume-2-Bw5KASy8.js} +1 -1
- package/apps/web/dist/index.html +13 -13
- package/apps/web/dist/mcp/flow.html +1 -1
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +6 -0
- package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/rwx.js +3 -0
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/README.md +3 -0
- package/plugin/plugin.json +1 -1
- package/plugin/skills/work-in-space/SKILL.md +16 -0
- package/apps/web/dist/assets/changelog-6MqC8Vy8.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{cn as r}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{cn as r}from"./ui-CktezodE.js";import{a as i,c as a,i as o,n as s,r as c,s as l,t as u}from"./esm-Xwn4GtqG.js";var d=e(t(),1),f=e(n(),1),p=208,m=42,h=26,g=22,_=132;function v({data:e}){let t=e.icon;return(0,f.jsxs)(`div`,{style:{width:p,height:m},className:r(`flex cursor-default items-center gap-2.5 rounded-xl px-2.5`,e.optional?`border border-ink-4 border-dashed`:`bg-paper-2 ring-1 ring-border-soft`),children:[(0,f.jsx)(c,{type:`target`,position:a.Top}),(0,f.jsx)(c,{type:`target`,id:`in`,position:a.Right}),(0,f.jsx)(`span`,{className:r(`inline-flex size-6 shrink-0 items-center justify-center rounded-md`,e.tone),children:(0,f.jsx)(t,{className:`size-3.5`})}),(0,f.jsx)(`span`,{className:`truncate font-medium text-[0.8125rem] text-ink`,children:e.title}),(0,f.jsx)(c,{type:`source`,position:a.Bottom}),(0,f.jsx)(c,{type:`source`,id:`out`,position:a.Right})]})}function y({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,markerEnd:a}){let o=Math.max(e,n)+g,c=[`M ${e} ${t}`,`H ${o-8}`,`Q ${o} ${t} ${o} ${t+8}`,`V ${r-8}`,`Q ${o} ${r} ${o-8} ${r}`,`H ${n}`].join(` `);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u,{path:c,markerEnd:a,style:{strokeDasharray:`5 4`}}),(0,f.jsx)(s,{children:(0,f.jsx)(`div`,{style:{width:_,transform:`translate(${o+8}px, ${(t+r)/2}px) translateY(-50%)`},className:`absolute text-[0.6875rem] text-ink-2 leading-snug`,children:i})})]})}var b={step:v},x={branch:y};function S(e){let t={markerEnd:{type:l.ArrowClosed,width:14,height:14,color:`var(--ink-4)`}},n=e.map((e,t)=>({id:e.id,type:`step`,position:{x:0,y:t*68},data:{title:e.title,icon:e.icon,tone:e.tone,optional:e.optional},draggable:!1})),r=[],i=!1;return e.forEach((n,a)=>{let o=e[a+1];for(let[a,o]of(n.branches??[]).entries())e.some(e=>e.id===o.to)&&(i=!0,r.push({id:`b-${n.id}-${a}`,type:`branch`,source:n.id,sourceHandle:`out`,target:o.to,targetHandle:`in`,label:o.when,...t}));o&&r.push({id:`n-${n.id}`,type:`straight`,source:n.id,target:o.id,...t})}),{nodes:n,edges:r,width:p+(i?162:0),height:e.length*68-h}}function C({steps:e}){let{nodes:t,edges:n,width:r,height:a}=(0,d.useMemo)(()=>S(e),[e]);return e.length?(0,f.jsx)(`div`,{className:`max-w-full`,style:{width:r,height:a+4},children:(0,f.jsx)(o,{children:(0,f.jsx)(i,{nodes:t,edges:n,nodeTypes:b,edgeTypes:x,defaultViewport:{x:1,y:2,zoom:1},minZoom:1,maxZoom:1,nodesConnectable:!1,nodesDraggable:!1,nodesFocusable:!1,edgesFocusable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,proOptions:{hideAttribution:!0}})})}):null}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{cn as r,nn as i}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{cn as r,nn as i}from"./ui-CktezodE.js";import{g as a}from"./session-CpYa5hwd.js";import{D as o,O as s,Q as c,c as l,q as u,r as d,s as f}from"./i18n-0fUKyVRE.js";import{t as p}from"./media-Cej-H610.js";var m=e(t(),1),h=e(n(),1),g=`cubic-bezier(0.3, 0.7, 0.2, 1)`,_=`(max-width: 639px)`;function v({tone:e=`ground`,ink:t}){let n=l(),r=a(),i=d();return i?(0,h.jsx)(y,{langs:[`en`,i],value:n,onPick:e=>{u(e)&&r(e)},tone:e,ink:t}):null}function y({langs:e,value:t,onPick:n,tone:i=`ground`,ink:a,label:o}){let s=p(_),l=(0,m.useRef)({}),[u,d]=(0,m.useState)(null),v=e=>o?o(e):c(e),y=e.join(`|`);(0,m.useLayoutEffect)(()=>{let e=()=>{let e={};for(let[t,n]of Object.entries(l.current))e[t]=n?Math.ceil(n.getBoundingClientRect().width):0;d(e)};e(),document.fonts?.ready.then(e)},[y]);let b=e=>u?(u[e===t&&!s?`${e}-full`:`${e}-short`]??0)+24:void 0,x=u?e.slice(0,e.indexOf(t)).reduce((e,t)=>e+(b(t)??0),0):0,S=`300ms ${g}`,C=i===`ground`;return(0,h.jsxs)(`fieldset`,{className:r(`relative inline-flex items-center rounded-full border-0 p-0.5 ring-1`,C?`bg-white/10 ring-white/15`:`bg-paper-2 ring-border-soft`),children:[(0,h.jsx)(`legend`,{className:`sr-only`,children:f(`nav.language`)}),u?(0,h.jsx)(`span`,{"aria-hidden":`true`,className:r(`absolute top-0.5 bottom-0.5 left-0.5 rounded-full shadow-sm motion-reduce:transition-none`,C?`bg-white`:`bg-card`),style:{width:b(t),transform:`translateX(${x}px)`,transition:`transform ${S}, width ${S}`}}):null,e.map(e=>{let i=e===t;return(0,h.jsxs)(`button`,{"aria-pressed":i,className:r(`relative h-7 cursor-pointer overflow-hidden whitespace-nowrap rounded-full font-medium text-[0.75rem] motion-reduce:transition-none`,C?i?`text-[oklch(32%_0.15_262)]`:`text-white/70`:i?`text-ink`:`text-ink-3`),lang:e,onClick:()=>{i||n(e)},style:{width:b(e),transition:`width ${S}, color ${S}`,...C&&i&&a?{color:a}:{}},title:v(e),type:`button`,children:[[v(e),e.toUpperCase()].map((e,t)=>{let n=i&&!s?t===0:t===1;return(0,h.jsx)(`span`,{"aria-hidden":!n,className:`absolute inset-0 grid place-items-center motion-reduce:transition-none`,style:{opacity:+!!n,transition:`opacity 220ms ${g}`},children:e},`${t}:${e}`)}),(0,h.jsx)(`span`,{ref:t=>{l.current[`${e}-full`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:v(e)}),(0,h.jsx)(`span`,{ref:t=>{l.current[`${e}-short`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:e.toUpperCase()}),(0,h.jsx)(`span`,{className:`invisible px-3`,children:i?v(e):e.toUpperCase()})]},e)})]})}function b(){let e=l(),t=a();return(0,h.jsx)(i,{className:`w-44`,value:e,onChange:e=>{u(e)&&t(e)},options:o.map(e=>({value:e,label:s[e]}))})}export{y as n,v as r,b as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FlowPreview-
|
|
2
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{n,t as r}from"./jsx-runtime-BNakU3Ej.js";import{$n as i,An as a,Cr as o,Dn as s,G as c,Jt as l,Kt as u,Pr as d,Qn as f,Vn as p,Wr as m,Yn as h,Yt as g,_r as _,bn as ee,br as v,cn as y,dn as b,jn as x,ln as S,mn as te,nr as C,q as w,qt as ne,rn as T,sr as E,un as D,wr as O,xr as k,yr as A}from"./ui-Uqnx1UpK.js";import{t as j}from"./useMutation-DEkZhp5c.js";import{t as re}from"./preload-helper-DpV6A1kQ.js";import{i as ie,n as ae,r as oe,t as se}from"./volume-2-CU_oy81Z.js";import{t as ce}from"./eye-BpoKpIdt.js";import{A as le,S as ue,m as de,u as fe}from"./session-SXPtTWRK.js";import{c as pe,s as me}from"./engenty-CNjaZCVM.js";import{$ as M,B as he,V as N,Y as ge,ct as _e,n as P,nt as ve,s as F,tt as ye,y as be}from"./i18n-BJ7Ld6O6.js";var xe=class extends k{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:s,isRefetchError:c}=r,l=n.fetchMeta?.fetchMore?.direction,u=s&&l===`forward`,d=i&&l===`forward`,f=s&&l===`backward`,p=i&&l===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:o(t,n.data),hasPreviousPage:O(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:c&&!u&&!f,isRefetching:a&&!d&&!p}}};function Se(e,t){return v(e,xe,t)}var Ce={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};Ce.node;var I=E(Ce),we={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};we.node;var Te=E(we),Ee={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Ee.node;var De=E(Ee),Oe={name:`circle-euro`,size:24,node:[[`path`,{d:`M15 9.4a4 4 0 1 0 0 5.2`,key:`1makmb`}],[`path`,{d:`M7 12h5`,key:`gblrwe`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Oe.node;var ke=E(Oe),Ae={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]};Ae.node;var L=E(Ae),je={name:`cloud-off`,size:24,node:[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};je.node;var Me=E(je),Ne={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};Ne.node;var Pe=E(Ne),Fe={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Fe.node;var R=E(Fe),Ie={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Ie.node;var z=E(Ie),Le={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Le.node;var Re=E(Le),ze={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};ze.node;var Be=E(ze),Ve={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Ve.node;var B=E(Ve),He={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};He.node;var Ue=E(He),We={name:`scan-text`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}]]};We.node;var Ge=E(We),Ke={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Ke.node;var V=E(Ke),qe={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};qe.node;var Je=E(qe),Ye={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Ye.node;var Xe=E(Ye),Ze=[`text`,`web`,`browser`,`documents`,`image`,`video`,`speech`,`listening`,`code`,`connectors`,`motion-graphics`],Qe=new Set([`html`,`md`,`txt`,`csv`,`json`]),$e=new Set([`code`]),et=new Set([`web_search`,`browser`,`sandbox`,`image`]),tt=new Set([`web_fetch`,`http`]),nt=/\{\{\s*memory\b/;function rt(e){switch(e.type){case`agent`:return[e.instructions,e.call?JSON.stringify(e.call.input):``];case`generate`:return[e.prompt,e.options?.style??``];case`motion-graphics`:return[e.brief];case`widget`:case`surface`:return Object.values(e.data).map(e=>`{{${N(e)}}}`);default:return[]}}function it(e,t){return e.steps.slice(t+1).some(e=>e.type===`agent`&&!e.call||e.type===`generate`||e.type===`motion-graphics`)}function at(e,t){let n=[],r=(t,r)=>{let i=n.find(e=>e.need===t);i?i.hard||=r:n.push({stepId:e.id,need:t,hard:r})},i=t.steps.indexOf(e);for(let t of rt(e))nt.test(t)&&r(`memory`,!0),_e(t).some(e=>e.startsWith(`lists.`))&&r(`lists`,!0);switch(e.type){case`page`:for(let n of e.fields){switch(n.kind){case`audio`:r(`field:audio`,!!n.required);break;case`connection`:r(`field:connection`,!0);break;case`slot`:r(`field:slot`,!0);break;case`list`:r(`lists`,!0);break;case`location`:r(`field:location`,!1);break;case`image`:r(`field:image`,!1);break;case`file`:it(t,i)?r(`field:file-read`,!0):r(`field:file`,!1)}n.optionsFrom&&M(N(n.optionsFrom).split(`.`).slice(0,2).join(`.`))&&r(`lists`,!0)}break;case`agent`:{let t=e.call&&`tool`in e.call?[...e.tools,e.call.tool]:e.tools;for(let e of t){let t=ye(e);t?r(`plugin:${t.plugin}`,!0):tt.has(e)||$e.has(e)||(et.has(e)?r(`tool:${e}`,!0):r(`tool:${e}`,!1))}e.connections?.length&&r(`connections`,!0),e.each&&(M(N(e.each))?r(`lists`,!0):r(`each`,!1));break}case`generate`:e.asset!==`document`&&e.asset!==`dashboard`&&r(`asset:${e.asset}`,!0);break;case`motion-graphics`:r(`motion-graphics`,!0);break;case`widget`:r(e.video?`widget:video`:`widget`,!0);break;case`surface`:Object.values(e.data).some(e=>M(N(e)))&&r(`lists`,!0);break;case`review`:e.show.some(e=>M(e))&&r(`lists`,!0);break;case`result`:for(let n of e.deliverables){if(M(n.from)){r(`lists`,!0);continue}let e=t.steps.find(e=>e.id===n.from);if(e?.type!==`agent`&&(e?.type!==`generate`||e.asset!==`document`&&e.asset!==`dashboard`))continue;let i=n.formats.some(e=>Qe.has(e));for(let t of n.formats)Qe.has(t)||(t!==`pdf`||e?.type!==`agent`)&&r(`format:${t}`,t!==`pdf`&&!i)}}return n}function ot(e){let t=e.steps.flatMap(t=>at(t,e));e.lists?.length&&!t.some(e=>e.need===`lists`)&&t.push({stepId:e.steps[0]?.id??``,need:`lists`,hard:!0}),e.connections?.length&&!t.some(e=>e.need===`connections`)&&t.push({stepId:e.steps[0]?.id??``,need:`connections`,hard:!0});let n=lt(e);return{fit:t.some(e=>e.hard&&n.has(e.stepId))?`no`:t.length?`less`:`full`,notes:t}}function st(e){switch(e){case`tool:web_search`:case`tool:web_fetch`:return`web`;case`tool:browser`:return`browser`;case`tool:sandbox`:return`code`;case`tool:image`:case`asset:image`:return`image`;case`asset:video`:case`motion-graphics`:case`widget:video`:return`video`;case`asset:voice`:return`speech`;case`field:audio`:return`listening`;case`tool:http`:case`connections`:case`field:connection`:return`connectors`;case`field:image`:case`field:file`:case`field:file-read`:return`documents`;default:return null}}function ct(e){let t=ot(e),n=lt(e),r=new Set,i=new Set,a=new Set,o=new Set;for(let e of t.notes){if(e.need.startsWith(`plugin:`)){a.add(e.need.slice(7));continue}if(e.need.startsWith(`format:`)){o.add(e.need.slice(7));continue}let t=st(e.need);t&&(e.hard&&n.has(e.stepId)?r.add(t):i.add(t))}for(let e of r)i.delete(e);return{...t,missing:[...r],optional:[...i],needs:[...a].sort(),without:[...o]}}function lt(e){return e.steps.length?ut(e,e.steps[0].id,{}):new Set}function ut(e,t,n){let r=new Map(e.steps.map((e,t)=>[e.id,t])),i=r.get(t)??0,a=t=>{let i=[];for(let a of e.steps[t].next??[]){if(ge(a))continue;let t=a.goto===`end`?e.steps.length:r.get(a.goto)??-1;if(a.ask||!he(a.when).every(e=>e.field in n)){t>=0&&i.push(t);continue}if(ve(a,n))return t>=0?[...i,t]:i}return i.push(dt(e,t,r)),i},o=t=>{if(t===i)return!1;let n=new Set([i]),r=[i];for(;r.length;){let i=r.shift();if(i>=e.steps.length)return!0;for(let e of a(i))e!==t&&!n.has(e)&&(n.add(e),r.push(e))}return!1};return new Set(e.steps.filter((e,t)=>!o(t)).map(e=>e.id))}function dt(e,t,n){let r=e.steps[t].next?.find(ge)?.goto;return r===void 0?t+1:r===`end`?e.steps.length:n.get(r)??t+1}var ft=[`text`,`document`,`table`,`image`,`video`,`audio`,`dashboard`],pt=[`any`,`trades`,`gastronomy`,`hospitality`,`realEstate`,`retail`,`health`,`professional`,`agency`,`events`,`publicSector`],mt=[`marketing`,`sales`,`accounting`,`service`,`research`,`hr`,`operations`,`website`,`visuals`,`inquiries`,`advice`],ht=[`free`,`pro`],gt={"format.text":`Text`,"format.document":`Document (PDF, Word)`,"format.table":`Table`,"format.image":`Image`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Any industry`,"industry.trades":`Trades`,"industry.gastronomy":`Food service`,"industry.hospitality":`Hotels & tourism`,"industry.realEstate":`Real estate`,"industry.retail":`Retail`,"industry.health":`Health`,"industry.professional":`Professional services`,"industry.agency":`Agency & marketing`,"industry.events":`Events`,"industry.publicSector":`Associations & public sector`,"useCase.marketing":`Marketing & social media`,"useCase.sales":`Offers & sales`,"useCase.accounting":`Accounting & receipts`,"useCase.service":`Customer service`,"useCase.research":`Research & analysis`,"useCase.hr":`HR & applications`,"useCase.operations":`Planning & operations`,"useCase.website":`Website helpers`,"useCase.visuals":`Images & video`,"useCase.inquiries":`Inquiries & bookings`,"useCase.advice":`Advice & pricing`,"capability.text":`Writes text`,"capability.web":`Web search`,"capability.browser":`Drives a browser`,"capability.documents":`Reads documents & photos`,"capability.image":`Makes images`,"capability.video":`Makes video`,"capability.speech":`Speech output`,"capability.listening":`Understands voice notes`,"capability.code":`Runs code`,"capability.connectors":`Connected accounts & systems`,"capability.motion-graphics":`Motion graphics with Claude Code (on your subscription)`,"cost.low":`low cost`,"cost.medium":`medium cost`,"cost.high":`high cost`,"plan.free":`Free`,"plan.pro":`Pro`,"outline.otherwise":`otherwise`,"outline.and":`{first} and {second}`,"outline.with":`with {name}`,"outline.without":`without {name}`,"outline.contains":`{name} contains {value}`},_t={en:gt,de:{"format.text":`Text`,"format.document":`Dokument (PDF, Word)`,"format.table":`Tabelle`,"format.image":`Bild`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Jede Branche`,"industry.trades":`Handwerk`,"industry.gastronomy":`Gastronomie`,"industry.hospitality":`Hotel & Tourismus`,"industry.realEstate":`Immobilien`,"industry.retail":`Handel`,"industry.health":`Gesundheit`,"industry.professional":`Kanzlei & Beratung`,"industry.agency":`Agentur & Marketing`,"industry.events":`Veranstaltungen`,"industry.publicSector":`Vereine & Öffentliches`,"useCase.marketing":`Marketing & Social Media`,"useCase.sales":`Angebote & Verkauf`,"useCase.accounting":`Buchhaltung & Belege`,"useCase.service":`Kundenservice`,"useCase.research":`Recherche & Analyse`,"useCase.hr":`Personal & Bewerbungen`,"useCase.operations":`Planung & Abläufe`,"useCase.website":`Helfer für die Website`,"useCase.visuals":`Bilder & Video`,"useCase.inquiries":`Anfragen & Termine`,"useCase.advice":`Beratung & Preise`,"capability.text":`Text schreiben`,"capability.web":`Websuche`,"capability.browser":`Browser bedienen`,"capability.documents":`Dokumente & Fotos lesen`,"capability.image":`Bilder erzeugen`,"capability.video":`Videos erzeugen`,"capability.speech":`Sprachausgabe`,"capability.listening":`Sprachnotizen verstehen`,"capability.code":`Code ausführen`,"capability.connectors":`Verbundene Konten & Systeme`,"capability.motion-graphics":`Motion-Grafik mit Claude Code (auf deinem Abo)`,"cost.low":`günstig`,"cost.medium":`mittel`,"cost.high":`teuer`,"plan.free":`Kostenlos`,"plan.pro":`Pro`,"outline.otherwise":`sonst`,"outline.and":`{first} und {second}`,"outline.with":`mit {name}`,"outline.without":`ohne {name}`,"outline.contains":`{name} enthält {value}`}};function vt(e,t,n,r){let i=`${e}.${t}`;return i in gt?be(_t,i,n,r):t}var H=t(n(),1);function yt(e){switch(e.type){case`page`:return B;case`agent`:return ie;case`generate`:return e.asset===`image`?z:e.asset===`video`?b:e.asset===`dashboard`?Re:p;case`widget`:return I;case`surface`:return Be;case`motion-graphics`:return L;case`review`:return ce;case`result`:return R}return D}var bt={page:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,surface:`bg-ember-veil text-ember-strong`,"motion-graphics":`bg-amber-tint text-ink-2`,review:`bg-moss-tint text-moss`,result:`bg-paper-2 text-ink-2`};function xt(e){return F(`type.${e.type}`)}var St=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`,`code`];function Ct(e){return St.includes(e)?F(`tool.${e}`):e}function wt(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:return e.tools.map(Ct).join(` · `)||e.instructions.slice(0,90);case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`surface`:return e.candidates?e.candidates.map(e=>e.id).join(` · `):Object.keys(e.data).join(`, `);case`motion-graphics`:return[e.format,e.seconds?`${e.seconds}s`:null,e.skills.join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?F(`editor.reviewEditable`):null,e.regenerate?F(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var Tt=e({EntryDialog:()=>Q,MarketplaceBrowser:()=>Kt,MarketplaceCards:()=>Gt,MarketplaceFit:()=>Wt,MarketplaceHits:()=>Ht,ProChip:()=>q,useFit:()=>Ut,useSettled:()=>$}),U=t(r(),1),Et=(0,H.lazy)(()=>re(()=>import(`./FlowPreview-aMfwcPul.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),Dt={useCase:``,industry:``,format:``,capability:``,plan:``},W=(e,t)=>vt(e,t,P),Ot={en:De,de:ke};function kt(e){if(e<1)return 1;let t=10**Math.floor(Math.log10(e));return Math.round(e/t)*t}function At(e){return e.credits?F(`market.credits`,{n:kt(e.credits.credits)}):W(`cost`,e.costTier)}var jt={text:Xe,document:p,table:te,image:z,video:b,audio:C,dashboard:Te};function G({format:e,className:t}){let n=jt[e],r=W(`format`,e);return(0,U.jsx)(`span`,{title:r,className:`inline-flex`,children:(0,U.jsx)(n,{className:t,"aria-label":r,role:`img`})})}var Mt=[`low`,`medium`,`high`];function K({entry:e}){let t=Mt.indexOf(e.costTier)+1,n=Ot[P];return(0,U.jsxs)(`span`,{title:At(e),className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex shrink-0`,children:Mt.slice(0,t).map((e,t)=>(0,U.jsx)(`span`,{className:y(`rounded-full bg-(--coin-bg,var(--color-card))`,t>0&&`-ml-1.5`),children:(0,U.jsx)(n,{className:`size-4`})},e))}),W(`cost`,e.costTier)]})}function q(){return(0,U.jsx)(l,{tone:`ember`,title:F(`market.proHint`),children:F(`market.pro`)})}function Nt({plugin:e}){return(0,U.jsx)(l,{icon:(0,U.jsx)(Ue,{className:`size-3.5`}),title:F(`market.fromPlugin`,{name:e.name}),children:e.name})}function J({entry:e,onOpen:t,why:n}){return(0,U.jsxs)(ne,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:y(`relative flex min-h-[124px] cursor-pointer flex-col gap-5 p-4 text-left transition sm:min-h-[136px] sm:p-5 hover:shadow-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,(!e.usable||e.missing.length>0||!!e.needs?.length)&&`opacity-60`),children:[(0,U.jsx)(`span`,{className:`-top-4 pointer-events-none absolute right-4`,children:(0,U.jsx)(ue,{kind:e.avatar,costume:e.costume,size:68})}),(0,U.jsxs)(`div`,{className:`min-w-0 pr-20`,children:[(0,U.jsxs)(`div`,{className:`font-display font-semibold text-[0.9375rem]`,children:[e.title,e.plan===`pro`?(0,U.jsx)(`span`,{className:`ml-1.5 inline-flex align-middle`,children:(0,U.jsx)(q,{})}):null,e.starred?(0,U.jsx)(V,{className:`ml-1.5 inline size-3.5 fill-amber align-[-2px] text-amber`,"aria-label":F(`market.starred`)}):null]}),e.featured?(0,U.jsx)(`div`,{className:`mt-1`,children:(0,U.jsx)(l,{tone:`ember`,children:F(`market.recommended`)})}):null,(0,U.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:e.pitch})]}),(0,U.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-x-3 gap-y-1.5 text-[0.75rem] text-ink-3`,children:[n?(0,U.jsx)(l,{children:n}):null,e.plugin?(0,U.jsx)(Nt,{plugin:e.plugin}):null,e.needs?.length?(0,U.jsx)(l,{tone:`warn`,children:F(`market.needsPro`,{list:e.needs.join(`, `)})}):e.usable&&e.missing.length?(0,U.jsx)(l,{tone:`warn`,children:F(`market.missing`,{list:X(e.missing)})}):e.usable?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(h,{className:`size-3.5`}),` `,F(`market.minutes`,{n:e.effort.minutes})]}),(0,U.jsx)(K,{entry:e}),e.optional?.length?(0,U.jsx)(l,{title:F(`market.optionalHint`,{list:X(e.optional)}),children:F(`market.without`,{list:X(e.optional)})}):null,(0,U.jsx)(`span`,{className:`ml-auto inline-flex items-center gap-1.5`,children:e.formats.map(e=>(0,U.jsx)(G,{format:e,className:`size-4`},e))})]}):(0,U.jsx)(l,{tone:`warn`,children:F(`market.needsUpdate`)})]})]})}function Y({title:e,children:t}){return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:e}),t]})}var X=e=>e.map(e=>W(`capability`,e)).join(`, `),Pt={text:s,web:oe,browser:a,documents:Ge,image:z,video:b,speech:se,listening:x,code:Je,connectors:ae,"motion-graphics":L};function Ft(e){switch(e.type){case`page`:return B;case`agent`:return ie;case`generate`:return e.asset===`image`?z:e.asset===`video`?b:e.asset===`voice`?se:e.asset===`dashboard`?Te:p;case`widget`:return e.video?L:I;case`surface`:return I;case`motion-graphics`:return L;case`review`:return ce;case`result`:return R}return D}function It(e){let t=new Set;for(let[n,r]of e.entries())for(let i of r.branches??[]){let r=i.to===`end`?e.length:e.findIndex(e=>e.id===i.to);for(let i=n+1;i<r;i++)t.add(e[i].id)}return t}function Lt(e){let t=It(e);return e.map(e=>({id:e.id,title:e.title,icon:Ft(e),tone:bt[e.type]??`bg-paper-2 text-ink-2`,optional:t.has(e.id),branches:e.branches}))}function Z({title:e,children:t}){return(0,U.jsx)(`span`,{title:e,className:`inline-flex items-center gap-2 border-border border-l px-4 first:border-l-0 first:pl-0`,children:t})}function Rt({icon:e,children:t,more:n}){return(0,U.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,U.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-[0.875rem] text-ink leading-snug`,children:t}),n?(0,U.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 leading-snug`,children:n}):null]})]})}function zt({className:e,children:t}){let n=(0,H.useRef)(null),[r,i]=(0,H.useState)({above:!1,below:!1});(0,H.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let t=e.scrollTop>1,n=e.scrollTop+e.clientHeight<e.scrollHeight-1;i(e=>e.above===t&&e.below===n?e:{above:t,below:n})};t(),e.addEventListener(`scroll`,t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild),()=>{e.removeEventListener(`scroll`,t),r.disconnect()}},[]);let a=`linear-gradient(to bottom, ${r.above?`transparent`:`black`} 0, black 28px, black calc(100% - 44px), ${r.below?`transparent`:`black`} 100%)`;return(0,U.jsx)(`div`,{ref:n,className:e,style:{maskImage:a,WebkitMaskImage:a},children:(0,U.jsx)(`div`,{children:t})})}function Q({id:e,fallback:t,onClose:n,onUse:r,busy:i}){let a=m(),o=_(),s=A({queryKey:[`marketplace-entry`,e,P],queryFn:()=>w.get(`/api/studio/marketplace/${encodeURIComponent(e)}?lang=${P}`),enabled:!!e,retry:!1}),c=s.data??t,l=j({mutationFn:t=>{let n=`/api/studio/marketplace/${encodeURIComponent(e)}/star`;return t?w.put(n):w.del(n)},onSuccess:()=>Promise.all([a.invalidateQueries({queryKey:[`marketplace`]}),a.invalidateQueries({queryKey:[`marketplace-entry`,e]})])}),d=le()===`dark`,f=me[pe[c?.avatar||`round`]],p=d?`var(--card)`:`color-mix(in oklch, ${f??`var(--ink-4)`} 14%, var(--paper-2))`;return(0,U.jsx)(g,{open:!!e,onClose:n,wide:!0,bare:!0,children:c?(0,U.jsxs)(`div`,{className:`relative flex max-h-[calc(100dvh-48px)] flex-col rounded-2xl bg-card shadow-overlay max-sm:h-dvh max-sm:max-h-none max-sm:rounded-none`,children:[(0,U.jsx)(`button`,{type:`button`,"aria-label":F(`common.close`),onClick:n,className:`sm:-top-3.5 sm:-right-3.5 absolute top-3 right-3 z-20 flex size-9 items-center justify-center rounded-full bg-card text-ink-2 shadow-elevated ring-1 ring-border-soft transition hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,children:(0,U.jsx)(S,{className:`size-4`})}),(0,U.jsxs)(`header`,{className:`relative shrink-0 border-border-soft border-b px-5 pt-5 pb-4 text-ink sm:rounded-t-2xl sm:px-7`,style:{background:p,"--coin-bg":p},children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 overflow-hidden sm:rounded-t-2xl`,children:(0,U.jsx)(`span`,{className:y(`-top-28 -right-10 absolute size-80 rounded-full bg-white blur-3xl`,d?`opacity-[0.14]`:`opacity-80`)})}),(0,U.jsx)(`div`,{className:`-bottom-5 absolute right-9 z-10 max-sm:hidden`,children:(0,U.jsx)(ue,{kind:c.avatar,costume:c.costume,size:104})}),(0,U.jsxs)(`div`,{className:`relative sm:pr-36`,children:[(0,U.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight max-sm:pr-10`,children:c.title}),(0,U.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-snug`,children:s.data?.description||c.pitch})]}),c.usable?(0,U.jsxs)(`div`,{className:`-mx-5 sm:-mx-7 relative mt-3.5 flex flex-wrap items-center gap-y-2 border-border-soft border-t px-5 pt-3 font-medium text-[0.875rem] sm:px-7 sm:pr-40`,children:[(0,U.jsxs)(Z,{title:F(`market.duration`),children:[(0,U.jsx)(h,{className:`size-4 text-ink-3`}),F(`market.minutes`,{n:c.effort.minutes})]}),(0,U.jsx)(Z,{title:F(`market.cost`),children:(0,U.jsx)(K,{entry:c})}),(0,U.jsx)(Z,{title:F(`market.result`),children:c.formats.map(e=>(0,U.jsx)(G,{format:e,className:`size-4`},e))})]}):null]}),c.usable?(0,U.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-7 gap-y-6 px-5 pt-6 max-sm:overflow-y-auto max-sm:pb-4 sm:grid-cols-[230px_minmax(0,1fr)] sm:grid-rows-[minmax(0,1fr)] sm:px-7`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-5 sm:min-h-0 sm:overflow-y-auto`,children:[(0,U.jsx)(Y,{title:F(`market.duration`),children:(0,U.jsx)(Rt,{icon:(0,U.jsx)(h,{className:`size-4 text-moss`}),more:F(`market.durationHint`,{n:c.effort.fields}),children:F(`market.minutes`,{n:c.effort.minutes})})}),(0,U.jsx)(Y,{title:F(`market.cost`),children:(0,U.jsx)(Rt,{icon:(0,U.jsx)(Pe,{className:`size-4 text-amber`}),more:c.credits?F(`market.creditsHint`):void 0,children:(0,U.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,U.jsx)(K,{entry:c}),c.credits?(0,U.jsx)(`span`,{className:`text-ink-2`,children:F(`market.creditsRange`,{n:kt(c.credits.credits)})}):null]})})}),(0,U.jsx)(Y,{title:F(`market.result`),children:(0,U.jsx)(`div`,{className:`flex flex-col gap-2`,children:(s.data?.results??[]).map(e=>(0,U.jsx)(Rt,{icon:(0,U.jsx)(G,{format:e.kind,className:`size-4 text-ember-strong`}),more:e.formats.map(e=>e.toUpperCase()).join(` · `),children:e.title},e.title))})}),(0,U.jsx)(Y,{title:F(`market.needs`),children:(0,U.jsx)(`ul`,{className:`flex flex-col gap-2`,children:c.capabilities.map(e=>{let t=Pt[e],n=c.missing.includes(e),r=c.optional?.includes(e);return(0,U.jsxs)(`li`,{className:y(`flex items-center gap-2.5 text-[0.875rem]`,n?`text-ink-3`:`text-ink-2`),children:[(0,U.jsx)(t,{className:y(`size-4 shrink-0`,n?`text-rose`:r?`text-amber`:`text-cobalt`)}),W(`capability`,e),n?(0,U.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:F(`market.unavailable`)}):r?(0,U.jsx)(`span`,{className:`text-[0.75rem] text-amber`,children:F(`market.optional`)}):null]},e)})})})]}),(0,U.jsxs)(`div`,{className:`flex flex-col sm:min-h-0`,children:[(0,U.jsx)(`div`,{className:`mb-1.5 shrink-0 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:F(`market.steps`)}),(0,U.jsx)(zt,{className:`-mr-2 overscroll-contain pt-1 pr-2 pl-1 sm:min-h-0 sm:flex-1 sm:overflow-y-auto`,children:s.isLoading?(0,U.jsx)(T,{className:`size-5 text-ink-3`}):(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(T,{className:`size-5 text-ink-3`}),children:(0,U.jsx)(Et,{steps:Lt(s.data?.outline??[])})})})]})]}):(0,U.jsx)(`div`,{className:`flex-1 px-5 pt-6 sm:px-7`,children:(0,U.jsx)(`p`,{className:`rounded-lg bg-amber-tint p-3 text-[0.875rem] text-ink-2`,children:F(`market.needsUpdateHint`)})}),(0,U.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 px-5 pt-4 pb-5 max-sm:border-border-soft max-sm:border-t sm:px-7 sm:pb-6`,children:[c.plugin?(0,U.jsx)(`span`,{className:`mr-auto flex items-center`,children:(0,U.jsx)(Nt,{plugin:c.plugin})}):(0,U.jsxs)(u,{variant:`ghost`,className:`mr-auto`,title:F(`market.starHint`),"aria-pressed":c.starred,busy:l.isPending,onClick:()=>l.mutate(!c.starred),children:[(0,U.jsx)(V,{className:y(`size-4`,c.starred&&`fill-amber text-amber`)}),(0,U.jsx)(`span`,{className:`max-sm:sr-only`,children:F(c.starred?`market.starred`:`market.star`)})]}),(0,U.jsx)(u,{variant:`secondary`,onClick:n,children:F(`common.close`)}),c.usable&&c.missing.length?(0,U.jsx)(u,{variant:`secondary`,onClick:()=>o(`/settings/models`),children:F(`editor.models.settings`)}):null,r?(0,U.jsx)(u,{disabled:!c.usable||c.missing.length>0||!!c.needs?.length,title:c.needs?.length?F(`market.needsProHint`,{list:c.needs.join(`, `)}):c.missing.length?F(`market.missingHint`,{list:X(c.missing)}):c.optional?.length?F(`market.optionalHint`,{list:X(c.optional)}):void 0,busy:i,onClick:()=>r(c),children:F(`market.use`)}):null]})]}):(0,U.jsx)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-3 rounded-2xl bg-card p-8 text-[0.875rem] text-ink-2 shadow-overlay`,children:s.isLoading?(0,U.jsx)(T,{className:`size-6 text-ink-3`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{children:F(`market.notFound`)}),(0,U.jsx)(u,{variant:`secondary`,onClick:n,children:F(`common.close`)})]})})})}function Bt({name:e,value:t,options:n,onChange:r}){let[a,o]=(0,H.useState)(!1),s=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!a)return;let e=e=>{s.current?.contains(e.target)||o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);let c=n.find(e=>e.value===t);return(0,U.jsxs)(`div`,{ref:s,className:`relative`,children:[(0,U.jsxs)(`div`,{className:y(`flex h-8 items-center rounded-full text-[0.8125rem] transition`,c?`bg-ember-tint text-ink`:`text-ink-2 hover:bg-paper-2 hover:text-ink`,a&&!c&&`bg-paper-2 text-ink`),children:[(0,U.jsx)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":a,onClick:()=>o(!a),className:y(`flex h-full items-center gap-1.5 rounded-full pl-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,c?`pr-1`:`pr-2.5`),children:c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,U.jsx)(`span`,{className:`font-medium`,children:c.label})]}):(0,U.jsxs)(U.Fragment,{children:[e,(0,U.jsx)(f,{className:y(`size-3.5 transition`,a&&`rotate-180`)})]})}),c?(0,U.jsx)(`button`,{type:`button`,"aria-label":`${e}: ${F(`market.reset`)}`,onClick:()=>r(``),className:`mr-1 flex size-6 items-center justify-center rounded-full text-ink-3 hover:bg-card hover:text-ink`,children:(0,U.jsx)(S,{className:`size-3.5`})}):null]}),a?(0,U.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`absolute top-full left-0 z-30 mt-1.5 max-h-80 min-w-60 overflow-y-auto rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:n.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.value===t,disabled:!e.count||e.unavailable,onClick:()=>{r(e.value===t?``:e.value),o(!1)},className:y(`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[0.875rem] transition coarse:py-2.5`,e.count&&!e.unavailable?`text-ink-2 hover:bg-paper-2 hover:text-ink`:`text-ink-4`,e.value===t&&`font-medium text-ink`),children:[e.icon,(0,U.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:e.label}),e.value===t?(0,U.jsx)(i,{className:`size-4 text-ember`}):e.unavailable?(0,U.jsx)(`span`,{className:`whitespace-nowrap text-[0.75rem] text-ink-4`,children:F(`market.unavailable`)}):(0,U.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:e.count})]},e.value))}):null]})}function $(e,t){let[n,r]=(0,H.useState)(e);return(0,H.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var Vt=60;function Ht({query:e,onUse:t,busy:n,limit:r=6}){let[i,a]=(0,H.useState)(null),o=$(e.trim(),250),s=A({queryKey:[`marketplace`,P,o,`hits`,r],queryFn:()=>w.get(`/api/studio/marketplace?${new URLSearchParams({lang:P,limit:String(r),offset:`0`,q:o})}`),enabled:!!o,placeholderData:d}),c=o?s.data?.entries??[]:[];return c.length?(0,U.jsxs)(`section`,{className:`mt-10`,children:[(0,U.jsxs)(`h2`,{className:`mb-5 flex items-center gap-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:[F(`market.hits`),s.isFetching?(0,U.jsx)(T,{className:`size-3.5`}):null]}),(0,U.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:c.map(e=>(0,U.jsx)(J,{entry:e,onOpen:()=>a(e.id)},e.id))}),(0,U.jsx)(Q,{id:i,fallback:c.find(e=>e.id===i)??null,onClose:()=>a(null),onUse:t,busy:n})]}):null}function Ut(){let e=A({queryKey:[`marketplace`,P,`fit`],queryFn:()=>w.get(`/api/studio/marketplace?${new URLSearchParams({lang:P,limit:`12`,offset:`0`,fit:`1`})}`)});return e.data?.context&&e.data.entries.some(e=>e.fit)?e.data:null}function Wt({page:e,organization:t,onUse:n,busy:r,onAll:i}){let[a,o]=(0,H.useState)(null),s=e.context??{sector:null,sectorName:null},c=e.entries,l=e=>e.fit===`sector`||e.fit===`industry`?s.sectorName:e.fit===`wish`?F(`market.fitWish`):null;return(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h2`,{className:`mt-16 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:F(`market.fitTitle`,{organization:t})}),(0,U.jsx)(`p`,{className:`mt-2 mb-5 text-center text-[0.875rem] text-ink-3`,children:s.sectorName?F(`market.fitLine`,{sector:s.sectorName}):F(`market.fitLinePlain`)}),(0,U.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:c.map((e,t)=>(0,U.jsx)(`div`,{className:y(`contents`,t>=4&&`max-sm:hidden`,t>=8&&`sm:max-lg:hidden`),children:(0,U.jsx)(J,{entry:e,why:l(e),onOpen:()=>o(e.id)})},e.id))}),(0,U.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,U.jsx)(u,{variant:`secondary`,onClick:i,children:F(`market.fitAll`,{n:e.all||e.total})})}),(0,U.jsx)(Q,{id:a,fallback:c.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:n,busy:r})]})}function Gt({entries:e}){let t=m(),n=_(),{space:r}=fe(),i=de()&&!!r&&!r?.readOnly,[a,o]=(0,H.useState)(null),s=j({mutationFn:e=>w.post(`/api/studio/wizards`,{spaceId:r.id,starterId:e,lang:P}),onSuccess:async({id:e})=>{await t.invalidateQueries({queryKey:c.spaces()}),await t.invalidateQueries({queryKey:[`wizards`]}),o(null),n(`/edit/${e}`)}});return(0,U.jsxs)(`div`,{className:`@container mt-3`,children:[(0,U.jsx)(`div`,{className:`flex flex-col gap-4 @xl:grid @xl:grid-cols-2`,children:e.map(e=>(0,U.jsx)(J,{entry:e,onOpen:()=>o(e.id)},e.id))}),s.error?(0,U.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:s.error.message}):null,(0,U.jsx)(Q,{id:a,fallback:e.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:i?e=>!s.isPending&&s.mutate(e.id):void 0,busy:s.isPending})]})}function Kt({onUse:e,busy:t,open:n,search:r,onGuestOpen:i}){let[a,o]=(0,H.useState)(``);(0,H.useEffect)(()=>{r&&o(r.text)},[r]);let[s,c]=(0,H.useState)(Dt),[l,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(n??null),h=$(a.trim(),250),g=(0,H.useRef)(null);(0,H.useEffect)(()=>{let e=g.current;h&&e&&window.matchMedia(`(max-width: 639px)`).matches&&e.scrollIntoView({behavior:`smooth`,block:`start`})},[h]);let _=Se({queryKey:[`marketplace`,P,h,s,l],queryFn:({pageParam:e})=>{let t=new URLSearchParams({lang:P,limit:String(Vt),offset:String(e)});h&&t.set(`q`,h);for(let[e,n]of Object.entries(s))n&&t.set(e,n);return l&&t.set(`starred`,`1`),w.get(`/api/${i?`guest`:`studio`}/marketplace?${t}`)},initialPageParam:0,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.entries.length,0);return n<e.total?n:void 0},placeholderData:d}),v=_.data?.pages[0],b=_.data?.pages.flatMap(e=>e.entries)??[],x=v?.all??0,te=a.trim()!==h||_.isFetching&&!_.isFetchingNextPage,C=(e,t,n,r)=>n.filter(t=>v?.facets[e]?.[t]!==void 0).map(n=>({value:n,label:W(t,n),icon:r?.(n),count:(v?.facets[e])[n]??0,unavailable:e===`capability`&&ne.has(n)})),ne=new Set(v?.unavailable??[]),E=C(`useCase`,`useCase`,mt),D=[{key:`industry`,name:F(`market.industry`),options:C(`industry`,`industry`,pt)},{key:`format`,name:F(`market.format`),options:C(`format`,`format`,ft,e=>(0,U.jsx)(G,{format:e,className:`size-4 text-ink-3`}))},{key:`plan`,name:F(`market.plan`),options:C(`plan`,`plan`,ht)},{key:`capability`,name:F(`market.capability`),options:C(`capability`,`capability`,Ze,e=>{let t=Pt[e];return(0,U.jsx)(t,{className:`size-4 text-ink-3`})})}],O=!!a.trim()||l||Object.values(s).some(Boolean),k=()=>{c(Dt),o(``),f(!1)};if(_.isLoading)return(0,U.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,U.jsx)(T,{className:`size-6 text-ink-3`})});let A=v?.offline?(0,U.jsxs)(`p`,{className:`mt-4 flex items-center justify-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,U.jsx)(Me,{className:`size-4 shrink-0`}),F(`market.offline`)]}):null;if(!x&&!O)return A;let j=a?(0,U.jsx)(`button`,{type:`button`,"aria-label":F(`market.reset`),onClick:()=>o(``),className:`-mr-1.5 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-3 hover:bg-paper-2 hover:text-ink`,children:(0,U.jsx)(S,{className:`size-4`})}):null,re=e=>y(`inline-flex h-7 shrink-0 items-center gap-1 whitespace-nowrap rounded-full px-2.5 text-[0.78125rem] transition`,e?`bg-card font-medium text-ink shadow-soft ring-1 ring-border-soft`:`text-ink-3 hover:bg-card/60 hover:text-ink`);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{ref:g,className:`relative mx-auto flex h-10 max-w-md scroll-mt-4 items-center gap-2.5 rounded-full bg-card px-4 shadow-soft ring-1 ring-border-soft transition focus-within:ring-2 focus-within:ring-focus sm:h-11`,children:[te?(0,U.jsx)(T,{className:`size-4 shrink-0 text-ink-3`}):(0,U.jsx)(ee,{className:`size-4 shrink-0 text-ink-3`}),(0,U.jsx)(`input`,{type:`search`,value:a,onChange:e=>o(e.target.value),placeholder:F(`market.search`),"aria-label":F(`market.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),j]}),A,(0,U.jsxs)(`div`,{className:`max-sm:-mx-3 mt-4 flex gap-1 max-sm:overflow-x-auto max-sm:px-3 max-sm:[scrollbar-width:none] sm:flex-wrap sm:justify-center max-sm:[&::-webkit-scrollbar]:hidden`,children:[[{value:``,label:F(`market.all`)},...E].map(e=>(0,U.jsx)(`button`,{type:`button`,"aria-pressed":!l&&s.useCase===e.value,onClick:()=>{f(!1),c({...s,useCase:e.value})},className:re(!l&&s.useCase===e.value),children:e.label},e.value)),i?null:(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":l,onClick:()=>f(!l),className:re(l),children:[(0,U.jsx)(V,{className:y(`size-3.5`,l&&`fill-amber text-amber`)}),F(`market.starred`)]})]}),(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-1 gap-y-2 sm:mt-6`,children:[l?null:D.map(e=>(0,U.jsx)(Bt,{name:e.name,value:s[e.key],options:e.options,onChange:t=>c({...s,[e.key]:t})},e.key)),(0,U.jsxs)(`span`,{className:`ml-auto flex items-center gap-3 whitespace-nowrap pl-2 text-[0.8125rem] text-ink-3`,children:[O?(0,U.jsxs)(`button`,{type:`button`,onClick:k,className:`inline-flex items-center gap-1 text-ember-strong underline-offset-2 hover:underline`,children:[(0,U.jsx)(S,{className:`size-3.5 max-sm:size-4`}),(0,U.jsx)(`span`,{className:`max-sm:sr-only`,children:F(`market.resetShort`)})]}):null,O?(0,U.jsx)(`span`,{className:`tabular-nums sm:hidden`,children:F(`market.countOfShort`,{n:v?.total??0,all:x})}):null,(0,U.jsx)(`span`,{className:y(`tabular-nums`,O&&`max-sm:hidden`),children:O?F(`market.countOf`,{n:v?.total??0,all:x}):F(`market.count`,{n:x})})]})]}),b.length?(0,U.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:b.map(e=>(0,U.jsx)(J,{entry:e,onOpen:()=>i?i(e):m(e.id)},e.id))}):(0,U.jsxs)(`div`,{className:`py-10 text-center text-[0.875rem] text-ink-3`,children:[(0,U.jsx)(`p`,{children:F(l?`market.noneStarred`:`market.none`)}),(0,U.jsx)(u,{variant:`ghost`,className:`mt-2`,onClick:k,children:F(`market.reset`)})]}),_.hasNextPage?(0,U.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,U.jsx)(u,{variant:`secondary`,busy:_.isFetchingNextPage,onClick:()=>void _.fetchNextPage(),children:F(`market.more`)})}):null,(0,U.jsx)(Q,{id:p,fallback:b.find(e=>e.id===p)??null,onClose:()=>m(null),onUse:e,busy:t})]})}export{Se as A,z as C,L as D,Me as E,Te as O,Re as S,Pe as T,Xe as _,Tt as a,B as b,$ as c,wt as d,Ct as f,ct as g,st as h,Ht as i,I as k,bt as l,vt as m,Kt as n,q as o,xt as p,Wt as r,Ut as s,Q as t,yt as u,V as v,R as w,Be as x,Ue as y};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FlowPreview-BPS86xzA.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/ui-CktezodE.js","assets/preload-helper-DpV6A1kQ.js","assets/i18n-0fUKyVRE.js","assets/esm-Xwn4GtqG.js","assets/react-dom-hf6EcyAr.js","assets/with-selector-CoMyWBAX.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{n,t as r}from"./jsx-runtime-BNakU3Ej.js";import{$n as i,An as a,Cr as o,Dn as s,G as c,Jt as l,Kt as u,Pr as d,Qn as f,Vn as p,Wr as m,Yn as h,Yt as g,_r as _,bn as ee,br as v,cn as y,dn as b,jn as x,ln as S,mn as te,nr as C,q as w,qt as ne,rn as T,sr as E,un as D,wr as O,xr as k,yr as A}from"./ui-CktezodE.js";import{t as j}from"./useMutation-7_FOHoEl.js";import{t as re}from"./preload-helper-DpV6A1kQ.js";import{i as ie,n as ae,r as oe,t as se}from"./volume-2-Bw5KASy8.js";import{t as ce}from"./eye-CgkvVlba.js";import{A as le,S as ue,m as de,u as fe}from"./session-CpYa5hwd.js";import{c as pe,s as me}from"./engenty-CNjaZCVM.js";import{$ as M,B as he,V as N,Y as ge,ct as _e,n as P,nt as ve,s as F,tt as ye,y as be}from"./i18n-0fUKyVRE.js";var xe=class extends k{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:s,isRefetchError:c}=r,l=n.fetchMeta?.fetchMore?.direction,u=s&&l===`forward`,d=i&&l===`forward`,f=s&&l===`backward`,p=i&&l===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:o(t,n.data),hasPreviousPage:O(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:p,isRefetchError:c&&!u&&!f,isRefetching:a&&!d&&!p}}};function Se(e,t){return v(e,xe,t)}var Ce={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};Ce.node;var I=E(Ce),we={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};we.node;var Te=E(we),Ee={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Ee.node;var De=E(Ee),Oe={name:`circle-euro`,size:24,node:[[`path`,{d:`M15 9.4a4 4 0 1 0 0 5.2`,key:`1makmb`}],[`path`,{d:`M7 12h5`,key:`gblrwe`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Oe.node;var ke=E(Oe),Ae={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]};Ae.node;var L=E(Ae),je={name:`cloud-off`,size:24,node:[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};je.node;var Me=E(je),Ne={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};Ne.node;var Pe=E(Ne),Fe={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Fe.node;var R=E(Fe),Ie={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Ie.node;var z=E(Ie),Le={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Le.node;var Re=E(Le),ze={name:`layout-template`,size:24,node:[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]};ze.node;var Be=E(ze),Ve={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Ve.node;var B=E(Ve),He={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};He.node;var Ue=E(He),We={name:`scan-text`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}]]};We.node;var Ge=E(We),Ke={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Ke.node;var V=E(Ke),qe={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};qe.node;var Je=E(qe),Ye={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Ye.node;var Xe=E(Ye),Ze=[`text`,`web`,`browser`,`documents`,`image`,`video`,`speech`,`listening`,`code`,`connectors`,`motion-graphics`],Qe=new Set([`html`,`md`,`txt`,`csv`,`json`]),$e=new Set([`code`]),et=new Set([`web_search`,`browser`,`sandbox`,`image`]),tt=new Set([`web_fetch`,`http`]),nt=/\{\{\s*memory\b/;function rt(e){switch(e.type){case`agent`:return[e.instructions,e.call?JSON.stringify(e.call.input):``];case`generate`:return[e.prompt,e.options?.style??``];case`motion-graphics`:return[e.brief];case`widget`:case`surface`:return Object.values(e.data).map(e=>`{{${N(e)}}}`);default:return[]}}function it(e,t){return e.steps.slice(t+1).some(e=>e.type===`agent`&&!e.call||e.type===`generate`||e.type===`motion-graphics`)}function at(e,t){let n=[],r=(t,r)=>{let i=n.find(e=>e.need===t);i?i.hard||=r:n.push({stepId:e.id,need:t,hard:r})},i=t.steps.indexOf(e);for(let t of rt(e))nt.test(t)&&r(`memory`,!0),_e(t).some(e=>e.startsWith(`lists.`))&&r(`lists`,!0);switch(e.type){case`page`:for(let n of e.fields){switch(n.kind){case`audio`:r(`field:audio`,!!n.required);break;case`connection`:r(`field:connection`,!0);break;case`slot`:r(`field:slot`,!0);break;case`list`:r(`lists`,!0);break;case`location`:r(`field:location`,!1);break;case`image`:r(`field:image`,!1);break;case`file`:it(t,i)?r(`field:file-read`,!0):r(`field:file`,!1)}n.optionsFrom&&M(N(n.optionsFrom).split(`.`).slice(0,2).join(`.`))&&r(`lists`,!0)}break;case`agent`:{let t=e.call&&`tool`in e.call?[...e.tools,e.call.tool]:e.tools;for(let e of t){let t=ye(e);t?r(`plugin:${t.plugin}`,!0):tt.has(e)||$e.has(e)||(et.has(e)?r(`tool:${e}`,!0):r(`tool:${e}`,!1))}e.connections?.length&&r(`connections`,!0),e.each&&(M(N(e.each))?r(`lists`,!0):r(`each`,!1));break}case`generate`:e.asset!==`document`&&e.asset!==`dashboard`&&r(`asset:${e.asset}`,!0);break;case`motion-graphics`:r(`motion-graphics`,!0);break;case`widget`:r(e.video?`widget:video`:`widget`,!0);break;case`surface`:Object.values(e.data).some(e=>M(N(e)))&&r(`lists`,!0);break;case`review`:e.show.some(e=>M(e))&&r(`lists`,!0);break;case`result`:for(let n of e.deliverables){if(M(n.from)){r(`lists`,!0);continue}let e=t.steps.find(e=>e.id===n.from);if(e?.type!==`agent`&&(e?.type!==`generate`||e.asset!==`document`&&e.asset!==`dashboard`))continue;let i=n.formats.some(e=>Qe.has(e));for(let t of n.formats)Qe.has(t)||(t!==`pdf`||e?.type!==`agent`)&&r(`format:${t}`,t!==`pdf`&&!i)}}return n}function ot(e){let t=e.steps.flatMap(t=>at(t,e));e.lists?.length&&!t.some(e=>e.need===`lists`)&&t.push({stepId:e.steps[0]?.id??``,need:`lists`,hard:!0}),e.connections?.length&&!t.some(e=>e.need===`connections`)&&t.push({stepId:e.steps[0]?.id??``,need:`connections`,hard:!0});let n=lt(e);return{fit:t.some(e=>e.hard&&n.has(e.stepId))?`no`:t.length?`less`:`full`,notes:t}}function st(e){switch(e){case`tool:web_search`:case`tool:web_fetch`:return`web`;case`tool:browser`:return`browser`;case`tool:sandbox`:return`code`;case`tool:image`:case`asset:image`:return`image`;case`asset:video`:case`motion-graphics`:case`widget:video`:return`video`;case`asset:voice`:return`speech`;case`field:audio`:return`listening`;case`tool:http`:case`connections`:case`field:connection`:return`connectors`;case`field:image`:case`field:file`:case`field:file-read`:return`documents`;default:return null}}function ct(e){let t=ot(e),n=lt(e),r=new Set,i=new Set,a=new Set,o=new Set;for(let e of t.notes){if(e.need.startsWith(`plugin:`)){a.add(e.need.slice(7));continue}if(e.need.startsWith(`format:`)){o.add(e.need.slice(7));continue}let t=st(e.need);t&&(e.hard&&n.has(e.stepId)?r.add(t):i.add(t))}for(let e of r)i.delete(e);return{...t,missing:[...r],optional:[...i],needs:[...a].sort(),without:[...o]}}function lt(e){return e.steps.length?ut(e,e.steps[0].id,{}):new Set}function ut(e,t,n){let r=new Map(e.steps.map((e,t)=>[e.id,t])),i=r.get(t)??0,a=t=>{let i=[];for(let a of e.steps[t].next??[]){if(ge(a))continue;let t=a.goto===`end`?e.steps.length:r.get(a.goto)??-1;if(a.ask||!he(a.when).every(e=>e.field in n)){t>=0&&i.push(t);continue}if(ve(a,n))return t>=0?[...i,t]:i}return i.push(dt(e,t,r)),i},o=t=>{if(t===i)return!1;let n=new Set([i]),r=[i];for(;r.length;){let i=r.shift();if(i>=e.steps.length)return!0;for(let e of a(i))e!==t&&!n.has(e)&&(n.add(e),r.push(e))}return!1};return new Set(e.steps.filter((e,t)=>!o(t)).map(e=>e.id))}function dt(e,t,n){let r=e.steps[t].next?.find(ge)?.goto;return r===void 0?t+1:r===`end`?e.steps.length:n.get(r)??t+1}var ft=[`text`,`document`,`table`,`image`,`video`,`audio`,`dashboard`],pt=[`any`,`trades`,`gastronomy`,`hospitality`,`realEstate`,`retail`,`health`,`professional`,`agency`,`events`,`publicSector`],mt=[`marketing`,`sales`,`accounting`,`service`,`research`,`hr`,`operations`,`website`,`visuals`,`inquiries`,`advice`],ht=[`free`,`pro`],gt={"format.text":`Text`,"format.document":`Document (PDF, Word)`,"format.table":`Table`,"format.image":`Image`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Any industry`,"industry.trades":`Trades`,"industry.gastronomy":`Food service`,"industry.hospitality":`Hotels & tourism`,"industry.realEstate":`Real estate`,"industry.retail":`Retail`,"industry.health":`Health`,"industry.professional":`Professional services`,"industry.agency":`Agency & marketing`,"industry.events":`Events`,"industry.publicSector":`Associations & public sector`,"useCase.marketing":`Marketing & social media`,"useCase.sales":`Offers & sales`,"useCase.accounting":`Accounting & receipts`,"useCase.service":`Customer service`,"useCase.research":`Research & analysis`,"useCase.hr":`HR & applications`,"useCase.operations":`Planning & operations`,"useCase.website":`Website helpers`,"useCase.visuals":`Images & video`,"useCase.inquiries":`Inquiries & bookings`,"useCase.advice":`Advice & pricing`,"capability.text":`Writes text`,"capability.web":`Web search`,"capability.browser":`Drives a browser`,"capability.documents":`Reads documents & photos`,"capability.image":`Makes images`,"capability.video":`Makes video`,"capability.speech":`Speech output`,"capability.listening":`Understands voice notes`,"capability.code":`Runs code`,"capability.connectors":`Connected accounts & systems`,"capability.motion-graphics":`Motion graphics with Claude Code (on your subscription)`,"cost.low":`low cost`,"cost.medium":`medium cost`,"cost.high":`high cost`,"plan.free":`Free`,"plan.pro":`Pro`,"outline.otherwise":`otherwise`,"outline.and":`{first} and {second}`,"outline.with":`with {name}`,"outline.without":`without {name}`,"outline.contains":`{name} contains {value}`},_t={en:gt,de:{"format.text":`Text`,"format.document":`Dokument (PDF, Word)`,"format.table":`Tabelle`,"format.image":`Bild`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Jede Branche`,"industry.trades":`Handwerk`,"industry.gastronomy":`Gastronomie`,"industry.hospitality":`Hotel & Tourismus`,"industry.realEstate":`Immobilien`,"industry.retail":`Handel`,"industry.health":`Gesundheit`,"industry.professional":`Kanzlei & Beratung`,"industry.agency":`Agentur & Marketing`,"industry.events":`Veranstaltungen`,"industry.publicSector":`Vereine & Öffentliches`,"useCase.marketing":`Marketing & Social Media`,"useCase.sales":`Angebote & Verkauf`,"useCase.accounting":`Buchhaltung & Belege`,"useCase.service":`Kundenservice`,"useCase.research":`Recherche & Analyse`,"useCase.hr":`Personal & Bewerbungen`,"useCase.operations":`Planung & Abläufe`,"useCase.website":`Helfer für die Website`,"useCase.visuals":`Bilder & Video`,"useCase.inquiries":`Anfragen & Termine`,"useCase.advice":`Beratung & Preise`,"capability.text":`Text schreiben`,"capability.web":`Websuche`,"capability.browser":`Browser bedienen`,"capability.documents":`Dokumente & Fotos lesen`,"capability.image":`Bilder erzeugen`,"capability.video":`Videos erzeugen`,"capability.speech":`Sprachausgabe`,"capability.listening":`Sprachnotizen verstehen`,"capability.code":`Code ausführen`,"capability.connectors":`Verbundene Konten & Systeme`,"capability.motion-graphics":`Motion-Grafik mit Claude Code (auf deinem Abo)`,"cost.low":`günstig`,"cost.medium":`mittel`,"cost.high":`teuer`,"plan.free":`Kostenlos`,"plan.pro":`Pro`,"outline.otherwise":`sonst`,"outline.and":`{first} und {second}`,"outline.with":`mit {name}`,"outline.without":`ohne {name}`,"outline.contains":`{name} enthält {value}`}};function vt(e,t,n,r){let i=`${e}.${t}`;return i in gt?be(_t,i,n,r):t}var H=t(n(),1);function yt(e){switch(e.type){case`page`:return B;case`agent`:return ie;case`generate`:return e.asset===`image`?z:e.asset===`video`?b:e.asset===`dashboard`?Re:p;case`widget`:return I;case`surface`:return Be;case`motion-graphics`:return L;case`review`:return ce;case`result`:return R}return D}var bt={page:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,surface:`bg-ember-veil text-ember-strong`,"motion-graphics":`bg-amber-tint text-ink-2`,review:`bg-moss-tint text-moss`,result:`bg-paper-2 text-ink-2`};function xt(e){return F(`type.${e.type}`)}var St=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`,`code`];function Ct(e){return St.includes(e)?F(`tool.${e}`):e}function wt(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:return e.tools.map(Ct).join(` · `)||e.instructions.slice(0,90);case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`surface`:return e.candidates?e.candidates.map(e=>e.id).join(` · `):Object.keys(e.data).join(`, `);case`motion-graphics`:return[e.format,e.seconds?`${e.seconds}s`:null,e.skills.join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?F(`editor.reviewEditable`):null,e.regenerate?F(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var Tt=e({EntryDialog:()=>Q,MarketplaceBrowser:()=>Kt,MarketplaceCards:()=>Gt,MarketplaceFit:()=>Wt,MarketplaceHits:()=>Ht,ProChip:()=>q,useFit:()=>Ut,useSettled:()=>$}),U=t(r(),1),Et=(0,H.lazy)(()=>re(()=>import(`./FlowPreview-BPS86xzA.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),Dt={useCase:``,industry:``,format:``,capability:``,plan:``},W=(e,t)=>vt(e,t,P),Ot={en:De,de:ke};function kt(e){if(e<1)return 1;let t=10**Math.floor(Math.log10(e));return Math.round(e/t)*t}function At(e){return e.credits?F(`market.credits`,{n:kt(e.credits.credits)}):W(`cost`,e.costTier)}var jt={text:Xe,document:p,table:te,image:z,video:b,audio:C,dashboard:Te};function G({format:e,className:t}){let n=jt[e],r=W(`format`,e);return(0,U.jsx)(`span`,{title:r,className:`inline-flex`,children:(0,U.jsx)(n,{className:t,"aria-label":r,role:`img`})})}var Mt=[`low`,`medium`,`high`];function K({entry:e}){let t=Mt.indexOf(e.costTier)+1,n=Ot[P];return(0,U.jsxs)(`span`,{title:At(e),className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex shrink-0`,children:Mt.slice(0,t).map((e,t)=>(0,U.jsx)(`span`,{className:y(`rounded-full bg-(--coin-bg,var(--color-card))`,t>0&&`-ml-1.5`),children:(0,U.jsx)(n,{className:`size-4`})},e))}),W(`cost`,e.costTier)]})}function q(){return(0,U.jsx)(l,{tone:`ember`,title:F(`market.proHint`),children:F(`market.pro`)})}function Nt({plugin:e}){return(0,U.jsx)(l,{icon:(0,U.jsx)(Ue,{className:`size-3.5`}),title:F(`market.fromPlugin`,{name:e.name}),children:e.name})}function J({entry:e,onOpen:t,why:n}){return(0,U.jsxs)(ne,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:y(`relative flex min-h-[124px] cursor-pointer flex-col gap-5 p-4 text-left transition sm:min-h-[136px] sm:p-5 hover:shadow-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,(!e.usable||e.missing.length>0||!!e.needs?.length)&&`opacity-60`),children:[(0,U.jsx)(`span`,{className:`-top-4 pointer-events-none absolute right-4`,children:(0,U.jsx)(ue,{kind:e.avatar,costume:e.costume,size:68})}),(0,U.jsxs)(`div`,{className:`min-w-0 pr-20`,children:[(0,U.jsxs)(`div`,{className:`font-display font-semibold text-[0.9375rem]`,children:[e.title,e.plan===`pro`?(0,U.jsx)(`span`,{className:`ml-1.5 inline-flex align-middle`,children:(0,U.jsx)(q,{})}):null,e.starred?(0,U.jsx)(V,{className:`ml-1.5 inline size-3.5 fill-amber align-[-2px] text-amber`,"aria-label":F(`market.starred`)}):null]}),e.featured?(0,U.jsx)(`div`,{className:`mt-1`,children:(0,U.jsx)(l,{tone:`ember`,children:F(`market.recommended`)})}):null,(0,U.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:e.pitch})]}),(0,U.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-x-3 gap-y-1.5 text-[0.75rem] text-ink-3`,children:[n?(0,U.jsx)(l,{children:n}):null,e.plugin?(0,U.jsx)(Nt,{plugin:e.plugin}):null,e.needs?.length?(0,U.jsx)(l,{tone:`warn`,children:F(`market.needsPro`,{list:e.needs.join(`, `)})}):e.usable&&e.missing.length?(0,U.jsx)(l,{tone:`warn`,children:F(`market.missing`,{list:X(e.missing)})}):e.usable?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(h,{className:`size-3.5`}),` `,F(`market.minutes`,{n:e.effort.minutes})]}),(0,U.jsx)(K,{entry:e}),e.optional?.length?(0,U.jsx)(l,{title:F(`market.optionalHint`,{list:X(e.optional)}),children:F(`market.without`,{list:X(e.optional)})}):null,(0,U.jsx)(`span`,{className:`ml-auto inline-flex items-center gap-1.5`,children:e.formats.map(e=>(0,U.jsx)(G,{format:e,className:`size-4`},e))})]}):(0,U.jsx)(l,{tone:`warn`,children:F(`market.needsUpdate`)})]})]})}function Y({title:e,children:t}){return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:e}),t]})}var X=e=>e.map(e=>W(`capability`,e)).join(`, `),Pt={text:s,web:oe,browser:a,documents:Ge,image:z,video:b,speech:se,listening:x,code:Je,connectors:ae,"motion-graphics":L};function Ft(e){switch(e.type){case`page`:return B;case`agent`:return ie;case`generate`:return e.asset===`image`?z:e.asset===`video`?b:e.asset===`voice`?se:e.asset===`dashboard`?Te:p;case`widget`:return e.video?L:I;case`surface`:return I;case`motion-graphics`:return L;case`review`:return ce;case`result`:return R}return D}function It(e){let t=new Set;for(let[n,r]of e.entries())for(let i of r.branches??[]){let r=i.to===`end`?e.length:e.findIndex(e=>e.id===i.to);for(let i=n+1;i<r;i++)t.add(e[i].id)}return t}function Lt(e){let t=It(e);return e.map(e=>({id:e.id,title:e.title,icon:Ft(e),tone:bt[e.type]??`bg-paper-2 text-ink-2`,optional:t.has(e.id),branches:e.branches}))}function Z({title:e,children:t}){return(0,U.jsx)(`span`,{title:e,className:`inline-flex items-center gap-2 border-border border-l px-4 first:border-l-0 first:pl-0`,children:t})}function Rt({icon:e,children:t,more:n}){return(0,U.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,U.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-[0.875rem] text-ink leading-snug`,children:t}),n?(0,U.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 leading-snug`,children:n}):null]})]})}function zt({className:e,children:t}){let n=(0,H.useRef)(null),[r,i]=(0,H.useState)({above:!1,below:!1});(0,H.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let t=e.scrollTop>1,n=e.scrollTop+e.clientHeight<e.scrollHeight-1;i(e=>e.above===t&&e.below===n?e:{above:t,below:n})};t(),e.addEventListener(`scroll`,t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild),()=>{e.removeEventListener(`scroll`,t),r.disconnect()}},[]);let a=`linear-gradient(to bottom, ${r.above?`transparent`:`black`} 0, black 28px, black calc(100% - 44px), ${r.below?`transparent`:`black`} 100%)`;return(0,U.jsx)(`div`,{ref:n,className:e,style:{maskImage:a,WebkitMaskImage:a},children:(0,U.jsx)(`div`,{children:t})})}function Q({id:e,fallback:t,onClose:n,onUse:r,busy:i}){let a=m(),o=_(),s=A({queryKey:[`marketplace-entry`,e,P],queryFn:()=>w.get(`/api/studio/marketplace/${encodeURIComponent(e)}?lang=${P}`),enabled:!!e,retry:!1}),c=s.data??t,l=j({mutationFn:t=>{let n=`/api/studio/marketplace/${encodeURIComponent(e)}/star`;return t?w.put(n):w.del(n)},onSuccess:()=>Promise.all([a.invalidateQueries({queryKey:[`marketplace`]}),a.invalidateQueries({queryKey:[`marketplace-entry`,e]})])}),d=le()===`dark`,f=me[pe[c?.avatar||`round`]],p=d?`var(--card)`:`color-mix(in oklch, ${f??`var(--ink-4)`} 14%, var(--paper-2))`;return(0,U.jsx)(g,{open:!!e,onClose:n,wide:!0,bare:!0,children:c?(0,U.jsxs)(`div`,{className:`relative flex max-h-[calc(100dvh-48px)] flex-col rounded-2xl bg-card shadow-overlay max-sm:h-dvh max-sm:max-h-none max-sm:rounded-none`,children:[(0,U.jsx)(`button`,{type:`button`,"aria-label":F(`common.close`),onClick:n,className:`sm:-top-3.5 sm:-right-3.5 absolute top-3 right-3 z-20 flex size-9 items-center justify-center rounded-full bg-card text-ink-2 shadow-elevated ring-1 ring-border-soft transition hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,children:(0,U.jsx)(S,{className:`size-4`})}),(0,U.jsxs)(`header`,{className:`relative shrink-0 border-border-soft border-b px-5 pt-5 pb-4 text-ink sm:rounded-t-2xl sm:px-7`,style:{background:p,"--coin-bg":p},children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 overflow-hidden sm:rounded-t-2xl`,children:(0,U.jsx)(`span`,{className:y(`-top-28 -right-10 absolute size-80 rounded-full bg-white blur-3xl`,d?`opacity-[0.14]`:`opacity-80`)})}),(0,U.jsx)(`div`,{className:`-bottom-5 absolute right-9 z-10 max-sm:hidden`,children:(0,U.jsx)(ue,{kind:c.avatar,costume:c.costume,size:104})}),(0,U.jsxs)(`div`,{className:`relative sm:pr-36`,children:[(0,U.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight max-sm:pr-10`,children:c.title}),(0,U.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-snug`,children:s.data?.description||c.pitch})]}),c.usable?(0,U.jsxs)(`div`,{className:`-mx-5 sm:-mx-7 relative mt-3.5 flex flex-wrap items-center gap-y-2 border-border-soft border-t px-5 pt-3 font-medium text-[0.875rem] sm:px-7 sm:pr-40`,children:[(0,U.jsxs)(Z,{title:F(`market.duration`),children:[(0,U.jsx)(h,{className:`size-4 text-ink-3`}),F(`market.minutes`,{n:c.effort.minutes})]}),(0,U.jsx)(Z,{title:F(`market.cost`),children:(0,U.jsx)(K,{entry:c})}),(0,U.jsx)(Z,{title:F(`market.result`),children:c.formats.map(e=>(0,U.jsx)(G,{format:e,className:`size-4`},e))})]}):null]}),c.usable?(0,U.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-7 gap-y-6 px-5 pt-6 max-sm:overflow-y-auto max-sm:pb-4 sm:grid-cols-[230px_minmax(0,1fr)] sm:grid-rows-[minmax(0,1fr)] sm:px-7`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-5 sm:min-h-0 sm:overflow-y-auto`,children:[(0,U.jsx)(Y,{title:F(`market.duration`),children:(0,U.jsx)(Rt,{icon:(0,U.jsx)(h,{className:`size-4 text-moss`}),more:F(`market.durationHint`,{n:c.effort.fields}),children:F(`market.minutes`,{n:c.effort.minutes})})}),(0,U.jsx)(Y,{title:F(`market.cost`),children:(0,U.jsx)(Rt,{icon:(0,U.jsx)(Pe,{className:`size-4 text-amber`}),more:c.credits?F(`market.creditsHint`):void 0,children:(0,U.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,U.jsx)(K,{entry:c}),c.credits?(0,U.jsx)(`span`,{className:`text-ink-2`,children:F(`market.creditsRange`,{n:kt(c.credits.credits)})}):null]})})}),(0,U.jsx)(Y,{title:F(`market.result`),children:(0,U.jsx)(`div`,{className:`flex flex-col gap-2`,children:(s.data?.results??[]).map(e=>(0,U.jsx)(Rt,{icon:(0,U.jsx)(G,{format:e.kind,className:`size-4 text-ember-strong`}),more:e.formats.map(e=>e.toUpperCase()).join(` · `),children:e.title},e.title))})}),(0,U.jsx)(Y,{title:F(`market.needs`),children:(0,U.jsx)(`ul`,{className:`flex flex-col gap-2`,children:c.capabilities.map(e=>{let t=Pt[e],n=c.missing.includes(e),r=c.optional?.includes(e);return(0,U.jsxs)(`li`,{className:y(`flex items-center gap-2.5 text-[0.875rem]`,n?`text-ink-3`:`text-ink-2`),children:[(0,U.jsx)(t,{className:y(`size-4 shrink-0`,n?`text-rose`:r?`text-amber`:`text-cobalt`)}),W(`capability`,e),n?(0,U.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:F(`market.unavailable`)}):r?(0,U.jsx)(`span`,{className:`text-[0.75rem] text-amber`,children:F(`market.optional`)}):null]},e)})})})]}),(0,U.jsxs)(`div`,{className:`flex flex-col sm:min-h-0`,children:[(0,U.jsx)(`div`,{className:`mb-1.5 shrink-0 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:F(`market.steps`)}),(0,U.jsx)(zt,{className:`-mr-2 overscroll-contain pt-1 pr-2 pl-1 sm:min-h-0 sm:flex-1 sm:overflow-y-auto`,children:s.isLoading?(0,U.jsx)(T,{className:`size-5 text-ink-3`}):(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(T,{className:`size-5 text-ink-3`}),children:(0,U.jsx)(Et,{steps:Lt(s.data?.outline??[])})})})]})]}):(0,U.jsx)(`div`,{className:`flex-1 px-5 pt-6 sm:px-7`,children:(0,U.jsx)(`p`,{className:`rounded-lg bg-amber-tint p-3 text-[0.875rem] text-ink-2`,children:F(`market.needsUpdateHint`)})}),(0,U.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 px-5 pt-4 pb-5 max-sm:border-border-soft max-sm:border-t sm:px-7 sm:pb-6`,children:[c.plugin?(0,U.jsx)(`span`,{className:`mr-auto flex items-center`,children:(0,U.jsx)(Nt,{plugin:c.plugin})}):(0,U.jsxs)(u,{variant:`ghost`,className:`mr-auto`,title:F(`market.starHint`),"aria-pressed":c.starred,busy:l.isPending,onClick:()=>l.mutate(!c.starred),children:[(0,U.jsx)(V,{className:y(`size-4`,c.starred&&`fill-amber text-amber`)}),(0,U.jsx)(`span`,{className:`max-sm:sr-only`,children:F(c.starred?`market.starred`:`market.star`)})]}),(0,U.jsx)(u,{variant:`secondary`,onClick:n,children:F(`common.close`)}),c.usable&&c.missing.length?(0,U.jsx)(u,{variant:`secondary`,onClick:()=>o(`/settings/models`),children:F(`editor.models.settings`)}):null,r?(0,U.jsx)(u,{disabled:!c.usable||c.missing.length>0||!!c.needs?.length,title:c.needs?.length?F(`market.needsProHint`,{list:c.needs.join(`, `)}):c.missing.length?F(`market.missingHint`,{list:X(c.missing)}):c.optional?.length?F(`market.optionalHint`,{list:X(c.optional)}):void 0,busy:i,onClick:()=>r(c),children:F(`market.use`)}):null]})]}):(0,U.jsx)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-3 rounded-2xl bg-card p-8 text-[0.875rem] text-ink-2 shadow-overlay`,children:s.isLoading?(0,U.jsx)(T,{className:`size-6 text-ink-3`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{children:F(`market.notFound`)}),(0,U.jsx)(u,{variant:`secondary`,onClick:n,children:F(`common.close`)})]})})})}function Bt({name:e,value:t,options:n,onChange:r}){let[a,o]=(0,H.useState)(!1),s=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!a)return;let e=e=>{s.current?.contains(e.target)||o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);let c=n.find(e=>e.value===t);return(0,U.jsxs)(`div`,{ref:s,className:`relative`,children:[(0,U.jsxs)(`div`,{className:y(`flex h-8 items-center rounded-full text-[0.8125rem] transition`,c?`bg-ember-tint text-ink`:`text-ink-2 hover:bg-paper-2 hover:text-ink`,a&&!c&&`bg-paper-2 text-ink`),children:[(0,U.jsx)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":a,onClick:()=>o(!a),className:y(`flex h-full items-center gap-1.5 rounded-full pl-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,c?`pr-1`:`pr-2.5`),children:c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,U.jsx)(`span`,{className:`font-medium`,children:c.label})]}):(0,U.jsxs)(U.Fragment,{children:[e,(0,U.jsx)(f,{className:y(`size-3.5 transition`,a&&`rotate-180`)})]})}),c?(0,U.jsx)(`button`,{type:`button`,"aria-label":`${e}: ${F(`market.reset`)}`,onClick:()=>r(``),className:`mr-1 flex size-6 items-center justify-center rounded-full text-ink-3 hover:bg-card hover:text-ink`,children:(0,U.jsx)(S,{className:`size-3.5`})}):null]}),a?(0,U.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`absolute top-full left-0 z-30 mt-1.5 max-h-80 min-w-60 overflow-y-auto rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:n.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.value===t,disabled:!e.count||e.unavailable,onClick:()=>{r(e.value===t?``:e.value),o(!1)},className:y(`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[0.875rem] transition coarse:py-2.5`,e.count&&!e.unavailable?`text-ink-2 hover:bg-paper-2 hover:text-ink`:`text-ink-4`,e.value===t&&`font-medium text-ink`),children:[e.icon,(0,U.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:e.label}),e.value===t?(0,U.jsx)(i,{className:`size-4 text-ember`}):e.unavailable?(0,U.jsx)(`span`,{className:`whitespace-nowrap text-[0.75rem] text-ink-4`,children:F(`market.unavailable`)}):(0,U.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:e.count})]},e.value))}):null]})}function $(e,t){let[n,r]=(0,H.useState)(e);return(0,H.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var Vt=60;function Ht({query:e,onUse:t,busy:n,limit:r=6}){let[i,a]=(0,H.useState)(null),o=$(e.trim(),250),s=A({queryKey:[`marketplace`,P,o,`hits`,r],queryFn:()=>w.get(`/api/studio/marketplace?${new URLSearchParams({lang:P,limit:String(r),offset:`0`,q:o})}`),enabled:!!o,placeholderData:d}),c=o?s.data?.entries??[]:[];return c.length?(0,U.jsxs)(`section`,{className:`mt-10`,children:[(0,U.jsxs)(`h2`,{className:`mb-5 flex items-center gap-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:[F(`market.hits`),s.isFetching?(0,U.jsx)(T,{className:`size-3.5`}):null]}),(0,U.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:c.map(e=>(0,U.jsx)(J,{entry:e,onOpen:()=>a(e.id)},e.id))}),(0,U.jsx)(Q,{id:i,fallback:c.find(e=>e.id===i)??null,onClose:()=>a(null),onUse:t,busy:n})]}):null}function Ut(){let e=A({queryKey:[`marketplace`,P,`fit`],queryFn:()=>w.get(`/api/studio/marketplace?${new URLSearchParams({lang:P,limit:`12`,offset:`0`,fit:`1`})}`)});return e.data?.context&&e.data.entries.some(e=>e.fit)?e.data:null}function Wt({page:e,organization:t,onUse:n,busy:r,onAll:i}){let[a,o]=(0,H.useState)(null),s=e.context??{sector:null,sectorName:null},c=e.entries,l=e=>e.fit===`sector`||e.fit===`industry`?s.sectorName:e.fit===`wish`?F(`market.fitWish`):null;return(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h2`,{className:`mt-16 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:F(`market.fitTitle`,{organization:t})}),(0,U.jsx)(`p`,{className:`mt-2 mb-5 text-center text-[0.875rem] text-ink-3`,children:s.sectorName?F(`market.fitLine`,{sector:s.sectorName}):F(`market.fitLinePlain`)}),(0,U.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:c.map((e,t)=>(0,U.jsx)(`div`,{className:y(`contents`,t>=4&&`max-sm:hidden`,t>=8&&`sm:max-lg:hidden`),children:(0,U.jsx)(J,{entry:e,why:l(e),onOpen:()=>o(e.id)})},e.id))}),(0,U.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,U.jsx)(u,{variant:`secondary`,onClick:i,children:F(`market.fitAll`,{n:e.all||e.total})})}),(0,U.jsx)(Q,{id:a,fallback:c.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:n,busy:r})]})}function Gt({entries:e}){let t=m(),n=_(),{space:r}=fe(),i=de()&&!!r&&!r?.readOnly,[a,o]=(0,H.useState)(null),s=j({mutationFn:e=>w.post(`/api/studio/wizards`,{spaceId:r.id,starterId:e,lang:P}),onSuccess:async({id:e})=>{await t.invalidateQueries({queryKey:c.spaces()}),await t.invalidateQueries({queryKey:[`wizards`]}),o(null),n(`/edit/${e}`)}});return(0,U.jsxs)(`div`,{className:`@container mt-3`,children:[(0,U.jsx)(`div`,{className:`flex flex-col gap-4 @xl:grid @xl:grid-cols-2`,children:e.map(e=>(0,U.jsx)(J,{entry:e,onOpen:()=>o(e.id)},e.id))}),s.error?(0,U.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:s.error.message}):null,(0,U.jsx)(Q,{id:a,fallback:e.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:i?e=>!s.isPending&&s.mutate(e.id):void 0,busy:s.isPending})]})}function Kt({onUse:e,busy:t,open:n,search:r,onGuestOpen:i}){let[a,o]=(0,H.useState)(``);(0,H.useEffect)(()=>{r&&o(r.text)},[r]);let[s,c]=(0,H.useState)(Dt),[l,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(n??null),h=$(a.trim(),250),g=(0,H.useRef)(null);(0,H.useEffect)(()=>{let e=g.current;h&&e&&window.matchMedia(`(max-width: 639px)`).matches&&e.scrollIntoView({behavior:`smooth`,block:`start`})},[h]);let _=Se({queryKey:[`marketplace`,P,h,s,l],queryFn:({pageParam:e})=>{let t=new URLSearchParams({lang:P,limit:String(Vt),offset:String(e)});h&&t.set(`q`,h);for(let[e,n]of Object.entries(s))n&&t.set(e,n);return l&&t.set(`starred`,`1`),w.get(`/api/${i?`guest`:`studio`}/marketplace?${t}`)},initialPageParam:0,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.entries.length,0);return n<e.total?n:void 0},placeholderData:d}),v=_.data?.pages[0],b=_.data?.pages.flatMap(e=>e.entries)??[],x=v?.all??0,te=a.trim()!==h||_.isFetching&&!_.isFetchingNextPage,C=(e,t,n,r)=>n.filter(t=>v?.facets[e]?.[t]!==void 0).map(n=>({value:n,label:W(t,n),icon:r?.(n),count:(v?.facets[e])[n]??0,unavailable:e===`capability`&&ne.has(n)})),ne=new Set(v?.unavailable??[]),E=C(`useCase`,`useCase`,mt),D=[{key:`industry`,name:F(`market.industry`),options:C(`industry`,`industry`,pt)},{key:`format`,name:F(`market.format`),options:C(`format`,`format`,ft,e=>(0,U.jsx)(G,{format:e,className:`size-4 text-ink-3`}))},{key:`plan`,name:F(`market.plan`),options:C(`plan`,`plan`,ht)},{key:`capability`,name:F(`market.capability`),options:C(`capability`,`capability`,Ze,e=>{let t=Pt[e];return(0,U.jsx)(t,{className:`size-4 text-ink-3`})})}],O=!!a.trim()||l||Object.values(s).some(Boolean),k=()=>{c(Dt),o(``),f(!1)};if(_.isLoading)return(0,U.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,U.jsx)(T,{className:`size-6 text-ink-3`})});let A=v?.offline?(0,U.jsxs)(`p`,{className:`mt-4 flex items-center justify-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,U.jsx)(Me,{className:`size-4 shrink-0`}),F(`market.offline`)]}):null;if(!x&&!O)return A;let j=a?(0,U.jsx)(`button`,{type:`button`,"aria-label":F(`market.reset`),onClick:()=>o(``),className:`-mr-1.5 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-3 hover:bg-paper-2 hover:text-ink`,children:(0,U.jsx)(S,{className:`size-4`})}):null,re=e=>y(`inline-flex h-7 shrink-0 items-center gap-1 whitespace-nowrap rounded-full px-2.5 text-[0.78125rem] transition`,e?`bg-card font-medium text-ink shadow-soft ring-1 ring-border-soft`:`text-ink-3 hover:bg-card/60 hover:text-ink`);return(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{ref:g,className:`relative mx-auto flex h-10 max-w-md scroll-mt-4 items-center gap-2.5 rounded-full bg-card px-4 shadow-soft ring-1 ring-border-soft transition focus-within:ring-2 focus-within:ring-focus sm:h-11`,children:[te?(0,U.jsx)(T,{className:`size-4 shrink-0 text-ink-3`}):(0,U.jsx)(ee,{className:`size-4 shrink-0 text-ink-3`}),(0,U.jsx)(`input`,{type:`search`,value:a,onChange:e=>o(e.target.value),placeholder:F(`market.search`),"aria-label":F(`market.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),j]}),A,(0,U.jsxs)(`div`,{className:`max-sm:-mx-3 mt-4 flex gap-1 max-sm:overflow-x-auto max-sm:px-3 max-sm:[scrollbar-width:none] sm:flex-wrap sm:justify-center max-sm:[&::-webkit-scrollbar]:hidden`,children:[[{value:``,label:F(`market.all`)},...E].map(e=>(0,U.jsx)(`button`,{type:`button`,"aria-pressed":!l&&s.useCase===e.value,onClick:()=>{f(!1),c({...s,useCase:e.value})},className:re(!l&&s.useCase===e.value),children:e.label},e.value)),i?null:(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":l,onClick:()=>f(!l),className:re(l),children:[(0,U.jsx)(V,{className:y(`size-3.5`,l&&`fill-amber text-amber`)}),F(`market.starred`)]})]}),(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-1 gap-y-2 sm:mt-6`,children:[l?null:D.map(e=>(0,U.jsx)(Bt,{name:e.name,value:s[e.key],options:e.options,onChange:t=>c({...s,[e.key]:t})},e.key)),(0,U.jsxs)(`span`,{className:`ml-auto flex items-center gap-3 whitespace-nowrap pl-2 text-[0.8125rem] text-ink-3`,children:[O?(0,U.jsxs)(`button`,{type:`button`,onClick:k,className:`inline-flex items-center gap-1 text-ember-strong underline-offset-2 hover:underline`,children:[(0,U.jsx)(S,{className:`size-3.5 max-sm:size-4`}),(0,U.jsx)(`span`,{className:`max-sm:sr-only`,children:F(`market.resetShort`)})]}):null,O?(0,U.jsx)(`span`,{className:`tabular-nums sm:hidden`,children:F(`market.countOfShort`,{n:v?.total??0,all:x})}):null,(0,U.jsx)(`span`,{className:y(`tabular-nums`,O&&`max-sm:hidden`),children:O?F(`market.countOf`,{n:v?.total??0,all:x}):F(`market.count`,{n:x})})]})]}),b.length?(0,U.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:b.map(e=>(0,U.jsx)(J,{entry:e,onOpen:()=>i?i(e):m(e.id)},e.id))}):(0,U.jsxs)(`div`,{className:`py-10 text-center text-[0.875rem] text-ink-3`,children:[(0,U.jsx)(`p`,{children:F(l?`market.noneStarred`:`market.none`)}),(0,U.jsx)(u,{variant:`ghost`,className:`mt-2`,onClick:k,children:F(`market.reset`)})]}),_.hasNextPage?(0,U.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,U.jsx)(u,{variant:`secondary`,busy:_.isFetchingNextPage,onClick:()=>void _.fetchNextPage(),children:F(`market.more`)})}):null,(0,U.jsx)(Q,{id:p,fallback:b.find(e=>e.id===p)??null,onClose:()=>m(null),onUse:e,busy:t})]})}export{Se as A,z as C,L as D,Me as E,Te as O,Re as S,Pe as T,Xe as _,Tt as a,B as b,$ as c,wt as d,Ct as f,ct as g,st as h,Ht as i,I as k,bt as l,vt as m,Kt as n,q as o,xt as p,Wt as r,Ut as s,Q as t,yt as u,V as v,R as w,Be as x,Ue as y};
|
package/apps/web/dist/assets/{NewWizardChannels-CcE3UMVb.js → NewWizardChannels-D-OLsex6.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$n as r,Mn as i,cn as a,dn as o,nr as s,wn as c}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$n as r,Mn as i,cn as a,dn as o,nr as s,wn as c}from"./ui-CktezodE.js";import{b as l}from"./Marketplace-CS7JTgiv.js";import{Jt as u,Yt as d}from"./host-Bd_bon_c.js";import{r as f}from"./volume-2-Bw5KASy8.js";import{t as p}from"./phone-CjPvZ0nk.js";import{s as m}from"./i18n-0fUKyVRE.js";import{t as h}from"./runners-BoPaPsjN.js";var g=e(t(),1),_=e(n(),1),v=[{id:`steps`,group:`web`,runner:`steps`,label:`new.ch.steps`,icon:l},{id:`chat`,group:`web`,runner:`chat`,label:`new.ch.chat`,icon:d},{id:`talk`,group:`web`,runner:`talk`,label:`new.ch.talk`,icon:s},{id:`video`,group:`web`,runner:`video`,label:`new.ch.video`,icon:o},{id:`call`,group:`phone`,runner:`call`,label:`new.ch.call`,icon:p},{id:`wacall`,group:`phone`,runner:`call`,label:`new.ch.whatsapp`,icon:null},{id:`sms`,group:`message`,runner:`sms`,label:`new.ch.sms`,icon:i},{id:`whatsapp`,group:`message`,runner:`whatsapp`,label:`new.ch.whatsapp`,icon:null}],y=[{id:`web`,label:`new.web`,icon:f},{id:`phone`,label:`new.phone`,icon:p},{id:`message`,label:`new.messages`,icon:u}],b=v.filter(e=>h.enabled.includes(e.id)).map(e=>e.id),x=e=>v.filter(t=>e.includes(t.id));function S(e){return e.length===b.length&&b.every(t=>e.includes(t))}function C(e){let t=x(e),n=[...new Set(t.map(e=>e.runner))];return{default:t.find(e=>e.group===`web`)?.runner??n[0]??h.default,enabled:n}}var w=e=>e.map(e=>m(e.label));function T(e){return v.find(t=>t.runner===e)}function E(e){return v.filter(t=>t.id!==`wacall`&&e.includes(t.runner)).map(e=>e.id)}function D(e){let t=x(e),n=y.flatMap(e=>{let n=w(t.filter(t=>t.group===e.id));return n.length?[e.id===`web`?n.join(`, `):`${m(e.label)}: ${n.join(`, `)}`]:[]});return`${m(`new.runsAs`)}: ${n.join(` · `)}`}function O(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function k({channel:e,className:t}){let n=e.icon;return n?(0,_.jsx)(n,{className:t??`size-4`}):(0,_.jsx)(`span`,{"aria-hidden":`true`,className:`font-semibold text-[0.625rem] tracking-wide`,children:`WA`})}function A(e){let t=new Set(e?.map(e=>e.id)??[`steps`,`chat`]);return v.filter(e=>t.has(e.runner))}function j({value:e,onChange:t,runners:n,without:i,disabled:o}){let s=A(n).filter(e=>!i?.includes(e.id)),c=t=>e.includes(t.id),l=n=>{o||c(n)&&e.length===1||t(c(n)?e.filter(e=>e!==n.id):[...e,n.id])},u=t=>{let n=y.find(e=>e.id===t),i=s.filter(e=>e.group===t);if(!(n&&i.length))return null;let u=n.icon;return(0,_.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,_.jsxs)(`legend`,{className:`flex items-center gap-1.5 px-2 pt-2 pb-1 text-[0.75rem] text-ink-3`,children:[(0,_.jsx)(u,{className:`size-3.5`}),` `,m(n.label)]}),i.map(t=>(0,_.jsxs)(`div`,{children:[(0,_.jsxs)(`label`,{className:a(`flex h-10 w-full cursor-pointer items-center gap-2.5 rounded-lg px-2 text-[0.875rem] transition hover:bg-accent has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus coarse:h-11`,c(t)&&`bg-paper-2`),children:[(0,_.jsx)(`span`,{className:`flex w-5 justify-center text-ink-3`,children:(0,_.jsx)(k,{channel:t})}),(0,_.jsx)(`span`,{className:`flex-1`,children:m(t.label)}),(0,_.jsx)(`input`,{type:`checkbox`,className:`sr-only`,"aria-label":m(t.label),checked:c(t),disabled:o,"aria-disabled":c(t)&&e.length===1,onChange:()=>l(t)}),(0,_.jsx)(`span`,{"aria-hidden":`true`,className:a(`flex size-[1.125rem] items-center justify-center rounded-md ring-1`,c(t)?`bg-ink text-paper ring-ink`:`ring-border`),children:c(t)?(0,_.jsx)(r,{className:`size-3`,strokeWidth:3}):null})]}),t.id===`call`&&c(t)?(0,_.jsx)(`p`,{className:`px-2 pb-1.5 pl-9 text-[0.75rem] text-ink-3`,children:m(`new.callHandoff`)}):null]},t.id))]})};return(0,_.jsxs)(`div`,{className:`grid gap-x-4 sm:grid-cols-2`,children:[u(`web`),(0,_.jsxs)(`div`,{className:`flex flex-col`,children:[u(`phone`),u(`message`)]})]})}function M({value:e,onChange:t,runners:n,className:r}){let[i,o]=(0,g.useState)(!1),[s,l]=(0,g.useState)(0),u=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(!i)return;let e=e=>{u.current?.contains(e.target)||o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i]);let d=A(n),f=y.filter(e=>d.some(t=>t.group===e.id)),p=t=>e.includes(t.id);return(0,_.jsxs)(`div`,{ref:u,className:a(`relative flex flex-wrap items-center gap-1.5`,r),children:[(0,_.jsx)(`span`,{className:`mr-0.5 px-1 text-[0.8125rem] text-ink-3`,children:m(`new.runsAs`)}),f.map(e=>{let t=w(d.filter(t=>t.group===e.id&&p(t))),n=e.icon;return(0,_.jsxs)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-label":`${m(e.label)}: ${t.length?t.join(`, `):m(`new.off`)}`,onClick:e=>{let t=e.currentTarget;l(t.offsetLeft+t.offsetWidth/2),o(e=>!e)},className:a(`inline-flex h-9 items-center justify-center gap-1.5 rounded-full font-medium text-[0.8125rem] transition coarse:h-11`,t.length?`bg-ink px-3 text-paper`:`w-9 text-ink-3 ring-1 ring-border hover:text-ink coarse:w-11`),children:[(0,_.jsx)(n,{className:`size-4 shrink-0`}),t.length?(0,_.jsx)(`span`,{className:`truncate`,children:O(t)}):null]},e.id)}),(0,_.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-label":m(`new.where`),onClick:e=>{let t=e.currentTarget;l(t.offsetLeft+t.offsetWidth/2),o(e=>!e)},className:`inline-flex size-9 items-center justify-center rounded-full text-ink-3 ring-1 ring-border transition hover:text-ink coarse:size-11`,children:(0,_.jsx)(c,{className:`size-4`})}),i?(0,_.jsxs)(`div`,{role:`dialog`,"aria-label":m(`new.where`),style:{transformOrigin:`${s}px top`},className:`absolute top-full left-0 z-20 mt-2 w-[min(32rem,calc(100vw-2rem))] animate-unfold rounded-2xl bg-card p-3 text-left shadow-overlay ring-1 ring-border`,children:[(0,_.jsx)(`p`,{className:`px-2 pt-1 font-semibold text-[0.9375rem]`,children:m(`new.where`)}),(0,_.jsx)(j,{value:e,onChange:t,runners:n})]}):null]})}export{D as a,S as c,M as i,C as l,k as n,T as o,j as r,E as s,y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{G as r,Jt as i,Kt as a,Pr as o,Wr as s,Yt as c,_r as l,c as u,cn as d,ct as f,d as p,dr as m,fr as h,i as g,ir as _,l as v,o as y,q as b,s as ee,sn as te,u as ne,wn as re,yr as x,zt as S}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{G as r,Jt as i,Kt as a,Pr as o,Wr as s,Yt as c,_r as l,c as u,cn as d,ct as f,d as p,dr as m,fr as h,i as g,ir as _,l as v,o as y,q as b,s as ee,sn as te,u as ne,wn as re,yr as x,zt as S}from"./ui-CktezodE.js";import{c as ie,n as ae,o as C,r as oe,s as se,t as w}from"./Marketplace-CS7JTgiv.js";import{t as T}from"./useMutation-7_FOHoEl.js";import{Et as ce,Nt as le}from"./host-Bd_bon_c.js";import{S as ue,h as de,i as E,m as fe,t as pe,u as D}from"./session-CpYa5hwd.js";import{t as O}from"./upload-CHGCFVZK.js";import{n as k,s as A}from"./i18n-0fUKyVRE.js";import{a as me,c as j,i as he,l as ge}from"./NewWizardChannels-D-OLsex6.js";var M=[[`id`,8],[`toolId`,10],[`moduleId`,7],[`pluginId`,6],[`title`,6],[`description`,4],[`tags`,3],[`path`,3],[`inputSchema`,2],[`outputSchema`,2],[`request`,1],[`response`,1]];function N(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase()}function P(e){return N(e).split(/[^a-z0-9]+/).map(e=>e.trim()).filter(e=>e.length>1)}function F(e){return e==null?``:Array.isArray(e)?e.map(F).filter(Boolean).join(` `):typeof e==`object`?Object.values(e).map(F).filter(Boolean).join(` `):String(e)}function I(e,t){let n=t.map(([t,n])=>({text:F(e[t]),weight:n})).filter(e=>e.text.length>0);return{fields:n,tokens:n.flatMap(e=>P(e.text))}}function L(e){let t=[e];if(e.length<5)return t;if(e.endsWith(`ing`)){let n=e.slice(0,-3);n.length>=3&&t.push(n,`${n}e`)}else if(e.endsWith(`ies`)&&e.length>=6)t.push(`${e.slice(0,-3)}y`);else if(e.endsWith(`es`))t.push(e.slice(0,-2),e.slice(0,-1));else if(e.endsWith(`ed`)){let n=e.slice(0,-2);t.push(n,`${n}e`)}else e.endsWith(`s`)&&!e.endsWith(`ss`)&&t.push(e.slice(0,-1));return[...new Set(t)]}function R(e,t){if(e===t)return 1;let n=0;for(let r of L(e))for(let i of L(t)){if(r===i){n=Math.max(n,r===e&&i===t?1:.75);continue}r.length>=2&&i.startsWith(r)&&(n=Math.max(n,.55*(r.length/i.length))),i.length>=4&&r.startsWith(i)&&(n=Math.max(n,.4*(i.length/r.length)))}return n}function z(e,t){return e.reduce((e,n)=>e+R(t,n),0)}function B(e,t,n=M){if(!t?.trim())return 0;let r=P(t);if(r.length===0)return 0;let i=I(e,n);return i.tokens.length===0?0:r.reduce((e,t)=>z(i.tokens,t)===0?e:e+i.fields.reduce((e,n)=>{let r=P(n.text),i=z(r,t);if(i===0)return e;let a=i*2.2/(i+1.2+r.length/16);return e+n.weight*a},0),0)}var V=new Set(P(`aber als also am an auch auf aus bei bin bitte brauche brauchen braucht das dass dem den der
|
|
2
2
|
des die dies diese dieser doch du ein eine einem einen einer eines er es etwas fuer für gerne
|
|
3
3
|
habe haben hat ich ihr im in ist kann können koennen mache machen mag mein meine meinem meinen
|
|
4
4
|
meiner mich mir mit möchte moechte nach nicht noch nur oder sich sie sind soll suche suchen
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$n as r,G as i,Vn as a,Wr as o,_r as s,cn as c,d as l,dr as ee,i as u,ir as d,q as f,u as p,yr as te}from"./ui-Uqnx1UpK.js";import{t as m}from"./useMutation-DEkZhp5c.js";import{S as ne,T as h,_ as g,h as re,i as ie,n as _,u as ae}from"./session-SXPtTWRK.js";import{t as oe}from"./upload-BchUnQGV.js";import{t as v}from"./logo-BpnjXTRy.js";import{n as y,s as b}from"./i18n-BJ7Ld6O6.js";import{r as se}from"./LangSwitch-DpD0inR4.js";var x=new Set([`gmail.com`,`googlemail.com`,`gmx.at`,`gmx.de`,`gmx.net`,`web.de`,`outlook.com`,`hotmail.com`,`live.com`,`icloud.com`,`me.com`,`yahoo.com`,`yahoo.de`,`aon.at`,`a1.net`,`chello.at`,`t-online.de`,`proton.me`,`protonmail.com`]),ce={website:`Website`,blog:`Blog`,linkedin:`LinkedIn`,instagram:`Instagram`,facebook:`Facebook`,youtube:`YouTube`,x:`X`,xing:`XING`,tiktok:`TikTok`},le=[[`linkedin`,/(^|\.)linkedin\.com$/],[`instagram`,/(^|\.)instagram\.com$/],[`facebook`,/(^|\.)(facebook|fb)\.com$/],[`youtube`,/(^|\.)(youtube\.com|youtu\.be)$/],[`x`,/(^|\.)(x|twitter)\.com$/],[`xing`,/(^|\.)xing\.com$/],[`tiktok`,/(^|\.)tiktok\.com$/]];function ue(e){let t=e.trim();if(!t||/\s/.test(t))return null;try{let e=new URL(/^https?:\/\//i.test(t)?t:`https://${t}`);return e.hostname.includes(`.`)?e.href:null}catch{return null}}function de(e){let t=ue(e);if(!t)return`website`;let{hostname:n,pathname:r}=new URL(t),i=n.toLowerCase().replace(/^www\./,``);for(let[e,t]of le)if(t.test(i))return e;return/^blog\./.test(i)||/^\/blog(\/|$)/.test(r)||/(^|\.)(medium|substack)\.com$/.test(i)?`blog`:`website`}var S=[{id:`bakeries`,industry:`gastronomy`,name:{de:`Bäckereien`,en:`Bakeries`},words:[`bäckerei`,`bäcker`,`backstube`,`brot`,`gebäck`,`konditorei`,`bakery`,`bread`,`pastry`]},{id:`cafes`,industry:`gastronomy`,name:{de:`Cafés`,en:`Cafés`},words:[`café`,`cafe`,`kaffeehaus`,`kaffee`,`coffee`,`espresso`]},{id:`restaurants`,industry:`gastronomy`,name:{de:`Restaurants`,en:`Restaurants`},words:[`restaurant`,`gasthaus`,`gasthof`,`wirtshaus`,`pizzeria`,`küche`,`speisekarte`,`menu`,`bistro`]},{id:`hotels`,industry:`hospitality`,name:{de:`Hotels und Pensionen`,en:`Hotels and guesthouses`},words:[`hotel`,`pension`,`zimmer`,`übernachtung`,`ferienwohnung`,`guesthouse`,`booking`,`rooms`]},{id:`architects`,industry:`professional`,name:{de:`Architekturbüros`,en:`Architects`},words:[`architekt`,`architektur`,`planung`,`entwurf`,`architect`,`architecture`]},{id:`lawFirms`,industry:`professional`,name:{de:`Kanzleien`,en:`Law firms`},words:[`rechtsanwalt`,`anwalt`,`kanzlei`,`recht`,`notar`,`law firm`,`lawyer`,`attorney`,`legal`]},{id:`taxAdvisors`,industry:`professional`,name:{de:`Steuerberatung`,en:`Tax advisors`},words:[`steuerberatung`,`steuerberater`,`steuer`,`buchhaltung`,`lohnverrechnung`,`bilanz`,`tax`,`accounting`,`bookkeeping`]},{id:`consultants`,industry:`professional`,name:{de:`Beratung`,en:`Consultants`},words:[`beratung`,`berater`,`consulting`,`coaching`,`consultant`]},{id:`physiotherapy`,industry:`health`,name:{de:`Physiotherapie`,en:`Physiotherapy`},words:[`physiotherapie`,`physio`,`massage`,`therapie`,`physiotherapy`]},{id:`practices`,industry:`health`,name:{de:`Arztpraxen`,en:`Doctors’ practices`},words:[`arzt`,`ärztin`,`praxis`,`ordination`,`zahnarzt`,`doctor`,`clinic`,`dentist`]},{id:`hairdressers`,industry:`retail`,name:{de:`Friseur und Kosmetik`,en:`Hair and beauty`},words:[`friseur`,`frisör`,`kosmetik`,`nagelstudio`,`beauty`,`hairdresser`,`salon`]},{id:`joiners`,industry:`trades`,name:{de:`Tischlereien`,en:`Joiners`},words:[`tischlerei`,`tischler`,`schreiner`,`möbel`,`holz`,`joinery`,`carpenter`,`furniture`]},{id:`electricians`,industry:`trades`,name:{de:`Elektrotechnik`,en:`Electricians`},words:[`elektriker`,`elektro`,`elektrotechnik`,`photovoltaik`,`electrician`,`electrical`]},{id:`plumbing`,industry:`trades`,name:{de:`Installateure`,en:`Plumbing and heating`},words:[`installateur`,`sanitär`,`heizung`,`klima`,`plumber`,`plumbing`,`heating`]},{id:`windows`,industry:`trades`,name:{de:`Fensterbau`,en:`Window makers`},words:[`fenster`,`türen`,`fensterbau`,`sonnenschutz`,`windows`,`doors`]},{id:`construction`,industry:`trades`,name:{de:`Bau und Handwerk`,en:`Building and trades`},words:[`bau`,`baumeister`,`maler`,`dachdecker`,`handwerk`,`construction`,`builder`,`painter`,`roofer`]},{id:`realEstate`,industry:`realEstate`,name:{de:`Immobilien`,en:`Real estate`},words:[`immobilien`,`makler`,`wohnung`,`miete`,`hausverwaltung`,`real estate`,`property`,`estate agent`]},{id:`onlineShops`,industry:`retail`,name:{de:`Online-Shops`,en:`Online shops`},words:[`online-shop`,`onlineshop`,`shop`,`versand`,`e-commerce`,`webshop`,`online store`]},{id:`retail`,industry:`retail`,name:{de:`Handel`,en:`Retail`},words:[`geschäft`,`handel`,`laden`,`boutique`,`retail`,`store`]},{id:`agencies`,industry:`agency`,name:{de:`Agenturen`,en:`Agencies`},words:[`agentur`,`werbung`,`marketing`,`design`,`kommunikation`,`agency`,`advertising`,`branding`]},{id:`photographers`,industry:`agency`,name:{de:`Fotografie`,en:`Photographers`},words:[`fotograf`,`fotografie`,`foto`,`photographer`,`photography`]},{id:`events`,industry:`events`,name:{de:`Veranstaltungen`,en:`Events`},words:[`event`,`veranstaltung`,`hochzeit`,`catering`,`konferenz`,`wedding`,`conference`]},{id:`itServices`,industry:`professional`,name:{de:`IT-Dienstleister`,en:`IT services`},words:[`it-dienstleister`,`it-service`,`software`,`webentwicklung`,`hosting`,`netzwerk`,`development`,`web design`]},{id:`cleaning`,industry:`trades`,name:{de:`Reinigung`,en:`Cleaning`},words:[`reinigung`,`gebäudereinigung`,`putz`,`cleaning`,`janitorial`]},{id:`footballClubs`,industry:`any`,name:{de:`Fußballvereine`,en:`Football clubs`},words:[`fußball`,`fussball`,`fc`,`sv`,`kicker`,`football`,`soccer`]},{id:`sportsClubs`,industry:`any`,name:{de:`Sportvereine`,en:`Sports clubs`},words:[`sportverein`,`verein`,`turnen`,`tennis`,`laufen`,`sport`,`club`]},{id:`musicClubs`,industry:`events`,name:{de:`Musikvereine und Chöre`,en:`Music clubs and choirs`},words:[`musikverein`,`blasmusik`,`chor`,`kapelle`,`orchester`,`band`,`choir`,`music`]},{id:`fireBrigades`,industry:`publicSector`,name:{de:`Feuerwehren`,en:`Fire brigades`},words:[`feuerwehr`,`rettung`,`rotes kreuz`,`fire brigade`,`rescue`]},{id:`schools`,industry:`publicSector`,name:{de:`Schulen und Bildung`,en:`Schools and education`},words:[`schule`,`kurs`,`weiterbildung`,`akademie`,`nachhilfe`,`school`,`course`,`training`]},{id:`municipalities`,industry:`publicSector`,name:{de:`Gemeinden`,en:`Municipalities`},words:[`gemeinde`,`stadt`,`bürgerservice`,`amt`,`municipality`,`council`,`town`]},{id:`associations`,industry:`any`,name:{de:`Vereine und Initiativen`,en:`Associations`},words:[`verein`,`initiative`,`ehrenamt`,`verband`,`association`,`nonprofit`,`charity`]}],C=e=>S.find(t=>t.id===e)??null;function fe(e,t=3){let n=` ${e.toLowerCase().normalize(`NFC`).replace(/[^\p{L}\p{N}-]+/gu,` `)} `;return S.map(e=>({id:e.id,score:e.words.reduce((e,t)=>e+(n.includes(` ${t}`)?Math.min(3,t.length/4):0),0)})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,t).map(e=>e.id)}var w=e(t(),1),T=e(n(),1),pe=`oklch(50% 0.2 262)`,E=`oklch(32% 0.15 262)`,D=`oklch(90% 0.1 80)`,me={"--on":`white`,"--dot":D,"--ink-2":`oklch(96% 0.02 262)`,"--ink-3":`oklch(90% 0.035 262)`,"--moss":`oklch(90% 0.14 150)`,"--rose":`oklch(89% 0.09 45)`},O={kind:1,organization:1,site:2,details:3,know:4,space:5},he=e=>e!==null&&Object.hasOwn(O,e),ge=`w-full rounded-[18px] border border-white/30 bg-white/15 px-6 py-5 text-[1.375rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function _e(){return(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,T.jsx)(v,{size:28}),(0,T.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight`,children:[`engenty`,(0,T.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-(color:--dot)`,children:`.`}),(0,T.jsx)(`span`,{className:`font-normal text-white/70`,children:`wizards`})]})]})}function k({children:e,busy:t,onClick:n,type:r=`button`}){return(0,T.jsxs)(`button`,{type:r,disabled:t,onClick:n,className:`inline-flex h-13 cursor-pointer items-center gap-2.5 rounded-full bg-white px-7 font-semibold text-[1rem] transition hover:bg-white/90 disabled:cursor-default disabled:opacity-70`,style:{color:E},children:[e,(0,T.jsx)(d,{className:`size-[18px]`})]})}function A({children:e,onClick:t}){return(0,T.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer font-semibold text-[0.9375rem] text-white/85 transition hover:text-white`,children:e})}function j({step:e,total:t=4}){return(0,T.jsx)(`span`,{className:`ml-auto inline-flex gap-1.5`,role:`img`,"aria-label":b(`onboard.step`,{n:e,total:t}),children:Array.from({length:t},(e,t)=>t+1).map(t=>(0,T.jsx)(`span`,{className:c(`size-2 rounded-full`,t===e?`bg-white`:`bg-white/40`)},t))})}var ve=[{kind:`personal`,label:`onboard.kindPersonal`,sub:`onboard.kindPersonalSub`},{kind:`club`,label:`onboard.kindClub`,sub:`onboard.kindClubSub`},{kind:`small`,label:`onboard.kindSmall`,sub:`onboard.kindSmallSub`},{kind:`corp`,label:`onboard.kindCorp`,sub:`onboard.kindCorpSub`}];function ye(e){let t=(e.split(`@`)[1]??``).trim().toLowerCase();return t?x.has(t)?{kind:`personal`,domain:t}:/(verein|club|klub|^sv-|^fc-|^ff-|feuerwehr|musik|chor)/.test(t)?{kind:`club`,domain:t}:{kind:`small`,domain:t}:{kind:null,domain:t}}var be={club:[`0-50`,`50-250`,`250-1000`,`1000+`],small:[`1`,`2-9`,`10-49`],corp:[`50-249`,`250-999`,`1000+`]},M=e=>Number(e).toLocaleString(y),xe=e=>{if(e===`1`)return b(`onboard.justMe`);if(e.endsWith(`+`))return`${M(e.slice(0,-1))}+`;let[t,n]=e.split(`-`);return t===`0`?`≤ ${M(n)}`:`${M(t)}–${M(n)}`},Se=[`sport`,`culture`,`social`,`education`,`environment`,`rescue`,`other`],Ce=[`chair`,`board`,`treasurer`,`secretary`,`member`],we=[`management`,`it`,`marketing`,`sales`,`operations`,`other`],Te=`w-full rounded-[14px] border border-white/30 bg-white/15 px-4 py-3 text-[1.0625rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function Ee({picked:e,label:t,sub:n,onClick:r}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:r,className:c(`flex cursor-pointer flex-col gap-1 rounded-[18px] border px-5 py-4 text-left transition`,e?`border-white bg-white/25`:`border-white/30 bg-white/10 hover:bg-white/15`),children:[(0,T.jsx)(`span`,{className:`font-display font-semibold text-[1.125rem]`,children:t}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:n})]})}function N({label:e,options:t,value:n,text:r,onChange:i}){return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:e}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":n===e,onClick:()=>i(e),className:c(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,n===e?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:n===e?{color:E}:void 0,children:r(e)},e))})]})}function P(e,t,n){let r=`${De}${e}:${t}`,[i,a]=(0,w.useState)(()=>{try{let e=sessionStorage.getItem(r);return e===null?n:JSON.parse(e)}catch{return n}});return(0,w.useEffect)(()=>{try{sessionStorage.setItem(r,JSON.stringify(i))}catch{}},[r,i]),[i,a]}var De=`wizards.onboarding:`;function Oe(){try{for(let e of Object.keys(sessionStorage))e.startsWith(De)&&sessionStorage.removeItem(e)}catch{}}function F(){return h(pe),re().data?.onboarding===`welcome`?(0,T.jsx)(Me,{}):(0,T.jsx)(I,{})}function I(){let e=re(),t=o(),n=s(),{space:l}=ae(),u=e.data?.user.id??``,d=e.data?.onboarding===`organization`,p=d?4:5,h=e.data?.startingName?null:e.data?.tenant.name??null,[g,_]=P(u,`organization`,``),[v,x]=P(u,`line`,null),[le,S]=P(u,`ticked`,null),[C,O]=P(u,`own`,[``]),[M,De]=(0,w.useState)(null),[F,I]=(0,w.useState)([]),Me=(0,w.useRef)(null),[Pe]=(0,w.useState)(ie),[B]=(0,w.useState)(()=>d?{kind:null,domain:``}:ye(e.data?.user.email??``)),[V,Fe]=P(u,`profile`,{kind:B.kind,size:null,sector:``,role:null,need:``,questions:``,phone:``}),[Ie,Le]=ee(),H=Ie.get(`page`),U=he(H)&&(H===`kind`||V.kind)&&!(d&&H===`space`)?H:`kind`,W=e=>Le(t=>{let n=new URLSearchParams(t);return n.set(`page`,e),n}),G=e=>Fe(t=>({...t,...e})),K=V.kind===`personal`,q=h??(g.trim()||null),J=te({queryKey:[`onboarding`,`suggest`],queryFn:()=>f.get(`/api/studio/onboarding/suggest`),enabled:!d&&!h&&!!V.kind&&!K,staleTime:1/0}).data?.site??null;(0,w.useEffect)(()=>{J&&!g&&_(J.name)},[J,g,_]);let Re=te({queryKey:[`onboarding`,`find`,q],queryFn:()=>f.post(`/api/studio/onboarding/find`,{name:q,lang:y}),enabled:U===`site`&&!K&&!!q,staleTime:1/0}),Y=Re.data?.addresses??[],X=le??Y.filter((e,t)=>e.kind!==`website`||!Y.slice(0,t).some(e=>e.kind===`website`)).map(e=>e.url),ze=C.map(e=>e.trim()).filter(e=>ue(e)),Z=[...X,...ze],Be=!K&&Re.isSuccess&&Y.length===0,[Ve,He]=P(u,`anyway`,!1),Ue=v!==null||Be&&!ze.length&&!Ve,We=m({mutationFn:()=>f.put(`/api/studio/organization/profile`,{kind:V.kind,size:V.size,sector:V.sector.trim()||null,role:V.role,need:V.need.trim()||null,questions:(V.questions??``).trim()||null,phone:V.phone.trim()||null,website:Z.find(e=>de(e)===`website`)??null,links:Z})}),Ge=m({mutationFn:e=>f.put(`/api/studio/organization`,{name:e})}),Ke=()=>{W(`site`),t.invalidateQueries({queryKey:[`organization`]}),t.invalidateQueries({queryKey:[`me`]})},Q=m({mutationFn:e=>f.post(`/api/studio/spaces/${l?.id}/website`,{urls:e,lang:y}),onSuccess:async e=>{let n=e?.sectors?.[0];n&&Fe(e=>e.sector?e:{...e,sector:n}),De(e??{name:``,about:!1,colors:0,fonts:0,logo:!1,facts:0,assets:0}),await t.invalidateQueries({queryKey:i.spaces()})}}),qe=m({mutationFn:e=>f.patch(`/api/studio/spaces/${l?.id}`,{brand:{about:e}}),onSuccess:()=>t.invalidateQueries({queryKey:i.spaces()})}),$=m({mutationFn:()=>f.post(`/api/studio/onboarding/done`),onSuccess:async()=>{Oe(),await t.invalidateQueries({queryKey:[`me`]}),n(`/new`,{replace:!0})}}),Je=e.data?.user.name??``,Ye=Je.includes(`@`)?``:Je.split(` `)[0],Xe=d&&h?b(`onboard.kickerNew`,{organization:h}):Ye?b(`onboard.kicker1`,{name:Ye}):b(`onboard.kicker1Anon`),Ze=(e,t)=>q&&!K?b(e,{organization:q}):b(t),Qe=async e=>{if(e&&l){for(let t of Array.from(e)){I(e=>[...e,{name:t.name,state:`uploading`}]);try{await f.upload(`/api/studio/spaces/${l.id}/files?kind=document`,t),I(e=>e.map(e=>e.name===t.name?{...e,state:`done`}:e))}catch{I(e=>e.map(e=>e.name===t.name?{...e,state:`failed`}:e))}}await t.invalidateQueries({queryKey:i.spaces()})}},$e=M?[M.about?b(`onboard.readAbout`):``,M.colors?b(`onboard.readColors`,{n:M.colors}):``,M.fonts?b(`onboard.readFonts`,{n:M.fonts}):``,M.logo?b(`onboard.readLogo`):``,M.facts?b(`onboard.readFacts`,{n:M.facts}):``,M.assets?b(`onboard.readAssets`,{n:M.assets}):``].join(``):``,et=[...new Set([...M?.sectors??[],...fe(`${q??``} ${v??``} ${V.questions??``}`,4)])].slice(0,4),tt=e=>`${window.location.host}/studio/${je(e)}`;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(se,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:[(0,T.jsx)(ne,{kind:`drop`,size:240,fluffy:!0,coat:`fur`}),Pe?(0,T.jsxs)(`figure`,{className:`w-full max-w-sm rounded-[18px] bg-white/15 px-5 py-4`,children:[(0,T.jsx)(`figcaption`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:b(`onboard.wish`)}),(0,T.jsx)(`blockquote`,{className:`mt-1.5 line-clamp-6 whitespace-pre-line break-words text-[1rem] leading-relaxed`,children:Pe}),(0,T.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-white/75`,children:b(`onboard.wishNext`)})]}):null]}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[U===`kind`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),V.kind&&W(V.kind===`personal`||h?`site`:`organization`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:b(`onboard.kind`)}),(0,T.jsx)(z,{children:d&&h?b(`onboard.kindSubOrganization`,{organization:h}):b(`onboard.kindSub`)}),B.kind?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:b(`onboard.guess`,{domain:B.domain,kind:b(ve.find(e=>e.kind===B.kind)?.label??`onboard.kindSmall`)})}):null,(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:ve.map(e=>(0,T.jsx)(Ee,{picked:V.kind===e.kind,label:b(e.label),sub:b(e.sub),onClick:()=>G({kind:e.kind,size:e.kind===V.kind?V.size:null})},e.kind))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,children:b(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:p})]})]}):null,U===`organization`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=g.trim();t?Ge.mutate(t,{onSuccess:Ke}):W(`site`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:b(`onboard.organization`)}),(0,T.jsx)(z,{children:b(`onboard.organizationSub`)}),(0,T.jsx)(`input`,{value:g,onChange:e=>_(e.target.value),placeholder:b(`onboard.organizationPlaceholder`),maxLength:80,"aria-label":b(`onboard.organization`),className:ge}),g.trim()?(0,T.jsxs)(`p`,{className:`-mt-2 text-[0.9375rem] text-white/85`,children:[J&&g===J.name?`${b(`onboard.nameFrom`,{domain:new URL(J.url).host})} `:``,b(`onboard.address`),` `,(0,T.jsx)(`span`,{className:`font-mono text-[0.875rem]`,style:{color:D},children:tt(g)})]}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:Ge.isPending,children:b(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:p})]})]}):null,U===`site`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:K?b(`onboard.kicker2Personal`):Ze(`onboard.kicker2Named`,`onboard.kicker2`)}),(0,T.jsx)(R,{children:K?b(`onboard.linksPersonal`):Be&&!Ve&&q?b(`onboard.noneFound`,{name:q}):q?b(`onboard.siteNamed`,{organization:q}):b(`onboard.site`)}),(0,T.jsx)(z,{children:K?b(`onboard.linksPersonalSub`):Be&&!Ve&&q?b(`onboard.noneFoundSub`,{name:q}):Re.isPending?b(`onboard.searching`,{name:q??``}):b(`onboard.foundSub`)}),Ue?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=(v??``).trim();t?qe.mutate(t,{onSuccess:()=>W(`details`)}):W(`details`)},children:[(0,T.jsx)(ke,{value:v??``,onChange:x,rows:4,label:b(`onboard.line`),placeholder:b(K?`onboard.linePlaceholderPersonal`:`onboard.linePlaceholder`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>{x(null),He(!0),O(e=>e.length?e:[``])},className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,b(`onboard.addressAfterAll`)]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:qe.isPending,children:b(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:b(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:p})]})]}):(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),M?W(`details`):Z.length&&!Q.isPending&&Q.mutate(Z)},children:[Y.length?(0,T.jsx)(`div`,{className:`flex flex-col gap-2`,children:Y.map(e=>(0,T.jsx)(Ae,{address:e,picked:X.includes(e.url),onToggle:()=>S(X.includes(e.url)?X.filter(t=>t!==e.url):[...X,e.url])},e.url))}):null,!K&&Y.length?(0,T.jsx)(`p`,{className:`-mb-2 text-[0.9375rem] text-white/85`,children:b(`onboard.own`)}):null,C.map((e,t)=>(0,T.jsxs)(`div`,{className:`relative`,children:[(0,T.jsx)(`input`,{value:e,onChange:e=>O(n=>n.map((n,r)=>r===t?e.target.value:n)),placeholder:b(K?`onboard.linkPlaceholderPersonal`:`onboard.ownPlaceholder`),autoCapitalize:`none`,"aria-label":b(`onboard.own`),className:c(Te,`pr-28`)}),ue(e)?(0,T.jsx)(`span`,{className:`-translate-y-1/2 absolute top-1/2 right-3 rounded-full bg-white/20 px-2.5 py-0.5 font-semibold text-[0.75rem]`,children:ce[de(e)]}):null]},t)),C.length+Y.length<10?(0,T.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>[...e,``]),className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,b(`onboard.addAddress`)]}):null,M?(0,T.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.9375rem] text-(color:--moss)`,children:[(0,T.jsx)(r,{className:`size-4`}),M.name?b(`onboard.readDone`,{name:M.name,details:$e}):b(`onboard.readKept`,{n:Z.length})]}):Q.isError?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-(color:--rose)`,children:b(`onboard.readFailed`)}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[M?(0,T.jsx)(k,{type:`submit`,children:b(`onboard.continue`)}):(0,T.jsx)(k,{type:`submit`,busy:Q.isPending,children:Q.isPending?b(`onboard.reading`):b(`onboard.read`)}),(0,T.jsx)(A,{onClick:()=>x(``),children:b(`onboard.line`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:b(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:p})]})]})]}):null,U===`details`&&V.kind?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),We.mutate(),W(`know`)},children:[(0,T.jsx)(L,{children:K||!q?Xe:q}),(0,T.jsx)(R,{small:!0,children:K?b(`onboard.personalTitle`):q?b(`onboard.aboutOrganization`,{organization:q}):b(V.kind===`club`?`onboard.clubTitle`:`onboard.businessTitle`)}),K?(0,T.jsx)(ke,{value:V.need,onChange:e=>G({need:e}),rows:4,label:b(`onboard.personalTitle`),placeholder:b(`onboard.personalPlaceholder`)}):null,V.kind===`club`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:b(`onboard.clubKind`),options:Se,value:V.sector,text:e=>b(`onboard.club.${e}`),onChange:e=>G({sector:e})}),(0,T.jsx)(N,{label:b(`onboard.members`),options:be.club,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(N,{label:b(`onboard.yourRole`),options:Ce,value:V.role,text:e=>b(`onboard.role.${e}`),onChange:e=>G({role:e})})]}):null,V.kind===`small`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:b(`onboard.people`),options:be.small,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et})]}):null,V.kind===`corp`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:b(`onboard.people`),options:be.corp,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et}),(0,T.jsx)(N,{label:b(`onboard.yourRole`),options:we,value:V.role,text:e=>b(`onboard.role.${e}`),onChange:e=>G({role:e})}),(0,T.jsxs)(`label`,{className:`flex flex-col gap-2 text-[0.9375rem] text-white/85`,children:[(0,T.jsxs)(`span`,{children:[b(`onboard.phone`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:b(`onboard.phoneWhy`)})]}),(0,T.jsx)(`input`,{type:`tel`,value:V.phone,onChange:e=>G({phone:e.target.value.replace(/[^+0-9 ()/.-]/g,``)}),placeholder:`+43 …`,maxLength:40,autoComplete:`tel`,className:Te})]})]}):null,K?null:(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,T.jsxs)(`span`,{className:`text-[0.9375rem] text-white/85`,children:[b(`onboard.questions`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:b(`onboard.optional`)})]}),(0,T.jsx)(ke,{value:V.questions??``,onChange:e=>G({questions:e}),rows:3,label:b(`onboard.questions`),placeholder:b(`onboard.questionsPlaceholder`)}),(0,T.jsx)(`span`,{className:`text-[0.8125rem] text-white/70`,children:b(`onboard.questionsHint`)})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:We.isPending,children:b(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>window.history.state?.idx>0?n(-1):W(`site`),children:b(`onboard.back`)}),(0,T.jsx)(j,{step:3,total:p})]})]}):null,U===`know`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker3Named`,`onboard.kicker3`)}),(0,T.jsx)(R,{children:b(`onboard.know`)}),(0,T.jsx)(z,{children:b(`onboard.knowSub`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>Me.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),Qe(e.dataTransfer.files)},className:`flex cursor-pointer flex-col items-center gap-2 rounded-[18px] border-2 border-white/45 border-dashed bg-white/10 px-6 py-7 text-center transition hover:bg-white/15`,children:[(0,T.jsx)(oe,{className:`size-7`}),(0,T.jsx)(`span`,{className:`font-semibold text-[1.0625rem]`,children:b(`onboard.drop`)}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:`PDF · Word · Excel · Markdown`}),(0,T.jsx)(`input`,{ref:Me,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{Qe(e.target.files),e.target.value=``}})]}),F.length?(0,T.jsx)(`ul`,{className:`flex flex-col gap-2`,children:F.map(e=>(0,T.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-xl bg-white/15 px-3.5 py-2.5 text-[0.875rem]`,children:[(0,T.jsx)(a,{className:`size-4 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,T.jsx)(`span`,{className:c(`text-white/80`,e.state===`failed`?`text-(color:--rose)`:``),children:e.state===`uploading`?b(`onboard.uploading`):e.state===`done`?b(`onboard.uploaded`):b(`onboard.uploadFailed`)})]},e.name))}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:F.some(e=>e.state===`uploading`)||$.isPending,onClick:()=>d?$.mutate():W(`space`),children:b(d?`onboard.buildFirst`:`onboard.continue`)}),F.length||d?null:(0,T.jsx)(A,{onClick:()=>W(`space`),children:b(`onboard.skip`)}),(0,T.jsx)(j,{step:4,total:p})]})]}):null,U===`space`&&!d?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker4Named`,`onboard.kicker4`)}),(0,T.jsx)(R,{children:q&&!K?b(`onboard.spaceNamed`,{organization:q}):b(`onboard.space`)}),(0,T.jsx)(z,{children:b(`onboard.spaceSub`,{space:l?.name??``})}),(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[[`partInfo`,`partInfoText`,!!(M||v)],[`partKnow`,`partKnowText`,F.some(e=>e.state===`done`)],[`partData`,`partDataText`,!1],[`partResults`,`partResultsText`,!1]].map(([e,t,n])=>(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-2xl border border-white/20 bg-white/10 px-4.5 py-4`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-2 font-semibold text-[1rem]`,children:[n?(0,T.jsx)(r,{className:`size-4 text-(color:--moss)`}):null,b(`onboard.${e}`)]}),(0,T.jsx)(`span`,{className:`text-[0.84375rem] text-white/85 leading-snug`,children:b(`onboard.${t}`)})]},e))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:$.isPending,onClick:()=>$.mutate(),children:b(`onboard.build`)}),(0,T.jsx)(j,{step:5,total:p})]})]}):null]},U)]}),(0,T.jsxs)(`footer`,{className:`mx-auto flex w-full max-w-6xl items-center justify-between pb-6 text-[0.75rem] text-white/55 sm:pb-8`,children:[(0,T.jsx)(`span`,{children:`engenty.wizards`}),(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px] bg-(color:--dot)`})]})]})}function L({children:e}){return(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:e})}function R({children:e,small:t}){return(0,T.jsx)(`h1`,{className:c(`font-display font-bold leading-[1.05] tracking-[-0.02em]`,t?`text-[2.25rem] sm:text-[2.75rem]`:`text-[2.5rem] sm:text-[3.25rem]`),children:e})}function z({children:e}){return(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:e})}function ke({value:e,onChange:t,rows:n,label:r,placeholder:i}){let[a]=l(),o=p(e,t,{deviceId:a.deviceId});return(0,T.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[18px] border border-white/30 bg-white/15 px-4 pt-3 pb-3 focus-within:border-white/60`,children:[(0,T.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),placeholder:o.listening?b(`editor.listening`):i,rows:n,maxLength:4e3,"aria-label":r,className:`w-full resize-none bg-transparent text-[1.0625rem] text-white leading-relaxed outline-none placeholder:text-white/55`}),o.supported?(0,T.jsx)(`div`,{className:`self-end`,style:{"--ink":`white`,"--border":`rgb(255 255 255 / 0.55)`},children:(0,T.jsx)(u,{speech:o,labelled:!0})}):null]})}function Ae({address:e,picked:t,onToggle:n}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":t,onClick:n,className:c(`flex cursor-pointer items-center gap-3.5 rounded-[14px] border px-4 py-2.5 text-left transition`,t?`border-white bg-white/22`:`border-white/30 bg-white/8 hover:bg-white/12`),children:[(0,T.jsx)(`span`,{className:c(`flex size-5 shrink-0 items-center justify-center rounded-md border-2`,t?`border-white bg-white`:`border-white/60`),style:t?{color:E}:void 0,children:t?(0,T.jsx)(r,{className:`size-3.5`,strokeWidth:3}):null}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`font-semibold text-[0.6875rem] text-white/70 uppercase tracking-[0.1em]`,children:ce[e.kind]}),(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.9375rem]`,children:e.url.replace(/^https?:\/\/(www\.)?/,``).replace(/\/$/,``)}),(0,T.jsx)(`span`,{className:`truncate text-[0.8125rem] text-white/80`,children:e.title})]}),(0,T.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-white/70 max-sm:hidden`,children:b(e.source===`email`?`onboard.fromEmail`:`onboard.fromWeb`)})]})}function je(e){return e.toLowerCase().replace(/['’]/g,``).replace(/ä/g,`ae`).replace(/ö/g,`oe`).replace(/ü/g,`ue`).replace(/ß/g,`ss`).normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,35).replace(/-+$/,``)}function Me(){let e=re(),t=o(),n=s(),r=g(),i=e.data?.tenant,a=te({queryKey:[`organization`,i?.id],queryFn:()=>f.get(`/api/studio/organization`),enabled:!!i}),c=m({mutationFn:()=>f.post(`/api/studio/onboarding/done`),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`me`]}),n(`/`,{replace:!0})}});if(!(e.data&&i))return null;let l=i.name??``,ee=e.data.user.name,u=ee.includes(`@`)?``:ee.split(` `)[0],d=e.data.organizations.find(e=>e.id===i.id)?.invitedBy?.name,p=a.data?.members.find(t=>t.role===`owner`&&t.userId!==e.data?.user.id)?.name,h=i.role!==`member`,ie=i.slug?`${window.location.host}/studio/${i.slug}`:null;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(se,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsx)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:(0,T.jsx)(ne,{kind:`drop`,size:240,fluffy:!0,coat:`fur`})}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:u?b(`onboard.kicker1`,{name:u}):b(`onboard.kicker1Anon`)}),(0,T.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:b(`welcome.title`,{organization:l})}),(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:d?b(`welcome.invited`,{name:d}):p?b(`welcome.setUp`,{name:p,organization:l}):b(`welcome.plain`)}),(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-[18px] bg-white/12 ring-1 ring-white/20`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3.5 px-4.5 py-3.5`,children:[(0,T.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl font-bold font-display`,style:{background:D,color:E},children:_(l)}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`truncate font-semibold text-[1.0625rem]`,children:l}),ie?(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.8125rem] text-white/75`,children:ie}):null]}),(0,T.jsx)(`span`,{className:`rounded-full bg-white/20 px-2.5 py-1 font-semibold text-[0.75rem]`,children:b(`organization.role.${i.role}`)})]}),r.data?.some(e=>e.wizardCount>0)?r.data.map(e=>(0,T.jsxs)(`div`,{className:`flex justify-between gap-3 border-white/15 border-t px-4.5 py-2.5 text-[0.9375rem]`,children:[(0,T.jsx)(`span`,{className:`truncate`,children:e.name}),(0,T.jsx)(`span`,{className:`shrink-0 text-white/75`,children:b(`welcome.wizards`,{n:e.wizardCount})})]},e.id)):(0,T.jsx)(`p`,{className:`border-white/15 border-t px-4.5 py-3 text-[0.9375rem] text-white/80`,children:b(`welcome.noWizards`)})]}),(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:b(h?`welcome.canBuild`:`welcome.canMember`)}),(0,T.jsx)(`div`,{className:`flex flex-wrap items-center gap-5`,children:(0,T.jsx)(k,{busy:c.isPending,onClick:()=>c.mutate(),children:b(`welcome.go`)})})]})]})]})}function Ne({value:e,onChange:t,suggested:n}){let[r,i]=(0,w.useState)(!1),a=C(e),o=[...new Set([...a?[a.id]:[],...n])].slice(0,4),s=e=>C(e)?.name[y===`de`?`de`:`en`]??e;return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:b(`onboard.sector`)}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.map(n=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":e===n,onClick:()=>t(n),className:c(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,e===n?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:e===n?{color:E}:void 0,children:s(n)},n)),(0,T.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>i(e=>!e),className:`cursor-pointer rounded-full border border-white/40 border-dashed px-4 py-2 text-[0.9375rem] hover:bg-white/15`,children:b(`onboard.sectorOther`)})]}),r?(0,T.jsxs)(`select`,{value:a?e:``,onChange:e=>{t(e.target.value),i(!1)},"aria-label":b(`onboard.sector`),className:c(Te,`[&>option]:text-black`),children:[(0,T.jsx)(`option`,{value:``,children:b(`onboard.sectorPick`)}),[...S].sort((e,t)=>s(e.id).localeCompare(s(t.id),y)).map(e=>(0,T.jsx)(`option`,{value:e.id,children:s(e.id)},e.id))]}):null,a?(0,T.jsxs)(`span`,{className:`text-[0.8125rem] text-white/75`,children:[b(`onboard.sectorHint`),` `,(0,T.jsx)(`b`,{style:{color:D},children:b(`onboard.catalog`,{sector:s(a.id)})})]}):null]})}export{F as OnboardingPage};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$n as r,G as i,Vn as a,Wr as o,_r as s,cn as c,d as l,dr as ee,i as u,ir as d,q as f,u as p,yr as te}from"./ui-CktezodE.js";import{t as m}from"./useMutation-7_FOHoEl.js";import{S as ne,T as h,_ as g,h as re,i as ie,n as _,u as ae}from"./session-CpYa5hwd.js";import{t as oe}from"./upload-CHGCFVZK.js";import{t as v}from"./logo-BpnjXTRy.js";import{n as y,s as b}from"./i18n-0fUKyVRE.js";import{r as se}from"./LangSwitch-BRHbi_Sd.js";var x=new Set([`gmail.com`,`googlemail.com`,`gmx.at`,`gmx.de`,`gmx.net`,`web.de`,`outlook.com`,`hotmail.com`,`live.com`,`icloud.com`,`me.com`,`yahoo.com`,`yahoo.de`,`aon.at`,`a1.net`,`chello.at`,`t-online.de`,`proton.me`,`protonmail.com`]),ce={website:`Website`,blog:`Blog`,linkedin:`LinkedIn`,instagram:`Instagram`,facebook:`Facebook`,youtube:`YouTube`,x:`X`,xing:`XING`,tiktok:`TikTok`},le=[[`linkedin`,/(^|\.)linkedin\.com$/],[`instagram`,/(^|\.)instagram\.com$/],[`facebook`,/(^|\.)(facebook|fb)\.com$/],[`youtube`,/(^|\.)(youtube\.com|youtu\.be)$/],[`x`,/(^|\.)(x|twitter)\.com$/],[`xing`,/(^|\.)xing\.com$/],[`tiktok`,/(^|\.)tiktok\.com$/]];function ue(e){let t=e.trim();if(!t||/\s/.test(t))return null;try{let e=new URL(/^https?:\/\//i.test(t)?t:`https://${t}`);return e.hostname.includes(`.`)?e.href:null}catch{return null}}function de(e){let t=ue(e);if(!t)return`website`;let{hostname:n,pathname:r}=new URL(t),i=n.toLowerCase().replace(/^www\./,``);for(let[e,t]of le)if(t.test(i))return e;return/^blog\./.test(i)||/^\/blog(\/|$)/.test(r)||/(^|\.)(medium|substack)\.com$/.test(i)?`blog`:`website`}var S=[{id:`bakeries`,industry:`gastronomy`,name:{de:`Bäckereien`,en:`Bakeries`},words:[`bäckerei`,`bäcker`,`backstube`,`brot`,`gebäck`,`konditorei`,`bakery`,`bread`,`pastry`]},{id:`cafes`,industry:`gastronomy`,name:{de:`Cafés`,en:`Cafés`},words:[`café`,`cafe`,`kaffeehaus`,`kaffee`,`coffee`,`espresso`]},{id:`restaurants`,industry:`gastronomy`,name:{de:`Restaurants`,en:`Restaurants`},words:[`restaurant`,`gasthaus`,`gasthof`,`wirtshaus`,`pizzeria`,`küche`,`speisekarte`,`menu`,`bistro`]},{id:`hotels`,industry:`hospitality`,name:{de:`Hotels und Pensionen`,en:`Hotels and guesthouses`},words:[`hotel`,`pension`,`zimmer`,`übernachtung`,`ferienwohnung`,`guesthouse`,`booking`,`rooms`]},{id:`architects`,industry:`professional`,name:{de:`Architekturbüros`,en:`Architects`},words:[`architekt`,`architektur`,`planung`,`entwurf`,`architect`,`architecture`]},{id:`lawFirms`,industry:`professional`,name:{de:`Kanzleien`,en:`Law firms`},words:[`rechtsanwalt`,`anwalt`,`kanzlei`,`recht`,`notar`,`law firm`,`lawyer`,`attorney`,`legal`]},{id:`taxAdvisors`,industry:`professional`,name:{de:`Steuerberatung`,en:`Tax advisors`},words:[`steuerberatung`,`steuerberater`,`steuer`,`buchhaltung`,`lohnverrechnung`,`bilanz`,`tax`,`accounting`,`bookkeeping`]},{id:`consultants`,industry:`professional`,name:{de:`Beratung`,en:`Consultants`},words:[`beratung`,`berater`,`consulting`,`coaching`,`consultant`]},{id:`physiotherapy`,industry:`health`,name:{de:`Physiotherapie`,en:`Physiotherapy`},words:[`physiotherapie`,`physio`,`massage`,`therapie`,`physiotherapy`]},{id:`practices`,industry:`health`,name:{de:`Arztpraxen`,en:`Doctors’ practices`},words:[`arzt`,`ärztin`,`praxis`,`ordination`,`zahnarzt`,`doctor`,`clinic`,`dentist`]},{id:`hairdressers`,industry:`retail`,name:{de:`Friseur und Kosmetik`,en:`Hair and beauty`},words:[`friseur`,`frisör`,`kosmetik`,`nagelstudio`,`beauty`,`hairdresser`,`salon`]},{id:`joiners`,industry:`trades`,name:{de:`Tischlereien`,en:`Joiners`},words:[`tischlerei`,`tischler`,`schreiner`,`möbel`,`holz`,`joinery`,`carpenter`,`furniture`]},{id:`electricians`,industry:`trades`,name:{de:`Elektrotechnik`,en:`Electricians`},words:[`elektriker`,`elektro`,`elektrotechnik`,`photovoltaik`,`electrician`,`electrical`]},{id:`plumbing`,industry:`trades`,name:{de:`Installateure`,en:`Plumbing and heating`},words:[`installateur`,`sanitär`,`heizung`,`klima`,`plumber`,`plumbing`,`heating`]},{id:`windows`,industry:`trades`,name:{de:`Fensterbau`,en:`Window makers`},words:[`fenster`,`türen`,`fensterbau`,`sonnenschutz`,`windows`,`doors`]},{id:`construction`,industry:`trades`,name:{de:`Bau und Handwerk`,en:`Building and trades`},words:[`bau`,`baumeister`,`maler`,`dachdecker`,`handwerk`,`construction`,`builder`,`painter`,`roofer`]},{id:`realEstate`,industry:`realEstate`,name:{de:`Immobilien`,en:`Real estate`},words:[`immobilien`,`makler`,`wohnung`,`miete`,`hausverwaltung`,`real estate`,`property`,`estate agent`]},{id:`onlineShops`,industry:`retail`,name:{de:`Online-Shops`,en:`Online shops`},words:[`online-shop`,`onlineshop`,`shop`,`versand`,`e-commerce`,`webshop`,`online store`]},{id:`retail`,industry:`retail`,name:{de:`Handel`,en:`Retail`},words:[`geschäft`,`handel`,`laden`,`boutique`,`retail`,`store`]},{id:`agencies`,industry:`agency`,name:{de:`Agenturen`,en:`Agencies`},words:[`agentur`,`werbung`,`marketing`,`design`,`kommunikation`,`agency`,`advertising`,`branding`]},{id:`photographers`,industry:`agency`,name:{de:`Fotografie`,en:`Photographers`},words:[`fotograf`,`fotografie`,`foto`,`photographer`,`photography`]},{id:`events`,industry:`events`,name:{de:`Veranstaltungen`,en:`Events`},words:[`event`,`veranstaltung`,`hochzeit`,`catering`,`konferenz`,`wedding`,`conference`]},{id:`itServices`,industry:`professional`,name:{de:`IT-Dienstleister`,en:`IT services`},words:[`it-dienstleister`,`it-service`,`software`,`webentwicklung`,`hosting`,`netzwerk`,`development`,`web design`]},{id:`cleaning`,industry:`trades`,name:{de:`Reinigung`,en:`Cleaning`},words:[`reinigung`,`gebäudereinigung`,`putz`,`cleaning`,`janitorial`]},{id:`footballClubs`,industry:`any`,name:{de:`Fußballvereine`,en:`Football clubs`},words:[`fußball`,`fussball`,`fc`,`sv`,`kicker`,`football`,`soccer`]},{id:`sportsClubs`,industry:`any`,name:{de:`Sportvereine`,en:`Sports clubs`},words:[`sportverein`,`verein`,`turnen`,`tennis`,`laufen`,`sport`,`club`]},{id:`musicClubs`,industry:`events`,name:{de:`Musikvereine und Chöre`,en:`Music clubs and choirs`},words:[`musikverein`,`blasmusik`,`chor`,`kapelle`,`orchester`,`band`,`choir`,`music`]},{id:`fireBrigades`,industry:`publicSector`,name:{de:`Feuerwehren`,en:`Fire brigades`},words:[`feuerwehr`,`rettung`,`rotes kreuz`,`fire brigade`,`rescue`]},{id:`schools`,industry:`publicSector`,name:{de:`Schulen und Bildung`,en:`Schools and education`},words:[`schule`,`kurs`,`weiterbildung`,`akademie`,`nachhilfe`,`school`,`course`,`training`]},{id:`municipalities`,industry:`publicSector`,name:{de:`Gemeinden`,en:`Municipalities`},words:[`gemeinde`,`stadt`,`bürgerservice`,`amt`,`municipality`,`council`,`town`]},{id:`associations`,industry:`any`,name:{de:`Vereine und Initiativen`,en:`Associations`},words:[`verein`,`initiative`,`ehrenamt`,`verband`,`association`,`nonprofit`,`charity`]}],C=e=>S.find(t=>t.id===e)??null;function fe(e,t=3){let n=` ${e.toLowerCase().normalize(`NFC`).replace(/[^\p{L}\p{N}-]+/gu,` `)} `;return S.map(e=>({id:e.id,score:e.words.reduce((e,t)=>e+(n.includes(` ${t}`)?Math.min(3,t.length/4):0),0)})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,t).map(e=>e.id)}var w=e(t(),1),T=e(n(),1),pe=`oklch(50% 0.2 262)`,E=`oklch(32% 0.15 262)`,D=`oklch(90% 0.1 80)`,me={"--on":`white`,"--dot":D,"--ink-2":`oklch(96% 0.02 262)`,"--ink-3":`oklch(90% 0.035 262)`,"--moss":`oklch(90% 0.14 150)`,"--rose":`oklch(89% 0.09 45)`},O={kind:1,organization:1,site:2,details:3,know:4,space:5},he=e=>e!==null&&Object.hasOwn(O,e),ge=`w-full rounded-[18px] border border-white/30 bg-white/15 px-6 py-5 text-[1.375rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function _e(){return(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,T.jsx)(v,{size:28}),(0,T.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight`,children:[`engenty`,(0,T.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-(color:--dot)`,children:`.`}),(0,T.jsx)(`span`,{className:`font-normal text-white/70`,children:`wizards`})]})]})}function k({children:e,busy:t,onClick:n,type:r=`button`}){return(0,T.jsxs)(`button`,{type:r,disabled:t,onClick:n,className:`inline-flex h-13 cursor-pointer items-center gap-2.5 rounded-full bg-white px-7 font-semibold text-[1rem] transition hover:bg-white/90 disabled:cursor-default disabled:opacity-70`,style:{color:E},children:[e,(0,T.jsx)(d,{className:`size-[18px]`})]})}function A({children:e,onClick:t}){return(0,T.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer font-semibold text-[0.9375rem] text-white/85 transition hover:text-white`,children:e})}function j({step:e,total:t=4}){return(0,T.jsx)(`span`,{className:`ml-auto inline-flex gap-1.5`,role:`img`,"aria-label":b(`onboard.step`,{n:e,total:t}),children:Array.from({length:t},(e,t)=>t+1).map(t=>(0,T.jsx)(`span`,{className:c(`size-2 rounded-full`,t===e?`bg-white`:`bg-white/40`)},t))})}var ve=[{kind:`personal`,label:`onboard.kindPersonal`,sub:`onboard.kindPersonalSub`},{kind:`club`,label:`onboard.kindClub`,sub:`onboard.kindClubSub`},{kind:`small`,label:`onboard.kindSmall`,sub:`onboard.kindSmallSub`},{kind:`corp`,label:`onboard.kindCorp`,sub:`onboard.kindCorpSub`}];function ye(e){let t=(e.split(`@`)[1]??``).trim().toLowerCase();return t?x.has(t)?{kind:`personal`,domain:t}:/(verein|club|klub|^sv-|^fc-|^ff-|feuerwehr|musik|chor)/.test(t)?{kind:`club`,domain:t}:{kind:`small`,domain:t}:{kind:null,domain:t}}var be={club:[`0-50`,`50-250`,`250-1000`,`1000+`],small:[`1`,`2-9`,`10-49`],corp:[`50-249`,`250-999`,`1000+`]},M=e=>Number(e).toLocaleString(y),xe=e=>{if(e===`1`)return b(`onboard.justMe`);if(e.endsWith(`+`))return`${M(e.slice(0,-1))}+`;let[t,n]=e.split(`-`);return t===`0`?`≤ ${M(n)}`:`${M(t)}–${M(n)}`},Se=[`sport`,`culture`,`social`,`education`,`environment`,`rescue`,`other`],Ce=[`chair`,`board`,`treasurer`,`secretary`,`member`],we=[`management`,`it`,`marketing`,`sales`,`operations`,`other`],Te=`w-full rounded-[14px] border border-white/30 bg-white/15 px-4 py-3 text-[1.0625rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function Ee({picked:e,label:t,sub:n,onClick:r}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:r,className:c(`flex cursor-pointer flex-col gap-1 rounded-[18px] border px-5 py-4 text-left transition`,e?`border-white bg-white/25`:`border-white/30 bg-white/10 hover:bg-white/15`),children:[(0,T.jsx)(`span`,{className:`font-display font-semibold text-[1.125rem]`,children:t}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:n})]})}function N({label:e,options:t,value:n,text:r,onChange:i}){return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:e}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":n===e,onClick:()=>i(e),className:c(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,n===e?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:n===e?{color:E}:void 0,children:r(e)},e))})]})}function P(e,t,n){let r=`${De}${e}:${t}`,[i,a]=(0,w.useState)(()=>{try{let e=sessionStorage.getItem(r);return e===null?n:JSON.parse(e)}catch{return n}});return(0,w.useEffect)(()=>{try{sessionStorage.setItem(r,JSON.stringify(i))}catch{}},[r,i]),[i,a]}var De=`wizards.onboarding:`;function Oe(){try{for(let e of Object.keys(sessionStorage))e.startsWith(De)&&sessionStorage.removeItem(e)}catch{}}function F(){return h(pe),re().data?.onboarding===`welcome`?(0,T.jsx)(Me,{}):(0,T.jsx)(I,{})}function I(){let e=re(),t=o(),n=s(),{space:l}=ae(),u=e.data?.user.id??``,d=e.data?.onboarding===`organization`,p=d?4:5,h=e.data?.startingName?null:e.data?.tenant.name??null,[g,_]=P(u,`organization`,``),[v,x]=P(u,`line`,null),[le,S]=P(u,`ticked`,null),[C,O]=P(u,`own`,[``]),[M,De]=(0,w.useState)(null),[F,I]=(0,w.useState)([]),Me=(0,w.useRef)(null),[Pe]=(0,w.useState)(ie),[B]=(0,w.useState)(()=>d?{kind:null,domain:``}:ye(e.data?.user.email??``)),[V,Fe]=P(u,`profile`,{kind:B.kind,size:null,sector:``,role:null,need:``,questions:``,phone:``}),[Ie,Le]=ee(),H=Ie.get(`page`),U=he(H)&&(H===`kind`||V.kind)&&!(d&&H===`space`)?H:`kind`,W=e=>Le(t=>{let n=new URLSearchParams(t);return n.set(`page`,e),n}),G=e=>Fe(t=>({...t,...e})),K=V.kind===`personal`,q=h??(g.trim()||null),J=te({queryKey:[`onboarding`,`suggest`],queryFn:()=>f.get(`/api/studio/onboarding/suggest`),enabled:!d&&!h&&!!V.kind&&!K,staleTime:1/0}).data?.site??null;(0,w.useEffect)(()=>{J&&!g&&_(J.name)},[J,g,_]);let Re=te({queryKey:[`onboarding`,`find`,q],queryFn:()=>f.post(`/api/studio/onboarding/find`,{name:q,lang:y}),enabled:U===`site`&&!K&&!!q,staleTime:1/0}),Y=Re.data?.addresses??[],X=le??Y.filter((e,t)=>e.kind!==`website`||!Y.slice(0,t).some(e=>e.kind===`website`)).map(e=>e.url),ze=C.map(e=>e.trim()).filter(e=>ue(e)),Z=[...X,...ze],Be=!K&&Re.isSuccess&&Y.length===0,[Ve,He]=P(u,`anyway`,!1),Ue=v!==null||Be&&!ze.length&&!Ve,We=m({mutationFn:()=>f.put(`/api/studio/organization/profile`,{kind:V.kind,size:V.size,sector:V.sector.trim()||null,role:V.role,need:V.need.trim()||null,questions:(V.questions??``).trim()||null,phone:V.phone.trim()||null,website:Z.find(e=>de(e)===`website`)??null,links:Z})}),Ge=m({mutationFn:e=>f.put(`/api/studio/organization`,{name:e})}),Ke=()=>{W(`site`),t.invalidateQueries({queryKey:[`organization`]}),t.invalidateQueries({queryKey:[`me`]})},Q=m({mutationFn:e=>f.post(`/api/studio/spaces/${l?.id}/website`,{urls:e,lang:y}),onSuccess:async e=>{let n=e?.sectors?.[0];n&&Fe(e=>e.sector?e:{...e,sector:n}),De(e??{name:``,about:!1,colors:0,fonts:0,logo:!1,facts:0,assets:0}),await t.invalidateQueries({queryKey:i.spaces()})}}),qe=m({mutationFn:e=>f.patch(`/api/studio/spaces/${l?.id}`,{brand:{about:e}}),onSuccess:()=>t.invalidateQueries({queryKey:i.spaces()})}),$=m({mutationFn:()=>f.post(`/api/studio/onboarding/done`),onSuccess:async()=>{Oe(),await t.invalidateQueries({queryKey:[`me`]}),n(`/new`,{replace:!0})}}),Je=e.data?.user.name??``,Ye=Je.includes(`@`)?``:Je.split(` `)[0],Xe=d&&h?b(`onboard.kickerNew`,{organization:h}):Ye?b(`onboard.kicker1`,{name:Ye}):b(`onboard.kicker1Anon`),Ze=(e,t)=>q&&!K?b(e,{organization:q}):b(t),Qe=async e=>{if(e&&l){for(let t of Array.from(e)){I(e=>[...e,{name:t.name,state:`uploading`}]);try{await f.upload(`/api/studio/spaces/${l.id}/files?kind=document`,t),I(e=>e.map(e=>e.name===t.name?{...e,state:`done`}:e))}catch{I(e=>e.map(e=>e.name===t.name?{...e,state:`failed`}:e))}}await t.invalidateQueries({queryKey:i.spaces()})}},$e=M?[M.about?b(`onboard.readAbout`):``,M.colors?b(`onboard.readColors`,{n:M.colors}):``,M.fonts?b(`onboard.readFonts`,{n:M.fonts}):``,M.logo?b(`onboard.readLogo`):``,M.facts?b(`onboard.readFacts`,{n:M.facts}):``,M.assets?b(`onboard.readAssets`,{n:M.assets}):``].join(``):``,et=[...new Set([...M?.sectors??[],...fe(`${q??``} ${v??``} ${V.questions??``}`,4)])].slice(0,4),tt=e=>`${window.location.host}/studio/${je(e)}`;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(se,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:[(0,T.jsx)(ne,{kind:`drop`,size:240,fluffy:!0,coat:`fur`}),Pe?(0,T.jsxs)(`figure`,{className:`w-full max-w-sm rounded-[18px] bg-white/15 px-5 py-4`,children:[(0,T.jsx)(`figcaption`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:b(`onboard.wish`)}),(0,T.jsx)(`blockquote`,{className:`mt-1.5 line-clamp-6 whitespace-pre-line break-words text-[1rem] leading-relaxed`,children:Pe}),(0,T.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-white/75`,children:b(`onboard.wishNext`)})]}):null]}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[U===`kind`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),V.kind&&W(V.kind===`personal`||h?`site`:`organization`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:b(`onboard.kind`)}),(0,T.jsx)(z,{children:d&&h?b(`onboard.kindSubOrganization`,{organization:h}):b(`onboard.kindSub`)}),B.kind?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:b(`onboard.guess`,{domain:B.domain,kind:b(ve.find(e=>e.kind===B.kind)?.label??`onboard.kindSmall`)})}):null,(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:ve.map(e=>(0,T.jsx)(Ee,{picked:V.kind===e.kind,label:b(e.label),sub:b(e.sub),onClick:()=>G({kind:e.kind,size:e.kind===V.kind?V.size:null})},e.kind))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,children:b(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:p})]})]}):null,U===`organization`?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=g.trim();t?Ge.mutate(t,{onSuccess:Ke}):W(`site`)},children:[(0,T.jsx)(L,{children:Xe}),(0,T.jsx)(R,{children:b(`onboard.organization`)}),(0,T.jsx)(z,{children:b(`onboard.organizationSub`)}),(0,T.jsx)(`input`,{value:g,onChange:e=>_(e.target.value),placeholder:b(`onboard.organizationPlaceholder`),maxLength:80,"aria-label":b(`onboard.organization`),className:ge}),g.trim()?(0,T.jsxs)(`p`,{className:`-mt-2 text-[0.9375rem] text-white/85`,children:[J&&g===J.name?`${b(`onboard.nameFrom`,{domain:new URL(J.url).host})} `:``,b(`onboard.address`),` `,(0,T.jsx)(`span`,{className:`font-mono text-[0.875rem]`,style:{color:D},children:tt(g)})]}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:Ge.isPending,children:b(`onboard.continue`)}),(0,T.jsx)(j,{step:1,total:p})]})]}):null,U===`site`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:K?b(`onboard.kicker2Personal`):Ze(`onboard.kicker2Named`,`onboard.kicker2`)}),(0,T.jsx)(R,{children:K?b(`onboard.linksPersonal`):Be&&!Ve&&q?b(`onboard.noneFound`,{name:q}):q?b(`onboard.siteNamed`,{organization:q}):b(`onboard.site`)}),(0,T.jsx)(z,{children:K?b(`onboard.linksPersonalSub`):Be&&!Ve&&q?b(`onboard.noneFoundSub`,{name:q}):Re.isPending?b(`onboard.searching`,{name:q??``}):b(`onboard.foundSub`)}),Ue?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=(v??``).trim();t?qe.mutate(t,{onSuccess:()=>W(`details`)}):W(`details`)},children:[(0,T.jsx)(ke,{value:v??``,onChange:x,rows:4,label:b(`onboard.line`),placeholder:b(K?`onboard.linePlaceholderPersonal`:`onboard.linePlaceholder`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>{x(null),He(!0),O(e=>e.length?e:[``])},className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,b(`onboard.addressAfterAll`)]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:qe.isPending,children:b(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:b(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:p})]})]}):(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),M?W(`details`):Z.length&&!Q.isPending&&Q.mutate(Z)},children:[Y.length?(0,T.jsx)(`div`,{className:`flex flex-col gap-2`,children:Y.map(e=>(0,T.jsx)(Ae,{address:e,picked:X.includes(e.url),onToggle:()=>S(X.includes(e.url)?X.filter(t=>t!==e.url):[...X,e.url])},e.url))}):null,!K&&Y.length?(0,T.jsx)(`p`,{className:`-mb-2 text-[0.9375rem] text-white/85`,children:b(`onboard.own`)}):null,C.map((e,t)=>(0,T.jsxs)(`div`,{className:`relative`,children:[(0,T.jsx)(`input`,{value:e,onChange:e=>O(n=>n.map((n,r)=>r===t?e.target.value:n)),placeholder:b(K?`onboard.linkPlaceholderPersonal`:`onboard.ownPlaceholder`),autoCapitalize:`none`,"aria-label":b(`onboard.own`),className:c(Te,`pr-28`)}),ue(e)?(0,T.jsx)(`span`,{className:`-translate-y-1/2 absolute top-1/2 right-3 rounded-full bg-white/20 px-2.5 py-0.5 font-semibold text-[0.75rem]`,children:ce[de(e)]}):null]},t)),C.length+Y.length<10?(0,T.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>[...e,``]),className:`-mt-1 cursor-pointer self-start font-semibold text-[0.9375rem] text-white/85 hover:text-white`,children:[`+ `,b(`onboard.addAddress`)]}):null,M?(0,T.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.9375rem] text-(color:--moss)`,children:[(0,T.jsx)(r,{className:`size-4`}),M.name?b(`onboard.readDone`,{name:M.name,details:$e}):b(`onboard.readKept`,{n:Z.length})]}):Q.isError?(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-(color:--rose)`,children:b(`onboard.readFailed`)}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[M?(0,T.jsx)(k,{type:`submit`,children:b(`onboard.continue`)}):(0,T.jsx)(k,{type:`submit`,busy:Q.isPending,children:Q.isPending?b(`onboard.reading`):b(`onboard.read`)}),(0,T.jsx)(A,{onClick:()=>x(``),children:b(`onboard.line`)}),(0,T.jsx)(A,{onClick:()=>W(`details`),children:b(`onboard.skip`)}),(0,T.jsx)(j,{step:2,total:p})]})]})]}):null,U===`details`&&V.kind?(0,T.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),We.mutate(),W(`know`)},children:[(0,T.jsx)(L,{children:K||!q?Xe:q}),(0,T.jsx)(R,{small:!0,children:K?b(`onboard.personalTitle`):q?b(`onboard.aboutOrganization`,{organization:q}):b(V.kind===`club`?`onboard.clubTitle`:`onboard.businessTitle`)}),K?(0,T.jsx)(ke,{value:V.need,onChange:e=>G({need:e}),rows:4,label:b(`onboard.personalTitle`),placeholder:b(`onboard.personalPlaceholder`)}):null,V.kind===`club`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:b(`onboard.clubKind`),options:Se,value:V.sector,text:e=>b(`onboard.club.${e}`),onChange:e=>G({sector:e})}),(0,T.jsx)(N,{label:b(`onboard.members`),options:be.club,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(N,{label:b(`onboard.yourRole`),options:Ce,value:V.role,text:e=>b(`onboard.role.${e}`),onChange:e=>G({role:e})})]}):null,V.kind===`small`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:b(`onboard.people`),options:be.small,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et})]}):null,V.kind===`corp`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(N,{label:b(`onboard.people`),options:be.corp,value:V.size,text:xe,onChange:e=>G({size:e})}),(0,T.jsx)(Ne,{value:V.sector,onChange:e=>G({sector:e}),suggested:et}),(0,T.jsx)(N,{label:b(`onboard.yourRole`),options:we,value:V.role,text:e=>b(`onboard.role.${e}`),onChange:e=>G({role:e})}),(0,T.jsxs)(`label`,{className:`flex flex-col gap-2 text-[0.9375rem] text-white/85`,children:[(0,T.jsxs)(`span`,{children:[b(`onboard.phone`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:b(`onboard.phoneWhy`)})]}),(0,T.jsx)(`input`,{type:`tel`,value:V.phone,onChange:e=>G({phone:e.target.value.replace(/[^+0-9 ()/.-]/g,``)}),placeholder:`+43 …`,maxLength:40,autoComplete:`tel`,className:Te})]})]}):null,K?null:(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,T.jsxs)(`span`,{className:`text-[0.9375rem] text-white/85`,children:[b(`onboard.questions`),` `,(0,T.jsx)(`span`,{className:`text-white/60`,children:b(`onboard.optional`)})]}),(0,T.jsx)(ke,{value:V.questions??``,onChange:e=>G({questions:e}),rows:3,label:b(`onboard.questions`),placeholder:b(`onboard.questionsPlaceholder`)}),(0,T.jsx)(`span`,{className:`text-[0.8125rem] text-white/70`,children:b(`onboard.questionsHint`)})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{type:`submit`,busy:We.isPending,children:b(`onboard.continue`)}),(0,T.jsx)(A,{onClick:()=>window.history.state?.idx>0?n(-1):W(`site`),children:b(`onboard.back`)}),(0,T.jsx)(j,{step:3,total:p})]})]}):null,U===`know`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker3Named`,`onboard.kicker3`)}),(0,T.jsx)(R,{children:b(`onboard.know`)}),(0,T.jsx)(z,{children:b(`onboard.knowSub`)}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>Me.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),Qe(e.dataTransfer.files)},className:`flex cursor-pointer flex-col items-center gap-2 rounded-[18px] border-2 border-white/45 border-dashed bg-white/10 px-6 py-7 text-center transition hover:bg-white/15`,children:[(0,T.jsx)(oe,{className:`size-7`}),(0,T.jsx)(`span`,{className:`font-semibold text-[1.0625rem]`,children:b(`onboard.drop`)}),(0,T.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:`PDF · Word · Excel · Markdown`}),(0,T.jsx)(`input`,{ref:Me,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{Qe(e.target.files),e.target.value=``}})]}),F.length?(0,T.jsx)(`ul`,{className:`flex flex-col gap-2`,children:F.map(e=>(0,T.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-xl bg-white/15 px-3.5 py-2.5 text-[0.875rem]`,children:[(0,T.jsx)(a,{className:`size-4 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,T.jsx)(`span`,{className:c(`text-white/80`,e.state===`failed`?`text-(color:--rose)`:``),children:e.state===`uploading`?b(`onboard.uploading`):e.state===`done`?b(`onboard.uploaded`):b(`onboard.uploadFailed`)})]},e.name))}):null,(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:F.some(e=>e.state===`uploading`)||$.isPending,onClick:()=>d?$.mutate():W(`space`),children:b(d?`onboard.buildFirst`:`onboard.continue`)}),F.length||d?null:(0,T.jsx)(A,{onClick:()=>W(`space`),children:b(`onboard.skip`)}),(0,T.jsx)(j,{step:4,total:p})]})]}):null,U===`space`&&!d?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(L,{children:Ze(`onboard.kicker4Named`,`onboard.kicker4`)}),(0,T.jsx)(R,{children:q&&!K?b(`onboard.spaceNamed`,{organization:q}):b(`onboard.space`)}),(0,T.jsx)(z,{children:b(`onboard.spaceSub`,{space:l?.name??``})}),(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[[`partInfo`,`partInfoText`,!!(M||v)],[`partKnow`,`partKnowText`,F.some(e=>e.state===`done`)],[`partData`,`partDataText`,!1],[`partResults`,`partResultsText`,!1]].map(([e,t,n])=>(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-2xl border border-white/20 bg-white/10 px-4.5 py-4`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-2 font-semibold text-[1rem]`,children:[n?(0,T.jsx)(r,{className:`size-4 text-(color:--moss)`}):null,b(`onboard.${e}`)]}),(0,T.jsx)(`span`,{className:`text-[0.84375rem] text-white/85 leading-snug`,children:b(`onboard.${t}`)})]},e))}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,T.jsx)(k,{busy:$.isPending,onClick:()=>$.mutate(),children:b(`onboard.build`)}),(0,T.jsx)(j,{step:5,total:p})]})]}):null]},U)]}),(0,T.jsxs)(`footer`,{className:`mx-auto flex w-full max-w-6xl items-center justify-between pb-6 text-[0.75rem] text-white/55 sm:pb-8`,children:[(0,T.jsx)(`span`,{children:`engenty.wizards`}),(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px] bg-(color:--dot)`})]})]})}function L({children:e}){return(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:e})}function R({children:e,small:t}){return(0,T.jsx)(`h1`,{className:c(`font-display font-bold leading-[1.05] tracking-[-0.02em]`,t?`text-[2.25rem] sm:text-[2.75rem]`:`text-[2.5rem] sm:text-[3.25rem]`),children:e})}function z({children:e}){return(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:e})}function ke({value:e,onChange:t,rows:n,label:r,placeholder:i}){let[a]=l(),o=p(e,t,{deviceId:a.deviceId});return(0,T.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[18px] border border-white/30 bg-white/15 px-4 pt-3 pb-3 focus-within:border-white/60`,children:[(0,T.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),placeholder:o.listening?b(`editor.listening`):i,rows:n,maxLength:4e3,"aria-label":r,className:`w-full resize-none bg-transparent text-[1.0625rem] text-white leading-relaxed outline-none placeholder:text-white/55`}),o.supported?(0,T.jsx)(`div`,{className:`self-end`,style:{"--ink":`white`,"--border":`rgb(255 255 255 / 0.55)`},children:(0,T.jsx)(u,{speech:o,labelled:!0})}):null]})}function Ae({address:e,picked:t,onToggle:n}){return(0,T.jsxs)(`button`,{type:`button`,"aria-pressed":t,onClick:n,className:c(`flex cursor-pointer items-center gap-3.5 rounded-[14px] border px-4 py-2.5 text-left transition`,t?`border-white bg-white/22`:`border-white/30 bg-white/8 hover:bg-white/12`),children:[(0,T.jsx)(`span`,{className:c(`flex size-5 shrink-0 items-center justify-center rounded-md border-2`,t?`border-white bg-white`:`border-white/60`),style:t?{color:E}:void 0,children:t?(0,T.jsx)(r,{className:`size-3.5`,strokeWidth:3}):null}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`font-semibold text-[0.6875rem] text-white/70 uppercase tracking-[0.1em]`,children:ce[e.kind]}),(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.9375rem]`,children:e.url.replace(/^https?:\/\/(www\.)?/,``).replace(/\/$/,``)}),(0,T.jsx)(`span`,{className:`truncate text-[0.8125rem] text-white/80`,children:e.title})]}),(0,T.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-white/70 max-sm:hidden`,children:b(e.source===`email`?`onboard.fromEmail`:`onboard.fromWeb`)})]})}function je(e){return e.toLowerCase().replace(/['’]/g,``).replace(/ä/g,`ae`).replace(/ö/g,`oe`).replace(/ü/g,`ue`).replace(/ß/g,`ss`).normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,35).replace(/-+$/,``)}function Me(){let e=re(),t=o(),n=s(),r=g(),i=e.data?.tenant,a=te({queryKey:[`organization`,i?.id],queryFn:()=>f.get(`/api/studio/organization`),enabled:!!i}),c=m({mutationFn:()=>f.post(`/api/studio/onboarding/done`),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`me`]}),n(`/`,{replace:!0})}});if(!(e.data&&i))return null;let l=i.name??``,ee=e.data.user.name,u=ee.includes(`@`)?``:ee.split(` `)[0],d=e.data.organizations.find(e=>e.id===i.id)?.invitedBy?.name,p=a.data?.members.find(t=>t.role===`owner`&&t.userId!==e.data?.user.id)?.name,h=i.role!==`member`,ie=i.slug?`${window.location.host}/studio/${i.slug}`:null;return(0,T.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...me,background:pe},children:[(0,T.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,T.jsx)(_e,{}),(0,T.jsx)(se,{tone:`ground`,ink:E})]}),(0,T.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,T.jsx)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:(0,T.jsx)(ne,{kind:`drop`,size:240,fluffy:!0,coat:`fur`})}),(0,T.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[(0,T.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:u?b(`onboard.kicker1`,{name:u}):b(`onboard.kicker1Anon`)}),(0,T.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:b(`welcome.title`,{organization:l})}),(0,T.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:d?b(`welcome.invited`,{name:d}):p?b(`welcome.setUp`,{name:p,organization:l}):b(`welcome.plain`)}),(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-[18px] bg-white/12 ring-1 ring-white/20`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3.5 px-4.5 py-3.5`,children:[(0,T.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl font-bold font-display`,style:{background:D,color:E},children:_(l)}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsx)(`span`,{className:`truncate font-semibold text-[1.0625rem]`,children:l}),ie?(0,T.jsx)(`span`,{className:`truncate font-mono text-[0.8125rem] text-white/75`,children:ie}):null]}),(0,T.jsx)(`span`,{className:`rounded-full bg-white/20 px-2.5 py-1 font-semibold text-[0.75rem]`,children:b(`organization.role.${i.role}`)})]}),r.data?.some(e=>e.wizardCount>0)?r.data.map(e=>(0,T.jsxs)(`div`,{className:`flex justify-between gap-3 border-white/15 border-t px-4.5 py-2.5 text-[0.9375rem]`,children:[(0,T.jsx)(`span`,{className:`truncate`,children:e.name}),(0,T.jsx)(`span`,{className:`shrink-0 text-white/75`,children:b(`welcome.wizards`,{n:e.wizardCount})})]},e.id)):(0,T.jsx)(`p`,{className:`border-white/15 border-t px-4.5 py-3 text-[0.9375rem] text-white/80`,children:b(`welcome.noWizards`)})]}),(0,T.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:b(h?`welcome.canBuild`:`welcome.canMember`)}),(0,T.jsx)(`div`,{className:`flex flex-wrap items-center gap-5`,children:(0,T.jsx)(k,{busy:c.isPending,onClick:()=>c.mutate(),children:b(`welcome.go`)})})]})]})]})}function Ne({value:e,onChange:t,suggested:n}){let[r,i]=(0,w.useState)(!1),a=C(e),o=[...new Set([...a?[a.id]:[],...n])].slice(0,4),s=e=>C(e)?.name[y===`de`?`de`:`en`]??e;return(0,T.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,T.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:b(`onboard.sector`)}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o.map(n=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":e===n,onClick:()=>t(n),className:c(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,e===n?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:e===n?{color:E}:void 0,children:s(n)},n)),(0,T.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>i(e=>!e),className:`cursor-pointer rounded-full border border-white/40 border-dashed px-4 py-2 text-[0.9375rem] hover:bg-white/15`,children:b(`onboard.sectorOther`)})]}),r?(0,T.jsxs)(`select`,{value:a?e:``,onChange:e=>{t(e.target.value),i(!1)},"aria-label":b(`onboard.sector`),className:c(Te,`[&>option]:text-black`),children:[(0,T.jsx)(`option`,{value:``,children:b(`onboard.sectorPick`)}),[...S].sort((e,t)=>s(e.id).localeCompare(s(t.id),y)).map(e=>(0,T.jsx)(`option`,{value:e.id,children:s(e.id)},e.id))]}):null,a?(0,T.jsxs)(`span`,{className:`text-[0.8125rem] text-white/75`,children:[b(`onboard.sectorHint`),` `,(0,T.jsx)(`b`,{style:{color:D},children:b(`onboard.catalog`,{sector:s(a.id)})})]}):null]})}export{F as OnboardingPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$n as r,$t as i,B as a,G as o,H as s,Jt as c,Kt as l,Nn as u,On as d,Pn as f,Pr as p,Qn as m,Qt as h,Sn as g,Tn as _,V as v,Vn as y,Wr as b,Xn as x,Xt as S,Yt as C,Zt as w,_r as T,an as E,ar as D,b as O,cn as k,fn as A,h as j,ht as M,ln as N,mn as ee,nn as P,pn as F,q as I,qt as L,rn as R,sn as te,sr as z,tn as B,wn as V,xn as ne,xt as re,y as H,yn as U,yr as W,yt as ie,zt as ae}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$n as r,$t as i,B as a,G as o,H as s,Jt as c,Kt as l,Nn as u,On as d,Pn as f,Pr as p,Qn as m,Qt as h,Sn as g,Tn as _,V as v,Vn as y,Wr as b,Xn as x,Xt as S,Yt as C,Zt as w,_r as T,an as E,ar as D,b as O,cn as k,fn as A,h as j,ht as M,ln as N,mn as ee,nn as P,pn as F,q as I,qt as L,rn as R,sn as te,sr as z,tn as B,wn as V,xn as ne,xt as re,y as H,yn as U,yr as W,yt as ie,zt as ae}from"./ui-CktezodE.js";import{_ as oe}from"./Marketplace-CS7JTgiv.js";import{t as G}from"./useMutation-7_FOHoEl.js";import{C as K,Dt as se,E as q,Gt as ce,It as le,S as ue,T as de,an as fe,b as pe,qt as me,v as he,w as ge,x as _e,y as ve,z as ye}from"./host-Bd_bon_c.js";import{i as be}from"./volume-2-Bw5KASy8.js";import{t as xe}from"./eye-CgkvVlba.js";import{b as Se,d as Ce,f as we,p as Te,r as Ee,t as De}from"./theme-Bj3wNQR0.js";import{N as Oe,P as ke,S as Ae,h as je}from"./session-CpYa5hwd.js";import{t as Me}from"./upload-CHGCFVZK.js";import{$ as Ne,Q as Pe,ft as Fe,h as Ie,n as J,q as Le,s as Y,ut as Re}from"./i18n-0fUKyVRE.js";import{a as ze,i as Be,n as Ve,o as He,r as Ue}from"./index-DOgwxnto.js";import{t as We}from"./code-editor-BpCEnf8H.js";import{t as Ge}from"./runners-BoPaPsjN.js";var Ke={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Ke.node;var qe=z(Ke),Je={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};Je.node;var Ye=z(Je),Xe={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Xe.node;var Ze=z(Xe),Qe={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};Qe.node;var $e=z(Qe),et={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};et.node;var tt=z(et),nt={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};nt.node;var rt=z(nt),it={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};it.node;var at=z(it),ot={name:`panel-right-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]};ot.node;var st=z(ot),ct={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ct.node;var lt=z(ct),ut={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};ut.node;var dt=z(ut),ft={name:`toggle-left`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};ft.node;var pt=z(ft),mt={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};mt.node;var ht=z(mt),X=e(n(),1),Z=e(t(),1);function gt(e){return W({queryKey:[`share-targets`,e,J],queryFn:()=>I.get(`/api/studio/wizards/${e}/share-targets?lang=${J}`),enabled:!!e,staleTime:6e4})}var _t=(0,Z.createContext)(null);function vt(e){return e.share?e.share.length?`own`:`off`:`default`}var yt=e=>e.byDefault&&e.usable;function bt(e,t){let n=vt(e),r=e.share??[],i=new Map,a=e=>{let t=i.get(e)??0;return i.set(e,t+1),`${e}#${t}`},o=e=>({key:a(e.id),target:e.id,info:e,index:null,option:null,on:!1,name:e.name});if(n==="default")return{mode:n,rows:t.filter(yt).map(e=>({...o(e),on:!0})),unset:t.filter(e=>e.byDefault&&!e.usable)};let s=r.map((e,n)=>{let r=t.find(t=>t.id===e.target);return{key:a(e.target),target:e.target,info:r,index:n,option:e,on:!0,name:e.label||r?.name||e.target}}),c=new Set(r.map(e=>e.target));return s.push(...t.filter(e=>yt(e)&&!c.has(e.id)).map(o)),{mode:n,rows:s,unset:t.filter(e=>e.byDefault&&!e.usable&&!c.has(e.id))}}function xt(e,t){let n=t.filter(e=>e.on&&e.info?.usable);return{visitors:n.filter(t=>!(e==="default"&&t.info?.agent)),onlyYou:e==="default"?n.filter(e=>e.info?.agent):[],broken:t.filter(e=>e.on&&!e.info?.usable)}}function St(e){return e.filter(e=>yt(e)&&!e.agent).map(e=>({target:e.id}))}function Ct(e,t){let n=vt(e);return n===`own`?e.share??[]:n==="default"?St(t):[]}function wt(e,t,n,r){let i=Ct(e,t);return r?[...i,{target:n.target}]:n.index===null?i.filter(e=>e.target!==n.target):i.filter((e,t)=>t!==n.index)}function Tt(e,t,n,r){let i=Ct(e,t),a=n.index??i.findIndex(e=>e.target===n.target);return a===-1?[...i,r]:i.map((e,t)=>t===a?r:e)}function Et(e,t,n){return[...Ct(e,t),{target:n}]}function Dt(e,t){let n=new Set(e.map(e=>e.target));return t.filter(e=>e.usable&&!e.byDefault&&!n.has(e.id))}function Ot(e,t){let n=e.steps.slice(0,e.steps.indexOf(t));return[...n.flatMap(e=>e.type===`page`?e.fields.filter(e=>e.kind!==`image`&&e.kind!==`file`&&e.kind!==`signature`).map(e=>({ref:e.id,label:e.label})):[]),...n.flatMap(e=>e.type===`agent`&&e.output.format!==`json`?[{ref:`steps.${e.id}`,label:e.title}]:[]),{ref:`brand.name`,label:Y(`shareEditor.brandName`)}]}function kt(e){return new Intl.ListFormat(J===`en`?`en-GB`:J,{style:`long`,type:`conjunction`}).format(e)}var At=(e,t)=>`${e}/${t}`;function jt(e,t,n){if(e.endsWith(`.localhost`)){let r=n&&URL.canParse(n)?new URL(n).port:``;return`http://${e}${r?`:${r}`:``}/${t}`}return`https://${e}/${t}`}var Mt=e=>e.lang===`en`?`en`:e.form===`sie`?`de-sie`:`de-du`;function Nt(e){return e===`en`?{lang:`en`}:{lang:`de`,form:e===`de-sie`?`sie`:`du`}}function Pt(e,t,n){let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;let o=[];for(let e=0;e<r;e++)o.push([e,e]);let s=i-r,c=a-r;if(s>0&&c>0){let i=s+c,a=i,l=new Int32Array(2*i+2),u=[],d=!1;for(let o=0;o<=i&&o<=n;o++){u.push(l.slice());for(let n=-o;n<=o;n+=2){let i=n===-o||n!==o&&l[a+n-1]<l[a+n+1]?l[a+n+1]:l[a+n-1]+1,u=i-n;for(;i<s&&u<c&&e[r+i]===t[r+u];)i++,u++;if(l[a+n]=i,i>=s&&u>=c){d=!0;break}}if(d)break}if(!d)return null;let f=[],p=s,m=c;for(let e=u.length-1;e>=0&&(p>0||m>0);e--){let t=u[e],n=p-m,i=n===-e||n!==e&&t[a+n-1]<t[a+n+1]?n+1:n-1,o=e===0?0:t[a+i],s=o-i;for(;p>o&&m>s;)p--,m--,f.push([r+p,r+m]);e>0&&(p=o,m=s)}o.push(...f.reverse())}for(let t=0;t<e.length-i;t++)o.push([i+t,a+t]);return o}var Ft=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),It=4e3;function Lt(e,t,n){if(t===n||n===e)return{text:t,clean:!0,conflicts:0};if(t===e)return{text:n,clean:!0,conflicts:0};let r=e.split(`
|
|
2
2
|
`),i=t.split(`
|
|
3
3
|
`),a=n.split(`
|
|
4
4
|
`),o=Pt(r,i,It),s=Pt(r,a,It);if(!o||!s)return{text:t,clean:!1,conflicts:1};let c=new Map(o.map(([e,t])=>[e,t])),l=new Map(s.map(([e,t])=>[e,t])),u=[],d=0,f=0,p=0,m=0,h=(e,t,n)=>{let o=r.slice(f,e),s=i.slice(p,t),c=a.slice(m,n);Ft(s,o)?u.push(...c):(Ft(c,o)||Ft(s,c)||d++,u.push(...s))};for(let e=0;e<r.length;e++){let t=c.get(e),n=l.get(e);t===void 0||n===void 0||t<p||n<m||(h(e,t,n),u.push(r[e]),f=e+1,p=t+1,m=n+1)}return h(r.length,i.length,a.length),{text:u.join(`
|