import{d as b,ex as f,H as y,b as D,c as _,u as w}from"./registerWidgets.1e9167ab.js";import{e as g,a as k,b as C}from"./icons.41af03d8.js";import{a as x}from"./asyncComputed.8a644895.js";import{D as l}from"./dashes.6c2a613d.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.e0bf9fc2.js";import"./activeRecord.60b6bd01.js";import"./pubsub.09eafe35.js";import"./index.89742732.js";import"./Modal.b646cd22.js";import"./Title.d1f45d59.js";import"./transButton.755e702e.js";import"./index.9165a659.js";import"./Text.c8d7b4c0.js";import"./index.32c7f8ee.js";import"./index.d74062f4.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]="ebd58973-d783-4d5e-a1be-9d70b34a23cb",o._sentryDebugIdIdentifier="sentry-dbid-ebd58973-d783-4d5e-a1be-9d70b34a23cb")}catch{}})();const j=b({__name:"Dashes",setup(o){const s=f(),{loading:r,result:n,refetch:d}=x(()=>l.list()),c=({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()),d()},u=async()=>{const e=await l.create();c({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()),d())},h=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,link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:g,label:"Edit Dash",onClick:c},{icon:k,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),_(v,{loading:w(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{j as default};
//# sourceMappingURL=Dashes.2f1a5d2e.js.map
