1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{245:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var a=n(5155),r=n(2115),s=n(3735),i=n(8213);function l(){let[e,t]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=()=>t(e=>e+1);return window.addEventListener(i.P,e),()=>window.removeEventListener(i.P,e)},[]),e>0?(0,a.jsx)(s.default,{},e):null}},311:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var a=n(5155),r=n(2115),s=n(9636),i=n(8213),l=n(2578);let o=(e,t)=>"".concat(e," ").concat(t).concat(1===e?"":"s"),c=e=>{var t;return e.length>1?"".concat(e.slice(0,-1).join(", ")," and ").concat(e.at(-1)):null!=(t=e[0])?t:""};var d=n(1266),u=n(1175),m=n(5202);function h(){let[e,t]=(0,r.useState)(null),n=(0,r.useCallback)(()=>t(null),[]);if((0,r.useEffect)(()=>{let e=e=>{var n;let a=null==(n=e.detail)?void 0:n.user,r=(0,l.U2)();if(a&&r&&r.fresh&&r.user.id===a.id&&a&&r){try{t({name:(0,d.Mn)()||a.name,streak:(0,m.c2)().count,achievements:(0,s.oc)().size,adoptedName:r.adoptedName,summary:r.summary})}catch(e){return}(0,i.Q)(),(0,u._O)("win")}};return window.addEventListener(l.Dh,e),()=>window.removeEventListener(l.Dh,e)},[]),(0,r.useEffect)(()=>{if(!e)return;let t=window.setTimeout(n,9e3);return()=>window.clearTimeout(t)},[e,n]),!e)return null;let{headline:h,detail:f}=function(e){let{name:t,streak:n,achievements:a,summary:r}=e,{mode:s,achievementsGained:i,bestsRaised:l,streakRestored:d}=r,u=[];n>0&&u.push("".concat(n,"-day streak")),a>0&&u.push(o(a,"achievement"));let m=[];return d&&m.push("your streak"),i>0&&m.push(o(i,"achievement")),l>0&&m.push(o(l,"record")),{headline:"upload"===s?"You're all set, ".concat(t):"Welcome back, ".concat(t),detail:"merge"===s?m.length?"Nothing was replaced â ".concat(c(m)," came back from your account."):"Nothing was replaced â this device was already up to date.":"restore"===s?u.length?"".concat(c(u)," â restored and safe on any device."):"Your progress is back.":u.length?"".concat(c(u)," â safe now, on any device."):"Your progress will follow you to any device from here."}}({name:e.name,streak:e.streak,achievements:e.achievements,summary:e.summary});return(0,a.jsx)("div",{className:"pointer-events-none fixed inset-x-0 bottom-0 z-[95] flex justify-center px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",role:"status",children:(0,a.jsxs)("div",{className:"motion-safe:animate-slide-up pointer-events-auto relative w-full max-w-md overflow-hidden rounded-2xl border border-emerald-400/30 bg-zinc-950/95 p-4 pr-10 shadow-2xl shadow-black/60 backdrop-blur",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute -left-10 -top-12 h-32 w-32 rounded-full bg-emerald-500/20 blur-2xl"}),(0,a.jsx)("button",{onClick:n,"aria-label":"Dismiss",className:"absolute right-2 top-2 rounded-lg px-2 py-1 text-sm leading-none text-zinc-600 transition hover:text-zinc-300",children:"â"}),(0,a.jsxs)("div",{className:"relative flex items-center gap-3",children:[(0,a.jsx)("span",{className:"text-3xl","aria-hidden":!0,children:"\uD83C\uDF89"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-[15px] font-extrabold leading-snug text-white",children:h}),(0,a.jsxs)("p",{className:"mt-0.5 text-xs leading-snug text-zinc-400",children:[f,e.adoptedName&&" We've used your Google name â change it in Settings."]})]})]})]})})}},708:(e,t,n)=>{"use strict";n.d(t,{DonateFooterLink:()=>d,S:()=>c,T:()=>o});var a=n(5155),r=n(9045),s=n(6815);function i(e){let{className:t=""}=e;return(0,a.jsx)("svg",{viewBox:"0 0 24 24",className:t,fill:"currentColor","aria-hidden":!0,children:(0,a.jsx)("path",{d:"M12 20.7 4.6 13.6a4.9 4.9 0 0 1 0-7 5 5 0 0 1 7.1 0l.3.3.3-.3a5 5 0 0 1 7.1 0 4.9 4.9 0 0 1 0 7L12 20.7Z"})})}let l=()=>(0,s.lk)()?{target:"_blank",rel:"noopener noreferrer"}:{};function o(){return(0,s.B3)()?(0,a.jsxs)("a",{href:s.Av,...l(),onClick:r.SM,title:s.WS,className:"fn-donate group relative flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full border border-rose-400/40 bg-gradient-to-r from-rose-500/30 via-pink-500/25 to-amber-400/20 px-3.5 py-1.5 text-sm font-bold text-rose-100 shadow-lg shadow-rose-500/20 transition duration-300 hover:scale-105 hover:border-rose-300/60 hover:shadow-rose-500/40",children:[(0,a.jsx)("span",{"aria-hidden":!0,
1className:"pointer-events-none absolute inset-0 -translate-x-full bg-gradient-to-r from-transparent via-white/30 to-transparent motion-safe:animate-donate-shine"}),(0,a.jsx)(i,{className:"fn-donate-heart relative h-3.5 w-3.5 text-rose-300 motion-safe:animate-heart-beat"}),(0,a.jsx)("span",{className:"relative",children:s.jA})]}):null}function c(e){let{onNavigate:t}=e;return(0,s.B3)()?(0,a.jsxs)("a",{href:s.Av,...l(),onClick:()=>{(0,r.SM)(),null==t||t()},className:"flex items-center gap-2 rounded-lg border-l-2 border-transparent px-3 py-2.5 font-semibold text-rose-300 transition hover:bg-white/10",children:[(0,a.jsx)(i,{className:"h-4 w-4 motion-safe:animate-heart-beat"}),s.WS]}):null}function d(){return(0,s.B3)()?(0,a.jsxs)("a",{href:s.Av,...l(),className:"flex items-center gap-2 rounded-full border border-rose-400/30 bg-rose-400/10 px-4 py-2 font-semibold text-rose-200 transition hover:bg-rose-400/20",children:[(0,a.jsx)(i,{className:"h-4 w-4 motion-safe:animate-heart-beat"}),s.WS]}):null}},1896:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var a=n(5155),r=n(63),s=n(2115),i=n(9636),l=n(1175);function o(){let e=(0,r.usePathname)()||"/",[t,n]=(0,s.useState)(!1),[o,c]=(0,s.useState)("hidden"),d=(0,s.useRef)(null),u=(0,s.useRef)(null),m=(0,s.useRef)(null),[h,f]=(0,s.useState)(!1),[x,p]=(0,s.use
1State)(null),b=(0,s.useRef)({x:0,y:0,vx:0,vy:0,t:0,raf:0,last:0,dropped:!1,pokes:0});(0,s.useEffect)(()=>{var e,t;n(!(null==(e=(t=window).matchMedia)?void 0:e.call(t,"(prefers-reduced-motion: reduce)").matches))},[]),(0,s.useEffect)(()=>{let n;return t&&("/"===e||"/leaderboards"===e)?void c(e=>"in"===e?e:"in"):(c(e=>"hidden"===e?e:(n=setTimeout(()=>{b.current.dropped=!1,b.current.pokes=0,f(!1),c("hidden")},700),"out")),()=>clearTimeout(n))},[e,t]);let g=(0,s.useCallback)(e=>{let t=b.current,n=e.getBoundingClientRect(),a=n.left-t.x,r=n.top-t.y;return{minX:8-a,maxX:window.innerWidth-8-n.width-a,minY:8-r,maxY:window.innerHeight-8-n.height-r}},[]),w=(0,s.useCallback)(e=>{let t=b.current,n=d.current;if(!n){t.raf=0;return}let a=Math.min(48,e-t.last)/16.667;t.last=e,t.t+=a,t.vy+=.02*a,t.vx+=.012*Math.sin(.06*t.t)*a;let r=Math.pow(.9875,a);t.vx*=r,t.vy*=r,t.x+=t.vx*a,t.y+=t.vy*a;let s=g(n);if(t.x<s.minX?(t.x=s.minX,t.vx=.4*Math.abs(t.vx)):t.x>s.maxX&&(t.x=s.maxX,t.vx=-(.4*Math.abs(t.vx))),t.y<s.minY?(t.y=s.minY,t.vy=.4*Math.abs(t.vy)):t.y>s.maxY&&(t.y=s.maxY,t.vy=-(.4*Math.abs(t.vy))),n.style.transform="translate3d(".concat(t.x,"px, ").concat(t.y,"px, 0)"),u.current){let e=Math.max(-26,Math.min(26,-(5*t.vx)));u.current.style.transform="rotate(".concat(e,"deg)")}if(t.y>=s.maxY-.5&&.22>Math.hypot(t.vx,t.vy)){t.vx=0,t.vy=0,t.raf=0,u.current&&(u.current.style.transition="transform 900ms ease-out",u.current.style.transform="",window.setTimeout(()=>{u.current&&(u.current.style.transition="")},920));return}t.raf=requestAnimationFrame(w)},[g]),v=(0,s.useCallback)(e=>{if(d.current=e,!e)return;let t=b.current;if(t.dropped){e.style.transform="translate3d(".concat(t.x,"px, ").concat(t.y,"px, 0)"),!t.raf&&Math.hypot(t.vx,t.vy)>.22&&(t.last=performance.now(),t.raf=requestAnimationFrame(w));return}t.dropped=!0,t.pokes=0;let n=m.current;n&&(n.style.animation="",n.style.removeProperty("--s")),t.y=-Math.round(.5*window.innerHeight),t.x=0,t.vx=0,t.vy=0,e.style.transform="translate3d(0px, ".concat(t.y,"px, 0)"),e.style.transition="opacity ".concat(400,"ms ease"),e.style.opacity="0",requestAnimationFrame(()=>{e.style.opacity="1"}),t.last=performance.now(),t.raf=requestAnimationFrame(w)},[w]),y=(0,s.useCallback)(e=>{let t=b.current;(0,l._O)("pop"),(0,i.Tl)("balloon-popper"),p({x:e.left+e.width/2,y:e.top+e.height/2,bits:Array.from({length:18},(e,t)=>{let n=t/18*Math.PI*2+.6*Math.random(),a=40+95*Math.random();return{id:t,dx:Math.cos(n)*a,dy:Math.sin(n)*a+34,rot:200+520*Math.random(),dur:620+460*Math.random(),color:t%3==0?"#fca5a5":t%3==1?"#ef4444":"#b91c1c",size:4+5*Math.random()}})});let n=m.current;n&&(n.style.animation="none",n.getBoundingClientRect(),n.style.animation="balloon-pop ".concat(260,"ms ease-out forwards")),t.raf&&cancelAnimationFrame(t.raf),t.raf=0,window.setTimeout(()=>f(!0),240),window.setTimeout(()=>p(null),1500)},[]),j=(0,s.useCallback)(e=>{let t=b.current,n=d.current;if(!n)return;let a=n.getBoundingClientRect(),r=++t.pokes;if(r>=8)return void y(a);let s=m.current;s&&(s.style.setProperty("--s",String(1+.05*r)),s.style.animation="none",s.getBoundingClientRect(),s.style.animation="balloon-squash ".concat(420,"ms cubic-bezier(.2,.85,.3,1) forwards")),(0,l._O)("bubble");let i=-1,o=-.4;e&&(i=a.left+a.width/2-e.x,o=a.top+a.height/2-e.y);let c=Math.hypot(i,o)||1;t.vx+=i/c*4.2,t.vy+=o/c*4.2-1.4;let h=Math.hypot(t.vx,t.vy);h>8&&(t.vx=t.vx/h*8,t.vy=t.vy/h*8),t.raf||(u.current&&(u.current.style.transition=""),t.last=performance.now(),t.raf=requestAnimationFrame(w))},[w,y]);return((0,s.useEffect)(()=>{let e=d.current;e&&"out"===o&&(e.style.transition="opacity ".concat(700,"ms ease"),e.style.opacity="0")},[o]),(0,s.useEffect)(()=>{if("hidden"===o)return;let e=()=>{let e=d.current;if(!e)return;let t=b.current,n=g(e);t.x=Math.max(n.minX,Math.min(n.maxX,t.x)),t.y=Math.max(n.minY,Math.min(n.maxY,t.y)),e.style.transform="translate3d(".concat(t.x,"px, ").concat(t.y,"px, 0)")};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[o,g]),(0,s.useEffect)(()=>{let e=b.current;return()=>{e.raf&&cancelAnimationFrame(e.raf),e.raf=0}},[]),"hidden"===o)?null:(0,a.jsxs)(a.Fragment,{children:[x&&(0,a.jsx)("div",{className:"pointer-events-none fixed inset-0 z-[56]","aria-hidden":!0,
1children:x.bits.map(e=>(0,a.jsx)("span",{className:"absolute rounded-[1px] opacity-0",style:{left:"".concat(x.x,"px"),top:"".concat(x.y,"px"),width:"".concat(e.size,"px"),height:"".concat(e.size,"px"),background:e.color,"--dx":"".concat(e.dx,"px"),"--dy":"".concat(e.dy,"px"),"--rot":"".concat(e.rot,"deg"),animation:"celebrate-fall ".concat(e.dur,"ms cubic-bezier(.15,.7,.4,1) forwards")}},e.id))}),!h&&(0,a.jsx)("button",{ref:v,type:"button","aria-label":"Balloon â click to bat it around",title:"Give it a poke",onClick:e=>j(0===e.detail?void 0:{x:e.clientX,y:e.clientY}),className:"fixed left-5 z-[55] cursor-pointer appearance-none border-0 bg-transparent p-1 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-rose-400 sm:left-6",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) + 10px)"},children:(0,a.jsx)("span",{className:"block",style:{animation:"balloon-bob 4.5s ease-in-out infinite"},children:(0,a.jsx)("span",{ref:u,className:"block origin-bottom will-change-transform",children:(0,a.jsxs)("svg",{ref:m,width:"36",height:"56",viewBox:"0 0 36 56","aria-hidden":!0,children:[(0,a.jsx)("path",{d:"M18 38 C 15 44, 21 48, 18 55",fill:"none",stroke:"rgba(255,255,255,0.45)",strokeWidth:"1.2",strokeLinecap:"round"}),(0,a.jsx)("path",{d:"M15.6 36.4 L18 39.4 L20.4 36.4 Z",fill:"#b91c1c"}),(0,a.jsx)("ellipse",{cx:"18",cy:"21",rx:"14",ry:"17",fill:"#ef4444"}),(0,a.jsx)("ellipse",{cx:"18",cy:"21",rx:"14",ry:"17",fill:"url(#balloon-shade)"}),(0,a.jsx)("ellipse",{cx:"12.5",cy:"14",rx:"4",ry:"5.5",fill:"rgba(255,255,255,0.42)",transform:"rotate(-22 12.5 14)"}),(0,a.jsx)("defs",{children:(0,a.jsxs)("radialGradient",{id:"balloon-shade",cx:"0.35",cy:"0.3",r:"0.85",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:"rgba(255,255,255,0.25)"}),(0,a.jsx)("stop",{offset:"55%",stopColor:"rgba(255,255,255,0)"}),(0,a.jsx)("stop",{offset:"100%",stopColor:"rgba(120,0,0,0.45)"})]})})]})})})})]})}},2197:(e,t,n)=>{"use strict";n.d(t,{default:()=>w});var a=n(5155),r=n(2619),s=n.n(r),i=n(6144),l=n(63),o=n(2115),c=n(9636),d=n(2578),u=n(1266),m=n(5202);let h="funnudge:save-prompt-count",f="funnudge:save-prompt-last",x="funnudge:save-prompt-pending",p=e=>{try{return Number(window.localStorage.getItem(e))||0}catch(e){return 0}},b=(e,t)=>{try{window.localStorage.setItem(e,t)}catch(e){}};function g(){return(0,a.jsxs)("span",{className:"relative mx-auto mb-3 flex h-16 w-16 items-center justify-center",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"motion-safe:animate-shield-seal absolute inset-0 rounded-full bg-emerald-400/40 blur-xl"}),(0,a.jsxs)("svg",{viewBox:"0 0 48 48",className:"relative h-16 w-16",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,a.jsx)("path",{d:"M24 4 L40 10 V24 C40 33 33 40.5 24 44 C15 40.5 8 33 8 24 V10 Z",pathLength:"1",className:"motion-safe:animate-shield-draw text-emerald-300 [stroke-dasharray:1]"}),(0,a.jsx)("path",{d:"M16.5 24.5 L21.5 29.5 L31.5 18.5",pathLength:"1",className:"motion-safe:animate-tick-draw text-emerald-200 [stroke-dasharray:1]"})]})]})}function w(){let e=(0,l.usePathname)()||"/",[t,n]=(0,o.useState)(null),[r,w]=(0,o.useState)(""),[v,y]=(0,o.useState)(!1),j=!e.startsWith("/games/"),N=(0,o.useCallback)(e=>{b(f,String(Date.now())),b(h,String(p(h)+(e?2:1))),n(null)},[]);if((0,o.useEffect)(()=>{if(!(0,d._7)())return;let e=e=>{var t;(null==(t=e.detail)?void 0:t.achievement)&&b(x,"1")};return window.addEventListener(c.xP,e),()=>window.removeEventListener(c.xP,e)},[]),(0,o.useEffect)(()=>{if(!(0,d._7)()||!j)return;let e=!0,t=async()=>{if(!function(){if(p(h)>=2)return!1;let e=p(f);return!e||Date.now()-e>12096e5}())return;let t=function(){try{return{achievements:(0,c.oc)().size,streak:(0,m.c2)().count,plays:(0,c.mt)()}}catch(e){return null}}();if(!t||!(t.achievements>=5||t.plays>=20||t.streak>=3))return;let a=await (0,d.Ny)();if(e&&!a){w((0,u.Mn)()),n(t);try{window.localStorage.removeItem(x)}catch(e){}}},a=window.setTimeout(t,1800),r=()=>void t();return window.addEventListener(d.Dh,r),()=>{e=!1,window.clearTimeout(a),window.removeEventListener(d.Dh,r)}},[j,e]),(0,o.useEffect)(()=>
1{if(!t)return;let e=e=>{"Escape"===e.key&&N(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,N]),!t)return null;let k=function(e){let t=[];return e.streak>0&&t.push({icon:"\uD83D\uDD25",label:"".concat(e.streak,"-day streak")}),e.achievements>0&&t.push({icon:"\uD83C\uDFC5",label:"".concat(e.achievements," achievement").concat(1===e.achievements?"":"s")}),t.length<2&&e.plays>0&&t.push({icon:"\uD83C\uDFAE",label:"".concat(e.plays," games played")}),t}(t);return(0,a.jsx)("div",{className:"motion-safe:animate-veil-in fixed inset-0 z-[96] flex items-end justify-center bg-black/65 px-3 pb-[max(1rem,env(safe-area-inset-bottom))] backdrop-blur-sm sm:items-center sm:pb-0",role:"dialog","aria-modal":"true","aria-labelledby":"save-progress-title",onClick:()=>N(!1),children:(0,a.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"motion-safe:animate-vault-in relative w-full max-w-sm overflow-hidden rounded-3xl border border-emerald-400/25 bg-zinc-950/95 px-5 pb-5 pt-6 text-center shadow-2xl shadow-black/70",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"motion-safe:animate-card-sheen pointer-events-none absolute inset-y-0 -left-1/3 w-1/3 bg-gradient-to-r from-transparent via-white/10 to-transparent"}),(0,a.jsx)("button",{onClick:()=>N(!1),"aria-label":"Dismiss",className:"absolute right-2 top-2 z-10 rounded-lg px-2 py-1 text-sm leading-none text-zinc-600 transition hover:text-zinc-300",children:"â"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(g,{}),(0,a.jsx)("p",{id:"save-progress-title",className:"text-lg font-extrabold leading-snug text-white",children:r?"Nice run, ".concat(r,"."):"Nice run."}),k.length>0&&(0,a.jsx)("ul",{className:"mt-3 flex flex-wrap justify-center gap-1.5",children:k.map((e,t)=>(0,a.jsxs)("li",{className:"motion-safe:animate-chip-in flex items-center gap-1.5 rounded-full border border-white/10 bg-white/5 px-3 py-1 text-xs font-semibold text-zinc-200",style:{animationDelay:"".concat(.9+.08*t,"s")},children:[(0,a.jsx)("span",{"aria-hidden":!0,children:e.icon}),e.label]},e.label))}),(0,a.jsx)("p",{className:"mt-3 text-sm leading-snug text-zinc-400",children:"All of it lives in this browser only. Clear your history or switch device and itâs gone."}),(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,a.jsxs)("button",{onClick:()=>{b(f,String(Date.now())),b(h,String(p(h)+1)),y(!0),(0,d.Jv)()},disabled:v,className:"flex items-center justify-center gap-2 rounded-xl bg-gradient-to-r from-emerald-500 to-teal-500 px-4 py-2.5 text-sm font-bold text-white shadow-lg shadow-emerald-500/20 transition hover:scale-[1.02] hover:shadow-emerald-500/30 disabled:hover:scale-100",children:[v&&(0,a.jsx)(i.A,{}),v?"Opening Googleâ¦":"Keep it safe with Google"]}),(0,a.jsx)("button",{onClick:()=>N(!1),className:"rounded-xl px-4 py-2 text-sm font-semibold text-zinc-400 transition hover:bg-white/5 hover:text-zinc-200",children:"Not now"})]}),(0,a.jsxs)("p",{className:"mt-3 text-[11px] leading-snug text-zinc-600",children:["Free, takes a second, and nothing is replaced â it only adds to what you already have."," ",(0,a.jsx)(s(),{href:"/settings",onClick:()=>N(!0),className:"underline underline-offset-2 transition hover:text-zinc-400",children:"Manage in settings"})]})]})]})})}},2773:(e,t,n)=>{"use strict";n.d(t,{GL:()=>d,Gp:()=>l,Nc:()=>i,_y:()=>o,mA:()=>c});var a=n(2115);let r=null,s=new Set;function i(e){if(r!==e)for(let t of(r=e,s))t(e)}function l(e){return s.add(e),()=>s.delete(e)}let o={title:"Leave this game?",body:"You're mid-game â your progress in this round will be lost."},c={title:"Leave the match?",body:"The match is still live â leaving counts as a loss and your opponent takes the win."};function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,{title:n,body:r}=t;(0,a.useEffect)(()=>e?(i({title:n,body:r}),()=>i(null)):void i(null),[e,n,r])}},2983:(e,t,n)=>{"use strict";n.d(t,{FeedbackWidget:()=>o});var a=n(5155),r=n(2115),s=n(63),i=n(9383);let l="funnudge:feedback:last-submission";function o(){let e=(0,s.usePathname)(),t=(0,r.useId)(),n=(0,r.useRef)(null),[o,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(null),[m,h]=(0,r.useState)(""),[f,x]=(0,r.useState)("idle"),[p,b]=(0,r.useState)("");(0,r.useEffect)(()=>{let e=e=>{var t;let n=e.detail;u(null!=(t=null==n?void 0:n.rating)?t:null),h(""),x("idle"),b(""),c(!0)};return window.addEventListener(i.cK,e),()=>window.removeEventListener(i.cK,e)},[]),(0,r.useEffect)(()=>{c(!1),x("idle")},[e]),(0,r.useEffect)(()=>
1{if(!o)return;let e=document.body.style.overflow;document.body.style.overflow="hidden";let t=window.setTimeout(()=>{var e;return null==(e=n.current)?void 0:e.focus()},0),a=e=>{"Escape"===e.key&&"submitting"!==f&&c(!1)};return window.addEventListener("keydown",a),()=>{window.clearTimeout(t),window.removeEventListener("keydown",a),document.body.style.overflow=e}},[o,f]);let g=()=>{"submitting"!==f&&c(!1)},w=async()=>{if(!d||"submitting"===f)return;let t=function(){try{let e=Number(localStorage.getItem(l));if(!Number.isFinite(e))return 0;return Math.max(0,6e4-(Date.now()-e))}catch(e){return 0}}();if(t>0){x("error"),b("Thanks for checking in. You can send more feedback in ".concat(Math.ceil(t/1e3)," seconds."));return}x("submitting"),b("");try{var n,a,r,s;let t=await fetch("/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rating:d,message:m.trim()||null,page_path:e,game_slug:null!=(s=null==(r=e.match(/^\/games\/([^/]+)\/?$/))?void 0:r[1])?s:null})});if(!t.ok){if(429===t.status)throw Error("Youâve shared a few notes already. Please try again later.");throw Error("Feedback couldnât be sent. Please try again.")}try{localStorage.setItem(l,Date.now().toString())}catch(e){}x("success"),null==(n=(a=window).gtag)||n.call(a,"event","feedback_submitted",{rating:d,page_path:e}),window.dispatchEvent(new CustomEvent(i.qZ,{detail:{pagePath:e,rating:d}}))}catch(e){x("error"),b(e instanceof Error?e.message:"Feedback couldnât be sent. Please try again.")}};return(0,a.jsxs)(a.Fragment,{children:[!o&&(0,a.jsxs)("button",{type:"button","data-feedback-floating":!0,onClick:()=>(0,i.A8)(),"aria-label":"Send feedback",title:"Send feedback",className:"fixed right-3 z-50 flex h-10 items-center justify-center gap-2 rounded-lg border border-fuchsia-300/25 bg-zinc-950/90 px-3 text-xs font-bold text-zinc-100 shadow-lg shadow-black/40 backdrop-blur-md transition hover:border-fuchsia-300/50 hover:bg-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fuchsia-400 sm:right-4 sm:text-sm",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) + 12px)"},children:[(0,a.jsx)("span",{"aria-hidden":!0,children:"\uD83D\uDCAC"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Feedback"})]}),o&&(0,a.jsx)("div",{className:"fixed inset-0 z-[100] flex items-end justify-center bg-black/65 p-3 backdrop-blur-[2px] sm:justify-end sm:p-5",onMouseDown:e=>{e.target===e.currentTarget&&g()},children:(0,a.jsxs)("section",{role:"dialog","aria-modal":"true","aria-labelledby":"feedback-title",className:"animate-pop w-full max-w-sm overflow-hidden rounded-xl border border-white/15 bg-[#11111f] shadow-2xl shadow-black/60",children:[(0,a.jsxs)("header",{className:"flex items-start justify-between border-b border-white/10 px-4 py-3.5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-bold uppercase text-fuchsia-300",children:"Quick feedback"}),(0,a.jsx)("h2",{id:"feedback-title",className:"mt-0.5 text-lg font-bold text-white",children:"Help us tune the fun"})]}),(0,a.jsx)("button",{ref:n,type:"button",onClick:g,disabled:"submitting"===f,"aria-label":"Close feedback",title:"Close",className:"flex h-8 w-8 items-center justify-center rounded-lg bg-white/5 text-xl text-zinc-400 transition hover:bg-white/10 hover:text-white disabled:opacity-40",children:"\xd7"})]}),"success"===f?(0,a.jsxs)("div",{className:"px-5 py-7 text-center","aria-live":"polite",children:[(0,a.jsx)("div",{className:"mx-auto flex h-11 w-11 items-center justify-center rounded-full bg-emerald-400/15 text-xl text-emerald-300",children:"â"}),(0,a.jsx)("p",{className:"mt-4 font-bold text-white",children:"Thanks! Your feedback helps improve FunNudge."}),(0,a.jsx)("button",{type:"button",onClick:g,className:"mt-5 rounded-lg bg-white/10 px-5 py-2 text-sm font-bold text-white transition hover:bg-white/15",children:"Done"})]}):(0,a.jsxs)("div",{className:"space-y-4 p-4",children:[(0,a.jsxs)("fieldset",{children:[(0,a.jsx)("legend",{className:"mb-2 text-sm font-semibold text-zinc-300",children:"How was your experience?"}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2",children:i.l6.map(e=>{let t=d===e.value;return(0,a.jsxs)("button",{type:"button",onClick:()=>{u(e.value),x("idle"),b("")},"aria-pressed":t,className:"min-h-16 rounded-lg border px-1.5 py-2 text-center text-xs font-semibold transition focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fuchsia-400 ".concat(t?"border-fuchsia-400 bg-fuchsia-400/15 text-white":"border-white/10 bg-white/[0.04] text-zinc-400 hover:border-white/20 hover:bg-white/[0.07] hover:text-white"),children:[(0,a.jsx)("span",{"aria-hidden":!0,
1className:"block text-xl",children:e.emoji}),(0,a.jsx)("span",{className:"mt-1 block",children:e.label})]},e.value)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-1.5 flex items-center justify-between gap-3",children:[(0,a.jsxs)("label",{htmlFor:t,className:"text-sm font-semibold text-zinc-300",children:["Tell us what to improve ",(0,a.jsx)("span",{className:"font-normal text-zinc-500",children:"(optional)"})]}),(0,a.jsxs)("span",{className:"text-xs text-zinc-600",children:[m.length,"/1000"]})]}),(0,a.jsx)("textarea",{id:t,value:m,onChange:e=>h(e.target.value.slice(0,1e3)),maxLength:1e3,rows:4,placeholder:"A bug, an idea, or something that felt offâ¦",className:"w-full resize-none rounded-lg border border-white/10 bg-black/25 px-3 py-2.5 text-sm text-white outline-none placeholder:text-zinc-600 focus:border-fuchsia-400/70 focus:ring-2 focus:ring-fuchsia-400/15"})]}),"error"===f&&(0,a.jsx)("p",{className:"text-sm text-rose-300",role:"alert",children:p}),(0,a.jsx)("button",{type:"button",onClick:()=>void w(),disabled:!d||"submitting"===f,className:"w-full rounded-lg bg-gradient-to-r from-fuchsia-500 to-violet-600 px-4 py-2.5 text-sm font-bold text-white shadow-lg shadow-fuchsia-950/40 transition hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-45",children:"submitting"===f?"Sendingâ¦":"Send feedback"})]})]})})]})}},3195:(e,t,n)=>{"use strict";n.d(t,{default:()=>u});var a=n(5155),r=n(8321),s=n(63),i=n(2115),l=n(80),o=n(5704);let c="G-JNGQ8CRKF9",d=o.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN;function u(){let e=(0,s.usePathname)();return(0,i.useEffect)(()=>{(0,l.o)(e)},[e]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.default,{src:"https://www.googletagmanager.com/gtag/js?id=".concat(c),strategy:"afterInteractive"}),(0,a.jsx)(r.default,{id:"google-tag-init",strategy:"afterInteractive",children:"\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n window.gtag = gtag;\n gtag('js', new Date());\n ".concat(c?"gtag('config', '".concat(c,"', { send_page_view: false });"):"","\n gtag('config', '").concat("AW-18287633892","');\n ")}),d&&(0,a.jsx)(r.default,{src:"https://plausible.io/js/script.js","data-domain":d,strategy:"afterInteractive"})]})}},3248:(e,t,n)=>{"use strict";n.d(t,{default:()=>c});var a=n(5155),r=n(2115),s=n(9636),i=n(80);let l="funnudge:install-dismissed",o=()=>{try{var e;let t=Number(null!=(e=window.localStorage.getItem(l))?e:0);return Date.now()-t<12096e5}catch(e){return!1}};function c(){let[e,t]=(0,r.useState)(null),[n,c]=(0,r.useState)(!1);(0,r.useEffect)(()=>{var e,n;if((null==(e=(n=window).matchMedia)?void 0:e.call(n,"(display-mode: standalone)").matches)||!0===window.navigator.standalone||o())return;let a=e=>{e.preventDefault(),o()||1>(0,s.mt)()||t(e)};window.addEventListener("beforeinstallprompt",a);let r=()=>{t(null),c(!1),(0,i.u)("pwa_installed",{});try{window.localStorage.setItem(l,String(Date.now()))}catch(e){}};window.addEventListener("appinstalled",r);let d=null;return"undefined"!=typeof navigator&&/iphone|ipad|ipod/i.test(navigator.userAgent)&&!/crios|fxios/i.test(navigator.userAgent)&&(0,s.mt)()>=1&&(d=setTimeout(()=>c(!0),4e3)),()=>{window.removeEventListener("beforeinstallprompt",a),window.removeEventListener("appinstalled",r),d&&clearTimeout(d)}},[]);let d=async()=>{if(e){(0,i.u)("pwa_install_prompt",{action:"accept"}),await e.prompt();try{await e.userChoice}catch(e){}t(null)}};return e||n?(0,a.jsx)("div",{className:"fixed inset-x-0 bottom-0 z-[70] flex justify-center px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",children:(0,a.jsxs)("div",{className:"animate-bounce-in flex w-full max-w-md items-center gap-3 rounded-2xl border border-fuchsia-400/30 bg-zinc-950/95 p-3 shadow-2xl shadow-black/50 backdrop-blur",children:[(0,a.jsx)("span",{className:"text-3xl","aria-hidden":!0,children:"\uD83D\uDCF2"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-bold text-white",children:"Install FunNudge"}),e?(0,a.jsx)("p",{className:"text-xs text-zinc-400",children:"Add it to your home screen for instant, full-screen play â no app store, no download."}):(0,a.jsxs)("p",{className:"text-xs text-zinc-400",children:["Tap the Share button"," ",(0,a.jsx)("span",{className:"font-semibold text-zinc-200",children:"â¬ï¸"}),", then"," ",(0,a.jsx)("span",{className:"font-semibold text-zinc-200",children:"âAdd to Home Screenâ"})," ","for one-tap play."]})]}),e&&(0,a.jsx)("button",{onClick:d,className:"shrink-0 rounded-xl bg-gradient-to-r from-fuchsia-500 to-violet-500 px-4 py-2 text-sm font-bold text-white transition hover:scale-105",children:"Install"}),(0,a.jsx)("button",{onClick:()=>{t(null),c(!1);try{window.localStorage.setItem(l,String(Date.now()))}catch(e){}},"aria-label":"Dismiss install prompt",className:"shrink-0 rounded-lg px-2 py-1 text-lg text-zinc-500 transition hover:bg-white/10 hover:text-white",children:"â"})]})}):null}},3318:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var a=n(5155),r=n(63),s=n(2115),i=n(2773),l=n(1175);
1function o(){let e=(0,r.useRouter)(),[t,n]=(0,s.useState)(null),[o,c]=(0,s.useState)(null),d=(0,s.useRef)(null);d.current=t,(0,s.useEffect)(()=>(0,i.Gp)(n),[]);let u=(0,s.useRef)(null),m=()=>{var e;u.current=window.location.pathname,window.history.pushState({...null!=(e=window.history.state)?e:{},__fnGuard:!0},"",window.location.href)};(0,s.useEffect)(()=>{if(t){u.current||m();return}let e=u.current;u.current=null,e&&window.location.pathname===e&&window.history.go(-1)},[t]),(0,s.useEffect)(()=>{let e=()=>{d.current&&(m(),c("__back__"))};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]),(0,s.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[t]),(0,s.useEffect)(()=>{let e=e=>{var t,n;let a;if(!d.current||e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let r=null==(n=e.target)||null==(t=n.closest)?void 0:t.call(n,"a");if(!r)return;let s=r.getAttribute("href");if(!(!s||s.startsWith("#"))&&"_blank"!==r.target){try{a=new URL(r.href,window.location.href)}catch(e){return}a.origin===window.location.origin&&a.pathname!==window.location.pathname&&(e.preventDefault(),e.stopPropagation(),(0,l._O)("chirp"),c(a.pathname+a.search))}};return document.addEventListener("click",e,!0),()=>document.removeEventListener("click",e,!0)},[]),(0,s.useEffect)(()=>{o&&!t&&(c(null),e.push(o))},[o,t,e]);let h=(0,s.useCallback)(()=>c(null),[]),f=(0,s.useCallback)(()=>{c(null),u.current=null,(0,i.Nc)(null),"__back__"===o?window.history.go(-2):o&&e.push(o)},[o,e]);return o&&t?(0,a.jsx)("div",{className:"fixed inset-0 z-[120] flex items-center justify-center bg-black/65 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-label":t.title,onClick:h,children:(0,a.jsxs)("div",{className:"animate-bounce-in w-full max-w-xs rounded-2xl border border-white/10 bg-zinc-900 p-5 text-center shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("p",{className:"text-3xl","aria-hidden":!0,children:"\uD83D\uDEAA"}),(0,a.jsx)("h3",{className:"mt-2 text-lg font-extrabold text-white",children:t.title}),(0,a.jsx)("p",{className:"mt-1 text-sm text-zinc-400",children:t.body}),(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,a.jsx)("button",{onClick:h,autoFocus:!0,className:"rounded-xl bg-gradient-to-r from-emerald-500 to-teal-600 px-5 py-2.5 font-bold text-white transition hover:scale-[1.02]",children:"â Keep playing"}),(0,a.jsx)("button",{onClick:f,className:"rounded-xl bg-white/10 px-5 py-2.5 font-bold text-rose-300 transition hover:bg-rose-500/20",children:"Leave anyway"})]})]})}):null}},3673:()=>{},3735:(e,t,n)=>{"use strict";n.d(t,{default:()=>i});var a=n(5155),r=n(2115);let s=["#fbbf24","#f59e0b","#fcd34d","#d946ef","#a78bfa","#34d399","#f472b6"];function i(){let[e,t]=(0,r.useState)([]),[n,i]=(0,r.useState)([]);return((0,r.useEffect)(()=>{var e,n;if(null==(e=(n=window).matchMedia)?void 0:e.call(n,"(prefers-reduced-motion: reduce)").matches)return;t(Array.from({length:46},(e,t)=>{let n=t%4==0,a=6+6*Math.random();return{id:t,left:100*Math.random(),dx:(Math.random()-.5)*220,dy:108+22*Math.random(),rot:360+700*Math.random(),delay:700*Math.random(),dur:1900+1100*Math.random(),color:s[t%s.length],w:n?a:.7*a,h:n?a:1.6*a,round:n}})),i(Array.from({length:16},(e,t)=>({id:t,left:3+92*Math.random(),top:6+66*Math.random(),delay:200+1100*Math.random(),size:12+16*Math.random(),dur:1100+700*Math.random()})));let a=setTimeout(()=>{t([]),i([])},3200);return()=>clearTimeout(a)},[]),e.length)?(0,a.jsxs)("div",{className:"pointer-events-none fixed inset-0 z-[60] overflow-hidden","aria-hidden":!0,children:[e.map(e=>(0,a.jsx)("span",{className:"absolute top-[-8%] opacity-0",style:{left:"".concat(e.left,"%"),width:"".concat(e.w,"px"),height:"".concat(e.h,"px"),background:e.color,borderRadius:e.round?"9999px":"2px","--dx":"".concat(e.dx,"px"),"--dy":"".concat(e.dy,"vh"),"--rot":"".concat(e.rot,"deg"),animation:"celebrate-fall ".concat(e.dur,"ms cubic-bezier(0.25, 0.6, 0.5, 1) ").concat(e.delay,"ms forwards")}},e.id)),n.map(e=>(0,a.jsx)("span",{className:"absolute select-none opacity-0",style:{left:"".concat(e.left,"%"),top:"".concat(e.top,"%"),fontSize:"".concat(e.size,"px"),animation:"sparkle-pop ".concat(e.dur,"ms ease-out ").concat(e.delay,"ms forwards")},children:"â¨"},"s-".concat(e.id)))]}):null}},4107:(e,t,n)=>{"use strict";n.d(t,{GT:()=>l,gO:()=>s,q7:()=>o});var a=n(9636),r=n(80);let s="funnudge:gameend",i=e=>"funnudge:stats:".concat(e);function l(e){try{let r=window.localStorage.getItem(i(e));if(r){var t,n,a;let e=JSON.parse(r);return{plays:null!=(t=e.plays)?t:0,best:null!=(n=e.best)?n:0,total:null!=(a=e.total)?a:0}}}catch(e){}return{plays:0,best:0,total:0}}function o(e,t){let n=l(e),o={plays:n.plays+1,best:Math.max(n.best,t),total:n.total+t};try{window.localStorage.setItem(i(e),JSON.stringify(o))}catch(e){}window.dispatchEvent(new CustomEvent(s,{detail:{slug:e,score:t}})),(0,a.CT)(e,t),(0,r.u)("game_end",{game:e,score:t,plays:o.plays})}}
1,5264:(e,t,n)=>{"use strict";n.d(t,{default:()=>v});var a=n(5155),r=n(2619),s=n.n(r),i=n(63),l=n(2115),o=n(708),c=n(652),d=n(2549);function u(){let e=(0,i.usePathname)()||"/",{peers:t,playerId:n}=(0,c.Zr)((0,c.Jd)(e)&&(0,d.Tx)());if(!n)return null;let r=t.filter(e=>e.id&&e.id!==n&&e.open&&!e.busy).length;return 0===r?null:(0,a.jsxs)("span",{className:"ml-1.5 inline-flex items-center gap-1 rounded-full bg-emerald-400/15 px-1.5 py-0.5 align-middle text-[10px] font-extrabold tabular-nums text-emerald-300",title:"".concat(r," player").concat(1===r?"":"s"," online and open to a challenge"),children:[(0,a.jsxs)("span",{className:"relative flex h-1.5 w-1.5","aria-hidden":!0,children:[(0,a.jsx)("span",{className:"absolute inline-flex h-full w-full rounded-full bg-emerald-400 motion-safe:animate-lobby-ping"}),(0,a.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-400"})]}),r,(0,a.jsx)("span",{className:"sr-only",children:" player".concat(1===r?"":"s"," online")})]})}var m=n(1175),h=n(5202);function f(e){let{urgent:t,flare:n}=e,r=t?["#b91c1c","#ef4444","#fca5a5"]:["#ea580c","#fb923c","#fde047"];return(0,a.jsxs)("span",{className:"relative inline-flex h-5 w-5 shrink-0 items-center justify-center",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute inset-x-0 bottom-0 h-4 rounded-full blur-[6px] ".concat(n?"animate-flame-burst":"motion-safe:animate-flame-glow"," ").concat(t?"bg-red-500/70":"bg-orange-500/65")}),(0,a.jsxs)("svg",{viewBox:"0 0 24 24",className:"relative h-5 w-5 overflow-visible transition-[filter] duration-200 ".concat(n?"[filter:brightness(1.45)_saturate(1.35)]":""),"aria-hidden":!0,children:[(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:"fn-flame-body",x1:"0",y1:"1",x2:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:r[0]}),(0,a.jsx)("stop",{offset:"55%",stopColor:r[1]}),(0,a.jsx)("stop",{offset:"100%",stopColor:r[2]})]}),(0,a.jsxs)("linearGradient",{id:"fn-flame-core",x1:"0",y1:"1",x2:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:"#fbbf24"}),(0,a.jsx)("stop",{offset:"70%",stopColor:"#fde68a"}),(0,a.jsx)("stop",{offset:"100%",stopColor:"#fffbeb"})]})]}),(0,a.jsx)("path",{d:"M12 2.4c.3 2.1 1.5 3.5 2.7 4.9 1.7 2 2.9 3.9 2.9 6.4a5.6 5.6 0 0 1-11.2 0c0-1.7.6-3.1 1.5-4.4.3 1.1.9 1.9 1.8 2.4C9.6 8.5 10.5 5.1 12 2.4Z",fill:"url(#fn-flame-body)",className:"origin-bottom motion-safe:animate-flame-body"}),(0,a.jsx)("path",{d:"M12.3 12c.7 1 1.5 1.9 1.5 3.1a2.5 2.5 0 0 1-5 0c0-1.1.5-1.9 1.2-2.6.2.5.5.9.9 1.1.3-.6.8-1.1 1.4-1.6Z",fill:"url(#fn-flame-core)",className:"origin-bottom motion-safe:animate-flame-core"})]})]})}function x(){let[e,t]=(0,l.useState)(null),[n,r]=(0,l.useState)(!1),[i,o]=(0,l.useState)([]),c=(0,l.useRef)(0),d=(0,l.useRef)(null),u=(0,l.useRef)([]);(0,l.useEffect)(()=>{let e=()=>t((0,h.c2)());return e(),window.addEventListener(h.Se,e),()=>window.removeEventListener(h.Se,e)},[]),(0,l.useEffect)(()=>()=>{for(let e of(d.current&&window.clearTimeout(d.current),u.current))window.clearTimeout(e)},[]);let x="flex h-7 min-w-[3.5rem] shrink-0 items-center justify-end md:hidden lg:flex";if(!e||0===e.count)return(0,a.jsx)("div",{className:x,"aria-hidden":!0});let p=e.atRisk&&!e.doneToday&&new Date().getHours()>=17,b=e.freezes>0?" \xb7 ".concat(e.freezes," freeze").concat(e.freezes>1?"s":""," banked"):"",g=e.doneToday?"".concat(e.count,"-day streak â today's challenge is done â").concat(b):p?"Play before midnight to keep your ".concat(e.count,"-day streak!").concat(b):"".concat(e.count,"-day streak â play today's challenge to keep it alive").concat(b);return(0,a.jsx)("div",{className:x,children:(0,a.jsxs)(s(),{href:"/daily-challenge",title:g,"aria-label":g,className:"fn-streak flex shrink-0 items-center gap-1.5 rounded-full border px-2.5 py-1 transition hover:scale-105 ".concat(p?"border-red-400/40 bg-red-500/15 hover:bg-red-500/25":"border-orange-400/30 bg-orange-400/10 hover:bg-orange-400/20"),children:[(0,a.jsxs)("span",{role:"presentation",onClick:e=>{e.preventDefault(),e.stopPropagation(),(()=>{c.current+=1;let e=c.current%5==0;if((0,m._O)("flame"),r(!1),requestAnimationFrame(()=>r(!0)),d.current&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>r(!1),600),!e)return;let t=c.current,n=Array.from({length:6},(e,n)=>({key:"".concat(t,"-").concat(n),dx:-18+Math.round(36*Math.random()),rot:-40+Math.round(80*Math.random()),size:9+Math.round(7*Math.random()),delay:70*n+Math.round(60*Math.random())}));o(e=>[...e,...n]),u.current.push(window.setTimeout(()=>
1o(e=>e.filter(e=>!n.some(t=>t.key===e.key))),1800))})()},className:"relative inline-flex cursor-pointer",children:[(0,a.jsx)("span",{className:"inline-flex ".concat(n?"animate-flame-flare":""),children:(0,a.jsx)(f,{urgent:p,flare:n})}),i.map(e=>(0,a.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute bottom-0 left-1/2 z-20 motion-safe:animate-flame-rise",style:{fontSize:"".concat(e.size,"px"),animationDelay:"".concat(e.delay,"ms"),"--fx":"".concat(e.dx,"px"),"--fr":"".concat(e.rot,"deg")},children:"\uD83D\uDD25"},e.key))]}),(0,a.jsx)("span",{className:"text-sm font-extrabold tabular-nums ".concat(p?"text-red-200":"text-orange-200"),children:e.count})]})})}let p=[{href:"/category/multiplayer",label:"Play with Friends",icon:"\uD83D\uDC65",live:!0,className:"font-semibold text-fuchsia-300 hover:text-fuchsia-200",accent:"bg-fuchsia-400"},{href:"/daily-challenge",label:"Daily Challenge",icon:"\uD83C\uDFAF",className:"font-semibold text-emerald-300 hover:text-emerald-200",accent:"bg-emerald-400"},{href:"/games",label:"All Games",icon:"\uD83D\uDD79ï¸"},{href:"/leaderboards",label:"Leaderboards",icon:"\uD83C\uDFC6",className:"font-semibold text-amber-300 hover:text-amber-200",accent:"bg-amber-300"},{href:"/achievements",label:"Achievements",icon:"\uD83C\uDFC5"}],b={href:"/settings",label:"Settings",icon:"âï¸"};function g(e,t){return e===t||e.startsWith("".concat(t,"/"))}function w(e){let{current:t,className:n=""}=e;return(0,a.jsx)(s(),{href:"/settings","aria-label":"Settings",title:"Settings","aria-current":t?"page":void 0,className:"shrink-0 rounded-lg p-2 transition hover:bg-white/10 ".concat(t?"text-white":"text-zinc-400 hover:text-white"," ").concat(n),children:(0,a.jsxs)("svg",{viewBox:"0 0 24 24",className:"h-5 w-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,a.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.6 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.6h.09A1.65 1.65 0 0 0 10 3.09V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9v.09a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})})}function v(){let e=(0,i.usePathname)()||"/",[t,n]=(0,l.useState)(!1),[r,c]=(0,l.useState)(0);return(0,a.jsxs)("header",{className:"fn-siteheader sticky top-0 z-50 border-b border-white/10 bg-[#0a0a14]/80 backdrop-blur-md",children:[(0,a.jsxs)("div",{className:"mx-auto flex max-w-6xl items-center justify-between py-3 pl-4 pr-4 min-[1400px]:pr-16 min-[1512px]:pr-4",children:[(0,a.jsxs)(s(),{href:"/",onClick:()=>{var e,t;n(!1),null!=(e=(t=window).matchMedia)&&e.call(t,"(prefers-reduced-motion: reduce)").matches||(c(e=>e+1),(0,m._O)("boing"))},className:"flex shrink-0 items-center gap-2 text-lg font-extrabold tracking-tight sm:text-xl",children:[(0,a.jsxs)("span",{className:"relative inline-block text-2xl",style:r?{animation:"logo-shove 700ms cubic-bezier(.3,1.3,.5,1) both"}:void 0,"aria-hidden":!0,children:["\uD83C\uDFAE",r>0&&(0,a.jsx)("span",{className:"pointer-events-none absolute -right-2 top-0 text-sm",style:{animation:"logo-spark 640ms ease-out both"},children:"\uD83D\uDCA5"})]},"pad-".concat(r)),(0,a.jsxs)("span",{className:"inline-block",style:r?{animation:"logo-recoil 700ms cubic-bezier(.25,1.2,.4,1) both"}:void 0,children:["Fun",(0,a.jsxs)("span",{className:"relative inline-block",children:[(0,a.jsx)("span",{className:"bg-gradient-to-r from-fuchsia-400 to-violet-400 bg-clip-text text-transparent",children:"Nudge"}),(0,a.jsx)("span",{"aria-hidden":!0,style:{"--fn-word":'"Nudge"'},className:"fn-wordmark-gold pointer-events-none absolute inset-0 bg-clip-text text-transparent"})]})]},"word-".concat(r))]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("nav",{"aria-label":"Main navigation",className:"hidden md:block",children:(0,a.jsx)("ul",{className:"flex items-center gap-0.5 text-xs font-medium text-zinc-300 lg:gap-1 lg:text-sm",children:p.map(t=>{var n,r;let i=g(e,t.href);return(0,a.jsx)("li",{children:(0,a.jsxs)(s(),{href:t.href,"aria-current":i?"page":void 0,className:"group relative whitespace-nowrap rounded-lg px-2 pb-2.5 pt-2 transition hover:bg-white/10 lg:px-3 ".concat(null!=(n=t.className)?n:"hover:text-white"),children:[t.icon?(0,a.jsx)("span",{className:"mr-1.5 hidden xl:inline-block motion-safe:group-hover:animate-nav-hop","aria-hidden":!0,
1children:t.icon}):null,t.label,t.live&&(0,a.jsx)(u,{}),(0,a.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-3 bottom-0.5 h-[3px] origin-center rounded-full transition-transform duration-200 motion-reduce:transition-none lg:inset-x-4 ".concat(null!=(r=t.accent)?r:"bg-zinc-300"," ").concat(i?"scale-x-100":"scale-x-0 opacity-70 group-hover:scale-x-100")})]})},t.href)})})}),(0,a.jsx)(x,{}),(0,a.jsx)(w,{current:"/settings"===e,className:"hidden md:max-[1400px]:block"}),(0,a.jsx)("button",{onClick:()=>n(e=>!e),"aria-label":t?"Close menu":"Open menu","aria-expanded":t,className:"rounded-lg px-2.5 py-1.5 text-xl leading-none text-zinc-200 transition hover:bg-white/10 md:hidden",children:t?"â":"â°"})]})]}),(0,a.jsxs)("div",{className:"absolute right-5 top-1/2 z-10 hidden -translate-y-1/2 items-center gap-1.5 min-[1400px]:flex",children:[(0,a.jsx)(w,{current:"/settings"===e}),(0,a.jsx)(o.T,{})]}),t&&(0,a.jsx)("nav",{"aria-label":"Mobile navigation",className:"border-t border-white/10 md:hidden",children:(0,a.jsxs)("ul",{className:"mx-auto flex max-w-6xl flex-col px-3 py-2 text-sm font-medium text-zinc-200",children:[[...p,b].map(t=>{var r;let i=g(e,t.href);return(0,a.jsx)("li",{children:(0,a.jsxs)(s(),{href:t.href,onClick:()=>n(!1),"aria-current":i?"page":void 0,className:"block rounded-lg border-l-2 px-3 py-2.5 transition hover:bg-white/10 ".concat(i?"border-current bg-white/5":"border-transparent"," ").concat(null!=(r=t.className)?r:"hover:text-white"),children:[t.icon?"".concat(t.icon," "):"",t.label,t.live&&(0,a.jsx)(u,{})]})},t.href)}),(0,a.jsx)("li",{className:"mt-1 border-t border-white/10 pt-1",children:(0,a.jsx)(o.S,{onNavigate:()=>n(!1)})})]})})]})}},5470:(e,t,n)=>{"use strict";n.d(t,{default:()=>m});var a=n(5155),r=n(2115),s=n(6815),i=n(9341),l=n(4908),o=n(9045);let c="funnudge:support-nudge",d="funnudge:support-nudge-count";function u(){try{var e;return Number(null!=(e=window.localStorage.getItem(d))?e:0)}catch(e){return 3}}function m(){let[e,t]=(0,r.useState)(null),n=(0,r.useCallback)(()=>{try{window.localStorage.setItem(c,String(Date.now())),window.localStorage.setItem(d,String(u()+1))}catch(e){}t(null)},[]);if((0,r.useEffect)(()=>{if(!(0,s.B3)())return;let e=e=>{var n,a;let r=e.detail;if(!(null==r?void 0:r.record)||"w"!==r.outcome||(0,l.wV)()||(0,o.fg)()||function(){try{var e;if(u()>=3)return!0;let t=Number(null!=(e=window.localStorage.getItem(c))?e:0);return Date.now()-t<2592e6}catch(e){return!0}}())return;let s=(0,i.xu)().w;n=r.record,!(s<5)&&(n.streak>=3||s%10==0)&&t({line:(a=r.record,a.streak>=3?"".concat(a.streak," wins in a row \uD83D\uDD25"):"".concat(s," wins on FunNudge"))})},n=(0,l.AJ)();return window.addEventListener(i.jC,e),()=>{n(),window.removeEventListener(i.jC,e)}},[]),(0,r.useEffect)(()=>{if(!e)return;let t=window.setTimeout(n,14e3);return()=>window.clearTimeout(t)},[e,n]),!e)return null;let m=(0,s.lk)()?{target:"_blank",rel:"noopener noreferrer"}:{};return(0,a.jsx)("div",{className:"pointer-events-none fixed inset-x-0 bottom-0 z-[90] flex justify-center px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",role:"status",children:(0,a.jsxs)("div",{className:"motion-safe:animate-slide-up pointer-events-auto relative w-full max-w-md overflow-hidden rounded-2xl border border-amber-400/25 bg-zinc-950/95 shadow-2xl shadow-black/60 backdrop-blur",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute -left-10 -top-12 h-32 w-32 rounded-full bg-amber-500/20 blur-2xl"}),(0,a.jsx)("button",{onClick:n,"aria-label":"No thanks",className:"absolute right-2 top-2 z-10 rounded-lg px-2 py-1 text-sm leading-none text-zinc-600 transition hover:text-zinc-300",children:"â"}),(0,a.jsxs)("div",{className:"relative flex items-center gap-3 p-3.5 pr-9",children:[(0,a.jsx)(h,{}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[15px] font-extrabold leading-snug text-white",children:e.line}),(0,a.jsx)("p",{className:"mt-0.5 text-xs leading-snug text-zinc-400",children:"A coffee helps me keep it free."})]}),(0,a.jsx)("a",{href:s.Av,...m,onClick:()=>{(0,o.SM)(),n()},className:"shrink-0 rounded-full bg-gradient-to-r from-amber-400 to-orange-500 px-4 py-2 text-xs font-extrabold text-zinc-900 shadow-lg shadow-orange-500/20 transition hover:scale-105 hover:from-amber-300",children:"Buy a coffee"})]})]})})}function h(){return(0,a.jsxs)("span",{className:"relative flex h-12 w-12 shrink-0 items-end justify-center","aria-hidden":!0,
1children:[[0,.95,1.9].map((e,t)=>(0,a.jsx)("span",{className:"absolute rounded-full bg-amber-200/60 motion-safe:animate-steam",style:{width:3.5,height:3.5,left:12+7*t,top:4,animationDelay:"".concat(e,"s")}},t)),(0,a.jsxs)("svg",{viewBox:"0 0 44 34",className:"h-[30px] w-[39px]",children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:"fn-cup",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:"#fef3c7"}),(0,a.jsx)("stop",{offset:"100%",stopColor:"#fbbf24"})]})}),(0,a.jsx)("path",{d:"M30 10h4a6 6 0 0 1 0 12h-4",fill:"none",stroke:"#f59e0b",strokeWidth:"3.5",strokeLinecap:"round"}),(0,a.jsx)("path",{d:"M4 7h27v13a10 10 0 0 1-10 10h-7A10 10 0 0 1 4 20z",fill:"url(#fn-cup)"}),(0,a.jsx)("ellipse",{cx:"17.5",cy:"8",rx:"13.5",ry:"2.6",fill:"#7c2d12"}),(0,a.jsx)("rect",{x:"1",y:"31",width:"33",height:"3",rx:"1.5",fill:"#f59e0b"})]})]})}},6091:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var a=n(2115),r=n(9045),s=n(4908);let i="fn-premium";function l(){return(0,a.useEffect)(()=>{let e=()=>{let e=!!(0,s.wV)()&&(0,r.eo)();document.documentElement.classList.toggle(i,e)},t=(0,s.AJ)();return e(),window.addEventListener("funnudge:supporter",e),window.addEventListener(r.yY,e),()=>{t(),window.removeEventListener("funnudge:supporter",e),window.removeEventListener(r.yY,e),document.documentElement.classList.remove(i)}},[]),null}},6331:(e,t,n)=>{"use strict";n.d(t,{default:()=>i});var a=n(2115),r=n(9016);let s=["\uD83D\uDC40 come back","\uD83C\uDFAE the games are getting cold","\uD83D\uDD79ï¸ still hereâ¦","\uD83C\uDFB2 your move","\uD83D\uDE34 we'll wait"];function i(){return(0,a.useEffect)(()=>{let e=s[Math.floor(Math.random()*s.length)],t=null,n=()=>{document.hidden?null!==t||(0,r.SV)()||(t=document.title,document.title=e):null!==t&&(document.title=t,t=null)};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n),null!==t&&(document.title=t)}},[]),null}},6792:(e,t,n)=>{"use strict";n.d(t,{default:()=>d});var a=n(2115),r=n(9636),s=n(8213),i=n(1175);let l=["ArrowUp","ArrowUp","ArrowDown","ArrowDown","ArrowLeft","ArrowRight","ArrowLeft","ArrowRight","b","a"],o=["f","u","n","n","u","d","g","e"],c=!1;function d(){return(0,a.useEffect)(()=>{if(!c){c=!0;try{console.log("%c\uD83C\uDFAE FunNudge","font-size:22px;font-weight:800;color:#d946ef"),console.log("%cPoking around in here? Good. There are a few things hidden around the site â the Konami code is a fair place to start.","color:#a1a1aa")}catch(e){}}},[]),(0,a.useEffect)(()=>{let e=0,t=0,n=(e,t,n)=>n===e[t]?t+1:+(n===e[0]),a=a=>{let c=a.target;if(c&&("INPUT"===c.tagName||"TEXTAREA"===c.tagName||c.isContentEditable)){e=0,t=0;return}let d=1===a.key.length?a.key.toLowerCase():a.key;(e=n(l,e,d))===l.length&&(e=0,(0,s.Q)(),(0,i._O)("win"),(0,r.Tl)("old-school")),(t=n(o,t,d))===o.length&&(t=0,document.documentElement.classList.add("fn-nudged"),window.setTimeout(()=>document.documentElement.classList.remove("fn-nudged"),700),(0,i._O)("boing"),(0,r.Tl)("name-dropper"))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]),null}},7127:(e,t,n)=>{"use strict";n.d(t,{DP:()=>o,hw:()=>l,kW:()=>i});var a=n(1927),r=n(3072);n(5704);let s="sb_publishable_f7QNX8Dn4Kw9sm6wtrd31w_ySsgnx9y",i={ttt:"tic-tac-toe-online",c4:"connect-four-online",chess:"chess-online",race:"typing-race-online",pool:"8-ball-pool-online",carrom:"carrom-online",ludo:"ludo-online",snl:"snakes-ladders-online",c8:"crazy-eights-online",checkers:"checkers-online",dnl:"dont-look-online"};async function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(!(0,a.Zw)())return[];try{let n="".concat("https://szrhpgweueniopvwutic.supabase.co","/rest/v1/").concat("funnudge_mp_records")+"?select=name,wins,losses,draws,streak,best_streak,country,pid_pub,supporter"+"&game=eq.".concat(encodeURIComponent(e))+"&wins=gt.0"+"&order=wins.desc,best_streak.desc,updated_at.asc&limit=".concat(t),a=await fetch(n,{headers:{apikey:s,Authorization:"Bearer ".concat(s)},cache:"no-store"});if(!a.ok)return[];return await a.json()}catch(e){return[]}}async function o(e,t){var s;if(!(0,a.Zw)())return!1;let l=null!=(s=i[e])?s:e;if(!r.SU.has(l))return!1;let o=(0,a.j0)();if(!o)return!1;let c=await (0,a.Gs)(),{accessToken:d}=await Promise.resolve().then(n.bind(n,2578)),u=await d();try{let e=await (0,a.uP)({k:"mp",g:l,o:t,at:u,n:(0,a.$y)().trim().slice(0,20)||"Anonymous",t:c,pid:o,ts:Date.now(),r:M
1ath.random().toString(36).slice(2)});return(await fetch("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({p:e})})).ok}catch(e){return!1}}},7205:(e,t,n)=>{Promise.resolve().then(n.bind(n,8955)),Promise.resolve().then(n.t.bind(n,2619,23)),Promise.resolve().then(n.t.bind(n,3673,23)),Promise.resolve().then(n.bind(n,8586)),Promise.resolve().then(n.bind(n,3195)),Promise.resolve().then(n.bind(n,8281)),Promise.resolve().then(n.bind(n,6331)),Promise.resolve().then(n.bind(n,245)),Promise.resolve().then(n.bind(n,7458)),Promise.resolve().then(n.bind(n,708)),Promise.resolve().then(n.bind(n,2983)),Promise.resolve().then(n.bind(n,1896)),Promise.resolve().then(n.bind(n,3248)),Promise.resolve().then(n.bind(n,5470)),Promise.resolve().then(n.bind(n,3318)),Promise.resolve().then(n.bind(n,6091)),Promise.resolve().then(n.bind(n,2197)),Promise.resolve().then(n.bind(n,6792)),Promise.resolve().then(n.bind(n,5264)),Promise.resolve().then(n.bind(n,9828)),Promise.resolve().then(n.bind(n,311))},7458:(e,t,n)=>{"use strict";n.d(t,{default:()=>d});var a=n(5155),r=n(63),s=n(2115),i=n(652),l=n(9016),o=n(2549),c=n(1175);function d(){let e=(0,r.usePathname)()||"/",t=(0,r.useRouter)(),{advertise:n,gameTag:d,showToggle:u}=function(e){let t=e.startsWith("/games/"),n=(0,i.Jd)(e);return{advertise:n,gameTag:t&&e.split("/")[2]||"browse",showToggle:n}}
1(e),[m,h]=(0,s.useState)("Player"),[f,x]=(0,s.useState)(!0),[p,b]=(0,s.useState)(!1),[g,w]=(0,s.useState)(null),[v,y]=(0,s.useState)(18),[j,N]=(0,s.useState)(""),[k,E]=(0,s.useState)(!1),S=(0,s.useRef)(g);S.current=g;let C=(0,s.useRef)(null);(0,s.useEffect)(()=>{try{h(window.localStorage.getItem("funnudge:name")||"Player")}catch(e){}x((0,i.oL)())},[e]),(0,i.nI)({name:m,open:f,game:d,enabled:n&&(0,o.Tx)()});let{peers:z,playerId:L}=(0,i.Zr)(n&&(0,o.Tx)()),M=!!L,D=z.filter(e=>e.id&&e.id!==L&&e.open&&!e.busy).length,A=M&&f&&D>0,{notifyUser:T,stopTitleFlash:P}=(0,l.QE)(),_=(0,s.useCallback)(e=>{let t=S.current;t&&e&&(0,i.ow)(t.from,e),C.current&&(clearTimeout(C.current.timer),C.current=null),E(!1),w(null),y(18),N(""),P()},[P]);return((0,s.useEffect)(()=>{if(n)return(0,i.tK)((e,t)=>{if(!(0,i.oL)()||(0,i.OJ)()||S.current)return void(0,i.ow)(t,"reject");w({inv:e,from:t}),y(18),(0,c._O)("chirp"),T("âï¸ ".concat(e.fromName||"A player"," wants to play!"),"".concat(e.slugName," â tap to accept before it expires"))})},[n,T]),(0,s.useEffect)(()=>{if(n)return(0,i.Nn)(e=>{var t;(null==(t=S.current)?void 0:t.from)===e&&_(null)})},[n,_]),(0,s.useEffect)(()=>(b((0,i.OJ)()),(0,i.XX)(e=>{b(e),e&&S.current&&!C.current&&_("reject")})),[_]),(0,s.useEffect)(()=>{if(!g||k)return;let e=setInterval(()=>{y(t=>t<=1?(clearInterval(e),_("ignore"),18):t-1)},1e3);return()=>clearInterval(e)},[g,k,_]),(0,s.useEffect)(()=>{if(n)return(0,i.ZT)(e=>{let n=C.current,a=S.current;n&&e===n.from&&a&&(clearTimeout(n.timer),C.current=null,E(!1),w(null),P(),window.dispatchEvent(new CustomEvent("funnudge:invite-accepted",{detail:{slug:a.inv.slug,code:a.inv.code}})),t.push("/games/".concat(a.inv.slug,"?room=").concat(a.inv.code,"&auto=1")))})},[n,t,P]),(0,o.Tx)())?(0,a.jsxs)(a.Fragment,{children:[u&&!g&&!p&&(!M||!f)&&(0,a.jsxs)("button",{onClick:()=>{let e=!f;x(e);try{window.localStorage.setItem(i.FA,e?"1":"0")}catch(e){}},"aria-pressed":f,"aria-label":M?f?"Open to challenges â ".concat(D," player").concat(1===D?"":"s"," online. Tap to turn invites off."):"Challenges off. Tap to become invitable.":"Joining the match lobby",className:"fixed bottom-[max(3.75rem,calc(env(safe-area-inset-bottom)+3.5rem))] right-3 z-[65] flex items-center gap-2.5 rounded-full border py-1.5 pl-2.5 pr-3.5 text-xs font-semibold shadow-lg backdrop-blur transition-colors motion-safe:animate-lobby-pop sm:right-4 ".concat(A?"border-emerald-400/30 bg-emerald-500/10 text-emerald-100 hover:bg-emerald-500/20":"border-white/10 bg-zinc-950/85 text-zinc-300 hover:bg-zinc-900"),children:[(0,a.jsxs)("span",{className:"relative flex h-2.5 w-2.5 shrink-0 items-center justify-center",children:[A&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"absolute h-2.5 w-2.5 rounded-full bg-emerald-400 motion-safe:animate-lobby-ping","aria-hidden":!0}),(0,a.jsx)("span",{className:"absolute h-2.5 w-2.5 rounded-full bg-emerald-400 motion-safe:animate-lobby-ping",style:{animationDelay:"1.2s"},"aria-hidden":!0})]}),(0,a.jsx)("span",{className:"relative h-2 w-2 rounded-full ".concat(M?f?"bg-emerald-400":"bg-zinc-600":"bg-amber-400 motion-safe:animate-pulse"),"aria-hidden":!0})]}),M?f?A?(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"text-sm font-extrabold tabular-nums text-white",children:D})," ","online"]}):"Open \xb7 waiting":"Challenges off":"Connectingâ¦"]},A?D:-1),g&&(0,a.jsx)("div",{className:"fixed inset-x-0 bottom-0 z-[80] flex justify-center px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",children:(0,a.jsx)("div",{className:"animate-bounce-in w-full max-w-md rounded-2xl border border-fuchsia-400/40 bg-zinc-950/95 p-4 shadow-2xl shadow-black/50 backdrop-blur",children:j?(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"text-2xl","aria-hidden":!0,children:"\uD83E\uDD37"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-sm text-zinc-300",children:j})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"text-3xl","aria-hidden":!0,children:"âï¸"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"truncate text-sm font-bold text-white",children:[g.inv.fromName||"A player"," wants to play"]}),(0,a.jsxs)("p",{className:"flex items-center gap-2 text-xs text-fuchsia-300",children:[g.inv.slugName,g.inv.rec&&g.inv.rec.w+g.inv.rec.l>0?(0,a.jsxs)("span",{className:"rounded-full bg-white/10 px-1.5 py-0.5 text-[10px] font-semibold text-zinc-300",children:["\uD83C\uDFC6 ",g.inv.rec.w,"W \xb7 ",g.inv.rec.l,"L"]}
1):(0,a.jsx)("span",{className:"rounded-full bg-emerald-400/15 px-1.5 py-0.5 text-[10px] font-semibold text-emerald-300",children:"⨠New challenger"})]})]}),(0,a.jsxs)("span",{className:"shrink-0 font-mono text-sm font-bold tabular-nums text-zinc-500",children:[v,"s"]})]}),(0,a.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,a.jsx)("button",{onClick:()=>_("reject"),disabled:k,className:"flex-1 rounded-xl border border-white/10 px-4 py-2 text-sm font-semibold text-zinc-300 transition hover:bg-white/5 disabled:opacity-50",children:"Reject"}),(0,a.jsx)("button",{onClick:()=>{let e=S.current;if(!e||k)return;E(!0),(0,i.ow)(e.from,"accept");let t=setTimeout(()=>{C.current=null,E(!1),N("".concat(e.inv.fromName||"They"," started another game â that invite is gone.")),window.setTimeout(()=>{N(""),_(null)},3500)},5e3);C.current={from:e.from,timer:t}},disabled:k,className:"flex-1 rounded-xl bg-gradient-to-r from-fuchsia-500 to-violet-500 px-4 py-2 text-sm font-bold text-white transition hover:scale-[1.02] disabled:opacity-70",children:k?"â³ Joiningâ¦":"â Accept"})]}),(0,a.jsxs)("button",{onClick:()=>{let e=S.current;e&&(0,i.r1)(e.from),_("reject")},className:"mt-2 w-full text-center text-[11px] text-zinc-500 transition hover:text-zinc-300",children:["\uD83D\uDD15 Reject & don't let ",g.inv.fromName||"them"," ","invite me again"]})]})})})]}):null}},8213:(e,t,n)=>{"use strict";n.d(t,{P:()=>a,Q:()=>r});let a="funnudge:celebrate";function r(){try{window.dispatchEvent(new CustomEvent(a))}catch(e){}}},8281:(e,t,n)=>{"use strict";n.d(t,{default:()=>m});var a=n(2115),r=n(9636),s=n(2578),i=n(1266),l=n(9341),o=n(2237),c=n(4107),d=n(5202);let u=[c.gO,r.xP,d.Se,o.hO,l.jC,i.dK];function m(){let e=(0,a.useRef)(!1),t=(0,a.useRef)(null),n=(0,a.useRef)(0),r=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(!(0,s._7)())return;let a=!0,i=()=>{t.current&&window.clearTimeout(t.current),t.current=null},l=async()=>{if(i(),n.current=0,e.current&&!r.current){r.current=!0;try{await (0,s.cA)({ifChanged:!0})}finally{r.current=!1}}},o=()=>{if(!e.current)return;let a=Date.now();if(n.current||(n.current=a),a-n.current>=45e3)return void l();i(),t.current=window.setTimeout(()=>void l(),6e3)},c=()=>{"hidden"===document.visibilityState&&n.current&&l()},d=t=>{var n;e.current=!!(null==(n=t.detail)?void 0:n.user),e.current||i()};for(let t of((0,s.Ny)().then(t=>{a&&(e.current=!!t)}),u))window.addEventListener(t,o);return window.addEventListener(s.Dh,d),document.addEventListener("visibilitychange",c),window.addEventListener("pagehide",c),()=>{for(let e of(a=!1,i(),u))window.removeEventListener(e,o);window.removeEventListener(s.Dh,d),document.removeEventListener("visibilitychange",c),window.removeEventListener("pagehide",c)}},[]),null}},8586:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var a=n(5155),r=n(2115),s=n(3735),i=n(9636),l=n(1175);function o(){let[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(null),[c,d]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=e=>{var n;let a=null==(n=e.detail)?void 0:n.achievement;a&&t(e=>[...e,a])};return window.addEventListener(i.xP,e),()=>window.removeEventListener(i.xP,e)},[]),(0,r.useEffect)(()=>{n||0===e.length||(o(e[0]),t(e=>e.slice(1)),(0,l._O)("win"),d(e=>e+1))},[e,n]),(0,r.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>o(null),3500);return()=>clearTimeout(e)},[n]),(0,a.jsxs)(a.Fragment,{children:[c>0&&(0,a.jsx)(s.default,{},c),n&&(0,a.jsxs)("div",{className:"animate-bounce-in fixed inset-x-4 bottom-6 z-[100] mx-auto w-fit max-w-md",children:[(0,a.jsx)("button",{onClick:()=>o(null),"aria-label":"Dismiss notification",className:"absolute -right-2 -top-2 z-10 flex h-6 w-6 items-center justify-center rounded-full bg-zinc-700 text-xs font-bold text-zinc-200 shadow hover:bg-zinc-600",children:"â"}),(0,a.jsxs)("a",{href:"/achievements",className:"flex items-center gap-3 rounded-2xl border border-amber-400/40 bg-zinc-900/95 px-5 py-3 shadow-2xl shadow-amber-500/20 backdrop-blur",children:[(0,a.jsx)("span",{className:"shrink-0 text-3xl","aria-hidden":!0,children:n.emoji}),(0,a.jsxs)("span",{className:"min-w-0",children:[(0,a.jsx)("span",{className:"block text-xs font-bold uppercase tracking-wide text-amber-300",children:"\uD83C\uDFC6 Achievement unlocked"}),(0,a.jsx)("span",{className:"block font-bold text-white",children:n.name}),(0,a.jsx)("span",{className:"block text-sm text-zinc-400",children:n.desc})]})]})]})]})}},9016:(e,t,n)=>{"use strict";n.d(t,{LT:()=>h,QE:()=>m,SV:()=>u,Zk:()=>f,j$:()=>x,oS:()=>i});var a=n(2115),r=n(9379),s=n(1175);let i="funnudge:name",l="funnudge:room-notify",o=null,c=null,d=null,u=()=>null!==o;function m(){let[e,t]=(0,a.useState)(!1),n=(0,a.useRef)(!1);n.current=e;let r=(0,a.useRef)({}),i=(0,a.useCallback)(()=>{var e;return e=r.current,void(o&&c===e&&(clearInterval(o),o=null,c=null,null!=d&&(document.title=d,d=null)))},[]),u=(0,a.useCallback)(e=>(function(e,t){if(o)return;c=e,d=document.title;let n=!0;document.title=t,o=setInterval(()=>{n=!n,document.title=n?t:null!=d?d:""},1100)})(r.current,e),[]),m=(0,a.useCallback)((e,t)=>{if("undefined"!=typeof document&&document.hidden&&((0,s._O)("chirp"),u(e),n.current&&"undefined"!=typeof Notification&&"granted"===Notification.permission))try{let n=new Notification(e,{body:t,icon:"/icon.svg"});n.onclick=()=>{window.focus(),n.close()}}catch(e){}},[u]);(0,a.useEffect)(()=>{try{t("1"===window.localStorage.getItem(l))}catch(e){}let e=()=>{document.hidden||i()};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e),i()}},[i]);let h=async()=>
1{if(!e){if("undefined"==typeof Notification)return;let e=Notification.permission;if("default"===e&&(e=await Notification.requestPermission()),"granted"!==e)return}let n=!e;t(n);try{window.localStorage.setItem(l,n?"1":"0")}catch(e){}};return{notifyOn:e,notifyUser:m,stopTitleFlash:i,toggleNotify:h}}function h(){let[e,t]=(0,a.useState)([]),n=(0,a.useRef)(0);return{floaties:e,addFloaty:(0,a.useCallback)(e=>{let a=++n.current;t(t=>[...t.slice(-5),{id:a,emoji:e,left:12+76*Math.random()}]),setTimeout(()=>t(e=>e.filter(e=>e.id!==a)),1900)},[])}}function f(e,t,n,r){(0,a.useEffect)(()=>{let a=setInterval(()=>{if("menu"===e.current)return;let a="playing"===e.current?18e5:6e5;Date.now()-t.current>a&&(r("\uD83D\uDCA4 Room closed after inactivity â create or join a new one!"),n.current())},6e4);return()=>clearInterval(a)},[])}async function x(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Play with me on FunNudge!",a=null!=(t=window.location.pathname.split("/").filter(Boolean).pop())?t:"",s=(0,r.lY)(a),i=(null==s?void 0:s.category)==="multiplayer",l=i?"/invite/".concat(a):window.location.pathname,o="".concat(window.location.origin).concat(l,"?room=").concat(e),c=i?"âï¸ I challenge you to ".concat(s.name,"! Tap to join my room:"):n;if("undefined"!=typeof navigator&&"share"in navigator&&/android|iphone|ipad|mobile/i.test(navigator.userAgent))try{return await navigator.share({title:c,text:c,url:o}),!1}catch(e){}try{return await navigator.clipboard.writeText(o),!0}catch(e){return!1}}},9341:(e,t,n)=>{"use strict";n.d(t,{bI:()=>l,jC:()=>i,np:()=>c,xu:()=>o});var a=n(9379),r=n(7127);let s=e=>"funnudge:mp-record:".concat(e),i="funnudge:mp-result";function l(e){try{var t,n,a,r,i;let l=window.localStorage.getItem(s(e));if(!l)return null;let o=JSON.parse(l);return{w:null!=(t=o.w)?t:0,l:null!=(n=o.l)?n:0,d:null!=(a=o.d)?a:0,streak:null!=(r=o.streak)?r:0,bestStreak:null!=(i=o.bestStreak)?i:0}}catch(e){return null}}function o(){let e={w:0,l:0,d:0};for(let t of a.ag){if(!t.slug.endsWith("-online"))continue;let n=l(t.slug);n&&(e.w+=n.w,e.l+=n.l,e.d+=n.d)}return e}function c(e,t){(0,r.DP)(e,t);try{var n;let a=null!=(n=l(e))?n:{w:0,l:0,d:0,streak:0,bestStreak:0};a[t]++,"w"===t?(a.streak++,a.bestStreak=Math.max(a.bestStreak,a.streak)):"l"===t&&(a.streak=0),window.localStorage.setItem(s(e),JSON.stringify(a)),window.dispatchEvent(new CustomEvent(i,{detail:{game:e,outcome:t,record:a}}))}catch(e){}}},9383:(e,t,n)=>{"use strict";n.d(t,{A8:()=>i,cK:()=>a,l6:()=>s,qZ:()=>r});let a="funnudge:open-feedback",r="funnudge:feedback-sent",s=[{value:"loved",emoji:"\uD83D\uDC4D",label:"Loved it"},{value:"okay",emoji:"\uD83D\uDE10",label:"Itâs okay"},{value:"needs_work",emoji:"\uD83D\uDC4E",label:"Needs work"}];function i(e){window.dispatchEvent(new CustomEvent(a,{detail:{rating:e}}))}},9828:(e,t,n)=>{"use strict";n.d(t,{default:()=>c});var a=n(5155),r=n(2115),s=n(6144),i=n(9636),l=n(2578),o=n(5202);function c(){let[e,t]=(0,r.useState)(null),[n,c]=(0,r.useState)(!1),[u,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!(0,l._7)())return;let e=!0;(async()=>{let n=await (0,l.Ny)();e&&(t(n),c(!!n||function(){try{if((0,i.mt)()>=5)return!0;return(0,o.c2)().count>=2}catch(e){return!1}}()),n&&await (0,l.cA)())})();let n=e=>{var n,a;return t(null!=(a=null==(n=e.detail)?void 0:n.user)?a:null)};return window.addEventListener(l.Dh,n),()=>{e=!1,window.removeEventListener(l.Dh,n)}},[]);let h=(0,r.useCallback)(async()=>{m(!0);try{await (0,l.Jv)()}finally{m(!1)}},[]),f=(0,r.useCallback)(async()=>{m(!0);try{await (0,l.cA)(),await (0,l.CI)(),t(null)}finally{m(!1)}},[]);return(0,l._7)()&&n?e?(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 text-xs text-zinc-500",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400","aria-hidden":!0}),"Progress saved as"," ",(0,a.jsx)("span",{className:"font-semibold text-zinc-300",children:e.name})]}),(0,a.jsx)("button",{onClick:f,disabled:u,className:"rounded-lg px-2 py-1 underline-offset-2 transition hover:text-zinc-300 hover:underline disabled:opacity-50",children:u?"Savingâ¦":"Sign out"})]}):(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,a.jsxs)("button",{onClick:h,disabled:u,title:"Keeps your streak, achievements and records if you clear your browser or switch device",className:"flex items-center gap-2 rounded-xl border border-white/10 bg-white/5 px-4 py-2 text-xs font-semibold text-zinc-300 transition hover:bg-white/10 disabled:opacity-50",children:[u?(0,a.jsx)(s.A,{className:"h-3.5 w-3.5"}):(0,a.jsx)(d,{}),u?"Opening Googleâ¦":"Save my progress"]}),(0,a.jsx)("p",{className:"text-[11px] text-zinc-600",children:"Adds to what you already have â nothing is replaced."})]}):null}function d(){return(0,a.jsxs)("svg",{viewBox:"0 0 18 18",className:"h-3.5 w-3.5","aria-hidden":!0,
1children:[(0,a.jsx)("path",{fill:"#4285F4",d:"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84a4.14 4.14 0 0 1-1.8 2.72v2.26h2.92c1.7-1.57 2.68-3.88 2.68-6.62z"}),(0,a.jsx)("path",{fill:"#34A853",d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.81.54-1.84.86-3.04.86-2.34 0-4.32-1.58-5.03-3.7H.96v2.33A9 9 0 0 0 9 18z"}),(0,a.jsx)("path",{fill:"#FBBC05",d:"M3.97 10.72a5.41 5.41 0 0 1 0-3.44V4.95H.96a9 9 0 0 0 0 8.1l3.01-2.33z"}),(0,a.jsx)("path",{fill:"#EA4335",d:"M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.59C13.46.89 11.43 0 9 0A9 9 0 0 0 .96 4.95l3.01 2.33C4.68 5.16 6.66 3.58 9 3.58z"})]})}}},e=>{e.O(0,[2978,2619,1803,652,7622,8420,2578,5019,8441,1255,7358],()=>e(e.s=7205)),_N_E=e.O()}]);
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.