import{f as a,eG as g,eV as _,eW as w,d as x,o as C,L as I,r as k,S as f,H as S,b as j,ev as P,w as s,u as d,bV as V,ar as b}from"./outputWidgets.73e48adb.js";import{W as A}from"./workspaces.ca95d07a.js";import{E as c}from"./envVars.77ca5967.js";import{i as D}from"./icons.37a32d23.js";import{C as N}from"./CrudView.835ae129.js";import{A as T}from"./index.cbbb6df0.js";import{A as $}from"./index.49a6e40d.js";import"./runnerData.737f4318.js";import"./url.ee9a902a.js";import"./record.dad9df30.js";import"./pubsub.5ce27a1f.js";import"./asyncComputed.02c9e941.js";import"./Paragraph.2c7f637b.js";import"./Base.dc6b2177.js";import"./Typography.343bcd00.js";import"./Form.96a128f7.js";import"./hasIn.e1935081.js";import"./Modal.cc696ff2.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.d98a9d0d.js";import"./router.32167d1f.js";import"./index.27d555b2.js";import"./Title.42a97159.js";import"./Text.6ed098e9.js";import"./index.198d7afa.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="9eabd0cd-de9b-45e9-a64e-5ee024ef3de6",n._sentryDebugIdIdentifier="sentry-dbid-9eabd0cd-de9b-45e9-a64e-5ee024ef3de6")}catch{}})();function y(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable}))),r.forEach(function(o){B(n,o,t[o])})}return n}function B(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var p=function(e,t){var r=y({},e,t.attrs);return a(g,y({},r,{icon:_}),null)};p.displayName="EyeInvisibleOutlined";p.inheritAttrs=!1;const M=p;function v(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable}))),r.forEach(function(o){W(n,o,t[o])})}return n}function W(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var m=function(e,t){var r=v({},e,t.attrs);return a(g,v({},r,{icon:w}),null)};m.displayName="EyeOutlined";m.inheritAttrs=!1;const F=m,G={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},pe=x({__name:"EnvVarsEditor",setup(n){let e=null;C(()=>{e=setInterval(c.listComputed.refetch,2e3)}),I(()=>{e&&clearInterval(e)});const t=k(!!f.get("hideEnvVars")),r=i=>{t.value=!!i,f.set("hideEnvVars",i)};function o(){var i;(i=A.computed.result.value)==null||i.openFile(".env")}const O=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],h=S(()=>{var i,l;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(l=(i=c.listComputed.result.value)==null?void 0:i.map(u=>({key:u.key,cells:[{type:"text",text:u.key},{text:t.value?"*".repeat(u.value.length):u.value,type:"text"},{type:"actions",actions:[{icon:D,label:"Delete",onClick:()=>u.delete(),dangerous:!0}]}]})))!=null?l:[]}});async function E({key:i,value:l}){await c.create(i,l)}return(i,l)=>(j(),P("div",G,[a(N,{"entity-name":"Env var",loading:d(c).listComputed.loading.value,title:"Environment Variables",description:"Set environment variables for your project.","empty-title":"No environment variables set",table:h.value,"create-button-text":"Add Environment Variable",fields:O,live:"",onCreate:E},{secondary:s(()=>[a(d(V),{onClick:l[0]||(l[0]=u=>o())},{default:s(()=>[b("Open .env")]),_:1})]),extra:s(()=>[a(d($),{"show-icon":"",style:{"margin-top":"20px"}},{message:s(()=>[b(" 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})]),more:s(()=>[a(d(T),{checked:t.value,onChange:r},{checkedChildren:s(()=>[a(d(M))]),unCheckedChildren:s(()=>[a(d(F))]),_:1},8,["checked"])]),_:1},8,["loading","table"])]))}});export{pe as default};
//# sourceMappingURL=EnvVarsEditor.ecf95581.js.map
