import{f as i,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 c,bV as V,ar as b}from"./outputWidgets.83ad65aa.js";import{W as A}from"./workspaces.a03a836c.js";import{E as d}from"./envVars.f18fb294.js";import{i as D}from"./icons.ec92f7f9.js";import{C as N}from"./CrudView.fb55c5f4.js";import{A as T}from"./index.a2aad296.js";import{A as $}from"./index.a449e568.js";import"./runnerData.83b2a9f7.js";import"./url.27ce9387.js";import"./record.df4e3ae7.js";import"./pubsub.6c6cbc8d.js";import"./asyncComputed.eebec89e.js";import"./Paragraph.eee68d2f.js";import"./Base.5de97c83.js";import"./Typography.fea800b8.js";import"./Form.5deb3adb.js";import"./hasIn.597d0078.js";import"./Modal.00c72438.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.d125b27a.js";import"./router.1b8539af.js";import"./index.677f843d.js";import"./Title.50be6d8b.js";import"./Text.72dc1978.js";import"./index.06a93781.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]="67ee3882-ee32-4fd6-9177-d0aaf5a2b4b2",n._sentryDebugIdIdentifier="sentry-dbid-67ee3882-ee32-4fd6-9177-d0aaf5a2b4b2")}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 i(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 i(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(d.listComputed.refetch,2e3)}),I(()=>{e&&clearInterval(e)});const t=k(!!f.get("hideEnvVars")),r=a=>{t.value=!!a,f.set("hideEnvVars",a)};function o(){var a;(a=A.computed.result.value)==null||a.openFile(".env")}const O=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],h=S(()=>{var a,l;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(l=(a=d.listComputed.result.value)==null?void 0:a.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:a,value:l}){await d.create(a,l)}return(a,l)=>(j(),P("div",G,[i(N,{"entity-name":"Env var",loading:c(d).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(()=>[i(c(V),{onClick:l[0]||(l[0]=u=>o())},{default:s(()=>[b("Open .env")]),_:1})]),extra:s(()=>[i(c($),{"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(()=>[i(c(T),{checked:t.value,onChange:r},{checkedChildren:s(()=>[i(c(M))]),unCheckedChildren:s(()=>[i(c(F))]),_:1},8,["checked"])]),_:1},8,["loading","table"])]))}});export{pe as default};
//# sourceMappingURL=EnvVarsEditor.cd8215df.js.map
