import{d as y,o as f,L as b,H as v,b as _,ev as g,f as l,w as a,u as s,bG as w,ar as d}from"./outputWidgets.763535ec.js";import{W as x}from"./workspaces.e85b3963.js";import{E as i}from"./envVars.56582b39.js";import{i as k}from"./icons.39d7577b.js";import{C}from"./CrudView.0261ff81.js";import{A as h}from"./index.eb21589f.js";import"./runnerData.e52c0f9f.js";import"./url.0280fc81.js";import"./record.ae98c277.js";import"./pubsub.e128dec2.js";import"./asyncComputed.c1b5752d.js";import"./Paragraph.1d14da40.js";import"./Base.0423a633.js";import"./Typography.3b9809ab.js";import"./Form.93c1d68a.js";import"./hasIn.c3ad9d17.js";import"./Modal.33014e22.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.0d674672.js";import"./router.4c31abb0.js";import"./popupNotifcation.59a7179b.js";import"./index.5c5eefcc.js";import"./Title.b6a28a5f.js";import"./Text.1de1f1d2.js";import"./index.351b265c.js";import"./SyncOutlined.cf45cade.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[o]="76b8579e-1681-4573-8793-d9413d6dd576",r._sentryDebugIdIdentifier="sentry-dbid-76b8579e-1681-4573-8793-d9413d6dd576")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},X=y({__name:"EnvVarsEditor",setup(r){let o=null;f(()=>{o=setInterval(i.listComputed.refetch,2e3)}),b(()=>{o&&clearInterval(o)});function p(){var e;(e=x.computed.result.value)==null||e.openFile(".env")}const m=[{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: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("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:m,live:"",onCreate:c},{secondary:a(()=>[l(s(w),{onClick:t[0]||(t[0]=n=>p())},{default:a(()=>[d("Open .env")]),_:1})]),extra:a(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:a(()=>[d(" 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{X as default};
//# sourceMappingURL=EnvVarsEditor.c1b22d78.js.map
