import{d as f,ez as b,J as y,b as D,c as w,u as g}from"./outputWidgets.cf5b7366.js";import{e as _,a as C,b as k}from"./icons.c510a141.js";import{a as v}from"./asyncComputed.2caa7fe6.js";import{D as l}from"./dashes.75890af5.js";import{C as x}from"./CrudView.ca1846b4.js";import{a as I}from"./ant-design.55c856ad.js";import"./activeRecord.f30e02c2.js";import"./pubsub.664a70af.js";import"./index.3d2fbf9e.js";import"./index.7622dd54.js";import"./Title.adce1298.js";import"./Form.c8affe88.js";import"./router.565b4739.js";import"./url.fb40e08c.js";import"./index.47f17eed.js";import"./index.aee8b5d5.js";import"./index.9583d9e9.js";import"./index.10cdfb2c.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]="66e7cf9a-a114-4a5f-a41c-b935bf3dcba0",o._sentryDebugIdIdentifier="sentry-dbid-66e7cf9a-a114-4a5f-a41c-b935bf3dcba0")}catch{}})();const q=f({__name:"Dashes",setup(o){const s=b(),{loading:r,result:n,refetch:c}=v(()=>l.list()),d=({key:e})=>s.push({name:"dashEditor",params:{dashPath:e}}),p=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()},u=async()=>{const e=await l.create();d({key:e.path})},m=async({key:e})=>{var a,t;await I("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())},h=y(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=n.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:_,label:"Edit Dash",onClick:d},{icon:C,label:"Duplicate",onClick:p},{icon:k,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?a:[]}});return(e,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:u},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Dashes.57e1735d.js.map
