import{d as f,ey as y,G as b,b as D,c as w,u as g}from"./outputWidgets.0fb707c7.js";import{e as _,a as C,b as k}from"./icons.24a85994.js";import{a as v}from"./asyncComputed.a0ca296c.js";import{D as c}from"./dashes.732fbcbe.js";import{C as x}from"./CrudView.e365e55f.js";import{a as I}from"./ant-design.c18e1d39.js";import"./activeRecord.204186f3.js";import"./pubsub.7d8bce56.js";import"./runnerData.123d166f.js";import"./Text.3ec0a64d.js";import"./Title.f00a58f9.js";import"./transButton.220177fb.js";import"./router.81de177d.js";import"./Form.0dcb97c0.js";import"./index.140c5bc8.js";import"./url.d43b75f5.js";import"./index.85d2f01b.js";import"./index.8dbf2994.js";import"./index.0d3d2205.js";import"./index.e8ef1073.js";import"./index.a2e845fd.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[i]="3b3768c1-2e84-4627-82b0-d92704013a31",o._sentryDebugIdIdentifier="sentry-dbid-3b3768c1-2e84-4627-82b0-d92704013a31")}catch{}})();const K=f({__name:"Dashes",setup(o){const i=y(),{loading:r,result:s,refetch:d}=v(()=>c.list()),p=({key:t})=>i.push({name:"dashEditor",params:{dashPath:t}}),l=async({key:t})=>{var a,e;await((e=(a=s.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.duplicate()),d()},m=async()=>{const t=await c.create();p({key:t.path})},u=async({key:t})=>{var a,e;await I("Are you sure you want to delete this dash?")&&(await((e=(a=s.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.delete()),d())},h=b(()=>{var t,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(t=s.value)==null?void 0:t.map(e=>({key:e.path,cells:[{text:e.title,link:`/_editor/dash/${encodeURIComponent(e.path)}`},{text:e.path},{text:"",actions:[{icon:_,label:"Edit Dash",onClick:p},{icon:C,label:"Duplicate",onClick:l},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(t,a)=>(D(),w(x,{loading:g(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:h.value,"entity-name":"Dash",onCreate:m},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Dashes.4042c1cc.js.map
