1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8886],{28886:function(e,t,n){n.r(t),n.d(t,{default:function(){return j}});var r=n(57437),a=n(29),s=n.n(a),o=n(2265),i=n(49924),c=n(18030),l=n(73890),u=n(28354),d=n(77874);function m(e){try{var t,n;null===(n=navigator)||void 0===n||null===(t=n.vibrate)||void 0===t||t.call(n,e)}catch(e){}}let f={natural:"cubic-bezier(0.25, 0.1, 0.25, 1)",sudden:"cubic-bezier(0.1, 0.8, 0.2, 1)",bounce:"cubic-bezier(0.34, 1.56, 0.64, 1)"};function p(e,t){let n=e.replace("#",""),r=parseInt(n.substring(0,2),16),a=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);return"#".concat(Math.min(255,Math.round(r+(255-r)*t)).toString(16).padStart(2,"0")).concat(Math.min(255,Math.round(a+(255-a)*t)).toString(16).padStart(2,"0")).concat(Math.min(255,Math.round(s+(255-s)*t)).toString(16).padStart(2,"0"))}function x(e){let{segments:t,theme:n,customColors:a}=e,s=null!=a?a:n.colors;return(0,r.jsxs)("svg",{viewBox:"0 0 ".concat(300," ").concat(300),className:"absolute inset-0 w-full h-full","aria-hidden":"true",children:[(0,r.jsxs)("defs",{children:[Array.from({length:t},(e,t)=>{let a=s[t%s.length],o=n.gradientOverride;return(0,r.jsx)("radialGradient",{id:"seg-grad-".concat(t),cx:150,cy:150,r:110,gradientUnits:"userSpaceOnUse",children:o?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("stop",{offset:"0%",stopColor:o[0]}),(0,r.jsx)("stop",{offset:"100%",stopColor:o[1]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("stop",{offset:"0%",stopColor:p(a,.3)}),(0,r.jsx)("stop",{offset:"65%",stopColor:a}),(0,r.jsx)("stop",{offset:"100%",stopColor:function(e,t){let n=e.replace("#",""),r=parseInt(n.substring(0,2),16),a=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);return"#".concat(Math.round(.92*r).toString(16).padStart(2,"0")).concat(Math.round(.92*a).toString(16).padStart(2,"0")).concat(Math.round(.92*s).toString(16).padStart(2,"0"))}(a,.08)})]})},"grad-".concat(t))}),(0,r.jsxs)("radialGradient",{id:"outer-ring-grad",cx:150,cy:150,r:128,gradientUnits:"userSpaceOnUse",children:[(0,r.jsx)("stop",{offset:"85%",stopColor:n.outerRing.color}),(0,r.jsx)("stop",{offset:"100%",stopColor:n.outerRing.borderColor})]}
1),(0,r.jsxs)("radialGradient",{id:"center-grad",cx:"45%",cy:"35%",r:"60%",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:p(n.center.bg,.3)}),(0,r.jsx)("stop",{offset:"100%",stopColor:n.center.bg})]})]}),(0,r.jsx)("circle",{cx:150,cy:150,r:125,fill:"none",stroke:n.outerRing.borderColor,strokeWidth:3}),(0,r.jsx)("circle",{cx:150,cy:150,r:118,fill:"none",stroke:"url(#outer-ring-grad)",strokeWidth:10}),Array.from({length:t},(e,n)=>(0,r.jsx)("path",{d:function(e,t,n,r,a){let s=360/t,o=e*s-90,i=o*Math.PI/180,c=(o+s)*Math.PI/180,l=150+110*Math.cos(c),u=150+a*Math.sin(c);return["M".concat(150,",").concat(150),"L".concat((150+110*Math.cos(i)).toFixed(2),",").concat((150+110*Math.sin(i)).toFixed(2)),"A".concat(a,",").concat(a," 0 ").concat(s>180?1:0,",1 ").concat(l.toFixed(2),",").concat(u.toFixed(2)),"Z"].join(" ")}(n,t,150,150,110),fill:"url(#seg-grad-".concat(n,")")},"seg-".concat(n))),Array.from({length:t},(e,a)=>{let s=function(e,t,n,r,a){let s=(360*e/t-90)*Math.PI/180;return{x:150+110*Math.cos(s),y:150+110*Math.sin(s)}}(a,t,0,0,0);return(0,r.jsx)("line",{x1:150,y1:150,x2:s.x.toFixed(2),y2:s.y.toFixed(2),stroke:n.segmentBorderColor,strokeWidth:1.5},"div-".concat(a))}),(0,r.jsx)("circle",{cx:150,cy:150,r:28,fill:"url(#center-grad)",stroke:n.center.borderColor,strokeWidth:3})]})}function h(e){let{segments:t,layout:n,theme:a,noWinText:s,prizeIconPath:o}=e,i=360/t,c=t<=6?"text-[11px] sm:text-sm":t<=8?"text-[10px] sm:text-[13px]":t<=10?"text-[8px] sm:text-[11px]":"text-[7px] sm:text-[10px]",l=t<=6?36:t<=8?30:t<=10?24:20;return(0,r.jsx)("div",{className:"absolute inset-0 pointer-events-none","aria-hidden":"true",children:n.map((e,t)=>{let n=(i*t+i/2)*Math.PI/180;return(0,r.jsx)("div",{className:"absolute flex items-center justify-center",style:{left:"".concat(50+24*Math.sin(n),"%"),top:"".concat(50-24*Math.cos(n),"%"),transform:"translate(-50%, -50%)"},children:e?(0,r.jsx)("img",{src:o,alt:"",width:l,height:l,className:"object-contain",draggable:!1}):(0,r.jsx)("span",{className:"".concat(c," font-bold whitespace-nowrap"),style:{color:"#333",textShadow:"0 1px 2px rgba(255,255,255,0.5)"},children:s})},t)})})}function y(e){let{rotation:t,isSpinning:n,spinDuration:a,easing:s,theme:o}=e;return(0,r.jsx)("div",{className:"absolute inset-0 pointer-events-none z-10",style:{transform:"rotate(".concat(t,"deg)"),transition:n?"transform ".concat(a,"s ").concat(s):"none",willChange:n?"transform":"auto"},"data-testid":"lucky-wheel-pointer",children:(0,r.jsx)("svg",{viewBox:"0 0 30 34",className:"absolute",style:{top:"".concat(86,"%"),left:"50%",transform:"translateX(-50%)",width:"8%",filter:"drop-shadow(0 2px 3px rgba(0,0,0,0.3))"},"aria-hidden":"true",children:(0,r.jsx)("polygon",{points:"15,0 29,31 1,31",fill:o.pointerColor,stroke:o.pointerBorderColor,strokeWidth:2.5,strokeLinejoin:"round"})})})}function b(e){let{theme:t}=e;return(0,r.jsx)("div",{className:"absolute inset-0 pointer-events-none z-10","data-testid":"lucky-wheel-pointer",children:(0,r.jsx)("svg",{viewBox:"0 0 30 34",className:"absolute",style:{top:"".concat(14,"%"),left:"50%",transform:"translateX(-50%) translateY(-100%)",width:"8%",filter:"drop-shadow(0 2px 3px rgba(0,0,0,0.3))"},"aria-hidden":"true",children:(0,r.jsx)("polygon",{points:"15,34 29,3 1,3",fill:t.pointerColor,stroke:t.pointerBorderColor,strokeWidth:2.5,strokeLinejoin:"round"})})})}function g(e){let{rotation:t,isSpinning:n,spinDuration:a,easing:s,theme:o}=e;return(0,r.jsx)("div",{className:"absolute inset-0 pointer-events-none z-10",style:{transform:"rotate(".concat(t,"deg)"),transition:n?"transform ".concat(a,"s ").concat(s):"none",willChange:n?"transform":"auto"},"data-testid":"lucky-wheel-pointer",children:(0,r.jsxs)("svg",{viewBox:"0 0 ".concat(300," ").concat(300),className:"absolute inset-0 w-full h-full","aria-hidden":"true",children:[(0,r.jsx)("polygon",{points:"".concat(150,",").concat(104," ").concat(144,",").concat(150," ").concat(156,",").concat(150),fill:o.pointerColor,stroke:o.pointerBorderColor,strokeWidth:1.5,strokeLinejoin:"round"}),(0,r.jsx)("polygon",{points:"".concat(146,",").concat(150," ").concat(154,",").concat(150," ").concat(150,",").concat(162),fill:o.pointerBorderColor,stroke:o.pointerBorderColor,strokeWidth:1,strokeLinejoin:"round"}),(0,r.jsx)("circle",{cx:150,cy:150,r:5,fill:o.pointerColor,stroke:o.pointerBorderColor,strokeWidth:1.5})]})})}function j(e){let{game_config:t,is_win:n,won_prize:a,no_win_image_url:p,gamePhase:j,onStartGame:w,onGameComplete:k}=e,T=(0,i.b)(),{t:v}=(0,c.$)(T),{wheelStyleId:C,segmentCountMode:_,segmentCount:N,spinDuration:z,spinRotations:M,decelerationStyle:S,winProbability:A,segmentColorsMode:W,segmentColors:B,pointerStyle:R,prizeIconId:L,noWinText:V}=function(e){let t="number"==typeof e.wheel_style_id?e.wheel_style_id:2,n="fixed"===e.segment_count_mode?"fixed":"auto",r="number"==typeof e.segment_count?e.segment_count:null,a="number"==typeof e.spin_duration?Math.max(3,Math.min(8,e.spin_duration)):5,s="number"==typeof e.spin_rotations?Math.max(3,Math.min(10,e.spin_rotations)):5,o=["natural","sudden","bounce"].includes(e.deceleration_style)?e.deceleration_style:"natural",i="number"==typeof e.win_probability?e.win_probability:30,c="custom"===e.segment_colors_mode?"custom"
1:"default",l=Array.isArray(e.segment_colors)?e.segment_colors:null;return{wheelStyleId:t,segmentCountMode:n,segmentCount:r,spinDuration:a,spinRotations:s,decelerationStyle:o,winProbability:i,segmentColorsMode:c,segmentColors:l,pointerStyle:"top"===e.pointer_style?"top":"center"===e.pointer_style?"center":"bottom",prizeIconId:"number"==typeof e.prize_icon_id?e.prize_icon_id:1,noWinText:"string"==typeof e.no_win_text&&e.no_win_text.trim()?e.no_win_text.trim():""}}(t),I=(0,d.lL)(L),F=V||v("play.luckyWheel.noWinSegment"),q="fixed"===_&&N?N:(0,d.HU)(C),G=(0,d.BW)(C),P="custom"===W&&B?B:null,O=(0,o.useMemo)(()=>(function(e,t){let n=Math.max(1,Math.min(e-1,Math.round(e*t/100))),r=Array(e).fill(!1),a=e/n;for(let t=0;t<n;t++)r[Math.round(t*a)%e]=!0;return r})(q,A),[q,A]),E=f[S],[Q,U]=(0,o.useState)(!1),[D,H]=(0,o.useState)(!1),[Y,X]=(0,o.useState)(!1),[Z,$]=(0,o.useState)(0),[J,K]=(0,o.useState)(!1),ee=(0,o.useRef)(!1),et=(0,o.useRef)(!1),{play:en,muted:er,toggleMute:ea}=(0,l.w)({spin:u.w4,tick:u.Yf,win:u.QQ,lose:u.gL}),es=(0,o.useMemo)(()=>(function(e,t,n,r){let a=360/e,s=t.map((e,t)=>({i:t,isPrize:e})).filter(e=>e.isPrize===n).map(e=>e.i),o=s[Math.floor(Math.random()*s.length)]*a+(.15*a+Math.random()*a*.7);if("top"===r)return(360-o)%360;if("center"===r)return o%360;let i=o-180;return i<0&&(i+=360),i})(q,O,n,R),[q,O,n,R]),eo=(0,o.useCallback)(()=>{if(Q||"ready"!==j)return;K(!1),en("spin"),m(30),w(),U(!0);let e=360*M+es;requestAnimationFrame(()=>{$(t=>t+e)}),setTimeout(()=>{U(!1),H(!0),en("tick"),m(50),setTimeout(()=>{en(n?"win":"lose"),n&&m([100,50,100,50,200])},300),ee.current||(ee.current=!0,k())},1e3*z+300)},[Q,j,w,k,M,z,es,en,n]);(0,o.useEffect)(()=>{"result"!==j||D||(H(!0),U(!1))},[j,D]),(0,o.useEffect)(()=>{if("ready"===j&&!Q&&!et.current){et.current=!0,K(!0);let e=setTimeout(()=>K(!1),3e3);return()=>clearTimeout(e)}},[j,Q]);let ei="ready"===j&&!Q;return(0,r.jsxs)("div",{style:{minHeight:340},"data-testid":"lucky-wheel-game",className:"jsx-4836c964b5d9f3cc relative flex flex-col items-center justify-center rounded-2xl overflow-visible bg-linear-to-b from-amber-50 to-orange-50 py-6 px-4 sm:py-8",children:[(0,r.jsx)("button",{type:"button",onClick:ea,"aria-label":v(er?"play.sound.unmute":"play.sound.mute"),"data-testid":"lucky-wheel-mute-btn",className:"jsx-4836c964b5d9f3cc absolute top-2 right-2 z-20 flex h-8 w-8 items-center justify-center rounded-full bg-white/80 text-gray-500 shadow-sm transition-colors hover:bg-white cursor-pointer",children:er?(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-4836c964b5d9f3cc h-4 w-4",children:[(0,r.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",className:"jsx-4836c964b5d9f3cc"}),(0,r.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15",className:"jsx-4836c964b5d9f3cc"}),(0,r.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15",className:"jsx-4836c964b5d9f3cc"})]}):(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-4836c964b5d9f3cc h-4 w-4",children:[(0,r.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",className:"jsx-4836c964b5d9f3cc"}),(0,r.jsx)("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",className:"jsx-4836c964b5d9f3cc"}),(0,r.jsx)("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",className:"jsx-4836c964b5d9f3cc"})]})}),(0,r.jsxs)("div",{"data-testid":"lucky-wheel-container",className:"jsx-4836c964b5d9f3cc relative w-80 max-w-full aspect-square sm:w-[380px] md:w-[480px]",children:["top"===R?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{style:{transform:"rotate(".concat(Z,"deg)"),transition:Q?"transform ".concat(z,"s ").concat(E):"none",willChange:Q?"transform":"auto"},"data-testid":"lucky-wheel-rotating-wheel",className:"jsx-4836c964b5d9f3cc absolute inset-0",children:[(0,r.jsx)(x,{segments:q,theme:G,customColors:P}),(0,r.jsx)(h,{segments:q,layout:O,theme:G,noWinText:F,prizeIconPath:I})]}),(0,r.jsx)(b,{theme:G})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x,{segments:q,theme:G,customColors:P}),(0,r.jsx)(h,{segments:q,layout:O,theme:G,noWinText:F,prizeIconPath:I}),"center"===R?(0,r.jsx)(g,{rotation:Z,isSpinning:Q,spinDuration:z,easing:E,theme:G}):(0,r.jsx)(y,{rotation:Z,isSpinning:Q,spinDuration:z,easing:E,theme:G})]}),(0,r.jsxs)("div",{className:"jsx-4836c964b5d9f3cc absolute inset-0 flex items-center justify-center z-20",children:[J&&ei&&(0,r.jsx)("div",{style:{to
1p:"30%"},"data-testid":"lucky-wheel-spin-hint",className:"jsx-4836c964b5d9f3cc absolute animate-spin-hint pointer-events-none",children:(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"jsx-4836c964b5d9f3cc h-7 w-7 text-amber-500 drop-shadow-md",children:(0,r.jsx)("path",{d:"M12 2a1 1 0 0 1 1 1v12.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-5 5a1 1 0 0 1-1.414 0l-5-5a1 1 0 0 1 1.414-1.414L11 15.586V3a1 1 0 0 1 1-1z",className:"jsx-4836c964b5d9f3cc"})})}),(0,r.jsx)("button",{type:"button",onClick:eo,disabled:!ei,style:{width:"19%",height:"19%",background:G.center.bg,color:G.center.textColor,border:"3px solid ".concat(G.center.borderColor),fontSize:"clamp(8px, 2.5vw, 13px)",fontWeight:700,lineHeight:1.2},"data-testid":"lucky-wheel-spin-btn",className:"jsx-4836c964b5d9f3cc "+"rounded-full flex items-center justify-center shadow-lg transition-all ".concat(ei?"hover:scale-105 active:scale-95 cursor-pointer":Q?"":"cursor-not-allowed opacity-70"),children:v(Q?"play.luckyWheel.spinning":"play.luckyWheel.spinButton")})]})]}),D&&(0,r.jsx)("div",{"data-testid":"lucky-wheel-result",className:"jsx-4836c964b5d9f3cc mt-6 flex flex-col items-center animate-wheel-result-in",children:n&&a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{"data-testid":"lucky-wheel-result-title",className:"jsx-4836c964b5d9f3cc text-xl font-bold text-amber-600 mb-2",children:v("play.luckyWheel.resultWin")}),a.prize_image_url&&(0,r.jsx)("button",{type:"button",onClick:()=>X(!0),"data-testid":"lucky-wheel-prize-image-btn",className:"jsx-4836c964b5d9f3cc cursor-pointer",children:(0,r.jsx)("img",{src:a.prize_image_url,alt:a.prize_name,"data-testid":"lucky-wheel-prize-image",className:"jsx-4836c964b5d9f3cc w-24 h-24 object-contain rounded-lg shadow-md bg-white mb-3"})}),(0,r.jsx)("p",{"data-testid":"lucky-wheel-prize-name",className:"jsx-4836c964b5d9f3cc text-lg font-semibold text-gray-800",children:a.prize_name})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{"data-testid":"lucky-wheel-result-title",className:"jsx-4836c964b5d9f3cc text-xl font-bold text-gray-600 mb-2",children:v("play.luckyWheel.resultLose")}),p&&(0,r.jsx)("button",{type:"button",onClick:()=>X(!0),"data-testid":"lucky-wheel-no-win-image-btn",className:"jsx-4836c964b5d9f3cc cursor-pointer",children:(0,r.jsx)("img",{src:p,alt:"","data-testid":"lucky-wheel-no-win-image",className:"jsx-4836c964b5d9f3cc w-24 h-24 object-contain rounded-lg shadow-md bg-white"})})]})}),Y&&(0,r.jsx)("div",{onClick:()=>X(!1),"data-testid":"lucky-wheel-lightbox",className:"jsx-4836c964b5d9f3cc fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-6",children:(0,r.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"jsx-4836c964b5d9f3cc relative max-w-sm w-full",children:[(0,r.jsx)("img",{src:n&&(null==a?void 0:a.prize_image_url)?a.prize_image_url:p||"",alt:(null==a?void 0:a.prize_name)||"",className:"jsx-4836c964b5d9f3cc w-full object-contain rounded-xl bg-white p-4 shadow-2xl"}),(null==a?void 0:a.prize_name)&&(0,r.jsx)("p",{className:"jsx-4836c964b5d9f3cc mt-3 text-center text-white text-lg font-bold drop-shadow-md",children:a.prize_name}),(0,r.jsx)("button",{type:"button",onClick:()=>X(!1),"data-testid":"lucky-wheel-lightbox-close",className:"jsx-4836c964b5d9f3cc absolute -top-3 -right-3 w-8 h-8 rounded-full bg-white/90 text-gray-600 flex items-center justify-center shadow-md hover:bg-white transition-colors",children:(0,r.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"jsx-4836c964b5d9f3cc w-5 h-5",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd",className:"jsx-4836c964b5d9f3cc"})})})]})}),(0,r.jsx)(s(),{id:"4836c964b5d9f3cc",children:"@-webkit-keyframes wheel-result-in{0%{opacity:0;-webkit-transform:translatey(20px)scale(.95);transform:translatey(20px)scale(.95)}100%{opacity:1;-webkit-transform:translatey(0)scale(1);transform:translatey(0)scale(1)}}@-moz-keyframes wheel-result-in{0%{opacity:0;-moz-transform:translatey(20px)scale(.95);transform:translatey(20px)scale(.95)}100%{opacity:1;-moz-transform:translatey(0)scale(1);transform:translatey(0)scale(1)}}@-o-keyframes wheel-result-in{0%{opacity:0;-o-transform:translatey(20px)scale(.95);transform:translatey(20px)scale(.95)}100%{opacity:1;-o-transform:translatey(0)scale(1);transform:translatey(0)scale(1)}}@keyframes wheel-result-in{0%{opacity:0;-webkit-transform:translatey(20px)scale(.95);-moz-transform:translatey(20px)scale(.95);-o-transform:translatey(20px)scale(.95);transform:translatey(20px)scale(.95)}100%{opacity:1;-webkit-transform:translatey(0)scale(1);-moz-transform:translatey(0)scale(1);-o-transform:translatey(0)scale(1);transform:translatey(0)scale(1)}}.animate-wheel-result-in.jsx-4836c964b5d9f3cc{-webkit-animation:wheel-result-in 500ms ease-out forwards;-moz-animation:wheel-result-in 500ms ease-out forwards;-o-animation:wheel-result-in 500ms ease-out forwards;animation:wheel-result-in 500ms ease-out forwards}@-webkit-keyframes spin-hint{0%,100%{-webkit-transform:translatey(-8px);transform:translatey(-8px);opacity:.7}50%{-webkit-transform:translatey(8px);transform:translatey(8px);opacity:1}}@-moz-keyframes spin-hint{0%,100%{-moz-transform:translatey(-8px);transform:translatey(-8px);opacity:.7}50%{-moz-transform:translatey(8px);transform:translatey(8px);opacity:1}}@-o-keyframes spin-hint{0%,100%{-o-transform:translatey(-8px);transform:translatey(-8px);opacity:.7}50%{-o-transform:translatey(8px);transform:translatey(8px);opacity:1}}@keyframes spin-hint{0%,100%{-webkit-transform:translatey(-8px);-moz-transform:translatey(-8px);-o-transform:translatey(-8px);transform:translatey(-8px);opacity:.7}50%{-webkit-transform:translatey(8px);-moz-transform:translatey(8px);-o-transform:translatey(8px);transform:translatey(8px);opacity:1}}.animate-spin-hint.jsx-4836c964b5d9f3cc{-webkit-animation:spin-hint 1.2s ease-in-out infinite;-moz-animation:spin-hint 1.2s ease-in-out infinite;-o-animation:spin-hint 1.2s ease-in-out infinite;animation:spin-hint 1.2s ease-in-out infinite}"})]})}},73890:function(e,t,n){n.d(t,{w:function(){return a}});var r=n(2265);function a(e){let t=(0,r.useRef)(e);t.current=e;let[n,a]=(0,r.useState)(!1),s=(0,r.useRef)(n);return s.current=n,{play:(0,r.useCallback)(e=>{if(s.current)return;let n=t.current[e];if(n)try{n()}catch(e){}},[]),muted:n,toggleMute:(0,r.useCallback)(()=>{a(e=>!e)},[])}}},28354:function(e,t,n){n.d(t,{QQ:function(){return l},Tw:function(){return d},Yf:function(){return p},ZQ:function(){return m},gL:function(){return u},q2:function(){return o},tn:function(){return i},vS:function(){return c},w4:function(){return f}});let r=null;function a(){try{return r||(r=new(window.AudioContext||window.webkitAudioContext)),"suspended"===r.state&&r.resume(),r}catch(e){return null}}function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sine",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.15,s=a();if(!s)return;let o=s.createOscillator(),i=s.createGain();o.type=n,o.frequency.setValueAtTime(e,s.currentTime),i.gain.setValueAtTime(r,s.currentTime),i.gain.exponentialRampToValueAtTime(.001,s.currentTime+t),o.connect(i),i.connect(s.destination),o.start(s.currentTime),o.stop(s.currentTime+t)}
1function o(){s(880,.06,"sine",.12)}function i(){let e=a();if(!e)return;let t=e.createOscillator(),n=e.createGain();t.type="sawtooth",t.frequency.setValueAtTime(600,e.currentTime),t.frequency.exponentialRampToValueAtTime(200,e.currentTime+.2),n.gain.setValueAtTime(.1,e.currentTime),n.gain.exponentialRampToValueAtTime(.001,e.currentTime+.25),t.connect(n),n.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.25)}function c(){[523,659,784].forEach((e,t)=>{setTimeout(()=>s(e,.1,"triangle",.1),80*t)})}function l(){[523,659,784,1047].forEach((e,t)=>{setTimeout(()=>s(e,.15,"sine",.12),120*t)})}function u(){s(440,.18,"sine",.08),setTimeout(()=>s(330,.22,"sine",.06),150)}function d(){let e=a();if(!e)return;let t=.03*e.sampleRate,n=e.createBuffer(1,t,e.sampleRate),r=n.getChannelData(0);for(let e=0;e<t;e++)r[e]=(2*Math.random()-1)*.3;let s=e.createBufferSource();s.buffer=n;let o=e.createGain();o.gain.setValueAtTime(.08,e.currentTime),o.gain.exponentialRampToValueAtTime(.001,e.currentTime+.04),s.connect(o),o.connect(e.destination),s.start(e.currentTime)}function m(){let e=a();if(!e)return;let t=e.createOscillator(),n=e.createGain();t.type="sine",t.frequency.setValueAtTime(300,e.currentTime),t.frequency.exponentialRampToValueAtTime(800,e.currentTime+.3),n.gain.setValueAtTime(.12,e.currentTime),n.gain.exponentialRampToValueAtTime(.001,e.currentTime+.35),t.connect(n),n.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.35)}function f(){let e=a();if(!e)return;let t=e.createOscillator(),n=e.createGain();t.type="triangle",t.frequency.setValueAtTime(200,e.currentTime),t.frequency.exponentialRampToValueAtTime(600,e.currentTime+.4),n.gain.setValueAtTime(.1,e.currentTime),n.gain.exponentialRampToValueAtTime(.001,e.currentTime+.45),t.connect(n),n.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.45)}function p(){s(1200,.02,"square",.1)}}}]);
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.