1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7550],{7550:function(e,t,r){r.r(t),r.d(t,{default:function(){return ue}});var n=r(5814),i=r(5634),a=(r(6561),r(5216)),s=r(293);const o=650,l=800,c=20,u=l,d=c,p=630,h={fillStyle:"#E6B143"},x={isStatic:!0,render:h},g={isStatic:!0,render:h},m={isStatic:!0,render:h},b={name:"topLine",isStatic:!0,isSensor:!0,render:h},f=[s.Bodies.rectangle(10,400,c,u,x),s.Bodies.rectangle(640,400,c,u,g),s.Bodies.rectangle(325,790,o,c,m),s.Bodies.rectangle(325,200,o,2,b)],y={wireframes:!1,background:"#F7F4C8",width:o,height:l};var v=r(8846),w=r(4873),S=r(709),$=r(9144),j=r.n($);const C=[{code:"JP",name:"\u65e5\u672c"},{code:"KR",name:"\u97d3\u56fd"},{code:"US",name:"\u7c73\u56fd"},{code:"GB",name:"\u82f1\u56fd"}],_=({show:e,onClose:t,shareText:r,shareUrl:a})=>{const s=(0,S.useTranslations)(),[o,l]=(0,i.useState)(!1);if(!e)return null;const c=encodeURIComponent(r),u=encodeURIComponent(a),d=[{name:s("share_on_x"),url:`https://twitter.com/intent/tweet?text=${c}&url=${u}`},{name:s("share_on_line"),url:`https://line.me/R/msg/text/?${c}%0A${u}`},{name:s("share_on_facebook"),url:`https://www.facebook.com/sharer/sharer.php?u=${u}"e=${c}`}];return(0,n.jsx)("div",{className:j().shareModalOverlay,children:(0,n.jsxs)("div",{className:j().shareModal,children:[(0,n.jsxs)("div",{className:j().shareModalHeader,children:[(0,n.jsx)("h3",{children:s("share_modal_title")}),(0,n.jsx)("button",{onClick:t,className:j().closeButton,children:"\u2715"})]}),(0,n.jsxs)("div",{className:j().shareModalBody,children:[(0,n.jsx)("p",{className:j().sharePreviewText,children:r}),(0,n.jsxs)("div",{className:j().shareActions,children:[d.map((e=>(0,n.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:j().socialShareButton,children:e.name},e.name))),(0,n.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(`${r} ${a}`),l(!0),setTimeout((()=>l(!1)),2e3)},className:j().copyButton,children:s(o?"text_copied_to_clipboard":"copy_share_text")})]})]})]})})};var k=({score:e,onRestart:t,isVisible:r})=>{const a=(0,S.useTranslations)(),[s,o]=(0,i.useState)(!1),[l,c]=(0,i.useState)(""),[u,d]=(0,i.useState)(""),[p,h]=(0,i.useState)(!1),[x,g]=(0,i.useState)(""),[m,b]=(0,i.useState)("JP"),[f,y]=(0,i.useState)(!1),[v,w]=(0,i.useState)(null),[$,k]=(0,i.useState)(!1);return r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:j().modalOverlay,children:(0,n.jsx)("div",{className:j().modalContent,children:p?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h2",{className:j().title,children:a("submit_your_score")}),(0,n.jsxs)("form",{onSubmit:async t=>{if(t.preventDefault(),0!==x.trim().length){y(!0),w({message:"\u63d0\u4ea4\u4e2d...",isError:!1});try{const t=await fetch("/api/scores",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:x,score:e,countryCode:m})}),r=await t.json();t.ok?(w({message:r.message||"\u5206\u6570\u63d0\u4ea4\u6210\u529f\uff01",isError:!1}),k(!0),setTimeout((()=>{h(!1)}),2e3)):w({message:r.message||"\u63d0\u4ea4\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u3002",isError:!0})}catch(r){w({message:"\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u68c0\u67e5\u60a8\u7684\u8fde\u63a5\u3002",isError:!0})}finally{y(!1)}}else w({message:"\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\u3002",isError:!0})},className:j().submitForm,children:[(0,n.jsxs)("div",{className:j().formGroup,children:[(0,n.jsx)("label",{htmlFor:"username",children:a("username")}),(0,n.jsx)("input",{type:"text",id:"username",value:x,onChange:e=>g(e.target.value),maxLength:10,placeholder:a("username_placeholder"),required:!0,className:j().formInput})]}),(0,n.jsxs)("div",{className:j().formGroup,children:[(0,n.jsx)("label",{htmlFor:"country",children:a("country")}),(0,n.jsx)("select",{id:"country",value:m,onChange:e=>b(e.target.value),className:j().formSelect,children:C.map((e=>(0,n.jsx)("option",{value:e.code,children:e.name},e.code)))})]}),(0,n.jsxs)("div",{className:j().formActions,children:[(0,n.jsx)("button",{type:"button",onClick:()=>h(!1),className:j().cancelButton,children:a("cancel")}
1),(0,n.jsx)("button",{type:"submit",className:j().confirmButton,disabled:f,children:a(f?"submitting":"confirm_submit")})]})]}),v&&(0,n.jsx)("p",{className:`${j().submissionStatus} ${v.isError?j().error:j().success}`,children:v.message})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h2",{className:j().title,children:a("game_over")}),(0,n.jsxs)("p",{className:j().scoreText,children:[a("your_score"),": ",(0,n.jsx)("span",{className:j().score,children:e})]}),(0,n.jsxs)("div",{className:j().buttonGroup,children:[(0,n.jsxs)("button",{className:j().shareButton,onClick:async()=>{const t=(e=>{const t=a("game_name_for_share"),r=a("share_score_message",{gameName:t,score:e}),n=[t,a("share_score_hashtag_challenge"),a("share_score_hashtag_game_challenge")],i=[...new Set(n.map((e=>`#${e}`)))];return{title:a("share_score"),text:`${r} ${i.join(" ")}`,url:window.location.origin}})(e);if(navigator.share)try{await navigator.share(t)}catch(r){c(t.text),d(t.url),o(!0)}else c(t.text),d(t.url),o(!0)},children:["\ud83d\udce4 ",a("share_score")]}),(0,n.jsxs)("button",{className:`${j().button} ${j().submitButton}`,onClick:()=>{w(null),h(!0)},disabled:$,children:["\ud83c\udfc6 ",a($?"score_submitted":"submit_score")]}),(0,n.jsx)("button",{className:j().restartButton,onClick:t,children:a("play_again")})]})]})})}),(0,n.jsx)(_,{show:s,onClose:()=>o(!1),shareText:l,shareUrl:u})]}):null},M=r(3635),F=r(9841);var T=({sequenceProgress:e,challengeData:t})=>{const r=(0,S.useTranslations)();return(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.95)",border:"2px solid #E6B143",borderRadius:"12px",padding:"12px 20px",marginBottom:"5px",boxShadow:"0px 4px 12px rgba(0,0,0,0.15)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",width:"100%",maxWidth:"650px"},children:[(0,n.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:(0,n.jsxs)("div",{style:{backgroundColor:"rgba(46, 160, 67, 0.95)",color:"white",padding:"8px 14px",borderRadius:"8px",fontSize:"16px",fontWeight:"bold",minWidth:"70px",textAlign:"center"},children:[e,"/",t.sequenceLength,e>=t.sequenceLength&&" \u2713"]})}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",flex:1,justifyContent:"center"},children:[(0,n.jsxs)("span",{style:{fontSize:"14px",color:"#B8860B",fontWeight:"bold",marginRight:"8px"},children:[r("upcoming"),":"]}),t.sequence.slice(e,e+8).map(((e,t)=>{const r=["cherry","strawberry","grape","tangerine","orange","apple","pear","peach","pineapple","melon","watermelon"][e];return r?(0,n.jsx)("img",{src:`/base/${r}.png`,alt:r,style:{width:"28px",height:"28px",borderRadius:"50%",objectFit:"contain",opacity:0===t?1:.7-.08*t,filter:"drop-shadow(0px 2px 4px rgba(0,0,0,0.2))",border:"1px solid rgba(255,255,255,0.5)",backgroundColor:"rgba(255,255,255,0.3)"}},t):null})),t.sequence.length-e>8&&(0,n.jsxs)("span",{style:{fontSize:"12px",color:"#B8860B",opacity:.6,marginLeft:"4px"},children:["+",t.sequence.length-e-8]})]})]})};let I,R,z,B,E,W,N,L,P,A=null;const D=async()=>A||(A=await Promise.resolve().then(r.t.bind(r,293,23)),({Bodies:I,Body:R,Engine:z,Events:B,Render:E,Runner:W,World:N,Sleeping:L,Pair:P}=A),A),H=e=>{switch(e){case"daily":return"sukigame_daily_gameState";case"blitz":return"sukigame_blitz_gameState";case"item":return"sukigame_item_gameState";case"target":return"sukigame_target_gameState";case"rising-tide":return"sukigame_rising_tide_gameState";default:return"sukigame_gameState"}},q=e=>({position:"absolute",top:20*e+"px",left:20*e+"px",fontSize:`${Math.max(24,48*e)}px`,fontWeight:"bold",color:"#FFD700",zIndex:100,fontFamily:'"Arial Black", Gadget, sans-serif',textShadow:`${2*e}px ${2*e}px ${4*e}px rgba(0,0,0,0.5)`}),V=(e,t=!1)=>({position:"absolute",top:t?75*e+"px":20*e+"px",right:20*e+"px",display:"flex",alignItems:"center",backgroundColor:"rgba(255, 160, 122, 0.75)",padding:`${10*e}px ${18*e}px`,borderRadius:12*e+"px",zIndex:100,boxShadow:`0px ${2*e}px ${5*e}px rgba(0,0,0,0.2)`}),O=e=>({color:"white",marginRight:10*e+"px",fontSize:`${Math.max(12,18*e)}px`,fontWeight:"bold"}),G=e=>({width:`${Math.max(20,30*e)}px`,height:`${Math.max(20,30*e)}px`,objectFit:"contain"}),J=(e,t=!1)=>
1({position:"absolute",top:t?130*e+"px":70*e+"px",right:20*e+"px",width:`${Math.max(32,40*e)}px`,height:`${Math.max(32,40*e)}px`,backgroundColor:"rgba(255, 160, 122, 0.75)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:100,boxShadow:`0px ${2*e}px ${5*e}px rgba(0,0,0,0.2)`}),K=e=>({position:"absolute",top:120*e+"px",right:20*e+"px",padding:`${8*e}px ${15*e}px`,minWidth:`${Math.max(32,40*e)}px`,height:`${Math.max(32,40*e)}px`,backgroundColor:"rgba(255, 160, 122, 0.75)",color:"white",borderRadius:12*e+"px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:100,boxShadow:`0px ${2*e}px ${5*e}px rgba(0,0,0,0.2)`,fontSize:`${Math.max(12,16*e)}px`,fontWeight:"bold",whiteSpace:"nowrap"}),U=(e,t=!1)=>({position:"absolute",top:t?130*e+"px":70*e+"px",right:70*e+"px",width:`${Math.max(32,40*e)}px`,height:`${Math.max(32,40*e)}px`,backgroundColor:"rgba(255, 99, 71, 0.75)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:100,boxShadow:`0px ${2*e}px ${5*e}px rgba(0,0,0,0.2)`}),X=e=>({position:"absolute",top:210*e+"px",right:20*e+"px",padding:`${10*e}px ${15*e}px`,backgroundColor:"rgba(255, 0, 0, 0.7)",color:"white",border:"none",borderRadius:5*e+"px",cursor:"pointer",zIndex:100,boxShadow:`${2*e}px ${2*e}px ${4*e}px rgba(0,0,0,0.3)`,fontSize:`${Math.max(10,14*e)}px`,fontWeight:"bold"}),Y=e=>({display:"flex",justifyContent:"center",alignItems:"center",gap:12*e+"px",marginBottom:5*e+"px",width:"100%"}),Z=(e,t)=>({display:"flex",alignItems:"center",gap:4*e+"px",padding:`${6*e}px ${12*e}px`,backgroundColor:"blitz"===t?"rgba(138, 43, 226, 0.9)":"daily"===t?"rgba(46, 160, 67, 0.9)":"item"===t?"rgba(255, 140, 0, 0.9)":"rising-tide"===t?"rgba(33, 150, 243, 0.9)":"rgba(220, 53, 69, 0.9)",color:"white",textDecoration:"none",borderRadius:8*e+"px",fontSize:`${Math.max(12,14*e)}px`,fontWeight:"bold",boxShadow:`0px ${2*e}px ${6*e}px rgba(0,0,0,0.2)`,transition:"all 0.2s ease",cursor:"pointer",minWidth:70*e+"px",justifyContent:"center",border:"none",userSelect:"none"}),Q=e=>({position:"absolute",top:75*e+"px",left:15*e+"px",display:"flex",alignItems:"stretch",gap:8*e+"px",zIndex:100}),ee=e=>({backgroundColor:"rgba(255, 160, 122, 0.9)",color:"white",padding:8*e+"px",borderRadius:8*e+"px",boxShadow:`0px ${2*e}px ${5*e}px rgba(0,0,0,0.2)`,display:"flex",flexDirection:"row",alignItems:"center",gap:6*e+"px"}),te=(e,t,r)=>({display:"flex",alignItems:"center",justifyContent:"center",gap:4*e+"px",padding:`${5*e}px ${8*e}px`,borderRadius:6*e+"px",cursor:r?"pointer":"not-allowed",backgroundColor:t?"rgba(255, 215, 0, 0.4)":r?"rgba(255, 255, 255, 0.15)":"rgba(255, 255, 255, 0.05)",border:t?"1px solid #FFD700":"1px solid rgba(255, 255, 255, 0.2)",opacity:r?1:.6,transition:"all 0.2s ease",minWidth:35*e+"px"}),re=e=>({backgroundColor:"rgba(255, 160, 122, 0.9)",color:"white",padding:`0 ${10*e}px`,borderRadius:8*e+"px",boxShadow:`0px ${2*e}px ${5*e}px rgba(0,0,0,0.2)`,fontSize:`${Math.max(12,14*e)}px`,fontWeight:"bold",textAlign:"center",minWidth:60*e+"px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),ne=(e,t)=>({position:"absolute",top:20*e+"px",right:20*e+"px",backgroundColor:t<=10?"rgba(255, 0, 0, 0.95)":"rgba(138, 43, 226, 0.95)",color:"white",padding:`${6*e}px ${12*e}px`,borderRadius:8*e+"px",fontSize:`${Math.max(14,20*e)}px`,fontWeight:"bold",zIndex:101,boxShadow:`0px ${2*e}px ${6*e}px rgba(0,0,0,0.3)`,animation:t<=10?"pulse 1s infinite":"none",transition:"all 0.3s ease",display:"flex",alignItems:"center",justifyContent:"center",minWidth:70*e+"px",border:t<=10?"2px solid rgba(255, 255, 255, 0.8)":"none",letterSpacing:"0.5px"}),ie=new Map,ae=new Map,se=e=>{if(ae.has(e))return ae.get(e);if(ie.has(e))return Promise.resolve(ie.get(e));const t=new Promise(((t,r)=>{const n=new Image,i=setTimeout((()=>{r(new Error(`Image load timeout: ${e}`))}),1e4);n.onload=()=>{clearTimeout(i),n.complete&&n.naturalWidth>0&&n.naturalHeight>0?(ie.set(e,n),t(n)):r(new Error(`Image loaded but invalid: ${e}`))},n.onerror=()=>{clearTimeout(i),r(new Error(`Failed to load image: ${e}`))},n.src=e}));return ae.set(e,t),t},oe=(e,t="#FF6B6B")=>{const r=(e=>{const t=e;return ie.has(t),t})(e);if(ie.has(r)){const e=ie.get(r);
1if(e.complete&&e.naturalWidth>0)return{texture:r,xScale:1,yScale:1}}return{fillStyle:t,strokeStyle:"#FFFFFF",lineWidth:2}},le=e=>({cherry:"#DC143C",strawberry:"#FF69B4",grape:"#9370DB",tangerine:"#FF8C00",orange:"#FFA500",apple:"#FF0000",pear:"#9ACD32",peach:"#FFCBA4",pineapple:"#FFD700",melon:"#32CD32",watermelon:"#00FF7F",pumpkin:"#FF7518",Verb:"#8B4513",boom:"#FF4500",booming:"#FF6347"}[e]||"#FF6B6B"),ce=(0,i.memo)((({theme:e,mode:t="classic",timeLimit:r=180,onTimeUp:s,onScoreChange:l,dailySequence:c,onSequenceProgress:u,onRisingTideGameOver:h,targetLevel:x,onTargetComplete:g})=>{const m=(0,S.useTranslations)(),b=(0,F.useParams)(),$=b?.locale||"ja",j=(0,v.Zl)(w.k),C=(0,v.sJ)(w.k),_=(0,i.useRef)(!1),[P,ie]=(0,i.useState)(!1);(0,i.useEffect)((()=>{l&&l(C)}),[C,l]);const[ae,ce]=(0,i.useState)(!1),[ue,de]=(0,i.useState)(40);(0,i.useEffect)((()=>{let e;const t=new MutationObserver((t=>{t.some((e=>{const t=e.target;return"HEADER"===t.tagName||t.closest("header")||"childList"===e.type&&Array.from(e.addedNodes).some((e=>e.nodeType===Node.ELEMENT_NODE&&("HEADER"===e.tagName||e.querySelector("header"))))}))&&(clearTimeout(e),e=setTimeout((()=>{const e=document.querySelector("header");if(e){const t=e.offsetHeight;t!==ue&&de(t)}}),100))}));return t.observe(document.body,{childList:!0,subtree:!1,attributes:!1,characterData:!1}),()=>{clearTimeout(e),t.disconnect()}}),[ue]);const[pe,he]=(0,i.useState)(1);(0,i.useEffect)((()=>{const e=()=>{const e=window.innerWidth,t=window.innerHeight,r=e<=768,n=r?32:40;if(r){ce(!0);const r=e/o,i=(t-n-30)/y.height;he(Math.min(.95,r,i))}else{ce(!1);const r=(e-40)/o,i=(t-n-40)/y.height;he(Math.min(1,r,i))}de(r?32:40)};e();const t=()=>e();return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[]);const[xe,ge]=(0,i.useState)(null),[me,be]=(0,i.useState)(!1),[fe,ye]=(0,i.useState)(!0),ve=(0,i.useRef)(fe),[we,Se]=(0,i.useState)(!1),[$e,je]=(0,i.useState)(1),[Ce,_e]=(0,i.useState)(0),[ke,Me]=(0,i.useState)("blitz"===t?r:0),[Fe,Te]=(0,i.useState)(!1),Ie=(0,i.useRef)(null),[Re,ze]=(0,i.useState)(0),[Be,Ee]=(0,i.useState)(0),[We,Ne]=(0,i.useState)(0),[Le,Pe]=(0,i.useState)("normal"),[Ae,De]=(0,i.useState)(0),[He,qe]=(0,i.useState)(!1),[Ve,Oe]=(0,i.useState)(0),[Ge,Je]=(0,i.useState)({}),[Ke,Ue]=(0,i.useState)(0),[Xe,Ye]=(0,i.useState)(0),Ze=(0,i.useRef)(null),Qe=(0,i.useRef)(!1),[et,tt]=(0,i.useState)([]),[rt,nt]=(0,i.useState)(0),[it,at]=(0,i.useState)(0),[st,ot]=(0,i.useState)(0),lt=(0,i.useRef)(null),ct=(0,i.useRef)(null),ut=(0,i.useRef)(null),dt=(0,i.useCallback)((e=>{tt((t=>[...t,`${(new Date).toLocaleTimeString()}: ${e}`].slice(-10)))}),[]),pt=(0,i.useRef)(null),ht=(0,i.useRef)(null),xt=(0,i.useRef)(null),gt=(0,i.useRef)(null),mt=(0,i.useRef)(null),bt=(0,i.useRef)(null),ft=(0,i.useRef)(null),yt=(0,i.useRef)(null),vt=(0,i.useRef)(null),wt=(0,i.useRef)(null),St=(0,i.useRef)(!1),$t=(0,i.useRef)(null),jt=(0,i.useRef)(null),Ct=(0,i.useRef)(null),_t=(0,i.useRef)(!1),kt=(0,i.useRef)(!1),Mt=(0,i.useRef)(!1),Ft="base"===e?a.L2:a.uC;(0,i.useEffect)((()=>{}),[]),(0,i.useEffect)((()=>{ve.current=fe}),[fe]),(0,i.useEffect)((()=>{if(!Mt.current)return pt.current=new Audio,ht.current=new Audio,xt.current=new Audio,gt.current=new Audio,mt.current=new Audio,Mt.current=!0,()=>{pt.current=null,ht.current=null,xt.current=null,gt.current=null,mt.current=null,Mt.current=!1}}),[]);const Tt=(0,i.useCallback)((()=>{pt.current&&(pt.current.src="/base/dropdown.mp3",pt.current.load()),ht.current&&(ht.current.src="/base/mergefruit.mp3",ht.current.load()),xt.current&&(xt.current.src="/base/win.mp3",xt.current.load()),gt.current&&(gt.current.src="/base/mergefruit.mp3",gt.current.load()),mt.current&&(mt.current.src="/base/win.mp3",mt.current.load())}),[]);(0,i.useEffect)((()=>{fe?(pt.current&&(pt.current.src=""),ht.current&&(ht.current.src=""),xt.current&&(xt.current.src=""),gt.current&&(gt.current.src=""),mt.current&&(mt.current.src="")):Tt()}),[fe,Tt]);const It=(0,i.useCallback)((e=>{!fe&&e.current&&e.current.src&&(e.current.currentTime=0,e.current.play().catch((e=>{})))}),[fe]),Rt=(0,i.useCallback)((e=>{e.stopPropagation(),ye((e=>!e)),e.preventDefault()}),[we]);(0,i.useEffect)((()=>
1{if("blitz"===t&&!Fe&&_t.current)return Ie.current=setInterval((()=>{Me((e=>e<=1?(Te(!0),St.current=!0,Ie.current&&(clearInterval(Ie.current),Ie.current=null),s&&setTimeout((()=>{s(),It(xt)}),500),0):e-1))}),1e3),()=>{Ie.current&&(clearInterval(Ie.current),Ie.current=null)}}),[t,Fe,s,It]),(0,i.useEffect)((()=>{if("rising-tide"===t&&_t.current&&yt.current)return ct.current=setInterval((()=>{at((e=>e+1))}),1e3),lt.current=setInterval((()=>{nt((e=>{const t=e+30,r=y.height-150;if(t>=r)return St.current=!0,lt.current&&(clearInterval(lt.current),lt.current=null),ct.current&&(clearInterval(ct.current),ct.current=null),h&&setTimeout((()=>{h({waterLevel:Math.floor(t/30),survivalTime:it,fruitsMerged:st}),It(xt)}),500),r;if(ut.current&&yt.current){yt.current.world;const e=y.height-t;R.setPosition(ut.current,{x:ut.current.position.x,y:e})}return t}))}),3e4),()=>{lt.current&&(clearInterval(lt.current),lt.current=null),ct.current&&(clearInterval(ct.current),ct.current=null)}}),[t,h,It,it,st]);const zt=(0,i.useCallback)((()=>{if("target"===t&&x&&Ve<x.sequence.length){const e=x.sequence[Ve];return Ft[e]}if("daily"===t&&c&&Ae<c.length){const e=c[Ae];return Ft[e]}let e=Math.min(5,Ft.length-1);switch(Ce){case 1:e=Math.min(6,Ft.length-1);break;case 2:e=Math.min(7,Ft.length-1);break;case 3:e=Math.min(8,Ft.length-1)}const r=Math.floor(Math.random()*e);return Ft[r]}),[Ft,Ce,t,c,Ae,x,Ve]),Bt=(0,i.useCallback)((e=>{if(!yt.current||!_t.current)return;const r=yt.current.world,n=[];r.bodies.forEach((e=>{const t=e;if(!t.isStatic&&t.label&&"Circle Body"!==t.label&&"number"===typeof t.index){if(vt.current&&vt.current.id===t.id)return;n.push({x:t.position.x,y:t.position.y,angle:t.angle,angularVelocity:t.angularVelocity,velocityX:t.velocity.x,velocityY:t.velocity.y,label:t.label,index:t.index,isSleeping:t.isSleeping})}}));let i=null;if(vt.current&&wt.current){const e=vt.current,t=Ft.findIndex((e=>e.name===wt.current.name));-1!==t&&(i={x:e.position.x,y:e.position.y,angle:e.angle,angularVelocity:e.angularVelocity,velocityX:e.velocity.x,velocityY:e.velocity.y,label:e.label,index:t,isSleeping:e.isSleeping})}const a={score:"number"===typeof e?e:C,fruitsInScene:n,nextFruitIndex:xe?Ft.findIndex((e=>e.name===xe.name)):null,currentControlledFruitState:i,bigFruitLevel:Ce,consecutiveMerges:Re,hammerCount:Be,bombCount:We,selectedTool:Le};try{const e=H(t);localStorage.setItem(e,JSON.stringify(a))}catch(s){}}),[C,xe,Ft,e,yt,vt,wt,_t,Ce,Re,Be,We,Le,t]),Et=(0,i.useCallback)((()=>{if(!yt.current)return!1;const r=H(t),n=localStorage.getItem(r);if(!n)return!1;try{const t=JSON.parse(n),r=yt.current.world,i=r.bodies.filter((e=>!e.isStatic&&"Circle Body"!==e.label));if(N.remove(r,i),vt.current=null,wt.current=null,j(t.score),"number"===typeof t.bigFruitLevel?_e(t.bigFruitLevel):_e(0),ze(t.consecutiveMerges||0),Ee(t.hammerCount||0),Ne(t.bombCount||0),Pe(t.selectedTool||"normal"),null!==t.nextFruitIndex&&Ft[t.nextFruitIndex]?ge(Ft[t.nextFruitIndex]):ge(zt()),t.fruitsInScene.forEach((t=>{const n=Ft[t.index];if(!n)return;const i={label:t.label,index:t.index,isSleeping:t.isSleeping,render:{sprite:oe(`/${e}/${n.name}.png`,le(n.name))},restitution:.2,angle:t.angle},a=I.circle(t.x,t.y,n.radius,i);N.add(r,a),R.setVelocity(a,{x:t.velocityX,y:t.velocityY}),R.setAngularVelocity(a,t.angularVelocity),t.isSleeping?L.set(a,!0):L.set(a,!1)})),t.currentControlledFruitState){const n=t.currentControlledFruitState,i=Ft[n.index];if(i){const t={label:n.label,index:n.index,isSleeping:!0,render:{sprite:oe(`/${e}/${i.name}.png`,le(i.name))},restitution:.2},a=I.circle(n.x,n.y,i.radius,t);N.add(r,a),R.setPosition(a,{x:n.x,y:n.y}),R.setVelocity(a,{x:0,y:0}),R.setAngularVelocity(a,0),vt.current=a,wt.current=i,L.set(a,!0)}}return _.current=!0,!0}catch(i){const e=H(t);return localStorage.removeItem(e),!1}}),[Ft,e,j,ge,zt,yt,_e,t]),Wt=(0,i.useCallback)((async()=>{if(!yt.current)return;A||await D(),vt.current=null,wt.current=null;const r=yt.current.world;let n,i=!1;if("item"===t&&"hammer"===Le&&Be>0?(n=a.Tk.hammer,i=!0,Ee((e=>e-1)),Pe("normal")):"item"===t&&"bomb"===Le&&We>0?(n=a.Tk.bomb,i=!0,Ne((e=>e-1)),Pe("normal")):(n=xe||zt(),Pe("normal")),!n)return;const s=i?-1:Ft.findIndex((e=>e.name===n.name)),o={label:n.name,index:s,isSleeping:!0,render:{sprite:oe(`/${e}/${n.name}.png`,le(n.name))},restitution:.2},l=I.circle(325,70,n.radius,o);if(i&&(l.toolType=n.type,l.isSpecialTool=!0),vt.current=l,wt.current=n,N.add(r,l),!i)if("target"===t)Ye((e=>e+1)),Oe((e=>{const t=e+1;if(x){if(x.maxMoves&&Xe+1>=x.maxMoves)return Ot(),e;if(t>=x.sequence.length)return Ot(),e;if(t<x.sequence.length){const e=x.sequence[t],r=Ft[e];ge(r)}}return t}));else if("daily"===t)De((e=>{const t=e+1;if(c&&t>=c.length)return qe(!0),u&&u(c.length),e;if(u&&u(t),c&&t<c.length){const e=c[t],r=Ft[e];ge(r)}return t}));else{const e=zt();ge(e)}}),[Ft,zt,xe,e,yt,ge,Le,Be,We]),Nt=(0,i.useCallback)((e=>{if(!_t.current||St.current||!vt.current||!wt.current||!bt.current||"daily"===t&&He)return;const r=vt.current,n=wt.current,i=bt.current.getBoundingClientRect(),a=bt.current.querySelectorAll("canvas");let s=i;if(a.length>0){s=a[0].getBoundingClientRect()}const l=(e.clientX-s.left)/(s.width/o),c=20+n.radius,u=p-n.radius,d=Math.max(c,Math.min(l,u));R.setPosition(r,{x:d,y:r.position.y}),L.set(r,!1),It(pt),Bt(),St.current=!0;!r.isSpecialTool&&(Qe.current=!0,Ze.current&&clearTimeout(Ze.current),Ze.current=setTimeout((()=>{Qe.current&&(ze(0),Qe.current=!1)}),2e3));setTimeout((async()=>{await Wt(),St.current=!1}),"blitz"===t?600:1e3)}),[Wt,It,pe,Bt]),Lt=(0,i.useCallback)((async()=>{{const e=H(t);localStorage.removeItem(e)}if(_.current=!1,be(!1),j(0),_e(0),ze(0),Ee(0),Ne(0),Pe("normal"),"daily"===t&&(De(0),qe(!1)),"target"===t&&(Oe(0),Je({}),Ue(0),Ye(0)),Qe.current=!1,Ze.current&&(clearTimeout(Ze.current),Ze.current=null),St.current=!1,yt.current){const e=yt.current.world,t=e.bodies.filter((e=>!e.isStatic&&"Circle Body"!==e.label));N.remove(e,t)}await Wt()}),[Wt,j,t]),Pt=(0,i.useCallback)((async e=>{e.stopPropagation(),e.preventDefault(),await Lt()}),[Lt]),At=(0,i.useCallback)((()=>
1{if(!we)return;const e=Math.floor(20001*Math.random())+1e4;if(j(e),be(!0),!ve.current&&xt.current)try{xt.current.src&&-1!==xt.current.src.indexOf("win.mp3")||(xt.current.src="/base/win.mp3",xt.current.load()),xt.current.currentTime=0;const e=xt.current.play();e&&e.catch((e=>{}))}catch(t){}}),[we,j,ve]),Dt=((0,i.useCallback)((e=>{const t=parseFloat(e.target.value);je(t),yt.current&&(yt.current.world.gravity.y=t),Bt()}),[Bt]),(0,i.useCallback)((e=>{e.stopPropagation(),e.preventDefault(),_e((e=>(e+1)%4)),Bt()}),[Ce,Bt])),Ht=(0,i.useCallback)(((e,t)=>{t.stopPropagation(),t.preventDefault(),"hammer"===e&&Be<=0||"bomb"===e&&We<=0||(Pe(e),Bt())}),[Be,We,Bt]),qt=(0,i.useCallback)(((e,t,r,n)=>{if(!yt.current)return;const i=yt.current.world,a=I.circle(e,t,n/2,{isStatic:!0,isSensor:!0,label:"visual_effect",render:{sprite:oe(`/base/${r}`,le(r.replace(".png",""))),opacity:0}});N.add(i,a);let s=0;const o=setInterval((()=>{s+=.2,s>=1&&(s=1,clearInterval(o),setTimeout((()=>{const e=setInterval((()=>{s-=.1,s<=0?(clearInterval(e),N.remove(i,a)):a.render.opacity=s}),30)}),200)),a.render.opacity=s}),20)}),[yt]),Vt=(0,i.useCallback)((e=>{5===e&&(Ee((e=>e+1)),dt("\ud83d\udd28 \u83b7\u5f97\u9524\u5934\u5956\u52b1\uff01")),10===e&&(Ne((e=>e+1)),dt("\ud83d\udca3 \u83b7\u5f97\u70b8\u5f39\u5956\u52b1\uff01")),e>10&&e%10===0&&(Ne((e=>e+1)),dt(`\ud83d\udca3 \u8fde\u7eed${e}\u6b21\uff01\u989d\u5916\u5956\u52b1\uff01`)),e>10&&(e-10)%5===0&&(Ee((e=>e+1)),dt(`\ud83d\udd28 \u8fde\u7eed${e}\u6b21\uff01\u989d\u5916\u5956\u52b1\uff01`))}),[dt]),Ot=((0,i.useCallback)((()=>{Vt(Re)}),[Re,Vt]),(0,i.useCallback)((()=>{if("target"!==t||!x||!g)return;let e=!0;for(const t of x.targets)switch(t.type){case"collect":if(t.fruit){(Ge[t.fruit]||0)<t.value&&(e=!1)}break;case"score":C<t.value&&(e=!1);break;case"combo":Ke<t.value&&(e=!1)}const r=H(t);localStorage.removeItem(r),g({score:C,targetsCompleted:e,collectedFruits:Ge,maxCombo:Ke})}),[t,x,g,Ge,C,Ke])),Gt=(0,i.useCallback)((()=>{if(!bt.current)return;const e=bt.current.querySelectorAll("canvas");if(e.length>0){const t=e[0];t.style.visibility="visible",t.style.opacity="1",t.style.display="block",t.style.marginLeft="auto",t.style.marginRight="auto",dt("Canvas\u5c45\u4e2d\u5b8c\u6210")}else dt("\u8b66\u544a: \u6ca1\u6709\u627e\u5230Canvas\u5143\u7d20")}),[dt]);return(0,i.useEffect)((()=>{if(kt.current)return;const r=setTimeout((()=>{bt.current&&function(){dt("\u5f00\u59cb\u521d\u59cb\u5316\u6e38\u620f\u5f15\u64ce");const r=async()=>{try{dt("\u6b63\u5728\u52a0\u8f7dMatter.js..."),await D(),dt("Matter.js\u52a0\u8f7d\u5b8c\u6210"),dt("\u9884\u52a0\u8f7d\u56fe\u7247\u4e2d..."),await(async(e,t)=>{const r=e.map((e=>{const r=`/${t}/${e.name}.png`;return se(r).catch((e=>null))}));["/base/Verb.png","/base/boom.png","/base/booming.png"].forEach((e=>{r.push(se(e).catch((e=>null)))}));const n=await Promise.allSettled(r);n.filter((e=>"fulfilled"===e.status&&null!==e.value)).length,n.length})(Ft,e),dt("\u56fe\u7247\u9884\u52a0\u8f7d\u5b8c\u6210"),await n()}catch(t){dt(`\u8d44\u6e90\u52a0\u8f7d\u8b66\u544a: ${t}`),await n()}},n=async()=>{try{await D();const r=z.create();dt(`Matter.js \u5f15\u64ce\u521b\u5efa: ${!!r}`),yt.current=r;const n=r.world;if(r.world.gravity.y="blitz"===t?2.5:2,"rising-tide"===t){const e=I.rectangle(-30,y.height/2,50,y.height,{isStatic:!0,label:"leftWall"}),t=I.rectangle(680,y.height/2,50,y.height,{isStatic:!0,label:"rightWall"}),r=I.rectangle(325,y.height,o,60,{isStatic:!0,label:"ground"}),i=I.rectangle(325,70,o,2,{name:"topLine",isStatic:!0,isSensor:!0,label:"topLine"});ut.current=r,N.add(n,[e,t,r,i])}else N.add(n,f);
1if(dt(`\u4e16\u754c\u7269\u4f53\u6570\u91cf: ${n.bodies.length}`),f.forEach(((e,t)=>{const r=e.label||`\u8fb9\u754c${t}`;dt(`\u8fb9\u754c${t}: ${r}, \u4f4d\u7f6e: (${e.position.x.toFixed(1)}, ${e.position.y.toFixed(1)})`)})),dt(`\u6e38\u620f\u533a\u57df: X(20-630), Y(0-${y.height})`),!ft.current){dt("\u521b\u5efa\u65b0\u7684canvas\u5143\u7d20");const e=document.createElement("canvas");ft.current=e,bt.current&&(bt.current.firstChild?bt.current.insertBefore(e,bt.current.firstChild):bt.current.appendChild(e)),dt("Canvas\u5143\u7d20\u5df2\u6dfb\u52a0\u5230\u5bb9\u5668")}const i=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);dt(`\u79fb\u52a8\u8bbe\u5907\u68c0\u6d4b: ${i}`),dt(`\u5f53\u524d\u7f29\u653e\u6bd4\u4f8b: ${pe}`);const s=bt.current?.clientWidth||o,l=bt.current?.clientHeight||y.height;dt(`\u5bb9\u5668\u5c3a\u5bf8: ${s}x${l}`);const c=i?Math.min(window.devicePixelRatio||1,2):1;dt(`\u6709\u6548\u50cf\u7d20\u6bd4: ${c} (\u539f\u59cb: ${window.devicePixelRatio})`);const u=s/o,x=l/y.height,g=Math.min(u,x,pe),m=o*g,b=y.height*g;dt(`\u6700\u7ec8\u7f29\u653e\u6bd4\u4f8b: ${g}`),dt(`Canvas\u663e\u793a\u5c3a\u5bf8: ${m}x${b}`);const v={...y,width:o,height:y.height,background:y.background,wireframes:y.wireframes,pixelRatio:c,hasBounds:!1,enabled:!0,showStats:!1,showPerformance:!1,showBounds:!1,showVelocity:!1,showAngleIndicator:!1,showSleeping:!1};dt(`\u6e32\u67d3\u5668\u914d\u7f6e: ${v.width}x${v.height}, \u50cf\u7d20\u6bd4: ${v.pixelRatio}`);const w=E.create({engine:r,element:bt.current||void 0,canvas:ft.current||void 0,options:v});dt(`\u6e32\u67d3\u5668\u521b\u5efa: ${!!w}`),dt(`Canvas\u5c3a\u5bf8: ${w.canvas?.width}x${w.canvas?.height}`),w.canvas&&(w.canvas.style.width=`${m}px`,w.canvas.style.height=`${b}px`,w.canvas.style.maxWidth="100%",w.canvas.style.maxHeight="100%",dt(`\u8bbe\u7f6eCanvas CSS\u5c3a\u5bf8: ${m}x${b}`),dt(`Canvas\u903b\u8f91\u5c3a\u5bf8: ${w.canvas.width}x${w.canvas.height}`),dt(`Canvas\u663e\u793a\u5c3a\u5bf8: ${w.canvas.offsetWidth}x${w.canvas.offsetHeight}`),dt(`\u7f29\u653e\u6bd4\u4f8b: ${(w.canvas.offsetWidth/w.canvas.width).toFixed(3)}`)),Ct.current=w,dt("\u542f\u52a8\u6e32\u67d3"),E.run(w),setTimeout((()=>{w.canvas&&(dt(`Canvas\u8fde\u63a5\u72b6\u6001: ${w.canvas.isConnected}`),i&&(dt("\u6267\u884c\u5f3a\u5236\u91cd\u7ed8"),w.canvas.style.display="none",w.canvas.offsetHeight,w.canvas.style.display="block"))}),500);const S=W.create();jt.current=S,dt("\u542f\u52a8\u7269\u7406\u6a21\u62df"),W.run(S,r);let $=!1;if("target"!==t&&"rising-tide"!==t&&($=Et()),$);else{const e=zt();ge(e)}vt.current||await Wt(),_t.current=!0,setTimeout((()=>{Gt()}),100);const C=e=>{if(St.current||!vt.current||!wt.current||!_t.current)return;const t=vt.current;switch(e.code){case"KeyA":case"ArrowLeft":if($t.current)return;$t.current=setInterval((()=>{vt.current&&wt.current&&vt.current.position.x-wt.current.radius>d&&R.setPosition(vt.current,{x:vt.current.position.x-1,y:vt.current.position.y})}),5);break;case"KeyD":case"ArrowRight":if($t.current)return;$t.current=setInterval((()=>{vt.current&&wt.current&&vt.current.position.x+wt.current.radius<p&&R.setPosition(vt.current,{x:vt.current.position.x+1,y:vt.current.position.y})}),5);break;case"KeyS":case"ArrowDown":L.set(t,!1),It(pt),St.current=!0,setTimeout((async()=>{await Wt(),St.current=!1}),1e3)}},_=e=>{switch(e.code){case"KeyA":case"KeyD":case"ArrowLeft":case"ArrowRight":$t.current&&(clearInterval($t.current),$t.current=null)}},k=r=>{r.pairs.forEach((r=>{const i=r.bodyA,s=r.bodyB;if("hammer"!==i.toolType&&"hammer"!==s.toolType)if("bomb"!==i.toolType&&"bomb"!==s.toolType){if(void 0!==i.index&&i.index===s.index&&i.index>=0){const a=i.index;if(a===Ft.length-1)return;N.remove(n,[i,s]);const l=Ft[a+1];if(!l)return;const c={label:l.name,render:{sprite:oe(`/${e}/${l.name}.png`,le(l.name))},index:a+1},u=I.circle(r.collision.supports[0].x,r.collision.supports[0].y,l.radius,c);if(N.add(n,u),"target"===t&&Je((e=>({...e,[l.name]:(e[l.name]||0)+1}))),Qe.current=!1,Ze.current&&(clearTimeout(Ze.current),Ze.current=null),ze((e=>{const r=e+1;return"target"===t&&Ue((e=>Math.max(e,r))),"item"===t&&Vt(r),r})),!ve.current&&ht.current)try{ht.current.src&&-1!==ht.current.src.indexOf("mergefruit.mp3")||(ht.current.src="/base/mergefruit.mp3",ht.current.load()),ht.current.currentTime=0;const e=ht.current.play();e&&e.catch((e=>{}))}catch(o){}const d=10*(a+1);let p=0;j((e=>(p=e+d,p))),Bt(p),"rising-tide"===t&&ot((e=>e+1))}if(!St.current&&("topLine"===i.name&&!1===s.isSleeping&&!1===s.isStatic||"topLine"===s.name&&!1===i.isSleeping&&!1===i.isStatic)){if(!("topLine"===i.name?s:i).isStatic){if(St.current=!0,"rising-tide"===t)return lt.current&&(clearInterval(lt.current),lt.current=null),ct.current&&(clearInterval(ct.current),ct.current=null),void(h&&setTimeout((()=>{h({waterLevel:Math.floor(rt/30),survivalTime:it,fruitsMerged:st}),It(xt)}),500));if(!ve.current&&xt.current)try{xt.current.src&&-1!==xt.current.src.indexOf("win.mp3")||(xt.current.src="/base/win.mp3",xt.current.load()),xt.current.currentTime=0;const e=xt.current.play();e&&e.catch((e=>{}))}catch(o){}be(!0)}}}
1else{const e="bomb"===i.toolType?i:s,t=e===i?s:i;if(!t.isStatic&&!t.isSpecialTool&&"Circle Body"!==t.label){if(!ve.current&&mt.current)try{mt.current.src&&-1!==mt.current.src.indexOf("win.mp3")||(mt.current.src="/base/win.mp3",mt.current.load()),mt.current.currentTime=0,mt.current.play().catch((e=>console.warn("\u70b8\u5f39\u97f3\u6548\u64ad\u653e\u5931\u8d25:",e)))}catch(o){}const t={x:e.position.x,y:e.position.y},r=a.rX.radius,i=[e];n.bodies.filter((t=>!t.isStatic&&!t.isSpecialTool&&"Circle Body"!==t.label&&t.id!==e.id)).forEach((e=>{Math.sqrt(Math.pow(e.position.x-t.x,2)+Math.pow(e.position.y-t.y,2))<=r&&i.push(e)})),qt(t.x,t.y,"booming.png",2*r),setTimeout((()=>{yt.current&&N.remove(yt.current.world,i)}),50)}}else{const e="hammer"===i.toolType?i:s,t=e===i?s:i;if(!t.isStatic&&!t.isSpecialTool&&"Circle Body"!==t.label){if(!ve.current&>.current)try{gt.current.src&&-1!==gt.current.src.indexOf("mergefruit.mp3")||(gt.current.src="/base/mergefruit.mp3",gt.current.load()),gt.current.currentTime=0,gt.current.play().catch((e=>console.warn("\u9524\u5934\u97f3\u6548\u64ad\u653e\u5931\u8d25:",e)))}catch(o){}qt(t.position.x,t.position.y,"booming.png",2.5*(t.circleRadius||30)),setTimeout((()=>{yt.current&&N.remove(yt.current.world,[e,t])}),50)}}}))};window.addEventListener("keydown",C),window.addEventListener("keyup",_),B.on(r,"collisionStart",k),kt.current=!0,setTimeout((()=>{Gt(),ie(!0)}),100)}catch(r){}};r()}()}),100);return()=>clearTimeout(r)}),[]),(0,i.useEffect)((()=>()=>{Ct.current&&E.stop(Ct.current),jt.current&&W.stop(jt.current),yt.current&&z.clear(yt.current),pt.current&&(pt.current=null),ht.current&&(ht.current=null),xt.current&&(xt.current=null),gt.current&&(gt.current=null),mt.current&&(mt.current=null),Ze.current&&(clearTimeout(Ze.current),Ze.current=null),kt.current=!1,_t.current=!1,Mt.current=!1,ie(!1)}),[]),(0,i.useEffect)((()=>{}),[fe,we]),(0,i.useEffect)((()=>{const e=()=>{const e=window.innerWidth,t=window.innerHeight,r=e<=768;ce(r);const n=ue||(r?32:40);if(r){const r=e/o,i=(t-n-30)/y.height;he(Math.min(.95,r,i))}else{const r=(e-40)/o,i=(t-n-40)/y.height;he(Math.min(1,r,i))}setTimeout(Gt,100)};let t;e();const r=()=>{clearTimeout(t),t=setTimeout(e,100)};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r),clearTimeout(t)}}),[Gt]),(0,i.useEffect)((()=>{const e=setTimeout((()=>{Gt()}),300);return()=>clearTimeout(e)}),[Gt]),(0,i.useEffect)((()=>{if(0===ue)return;(()=>{const e=window.innerWidth,t=window.innerHeight;if(e<=768){const r=e/o,n=(t-ue-30)/y.height;he(Math.min(.95,r,n))}else{const r=(e-40)/o,n=(t-ue-40)/y.height;he(Math.min(1,r,n))}})()}),[ue]),(0,n.jsxs)("div",{style:{width:"100%",height:`calc(100vh - ${ue}px)`,minHeight:"850px",display:"flex",flexDirection:"column",justifyContent:ae?"flex-start":"center",alignItems:"center",paddingTop:ae?"30px":"0",paddingBottom:ae?"10px":"0",position:"relative",overflow:"hidden",boxSizing:"border-box"},children:[P&&"classic"===t&&(0,n.jsxs)("div",{style:Y(pe),children:[(0,n.jsxs)(M.default,{href:`/${$}/mode-select`,style:{...Z(pe,"target"),backgroundColor:"rgba(148, 163, 184, 0.9)",minWidth:100*pe+"px"},title:m("mode_select_title"),onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("span",{children:"\ud83c\udfae"}),(0,n.jsx)("span",{children:m("mode_select_button")})]}),(0,n.jsxs)(M.default,{href:`/${$}/blitz`,style:Z(pe,"blitz"),title:m("mode_blitz_title"),onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("span",{children:"\u26a1"}),(0,n.jsx)("span",{children:m("blitz_button")})]}),(0,n.jsxs)(M.default,{href:`/${$}/daily`,style:Z(pe,"daily"),title:m("daily_challenge_title"),onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("span",{children:"\ud83d\udcc5"}),(0,n.jsx)("span",{children:m("daily_button")})]}),(0,n.jsxs)(M.default,{href:`/${$}/item`,style:Z(pe,"item"),title:m("mode_item_title"),onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("span",{children:"\ud83d\udd28"}),(0,n.jsx)("span",{children:m("item_button")})]}),(0,n.jsxs)(M.default,{href:`/${$}/rising-tide`,style:Z(pe,"rising-tide"),title:m("mode_rising_tide_title"),onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("span",{children:"\ud83c\udf0a"}),(0,n.jsx)("span",{children:m("rising_tide_button")})]}),(0,n.jsxs)(M.default,{href:`/${$}/target`,style:Z(pe,"target"),title:m("mode_target_title"),onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("span",{children:"\ud83c\udfaf"}),(0,n.jsx)("span",{children:m("target_button")})]})]}),P&&"daily"===t&&c&&(0,n.jsx)(T,{sequenceProgress:Ae,challengeData:{sequence:c,sequenceLength:c.length}}),P&&"target"===t&&x&&(0,n.jsxs)("div",{style:{backgroundColor:"rgba(66, 153, 225, 0.95)",color:"white",padding:`${8*pe}px ${15*pe}px`,borderRadius:8*pe+"px",marginBottom:5*pe+"px",boxShadow:`0px ${2*pe}px ${6*pe}px rgba(0,0,0,0.3)`,maxWidth:o*pe+"px",width:"100%"},children:[(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6*pe+"px"},children:[(0,n.jsxs)("span",{style:{fontSize:`${Math.max(14,16*pe)}px`,fontWeight:"bold"},children:[m("target_level")," ",x.id,": ",x.name]}),x.maxMoves&&(0,n.jsxs)("span",{style:{fontSize:`${Math.max(12,14*pe)}px`},children:[m("target_moves"),": ",Xe,"/",x.maxMoves]})]}),(0,n.jsx)("div",{style:{display:"flex",gap:10*pe+"px",flexWrap:"wrap"},children:x.targets.map(((t,r)=>(0,n.jsxs)("div",{style:{backgroundColor:"rgba(255, 255, 255, 0.2)",padding:`${4*pe}px ${8*pe}px`,borderRadius:4*pe+"px",fontSize:`${Math.max(12,14*pe)}px`,display:"flex",alignItems:"center",gap:4*pe+"px"},children:["collect"===t.type&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{children:[Ge[t.fruit]||0,"/",t.value]}),(0,n.jsx)("img",{src:`/${e}/${t.fruit}.png`,alt:t.fruit,style:{width:20*pe+"px",height:20*pe+"px"}}),(Ge[t.fruit]||0)>=t.value&&"\u2705"]}),"score"===t.type&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{children:[C,"/",t.value," ",m("target_points")]}),C>=t.value&&"\u2705"]}),"combo"===t.type&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{children:[Ke,"/",t.value," ",m("target_combo")]}),Ke>=t.value&&"\u2705"]})]},r)))})]}),(0,n.jsxs)("section",{ref:bt,style:{width:o*pe+"px",height:y.height*pe+"px",maxWidth:"100%",maxHeight:"100vh",position:"relative",curs
1or:P?"pointer":"default",marginBottom:"0px",backgroundColor:"rgba(246, 240, 233, 0.9)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",textAlign:"center",overflow:"visible",border:"2px solid #E6B143",borderRadius:"8px",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",userSelect:"none"},onClick:P?Nt:void 0,children:[!P&&(0,n.jsx)("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"#666",fontSize:`${Math.max(16,20*pe)}px`,margin:0,zIndex:1e3,pointerEvents:"none"},children:m("loadingGame")}),P&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:q(pe),children:C}),"blitz"===t&&(0,n.jsxs)("div",{style:ne(pe,ke),children:[Math.floor(ke/60),":",(ke%60).toString().padStart(2,"0")]}),xe&&(0,n.jsxs)("div",{style:V(pe,"blitz"===t),children:[(0,n.jsx)("span",{style:O(pe),children:m("next")}),(0,n.jsx)("img",{src:`/${e}/${xe.name}.png`,alt:`Next: ${xe.name}`,style:G(pe)})]}),(0,n.jsx)("div",{style:U(pe,"blitz"===t),onClick:Pt,title:m("resetGame"),children:(0,n.jsx)("svg",{width:Math.max(16,24*pe),height:Math.max(16,24*pe),viewBox:"0 0 24 24",fill:"white",children:(0,n.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})})}),(0,n.jsx)("div",{style:J(pe,"blitz"===t),onClick:Rt,title:m(fe?"unmute":"mute"),children:fe?(0,n.jsx)("svg",{width:Math.max(16,24*pe),height:Math.max(16,24*pe),viewBox:"0 0 24 24",fill:"white",children:(0,n.jsx)("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"})}):(0,n.jsx)("svg",{width:Math.max(16,24*pe),height:Math.max(16,24*pe),viewBox:"0 0 24 24",fill:"white",children:(0,n.jsx)("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})})}),"classic"===t&&(0,n.jsxs)("div",{style:K(pe),onClick:Dt,title:m("big_fruit_add"),children:[0===Ce&&m("big_fruit_add"),1===Ce&&(0,n.jsxs)(n.Fragment,{children:[m("big_fruit_add")," \ud83c\udf4e"]}),2===Ce&&(0,n.jsxs)(n.Fragment,{children:[m("big_fruit_add")," \ud83c\udf50"]}),3===Ce&&(0,n.jsxs)(n.Fragment,{children:[m("big_fruit_add")," \ud83c\udf51"]})]}),"item"===t&&(0,n.jsxs)("div",{style:Q(pe),children:[(0,n.jsxs)("div",{style:ee(pe),children:[(0,n.jsxs)("div",{style:te(pe,"hammer"===Le,Be>0),onClick:e=>Ht("hammer",e),title:m(Be>0?"tooltip_use_hammer":"tooltip_hammer_unavailable"),children:[(0,n.jsx)("span",{style:{fontSize:`${Math.max(16,20*pe)}px`},children:"\ud83d\udd28"}),(0,n.jsx)("span",{style:{fontSize:`${Math.max(10,12*pe)}px`,color:"#FFD700",fontWeight:"bold"},children:Be})]}),(0,n.jsxs)("div",{style:te(pe,"bomb"===Le,We>0),onClick:e=>Ht("bomb",e),title:m(We>0?"tooltip_use_bomb":"tooltip_bomb_unavailable"),children:[(0,n.jsx)("span",{style:{fontSize:`${Math.max(16,20*pe)}px`},children:"\ud83d\udca3"}),(0,n.jsx)("span",{style:{fontSize:`${Math.max(10,12*pe)}px`,color:"#FFD700",fontWeight:"bold"},children:We})]})]}),(0,n.jsxs)("div",{style:re(pe),children:[(0,n.jsx)("div",{style:{fontSize:`${Math.max(16,20*pe)}px`,color:"#FFD700",fontWeight:"bold",lineHeight:1},children:Re}),(0,n.jsx)("div",{style:{fontSize:`${Math.max(8,9*pe)}px`,opacity:.8,lineHeight:1,marginTop:1*pe+"px"},children:Re<5?5-Re+"\ud83d\udd28":Re<10?10-Re+"\ud83d\udca3":m("combo_active")})]})]}),we&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{style:X(pe),onClick:e=>{e.stopPropagation(),At()},title:m("test_game_over"),children:m("test_game_over")}),(0,n.jsxs)("div",{style:{position:"absolute",top:"260px",right:"20px",padding:"10px",backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",borderRadius:"5px",fontSize:"12px",zIndex:100,fontFamily:"monospace",maxWidth:"200px"},children:[(0,n.jsxs)("div",{children:["\u7f29\u653e\u6bd4\u4f8b: ",pe.toFixed(3)]}),(0,n.jsxs)("div",{suppressHydrationWarning:!0,children:["\u7a97\u53e3: ",`${window.innerWidth}\xd7${window.innerHeight}`]}),(0,n.jsxs)("div",{children:["Header\u9ad8\u5ea6: ",ue,"px"]}),(0,n.jsxs)("div",{suppressHydrationWarning:!0,children:["\u53ef\u7528\u9ad8\u5ea6: ",window.innerHeight-ue,"px"]}),(0,n.jsxs)("div",{children:["\u6e38\u620f: ",o,"\xd7",y.height]}),(0,n.jsxs)("div",{children:["\u663e\u793a: ",Math.round(o*pe),"\xd7",Math.round(y.height*pe)]}),(0,n.jsxs)("div",{children:["\u8bbe\u5907: ",ae?"\u79fb\u52a8\u7aef":"PC\u7aef"]})]})]}),"rising-tide"===t&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{position:"absolute",bottom:rt*pe+"px",left:0,right:0,height:"3px",backgroundColor:"#3498db",boxShadow:"0 0 10px rgba(52, 152, 219, 0.8)",transition:"bottom 1s ease-in-out",zIndex:98}}),(0,n.jsxs)("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:rt*pe+"px",backgroundColor:"rgba(28, 107, 160, 0.2)",backgroundImage:"\n linear-gradient(180deg, \n rgba(72, 202, 228, 0.6) 0%, \n rgba(28, 107, 160, 0.5) 30%,\n rgba(0, 119, 182, 0.4) 60%,\n rgba(0, 150, 199, 0.3) 100%)\n ",transition:"height 1s ease-in-out",zIndex:97,overflow:"hidden"},children:[(0,n.jsx)("div",{style:{position:"absolute",top:0,left:"-100%",width:"300%",height:"20px",background:"\n repeating-linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0.3) 0px,\
1n rgba(255, 255, 255, 0.5) 20px,\n rgba(255, 255, 255, 0.3) 40px,\n rgba(255, 255, 255, 0.1) 60px,\n rgba(255, 255, 255, 0.3) 80px\n )\n ",animation:"waveMove 8s linear infinite"}}),(0,n.jsx)("div",{style:{position:"absolute",top:"10px",left:"0",width:"300%",height:"15px",background:"\n repeating-linear-gradient(\n 90deg,\n rgba(173, 216, 230, 0.2) 0px,\n rgba(173, 216, 230, 0.4) 30px,\n rgba(173, 216, 230, 0.2) 60px,\n rgba(173, 216, 230, 0.1) 90px\n )\n ",animation:"waveMove 12s linear infinite reverse"}}),(0,n.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"100%",background:"\n radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.3) 0%, transparent 3%),\n radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.2) 0%, transparent 2%),\n radial-gradient(circle at 45% 88%, rgba(255, 255, 255, 0.25) 0%, transparent 2.5%),\n radial-gradient(circle at 80% 85%, rgba(255, 255, 255, 0.2) 0%, transparent 2%)\n ",animation:"bubbleFloat 15s ease-in-out infinite"}})]}),(0,n.jsxs)("div",{style:{position:"absolute",top:20*pe+"px",right:20*pe+"px",backgroundColor:"rgba(52, 152, 219, 0.95)",color:"white",padding:`${6*pe}px ${12*pe}px`,borderRadius:8*pe+"px",fontSize:`${Math.max(14,16*pe)}px`,fontWeight:"bold",zIndex:101,boxShadow:`0px ${2*pe}px ${6*pe}px rgba(0,0,0,0.3)`,display:"flex",flexDirection:"column",alignItems:"center",gap:4*pe+"px"},children:[(0,n.jsxs)("div",{children:["\ud83c\udf0a ",m("rising_tide_level"),": ",Math.floor(rt/30)]}),(0,n.jsxs)("div",{children:["\u23f1\ufe0f ",Math.floor(it/60),":",(it%60).toString().padStart(2,"0")]})]})]}),(0,n.jsx)(k,{score:C,onRestart:Lt,isVisible:me})]})]})]})}));ce.displayName="Game";var ue=ce}}]);
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.