import{j as o,L as g,R as h,bW as f,cr as p,c3 as y,bm as x,dk as j,df as k,dg as v,dh as P,a2 as D,d as m,K as l,db as L}from"./index-C88DWJny.js";const C=({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})}),O=({devices:s,className:n})=>{const a=s.filter(t=>!p(t)),e={};a.forEach(t=>{if(y(t)){if(x(t))return;j(t)?e.volume=(e.volume||0)+1:e.disk=(e.disk||0)+1}else k(t)?e.gpu=(e.gpu||0)+1:v(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{O as D,C as P,S as a,R as b};
