import{j as o,L as g,R as h,b_ as f,cv as p,c7 as y,bq as j,dp as x,dj as v,dk as k,dl as P,a2 as D,d as m,K as l,df as L}from"./index-Dz5JRQhj.js";const O=({profile:s})=>o.jsx(g,{to:`${h}/ui/project/${encodeURIComponent(s?.project??"default")}/profile/${encodeURIComponent(s.name)}`,onClick:n=>{n.stopPropagation()},children:o.jsx(f,{item:s})}),b=({devices:s,className:n})=>{const a=s.filter(t=>!p(t)),e={};a.forEach(t=>{if(y(t)){if(j(t))return;x(t)?e.volume=(e.volume||0)+1:e.disk=(e.disk||0)+1}else v(t)?e.gpu=(e.gpu||0)+1:k(t)?e.proxy=(e.proxy||0)+1:P(t)&&(e.other=(e.other||0)+1)});const r={volume:"Volume",disk:"Disk",gpu:"GPU",proxy:"Proxy",other:"Other"},c=["volume","disk","gpu","proxy","other"].filter(t=>e[t]>0).map(t=>{const i=e[t],d=r[t]||t;return`${i} ${D(d,i)}`});return c.length>0?o.jsx(m.List,{items:c,middot:!0,className:l("u-no-margin devices-summary-list",n),title:c.join(", ")}):"-"},R=({profile:s,className:n})=>{if(!s)return"-";const a=Object.keys(s.config).some(i=>i.startsWith("security.")),e=Object.keys(s.config).some(i=>i.startsWith("snapshots.")),r=!!(s.config["migration.stateful"]||s.config["cluster.evacuate"]),u=Object.keys(s.config).some(i=>i.startsWith("boot.")),c=L(s),t=[a&&"Security policies",e&&"Snapshots",r&&"Migration",u&&"Boot",c&&"Cloud init"].filter(Boolean);return t.length>0?o.jsx(m.List,{items:t,middot:!0,className:l("u-no-margin profile-configuration-sections",n),title:t.join(", ")}):"-"},S=({profile:s})=>s.config["limits.cpu"]||s.config["limits.memory"]?o.jsx(m.List,{items:[`CPU: ${s.config["limits.cpu"]||"-"}`,`Memory: ${s.config["limits.memory"]||"-"}`],middot:!0,className:"u-no-margin"}):o.jsx(o.Fragment,{children:"-"});export{b as D,O as P,S as a,R as b};
