import{d as f,o as y,L as b,H as v,b as _,ev as g,f as l,w as n,u as s,bG as w,ar as d}from"./outputWidgets.503b5a9e.js";import{W as x}from"./workspaces.f912f434.js";import{E as i}from"./envVars.b9984f23.js";import{i as k}from"./icons.623e5b2a.js";import{C}from"./CrudView.8215f03b.js";import{A as h}from"./index.98f7242c.js";import"./runnerData.05d8e459.js";import"./url.f247c0b7.js";import"./record.3ffddda0.js";import"./pubsub.2a2a572f.js";import"./asyncComputed.f38b9d8f.js";import"./Paragraph.eecb906a.js";import"./Base.e395406f.js";import"./Typography.bd2876f7.js";import"./Form.6709fcbf.js";import"./hasIn.8f49de2e.js";import"./Modal.f99bc7ef.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.98eda1bf.js";import"./router.51aa7056.js";import"./popupNotifcation.d55d8262.js";import"./index.d8ff7290.js";import"./Title.fc9871d6.js";import"./Text.f7ffa2fe.js";import"./index.1289db45.js";import"./SyncOutlined.60f5ac51.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]="a4add52c-bd05-48b6-a60e-a4f184da4af7",a._sentryDebugIdIdentifier="sentry-dbid-a4add52c-bd05-48b6-a60e-a4f184da4af7")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},X=f({__name:"EnvVarsEditor",setup(a){let o=null;y(()=>{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(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("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:n(()=>[l(s(w),{onClick:t[0]||(t[0]=r=>p())},{default:n(()=>[d("Open .env")]),_:1})]),extra:n(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:n(()=>[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.118d841f.js.map
