import{d as b,ex as y,F as h,b as g,u as w,bu as _}from"./registerWidgets.d68712f0.js";import{e as F,f as C,g as k}from"./icons.24d45fbf.js";import{a as v}from"./asyncComputed.f9ea598c.js";import{F as l}from"./forms.23376eb8.js";import{R as x}from"./RuntimeList.0775f6b1.js";import"./activeRecord.b8754928.js";import"./pubsub.5d7eaeae.js";import"./DropdownMenu.96853481.js";import"./CircularLoading.3dc537f5.js";import"./lottie.2b6a117e.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="0d1d9bda-00c5-49c2-8dad-bf5828074d94",a._sentryDebugIdIdentifier="sentry-dbid-0d1d9bda-00c5-49c2-8dad-bf5828074d94")}catch{}})();const G=b({__name:"Forms",setup(a){const n=y(),{loading:i,result:r,refetch:c}=v(()=>l.list()),d=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),m=async({key:e})=>{var o,t;await((t=(o=r.value)==null?void 0:o.find(s=>s.path===e))==null?void 0:t.duplicate()),c()},u=async()=>{const e=await l.create();d({key:e.path})},p=async({key:e})=>{var o,t;confirm("Are you sure you want to delete this form?")&&(await((t=(o=r.value)==null?void 0:o.find(s=>s.path===e))==null?void 0:t.delete()),c())},f=h(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Form Actions"}],rows:(o=(e=r.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,classes:["title","centered"],link:`/_editor/form/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",classes:["centered"],actions:[{icon:F,label:"Delete",onClick:p,dangerous:!0},{icon:C,label:"Edit Form",onClick:d},{icon:k,label:"Duplicate",onClick:m}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(x,{loading:_(i),title:"Dynamic Python forms",description:"Create forms with advanced logic, easy integrations and custom branding.","create-button-text":"Create Form","empty-title":"No forms here yet","video-url":"https://www.youtube.com/embed/tN7SRGmVPwc",table:f.value,onCreate:u},null,8,["loading","table"]))}});export{G as default};
//# sourceMappingURL=Forms.a5332fdc.js.map
