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