import{d as y,K as b,b as D,t as w,z as l,H as g}from"./registerWidgets.39370cce.js";import{f as _,g as k,h as C}from"./icons.c1d7cae2.js";import{a as I}from"./asyncComputed.588e6ddd.js";import{D as p}from"./dashes.8cfbe077.js";import{R as x}from"./RuntimeList.c060a1d2.js";import"./activeRecord.fab7288a.js";import"./runnerData.561187a0.js";import"./DropdownMenu.f1872b59.js";import"./CircularLoading.858c95df.js";import"./lottie.576b6dda.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[s]="1c8cdceb-c779-499c-9881-9c8e5cee524e",o._sentryDebugIdIdentifier="sentry-dbid-1c8cdceb-c779-499c-9881-9c8e5cee524e")}catch{}})();const z=y({__name:"Dashes",setup(o){const s=g(),{loading:i,result:n,refetch:r}=I(()=>p.list()),d=({key:e})=>s.push({path:`/_editor/dash/${encodeURIComponent(e)}`}),u=async({key:e})=>{var a,t;await((t=(a=n.value)==null?void 0:a.find(c=>c.path===e))==null?void 0:t.duplicate()),r()},h=async()=>{const e=await p.create();d({key:e.path})},m=async({key:e})=>{var a,t;confirm("Are you sure you want to delete this dash?")&&(await((t=(a=n.value)==null?void 0:a.find(c=>c.path===e))==null?void 0:t.delete()),r())},f=b(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Dash Actions"}],rows:(a=(e=n.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,classes:["title","centered"],link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",classes:["centered"],actions:[{icon:_,label:"Delete",onClick:m,dangerous:!0},{icon:k,label:"Edit Dash",onClick:d},{icon:C,label:"Duplicate",onClick:u}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{loading:l(i),title:"Python Dashes",description:"Create a dashboard page with charts and inputs interacting with your python code.","create-button-text":"Create Dash","empty-title":"No dashes here yet","video-url":"https://www.youtube.com/embed/oYMptrk7QNE",table:l(f),onCreate:h},null,8,["loading","table"]))}});export{z as default};
//# sourceMappingURL=Dashes.e3456ba5.js.map
