import{C as e,D as t,G as n,L as r,Q as i,R as a,W as o,Z as s,_ as c,a as l,b as u,et as d,k as f,m as p,o as m,r as h,tt as g,v as _,w as v,x as y}from"./app-ae3zsclI.js";import{t as b}from"./i18n-M94zPSoE.js";import{t as x}from"./AppLayout-E6S09nb5.js";var S={class:`mx-auto max-w-2xl`},C={class:`flex items-center justify-between`},w={class:`text-xs font-bold uppercase tracking-wide text-primary`},T={href:`/panel/order`,class:`text-sm font-semibold text-primary hover:text-primary-600`},E={class:`mt-1 text-2xl font-black tracking-tight`},D={class:`mt-1 text-sm text-ink-2`},O={key:0,class:`mt-4 rounded-lg border border-primary/30 bg-primary/[0.06] px-4 py-2.5 text-sm font-medium text-ink`},k=[`placeholder`],A=[`disabled`],j={class:`mt-6 space-y-3`},M={class:`flex flex-wrap items-center gap-2`},N={class:`font-bold text-ink`},P={class:`text-xs text-ink-muted`},F={key:0,class:`ml-auto flex items-center gap-2`},I=[`href`],L=[`onClick`],R={key:0,class:`mt-1 text-sm text-rose-500`},z={key:1,class:`mt-2 grid gap-1.5 text-sm text-ink-2`},B={class:`flex items-center gap-2`},V={class:`flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-ink-muted`},H={class:`font-mono`},U={key:0,class:`rounded-c border border-dashed border-line py-10 text-center text-sm text-ink-muted`},W={class:`mt-6 text-xs leading-relaxed text-ink-muted`},G=f({__name:`Panel`,props:{tenants:{},account:{}},setup(f){let G=l({name:``});function K(){G.post(`/panel/communities`,{preserveScroll:!0,onSuccess:()=>G.reset(`name`)})}let q=u(()=>m().props.flash?.status),J={active:`bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`,provisioning:`bg-amber-500/15 text-amber-600 dark:text-amber-400`,failed:`bg-rose-500/15 text-rose-600 dark:text-rose-400`};return(l,u)=>(r(),v(_,null,[t(s(h),{title:s(b)(`Managed hosting`)},null,8,[`title`]),t(x,null,{default:o(()=>[y(`div`,S,[y(`div`,C,[y(`span`,w,d(s(b)(`Proof of concept`)),1),y(`a`,T,d(s(b)(`View plans →`)),1)]),y(`h1`,E,d(s(b)(`Your communities`)),1),y(`p`,D,d(s(b)(`Signed in as {name} ({email}). Spin up a hosted community — you’re made its admin automatically, with the same Convoro Account.`,{name:f.account.name,email:f.account.email})),1),q.value?(r(),v(`div`,O,d(q.value),1)):e(``,!0),y(`form`,{class:`mt-5 flex flex-wrap gap-2 rounded-c border border-line bg-surface p-4`,onSubmit:c(K,[`prevent`])},[n(y(`input`,{"onUpdate:modelValue":u[0]||=e=>s(G).name=e,type:`text`,maxlength:`60`,placeholder:s(b)(`Community name, e.g. Acme Makers`),class:`min-w-[220px] flex-1 rounded-lg border-line bg-surface-2 text-sm text-ink placeholder:text-ink-muted focus:border-primary focus:ring-primary`},null,8,k),[[p,s(G).name]]),y(`button`,{type:`submit`,disabled:s(G).processing||!s(G).name.trim(),class:`rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-white shadow-lg shadow-primary/30 hover:bg-primary-600 disabled:opacity-50`},d(s(G).processing?s(b)(`Provisioning…`):s(b)(`Create community`)),9,A)],32),y(`div`,j,[(r(!0),v(_,null,a(f.tenants,t=>(r(),v(`div`,{key:t.id,class:`rounded-c border border-line bg-surface p-4`},[y(`div`,M,[y(`h2`,N,d(t.name),1),y(`span`,{class:i([`rounded px-1.5 py-0.5 text-[10px] font-bold uppercase`,J[t.status]])},d(t.status),3),y(`span`,P,d(t.createdAgo),1),t.status===`active`?(r(),v(`div`,F,[y(`a`,{href:`/panel/communities/${t.id}/manage`,class:`rounded-lg border border-line bg-surface px-3 py-1.5 text-xs font-semibold text-ink-2 hover:bg-surface-2`},d(s(b)(`Manage`)),9,I),y(`button`,{type:`button`,class:`rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-white hover:bg-primary-600`,onClick:e=>s(g).post(`/panel/communities/${t.id}/enter`)},d(s(b)(`Open community →`)),9,L)])):e(``,!0)]),t.error?(r(),v(`p`,R,d(t.error),1)):e(``,!0),t.status===`active`?(r(),v(`div`,z,[y(`div`,B,[u[1]||=y(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,class:`text-emerald-500`},[y(`path`,{d:`M20 6 9 17l-5-5`,"stroke-linecap":`round`,"stroke-linejoin":`round`})],-1),y(`span`,null,d(s(b)(`You are an admin here`)),1),u[2]||=y(`span`,{class:`text-ink-muted`},`·`,-1),(r(!0),v(_,null,a(t.admins,e=>(r(),v(`span`,{key:e,class:`font-mono text-xs text-ink-muted`},d(e),1))),128))]),y(`div`,V,[y(`span`,null,d(s(b)(`{n} member(s)`,{n:t.users})),1),y(`span`,null,d(s(b)(`{n} categorie(s) seeded`,{n:t.categories})),1),y(`span`,H,d(s(b)(`isolated DB:`))+` `+d(t.database),1)])])):e(``,!0)]))),128)),f.tenants.length?e(``,!0):(r(),v(`p`,U,d(s(b)(`No communities yet — create one above.`)),1))]),y(`p`,W,d(s(b)(`POC scope: each community is provisioned into its own isolated database, the full forum schema is migrated, base content is seeded, and your Convoro Account is set as admin. Production adds a deploy + DNS step (a real subdomain) and SSO so this same login works across the support forums too.`)),1)])]),_:1})],64))}});export{G as default};