import{j as n,O as d,Q as r,T as m,w as x,aT as u}from"./app-BgLa5dit.js";const f="_option_1pmb2_1",g="_iconBase_1pmb2_7",h="_largeIcon_1pmb2_15",b="_text_1pmb2_18",c={option:f,iconBase:g,largeIcon:h,text:b};l.defaultProps={fontSize:"std"};function l(e){let s=`${c.option} rounded-3 px-1 mb-2`;e.enableHighlight&&e.isSelected&&(s+=" bg-light-blue"),e.isSelected&&(s+=" border-info"),e.disabled&&(s+=" text-secondary cursor-default");const i=n.jsxs(d,{onClick:e.onClick,className:s,children:[n.jsx(r,{svg:e.icon,className:`svg-container ${c.iconBase} ${e.iconSize==="large"?c.largeIcon:""} ${e.iconClassName||""}`}),n.jsx("h3",{className:`fw-normal w-100 px-2 text-center ${c.text} ${e.fontSize==="std"?"h6":"font-size-normal"} ${e.iconSize==="large"?"pt-2":""}`,children:e.name})]});return e.tooltip?n.jsx(m,{title:e.tooltip,spanHack:!0,children:i}):i}const j="_descriptionContainer_1psgp_1",_={descriptionContainer:j};function N(e){if(e.options.sort((i,o)=>i.order-o.order).some(i=>i.hasOwnProperty("groupName"))){const i=Object.entries(x.groupBy(e.options,"groupName"));return n.jsx(n.Fragment,{children:i.map(([o,t])=>u.createElement(a,{...e,groupName:o,key:t[0].id,options:t,selectedAction:e.selectedAction,setOption:e.setOption}))})}return n.jsx(a,{...e})}function a(e){var o;function s(t){if(!t.disabled){if(e.selectedAction===t.id){e.setOption(null);return}e.setOption(t.id)}}const i=(o=e.options.find(t=>t.id===e.selectedAction))==null?void 0:o.infoComponent;return n.jsxs(n.Fragment,{children:[e.groupName&&n.jsx("h3",{className:"h6 mt-2",children:e.groupName}),n.jsx("ul",{className:"list-unstyled d-flex align-items-center mx-n1 flex-wrap mb-1",children:e.options.map(t=>n.jsx("li",{className:"mx-1",children:n.jsx(l,{name:t.name,icon:t.icon,onClick:()=>s(t),isSelected:e.selectedAction===t.id,disabled:t.disabled,tooltip:t.tooltip,fontSize:t.fontSize,iconClassName:e.iconClassName,iconSize:e.iconSize,enableHighlight:e.enableHighlight})},t.id))}),n.jsx("div",{className:_.descriptionContainer,children:!!i&&n.jsx(i,{})})]})}export{N as W};
//# sourceMappingURL=S1bUYSnw.chunk.js.map
