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,bG as w,ar as m}from"./outputWidgets.7dcb9763.js";import{W as x}from"./workspaces.45b3bb6b.js";import{E as i}from"./envVars.5114f344.js";import{i as k}from"./icons.28fdd925.js";import{C}from"./CrudView.498f2862.js";import{A as h}from"./index.8bebb143.js";import"./runnerData.67433442.js";import"./url.1d026e93.js";import"./record.c580fef2.js";import"./pubsub.a9318333.js";import"./asyncComputed.1391bc4e.js";import"./Paragraph.546e285b.js";import"./Base.959092ed.js";import"./Typography.890fd94a.js";import"./Form.d1397da7.js";import"./hasIn.a0faa635.js";import"./Modal.6b55c8db.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7b65ae43.js";import"./router.c239924b.js";import"./popupNotifcation.2e66fb53.js";import"./index.5807d2be.js";import"./Title.a796f87f.js";import"./Text.c3748e80.js";import"./index.ee476d81.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]="3d1187fb-c54e-4fc9-8ad1-738fa204216a",a._sentryDebugIdIdentifier="sentry-dbid-3d1187fb-c54e-4fc9-8ad1-738fa204216a")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},R=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 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(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 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:r(()=>[l(s(w),{onClick:t[0]||(t[0]=n=>p())},{default:r(()=>[m("Open .env")]),_:1})]),extra:r(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[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{R as default};
//# sourceMappingURL=EnvVarsEditor.2f593aab.js.map
