import{d as f,ex as y,H as b,b as D,c as w,u as _}from"./registerWidgets.9fce82a0.js";import{e as g,a as k,b as C}from"./icons.1992e13b.js";import{a as x}from"./asyncComputed.a4b709a3.js";import{D as l}from"./dashes.ea544587.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.ac5a77d6.js";import{a as I}from"./ant-design.cd2520f8.js";import"./activeRecord.872f4269.js";import"./pubsub.025cc397.js";import"./index.9df32b45.js";import"./index.2c964e80.js";import"./Title.26974edb.js";import"./Form.413853c0.js";import"./index.eed9c711.js";import"./index.30c35b37.js";import"./index.c9f7f8f0.js";import"./index.db5cf0e6.js";import"./index.e8158c16.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]="d699b6e1-2ac3-4aa3-a927-5f53c9f13d06",o._sentryDebugIdIdentifier="sentry-dbid-d699b6e1-2ac3-4aa3-a927-5f53c9f13d06")}catch{}})();const z=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:c}=x(()=>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()},m=async()=>{const e=await l.create();d({key:e.path})},u=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=b(()=>{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:g,label:"Edit Dash",onClick:d},{icon:k,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(v,{loading:_(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{z as default};
//# sourceMappingURL=Dashes.609044c9.js.map
