var D=Object.defineProperty;var m=(y,a)=>D(y,"name",{value:a,configurable:!0});import{defineComponent as E,watch as b,openBlock as e,createBlock as u,withCtx as l,createElementVNode as i,unref as r,toDisplayString as p,createElementBlock as s,Fragment as d,renderList as v,createVNode as c,createCommentVNode as g}from"vue";import{s as F}from"./vendor-vue-CazFs7AC.js";import C from"primevue/button";import M from"primevue/divider";import V from"primevue/message";import{useI18n as U}from"vue-i18n";import{l as O,cP as Q,cM as R,cQ as q,aV as z}from"./index-1hU-CrHv.js";import{u as G}from"./serverConfigStore-DLicSibJ.js";import"./vendor-other-CxTHhkh8.js";import"@primevue/themes";import"@primevue/themes/aura";import"primevue/config";import"primevue/confirmationservice";import"primevue/toastservice";import"primevue/tooltip";import"primevue/checkbox";import"primevue/scrollpanel";import"primevue/usetoast";import"primevue/card";import"primevue/listbox";import"primevue/skeleton";import"primevue/multiselect";import"primevue/inputtext";import"primevue/select";import"./vendor-xterm-DV1MVhAx.js";import"primevue/progressspinner";import"primevue/galleria";import"primevue/popover";import"primevue/iconfield";import"primevue/inputicon";import"primevue/badge";import"primevue/chip";import"primevue/contextmenu";import"primevue/tree";import"primevue/toolbar";import"primevue/progressbar";import"primevue";import"primevue/slider";import"./vendor-three-B-uslVEb.js";import"primevue/floatlabel";import"@primevue/forms";import"@primevue/forms/resolvers/zod";import"primevue/password";import"primevue/tag";import"primevue/inputnumber";import"primevue/tabpanels";import"primevue/tabs";import"primevue/tabpanel";import"primevue/toggleswitch";import"primevue/colorpicker";import"primevue/radiobutton";import"primevue/knob";import"primevue/panel";import"primevue/tabmenu";import"primevue/tab";import"primevue/tablist";import"primevue/autocomplete";import"primevue/dropdown";import"primevue/selectbutton";import"primevue/dialog";import"primevue/confirmpopup";import"primevue/useconfirm";import"primevue/confirmdialog";import"primevue/tieredmenu";import"primevue/chart";import"primevue/imagecompare";import"primevue/textarea";import"primevue/treeselect";import"./vendor-tiptap-fKn4WMvi.js";import"primevue/blockui";const H={class:"flex flex-col gap-2"},J={class:"flex justify-end gap-2"},K={class:"flex items-center justify-between"},fr=E({__name:"ServerConfigPanel",setup(y){const a=O(),h=G(),{serverConfigsByCategory:w,serverConfigValues:x,launchArgs:$,commandLineArgs:f,modifiedConfigs:_}=F(h),A=m(()=>{h.revertChanges()},"revertChanges"),I=m(async()=>{await z().restartApp()},"restartApp");b($,async t=>{await a.set("Comfy.Server.LaunchArgs",t)}),b(x,async t=>{await a.set("Comfy.Server.ServerConfigValues",t)});const{copyToClipboard:B}=Q(),L=m(async()=>{await B(f.value)},"copyCommandLineArgs"),{t:k}=U(),j=m(t=>({...t,name:k(`serverConfigItems.${t.id}.name`,t.name),tooltip:t.tooltip?k(`serverConfigItems.${t.id}.tooltip`,t.tooltip):void 0}),"translateItem");return(t,S)=>(e(),u(R,{value:"Server-Config",class:"server-config-panel"},{header:l(()=>[i("div",H,[r(_).length>0?(e(),u(r(V),{key:0,severity:"info","pt:text":"w-full"},{default:l(()=>[i("p",null,p(t.$t("serverConfig.modifiedConfigs")),1),i("ul",null,[(e(!0),s(d,null,v(r(_),o=>(e(),s("li",{key:o.id},p(o.name)+": "+p(o.initialValue)+" → "+p(o.value),1))),128))]),i("div",J,[c(r(C),{label:t.$t("serverConfig.revertChanges"),outlined:"",onClick:A},null,8,["label"]),c(r(C),{label:t.$t("serverConfig.restart"),outlined:"",severity:"danger",onClick:I},null,8,["label"])])]),_:1})):g("",!0),r(f)?(e(),u(r(V),{key:1,severity:"secondary","pt:text":"w-full"},{icon:l(()=>S[0]||(S[0]=[i("i",{class:"icon-[lucide--terminal] text-xl font-bold"},null,-1)])),default:l(()=>[i("div",K,[i("p",null,p(r(f)),1),c(r(C),{icon:"pi pi-clipboard",severity:"secondary",text:"",onClick:L})])]),_:1})):g("",!0)])]),default:l(()=>[(e(!0),s(d,null,v(Object.entries(r(w)),([o,N],P)=>(e(),s("div",{key:o},[P>0?(e(),u(r(M),{key:0})):g("",!0),i("h3",null,p(t.$t(`serverConfigCategories.${o}`,o)),1),(e(!0),s(d,null,v(N,n=>(e(),s("div",{key:n.name,class:"mb-4"},[c(q,{id:n.id,"form-value":n.value,"onUpdate:formValue":m(T=>n.value=T,"onUpdate:formValue"),item:j(n),"label-class":{"text-highlight":n.initialValue!==n.value}},null,8,["id","form-value","onUpdate:formValue","item","label-class"])]))),128))]))),128))]),_:1}))}});export{fr as default};
//# sourceMappingURL=ServerConfigPanel-Dd-4w0PT.js.map
