import{d as f,ez as y,J as b,b as D,c as w,u as _}from"./outputWidgets.17392370.js";import{e as g,a as k,b as C}from"./icons.baa5f07a.js";import{a as v}from"./asyncComputed.76849272.js";import{D as l}from"./dashes.5976f8f5.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.c4e89a02.js";import{a as I}from"./ant-design.9c3ff8a2.js";import"./activeRecord.84b679f6.js";import"./pubsub.fc739490.js";import"./index.7c30bb7a.js";import"./index.8d8985c7.js";import"./Title.bc3ff086.js";import"./Form.e398e550.js";import"./index.56ff0f0c.js";import"./index.fffd13c2.js";import"./index.8c91651f.js";import"./index.1fd97730.js";import"./index.ba0ff767.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]="24fcd754-7989-4e27-a728-31e49eb08d7f",o._sentryDebugIdIdentifier="sentry-dbid-24fcd754-7989-4e27-a728-31e49eb08d7f")}catch{}})();const q=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:d}=v(()=>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()},m=async()=>{const e=await l.create();c({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()),d())},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:c},{icon:k,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{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{q as default};
//# sourceMappingURL=Dashes.35fd9bb7.js.map
