1import{j as n,f as m,r as u,z as h,A as b,aW as w}from"./index-ClQcrGAC.js";function v(t){const a=Array.from(t).map(r=>r.codePointAt(0)??0).filter(r=>r>=127462&&r<=127487).map(r=>String.fromCharCode(r-127462+97));return a.length===2?a.join(""):null}function f({flag:t,iso:a,className:r="",width:s=20,eager:o=!1}){const i=a&&a.length===2?a.toLowerCase():t?v(t):null;if(!i)return n.jsx("span",{"aria-hidden":"true",className:r,children:t});const c=Math.round(s*3/4);return n.jsx("img",{src:`/api/public/flag/24x18/${i}.png`,srcSet:`/api/public/flag/48x36/${i}.png 2x`,width:s,height:c,loading:o?"eager":"lazy",alt:"","aria-hidden":"true",className:`rounded-[2px] shrink-0 ${r}`})}function y(){const{lang:t,setLang:a,t:r}=m(),[s,o]=u.useState(!1),i=u.useRef(null),c=h(t),x=e=>typeof window>"u"?e==="de"?"/":`/${e}`:w(e,window.location);return u.useEffect(()=>{if(!s)return;const e=d=>{const p=i.current;p&&(p.contains(d.target)||o(!1))},l=d=>{d.key==="Escape"&&o(!1)},g=window.setTimeout(()=>{document.addEventListener("pointerdown",e),document.addEventListener("keydown",l)},0);return()=>{window.clearTimeout(g),document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",l)}},[s]),n.jsxs("div",{ref:i,className:"relative",children:[n.jsxs("button",{type:"button","aria-label":r("nav.language","Language"),"aria-haspopup":"listbox","aria-expanded":s,onClick:()=>o(e=>!e),className:"flex items-center gap-1.5 px-3 py-2 rounded-full text-sm font-medium border border-border bg-background hover:border-primary/40 transition-colors cursor-pointer select-none",children:[n.jsx(f,{flag:c.flag,eager:!0}),n.jsx("span",{className:"text-xs opacity-60",children:"â¾"})]}),s&&n.jsxs("div",{className:"absolute right-0 mt-2 w-56 rounded-xl border border-border bg-card shadow-lg z-[60] overflow-hidden",children:[n.jsx("div",{role:"listbox",className:"lang-scroll max-h-[70vh] py-1 pr-2",children:b.map(e=>n.jsxs("a",{href:x(e.code),role:"option","aria-selected":e.code===t,onClick:l=>{l.preventDefault(),o(!1),a(e.code)},className:`w-full text-left px-3 py-2 text-sm flex items-center gap-2 hover:bg-primary/5 ${e.code===t?"text-primary font-semibold":""}`,children:[n.jsx(f,{flag:e.flag}),n.jsx("span",{className:"flex-1",children:e.native}),n.jsx("span",{className:"text-xs opacity-50 uppercase",children:e.code})]},e.code))}),n.jsx("span",{"aria-hidden":"true",className:"lang-scroll-indicator"})]})]})}export{f as F,y as L};
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.