import{d as b,K as y,b as D,t as w,z as d,H as g}from"./registerWidgets.89616af0.js";import{f as _,g as k,h as C}from"./icons.9cfdae6d.js";import{a as x}from"./asyncComputed.8ac91a75.js";import{D as p}from"./dashes.f8616397.js";import{R as I}from"./RuntimeList.097a29c4.js";import"./activeRecord.3d3c7835.js";import"./pubsub.d7600aa1.js";import"./runnerData.bd24d7de.js";import"./DropdownMenu.8f7fc9d3.js";import"./CircularLoading.0fb686c0.js";import"./lottie.fc57e5ac.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]="69ef4f38-290b-42e2-80ba-04899a0a583b",o._sentryDebugIdIdentifier="sentry-dbid-69ef4f38-290b-42e2-80ba-04899a0a583b")}catch{}})();const L=b({__name:"Dashes",setup(o){const s=g(),{loading:r,result:n,refetch:c}=x(()=>p.list()),l=({key:e})=>s.push({name:"dashEditor",params:{dashPath: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();l({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=y(()=>{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:l},{icon:C,label:"Duplicate",onClick:u}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(I,{loading:d(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:d(f),onCreate:h},null,8,["loading","table"]))}});export{L as default};
//# sourceMappingURL=Dashes.8a9fc0d5.js.map
