1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[467],{467:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});var n=a(5155),o=a(2115),r=a(7548),i=a(8213),s=a(1175),l=a(4107),c=a(98),d=a(3557),h=a(5618),u=a(8812);let p={easy:{enemies:3,rageSpeed:6,triggerDist:20,tooClose:4.5},normal:{enemies:4,rageSpeed:7.15,triggerDist:26,tooClose:5.6},hard:{enemies:6,rageSpeed:8.6,triggerDist:30,tooClose:6.8}};function f(){let e=(0,o.useRef)(null),t=(0,o.useRef)(null),[a,f]=(0,o.useState)("idle"),[w,m]=(0,o.useState)(0),[x,g]=(0,o.useState)(0),[y,M]=(0,o.useState)(0),[b,v]=(0,o.useState)(100),[S,j]=(0,o.useState)(0),[T,k]=(0,o.useState)(!1),[N,P]=(0,o.useState)("normal"),[A,R]=(0,o.useState)(0),[I,q]=(0,o.useState)(0),[F,_]=(0,o.useState)(!1),[z,C]=(0,o.useState)(!0),[E,Y]=(0,o.useState)([]),V=(0,o.useRef)(0),J=(0,o.useRef)(()=>{}),{best:D,submit:L}=(0,d.g)("scp-096-maze"),G=(e,t)=>{let a=++V.current;Y(n=>[...n.slice(-2),{id:a,text:e,cls:t}]),window.setTimeout(()=>{Y(e=>e.filter(e=>e.id!==a))},1400)},B=(0,o.useRef)(G);B.current=G;let $=(0,o.useRef)(!1);$.current=T;let O=(0,o.useRef)("normal");O.current=N;let W=(0,o.useRef)(0),Z=(0,o.useRef)("idle"),H=(0,o.useRef)(0),U=(0,o.useRef)(0),K=(0,o.useRef)(0),X=(0,o.useRef)(100),Q=(0,o.useRef)(0),ee=(0,o.useRef)(()=>{}),et=(0,o.useRef)({forward:!1,back:!1,left:!1,right:!1,sprint:!1});Z.current=a,(0,o.useEffect)(()=>{let a=e.current;if(!a)return;let n=(0,c.cC)(a,{fov:58,clear:1581077,shadows:!0}),{scene:o,camera:d,render:w}=n;n.renderer.setPixelRatio(Math.min(window.devicePixelRatio||1,1.25)),n.renderer.setSize(a.clientWidth,a.clientHeight,!1),o.fog=new r.jUj(4280368,20,86);let x=new r.dth(0xcfe8ff,2101260,.85);o.add(x);let y=new r.ZyN(0xffead1,2.1);y.position.set(-18,28,12),y.castShadow=!0,y.shadow.mapSize.set(1024,1024),y.shadow.camera.left=-52,y.shadow.camera.right=52,y.shadow.camera.top=52,y.shadow.camera.bottom=-52,y.shadow.camera.far=90,o.add(y);let b=new r.HiM(0xef4444,1.2,22,2.4);o.add(b);let S=new r.YJl,T=new r.YJl,N=new r.YJl;o.add(S,T,N);let P=function(){let e=new r.YJl,t=new r._4j({color:0xf59e0b,roughness:.56,metalness:.05}),a=new r._4j({color:1187891,emissive:959977,emissiveIntensity:.18,roughness:.3}),n=new r.eaF(new r.qU7(.28,.7,5,10),t);n.position.y=.94,n.castShadow=!0,e.add(n);let o=new r.eaF(new r.Gu$(.24,16,12),t);o.position.y=1.5,o.castShadow=!0,e.add(o);let i=new r.eaF(new r.iNn(.28,.12,.035),a);i.position.set(0,1.52,.22),e.add(i);let s=new r.eaF(new r.iNn(.36,.48,.16),new r._4j({color:3359061,roughness:.7}));return s.position.set(0,.98,-.27),s.castShadow=!0,e.add(s),e}();o.add(P);let A=new r.nCl(0xbfefff,2.2,19,.48,.62,1.3);A.castShadow=!1;let I=new r.B69;o.add(A,I),A.target=I;let F=(0,c.ER)(8,256,(e,t,a)=>{let n=e.createLinearGradient(0,0,0,a);n.addColorStop(0,"#6f804c"),n.addColorStop(.38,"#a7a779"),n.addColorStop(1,"#d8b08d"),e.fillStyle=n,e.fillRect(0,0,t,a)}),z=new r.eaF(new r.Gu$(180,32,18),new r.V9B({map:F,side:r.hsX,fog:!1}));o.add(z);let E=new r.eaF(new r.tcD(220,48),new r._4j({color:4015152,roughness:1}));E.rotation.x=-Math.PI/2,E.position.y=-.06,E.receiveShadow=!0,o.add(E);let Y=new r._4j({color:3024416,roughness:.95}),V=new r._4j({color:5659730,roughness:.9}),D=new r.Ho_(.12,.32,5.5,6),G=new r.Ho_(.04,.1,2.4,5),ea=new r.nEu(.8,0),en=new r.iNn(.9,3.4,.5),eo=u.Z*u.JA/2;
1for(let e=0;e<42;e++){let t=e/42*Math.PI*2+.3*Math.random(),a=eo+5+36*Math.random(),n=new r.YJl,i=new r.eaF(D,Y);i.position.y=2.5,i.rotation.z=(Math.random()-.5)*.24,i.castShadow=!0,n.add(i);let s=2+(3*Math.random()|0);for(let e=0;e<s;e++){let e=new r.eaF(G,Y);e.position.set((Math.random()-.5)*.7,3+2.2*Math.random(),(Math.random()-.5)*.7),e.rotation.set((Math.random()-.5)*1.6,Math.random()*Math.PI*2,.5+.9*Math.random()),e.castShadow=!0,n.add(e)}n.position.set(Math.cos(t)*a,0,Math.sin(t)*a),n.scale.setScalar(.7+.8*Math.random()),o.add(n)}for(let e=0;e<26;e++){let e=Math.random()*Math.PI*2,t=eo+3+40*Math.random(),a=new r.eaF(ea,V);a.position.set(Math.cos(e)*t,.3,Math.sin(e)*t),a.scale.set(.5+Math.random(),.35+.6*Math.random(),.5+Math.random()),a.rotation.set(Math.random(),Math.random(),Math.random()),a.castShadow=!0,o.add(a)}for(let e=0;e<9;e++){let t=e/9*Math.PI*2+.4,a=eo+10+22*Math.random(),n=new r.eaF(en,V);n.position.set(Math.cos(t)*a,1.4,Math.sin(t)*a),n.rotation.set((Math.random()-.5)*.3,Math.random()*Math.PI,(Math.random()-.5)*.35),n.castShadow=!0,o.add(n)}let er=(0,c.ER)(256,256,(e,t,a)=>{e.fillStyle="#9c5d45",e.fillRect(0,0,t,a);for(let n=0;n<a;n+=32){let a=40*(n/32%2!=0);e.fillStyle="#78412f",e.fillRect(0,n+28,t,4);for(let o=-a;o<t;o+=80)e.fillRect(o,n,4,32)}for(let n=0;n<900;n++){let n=80+Math.floor(70*Math.random());e.fillStyle="rgba(".concat(n+45,", ").concat(n,", ").concat(n-20,", 0.22)"),e.fillRect(Math.random()*t,Math.random()*a,2,2)}},1.6,1.6),ei=(0,c.ER)(256,256,(e,t,a)=>{e.fillStyle="#6f6a58",e.fillRect(0,0,t,a);for(let n=0;n<5500;n++){let n=72+Math.floor(48*Math.random());e.fillStyle="rgba(".concat(n,", ").concat(n,", ").concat(n-8,", 0.28)"),e.fillRect(Math.random()*t,Math.random()*a,2,2)}e.strokeStyle="rgba(35, 30, 25, 0.18)";for(let n=0;n<t;n+=32)e.beginPath(),e.moveTo(n,0),e.lineTo(n,a),e.stroke();for(let n=0;n<a;n+=32)e.beginPath(),e.moveTo(0,n),e.lineTo(t,n),e.stroke()},12,12),es=new r.eaF(new r.bdM(u.Z*u.JA,u.Z*u.JA),new r._4j({map:ei,roughness:.96}));es.rotation.x=-Math.PI/2,es.position.y=-.02,es.receiveShadow=!0,S.add(es);let el=new r._4j({map:er,roughness:.88,metalness:.01}),ec=new r._4j({color:2278750,emissive:1483594,emissiveIntensity:.8,roughness:.45}),ed=new r._4j({color:0xef4444,emissive:0x991b1b,emissiveIntensity:.6,roughness:.45}),eh=new r.eaF(new r.O3Y(.95,.09,12,44),ed);eh.rotation.x=Math.PI/2,eh.position.y=.12,eh.castShadow=!0,N.add(eh);let eu=new r.iNn(.1,.34,.1),ep=new r.Gu$(.13,10,8),ef=new r._4j({color:2893344,roughness:.8}),ew=[0,1,2].map(()=>new r._4j({color:0xffc873,emissive:0xff9b3d,emissiveIntensity:1.4,roughness:.4})),em=(0,c.ER)(128,128,(e,t,a)=>{e.clearRect(0,0,t,a);for(let t=0;t<3;t++){let t=14+30*Math.random(),a=12+26*Math.random();for(let n=0;n<4;n++)e.strokeStyle="rgba(".concat(86+30*Math.random(),", 24, 20, ").concat(.5+.3*Math.random(),")"),e.lineWidth=2.5+2*Math.random(),e.beginPath(),e.moveTo(t+9*n,a),e.quadraticCurveTo(t+9*n+18,a+40,t+9*n+26,a+78+16*Math.random()),e.stroke()}}),ex=new r.V9B({map:em,transparent:!0,opacity:.85,depthWrite:!1}),eg=new r.bdM(1.7,1.7),ey=new r.Gu$(.16,8,6),eM=new r.ypk;eM.moveTo(0,.07),eM.quadraticCurveTo(.24,.11,.46,.02),eM.lineTo(.43,-.03),eM.quadraticCurveTo(.22,-.13,0,-.09),eM.closePath();let eb=new r.MSw(eM,8);eb.rotateX(-Math.PI/2);let ev=new r.bdM(.14,.26);ev.translate(0,.13,0),ev.rotateX(-Math.PI/2+.2);let eS=new r._4j({color:1119e3,roughness:.8,side:r.$EB}),ej=new r.qFE(.035,.12,6),eT=new r._4j({color:0xcf9f3f,roughness:.6}),ek=[],eN=new r.YJl;o.add(eN);for(let e=0;e<6;e++){let e=new r.YJl,t=new r.eaF(ey,eS);t.scale.set(.8,1,1.3);let a=new r.eaF(ej,eT);a.rotation.x=Math.PI/2,a.position.set(0,.04,.24);let n=new r.eaF(eb,eS);n.position.set(.1,.08,.02);let o=new r.eaF(eb,eS);o.position.set(-.1,.08,.02),o.scale.x=-1;let i=new r.eaF(ev,eS);i.position.set(0,.06,-.16),e.add(t,a,o,n,i),eN.add(e),ek.push({g:e,wl:o,wr:n,flying:!1,vel:new r.Pq0,t:0,idleT:1+3*Math.random(),gesture:0,kind:0,targetYaw:0})}let eP=new r.qU7(.07,.2,4,8),eA=new r.Ho_(.012,.02,.26,5),eR=new r._4j({color:4011568,roughness:.9}),eI=[];for(let e=0;e<4;e++){let e=new r.YJl,t=new r.eaF(eP,eR);t.rotation.x=Math.PI/2,t.position.y=.09;let a=new r.eaF(eA,eR);a.rotation.x=Math.PI/2,a.position.set(0,.08,-.22),e.add(t,a),e.visible=!1,o.add(e),eI.push({g:e,vel:new r.I9Y,life:0})}let eq={pos:(0,u.S)({c:1,r:1}),yaw:Math.PI/4,stamina:100},eF=(0,u.bP)(),e_=[],ez=[],eC=0,eE=0,eY=performance.now(),eV=0,eJ=!1,eD=!1,eL=!1,eG=p[O.current],eB=new URLSearchParams(window.location.search).has("preview"),e$=new Set,eO=null,eW=!1,eZ=null,eH=()=>{try{null!=eZ||(eZ=new(window.AudioContext||window.webkitAudioContext)),"suspended"===eZ.state&&eZ.resume()}catch(e){return null}return eZ},eU=(e,t,a)=>{if((0,s.qq)())return;let n=eH();if(!n)return;let o=n.currentTime,r=n.createOscillator(),i=n.createGain();r.type="sine",r.frequency.setValueAtTime(e,o),r.frequency.exponentialRampToValueAtTime(Math.max(20,.4*e),o+t),i.gain.setValueAtTime(1e-4,o),i.gain.exponentialRampToValueAtTime(a,o+.02),i.gain.exponentialRampToValueAtTime(1e-4,o+t),r.connect(i).c
1onnect(n.destination),r.start(o),r.stop(o+t+.05)},eK=null,eX=()=>{if((0,s.qq)()||eK)return;let e=eH();if(!e)return;let t=e.createOscillator();t.type="sawtooth",t.frequency.value=55;let a=e.createOscillator();a.type="sine",a.frequency.value=82.5;let n=e.createBiquadFilter();n.type="lowpass",n.frequency.value=220;let o=e.createGain();o.gain.value=.035;let r=e.createOscillator();r.frequency.value=.12;let i=e.createGain();i.gain.value=.02,r.connect(i).connect(o.gain),t.connect(n),a.connect(n),n.connect(o).connect(e.destination),t.start(),a.start(),r.start(),eK={osc:t,osc2:a,lfo:r}},eQ=()=>{if(eK){try{eK.osc.stop(),eK.osc2.stop(),eK.lfo.stop()}catch(e){}eK=null}},e0=()=>{if((0,s.qq)())return;let e=eH();if(!e)return;let t=e.currentTime;for(let a of[440,560,685]){let n=e.createOscillator();n.type="sawtooth",n.frequency.setValueAtTime(1.7*a,t),n.frequency.exponentialRampToValueAtTime(.5*a,t+.95);let o=e.createGain();o.gain.setValueAtTime(1e-4,t),o.gain.exponentialRampToValueAtTime(.16,t+.05),o.gain.exponentialRampToValueAtTime(1e-4,t+1),n.connect(o).connect(e.destination),n.start(t),n.stop(t+1.05)}let a=Math.floor(.9*e.sampleRate),n=e.createBuffer(1,a,e.sampleRate),o=n.getChannelData(0);for(let e=0;e<a;e++)o[e]=(2*Math.random()-1)*(1-e/a);let r=e.createBufferSource();r.buffer=n;let i=e.createBiquadFilter();i.type="bandpass",i.frequency.value=1300;let l=e.createGain();l.gain.value=.12,r.connect(i).connect(l).connect(e.destination),r.start(t)},e1=()=>{if((0,s.qq)())return;let e=eH();e&&[523,659,784,1047].forEach((t,a)=>{let n=e.currentTime+.09*a,o=e.createOscillator();o.type="triangle",o.frequency.value=t;let r=e.createGain();r.gain.setValueAtTime(1e-4,n),r.gain.exponentialRampToValueAtTime(.13,n+.02),r.gain.exponentialRampToValueAtTime(1e-4,n+.5),o.connect(r).connect(e.destination),o.start(n),o.stop(n+.55)})},e2=0,e5=1/0,e4=!1,e3=16,e8=0,e6=0,e9=3,e7=6,te=!1,tt=function(e,t,a){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"lowpass";if((0,s.qq)())return;let o=eH();if(!o)return;let r=Math.max(1,Math.floor(o.sampleRate*t)),i=o.createBuffer(1,r,o.sampleRate),l=i.getChannelData(0);for(let e=0;e<r;e++)l[e]=(2*Math.random()-1)*(1-e/r);let c=o.createBufferSource();c.buffer=i;let d=o.createBiquadFilter();d.type=n,d.frequency.value=e;let h=o.createGain();h.gain.value=a,c.connect(d).connect(h).connect(o.destination),c.start()},ta=(e,t)=>{for(let a=0;a<30;a++){let a=eF.open[Math.floor(Math.random()*eF.open.length)],n=(0,u.S)(a);if(t&&14>t.distanceTo(n))continue;let o=[{c:a.c+1,r:a.r},{c:a.c-1,r:a.r},{c:a.c,r:a.r+1},{c:a.c,r:a.r-1}].filter(e=>(0,u.f$)(eF.rows,e.c,e.r));if(!o.length)continue;let r=(0,u.S)(o[Math.floor(Math.random()*o.length)]);e.g.position.set(r.x,u.o8+.22,r.y),e.g.rotation.y=Math.random()*Math.PI*2,e.g.visible=!0,e.flying=!1,e.t=0;return}e.g.visible=!1},tn=null,to=0,tr=e=>{for(let t of[...e.children])e.remove(t)},ti=()=>{tr(S),S.add(es);let e=[];for(let t=0;t<u.Z;t++)for(let a=0;a<u.Z;a++)"#"===eF.rows[t][a]&&e.push({c:a,r:t});let t=new r.iNn(u.JA,u.o8,u.JA),a=new r.ZLX(t,el,e.length);a.castShadow=!0,a.receiveShadow=!0;let n=new r.kn4;e.forEach((e,t)=>{let o=(0,u.S)(e);n.makeTranslation(o.x,u.o8/2-.04,o.y),a.setMatrixAt(t,n)}),a.instanceMatrix.needsUpdate=!0,S.add(a);let o=new r._4j({color:0xb06a4f,roughness:.78}),i=new r.iNn(.96*u.JA,.14,.96*u.JA),s=new r.ZLX(i,o,e.length);s.castShadow=!1,e.forEach((e,t)=>{let a=(0,u.S)(e);n.makeTranslation(a.x,u.o8+.02,a.y),s.setMatrixAt(t,n)}),s.instanceMatrix.needsUpdate=!0,S.add(s);let l=0,c=0;for(let e of(0,u.yb)(eF.open)){if(l>=16&&c>=12)break;let t=(0,u.S)(e),a=[{c:1,r:0,yaw:-Math.PI/2},{c:-1,r:0,yaw:Math.PI/2},{c:0,r:1,yaw:Math.PI},{c:0,r:-1,yaw:0}].filter(t=>(0,u.f$)(eF.rows,e.c+t.c,e.r+t.r));if(!a.length)continue;let n=a[Math.floor(Math.random()*a.length)];if(l<16){let e=new r.YJl,a=new r.eaF(eu,ef),o=new r.eaF(ep,ew[l%ew.length]);o.position.y=.12,e.add(a,o),e.position.set(t.x+n.c*(u.JA/2-.06),2.05,t.y+n.r*(u.JA/2-.06)),S.add(e),l++}else{let e=new r.eaF(eg,ex);e.position.set(t.x+n.c*(u.JA/2-.03),1.2+.6*Math.random(),t.y+n.r*(u.JA/2-.03)),e.rotation.y=n.yaw,e.rotation.z=(Math.random()-.5)*.5,S.add(e),c++}}},ts=()=>{tr(N),N.add(eh),e_=eF.cards.map(e=>{let t=function(){let e=new r.YJl,t=new r.eaF(new r.iNn(.7,.08,.48),new r._4j({color:3718648,emissive:223649,emissiveIntensity:.7,roughness:.36}));t.castShadow=!0,e.add(t);let a=new r.eaF(new r.iNn(.28,.1,.18),new r.V9B({color:0xe0f2fe}));return a.position.y=.06,e.add(a),e.position.y=.22,e}(),a=(0,u.S)(e);return t.position.x=a.x,t.position.z=a.y,N.add(t),{cell:e,mesh:t,taken:!1}});let e=(0,u.S)(eF.exit);eh.position.x=e.x,eh.position.z=e.y},tl=()=>{tr(T),ez=eF.enemies.slice(0,eG.enemies).map((e,t)=>{let a,n,o,i=function(){let e=new r.HiM(0xff2a2a,0,8,2.2);return e.position.set(0,1.9,.4),e}(),s=function(){let e=new r.eaF(new r.Gu$(1.05,18,12),new r.V9B({color:0xff1f2d,transparent:!0,opacity:0,blending:r.EZo,depthWrite:!1}));return e.position.y=1.45,e.scale.set(.78,1.5,.78),e}();if(eO)a=(o=(0,h.HC)(eO)).group,o.play(h.lo.walk,.001),o.mixer.update(1.5*Math.random());else{let e=function(e){let t=new r.YJl,a=new r._4j({color:e%2?0xcfaea3
1:0xd8c1b7,roughness:.82,metalness:.02}),n=new r._4j({color:7030594,roughness:.9}),o=new r._4j({color:591368,roughness:.7}),i=new r._4j({color:0xfff1f2,emissive:0xef4444,emissiveIntensity:.35}),s=new r._4j({color:0xf8fafc,roughness:.28}),l=new r.V9B({color:0xff1f2d,transparent:!0,opacity:0,blending:r.EZo,depthWrite:!1}),c=new r.eaF(new r.qU7(.26,1.18,8,14),a);c.position.y=1.24,c.scale.set(.78,1.15,.46),c.castShadow=!0,t.add(c);let d=new r.eaF(new r.iNn(.82,.12,.24),n);d.position.set(0,1.78,.01),d.castShadow=!0,t.add(d);for(let e=0;e<4;e++){let a=new r.eaF(new r.iNn(.46-.045*e,.035,.035),n);a.position.set(0,1.5-.17*e,.17),a.castShadow=!0,t.add(a)}let h=new r.eaF(new r.Gu$(.33,24,18),a);h.position.set(0,2.23,.1),h.scale.set(.76,1.46,.72),h.castShadow=!0,t.add(h);let u=new r.eaF(new r.iNn(.34,.055,.04),n);u.position.set(0,2.33,.31),t.add(u);let p=new r.Gu$(.075,10,8);for(let e of[-.105,.105]){let a=new r.eaF(p,o);a.position.set(e,2.26,.34),a.scale.set(1.1,.78,.32),t.add(a)}let f=new r.Gu$(.045,8,8),w=[-.09,.09].map(e=>{let a=new r.eaF(f,i);return a.position.set(e,2.27,.38),t.add(a),a}),m=new r.eaF(new r.Gu$(.105,14,10),o);for(let e of(m.position.set(0,2.08,.38),m.scale.set(.72,2.05,.26),t.add(m),[-.045,.045])){let a=new r.eaF(new r.iNn(.022,.11,.02),s);a.position.set(e,2.1,.43),t.add(a)}let x=new r.Ho_(.045,.066,1.62,8),g=new r.Ho_(.055,.076,1.4,8),y=new r.eaF(x,a);y.position.set(-.52,1.04,.06),y.rotation.z=-.12,y.castShadow=!0,t.add(y);let M=new r.eaF(x,a);M.position.set(.52,1.04,.06),M.rotation.z=.12,M.castShadow=!0,t.add(M);let b=new r.eaF(g,a);b.position.set(-.18,.42,0),b.castShadow=!0,t.add(b);let v=new r.eaF(g,a);v.position.set(.18,.42,0),v.castShadow=!0,t.add(v);let S=[];for(let e of[-1,1])for(let a=0;a<3;a++){let n=new r.eaF(new r.qFE(.026,.26,7),s);n.position.set(e*(.48+.04*a),.16,.24+.025*a),n.rotation.x=.66*Math.PI,n.rotation.z=.22*e,n.castShadow=!0,S.push(n),t.add(n)}let j=new r.eaF(new r.Gu$(1.05,18,12),l);j.position.y=1.45,j.scale.set(.78,1.5,.78),t.add(j);let T=new r.HiM(0xff2a2a,0,8,2.2);return T.position.set(0,1.9,.4),t.add(T),t.scale.setScalar(1.25),{group:t,parts:{torso:c,head:h,leftArm:y,rightArm:M,leftLeg:b,rightLeg:v,mouth:m,eyes:w,claws:S,aura:j,rageLight:T}}}(t);a=e.group,n=e.parts}a.add(i,s);let l=(0,u.S)(e);return a.position.set(l.x,0,l.y),T.add(a),{pos:l.clone(),cell:e,group:a,parts:n,model:o,rageLight:i,aura:s,yaw:Math.random()*Math.PI*2,renderYaw:Math.random()*Math.PI*2,target:null,previous:null,rage:0,distress:0,pathCooldown:0,phase:Math.random()*Math.PI*2,chaseMin:999}})},tc=()=>{if(!eB||!ez.length)return;let e=eF.start,t=Math.sin(eq.yaw),a=Math.cos(eq.yaw),n=e;for(let o=3;o>=1;o--){let r=Math.round(e.c+t*o),i=Math.round(e.r+a*o);if(!(0,u.f$)(eF.rows,r,i)){n={c:r,r:i};break}}if(n===e){for(let t of[{c:e.c+1,r:e.r+1},{c:e.c+1,r:e.r},{c:e.c,r:e.r+1}])if(!(0,u.f$)(eF.rows,t.c,t.r)){n=t;break}}let o=ez[0],r=(0,u.S)(n);o.pos.set(r.x,r.y),o.cell={c:n.c,r:n.r},o.rage=9999,o.distress=0,o.renderYaw=eq.yaw+Math.PI,eq.yaw=Math.atan2(r.x-eq.pos.x,r.y-eq.pos.y);for(let e=1;e<ez.length;e++)ez[e].pos.set(9999,9999)},td=()=>{eH(),eG=p[O.current],eF=(0,u.bP)(),ti(),ts(),tl(),eX();let e=(0,u.S)(eF.start);for(let t of(eq.pos.copy(e),eq.yaw=Math.PI/4,eq.stamina=100,eL=!1,U.current=0,H.current=0,X.current=100,K.current=0,Q.current=0,eC=performance.now(),eJ=!1,g(0),m(0),M(0),v(100),j(0),f("running"),Z.current="running",(0,s._O)("tap"),ek))ta(t,eq.pos);for(let e of eI)e.g.visible=!1;e7=6,e3=12+10*Math.random(),tc()},th=(e,t)=>{if(eJ)return;eJ=!0;let a=Q.current,n="won"===e?2500+Math.max(0,Math.round(5e3-25*a)):0;if(H.current+=n,m(H.current),f(e),Z.current=e,L(H.current),(0,l.q7)("scp-096-maze",H.current),(0,s._O)("won"===e?"win":"lose"),"won"===e&&(0,i.Q)(),eQ(),"over"===e&&t){var o;tn=t,to=performance.now(),null==(o=t.model)||o.play(h.lo.scream,.08),t.model&&(t.model.mixer.timeScale=1),e0()}};ee.current=td;let tu=(e,t)=>{let a;if(eB){let t=eq.pos.x-e.pos.x,a=eq.pos.y-e.pos.y;if(2.6>Math.hypot(t,a)){e.yaw=Math.atan2(t,a),e.cell=(0,u.Ew)(e.pos);return}}let n=e.rage>0&&(0,u.RA)(eF.rows,e.pos,eq.pos);if(n)a=eq.pos;else{var o;let n=(0,u.Ew)(eq.pos);if(e.rage>0){if(e.pathCooldown-=t,!e.target||e.pathCooldown<=0){let t=(0,u.Hh)(eF.rows,e.cell,n);e.target=null!=(o=t[1])?o:n,e.pathCooldown=.18+.08*Math.random()}}else(!e.target||(0,u.ne)(e.cell,e.target))&&(e=>{var t;let a=(0,u.CY)(eF.rows,e.cell).filter(t=>!e.previous||!(0,u.ne)(t,e.previous)),n=a.length>0?a:(0,u.CY)(eF.rows,e.cell);e.target=null!=(t=n[Math.floor(Math.random()*n.length)])?t:e.cell})(e);if(!e.target){e.cell=(0,u.Ew)(e.pos);return}a=(0,u.S)(e.target)}let i=a.clone().sub(e.pos),s=i.length();if(!n&&e.target&&s<.08){e.previous=e.cell,e.cell=e.target,e.pos.copy(a),e.target=null;return}if(s<1e-4)return;let l=i.multiplyScalar(1/s),c=Math.min((e.rage>0?eG.rageSpeed:1.35)*t,s),d=e.pos.clone().addScaledVector(l,c);if((0,u.f2)(eF.rows,d,.44))e.pos.copy(d);else{let t=new r.I9Y(e.pos.x+l.x*c,e.pos.y),a=new r.I9Y(e.pos.x,e.pos.y+l.y*c);(0,u.f2)(eF.rows,t,.44)?e.pos.copy(t):(0,u.f2)(eF.rows,a,.44)?e.pos.copy(a):n||(e.target=null)}e.yaw=Math.atan2(l.x,l.y),e.cell=(0,u.Ew)(e.pos)},tp=(e,t)=>{let a=e.pos.clone().sub(eq.pos),n=a.length();if(n>eG.triggerDist)return!1;let o=a.multiplyScalar(1/Math.max(n,1e-4)),r=t.dot(o)>.74,i=n<eG.tooClose;return!!((r||i)&&(0,u.RA)(eF.rows,eq.pos,e.pos))&&(e.rage<=.05&&(e.distress=1,e0()),e.rage=Math.max(e.rage,i?8.5:12.5),!0)},tf=0,tw=e=>{let t=new r.Pq0(Math.sin(eq.yaw),0,Math.cos(eq.yaw)),a=+(K.current>0),n=+!!eD;if($.current){P.visible=!1,tf+=e*(n?13:8);let o=(n?.09:.05)*Math.sin(tf),i=new r.Pq0(eq.pos.x,1.6+o,eq.pos.y);a>0&&(i.x+=.05*Math.sin(performance.now()/30),i.z+=.05*Math.cos(performance.now()/34)),d.fov+=((a>0?82:n>0?78:74)-d.fov)*(1-Math.exp(-(8*e))),d.updateProjectionMatrix(),d.position.lerp(i,1-Math.exp(-(24*e))),d.lookAt(i.clone().addScaledVector(t,6));return}P.visible=!0;let o=new r.Pq0(eq.pos.x,1.18,eq.pos.y),i=o.clone().addScaledVector(t,-7-1.1*n).add(new r.Pq0(0,5.8-.5*n,0));a>0&&(i.x+=.08*Math.sin(performance.now()/38),i.z+=.08*Math.cos(performance.now()/43)),d.fov+=((a>0?72:n>0?66:58)-d.fov)*(1-Math.exp(-(7*e))),d.updateProjectionMatrix(),d.position.lerp(i,1-Math.exp(-(7.5*e))),d.lookAt(o.addScaledVector(t,3.8+.8*n))},tm=(u.Z-1)/2,tx=0,tg=e=>{eE=requestAnimationFrame(tg);let a=e-eY;if(a<15.5)return;let n=Math.min(a/1e3,.033);eY=e;let o=e/1e3;if(e4)return void w();if("running"===Z.current){var i;for(let e of((e=>{let t=e$.has("ArrowLeft")||e$.has("KeyA")||et.current.left,a=e$.has("ArrowRight")||e$.has("KeyD")||et.current.right,n=e$.has("ArrowUp")||e$.has("KeyW")||et.current.forward,o=e$.has("ArrowDown")||e$.has("KeyS")||et.current.back,i=e$.has("ShiftLeft")||e$.has("ShiftRight")||et.current.sprint;eq.yaw+=(!!t-!!a)*e*(eD?3.35:3);let s=!!n-.65*!!o;te=0!==s,eq.stamina<=.5?eL=!0:eq.stamina>30&&(eL=!1);let l=s>0&&i&&!eL;eD=l;let c=l?K.current>0?9.8:8.6:3.65;if(l?eq.stamina=Math.max(0,eq.stamina-17*e):eq.stamina=Math.min(100,eq.stamina+21*e),0!==s){let t=new r.I9Y(Math.sin(eq.yaw),Math.cos(eq.yaw)),a=eq.pos.clone().addScaledVector(t,c*s*e),n=new r.I9Y(a.x,eq.pos.y),o=new r.I9Y(eq.pos.x,a.y);(0,u.f2)(eF.rows,a,.46)?eq.pos.copy(a):(0,u.f2)(eF.rows,n,.46)?eq.pos.copy(n):(0,u.f2)(eF.rows,o,.46)&&eq.pos.copy(o)}X.current=Math.round(eq.stamina)})(n),e_)){if(e.taken)continue;e.mesh.rotation.y=1.8*o,e.mesh.position.y=.34+.08*Math.sin(4*o+e.cell.c);let t=(0,u.S)(e.cell);1.05>eq.pos.distanceTo(t)&&(e.taken=!0,e.mesh.visible=!1,U.current+=1,H.current+=1e3,g(U.current),m(H.current),L(H.current),(0,s._O)("score"),B.current("\uD83E\uDEAA KEYCARD +1000","text-sky-300"),3===U.current&&(e1(),B.current("\uD83D\uDD13 EXIT UNLOCKED","text-emerald-300")))}eh.material=U.current>=3?ec:ed,eh.rotation.z=.8*o,eh.scale.setScalar(1+.06*Math.sin(4*o));let t=(0,u.S)(eF.exit);if(U.current>=3&&1.25>eq.pos.distanceTo(t)&&th("won"),((e,t)=>{let a=new r.I9Y(Math.sin(eq.yaw),Math.cos(eq.yaw));P.position.set(eq.pos.x,0,eq.pos.y),P.rotation.y=eq.yaw,A.position.set(eq.pos.x,1.35,eq.pos.y),I.position.set(eq.pos.x+5*a.x,1.1,eq.pos.y+5*a.y),b.position.set(eq.pos.x,2.2,eq.pos.y),A.intensity=2.2*(K.current>0?.84+.12*Math.sin(20*t):1);let n=0;for(let o of(e5=1/0,ez)){if(tp(o,a),o.rage>0){let t=(0,u.RA)(eF.rows,o.pos,eq.pos);o.rage=Math.max(0,o.rage-e*(t?.35:1.6)),n+=1,o.chaseMin=Math.min(o.chaseMin,o.pos.distanceTo(eq.pos)),0===o.rage&&(o.chaseMin<10&&"running"===Z.current&&(H.current+=250,m(H.current),B.current("\uD83E\uDEE5 LOST IT +250","text-emerald-300"),(0,s._O)("clear")),o.chaseMin=999)}o.distress>0?(o.distress-=e,o.yaw=Math.atan2(eq.pos.x-o.pos.x,eq.pos.y-o.pos.y)):tu(o,e);let i=o.rage>0?r.cj9.clamp(o.rage/3.5,0,1):0;o.phase+=e*(i>0?16:4.5);let l=i>0?12:7,c=o.yaw-o.renderYaw;if(c=Math.atan2(Math.sin(c),Math.cos(c)),o.renderYaw+=c*Math.min(1,e*l),o.model){let a=o.distress>0,n=i>0&&!a;for(let r of(o.model.play(a?h.lo.scream:n?h.lo.run:h.lo.walk),o.model.mixer.timeScale=a?1:n?1.15:.8,o.model.mixer.update(e),o.model.materials))r.emissive.setHex(0xb1141d),r.emissiveIntensity=i>0?.55+.3*Math.sin(18*t):0;o.group.rotation.y=o.renderYaw+0}else if(o.parts){let e=o.parts,a=Math.sin(o.phase),n=.05*Math.sin(23*t+o.phase);for(let o of(e.torso.rotation.x=-.18*i,e.torso.rotation.z=n+a*(i>0?.08:.025),e.head.rotation.x=-.14*i+n,e.head.rotation.z=-(1.4*n),e.leftArm.rotation.x=i>0?-.95+.52*a:.18*a,e.rightArm.rotation.x=i>0?-.95-.52*a:-(.18*a),e.leftArm.rotation.z=-.25-.42*i,e.rightArm.rotation.z=.25+.42*i,e.leftLeg.rotation.x=-a*(i>0?.7:.24),e.rightLeg.rotation.x=a*(i>0?.7:.24),e.mouth.scale.set(.72,i>0?2.95:1.75,.26),e.eyes))o.material.emissiveIntensity=i>0?2.2+.5*Math.sin(18*t):.35;o.group.rotation.y=o.renderYaw}o.aura.material.opacity=i>0?.1+.04*Math.sin(11*t):0,o.aura.scale.setScalar(1+.38*i+.04*Math.sin(9*t)),o.rageLight.intensity=i>0?3.2+.8*Math.sin(15*t):0,o.group.position.set(o.pos.x,0,o.pos.y),o.group.position.y=Math.sin(t*(i>0?18:7)+o.phase)*(i>0?.07:.025);let d=o.pos.distanceTo(eq.pos);i>0&&(e5=Math.min(e5,d)),!eB&&i>0&&o.distress<=0&&d<1.2&&th("over",o)}K.current=n})(n,o),tw(n),K.current>0||e5<12){if((e2-=n)<=0){let e=r.cj9.clamp(1-e5/16,.15,1);eU(58,.16,.3+.22*e),window.setTimeout(()=>eU(46,.14,.2+.16*e),130),e2=.92-.55*e}}else e2=0;if(te?(e6-=n)<=0&&(e6=eD?.27:.46,tt(eD?420:300,.07,eD?.05:.028)):e6=.12,(e9-=n)<=0){e9=2.6+1.6*Math.random();let e=1/0;for(let t of ez)t.rage<=0&&(e=Math.min(e,t.pos.distanceTo(eq.pos)));e<9&&(e=>{if((0,s.qq)())return;let t=eH();if(!t)return;let a=t.currentTime,n=t.createOscillator();n.type="sawtooth",n.frequency.setValueAtTime(72,a),n.frequency.exponentialRampToValueAtTime(38,a+.6);let o=t.createBiquadFilter();o.type="lowpass",o.frequency.value=160;let r=t.createGain();r.gain.setValueAtTime(1e-4,a),r.gain.exponentialRampToValueAtTime(.05+.07*e,a+.08),r.gain.exponentialRampToValueAtTime(1e-4,a+.65),n.connect(o).connect(r).connect(t.destination),n.start(a),n.stop(a+.7)})(r.cj9.clamp(1-e/10,0,1))}if((e3-=n)<=0&&(e3=24+18*Math.random(),e8=1,window.setTimeout(()=>tt(90,1.4,.15),400+700*Math.random())),(e7-=n)<=0){e7=7+8*Math.random();let e=eI.find(e=>!e.g.visible);if(e){let t=new r.I9Y(Math.sin(eq.yaw),Math.cos(eq.yaw)),a=eq.pos.clone().addScaledVector(t,4+3*Math.random());if((0,u.f2)(eF.rows,a,.2)){let n=new r.I9Y(t.y,-t.x).multiplyScalar(.5>Math.random()?1:-1);e.g.position.set(a.x-1.2*n.x,0,a.y-1.2*n.y),e.vel.copy(n).multiplyScalar(5.5),e.life=.55,e.g.visible=!0,e.g.rotation.y=Math.atan2(n.x,n.y),eU(2100,.08,.045)}}}Q.current=(e-eC)/1e3,(eV-=n)<=0&&(eV=.09,j(Math.floor(Q.current)),m(H.current),M(K.current),v(X.current),W.current+=((K.current>0)-W.current)*.3,R(Math.round(100*W.current)/100),q(Math.round(100*Math.max(0,Math.min(1,(28-X.current)/28)))/100),(0,s.qq)()?eQ():eX())}else if(eh.rotation.z=.5*o,P.rotation.y+=.18*n,"over"===Z.current&&tn){let t=tn;null==(i=t.model)||i.mixer.update(n);let a=(e-to)/1e3,o=eq.pos.clone().sub(t.pos),s=Math.max(.001,o.length());o.multiplyScalar(1/s);let l=new r.Pq0(t.pos.x+1.15*o.x,2.15,t.pos.y+1.15*o.y),c=.06*(a<.9);l.x+=(Math.random()-.5)*c,l.y+=(Math.random()-.5)*c,d.fov+=(40-d.fov)*(1-Math.exp(-(9*n))),d.updateProjectionMatrix(),d.position.lerp(l,1-Math.exp(-(14*n))),d.lookAt(t.pos.x,2.2,t.pos.y),t.group.rotation.y=Math.atan2(o.x,o.y)+(t.model,0)}
1for(let e of(ew.forEach((e,t)=>{let a=Math.sin(.9*o+2.1*t)>.996?.25:1;e.emissiveIntensity=(1.15+.25*Math.sin(13*o+2.6*t))*a}),e8>.001&&(e8*=Math.exp(-(5*n))),x.intensity=.85+1.3*e8,y.intensity=2.1+1.1*e8,ek))if(e.g.visible)if(e.flying){e.t+=n,e.g.position.addScaledVector(e.vel,n),e.vel.y+=2*n;let t=Math.sin(26*o),a=t>0?.95*t:.5*t;e.wr.rotation.set(0,0,a),e.wl.rotation.set(0,0,-a),e.g.rotation.z=.08*Math.sin(26*o-.6),e.t>2.4&&ta(e,eq.pos)}else{let t=0,a=.14+.03*Math.sin(2*o+e.g.position.x),r=.6;if(e.idleT-=n,e.idleT<=0&&(e.idleT=2.5+4*Math.random(),e.gesture=.5,e.kind=.5>Math.random()?0:1,1===e.kind&&(e.targetYaw=e.g.rotation.y+(Math.random()-.5)*2.4)),e.gesture>0&&(e.gesture-=n,0===e.kind?(a+=.55*Math.abs(Math.sin(34*o)),r=.35):(e.g.rotation.y+=(e.targetYaw-e.g.rotation.y)*Math.min(1,6*n),t=.07*Math.abs(Math.sin((.5-e.gesture)*Math.PI*2)))),e.g.position.y=u.o8+.22+t+.02*Math.sin(3*o+e.g.position.x),e.wr.rotation.set(0,r,a),e.wl.rotation.set(0,-r,-a),4.6>Math.hypot(e.g.position.x-eq.pos.x,e.g.position.z-eq.pos.y)&&"running"===Z.current){e.flying=!0,e.t=0;let t=e.g.position.x-eq.pos.x,a=e.g.position.z-eq.pos.y,n=Math.max(.001,Math.hypot(t,a));e.vel.set(t/n*2.2+(Math.random()-.5),7.5,a/n*2.2+(Math.random()-.5)),tt(1100,.3,.07,"bandpass")}}for(let e of eI)e.g.visible&&(e.life-=n,e.g.position.x+=e.vel.x*n,e.g.position.z+=e.vel.y*n,e.g.position.y=.03*Math.abs(Math.sin(26*o)),e.life<=0&&(e.g.visible=!1));(tx-=n)<=0&&(tx=.05,(()=>{let e=t.current;if(!e)return;let a=e.getContext("2d");if(!a)return;let n=Math.min(window.devicePixelRatio||1,2),o=Math.max(1,Math.round((e.getBoundingClientRect().width||144)*n));e.width!==o&&(e.width=o,e.height=o);let r=e.width,i=r/u.Z,s=.5+.5*Math.sin(.006*performance.now()),l=e=>(e/u.JA+tm+.5)*i,c=e=>(e/u.JA+tm+.5)*i;a.clearRect(0,0,r,r),a.fillStyle="#15110d",a.fillRect(0,0,r,r),a.fillStyle="#9c5d45";
1for(let e=0;e<u.Z;e++){let t=eF.rows[e];for(let n=0;n<u.Z;n++)"#"===t[n]&&a.fillRect(n*i,e*i,i+1,i+1)}for(let e of e_){if(e.taken)continue;let t=l((e.cell.c-tm)*u.JA),n=c((e.cell.r-tm)*u.JA),o=.42*i;a.fillStyle="#0e7490",a.fillRect(t-o,n-.72*o,2*o,1.44*o),a.fillStyle="#67e8f9",a.fillRect(t-.55*o,n-.3*o,1.1*o,.6*o),a.strokeStyle="rgba(255,255,255,0.85)",a.lineWidth=Math.max(1,.07*i),a.strokeRect(t-o,n-.72*o,2*o,1.44*o)}{let e=l((eF.exit.c-tm)*u.JA),t=c((eF.exit.r-tm)*u.JA),n=U.current>=3,o=.55*i;n?(a.strokeStyle="rgba(34,197,94,".concat(.55+.45*s,")"),a.lineWidth=Math.max(1.5,.18*i),a.beginPath(),a.arc(e,t,o,0,2*Math.PI),a.stroke(),a.fillStyle="#22c55e",a.beginPath(),a.arc(e,t,.4*o,0,2*Math.PI),a.fill()):(a.fillStyle="#ef4444",a.fillRect(e-.8*o,t-.8*o,1.6*o,1.6*o),a.strokeStyle="rgba(0,0,0,0.55)",a.lineWidth=Math.max(1,.1*i),a.beginPath(),a.moveTo(e-.4*o,t),a.lineTo(e+.4*o,t),a.stroke())}for(let e of ez){let t=l(e.pos.x),n=c(e.pos.y);e.rage>0?(a.fillStyle="rgba(239,68,68,".concat(.18+.16*s,")"),a.beginPath(),a.arc(t,n,i*(.7+.3*s),0,2*Math.PI),a.fill(),a.fillStyle="#ef4444",a.beginPath(),a.arc(t,n,.4*i,0,2*Math.PI),a.fill(),a.fillStyle="#fde68a",a.beginPath(),a.arc(t-.14*i,n,.08*i,0,2*Math.PI),a.arc(t+.14*i,n,.08*i,0,2*Math.PI),a.fill()):(a.fillStyle="rgba(226,232,240,0.85)",a.beginPath(),a.arc(t,n,.32*i,0,2*Math.PI),a.fill(),a.strokeStyle="rgba(0,0,0,0.45)",a.lineWidth=Math.max(1,.08*i),a.stroke())}{let e=l(eq.pos.x),t=c(eq.pos.y),n=Math.sin(eq.yaw),o=Math.cos(eq.yaw),r=-o,s=3.4*i;a.fillStyle="rgba(251,191,36,0.16)",a.beginPath(),a.moveTo(e,t),a.lineTo(e+(n-.5*r)*s,t+(o-.5*n)*s),a.lineTo(e+(n+.5*r)*s,t+(o+.5*n)*s),a.closePath(),a.fill();let d=1.05*i;a.fillStyle="#f59e0b",a.strokeStyle="rgba(0,0,0,0.6)",a.lineWidth=Math.max(1,.09*i),a.beginPath(),a.moveTo(e+n*d,t+o*d),a.lineTo(e-n*d*.6+r*d*.7,t-o*d*.6+n*d*.7),a.lineTo(e-n*d*.6-r*d*.7,t-o*d*.6-n*d*.7),a.closePath(),a.fill(),a.stroke()}})()),w()};for(let e of(ti(),ts(),tl(),ek))ta(e);tw(1),eE=requestAnimationFrame(tg),(0,h.JI)(3).then(e=>{eW||(eO=e,tl(),"running"===Z.current&&tc())}).catch(()=>{}).finally(()=>{eW||C(!1)});let ty=e=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","KeyW","KeyA","KeyS","KeyD","ShiftLeft","ShiftRight"].includes(e.code)&&(e.preventDefault(),e$.add(e.code)),"KeyV"===e.code&&(e.preventDefault(),k(e=>!e)),("Space"===e.code||"Enter"===e.code)&&"running"!==Z.current&&(e.preventDefault(),td())},tM=e=>{e$.delete(e.code)},tb=()=>{if("running"===Z.current&&!e4){for(let e of(e4=!0,_(!0),[...e$]))e$.delete(e);eQ()}};J.current=()=>{e4&&(e4=!1,_(!1),eY=performance.now(),(0,s.qq)()||eX())};let tv=()=>{document.hidden&&tb()};return document.addEventListener("visibilitychange",tv),window.addEventListener("blur",tb),window.addEventListener("keydown",ty),window.addEventListener("keyup",tM),()=>{var e;for(let t of(eW=!0,cancelAnimationFrame(eE),window.removeEventListener("keydown",ty),window.removeEventListener("keyup",tM),document.removeEventListener("visibilitychange",tv),window.removeEventListener("blur",tb),ez))null==(e=t.model)||e.mixer.stopAllAction();eQ();try{null==eZ||eZ.close()}catch(e){}em.dispose(),n.dispose()}},[L]);let ea=(e,t)=>{et.current[e]=t},en=(e,t,a)=>(0,n.jsx)("button",{type:"button","aria-label":a,title:a,onPointerDown:t=>{t.preventDefault(),ea(e,!0)},onPointerUp:t=>{t.preventDefault(),ea(e,!1)},onPointerCancel:()=>ea(e,!1),onPointerLeave:()=>ea(e,!1),className:"flex h-11 w-11 items-center justify-center rounded-lg border border-white/15 bg-black/45 text-lg font-black text-white shadow-lg shadow-black/30 backdrop-blur transition active:scale-95 active:bg-white/20",children:t});return(0,n.jsxs)("div",{className:"select-none",children:[(0,n.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-5",children:[(0,n.jsxs)("div",{className:"rounded-xl bg-white/10 px-4 py-2 text-center",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase text-zinc-400",children:"Score"}),(0,n.jsx)("div",{className:"text-xl font-bold text-white",children:w})]}),(0,n.jsxs)("div",{className:"rounded-xl bg-white/10 px-4 py-2 text-center",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase text-zinc-400",children:"Best"}),(0,n.jsx)("div",{className:"text-xl font-bold text-amber-300",children:D})]}),(0,n.jsxs)("div",{className:"rounded-xl bg-white/10 px-4 py-2 text-center",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase text-zinc-400",children:"Cards"}),(0,n.jsxs)("div",{className:"text-xl font-bold text-sky-300",children:[x,"/",3]})]}),(0,n.jsxs)("div",{className:"rounded-xl bg-white/10 px-4 py-2 text-center",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase text-zinc-400",children:"Threat"}),(0,n.jsx)("div",{className:"text-xl font-bold text-rose-400",children:y})]}),(0,n.jsxs)("div",{className:"rounded-xl bg-white/10 px-4 py-2 text-center",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase text-zinc-400",children:"Time"}),(0,n.jsxs)("div",{className:"text-xl font-bold text-white",children:[S,"s"]})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("div",{className:"flex overflow-hidden rounded-xl bg-white/10 p-0.5",title:"Difficulty (applies on your next run)",children:["easy","normal","hard"].map(e=>(0,n.jsx)("button",{onClick:()=>P(e),className:"rounded-lg px-3 py-2.5 text-sm font-bold capitalize transition ".concat(N===e?"bg-gradient-to-r from-red-500 to-amber-500 text-white":"text-zinc-300 hover:text-white"),children:e},e))}),(0,n.jsx)("button",{onClick:()=>k(e=>!e),title:"Switch camera view (V)",className:"rounded-xl bg-white/10 px-4 py-3 font-bold text-white transition hover:bg-white/20",children:T?"\uD83D\uDC41 First-person":"\uD83C\uDFA5 Third-person"}),(0,n.jsx)("button",{onClick:()=>ee.current(),className:"rounded-xl bg-gradient-to-r from-red-500 to-amber-500 px-5 py-3 font-bold text-white shadow-lg shadow-red-500/25 transition hover:scale-105",children:"running"===a?"Restart":"Enter maze"})]})]}),(0,n.jsxs)("div",{"data-board":!0,className:"relative mx-auto w-full touch-none overflow-hidden rounded-2xl border border-white/10 bg-black",style:{aspectRatio:"16 / 10",minHeight:"360px"}
1,role:"application","aria-label":"Don't Look. Use W A S D or arrow keys to move, Shift to sprint, collect three cards, and reach the green exit.",children:[(0,n.jsx)("div",{ref:e,className:"h-full w-full"}),(0,n.jsx)("canvas",{ref:t,"data-mini-map":!0,width:184,height:184,"aria-hidden":!0,className:"scp-minimap absolute left-3 top-3 z-20 hidden h-40 w-40 rounded-lg border border-white/15 shadow-xl shadow-black/40 sm:block"}),z&&(0,n.jsxs)("div",{className:"absolute right-3 top-3 z-20 flex items-center gap-2 rounded-lg bg-black/55 px-3 py-1.5 text-xs font-semibold text-zinc-200 backdrop-blur-sm",children:[(0,n.jsx)("span",{className:"h-2 w-2 animate-pulse rounded-full bg-amber-400"}),"Loading creature modelâ¦"]}),(0,n.jsxs)("div",{className:"scp-fullscreen-hud","aria-hidden":!0,children:[(0,n.jsxs)("span",{children:["Cards ",(0,n.jsxs)("strong",{children:[x,"/",3]})]}),(0,n.jsxs)("span",{children:["Threat ",(0,n.jsx)("strong",{className:y>0?"text-red-200":"",children:y})]}),(0,n.jsxs)("span",{children:["Time ",(0,n.jsxs)("strong",{children:[S,"s"]})]})]}),(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-[22%] z-20 flex flex-col items-center gap-1",children:E.map(e=>(0,n.jsx)("div",{className:"animate-bounce-in text-xl font-extrabold drop-shadow-[0_2px_4px_rgba(0,0,0,0.8)] sm:text-2xl ".concat(e.cls),children:e.text},e.id))}),(0,n.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 z-10 bg-[radial-gradient(circle_at_center,transparent_40%,rgba(127,29,29,0.42)_100%)] transition-opacity duration-300",style:{opacity:A}}),(0,n.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 z-10 transition-opacity duration-500",style:{opacity:I},children:(0,n.jsx)("div",{className:"absolute inset-0 animate-pulse bg-[radial-gradient(circle_at_center,transparent_45%,rgba(0,0,0,0.7)_100%)]"})}),(0,n.jsx)("div",{className:"absolute bottom-3 left-3 right-3 h-2 overflow-hidden rounded-full bg-black/45 shadow-inner shadow-black/50",children:(0,n.jsx)("div",{className:"h-full rounded-full transition-[width] ".concat(b<28?"bg-gradient-to-r from-red-600 to-orange-400":"bg-gradient-to-r from-sky-400 to-lime-300"),style:{width:"".concat(b,"%")}})}),"running"===a&&(0,n.jsxs)("div",{className:"absolute bottom-7 right-3 grid grid-cols-3 gap-1.5 sm:hidden",children:[(0,n.jsx)("span",{}),en("forward","â²","Forward"),(0,n.jsx)("span",{}),en("left","â","Turn left"),en("sprint","â","Sprint"),en("right","â¶","Turn right"),(0,n.jsx)("span",{}),en("back","â¼","Back"),(0,n.jsx)("span",{})]}),F&&"running"===a&&(0,n.jsxs)("div",{className:"absolute inset-0 z-30 flex flex-col items-center justify-center gap-4 bg-black/85 p-6 text-center backdrop-blur-sm",children:[(0,n.jsx)("div",{className:"text-5xl","aria-hidden":!0,children:"â¸ï¸"}),(0,n.jsx)("p",{className:"text-2xl font-extrabold text-white",children:"Paused"}),(0,n.jsx)("p",{className:"max-w-xs text-sm text-zinc-300",children:"You switched away â the maze is frozen. The creatures wait for you."}),(0,n.jsx)("button",{onClick:()=>J.current(),className:"rounded-xl bg-gradient-to-r from-emerald-500 to-teal-500 px-6 py-3 font-bold text-white transition hover:scale-105",children:"â¶ Resume"})]}),"running"!==a&&(0,n.jsxs)("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-4 bg-black/65 p-6 text-center backdrop-blur-[2px]",children:[(0,n.jsx)("div",{className:"text-5xl","aria-hidden":!0,children:"won"===a?"â
":"over"===a?"â ï¸":"\uD83E\uDDF1"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-3xl font-extrabold text-white",children:"won"===a?"Escaped":"over"===a?"Caught":"Don't Look"}),"idle"!==a&&(0,n.jsxs)("p",{className:"mt-2 text-sm font-semibold text-zinc-300",children:["Score ",w," \xb7 Cards ",x,"/",3," \xb7 ",S,"s"]}),"idle"===a&&(0,n.jsxs)("p",{className:"mx-auto mt-2 max-w-md text-sm text-zinc-300",children:["Don't stare at the creature. Grab 3 keycards, reach the green exit.",(0,n.jsx)("br",{}),(0,n.jsx)("span",{className:"text-zinc-400",children:"WASD / arrows move \xb7 Shift sprint \xb7 V switch view"})]})]}),(0,n.jsx)("button",{onClick:()=>ee.current(),className:"rounded-xl bg-gradient-to-r from-red-500 to-amber-500 px-6 py-3 font-bold text-white shadow-lg shadow-red-500/25 transition hover:scale-105",children:"idle"===a?"Start":"Run again"})]})]})]})}},3557:(e,t,a)=>{a.d(t,{g:()=>o});var n=a(2115);
1function o(e){let[t,a]=(0,n.useState)(0);return(0,n.useEffect)(()=>{try{let t=window.localStorage.getItem("funnudge:".concat(e));t&&a(Number(t)||0)}catch(e){}},[e]),{best:t,submit:(0,n.useCallback)(t=>{a(a=>{if(t<=a)return a;try{window.localStorage.setItem("funnudge:".concat(e),String(t))}catch(e){}return t})},[e])}}},8213:(e,t,a)=>{a.d(t,{P:()=>n,Q:()=>o});let n="funnudge:celebrate";function o(){try{window.dispatchEvent(new CustomEvent(n))}catch(e){}}}}]);
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.