import{d as b,o as y,R as f,y as v,b as _,c as g,w as r,eS as k,f as l,u as s,bI as w,au as p}from"./outputWidgets.52571dac.js";import{E as i,W as C}from"./workspaces.daf256e7.js";import{C as x}from"./ContentLayout.34675bf7.js";import{C as h}from"./CrudView.6cb8ad38.js";import{A as E}from"./index.7797c9cd.js";import"./asyncComputed.2a2a1288.js";import"./runnerData.3982af84.js";import"./url.5cc70021.js";import"./record.2a93f29c.js";import"./pubsub.be7004e9.js";import"./router.0ae1ef4a.js";import"./Form.9e43a28b.js";import"./hasIn.f1c353ba.js";import"./gateway.9b472f57.js";import"./popupNotifcation.e85fac74.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a5567333.js";import"./BookOutlined.7e4ac738.js";import"./Paragraph.7aa2ce32.js";import"./Base.e64db743.js";import"./Modal.514213ca.js";import"./index.89edc4ba.js";import"./Title.8fbc2e7d.js";import"./Text.0586c869.js";import"./index.f3e1df2a.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]="a1488ffa-b85a-414d-b377-b58becab4937",a._sentryDebugIdIdentifier="sentry-dbid-a1488ffa-b85a-414d-b377-b58becab4937")}catch{}})();const Q=b({__name:"EnvVarsEditor",setup(a){let o=null;y(()=>{o=setInterval(i.listComputed.refetch,2e3)}),f(()=>{o&&clearInterval(o)});function m(){var e;(e=C.computed.result.value)==null||e.openFile(".env")}const u=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"multiline-text"}],d=v(()=>{var e,t;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(t=(e=i.listComputed.result.value)==null?void 0:e.map(n=>({key:n.key,cells:[{type:"text",text:n.key},{text:n.value,type:"secret"},{type:"actions",actions:[{icon:k,label:"Delete",onClick:()=>n.delete(),dangerous:!0}]}]})))!=null?t:[]}});async function c({key:e,value:t}){await i.create(e,t)}return(e,t)=>(_(),g(x,null,{default:r(()=>[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:d.value,"create-button-text":"Add Environment Variable",fields:u,live:"",onCreate:c},{secondary:r(()=>[l(s(w),{onClick:t[0]||(t[0]=n=>m())},{default:r(()=>[p("Open .env")]),_:1})]),extra:r(()=>[l(s(E),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[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{Q as default};
//# sourceMappingURL=EnvVarsEditor.ee843bb7.js.map
