import{i as b}from"./metadata-Dox04t5g.js";import{W as x}from"./Watermark-D2zHvRKy.js";import{P}from"./PageStageView-CnyrhD6f.js";import{F as C}from"./PhArrowSquareOut.vue-B9YappLN.js";import{L as I}from"./CircularLoading-CjXNFRbA.js";import{e as D,r as f,n as T,b as N,f as p,j as z,v as r,s as e,x as i,at as _,q as l,T as h,U as k,K as F,aR as v,X as L,Y as S,N as H,g as t,F as V,aS as B,ar as W}from"./jwt-decode.esm-CX61wVx3.js";import{u as j,f as E}from"./workspaceStore-QlTT1mu8.js";import{C as R}from"./index-GnIaed8S.js";import{L as $}from"./LoadingOutlined-CVkBHrpy.js";import"./PhWebhooksLogo.vue-CkLqDVcc.js";import"./PhHouse.vue-CqaxhGyx.js";import"./PhMagnifyingGlass.vue-C4JZlKTc.js";import"./constants-B5rys1IL.js";import"./userStore-C3Z0vN5p.js";import"./linkInterceptor-DeEo1UFM.js";import"./runnerData-B4AKypWD.js";import"./url-D1jI6Lt8.js";import"./colorHelpers-Dde0Xcnl.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[c]="f3d64ded-edfe-4bda-9e94-068589c359af",n._sentryDebugIdIdentifier="sentry-dbid-f3d64ded-edfe-4bda-9e94-068589c359af")}catch{}})();const q={key:0,class:"home-container"},A={key:1,class:"page-wrapper"},K={key:2,class:"home-container"},M=D({__name:"Home",setup(n){const c=H(),a=j(),m=f(!0),u=f(null);T(async()=>{try{const o=await E();if(o?.type==="page"){u.value=o.data,a.state.currentPageType="page";return}a.state.currentPageType=null,await a.actions.fetchIfNeeded()}catch{a.state.currentPageType=null,await a.actions.fetchIfNeeded()}finally{m.value=!1}});const g=N(()=>a.state.workspace?.sidebar.filter(o=>o.id!=="home")||[]),d=f(null),w=async(o,y)=>{d.value=y,await c.push({path:`/${o}`}),d.value=null};return(o,y)=>m.value?(t(),p("div",q,[r(I)])):u.value?(t(),p("div",A,[r(P,{"ui-data":u.value},null,8,["ui-data"])])):e(a).state.workspace?(t(),p("div",K,[r(e(_),{vertical:"",gap:"large",class:"cards-container"},{default:i(()=>[g.value.length===0?(t(),l(e(v),{key:0,type:"secondary",style:{"font-size":"18px"}},{default:i(()=>[h(k(e(F).translate("i18n_home_no_forms_available")),1)]),_:1})):(t(!0),p(L,{key:1},S(g.value,s=>(t(),l(e(R),{key:s.id,class:V(["form-card",{loading:d.value===s.id}]),"body-style":{cursor:"pointer"},onClick:O=>w(s.path,s.id)},{default:i(()=>[r(e(_),{gap:"large",align:"center",justify:"space-between"},{default:i(()=>[(t(),l(B(e(b)(s.type)),{style:{"flex-shrink":"0",width:"22px",height:"18px"}})),r(e(v),{style:{"font-size":"18px","font-weight":"500"}},{default:i(()=>[h(k(s.name),1)]),_:2},1024),d.value!==s.id?(t(),l(e(C),{key:0,size:"20"})):(t(),l(e($),{key:1,style:{"font-size":"20px"}}))]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1}),r(x,{class:"watermark","page-id":"home",locale:e(a).state.workspace.language},null,8,["locale"])])):z("",!0)}}),pe=W(M,[["__scopeId","data-v-32500e18"]]);export{pe as default};
//# sourceMappingURL=Home-_aY3wtod.js.map
