import{d as f,o as y,K as b,H as v,b as _,eu as g,f as l,w as a,u as s,eP as w,bE as x,aq as d}from"./outputWidgets.8f35e76b.js";import{W as k}from"./workspaces.afd4edf2.js";import{E as i}from"./envVars.04759b67.js";import{C}from"./CrudView.4b14d77c.js";import{A as E}from"./index.74670cde.js";import"./runnerData.6e315e3e.js";import"./url.99f1e379.js";import"./record.56272af3.js";import"./pubsub.aac2ae7d.js";import"./asyncComputed.b2c7682e.js";import"./Paragraph.5b35e944.js";import"./Text.cb1b4ad4.js";import"./Form.357810f8.js";import"./hasIn.38270313.js";import"./Modal.3cec70ce.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7378a41f.js";import"./BookOutlined.b79ac83a.js";import"./router.eb6cf81e.js";import"./popupNotifcation.20f659d9.js";import"./index.30032ec4.js";import"./Title.984d5105.js";import"./index.1d88a799.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="1fb980d9-429d-43d9-9443-25e77f9c8655",n._sentryDebugIdIdentifier="sentry-dbid-1fb980d9-429d-43d9-9443-25e77f9c8655")}catch{}})();const h={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},L=f({__name:"EnvVarsEditor",setup(n){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 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:w,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",h,[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(x),{onClick:t[0]||(t[0]=r=>p())},{default:a(()=>[d("Open .env")]),_:1})]),extra:a(()=>[l(s(E),{"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{L as default};
//# sourceMappingURL=EnvVarsEditor.b324a052.js.map
