PageSourceSearch

https://www.014pxj.com/assets/10.10.9/angpow-rain-floating.1fd42fa9.1791468856214.js

js 014pxj.com collected 2026-10-09 04:33:05 UTC 7,446 bytes, 1 lines download raw bytes

1import{r as n,l as S,A as s}from"./index.a592fd0f.1791468856214.js";import{r as P,u as xt}from"./agentation.68356e44.1791468856214.js";import{g as bt}from"./angpowRainModules.57538f8e.1791468856214.js";import{THEME_MAPPING as yt,Countdown as vt}from"./angpow-rain.835849fe.1791468856214.js";import"./Picture.91ce4a2f.1791468856214.js";import"./index-layout-lite.76900819.1791468856214.js";import"./user-slice.868aa776.1791468856214.js";import"./usePreloadTheme.0293eaca.1791468856214.js";import"./staticContentModules.67d7c02e.1791468856214.js";import"./luckyWheelModules.4a0bd2ce.1791468856214.js";import"./ms-hook.5efd5957.1791468856214.js";const _t="_angpowFloating_19zpv_1",Ct="_isAnimating_19zpv_19",Dt="_img_19zpv_33",kt="_countDownContainer_19zpv_39",St="_countDownImg_19zpv_39",Mt="_countDownBox_19zpv_74",Rt="_closeBtn_19zpv_103",l={angpowFloating:_t,isAnimating:Ct,img:Dt,countDownContainer:kt,countDownImg:St,"loykrathong-2025-countDownBox":"_loykrathong-2025-countDownBox_19zpv_51","christmas_2025-countDownBox":"_christmas_2025-countDownBox_19zpv_62",countDownBox:Mt,"loykrathong-2025-wording":"_loykrathong-2025-wording_19zpv_78","christmas_2025-wording":"_christmas_2025-wording_19zpv_91",closeBtn:Rt};function Nt({edgePadding:f=12,verticalPadding:x=8,storageKey:M="angpow-rain-floating",zIndex:V=9}){const{pathname:B}=P.useLocation(),I=P.useHistory(),b=n.useRef(null),[p,F]=n.useState({h:150}),[O,G]=n.useState("right"),[J,R]=n.useState(()=>{const t=window.innerHeight;return Math.max(0,t/2)}),[m,A]=n.useState(!1),[E,u]=n.useState(null),d=n.useRef({x:0,y:0}),w=n.useRef({x:0,y:0}),h=n.useRef(!1),y=5,[K,T]=n.useState(!1),U=500,[q,v]=n.useState(!1),[i,Q]=n.useState("loykrathong-2025"),{t:_}=xt(["liteAngpowRain"]),[H,Z]=n.useState(0),Y=n.useRef(!1),$=n.useCallback(t=>{t.preventDefault()},[]),C=n.useCallback(()=>{document.removeEventListener("touchmove",$),document&&document.body&&(document.body.style.overscrollBehavior="",document.body.style.touchAction="",document.body.style.overflow="")},[$]),tt=n.useCallback(t=>{t.preventDefault(),t.stopPropagation(),C(),v(!1)},[]),et=n.useCallback(t=>{const{naturalHeight:e}=t.target;F({h:e});const o=window.innerHeight,a=Math.max(0,(o-e)/2);R(a)},[]),nt=S.useSelector(t=>t.language?.countryLanguageKey),j=S.useSelector(t=>t.language?.currentLanguage?.currency),ot=S.useSelector(t=>t.user?.account?.currency),D=S.useSelector(t=>t.user?.isLogin);n.useEffect(()=>{bt({countryLanguageKey:nt,currency:D&&ot||j,isLogin:D}).then(e=>{e?.isEnableAngpowRain&&e?.theme?(Q(yt[e.theme]),Z(e.rewardAngpowRainDTO?.availableClaims||0),v(!0)):v(!1)}).catch(e=>{e?.isEnableAngpowRain||v(!1)})},[]),n.useEffect(()=>()=>{C()},[C]);const[at,it]=n.useState(0),[rt,st]=n.useState(0),N=[`/public/html/default_whitelabel/shared-image/angpow-rain/${i}/angpow-floating-icon.gif`,`/public/html/default_whitelabel/shared-image/angpow-rain/${i}/angpow-floating-icon.webp`,`/public/html/default_whitelabel/shared-image/angpow-rain/${i}/angpow-floating-icon.png`],X=[`/public/html/default_whitelabel/shared-image/angpow-rain/${i}/angpow-floating-timer.png`,`/public/html/default_whitelabel/shared-image/angpow-rain/${i}/angpow-floating-timer.webp`,`/public/html/default_whitelabel/shared-image/angpow-rain/${i}/angpow-floating-timer.gif`,`/public/html/default_whitelabel/shared-image/angpow-rain/${i}/title-wrapper.png`,`/public/html/default_whitelabel/shared-image/angpow-rain/${i}/title-wrapper.webp`],ct=N[Math.min(at,N.length-1)],lt=X[Math.min(rt,X.length-1)];n.useEffect(()=>{const t=()=>{if(!p.h)return;const e=window.innerHeight,o=Math.max(0,(e-p.h)/2);R(o)};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[p.h]);const ut=()=>window.visualViewport?.height||window.innerHeight,k=n.useCallback(t=>{const e=ut(),o=b.current?.offsetHeight??p.h??0,a=x,c=Math.max(x,e-o-x);return Math.min(Math.max(a,t),c)},[x,p.h]),[r,gt]=n.useState(200),W=n.useCallback(()=>{const t=window.innerWidth||1024;return t<=360?120:t<=480?140:t<=768?160:t<=1024?180:200},[]);n.useEffect(()=>{const t=()=>gt(W());return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[W]);const mt=n.useCallback(t=>{const e=b.current;if(!e)return;t.target.setPointerCapture?.(t.pointerId);const o=e.getBoundingClientRect();d.current={x:t.clientX-o.left,y:t.clientY-o.top},w.current={x:t.clientX,y:t.clientY},h.current=!1,A(!0),u({x:o.left,y:o.top})},[]),dt=n.useCallback(t=>{if(!m)return;const e=window.innerWidth;let o=t.clientX-d.current.x,a=t.clientY-d.current.y;o=Math.min(Math.max(0,o),Math.max(0,e-r)),a=k(a);const c=Math.abs(t.clientX-w.current.x),g=Math.abs(t.clientY-w.current.y);(c>y||g>y)&&(h.current=!0),u({x:o,y:a})},[m,k,r]),wt=n.useCallback(t=>{m&&(t.target.releasePointerCapture?.(t.pointerId),A(!1),u(e=>{if(!e)return null;const o=window.innerWidth,a=e.x,c=o-(e.x+r),g=a<=c?"left":"right",z=g==="left"?f:o-r-f;return T(!0),u({x:z,y:e.y}),window.setTimeout(()=>{T(!1),u(null),G(g),R(e.y),M&&window.localStorage.setItem(M,JSON.stringify({side:g,top:e.y}))},U),e}))},[m,M,r,f]),ht=n.useCallback(t=>{const e=t.touches[0];if(!e)return;const o=b.current.getBoundingClientRect();d.current={x:e.clientX-o.left,y:e.clientY-o.top},w.current={x:e.clientX,y:e.clientY},h.current=!1,A(!0),u({x:o.left,y:o.top}),document.addEventListener("touchmove",$,{passive:!1}),document.body.style.overscrollBehavior="contain",document.body.style.touchAction="none",document.body.style.overflow="hidden",Y.current=!0;const a=()=>{C(),Y.current=!1};window.addEventListener("touchend",a,{capture:!0,once:!0}),window.addEventListener("touchcancel",a,{capture:!0,once:!0})},[]),pt=n.useCallback(t=>{if(!m)return;const e=t.touches[0],o=window.innerWidth;let a=e.clientX-d.current.x,c=e.clientY-d.current.y;a=Math.min(Math.max(0,a),Math.max(0,o-r)),c=k(c);const g=Math.abs(e.clientX-w.current.x),z=Math.abs(e.clientY-w.current.y);(g>y||z>y)&&(h.current=!0),u({x:a,y:c})},[m,k,r]),ft=n.useCallback(t=>{if(h.current){t.preventDefault(),t.stopPropagation(),h.current=!1;return}I.push("/angpow-rain")},[I]),L={"--w":`${r}px`,"--h":"auto","--y":`${J}px`,"--edge":`${f}px`,"--z":V};
1return E&&(L.left=`${E.x}px`,L.top=`${E.y}px`),B==="/angpow-rain"||B.endsWith("/angpow-rain")||!q?null:s.jsxs("div",{ref:b,role:"button",tabIndex:0,"data-side":O,onPointerDown:mt,onPointerMove:dt,onPointerUp:wt,onTouchStart:ht,onTouchMove:pt,onClick:ft,className:`${l?.angpowFloating} angpowFloating ${K?`isAnimating ${l?.isAnimating}`:""}`,style:L,children:[s.jsx("button",{type:"button",className:l.closeBtn,"aria-label":"Close",onClick:tt,onPointerDown:t=>{t.preventDefault(),t.stopPropagation()},children:s.jsx("span",{"aria-hidden":!0,children:"×"})}),s.jsxs("div",{children:[s.jsx("img",{src:ct,alt:"floating-angpow",onLoad:et,onError:()=>it(t=>t+1),className:l.img,draggable:!1}),r>=180&&s.jsx("div",{className:`wording ${l?.[`${i}-wording`]}`,children:D?_("liteAngpowRain:youHaveClaim",{amount:H||0,defaultValue:"Click to Claim"}):_("liteAngpowRain:clickToClaim","Click to Claim")})]}),s.jsxs("div",{className:l?.countDownContainer,children:[s.jsx("img",{className:l?.countDownImg,src:lt,alt:"Countdown timer",onError:()=>st(t=>t+1),draggable:!1}),r>=180?s.jsx(vt,{showDescription:!1,countDownClassName:`countDownBox ${l?.[`${i}-countDownBox`]}`}):s.jsx("span",{className:l?.countDownBox,children:D?`${H} ${_("liteAngpowRain:claim","Claim")}`:_("liteAngpowRain:claim","Claim")})]})]})}export{Nt as default};

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.