import{S as E}from"./SaveButton.3679bfe7.js";import{C as V}from"./CrudView.f8c62bd5.js";import{a as x}from"./asyncComputed.6b1d4165.js";import{u as h}from"./polling.debfe6c7.js";import{o as d}from"./omniChatStore.755c548d.js";import{a as A}from"./controller.b35b6237.js";import{d as T,J as F,aj as B,K as I,u as e,c as m,ed as S,w as a,F as p,aL as U,o as u,b as i,az as c,bM as D,eb as g,cr as L,d5 as M,cx as N,cs as O,cE as P}from"./index.e310aebb.js";import{A as j}from"./index.1acd89cf.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},l=new Error().stack;l&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[l]="97b2ea8b-7751-4045-976d-3f21f22e1083",s._sentryDebugIdIdentifier="sentry-dbid-97b2ea8b-7751-4045-976d-3f21f22e1083")}catch{}})();const Q=T({__name:"View",props:{envVarRepository:{},mode:{},fileOpener:{}},setup(s){const l=s,{result:t,loading:k,refetch:f}=x(async()=>{const r=await A.create(l.envVarRepository,l.mode,l.fileOpener);return w(),r}),{startPolling:w,endPolling:C}=h({task:()=>{var r;return(r=t.value)==null?void 0:r.pollingFunction()},interval:2e3}),_={columns:[],rows:[]};return F(()=>{const r=d.subscribe("envVarCreated",()=>{f()}),n=d.subscribe("envVarEdited",()=>{f()});B(()=>{C(),d.unsubscribe(r),d.unsubscribe(n)})}),(r,n)=>{var v,b;return u(),I(U,null,[e(t)?(u(),m(V,{key:0,"entity-name":"Env var",loading:e(k),title:"Environment Variables",description:"Set environment variables for your project.","empty-title":"No environment variables set",table:e(t).table()||_,"create-button-text":"Add Environment Variable",create:e(t).create,fields:e(t).creationFields||[],live:e(t).isLocalEditor},S({_:2},[(v=e(t))!=null&&v.isLocalEditor?{name:"secondary",fn:a(()=>{var o;return[i(e(D),{onClick:(o=e(t))==null?void 0:o.openEnvFile},{default:a(()=>[c("Open .env")]),_:1},8,["onClick"])]}),key:"0"}:void 0,(b=e(t))!=null&&b.isLocalEditor?{name:"extra",fn:a(()=>[i(e(j),{"show-icon":"",style:{"margin-top":"20px"}},{message:a(()=>[c(" 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})]),key:"1"}:void 0,e(t)?{name:"more",fn:a(()=>[i(E,{model:e(t),disabled:!e(t).hasChanges()},{"with-changes":a(()=>[c(g(e(t).saveMessage),1)]),_:1},8,["model","disabled"])]),key:"2"}:void 0]),1032,["loading","table","create","fields","live"])):p("",!0),e(t)?(u(),m(e(P),{key:1,open:e(t).isUpdating,title:"Update value",onCancel:n[1]||(n[1]=o=>{var y;return(y=e(t))==null?void 0:y.cancelUpdate()}),onOk:n[2]||(n[2]=()=>{var o;return(o=e(t))==null?void 0:o.confirmUpdate()})},{default:a(()=>[e(t).state.value.type==="updating"?(u(),m(e(L),{key:0,layout:"vertical"},{default:a(()=>[i(e(O),null,{default:a(()=>[i(e(M),null,{default:a(()=>[c(g(e(t).state.value.name),1)]),_:1}),i(e(N),{value:e(t).state.value.value,"onUpdate:value":n[0]||(n[0]=o=>e(t).state.value.value=o)},null,8,["value"])]),_:1})]),_:1})):p("",!0)]),_:1},8,["open"])):p("",!0)],64)}}});export{Q as _};
//# sourceMappingURL=View.vue_vue_type_script_setup_true_lang.4d91a15c.js.map
