PageSourceSearch

https://podfriend.com/assets/LanguagePicker-D99wOj96.js

js podfriend.com collected 2026-10-02 10:13:52 UTC 3,018 bytes, 1 lines download raw bytes

1import{r as n,j as a}from"./vendor-react-DOIQJm1M.js";import{g as c}from"./index.modern-DH1nGOD2.js";import{P as h,a as b,b as x}from"./index-BgIkKSwn.js";import{c as j}from"./og-image.episode._id-DiXx5cb1.js";import{g as v,d as C,r as k,s as L}from"./language-prefs-DsNlV13K.js";import{C as y}from"./use-admin-BmNDkq_3.js";import"./vendor-radix-RJU8VpV1.js";import"./podcast-owner-api-BisQFHBF.js";import"./api-fetch-DaymAAS2.js";import"./vendor-supabase-Bux3oekT.js";import"./badge-Dmn2bjCo.js";import"./use-theme-Bvb7A0ov.js";import"./download-db-Dg_Q0jsO.js";import"./ap-api-CzBZ6HxO.js";const i=[{code:"en",label:"English",flag:"us"},{code:"es",label:"Español",flag:"es"},{code:"de",label:"Deutsch",flag:"de"},{code:"fr",label:"Français",flag:"fr"},{code:"pt",label:"Português",flag:"br"},{code:"ja",label:"日本語",flag:"jp"},{code:"ko",label:"한국어",flag:"kr"},{code:"zh",label:"中文",flag:"cn"},{code:"it",label:"Italiano",flag:"it"},{code:"nl",label:"Nederlands",flag:"nl"},{code:"sv",label:"Svenska",flag:"se"},{code:"da",label:"Dansk",flag:"dk"},{code:"no",label:"Norsk",flag:"no"},{code:"fi",label:"Suomi",flag:"fi"},{code:"ru",label:"Русский",flag:"ru"},{code:"pl",label:"Polski",flag:"pl"},{code:"tr",label:"Türkçe",flag:"tr"},{code:"hi",label:"हिन्दी",flag:"in"},{code:"ar",label:"العربية",flag:"sa"}];function R({lang:o,onLangChange:p}){var f,u;const[m,g]=n.useState(!1),[t,l]=n.useState(null),r=(f=i.find(e=>e.code===o))!=null?f:i[0];n.useEffect(()=>{if(v()){l(null);return}const e=C();if(!e||e===o){l(null);return}const s=k(e);if(!s){l(null);return}if(s.flag===r.flag){l(null);return}l(s)},[o,r.flag]);function d(e){L(e),p(e),g(!1),l(null)}return a.jsxs(a.Fragment,{children:[a.jsxs(h,{open:m,onOpenChange:g,children:[a.jsx(b,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent",children:[a.jsx(c,{countryCode:r.flag,width:16,height:16,cdnUrl:"https://hatscripts.github.io/circle-flags/flags/"}),r.label,a.jsx(y,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),a.jsx(x,{align:"start",className:"w-64 p-2",children:a.jsx("div",{className:"grid grid-cols-2 gap-0.5",children:i.map(e=>a.jsxs("button",{onClick:()=>d(e.code),className:j("flex items-center gap-2 rounded-md px-2.5 py-2 text-sm transition-colors",o===e.code?"bg-primary/10 font-medium text-primary":"text-foreground hover:bg-accent"),children:[a.jsx(c,{countryCode:e.flag,width:16,height:16,cdnUrl:"https://hatscripts.github.io/circle-flags/flags/"}),e.label]},e.code))})})]}),t&&a.jsxs("button",{onClick:()=>d(t.code),className:"flex items-center gap-1.5 rounded-md px-1 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[a.jsx(c,{countryCode:t.flag,width:12,height:12,cdnUrl:"https://hatscripts.github.io/circle-flags/flags/"}),"Change to ",(u=t.englishLabel)!=null?u:t.label,"?"]})]})}export{R as LanguagePicker};

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.