PageSourceSearch

https://chatintime.com/_next/static/chunks/05_xqc4zntjoo.js

js chatintime.com collected 2026-10-07 21:37:06 UTC 110,522 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86385,e=>{"use strict";var t=e.i(43476),a=e.i(22016),r=e.i(20983),s=e.i(71645);let i=s.forwardRef(function({title:e,titleId:t,...a},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},a),e?s.createElement("title",{id:t},e):null,s.createElement("path",{d:"M12.75 12.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM7.5 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.25 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM9.75 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM10.5 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM12.75 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM14.25 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM15 17.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM16.5 15.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM15 12.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM16.5 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z"}),s.createElement("path",{fillRule:"evenodd",d:"M6.75 2.25A.75.75 0 0 1 7.5 3v1.5h9V3A.75.75 0 0 1 18 3v1.5h.75a3 3 0 0 1 3 3v11.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V7.5a3 3 0 0 1 3-3H6V3a.75.75 0 0 1 .75-.75Zm13.5 9a1.5 1.5 0 0 0-1.5-1.5H5.25a1.5 1.5 0 0 0-1.5 1.5v7.5a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5v-7.5Z",clipRule:"evenodd"}))}),n=s.forwardRef(function({title:e,titleId:t,...a},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},a),e?s.createElement("title",{id:t},e):null,s.createElement("path",{d:"M4.913 2.658c2.075-.27 4.19-.408 6.337-.408 2.147 0 4.262.139 6.337.408 1.922.25 3.291 1.861 3.405 3.727a4.403 4.403 0 0 0-1.032-.211 50.89 50.89 0 0 0-8.42 0c-2.358.196-4.04 2.19-4.04 4.434v4.286a4.47 4.47 0 0 0 2.433 3.984L7.28 21.53A.75.75 0 0 1 6 21v-4.03a48.527 48.527 0 0 1-1.087-.128C2.905 16.58 1.5 14.833 1.5 12.862V6.638c0-1.97 1.405-3.718 3.413-3.979Z"}),s.createElement("path",{d:"M15.75 7.5c-1.376 0-2.739.057-4.086.169C10.124 7.797 9 9.103 9 10.609v4.285c0 1.507 1.128 2.814 2.67 2.94 1.243.102 2.5.157 3.768.165l2.782 2.781a.75.75 0 0 0 1.28-.53v-2.39l.33-.026c1.542-.125 2.67-1.433 2.67-2.94v-4.286c0-1.505-1.125-2.811-2.664-2.94A49.392 49.392 0 0 0 15.75 7.5Z"}))});var l=e.i(63608);let c=s.forwardRef(function({title:e,titleId:t,...a},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},a),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M12.963 2.286a.75.75 0 0 0-1.071-.136 9.742 9.742 0 0 0-3.539 6.176 7.547 7.547 0 0 1-1.705-1.715.75.75 0 0 0-1.152-.082A9 9 0 1 0 15.68 4.534a7.46 7.46 0 0 1-2.717-2.248ZM15.75 14.25a3.75 3.75 0 1 1-7.313-1.172c.628.465 1.35.81 2.133 1a5.99 5.99 0 0 1 1.925-3.546 3.75 3.75 0 0 1 3.255 3.718Z",clipRule:"evenodd"}))});var o=e.i(59808),d=e.i(30113),h=e.i(25521),u=e.i(6315),m=e.i(23274),p=e.i(33957),f=e.i(54827);function x({locale:e,p:s=f.palette,dense:g=!1,onChat:w}){let b=m.UI.account,v=m.UI.chat,{primaryColor:y}=h.default,{account:j,loading:k,error:N}=(0,p.useAccount)({mint:!0}),S=(0,p.useSnapshot)(),C=j?.rules??p.DEFAULT_RULES,E=j?.karma??(S?{...p.EMPTY_KARMA,balance:S.balance,streak:S.streak}:p.EMPTY_KARMA),I=j?.user??null,T=!p.API_BASE||"unavailable"===N;return(0,t.jsxs)(t.Fragment,{children:[T&&(0,t.jsxs)("div",{className:`${g?"mt-4":"mt-6"} flex items-start gap-2.5 rounded-2xl px-4 py-3 text-sm bg-amber-500/10 text-amber-500 ring-1 ring-amber-500/20`,role:"status",children:[(0,t.jsx)(l.ExclamationCircleIcon,{className:"w-5 h-5 shrink-0"}),(0,t.jsx)("span",{children:b.errUnavailable[e]})]}),(0,t.jsxs)("section",{className:`${g?"mt-4":"mt-8"} rounded-3xl overflow-hidden ${s.card}`,"aria-busy":k,children:[(0,t.jsxs)("div",{className:`flex items-center gap-4 ${g?"p-5":"p-6 sm:p-7"}
1`,children:[(0,t.jsx)("span",{className:"w-14 h-14 rounded-2xl flex items-center justify-center shrink-0",style:{backgroundColor:`${y}22`,color:y},children:(0,t.jsx)(o.SparklesIcon,{className:"w-7 h-7"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:`text-xs font-semibold uppercase tracking-wide ${s.sub}`,children:b.balanceLabel[e]}),(0,t.jsxs)("p",{className:`text-4xl sm:text-5xl font-bold tabular-nums leading-tight ${s.h}`,children:[E.balance.toLocaleString(e),(0,t.jsx)("span",{className:`text-lg font-semibold ml-2 ${s.sub}`,children:v.karma[e]})]}),!I&&(0,t.jsx)("p",{className:`text-[13px] mt-0.5 ${s.sub}`,children:b.onThisDevice[e]})]})]}),(0,t.jsx)("dl",{className:`grid grid-cols-3 border-t ${s.divider}`,children:[{icon:c,tint:E.streak>0?"text-orange-400":void 0,value:E.streak.toLocaleString(e),label:b.statStreak[e]},{icon:o.SparklesIcon,value:E.earnedTotal.toLocaleString(e),label:b.statEarned[e]},{icon:n,value:`${E.chatToday}/${C.chatDailyCap}`,label:b.statToday[e]}].map((e,a)=>(0,t.jsxs)("div",{className:`px-3 py-4 sm:px-5 text-center ${a>0?`border-l ${s.divider}`:""}`,children:[(0,t.jsxs)("dd",{className:`flex items-center justify-center gap-1.5 text-lg font-bold tabular-nums ${s.h}`,children:[(0,t.jsx)(e.icon,{className:`w-4 h-4 shrink-0 ${e.tint??"opacity-40"}`}),e.value]}),(0,t.jsx)("dt",{className:`text-[11px] leading-snug mt-0.5 ${s.sub}`,children:e.label})]},e.label))}),0===E.balance&&(w?(0,t.jsx)("div",{className:"px-5 pb-5 pt-1",children:(0,t.jsxs)("button",{type:"button",onClick:w,className:`${f.primaryBtn} h-11 px-5 text-sm`,style:{backgroundColor:y},children:[b.chatToEarn[e],(0,t.jsx)(r.ArrowRightIcon,{className:"w-4 h-4"})]})}):(0,t.jsx)("div",{className:"px-6 pb-6 sm:px-7 pt-1",children:(0,t.jsxs)(a.default,{href:(0,u.localizedPath)(e,"/chat"),className:`${f.primaryBtn} h-11 px-5 text-sm`,style:{backgroundColor:y},children:[b.chatToEarn[e],(0,t.jsx)(r.ArrowRightIcon,{className:"w-4 h-4"})]})}))]}),(0,t.jsxs)("section",{className:g?"mt-6":"mt-10",children:[(0,t.jsx)("h2",{className:`${g?"text-lg mb-3":"text-xl sm:text-2xl mb-4"} font-bold ${s.h}`,children:b.earnTitle[e]}),(0,t.jsx)("ul",{className:`rounded-2xl divide-y ${s.card} ${s.rows}`,children:[{icon:n,title:b.earnChatTitle[e],text:(0,m.tpl)(b.earnChat[e],{n:String(C.chatPerMinute),max:String(C.chatMaxPerSession),c
1ap:String(C.chatDailyCap)})},{icon:i,title:b.earnDailyTitle[e],text:(0,m.tpl)(b.earnDaily[e],{n:String(C.dailyBonus),step:String(C.streakStep),max:String(C.dailyBonus+C.streakMaxBonus)})},{icon:d.UserPlusIcon,title:b.earnSignupTitle[e],text:(0,m.tpl)(b.earnSignup[e],{n:String(C.signupBonus)})}].map(e=>(0,t.jsxs)("li",{className:`flex items-start gap-4 ${g?"px-4 py-3.5":"px-5 py-4"}`,children:[(0,t.jsx)("span",{className:"w-9 h-9 rounded-xl flex items-center justify-center shrink-0 mt-0.5",style:{backgroundColor:`${y}1f`,color:y},children:(0,t.jsx)(e.icon,{className:"w-[18px] h-[18px]"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:`font-semibold ${s.h}`,children:e.title}),(0,t.jsx)("p",{className:`text-sm leading-relaxed ${s.body}`,children:e.text})]})]},e.title))})]})]})}e.s(["KarmaPanel",0,x,"default",0,function({locale:e}){let a=m.UI.karma,r=f.palette;return(0,t.jsx)("main",{className:`flex-1 ${r.main}`,children:(0,t.jsxs)("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-10 sm:py-14",children:[(0,t.jsx)("h1",{className:`text-3xl sm:text-4xl font-bold tracking-tight mb-3 ${r.h}`,children:a.title[e]}),(0,t.jsx)("p",{className:`leading-relaxed max-w-2xl ${r.body}`,children:a.intro[e]}),(0,t.jsx)(x,{locale:e})]})})}],86385)},40015,e=>{"use strict";e.i(47167);var t=e.i(43476),a=e.i(71645),r=e.i(74080),s=e.i(22016),i=e.i(18566);let n=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M18.75 12.75h1.5a.75.75 0 0 0 0-1.5h-1.5a.75.75 0 0 0 0 1.5ZM12 6a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 12 6ZM12 18a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 12 18ZM3.75 6.75h1.5a.75.75 0 1 0 0-1.5h-1.5a.75.75 0 0 0 0 1.5ZM5.25 18.75h-1.5a.75.75 0 0 1 0-1.5h1.5a.75.75 0 0 1 0 1.5ZM3 12a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 3 12ZM9 3.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5ZM12.75 12a2.25 2.25 0 1 1 4.5 0 2.25 2.25 0 0 1-4.5 0ZM9 15.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Z"}))}),l=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M11.03 3.97a.75.75 0 0 1 0 1.06l-6.22 6.22H21a.75.75 0 0 1 0 1.5H4.81l6.22 6.22a.75.75 0 1 1-1.06 1.06l-7.5-7.5a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}),c=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",clipRule:"evenodd"}))});var o=e.i(20983);let d=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M4.804 21.644A6.707 6.707 0 0 0 6 21.75a6.721 6.721 0 0 0 3.583-1.029c.774.182 1.584.279 2.417.279 5.322 0 9.75-3.97 9.75-9 0-5.03-4.428-9-9.75-9s-9.75 3.97-9.75 9c0 2.409 1.025 4.587 2.674 6.192.232.226.277.428.254.543a3.73 3.73 0 0 1-.814 1.686.75.75 0 0 0 .44 1.223ZM8.25 10.875a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25ZM10.875 12a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Zm4.875-1.125a1.125 1.125 0 1 0 0 2.25 1.125 1.125 0 0 0 0-2.25Z",clipRule:"evenodd"}))}),h=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}),u=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 0 0-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 0 0-2.282.819l-.922 1.597a1.875 1.875 0 0 0 .432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 0 0 0 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 0 0-.432 2.385l.922 1.597a1.875 1.875 0 0 0 2.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.985.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 0 0 2.28-.819l.923-1.597a1.875 1.875 0 0 0-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 0 0 0-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 0 0-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 0 0-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 0 0-1.85-1.567h-1.843ZM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5Z",clipRule:"evenodd"}))}),m=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M10.5 18.75a.75.75 0 0 0 0 1.5h3a.75.75 0 0 0 0-1.5h-3Z"}),a.createElement("path",{fillRule:"evenodd",d:"M8.625.75A3.375 3.375 0 0 0 5.25 4.125v15.75a3.375 3.375 0 0 0 3.375 3.375h6.75a3.375 3.375 0 0 0 3.375-3.375V4.125A3.375 3.375 0 0 0 15.375.75h-6.75ZM7.5 4.125C7.5 3.504 8.004 3 8.625 3H9.75v.375c0 .621.504 1.125 1.125 1.125h2.25c.621 0 1.125-.504 1.125-1.125V3h1.125c.621 0 1.125.504 1.125 1.125v15.75c0 .621-.504 1.125-1.125 1.125h-6.75A1.125 1.125 0 0 1 7.5 19.875V4.125Z",clipRule:"evenodd"}))}),p=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M3 2.25a.75.75 0 0 1 .75.75v.54l1.838-.46a9.75 9.75 0 0 1 6.725.738l.108.054A8.25 8.25 0 0 0 18 4.524l3.11-.732a.75.75 0 0 1 .917.81 47.784 47.784 0 0 0 .005 10.337.75.75 0 0 1-.574.812l-3.114.733a9.75 9.75 0 0 1-6.594-.77l-.108-.054a8.25 8.25 0 0 0-5.69-.625l-2.202.55V21a.75.75 0 0 1-1.5 0V3A.75.75 0 0 1 3 2.25Z",clipRule:"evenodd"}))}),f=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M19.902 4.098a3.75 3.75 0 0 0-5.304 0l-4.5 4.5a3.75 3.75 0 0 0 1.035 6.037.75.75 0 0 1-.646 1.353 5.25 5.25 0 0 1-1.449-8.45l4.5-4.5a5.25 5.25 0 1 1 7.424 7.424l-1.757 1.757a.75.75 0 1 1-1.06-1.06l1.757-1.757a3.75 3.75 0 0 0 0-5.304Zm-7.389 4.267a.75.75 0 0 1 1-.353 5.25 5.25 0 0 1 1.449 8.45l-4.5 4.5a5.25 5.25 0 1 1-7.424-7.424l1.757-1.757a.75.75 0 1 1 1.06 1.06l-1.757 1.757a3.75 3.75 0 1 0 5.304 5.304l4.5-4.5a3.75 3.75 0 0 0-1.035-6.037.75.75 0 0 1-.354-1Z",clipRule:"evenodd"}))}),x=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M8.25 4.5a3.75 3.75 0 1 1 7.5 0v8.25a3.75 3.75 0 1 1-7.5 0V4.5Z"}),a.createElement("path",{d:"M6 10.5a.75.75 0 0 1 .75.75v1.5a5.25 5.25 0 1 0 10.5 0v-1.5a.75.75 0 0 1 1.5 0v1.5a6.751 6.751 0 0 1-6 6.709v2.291h3a.75.75 0 0 1 0 1.5h-7.5a.75.75 0 0 1 0-1.5h3v-2.291a6.751 6.751 0 0 1-6-6.709v-1.5A.75.75 0 0 1 6 10.5Z"}))}),g=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"}))});var w=e.i(59808);let b=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M13.5 4.06c0-1.336-1.616-2.005-2.56-1.06l-4.5 4.5H4.508c-1.141 0-2.318.664-2.66 1.905A9.76 9.76 0 0 0 1.5 12c0 .898.121 1.768.35 2.595.341 1.24 1.518 1.905 2.659 1.905h1.93l4.5 4.5c.945.945 2.561.276 2.561-1.06V4.06ZM17.78 9.22a.75.75 0 1 0-1.06 1.06L18.44 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06l1.72-1.72 1.72 1.72a.75.75 0 1 0 1.06-1.06L20.56 12l1.72-1.72a.75.75 0 1 0-1.06-1.06l-1.72 1.72-1.72-1.72Z"}))}),v=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z",clipRule:"evenodd"}))}),y=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z",clipRule:"evenodd"}))}),j=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M4.5 6.375a4.125 4.125 0 1 1 8.25 0 4.125 4.125 0 0 1-8.25 0ZM14.25 8.625a3.375 3.375 0 1 1 6.75 0 3.375 3.375 0 0 1-6.75 0ZM1.5 19.125a7.125 7.125 0 0 1 14.25 0v.003l-.001.119a.75.75 0 0 1-.363.63 13.067 13.067 0 0 1-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 0 1-.364-.63l-.001-.122ZM17.25 19.128l-.001.144a2.25 2.25 0 0 1-.233.96 10.088 10.088 0 0 0 5.06-1.01.75.75 0 0 0 .42-.643 4.875 4.875 0 0 0-6.957-4.611 8.586 8.586 0 0 1 1.71 5.157v.003Z"}))});var k=e.i(72102);let N=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M.97 3.97a.75.75 0 0 1 1.06 0l15 15a.75.75 0 1 1-1.06 1.06l-15-15a.75.75 0 0 1 0-1.06ZM17.25 16.06l2.69 2.69c.944.945 2.56.276 2.56-1.06V6.31c0-1.336-1.616-2.005-2.56-1.06l-2.69 2.69v8.12ZM15.75 7.5v8.068L4.682 4.5h8.068a3 3 0 0 1 3 3ZM1.5 16.5V7.682l11.773 11.773c-.17.03-.345.045-.523.045H4.5a3 3 0 0 1-3-3Z"}))});var S=e.i(25521),C=e.i(6315),E=e.i(23274),I=e.i(65254),T=e.i(33957);let M=[{urls:["stun:stun.cloudflare.com:3478","stun:stun.l.google.com:19302"]}],R=new Map;async function A(e){let t=R.get(e);if(t||(t={},R.set(e,t)),t.value&&t.value.expiresAt>Date.now()+6e4)return t.value;if(t.pending)return t.pending;let a=t;return a.pending=(async()=>{let t=new AbortController,r=setTimeout(()=>t.abort(),4e3);try{let r=await fetch(e.replace(/^ws/,"http").replace(/\/match$/,"/ice"),{signal:t.signal,cache:"no-store"});if(!r.ok)return null;let s=await r.json();if(!s.iceServers?.length)return null;let i={iceServers:s.iceServers,expiresAt:Number(s.expiresAt)||Date.now()+3e5};return a.value=i,i}catch{return null}finally{clearTimeout(r),a.pending=void 0}})(),a.pending}class U{url;handlers;matchTimeoutMs;ws=null;socketAnnounced=!1;pc=null;peerGeneration=0;dc=null;localStream=null;iceServers=M;
1iceLoaded=!1;iceExpiresAt=1/0;icePromise=null;spare=null;spareTimer=null;preparing=!1;matchRoom=null;earlySignals=[];earlyCandidates=[];signalChain=Promise.resolve();firstFrameTimer=null;adminMatching=!1;get allowsClips(){return!this.adminMatching}clipCheck=null;receivedFrame=!1;displayedStream=null;restartedIce=!1;attempt=null;mediaTimer=null;clock(){return"u">typeof performance?performance.now():Date.now()}mark(e){this.attempt&&void 0===this.attempt.marks[e]&&(this.attempt.marks[e]=Math.round(this.clock()-this.attempt.started))}beginAttempt(e){!this.attempt&&"u">typeof crypto&&(this.attempt={id:crypto.randomUUID(),started:this.clock(),trigger:e,marks:{},path:"unknown"})}finishAttempt(e){let t=this.attempt;if(this.attempt=null,!t||"u"<typeof navigator)return;let a=JSON.stringify({id:t.id,trigger:t.trigger,marks:t.marks,path:t.path,outcome:e,elapsed:Math.round(this.clock()-t.started)}),r=this.url.replace(/^ws/,"http").replace(/\/match$/,"/match-metrics");try{navigator.sendBeacon?.(r,a)||fetch(r,{method:"POST",body:a,keepalive:!0}).catch(()=>{})}catch{}}onPageLeft=()=>{this.finishAttempt("page-left"),this.closeSpare()};onNetworkChange=()=>{R.delete(this.url),this.iceExpiresAt=0,this.closeSpare(),this.isSearching&&this.preparePeer()};onVisible=()=>{document.hidden?this.closeSpare():this.isSearching&&this.preparePeer()};roomHost=!1;profile=null;searchTimer=null;reconnectTimer=null;keepAliveTimer=null;connectWatchdog=null;destroyed=!1;stopped=!1;clipReservation=null;state="idle";polite=!1;makingOffer=!1;ignoreOffer=!1;constructor(e){this.url=e.url,this.matchTimeoutMs=e.matchTimeoutMs??5e3,this.handlers=e,window.addEventListener("pagehide",this.onPageLeft),window.addEventListener("online",this.onNetworkChange),document.addEventListener("visibilitychange",this.onVisible)}setLocalStream(e){if(this.localStream=e,!e||!this.pc)return;let t=this.pc.getSenders();for(let a of e.getTracks()){let r=t.find(e=>null===e.track&&e.getParameters);if(r)r.replaceTrack(a).catch(()=>{});else if(!t.some(e=>e.track===a))try{this.pc.addTrack(a,e)}catch{}}this.applyBitrateCap()}setState(e){this.state!==e&&(this.state=e,this.handlers.onState(e))}get isSearching(){return!this.stopped&&!this.destroyed&&("searching"===this.state||"fallback"===this.state)}async loadIceServers(){let e=await A(this.url);e&&(this.iceServers=e.iceServers,this.iceExpiresAt=e.expiresAt,this.iceLoaded=!0)}ensureIceServers(){return this.iceLoaded&&this.iceExpiresAt>Date.now()+6e4?Promise.resolve():(this.icePromise||(this.icePromise=this.loadIceServers().finally(()=>{this.icePromise=null})),this.icePromise)}closeSpare(){this.spareTimer&&clearTimeout(this.spareTimer),this.spareTimer=null,this.spare?.close(),this.spare=null}async preparePeer(){if(this.preparing||this.spare||this.stopped||this.destroyed||this.matchRoom)return;this.preparing=!0;let e=this.peerGeneration;try{if(await this.ensureIceServers(),e!==this.peerGeneration||this.stopped||this.destroyed||this.matchRoom)return;try{this.spare=new RTCPeerConnection({iceServers:this.iceServers,iceCandidatePoolSize:1})}catch{return}this.spareTimer=setTimeout(()=>{this.closeSpare(),this.isSearching&&("u"<typeof document||!document.hidden)&&this.preparePeer()},Math.max(1e3,Math.min(12e4,this.iceExpiresAt-Date.now()-6e4)))}finally{this.preparing=!1}}async start(e,t={}){this.profile=e,this.roomHost=!!(t.host&&e.room),this.destroyed=!1,this.stopped=!1,this.beginAttempt("start"),this.ensureIceServers(),this.preparePeer(),this.connectSocket()}connectSocket(){if(!this.destroyed&&this.profile&&this.ws?.readyState!==WebSocket.OPEN&&this.ws?.readyState!==WebSocket.CONNECTING){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.socketAnnounced=!1;try{this.ws=new WebSocket(this.url)}catch{this.setState("fallback");return}this.ws.onopen=()=>{(this.startKeepAlive(),this.stopped)?this.setState("idle"):this.announceProfile()},this.ws.onmessage=e=>this.onSignal(e),this.ws.onclose=e=>{if(this.finishAttempt("socket-closed"),this.matchRoom=null,this.closeSpare(),this.stopKeepAlive(),!this.destroyed){if(this.teardownPeer(),("connected"===this.state||"connecting"===this.state)&&this.setState("fallback"),1008===e.code){this.stopped=!0,this.setState("idle");return}this.reconnectTimer=setTimeout(()=>this.connectSocket(),3e3)}},this.ws.onerror=()=>{this.stopped||this.destroyed||("searching"===this.state||"idle"===this.state)&&this.setState("fallback")}}}announceProfile(){this.beginAttempt("reconnect"),this.preparePeer(),this.setState("searching");let e=(0,I.loadClientId)(),t=(0,T.loadToken)();this.send({t:"hello",fast:!0,profile:this.profile,path:"u">typeof location?location.pathname:void 0,...e?{cid:e}:{},...t?{auth:t}:{},...this.roomHost?{host:!0}:{}}),this.socketAnnounced=!0,this.armSearchTimeout()}startKeepAlive(){this.stopKeepAlive(),this.keepAliveTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.send({t:"ping"})},25e3)}clearConnectWatchdog(){this.connectWatchdog&&(clearTimeout(this.connectWatchdog),this.connectWatchdog=null)}stopKeepAlive(){this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=null)}armSearchTimeout(){this.clearSearchTimeout(),this.searchTimer=setTimeout(()=>{"searching"===this.state&&this.setState("fallback")},this.matchTimeoutMs)}clearSearchTimeout(){this.searchTimer&&(clearTimeout(this.searchTimer),this.searchTimer=null)}send(e){this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify("signal"===e.t?{...e,room:this.matchRoom}:e))}async onSignal(e){let t;try{t=JSON.parse(e.data)}catch{return}switch(t.t){case"hello-ack":this.mark("ack"),this.adminMatching=!0===t.adminMatching,this.handlers.onFilters?.(P(t));break;case"queued":this.mark("ack");break;case"clip-clear":this.clipCheck&&this.clipCheck.id===t.request&&(clearTimeout(this.clipCheck.timer),this.clipCheck.resolve(!0===t.clear&&this.isSearching),this.clipCheck=null);break;case"filters":this.adminMatching=!0===t.adminMatching,this.handlers.onFilters?.(P(t));break;case"karma":"number"==typeof t.balance&&this.handlers.onKarma?.({balance:t.balance,delta:"number"==typeof t.delta?t.delta:0,..."number"==typeof t.streak?{streak:t.streak}:{},..."chat"===t.reason||"daily"===t.reason||"filter"===t.reason?{reason:t.reason}:{}});break;case"thin":if(this.stopped)return;this.handlers.onThin?.();break;case"waiting":if(this.stopped)return;this.setState("searching");break;case"room-empty":if(this.stopped)return;this.leaveRoom(),this.handlers.onRoomEmpty?.();break;case"matched":if(this.stopped)return void this.send({t:"stop",...this.clipReservation});this.leaveRoom(),this.matchRoom="string"==typeof t.room?t.room:null,this.mark("matched"),this.attempt&&"number"==typeof t.queueMs&&(this.attempt.marks.queue=t.queueMs),this.clearSearchTimeout(),this.setState("connecting"),this.handlers.onPeer(t.peer??null),await this.openPeerConnection(!!t.initiator);break;case"signal":if(this.stopped||t.room&&t.room!==this.matchRoom)return;if(!this.pc){this.matchRoom&&this.earlySignals.length<128&&this.earlySignals.push(t.data);return}await this.enqueueSignal(t.data);break;case"peer-left":if(this.stopped)return;this.finishAttempt("peer-left"),this.beginAttempt("peer-left"),this.teardownPeer(),this.matchRoom=null,this.handlers.onPeer(null),this.handlers.onRemoteStream(null),this.setState("searching"),this.armSearchTimeout(),this.preparePeer()}}async openPeerConnection(e){this.teardownPeer();let t=this.peerGeneration;if(this.iceExpiresAt<=Date.now()+6e4&&this.closeSpare(),await this.ensureIceServers(),this.stopped||this.destroyed||t!==this.peerGeneration)return;this.polite=!e;let a=this.spare??new RTCPeerConnection({iceServers:this.iceServers});if(this.spare=null,this.spareTimer&&clearTimeout(this.spareTimer),this.spareTimer=null,this.pc=a,this.mark("peer"),this.localStream)for(let e of this.localStream.getTracks())a.addTrack(e,this.localStream);else a.addTransceiver("video",{direction:"recvonly"}),a.addTransceiver("audio",{direction:"recvonly"});let r=null;if(a.ontrack=e=>{if(this.pc!==a||this.stopped||this.destroyed)return;this.mark("track");let t=e.streams.find(e=>e.getVideoTracks().length>0)??e.streams[0];if(t&&(!r||t.getVideoTracks().length>0)?r=t:t||(r=new MediaStream(r?.getTracks()??[])),r){for(let{track:e}of a.getReceivers())"ended"===e.readyState||r.getTracks().some(t=>t.id===e.id)||r.addTrack(e);
1this.handlers.onRemoteStream(r),this.displayedStream=r}},a.onicecandidate=e=>{this.pc===a&&e.candidate&&this.send({t:"signal",data:{candidate:e.candidate}})},a.onnegotiationneeded=async()=>{if(this.pc===a&&!this.stopped&&!this.destroyed&&(e||a.remoteDescription))try{if(this.makingOffer=!0,await a.setLocalDescription(),this.pc!==a||this.stopped)return;this.send({t:"signal",data:{description:a.localDescription}})}catch{}finally{this.makingOffer=!1}},setTimeout(()=>{this.pc!==a||a.remoteDescription||"connected"===a.connectionState||(this.finishAttempt("signal-timeout"),this.next())},5e3),this.clearConnectWatchdog(),this.connectWatchdog=setTimeout(()=>{if(this.pc===a&&"connected"!==a.connectionState){if("checking"===a.iceConnectionState||"connected"===a.iceConnectionState){this.connectWatchdog=setTimeout(()=>{this.pc===a&&"connected"!==a.connectionState&&(this.finishAttempt("connect-timeout"),this.next())},1e4);return}this.finishAttempt("connect-timeout"),this.next()}},12e3),a.onconnectionstatechange=()=>{this.pc===a&&("connected"===a.connectionState&&(this.mark("connected"),this.clearConnectWatchdog(),this.applyBitrateCap(),setTimeout(()=>{this.pc===a&&this.applyBitrateCap()},2e3),this.setState("connected"),this.watchFirstFrame(a),this.sampleMedia(a)),"failed"===a.connectionState&&(!this.restartedIce&&a.remoteDescription?(this.restartedIce=!0,a.restartIce(),this.clearConnectWatchdog(),this.connectWatchdog=setTimeout(()=>{this.pc===a&&"connected"!==a.connectionState&&(this.finishAttempt("ice-failed"),this.next())},5e3)):(this.finishAttempt("ice-failed"),this.next())))},a.oniceconnectionstatechange=()=>{this.pc===a&&["connected","completed"].includes(a.iceConnectionState)&&this.mark("ice")},e){let e=a.createDataChannel("chat",{ordered:!0});this.bindDataChannel(e)}else a.ondatachannel=e=>this.bindDataChannel(e.channel);for(let e of this.earlySignals.splice(0))this.enqueueSignal(e)}videoPresented(e){this.pc&&(!e||e===this.displayedStream)&&(this.mark("video"),this.receivedFrame=!0,this.firstFrameTimer&&clearTimeout(this.firstFrameTimer),this.firstFrameTimer=null)}async sampleMedia(e){let t=this.attempt;if(t&&this.pc===e){try{let a=await e.getStats();if(this.pc!==e||this.attempt!==t)return;a.forEach(e=>
1{"inbound-rtp"===e.type&&"video"===e.kind&&(e.bytesReceived>0&&this.mark("received"),e.framesDecoded>0&&this.mark("decoded"))});let r=await this.isRelayed();this.attempt===t&&(t.path=null===r?"unknown":r?"relay":"direct")}catch{}this.pc===e&&!this.receivedFrame&&this.attempt===t&&this.clock()-t.started-(t.marks.matched||0)<3e4&&(this.mediaTimer=setTimeout(()=>{this.sampleMedia(e)},500))}}watchFirstFrame(e){this.firstFrameTimer||this.receivedFrame||(this.firstFrameTimer=setTimeout(async()=>{if(this.firstFrameTimer=null,this.pc===e&&!this.receivedFrame)try{let t=await e.getStats(),a=0;if(t.forEach(e=>{"inbound-rtp"===e.type&&"video"===e.kind&&(a+=e.framesDecoded||0)}),this.pc!==e||this.receivedFrame)return;if(a>0){let t=new MediaStream(e.getReceivers().map(e=>e.track).filter(e=>"live"===e.readyState));this.displayedStream=t,this.handlers.onRemoteStream(t)}}catch{}},6e3))}enqueueSignal(e){let t=this.peerGeneration;return this.signalChain=this.signalChain.then(async()=>{t===this.peerGeneration&&await this.handleSignal(e)}).catch(()=>{}),this.signalChain}async isRelayed(){let e=this.pc;if(!e)return null;try{let t=await e.getStats(),a=null,r=new Map;t.forEach(e=>{"transport"===e.type&&e.selectedCandidatePairId&&(a=e.selectedCandidatePairId),"local-candidate"===e.type&&r.set(e.id,e.candidateType)});let s=null;return t.forEach(e=>{if("candidate-pair"===e.type&&(e.id===a||e.selected&&!a)){let t=r.get(e.localCandidateId);t&&(s="relay"===t)}}),s}catch{return null}}async applyBitrateCap(){let e=this.pc;if(!e)return;let t=await this.isRelayed();if(e!==this.pc)return;let a=!1===t?14e5:6e5,r=!1===t?30:24;for(let t of e.getSenders())if(t.track?.kind==="video")try{let e=t.getParameters();for(let t of(e.encodings&&0!==e.encodings.length||(e.encodings=[{}]),e.encodings))t.maxBitrate=a,t.maxFramerate=r;await t.setParameters(e)}catch{}}bindDataChannel(e){this.dc=e,e.onopen=()=>this.handlers.onCanSendChange?.(!0),e.onclose=()=>this.handlers.onCanSendChange?.(!1),e.onerror=()=>this.handlers.onCanSendChange?.(!1),e.onmessage=e=>{try{let t=JSON.parse(e.data);"msg"===t.t&&t.text&&this.handlers.onMessage(t.text),"typing"===t.t&&this.handlers.onPeerTyping?.(),"react"===t.t&&"string"==typeof t.e&&this.handlers.onReaction?.(t.e)}catch{}}}async handleSignal(e){let t=this.pc;if(t)try{if(e.description){let a="offer"===e.description.type&&(this.makingOffer||"stable"!==t.signalingState);if(this.ignoreOffer=!this.polite&&a,this.ignoreOffer||(await t.setRemoteDescription(e.description),this.pc!==t))return;for(let e of(this.mark("description"),this.earlyCandidates.splice(0)))try{await t.addIceCandidate(e)}catch{}if("offer"===e.description.type){if(await t.setLocalDescription(),this.pc!==t||this.stopped)return;this.send({t:"signal",data:{description:t.localDescription}})}}else if(e.candidate){if(this.ignoreOffer)return;if(!t.remoteDescription){this.earlyCandidates.length<128&&this.earlyCandidates.push(e.candidate);return}try{await t.addIceCandidate(e.candidate)}catch{if(!this.ignoreOffer)throw Error("ice")}}}catch{}}async replaceVideoTrack(e){let t=this.pc?.getSenders().find(e=>e.track?.kind==="video");if(t)try{await t.replaceTrack(e)}catch{}this.applyBitrateCap()}sendMessage(e){return this.dc?.readyState==="open"&&(this.dc.send(JSON.stringify({t:"msg",text:e})),!0)}sendTyping(){this.dc?.readyState==="open"&&this.dc.send(JSON.stringify({t:"typing"}))}sendReaction(e){return this.dc?.readyState==="open"&&(this.dc.send(JSON.stringify({t:"react",e:e})),!0)}refreshFilters(){this.send({t:"filters",refresh:!0})}report(e,t,a=!0,r){return this.ws?.readyState===WebSocket.OPEN&&(this.send({t:"report",reason:e,block:a,...t?{frame:t}:{},...r?{clipId:r}:{}}),!0)}block(){return this.ws?.readyState===WebSocket.OPEN&&(this.send({t:"block"}),!0)}get canSendMessages(){return this.dc?.readyState==="open"}async getDiagnostics(){let e=this.pc,t={state:this.state,socket:this.ws?["connecting","open","closing","closed"][this.ws.readyState]??"?":"none",pc:e?.connectionState??"none",ice:e?.iceConnectionState??"none",turn:!!this.iceLoaded&&this.iceServers.some(e=>(Array.isArray(e.urls)?e.urls:[e.urls]).some(e=>String(e).startsWith("turn"))),candidate:"-",remote:"-",rxBytes:0,rxFrames:0,rxLost:0,rxSize:"-",rxCodec:"-",txSize:"-",rxTrack:e?.getReceivers().find(e=>"video"===e.track.kind)?.track};if(!e)return t;try{let a=await e.getStats(),r=null,s=new Map;
1a.forEach(e=>{"inbound-rtp"===e.type&&(e.kind??e.mediaType)==="video"&&(t.rxBytes+=e.bytesReceived??0,t.rxFrames+=e.framesDecoded??0,t.rxLost+=e.packetsLost??0,t.rxSize=`${e.frameWidth??0}x${e.frameHeight??0}`,t.rxCodec=a.get(e.codecId)?.mimeType??"-"),"outbound-rtp"===e.type&&(e.kind??e.mediaType)==="video"&&(t.txSize=`${e.frameWidth??0}x${e.frameHeight??0}`),"transport"===e.type&&e.selectedCandidatePairId&&(r=e.selectedCandidatePairId),("local-candidate"===e.type||"remote-candidate"===e.type)&&s.set(e.id,{type:e.candidateType,protocol:e.protocol})}),a.forEach(e=>{"candidate-pair"===e.type&&(e.id===r||e.selected&&!r)&&(t.candidate=s.get(e.localCandidateId)?.type??"?",t.remote=s.get(e.remoteCandidateId)?.type??"?")})}catch{}return t}rejoin(){try{this.ws?.close()}catch{}}leaveRoom(){this.profile&&(this.profile.room=void 0),this.roomHost=!1}next(e){if(this.finishAttempt("next"),this.beginAttempt("next"),this.stopped=!1,this.teardownPeer(),this.matchRoom=null,this.preparePeer(),this.handlers.onPeer(null),this.handlers.onRemoteStream(null),this.profile&&(this.profile.room=e),this.roomHost=!!e,this.ws?.readyState===WebSocket.OPEN){if(!this.socketAnnounced)return void this.announceProfile();this.setState("searching"),this.send({t:"next",...e?{room:e}:{}}),this.armSearchTimeout()}else this.setState("fallback"),this.connectSocket()}async noRealMatchAvailable(){return!!this.allowsClips&&!!this.isSearching&&this.ws?.readyState===WebSocket.OPEN&&!this.clipCheck&&new Promise(e=>{let t=crypto.randomUUID(),a=setTimeout(()=>{this.clipCheck=null,e(!1)},1500);this.clipCheck={id:t,resolve:e,timer:a},this.send({t:"clip-check",request:t})})}startClip(e){if(!this.allowsClips)return null;let t=crypto.randomUUID();return this.stop({clipId:e,clipMatch:t}),t}clipPlayed(e,t){this.stopped&&!this.destroyed&&this.clipReservation?.clipId===e&&this.clipReservation.clipMatch===t&&this.send({t:"clip-played",clipId:e,clipMatch:t})}stop(e){this.finishAttempt(e?"clip":"stop"),this.stopped=!0,this.clipReservation=e??null,this.clearSearchTimeout(),this.teardownPeer(),this.matchRoom=null,this.closeSpare(),this.send({t:"stop",...e}),this.setState("idle")}teardownPeer(){if(this.clipCheck&&(clearTimeout(this.clipCheck.timer),this.clipCheck.resolve(!1),this.clipCheck=null),this.peerGeneration+=1,this.clearConnectWatchdog(),this.mediaTimer&&clearTimeout(this.mediaTimer),this.mediaTimer=null,this.firstFrameTimer&&clearTimeout(this.firstFrameTimer),this.firstFrameTimer=null,this.receivedFrame=!1,this.displayedStream=null,this.restartedIce=!1,this.earlySignals=[],this.earlyCandidates=[],this.signalChain=Promise.resolve(),this.dc){this.dc.onmessage=null,this.dc.onopen=null,this.dc.onclose=null,this.dc.onerror=null;try{this.dc.close()}catch{}this.dc=null,this.handlers.onCanSendChange?.(!1)}if(this.pc){this.pc.ontrack=null,this.pc.onicecandidate=null,this.pc.onnegotiationneeded=null,this.pc.onconnectionstatechange=null,this.pc.oniceconnectionstatechange=null;try{this.pc.close()}catch{}this.pc=null}this.makingOffer=!1,this.ignoreOffer=!1}destroy(){if(this.finishAttempt("page-left"),window.removeEventListener("pagehide",this.onPageLeft),window.removeEventListener("online",this.onNetworkChange),document.removeEventListener("visibilitychange",this.onVisible),this.destroyed=!0,this.clearSearchTimeout(),this.stopKeepAlive(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.teardownPeer(),this.closeSpare(),this.ws){this.ws.onclose=null,this.ws.onerror=null,this.ws.onmessage=null;try{this.ws.close()}catch{}this.ws=null}this.setState("idle")}}function P(e){return{adminMatching:!0===e.adminMatching,filters:e.filters??null,cost:"number"==typeof e.cost?e.cost:0,affordable:!!e.affordable}}let L="AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ 
1NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "),$={en:"en",de:"de",fr:"fr",es:"es"};function O(e,t){try{return new Intl.DisplayNames([$[t]],{type:"region"}).of(e)??e}catch{return e}}let F=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,Z="clipsSeen",D="clipsBlocked",B=new Set,z=null,W=0;function V(){if(!T.API_BASE)return Promise.resolve([]);if(z&&Date.now()<W)return z;let e=new AbortController,t=setTimeout(()=>e.abort(),4e3);return W=1/0,z=fetch(`${T.API_BASE}/clips`,{signal:e.signal}).then(e=>{if(!e.ok)throw Error(`Clip list returned ${e.status}`);return e.json()}).then(e=>Array.isArray(e.clips)?e.clips.filter(e=>"string"==typeof e&&F.test(e)).map(t=>{let a=e.countries?.[t],r="string"==typeof a?a.trim().toUpperCase():"",s=e.ages?.[t],i="number"==typeof s&&Number.isInteger(s)&&s>=21&&s<=29?s:0;return{id:t,gender:"female",country:/^[A-Z]{2}$/.test(r)?r:"",age:i}}):[]).then(e=>(W=e.length?Date.now()+6e4:0,e)).catch(()=>(W=0,[])).finally(()=>clearTimeout(t))}function _(){try{let e=JSON.parse(sessionStorage.getItem(Z)??"[]");return Array.isArray(e)?e.filter(e=>"string"==typeof e):[]}catch{return[]}}function G(){try{let e=JSON.parse(localStorage.getItem(D)??"[]");if(Array.isArray(e))for(let t of e)"string"==typeof t&&F.test(t)&&B.add(t)}catch{}return B}function H(e){let t=G();t.add(e);try{localStorage.setItem(D,JSON.stringify([...t]))}catch{}}async function K(){let e=G(),t=(await V()).filter(t=>!e.has(t.id)),a=_(),r=new Set(a),s=t.filter(e=>!r.has(e.id));if(s.length)return s[Math.floor(Math.random()*s.length)];let i=new Map(t.map(e=>[e.id,e]));for(let e of a){let t=i.get(e);if(t)return t}return null}function J(e){return`${T.API_BASE}/clips/${e}?cors=1`}function Y(e,t,a,r){let s,i,n=!1,l=Date.now()+1e4,c=new Set,o=!1,d=()=>!n&&e.srcObject===t,h=()=>{clearTimeout(s),s=void 0},u=()=>{!d()||o||e.readyState<2||e.videoWidth<=0||e.videoHeight<=0||("function"==typeof e.requestVideoFrameCallback?void 0===i&&(i=e.requestVideoFrameCallback(()=>{i=void 0,d()&&(o=!0,r?.())})):(o=!0,r?.()))},m=()=>{!d()||void 0!==s||document.hidden||Date.now()>=l||(s=setTimeout(()=>{s=void 0,p()},500))},p=()=>{if(d()&&!document.hidden){if(!e.paused&&e.readyState>=2)return void h();e.play().catch(t=>{d()&&(t?.name!=="NotAllowedError"||e.muted?(t?.name==="AbortError"||t?.name==="NotAllowedError")&&m():(e.muted=!0,a?.(),p()))}),m()}},f=()=>{if(d()){for(let e of t.getTracks())c.has(e)||(c.add(e),e.addEventListener("unmute",f));l=Date.now()+1e4,u(),p()}},x=()=>{d()&&(l=Date.now()+1e4,m())},g=["loadedmetadata","loadeddata","canplay"];return g.forEach(t=>e.addEventListener(t,f)),e.addEventListener("playing",h),e.addEventListener("playing",u),e.addEventListener("resize",u),e.addEventListener("pause",x),t.addEventListener("addtrack",f),document.addEventListener("visibilitychange",f),e.srcObject!==t&&(e.srcObject=t),f(),()=>{n=!0,void 0!==i&&e.cancelVideoFrameCallback(i),h(),g.forEach(t=>e.removeEventListener(t,f)),e.removeEventListener("playing",h),e.removeEventListener("playing",u),e.removeEventListener("resize",u),e.removeEventListener("pause",x),t.removeEventListener("addtrack",f),document.removeEventListener("visibilitychange",f),c.forEach(e=>e.removeEventListener("unmute",f))}}function q(e="user",t={}){let a=!1;{let e=window.matchMedia("(pointer: coarse)").matches,t=window.screen.orientation?.type;a=e?t?t.startsWith("portrait"):window.screen.height>window.screen.width:window.matchMedia("(orientation: portrait)").matches}return{video:{width:{ideal:a?720:1280},height:{ideal:a?1280:720},aspectRatio:{ideal:a?9/16:16/9},frameRate:{ideal:30,max:30},facingMode:{ideal:e},...t.cameraId?{deviceId:{ideal:t.cameraId}}:{}},audio:{echoCancellation:!0,noiseSuppression:!0,...t.micId?{deviceId:{ideal:t.micId}}:{}}}}var Q=e.i(76760),X=e.i(54827),ee=e.i(86385),et=e.i(63992);let ea=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
1currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))});function er({label:e,head:r,onClose:s,children:i}){let n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(n.current?.focus({preventScroll:!0}),!s)return;let e=e=>{"Escape"===e.key&&s()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]),(0,t.jsx)("div",{className:"absolute inset-0 z-50 flex items-end sm:items-center justify-center bg-black/70 backdrop-blur-[2px] sm:px-5",onClick:s,children:(0,t.jsxs)("div",{ref:n,tabIndex:-1,role:"dialog","aria-modal":"true","aria-label":e,onClick:e=>e.stopPropagation(),className:"chat-sheet flex flex-col w-full sm:max-w-md max-h-[88%] sm:max-h-[calc(100%-2.5rem)] rounded-t-3xl sm:rounded-3xl bg-[#0f0f13] ring-1 ring-white/10 shadow-[0_24px_80px_rgba(0,0,0,0.6)] outline-none overflow-hidden",children:[(0,t.jsx)("div",{className:"sm:hidden mx-auto mt-2.5 w-10 h-1 rounded-full bg-white/20","aria-hidden":"true"}),(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 pt-3 pb-3 sm:px-5 sm:pt-5 shrink-0",children:[r,s&&(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":"Close",className:"w-10 h-10 shrink-0 rounded-full bg-white/[0.06] hover:bg-white/10 flex items-center justify-center text-gray-300 hover:text-white transition-colors",children:(0,t.jsx)(ea,{className:"w-5 h-5"})})]}),(0,t.jsx)("div",{className:"min-h-0 overflow-y-auto overscroll-contain px-4 sm:px-5",style:{paddingBottom:"calc(1.25rem + env(safe-area-inset-bottom, 0px))"},children:i})]})})}function es({locale:e,tab:a,onTabChange:r,onClose:s,onAuthChange:i}){let n=[{id:"karma",label:E.UI.karma.title[e],Icon:w.SparklesIcon},{id:"account",label:E.UI.account.title[e],Icon:y}];return(0,t.jsx)(er,{label:"karma"===a?E.UI.karma.title[e]:E.UI.account.title[e],onClose:s,head:(0,t.jsx)("div",{className:"flex flex-1 rounded-full p-1 bg-white/[0.06]",role:"tablist",children:n.map(({id:e,label:s,Icon:i})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":a===e,onClick:()=>r(e),className:`flex-1 h-10 inline-flex items-center justify-center gap-1.5 rounded-full text-sm font-medium transition-colors ${a===e?"bg-white/15 text-white":"text-gray-400 hover:text-white"}`,children:[(0,t.jsx)(i,{className:"w-4 h-4 shrink-0"}),s]},e))}),children:(0,t.jsxs)("div",{role:"tabpanel",children:[(0,t.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed",children:"karma"===a?E.UI.karma.intro[e]:E.UI.account.accountIntro[e]}),"karma"===a?(0,t.jsx)(ee.KarmaPanel,{locale:e,p:X.darkPalette,dense:!0,onChat:s}):(0,t.jsx)(et.AccountPanel,{locale:e,p:X.darkPalette,dense:!0,onAuthChange:i})]})})}let ei=["male","female"],en=Array.from({length:53},(e,t)=>t+18),el=["females","males"];function ec({locale:e,onDone:r,onClose:s}){let i=E.UI.chatPreview,{primaryColor:n}=S.default,[l,c]=(0,a.useState)(""),[d,u]=(0,a.useState)(""),[m,p]=(0,a.useState)(""),x=""!==l&&""!==d&&""!==m,g="w-full flex items-center gap-2 rounded-full bg-white/[0.07] hover:bg-white/10 ring-1 ring-white/10 pl-4 pr-3 h-12 cursor-pointer transition-colors",w="flex-1 min-w-0 bg-transparent text-white text-base outline-none appearance-none cursor-pointer truncate",b="block text-xs font-semibold uppercase tracking-wide text-gray-500 mb-2",v="bg-[#16161a]";return(0,t.jsxs)(er,{label:E.UI.chat.roomJoining[e],onClose:s,head:(0,t.jsxs)("p",{className:"flex-1 min-w-0 inline-flex items-center gap-2 text-white text-base font-semibold truncate",children:[(0,t.jsx)(f,{className:"w-4 h-4 shrink-0",style:{color:n}}),E.UI.chat.roomJoining[e]]}),children:[(0,t.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed",children:E.UI.chat.profileIntro[e]}),(0,t.jsxs)("form",{onSubmit:function(e){e.preventDefault(),x&&((0,I.savePrefs)(l,d,m),r((0,I.loadChatPrefs)()??{gender:l,age:d,preference:m,ageRange:[18,70]}))},className:"mt-4 flex flex-col gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:b,children:i.whoAreYou[e]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("label",{className:g,children:[(0,t.jsxs)("select",{value:l,onCh
1ange:e=>c(e.target.value),"aria-label":i.selectGender[e],className:w,children:[(0,t.jsx)("option",{value:"",disabled:!0,className:v,children:i.selectGender[e]}),ei.map(a=>(0,t.jsx)("option",{value:a,className:v,children:"male"===a?i.male[e]:i.female[e]},a))]}),(0,t.jsx)(h,{className:"w-4 h-4 text-white/50 shrink-0"})]}),(0,t.jsxs)("label",{className:g,children:[(0,t.jsxs)("select",{value:d,onChange:e=>u(e.target.value),"aria-label":i.selectAge[e],className:w,children:[(0,t.jsx)("option",{value:"",disabled:!0,className:v,children:i.selectAge[e]}),en.map(a=>(0,t.jsxs)("option",{value:a,className:v,children:[a," ",i.years[e]]},a))]}),(0,t.jsx)(h,{className:"w-4 h-4 text-white/50 shrink-0"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:b,children:i.whoChatWith[e]}),(0,t.jsxs)("label",{className:g,children:[(0,t.jsxs)("select",{value:m,onChange:e=>p(e.target.value),"aria-label":i.selectPreference[e],className:w,children:[(0,t.jsx)("option",{value:"",disabled:!0,className:v,children:i.selectPreference[e]}),el.map(a=>(0,t.jsx)("option",{value:a,className:v,children:"females"===a?i.prefFemales[e]:i.prefMales[e]},a))]}),(0,t.jsx)(h,{className:"w-4 h-4 text-white/50 shrink-0"})]})]}),(0,t.jsxs)("button",{type:"submit",disabled:!x,className:"w-full inline-flex items-center justify-center gap-2 h-12 rounded-full text-white font-bold text-[15px] hover:brightness-110 active:scale-[0.98] transition disabled:opacity-40 disabled:pointer-events-none",style:{backgroundColor:n,boxShadow:`0 12px 32px -8px ${n}b3`},children:[E.UI.chat.continue[e],(0,t.jsx)(o.ArrowRightIcon,{className:"w-4 h-4"})]})]})]})}var eo=e.i(36239),ed=e.i(92359);let eh=a.forwardRef(function({title:e,titleId:t,...r},s){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":t},r),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M21.721 12.752a9.711 9.711 0 0 0-.945-5.003 12.754 12.754 0 0 1-4.339 2.708 18.991 18.991 0 0 1-.214 4.772 17.165 17.165 0 0 0 5.498-2.477ZM14.634 15.55a17.324 17.324 0 0 0 .332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 0 0 .332 4.647 17.385 17.385 0 0 0 5.268 0ZM9.772 17.119a18.963 18.963 0 0 0 4.456 0A17.182 17.182 0 0 1 12 21.724a17.18 17.18 0 0 1-2.228-4.605ZM7.777 15.23a18.87 18.87 0 0 1-.214-4.774 12.753 12.753 0 0 1-4.34-2.708 9.711 9.711 0 0 0-.944 5.004 17.165 17.165 0 0 0 5.498 2.477ZM21.356 14.752a9.765 9.765 0 0 1-7.478 6.817 18.64 18.64 0 0 0 1.988-4.718 18.627 18.627 0 0 0 5.49-2.098ZM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 0 0 1.988 4.718 9.765 9.765 0 0 1-7.478-6.816ZM13.878 2.43a9.755 9.755 0 0 1 6.116 3.986 11.267 11.267 0 0 1-3.746 2.504 18.63 18.63 0 0 0-2.37-6.49ZM12 2.276a17.152 17.152 0 0 1 2.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0 1 12 2.276ZM10.122 2.43a18.629 18.629 0 0 0-2.37 6.49 11.266 11.266 0 0 1-3.746-2.504 9.754 9.754 0 0 1 6.116-3.985Z"}))});function eu({locale:e,account:a,onChanged:r,onClose:s,className:i=""}){let n=E.UI.chat,l=a?.rules??T.DEFAULT_RULES,c=l.filterMatchCost?.one??T.DEFAULT_RULES.filterMatchCost.one,o=l.filterMatchCost?.both??T.DEFAULT_RULES.filterMatchCost.both,d=a?.karma?.balance??0,h=a?.filters??[],u=(0,T.enabledFilters)(a).length,m=(0,T.filterCostFor)(u,l);return(0,t.jsxs)("div",{"data-panel":"filters",className:`karma-pop rounded-2xl bg-[#0f0f13]/95 backdrop-blur-md border border-white/10 p-3 text-left shadow-[0_10px_40px_rgba(0,0,0,0.5)] ${i}`,role:"dialog","aria-label":n.filters[e],children:[s&&(0,t.jsx)("div",{className:"flex justify-end pb-1.5",children:(0,t.jsx)("button",{type:"button",onClick:s,className:"w-8 h-8 rounded-full flex items-center justify-center text-gray-400 hover:text-white hover:bg-white/10 transition-colors","aria-label":"Close",children:(0,t.jsx)(ea,{className:"w-4 h-4"})})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(em,{kind:"gender",locale:e,setting:h.find(e=>
1"gender"===e.kind)??null,price:c,defaultCountry:"",onChanged:r}),(0,t.jsx)(em,{kind:"country",locale:e,setting:h.find(e=>"country"===e.kind)??null,price:c,defaultCountry:a?.country&&/^[A-Z]{2}$/.test(a.country)?a.country:"",onChanged:r})]}),(0,t.jsx)("p",{className:"pt-2.5 pl-1.5 text-[11px] text-gray-400",children:(0,E.tpl)(n.bothPerMatch[e],{n:String(o)})}),u>0&&d<m&&(0,t.jsx)("p",{className:"pt-1 pl-1.5 text-[11px] text-amber-400 leading-relaxed",children:(0,E.tpl)(n.filterNeeds[e],{n:String(m),b:String(d)})})]})}function em({kind:e,locale:r,setting:s,price:i,defaultCountry:n,onChanged:l}){let c=E.UI.account,o=E.UI.chat,{primaryColor:d}=S.default,[u,m]=(0,a.useState)([]);(0,a.useEffect)(()=>{"country"===e&&m(L.map(e=>({code:e,name:O(e,r)})).sort((e,t)=>e.name.localeCompare(t.name,$[r])))},[e,r]);let[p,f]=(0,a.useState)(null),x=p??s?.value??("gender"===e?"female":n),g=s?.enabled??!1,[w,b]=(0,a.useState)(!1),[v,y]=(0,a.useState)(null);async function k(t){let a=t.value??x,s=t.enabled??g;if(a){b(!0),y(null);try{await (0,T.setFilter)(e,a,s),l()}catch(e){y((0,X.errorText)((0,X.codeOf)(e),r))}finally{b(!1)}}}function N(e){f(e),g&&k({value:e})}return(0,t.jsxs)("div",{className:"rounded-xl bg-white/[0.05] ring-1 ring-white/[0.06] p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-2 text-white text-sm font-semibold",children:["gender"===e?(0,t.jsx)(j,{className:"w-4 h-4 text-white/70"}):(0,t.jsx)(eh,{className:"w-4 h-4 text-white/70"}),"gender"===e?c.genderFilter[r]:c.countryFilter[r]]}),(0,t.jsx)("span",{className:"text-[11px] text-gray-400 whitespace-nowrap",children:(0,E.tpl)(o.perMatch[r],{n:String(i)})})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2.5",children:["gender"===e?(0,t.jsx)("div",{className:"flex flex-1 rounded-full bg-white/[0.06] p-0.5",role:"radiogroup","aria-label":c.genderFilter[r],children:["female","male"].map(e=>(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":x===e,onClick:()=>N(e),className:`flex-1 h-8 rounded-full text-xs font-medium transition-colors ${x===e?"bg-white/15 text-white":"text-gray-400 hover:text-white"}`,children:"female"===e?c.women[r]:c.men[r]},e))}):(0,t.jsxs)("label",{className:"flex flex-1 min-w-0 items-center gap-1 rounded-full bg-white/[0.06] hover:bg-white/10 ring-1 ring-white/10 pl-3 pr-2 h-9 cursor-pointer transition-colors",children:[(0,t.jsxs)("select",{value:x,onChange:e=>N(e.target.value),className:"flex-1 min-w-0 bg-transparent text-white text-xs outline-none appearance-none cursor-pointer truncate","aria-label":c.countryFilter[r],children:[(0,t.jsx)("option",{value:"",disabled:!0,className:"bg-[#16161a]",children:c.chooseCountry[r]}),u.map(e=>(0,t.jsx)("option",{value:e.code,className:"bg-[#16161a]",children:e.name},e.code))]}),(0,t.jsx)(h,{className:"w-3.5 h-3.5 text-white/50 shrink-0"})]}),(0,t.jsx)("button",{type:"button",role:"switch","aria-checked":g,"aria-label":"gender"===e?c.genderFilter[r]:c.countryFilter[r],disabled:w||!x,onClick:()=>void k({enabled:!g}),className:`relative shrink-0 w-11 h-6 rounded-full transition-colors disabled:opacity-40 ${g?"":"bg-white/20"}`,style:g?{backgroundColor:d}:void 0,children:(0,t.jsx)("span",{className:`absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ${g?"translate-x-5":""}`})})]}),v&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-red-400",children:v})]})}function ep({stream:e}){let r=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(!e||0===e.getAudioTracks().length)return;let t=window.AudioContext??window.webkitAudioContext;if(!t)return;let a=new t,s=a.createMediaStreamSource(e),i=a.createAnalyser();i.fftSize=512,s.connect(i);let n=new Uint8Array(i.fftSize),l=0,c=()=>{i.getByteTimeDomainData(n);let e=0;for(let t=0;t<n.length;t++){let a=(n[t]-128)/128;e+=a*a}let t=Math.sqrt(e/n.length);r.current&&(r.current.style.width=Math.min(100,Math.round(300*t))+"%"),l=requestAnimationFrame(c)};return a.resume?.().catch(()=>{}),c(),()=>{cancelAnimationFrame(l),s.disconnect(),a.close().catch(()=>{})}},[e]),(0,t.jsx)("div",{className:"w-full h-1.5 rounded-full bg-white/10 overflow-hidden",children:(0,t.jsx)("div",{ref:r,className:"h-full rounded-full bg-[#22C55E]",style:{width:0,transition:"width 75ms linear"}})})}var ef=e.i(72520),ex=e.i(43531);let eg="#FFC233",ew="#1A1200";function eb({locale:e="en",className:a="",variant:r="card"}){let s=(0,C.localizeSite)(e).chatAd;if(!s)return null;let i=s.avatars??[1,2,3].map(e=>`/ad-avatars/${S.default.avatarGender}/online/profile${e}.webp`);return"bar"===r?(0,t.jsx)("div",{className:a,children:(0,t.jsxs)("a",{href:"/goto/nsfw",target:"_blank",rel:"nofollow noopener noreferrer",className:"group ad-wave flex items-center gap-2.5 sm:gap-3 rounded-2xl sm:rounded-3xl border px-3 py-2.5 sm:px-3.5 transition-colors",style:{borderColor:"rgba(255,194,51,
10.45)",backgroundColor:"#16130c",backgroundImage:"linear-gradient(100deg, rgba(255,194,51,0.05) 0%, rgba(255,194,51,0.26) 45%, rgba(255,194,51,0.05) 90%)"},children:[(0,t.jsxs)("span",{className:"relative flex shrink-0",children:[i.slice(0,3).map((e,a)=>(0,t.jsx)("img",{src:e,alt:"",loading:"lazy",className:`${a>0?"hidden sm:block":""} w-9 h-9 sm:w-10 sm:h-10 rounded-full object-cover border-2 border-[#16130c]`,style:{marginLeft:0===a?0:"-12px",zIndex:3-a}},e)),s.verified&&(0,t.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 w-4 h-4 rounded-full bg-[#22C55E] border-2 border-[#16130c] flex items-center justify-center z-10",children:(0,t.jsx)(ex.Check,{className:"w-2 h-2 text-white",strokeWidth:4})})]}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 leading-tight",children:[(0,t.jsx)("span",{className:"block text-white font-bold text-sm sm:text-[15px] truncate",children:s.headline}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-[11px] sm:text-xs mt-0.5 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-[#22C55E] shrink-0"}),s.statValue&&(0,t.jsx)("span",{className:"text-white font-semibold shrink-0",children:s.statValue}),(0,t.jsx)("span",{className:"text-gray-400 truncate",children:s.compactStatLabel?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"sm:hidden",children:s.compactStatLabel}),(0,t.jsx)("span",{className:"hidden sm:inline",children:s.statLabel})]}):s.statLabel})]})]}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 shrink-0 rounded-full px-3 py-1.5 sm:px-3.5 sm:py-2 text-xs sm:text-[13px] font-bold transition-transform group-hover:scale-105",style:{backgroundColor:eg,color:ew},children:[s.ctaLabel,(0,t.jsx)(ef.ArrowRight,{className:"w-3.5 h-3.5",strokeWidth:2.5})]})]})}):(0,t.jsx)("div",{className:`w-full max-w-xl ${a}`,children:(0,t.jsxs)("a",{href:"/goto/nsfw",target:"_blank",rel:"nofollow noopener noreferrer",className:"group ad-wave block rounded-2xl sm:rounded-3xl overflow-hidden border transition-colors",style:{borderColor:"rgba(255,194,51,0.45)",backgroundColor:"#16130c",backgroundImage:"linear-gradient(100deg, rgba(255,194,51,0.05) 0%, rgba(255,194,51,0.26) 45%, rgba(255,194,51,0.05) 90%)"},children:[s.image&&(0,t.jsx)("img",{src:s.image,alt:"",className:"w-full h-32 sm:h-40 object-cover",loading:"lazy"}),(0,t.jsxs)("div",{className:"flex flex-col items-center text-center gap-4 p-5 sm:flex-row sm:items-center sm:text-left sm:gap-4 sm:pl-5 sm:pr-4 sm:py-4",children:[i.length>0&&(0,t.jsxs)("div",{className:"relative flex shrink-0",children:[i.map((e,a)=>(0,t.jsx)("img",{src:e,alt:"",loading:"lazy",className:"w-11 h-11 rounded-full object-cover border-2 border-[#16130c]",style:{marginLeft:0===a?0:"-12px",zIndex:i.length-a}},e)),s.verified&&(0,t.jsx)("span",{className:"absolute -bottom-0.5 left-8 sm:left-9 w-4 h-4 rounded-full bg-[#22C55E] border-2 border-[#16130c] flex items-center justify-center z-10",children:(0,t.jsx)(ex.Check,{className:"w-2 h-2 text-white",strokeWidth:4})})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h2",{className:"text-white font-bold text-base sm:text-lg leading-tight mb-1",children:s.headline}),s.statValue||s.statLabel?(0,t.jsxs)("p",{className:"flex items-center justify-center sm:justify-start gap-1.5 text-sm sm:text-[13px]",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-[#22C55E] shrink-0"}),s.statValue&&(0,t.jsx)("span",{className:"text-white font-semibold shrink-0",children:s.statValue}),(0,t.jsx)("span",{className:"text-gray-400",children:s.statLabel})]}):(0,t.jsx)("p",{className:"text-gray-400 text-sm leading-relaxed",children:s.body})]}),(0,t.jsxs)("span",{className:"inline-flex w-full sm:w-auto items-center justify-center gap-1.5 px-4 py-2.5 rounded-full text-sm font-bold shrink-0 transition-transform group-hover:scale-105",style:{backgroundColor:eg,color:ew},children:[s.ctaLabel,(0,t.jsx)(ef.ArrowRight,{className:"w-4 h-4",strokeWidth:2.5})]})]})]})})}let ev="chatDevices";function ey(){try{return JSON.parse(localStorage.getItem(ev)??"{}")}catch{return{}}}let ej=S.default.guidePages?.find(e=>/safety|sicher|secur|segur|privacy|protect|identity/i.test(e.slug))??null,ek="installNudgeDismissed",eN="abcdefghjkmnpqrstuvwxyz23456789";function eS(){return(/\/r\/([A-Za-z0-9-]{3,40})\/?$/.exec(window.location.pathname)?.[1]??new URLSearchParams(window.location.search).get("room")??"").toLowerCase().replace(/[^a-z0-9]/g,"")||null}function eC({className:e=""}){return(0,t.jsxs)("span",{className:`relative inline-flex ${e}`,"aria-hidden":"true",children:[(0,t.jsx)(x,{className:"w-full h-full"}),(0,t.jsx)("span",{className:"absolute left-1/2 top-1/2 w-[135%] h-[2px] rounded-full bg-current -translate-x-1/2 -translate-y-1/2 rotate-45 shadow-[0_0_0_1.5px_rgba(0,0,0,0.65)]"})]})}let eE=["😍","💋","🍆","🫵","💦"],eI={"🫵":"👉"};function eT(e,t){for(;e.length&&t-e[0]>1e4;)e.shift();return e.length}
1let eM=[["underage","reportUnderage"],["threats","reportThreats"],["abuse","reportAbuse"],["spam","reportSpam"],["other","reportOther"]];function eR({connecting:e,locale:a}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"animate-pulse-connect text-white text-base sm:text-lg mb-3",children:e?E.UI.chat.connecting[a]:E.UI.chat.searching[a]}),(0,t.jsxs)("div",{className:"flex justify-center gap-1",children:[(0,t.jsx)("span",{className:"w-2 h-2 bg-white/60 rounded-full animate-bounce [animation-delay:0ms]"}),(0,t.jsx)("span",{className:"w-2 h-2 bg-white/60 rounded-full animate-bounce [animation-delay:150ms]"}),(0,t.jsx)("span",{className:"w-2 h-2 bg-white/60 rounded-full animate-bounce [animation-delay:300ms]"})]})]})}e.s(["default",0,function({locale:e="en"}){var M,R;let P,L,$,F=(0,i.useRouter)(),D=(0,a.useRef)(null),B=(0,a.useRef)(null),z=(0,a.useRef)(null),W=(0,a.useRef)(null),G=(0,a.useRef)(null),X=(0,a.useRef)(null),ee=(0,a.useRef)(null),et=(0,a.useRef)(null),ea=(0,a.useRef)(0),er=(0,a.useRef)(new Set),ei=(0,a.useRef)(!1),[en,el]=(0,a.useState)(!1),[eh,em]=(0,a.useState)(!1),ef=(0,a.useRef)(null),[ex,eg]=(0,a.useState)(null),[ew,eA]=(0,a.useState)(!1),[eU,eP]=(0,a.useState)(!1),[eL,e$]=(0,a.useState)("idle"),[eO,eF]=(0,a.useState)(null),[eZ,eD]=(0,a.useState)(null),[eB,ez]=(0,a.useState)(!1),[eW,eV]=(0,a.useState)(!1),[e_,eG]=(0,a.useState)(!1),[eH,eK]=(0,a.useState)([]),[eJ,eY]=(0,a.useState)(""),[eq,eQ]=(0,a.useState)(!1),[eX,e0]=(0,a.useState)(!1),[e1,e5]=(0,a.useState)(null),[e2,e7]=(0,a.useState)(!1),[e3,e4]=(0,a.useState)(0),[e6,e8]=(0,a.useState)(!1),[e9,te]=(0,a.useState)(null),[tt,ta]=(0,a.useState)(null),[tr,ts]=(0,a.useState)(!1),[ti,tn]=(0,a.useState)(!1),[tl,tc]=(0,a.useState)(!1),[to,td]=(0,a.useState)(null),th=(0,a.useRef)(!1),[tu,tm]=(0,a.useState)(null),tp=(0,a.useRef)(null),[tf,tx]=(0,a.useState)(null),[tg,tw]=(0,a.useState)(!1),[tb,tv]=(0,a.useState)(!1),[ty,tj]=(0,a.useState)(!1),[tk,tN]=(0,a.useState)(!1),[tS,tC]=(0,a.useState)(null),tE=(0,a.useRef)(null),[tI,tT]=(0,a.useState)("searching"),tM=(0,a.useRef)(null),tR=(0,a.useRef)(null),tA=(0,a.useRef)(0),tU=(0,a.useRef)(null),tP=(0,a.useRef)(null),tL=(0,a.useRef)(0),t$=(0,a.useRef)(0),[tO,tF]=(0,a.useState)(0),{account:tZ}=(0,T.useAccount)(),[tD,tB]=(0,a.useState)(null),tz=(0,a.useRef)(null),[tW,tV]=(0,a.useState)(0),[t_,tG]=(0,a.useState)({filters:null,cost:0,affordable:!1}),[tH,tK]=(0,a.useState)(!1),[tJ,tY]=(0,a.useState)(!1),[tq,tQ]=(0,a.useState)([...eE]),[tX,t0]=(0,a.useState)([]),[t1,t5]=(0,a.useState)(20),t2=(0,a.useRef)([]),t7=(0,a.useRef)([]),t3=(0,a.useRef)(0),t4=(0,a.useRef)({}),t6=(0,a.useCallback)((e,t)=>{let a=++t3.current,r={id:a,emoji:e,mode:t,x:"fall"===t?6+88*Math.random():4+30*Math.random(),size:"fall"===t?30+Math.round(22*Math.random()):26,duration:"fall"===t?2600+Math.round(1200*Math.random()):1100,sway:Math.round((Math.random()-.5)*120)};t0(e=>[...e.slice(-59),r]),window.setTimeout(()=>t0(e=>e.filter(e=>e.id!==a)),r.duration+150)},[]),t8=(0,a.useCallback)((e,t)=>{let a=++ea.current;eK(r=>[...r,{id:a,from:e,text:t,state:"shown"}]);let r=(e,t)=>{let r=window.setTimeout(()=>{er.current.delete(r),eK(t=>t.some(e=>e.id===a)?t.map(t=>t.id===a?{...t,state:e}:t):t)},t);er.current.add(r)},s=Math.min(15e3,6e3+50*t.length);r("fading",s),r("gone",s+500)},[]);(0,a.useEffect)(()=>{let e=er.current;return()=>e.forEach(e=>window.clearTimeout(e))},[]);let[t9,ae]=(0,a.useState)("user"),at=(0,a.useRef)(!1),aa=(0,a.useRef)("user"),ar=(0,a.useRef)(!1),[as,ai]=(0,a.useState)(!1),[an,al]=(0,a.useState)(!1),ac=function(){let e=S.default.onlineCount??{min:900,max:1700},[t,r]=(0,a.useState)(Math.floor((e.min+e.max)/2));return(0,a.useEffect)(()=>{r(Math.floor(Math.random()*(e.max-e.min))+e.min);let t=setInterval(()=>{r(t=>{let a=t+Math.floor(11*Math.random())-5;return Math.min(e.max,Math.max(e.min,a))})},5e3);return()=>clearInterval(t)},[e.min,e.max]),t}(),[ao,ad]=(0,a.useState)({matches:0,seconds:0}),ah=(0,a.useRef)(null),[au,am]=(0,a.useState)("none"),ap=(0,a.useRef)(null),[af,ax]=(0,a.useState)(null),[ag,aw]=(0,a.useState)([]),[ab,av]=(0,a.useState)([]),[ay,aj]=(0,a.useState)({}),ak="wss://rtc.chatintime.com/match";(0,a.useEffect)(()=>{ak&&!e2&&A(ak)},[ak,e2]);let aN=!!tS&&"playing"===tI,aS=!!tS&&"searching"!==tI||"connecting"===eL||"connected"===eL,aC="connected"===eL,aE=aN?tS:aC?eO:null,aI=aC&&!!eZ,aT=e2||!tS&&!aS&&("fallback"===eL||"error"===eL);async function aM(){let e=ap.current;if(e)try{await e.prompt();let t=await e.userChoice;"accepted"===t.outcome&&am("none")}catch{}}(0,a.useEffect)(()=>
1{let e=document.documentElement,t=window.visualViewport,a=()=>{e.style.setProperty("--app-height",`${t?.height??window.innerHeight}px`),e.style.setProperty("--app-offset-top",`${t?.offsetTop??0}px`)},r=()=>{0!==window.scrollY&&window.scrollTo(0,0)};a();let s=()=>{a(),setTimeout(a,250)};return e.classList.add("chat-lock"),document.body.classList.add("chat-lock"),window.addEventListener("resize",a),window.addEventListener("orientationchange",s),window.addEventListener("scroll",r,{passive:!0}),t?.addEventListener("resize",a),t?.addEventListener("scroll",a),()=>{e.classList.remove("chat-lock"),document.body.classList.remove("chat-lock"),e.style.removeProperty("--app-height"),e.style.removeProperty("--app-offset-top"),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",s),window.removeEventListener("scroll",r),t?.removeEventListener("resize",a),t?.removeEventListener("scroll",a)}},[]),(0,a.useEffect)(()=>{let e={};for(let[t,a]of Object.entries(eI))!function(e){try{let t=document.createElement("canvas");t.width=32,t.height=32;let a=t.getContext("2d",{willReadFrequently:!0});if(!a)return!0;a.textBaseline="top",a.font="24px sans-serif",a.fillStyle="#000",a.fillText(e,0,0);let r=a.getImageData(0,0,32,32).data;for(let e=0;e<r.length;e+=4)if(r[e+3]>0&&(r[e]!==r[e+1]||r[e+1]!==r[e+2]))return!0;return!1}catch{return!0}}(t)&&(e[t]=a);t4.current=e,tQ(eE.map(t=>e[t]??t))},[]),(0,a.useEffect)(()=>{if(aC){ah.current=Date.now(),t$.current+=1,ad(e=>({...e,matches:e.matches+1}));return}let e=ah.current;if(!e)return;ah.current=null;let t=Math.round((Date.now()-e)/1e3);ad(e=>({...e,seconds:e.seconds+t}))},[aC]),(0,a.useEffect)(()=>{let e=navigator;if(window.matchMedia?.("(display-mode: standalone)").matches||!0===e.standalone)return;try{if(localStorage.getItem(ek))return}catch{}let t=navigator.userAgent;(/iPhone|iPad|iPod/.test(t)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&/Safari/.test(t)&&!/CriOS|FxiOS|EdgiOS/.test(t)&&am("ios");let a=e=>{e.preventDefault(),ap.current=e,am("prompt")};return window.addEventListener("beforeinstallprompt",a),()=>window.removeEventListener("beforeinstallprompt",a)},[]),(0,a.useEffect)(()=>{el(!(0,Q.hasConfirmedAge)()),em(!0)},[]),(0,a.useEffect)(()=>{if(!eh||en)return;let t=(0,I.loadChatPrefs)();t?eg(t):eS()?tN(!0):F.replace((0,C.localizedPath)(e,"/"))},[eh,en,F,e]);let aR=(0,a.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia(q(aa.current,ey())
1);return e.getAudioTracks().forEach(e=>e.enabled=!at.current),G.current=e,ax(e),eA(!0),X.current?.setLocalStream(e),e}catch{return eA(!1),null}},[]);async function aA(e,t){let a={...ey(),[e]:t};try{localStorage.setItem(ev,JSON.stringify(a))}catch{}aj(a),G.current?.getTracks().forEach(e=>e.stop()),G.current=null,await aR()}(0,a.useEffect)(()=>{if(!ex)return;let e=!1;return aR().then(t=>{e?t?.getTracks().forEach(e=>e.stop()):eP(!0)}),()=>{e=!0,G.current?.getTracks().forEach(e=>e.stop()),G.current=null}},[ex,aR]),(0,a.useEffect)(()=>{let e=G.current;if(!e)return;let t=[D.current,B.current].filter(e=>!!e).map(t=>Y(t,e));return()=>t.forEach(e=>e())},[ew,eW,an,af]),(0,a.useEffect)(()=>{let e=z.current,t=W.current;if(ez(!1),!eZ){e0(!1),e&&(e.srcObject=null),t&&(t.srcObject=null);return}if(!e)return;let a=Y(e,eZ,()=>e0(!0),()=>{ez(!0),X.current?.videoPresented(eZ)}),r=t?Y(t,eZ):void 0;return()=>{a(),r?.()}},[eZ,aI]),(0,a.useEffect)(()=>{ew&&!an&&(aj(ey()),navigator.mediaDevices.enumerateDevices().then(e=>{aw(e.filter(e=>"videoinput"===e.kind)),av(e.filter(e=>"audioinput"===e.kind))}).catch(()=>{}))},[ew,an]),(0,a.useEffect)(()=>{if(!ex||!ak||!eU||e2||!an)return;let e=new U({url:ak,matchTimeoutMs:1e4,onState:e$,onPeer:e=>{eF(e),e||eK([]),e&&(tp.current=null,tm(null),tx(null))},onRemoteStream:eD,onMessage:e=>{t8("stranger",e),ei.current||e4(e=>e+1)},onCanSendChange:eQ,onReaction:e=>{if(!(eE.includes(e)||Object.values(eI).includes(e)))return;let t=Date.now();eT(t7.current,t)>=20||(t7.current.push(t),t6(t4.current[e]??e,"fall"))},onKarma:e=>{(0,T.applyKarmaEvent)(e),0!==e.delta&&(tV(t=>t+e.delta),tB(e),tz.current&&window.clearTimeout(tz.current),tz.current=window.setTimeout(()=>tB(null),4e3))},onFilters:tG,onThin:()=>{tp.current||tK(!0)},onRoomEmpty:()=>{tx(null),tj(!0),window.setTimeout(()=>tj(!1),7e3)}});X.current=e,e.setLocalStream(G.current);let t=tp.current;return e.start({site:S.siteKey,gender:ex.gender,age:Number(ex.age)||18,preference:ex.preference,ageRange:ex.ageRange,room:t??eS()??void 0},{host:!!t}),tE.current&&e.stop(),()=>{tA.current+=1,e.destroy(),X.current=null}},[ex,ak,S.siteKey,eU,e2,an,t6,t8]),(0,a.useEffect)(()=>{let e=ee.current;e&&(e.scrollTop=e.scrollHeight)},[eH.length,e_]),(0,a.useEffect)(()=>{e_&&aC&&eq&&et.current?.focus()},[e_,aC,eq]),(0,a.useEffect)(()=>{ei.current=e_},[e_]),(0,a.useEffect)(()=>{e7(new URLSearchParams(window.location.search).has("ad")),tx(eS())},[]),(0,a.useEffect)(()=>{aS&&tK(!1)},[aS]),(0,a.useEffect)(()=>()=>tM.current?.cancel(),[]);let aU=(0,a.useCallback)(e=>{tM.current?.cancel(),tM.current=null,tR.current=null;let t=tE.current;return t?(tE.current=null,tC(null),e0(!1),"error"!==e&&tL.current&&function(e,t,a){if(!T.API_BASE)return;let r=JSON.stringify({outcome:t,seconds:Math.round(a)});try{if(navigator.sendBeacon?.(`${T.API_BASE}/clips/${e}/seen`,r))return;fetch(`${T.API_BASE}/clips/${e}/seen`,{method:"POST",body:r,keepalive:!0}).catch(()=>{})}catch{}}(t.id,e,(Date.now()-tL.current)/1e3),t):null},[]),aP=(0,a.useCallback)((e,t=!1)=>{var a;let r,s,i,n,l,c,o,d,h=X.current;if(h&&!h.allowsClips)return!1;let u=h?.startClip(e.id)??null;return(!h||!!u)&&(tM.current?.cancel(),tR.current=u,e4(0),eK([]),eY(""),eF(null),eD(null),tK(!1),t0([]),e0(!1),t$.current=0,tL.current=0,tE.current=e,tC(e),a={alreadySearched:t,onPhase:tT,onTimeout:()=>{aU("error"),X.current?.next(),tF(e=>e+1)}},r=!1,s=!1,i=!1,n=!1,l=[],c=()=>{r=!0,l.forEach(clearTimeout)},o=()=>{!r&&!n&&s&&i&&(n=!0,l.forEach(clearTimeout),a.onPhase("playing"))},d=()=>{r||(a.onPhase("connecting"),l.push(setTimeout(()=>{i=!0,o()},2e3)))},a.alreadySearched?d():(a.onPhase("searching"),l.push(setTimeout(d,2e3))),l.push(setTimeout(()=>{r||(c(),a.onTimeout())},15e3)),tM.current={cancel:c,ready(){s=!0,o()}},!0)},[aU]),aL=t_.affordable?t_.filters?.gender?.value:void 0,a$=!!ex&&!t_.adminMatching&&!e2&&!tu&&!tf&&"male"!==aL;(0,a.useEffect)(()=>{an&&a$&&V()},[an,a$]);let aO=an&&!eW&&!aS&&("searching"===eL||"fallback"===eL);async function aF(e){let t=++tA.current;if(aU("skipped"),!e&&!eW&&a$&&t$.current>=5){let e=await K();if(t!==tA.current||e&&X.current&&aP(e))return}eV(!1),tF(e=>e+1),e4(0),eK([]),eY(""),eF(null),eD(null),tp.current=e??null,tm(e??null),tx(null),G.current||await aR(),t===tA.current&&(X.current?X.current.next(e):e$("fallback"))}
1async function aZ(){let e,t=(e=new Uint8Array(6),crypto.getRandomValues(e),Array.from(e,e=>eN[e%eN.length]).join(""));if(aD(t),tK(!1),tw(!1),!an){tp.current=t,tm(t),tx(null),al(!0);return}await aF(t)}async function aD(e){try{await navigator.clipboard.writeText(`https://${S.default.domain}/r/${e}`),tv(!0),window.setTimeout(()=>tv(!1),2500)}catch{}}async function aB(){let e,t=G.current;if(!t||ar.current)return;ar.current=!0;let a="user"===aa.current?"environment":"user",r=!1;try{let s=(e=await navigator.mediaDevices.getUserMedia({video:q(a).video,audio:!1})).getVideoTracks()[0];if(!s||G.current!==t||(await X.current?.replaceVideoTrack(s),G.current!==t))return;t?.getVideoTracks().forEach(e=>e.stop());let i=new MediaStream([s,...t?.getAudioTracks()??[]]);G.current=i,ax(i),X.current?.setLocalStream(i),r=!0,aa.current=a,ae(a)}catch{}finally{r||e?.getTracks().forEach(e=>e.stop()),ar.current=!1}}async function az(){tK(!1);try{for(let e of(0,T.enabledFilters)(tZ))await (0,T.setFilter)(e.kind,e.value,!1)}catch{}X.current?.refreshFilters()}function aW(t,a){return"gender"===t?"female"===a?E.UI.chat.filterWomen[e]:E.UI.chat.filterMen[e]:(0,E.tpl)(E.UI.chat.filterCountry[e],{country:O(a,e)})}(0,a.useEffect)(()=>{let e;if(!aO||tS||!a$)return;let t=!1,a=tA.current,r=()=>{K().then(async s=>{if(!t&&a===tA.current&&!tE.current&&(!X.current||X.current.isSearching))if(s){let i=X.current;if(i&&!await i.noRealMatchAvailable()){!t&&i.isSearching&&(e=window.setTimeout(r,5e3));return}if(t||a!==tA.current||tE.current||i&&!i.isSearching)return;aP(s,!0)}else e=window.setTimeout(r,5e3)})};return e=window.setTimeout(r,5e3),()=>{t=!0,window.clearTimeout(e)}},[aO,tS,a$,aP,tO]),(0,a.useEffect)(()=>{let e=tU.current;if(!tS||!e)return;if(e6||"playing"!==tI)return void e.pause();e.muted=!1;let t=!1;return e.play().catch(a=>{t||a?.name!=="NotAllowedError"||(e.muted=!0,e0(!0),e.play().catch(()=>{}))}),()=>{t=!0}},[tS,tI,e6]),(0,a.useEffect)(()=>{let e=tU.current,t=tP.current;if(!tS||!e||!t)return;let a=()=>{t.readyState&&(Math.abs(t.currentTime-e.currentTime)>.25&&(t.currentTime=e.currentTime),t.playbackRate=e.playbackRate,e.paused?t.pause():t.play().catch(()=>{}))},r=["playing","pause","seeking","timeupdate","ratechange"];return r.forEach(t=>e.addEventListener(t,a)),t.addEventListener("loadedmetadata",a),a(),()=>{r.forEach(t=>e.removeEventListener(t,a)),t.removeEventListener("loadedmetadata",a)}},[tS]),(0,a.useEffect)(()=>{let e=e=>{e.key===T.TOKEN_KEY&&X.current?.rejoin()};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[]),(0,a.useEffect)(()=>{!aC&&th.current&&(th.current=!1,X.current?.rejoin())},[aC]),(0,a.useEffect)(()=>{if("connecting"!==eL)return void ai(!1);let e=window.setTimeout(()=>ai(!0),6e3);return()=>window.clearTimeout(e)},[eL]),(0,a.useEffect)(()=>{function e(e){let t=e.target;t?.closest?.('[data-panel="settings"]')||tn(!1),t?.closest?.('[data-panel="filters"]')||tY(!1),t?.closest?.('[data-panel="room"]')||tw(!1),t?.closest?.('[data-panel="chat"]')||eG(!1)}function t(e){"Escape"===e.key&&eG(!1)}return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[]),(0,a.useEffect)(()=>{if(!new URLSearchParams(window.location.search).has("debug"))return;let e=setInterval(async()=>{let e=await X.current?.getDiagnostics(),t=e=>e?`${e.videoWidth}x${e.videoHeight} ready:${e.readyState} paused:${e.paused} time:${e.currentTime.toFixed(1)} box:${Math.round(e.clientWidth)}x${Math.round(e.clientHeight)}`:"not mounted",a=G.current?.getVideoTracks()[0]?.getSettings();e5({...e,localVideo:t(D.current),remoteVideo:t(z.current??tU.current),capture:a?`${a.width}x${a.height} ${a.frameRate?.toFixed(0)}fps`:"none",orientation:window.screen.orientation?.type??`${window.screen.width}x${window.screen.height}`,track:e?.rxTrack?`${e.rxTrack.readyState} muted:${e.rxTrack.muted} enabled:${e.rxTrack.enabled}`:"none"})},1e3);return()=>clearInterval(e)},[]);let aV=t_.filters,a_=aV?[...aV.gender?[aW("gender",aV.gender.value)]:[],...aV.country?[aW("country",aV.country.value)]:[]]:[],aG=a_.length>0&&t_.affordable,aH=aN||aC&&eq,aK=e_?eH:eH.filter(e=>"gone"!==e.state).slice(-4),aJ=eh?en?"gate":ex?eW?"ended":an?"live":"ready":"loading":"loading",aY="live"===aJ,aq=aV?aG:(0,T.enabledFilters)(tZ).length>0,aQ="gate"===aJ?{label:E.UI.ageGate.enter[e],onClick:()=>ef.current?.enter()}:"ready"===aJ?{label:E.UI.chat.start[e],onClick:()=>al(!0)}:"ended"===aJ?{label:E.UI.chat.start[e],onClick:()=>void aF()}:"loading"===aJ?{label:E.UI.chat.start[e],onClick:void 0}:{label:E.UI.chat.next[e],onClick:()=>void aF()},aX="relative flex-1 min-w-0 min-h-0 rounded-2xl sm:rounded-3xl overflow-hidden bg-[#0f0f13] ring-1 ring-white/10",a0=aY||"loading"===aJ?"":"flex flex-col",a1="flex-1 min-h-0 overflow-y-auto flex flex-col items-center px-4 py-5 sm:py-6";return(0,t.jsxs)("section",{className:"chat-shell bg-black select-none flex flex-col",children:[(0,t.jsx)("header",{className:"chat-top-pt relative z-10 shrink-0",children:(0,t.jsxs)("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center h-14 sm:h-16 px-3 sm:px-5",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("button",{onClick:()=>F.push((0,C.localizedPath)(e,"/")),className:"w-10 h-10 rounded-full bg-white/[0.08] hover:bg-white/15 flex items-center justify-center text-white transition-colors","aria-label":"Back",children:(0,t.jsx)(l,{className:"w-4 h-4"})})}),(0,t.jsx)(s.default,{href:(0,C.localizedPath)(e,"/"),className:"flex items-center justify-center h-7 sm:h-8 max-w-[46vw]","aria-label":S.default.brandName,children:(0,t.jsx)(eo.default,{})}),(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(ed.default,{locale:e,variant:"chat",onOpen:td})})]})}),(0,t.jsx)("div",{className:"relative flex-1 min-h-0 px-2 sm:px-4 pb-2 sm:pb-3",children:(0,t.jsx)("div",{className:"w-full h-full flex gap-2 sm:gap-3",children:(0,t.jsxs)("div",{className:"chat-tiles relative flex-1 min-w-0 min-h-0 flex flex-col sm:flex-row gap-2 sm:gap-3","data-chat-open":aY&&e_||void 0,children:[(0,t.jsxs)("div",{className:`${aX}
1 ${a0}`,children:["gate"===aJ?(0,t.jsx)("div",{className:a1,children:(0,t.jsx)(Q.AgeGateForm,{ref:ef,locale:e,onConfirm:()=>el(!1),placement:"tile"})}):"loading"===aJ?!tk&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"animate-pulse-connect text-white text-base sm:text-lg",children:E.UI.chat.searching[e]})}):"ready"===aJ?(0,t.jsx)("div",{className:a1,children:(0,t.jsxs)("div",{className:"my-auto w-full max-w-md lg:max-w-lg flex flex-col items-center text-center",children:[(0,t.jsx)("h2",{className:"text-white text-2xl sm:text-3xl font-bold tracking-tight mb-3",children:E.UI.chat.readyTitle[e]}),tf?(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-white/[0.07] ring-1 ring-white/10 pl-2.5 pr-3.5 py-1.5 text-[13px]",children:[(0,t.jsx)(f,{className:"w-4 h-4 shrink-0",style:{color:S.default.primaryColor}}),(0,t.jsx)("span",{className:"text-white font-semibold",children:E.UI.chat.roomJoining[e]})]}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-white/[0.07] ring-1 ring-white/10 pl-2.5 pr-3.5 py-1.5 text-[13px]",children:[(0,t.jsxs)("span",{className:"relative flex w-2 h-2",children:[(0,t.jsx)("span",{className:"absolute inline-flex w-full h-full rounded-full bg-[#22C55E] opacity-60 animate-ping"}),(0,t.jsx)("span",{className:"relative inline-flex w-2 h-2 rounded-full bg-[#22C55E]"})]}),(0,t.jsx)("span",{className:"text-white font-semibold",children:ac.toLocaleString(e)}),(0,t.jsx)("span",{className:"text-gray-400",children:E.UI.chat.onlineNow[e]})]}),(ew||ab.length>1||ag.length>1)&&(0,t.jsxs)("div",{className:"w-full flex flex-col gap-2 mt-5",children:[(ew||ab.length>1)&&(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[ew&&(0,t.jsxs)("div",{className:"w-full sm:flex-1 min-w-0 flex items-center gap-2.5 rounded-full bg-white/[0.07] ring-1 ring-white/10 pl-3.5 pr-4 h-11 shrink-0",title:E.UI.chat.micLabel[e],children:[(0,t.jsx)(x,{className:"w-4 h-4 text-white/70 shrink-0"}),(0,t.jsx)(ep,{stream:af})]}),ab.length>1&&(0,t.jsxs)("label",{className:"hidden sm:flex sm:flex-1 min-w-0 items-center gap-2 rounded-full bg-white/[0.07] hover:bg-white/10 ring-1 ring-white/10 pl-3.5 pr-3 h-11 cursor-pointer transition-colors",children:[(0,t.jsx)(x,{className:"w-4 h-4 text-white/70 shrink-0"}),(0,t.jsx)("select",{value:ay.micId??ab[0]?.deviceId??"",onChange:e=>void aA("micId",e.target.value),className:"flex-1 min-w-0 bg-transparent text-white text-sm outline-none appearance-none cursor-pointer truncate","aria-label":E.UI.chat.micLabel[e],children:ab.map((a,r)=>(0,t.jsx)("option",{value:a.deviceId,className:"bg-[#16161a]",children:a.label||`${E.UI.chat.micLabel[e]} ${r+1}`},a.deviceId))}),(0,t.jsx)(h,{className:"w-4 h-4 text-white/50 shrink-0"})]})]}),ag.length>1&&(0,t.jsxs)("label",{className:"hidden sm:flex w-full min-w-0 items-center gap-2 rounded-full bg-white/[0.07] hover:bg-white/10 ring-1 ring-white/10 pl-3.5 pr-3 h-11 cursor-pointer transition-colors",children:[(0,t.jsx)(k.VideoCameraIcon,{className:"w-4 h-4 text-white/70 shrink-0"}),(0,t.jsx)("select",{value:ay.cameraId??ag[0]?.deviceId??"",onChange:e=>void aA("cameraId",e.target.value),className:"flex-1 min-w-0 bg-transparent text-white text-sm outline-none appearance-none cursor-pointer truncate","aria-label":E.UI.chat.cameraLabel[e],children:ag.map((a,r)=>(0,t.jsx)("option",{value:a.deviceId,className:"bg-[#16161a]",children:a.label||`${E.UI.chat.cameraLabel[e]} ${r+1}`},a.deviceId))}),(0,t.jsx)(h,{className:"w-4 h-4 text-white/50 shrink-0"})]})]}),(0,t.jsxs)("p",{className:"mt-5 text-xs text-gray-500 max-w-xs leading-relaxed",children:[E.UI.chat.houseRules[e],ej&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)(s.default,{href:(0,C.localizedPath)((0,C.isTranslated)(ej,e)?e:C.DEFAULT_LOCALE,`/guide/${ej.slug}`),className:"underline underline-offset-2 text-gray-400 hover:text-white transition-colors",children:E.UI.chat.safetyGuide[e]})]})]})]})}):"ended"===aJ?(0,t.jsx)("div",{className:a1,children:(0,t.jsxs)("div",{className:"my-auto w-full max-w-md lg:max-w-lg flex flex-col items-center text-center",children:[(0,t.jsx)("h2",{className:"text-white text-2xl sm:text-3xl font-bold tracking-tight mb-3",children:E.UI.chat.chatEnded[e]}),(ao.matches>0||0!==tW)&&(0,t.jsxs)("div",{className:"flex flex-wrap justify-center gap-2 mb-5",children:[ao.matches>0&&(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-white/[0.07] ring-1 ring-white/10 pl-2.5 pr-3.5 py-1.5 text-[13px] text-gray-300",children:[(0,t.jsx)(j,{className:"w-4 h-4 text-white/60 shrink-0"}),E.UI.chat.summary[e].replace("{people}",1===ao.matches?E.UI.chat.summaryOnePerson[e]:E.UI.chat.summaryPeople[e].replace("{n}",String(ao.matches))).replace("{time}",(P=Math.floor((M=ao.seconds)/3600),L=Math.floor(M%3600/60),$=P?String(L).padStart(2,"0"):String(L),`${P?`${P}:`:""}${$}:${String(M%60).padStart(2,"0")}`))]}),0!==tW&&(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-white/[0.07] ring-1 ring-white/10 pl-2.5 pr-3.5 py-1.5 text-[13px] text-gray-300",children:[(0,t.jsx)(w.SparklesIcon,{className:"w-4 h-4 shrink-0",style:{color:S.default.primaryColor}}),(0,E.tpl)(E.UI.chat.karmaThisSession[e],{n:(tW>0?"+":"−")+Math.abs(tW)})]})]}),"none"!==au&&(0,t.jsxs)("div",{className:"sm:hidden mt-5 w-full rounded-2xl bg-white/[0.05] ring-1 ring-white/10 p-4 text-left",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("span",{className:"w-10 h-10 rounded-xl bg-white/[0.07] ring-1 ring-white/10 flex items-center justify-center shrink-0",style:{color:S.default.primaryColor},children:(0,t.jsx)(m,{className:"w-5 h-5"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-white text-sm font-semibold leading-snug",children:E.UI.chat.installTitle[e].replace("{brand}",S.default.brandName)}),(0,t.jsx)("p",{className:"text-gray-400 text-xs leading-relaxed mt-1",children:"ios"===au?E.UI.chat.installIos[e]:E.UI.chat.installBody[e]})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)("button",{onClick:function(){try{localStorage.setItem(ek,"1")}catch{}am("none")},className:"h-9 px-3.5 rounded-full text-gray-300 text-xs font-medium bg-white/[0.06] hover:bg-white/10 transition-colors",children:E.UI.chat.installDismiss[e]}),"prompt"===au&&(0,t.jsx)("button",{onClick:()=>
1void aM(),className:"h-9 px-4 rounded-full text-white text-xs font-semibold hover:brightness-110 active:scale-95 transition",style:{backgroundColor:S.default.primaryColor},children:E.UI.chat.installButton[e]})]})]})]})}):tS?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("video",{ref:tP,controls:!1,crossOrigin:"anonymous",src:J(tS.id),playsInline:!0,muted:!0,"aria-hidden":"true",style:{visibility:aN?"visible":"hidden"},className:"absolute inset-0 w-full h-full object-cover scale-110 blur-2xl opacity-40 pointer-events-none"},`${tS.id}-background`),(0,t.jsx)("video",{ref:tU,controls:!1,crossOrigin:"anonymous",src:J(tS.id),playsInline:!0,preload:"auto",style:{visibility:aN?"visible":"hidden"},onCanPlay:()=>tM.current?.ready(),onPlaying:()=>{if(tE.current?.id!==tS.id||tL.current)return;tL.current=Date.now();var e=tS.id;try{sessionStorage.setItem(Z,JSON.stringify([..._().filter(t=>t!==e),e]))}catch{}let t=tR.current;t&&X.current?.clipPlayed(tS.id,t)},onEnded:()=>{tE.current?.id===tS.id&&aU("finished")&&aF()},onError:()=>{tE.current?.id===tS.id&&aU("error")&&aF()},className:"chat-video-foreground"},tS.id),!aN&&(0,t.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center px-5",children:(0,t.jsx)(eR,{connecting:"connecting"===tI,locale:e})})]}):aI?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("video",{ref:W,controls:!1,playsInline:!0,muted:!0,"aria-hidden":"true",className:"absolute inset-0 w-full h-full object-cover scale-110 blur-2xl opacity-40 pointer-events-none"}),(0,t.jsx)("video",{ref:z,controls:!1,playsInline:!0,onPlaying:()=>{W.current?.play().catch(()=>{})},className:"chat-video-foreground"}),!eB&&(0,t.jsx)("div",{className:"absolute inset-0 bg-[#101014] flex flex-col items-center justify-center text-center px-5",children:(0,t.jsx)(eR,{connecting:!0,locale:e})})]}):(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center px-5",children:[tu&&!aS?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f,{className:"w-6 h-6 mb-3",style:{color:S.default.primaryColor}}),(0,t.jsx)("p",{className:"animate-pulse-connect text-white text-base sm:text-lg mb-4",children:E.UI.chat.roomWaiting[e]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-2 w-full max-w-sm",children:[(0,t.jsx)("span",{className:"min-w-0 max-w-full h-11 px-4 rounded-full bg-white/[0.07] ring-1 ring-white/10 flex items-center text-white text-sm font-medium truncate",children:`${S.default.domain}/r/${tu}`}),(0,t.jsx)("button",{onClick:()=>void aD(tu),className:"h-11 px-5 rounded-full text-white text-sm font-semibold shrink-0 hover:brightness-110 active:scale-95 transition",style:{backgroundColor:S.default.primaryColor},children:tb?E.UI.chat.roomCopied[e]:E.UI.chat.roomCopy[e]})]}),(0,t.jsx)("p",{className:"text-gray-500 text-xs sm:text-sm mt-4 max-w-xs mx-auto leading-relaxed",children:E.UI.chat.roomWaitingHint[e]})]}):aT?(0,t.jsx)("p",{className:"text-gray-500 text-xs sm:text-sm max-w-xs mx-auto leading-relaxed",children:E.UI.chat.fallbackBody[e]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eR,{connecting:aS,locale:e}),as&&aS&&(0,t.jsx)("p",{className:"text-gray-500 text-xs mt-4 max-w-xs mx-auto",children:E.UI.chat.slowConnect[e]})]}),!aS&&!tu&&t_.adminMatching&&(0,t.jsx)("p",{className:"mt-4 text-xs text-gray-400",role:"status",children:"Admin priority · real matches only"}),!aS&&!tu&&a_.length>0&&(0,t.jsxs)("p",{className:"mt-4 inline-flex items-center gap-1.5 text-gray-400 text-xs",children:[(0,t.jsx)(n,{className:"w-3.5 h-3.5 shrink-0"}),t_.affordable?a_.join(" · "):(0,E.tpl)(E.UI.chat.filtersWaiting[e],{n:String(t_.cost)})]})]}),aY&&aE&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"absolute top-2.5 left-2.5 sm:top-3 sm:left-3 z-[2] flex items-center gap-2 rounded-full bg-black/55 backdrop-blur-md ring-1 ring-white/10 pl-1 pr-3 py-1",children:[(0,t.jsx)("span",{className:"w-7 h-7 rounded-full bg-white/10 flex items-center justify-center text-white/80",children:(0,t.jsx)(y,{className:"w-4 h-4"})}),(0,t.jsx)("span",{className:"text-white text-[13px] font-medium capitalize leading-none",children:aE.gender}),aE.age>0&&(0,t.jsx)("span",{className:"text-white/60 text-[13px] leading-none",children:aE.age}),(0,t.jsx)("span",{className:"text-[15px] leading-none",title:O(aE.country,e),children:(R=aE.country,/^[A-Z]{2}$/.test(R)?String.fromCodePoint(...R.split("").map(e=>127462+e.charCodeAt(0)-65)):"🌍")})]}),(0,t.jsx)("button",{onClick:function(){let e=null,t=tE.current;ta(t?.id??null);let a=t?tU.current:z.current;if(t&&a?.pause(),a&&a.videoWidth>0)try{let t=document.createElement("canvas"),r=Math.min(1,480/Math.max(a.videoWidth,a.videoHeight));t.width=Math.round(a.videoWidth*r),t.height=Math.round(a.videoHeight*r),t.getContext("2d")?.drawImage(a,0,0,t.width,t.height),e=t.toDataURL("image/jpeg",.6)}catch{e=null}te(e),e8(!0)},className:"absolute top-2.5 right-2.5 sm:top-3 sm:right-3 z-[2] w-9 h-9 rounded-full bg-black/55 backdrop-blur-md ring-1 ring-white/10 flex items-center justify-center text-white/80 hover:text-white hover:bg-black/70 transition-colors",title:E.UI.chat.report[e],"aria-label":E.UI.chat.report[e],children:(0,t.jsx)(p,{className:"w-4 h-4"})})]}),aY&&eX&&(0,t.jsxs)("button",{onClick:()=>{let e=tU.current??z.current;e&&(e.muted=!1,e.play().then(()=>e0(!1)).catch(()=>{}))},className:"absolute bottom-2.5 left-2.5 sm:bottom-3 sm:left-3 z-[2] inline-flex items-center gap-1.5 rounded-full px-3 py-2 text-white text-xs font-semibold shadow-lg transition-transform hover:scale-105 whitespace-nowrap",style:{backgroundColor:S.default.primaryColor},children:[(0,t.jsx)(b,{className:"w-4 h-4"}),E.UI.chat.tapToUnmute[e]]}),aY&&(aC||aN)&&(0,t.jsx)("div",{className:"chat-reactions absolute bottom-2.5 right-2.5 sm:bottom-3 sm:right-3 z-[2] flex items-center gap-0.5 rounded-full bg-black/55 backdrop-blur-md ring-1 ring-white/10 p-1",role:"group","aria-label":E.UI.chat.react[e],title:t1<=0?E.UI.chat.reactCooldown[e]:void 0,children:tq.map(e=>(0,t.jsx)("button",{onClick:()=>(function(e){let t=Date.now();if(eT(t2.current,t)>=20)return void t5(0);if(!(tE.current&&"playing"===tI)&&!X.current?.sendReaction(e))return;t2.current.push(t),t5(20-t2.current.length),t6(e,"float");let a=t2.current[0];window.setTimeout(()=>{t5(20-eT(t2.current,Date.now()))},a+1e4-t+20)})(e),disabled:!aH||t1<=0,className:"w-9 h-9 sm:w-10 sm:h-10 rounded-full flex items-center justify-center text-[22px] sm:text-2xl leading-none hover:bg-white/10 active:scale-75 transition disabled:opacity-40 disabled:active:scale-100","aria-label":e,children:e},e))}),aY&&tX.some(e=>"float"===e.mode)&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[3] overflow-hidden","aria-hidden":"true",children:tX.filter(e=>"float"===e.mode).map(e=>(0,t.jsx)("span",{"data-rain":"float",className:"emoji-float absolute bottom-14 sm:bottom-16 select-none",style:{right:`${e.x}%`,fontSize:e.size,lineHeight:1,animationDuration:`${e.duration}ms`,"--sway":`${e.sway}px`},children:e.emoji},e.id))})]}),(0,t.jsxs)("div",{className:aX,children:[ew?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("video",{ref:B,controls:!1,muted:!0,playsInl
1ine:!0,"aria-hidden":"true",className:"absolute inset-0 w-full h-full object-cover scale-110 blur-2xl opacity-40 pointer-events-none",style:{transform:"user"===t9?"scaleX(-1)":"none"}},`self-background-${af?.id}`),(0,t.jsx)("video",{ref:D,controls:!1,muted:!0,playsInline:!0,onPlaying:()=>{B.current?.play().catch(()=>{})},className:"chat-video-foreground",style:{transform:"user"===t9?"scaleX(-1)":"none"}},`self-foreground-${af?.id}`)]}):(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 text-center px-5",children:[(0,t.jsx)(N,{className:"w-7 h-7 text-gray-500"}),"gate"===aJ?(0,t.jsx)("p",{className:"text-gray-400 text-xs max-w-[260px] leading-relaxed",children:E.UI.ageGate.cameraNote[e]}):"ended"===aJ?(0,t.jsx)("p",{className:"text-gray-400 text-xs max-w-[260px] leading-relaxed",children:E.UI.chat.chatEndedBody[e]}):("ready"===aJ||aY)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-gray-400 text-xs max-w-[220px]",children:E.UI.chat.cameraNeeded[e]}),(0,t.jsx)("button",{onClick:()=>aR(),className:"px-4 py-2 rounded-full text-white text-xs font-medium bg-white/10 hover:bg-white/20 transition-colors",children:E.UI.chat.retryCamera[e]})]})]}),(0,t.jsxs)("div",{className:"absolute top-2.5 left-2.5 sm:top-3 sm:left-3 z-[2] flex items-center gap-1.5 rounded-full bg-black/55 backdrop-blur-md ring-1 ring-white/10 px-3 py-1.5",children:[(0,t.jsx)("span",{className:"text-white text-[13px] font-medium leading-none",children:E.UI.chat.you[e]}),tl&&(0,t.jsx)(eC,{className:"w-3.5 h-3.5 text-[#F87171]"})]}),aY&&tD&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-12 sm:top-14 z-[3] flex justify-center px-3",children:(0,t.jsxs)("div",{className:"karma-pop inline-flex items-center gap-2 px-4 py-2 rounded-full bg-black/75 backdrop-blur-sm border border-white/10 text-white text-xs whitespace-nowrap",role:"status",children:[(0,t.jsx)(w.SparklesIcon,{className:"w-4 h-4 shrink-0",style:{color:S.default.primaryColor}}),(0,t.jsx)("span",{className:"font-semibold",children:"daily"===tD.reason?(0,E.tpl)(E.UI.chat.karmaDaily[e],{n:String(tD.delta)}):"filter"===tD.reason?(0,E.tpl)(E.UI.chat.karmaFilter[e],{n:String(Math.abs(tD.delta))}):(0,E.tpl)(E.UI.chat.karmaEarned[e],{n:String(tD.delta)})}),(0,t.jsx)("span",{className:"text-white/40",children:"·"}),(0,t.jsx)("span",{className:"text-gray-300",children:(0,E.tpl)(E.UI.chat.karmaTotal[e],{n:tD.balance.toLocaleString(e)})})]})})]}),aY&&(e_||aK.length>0)&&(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 top-[clamp(0px,calc(100%_-_14rem),50%)] sm:top-0 sm:left-[calc(50%_+_6px)] z-[4] flex flex-col items-start justify-end gap-2 px-2.5 pb-2.5 pt-11 sm:p-3",children:[aK.length>0&&(0,t.jsx)("div",{ref:ee,"data-panel":"chat",role:"log","aria-label":E.UI.chat.textChat[e],className:`chat-fade-top min-h-0 w-full max-w-sm flex flex-col gap-1.5 pt-6 ${e_?"pointer-events-auto overflow-y-auto overscroll-contain scrollbar-hide sm:max-h-[60%]":"overflow-hidden sm:max-h-[45%]"}`,children:aK.map(a=>(0,t.jsx)("div",{className:`flex transition-opacity duration-500 ${"me"===a.from?"justify-end":"justify-start"} ${!e_&&"fading"===a.state?"opacity-0":""}`,children:(0,t.jsxs)("p",{className:`${"shown"===a.state?"karma-pop":""} max-w-[85%] rounded-2xl px-3.5 py-2 text-[15px] leading-snug text-white whitespace-pre-wrap [overflow-wrap:anywhere] shadow-[0_4px_18px_rgba(0,0,0,0.35)] ${"me"===a.from?"origin-bottom-right rounded-br-md":"origin-bottom-left rounded-bl-md bg-black/65 backdrop-blur-md ring-1 ring-white/10"}`,style:"me"===a.from?{backgroundColor:S.default.primaryColor}:void 0,children:["me"===a.from&&(0,t.jsxs)("span",{className:"sr-only",children:[E.UI.chat.you[e],": "]}),a.text]})},a.id))}),e_&&(0,t.jsxs)("form",{"data-panel":"chat","aria-label":E.UI.chat.textChat[e],onSubmit:e=>{let t;e.preventDefault(),!(t=eJ.trim())||(tE.current&&"playing"===tI||X.current?.sendMessage(t))&&(t8("me",t),eY(""))},className:"karma-pop origin-bottom-left pointer-events-auto shrink-0 w-full max-w-sm flex items-center gap-2 rounded-2xl bg-[#0f0f13]/95 backdrop-blur-md border border-white/10 p-2 shadow-[0_10px_40px_rgba(0,0,0,0.5)]",children:[(0,t.jsx)("input",{ref:et,type:"text",value:eJ,onChange:e=>eY(e.target.value),placeholder:aH||tS?E.UI.chat.typeMessage[e]:aS?
1E.UI.chat.connecting[e]:E.UI.chat.searching[e],"aria-label":E.UI.chat.typeMessage[e],disabled:!aH,enterKeyHint:"send",autoComplete:"off",autoCapitalize:"sentences",className:"flex-1 min-w-0 h-11 rounded-xl bg-white/[0.05] ring-1 ring-white/[0.06] focus:ring-white/25 px-3.5 text-base text-white placeholder:text-gray-500 outline-none transition disabled:cursor-not-allowed"}),(0,t.jsx)("button",{type:"submit",disabled:!aH||!eJ.trim(),onPointerDown:e=>e.preventDefault(),className:"w-11 h-11 shrink-0 rounded-xl flex items-center justify-center text-white hover:brightness-110 active:scale-95 transition disabled:opacity-35 disabled:active:scale-100",style:{backgroundColor:S.default.primaryColor},"aria-label":"Send",children:(0,t.jsx)(g,{className:"w-[18px] h-[18px]"})})]})]})]})})}),(0,t.jsxs)("div",{className:"relative z-20 shrink-0 px-2 sm:px-4 chat-stack-pb",children:[(tr||ti||tJ||tH||tg||ty)&&(0,t.jsxs)("div",{className:"absolute inset-x-2 sm:inset-x-4 bottom-full mb-2 flex flex-col gap-2",children:[tg&&(0,t.jsxs)("div",{"data-panel":"room",role:"dialog","aria-label":E.UI.chat.room[e],className:"karma-pop self-center w-full max-w-sm rounded-2xl bg-[#0f0f13]/95 backdrop-blur-md border border-white/10 p-4 text-left shadow-[0_10px_40px_rgba(0,0,0,0.5)]",children:[(0,t.jsxs)("p",{className:"text-white text-sm font-semibold leading-snug inline-flex items-center gap-2",children:[(0,t.jsx)(f,{className:"w-4 h-4 shrink-0 text-white/70"}),E.UI.chat.room[e]]}),(0,t.jsx)("p",{className:"text-gray-400 text-xs leading-relaxed mt-1",children:E.UI.chat.roomBody[e]}),tu?(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"flex-1 min-w-0 h-10 px-3.5 rounded-xl bg-white/[0.05] ring-1 ring-white/[0.06] flex items-center text-white text-sm truncate",children:`${S.default.domain}/r/${tu}`}),(0,t.jsx)("button",{onClick:()=>void aD(tu),className:"h-10 px-4 rounded-full text-white text-xs font-semibold shrink-0 hover:brightness-110 active:scale-95 transition",style:{backgroundColor:S.default.primaryColor},children:tb?E.UI.chat.roomCopied[e]:E.UI.chat.roomCopy[e]})]}):(0,t.jsxs)("button",{onClick:()=>void aZ(),className:"mt-3 w-full h-11 rounded-full inline-flex items-center justify-center gap-2 text-white text-sm font-semibold hover:brightness-110 active:scale-[0.98] transition",style:{backgroundColor:S.default.primaryColor},children:[(0,t.jsx)(f,{className:"w-4 h-4"}),E.UI.chat.roomCreate[e]]})]}),ty&&(0,t.jsx)("div",{className:"karma-pop self-center max-w-sm px-4 py-2.5 rounded-2xl bg-black/75 backdrop-blur-sm border border-white/10 text-white text-xs leading-relaxed text-center",role:"status",children:E.UI.chat.roomEmpty[e]}),tJ&&(0,t.jsx)(eu,{locale:e,account:tZ,onChanged:()=>X.current?.refreshFilters(),className:"self-center w-full max-w-sm"}),tH&&(0,t.jsxs)("div",{className:"karma-pop self-center w-full max-w-sm rounded-2xl bg-black/80 backdrop-blur-md border border-white/10 p-4 text-left",children:[(0,t.jsx)("p",{className:"text-white text-sm font-semibold leading-snug",children:E.UI.chat.thinTitle[e]}),(0,t.jsx)("p",{className:"text-gray-400 text-xs leading-relaxed mt-1",children:E.UI.chat.thinBody[e]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)("button",{onClick:()=>tK(!1),className:"h-9 px-3.5 rounded-full text-gray-300 text-xs font-medium bg-white/[0.06] hover:bg-white/10 transition-colors",children:E.UI.chat.keepWaiting[e]}),(0,t.jsx)("button",{onClick:()=>void az(),className:"h-9 px-4 rounded-full text-white text-xs font-semibold hover:brightness-110 active:scale-95 transition",style:{backgroundColor:S.default.primaryColor},children:E.UI.chat.turnOffFilters[e]})]})]}),tr&&(0,t.jsx)("div",{className:"self-center px-4 py-2 rounded-full bg-black/75 backdrop-blur-sm border border-white/10 text-white text-xs",children:"blockOnly"===tr?E.UI.chat.blockSubmitted[e]:E.UI.chat.reportSubmitted[e]}),ti&&(0,t.jsx)("div",{"data-panel":"settings",role:"dialog","aria-label":E.UI.chat.settings[e],className:"karma-pop self-center w-full max-w-sm rounded-2xl bg-[#0f0f13]/95 backdrop-blur-md border border-white/10 p-3 text-left shadow-[0_10px_40px_rgba(0,0,0,0.5)]",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("button",{onClick:function(){let e=!tl;
1tc(e),at.current=e,G.current?.getAudioTracks().forEach(t=>t.enabled=!e)},className:"w-full h-12 px-3 flex items-center gap-2.5 rounded-xl bg-white/[0.05] ring-1 ring-white/[0.06] hover:bg-white/10 text-white text-sm font-semibold transition-colors",children:[tl?(0,t.jsx)(eC,{className:"w-4 h-4 text-[#E74C3C] shrink-0"}):(0,t.jsx)(x,{className:"w-4 h-4 text-white/70 shrink-0"}),tl?E.UI.chat.unmuteMic[e]:E.UI.chat.muteMic[e]]}),(0,t.jsxs)("button",{onClick:()=>void aB(),className:"sm:hidden w-full h-12 px-3 flex items-center gap-2.5 rounded-xl bg-white/[0.05] ring-1 ring-white/[0.06] hover:bg-white/10 text-white text-sm font-semibold transition-colors",children:[(0,t.jsx)(c,{className:"w-4 h-4 text-white/70 shrink-0"}),E.UI.chat.flipCamera[e]]})]})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 xl:grid xl:grid-cols-[minmax(0,1fr)_minmax(27.5rem,auto)_minmax(0,1fr)] xl:items-center xl:gap-3",children:[(0,t.jsx)("div",{className:"min-w-0 w-full sm:w-auto sm:max-w-full sm:self-start xl:col-start-1 xl:row-start-1 xl:justify-self-start",children:(0,t.jsx)(eb,{locale:e,variant:"bar",className:"w-full"})}),(0,t.jsx)("div",{className:"xl:col-start-2 xl:row-start-1 flex justify-center",children:(0,t.jsxs)("div",{className:"flex items-center gap-0.5 sm:gap-1.5 rounded-full bg-white/[0.07] backdrop-blur-xl ring-1 ring-white/10 p-1.5 shadow-[0_10px_40px_rgba(0,0,0,0.5)]",children:[(0,t.jsxs)("button",{onClick:()=>tn(e=>!e),"data-panel":"settings",disabled:"ready"!==aJ&&!aY,className:"relative w-10 h-10 sm:w-12 sm:h-12 rounded-full flex items-center justify-center text-white/85 hover:text-white hover:bg-white/10 active:scale-95 transition disabled:opacity-30 disabled:pointer-events-none",title:E.UI.chat.settings[e],"aria-label":E.UI.chat.settings[e],"aria-expanded":ti,children:[(0,t.jsx)(u,{className:"w-[22px] h-[22px]"}),tl&&(0,t.jsx)("span",{className:"absolute top-1.5 right-1.5 w-2.5 h-2.5 rounded-full bg-[#E74C3C] ring-2 ring-[#151518]","aria-hidden":"true"})]}),(0,t.jsxs)("button",{onClick:function(){(e4(0),e_)?eG(!1):((0,r.flushSync)(()=>eG(!0)),et.current?.focus())},"data-panel":"chat",disabled:!aY,className:"relative w-10 h-10 sm:w-12 sm:h-12 rounded-full flex items-center justify-center text-white/85 hover:text-white hover:bg-white/10 active:scale-95 transition disabled:opacity-30 disabled:pointer-events-none",title:E.UI.chat.textChat[e],"aria-label":e3>0?`${E.UI.chat.textChat[e]} (${e3})`:E.UI.chat.textChat[e],children:[(0,t.jsx)(d,{className:"w-[22px] h-[22px]"}),e3>0&&(0,t.jsx)("span",{className:"absolute top-0.5 right-0.5 min-w-[18px] h-[18px] px-1 rounded-full bg-[#E74C3C] ring-2 ring-[#151518] flex items-center justify-center text-[10px] font-bold leading-none","aria-hidden":"true",children:e3>9?"9+":e3})]}),(0,t.jsxs)("button",{onClick:()=>tY(e=>!e),"data-panel":"filters",disabled:"gate"===aJ||"loading"===aJ,className:"relative w-10 h-10 sm:w-12 sm:h-12 rounded-full flex items-center justify-center text-white/85 hover:text-white hover:bg-white/10 active:scale-95 transition disabled:opacity-30 disabled:pointer-events-none",title:E.UI.chat.filters[e],"aria-label":E.UI.chat.filters[e],"aria-expanded":tJ,children:[(0,t.jsx)(n,{className:"w-[22px] h-[22px]"}),aq&&(0,t.jsx)("span",{className:"absolute top-1.5 right-1.5 w-2.5 h-2.5 rounded-full bg-[#E74C3C] ring-2 ring-[#151518]","aria-hidden":"true"})]}),(0,t.jsxs)("button",{onClick:()=>tw(e=>!e),"data-panel":"room",disabled:"gate"===aJ||"loading"===aJ,className:"relative w-10 h-10 sm:w-12 sm:h-12 rounded-full flex items-center justify-center text-white/85 hover:text-white hover:bg-white/10 active:scale-95 transition disabled:opacity-30 disabled:pointer-events-none",title:E.UI.chat.room[e],"aria-label":E.UI.chat.room[e],"aria-expanded":tg,children:[(0,t.jsx)(f,{className:"w-[22px] h-[22px]"}),tu&&(0,t.jsx)("span",{className:"absolute top-1.5 right-1.5 w-2.5 h-2.5 rounded-full ring-2 ring-[#151518]",style:{backgroundColor:S.default.primaryColor},"aria-hidden":"true"})]}),(0,t.jsx)("span",{className:"w-px h-6 bg-white/10 mx-0.5 sm:mx-1","aria-hidden":"true"}),(0,t.jsx)("button",{onClick:function(){tA.current+=1,aU("skipped"),X.current?.stop(),tp.current=null,tm(null),tw(!1),tv(!1),G.current?.getTracks().forEac
1h(e=>e.stop()),G.current=null,ax(null),X.current?.setLocalStream(null),eA(!1),eV(!0),e4(0),tn(!1),tY(!1),tK(!1),tB(null),t0([]),eG(!1),eK([]),eY(""),eF(null),eD(null)},disabled:!aY,className:"w-10 h-10 sm:w-12 sm:h-12 rounded-full flex items-center justify-center bg-white/[0.06] text-[#F87171] hover:bg-[#E74C3C]/20 active:scale-95 transition disabled:opacity-30 disabled:pointer-events-none",title:E.UI.chat.stop[e],"aria-label":E.UI.chat.stop[e],children:(0,t.jsx)(v,{className:"w-[22px] h-[22px]"})}),(0,t.jsxs)("button",{onClick:aQ.onClick,disabled:!aQ.onClick,className:"h-10 sm:h-12 pl-5 pr-4 rounded-full flex items-center gap-2 text-white font-semibold text-sm sm:text-[15px] shadow-lg hover:brightness-110 active:scale-95 transition whitespace-nowrap disabled:opacity-50 disabled:pointer-events-none",style:{backgroundColor:S.default.primaryColor},title:aQ.label,"aria-label":aQ.label,children:[aQ.label,(0,t.jsx)(o.ArrowRightIcon,{className:"w-4 h-4"})]})]})})]})]}),tX.some(e=>"fall"===e.mode)&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 z-30 overflow-hidden","aria-hidden":"true",children:tX.filter(e=>"fall"===e.mode).map(e=>(0,t.jsx)("span",{"data-rain":"fall",className:"emoji-rain absolute top-0 select-none",style:{left:`${e.x}%`,fontSize:e.size,lineHeight:1,animationDuration:`${e.duration}ms`,"--sway":`${e.sway}px`},children:e.emoji},e.id))}),e6&&(0,t.jsx)("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-black/70 px-5",onClick:()=>e8(!1),children:(0,t.jsxs)("div",{className:"w-full max-w-sm rounded-2xl bg-[#16161a] border border-white/10 p-5",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("h3",{className:"text-white text-lg font-semibold mb-3",children:E.UI.chat.blockOrReportTitle[e]}),(0,t.jsxs)("button",{type:"button",onClick:function(){tt?H(tt):X.current?.block(),e8(!1),te(null),ts("blockOnly"),window.setTimeout(()=>ts(!1),3500),aF()},className:"w-full flex items-center justify-between gap-3 text-left px-4 py-3 mb-4 rounded-xl text-white transition-[filter] hover:brightness-110",style:{backgroundColor:S.default.primaryColor},children:[(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block text-sm font-semibold",children:E.UI.chat.blockAndNext[e]}),(0,t.jsx)("span",{className:"block text-white/75 text-xs leading-relaxed",children:E.UI.chat.blockAndNextHint[e]})]}),(0,t.jsx)(o.ArrowRightIcon,{className:"w-5 h-5 shrink-0","aria-hidden":"true"})]}),(0,t.jsx)("p",{className:"text-white text-sm font-medium mb-1",children:E.UI.chat.reportInstead[e]}),(0,t.jsx)("p",{className:"text-gray-400 text-xs leading-relaxed mb-3",children:E.UI.chat.reportBody[e]}),(0,t.jsx)("div",{className:"space-y-2",children:eM.map(([a,r])=>(0,t.jsx)("button",{onClick:()=>{X.current?.report(a,e9,!0,tt??void 0),tt&&H(tt),e8(!1),te(null),ts("reported"),window.setTimeout(()=>ts(!1),3500),aF()},className:"w-full text-left px-4 py-3 rounded-xl bg-white/5 hover:bg-white/15 text-white text-sm transition-colors",children:E.UI.chat[r][e]},a))}),(0,t.jsx)("button",{onClick:()=>e8(!1),className:"w-full mt-3 py-2.5 text-gray-400 hover:text-white text-sm transition-colors",children:E.UI.chat.reportCancel[e]})]})}),tk&&(0,t.jsx)(ec,{locale:e,onDone:e=>{tN(!1),eg(e)},onClose:()=>F.replace((0,C.localizedPath)(e,"/")+`?room=${eS()??""}`)}),to&&(0,t.jsx)(es,{locale:e,tab:to,onTabChange:td,onClose:()=>td(null),onAuthChange:function(){aC?th.current=!0:X.current?.rejoin()}}),e1&&(0,t.jsxs)("div",{className:"pointer-events-none absolute chat-inset-debug left-3 z-30 bg-black/85 text-[11px] leading-relaxed text-green-300 font-mono px-3 py-2 rounded-lg max-w-[80vw] break-all",children:[(0,t.jsxs)("div",{children:["state: ",String(e1.state)," / ws: ",String(e1.socket)]}),(0,t.jsxs)("div",{children:["pc: ",String(e1.pc)," / ice: ",String(e1.ice)]}),(0,t.jsxs)("div",{children:["path: ",String(e1.candidate)," ↔ ",String(e1.remote)]}),(0,t.jsxs)("div",{className:e1.turn?"text-green-300":"text-red-400",children:["turn configured: ",String(e1.turn)]}),(0,t.jsxs)("div",{children:["camera: ",String(ew)]}),(0,t.jsxs)("div",{children:["capture: ",String(e1.capture)," / ",String(e1.orientation)]}),(0,t.jsxs)("div",{children:["self: ",String(e1.localVideo)]}),(0,t.jsxs)("div",{children:["remote: ",String(e1.remoteVideo)]}),(0,t.jsxs)("div",{children:["received: ",String(e1.rxBytes)," bytes / ",String(e1.rxFrames)," decoded frames / lost:",String(e1.rxLost)]}),(0,t.jsxs)("div",{children:["rx: ",String(e1.rxSize)," ",String(e1.rxCodec)," / tx: ",String(e1.txSize)]}),(0,t.jsxs)("div",{children:["remote track: ",String(e1.track)]})]})]})}],40015)}]);

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.