1import{r as e,t}from"./jsx-runtime-BkSabwWG.js";import{z as n}from"./logo_VMV_blanc-B1BDEb6E.js";import{f as r}from"./MobileTabBar-CCRpNjdJ.js";import{t as i}from"./chevron-down-DEPMGZTO.js";import{E as a}from"./index-Dmfk4MRE.js";var o=e(n(),1),s=t();function c({value:e,values:t,options:n,onChange:c,onToggle:l,icon:u,ariaLabel:d,placeholder:f=`Sélectionner`,summaryLabel:p,align:m=`left`,allValue:h=a,triggerClassName:g=`bg-secondary`,labelClassName:_=`text-ink`}){let[v,y]=(0,o.useState)(!1),b=(0,o.useRef)(null),x=!!l;(0,o.useEffect)(()=>{if(!v)return;let e=e=>{b.current&&!b.current.contains(e.target)&&y(!1)},t=e=>{e.key===`Escape`&&y(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[v]);let S=t??[],C=t=>x?S.length===0?t===h:S.includes(t):t===e,w=n.find(t=>t.value===e),T=x?p??(S.length===0?f:S.length===1?S[0]:`${S.length} sélectionnés`):w?.label??f;return(0,s.jsxs)(`div`,{ref:b,className:`relative`,children:[(0,s.jsxs)(`button`,{type:`button`,onClick:()=>y(e=>!e),"aria-label":d,"aria-expanded":v,className:`flex items-center gap-1.5 rounded-full py-2 pr-2 pl-3 transition-colors duration-200 ${g}`,children:[(x?void 0:w?.icon)??u,(0,s.jsx)(`span`,{className:`text-sm font-bold whitespace-nowrap ${_}`,children:T}),(0,s.jsx)(i,{className:`h-4 w-4 opacity-60 transition-transform duration-200 ${v?`rotate-180`:``} ${_}`,strokeWidth:1.75})]}),v&&(0,s.jsx)(`div`,{className:`border-border/70 absolute z-50 mt-2 max-h-80 w-64 overflow-y-auto rounded-2xl border bg-white p-2 shadow-xl ${m===`right`?`right-0`:`left-0`}`,children:n.length===0?(0,s.jsx)(`p`,{className:`text-ink/50 px-3 py-2 text-sm`,children:`Aucune option disponible`}):n.map(e=>(0,s.jsxs)(`button`,{type:`button`,onClick:()=>{x?l?.(e.value):(c?.(e.value),y(!1))},className:`hover:bg-purple-100 hover:text-purple flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm font-bold transition-colors duration-200 ${C(e.value)?`bg-purple-100 text-purple`:`text-ink/80`}`,children:[x?(0,s.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[5px] border ${C(e.value)?`bg-purple border-purple`:`border-border bg-white`}`,children:C(e.value)?(0,s.jsx)(r,{className:`h-3 w-3 text-white`,strokeWidth:3}):null}):e.icon,(0,s.jsx)(`span`,{className:`truncate`,children:e.label})]},e.value))})]})}export{c as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.