import{ao as t,a_ as d,bl as r,c0 as o,gy as u,bS as x,bT as m}from"./app-k0jcl5PQ.js";import{a as g}from"./BcYgJJPz.chunk.js";const _="_preferenceItem_1ieg4_1",h="_expandCaret_1ieg4_1",C="_up_1ieg4_1",S="_down_1ieg4_1",f="_disabled_1ieg4_25",b="_selected_1ieg4_40",j="_noBorder_1ieg4_53",v="_textBox_1ieg4_67",k="_itemStatus_1ieg4_88",B="_unchecked_1ieg4_96",I="_green_1ieg4_99",s={preferenceItem:_,expandCaret:h,up:C,down:S,disabled:f,selected:b,noBorder:j,textBox:v,itemStatus:k,unchecked:B,green:I},w=e=>e.selectedChildrenCount?t.jsx("div",{className:`${s.itemStatus} ${s.green}`,children:e.selectedChildrenCount}):t.jsx(t.Fragment,{}),$=e=>{let n;return e.selected?n=t.jsx(d,{svg:r}):e.radioButton?n=t.jsx(t.Fragment,{children:" "}):n=t.jsx(d,{svg:o}),t.jsx("div",{className:`${s.itemStatus} ${e.selected?s.green:s.unchecked}`,children:n})};function N(e){function n(){let a=`rounded-3 ${s.preferenceItem}`;return e.extraClasses&&(a+=" "+e.extraClasses),e.isDisabled&&(a+=" "+s.disabled),e.isSelected&&!e.isExpandable&&(a+=" "+s.selected),e.hideStatus&&(a+=" "+s.noBorder),a}const l=`${s.expandCaret} ${e.expand?s.up:s.down}`;return t.jsx("li",{className:n(),onClick:e.onClick,"aria-checked":e.isSelected,"aria-haspopup":e.isExpandable,role:e.isExpandable?"button":"checkbox",style:{backgroundImage:`url(${e.imageUrl})`},tabIndex:0,title:e.name,children:t.jsxs("div",{className:`${s.textBox} p-2`,children:[t.jsxs("p",{className:"clamp-2 mb-0",children:[e.name,t.jsx("span",{className:e.isExpandable?l:""})]}),!e.hideStatus&&t.jsx(t.Fragment,{children:e.isExpandable?t.jsx(w,{selectedChildrenCount:e.selectedChildCount}):t.jsx($,{selected:e.isSelected,radioButton:e.radioButton})})]})})}function y(e){var i,c;const{presentation:n,onSelect:l,isSelected:a}=e;return n.type!==u.Subject?t.jsx(t.Fragment,{}):e.showCoverPills?t.jsx(g,{data:n,coverUrl:(i=n.cover)==null?void 0:i.url,isSelected:a,onClick:()=>l(n),className:"w-100 flex-grow-1"}):t.jsx(N,{name:n.name,imageUrl:x.createUrl((c=n.cover)==null?void 0:c.url,{size:m.Medium})||"",onClick:()=>l(n),isSelected:a,radioButton:!0},n.id)}function F(e){const{schoolLevels:n,onSelect:l,selectedId:a}=e;return t.jsx("ul",{className:"list-unstyled d-flex justify-content-center gap-2 flex-wrap",children:n.map((i,c)=>t.jsx(y,{presentation:i,onSelect:l,isSelected:a===i.id,showCoverPills:e.showCoverPills},c))})}export{F as S};
//# sourceMappingURL=CSEWPTB7.chunk.js.map
