import{d as f,o as y,L as b,H as v,b as _,ev as g,f as l,w as r,u as s,bV as w,ar as d}from"./outputWidgets.a3cf86d4.js";import{W as x}from"./workspaces.cec5c6f2.js";import{E as i}from"./envVars.be48c3cd.js";import{i as k}from"./icons.71dd468a.js";import{C}from"./CrudView.f083926d.js";import{A as h}from"./index.65e7b193.js";import"./runnerData.678131e4.js";import"./url.eef7d5cb.js";import"./record.284ed593.js";import"./pubsub.f3afa6c4.js";import"./asyncComputed.1cc21e38.js";import"./Paragraph.d0378343.js";import"./Base.438220fe.js";import"./Typography.2d337449.js";import"./Form.48a2d714.js";import"./hasIn.c81db0e4.js";import"./Modal.a36dd52c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7f8bc1c2.js";import"./router.7ac4af4b.js";import"./index.3c8fbafb.js";import"./Title.abc37adf.js";import"./Text.c33f164a.js";import"./index.1c110c61.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]="1e21c683-f43b-43ab-b2e8-2fcbf8dd76ac",n._sentryDebugIdIdentifier="sentry-dbid-1e21c683-f43b-43ab-b2e8-2fcbf8dd76ac")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},Q=f({__name:"EnvVarsEditor",setup(n){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"}],c=v(()=>{var e,t;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(t=(e=i.listComputed.result.value)==null?void 0:e.map(a=>({key:a.key,cells:[{type:"text",text:a.key},{text:a.value,type:"secret"},{type:"actions",actions:[{icon:k,label:"Delete",onClick:()=>a.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:m,live:"",onCreate:u},{secondary:r(()=>[l(s(w),{onClick:t[0]||(t[0]=a=>p())},{default:r(()=>[d("Open .env")]),_:1})]),extra:r(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[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{Q as default};
//# sourceMappingURL=EnvVarsEditor.ee8faa87.js.map
