import{d as f,o as y,K as b,H as v,b as _,eu as g,f as l,w as r,u as s,eP as w,bF as x,aq as m}from"./outputWidgets.e9677800.js";import{W as k}from"./workspaces.490451ae.js";import{E as i}from"./envVars.5ab5fff0.js";import{C}from"./CrudView.8e03181d.js";import{A as h}from"./index.3e3be57f.js";import"./runnerData.11ae4383.js";import"./url.89c6b244.js";import"./record.767f28b7.js";import"./pubsub.9e36d89a.js";import"./asyncComputed.37b7af98.js";import"./Paragraph.394702f6.js";import"./Base.64d54b8f.js";import"./Typography.511f4fec.js";import"./Form.9737d51d.js";import"./hasIn.bd3f78ff.js";import"./Modal.df560cc7.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.a4277c3a.js";import"./router.e014ddc2.js";import"./popupNotifcation.7148cdf9.js";import"./index.42279d35.js";import"./Title.c954a24a.js";import"./Text.fd9e90fd.js";import"./index.1a0bd015.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]="0f9f541a-8ffa-41f6-9526-941edb57b93b",a._sentryDebugIdIdentifier="sentry-dbid-0f9f541a-8ffa-41f6-9526-941edb57b93b")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},Q=f({__name:"EnvVarsEditor",setup(a){let o=null;y(()=>{o=setInterval(i.listComputed.refetch,2e3)}),b(()=>{o&&clearInterval(o)});function p(){var e;(e=k.computed.result.value)==null||e.openFile(".env")}const d=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],u=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:w,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("div",E,[l(C,{"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:r(()=>[l(s(x),{onClick:t[0]||(t[0]=n=>p())},{default:r(()=>[m("Open .env")]),_:1})]),extra:r(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[m(" 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"])]))}});export{Q as default};
//# sourceMappingURL=EnvVarsEditor.5d6ab064.js.map
