import{d as y,o as b,R as f,y as v,b as _,c as g,w as r,fd as k,f as i,u as s,bF as w,am as m}from"./outputWidgets.b408cd47.js";import{E as l,W as C}from"./workspaces.76828554.js";import{C as x}from"./ContentLayout.cab4f09c.js";import{C as h}from"./CrudView.b6646971.js";import{A as E}from"./index.8601379e.js";import"./asyncComputed.a7fc1aad.js";import"./runnerData.d52f67ef.js";import"./url.266b2c44.js";import"./record.7a308bd3.js";import"./pubsub.e8c4900b.js";import"./router.49371dd0.js";import"./Form.30ca3c8c.js";import"./hasIn.dda5a20c.js";import"./gateway.5649747e.js";import"./popupNotifcation.e99572f9.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.21e15a66.js";import"./BookOutlined.9049fb63.js";import"./Modal.7c3fbdf2.js";import"./index.c368a61e.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]="865c2d7e-3536-4557-ab6b-19c336cadd56",a._sentryDebugIdIdentifier="sentry-dbid-865c2d7e-3536-4557-ab6b-19c336cadd56")}catch{}})();const q=y({__name:"EnvVarsEditor",setup(a){let o=null;b(()=>{o=setInterval(l.listComputed.refetch,2e3)}),f(()=>{o&&clearInterval(o)});function d(){var e;(e=C.computed.result.value)==null||e.openFile(".env")}const p=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"multiline-text"}],u=v(()=>{var e,t;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(t=(e=l.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 c({key:e,value:t}){await l.create(e,t)}return(e,t)=>(_(),g(x,null,{default:r(()=>[i(h,{"entity-name":"Env var",loading:s(l).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:p,live:"",onCreate:c},{secondary:r(()=>[i(s(w),{onClick:t[0]||(t[0]=n=>d())},{default:r(()=>[m("Open .env")]),_:1})]),extra:r(()=>[i(s(E),{"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"])]),_:1}))}});export{q as default};
//# sourceMappingURL=EnvVarsEditor.d6ed37ba.js.map
