import{d as b,o as f,L as y,H as v,b as _,ev as g,f as l,w as a,u as s,bV as w,ar as m}from"./outputWidgets.174c2ebc.js";import{W as x}from"./workspaces.c7c00940.js";import{E as i}from"./envVars.db6cd2ba.js";import{i as k}from"./icons.0b449822.js";import{C}from"./CrudView.f2590a33.js";import{A as h}from"./index.ed5e4a27.js";import"./runnerData.e1086c55.js";import"./url.a9413b47.js";import"./record.3e2ab436.js";import"./pubsub.c25c1191.js";import"./asyncComputed.b96609d6.js";import"./Paragraph.0779ea1c.js";import"./Base.01a39e39.js";import"./Typography.fca84e57.js";import"./Form.664d60a0.js";import"./hasIn.d60397ef.js";import"./Modal.85d9af85.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.1ae089f8.js";import"./router.fc48f7ab.js";import"./index.8d590eaa.js";import"./Title.02a07c25.js";import"./Text.bb6ae54c.js";import"./index.70c0f8e0.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]="e5fb44e6-791c-4b8b-be27-2b45dc1f18ee",n._sentryDebugIdIdentifier="sentry-dbid-e5fb44e6-791c-4b8b-be27-2b45dc1f18ee")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},Q=b({__name:"EnvVarsEditor",setup(n){let o=null;f(()=>{o=setInterval(i.listComputed.refetch,2e3)}),y(()=>{o&&clearInterval(o)});function p(){var e;(e=x.computed.result.value)==null||e.openFile(".env")}const d=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],c=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 u({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:c.value,"create-button-text":"Add Environment Variable",fields:d,live:"",onCreate:u},{secondary:a(()=>[l(s(w),{onClick:t[0]||(t[0]=r=>p())},{default:a(()=>[m("Open .env")]),_:1})]),extra:a(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:a(()=>[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.2e4c6039.js.map
