import{d as y,K as b,b as D,t as w,z as l,H as g}from"./registerWidgets.29ceb1a3.js";import{f as _,g as k,h as C}from"./icons.3ddac2d4.js";import{a as I}from"./asyncComputed.9ed582d0.js";import{D as p}from"./dashes.f777e69e.js";import{R as x}from"./RuntimeList.199acaf8.js";import"./activeRecord.ab1afca6.js";import"./runnerData.b34f70e9.js";import"./DropdownMenu.e7128f2e.js";import"./CircularLoading.f0b3522c.js";import"./lottie.dc9b75c3.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]="358a3cc2-f0f6-44e4-9d24-6a2ea86dbb50",o._sentryDebugIdIdentifier="sentry-dbid-358a3cc2-f0f6-44e4-9d24-6a2ea86dbb50")}catch{}})();const z=y({__name:"Dashes",setup(o){const s=g(),{loading:r,result:n,refetch:c}=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(i=>i.path===e))==null?void 0:t.duplicate()),c()},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(i=>i.path===e))==null?void 0:t.delete()),c())},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(r),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.889eb556.js.map
