PageSourceSearch

https://flameproxies.com/assets/LanguageSwitcher-rAq_VE1J.js

js flameproxies.com collected 2026-10-01 23:51:51 UTC 2,102 bytes, 1 lines download raw bytes

1import{j as t}from"./jsx-runtime-DMY2L52G.js";import{d as h,r}from"./chunk-62JRHF6Z-6lUeWUJ3.js";import{u as g}from"./useTranslation-C--OALyH.js";import{C as b}from"./chevron-down-Bc0tqU_v.js";const l=[{code:"en",label:"English",flag:"https://flagcdn.com/w40/us.png"},{code:"ru",label:"Русский",flag:"https://flagcdn.com/w40/ru.png"}];function N({fullWidth:c=!1,size:p="sm"}){const{i18n:i}=g(),m=h(),[s,n]=r.useState(!1),o=r.useRef(null),x=e=>{i.changeLanguage(e),m.submit({language:e},{action:"/api/language",method:"post",encType:"application/json"}),n(!1)};r.useEffect(()=>{const e=f=>{o.current&&!o.current.contains(f.target)&&n(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const d=(i.language||"en").startsWith("ru")?"ru":"en",u=l.find(e=>e.code===d)??l[0],a=p==="md";return t.jsxs("div",{ref:o,className:`relative ${c?"block w-full":"inline-block"}`,children:[t.jsxs("button",{type:"button",onClick:()=>n(e=>!e),className:`flex items-center border border-[#373A41] bg-transparent text-white outline-none transition hover:border-[#61656C] ${c?"w-full":"min-w-[108px]"} ${a?"h-10 gap-2 rounded-[10px] px-3 text-sm":"h-8 gap-1.5 rounded-[8px] px-2.5 text-xs"}`,"aria-haspopup":"listbox","aria-expanded":s,children:[t.jsx("img",{src:u.flag,alt:"",className:`${a?"h-4 w-6":"h-3.5 w-5"} shrink-0 rounded-[2px] object-cover`}),t.jsx("span",{className:"flex-1 text-left",children:u.label}),t.jsx(b,{size:a?16:14,className:`text-[#8A8F98] transition-transform ${s?"rotate-180":""}`})]}),s?t.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-2 w-full overflow-hidden rounded-[10px] border border-[#373A41] bg-[#0C0E12] shadow-xl",children:l.map(e=>t.jsxs("button",{type:"button",role:"option","aria-selected":e.code===d,onClick:()=>x(e.code),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm text-white transition hover:bg-white/[0.06]",children:[t.jsx("img",{src:e.flag,alt:"",className:"h-4 w-6 shrink-0 rounded-[2px] object-cover"}),t.jsx("span",{children:e.label})]},e.code))}):null]})}export{N 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.