import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{X as t,c as n,f as r,l as i}from"./vendor-primevue-7po8Zk9v.js";import{$ as a,A as o,Bt as s,D as c,E as l,F as u,Ft as d,L as f,Lt as p,O as m,P as h,c as g,ht as _,k as v,tt as y,x as b}from"./vendor-vue-core-D3IvUUeM.js";import"./vendor-other-CrvBxfcV.js";import{n as x,t as S}from"./envUtil-DPL4J8Ws.js";import{t as C}from"./types-0oh-UGWL.js";import"./api-3C7_IVZO.js";import"./colorUtil-C83P1Arv.js";import"./i18n-DjEVEIh2.js";import{a as w,n as T,t as E,u as D}from"./systemStatsStore-gvlzOl4W.js";import{t as O}from"./useExternalLink-BZoBzmNd.js";import{t as k}from"./PanelTemplate-CuvxTtdx.js";var A={class:`grid grid-cols-2 gap-2`},j={class:`font-medium`},M=f({__name:`DeviceInfo`,props:{device:{}},setup(e){let t=e,n=[{field:`name`,header:`Name`},{field:`type`,header:`Type`},{field:`vram_total`,header:`VRAM Total`},{field:`vram_free`,header:`VRAM Free`},{field:`torch_vram_total`,header:`Torch VRAM Total`},{field:`torch_vram_free`,header:`Torch VRAM Free`}],formatValue=(e,t)=>{if([`vram_total`,`vram_free`,`torch_vram_total`,`torch_vram_free`].includes(t)){let t=Number(e);return Number.isFinite(t)?D(t):e}return e};return(e,r)=>(a(),o(`div`,A,[(a(),o(b,null,y(n,e=>(a(),o(b,{key:e.field},[c(`div`,j,s(e.header),1),c(`div`,null,s(formatValue(t.device[e.field],e.field)),1)],64))),64))]))}}),N={class:`system-stats`},P={class:`mb-6`},F={class:`mb-4 text-2xl font-semibold`},I={class:`grid grid-cols-2 gap-2`},L={class:`font-medium`},R={class:`mb-4 text-2xl font-semibold`},z=f({__name:`SystemStatsPanel`,props:{stats:{}},setup(e){let n=e,f=l(()=>({...n.stats.system,argv:n.stats.system.argv.join(` `)})),p=l(()=>n.stats.devices.length>0),h=[{field:`os`,header:`OS`},{field:`python_version`,header:`Python Version`},{field:`embedded_python`,header:`Embedded Python`},{field:`pytorch_version`,header:`Pytorch Version`},{field:`argv`,header:`Arguments`},{field:`ram_total`,header:`RAM Total`,formatNumber:D},{field:`ram_free`,header:`RAM Free`,formatNumber:D}],g=[{field:`cloud_version`,header:`Cloud Version`},{field:`comfyui_version`,header:`ComfyUI Version`,format:w},{field:`comfyui_frontend_version`,header:`Frontend Version`,format:w},{field:`workflow_templates_version`,header:`Templates Version`}],x=l(()=>C?g:h),getDisplayValue=e=>{let t=f.value[e.field];return e.formatNumber&&typeof t==`number`?e.formatNumber(t):e.format&&typeof t==`string`?e.format(t):t};return(e,l)=>(a(),o(`div`,N,[c(`div`,P,[c(`h2`,F,s(e.$t(`g.systemInfo`)),1),c(`div`,I,[(a(!0),o(b,null,y(x.value,e=>(a(),o(b,{key:e.field},[c(`div`,L,s(e.header),1),c(`div`,null,s(getDisplayValue(e)),1)],64))),128))])]),p.value?(a(),o(b,{key:0},[u(d(t)),c(`div`,null,[c(`h2`,R,s(e.$t(`g.devices`)),1),n.stats.devices.length>1?(a(),m(d(i),{key:0},{default:_(()=>[(a(!0),o(b,null,y(n.stats.devices,e=>(a(),m(d(r),{key:e.index,header:e.name,value:e.index},{default:_(()=>[u(M,{device:e},null,8,[`device`])]),_:2},1032,[`header`,`value`]))),128))]),_:1})):(a(),m(M,{key:1,device:n.stats.devices[0]},null,8,[`device`]))])],64)):v(``,!0)]))}});const B=g(`aboutPanel`,()=>{let e=T(),t=E(),{staticUrls:n}=O(),r=l(()=>t?.systemStats?.system?.comfyui_version??``),i=l(()=>[{label:`ComfyUI ${x()?`v`+S().getComfyUIVersion():w(r.value)}`,url:C?n.comfyOrg:n.github,icon:C?`pi pi-cloud`:`pi pi-github`},{label:`ComfyUI_frontend v1.39.8`,url:n.githubFrontend,icon:`pi pi-github`},{label:`Discord`,url:n.discord,icon:`pi pi-discord`},{label:`ComfyOrg`,url:n.comfyOrg,icon:`pi pi-globe`}]);return{badges:l(()=>[...i.value,...e.extensions.flatMap(e=>e.aboutPageBadges??[])])}});var V={class:`mb-2 text-2xl font-bold`},H={class:`space-y-2`},U=[`href`,`title`],W=f({__name:`AboutPanel`,setup(e){let r=E(),i=B();return(e,l)=>(a(),m(k,{value:`About`,class:`about-container`,"data-testid":`about-panel`},{default:_(()=>[c(`h2`,V,s(e.$t(`g.about`)),1),c(`div`,H,[(a(!0),o(b,null,y(d(i).badges,e=>(a(),o(`a`,{key:e.url,href:e.url,target:`_blank`,rel:`noopener noreferrer`,class:`about-badge inline-flex items-center no-underline`,title:e.url},[u(d(n),{class:`mr-2`},{icon:_(()=>[c(`i`,{class:p([e.icon,`mr-2 text-xl`])},null,2)]),default:_(()=>[h(` `+s(e.label),1)]),_:2},1024)],8,U))),128))]),u(d(t)),d(r).systemStats?(a(),m(z,{key:0,stats:d(r).systemStats},null,8,[`stats`])):v(``,!0)]),_:1}))}});export{W as default};
//# sourceMappingURL=AboutPanel-B6lMclOU.js.map