import{d as y,o as b,O as f,J as v,b as _,c as g,w as n,eS as k,f as l,u as s,bG as w,as as p}from"./outputWidgets.f4ff73cb.js";import{W as C}from"./workspaces.b1acd1b5.js";import{E as i}from"./envVars.092fda86.js";import{C as x}from"./ContentLayout.52723b88.js";import{C as h}from"./CrudView.153891cb.js";import{A as E}from"./index.efd7a444.js";import"./runnerData.f9578373.js";import"./url.f4aa4fed.js";import"./record.06ee4427.js";import"./pubsub.f8e50115.js";import"./asyncComputed.1c2e733f.js";import"./router.579c91e6.js";import"./Form.c8ea7c3d.js";import"./hasIn.c05f2ad3.js";import"./popupNotifcation.d7d31af4.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.273d3e2a.js";import"./BookOutlined.eb157924.js";import"./Paragraph.0762ff9a.js";import"./Base.2cf6cca2.js";import"./Modal.fb9d97fb.js";import"./index.38a388d2.js";import"./Title.8356c432.js";import"./Text.b0ae0f80.js";import"./index.72e9756f.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="20518b9b-9448-4af3-baaa-396a4d4d5622",a._sentryDebugIdIdentifier="sentry-dbid-20518b9b-9448-4af3-baaa-396a4d4d5622")}catch{}})();const R=y({__name:"EnvVarsEditor",setup(a){let o=null;b(()=>{o=setInterval(i.listComputed.refetch,2e3)}),f(()=>{o&&clearInterval(o)});function m(){var e;(e=C.computed.result.value)==null||e.openFile(".env")}const d=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"multiline-text"}],u=v(()=>{var e,t;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(t=(e=i.listComputed.result.value)==null?void 0:e.map(r=>({key:r.key,cells:[{type:"text",text:r.key},{text:r.value,type:"secret"},{type:"actions",actions:[{icon:k,label:"Delete",onClick:()=>r.delete(),dangerous:!0}]}]})))!=null?t:[]}});async function c({key:e,value:t}){await i.create(e,t)}return(e,t)=>(_(),g(x,null,{default:n(()=>[l(h,{"entity-name":"Env var",loading:s(i).listComputed.loading.value,title:"Environment Variables",description:"Set environment variables for your project.","empty-title":"No environment variables set",table:u.value,"create-button-text":"Add Environment Variable",fields:d,live:"",onCreate:c},{secondary:n(()=>[l(s(w),{onClick:t[0]||(t[0]=r=>m())},{default:n(()=>[p("Open .env")]),_:1})]),extra:n(()=>[l(s(E),{"show-icon":"",style:{"margin-top":"20px"}},{message:n(()=>[p(" This is simply a helper to manage your environment variables locally. The variables set here will not be deployed to Cloud with your project. ")]),_:1})]),_:1},8,["loading","table"])]),_:1}))}});export{R as default};
//# sourceMappingURL=EnvVarsEditor.2bef4934.js.map
