@truelab/truelogic 3.13.1-0 → 3.13.1-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/631.min.js +1 -1
- package/dist/truelogic.min.js +1 -1
- package/dist/types/src/app/store.d.ts +50 -50
- package/dist/types/src/entities/autoplay/model/autoPlaySlice.d.ts +12 -12
- package/dist/types/src/entities/bonus/model/bonusSlice.d.ts +60 -60
- package/dist/types/src/entities/bonus/ui/BonusConfirmButtonPro/BonusConfirmButtonPro.stories.d.ts +3 -3
- package/dist/types/src/modules/external-ui/shared/types.d.ts +21 -57
- package/dist/types/src/modules/promoLobby/app/store/promoLobbyStore.d.ts +0 -5
- package/dist/types/src/modules/promoLobby/app/store/reduxContext.d.ts +0 -3
- package/dist/types/src/modules/promoLobby/entities/notification/index.d.ts +1 -1
- package/dist/types/src/modules/promoLobby/entities/notification/model/notificationSlice.d.ts +1 -9
- package/dist/types/src/modules/promoLobby/entities/prizeDrop/index.d.ts +1 -1
- package/dist/types/src/modules/promoLobby/entities/prizeDrop/model/prizeDropSlice.d.ts +1 -0
- package/dist/types/src/modules/promoLobby/entities/wallet/index.d.ts +1 -1
- package/dist/types/src/modules/promoLobby/entities/wallet/model/types.d.ts +1 -0
- package/dist/types/src/modules/promoLobby/entities/wallet/model/walletSlice.d.ts +5 -1
- package/dist/types/src/modules/promoLobby/shared/lib/hooks/useHasNotifications.d.ts +31 -6
- package/dist/types/src/modules/promoLobby/shared/lib/tests/utils/getPreloadedState.d.ts +0 -1
- package/dist/types/src/modules/promoLobby/shared/lib/tests/utils/setupTestStore.d.ts +0 -2
- package/dist/types/src/sandbox/config.d.ts +1 -1
- package/dist/types/src/sandbox/externalPanel.d.ts +4 -2
- package/dist/types/src/sandbox/presets/index.d.ts +2 -0
- package/dist/types/src/sandbox/presets/prizeDrop/campaignsList.d.ts +2 -0
- package/dist/types/src/sandbox/presets/prizeDrop/lobbyInit.d.ts +3 -0
- package/dist/types/src/shared/api/modules/promoLobby/prizeDrop/lobbyInit.d.ts +1 -0
- package/dist/types/src/shared/lib/singletones/gameEmitter.d.ts +5 -3
- package/dist/types/src/shared/lib/store/redux.d.ts +24 -24
- package/dist/types/src/shared/lib/tests/utils/getPreloadedState.d.ts +12 -12
- package/dist/types/src/shared/lib/tests/utils/setupTestStore.d.ts +24 -24
- package/dist/types/src/shared/model/initResponse/initResponseSlice.d.ts +2 -2
- package/dist/types/src/truelogic.d.ts +36 -8
- package/package.json +2 -12
- package/dist/types/src/index.d.ts +0 -50
- package/dist/types/src/modules/external-ui/index.d.ts +0 -12
package/dist/631.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_truelab_truelogic=self.webpackChunk_truelab_truelogic||[]).push([[631],{9737:(e,t,a)=>{a.r(t),a.d(t,{PromoLobbyModule:()=>Ki,init:()=>Wi});var r=a(4848),i=a(8521);const n=a.p+"assets/coming-soon.378973f1d8788623bbe9.webp",s=a.p+"assets/true-coin.1428441fe478e319cb4e.webp",o=a.p+"assets/gradient-bg.ec5b14ea3eb84ebb40c2.jpg",l=a.p+"assets/prize-drop-item.2bf1291207de774584ad.webp",d=a.p+"assets/reward-icon.098bebd610501e5d7344.webp",c=a.p+"assets/bg-wallet.76604959187a933cb30d.jpg",p=a.p+"assets/safe.851b5630bbec8de3e5b1.webp",u=a.p+"assets/cash-prize.4ef22f77cafcace9ef38.webp",m=a.p+"assets/prize-drop-bg-event-landscape.62d513476fec0a205481.webp",h=a.p+"assets/prize-drop-bg-event-portrait.3d627778db401fff49c0.webp",f=a.p+"assets/prize-drop-logo.b4d8a5270f8092b9f573.webp";var g=a(6540),v=a(1468);const x=(0,g.createContext)(null),b=(0,v.iI)(x).withTypes(),w=(0,v.jO)(x).withTypes();var y=a(4644),j=a(38),D=a(1370),C=a(6901),z=a(3588);const N=(e,t)=>{e.screenHistory.push(t)},E=(0,z.Kr)({name:"promoLobby",initialState:{activeScreen:"true-world",topBarScreen:null,screenHistory:[],lang:null},reducers:e=>({setPromoLobbyActiveScreen:e.reducer((e,t)=>{const a=t.payload;e.activeScreen===a&&null===e.topBarScreen||("true-world"===a?e.screenHistory=[]:N(e,{activeScreen:e.activeScreen,topBarScreen:e.topBarScreen})),e.topBarScreen=null,e.activeScreen=a}),setPromoLobbyLang:e.reducer((e,t)=>{e.lang=t.payload}),setPromoLobbyTopBarScreen:e.reducer((e,t)=>{const a=t.payload;e.topBarScreen===a||N(e,{activeScreen:e.activeScreen,topBarScreen:e.topBarScreen}),e.topBarScreen=a}),navigateBack:e.reducer(e=>{const t=e.screenHistory.pop();t&&(e.activeScreen=t.activeScreen,e.topBarScreen=t.topBarScreen,"true-world"===t.activeScreen&&null===t.topBarScreen&&(e.screenHistory=[]))}),resetPromoLobbyScreen:e.reducer(e=>{e.activeScreen="true-world",e.topBarScreen=null,e.screenHistory=[]})}),selectors:{getActiveScreen:e=>e.activeScreen}}),{setPromoLobbyActiveScreen:P,setPromoLobbyLang:S,setPromoLobbyTopBarScreen:k,navigateBack:O,resetPromoLobbyScreen:R}=E.actions,{getActiveScreen:I}=E.selectors,B=E.reducer;var L=a(874),_=a(7542);const M={hasOpenedLobbyOnce:!1,viewedRewardDropIds:[],viewedCampaignIds:[]},T=(0,D.l1)(e=>{var t,a,r;return Object.assign(Object.assign({},M),{hasOpenedLobbyOnce:null!==(t=null==e?void 0:e.hasOpenedLobbyOnce)&&void 0!==t&&t,viewedRewardDropIds:null!==(a=null==e?void 0:e.viewedRewardDropIds)&&void 0!==a?a:[],viewedCampaignIds:null!==(r=null==e?void 0:e.viewedCampaignIds)&&void 0!==r?r:[]})},e=>{var t,a,r;return Object.assign(Object.assign({},M),{hasOpenedLobbyOnce:null!==(t=null==e?void 0:e.hasOpenedLobbyOnce)&&void 0!==t&&t,viewedRewardDropIds:null!==(a=null==e?void 0:e.viewedRewardDropIds)&&void 0!==a?a:[],viewedCampaignIds:null!==(r=null==e?void 0:e.viewedCampaignIds)&&void 0!==r?r:[]})},{whitelist:["notification"]}),A=(0,z.Kr)({name:"notification",initialState:M,reducers:e=>({markNotificationLobbyViewed:e.reducer(e=>{e.hasOpenedLobbyOnce=!0}),markNotificationRewardViewed:e.reducer((e,t)=>{e.viewedRewardDropIds.includes(t.payload)||e.viewedRewardDropIds.push(t.payload)}),markNotificationRewardsViewed:e.reducer((e,t)=>{t.payload.forEach(t=>{e.viewedRewardDropIds.includes(t)||e.viewedRewardDropIds.push(t)})}),clearNotificationViewedReward:e.reducer((e,t)=>{e.viewedRewardDropIds=e.viewedRewardDropIds.filter(e=>e!==t.payload)}),markNotificationCampaignViewed:e.reducer((e,t)=>{e.viewedCampaignIds.includes(t.payload)||e.viewedCampaignIds.push(t.payload)}),markNotificationCampaignsViewed:e.reducer((e,t)=>{t.payload.forEach(t=>{e.viewedCampaignIds.includes(t)||e.viewedCampaignIds.push(t)})}),clearNotificationViewedCampaign:e.reducer((e,t)=>{e.viewedCampaignIds=e.viewedCampaignIds.filter(e=>e!==t.payload)})})}),{markNotificationLobbyViewed:F,markNotificationRewardViewed:U,markNotificationRewardsViewed:$,clearNotificationViewedReward:Y,markNotificationCampaignViewed:V,markNotificationCampaignsViewed:G,clearNotificationViewedCampaign:H}=A.actions,J=A.reducer;var W=a(748);const K=(0,z.Kr)({name:"wallet",initialState:{isWalletAvailable:!0,trueDecimal:2,trueSessionRate:null,wallets:[]},reducers:e=>({setWallets:e.reducer((e,t)=>{e.wallets=t.payload}),setWalletAvailability:e.reducer((e,t)=>{e.isWalletAvailable=t.payload}),setTrueSessionRate:e.reducer((e,t)=>{e.trueSessionRate=t.payload}),incrementWalletBalance:e.reducer((e,t)=>{const a=e.wallets[0];if(a){const e=parseFloat(a.balance)||0;a.balance=String(e+t.payload)}})}),selectors:{getActiveWallet:e=>e.wallets[0],getIsWalletAvailable:e=>e.isWalletAvailable,getTrueSessionRate:e=>{var t,a,r;return null!==(a=null===(t=e.wallets[0])||void 0===t?void 0:t.sessionRate)&&void 0!==a?a:null===(r=e.trueSessionRate)||void 0===r?void 0:r.rate}}}),{incrementWalletBalance:Q,setTrueSessionRate:q,setWalletAvailability:X,setWallets:Z}=K.actions,{getActiveWallet:ee,getIsWalletAvailable:te,getTrueSessionRate:ae}=K.selectors,re=K.reducer;var ie=a(4554),ne=a(5478),se=a(4218),oe=a(9617);const le=["prizeDropCongratulation","prizeDropClaimed","prizeDropClaimedSuccess","prizeDropClaimedFailed","prizeDropClaimedExpired","prizeDropSuccess","prizeDropResultFinished","prizeDropResultCancelled","prizeDropLive","prizeDropJoinError"],de=e=>le.includes(e),ce=(0,j.Z0)({name:"modals",initialState:{hasOpened:!1,current:[],isModalReady:!0},reducers:{setIsModalReady(e,t){e.isModalReady=t.payload},setHasOpened(e,t){e.hasOpened=t.payload},addCurrent(e,t){e.current.push(t.payload)},focusModal(e,t){e.current=e.current.filter(e=>e!==t.payload),e.current.push(t.payload)},closeModalSlice(e,t){(null==t?void 0:t.payload)?e.current=e.current.filter(e=>e!==t.payload):e.current=[],e.hasOpened=!!e.current.length},setModalReady(e){e.isModalReady=!0}},selectors:{getModalsIsModalMode:e=>e.isModalReady&&e.hasOpened,getCurrentModal:e=>e.current.at(-1)||null}}),{closeModalSlice:pe,setModalReady:ue,setIsModalReady:me,setHasOpened:he,addCurrent:fe,focusModal:ge}=ce.actions,{getModalsIsModalMode:ve,getCurrentModal:xe}=ce.selectors,be=ce.reducer,we=e=>(t,a,r)=>{const{current:i}=a().modals;r.mainDispatch((0,se.Xm)(!0)),de(e)&&(r.mainDispatch((0,W.M5)()),r.mainDispatch((0,se.lX)(!0))),i.includes(e)?t(ge(e)):(ne.h$.emit("modal:opened",e),t(he(!0)),t(fe(e)))},ye=e=>(t,a,r)=>{"promoLobby"===e&&(t(R()),r.mainDispatch((0,oe.Pp)(!1))),t(pe(e));const i=a().modals.current,n=i.length<1,s=i.some(de);r.mainDispatch((0,se.lX)(s)),n&&r.mainDispatch((0,se.Xm)(!1))};var je,De=a(1128);!function(e){e.CAMPAIGN_UPDATED="campaignUpdated",e.DROP="drop",e.WALLET_STATUS="walletStatus"}(je||(je={}));const Ce=new class{constructor(){this.socket=null,this.callbacks=new Map}connect({url:e,token:t,transports:a}){return e&&t?(this.socket&&(this.socket.removeAllListeners(),this.socket.disconnect()),new Promise((r,i)=>{const n={auth:{token:t}};a&&(n.transports=a),this.socket=(0,De.io)(e,n),this.socket.once("connect",()=>{ne.vF.socketEvent("Socket.io connected"),r()}),this.socket.once("connect_error",e=>{ne.vF.socketEvent("Socket.io connection error",e),i(e)}),this.socket.once("error",e=>{ne.vF.socketEvent("Socket.io error",e),i(e)}),this.socket.on("reconnect_attempt",e=>ne.vF.socketEvent(`Socket.io trying to reconnect (#${e})`)),this.socket.on("reconnect_error",e=>ne.vF.socketEvent("Socket.io retry failed:",e)),this.socket.on("reconnect_failed",()=>ne.vF.socketEvent("Socket.io all retries exhausted")),this.socket.onAny((e,t)=>{const a={type:e,payload:t,timestamp:Date.now()};this.emit(e,a)}),this.socket.on("disconnect",e=>{ne.vF.socketEvent("Socket.io disconnected",e)})})):Promise.reject(new Error("Url or token not provided"))}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null)}send(e){this.socket&&this.socket.connected?this.socket.emit(e.type,e.payload):ne.vF.socketEvent("Socket.io not connected. Unable to send:",e)}on(e,t){this.callbacks.has(e)||this.callbacks.set(e,new Set),this.callbacks.get(e).add(t)}off(e,t){var a;null===(a=this.callbacks.get(e))||void 0===a||a.delete(t)}emit(e,t){var a;ne.vF.socketEvent(e,t.payload),null===(a=this.callbacks.get(e))||void 0===a||a.forEach(e=>e(t))}};var ze=a(3178);const Ne={ERR_UNKNOWN:{message:"General error: unknow error occured",languageKey:"LOBBY.100"},ERR_FORBIDDEN:{message:"General error: operation is forbidden",languageKey:"LOBBY.101"},ERR_TRUE_WALLET_API:{message:"Error occured while claiming reward (on Wallet side)",languageKey:"LOBBY.102"},ERR_DROP_CLAIM_NOT_ALLOWED:{message:"User tried to claim the wrong reward",languageKey:"LOBBY.103"},ERR_DROP_EXPIRED:{message:"Reward claim period expired",languageKey:"LOBBY.104"},ERR_DROP_ALREADY_CLAIMED:{message:"Reward already claimed",languageKey:"LOBBY.105"},ERR_DROP_CLAIM_FAILED:{message:"Error occured while claiming reward (on PM side)",languageKey:"LOBBY.106"},ERR_CAMPAIGN_NOT_FOUND:{message:"Campaign not found (it was cancelled or expired)",languageKey:"LOBBY.107"},ERR_CAMPAIGN_NOT_AVAILABLE:{message:"Campaign is not available for the user (possible reasons: not valid operator, brand, game, currency or country, or campaign has specific allowed players list)",languageKey:"LOBBY.108"},ERR_CAMPAIGN_ALREADY_JOINED:{message:"User has already joined this campaign",languageKey:"LOBBY.109"},ERR_CAMPAIGN_JOIN_ONCE:{message:"User has already joined to another RUNNING campaign",languageKey:"LOBBY.110"},ERR_TRUE_WALLET_UNAVAILABLE:{message:"Reward claim is temporarily unavailable due to a technical issue. Please try again later.",languageKey:"LOBBY.111"},ERR_DROP_CLAIM_WALLET_RETRY_COOLDOWN:{message:"Too many requests. Please wait before sending another claim request.",languageKey:"LOBBY.112"}},Ee=(e,t,a,...r)=>{return i=void 0,n=[e,t,a,...r],o=function*(e,t,a,r=null,i={}){var n,s;const o=new Headers;o.append("Content-Type","application/json"),o.append("Authorization",`Bearer ${a}`);const l={method:e,headers:o};r&&(l.body=JSON.stringify(r));const d=new URL(t);d.search=new URLSearchParams(i).toString();const c=d.toString(),{data:p,error:u}=yield(0,L.TX)((0,L.L5)(()=>fetch(c,l)));if(u)throw(0,ze.Xm)(u),new Error("There were problems with connection, please restart the game");if(!p.ok){const e={message:`HTTP error: ${p.status}`,languageKey:null};try{const t=yield p.json();(null===(n=t.error)||void 0===n?void 0:n.message)&&(e.message=t.error.message),(null===(s=t.error)||void 0===s?void 0:s.code)&&Object.assign(e,(e=>{var t,a;return{code:e,message:(null===(t=Ne[e])||void 0===t?void 0:t.message)||"Something went wrong",languageKey:(null===(a=Ne[e])||void 0===a?void 0:a.languageKey)||null}})(t.error.code))}catch(e){}finally{throw new Error(e.message,{cause:e})}}return yield p.json()},new((s=void 0)||(s=Promise))(function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function r(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s(function(e){e(i)})).then(a,r)}l((o=o.apply(i,n||[])).next())});var i,n,s,o};var Pe=function(e,t,a,r){return new(a||(a=Promise))(function(i,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function o(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,o)}l((r=r.apply(e,t||[])).next())})};const Se=["prizeDropCongratulation","prizeDropClaimed","prizeDropClaimedSuccess","prizeDropClaimedFailed","prizeDropClaimedExpired"],ke=[...Se,"prizeDropResultFinished","prizeDropResultCancelled"],Oe=e=>{if("true"!==e.drop.prize.type)return"prizeDropCongratulation";switch(e.claimUiStatus){case"pending":default:return"prizeDropClaimed";case"success":return"prizeDropClaimedSuccess";case"error":return"prizeDropClaimedFailed";case"expired":return"prizeDropClaimedExpired"}},Re=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),Ie=e=>{if(!Re(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},Be=e=>e instanceof Error&&Re(e.cause)?Ie(e.cause):null,Le={campaigns:[],activeCampaign:null,displayedCampaign:null,rewardHubDrops:[],dropsQueue:[],campaignsQueue:[],prizeDropLiveShownCampaignIds:[],apiLobbyInit:{data:null,isPending:!1,error:null,fake:null},apiJoinCampaign:{data:null,isPending:!1,error:null,fake:null},apiClaim:{data:null,isPending:!1,error:null,fake:null},socketConnection:{data:null,isSuccess:!1,isPending:!1,error:null,fake:null}},_e=(0,D.l1)(e=>{var t;return Object.assign(Object.assign({},Le),{prizeDropLiveShownCampaignIds:null!==(t=null==e?void 0:e.prizeDropLiveShownCampaignIds)&&void 0!==t?t:[]})},e=>{var t;return Object.assign(Object.assign({},Le),{prizeDropLiveShownCampaignIds:null!==(t=null==e?void 0:e.prizeDropLiveShownCampaignIds)&&void 0!==t?t:[]})},{whitelist:["prizeDrop"]}),Me=(0,z.Kr)({name:"prizeDrop",initialState:Le,reducers:e=>({setPrizeDropRestData:e.reducer((e,t)=>{e.restData=t.payload}),setPrizeDropCampaigns:e.reducer((e,t)=>{e.campaigns=t.payload}),setPrizeDropActiveCampaign:e.reducer((e,t)=>{e.activeCampaign=t.payload}),setPrizeDropDisplayedCampaign:e.reducer((e,t)=>{e.displayedCampaign=t.payload}),setPrizeDropSocketEventCampaignUpdated:e.reducer((e,t)=>{var a,r;const i=t.payload,n=e.campaigns.map(e=>{var t,a;return e.campaignId===i.campaignId?Object.assign(Object.assign({},e),{status:i.status,prizesLeftCount:null!==(t=i.prizesLeftCount)&&void 0!==t?t:e.prizesLeftCount,winnersCount:null!==(a=i.winnersCount)&&void 0!==a?a:e.winnersCount,prizes:i.prizes.length>0?e.prizes.map(e=>{const t=i.prizes.find(t=>t.prizeId===e.prizeId);return t?Object.assign(Object.assign({},e),t):e}):e.prizes}):e});e.campaigns=n;const s=e.campaigns.find(e=>e.campaignId===i.campaignId);(null===(a=e.displayedCampaign)||void 0===a?void 0:a.campaignId)===i.campaignId&&s&&(e.displayedCampaign=s),(null===(r=null==e?void 0:e.activeCampaign)||void 0===r?void 0:r.campaignId)===i.campaignId&&("finished"===i.status||"cancelled"===i.status?e.activeCampaign=null:e.activeCampaign=s)}),setPrizeDropSocketEventDrop:e.reducer((e,t)=>{const a=t.payload.drops[0];e.winDropItem=a}),setPrizeDropRewardHubDrops:e.reducer((e,t)=>{e.rewardHubDrops=[...e.rewardHubDrops,...t.payload.filter(t=>!e.rewardHubDrops.some(e=>e.dropId===t.dropId))]}),setPrizeDropWinItem:e.reducer((e,t)=>{e.winDropItem=t.payload}),clearPrizeDropWinItem:e.reducer(e=>{e.winDropItem=null}),setApiPrizeDropLobbyInitFake:e.reducer((e,t)=>{e.apiLobbyInit.fake=t.payload}),setApiPrizeDropJoinCampaignFake:e.reducer((e,t)=>{e.apiJoinCampaign.fake=t.payload}),setApiPrizeDropClaimFake:e.reducer((e,t)=>{e.apiClaim.fake=t.payload}),setPrizeDropSocketFake:e.reducer((e,t)=>{e.socketConnection.fake=t.payload}),setPrizeDropDefferedModal:e.reducer((e,t)=>{e.hasDefferedModal=t.payload}),joinPrizeDropCampaign:e.reducer((e,t)=>{t.payload.campaignId===e.displayedCampaign.campaignId&&(e.activeCampaign=e.displayedCampaign,e.activeCampaign.joined=!0)}),clearPrizeDropJoinCampaignError:e.reducer(e=>{e.apiJoinCampaign.error=null}),clearPrizeDropClaimData:e.reducer(e=>{e.apiClaim.data=null,e.apiClaim.error=null,e.apiClaim.isPending=!1}),clearPrizeDropRewardHubItem:e.reducer((e,t)=>{e.rewardHubDrops=e.rewardHubDrops.filter(e=>e.dropId!==t.payload)}),setPrizeDropDefferedCampaign:e.reducer((e,t)=>{e.defferedCampaign=t.payload}),clearPrizeDropDefferedCampaign:e.reducer(e=>{e.defferedCampaign=null}),addPrizeDropDropsToQueue:e.reducer((e,t)=>{t.payload.forEach(t=>{const a="pending",r=e.dropsQueue.findIndex(e=>e.drop.dropId===t.dropId);let i;if(r>=0){const n=e.dropsQueue[r];let s=a;"success"===n.claimUiStatus||"error"===n.claimUiStatus?s=n.claimUiStatus:"expired"===n.claimUiStatus&&(s="expired"),i={drop:t,claimUiStatus:s},e.dropsQueue.splice(r,1)}else i={drop:t,claimUiStatus:a};e.dropsQueue.unshift(i)})}),removePrizeDropFromDropsQueueById:e.reducer((e,t)=>{e.dropsQueue=e.dropsQueue.filter(e=>e.drop.dropId!==t.payload)}),updatePrizeDropQueueEntryClaimUiStatus:e.reducer((e,t)=>{const a=e.dropsQueue.find(e=>e.drop.dropId===t.payload.dropId);a&&(a.claimUiStatus=t.payload.claimUiStatus)}),setPrizeDropCampaignsQueue:e.reducer((e,t)=>{e.campaignsQueue=t.payload}),shiftPrizeDropFromCampaignsQueue:e.reducer(e=>{e.campaignsQueue=e.campaignsQueue.slice(1)}),clearPrizeDropCampaignsQueue:e.reducer(e=>{e.campaignsQueue=[]}),addPrizeDropLiveShownCampaignId:e.reducer((e,t)=>{e.prizeDropLiveShownCampaignIds.includes(t.payload)||e.prizeDropLiveShownCampaignIds.push(t.payload)}),fetchApiPrizeDropLobbyInit:e.asyncThunk((e,t)=>Pe(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,i,n,s,o;const l=a(),d=null===(r=l.prizeDrop.apiLobbyInit.fake)||void 0===r?void 0:r.enabled,c=null===(n=null===(i=l.prizeDrop)||void 0===i?void 0:i.restData)||void 0===n?void 0:n.token,p=null===(o=null===(s=l.prizeDrop)||void 0===s?void 0:s.restData)||void 0===o?void 0:o.url,u=l.promoLobby.lang;if(d){const e=l.prizeDrop.apiLobbyInit.fake;return yield(0,L.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!p||!c)throw Error("Endpoint or token not provided");try{return yield Ee("GET",`${p}/lobby/init`,c,e,{lang:u})}catch(e){const a=Be(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiLobbyInit.isPending=!0,e.apiLobbyInit.error=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:i}=Ie(t.payload);e.apiLobbyInit.isPending=!1,e.apiLobbyInit.error={name:a,message:r,code:a,languageKey:i}},fulfilled:(e,t)=>{e.apiLobbyInit.isPending=!1,e.apiLobbyInit.data=t.payload}}),fetchApiPrizeDropJoinCampaign:e.asyncThunk((e,t)=>Pe(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,i,n,s,o;const l=a(),d=null===(r=l.prizeDrop.apiJoinCampaign.fake)||void 0===r?void 0:r.enabled,c=null===(n=null===(i=l.prizeDrop)||void 0===i?void 0:i.restData)||void 0===n?void 0:n.url,p=null===(o=null===(s=l.prizeDrop)||void 0===s?void 0:s.restData)||void 0===o?void 0:o.token;if(d){const e=l.prizeDrop.apiJoinCampaign.fake;return yield(0,L.yy)(e.delay),e.hasError&&e.countRetries?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!c||!p)throw Error("Endpoint or token not provided");try{return yield Ee("POST",`${c}/campaign/join`,p,e)}catch(e){const a=Be(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiJoinCampaign.isPending=!0,e.apiJoinCampaign.error=null,e.apiJoinCampaign.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:i}=Ie(t.payload);e.apiJoinCampaign.isPending=!1,e.apiJoinCampaign.error={name:a,message:r,code:a,languageKey:i},e.apiJoinCampaign.data=null;const n=e.apiJoinCampaign.fake;(null==n?void 0:n.enabled)&&(null==n?void 0:n.countRetries)>0&&(n.countRetries-=1,e.apiJoinCampaign.fake=n)},fulfilled:(e,t)=>{e.apiJoinCampaign.isPending=!1,e.apiJoinCampaign.data=t.payload}}),fetchApiPrizeDropClaim:e.asyncThunk((e,t)=>Pe(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,i,n,s,o;const l=a(),d=null===(r=l.prizeDrop.apiClaim.fake)||void 0===r?void 0:r.enabled,c=null===(n=null===(i=l.prizeDrop)||void 0===i?void 0:i.restData)||void 0===n?void 0:n.url,p=null===(o=null===(s=l.prizeDrop)||void 0===s?void 0:s.restData)||void 0===o?void 0:o.token;if(d){const e=l.prizeDrop.apiClaim.fake;return yield(0,L.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!c||!p)throw Error("Endpoint or token not provided");try{return yield Ee("POST",`${c}/drop/${e.dropId}/claim`,p,e)}catch(e){const a=Be(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiClaim.isPending=!0,e.apiClaim.error=null,e.apiClaim.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:i}=Ie(t.payload);e.apiClaim.isPending=!1,e.apiClaim.error={name:a,message:r,code:a,languageKey:i},e.apiClaim.data=null;const n=e.apiClaim.fake;(null==n?void 0:n.enabled)&&(null==n?void 0:n.countRetries)>0&&(n.countRetries-=1,e.apiClaim.fake=n)},fulfilled:(e,t)=>{e.apiClaim.isPending=!1,e.apiClaim.data=t.payload}}),connectPrizeDropSocketService:e.asyncThunk((e,t)=>Pe(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,i;const n=a(),s=null===(r=n.prizeDrop.apiLobbyInit.data)||void 0===r?void 0:r.credentials;if(!s)throw Error("Socket credentials not provided (lobby init response)");const{url:o,token:l,transports:d}=s;if(null===(i=n.prizeDrop.apiLobbyInit.fake)||void 0===i?void 0:i.enabled){const e=n.prizeDrop.socketConnection.fake;return yield(0,L.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):void 0}yield Ce.connect({url:o,token:l,transports:d})}),{pending:e=>{e.socketConnection.isPending=!0,e.socketConnection.isSuccess=!1,e.socketConnection.error=null},rejected:(e,t)=>{var a,r;e.socketConnection.isPending=!1,e.socketConnection.isSuccess=!1,e.socketConnection.error={name:(null===(a=t.error)||void 0===a?void 0:a.name)||"Oops",message:(null===(r=t.error)||void 0===r?void 0:r.message)||"Something went wrong"}},fulfilled:e=>{e.socketConnection.isPending=!1,e.socketConnection.isSuccess=!0,e.socketConnection.error=null}})}),selectors:{isPrizeDropActive:e=>e.activeCampaign&&"cancelled"!==e.activeCampaign.status,getPrizeDropMode:(e,t)=>{const a=e.campaigns.find(e=>e.campaignId===t);if(a){if("scheduled"===a.status)return"upcoming";if("running"===a.status)return"live"}return"ended"},isPrizeDropJoined:e=>{var t;return null===(t=null==e?void 0:e.activeCampaign)||void 0===t?void 0:t.joined},getPrizeDropMaxPrize:e=>{const{prizes:t}=e.displayedCampaign,a=t.find(e=>null==e?void 0:e.topPrize);return!a&&t.length>0?t[0]:a},hasPrizeDropActiveCampaign:e=>{var t,a,r;return(null===(t=null==e?void 0:e.activeCampaign)||void 0===t?void 0:t.joined)&&(null===(a=null==e?void 0:e.activeCampaign)||void 0===a?void 0:a.campaignId)!==(null===(r=null==e?void 0:e.displayedCampaign)||void 0===r?void 0:r.campaignId)},displayPrizeDropJoinButton:e=>{var t,a,r,i;return"running"===(null===(t=null==e?void 0:e.displayedCampaign)||void 0===t?void 0:t.status)&&((null===(a=null==e?void 0:e.displayedCampaign)||void 0===a?void 0:a.campaignId)!==(null===(r=null==e?void 0:e.activeCampaign)||void 0===r?void 0:r.campaignId)||!(null===(i=null==e?void 0:e.activeCampaign)||void 0===i?void 0:i.joined))}}}),{setPrizeDropActiveCampaign:Te,setPrizeDropDisplayedCampaign:Ae,setPrizeDropSocketEventCampaignUpdated:Fe,setPrizeDropSocketEventDrop:Ue,setPrizeDropWinItem:$e,clearPrizeDropWinItem:Ye,setApiPrizeDropLobbyInitFake:Ve,setApiPrizeDropJoinCampaignFake:Ge,setApiPrizeDropClaimFake:He,setPrizeDropRestData:Je,fetchApiPrizeDropLobbyInit:We,fetchApiPrizeDropJoinCampaign:Ke,fetchApiPrizeDropClaim:Qe,connectPrizeDropSocketService:qe,setPrizeDropSocketFake:Xe,setPrizeDropDefferedModal:Ze,joinPrizeDropCampaign:et,setPrizeDropDefferedCampaign:tt,clearPrizeDropDefferedCampaign:at,addPrizeDropDropsToQueue:rt,removePrizeDropFromDropsQueueById:it,updatePrizeDropQueueEntryClaimUiStatus:nt,setPrizeDropCampaignsQueue:st,shiftPrizeDropFromCampaignsQueue:ot,clearPrizeDropCampaignsQueue:lt,addPrizeDropLiveShownCampaignId:dt,clearPrizeDropJoinCampaignError:ct,setPrizeDropCampaigns:pt,setPrizeDropRewardHubDrops:ut,clearPrizeDropClaimData:mt,clearPrizeDropRewardHubItem:ht}=Me.actions,{isPrizeDropActive:ft,getPrizeDropMode:gt,isPrizeDropJoined:vt,getPrizeDropMaxPrize:xt,hasPrizeDropActiveCampaign:bt,displayPrizeDropJoinButton:wt}=Me.selectors,yt=Me.reducer,jt=e=>(t,a,r)=>{const i=a(),n=r.mainGetState().play.isActive;e.drops.forEach(e=>{"true"===e.prize.type&&t(ut([e]))});const s=e.drops.filter(e=>e.direct);if(0===s.length)return;if(s.forEach(e=>{ne.h$.emit("prizeDrop:won",(0,ie.ym)(e))}),n){t(rt(s));const e=s[s.length-1];return t($e(e)),void t(Ze(!0))}t(rt(s));const o=a().prizeDrop.dropsQueue[0];return o?i.modals.current.some(e=>Se.includes(e))?(a().modals.current.filter(e=>Se.includes(e)).forEach(e=>{t(ye(e))}),t(mt()),t($e(o.drop)),void t(we(Oe(o)))):(t($e(o.drop)),void t(we(Oe(o)))):void 0},Dt=e=>(t,a,r)=>{const{displayedCampaign:i}=a().prizeDrop;(null==i?void 0:i.campaignId)&&"prizeDropJoinError"!==e&&t(dt(i.campaignId)),t(ye(e)),t(ot());const{campaignsQueue:n}=a().prizeDrop,s=n[0];s&&(t(Ae(s)),r.mainDispatch((0,W.M5)()),t(we("prizeDropLive")))},Ct=e=>(t,a,r)=>{var i;const n=null===(i=a().prizeDrop.winDropItem)||void 0===i?void 0:i.dropId;t(ye(e)),n&&t(it(n)),t(Ye()),t(mt());const{dropsQueue:s}=a().prizeDrop,o=s[0];o&&(t($e(o.drop)),t(we(Oe(o)))),r.mainDispatch((0,W.M5)())};const zt=(0,z.Kr)({name:"transaction",initialState:{transactions:[],hasMore:!1,currentPage:1,apiTransactions:{data:null,isPending:!1,error:null,fake:null}},reducers:e=>({setApiTransactionsFake:e.reducer((e,t)=>{var a;e.apiTransactions.fake=null!==(a=t.payload)&&void 0!==a?a:null}),clearTransactions:e.reducer(e=>{e.transactions=[],e.hasMore=!1,e.currentPage=1}),addTransaction:e.reducer((e,t)=>{const{amount:a,dropId:r}=t.payload,i={transactionId:`optimistic-${r}`,createdAt:(new Date).toISOString(),status:"completed",type:"top-up",subType:"prizedrop",amount:a};e.transactions=[i,...e.transactions]}),fetchApiTransactions:e.asyncThunk((e,t)=>{return a=void 0,r=[e,t],n=function*(e,{rejectWithValue:t,getState:a}){var r,i,n,s,o,l;const d=a(),c=null===(r=d.transaction.apiTransactions.fake)||void 0===r?void 0:r.enabled,p=null===(n=null===(i=d.prizeDrop)||void 0===i?void 0:i.restData)||void 0===n?void 0:n.token,u=null===(o=null===(s=d.prizeDrop)||void 0===s?void 0:s.restData)||void 0===o?void 0:o.url;if(c){const{fake:e}=d.transaction.apiTransactions;return yield(0,L.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!p)throw Error("Endpoint or token not provided");const m=e&&"object"==typeof e&&"page"in e&&null!==(l=e.page)&&void 0!==l?l:1,h={};return m>1&&(h.page=String(m)),Ee("GET",`${u}/wallet/transactions`,p,null,h)},new((i=void 0)||(i=Promise))(function(e,t){function s(e){try{l(n.next(e))}catch(e){t(e)}}function o(e){try{l(n.throw(e))}catch(e){t(e)}}function l(t){var a;t.done?e(t.value):(a=t.value,a instanceof i?a:new i(function(e){e(a)})).then(s,o)}l((n=n.apply(a,r||[])).next())});var a,r,i,n},{pending:e=>{e.apiTransactions.isPending=!0,e.apiTransactions.error=null},rejected:(e,t)=>{e.apiTransactions.isPending=!1,e.apiTransactions.error={name:"Oops",message:"Something went wrong"}},fulfilled:(e,t)=>{var a;e.apiTransactions.isPending=!1;const{payload:r}=t;e.apiTransactions.data=r;const i=r.transactions.map(e=>{return t=e,Object.assign(Object.assign({},t),{amount:parseFloat(t.amount)||0});var t}),{arg:n}=t.meta,s=n&&"object"==typeof n&&"page"in n&&null!==(a=n.page)&&void 0!==a?a:1;1===s?(e.transactions=i,e.currentPage=1):e.transactions=[...e.transactions,...i],e.currentPage=s,e.hasMore=r.hasMore}})})}),{addTransaction:Nt,clearTransactions:Et,fetchApiTransactions:Pt,setApiTransactionsFake:St}=zt.actions,kt=zt.reducer;var Ot,Rt;const It=(0,y.HY)({modals:be,notification:J,prizeDrop:yt,promoLobby:B,transaction:kt,wallet:re}),Bt=(0,L.P3)("token"),Lt={key:`${null!==(Rt=null===(Ot=(0,_.p)(Bt))||void 0===Ot?void 0:Ot.gameId)&&void 0!==Rt?Rt:"sandbox"}:promoLobby`,storage:C.A,whitelist:["notification","prizeDrop"],transforms:[T,_e]},_t=(0,D.rL)(Lt,It),Mt={mainDispatch:(...e)=>{throw new Error("PromoLobby mainDispatch is not set. Ensure PromoLobbyProvider mounted inside main Provider.")},mainGetState:()=>{throw new Error("PromoLobby mainGetState is not set. Ensure PromoLobbyProvider mounted inside main Provider.")}},Tt=(0,j.U1)({reducer:_t,middleware:e=>e({serializableCheck:{ignoredActions:[D.ZM,D.r2,D.Hz,D.DY,D.Cq,D.eY]},thunk:{extraArgument:Mt}}),devTools:!1}),At=(0,D.GM)(Tt);var Ft=a(8131);const Ut=({children:e})=>{const t=(0,v.Pj)();return(0,g.useEffect)(()=>{var e;e={mainDispatch:t.dispatch,mainGetState:()=>t.getState()},Mt.mainDispatch=e.mainDispatch,Mt.mainGetState=e.mainGetState},[t]),(0,r.jsx)(Ft.Q,{loading:null,persistor:At,children:(0,r.jsx)(v.Kq,{store:Tt,context:x,children:e})})},$t=({children:e})=>(0,r.jsx)(Ut,{children:e});var Yt,Vt=a(9286),Gt=a(6942),Ht=a.n(Gt);function Jt(){return Jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Jt.apply(null,arguments)}const Wt=e=>g.createElement("svg",Jt({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 8 10"},e),Yt||(Yt=g.createElement("path",{fill:"#fff",d:"M1.083 0v3l1.944 2-1.944 2v3h5.833V7L4.972 5l1.944-2V0z"})));var Kt=a(2192);const Qt=({prizeDropMode:e,className:t})=>{const a=(0,Kt.Bd)();return(0,r.jsxs)("div",{className:Ht()("flex items-center gap-4 rounded-20 px-10 py-4","ended"===e&&"bg-add-gradient","live"===e&&"bg-green","upcoming"===e&&"bg-add-violet backdrop-blur-[20px]",t),children:["live"===e&&(0,r.jsx)("div",{className:"h-6 w-6 rounded-full bg-white"}),"upcoming"===e&&(0,r.jsx)(Wt,{className:"h-10 w-8"}),(0,r.jsxs)("span",{className:"text-xs-bold",children:["ended"===e&&a("LOBBY.014","Ended").toUpperCase(),"live"===e&&a("LOBBY.012","Live").toUpperCase(),"upcoming"===e&&a("LOBBY.013","Upcoming").toUpperCase()]})]})};var qt=a(6098),Xt=a(7052);const Zt=({onClick:e,isLoading:t,className:a="",text:i,loadingText:n,disabled:s=!1,size:o="middle"})=>(0,r.jsx)(qt.$,{className:Ht()("mx-auto w-full mp:max-w-530 ml:max-w-560",a),onClick:a=>!t&&e(a),disabled:s||t,size:o,children:t?(0,r.jsxs)("div",{className:"flex items-center gap-8",children:[(0,r.jsx)(Xt.k,{}),n]}):i}),ea=({onClick:e,isLoading:t,className:a="",disabled:i=!1})=>{const n=(0,Kt.Bd)();return(0,r.jsx)(Zt,{onClick:e,text:n("DROP.010","Join now"),loadingText:n("DROP.011","Joining..."),isLoading:t,className:a,disabled:i})};var ta,aa,ra,ia,na,sa,oa,la,da,ca;function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},pa.apply(null,arguments)}const ua=e=>g.createElement("svg",pa({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 32 32"},e),ta||(ta=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__a)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m-5.548 15.999L16 21.547l5.548-5.548L16 10.45z",clipRule:"evenodd"})),aa||(aa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__b)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 3.429C9.057 3.429 3.429 9.057 3.429 16S9.057 28.571 16 28.571 28.571 22.943 28.571 16 22.943 3.429 16 3.429",clipRule:"evenodd"})),ra||(ra=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__c)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 3.429C9.057 3.429 3.429 9.057 3.429 16S9.057 28.571 16 28.571 28.571 22.943 28.571 16 22.943 3.429 16 3.429",clipRule:"evenodd"})),ia||(ia=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__d)",d:"M16 2.857C23.26 2.857 29.143 8.74 29.143 16c0 7.258-5.884 13.143-13.143 13.143-7.258 0-13.143-5.885-13.143-13.143S8.742 2.857 16 2.857m0 .571C9.057 3.428 3.43 9.057 3.43 16S9.057 28.57 16 28.57 28.572 22.943 28.572 16 22.943 3.428 16 3.428"})),na||(na=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__e)",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 .571C7.479.571.571 7.48.571 16S7.48 31.429 16 31.429 31.429 24.52 31.429 16 24.52.571 16 .571"})),sa||(sa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__f)",d:"M22.457 15.292a1 1 0 0 1 0 1.414l-5.75 5.75a1 1 0 0 1-1.414 0l-5.75-5.75a1 1 0 0 1 0-1.414l5.75-5.75a1 1 0 0 1 1.414 0zm-12.005.707L16 21.547l5.548-5.548L16 10.45z"})),oa||(oa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__g)",d:"M14.788 9.239c.67-.67 1.755-.67 2.424 0l5.548 5.548c.67.67.67 1.754 0 2.424l-5.548 5.548c-.67.67-1.754.67-2.424 0L9.24 17.21a1.714 1.714 0 0 1 0-2.424zm2.02.404a1.143 1.143 0 0 0-1.616 0L9.644 15.19l-.078.087c-.366.449-.34 1.11.078 1.529l5.548 5.548c.419.418 1.08.444 1.53.078l.086-.078 5.548-5.548c.419-.418.444-1.08.078-1.53l-.078-.086z"})),la||(la=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__h)",d:"M14.788 9.239c.67-.67 1.755-.67 2.424 0l5.548 5.548c.67.67.67 1.754 0 2.424l-5.548 5.548c-.67.67-1.754.67-2.424 0L9.24 17.21a1.714 1.714 0 0 1 0-2.424zm2.02.404a1.143 1.143 0 0 0-1.616 0L9.644 15.19l-.078.087c-.366.449-.34 1.11.078 1.529l5.548 5.548c.419.418 1.08.444 1.53.078l.086-.078 5.548-5.548c.419-.418.444-1.08.078-1.53l-.078-.086z"})),da||(da=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__i)",d:"M21.548 15.999 16 21.547l-5.548-5.548L16 10.45zm-10.288 0 4.74 4.74 4.74-4.74-4.74-4.74z"})),ca||(ca=g.createElement("defs",null,g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__d",x1:2.857,x2:29.143,y1:2.857,y2:29.143,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.153,stopColor:"#491B04"}),g.createElement("stop",{offset:.5,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.847,stopColor:"#FFF7D2"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__e",x1:0,x2:32,y1:0,y2:32,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.15,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.847,stopColor:"#734D26"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__g",x1:8.738,x2:23.262,y1:8.737,y2:23.261,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.215,stopColor:"#0DF2C1"}),g.createElement("stop",{offset:.5,stopColor:"#F2E70D"}),g.createElement("stop",{offset:.872,stopColor:"#04493A"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__h",x1:8.738,x2:23.262,y1:8.737,y2:23.261,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.25,stopColor:"#FFF7D2"}),g.createElement("stop",{offset:.5,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.75,stopColor:"#491B04"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__i",x1:10.452,x2:21.548,y1:10.451,y2:21.547,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.25,stopColor:"#491B04"}),g.createElement("stop",{offset:.748,stopColor:"#FFF7D2"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__a",cx:0,cy:0,r:1,gradientTransform:"matrix(35.02743 34.45334 -49.19166 50.01133 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.202,stopColor:"#E3C28E"}),g.createElement("stop",{offset:.721,stopColor:"#B37F42"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__b",cx:0,cy:0,r:1,gradientTransform:"matrix(31.98739 31.98739 -45.67082 45.67082 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#19925E"}),g.createElement("stop",{offset:.502,stopColor:"#4BB866",stopOpacity:.8}),g.createElement("stop",{offset:.968,stopColor:"#EBE713"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__c",cx:0,cy:0,r:1,gradientTransform:"matrix(35.02743 34.45334 -49.19166 50.01133 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.162,stopColor:"#CFA56A"}),g.createElement("stop",{offset:.76,stopColor:"#DEBA80"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__f",cx:0,cy:0,r:1,gradientTransform:"rotate(44.527 -6.37 15.216)scale(21.999 31.4097)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.162,stopColor:"#CFA56A"}),g.createElement("stop",{offset:.76,stopColor:"#DEBA80"}))))),ma={title:{fontSize:36,fontWeight:800,height:42,baseline:32},promo:{fontSize:30,fontWeight:700,height:35,baseline:28},currency:{fontSize:18,fontWeight:700,height:21,baseline:16},text:{fontSize:20,fontWeight:700,height:24,baseline:19}},ha=({children:e,variant:t="title",className:a="",maxWidth:i})=>{const n=(0,g.useId)().replace(/:/g,"-"),s=`gold-gradient-${n}`,o=`gold-shadow-${n}`,l=(0,g.useRef)(null),[d,c]=(0,g.useState)(200),p=ma[t],[u,m]=(0,g.useState)(p.fontSize),h=void 0!==i?p.height/2:p.baseline;return(0,g.useLayoutEffect)(()=>{m(p.fontSize)},[e,i,p.fontSize]),(0,g.useLayoutEffect)(()=>{if(l.current){const e=l.current.getBBox(),t=Math.ceil(e.width),a=void 0!==i?Math.min(t,i)+4:t+4;if(void 0!==i&&t>i){const e=Math.max(Math.floor(u*(i/t)),1);u!==e&&m(e)}d!==a&&c(a)}},[e,u,i,p.fontSize,d]),(0,r.jsxs)("svg",{className:a,width:d,height:p.height,viewBox:`0 0 ${d} ${p.height}`,style:{display:"inline-block",overflow:"visible"},children:[(0,r.jsxs)("defs",{children:[(0,r.jsxs)("radialGradient",{id:s,gradientUnits:"userSpaceOnUse",cx:"0",cy:"0",r:"10",gradientTransform:"matrix(12.479 4.522 17.525 -6.564 0.044977 0.0000027894)",children:[(0,r.jsx)("stop",{stopColor:"#E3C28E",offset:"20.23%"}),(0,r.jsx)("stop",{stopColor:"#CB9A68",offset:"46.16%"}),(0,r.jsx)("stop",{stopColor:"#B37F42",offset:"72.08%"})]}),(0,r.jsx)("filter",{id:o,x:"-20%",y:"-20%",width:"140%",height:"140%",children:(0,r.jsx)("feDropShadow",{dx:"0",dy:"1",stdDeviation:"0",floodColor:"black",floodOpacity:"0.3"})})]}),(0,r.jsx)("text",{ref:l,x:"0",y:h,fill:`url(#${s})`,filter:`url(#${o})`,fontFamily:"Roboto, sans-serif",fontSize:u,fontWeight:p.fontWeight,dominantBaseline:void 0!==i?"middle":void 0,children:e})]})};var fa;function ga(){return ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ga.apply(null,arguments)}const va=e=>g.createElement("svg",ga({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),fa||(fa=g.createElement("path",{fill:"currentColor",d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M4.418 8 8 11.582 11.582 8 8 4.418z"})));var xa=a(7031);const ba=({classes:e})=>(0,r.jsxs)("div",{className:"loader",children:[(0,r.jsx)("span",{className:null==e?void 0:e.dot}),(0,r.jsx)("span",{className:null==e?void 0:e.dot}),(0,r.jsx)("span",{className:null==e?void 0:e.dot})]});var wa=a(9494),ya=a(7997);const ja=()=>{var e;const t=(0,Kt.Bd)(),a=w(ee),i=null===(e=w(ee))||void 0===e?void 0:e.sessionRate,n=w(te),s=w(e=>e.wallet.trueDecimal),{isPending:o,error:l}=w(e=>e.prizeDrop.apiLobbyInit),d=(0,Vt.GV)(ya.ge),[u,m]=(0,g.useState)(""),h=o||!!l||!n,f=a?Number(a.balance):0;return(0,g.useEffect)(()=>{m(ne.bp.formatCash(f,{showCurrency:!1,customDecimals:s,roundUp:!0}))},[f,s,i]),(0,r.jsx)("div",{className:"h-180 rounded-30",style:{backgroundImage:`url(${xa.f.get(c)})`,backgroundSize:"cover",backgroundPosition:"top right"},children:(0,r.jsxs)("div",{className:"relative flex h-full flex-col justify-between rounded-30 border-[3px] border-white-10 p-17",children:[(0,r.jsx)("img",{src:xa.f.get(p),alt:"safe",className:"absolute -right-3 top-1/2 w-190 -translate-y-1/2"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-6",children:[(0,r.jsx)(va,{className:"h-28 w-28 shrink-0 text-white"}),(0,r.jsx)("div",{className:"title-h3-bold",children:"$TRUE Token"})]}),(0,r.jsxs)("div",{children:[h?(0,r.jsx)("div",{className:"flex h-38 items-center",children:(0,r.jsx)(ba,{classes:{dot:"w-7 h-7"}})}):(0,r.jsx)(wa.$,{className:"m-0 font-extrabold leading-[38px] text-white",text:u,initialFontSize:32,maxWidth:d?240:170}),!h&&f>0&&(0,r.jsxs)("div",{className:"text-medium-reg -mt-3 opacity-60",children:["~",ne.bp.formatCash(f/i,{roundUp:!0})]})]})]}),(0,r.jsx)("div",{className:"text-small-reg max-w-180 opacity-60",children:t("LOBBY.097","Conversion will open on May 26th")})]})})},Da=()=>{var e,t;const a=(0,Kt.Bd)(),i=w(e=>e.prizeDrop.displayedCampaign.cashPrizePool),n=w(e=>e.prizeDrop.displayedCampaign),s=w(ae),o=w(e=>e.wallet.trueDecimal),l=n.prizes.some(e=>"true"===e.type),d="number"==typeof s&&s>0;return i?(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"title-h3-bold text-cente flex items-center justify-center gap-8 text-center",children:[(0,r.jsxs)("div",{children:["🏆 ",a("DROP.003","Prize pool:")," "]}),l?(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ua,{className:"h-20 w-20"}),(0,r.jsxs)(ha,{variant:"text",children:[ne.bp.formatCash(null!==(e=null==i?void 0:i.value)&&void 0!==e?e:0,{showCurrency:!1,customDecimals:o,roundUp:!0})," "]})]}):(0,r.jsx)(ha,{variant:"text",children:ne.bp.formatCash(null==i?void 0:i.value,{customCurrency:null==i?void 0:i.currency,customDecimals:null==i?void 0:i.decimals,roundUp:!0})})]}),l&&d&&(0,r.jsxs)("div",{className:"text-medium-reg text-center opacity-60",children:["~"," ",ne.bp.formatCash((null!==(t=null==i?void 0:i.value)&&void 0!==t?t:0)/s,{roundUp:!0})]})]}):null};a(494),a(2796),a(7317),a(9964),a(813),a(5811),a(9423),a(7205),a(2369),a(5616),a(1340),a(7081),a(4895),a(6007);var Ca,za=a(4353),Na=a.n(za);function Ea(){return Ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ea.apply(null,arguments)}const Pa=e=>g.createElement("svg",Ea({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 21 20"},e),Ca||(Ca=g.createElement("path",{fill:"#fff",d:"M8 8.333V10H6.333V8.333zm3.333 0V10H9.667V8.333zm3.334 0V10H13V8.333zM16.333 2.5A1.666 1.666 0 0 1 18 4.166v11.667a1.666 1.666 0 0 1-1.667 1.667H4.667A1.667 1.667 0 0 1 3 15.833V4.166A1.667 1.667 0 0 1 4.667 2.5H5.5V.833h1.667V2.5h6.666V.833H15.5V2.5zm0 13.333V6.666H4.667v9.167zM8 11.666v1.667H6.333v-1.667zm3.333 0v1.667H9.667v-1.667zm3.334 0v1.667H13v-1.667z"}))),Sa=({dateStart:e,dateEnd:t,className:a=""})=>{const i=(0,Vt.GV)(e=>e.localization.lang);return(0,r.jsxs)("div",{className:Ht()(a||"text-small-med mt-12"),children:[(0,r.jsx)(Pa,{className:"mr-6 inline-block h-20 w-20"}),Na()(e).locale("no"===i?"nb":i).format("MMM D, YYYY")," ","–"," ",Na()(t).locale("no"===i?"nb":i).format("MMM D, YYYY")]})},ka=e=>{const t=Date.now();let a=new Date(e).getTime()-t;a<0&&(a=0);const r=Math.floor(a/864e5),i=Math.floor(a/36e5%24),n=Math.floor(a/6e4%60),s=Math.floor(a/1e3%60),o=e=>String(e).padStart(2,"0");return{days:o(r),hours:o(i),mins:o(n),secs:o(s)}},Oa=({prizeDropMode:e,className:t=""})=>{const a=(0,Kt.Bd)(),{dateStart:i,dateEnd:n}=w(e=>e.prizeDrop.displayedCampaign),s="upcoming"===e?i:n,o="ended"===e,[l,d]=(0,g.useState)(()=>ka(s));(0,g.useEffect)(()=>{const e=setInterval(()=>{d(ka(s))},1e3);return()=>clearInterval(e)},[s]);const c=[{value:l.days,text:a("DROP.036","Days")},{value:l.hours,text:a("DROP.037","Hrs")},{value:l.mins,text:a("DROP.038","Mins")},{value:l.secs,text:a("DROP.039","Secs")}],p=e=>!!(o||Number(e)<0);return(0,r.jsxs)("div",{className:Ht()("flex flex-col items-center rounded-16 bg-white-6 pb-20 pt-16",t),children:[(0,r.jsxs)("span",{className:"title-h3-bold",children:["live"===e&&a("DROP.035","Ends in"),"ended"===e&&a("DROP.045","Ended"),"upcoming"===e&&a("DROP.068","Starts in")]}),(0,r.jsx)("div",{className:"mt-6 flex gap-4",children:c.map(({value:e,text:t})=>(0,r.jsxs)("div",{className:"flex flex-col rounded-10 bg-white-6 px-14 py-12",children:[(0,r.jsx)("span",{className:"title-h2-bold text-center",children:p(e)?"00":e}),(0,r.jsx)("span",{className:"text-super-xs-reg uppercase",children:t})]},t))}),(0,r.jsx)(Sa,{dateStart:i,dateEnd:n})]})};var Ra,Ia,Ba,La=a(1601);function _a(){return _a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},_a.apply(null,arguments)}const Ma=e=>g.createElement("svg",_a({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 18 18"},e),Ra||(Ra=g.createElement("path",{fill:"url(#qualified-icon_svg__a)",d:"M8.222.962a1 1 0 0 1 1.556 0l.899 1.112a1 1 0 0 0 1.037.337l1.381-.371a1 1 0 0 1 1.259.914l.073 1.429a1 1 0 0 0 .642.882l1.335.512a1 1 0 0 1 .48 1.479l-.78 1.199a1 1 0 0 0 0 1.09l.78 1.2a1 1 0 0 1-.48 1.479l-1.335.51a1 1 0 0 0-.642.883l-.073 1.429a1 1 0 0 1-1.259.914l-1.38-.371a1 1 0 0 0-1.038.337l-.9 1.112a1 1 0 0 1-1.555 0l-.899-1.112a1 1 0 0 0-1.037-.337l-1.381.37a1 1 0 0 1-1.259-.913l-.073-1.429a1 1 0 0 0-.641-.882l-1.336-.511a1 1 0 0 1-.48-1.48l.78-1.199a1 1 0 0 0 0-1.09l-.78-1.2a1 1 0 0 1 .48-1.478l1.336-.512a1 1 0 0 0 .64-.882l.074-1.429a1 1 0 0 1 1.259-.914l1.38.371a1 1 0 0 0 1.038-.337z"})),Ia||(Ia=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeWidth:2,d:"m6 9 2 2 4-4"})),Ba||(Ba=g.createElement("defs",null,g.createElement("linearGradient",{id:"qualified-icon_svg__a",x1:0,x2:18,y1:6.818,y2:6.818,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#41FF8D"}),g.createElement("stop",{offset:1,stopColor:"#2FA5E8"})))));var Ta=a(6966);const Aa=({betStatus:e})=>{const t=(0,Kt.Bd)(),a=w(e=>e.prizeDrop.displayedCampaign),i=w(e=>e.prizeDrop.activeCampaign),n=(null==a?void 0:a.campaignId)===(null==i?void 0:i.campaignId);if(null===e)return null;const{bgClass:s,icon:o,title:l}=((e,t,a)=>t?e?{bgClass:"bg-green opacity-20",icon:(0,r.jsx)(Ma,{className:"z-1"}),title:a("DROP.041","Your current bet meets the requirements")}:{bgClass:"bg-[rgba(255,71,102,0.2)]",icon:(0,r.jsx)("span",{className:"z-1 leading-[18px]",children:"😴"}),title:a("DROP.044","Your current bet does not meet the requirements")}:{bgClass:"bg-[rgba(255,96,71,0.2)]",icon:(0,r.jsx)("div",{className:"bg-add-gradient z-1 flex min-h-18 min-w-18 items-center justify-center rounded-full",children:(0,r.jsx)(Ta.A,{className:"h-full w-full"})}),title:a("LOBBY.040","You have already joined an active event.")})(e,n,t);return(0,r.jsxs)("div",{className:"relative -mb-10 mt-10 flex items-center gap-6 py-6 pl-6 pr-10",children:[(0,r.jsx)("div",{className:Ht()("absolute inset-0 rounded-20",s)}),o,(0,r.jsx)("span",{className:"text-small-reg z-1",children:l})]})},Fa=({prizeDropMode:e,betStatus:t,isJoined:a})=>{const i=(0,Vt.GV)(La.uB),n=(0,Kt.Bd)();return(0,r.jsxs)("div",{className:"relative flex flex-col items-center rounded-tl-16 rounded-tr-16 bg-gradient-to-b from-white-6 to-transparent text-center",children:[(0,r.jsx)("img",{src:xa.f.get(i?h:m),alt:"bg",className:"absolute left-1/2 top-0 w-full max-w-full -translate-x-1/2 ml:max-w-448"}),(0,r.jsx)(Qt,{prizeDropMode:e,className:"absolute right-10 top-10"}),(0,r.jsx)("img",{src:xa.f.get(f),alt:"logo",className:"contain mt-20 h-74 w-140"}),(0,r.jsxs)("span",{className:"title-h3-bold mt-10 px-6",children:["ended"!==e&&n("DROP.002","Spin and win amazing prizes instantly!"),"ended"===e&&`${n("DROP.046","All winners have received their prizes!")} 🥳`]}),"ended"===e&&(0,r.jsxs)("span",{className:"text-medium-reg px-6 leading-[25px]",children:[n("DROP.047","Stay tuned for new events")," 🚀"]}),a&&(0,r.jsx)(Aa,{betStatus:t})]})},Ua=({minimumBet:e,className:t=""})=>{const a=(0,Kt.Bd)();return(0,r.jsx)("div",{className:Ht()("rounded-16 bg-white-6 py-14",t),children:(0,r.jsxs)("div",{className:"text-medium-reg text-center",children:[a("DROP.034","Minimum bet to participate:")," ",(0,r.jsx)("span",{className:"font-bold",children:ne.bp.formatCash(e)})]})})},$a=({className:e=""})=>{const t=w(e=>{var t;return gt(e,null===(t=e.prizeDrop.displayedCampaign)||void 0===t?void 0:t.campaignId)}),a=w(e=>e.prizeDrop.displayedCampaign.prizes),i=w(ae),n=w(e=>e.wallet.trueDecimal),s="number"==typeof i&&i>0,o=(0,Kt.Bd)();return(0,r.jsxs)("div",{className:Ht()("flex flex-col gap-1",e),children:[(0,r.jsxs)("div",{className:Ht()("text-small-reg grid rounded-tl-12 rounded-tr-12 bg-white-6 px-20 py-6","upcoming"===t?"grid-cols-[1fr_80px]":"grid-cols-[1fr_80px_80px]"),children:[(0,r.jsx)("div",{className:"opacity-60",children:o("DROP.031","Prize")}),(0,r.jsx)("div",{className:"text-right opacity-60",children:o("DROP.032","Count")}),"upcoming"!==t&&(0,r.jsx)("div",{className:"text-right opacity-60",children:o("DROP.033","Left")})]}),a.map(({prizeId:e,leftCount:a,totalCount:o,configCash:l,configTrue:c})=>{var p,u,m,h,f,g,v;return(0,r.jsxs)("div",{className:Ht()("text-medium-reg grid items-center bg-white-10 py-8 pl-16 pr-20 last-of-type:rounded-bl-12 last-of-type:rounded-br-12","upcoming"===t?"grid-cols-[1fr_80px]":"grid-cols-[1fr_80px_80px]"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-10",children:[(0,r.jsx)("img",{src:xa.f.get(d),alt:"Cash prize",className:"contain h-36 w-36"}),"TRUE"===(null===(p=null==c?void 0:c.amount)||void 0===p?void 0:p.currency)?(0,r.jsxs)("div",{className:"flex flex-col justify-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(va,{className:"h-16 w-16"}),ne.bp.formatCash(null===(u=null==c?void 0:c.amount)||void 0===u?void 0:u.value,{showCurrency:!1,customDecimals:n,roundUp:!0})," "]}),s&&(0,r.jsxs)("span",{className:"text-xs-reg opacity-60",children:["~",ne.bp.formatCash((null!==(h=null===(m=null==c?void 0:c.amount)||void 0===m?void 0:m.value)&&void 0!==h?h:0)/i,{roundUp:!0})," "]})]}):(0,r.jsxs)("span",{className:"title-h3-bold",children:[ne.bp.formatCash(null===(f=null==l?void 0:l.amount)||void 0===f?void 0:f.value,{showCurrency:!1,customDecimals:null===(g=null==l?void 0:l.amount)||void 0===g?void 0:g.decimals,roundUp:!0})," ",(0,r.jsx)("span",{className:"text-small-bold",children:null===(v=null==l?void 0:l.amount)||void 0===v?void 0:v.currency})]})]}),(0,r.jsx)("span",{className:"text-right",children:o}),"upcoming"!==t&&(0,r.jsx)("span",{className:"text-right",children:a})]},e)})]})},Ya=({prizesLeftCount:e,winnersCount:t})=>{const a=(0,Kt.Bd)();return(0,r.jsxs)("div",{className:"mt-18 flex gap-10",children:[(0,r.jsxs)("div",{className:"flex flex-1 flex-col rounded-12 bg-white-6 pb-12 pt-14 text-center",children:[(0,r.jsx)("span",{className:"title-h1-bold",children:e}),(0,r.jsxs)("span",{className:"text-small-med",children:["🎁 ",a("DROP.029","Prizes left")]})]}),(0,r.jsxs)("div",{className:"flex flex-1 flex-col rounded-12 bg-white-6 pb-12 pt-14 text-center",children:[(0,r.jsx)("span",{className:"title-h1-bold",children:t}),(0,r.jsxs)("span",{className:"text-small-med",children:["⭐️ ",a("DROP.030","Winners")]})]})]})},Va=()=>{const e=(0,Vt.GV)(e=>e.stake.current.amount),{prizesLeftCount:t,winnersCount:a,betAmount:i}=w(e=>e.prizeDrop.displayedCampaign),n=w(e=>{var t;return gt(e,null===(t=e.prizeDrop.displayedCampaign)||void 0===t?void 0:t.campaignId)}),s=w(vt),o="live"===n?e>=i:null;return(0,g.useEffect)(()=>{ne.h$.emit("pdModal:eventsView")},[]),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-10",children:[(0,r.jsx)(Fa,{betStatus:o,prizeDropMode:n,isJoined:s}),"upcoming"===n&&(0,r.jsx)(Oa,{prizeDropMode:n,className:"mt-6"}),(0,r.jsxs)("div",{className:Ht()("rounded-16 bg-white-6 px-14 pb-14 pt-16","live"===n&&"mt-6","live"===n&&s&&"!mt-16","ended"===n&&"mt-4"),children:["upcoming"!==n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Da,{}),(0,r.jsx)(Ya,{prizesLeftCount:t,winnersCount:a})]}),"upcoming"===n&&(0,r.jsx)(Da,{}),(0,r.jsx)($a,{className:Ht()("upcoming"===n?"mt-18":"mt-10")})]}),(0,r.jsx)(Ua,{minimumBet:i,className:"upcoming"===n&&"mb-13"}),"upcoming"!==n&&(0,r.jsx)(Oa,{prizeDropMode:n,className:"mb-10"})]})};var Ga=a(9701);const Ha=e=>{const t=Date.now();let a=new Date(e).getTime()-t;a<0&&(a=0);const r=Math.floor(a/864e5),i=Math.floor(a/36e5%24),n=Math.floor(a/6e4%60),s=Math.floor(a/1e3%60),o=e=>String(e).padStart(2,"0");return{days:o(r),hours:o(i),mins:o(n),secs:o(s)}},Ja=({dateStart:e,className:t=""})=>{const a=(0,Kt.Bd)(),[i,n]=(0,g.useState)(()=>Ha(e));(0,g.useEffect)(()=>{const t=setInterval(()=>{n(Ha(e))},1e3);return()=>clearInterval(t)},[e]);const s=[{value:i.days,text:a("DROP.036","Days")},{value:i.hours,text:a("DROP.037","Hrs")},{value:i.mins,text:a("DROP.038","Mins")},{value:i.secs,text:a("DROP.039","Secs")}],o=e=>Number(e)<0;return(0,r.jsxs)("div",{className:Ht()("flex flex-col gap-5",t),children:[(0,r.jsx)("span",{className:"text-small-reg text-left opacity-60",children:a("DROP.068","Starts in")}),(0,r.jsx)("div",{className:"flex gap-4",children:s.map(({value:e,text:t})=>(0,r.jsxs)("div",{className:"flex min-w-40 flex-col rounded-10 bg-white-20 p-8",style:{boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.20) inset"},children:[(0,r.jsx)("span",{className:"title-h2-bold text-center",children:o(e)?"00":e}),(0,r.jsx)("span",{className:"text-super-xs-reg uppercase",children:t})]},t))})]})},Wa=({campaign:e})=>{var t,a,i,n,s,o,d,c;const p=w(t=>gt(t,e.campaignId)),u="ended"===p,m="upcoming"===p,h="live"===p,f=w(ae),g=w(e=>e.wallet.trueDecimal),v="number"==typeof f&&f>0,x=(0,Vt.GV)(La.ge),y=(0,Kt.Bd)(),j=b(),D=e.prizes.some(e=>"true"===e.type);return(0,r.jsxs)("button",{type:"button",className:"relative flex h-170 w-full cursor-pointer flex-col justify-between overflow-hidden rounded-16 bg-[linear-gradient(79deg,#D1003F_0%,#D1003F_50%,#FF844F_100%)] p-20 drop-shadow-[0_1px_2px_rgba(0,0,0,0.2)]",onClick:()=>(j(Ae(e)),void j(P("campaign"))),children:[(0,r.jsxs)("svg",{style:{transform:"rotate(65.125deg) translate(-115%, -36%)",position:"absolute",right:"-160px",top:"0",mixBlendMode:"plus-lighter",width:"268.556px",height:"583.547px"},width:"305",height:"170",viewBox:"0 0 305 170",fill:"none",children:[(0,r.jsxs)("g",{style:{mixBlendMode:"plus-lighter"},children:[(0,r.jsx)("g",{filter:"url(#filter0_f_5002_5141)",children:(0,r.jsx)("ellipse",{cx:"167.639",cy:"115.844",rx:"167.639",ry:"115.844",transform:"matrix(-0.612432 0.790523 -0.999061 -0.0433308 508.881 -146.403)",fill:"#FF4D00"})}),(0,r.jsx)("g",{filter:"url(#filter1_f_5002_5141)",children:(0,r.jsx)("ellipse",{cx:"135.464",cy:"72.9381",rx:"135.464",ry:"72.9381",transform:"matrix(0.938677 -0.344798 0.823647 0.567102 188.028 -5.93066)",fill:"#FF4D00"})})]}),(0,r.jsxs)("defs",{children:[(0,r.jsxs)("filter",{id:"filter0_f_5002_5141",x:"0.000213623",y:"-287.287",width:"580.958",height:"536.773",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"67.8837",result:"effect1_foregroundBlur_5002_5141"})]}),(0,r.jsxs)("filter",{id:"filter1_f_5002_5141",x:"183.68",y:"-124.579",width:"383.16",height:"226.608",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"25.4564",result:"effect1_foregroundBlur_5002_5141"})]})]})]}),(0,r.jsx)("img",{className:"absolute right-0 top-1/2 h-170 w-190 -translate-y-1/2",src:xa.f.get(l),alt:""}),(0,r.jsx)(Qt,{prizeDropMode:p,className:"absolute right-16 top-16 z-[30]"}),(0,r.jsx)(Ga.Y,{className:"title-h1-bold relative z-10 max-w-[50%] text-left uppercase",text:""===(null===(t=e.texts)||void 0===t?void 0:t.title)||null===(null===(a=e.texts)||void 0===a?void 0:a.title)?y("LOBBY.005","Spin and Win"):e.texts.title,initialFontSize:20,initialLineHeight:23,maxHeight:46}),m&&(0,r.jsx)("div",{children:(0,r.jsx)(Ja,{dateStart:e.dateStart})}),(h||u)&&(0,r.jsxs)("div",{className:"relative z-10 -mb-3 text-left",children:[(0,r.jsx)("div",{className:"text-small-bold mb-2",children:y("LOBBY.006","Prize pool")}),(0,r.jsxs)("div",{className:"flex items-center gap-8",children:[D&&(0,r.jsx)(ua,{className:"h-32 w-32"}),(0,r.jsx)(ha,{variant:"title",className:"-mb-3",maxWidth:x?400:133,children:ne.bp.formatCash(null!==(n=null===(i=e.cashPrizePool)||void 0===i?void 0:i.value)&&void 0!==n?n:0,{showCurrency:!1,customDecimals:D?g:null===(s=e.cashPrizePool)||void 0===s?void 0:s.decimals,roundUp:!0})})]}),(0,r.jsxs)("div",{className:"h-21",children:[D&&v&&(0,r.jsxs)("div",{className:"title-h2-bold",children:["~",ne.bp.formatCash((null!==(d=null===(o=e.cashPrizePool)||void 0===o?void 0:o.value)&&void 0!==d?d:0)/f,{showCurrency:!0,roundUp:!0})]}),!D&&(0,r.jsx)(ha,{variant:"currency",children:null===(c=e.cashPrizePool)||void 0===c?void 0:c.currency})]})]}),u&&(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[20] rounded-16 bg-[#000101] opacity-100",style:{mixBlendMode:"color"},"aria-hidden":!0})]},e.campaignId)},Ka={running:0,scheduled:1,finished:2},Qa=e=>new Date(e).getTime(),qa=()=>{var e;const t=w(e=>e.prizeDrop.campaigns),a=(0,Kt.Bd)(),i=null!==(e=null==t?void 0:t.filter(e=>"cancelled"!==e.status).sort((e,t)=>{const a=Ka[e.status]-Ka[t.status];if(0!==a)return a;const r=Qa(e.dateStart),i=Qa(t.dateStart);return"running"===e.status?i-r:r-i}))&&void 0!==e?e:[],n=0===i.filter(e=>!("finished"===e.status)).length;return(0,r.jsxs)("div",{className:"flex w-full flex-col gap-12",children:[(0,r.jsx)("div",{className:"title-h2-bold pl-16",children:a("LOBBY.004","Events")}),(0,r.jsxs)("div",{className:"flex flex-col gap-12",children:[i.map(e=>(0,r.jsx)(Wa,{campaign:e},e.campaignId)),n&&(0,r.jsxs)("div",{className:"text-medium-reg rounded-12 bg-white-10 p-14 text-center opacity-80",children:[a("LOBBY.011","New thrilling events are coming soon — stay tuned 🚀 ")," 🚀"]})]})]})},Xa=({htmlString:e})=>(0,r.jsx)("div",{className:Ht()("[&_h3]:text-medium-bold [&_h3:first-child]:mt-0 [&_h3]:mt-19","[&_p]:text-small-reg [&_p>strong]:text-small-bold [&_p]:mt-4 [&_p]:opacity-80 [&_p]:ml:mt-5","[&_ul]:mt-4 [&_ul]:flex [&_ul]:flex-col [&_ul]:gap-3","[&_li]:text-small-reg [&_li]:relative [&_li]:pl-22 [&_li]:opacity-80 [&_li]:before:absolute [&_li]:before:left-10 [&_li]:before:top-7 [&_li]:before:h-4 [&_li]:before:w-4 [&_li]:before:rounded-full [&_li]:before:bg-additional","[&_table]:mt-4 [&_table]:w-full","[&_thead]:text-small-bold [&_thead>tr>th:first-child]:rounded-tl-10 [&_thead>tr>th:last-child]:rounded-tr-10 [&_thead>tr>th]:h-30 [&_thead>tr>th]:w-1/2 [&_thead>tr>th]:bg-white-10 [&_thead>tr>th]:pl-12 [&_thead>tr>th]:text-left","[&_tbody>tr>td]:text-small-reg [&_tbody>tr>td]:relative [&_tbody>tr>td]:h-30 [&_tbody>tr>td]:pl-12","[&_tbody>tr:last-child>td:first-child]:before:rounded-bl-10 [&_tbody>tr:last-child>td:last-child]:before:rounded-br-10 [&_tbody>tr>td:last-child]:before:border-r [&_tbody>tr>td]:before:absolute [&_tbody>tr>td]:before:left-0 [&_tbody>tr>td]:before:top-0 [&_tbody>tr>td]:before:h-full [&_tbody>tr>td]:before:w-full [&_tbody>tr>td]:before:border-b [&_tbody>tr>td]:before:border-l [&_tbody>tr>td]:before:border-solid [&_tbody>tr>td]:before:border-white-10"),dangerouslySetInnerHTML:{__html:e}}),Za=()=>{const e=w(e=>e.prizeDrop.displayedCampaign.texts.rules);return(0,g.useEffect)(()=>{ne.h$.emit("pdModal:rulesView")},[]),(0,r.jsx)("div",{className:"mb-19 rounded-16 bg-white-6 p-20 text-white",children:(0,r.jsx)(Xa,{htmlString:e})})},er=({config:e,activeTab:t,setActiveTab:a})=>e.length?(0,r.jsx)("div",{className:"flex h-44 w-384",children:e.map(e=>(0,r.jsx)("button",{className:Ht()(["first-of-type:border-l-solid first-of-type:rounded-l-12 first-of-type:border-l-2 first-of-type:border-l-white-20"],["last-of-type:border-r-solid last-of-type:rounded-r-12 last-of-type:border-r-2 last-of-type:border-r-white-20"],"border-y-solid group flex-1 border-y-2 border-y-white-20 ",e.id===t&&"pointer-events-none !border-transparent bg-white-20"),type:"button",onClick:r=>((e,r)=>{e.preventDefault(),r!==t&&a(r)})(r,e.id),children:(0,r.jsx)("span",{className:Ht()("text-medium-bold",e.id===t?"opacity-100":"opacity-40 group-hover:opacity-80 group-hover:transition-opacity"),children:e.title})},e.id))}):null;const tr=({campaignId:e})=>(t,a)=>{return r=void 0,i=void 0,s=function*(){t(Ke({campaignId:e})).unwrap().then(a=>{a.joined&&(t(et({campaignId:e})),t(qe()))}).catch(e=>{ne.vF.error(e)})},new((n=void 0)||(n=Promise))(function(e,t){function a(e){try{l(s.next(e))}catch(e){t(e)}}function o(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(e){e(r)})).then(a,o)}l((s=s.apply(r,i||[])).next())});var r,i,n,s};var ar=function(e,t,a,r){return new(a||(a=Promise))(function(i,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function o(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,o)}l((r=r.apply(e,t||[])).next())})};const rr=(e={})=>(t,a,r)=>ar(void 0,void 0,void 0,function*(){var i;const n=null!==(i=e.shouldFreezeUi)&&void 0!==i&&i;n&&r.mainDispatch((0,se.zE)()),t(We()).unwrap().then(e=>ar(void 0,void 0,void 0,function*(){var i,s,o,l,d,c;n&&r.mainDispatch((0,se.GP)());const p=null===(i=null==e?void 0:e.campaigns)||void 0===i?void 0:i.find(e=>e.joined&&"running"===e.status);if(t(pt(null!==(s=null==e?void 0:e.campaigns)&&void 0!==s?s:[])),t(X(null===(o=null==e?void 0:e.isWalletAvailable)||void 0===o||o)),t(q(null!==(l=null==e?void 0:e.trueSessionRate)&&void 0!==l?l:null)),t(Z(null!==(d=null==e?void 0:e.wallets)&&void 0!==d?d:[])),t(qe()),null==p?void 0:p.joined)t(Te(p)),ne.h$.emit("campaignId:set",p.campaignId);else{const r=a().prizeDrop.prizeDropLiveShownCampaignIds,i=null===(c=null==e?void 0:e.campaigns)||void 0===c?void 0:c.filter(e=>"running"===e.status&&!e.joined&&!r.includes(e.campaignId));t(st(null!=i?i:[])),(null==i?void 0:i.length)>0&&t(Ae(null==i?void 0:i[0]))}})).catch(e=>{n&&r.mainDispatch((0,se.GP)()),ne.vF.error(e)})}),ir=()=>(e,t,a)=>ar(void 0,void 0,void 0,function*(){e(We()).unwrap().then(a=>ar(void 0,void 0,void 0,function*(){var r,i,n,s;const o=a.campaigns.find(e=>e.joined&&"running"===e.status);e(pt(a.campaigns)),e(X(null===(r=a.isWalletAvailable)||void 0===r||r)),e(q(null!==(i=a.trueSessionRate)&&void 0!==i?i:null)),e(Z(null!==(n=a.wallets)&&void 0!==n?n:[])),(null===(s=t().prizeDrop.socketConnection)||void 0===s?void 0:s.isSuccess)||e(qe()),e(Te(o))})).catch(e=>{a.mainDispatch((0,se.GP)()),ne.vF.error(e)})}),nr=e=>(t,a,r)=>{const i=r.mainGetState().play.isActive,{activeCampaign:n,campaigns:s}=a().prizeDrop;s.find(t=>t.campaignId===e.campaignId)?"finished"===e.status||"cancelled"===e.status?i&&(null==n?void 0:n.campaignId)===e.campaignId?(t(Ze(!0)),t(tt(e))):(t(Fe(e)),(null==n?void 0:n.campaignId)===e.campaignId&&("finished"===e.status?t(we("prizeDropResultFinished")):"cancelled"===e.status&&t(we("prizeDropResultCancelled")))):t(i?tt(e):Fe(e)):(a().modals.current.includes("promoLobby")&&t(V(e.campaignId)),t(rr()))};var sr,or=a(8682),lr=a(4354),dr=a(8578),cr=a(8608);function pr(){return pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},pr.apply(null,arguments)}const ur=e=>g.createElement("svg",pr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),sr||(sr=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 14h8M8 2v8.333m0 0L11.333 7M8 10.333 4.667 7"}))),mr={deposit:{label:"Received",key:"LOBBY.020"},prizedrop:{label:"Prizedrop Reward",key:"LOBBY.007"},airdrop:{label:"Airdrop Reward",key:"LOBBY.010"},sent:{label:"Sent",key:"LOBBY.019"}},hr=({transaction:e})=>{const t="top-up"===e.type,a=(0,Kt.Bd)(),i=w(e=>e.wallet.trueDecimal);return(0,r.jsxs)("div",{className:"flex items-center gap-10 rounded-16 bg-white-10 py-5 pl-5 pr-15",children:[(0,r.jsx)("div",{className:"flex h-34 w-34 items-center justify-center rounded-8 bg-white-10",children:(0,r.jsx)(ur,{className:Ht()("h-16 w-16 opacity-60",!t&&"rotate-180")})}),(0,r.jsx)("div",{className:"min-w-0 flex-1",children:(0,r.jsx)("span",{className:"text-medium-med",children:a(mr[e.subType].key,mr[e.subType].label)})}),(0,r.jsxs)("div",{className:Ht()("text-medium-bold flex shrink-0 items-center gap-6",t?"text-[#77DA29]":"text-white opacity-60"),children:[t&&(0,r.jsx)("span",{children:"+"}),!t&&(0,r.jsx)("span",{children:"-"}),(0,r.jsx)(va,{className:Ht()("h-16 w-16",t?"text-[#77DA29]":"text-white")}),ne.bp.formatCash(e.amount,{showCurrency:!1,customDecimals:i,roundUp:!0})]})]})},fr=()=>{const e=(0,Kt.Bd)(),t=b(),a=w(e=>e.transaction.transactions),i=w(e=>e.transaction.apiTransactions.isPending),n=w(te),s=w(e=>e.transaction.hasMore),o=w(e=>e.transaction.currentPage),l=(0,g.useRef)(null),d=i||!n;return(0,g.useEffect)(()=>{if(!s||d)return;const e=l.current;if(!e)return;const a=new IntersectionObserver(e=>{e[0].isIntersecting&&n&&t(Pt({page:o+1}))},{threshold:0});return a.observe(e),()=>a.disconnect()},[s,d,o]),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("h2",{className:"title-h2-bold text-white",children:e("LOBBY.015","History")}),!d&&0===a.length&&(0,r.jsx)("div",{className:"flex h-56 flex-col items-center justify-center rounded-12 bg-white-6 p-12 text-center",children:(0,r.jsx)("div",{className:"text-medium-reg opacity-60",children:e("LOBBY.016","There are no transactions yet")})}),a.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[a.filter(e=>"completed"===e.status).map(e=>(0,r.jsx)(hr,{transaction:e},e.transactionId)),s&&(0,r.jsx)("div",{ref:l,className:"h-1"})]}),d&&(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)(Xt.k,{className:"!mb-20 !mt-5 !h-17 !w-17 !p-2"})})]})};var gr=a(5894),vr=a(3372),xr=a(3654),br=a(7263);const wr=({children:e,onClose:t=null,fullScreen:a=!1,background:i=null,modalName:n="promoLobby"})=>{const s=w(e=>e.modals.current.at(-1)||null),o=(0,Vt.GV)(e=>!!e.modals.current.length),l=(0,Vt.GV)(e=>e.viewPort.userAgent.browser.isSafari),d=(0,g.useRef)(null),c=l?{isolation:"isolate",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden"}:void 0,p=()=>{s===n&&t&&(ne.VH.emit("button:clicked",{name:"modalClose",value:n}),t())};return(0,xr.Ls)([d],p,!o),(0,xr.dD)("Escape",p,!o),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Ht()("fixed inset-0 -right-1 bottom-39 bg-brand-black opacity-75",gr.T.modal),style:c}),(0,r.jsx)("div",{className:Ht()("fixed -left-1 -right-1 bottom-0 h-40 bg-brand-black",gr.T.modal),style:c}),(0,r.jsx)("div",{className:"shadow-general-modals",children:(0,r.jsxs)("div",{ref:d,"data-testid":(0,vr.j)(`${n}-modal`),className:Ht()("promo-lobby-modal-gradient-border bg-brand-black-95 fixed bottom-40 left-0 right-0 flex w-full flex-col items-center overflow-hidden rounded-t-20",a&&["top-40 bg-white-6-gradient ml:top-20"],!a&&["max-h-[calc(100%-40px-20px)]"],gr.T.modal),style:c,children:[e,i&&(0,r.jsx)(br.o,{src:xa.f.get(i),from:"from-main-ui-bleached-06",className:"!absolute left-1/2 top-1/2 z-[-1] size-1000 min-w-1000 -translate-x-1/2 -translate-y-1/2 opacity-20"})]})})]})},yr=({children:e,hasShadow:t=!1,className:a="",scrollbarInsetTop:i=0,scrollbarInsetBottom:n=0})=>{const s=w(e=>e.promoLobby.activeScreen),o=w(e=>e.promoLobby.topBarScreen),l=(0,Vt.GV)(e=>e.viewPort.style.scale),d=(0,g.useRef)(null),c=(0,g.useRef)(null),p=(0,g.useRef)(null),[u,m]=(0,g.useState)(0),[h,f]=(0,g.useState)(0),[v,x]=(0,g.useState)(0),[b,y]=(0,g.useState)(!1),j=(0,g.useRef)(0),D=h-u<1;function C(){if(c.current&&d.current){const e=c.current.clientHeight,t=d.current.clientHeight;if(e>t){const a=Math.max(0,i),r=Math.max(0,n),s=Math.max(0,t-a-r);f(e-t);const o=s>0?s*t/e:0;x(Math.min(s,o)),y(s>0)}else y(!1),m(0)}}const z=`${s}-${null!=o?o:"null"}`,N=(0,g.useRef)(z);(0,g.useEffect)(()=>{b&&N.current!==z&&(m(0),N.current=z),N.current=z},[b,z]),(0,g.useEffect)(()=>{if(b){const e=e=>{e.preventDefault(),e.stopPropagation()};return document.addEventListener("wheel",e,{passive:!1}),()=>{document.removeEventListener("wheel",e)}}},[b]),(0,La.st)(C,0,c),(0,g.useEffect)(()=>{b&&u>=c.current.scrollHeight-d.current.clientHeight&&m(c.current.clientHeight-d.current.clientHeight)},[v,b,u]);const E=e=>{const t=d.current;if(!t)return;const a=t.getBoundingClientRect(),r=Math.max(0,i),s=Math.max(0,n),o=Math.max(0,t.clientHeight-r-s),c=Math.max(0,o-v);if(0===c)return;let p=(e.clientY-a.top)/l-r-j.current;p=Math.max(0,Math.min(p,c)),m(p/c*h)},P=()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",P)};return(0,r.jsxs)("div",{ref:d,className:Ht()("relative h-full w-full touch-none overflow-hidden scroll-smooth",a),onWheel:e=>{if(C(),b){const t=u+e.deltaY;m(Math.max(0,Math.min(t,h)))}},onTouchStart:e=>{if(C(),b){const t=e.touches[0].clientY;d.current.dataset.touchStartY=(t/l).toString()}},onTouchMove:e=>{if(C(),b){const t=d.current,a=parseFloat(t.dataset.touchStartY||"0"),r=e.touches[0].clientY,i=u+(a-r/l);m(Math.max(0,Math.min(i,h))),t.dataset.touchStartY=(r/l).toString()}},children:[(0,r.jsx)("div",{ref:c,className:"custom-scroll-content relative scroll-smooth will-change-transform",style:{transform:`translateY(-${u}px)`,transition:"none"},children:e}),t&&(0,r.jsx)("div",{className:Ht()("bg-surface-gradient pointer-events-none absolute -bottom-10 left-0 z-2 h-104 w-full",D?"transition-opacity duration-300":"transition-none"),style:{opacity:D?0:1}}),b&&(0,r.jsx)("div",{ref:p,className:"absolute right-6 top-0 w-3 cursor-pointer rounded-3 bg-white-20 md:right-11",style:{height:`${v}px`,transform:(()=>{var e;const t=(null===(e=d.current)||void 0===e?void 0:e.clientHeight)||0,a=Math.max(0,i),r=Math.max(0,n),s=Math.max(0,t-a-r),o=Math.max(0,s-v);return`translateY(${a+(o>0?o*u/h:0)}px)`})()},onMouseDown:e=>{e.preventDefault();const t=d.current,a=p.current;if(!t||!a)return;const r=a.getBoundingClientRect();j.current=(e.clientY-r.top)/l,document.addEventListener("mousemove",E),document.addEventListener("mouseup",P)}})]})},jr=({children:e,className:t="",contentClassName:a="",scrollbarInsetTop:i=null,scrollbarInsetBottom:n=null})=>(0,r.jsx)(yr,{scrollbarInsetTop:i,scrollbarInsetBottom:n,className:Ht()("w-full flex-1",t),children:(0,r.jsx)("div",{className:Ht()("mx-auto max-w-560 px-15 ml:px-0",a),children:e})}),Dr=({children:e,className:t=""})=>(0,r.jsx)("div",{className:Ht()("bg-brand-black-95 w-full px-16 pb-14 ml:pb-6",t),children:e});var Cr=a(6629),zr=a(5529),Nr=a(3277),Er=a(2306);const Pr=({children:e,onReturn:t=null,onClose:a=null,returnType:i="back",modalName:n="promoLobby",classes:s={closeButton:"",returnButton:""}})=>{const o=!!(0,Vt.GV)(e=>e.session.urls.lobby),l=(0,Vt.GV)(e=>e.app.urlParams.isHomeButtonDisabled),d=t&&("back"===i||"home"===i&&o&&!l);return(0,r.jsxs)("div",{className:"relative w-full px-60",children:[d&&(0,r.jsx)(Er.K,{"data-testid":"return-button",icon:"home"===i?Nr.A:Cr.A,className:Ht()("absolute left-8 top-8 z-1",null==s?void 0:s.returnButton),onClick:e=>{"home"!==i&&ne.VH.emit("button:clicked",{name:"return"}),t(e)}}),e,a&&(0,r.jsx)(Er.K,{"data-testid":"close-button",icon:zr.A,className:Ht()("absolute right-8 top-8 z-1",null==s?void 0:s.closeButton),onClick:e=>{e.stopPropagation(),ne.VH.emit("button:clicked",{name:"modalClose",value:n}),a()}})]})},Sr=({children:e,onClose:t=null,background:a=null,modalName:i="promoLobby"})=>{const n=w(e=>e.modals.current.at(-1)||null),s=(0,Vt.GV)(e=>!!e.modals.current.length),o=(0,g.useRef)(null),l=()=>{n===i&&t&&!s&&(ne.VH.emit("button:clicked",{name:"modalClose",value:i}),t())};return(0,xr.Ls)([o],l,!s),(0,xr.dD)("Escape",l,!s),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Ht()("fixed inset-0 -right-1 bottom-0",gr.T.modal),style:{background:"radial-gradient(107.99% 100% at 50% 0%, rgba(13, 242, 193, 0.1) 0%, rgba(0, 0, 0, 0.05) 50%, rgba(8, 8, 8, 0.00) 100%), var(--colors-brand-black)"}}),(0,r.jsx)("div",{className:"shadow-general-modals",children:(0,r.jsxs)("div",{ref:o,"data-testid":(0,vr.j)(`${i}-modal`),className:Ht()("fixed bottom-0 left-0 right-0 top-0 flex w-full flex-col items-center overflow-hidden rounded-t-0",gr.T.modal),children:[a&&(0,r.jsx)("div",{className:"absolute left-0 top-0 h-full w-full",children:(0,r.jsx)("img",{className:"h-full w-full object-cover object-center ml:scale-[1.5]",src:xa.f.get(a),alt:""})}),e,(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:l,className:"fixed bottom-0 left-0 right-0 h-40 w-full cursor-default"}),(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:l,className:"fixed left-0 right-0 top-0 h-20 w-full cursor-default"})]})})]})};const kr=({campaignId:e,prizeId:t,dropId:a})=>(r,i)=>{return n=void 0,s=void 0,l=function*(){r(Qe({campaignId:e,prizeId:t,dropId:a})).unwrap().then(()=>{var e,t,n,s;r(U(a)),r(Y(a));const o=i().prizeDrop.rewardHubDrops.find(e=>e.dropId===a),l=null!==(s=null===(n=null===(t=null===(e=null==o?void 0:o.prize)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===n?void 0:n.value)&&void 0!==s?s:0;l>0&&(r(Q(l)),r(Nt({amount:l,dropId:a}))),r(ht(a)),i().wallet.isWalletAvailable&&r(Pt({page:1}))}).catch(e=>{ne.vF.error(e)})},new((o=void 0)||(o=Promise))(function(e,t){function a(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o(function(e){e(i)})).then(a,r)}i((l=l.apply(n,s||[])).next())});var n,s,o,l},Or=e=>!!e&&new Date(e).getTime()<=Date.now(),Rr=()=>{var e,t,a,i,n;const s=(0,Vt.GV)(La.uB),o=w(e=>e.prizeDrop.winDropItem),l=w(e=>e.prizeDrop.apiClaim),d=w(e=>e.modals.current.includes("promoLobby")),c=w(e=>e.promoLobby.activeScreen),p=w(e=>e.promoLobby.topBarScreen),{isPending:u,data:v,error:x}=l,y=w(e=>e.wallet.trueDecimal),j=w(ae),D="number"==typeof j&&j>0,[C,z]=(0,g.useState)(!1),N=(0,Kt.Bd)(),E=b(),P=()=>{ne.h$.emit("reward:expired",(0,ie.rx)(o,"expired")),E(nt({dropId:o.dropId,claimUiStatus:"expired"})),E(Y(o.dropId)),E(ht(o.dropId)),E(mt()),E(ye("prizeDropClaimed")),E(we("prizeDropClaimedExpired"))};(0,g.useEffect)(()=>{ne.h$.emit("pdModalWinTrue:opened",(0,ie.ym)(o))},[o]),(0,g.useEffect)(()=>{z(!1)},[o.dropId]),(0,g.useEffect)(()=>{if(v&&C&&(ne.h$.emit("reward:claimSuccess",(0,ie.rx)(o,"claimed")),E(nt({dropId:o.dropId,claimUiStatus:"success"})),E(ye("prizeDropClaimed")),E(we("prizeDropClaimedSuccess")),E(mt())),x&&!u&&C){if(Or(o.expiresAt))return void P();ne.h$.emit("reward:claimFailed",Object.assign(Object.assign({},(0,ie.rx)(o,"new")),{error_code:x.name})),E(nt({dropId:o.dropId,claimUiStatus:"error"})),E(ye("prizeDropClaimed")),E(we("prizeDropClaimedFailed"))}},[C,v,E,x,u,o.dropId,o.expiresAt]);const S=()=>{u||(ne.h$.emit("pdModalWinDrop:closed",(0,ie.ym)(o)),d&&"true-world"===c&&null===p&&E(U(o.dropId)),E(Ct("prizeDropClaimed")))};return(0,r.jsxs)(wr,{modalName:"prizeDropClaimed",onClose:S,children:[s&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:xa.f.get(h),alt:"event"}),!s&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:xa.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropClaimed",onClose:S,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(jr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)("img",{className:"h-74 w-140 ml:h-64 ml:w-121",src:xa.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:N("DROP.018","Congratulations!")}),(0,r.jsx)("div",{className:"title-h3-bold",children:N("DROP.072","You've won a prize")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ua,{className:"h-28 w-28"}),(0,r.jsxs)(ha,{variant:"promo",children:[ne.bp.formatCash(null===(t=null===(e=o.prize.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value,{showCurrency:!1,customDecimals:y,roundUp:!0})," "]})]}),D&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",ne.bp.formatCash((null!==(n=null===(i=null===(a=o.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value)&&void 0!==n?n:0)/j,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:N("DROP.070","Claim your prize to have it credited to your account")})]}),(0,r.jsx)(Zt,{text:N("LOBBY.008","Claim"),loadingText:N("LOBBY.036","Pending"),isLoading:u,className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:()=>{if(z(!0),Or(o.expiresAt))return(0,L.yy)(300),void P();E(kr({campaignId:o.campaignId,prizeId:o.prize.prizeId,dropId:o.dropId}))},disabled:u})]})})]})};var Ir;function Br(){return Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Br.apply(null,arguments)}const Lr=e=>g.createElement("svg",Br({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 22 22"},e),Ir||(Ir=g.createElement("path",{fill:"#fff",d:"M13.024 13.024a.75.75 0 0 0 .474-1.423l-.237.711zm-1.732-1.368h-.75c0 .323.207.61.513.712zm.75-2.744a.75.75 0 0 0-1.5 0h1.5m1.219 3.4.237-.711-1.969-.656-.237.711-.237.712 1.969.656zm-1.969-.656h.75V8.912h-1.5v2.744zm5.25-.656h-.75a4.5 4.5 0 0 1-4.5 4.5V17a6 6 0 0 0 6-6zm-5.25 5.25v-.75a4.5 4.5 0 0 1-4.5-4.5h-1.5a6 6 0 0 0 6 6zM6.042 11h.75a4.5 4.5 0 0 1 4.5-4.5V5a6 6 0 0 0-6 6zm5.25-5.25v.75a4.5 4.5 0 0 1 4.5 4.5h1.5a6 6 0 0 0-6-6z"}))),_r=()=>{var e,t,a,i,n;const s=(0,Vt.GV)(La.uB),o=w(e=>e.prizeDrop.winDropItem),l=w(e=>e.wallet.trueDecimal),d=w(ae),c="number"==typeof d&&d>0,p=(0,Kt.Bd)(),u=b();(0,g.useEffect)(()=>{ne.h$.emit("pdModalClaimExpired:opened")},[]),(0,g.useEffect)(()=>{},[]);const f=()=>{ne.h$.emit("pdModalClaimExpired:closed"),u(Ct("prizeDropClaimedExpired"))};return(0,r.jsxs)(wr,{modalName:"prizeDropClaimedExpired",onClose:f,children:[s&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:xa.f.get(h),alt:"event"}),!s&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:xa.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropClaimedExpired",onClose:f,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(jr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(Lr,{className:"bg-add-gradient h-74 w-74 rounded-full ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:p("DROP.077","Reward expired")}),(0,r.jsx)("div",{className:"title-h3-bold",children:p("DROP.078","Time is up")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ua,{className:"h-28 w-28"}),(0,r.jsxs)(ha,{variant:"promo",children:[ne.bp.formatCash(null===(t=null===(e=o.prize.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value,{showCurrency:!1,customDecimals:l,roundUp:!0})," "]})]}),c&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",ne.bp.formatCash((null!==(n=null===(i=null===(a=o.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value)&&void 0!==n?n:0)/d,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:p("DROP.079","Unfortunately, the reward expiration time has ended.")})]}),(0,r.jsx)(qt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:f,children:p("GEN.220","Close")})]})})]})},Mr=({t:e,error:t,fallbackKey:a,fallbackMessage:r})=>{var i,n;return(null==t?void 0:t.code)?e(null!==(i=t.languageKey)&&void 0!==i?i:"",null!==(n=t.message)&&void 0!==n?n:r):e(a,r)},Tr=()=>{var e,t,a,i,n;const s=(0,Vt.GV)(La.uB),o=w(e=>e.prizeDrop.winDropItem),l=w(e=>e.prizeDrop.apiClaim),{isPending:d,data:c,error:p}=l,u=w(e=>e.wallet.trueDecimal),f=w(ae),v="number"==typeof f&&f>0,x=(0,Kt.Bd)(),y=b();(0,g.useEffect)(()=>{ne.h$.emit("pdModalClaimFailed:opened")},[]),(0,g.useEffect)(()=>{c&&o&&(y(nt({dropId:o.dropId,claimUiStatus:"success"})),y(ye("prizeDropClaimedFailed")),y(we("prizeDropClaimedSuccess")),y(mt()))},[c,y,o]);const j=()=>{d||(ne.h$.emit("pdModalClaimFailed:closed"),y(Ct("prizeDropClaimedFailed")))};return(0,r.jsxs)(wr,{modalName:"prizeDropClaimedFailed",onClose:j,children:[s&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:xa.f.get(h),alt:"event"}),!s&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:xa.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropClaimedFailed",onClose:j,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(jr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(Ta.A,{className:"bg-add-gradient h-74 w-74 rounded-full ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:x("DROP.074","Claim failed")}),(0,r.jsx)("div",{className:"title-h3-bold",children:x("DROP.075","Something went wrong")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ua,{className:"h-28 w-28"}),(0,r.jsxs)(ha,{variant:"promo",children:[ne.bp.formatCash(null===(t=null===(e=o.prize.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value,{showCurrency:!1,customDecimals:u,roundUp:!0})," "]})]}),v&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",ne.bp.formatCash((null!==(n=null===(i=null===(a=o.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value)&&void 0!==n?n:0)/f,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:Mr({t:x,error:p,fallbackKey:"DROP.076",fallbackMessage:"We couldn't process your request. Please try again later."})})]}),(0,r.jsx)(Zt,{text:x("DROP.017","Try Again"),loadingText:x("LOBBY.036","Pending"),isLoading:d,className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:()=>{d||y(kr({campaignId:o.campaignId,prizeId:o.prize.prizeId,dropId:o.dropId}))},disabled:d})]})})]})};var Ar=a(598);const Fr=()=>{var e,t,a,i,n;const s=(0,Vt.GV)(La.uB),o=w(e=>e.prizeDrop.winDropItem),l=w(e=>e.wallet.trueDecimal),d=w(ae),c="number"==typeof d&&d>0,p=(0,Kt.Bd)(),u=b();(0,g.useEffect)(()=>{ne.h$.emit("pdModalClaimSuccess:opened")},[]);const f=()=>{ne.h$.emit("pdModalClaimSuccess:closed"),u(Ct("prizeDropClaimedSuccess"))};return(0,r.jsxs)(wr,{modalName:"prizeDropClaimedSuccess",onClose:f,children:[s&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:xa.f.get(h),alt:"event"}),!s&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:xa.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropClaimedSuccess",onClose:f,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(jr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(Ar.A,{className:"h-74 w-74 rounded-full bg-green ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:p("DROP.071","Reward claimed")}),(0,r.jsx)("div",{className:"title-h3-bold",children:p("DROP.072","You’ve won a prize")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ua,{className:"h-28 w-28"}),(0,r.jsxs)(ha,{variant:"promo",children:[ne.bp.formatCash(null===(t=null===(e=o.prize.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value,{showCurrency:!1,customDecimals:l,roundUp:!0})," "]})]}),c&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",ne.bp.formatCash((null!==(n=null===(i=null===(a=o.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value)&&void 0!==n?n:0)/d,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:p("DROP.073","The reward has been successfully credited to your balance.")})]}),(0,r.jsx)(qt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:f,children:p("GEN.220","OK")})]})})]})},Ur=()=>{var e,t,a,i,n,s,o,l,d;const c=(0,Vt.GV)(La.uB),p=w(e=>e.prizeDrop.winDropItem),u=(0,Kt.Bd)(),v=b();(0,g.useEffect)(()=>{ne.h$.emit("pdModalWinDrop:opened",(0,ie.ym)(p))},[p]);const x=()=>{ne.h$.emit("pdModalWinDrop:closed",(0,ie.ym)(p)),v(Ct("prizeDropCongratulation"))};return(0,r.jsxs)(wr,{modalName:"prizeDropCongratulation",onClose:x,children:[c&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:xa.f.get(h),alt:"event"}),!c&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:xa.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropCongratulation",onClose:x,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(jr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)("img",{className:"h-74 w-140 ml:h-64 ml:w-121",src:xa.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:u("DROP.018","Congratulations!")}),(0,r.jsx)("div",{className:"title-h3-bold",children:u("DROP.019","You’ve won a cash prize")})]}),(0,r.jsx)("div",{className:"text-prize-drop",children:(0,r.jsxs)(ha,{variant:"promo",children:[ne.bp.formatCash(null===(a=null===(t=null===(e=null==p?void 0:p.prize)||void 0===e?void 0:e.configCash)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:null===(s=null===(n=null===(i=null==p?void 0:p.prize)||void 0===i?void 0:i.configCash)||void 0===n?void 0:n.amount)||void 0===s?void 0:s.decimals,roundUp:!0})," ",null===(d=null===(l=null===(o=null==p?void 0:p.prize)||void 0===o?void 0:o.configCash)||void 0===l?void 0:l.amount)||void 0===d?void 0:d.currency]})}),(0,r.jsx)("div",{className:"text-medium-reg",children:u("DROP.020","Instantly credited to your account.")})]}),(0,r.jsx)(qt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),x()},children:u("DROP.021","Great news!")})]})})]})},$r=()=>{const{apiJoinCampaign:e}=w(e=>e.prizeDrop),{campaignId:t}=w(e=>e.prizeDrop.displayedCampaign),a=b(),i=(0,Kt.Bd)();(0,g.useEffect)(()=>{ne.h$.emit("pdModalJoinError:opened")},[]),((t,r)=>{const i=(0,g.useRef)(!1);(0,g.useEffect)(()=>{if(i.current)return e.data&&(e.data.joined?(ne.h$.emit("pdModalJoinError:successRetry"),a(we("prizeDropSuccess")),a(ye("prizeDropJoinError")),a(ct()),a(qe())):(ne.h$.emit("pdModalJoinError:unsuccessfulRetry"),a(we("prizeDropJoinError")))),void(e.error&&(ne.h$.emit("pdModalJoinError:unsuccessfulRetry"),a(we("prizeDropJoinError"))))},r),(0,g.useEffect)(()=>{i.current=!0},[])})(0,[e]);const n=()=>{e.isPending||(ne.h$.emit("pdModalJoinError:closed"),a(Dt("prizeDropJoinError")),a(ct()))};return(0,r.jsxs)(wr,{onClose:n,modalName:"prizeDropJoinError",children:[(0,r.jsx)(Pr,{onClose:n,returnType:"home",modalName:"prizeDropJoinError",children:(0,r.jsx)("div",{className:"title-h1-bold pb-18 pt-25 text-center uppercase ml:pt-19",children:i("DROP.015","Oops")})}),(0,r.jsx)(jr,{children:(0,r.jsxs)("div",{className:"mx-auto flex max-w-604 select-text flex-col items-center gap-18 px-14 pb-30 ml:px-0 ml:pb-31",children:[(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-medium-reg mb-2",children:Mr({t:i,error:e.error,fallbackKey:"DROP.016",fallbackMessage:"Something's wrong... Please try again."})})}),(0,r.jsx)(Zt,{text:i("DROP.017","Try Again"),loadingText:i("DROP.011","Joining..."),className:"w-full max-w-354 !bg-brand-gradient",isLoading:e.isPending,onClick:e=>{e.stopPropagation(),ne.VH.emit("button:clicked",{name:"service"}),a(tr({campaignId:t})),ne.h$.emit("pdModalJoinError:startRetry")}})]})})]})};var Yr;function Vr(){return Vr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Vr.apply(null,arguments)}const Gr=e=>g.createElement("svg",Vr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 9 8"},e),Yr||(Yr=g.createElement("path",{fill:"#FC0",d:"m4.5 0 1.08 2.92L8.5 4 5.58 5.08 4.5 8 3.42 5.08.5 4l2.92-1.08z"}))),Hr=()=>{var e,t,a,i,n,s,o,l,d,c;const p=(0,Vt.GV)(La.uB),{dateStart:u,dateEnd:v,betAmount:x,prizesTotalCount:y,campaignId:j,texts:D}=w(e=>e.prizeDrop.displayedCampaign),{apiJoinCampaign:C}=w(e=>e.prizeDrop),z=w(xt),N=w(e=>e.wallet.trueDecimal),E=(0,Kt.Bd)(),P=b();(0,g.useEffect)(()=>{ne.h$.emit("pdModalLive:opened")},[]),(0,g.useEffect)(()=>{C.data&&(C.data.joined?(ne.h$.emit("pdModalLive:joinSuccess"),P(lt()),P(we("prizeDropSuccess")),P(Dt("prizeDropLive")),P(qe())):(ne.h$.emit("pdModalLive:joinError"),P(we("prizeDropJoinError")),P(ye("prizeDropLive")))),C.error&&(ne.h$.emit("pdModalLive:joinError"),P(we("prizeDropJoinError")),P(ye("prizeDropLive")))},[C]);const S=()=>{C.isPending||(ne.h$.emit("pdModalLive:later"),P(Dt("prizeDropLive")))};return(0,r.jsxs)(wr,{modalName:"prizeDropLive",onClose:S,children:[(0,r.jsx)(Pr,{modalName:"prizeDropLive",onClose:S,children:(0,r.jsx)("div",{})}),(0,r.jsxs)(jr,{scrollbarInsetTop:56,children:[p&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:xa.f.get(h),alt:"event"}),!p&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:xa.f.get(m),alt:"event"}),(0,r.jsx)("div",{className:"mx-auto max-w-604 pt-30 ml:pt-25",children:(0,r.jsxs)("div",{className:"flex flex-col gap-16 px-15 pb-22 text-center ml:px-0 ml:pb-18",children:[(0,r.jsxs)("div",{className:"relative flex w-full flex-col items-center gap-11 text-center ml:gap-10",children:[(0,r.jsx)(Qt,{prizeDropMode:"live",className:"absolute -top-5 left-1/2 translate-x-22"}),(0,r.jsx)("img",{className:"h-74 w-140",src:xa.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:(null==D?void 0:D.title)||E("DROP.001","Prize drop event is live!")}),(0,r.jsx)("div",{className:"text-medium-reg",children:(null==D?void 0:D.description)||E("DROP.002","Spin and win amazing prizes instantly!")})]})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-11 rounded-14 bg-white-6 px-20 pb-22 pt-20 ml:gap-10",children:[(0,r.jsx)(Da,{}),(0,r.jsxs)("div",{className:"text-medium-reg flex flex-col gap-2 pl-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Gr,{width:8,height:8})}),(0,r.jsxs)("div",{children:[E("DROP.004","Total prize count:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:y})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Gr,{width:8,height:8})}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[E("DROP.005","Top prize:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:"true"===(null==z?void 0:z.type)?(0,r.jsxs)("div",{children:[ne.bp.formatCash(null!==(a=null===(t=null===(e=null==z?void 0:z.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value)&&void 0!==a?a:0,{showCurrency:!1,customDecimals:N,roundUp:!0})," $TRUE"]}):(0,r.jsx)("div",{children:ne.bp.formatCash(null!==(s=null===(n=null===(i=null==z?void 0:z.configCash)||void 0===i?void 0:i.amount)||void 0===n?void 0:n.value)&&void 0!==s?s:0,{customCurrency:null===(l=null===(o=null==z?void 0:z.configCash)||void 0===o?void 0:o.amount)||void 0===l?void 0:l.currency,customDecimals:null===(c=null===(d=null==z?void 0:z.configCash)||void 0===d?void 0:d.amount)||void 0===c?void 0:c.decimals,roundUp:!0})})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Gr,{width:8,height:8})}),(0,r.jsxs)("div",{children:[E("DROP.006","Min. bet to participate:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:ne.bp.formatCash(x)})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Gr,{width:8,height:8})}),(0,r.jsxs)("div",{children:[E("DROP.007","Every qualified bet can win")," 🚀"]})]})]})]}),(0,r.jsx)(Sa,{dateStart:u,dateEnd:v,className:"text-medium-bold mt-0 flex items-center justify-center"})]})})]}),(0,r.jsx)(Dr,{className:"!pb-30 ml:!pb-10",children:(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-560 gap-14 px-14 ml:gap-10 ml:px-0",children:[(0,r.jsx)(qt.$,{className:"!min-w-170 flex-1",onClick:e=>{e.stopPropagation(),S()},variant:"secondary",children:E("DROP.009","Later")}),(0,r.jsx)(Zt,{text:E("DROP.010","Join now"),loadingText:E("DROP.011","Joining..."),isLoading:C.isPending,onClick:()=>{ne.h$.emit("pdModalLive:startJoin"),P(tr({campaignId:j}))},className:"text-medium-bold !min-w-170 flex-1 !bg-brand-gradient"})]})})]})},Jr=()=>{const e=(0,Vt.GV)(La.uB),t=(0,Kt.Bd)(),a=b();(0,g.useEffect)(()=>{ne.h$.emit("pdModalEventCancelled:opened")},[]);const i=()=>{ne.h$.emit("pdModalEventCancelled:closed"),a(ye("prizeDropResultCancelled"))};return(0,r.jsxs)(wr,{modalName:"prizeDropResultCancelled",onClose:i,children:[e&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:xa.f.get(h),alt:"event"}),!e&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:xa.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropResultCancelled",onClose:i,children:(0,r.jsx)("div",{})}),(0,r.jsx)(jr,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-604 py-30 ml:pb-20 ml:pt-25",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-10 px-50 pb-22 text-center ml:pb-18",children:[(0,r.jsx)("img",{className:"h-74 w-140",src:xa.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:t("DROP.022","Event cancelled")}),(0,r.jsx)("div",{className:"text-medium-reg",children:`${t("DROP.023","The current event has been cancelled. Stay tuned for new events ")} 🚀`})]})]}),(0,r.jsx)(qt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),i()},children:t("DROP.014","OK")})]})})]})},Wr=()=>{const e=(0,Vt.GV)(La.uB),t=(0,Kt.Bd)(),a=b();(0,g.useEffect)(()=>{ne.h$.emit("pdModalEventEnded:opened")},[]);const i=()=>{ne.h$.emit("pdModalEventEnded:closed"),a(ye("prizeDropResultFinished"))};return(0,r.jsxs)(wr,{modalName:"prizeDropResultFinished",onClose:i,children:[e&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:xa.f.get(h),alt:"event"}),!e&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:xa.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropResultFinished",onClose:i,children:(0,r.jsx)("div",{})}),(0,r.jsx)(jr,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-604 py-30 ml:pb-20 ml:pt-25",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-10 px-50 pb-22 text-center ml:pb-18",children:[(0,r.jsx)("img",{className:"h-74 w-140",src:xa.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:t("DROP.024","Event ended")}),(0,r.jsx)("div",{className:"text-medium-reg",children:`${t("DROP.025","The current event is over. Stay tuned for new events")} 🚀`})]})]}),(0,r.jsx)(qt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),i()},children:t("DROP.014","OK")})]})})]})},Kr=()=>{const e=b(),t=(0,Kt.Bd)();(0,g.useEffect)(()=>{ne.h$.emit("pdModalSuccess:opened")},[]);const a=()=>{ne.h$.emit("pdModalSuccess:closed"),e(ye("prizeDropSuccess"))};return(0,r.jsxs)(wr,{onClose:a,modalName:"prizeDropSuccess",children:[(0,r.jsx)(Pr,{onClose:a,returnType:"home",modalName:"prizeDropSuccess",children:(0,r.jsx)("div",{className:"mx-auto mt-25 flex h-46 w-46 items-center justify-center rounded-full bg-green",children:(0,r.jsx)(Ar.A,{className:"",width:46,height:46})})}),(0,r.jsx)(jr,{children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-20 pb-30 pt-20",children:[(0,r.jsx)("h1",{className:"title-h1-bold",children:t("DROP.012","Success").toUpperCase()}),(0,r.jsx)("span",{className:"text-medium-reg",children:t("DROP.013","You have successfully joined the event!")}),(0,r.jsx)(qt.$,{className:"w-full max-w-354 !bg-brand-gradient uppercase",onClick:e=>{e.stopPropagation(),a()},children:t("DROP.014","OK")})]})})]})},Qr=()=>{const e=w(wt),t=(0,Kt.Bd)(),a=[{id:"events",title:t("DROP.027","Event")},{id:"rules",title:t("DROP.028","Rules")}],[i,n]=(0,g.useState)("events");return(0,r.jsxs)("div",{className:Ht()(e&&"!pb-64"),children:[(0,r.jsx)("div",{className:"mb-16 flex flex-col items-center",children:(0,r.jsx)(er,{activeTab:i,setActiveTab:n,config:a})}),(0,r.jsx)("div",{className:"mx-auto",children:"events"===i?(0,r.jsx)(Va,{}):(0,r.jsx)(Za,{})})]})},qr=()=>{const e=(0,Kt.Bd)(),t=e=>e.split(/(\$TRUE)/g).map((e,t)=>(0,r.jsx)("span",{className:"$TRUE"===e?"text-medium-bold text-white opacity-100":"opacity-60",children:e},`${e}-${t}`));return(0,r.jsxs)("div",{className:"mx-auto flex w-full flex-col items-center pb-28",children:[(0,r.jsx)("h2",{className:"w-340 text-28 font-black leading-[1.3] text-white",children:e("LOBBY.041","Welcome to TRUE World. Play. Earn. Unlock more.")}),(0,r.jsx)("div",{className:"h-322",children:(0,r.jsx)("img",{src:xa.f.get(s),alt:"true coin",className:"h-full object-cover object-center"})}),(0,r.jsxs)("div",{className:"text-medium-reg mx-auto max-w-340 text-white",children:[(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.042","TRUE World is your gateway to the next generation of rewards inside TRUE LABS games."))}),(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.043","As you play, you automatically earn $TRUE tokens through Prize Drops, leaderboard tournaments, and exclusive airdrops. No extra steps - just enjoy your favorite games and collect rewards."))}),(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.044","Your $TRUE tokens open the door to a growing universe of opportunities: trade collectibles on the Marketplace, stake tokens for added benefits, or explore new features across the TRUE World portal."))}),(0,r.jsx)("p",{children:t(e("LOBBY.045","Ownership of $TRUE is more than a bonus - it's your entry ticket to special events and tournaments, unique in-game content, and future perks across the entire TRUE ecosystem. You can even spend $TRUE on exclusive TRUE LABS merchandise and other real-world items."))})]})]})},Xr=()=>{const e=(0,Kt.Bd)();return(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-16 pb-28",children:[(0,r.jsx)("img",{src:xa.f.get(n),alt:"coming soon",className:"h-310 w-414 max-w-none object-cover object-center"}),(0,r.jsxs)("div",{className:"flex w-340 flex-col items-center gap-6 text-center",children:[(0,r.jsx)("h2",{className:"title-h1-bold text-white",children:e("LOBBY.029","Your character's progress")}),(0,r.jsxs)("p",{className:"text-medium-reg text-white opacity-60",children:[e("LOBBY.030","Let your hero grow with every spin!"),(0,r.jsx)("br",{}),e("LOBBY.031","Tease your luck, uncover in-game secrets, and unlock real-world rewards.")]}),(0,r.jsx)("p",{className:"text-medium-bold text-white",children:e("LOBBY.032","Coming soon. Stay tuned!")})]})]})};var Zr=a(6861),ei=a(454);const ti=({text:e,className:t=""})=>(0,r.jsxs)("div",{className:Ht()("relative flex min-w-290 items-center justify-center gap-12 rounded-8 bg-main-ui px-16 py-12 shadow-notify-modals",t),children:[(0,r.jsx)("div",{className:"absolute h-full w-full rounded-8 bg-white-10"}),(0,r.jsx)("div",{className:"bg-add-gradient flex min-h-22 min-w-22 shrink-0 items-center justify-center overflow-hidden rounded-full",children:(0,r.jsx)(Lr,{className:"h-full w-full"})}),(0,r.jsx)("div",{className:"text-medium-med",children:e})]}),ai=(0,g.createContext)(null),ri=({children:e})=>{const[t,a]=(0,g.useState)(null),i=(0,g.useRef)(null),n=(0,g.useCallback)((e,t)=>{clearTimeout(i.current),a({type:e,text:t}),i.current=setTimeout(()=>{a(null)},1500)},[]),s=(0,g.useCallback)((e="Reward claimed")=>{n("success",e)},[n]),o=(0,g.useCallback)((e="Something went wrong")=>{n("failed",e)},[n]),l=(0,g.useCallback)((e="Unfortunately, the reward expiration time has ended.")=>{n("expired",e)},[n]),d=(0,g.useMemo)(()=>({showSuccessToast:s,showFailedToast:o,showExpiredToast:l}),[s,o,l]);return(0,r.jsxs)(ai.Provider,{value:d,children:[e,t&&(0,r.jsxs)("div",{className:"pointer-events-none fixed left-1/2 top-28 z-[71] min-w-290 -translate-x-1/2 text-wrap px-16",children:["success"===t.type&&(0,r.jsx)(ei.r,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"}),"expired"===t.type&&(0,r.jsx)(ti,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"}),"failed"===t.type&&(0,r.jsx)(Zr.v,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"})]})]})},ii=()=>{const e=(0,g.useContext)(ai);if(!e)throw new Error("usePromoLobbyToast must be used within PromoLobbyToastProvider");return e},ni=e=>{if(!e)return"expired";const t=new Date(e).getTime()-Date.now();if(t<=0)return"expired";const a=Math.floor(t/36e5);return a<1?"lessThanHour":a},si=({reward:e,onClaimRequested:t=()=>!0})=>{var a,i,n,s,o;const l=(0,Kt.Bd)(),c=b(),{showExpiredToast:p}=ii(),[u,m]=(0,g.useState)(()=>ni(e.expiresAt)),h=w(e=>e.prizeDrop.apiClaim),{error:f}=h,[v,x]=(0,g.useState)(!1),y=w(e=>e.wallet.trueDecimal),j=w(ae),D=!!(C=e.expiresAt)&&new Date(C).getTime()<=Date.now();var C;const z="number"==typeof j&&j>0;(0,g.useEffect)(()=>{if(!e.expiresAt)return;const t=()=>m(ni(e.expiresAt)),a=setInterval(t,6e4);return t(),()=>clearInterval(a)},[e.expiresAt]),(0,g.useEffect)(()=>{f&&v&&x(!1)},[f,v]);const N=(0,g.useMemo)(()=>"expired"===u?l("LOBBY.035","Unfortunately, the reward expiration time has ended."):"lessThanHour"===u?l("LOBBY.038","expires in <1 hour"):1===u?l("LOBBY.038","expires in <1 hour").replace("<1","1"):l("LOBBY.009","expires in <HOURS> hours",{"<HOURS>":String(u)}),[u,l]),E=(0,g.useRef)(!1);return(0,g.useEffect)(()=>{D&&!E.current&&(E.current=!0,e.direct||ne.h$.emit("reward:expired",(0,ie.rx)(e,"expired")),p(l("LOBBY.035","Unfortunately, the reward expiration time has ended.")),c(Y(e.dropId)),c(ht(e.dropId)))},[c,e,e.dropId,D,p,l]),D?null:(0,r.jsxs)("div",{className:"mt-12 flex items-center gap-10 border-b border-white-10 pb-12 first:pt-0 last:border-b-0 last:pb-0",children:[(0,r.jsx)("img",{className:"h-54 w-54",src:d,alt:"Reward"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-small-reg",children:l("LOBBY.007","Prizedrop reward")}),(0,r.jsxs)("div",{className:"title-h2-bold mt-2 flex items-center gap-4",children:[(0,r.jsx)(va,{className:"h-16 w-16"}),ne.bp.formatCash(null===(i=null===(a=e.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value,{showCurrency:!1,customDecimals:y,roundUp:!0})]}),z&&(0,r.jsxs)("div",{className:"text-xs-reg mt-1 opacity-70",children:["~",ne.bp.formatCash((null!==(o=null===(s=null===(n=e.prize.configTrue)||void 0===n?void 0:n.amount)||void 0===s?void 0:s.value)&&void 0!==o?o:0)/j,{roundUp:!0})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-4",children:[(0,r.jsx)(Zt,{size:"small",text:l("LOBBY.008","Claim"),loadingText:l("LOBBY.036","Pending"),isLoading:v,className:"!min-w-120 !bg-brand-gradient",onClick:()=>{t(e)&&(ne.h$.emit("reward:claimClicked",(0,ie.rx)(e,"new")),x(!0),c(kr({campaignId:e.campaignId,prizeId:e.prize.prizeId,dropId:e.dropId})))},disabled:D||v}),(0,r.jsx)("span",{className:"text-super-xs-reg text-center opacity-40",children:N})]})]})},oi=()=>{const e=w(e=>e.prizeDrop.rewardHubDrops),t=w(e=>e.prizeDrop.apiClaim),{data:a,error:i}=t,n=(0,Kt.Bd)(),s=(0,g.useRef)(!1),o=(0,g.useRef)(null),{showSuccessToast:l,showFailedToast:d,showExpiredToast:c}=ii();(0,g.useEffect)(()=>{a&&s.current&&o.current&&(l(n("LOBBY.034","The reward has been successfully credited to your balance.")),ne.h$.emit("reward:claimSuccess",(0,ie.rx)(o.current,"claimed")),s.current=!1,o.current=null)},[a,l,n]),(0,g.useEffect)(()=>{i&&s.current&&o.current&&(d(Mr({t:n,error:i,fallbackKey:"LOBBY.037",fallbackMessage:"Something went wrong. Please try again later."})),ne.h$.emit("reward:claimFailed",Object.assign(Object.assign({},(0,ie.rx)(o.current,"new")),{error_code:i.name})),s.current=!1,o.current=null)},[i,d,c,n]);const p=e=>{return(t=e.expiresAt)&&new Date(t).getTime()<=Date.now()?(ne.h$.emit("reward:expired",(0,ie.rx)(e,"expired")),c(n("LOBBY.035","Unfortunately, the reward expiration time has ended.")),!1):(s.current=!0,o.current=e,!0);var t};return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"flex w-full flex-col rounded-12 bg-white-10 p-16",children:[(0,r.jsx)("h2",{className:"title-h2-bold",children:n("LOBBY.002","Rewards Hub")}),e.map(e=>(0,r.jsx)(si,{reward:e,onClaimRequested:p},e.dropId)),0===e.length&&(0,r.jsxs)("div",{className:"text-medium-reg mt-6 opacity-60",children:[n("LOBBY.003","Just play TRUE LABS games and unlock extra rewards")," 🎁"]})]})})},li=()=>{const e=b();return(0,g.useEffect)(()=>{e(ir())},[e]),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-16 pb-12",children:[(0,r.jsx)(oi,{}),(0,r.jsx)(qa,{})]})};const di=()=>{const e=b(),t=!!w(e=>e.prizeDrop.restData),a=!!w(e=>{var t;return null===(t=e.transaction.apiTransactions.fake)||void 0===t?void 0:t.enabled}),r=w(te),i=t||a;(0,g.useEffect)(()=>{i&&(e(Et()),r&&e((e,t)=>{return a=void 0,r=void 0,n=function*(){t().wallet.isWalletAvailable&&e(Pt(void 0)).unwrap().catch(e=>{ne.vF.error(e)})},new((i=void 0)||(i=Promise))(function(e,t){function s(e){try{l(n.next(e))}catch(e){t(e)}}function o(e){try{l(n.throw(e))}catch(e){t(e)}}function l(t){var a;t.done?e(t.value):(a=t.value,a instanceof i?a:new i(function(e){e(a)})).then(s,o)}l((n=n.apply(a,r||[])).next())});var a,r,i,n}),e(ir()))},[e,i,r])},ci=()=>(di(),(0,r.jsxs)("div",{className:"flex flex-col gap-24",children:[(0,r.jsx)(ja,{}),(0,r.jsx)(fr,{})]})),pi=()=>{const e=w(e=>e.promoLobby.activeScreen),t=w(e=>e.promoLobby.topBarScreen);return(0,r.jsxs)(r.Fragment,{children:["info"===t&&(0,r.jsx)(qr,{}),"profile"===t&&(0,r.jsx)(Xr,{}),"wallet"===t&&(0,r.jsx)(ci,{}),null===t&&(0,r.jsxs)(r.Fragment,{children:["true-world"===e&&(0,r.jsx)(li,{}),"campaign"===e&&(0,r.jsx)(Qr,{})]})]})};var ui,mi,hi,fi,gi;function vi(){return vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},vi.apply(null,arguments)}function xi(){return xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},xi.apply(null,arguments)}function bi(){return bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},bi.apply(null,arguments)}function wi(){return wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},wi.apply(null,arguments)}function yi(){return yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},yi.apply(null,arguments)}const ji={trueWorld:{title:"True World",icon:e=>g.createElement("svg",yi({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),gi||(gi=g.createElement("path",{fill:"#fff",d:"m27.844 15-9.866 9.88L8.11 15l9.867-9.879zM11.3 21.686l-2.466 2.47-2.467-2.47 2.467-2.47zM9.133 9.038l-3.488 3.493-3.489-3.493 3.489-3.493z"}))),screens:["true-world","campaign"],comingSoon:!1},trueGames:{title:"True Games",icon:e=>g.createElement("svg",wi({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),fi||(fi=g.createElement("path",{fill:"#fff",d:"M5.294 15a1.08 1.08 0 0 0 1.078 1.078h6.471A1.08 1.08 0 0 0 13.921 15V6.372a1.08 1.08 0 0 0-1.078-1.078h-6.47a1.08 1.08 0 0 0-1.08 1.078zm0 8.627a1.08 1.08 0 0 0 1.078 1.079h6.471a1.08 1.08 0 0 0 1.078-1.079v-4.313a1.08 1.08 0 0 0-1.078-1.079h-6.47a1.08 1.08 0 0 0-1.08 1.079zm10.784 0a1.08 1.08 0 0 0 1.079 1.079h6.47a1.08 1.08 0 0 0 1.079-1.079V15a1.08 1.08 0 0 0-1.079-1.079h-6.47A1.08 1.08 0 0 0 16.078 15zm1.079-18.333a1.08 1.08 0 0 0-1.079 1.078v4.314a1.08 1.08 0 0 0 1.079 1.079h6.47a1.08 1.08 0 0 0 1.079-1.079V6.372a1.08 1.08 0 0 0-1.079-1.078z"}))),screens:["true-games"],comingSoon:!0},tournaments:{title:"Tournaments",icon:e=>g.createElement("svg",bi({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),hi||(hi=g.createElement("path",{fill:"#fff",d:"M21.353 4.412v3.176h4.236q-.044 3.834-1.205 5.407l-.119.152q-.933 1.12-3.187 1.592a6.36 6.36 0 0 1-5.017 4.408l-.002.088a4.235 4.235 0 0 0 4.235 4.236v2.117H9.707v-2.117a4.235 4.235 0 0 0 4.236-4.236l-.003-.088a6.36 6.36 0 0 1-5.016-4.408q-2.254-.471-3.187-1.592-1.279-1.534-1.324-5.559h4.235V4.412zM15 6.529l-1.224 2.91-3.01.326 2.256 2.118-.64 3.117L15 13.399l2.618 1.6-.64-3.112 2.258-2.118-3.012-.326zM8.647 9.706H6.676l.023.152c.136.87.344 1.486.594 1.842l.07.091c.195.235.562.455 1.106.641l.178.056zm14.678 0h-1.972v2.782l.179-.056c.544-.186.91-.406 1.106-.64l.07-.091c.25-.357.458-.974.594-1.843z"}))),screens:["tournaments"],comingSoon:!0},quests:{title:"Quests",icon:e=>g.createElement("svg",vi({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),ui||(ui=g.createElement("path",{fill:"#fff",d:"M25.106 6.805a.53.53 0 0 1 .483.527v15.08l-7.412 3.177-6.353-3.177-6.674 2.86a.53.53 0 0 1-.738-.487V9.706l3.314-1.42a7.41 7.41 0 0 0 2.033 6.66L15 20.19l5.241-5.242A7.41 7.41 0 0 0 22.21 7.98l2.642-1.133a.5.5 0 0 1 .255-.041M15 4.412a5.296 5.296 0 0 1 3.744 9.037L15 17.192l-3.744-3.743A5.295 5.295 0 0 1 15 4.412m0 3.53a1.765 1.765 0 1 0 0 3.529 1.765 1.765 0 0 0 0-3.53"}))),screens:["quests"],comingSoon:!0},marketplace:{title:"Marketplace",icon:e=>g.createElement("svg",xi({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),mi||(mi=g.createElement("path",{fill:"#fff",d:"M4.995 4.445a.814.814 0 0 1 1.012.552l.597 2.022H22.52c1.998 0 3.524 1.864 2.948 3.811l-1.797 6.082c-.382 1.296-1.598 2.16-2.948 2.16h-9.943c-1.351 0-2.565-.864-2.949-2.16L4.446 5.458a.814.814 0 0 1 .55-1.013m3.76 18.7a2.443 2.443 0 1 1 4.887 0 2.443 2.443 0 0 1-4.886 0m8.688 0a2.443 2.443 0 1 1 4.886 0 2.443 2.443 0 0 1-4.886 0"}))),screens:["marketplace"],comingSoon:!0}},Di=({item:e,isActive:t})=>{const a=e.icon,i=e.comingSoon,n=(0,Kt.Bd)(),s=b();return(0,r.jsxs)("button",{disabled:i,onClick:()=>{s(P(e.screens[0]))},type:"button",className:Ht()("relative flex flex-1 flex-col items-center justify-center gap-2 ml:flex-none"),children:[(0,r.jsxs)("div",{className:Ht()("flex flex-col items-center justify-center gap-2 ml:w-70",t(e.screens)?"text-white":"opacity-40",i&&"cursor-default !opacity-15",!i&&"cursor-pointer hover:opacity-100"),children:[(0,r.jsx)(a,{className:"h-30 w-30"}),(0,r.jsx)("div",{className:"text-super-xs-bold",children:e.title})]}),e.comingSoon&&(0,r.jsx)("div",{className:"absolute right-0 top-0 z-10 rounded-10 border border-brand-black bg-[#262626] px-5 py-1",children:(0,r.jsx)("div",{className:"text-super-xss-bold uppercase opacity-40 ",children:n("","Soon")})})]},e.title)},Ci=()=>{const e=w(e=>e.promoLobby.activeScreen),t=t=>t.includes(e);return(0,r.jsx)("div",{className:"md:navbar-gradient-border absolute bottom-40 left-0 right-0 flex justify-between gap-6 bg-brand-black px-20 pb-18 pt-14 mp:rounded-t-20 ml:right-auto ml:top-20 ml:flex-col ml:justify-start ml:gap-20 ml:px-8 ml:pb-16 ml:pt-16",children:Object.values(ji).map(e=>(0,r.jsx)(Di,{item:e,isActive:t},e.title))})};var zi,Ni;function Ei(){return Ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ei.apply(null,arguments)}const Pi=e=>g.createElement("svg",Ei({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 46 46"},e),zi||(zi=g.createElement("path",{fill:"#fff",d:"M46 23c0 12.703-10.297 23-23 23S0 35.703 0 23 10.298 0 23 0s23 10.298 23 23M2.3 23c0 11.432 9.268 20.7 20.7 20.7S43.7 34.432 43.7 23 34.432 2.3 23 2.3 2.3 11.568 2.3 23"})),Ni||(Ni=g.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M23 6a17 17 0 0 1 17 17c0 9.389-7.611 17-17 17S6 32.389 6 23 13.611 6 23 6m1.7 18.7h-3.4a10.2 10.2 0 0 0-9.38 6.188A13.58 13.58 0 0 0 23 36.6c4.57 0 8.615-2.255 11.08-5.713A10.2 10.2 0 0 0 24.7 24.7M23 11.1a5.1 5.1 0 1 0 0 10.2 5.1 5.1 0 0 0 0-10.2",clipRule:"evenodd"})));var Si;function ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ki.apply(null,arguments)}const Oi=e=>g.createElement("svg",ki({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),Si||(Si=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 8v3m0-5.224V5.75M2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8"}))),Ri=({className:e=""})=>{var t;const a=w(e=>e.promoLobby.topBarScreen),i=w(ee),n=w(te),{isPending:s,error:o}=w(e=>e.prizeDrop.apiLobbyInit),l=w(e=>e.wallet.trueDecimal),d=null!==(t=null==i?void 0:i.balance)&&void 0!==t?t:0,c=s||!!o||!n,p=b();return(0,r.jsxs)("div",{className:Ht()("flex w-full max-w-560 items-center justify-between gap-12 px-15 pb-16 ml:px-0",e),children:[(0,r.jsxs)("div",{className:"flex items-center gap-10",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{p(k("profile"))},className:Ht()("cursor-pointer opacity-20 transition-all hover:opacity-30","profile"===a&&"opacity-40"),"aria-label":"Profile",children:(0,r.jsx)(Pi,{className:"h-46 w-46"})}),(0,r.jsxs)("button",{type:"button","aria-label":"Wallet",onClick:()=>{p(k("wallet"))},className:Ht()("flex items-center gap-6 rounded-full bg-white-10 py-6 pl-6 pr-14 transition-all","wallet"===a&&"bg-white-20"),children:[(0,r.jsx)(va,{className:"h-28 w-28 shrink-0 text-white"}),c?(0,r.jsx)(ba,{}):(0,r.jsx)("span",{className:"text-medium-bold",children:ne.bp.formatCash(Number(d),{showCurrency:!1,customDecimals:l,roundUp:!0})})]})]}),(0,r.jsx)("button",{type:"button",className:Ht()("flex h-36 w-36 cursor-pointer items-center justify-center rounded-full bg-white-10 transition-all","info"===a&&"bg-white-20"),onClick:()=>{p(k("info"))},children:(0,r.jsx)(Oi,{className:"h-16 w-16"})})]})},Ii=()=>{const e=w(e=>e.promoLobby.topBarScreen),t=w(e=>e.promoLobby.screenHistory),a=w(e=>e.prizeDrop.rewardHubDrops),i=w(e=>e.prizeDrop.campaignsQueue),n=w(wt),s=w(e=>e.prizeDrop.displayedCampaign),o=w(e=>e.prizeDrop.apiJoinCampaign),l=w(bt),d=w(e=>e.promoLobby.activeScreen),c=b(),p=(0,Kt.Bd)(),u=(0,g.useRef)(!1),m=(0,g.useRef)(""),h=(0,g.useRef)(""),f=(0,g.useRef)(!1),v=(0,g.useRef)(null),{showSuccessToast:x,showFailedToast:y}=ii();(0,g.useEffect)(()=>(ne.h$.emit("promoLobby:opened"),()=>{ne.h$.emit("promoLobby:closed")}),[]),(0,g.useEffect)(()=>{u.current||(u.current=!0,c(F()));const e=a.map(e=>e.dropId).sort().join(",");e!==m.current&&(m.current=e,c($(a.map(e=>e.dropId))));const t=i.map(e=>e.campaignId).sort().join(",");t!==h.current&&(h.current=t,c(G(i.map(e=>e.campaignId))))},[a,i,c]),(0,g.useEffect)(()=>{f.current&&(o.data&&(o.data.joined?(x(p("DROP.042","You have successfully joined!")),ne.h$.emit("pdModal:joinSuccess")):(y(Mr({t:p,error:o.error,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),ne.h$.emit("pdModal:joinError")),f.current=!1),o.error&&(y(Mr({t:p,error:o.error,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),ne.h$.emit("pdModal:joinError"),f.current=!1))},[o.data,o.error,y,x,p]),(0,g.useEffect)(()=>{"info"===e&&"info"!==v.current&&ne.h$.emit("promoLobby:infoViewed"),v.current=e},[e]);const j="info"===e,D="campaign"===d,C=t.length>0,z=()=>{c(ye("promoLobby"))};return(0,r.jsxs)(Sr,{onClose:z,children:[(0,r.jsx)(Pr,{onReturn:C?()=>{c(O())}:void 0,onClose:z,classes:{closeButton:"!top-23",returnButton:"!top-23 ml:!left-98"},children:(0,r.jsx)("div",{className:"title-h1-bold pb-20 pt-34 text-center uppercase",children:p("LOBBY.001","True world")})}),(0,r.jsx)(Ri,{}),(0,r.jsx)(jr,{scrollbarInsetBottom:D&&n&&!e?64:void 0,className:"mb-120 ml:mb-40",contentClassName:j?"!px-0 !max-w-full":"",children:(0,r.jsx)(pi,{})}),D&&n&&!e&&(0,r.jsx)(Dr,{className:"fixed !bottom-120 left-0 right-0 !bg-brand-black ml:!bottom-40 ",children:(0,r.jsx)(ea,{isLoading:o.isPending,onClick:()=>{ne.h$.emit("pdModal:startJoin"),f.current=!0,c(tr({campaignId:s.campaignId}))},className:"!bg-brand-gradient",disabled:l})}),(0,r.jsx)(Ci,{})]})},Bi=()=>(0,r.jsx)(ri,{children:(0,r.jsx)(Ii,{})}),Li=()=>{const e=w(e=>e.modals.current);return(0,r.jsx)("div",{className:"pointer-events-auto",children:e.map(e=>(e=>{switch(e){case"promoLobby":return(0,r.jsx)(Bi,{},e);case"prizeDropCongratulation":return(0,r.jsx)(Ur,{},e);case"prizeDropClaimed":return(0,r.jsx)(Rr,{},e);case"prizeDropClaimedSuccess":return(0,r.jsx)(Fr,{},e);case"prizeDropClaimedFailed":return(0,r.jsx)(Tr,{},e);case"prizeDropClaimedExpired":return(0,r.jsx)(_r,{},e);case"prizeDropSuccess":return(0,r.jsx)(Kr,{},e);case"prizeDropResultFinished":return(0,r.jsx)(Wr,{},e);case"prizeDropResultCancelled":return(0,r.jsx)(Jr,{},e);case"prizeDropLive":return(0,r.jsx)(Hr,{},e);case"prizeDropJoinError":return(0,r.jsx)($r,{},e);default:return null}})(e))})};var _i,Mi,Ti,Ai,Fi;function Ui(){return Ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ui.apply(null,arguments)}const $i=e=>g.createElement("svg",Ui({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 52 52"},e),_i||(_i=g.createElement("path",{fill:"#000",fillOpacity:.5,stroke:"url(#promo-lobby-icon_svg__a)",strokeWidth:1.7,d:"M15 1.85h22c7.263 0 13.15 5.887 13.15 13.15v22c0 7.263-5.887 13.15-13.15 13.15H15C7.737 50.15 1.85 44.263 1.85 37V15C1.85 7.737 7.737 1.85 15 1.85Z"})),Mi||(Mi=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__b)",d:"M41.5 26 29.593 38 17.687 26l11.906-12z"})),Ti||(Ti=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__c)",d:"m21.535 34.122-2.977 3-2.976-3 2.976-3z"})),Ai||(Ai=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__d)",d:"M18.92 18.758 14.71 23l-4.21-4.243 4.21-4.243z"})),Fi||(Fi=g.createElement("defs",null,g.createElement("linearGradient",{id:"promo-lobby-icon_svg__a",x1:29.826,x2:30.02,y1:50.743,y2:10.567,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__b",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__c",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__d",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"}))))),Yi=e=>{return"true"===e.prize.type&&!((t=e.expiresAt)&&new Date(t).getTime()<=Date.now());var t},Vi=e=>"expired"!==e.claimUiStatus&&Yi(e.drop);const Gi=({disabled:e=!1,gridClassName:t=""})=>{const a=function(){const e=(0,Vt.GV)(e=>e.play.isActive);return(({hasOpenedLobbyOnce:e,isPlayActive:t,viewedRewardDropIds:a,viewedCampaignIds:r,rewardHubDrops:i,dropsQueue:n,campaignsQueue:s,hasDefferedModal:o,hasDefferedCampaign:l,hasDefferedReward:d})=>{if(t)return!1;if(!e)return!0;const c=i.some(e=>Yi(e)&&!a.includes(e.dropId)),p=n.some(Vi),u=s.some(e=>!r.includes(e.campaignId));return c||p||u||!!o&&(l||d)})({hasOpenedLobbyOnce:w(e=>e.notification.hasOpenedLobbyOnce),isPlayActive:e,viewedRewardDropIds:w(e=>e.notification.viewedRewardDropIds),viewedCampaignIds:w(e=>e.notification.viewedCampaignIds),rewardHubDrops:w(e=>e.prizeDrop.rewardHubDrops),dropsQueue:w(e=>e.prizeDrop.dropsQueue),campaignsQueue:w(e=>e.prizeDrop.campaignsQueue),hasDefferedModal:w(e=>e.prizeDrop.hasDefferedModal),hasDefferedCampaign:w(e=>!!e.prizeDrop.defferedCampaign),hasDefferedReward:w(e=>!!e.prizeDrop.winDropItem&&Yi(e.prizeDrop.winDropItem))})}(),i=(0,Vt.jL)(),n=b(),s=(0,g.useRef)(null);return(0,g.useEffect)(()=>{null===s.current?(s.current=a,a&&ne.h$.emit("notification_badge_shown")):s.current!==a&&(s.current=a,a?ne.h$.emit("notification_badge_shown"):ne.h$.emit("notification_badge_cleared"))},[a]),(0,r.jsx)("div",{className:t?`${t} relative bottom-64 h-52 w-52 ml:h-46 ml:w-46`:"",children:(0,r.jsxs)("button",{disabled:e,type:"button",onClick:t=>{t.stopPropagation(),e||(n(we("promoLobby")),i((0,oe.Pp)(!0)))},className:Ht()("pointer-events-auto absolute cursor-pointer items-center justify-center rounded-14",!t&&"bottom-105 left-1/2 m-1 flex origin-top -translate-x-188 ml:bottom-auto ml:left-29 ml:top-1/2 ml:translate-x-0 ml:translate-y-[calc(-100%+167px)]",gr.T.prizeDrop,["[&_svg_stop:nth-child(1)]:[stop-color:var(--colors-gold-stop-0)]","[&_svg_stop:nth-child(2)]:[stop-color:var(--colors-gold-stop-1)]","[&_svg_stop:nth-child(3)]:[stop-color:var(--colors-gold-stop-2)]"],!e&&'after:absolute after:bottom-0 after:left-0 after:right-0 after:top-0 after:rounded-14 after:transition-all after:content-[""] hover:after:bg-white-10',"active:opacity-70","disabled:cursor-default disabled:opacity-40 disabled:hover:after:bg-transparent disabled:active:bg-transparent"),children:[a&&(0,r.jsx)("div",{className:"absolute right-0 top-0 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-gold",children:(0,r.jsx)("div",{className:"bg-neon-rouge h-8 w-8 rounded-full"})}),(0,r.jsx)($i,{className:"relative z-1 h-52 w-52 ml:h-46 ml:w-46"})]})})},Hi=()=>{var e;const t=(0,Vt.GV)(La.ge),a=(0,Vt.GV)(e=>e.round.isRestore),i=(null===(e=(0,Vt.GV)(e=>e.freeRounds.current))||void 0===e?void 0:e.count)>0,n=(0,Vt.GV)(e=>e.play.isActive),s=(0,Vt.GV)(e=>e.app.isUIHidden),o=a||i||n;return(0,r.jsxs)(r.Fragment,{children:[t&&!s&&(0,r.jsx)(Gi,{disabled:o}),!t&&!s&&(0,r.jsx)("div",{className:Ht()("pointer-events-none fixed grid","mp:bottom-42 mp:left-1/2 mp:-translate-x-1/2 mp:items-end mp:gap-x-12","ml:right-21 ml:top-1/2 ml:-translate-y-1/2 ml:justify-items-center ml:gap-y-10","mp:grid-cols-[52px_52px_118px_52px_52px]","ml:grid-rows-[46px_46px_110px_46px_46px]",'mp:[grid-template-areas:"menu_stakeAmounts_play_auto_bonus"]','ml:[grid-template-areas:"menu""stakeAmounts""play""auto""bonus"]',"ml:opacity-0","z-51"),children:(0,r.jsx)(Gi,{gridClassName:"[grid-area:menu]",disabled:o})})]})},Ji=()=>{const e=(0,Vt.GV)(e=>"main"===e.app.screen);return(()=>{const e=(0,Vt.GV)(e=>e.app.modulesConfig.promoLobby),t=b(),a=null==e?void 0:e.fakeApi,r=null==e?void 0:e.fakeSocket,i=null==e?void 0:e.lang;(0,g.useEffect)(()=>{e&&a&&(t(Ve(a.prizeDropLobbyInit)),t(Ge(a.prizeDropJoinCampaign)),t(He(a.prizeDropClaim)),t(St(a.walletTransactions)))},[a]),(0,g.useEffect)(()=>{e&&r&&t(Xe(r))},[r]),(0,g.useEffect)(()=>{e&&t(Je({url:e.url,token:e.token}))},[e]),(0,g.useEffect)(()=>{e&&i&&t(S(e.lang))},[e])})(),function(){const e=(0,Vt.jL)(),t=b();(0,g.useEffect)(()=>{cr.j.on("round:opened",()=>{var t,a;try{"live"===gt(Tt.getState(),null===(t=Tt.getState().prizeDrop.activeCampaign)||void 0===t?void 0:t.campaignId)&&vt(Tt.getState())&&e((0,lr.Nl)({pdCampaignId:null===(a=Tt.getState().prizeDrop.activeCampaign)||void 0===a?void 0:a.campaignId}))}catch(t){const a=t;(0,ze.PI)(a),ne.vF.error(a),e((0,se.qX)(a))}}).on("round:ended",()=>{try{const{hasDefferedModal:a,winDropItem:r,defferedCampaign:i,dropsQueue:n}=Tt.getState().prizeDrop;if(i&&t(Fe(i)),a){if(e((0,or.X2)()),e((0,dr.SE)()),e((0,W.Zv)(!1)),"finished"===(null==i?void 0:i.status)?t(we("prizeDropResultFinished")):"cancelled"===(null==i?void 0:i.status)&&t(we("prizeDropResultCancelled")),r){const e=n.find(e=>e.drop.dropId===r.dropId);let a;a=e?Oe(e):"true"===r.prize.type?"prizeDropClaimed":"prizeDropCongratulation",t(we(a))}t(Ze(!1)),t(at())}}catch(t){const a=t;(0,ze.PI)(a),ne.vF.error(a),e((0,se.qX)(a))}}).on("autoplay:restarted",()=>{t((e,t)=>{var a;const r=t(),i=r.modals.current.filter(e=>ke.includes(e)),n=i.some(e=>Se.includes(e)),s=i.includes("prizeDropClaimed"),o=null===(a=r.prizeDrop.winDropItem)||void 0===a?void 0:a.dropId,l=r.modals.current.includes("promoLobby")&&"true-world"===r.promoLobby.activeScreen&&null===r.promoLobby.topBarScreen;i.forEach(t=>{(e=>{switch(e){case"prizeDropCongratulation":case"prizeDropClaimed":return void ne.h$.emit("pdModalWinDrop:closed");case"prizeDropClaimedSuccess":return void ne.h$.emit("pdModalClaimSuccess:closed");case"prizeDropClaimedFailed":return void ne.h$.emit("pdModalClaimFailed:closed");case"prizeDropClaimedExpired":return void ne.h$.emit("pdModalClaimExpired:closed");case"prizeDropResultFinished":ne.h$.emit("pdModalEventEnded:closed");break;case"prizeDropResultCancelled":ne.h$.emit("pdModalEventCancelled:closed")}})(t),e(ye(t))}),s&&o&&l&&e(U(o)),n&&o&&e(it(o)),(n||r.prizeDrop.hasDefferedModal)&&(e(Ye()),e(mt())),e(Ze(!1)),e(at())})})},[])}(),(()=>{var e;const t=(0,Vt.jL)(),a=b(),r=!!w(e=>e.prizeDrop.restData),i=w(e=>e.prizeDrop.campaignsQueue),n=w(e=>e.prizeDrop.displayedCampaign),s=w(e=>e.prizeDrop.apiLobbyInit.isPending),o=(0,Vt.GV)(e=>e.play.isActive),l=(0,Vt.GV)(e=>e.freeRounds.isActive),d=(null===(e=(0,Vt.GV)(e=>e.freeRounds.current))||void 0===e?void 0:e.count)>0,c=w(ve),p=(0,Vt.GV)(e=>e.modals.hasOpened),u=(0,Vt.GV)(e=>e.round.isRestore),m=(0,g.useRef)(!1);(0,g.useEffect)(()=>{!m.current&&r&&(a(rr({shouldFreezeUi:!0})),m.current=!0)},[a,r]),(0,g.useEffect)(()=>{var e;if(!(({hasInitialized:e,hasPromoLobby:t,isPromoLobbyInitPending:a,campaignsQueueLength:r,isPlayActive:i,isFreeRoundsActive:n,isFreeRoundsCurrent:s,hasOpenedModalByCore:o,isRestore:l,isModalMode:d})=>e&&t&&!a&&r>0&&!i&&!n&&!s&&!o&&!l&&!d)({hasInitialized:m.current,hasPromoLobby:r,isPromoLobbyInitPending:s,campaignsQueueLength:null!==(e=null==i?void 0:i.length)&&void 0!==e?e:0,isPlayActive:o,isFreeRoundsActive:l,isFreeRoundsCurrent:d,hasOpenedModalByCore:p,isRestore:u,isModalMode:c}))return;const h=i[0];h&&((null==n?void 0:n.campaignId)!==h.campaignId&&a(Ae(h)),t((0,W.M5)()),a(we("prizeDropLive")))},[i,a,null==n?void 0:n.campaignId,p,l,d,c,o,r,s,u,t])})(),function(){const e=b(),t=(0,g.useCallback)(t=>{e((e=>t=>{t(X(e.active))})(t)),t.active&&e(ir())},[e]);(0,g.useEffect)(()=>{Ce.on(je.CAMPAIGN_UPDATED,({payload:t})=>{e(nr(t))}),Ce.on(je.DROP,({payload:t})=>{e(jt(t))}),Ce.on(je.WALLET_STATUS,({payload:e})=>{t(e)})},[e,t]),(0,g.useEffect)(()=>{const a=a=>{var r,i,n;if(a.data.isGUI){if((null===(r=a.data)||void 0===r?void 0:r.type)===je.CAMPAIGN_UPDATED){const{payload:t}=a.data;ne.vF.socketEvent(je.CAMPAIGN_UPDATED,t),e(nr(t))}if((null===(i=a.data)||void 0===i?void 0:i.type)===je.DROP){const{payload:t}=a.data;ne.vF.socketEvent(je.DROP,t),e(jt(t))}if((null===(n=a.data)||void 0===n?void 0:n.type)===je.WALLET_STATUS){const{payload:e}=a.data;ne.vF.socketEvent(je.WALLET_STATUS,e),t(e)}}};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[e,t])}(),(0,r.jsx)("div",{className:"promo-lobby-container pointer-events-auto",children:e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Hi,{}),(0,r.jsx)(Li,{})]})})},Wi=({dispatch:e})=>{null==e||e((0,i.JI)((()=>{const e=[];return e.push(m,h,f,u,o,l,c,p,s,n,d),e.filter(e=>!!e)})()))},Ki=()=>(0,r.jsx)($t,{children:(0,r.jsx)(Ji,{})})}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_truelab_truelogic=self.webpackChunk_truelab_truelogic||[]).push([[631],{9737:(e,t,a)=>{a.r(t),a.d(t,{PromoLobbyModule:()=>Qi,init:()=>Ki});var r=a(4848),i=a(8521);const n=a.p+"assets/coming-soon.378973f1d8788623bbe9.webp",s=a.p+"assets/true-coin.1428441fe478e319cb4e.webp",o=a.p+"assets/gradient-bg.ec5b14ea3eb84ebb40c2.jpg",l=a.p+"assets/prize-drop-item.2bf1291207de774584ad.webp",d=a.p+"assets/reward-icon.098bebd610501e5d7344.webp",c=a.p+"assets/bg-wallet.76604959187a933cb30d.jpg",p=a.p+"assets/safe.851b5630bbec8de3e5b1.webp",u=a.p+"assets/cash-prize.4ef22f77cafcace9ef38.webp",m=a.p+"assets/prize-drop-bg-event-landscape.62d513476fec0a205481.webp",h=a.p+"assets/prize-drop-bg-event-portrait.3d627778db401fff49c0.webp",f=a.p+"assets/prize-drop-logo.b4d8a5270f8092b9f573.webp";var g=a(6540),v=a(1468);const x=(0,g.createContext)(null),b=(0,v.iI)(x).withTypes(),w=(0,v.jO)(x).withTypes();var y=a(4644),j=a(38),D=a(1370),C=a(6901),z=a(3588);const N=(e,t)=>{e.screenHistory.push(t)},E=(0,z.Kr)({name:"promoLobby",initialState:{activeScreen:"true-world",topBarScreen:null,screenHistory:[],lang:null},reducers:e=>({setPromoLobbyActiveScreen:e.reducer((e,t)=>{const a=t.payload;e.activeScreen===a&&null===e.topBarScreen||("true-world"===a?e.screenHistory=[]:N(e,{activeScreen:e.activeScreen,topBarScreen:e.topBarScreen})),e.topBarScreen=null,e.activeScreen=a}),setPromoLobbyLang:e.reducer((e,t)=>{e.lang=t.payload}),setPromoLobbyTopBarScreen:e.reducer((e,t)=>{const a=t.payload;e.topBarScreen===a||N(e,{activeScreen:e.activeScreen,topBarScreen:e.topBarScreen}),e.topBarScreen=a}),navigateBack:e.reducer(e=>{const t=e.screenHistory.pop();t&&(e.activeScreen=t.activeScreen,e.topBarScreen=t.topBarScreen,"true-world"===t.activeScreen&&null===t.topBarScreen&&(e.screenHistory=[]))}),resetPromoLobbyScreen:e.reducer(e=>{e.activeScreen="true-world",e.topBarScreen=null,e.screenHistory=[]})}),selectors:{getActiveScreen:e=>e.activeScreen}}),{setPromoLobbyActiveScreen:S,setPromoLobbyLang:P,setPromoLobbyTopBarScreen:k,navigateBack:R,resetPromoLobbyScreen:O}=E.actions,{getActiveScreen:I}=E.selectors,B=E.reducer;var L=a(874),_=a(7542);const M={viewedRewardDropIds:[],viewedCampaignIds:[]},T=(0,D.l1)(e=>{var t,a;return Object.assign(Object.assign({},M),{viewedRewardDropIds:null!==(t=null==e?void 0:e.viewedRewardDropIds)&&void 0!==t?t:[],viewedCampaignIds:null!==(a=null==e?void 0:e.viewedCampaignIds)&&void 0!==a?a:[]})},e=>{var t,a;return Object.assign(Object.assign({},M),{viewedRewardDropIds:null!==(t=null==e?void 0:e.viewedRewardDropIds)&&void 0!==t?t:[],viewedCampaignIds:null!==(a=null==e?void 0:e.viewedCampaignIds)&&void 0!==a?a:[]})},{whitelist:["notification"]}),A=(0,z.Kr)({name:"notification",initialState:M,reducers:e=>({markNotificationRewardViewed:e.reducer((e,t)=>{e.viewedRewardDropIds.includes(t.payload)||e.viewedRewardDropIds.push(t.payload)}),markNotificationRewardsViewed:e.reducer((e,t)=>{t.payload.forEach(t=>{e.viewedRewardDropIds.includes(t)||e.viewedRewardDropIds.push(t)})}),clearNotificationViewedReward:e.reducer((e,t)=>{e.viewedRewardDropIds=e.viewedRewardDropIds.filter(e=>e!==t.payload)}),markNotificationCampaignViewed:e.reducer((e,t)=>{e.viewedCampaignIds.includes(t.payload)||e.viewedCampaignIds.push(t.payload)}),markNotificationCampaignsViewed:e.reducer((e,t)=>{t.payload.forEach(t=>{e.viewedCampaignIds.includes(t)||e.viewedCampaignIds.push(t)})}),clearNotificationViewedCampaign:e.reducer((e,t)=>{e.viewedCampaignIds=e.viewedCampaignIds.filter(e=>e!==t.payload)})})}),{markNotificationRewardViewed:F,markNotificationRewardsViewed:U,clearNotificationViewedReward:$,markNotificationCampaignViewed:Y,markNotificationCampaignsViewed:V,clearNotificationViewedCampaign:G}=A.actions,W=A.reducer;var H=a(748);const J=(0,z.Kr)({name:"wallet",initialState:{isWalletAvailable:!0,trueDecimal:2,trueSessionRate:null,wallets:[]},reducers:e=>({setWallets:e.reducer((e,t)=>{e.wallets=t.payload}),setWalletAvailability:e.reducer((e,t)=>{e.isWalletAvailable=t.payload}),setTrueSessionRate:e.reducer((e,t)=>{e.trueSessionRate=t.payload}),incrementWalletBalance:e.reducer((e,t)=>{const a=e.wallets[0];if(a){const e=parseFloat(a.balance)||0;a.balance=String(e+t.payload)}}),markActiveWalletSeen:e.reducer(e=>{const t=e.wallets[0];t&&(t.isNew=!1)})}),selectors:{getActiveWallet:e=>e.wallets[0],getIsWalletAvailable:e=>e.isWalletAvailable,getTrueSessionRate:e=>{var t,a,r;return null!==(a=null===(t=e.wallets[0])||void 0===t?void 0:t.sessionRate)&&void 0!==a?a:null===(r=e.trueSessionRate)||void 0===r?void 0:r.rate},getIsActiveWalletNew:e=>{var t;return!0===(null===(t=e.wallets[0])||void 0===t?void 0:t.isNew)}}}),{incrementWalletBalance:K,markActiveWalletSeen:Q,setTrueSessionRate:q,setWalletAvailability:X,setWallets:Z}=J.actions,{getActiveWallet:ee,getIsActiveWalletNew:te,getIsWalletAvailable:ae,getTrueSessionRate:re}=J.selectors,ie=J.reducer;var ne=a(4554),se=a(5478),oe=a(4218),le=a(9617);const de=["prizeDropCongratulation","prizeDropClaimed","prizeDropClaimedSuccess","prizeDropClaimedFailed","prizeDropClaimedExpired","prizeDropSuccess","prizeDropResultFinished","prizeDropResultCancelled","prizeDropLive","prizeDropJoinError"],ce=e=>de.includes(e),pe=(0,j.Z0)({name:"modals",initialState:{hasOpened:!1,current:[],isModalReady:!0},reducers:{setIsModalReady(e,t){e.isModalReady=t.payload},setHasOpened(e,t){e.hasOpened=t.payload},addCurrent(e,t){e.current.push(t.payload)},focusModal(e,t){e.current=e.current.filter(e=>e!==t.payload),e.current.push(t.payload)},closeModalSlice(e,t){(null==t?void 0:t.payload)?e.current=e.current.filter(e=>e!==t.payload):e.current=[],e.hasOpened=!!e.current.length},setModalReady(e){e.isModalReady=!0}},selectors:{getModalsIsModalMode:e=>e.isModalReady&&e.hasOpened,getCurrentModal:e=>e.current.at(-1)||null}}),{closeModalSlice:ue,setModalReady:me,setIsModalReady:he,setHasOpened:fe,addCurrent:ge,focusModal:ve}=pe.actions,{getModalsIsModalMode:xe,getCurrentModal:be}=pe.selectors,we=pe.reducer,ye=e=>(t,a,r)=>{const{current:i}=a().modals;r.mainDispatch((0,oe.Xm)(!0)),ce(e)&&(r.mainDispatch((0,H.M5)()),r.mainDispatch((0,oe.lX)(!0))),i.includes(e)?t(ve(e)):(se.h$.emit("modal:opened",e),t(fe(!0)),t(ge(e)))},je=e=>(t,a,r)=>{"promoLobby"===e&&(t(O()),r.mainDispatch((0,le.Pp)(!1))),t(ue(e));const i=a().modals.current,n=i.length<1,s=i.some(ce);r.mainDispatch((0,oe.lX)(s)),n&&r.mainDispatch((0,oe.Xm)(!1))};var De,Ce=a(1128);!function(e){e.CAMPAIGN_UPDATED="campaignUpdated",e.DROP="drop",e.WALLET_STATUS="walletStatus"}(De||(De={}));const ze=new class{constructor(){this.socket=null,this.callbacks=new Map}connect({url:e,token:t,transports:a}){return e&&t?(this.socket&&(this.socket.removeAllListeners(),this.socket.disconnect()),new Promise((r,i)=>{const n={auth:{token:t}};a&&(n.transports=a),this.socket=(0,Ce.io)(e,n),this.socket.once("connect",()=>{se.vF.socketEvent("Socket.io connected"),r()}),this.socket.once("connect_error",e=>{se.vF.socketEvent("Socket.io connection error",e),i(e)}),this.socket.once("error",e=>{se.vF.socketEvent("Socket.io error",e),i(e)}),this.socket.on("reconnect_attempt",e=>se.vF.socketEvent(`Socket.io trying to reconnect (#${e})`)),this.socket.on("reconnect_error",e=>se.vF.socketEvent("Socket.io retry failed:",e)),this.socket.on("reconnect_failed",()=>se.vF.socketEvent("Socket.io all retries exhausted")),this.socket.onAny((e,t)=>{const a={type:e,payload:t,timestamp:Date.now()};this.emit(e,a)}),this.socket.on("disconnect",e=>{se.vF.socketEvent("Socket.io disconnected",e)})})):Promise.reject(new Error("Url or token not provided"))}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null)}send(e){this.socket&&this.socket.connected?this.socket.emit(e.type,e.payload):se.vF.socketEvent("Socket.io not connected. Unable to send:",e)}on(e,t){this.callbacks.has(e)||this.callbacks.set(e,new Set),this.callbacks.get(e).add(t)}off(e,t){var a;null===(a=this.callbacks.get(e))||void 0===a||a.delete(t)}emit(e,t){var a;se.vF.socketEvent(e,t.payload),null===(a=this.callbacks.get(e))||void 0===a||a.forEach(e=>e(t))}};var Ne=a(3178);const Ee={ERR_UNKNOWN:{message:"General error: unknow error occured",languageKey:"LOBBY.100"},ERR_FORBIDDEN:{message:"General error: operation is forbidden",languageKey:"LOBBY.101"},ERR_TRUE_WALLET_API:{message:"Error occured while claiming reward (on Wallet side)",languageKey:"LOBBY.102"},ERR_DROP_CLAIM_NOT_ALLOWED:{message:"User tried to claim the wrong reward",languageKey:"LOBBY.103"},ERR_DROP_EXPIRED:{message:"Reward claim period expired",languageKey:"LOBBY.104"},ERR_DROP_ALREADY_CLAIMED:{message:"Reward already claimed",languageKey:"LOBBY.105"},ERR_DROP_CLAIM_FAILED:{message:"Error occured while claiming reward (on PM side)",languageKey:"LOBBY.106"},ERR_CAMPAIGN_NOT_FOUND:{message:"Campaign not found (it was cancelled or expired)",languageKey:"LOBBY.107"},ERR_CAMPAIGN_NOT_AVAILABLE:{message:"Campaign is not available for the user (possible reasons: not valid operator, brand, game, currency or country, or campaign has specific allowed players list)",languageKey:"LOBBY.108"},ERR_CAMPAIGN_ALREADY_JOINED:{message:"User has already joined this campaign",languageKey:"LOBBY.109"},ERR_CAMPAIGN_JOIN_ONCE:{message:"User has already joined to another RUNNING campaign",languageKey:"LOBBY.110"},ERR_TRUE_WALLET_UNAVAILABLE:{message:"Reward claim is temporarily unavailable due to a technical issue. Please try again later.",languageKey:"LOBBY.111"},ERR_DROP_CLAIM_WALLET_RETRY_COOLDOWN:{message:"Too many requests. Please wait before sending another claim request.",languageKey:"LOBBY.112"}},Se=(e,t,a,...r)=>{return i=void 0,n=[e,t,a,...r],o=function*(e,t,a,r=null,i={}){var n,s;const o=new Headers;o.append("Content-Type","application/json"),o.append("Authorization",`Bearer ${a}`);const l={method:e,headers:o};r&&(l.body=JSON.stringify(r));const d=new URL(t);d.search=new URLSearchParams(i).toString();const c=d.toString(),{data:p,error:u}=yield(0,L.TX)((0,L.L5)(()=>fetch(c,l)));if(u)throw(0,Ne.Xm)(u),new Error("There were problems with connection, please restart the game");if(!p.ok){const e={message:`HTTP error: ${p.status}`,languageKey:null};try{const t=yield p.json();(null===(n=t.error)||void 0===n?void 0:n.message)&&(e.message=t.error.message),(null===(s=t.error)||void 0===s?void 0:s.code)&&Object.assign(e,(e=>{var t,a;return{code:e,message:(null===(t=Ee[e])||void 0===t?void 0:t.message)||"Something went wrong",languageKey:(null===(a=Ee[e])||void 0===a?void 0:a.languageKey)||null}})(t.error.code))}catch(e){}finally{throw new Error(e.message,{cause:e})}}return yield p.json()},new((s=void 0)||(s=Promise))(function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function r(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof s?i:new s(function(e){e(i)})).then(a,r)}l((o=o.apply(i,n||[])).next())});var i,n,s,o};var Pe=function(e,t,a,r){return new(a||(a=Promise))(function(i,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function o(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,o)}l((r=r.apply(e,t||[])).next())})};const ke=["prizeDropCongratulation","prizeDropClaimed","prizeDropClaimedSuccess","prizeDropClaimedFailed","prizeDropClaimedExpired"],Re=[...ke,"prizeDropResultFinished","prizeDropResultCancelled"],Oe=e=>{if("true"!==e.drop.prize.type)return"prizeDropCongratulation";switch(e.claimUiStatus){case"pending":default:return"prizeDropClaimed";case"success":return"prizeDropClaimedSuccess";case"error":return"prizeDropClaimedFailed";case"expired":return"prizeDropClaimedExpired"}},Ie=e=>!(!e||"object"!=typeof e)&&("message"in e||"code"in e||"languageKey"in e),Be=e=>{if(!Ie(e))return{code:"Error",message:"Something went wrong"};const t=e;return{code:"string"==typeof t.code?t.code:"Error",message:"string"==typeof t.message?t.message:"Something went wrong",languageKey:"string"==typeof t.languageKey?t.languageKey:void 0}},Le=e=>e instanceof Error&&Ie(e.cause)?Be(e.cause):null,_e={campaigns:[],activeCampaign:null,displayedCampaign:null,rewardHubDrops:[],dropsQueue:[],campaignsQueue:[],prizeDropLiveShownCampaignIds:[],apiLobbyInit:{data:null,isPending:!1,error:null,fake:null},apiJoinCampaign:{data:null,isPending:!1,error:null,fake:null},apiClaim:{data:null,isPending:!1,error:null,fake:null},socketConnection:{data:null,isSuccess:!1,isPending:!1,error:null,fake:null}},Me=(0,D.l1)(e=>{var t;return Object.assign(Object.assign({},_e),{prizeDropLiveShownCampaignIds:null!==(t=null==e?void 0:e.prizeDropLiveShownCampaignIds)&&void 0!==t?t:[]})},e=>{var t;return Object.assign(Object.assign({},_e),{prizeDropLiveShownCampaignIds:null!==(t=null==e?void 0:e.prizeDropLiveShownCampaignIds)&&void 0!==t?t:[]})},{whitelist:["prizeDrop"]}),Te=(0,z.Kr)({name:"prizeDrop",initialState:_e,reducers:e=>({setPrizeDropRestData:e.reducer((e,t)=>{e.restData=t.payload}),setPrizeDropCampaigns:e.reducer((e,t)=>{e.campaigns=t.payload}),setPrizeDropActiveCampaign:e.reducer((e,t)=>{e.activeCampaign=t.payload}),setPrizeDropDisplayedCampaign:e.reducer((e,t)=>{e.displayedCampaign=t.payload}),setPrizeDropSocketEventCampaignUpdated:e.reducer((e,t)=>{var a,r;const i=t.payload,n=e.campaigns.map(e=>{var t,a;return e.campaignId===i.campaignId?Object.assign(Object.assign({},e),{status:i.status,prizesLeftCount:null!==(t=i.prizesLeftCount)&&void 0!==t?t:e.prizesLeftCount,winnersCount:null!==(a=i.winnersCount)&&void 0!==a?a:e.winnersCount,prizes:i.prizes.length>0?e.prizes.map(e=>{const t=i.prizes.find(t=>t.prizeId===e.prizeId);return t?Object.assign(Object.assign({},e),t):e}):e.prizes}):e});e.campaigns=n;const s=e.campaigns.find(e=>e.campaignId===i.campaignId);(null===(a=e.displayedCampaign)||void 0===a?void 0:a.campaignId)===i.campaignId&&s&&(e.displayedCampaign=s),(null===(r=null==e?void 0:e.activeCampaign)||void 0===r?void 0:r.campaignId)===i.campaignId&&("finished"===i.status||"cancelled"===i.status?e.activeCampaign=null:e.activeCampaign=s)}),setPrizeDropSocketEventDrop:e.reducer((e,t)=>{const a=t.payload.drops[0];e.winDropItem=a}),setPrizeDropRewardHubDrops:e.reducer((e,t)=>{e.rewardHubDrops=[...e.rewardHubDrops,...t.payload.filter(t=>!e.rewardHubDrops.some(e=>e.dropId===t.dropId))]}),setPrizeDropWinItem:e.reducer((e,t)=>{e.winDropItem=t.payload}),clearPrizeDropWinItem:e.reducer(e=>{e.winDropItem=null}),setApiPrizeDropLobbyInitFake:e.reducer((e,t)=>{e.apiLobbyInit.fake=t.payload}),setApiPrizeDropJoinCampaignFake:e.reducer((e,t)=>{e.apiJoinCampaign.fake=t.payload}),setApiPrizeDropClaimFake:e.reducer((e,t)=>{e.apiClaim.fake=t.payload}),setPrizeDropSocketFake:e.reducer((e,t)=>{e.socketConnection.fake=t.payload}),setPrizeDropDefferedModal:e.reducer((e,t)=>{e.hasDefferedModal=t.payload}),joinPrizeDropCampaign:e.reducer((e,t)=>{t.payload.campaignId===e.displayedCampaign.campaignId&&(e.activeCampaign=e.displayedCampaign,e.activeCampaign.joined=!0)}),clearPrizeDropJoinCampaignError:e.reducer(e=>{e.apiJoinCampaign.error=null}),clearPrizeDropClaimData:e.reducer(e=>{e.apiClaim.data=null,e.apiClaim.error=null,e.apiClaim.isPending=!1}),clearPrizeDropRewardHubItem:e.reducer((e,t)=>{e.rewardHubDrops=e.rewardHubDrops.filter(e=>e.dropId!==t.payload)}),setPrizeDropDefferedCampaign:e.reducer((e,t)=>{e.defferedCampaign=t.payload}),clearPrizeDropDefferedCampaign:e.reducer(e=>{e.defferedCampaign=null}),addPrizeDropDropsToQueue:e.reducer((e,t)=>{t.payload.forEach(t=>{const a="pending",r=e.dropsQueue.findIndex(e=>e.drop.dropId===t.dropId);let i;if(r>=0){const n=e.dropsQueue[r];let s=a;"success"===n.claimUiStatus||"error"===n.claimUiStatus?s=n.claimUiStatus:"expired"===n.claimUiStatus&&(s="expired"),i={drop:t,claimUiStatus:s},e.dropsQueue.splice(r,1)}else i={drop:t,claimUiStatus:a};e.dropsQueue.unshift(i)})}),removePrizeDropFromDropsQueueById:e.reducer((e,t)=>{e.dropsQueue=e.dropsQueue.filter(e=>e.drop.dropId!==t.payload)}),updatePrizeDropQueueEntryClaimUiStatus:e.reducer((e,t)=>{const a=e.dropsQueue.find(e=>e.drop.dropId===t.payload.dropId);a&&(a.claimUiStatus=t.payload.claimUiStatus)}),setPrizeDropCampaignsQueue:e.reducer((e,t)=>{e.campaignsQueue=t.payload}),shiftPrizeDropFromCampaignsQueue:e.reducer(e=>{e.campaignsQueue=e.campaignsQueue.slice(1)}),clearPrizeDropCampaignsQueue:e.reducer(e=>{e.campaignsQueue=[]}),addPrizeDropLiveShownCampaignId:e.reducer((e,t)=>{e.prizeDropLiveShownCampaignIds.includes(t.payload)||e.prizeDropLiveShownCampaignIds.push(t.payload)}),fetchApiPrizeDropLobbyInit:e.asyncThunk((e,t)=>Pe(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,i,n,s,o;const l=a(),d=null===(r=l.prizeDrop.apiLobbyInit.fake)||void 0===r?void 0:r.enabled,c=null===(n=null===(i=l.prizeDrop)||void 0===i?void 0:i.restData)||void 0===n?void 0:n.token,p=null===(o=null===(s=l.prizeDrop)||void 0===s?void 0:s.restData)||void 0===o?void 0:o.url,u=l.promoLobby.lang;if(d){const e=l.prizeDrop.apiLobbyInit.fake;return yield(0,L.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!p||!c)throw Error("Endpoint or token not provided");try{return yield Se("GET",`${p}/lobby/init`,c,e,{lang:u})}catch(e){const a=Le(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiLobbyInit.isPending=!0,e.apiLobbyInit.error=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:i}=Be(t.payload);e.apiLobbyInit.isPending=!1,e.apiLobbyInit.error={name:a,message:r,code:a,languageKey:i}},fulfilled:(e,t)=>{e.apiLobbyInit.isPending=!1,e.apiLobbyInit.data=t.payload}}),fetchApiPrizeDropJoinCampaign:e.asyncThunk((e,t)=>Pe(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,i,n,s,o;const l=a(),d=null===(r=l.prizeDrop.apiJoinCampaign.fake)||void 0===r?void 0:r.enabled,c=null===(n=null===(i=l.prizeDrop)||void 0===i?void 0:i.restData)||void 0===n?void 0:n.url,p=null===(o=null===(s=l.prizeDrop)||void 0===s?void 0:s.restData)||void 0===o?void 0:o.token;if(d){const e=l.prizeDrop.apiJoinCampaign.fake;return yield(0,L.yy)(e.delay),e.hasError&&e.countRetries?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!c||!p)throw Error("Endpoint or token not provided");try{return yield Se("POST",`${c}/campaign/join`,p,e)}catch(e){const a=Le(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiJoinCampaign.isPending=!0,e.apiJoinCampaign.error=null,e.apiJoinCampaign.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:i}=Be(t.payload);e.apiJoinCampaign.isPending=!1,e.apiJoinCampaign.error={name:a,message:r,code:a,languageKey:i},e.apiJoinCampaign.data=null;const n=e.apiJoinCampaign.fake;(null==n?void 0:n.enabled)&&(null==n?void 0:n.countRetries)>0&&(n.countRetries-=1,e.apiJoinCampaign.fake=n)},fulfilled:(e,t)=>{e.apiJoinCampaign.isPending=!1,e.apiJoinCampaign.data=t.payload}}),fetchApiPrizeDropClaim:e.asyncThunk((e,t)=>Pe(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,i,n,s,o;const l=a(),d=null===(r=l.prizeDrop.apiClaim.fake)||void 0===r?void 0:r.enabled,c=null===(n=null===(i=l.prizeDrop)||void 0===i?void 0:i.restData)||void 0===n?void 0:n.url,p=null===(o=null===(s=l.prizeDrop)||void 0===s?void 0:s.restData)||void 0===o?void 0:o.token;if(d){const e=l.prizeDrop.apiClaim.fake;return yield(0,L.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!c||!p)throw Error("Endpoint or token not provided");try{return yield Se("POST",`${c}/drop/${e.dropId}/claim`,p,e)}catch(e){const a=Le(e);if(a)return t(a);throw e}}),{pending:e=>{e.apiClaim.isPending=!0,e.apiClaim.error=null,e.apiClaim.data=null},rejected:(e,t)=>{const{code:a,message:r,languageKey:i}=Be(t.payload);e.apiClaim.isPending=!1,e.apiClaim.error={name:a,message:r,code:a,languageKey:i},e.apiClaim.data=null;const n=e.apiClaim.fake;(null==n?void 0:n.enabled)&&(null==n?void 0:n.countRetries)>0&&(n.countRetries-=1,e.apiClaim.fake=n)},fulfilled:(e,t)=>{e.apiClaim.isPending=!1,e.apiClaim.data=t.payload}}),connectPrizeDropSocketService:e.asyncThunk((e,t)=>Pe(void 0,[e,t],void 0,function*(e,{rejectWithValue:t,getState:a}){var r,i;const n=a(),s=null===(r=n.prizeDrop.apiLobbyInit.data)||void 0===r?void 0:r.credentials;if(!s)throw Error("Socket credentials not provided (lobby init response)");const{url:o,token:l,transports:d}=s;if(null===(i=n.prizeDrop.apiLobbyInit.fake)||void 0===i?void 0:i.enabled){const e=n.prizeDrop.socketConnection.fake;return yield(0,L.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):void 0}yield ze.connect({url:o,token:l,transports:d})}),{pending:e=>{e.socketConnection.isPending=!0,e.socketConnection.isSuccess=!1,e.socketConnection.error=null},rejected:(e,t)=>{var a,r;e.socketConnection.isPending=!1,e.socketConnection.isSuccess=!1,e.socketConnection.error={name:(null===(a=t.error)||void 0===a?void 0:a.name)||"Oops",message:(null===(r=t.error)||void 0===r?void 0:r.message)||"Something went wrong"}},fulfilled:e=>{e.socketConnection.isPending=!1,e.socketConnection.isSuccess=!0,e.socketConnection.error=null}})}),selectors:{isPrizeDropActive:e=>e.activeCampaign&&"cancelled"!==e.activeCampaign.status,getPrizeDropMode:(e,t)=>{const a=e.campaigns.find(e=>e.campaignId===t);if(a){if("scheduled"===a.status)return"upcoming";if("running"===a.status)return"live"}return"ended"},isPrizeDropJoined:e=>{var t;return null===(t=null==e?void 0:e.activeCampaign)||void 0===t?void 0:t.joined},getPrizeDropMaxPrize:e=>{const{prizes:t}=e.displayedCampaign,a=t.find(e=>null==e?void 0:e.topPrize);return!a&&t.length>0?t[0]:a},hasPrizeDropActiveCampaign:e=>{var t,a,r;return(null===(t=null==e?void 0:e.activeCampaign)||void 0===t?void 0:t.joined)&&(null===(a=null==e?void 0:e.activeCampaign)||void 0===a?void 0:a.campaignId)!==(null===(r=null==e?void 0:e.displayedCampaign)||void 0===r?void 0:r.campaignId)},displayPrizeDropJoinButton:e=>{var t,a,r,i;return"running"===(null===(t=null==e?void 0:e.displayedCampaign)||void 0===t?void 0:t.status)&&((null===(a=null==e?void 0:e.displayedCampaign)||void 0===a?void 0:a.campaignId)!==(null===(r=null==e?void 0:e.activeCampaign)||void 0===r?void 0:r.campaignId)||!(null===(i=null==e?void 0:e.activeCampaign)||void 0===i?void 0:i.joined))}}}),{setPrizeDropActiveCampaign:Ae,setPrizeDropDisplayedCampaign:Fe,setPrizeDropSocketEventCampaignUpdated:Ue,setPrizeDropSocketEventDrop:$e,setPrizeDropWinItem:Ye,clearPrizeDropWinItem:Ve,setApiPrizeDropLobbyInitFake:Ge,setApiPrizeDropJoinCampaignFake:We,setApiPrizeDropClaimFake:He,setPrizeDropRestData:Je,fetchApiPrizeDropLobbyInit:Ke,fetchApiPrizeDropJoinCampaign:Qe,fetchApiPrizeDropClaim:qe,connectPrizeDropSocketService:Xe,setPrizeDropSocketFake:Ze,setPrizeDropDefferedModal:et,joinPrizeDropCampaign:tt,setPrizeDropDefferedCampaign:at,clearPrizeDropDefferedCampaign:rt,addPrizeDropDropsToQueue:it,removePrizeDropFromDropsQueueById:nt,updatePrizeDropQueueEntryClaimUiStatus:st,setPrizeDropCampaignsQueue:ot,shiftPrizeDropFromCampaignsQueue:lt,clearPrizeDropCampaignsQueue:dt,addPrizeDropLiveShownCampaignId:ct,clearPrizeDropJoinCampaignError:pt,setPrizeDropCampaigns:ut,setPrizeDropRewardHubDrops:mt,clearPrizeDropClaimData:ht,clearPrizeDropRewardHubItem:ft}=Te.actions,{isPrizeDropActive:gt,getPrizeDropMode:vt,isPrizeDropJoined:xt,getPrizeDropMaxPrize:bt,hasPrizeDropActiveCampaign:wt,displayPrizeDropJoinButton:yt}=Te.selectors,jt=Te.reducer,Dt=e=>(t,a,r)=>{const i=a(),n=r.mainGetState().play.isActive;e.drops.forEach(e=>{"true"===e.prize.type&&t(mt([e]))});const s=e.drops.filter(e=>e.direct);if(0===s.length)return;if(s.forEach(e=>{se.h$.emit("prizeDrop:won",(0,ne.ym)(e))}),n){t(it(s));const e=s[s.length-1];return t(Ye(e)),void t(et(!0))}t(it(s));const o=a().prizeDrop.dropsQueue[0];return o?i.modals.current.some(e=>ke.includes(e))?(a().modals.current.filter(e=>ke.includes(e)).forEach(e=>{t(je(e))}),t(ht()),t(Ye(o.drop)),void t(ye(Oe(o)))):(t(Ye(o.drop)),void t(ye(Oe(o)))):void 0},Ct=e=>(t,a,r)=>{const{displayedCampaign:i}=a().prizeDrop;(null==i?void 0:i.campaignId)&&"prizeDropJoinError"!==e&&t(ct(i.campaignId)),t(je(e)),t(lt());const{campaignsQueue:n}=a().prizeDrop,s=n[0];s&&(t(Fe(s)),r.mainDispatch((0,H.M5)()),t(ye("prizeDropLive")))},zt=e=>(t,a,r)=>{var i;const n=null===(i=a().prizeDrop.winDropItem)||void 0===i?void 0:i.dropId;t(je(e)),n&&t(nt(n)),t(Ve()),t(ht());const{dropsQueue:s}=a().prizeDrop,o=s[0];o&&(t(Ye(o.drop)),t(ye(Oe(o)))),r.mainDispatch((0,H.M5)())};const Nt=(0,z.Kr)({name:"transaction",initialState:{transactions:[],hasMore:!1,currentPage:1,apiTransactions:{data:null,isPending:!1,error:null,fake:null}},reducers:e=>({setApiTransactionsFake:e.reducer((e,t)=>{var a;e.apiTransactions.fake=null!==(a=t.payload)&&void 0!==a?a:null}),clearTransactions:e.reducer(e=>{e.transactions=[],e.hasMore=!1,e.currentPage=1}),addTransaction:e.reducer((e,t)=>{const{amount:a,dropId:r}=t.payload,i={transactionId:`optimistic-${r}`,createdAt:(new Date).toISOString(),status:"completed",type:"top-up",subType:"prizedrop",amount:a};e.transactions=[i,...e.transactions]}),fetchApiTransactions:e.asyncThunk((e,t)=>{return a=void 0,r=[e,t],n=function*(e,{rejectWithValue:t,getState:a}){var r,i,n,s,o,l;const d=a(),c=null===(r=d.transaction.apiTransactions.fake)||void 0===r?void 0:r.enabled,p=null===(n=null===(i=d.prizeDrop)||void 0===i?void 0:i.restData)||void 0===n?void 0:n.token,u=null===(o=null===(s=d.prizeDrop)||void 0===s?void 0:s.restData)||void 0===o?void 0:o.url;if(c){const{fake:e}=d.transaction.apiTransactions;return yield(0,L.yy)(e.delay),e.hasError?t(JSON.parse(e.error)):JSON.parse(e.response)}if(!u||!p)throw Error("Endpoint or token not provided");const m=e&&"object"==typeof e&&"page"in e&&null!==(l=e.page)&&void 0!==l?l:1,h={};return m>1&&(h.page=String(m)),Se("GET",`${u}/wallet/transactions`,p,null,h)},new((i=void 0)||(i=Promise))(function(e,t){function s(e){try{l(n.next(e))}catch(e){t(e)}}function o(e){try{l(n.throw(e))}catch(e){t(e)}}function l(t){var a;t.done?e(t.value):(a=t.value,a instanceof i?a:new i(function(e){e(a)})).then(s,o)}l((n=n.apply(a,r||[])).next())});var a,r,i,n},{pending:e=>{e.apiTransactions.isPending=!0,e.apiTransactions.error=null},rejected:(e,t)=>{e.apiTransactions.isPending=!1,e.apiTransactions.error={name:"Oops",message:"Something went wrong"}},fulfilled:(e,t)=>{var a;e.apiTransactions.isPending=!1;const{payload:r}=t;e.apiTransactions.data=r;const i=r.transactions.map(e=>{return t=e,Object.assign(Object.assign({},t),{amount:parseFloat(t.amount)||0});var t}),{arg:n}=t.meta,s=n&&"object"==typeof n&&"page"in n&&null!==(a=n.page)&&void 0!==a?a:1;1===s?(e.transactions=i,e.currentPage=1):e.transactions=[...e.transactions,...i],e.currentPage=s,e.hasMore=r.hasMore}})})}),{addTransaction:Et,clearTransactions:St,fetchApiTransactions:Pt,setApiTransactionsFake:kt}=Nt.actions,Rt=Nt.reducer;var Ot,It;const Bt=(0,y.HY)({modals:we,notification:W,prizeDrop:jt,promoLobby:B,transaction:Rt,wallet:ie}),Lt=(0,L.P3)("token"),_t={key:`${null!==(It=null===(Ot=(0,_.p)(Lt))||void 0===Ot?void 0:Ot.gameId)&&void 0!==It?It:"sandbox"}:promoLobby`,storage:C.A,whitelist:["notification","prizeDrop"],transforms:[T,Me]},Mt=(0,D.rL)(_t,Bt),Tt={mainDispatch:(...e)=>{throw new Error("PromoLobby mainDispatch is not set. Ensure PromoLobbyProvider mounted inside main Provider.")},mainGetState:()=>{throw new Error("PromoLobby mainGetState is not set. Ensure PromoLobbyProvider mounted inside main Provider.")}},At=(0,j.U1)({reducer:Mt,middleware:e=>e({serializableCheck:{ignoredActions:[D.ZM,D.r2,D.Hz,D.DY,D.Cq,D.eY]},thunk:{extraArgument:Tt}}),devTools:!1}),Ft=(0,D.GM)(At);var Ut=a(8131);const $t=({children:e})=>{const t=(0,v.Pj)();return(0,g.useEffect)(()=>{var e;e={mainDispatch:t.dispatch,mainGetState:()=>t.getState()},Tt.mainDispatch=e.mainDispatch,Tt.mainGetState=e.mainGetState},[t]),(0,r.jsx)(Ut.Q,{loading:null,persistor:Ft,children:(0,r.jsx)(v.Kq,{store:At,context:x,children:e})})},Yt=({children:e})=>(0,r.jsx)($t,{children:e});var Vt,Gt=a(9286),Wt=a(6942),Ht=a.n(Wt);function Jt(){return Jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Jt.apply(null,arguments)}const Kt=e=>g.createElement("svg",Jt({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 8 10"},e),Vt||(Vt=g.createElement("path",{fill:"#fff",d:"M1.083 0v3l1.944 2-1.944 2v3h5.833V7L4.972 5l1.944-2V0z"})));var Qt=a(2192);const qt=({prizeDropMode:e,className:t})=>{const a=(0,Qt.Bd)();return(0,r.jsxs)("div",{className:Ht()("flex items-center gap-4 rounded-20 px-10 py-4","ended"===e&&"bg-add-gradient","live"===e&&"bg-green","upcoming"===e&&"bg-add-violet backdrop-blur-[20px]",t),children:["live"===e&&(0,r.jsx)("div",{className:"h-6 w-6 rounded-full bg-white"}),"upcoming"===e&&(0,r.jsx)(Kt,{className:"h-10 w-8"}),(0,r.jsxs)("span",{className:"text-xs-bold",children:["ended"===e&&a("LOBBY.014","Ended").toUpperCase(),"live"===e&&a("LOBBY.012","Live").toUpperCase(),"upcoming"===e&&a("LOBBY.013","Upcoming").toUpperCase()]})]})};var Xt=a(6098),Zt=a(7052);const ea=({onClick:e,isLoading:t,className:a="",text:i,loadingText:n,disabled:s=!1,size:o="middle"})=>(0,r.jsx)(Xt.$,{className:Ht()("mx-auto w-full mp:max-w-530 ml:max-w-560",a),onClick:a=>!t&&e(a),disabled:s||t,size:o,children:t?(0,r.jsxs)("div",{className:"flex items-center gap-8",children:[(0,r.jsx)(Zt.k,{}),n]}):i}),ta=({onClick:e,isLoading:t,className:a="",disabled:i=!1})=>{const n=(0,Qt.Bd)();return(0,r.jsx)(ea,{onClick:e,text:n("DROP.010","Join now"),loadingText:n("DROP.011","Joining..."),isLoading:t,className:a,disabled:i})};var aa,ra,ia,na,sa,oa,la,da,ca,pa;function ua(){return ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ua.apply(null,arguments)}const ma=e=>g.createElement("svg",ua({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 32 32"},e),aa||(aa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__a)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m-5.548 15.999L16 21.547l5.548-5.548L16 10.45z",clipRule:"evenodd"})),ra||(ra=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__b)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 3.429C9.057 3.429 3.429 9.057 3.429 16S9.057 28.571 16 28.571 28.571 22.943 28.571 16 22.943 3.429 16 3.429",clipRule:"evenodd"})),ia||(ia=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__c)",fillRule:"evenodd",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 3.429C9.057 3.429 3.429 9.057 3.429 16S9.057 28.571 16 28.571 28.571 22.943 28.571 16 22.943 3.429 16 3.429",clipRule:"evenodd"})),na||(na=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__d)",d:"M16 2.857C23.26 2.857 29.143 8.74 29.143 16c0 7.258-5.884 13.143-13.143 13.143-7.258 0-13.143-5.885-13.143-13.143S8.742 2.857 16 2.857m0 .571C9.057 3.428 3.43 9.057 3.43 16S9.057 28.57 16 28.57 28.572 22.943 28.572 16 22.943 3.428 16 3.428"})),sa||(sa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__e)",d:"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16S0 24.837 0 16 7.163 0 16 0m0 .571C7.479.571.571 7.48.571 16S7.48 31.429 16 31.429 31.429 24.52 31.429 16 24.52.571 16 .571"})),oa||(oa=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__f)",d:"M22.457 15.292a1 1 0 0 1 0 1.414l-5.75 5.75a1 1 0 0 1-1.414 0l-5.75-5.75a1 1 0 0 1 0-1.414l5.75-5.75a1 1 0 0 1 1.414 0zm-12.005.707L16 21.547l5.548-5.548L16 10.45z"})),la||(la=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__g)",d:"M14.788 9.239c.67-.67 1.755-.67 2.424 0l5.548 5.548c.67.67.67 1.754 0 2.424l-5.548 5.548c-.67.67-1.754.67-2.424 0L9.24 17.21a1.714 1.714 0 0 1 0-2.424zm2.02.404a1.143 1.143 0 0 0-1.616 0L9.644 15.19l-.078.087c-.366.449-.34 1.11.078 1.529l5.548 5.548c.419.418 1.08.444 1.53.078l.086-.078 5.548-5.548c.419-.418.444-1.08.078-1.53l-.078-.086z"})),da||(da=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__h)",d:"M14.788 9.239c.67-.67 1.755-.67 2.424 0l5.548 5.548c.67.67.67 1.754 0 2.424l-5.548 5.548c-.67.67-1.754.67-2.424 0L9.24 17.21a1.714 1.714 0 0 1 0-2.424zm2.02.404a1.143 1.143 0 0 0-1.616 0L9.644 15.19l-.078.087c-.366.449-.34 1.11.078 1.529l5.548 5.548c.419.418 1.08.444 1.53.078l.086-.078 5.548-5.548c.419-.418.444-1.08.078-1.53l-.078-.086z"})),ca||(ca=g.createElement("path",{fill:"url(#true-token-gradient-icon_svg__i)",d:"M21.548 15.999 16 21.547l-5.548-5.548L16 10.45zm-10.288 0 4.74 4.74 4.74-4.74-4.74-4.74z"})),pa||(pa=g.createElement("defs",null,g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__d",x1:2.857,x2:29.143,y1:2.857,y2:29.143,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.153,stopColor:"#491B04"}),g.createElement("stop",{offset:.5,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.847,stopColor:"#FFF7D2"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__e",x1:0,x2:32,y1:0,y2:32,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.15,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.847,stopColor:"#734D26"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__g",x1:8.738,x2:23.262,y1:8.737,y2:23.261,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.215,stopColor:"#0DF2C1"}),g.createElement("stop",{offset:.5,stopColor:"#F2E70D"}),g.createElement("stop",{offset:.872,stopColor:"#04493A"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__h",x1:8.738,x2:23.262,y1:8.737,y2:23.261,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.25,stopColor:"#FFF7D2"}),g.createElement("stop",{offset:.5,stopColor:"#FFE56F"}),g.createElement("stop",{offset:.75,stopColor:"#491B04"})),g.createElement("linearGradient",{id:"true-token-gradient-icon_svg__i",x1:10.452,x2:21.548,y1:10.451,y2:21.547,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.25,stopColor:"#491B04"}),g.createElement("stop",{offset:.748,stopColor:"#FFF7D2"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__a",cx:0,cy:0,r:1,gradientTransform:"matrix(35.02743 34.45334 -49.19166 50.01133 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.202,stopColor:"#E3C28E"}),g.createElement("stop",{offset:.721,stopColor:"#B37F42"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__b",cx:0,cy:0,r:1,gradientTransform:"matrix(31.98739 31.98739 -45.67082 45.67082 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#19925E"}),g.createElement("stop",{offset:.502,stopColor:"#4BB866",stopOpacity:.8}),g.createElement("stop",{offset:.968,stopColor:"#EBE713"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__c",cx:0,cy:0,r:1,gradientTransform:"matrix(35.02743 34.45334 -49.19166 50.01133 .013 0)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.162,stopColor:"#CFA56A"}),g.createElement("stop",{offset:.76,stopColor:"#DEBA80"})),g.createElement("radialGradient",{id:"true-token-gradient-icon_svg__f",cx:0,cy:0,r:1,gradientTransform:"rotate(44.527 -6.37 15.216)scale(21.999 31.4097)",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{offset:.162,stopColor:"#CFA56A"}),g.createElement("stop",{offset:.76,stopColor:"#DEBA80"}))))),ha={title:{fontSize:36,fontWeight:800,height:42,baseline:32},promo:{fontSize:30,fontWeight:700,height:35,baseline:28},currency:{fontSize:18,fontWeight:700,height:21,baseline:16},text:{fontSize:20,fontWeight:700,height:24,baseline:19}},fa=({children:e,variant:t="title",className:a="",maxWidth:i})=>{const n=(0,g.useId)().replace(/:/g,"-"),s=`gold-gradient-${n}`,o=`gold-shadow-${n}`,l=(0,g.useRef)(null),[d,c]=(0,g.useState)(200),p=ha[t],[u,m]=(0,g.useState)(p.fontSize),h=void 0!==i?p.height/2:p.baseline;return(0,g.useLayoutEffect)(()=>{m(p.fontSize)},[e,i,p.fontSize]),(0,g.useLayoutEffect)(()=>{if(l.current){const e=l.current.getBBox(),t=Math.ceil(e.width),a=void 0!==i?Math.min(t,i)+4:t+4;if(void 0!==i&&t>i){const e=Math.max(Math.floor(u*(i/t)),1);u!==e&&m(e)}d!==a&&c(a)}},[e,u,i,p.fontSize,d]),(0,r.jsxs)("svg",{className:a,width:d,height:p.height,viewBox:`0 0 ${d} ${p.height}`,style:{display:"inline-block",overflow:"visible"},children:[(0,r.jsxs)("defs",{children:[(0,r.jsxs)("radialGradient",{id:s,gradientUnits:"userSpaceOnUse",cx:"0",cy:"0",r:"10",gradientTransform:"matrix(12.479 4.522 17.525 -6.564 0.044977 0.0000027894)",children:[(0,r.jsx)("stop",{stopColor:"#E3C28E",offset:"20.23%"}),(0,r.jsx)("stop",{stopColor:"#CB9A68",offset:"46.16%"}),(0,r.jsx)("stop",{stopColor:"#B37F42",offset:"72.08%"})]}),(0,r.jsx)("filter",{id:o,x:"-20%",y:"-20%",width:"140%",height:"140%",children:(0,r.jsx)("feDropShadow",{dx:"0",dy:"1",stdDeviation:"0",floodColor:"black",floodOpacity:"0.3"})})]}),(0,r.jsx)("text",{ref:l,x:"0",y:h,fill:`url(#${s})`,filter:`url(#${o})`,fontFamily:"Roboto, sans-serif",fontSize:u,fontWeight:p.fontWeight,dominantBaseline:void 0!==i?"middle":void 0,children:e})]})};var ga;function va(){return va=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},va.apply(null,arguments)}const xa=e=>g.createElement("svg",va({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),ga||(ga=g.createElement("path",{fill:"currentColor",d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M4.418 8 8 11.582 11.582 8 8 4.418z"})));var ba=a(7031);const wa=({classes:e})=>(0,r.jsxs)("div",{className:"loader",children:[(0,r.jsx)("span",{className:null==e?void 0:e.dot}),(0,r.jsx)("span",{className:null==e?void 0:e.dot}),(0,r.jsx)("span",{className:null==e?void 0:e.dot})]});var ya=a(9494),ja=a(7997);const Da=()=>{var e;const t=(0,Qt.Bd)(),a=w(ee),i=null===(e=w(ee))||void 0===e?void 0:e.sessionRate,n=w(ae),s=w(e=>e.wallet.trueDecimal),{isPending:o,error:l}=w(e=>e.prizeDrop.apiLobbyInit),d=(0,Gt.GV)(ja.ge),[u,m]=(0,g.useState)(""),h=o||!!l||!n,f=a?Number(a.balance):0;return(0,g.useEffect)(()=>{m(se.bp.formatCash(f,{showCurrency:!1,customDecimals:s,roundUp:!0}))},[f,s,i]),(0,r.jsx)("div",{className:"h-180 rounded-30",style:{backgroundImage:`url(${ba.f.get(c)})`,backgroundSize:"cover",backgroundPosition:"top right"},children:(0,r.jsxs)("div",{className:"relative flex h-full flex-col justify-between rounded-30 border-[3px] border-white-10 p-17",children:[(0,r.jsx)("img",{src:ba.f.get(p),alt:"safe",className:"absolute -right-3 top-1/2 w-190 -translate-y-1/2"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-6",children:[(0,r.jsx)(xa,{className:"h-28 w-28 shrink-0 text-white"}),(0,r.jsx)("div",{className:"title-h3-bold",children:"$TRUE Token"})]}),(0,r.jsxs)("div",{children:[h?(0,r.jsx)("div",{className:"flex h-38 items-center",children:(0,r.jsx)(wa,{classes:{dot:"w-7 h-7"}})}):(0,r.jsx)(ya.$,{className:"m-0 font-extrabold leading-[38px] text-white",text:u,initialFontSize:32,maxWidth:d?240:170}),!h&&f>0&&(0,r.jsxs)("div",{className:"text-medium-reg -mt-3 opacity-60",children:["~",se.bp.formatCash(f/i,{roundUp:!0})]})]})]}),(0,r.jsx)("div",{className:"text-small-reg max-w-180 opacity-60",children:t("LOBBY.097","Conversion will open on May 26th")})]})})},Ca=()=>{var e,t;const a=(0,Qt.Bd)(),i=w(e=>e.prizeDrop.displayedCampaign.cashPrizePool),n=w(e=>e.prizeDrop.displayedCampaign),s=w(re),o=w(e=>e.wallet.trueDecimal),l=n.prizes.some(e=>"true"===e.type),d="number"==typeof s&&s>0;return i?(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"title-h3-bold text-cente flex items-center justify-center gap-8 text-center",children:[(0,r.jsxs)("div",{children:["🏆 ",a("DROP.003","Prize pool:")," "]}),l?(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ma,{className:"h-20 w-20"}),(0,r.jsxs)(fa,{variant:"text",children:[se.bp.formatCash(null!==(e=null==i?void 0:i.value)&&void 0!==e?e:0,{showCurrency:!1,customDecimals:o,roundUp:!0})," "]})]}):(0,r.jsx)(fa,{variant:"text",children:se.bp.formatCash(null==i?void 0:i.value,{customCurrency:null==i?void 0:i.currency,customDecimals:null==i?void 0:i.decimals,roundUp:!0})})]}),l&&d&&(0,r.jsxs)("div",{className:"text-medium-reg text-center opacity-60",children:["~"," ",se.bp.formatCash((null!==(t=null==i?void 0:i.value)&&void 0!==t?t:0)/s,{roundUp:!0})]})]}):null};a(494),a(2796),a(7317),a(9964),a(813),a(5811),a(9423),a(7205),a(2369),a(5616),a(1340),a(7081),a(4895),a(6007);var za,Na=a(4353),Ea=a.n(Na);function Sa(){return Sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Sa.apply(null,arguments)}const Pa=e=>g.createElement("svg",Sa({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 21 20"},e),za||(za=g.createElement("path",{fill:"#fff",d:"M8 8.333V10H6.333V8.333zm3.333 0V10H9.667V8.333zm3.334 0V10H13V8.333zM16.333 2.5A1.666 1.666 0 0 1 18 4.166v11.667a1.666 1.666 0 0 1-1.667 1.667H4.667A1.667 1.667 0 0 1 3 15.833V4.166A1.667 1.667 0 0 1 4.667 2.5H5.5V.833h1.667V2.5h6.666V.833H15.5V2.5zm0 13.333V6.666H4.667v9.167zM8 11.666v1.667H6.333v-1.667zm3.333 0v1.667H9.667v-1.667zm3.334 0v1.667H13v-1.667z"}))),ka=({dateStart:e,dateEnd:t,className:a=""})=>{const i=(0,Gt.GV)(e=>e.localization.lang);return(0,r.jsxs)("div",{className:Ht()(a||"text-small-med mt-12"),children:[(0,r.jsx)(Pa,{className:"mr-6 inline-block h-20 w-20"}),Ea()(e).locale("no"===i?"nb":i).format("MMM D, YYYY")," ","–"," ",Ea()(t).locale("no"===i?"nb":i).format("MMM D, YYYY")]})},Ra=e=>{const t=Date.now();let a=new Date(e).getTime()-t;a<0&&(a=0);const r=Math.floor(a/864e5),i=Math.floor(a/36e5%24),n=Math.floor(a/6e4%60),s=Math.floor(a/1e3%60),o=e=>String(e).padStart(2,"0");return{days:o(r),hours:o(i),mins:o(n),secs:o(s)}},Oa=({prizeDropMode:e,className:t=""})=>{const a=(0,Qt.Bd)(),{dateStart:i,dateEnd:n}=w(e=>e.prizeDrop.displayedCampaign),s="upcoming"===e?i:n,o="ended"===e,[l,d]=(0,g.useState)(()=>Ra(s));(0,g.useEffect)(()=>{const e=setInterval(()=>{d(Ra(s))},1e3);return()=>clearInterval(e)},[s]);const c=[{value:l.days,text:a("DROP.036","Days")},{value:l.hours,text:a("DROP.037","Hrs")},{value:l.mins,text:a("DROP.038","Mins")},{value:l.secs,text:a("DROP.039","Secs")}],p=e=>!!(o||Number(e)<0);return(0,r.jsxs)("div",{className:Ht()("flex flex-col items-center rounded-16 bg-white-6 pb-20 pt-16",t),children:[(0,r.jsxs)("span",{className:"title-h3-bold",children:["live"===e&&a("DROP.035","Ends in"),"ended"===e&&a("DROP.045","Ended"),"upcoming"===e&&a("DROP.068","Starts in")]}),(0,r.jsx)("div",{className:"mt-6 flex gap-4",children:c.map(({value:e,text:t})=>(0,r.jsxs)("div",{className:"flex flex-col rounded-10 bg-white-6 px-14 py-12",children:[(0,r.jsx)("span",{className:"title-h2-bold text-center",children:p(e)?"00":e}),(0,r.jsx)("span",{className:"text-super-xs-reg uppercase",children:t})]},t))}),(0,r.jsx)(ka,{dateStart:i,dateEnd:n})]})};var Ia,Ba,La,_a=a(1601);function Ma(){return Ma=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ma.apply(null,arguments)}const Ta=e=>g.createElement("svg",Ma({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 18 18"},e),Ia||(Ia=g.createElement("path",{fill:"url(#qualified-icon_svg__a)",d:"M8.222.962a1 1 0 0 1 1.556 0l.899 1.112a1 1 0 0 0 1.037.337l1.381-.371a1 1 0 0 1 1.259.914l.073 1.429a1 1 0 0 0 .642.882l1.335.512a1 1 0 0 1 .48 1.479l-.78 1.199a1 1 0 0 0 0 1.09l.78 1.2a1 1 0 0 1-.48 1.479l-1.335.51a1 1 0 0 0-.642.883l-.073 1.429a1 1 0 0 1-1.259.914l-1.38-.371a1 1 0 0 0-1.038.337l-.9 1.112a1 1 0 0 1-1.555 0l-.899-1.112a1 1 0 0 0-1.037-.337l-1.381.37a1 1 0 0 1-1.259-.913l-.073-1.429a1 1 0 0 0-.641-.882l-1.336-.511a1 1 0 0 1-.48-1.48l.78-1.199a1 1 0 0 0 0-1.09l-.78-1.2a1 1 0 0 1 .48-1.478l1.336-.512a1 1 0 0 0 .64-.882l.074-1.429a1 1 0 0 1 1.259-.914l1.38.371a1 1 0 0 0 1.038-.337z"})),Ba||(Ba=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeWidth:2,d:"m6 9 2 2 4-4"})),La||(La=g.createElement("defs",null,g.createElement("linearGradient",{id:"qualified-icon_svg__a",x1:0,x2:18,y1:6.818,y2:6.818,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#41FF8D"}),g.createElement("stop",{offset:1,stopColor:"#2FA5E8"})))));var Aa=a(6966);const Fa=({betStatus:e})=>{const t=(0,Qt.Bd)(),a=w(e=>e.prizeDrop.displayedCampaign),i=w(e=>e.prizeDrop.activeCampaign),n=(null==a?void 0:a.campaignId)===(null==i?void 0:i.campaignId);if(null===e)return null;const{bgClass:s,icon:o,title:l}=((e,t,a)=>t?e?{bgClass:"bg-green opacity-20",icon:(0,r.jsx)(Ta,{className:"z-1"}),title:a("DROP.041","Your current bet meets the requirements")}:{bgClass:"bg-[rgba(255,71,102,0.2)]",icon:(0,r.jsx)("span",{className:"z-1 leading-[18px]",children:"😴"}),title:a("DROP.044","Your current bet does not meet the requirements")}:{bgClass:"bg-[rgba(255,96,71,0.2)]",icon:(0,r.jsx)("div",{className:"bg-add-gradient z-1 flex min-h-18 min-w-18 items-center justify-center rounded-full",children:(0,r.jsx)(Aa.A,{className:"h-full w-full"})}),title:a("LOBBY.040","You have already joined an active event.")})(e,n,t);return(0,r.jsxs)("div",{className:"relative -mb-10 mt-10 flex items-center gap-6 py-6 pl-6 pr-10",children:[(0,r.jsx)("div",{className:Ht()("absolute inset-0 rounded-20",s)}),o,(0,r.jsx)("span",{className:"text-small-reg z-1",children:l})]})},Ua=({prizeDropMode:e,betStatus:t,isJoined:a})=>{const i=(0,Gt.GV)(_a.uB),n=(0,Qt.Bd)();return(0,r.jsxs)("div",{className:"relative flex flex-col items-center rounded-tl-16 rounded-tr-16 bg-gradient-to-b from-white-6 to-transparent text-center",children:[(0,r.jsx)("img",{src:ba.f.get(i?h:m),alt:"bg",className:"absolute left-1/2 top-0 w-full max-w-full -translate-x-1/2 ml:max-w-448"}),(0,r.jsx)(qt,{prizeDropMode:e,className:"absolute right-10 top-10"}),(0,r.jsx)("img",{src:ba.f.get(f),alt:"logo",className:"contain mt-20 h-74 w-140"}),(0,r.jsxs)("span",{className:"title-h3-bold mt-10 px-6",children:["ended"!==e&&n("DROP.002","Spin and win amazing prizes instantly!"),"ended"===e&&`${n("DROP.046","All winners have received their prizes!")} 🥳`]}),"ended"===e&&(0,r.jsxs)("span",{className:"text-medium-reg px-6 leading-[25px]",children:[n("DROP.047","Stay tuned for new events")," 🚀"]}),a&&(0,r.jsx)(Fa,{betStatus:t})]})},$a=({minimumBet:e,className:t=""})=>{const a=(0,Qt.Bd)();return(0,r.jsx)("div",{className:Ht()("rounded-16 bg-white-6 py-14",t),children:(0,r.jsxs)("div",{className:"text-medium-reg text-center",children:[a("DROP.034","Minimum bet to participate:")," ",(0,r.jsx)("span",{className:"font-bold",children:se.bp.formatCash(e)})]})})},Ya=({className:e=""})=>{const t=w(e=>{var t;return vt(e,null===(t=e.prizeDrop.displayedCampaign)||void 0===t?void 0:t.campaignId)}),a=w(e=>e.prizeDrop.displayedCampaign.prizes),i=w(re),n=w(e=>e.wallet.trueDecimal),s="number"==typeof i&&i>0,o=(0,Qt.Bd)();return(0,r.jsxs)("div",{className:Ht()("flex flex-col gap-1",e),children:[(0,r.jsxs)("div",{className:Ht()("text-small-reg grid rounded-tl-12 rounded-tr-12 bg-white-6 px-20 py-6","upcoming"===t?"grid-cols-[1fr_80px]":"grid-cols-[1fr_80px_80px]"),children:[(0,r.jsx)("div",{className:"opacity-60",children:o("DROP.031","Prize")}),(0,r.jsx)("div",{className:"text-right opacity-60",children:o("DROP.032","Count")}),"upcoming"!==t&&(0,r.jsx)("div",{className:"text-right opacity-60",children:o("DROP.033","Left")})]}),a.map(({prizeId:e,leftCount:a,totalCount:o,configCash:l,configTrue:c})=>{var p,u,m,h,f,g,v;return(0,r.jsxs)("div",{className:Ht()("text-medium-reg grid items-center bg-white-10 py-8 pl-16 pr-20 last-of-type:rounded-bl-12 last-of-type:rounded-br-12","upcoming"===t?"grid-cols-[1fr_80px]":"grid-cols-[1fr_80px_80px]"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-10",children:[(0,r.jsx)("img",{src:ba.f.get(d),alt:"Cash prize",className:"contain h-36 w-36"}),"TRUE"===(null===(p=null==c?void 0:c.amount)||void 0===p?void 0:p.currency)?(0,r.jsxs)("div",{className:"flex flex-col justify-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(xa,{className:"h-16 w-16"}),se.bp.formatCash(null===(u=null==c?void 0:c.amount)||void 0===u?void 0:u.value,{showCurrency:!1,customDecimals:n,roundUp:!0})," "]}),s&&(0,r.jsxs)("span",{className:"text-xs-reg opacity-60",children:["~",se.bp.formatCash((null!==(h=null===(m=null==c?void 0:c.amount)||void 0===m?void 0:m.value)&&void 0!==h?h:0)/i,{roundUp:!0})," "]})]}):(0,r.jsxs)("span",{className:"title-h3-bold",children:[se.bp.formatCash(null===(f=null==l?void 0:l.amount)||void 0===f?void 0:f.value,{showCurrency:!1,customDecimals:null===(g=null==l?void 0:l.amount)||void 0===g?void 0:g.decimals,roundUp:!0})," ",(0,r.jsx)("span",{className:"text-small-bold",children:null===(v=null==l?void 0:l.amount)||void 0===v?void 0:v.currency})]})]}),(0,r.jsx)("span",{className:"text-right",children:o}),"upcoming"!==t&&(0,r.jsx)("span",{className:"text-right",children:a})]},e)})]})},Va=({prizesLeftCount:e,winnersCount:t})=>{const a=(0,Qt.Bd)();return(0,r.jsxs)("div",{className:"mt-18 flex gap-10",children:[(0,r.jsxs)("div",{className:"flex flex-1 flex-col rounded-12 bg-white-6 pb-12 pt-14 text-center",children:[(0,r.jsx)("span",{className:"title-h1-bold",children:e}),(0,r.jsxs)("span",{className:"text-small-med",children:["🎁 ",a("DROP.029","Prizes left")]})]}),(0,r.jsxs)("div",{className:"flex flex-1 flex-col rounded-12 bg-white-6 pb-12 pt-14 text-center",children:[(0,r.jsx)("span",{className:"title-h1-bold",children:t}),(0,r.jsxs)("span",{className:"text-small-med",children:["⭐️ ",a("DROP.030","Winners")]})]})]})},Ga=()=>{const e=(0,Gt.GV)(e=>e.stake.current.amount),{prizesLeftCount:t,winnersCount:a,betAmount:i}=w(e=>e.prizeDrop.displayedCampaign),n=w(e=>{var t;return vt(e,null===(t=e.prizeDrop.displayedCampaign)||void 0===t?void 0:t.campaignId)}),s=w(xt),o="live"===n?e>=i:null;return(0,g.useEffect)(()=>{se.h$.emit("pdModal:eventsView")},[]),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-10",children:[(0,r.jsx)(Ua,{betStatus:o,prizeDropMode:n,isJoined:s}),"upcoming"===n&&(0,r.jsx)(Oa,{prizeDropMode:n,className:"mt-6"}),(0,r.jsxs)("div",{className:Ht()("rounded-16 bg-white-6 px-14 pb-14 pt-16","live"===n&&"mt-6","live"===n&&s&&"!mt-16","ended"===n&&"mt-4"),children:["upcoming"!==n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ca,{}),(0,r.jsx)(Va,{prizesLeftCount:t,winnersCount:a})]}),"upcoming"===n&&(0,r.jsx)(Ca,{}),(0,r.jsx)(Ya,{className:Ht()("upcoming"===n?"mt-18":"mt-10")})]}),(0,r.jsx)($a,{minimumBet:i,className:"upcoming"===n&&"mb-13"}),"upcoming"!==n&&(0,r.jsx)(Oa,{prizeDropMode:n,className:"mb-10"})]})};var Wa=a(9701);const Ha=e=>{const t=Date.now();let a=new Date(e).getTime()-t;a<0&&(a=0);const r=Math.floor(a/864e5),i=Math.floor(a/36e5%24),n=Math.floor(a/6e4%60),s=Math.floor(a/1e3%60),o=e=>String(e).padStart(2,"0");return{days:o(r),hours:o(i),mins:o(n),secs:o(s)}},Ja=({dateStart:e,className:t=""})=>{const a=(0,Qt.Bd)(),[i,n]=(0,g.useState)(()=>Ha(e));(0,g.useEffect)(()=>{const t=setInterval(()=>{n(Ha(e))},1e3);return()=>clearInterval(t)},[e]);const s=[{value:i.days,text:a("DROP.036","Days")},{value:i.hours,text:a("DROP.037","Hrs")},{value:i.mins,text:a("DROP.038","Mins")},{value:i.secs,text:a("DROP.039","Secs")}],o=e=>Number(e)<0;return(0,r.jsxs)("div",{className:Ht()("flex flex-col gap-5",t),children:[(0,r.jsx)("span",{className:"text-small-reg text-left opacity-60",children:a("DROP.068","Starts in")}),(0,r.jsx)("div",{className:"flex gap-4",children:s.map(({value:e,text:t})=>(0,r.jsxs)("div",{className:"flex min-w-40 flex-col rounded-10 bg-white-20 p-8",style:{boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.20) inset"},children:[(0,r.jsx)("span",{className:"title-h2-bold text-center",children:o(e)?"00":e}),(0,r.jsx)("span",{className:"text-super-xs-reg uppercase",children:t})]},t))})]})},Ka=({campaign:e})=>{var t,a,i,n,s,o,d,c;const p=w(t=>vt(t,e.campaignId)),u="ended"===p,m="upcoming"===p,h="live"===p,f=w(re),g=w(e=>e.wallet.trueDecimal),v="number"==typeof f&&f>0,x=(0,Gt.GV)(_a.ge),y=(0,Qt.Bd)(),j=b(),D=e.prizes.some(e=>"true"===e.type);return(0,r.jsxs)("button",{type:"button",className:"relative flex h-170 w-full cursor-pointer flex-col justify-between overflow-hidden rounded-16 bg-[linear-gradient(79deg,#D1003F_0%,#D1003F_50%,#FF844F_100%)] p-20 drop-shadow-[0_1px_2px_rgba(0,0,0,0.2)]",onClick:()=>(j(Fe(e)),void j(S("campaign"))),children:[(0,r.jsxs)("svg",{style:{transform:"rotate(65.125deg) translate(-115%, -36%)",position:"absolute",right:"-160px",top:"0",mixBlendMode:"plus-lighter",width:"268.556px",height:"583.547px"},width:"305",height:"170",viewBox:"0 0 305 170",fill:"none",children:[(0,r.jsxs)("g",{style:{mixBlendMode:"plus-lighter"},children:[(0,r.jsx)("g",{filter:"url(#filter0_f_5002_5141)",children:(0,r.jsx)("ellipse",{cx:"167.639",cy:"115.844",rx:"167.639",ry:"115.844",transform:"matrix(-0.612432 0.790523 -0.999061 -0.0433308 508.881 -146.403)",fill:"#FF4D00"})}),(0,r.jsx)("g",{filter:"url(#filter1_f_5002_5141)",children:(0,r.jsx)("ellipse",{cx:"135.464",cy:"72.9381",rx:"135.464",ry:"72.9381",transform:"matrix(0.938677 -0.344798 0.823647 0.567102 188.028 -5.93066)",fill:"#FF4D00"})})]}),(0,r.jsxs)("defs",{children:[(0,r.jsxs)("filter",{id:"filter0_f_5002_5141",x:"0.000213623",y:"-287.287",width:"580.958",height:"536.773",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"67.8837",result:"effect1_foregroundBlur_5002_5141"})]}),(0,r.jsxs)("filter",{id:"filter1_f_5002_5141",x:"183.68",y:"-124.579",width:"383.16",height:"226.608",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"25.4564",result:"effect1_foregroundBlur_5002_5141"})]})]})]}),(0,r.jsx)("img",{className:"absolute right-0 top-1/2 h-170 w-190 -translate-y-1/2",src:ba.f.get(l),alt:""}),(0,r.jsx)(qt,{prizeDropMode:p,className:"absolute right-16 top-16 z-[30]"}),(0,r.jsx)(Wa.Y,{className:"title-h1-bold relative z-10 max-w-[50%] text-left uppercase",text:""===(null===(t=e.texts)||void 0===t?void 0:t.title)||null===(null===(a=e.texts)||void 0===a?void 0:a.title)?y("LOBBY.005","Spin and Win"):e.texts.title,initialFontSize:20,initialLineHeight:23,maxHeight:46}),m&&(0,r.jsx)("div",{children:(0,r.jsx)(Ja,{dateStart:e.dateStart})}),(h||u)&&(0,r.jsxs)("div",{className:"relative z-10 -mb-3 text-left",children:[(0,r.jsx)("div",{className:"text-small-bold mb-2",children:y("LOBBY.006","Prize pool")}),(0,r.jsxs)("div",{className:"flex items-center gap-8",children:[D&&(0,r.jsx)(ma,{className:"h-32 w-32"}),(0,r.jsx)(fa,{variant:"title",className:"-mb-3",maxWidth:x?400:133,children:se.bp.formatCash(null!==(n=null===(i=e.cashPrizePool)||void 0===i?void 0:i.value)&&void 0!==n?n:0,{showCurrency:!1,customDecimals:D?g:null===(s=e.cashPrizePool)||void 0===s?void 0:s.decimals,roundUp:!0})})]}),(0,r.jsxs)("div",{className:"h-21",children:[D&&v&&(0,r.jsxs)("div",{className:"title-h2-bold",children:["~",se.bp.formatCash((null!==(d=null===(o=e.cashPrizePool)||void 0===o?void 0:o.value)&&void 0!==d?d:0)/f,{showCurrency:!0,roundUp:!0})]}),!D&&(0,r.jsx)(fa,{variant:"currency",children:null===(c=e.cashPrizePool)||void 0===c?void 0:c.currency})]})]}),u&&(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[20] rounded-16 bg-[#000101] opacity-100",style:{mixBlendMode:"color"},"aria-hidden":!0})]},e.campaignId)},Qa={running:0,scheduled:1,finished:2},qa=e=>new Date(e).getTime(),Xa=()=>{var e;const t=w(e=>e.prizeDrop.campaigns),a=(0,Qt.Bd)(),i=null!==(e=null==t?void 0:t.filter(e=>"cancelled"!==e.status).sort((e,t)=>{const a=Qa[e.status]-Qa[t.status];if(0!==a)return a;const r=qa(e.dateStart),i=qa(t.dateStart);return"running"===e.status?i-r:r-i}))&&void 0!==e?e:[],n=0===i.filter(e=>!("finished"===e.status)).length;return(0,r.jsxs)("div",{className:"flex w-full flex-col gap-12",children:[(0,r.jsx)("div",{className:"title-h2-bold pl-16",children:a("LOBBY.004","Events")}),(0,r.jsxs)("div",{className:"flex flex-col gap-12",children:[i.map(e=>(0,r.jsx)(Ka,{campaign:e},e.campaignId)),n&&(0,r.jsxs)("div",{className:"text-medium-reg rounded-12 bg-white-10 p-14 text-center opacity-80",children:[a("LOBBY.011","New thrilling events are coming soon — stay tuned 🚀 ")," 🚀"]})]})]})},Za=({htmlString:e})=>(0,r.jsx)("div",{className:Ht()("[&_h3]:text-medium-bold [&_h3:first-child]:mt-0 [&_h3]:mt-19","[&_p]:text-small-reg [&_p>strong]:text-small-bold [&_p]:mt-4 [&_p]:opacity-80 [&_p]:ml:mt-5","[&_ul]:mt-4 [&_ul]:flex [&_ul]:flex-col [&_ul]:gap-3","[&_li]:text-small-reg [&_li]:relative [&_li]:pl-22 [&_li]:opacity-80 [&_li]:before:absolute [&_li]:before:left-10 [&_li]:before:top-7 [&_li]:before:h-4 [&_li]:before:w-4 [&_li]:before:rounded-full [&_li]:before:bg-additional","[&_table]:mt-4 [&_table]:w-full","[&_thead]:text-small-bold [&_thead>tr>th:first-child]:rounded-tl-10 [&_thead>tr>th:last-child]:rounded-tr-10 [&_thead>tr>th]:h-30 [&_thead>tr>th]:w-1/2 [&_thead>tr>th]:bg-white-10 [&_thead>tr>th]:pl-12 [&_thead>tr>th]:text-left","[&_tbody>tr>td]:text-small-reg [&_tbody>tr>td]:relative [&_tbody>tr>td]:h-30 [&_tbody>tr>td]:pl-12","[&_tbody>tr:last-child>td:first-child]:before:rounded-bl-10 [&_tbody>tr:last-child>td:last-child]:before:rounded-br-10 [&_tbody>tr>td:last-child]:before:border-r [&_tbody>tr>td]:before:absolute [&_tbody>tr>td]:before:left-0 [&_tbody>tr>td]:before:top-0 [&_tbody>tr>td]:before:h-full [&_tbody>tr>td]:before:w-full [&_tbody>tr>td]:before:border-b [&_tbody>tr>td]:before:border-l [&_tbody>tr>td]:before:border-solid [&_tbody>tr>td]:before:border-white-10"),dangerouslySetInnerHTML:{__html:e}}),er=()=>{const e=w(e=>e.prizeDrop.displayedCampaign.texts.rules);return(0,g.useEffect)(()=>{se.h$.emit("pdModal:rulesView")},[]),(0,r.jsx)("div",{className:"mb-19 rounded-16 bg-white-6 p-20 text-white",children:(0,r.jsx)(Za,{htmlString:e})})},tr=({config:e,activeTab:t,setActiveTab:a})=>e.length?(0,r.jsx)("div",{className:"flex h-44 w-384",children:e.map(e=>(0,r.jsx)("button",{className:Ht()(["first-of-type:border-l-solid first-of-type:rounded-l-12 first-of-type:border-l-2 first-of-type:border-l-white-20"],["last-of-type:border-r-solid last-of-type:rounded-r-12 last-of-type:border-r-2 last-of-type:border-r-white-20"],"border-y-solid group flex-1 border-y-2 border-y-white-20 ",e.id===t&&"pointer-events-none !border-transparent bg-white-20"),type:"button",onClick:r=>((e,r)=>{e.preventDefault(),r!==t&&a(r)})(r,e.id),children:(0,r.jsx)("span",{className:Ht()("text-medium-bold",e.id===t?"opacity-100":"opacity-40 group-hover:opacity-80 group-hover:transition-opacity"),children:e.title})},e.id))}):null;const ar=({campaignId:e})=>(t,a)=>{return r=void 0,i=void 0,s=function*(){t(Qe({campaignId:e})).unwrap().then(a=>{a.joined&&(t(tt({campaignId:e})),t(Xe()))}).catch(e=>{se.vF.error(e)})},new((n=void 0)||(n=Promise))(function(e,t){function a(e){try{l(s.next(e))}catch(e){t(e)}}function o(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(e){e(r)})).then(a,o)}l((s=s.apply(r,i||[])).next())});var r,i,n,s};var rr=function(e,t,a,r){return new(a||(a=Promise))(function(i,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function o(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(s,o)}l((r=r.apply(e,t||[])).next())})};const ir=(e={})=>(t,a,r)=>rr(void 0,void 0,void 0,function*(){var i;const n=null!==(i=e.shouldFreezeUi)&&void 0!==i&&i;n&&r.mainDispatch((0,oe.zE)()),t(Ke()).unwrap().then(e=>rr(void 0,void 0,void 0,function*(){var i,s,o,l,d,c;n&&r.mainDispatch((0,oe.GP)());const p=null===(i=null==e?void 0:e.campaigns)||void 0===i?void 0:i.find(e=>e.joined&&"running"===e.status);if(t(ut(null!==(s=null==e?void 0:e.campaigns)&&void 0!==s?s:[])),t(X(null===(o=null==e?void 0:e.isWalletAvailable)||void 0===o||o)),t(q(null!==(l=null==e?void 0:e.trueSessionRate)&&void 0!==l?l:null)),t(Z(null!==(d=null==e?void 0:e.wallets)&&void 0!==d?d:[])),t(Xe()),null==p?void 0:p.joined)t(Ae(p)),se.h$.emit("campaignId:set",p.campaignId);else{const r=a().prizeDrop.prizeDropLiveShownCampaignIds,i=null===(c=null==e?void 0:e.campaigns)||void 0===c?void 0:c.filter(e=>"running"===e.status&&!e.joined&&!r.includes(e.campaignId));t(ot(null!=i?i:[])),(null==i?void 0:i.length)>0&&t(Fe(null==i?void 0:i[0]))}})).catch(e=>{n&&r.mainDispatch((0,oe.GP)()),se.vF.error(e)})}),nr=()=>(e,t,a)=>rr(void 0,void 0,void 0,function*(){e(Ke()).unwrap().then(a=>rr(void 0,void 0,void 0,function*(){var r,i,n,s;const o=a.campaigns.find(e=>e.joined&&"running"===e.status);e(ut(a.campaigns)),e(X(null===(r=a.isWalletAvailable)||void 0===r||r)),e(q(null!==(i=a.trueSessionRate)&&void 0!==i?i:null)),e(Z(null!==(n=a.wallets)&&void 0!==n?n:[])),(null===(s=t().prizeDrop.socketConnection)||void 0===s?void 0:s.isSuccess)||e(Xe()),e(Ae(o))})).catch(e=>{a.mainDispatch((0,oe.GP)()),se.vF.error(e)})}),sr=e=>(t,a,r)=>{const i=r.mainGetState().play.isActive,{activeCampaign:n,campaigns:s}=a().prizeDrop;s.find(t=>t.campaignId===e.campaignId)?"finished"===e.status||"cancelled"===e.status?i&&(null==n?void 0:n.campaignId)===e.campaignId?(t(et(!0)),t(at(e))):(t(Ue(e)),(null==n?void 0:n.campaignId)===e.campaignId&&("finished"===e.status?t(ye("prizeDropResultFinished")):"cancelled"===e.status&&t(ye("prizeDropResultCancelled")))):t(i?at(e):Ue(e)):(a().modals.current.includes("promoLobby")&&t(Y(e.campaignId)),t(ir()))};var or,lr=a(8682),dr=a(4354),cr=a(8578),pr=a(8608);function ur(){return ur=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ur.apply(null,arguments)}const mr=e=>g.createElement("svg",ur({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),or||(or=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 14h8M8 2v8.333m0 0L11.333 7M8 10.333 4.667 7"}))),hr={deposit:{label:"Received",key:"LOBBY.020"},prizedrop:{label:"Prizedrop Reward",key:"LOBBY.007"},airdrop:{label:"Airdrop Reward",key:"LOBBY.010"},sent:{label:"Sent",key:"LOBBY.019"}},fr=({transaction:e})=>{const t="top-up"===e.type,a=(0,Qt.Bd)(),i=w(e=>e.wallet.trueDecimal);return(0,r.jsxs)("div",{className:"flex items-center gap-10 rounded-16 bg-white-10 py-5 pl-5 pr-15",children:[(0,r.jsx)("div",{className:"flex h-34 w-34 items-center justify-center rounded-8 bg-white-10",children:(0,r.jsx)(mr,{className:Ht()("h-16 w-16 opacity-60",!t&&"rotate-180")})}),(0,r.jsx)("div",{className:"min-w-0 flex-1",children:(0,r.jsx)("span",{className:"text-medium-med",children:a(hr[e.subType].key,hr[e.subType].label)})}),(0,r.jsxs)("div",{className:Ht()("text-medium-bold flex shrink-0 items-center gap-6",t?"text-[#77DA29]":"text-white opacity-60"),children:[t&&(0,r.jsx)("span",{children:"+"}),!t&&(0,r.jsx)("span",{children:"-"}),(0,r.jsx)(xa,{className:Ht()("h-16 w-16",t?"text-[#77DA29]":"text-white")}),se.bp.formatCash(e.amount,{showCurrency:!1,customDecimals:i,roundUp:!0})]})]})},gr=()=>{const e=(0,Qt.Bd)(),t=b(),a=w(e=>e.transaction.transactions),i=w(e=>e.transaction.apiTransactions.isPending),n=w(ae),s=w(e=>e.transaction.hasMore),o=w(e=>e.transaction.currentPage),l=(0,g.useRef)(null),d=i||!n;return(0,g.useEffect)(()=>{if(!s||d)return;const e=l.current;if(!e)return;const a=new IntersectionObserver(e=>{e[0].isIntersecting&&n&&t(Pt({page:o+1}))},{threshold:0});return a.observe(e),()=>a.disconnect()},[s,d,o]),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("h2",{className:"title-h2-bold text-white",children:e("LOBBY.015","History")}),!d&&0===a.length&&(0,r.jsx)("div",{className:"flex h-56 flex-col items-center justify-center rounded-12 bg-white-6 p-12 text-center",children:(0,r.jsx)("div",{className:"text-medium-reg opacity-60",children:e("LOBBY.016","There are no transactions yet")})}),a.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[a.filter(e=>"completed"===e.status).map(e=>(0,r.jsx)(fr,{transaction:e},e.transactionId)),s&&(0,r.jsx)("div",{ref:l,className:"h-1"})]}),d&&(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)(Zt.k,{className:"!mb-20 !mt-5 !h-17 !w-17 !p-2"})})]})};var vr=a(5894),xr=a(3372),br=a(3654),wr=a(7263);const yr=({children:e,onClose:t=null,fullScreen:a=!1,background:i=null,modalName:n="promoLobby"})=>{const s=w(e=>e.modals.current.at(-1)||null),o=(0,Gt.GV)(e=>!!e.modals.current.length),l=(0,Gt.GV)(e=>e.viewPort.userAgent.browser.isSafari),d=(0,g.useRef)(null),c=l?{isolation:"isolate",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden"}:void 0,p=()=>{s===n&&t&&(se.VH.emit("button:clicked",{name:"modalClose",value:n}),t())};return(0,br.Ls)([d],p,!o),(0,br.dD)("Escape",p,!o),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Ht()("fixed inset-0 -right-1 bottom-39 bg-brand-black opacity-75",vr.T.modal),style:c}),(0,r.jsx)("div",{className:Ht()("fixed -left-1 -right-1 bottom-0 h-40 bg-brand-black",vr.T.modal),style:c}),(0,r.jsx)("div",{className:"shadow-general-modals",children:(0,r.jsxs)("div",{ref:d,"data-testid":(0,xr.j)(`${n}-modal`),className:Ht()("promo-lobby-modal-gradient-border bg-brand-black-95 fixed bottom-40 left-0 right-0 flex w-full flex-col items-center overflow-hidden rounded-t-20",a&&["top-40 bg-white-6-gradient ml:top-20"],!a&&["max-h-[calc(100%-40px-20px)]"],vr.T.modal),style:c,children:[e,i&&(0,r.jsx)(wr.o,{src:ba.f.get(i),from:"from-main-ui-bleached-06",className:"!absolute left-1/2 top-1/2 z-[-1] size-1000 min-w-1000 -translate-x-1/2 -translate-y-1/2 opacity-20"})]})})]})},jr=({children:e,hasShadow:t=!1,className:a="",scrollbarInsetTop:i=0,scrollbarInsetBottom:n=0})=>{const s=w(e=>e.promoLobby.activeScreen),o=w(e=>e.promoLobby.topBarScreen),l=(0,Gt.GV)(e=>e.viewPort.style.scale),d=(0,g.useRef)(null),c=(0,g.useRef)(null),p=(0,g.useRef)(null),[u,m]=(0,g.useState)(0),[h,f]=(0,g.useState)(0),[v,x]=(0,g.useState)(0),[b,y]=(0,g.useState)(!1),j=(0,g.useRef)(0),D=h-u<1;function C(){if(c.current&&d.current){const e=c.current.clientHeight,t=d.current.clientHeight;if(e>t){const a=Math.max(0,i),r=Math.max(0,n),s=Math.max(0,t-a-r);f(e-t);const o=s>0?s*t/e:0;x(Math.min(s,o)),y(s>0)}else y(!1),m(0)}}const z=`${s}-${null!=o?o:"null"}`,N=(0,g.useRef)(z);(0,g.useEffect)(()=>{b&&N.current!==z&&(m(0),N.current=z),N.current=z},[b,z]),(0,g.useEffect)(()=>{if(b){const e=e=>{e.preventDefault(),e.stopPropagation()};return document.addEventListener("wheel",e,{passive:!1}),()=>{document.removeEventListener("wheel",e)}}},[b]),(0,_a.st)(C,0,c),(0,g.useEffect)(()=>{b&&u>=c.current.scrollHeight-d.current.clientHeight&&m(c.current.clientHeight-d.current.clientHeight)},[v,b,u]);const E=e=>{const t=d.current;if(!t)return;const a=t.getBoundingClientRect(),r=Math.max(0,i),s=Math.max(0,n),o=Math.max(0,t.clientHeight-r-s),c=Math.max(0,o-v);if(0===c)return;let p=(e.clientY-a.top)/l-r-j.current;p=Math.max(0,Math.min(p,c)),m(p/c*h)},S=()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",S)};return(0,r.jsxs)("div",{ref:d,className:Ht()("relative h-full w-full touch-none overflow-hidden scroll-smooth",a),onWheel:e=>{if(C(),b){const t=u+e.deltaY;m(Math.max(0,Math.min(t,h)))}},onTouchStart:e=>{if(C(),b){const t=e.touches[0].clientY;d.current.dataset.touchStartY=(t/l).toString()}},onTouchMove:e=>{if(C(),b){const t=d.current,a=parseFloat(t.dataset.touchStartY||"0"),r=e.touches[0].clientY,i=u+(a-r/l);m(Math.max(0,Math.min(i,h))),t.dataset.touchStartY=(r/l).toString()}},children:[(0,r.jsx)("div",{ref:c,className:"custom-scroll-content relative scroll-smooth will-change-transform",style:{transform:`translateY(-${u}px)`,transition:"none"},children:e}),t&&(0,r.jsx)("div",{className:Ht()("bg-surface-gradient pointer-events-none absolute -bottom-10 left-0 z-2 h-104 w-full",D?"transition-opacity duration-300":"transition-none"),style:{opacity:D?0:1}}),b&&(0,r.jsx)("div",{ref:p,className:"absolute right-6 top-0 w-3 cursor-pointer rounded-3 bg-white-20 md:right-11",style:{height:`${v}px`,transform:(()=>{var e;const t=(null===(e=d.current)||void 0===e?void 0:e.clientHeight)||0,a=Math.max(0,i),r=Math.max(0,n),s=Math.max(0,t-a-r),o=Math.max(0,s-v);return`translateY(${a+(o>0?o*u/h:0)}px)`})()},onMouseDown:e=>{e.preventDefault();const t=d.current,a=p.current;if(!t||!a)return;const r=a.getBoundingClientRect();j.current=(e.clientY-r.top)/l,document.addEventListener("mousemove",E),document.addEventListener("mouseup",S)}})]})},Dr=({children:e,className:t="",contentClassName:a="",scrollbarInsetTop:i=null,scrollbarInsetBottom:n=null})=>(0,r.jsx)(jr,{scrollbarInsetTop:i,scrollbarInsetBottom:n,className:Ht()("w-full flex-1",t),children:(0,r.jsx)("div",{className:Ht()("mx-auto max-w-560 px-15 ml:px-0",a),children:e})}),Cr=({children:e,className:t=""})=>(0,r.jsx)("div",{className:Ht()("bg-brand-black-95 w-full px-16 pb-14 ml:pb-6",t),children:e});var zr=a(6629),Nr=a(5529),Er=a(3277),Sr=a(2306);const Pr=({children:e,onReturn:t=null,onClose:a=null,returnType:i="back",modalName:n="promoLobby",classes:s={closeButton:"",returnButton:""}})=>{const o=!!(0,Gt.GV)(e=>e.session.urls.lobby),l=(0,Gt.GV)(e=>e.app.urlParams.isHomeButtonDisabled),d=t&&("back"===i||"home"===i&&o&&!l);return(0,r.jsxs)("div",{className:"relative w-full px-60",children:[d&&(0,r.jsx)(Sr.K,{"data-testid":"return-button",icon:"home"===i?Er.A:zr.A,className:Ht()("absolute left-8 top-8 z-1",null==s?void 0:s.returnButton),onClick:e=>{"home"!==i&&se.VH.emit("button:clicked",{name:"return"}),t(e)}}),e,a&&(0,r.jsx)(Sr.K,{"data-testid":"close-button",icon:Nr.A,className:Ht()("absolute right-8 top-8 z-1",null==s?void 0:s.closeButton),onClick:e=>{e.stopPropagation(),se.VH.emit("button:clicked",{name:"modalClose",value:n}),a()}})]})},kr=({children:e,onClose:t=null,background:a=null,modalName:i="promoLobby"})=>{const n=w(e=>e.modals.current.at(-1)||null),s=(0,Gt.GV)(e=>!!e.modals.current.length),o=(0,g.useRef)(null),l=()=>{n===i&&t&&!s&&(se.VH.emit("button:clicked",{name:"modalClose",value:i}),t())};return(0,br.Ls)([o],l,!s),(0,br.dD)("Escape",l,!s),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:Ht()("fixed inset-0 -right-1 bottom-0",vr.T.modal),style:{background:"radial-gradient(107.99% 100% at 50% 0%, rgba(13, 242, 193, 0.1) 0%, rgba(0, 0, 0, 0.05) 50%, rgba(8, 8, 8, 0.00) 100%), var(--colors-brand-black)"}}),(0,r.jsx)("div",{className:"shadow-general-modals",children:(0,r.jsxs)("div",{ref:o,"data-testid":(0,xr.j)(`${i}-modal`),className:Ht()("fixed bottom-0 left-0 right-0 top-0 flex w-full flex-col items-center overflow-hidden rounded-t-0",vr.T.modal),children:[a&&(0,r.jsx)("div",{className:"absolute left-0 top-0 h-full w-full",children:(0,r.jsx)("img",{className:"h-full w-full object-cover object-center ml:scale-[1.5]",src:ba.f.get(a),alt:""})}),e,(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:l,className:"fixed bottom-0 left-0 right-0 h-40 w-full cursor-default"}),(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:l,className:"fixed left-0 right-0 top-0 h-20 w-full cursor-default"})]})})]})};const Rr=({campaignId:e,prizeId:t,dropId:a})=>(r,i)=>{return n=void 0,s=void 0,l=function*(){r(qe({campaignId:e,prizeId:t,dropId:a})).unwrap().then(()=>{var e,t,n,s;r(F(a)),r($(a));const o=i().prizeDrop.rewardHubDrops.find(e=>e.dropId===a),l=null!==(s=null===(n=null===(t=null===(e=null==o?void 0:o.prize)||void 0===e?void 0:e.configTrue)||void 0===t?void 0:t.amount)||void 0===n?void 0:n.value)&&void 0!==s?s:0;l>0&&(r(K(l)),r(Et({amount:l,dropId:a}))),r(ft(a)),i().wallet.isWalletAvailable&&r(Pt({page:1}))}).catch(e=>{se.vF.error(e)})},new((o=void 0)||(o=Promise))(function(e,t){function a(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o(function(e){e(i)})).then(a,r)}i((l=l.apply(n,s||[])).next())});var n,s,o,l},Or=e=>!!e&&new Date(e).getTime()<=Date.now(),Ir=()=>{var e,t,a,i,n;const s=(0,Gt.GV)(_a.uB),o=w(e=>e.prizeDrop.winDropItem),l=w(e=>e.prizeDrop.apiClaim),d=w(e=>e.modals.current.includes("promoLobby")),c=w(e=>e.promoLobby.activeScreen),p=w(e=>e.promoLobby.topBarScreen),{isPending:u,data:v,error:x}=l,y=w(e=>e.wallet.trueDecimal),j=w(re),D="number"==typeof j&&j>0,[C,z]=(0,g.useState)(!1),N=(0,Qt.Bd)(),E=b(),S=()=>{se.h$.emit("reward:expired",(0,ne.rx)(o,"expired")),E(st({dropId:o.dropId,claimUiStatus:"expired"})),E($(o.dropId)),E(ft(o.dropId)),E(ht()),E(je("prizeDropClaimed")),E(ye("prizeDropClaimedExpired"))};(0,g.useEffect)(()=>{se.h$.emit("pdModalWinTrue:opened",(0,ne.ym)(o))},[o]),(0,g.useEffect)(()=>{z(!1)},[o.dropId]),(0,g.useEffect)(()=>{if(v&&C&&(se.h$.emit("reward:claimSuccess",(0,ne.rx)(o,"claimed")),E(st({dropId:o.dropId,claimUiStatus:"success"})),E(je("prizeDropClaimed")),E(ye("prizeDropClaimedSuccess")),E(ht())),x&&!u&&C){if(Or(o.expiresAt))return void S();se.h$.emit("reward:claimFailed",Object.assign(Object.assign({},(0,ne.rx)(o,"new")),{error_code:x.name})),E(st({dropId:o.dropId,claimUiStatus:"error"})),E(je("prizeDropClaimed")),E(ye("prizeDropClaimedFailed"))}},[C,v,E,x,u,o.dropId,o.expiresAt]);const P=()=>{u||(se.h$.emit("pdModalWinDrop:closed",(0,ne.ym)(o)),d&&"true-world"===c&&null===p&&E(F(o.dropId)),E(zt("prizeDropClaimed")))};return(0,r.jsxs)(yr,{modalName:"prizeDropClaimed",onClose:P,children:[s&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:ba.f.get(h),alt:"event"}),!s&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:ba.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropClaimed",onClose:P,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Dr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)("img",{className:"h-74 w-140 ml:h-64 ml:w-121",src:ba.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:N("DROP.018","Congratulations!")}),(0,r.jsx)("div",{className:"title-h3-bold",children:N("DROP.072","You've won a prize")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ma,{className:"h-28 w-28"}),(0,r.jsxs)(fa,{variant:"promo",children:[se.bp.formatCash(null===(t=null===(e=o.prize.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value,{showCurrency:!1,customDecimals:y,roundUp:!0})," "]})]}),D&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",se.bp.formatCash((null!==(n=null===(i=null===(a=o.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value)&&void 0!==n?n:0)/j,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:N("DROP.070","Claim your prize to have it credited to your account")})]}),(0,r.jsx)(ea,{text:N("LOBBY.008","Claim"),loadingText:N("LOBBY.036","Pending"),isLoading:u,className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:()=>{if(z(!0),Or(o.expiresAt))return(0,L.yy)(300),void S();E(Rr({campaignId:o.campaignId,prizeId:o.prize.prizeId,dropId:o.dropId}))},disabled:u})]})})]})};var Br;function Lr(){return Lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Lr.apply(null,arguments)}const _r=e=>g.createElement("svg",Lr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 22 22"},e),Br||(Br=g.createElement("path",{fill:"#fff",d:"M13.024 13.024a.75.75 0 0 0 .474-1.423l-.237.711zm-1.732-1.368h-.75c0 .323.207.61.513.712zm.75-2.744a.75.75 0 0 0-1.5 0h1.5m1.219 3.4.237-.711-1.969-.656-.237.711-.237.712 1.969.656zm-1.969-.656h.75V8.912h-1.5v2.744zm5.25-.656h-.75a4.5 4.5 0 0 1-4.5 4.5V17a6 6 0 0 0 6-6zm-5.25 5.25v-.75a4.5 4.5 0 0 1-4.5-4.5h-1.5a6 6 0 0 0 6 6zM6.042 11h.75a4.5 4.5 0 0 1 4.5-4.5V5a6 6 0 0 0-6 6zm5.25-5.25v.75a4.5 4.5 0 0 1 4.5 4.5h1.5a6 6 0 0 0-6-6z"}))),Mr=()=>{var e,t,a,i,n;const s=(0,Gt.GV)(_a.uB),o=w(e=>e.prizeDrop.winDropItem),l=w(e=>e.wallet.trueDecimal),d=w(re),c="number"==typeof d&&d>0,p=(0,Qt.Bd)(),u=b();(0,g.useEffect)(()=>{se.h$.emit("pdModalClaimExpired:opened")},[]),(0,g.useEffect)(()=>{},[]);const f=()=>{se.h$.emit("pdModalClaimExpired:closed"),u(zt("prizeDropClaimedExpired"))};return(0,r.jsxs)(yr,{modalName:"prizeDropClaimedExpired",onClose:f,children:[s&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:ba.f.get(h),alt:"event"}),!s&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:ba.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropClaimedExpired",onClose:f,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Dr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(_r,{className:"bg-add-gradient h-74 w-74 rounded-full ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:p("DROP.077","Reward expired")}),(0,r.jsx)("div",{className:"title-h3-bold",children:p("DROP.078","Time is up")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ma,{className:"h-28 w-28"}),(0,r.jsxs)(fa,{variant:"promo",children:[se.bp.formatCash(null===(t=null===(e=o.prize.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value,{showCurrency:!1,customDecimals:l,roundUp:!0})," "]})]}),c&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",se.bp.formatCash((null!==(n=null===(i=null===(a=o.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value)&&void 0!==n?n:0)/d,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:p("DROP.079","Unfortunately, the reward expiration time has ended.")})]}),(0,r.jsx)(Xt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:f,children:p("GEN.220","Close")})]})})]})},Tr=({t:e,error:t,fallbackKey:a,fallbackMessage:r})=>{var i,n;return(null==t?void 0:t.code)?e(null!==(i=t.languageKey)&&void 0!==i?i:"",null!==(n=t.message)&&void 0!==n?n:r):e(a,r)},Ar=()=>{var e,t,a,i,n;const s=(0,Gt.GV)(_a.uB),o=w(e=>e.prizeDrop.winDropItem),l=w(e=>e.prizeDrop.apiClaim),{isPending:d,data:c,error:p}=l,u=w(e=>e.wallet.trueDecimal),f=w(re),v="number"==typeof f&&f>0,x=(0,Qt.Bd)(),y=b();(0,g.useEffect)(()=>{se.h$.emit("pdModalClaimFailed:opened")},[]),(0,g.useEffect)(()=>{c&&o&&(y(st({dropId:o.dropId,claimUiStatus:"success"})),y(je("prizeDropClaimedFailed")),y(ye("prizeDropClaimedSuccess")),y(ht()))},[c,y,o]);const j=()=>{d||(se.h$.emit("pdModalClaimFailed:closed"),y(zt("prizeDropClaimedFailed")))};return(0,r.jsxs)(yr,{modalName:"prizeDropClaimedFailed",onClose:j,children:[s&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:ba.f.get(h),alt:"event"}),!s&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:ba.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropClaimedFailed",onClose:j,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Dr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(Aa.A,{className:"bg-add-gradient h-74 w-74 rounded-full ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:x("DROP.074","Claim failed")}),(0,r.jsx)("div",{className:"title-h3-bold",children:x("DROP.075","Something went wrong")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ma,{className:"h-28 w-28"}),(0,r.jsxs)(fa,{variant:"promo",children:[se.bp.formatCash(null===(t=null===(e=o.prize.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value,{showCurrency:!1,customDecimals:u,roundUp:!0})," "]})]}),v&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",se.bp.formatCash((null!==(n=null===(i=null===(a=o.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value)&&void 0!==n?n:0)/f,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:Tr({t:x,error:p,fallbackKey:"DROP.076",fallbackMessage:"We couldn't process your request. Please try again later."})})]}),(0,r.jsx)(ea,{text:x("DROP.017","Try Again"),loadingText:x("LOBBY.036","Pending"),isLoading:d,className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:()=>{d||y(Rr({campaignId:o.campaignId,prizeId:o.prize.prizeId,dropId:o.dropId}))},disabled:d})]})})]})};var Fr=a(598);const Ur=()=>{var e,t,a,i,n;const s=(0,Gt.GV)(_a.uB),o=w(e=>e.prizeDrop.winDropItem),l=w(e=>e.wallet.trueDecimal),d=w(re),c="number"==typeof d&&d>0,p=(0,Qt.Bd)(),u=b();(0,g.useEffect)(()=>{se.h$.emit("pdModalClaimSuccess:opened")},[]);const f=()=>{se.h$.emit("pdModalClaimSuccess:closed"),u(zt("prizeDropClaimedSuccess"))};return(0,r.jsxs)(yr,{modalName:"prizeDropClaimedSuccess",onClose:f,children:[s&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:ba.f.get(h),alt:"event"}),!s&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:ba.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropClaimedSuccess",onClose:f,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Dr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)(Fr.A,{className:"h-74 w-74 rounded-full bg-green ml:h-64 ml:w-64"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:p("DROP.071","Reward claimed")}),(0,r.jsx)("div",{className:"title-h3-bold",children:p("DROP.072","You’ve won a prize")})]}),(0,r.jsxs)("div",{className:"text-prize-drop",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(ma,{className:"h-28 w-28"}),(0,r.jsxs)(fa,{variant:"promo",children:[se.bp.formatCash(null===(t=null===(e=o.prize.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value,{showCurrency:!1,customDecimals:l,roundUp:!0})," "]})]}),c&&(0,r.jsxs)("span",{className:"text-medium-reg opacity-60 text-shadow",children:["~"," ",se.bp.formatCash((null!==(n=null===(i=null===(a=o.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value)&&void 0!==n?n:0)/d,{roundUp:!0})]})]}),(0,r.jsx)("div",{className:"text-medium-reg",children:p("DROP.073","The reward has been successfully credited to your balance.")})]}),(0,r.jsx)(Xt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:f,children:p("GEN.220","OK")})]})})]})},$r=()=>{var e,t,a,i,n,s,o,l,d;const c=(0,Gt.GV)(_a.uB),p=w(e=>e.prizeDrop.winDropItem),u=(0,Qt.Bd)(),v=b();(0,g.useEffect)(()=>{se.h$.emit("pdModalWinDrop:opened",(0,ne.ym)(p))},[p]);const x=()=>{se.h$.emit("pdModalWinDrop:closed",(0,ne.ym)(p)),v(zt("prizeDropCongratulation"))};return(0,r.jsxs)(yr,{modalName:"prizeDropCongratulation",onClose:x,children:[c&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:ba.f.get(h),alt:"event"}),!c&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:ba.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropCongratulation",onClose:x,classes:{closeButton:"!top-6 ml:!top-1 !right-6 ml:!right-8"},children:(0,r.jsx)("div",{})}),(0,r.jsx)(Dr,{children:(0,r.jsxs)("div",{className:"mx-15 max-w-604 py-30 ml:mx-auto ml:py-20 ml:pt-14",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-12 px-50 pb-22 text-center ml:gap-10 ml:pb-16",children:[(0,r.jsx)("img",{className:"h-74 w-140 ml:h-64 ml:w-121",src:ba.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h1-bold",children:u("DROP.018","Congratulations!")}),(0,r.jsx)("div",{className:"title-h3-bold",children:u("DROP.019","You’ve won a cash prize")})]}),(0,r.jsx)("div",{className:"text-prize-drop",children:(0,r.jsxs)(fa,{variant:"promo",children:[se.bp.formatCash(null===(a=null===(t=null===(e=null==p?void 0:p.prize)||void 0===e?void 0:e.configCash)||void 0===t?void 0:t.amount)||void 0===a?void 0:a.value,{showCurrency:!1,customDecimals:null===(s=null===(n=null===(i=null==p?void 0:p.prize)||void 0===i?void 0:i.configCash)||void 0===n?void 0:n.amount)||void 0===s?void 0:s.decimals,roundUp:!0})," ",null===(d=null===(l=null===(o=null==p?void 0:p.prize)||void 0===o?void 0:o.configCash)||void 0===l?void 0:l.amount)||void 0===d?void 0:d.currency]})}),(0,r.jsx)("div",{className:"text-medium-reg",children:u("DROP.020","Instantly credited to your account.")})]}),(0,r.jsx)(Xt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),x()},children:u("DROP.021","Great news!")})]})})]})},Yr=()=>{const{apiJoinCampaign:e}=w(e=>e.prizeDrop),{campaignId:t}=w(e=>e.prizeDrop.displayedCampaign),a=b(),i=(0,Qt.Bd)();(0,g.useEffect)(()=>{se.h$.emit("pdModalJoinError:opened")},[]),((t,r)=>{const i=(0,g.useRef)(!1);(0,g.useEffect)(()=>{if(i.current)return e.data&&(e.data.joined?(se.h$.emit("pdModalJoinError:successRetry"),a(ye("prizeDropSuccess")),a(je("prizeDropJoinError")),a(pt()),a(Xe())):(se.h$.emit("pdModalJoinError:unsuccessfulRetry"),a(ye("prizeDropJoinError")))),void(e.error&&(se.h$.emit("pdModalJoinError:unsuccessfulRetry"),a(ye("prizeDropJoinError"))))},r),(0,g.useEffect)(()=>{i.current=!0},[])})(0,[e]);const n=()=>{e.isPending||(se.h$.emit("pdModalJoinError:closed"),a(Ct("prizeDropJoinError")),a(pt()))};return(0,r.jsxs)(yr,{onClose:n,modalName:"prizeDropJoinError",children:[(0,r.jsx)(Pr,{onClose:n,returnType:"home",modalName:"prizeDropJoinError",children:(0,r.jsx)("div",{className:"title-h1-bold pb-18 pt-25 text-center uppercase ml:pt-19",children:i("DROP.015","Oops")})}),(0,r.jsx)(Dr,{children:(0,r.jsxs)("div",{className:"mx-auto flex max-w-604 select-text flex-col items-center gap-18 px-14 pb-30 ml:px-0 ml:pb-31",children:[(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-medium-reg mb-2",children:Tr({t:i,error:e.error,fallbackKey:"DROP.016",fallbackMessage:"Something's wrong... Please try again."})})}),(0,r.jsx)(ea,{text:i("DROP.017","Try Again"),loadingText:i("DROP.011","Joining..."),className:"w-full max-w-354 !bg-brand-gradient",isLoading:e.isPending,onClick:e=>{e.stopPropagation(),se.VH.emit("button:clicked",{name:"service"}),a(ar({campaignId:t})),se.h$.emit("pdModalJoinError:startRetry")}})]})})]})};var Vr;function Gr(){return Gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Gr.apply(null,arguments)}const Wr=e=>g.createElement("svg",Gr({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 9 8"},e),Vr||(Vr=g.createElement("path",{fill:"#FC0",d:"m4.5 0 1.08 2.92L8.5 4 5.58 5.08 4.5 8 3.42 5.08.5 4l2.92-1.08z"}))),Hr=()=>{var e,t,a,i,n,s,o,l,d,c;const p=(0,Gt.GV)(_a.uB),{dateStart:u,dateEnd:v,betAmount:x,prizesTotalCount:y,campaignId:j,texts:D}=w(e=>e.prizeDrop.displayedCampaign),{apiJoinCampaign:C}=w(e=>e.prizeDrop),z=w(bt),N=w(e=>e.wallet.trueDecimal),E=(0,Qt.Bd)(),S=b();(0,g.useEffect)(()=>{se.h$.emit("pdModalLive:opened")},[]),(0,g.useEffect)(()=>{C.data&&(C.data.joined?(se.h$.emit("pdModalLive:joinSuccess"),S(dt()),S(ye("prizeDropSuccess")),S(Ct("prizeDropLive")),S(Xe())):(se.h$.emit("pdModalLive:joinError"),S(ye("prizeDropJoinError")),S(je("prizeDropLive")))),C.error&&(se.h$.emit("pdModalLive:joinError"),S(ye("prizeDropJoinError")),S(je("prizeDropLive")))},[C]);const P=()=>{C.isPending||(se.h$.emit("pdModalLive:later"),S(Ct("prizeDropLive")))};return(0,r.jsxs)(yr,{modalName:"prizeDropLive",onClose:P,children:[(0,r.jsx)(Pr,{modalName:"prizeDropLive",onClose:P,children:(0,r.jsx)("div",{})}),(0,r.jsxs)(Dr,{scrollbarInsetTop:56,children:[p&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:ba.f.get(h),alt:"event"}),!p&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:ba.f.get(m),alt:"event"}),(0,r.jsx)("div",{className:"mx-auto max-w-604 pt-30 ml:pt-25",children:(0,r.jsxs)("div",{className:"flex flex-col gap-16 px-15 pb-22 text-center ml:px-0 ml:pb-18",children:[(0,r.jsxs)("div",{className:"relative flex w-full flex-col items-center gap-11 text-center ml:gap-10",children:[(0,r.jsx)(qt,{prizeDropMode:"live",className:"absolute -top-5 left-1/2 translate-x-22"}),(0,r.jsx)("img",{className:"h-74 w-140",src:ba.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:(null==D?void 0:D.title)||E("DROP.001","Prize drop event is live!")}),(0,r.jsx)("div",{className:"text-medium-reg",children:(null==D?void 0:D.description)||E("DROP.002","Spin and win amazing prizes instantly!")})]})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-11 rounded-14 bg-white-6 px-20 pb-22 pt-20 ml:gap-10",children:[(0,r.jsx)(Ca,{}),(0,r.jsxs)("div",{className:"text-medium-reg flex flex-col gap-2 pl-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Wr,{width:8,height:8})}),(0,r.jsxs)("div",{children:[E("DROP.004","Total prize count:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:y})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Wr,{width:8,height:8})}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[E("DROP.005","Top prize:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:"true"===(null==z?void 0:z.type)?(0,r.jsxs)("div",{children:[se.bp.formatCash(null!==(a=null===(t=null===(e=null==z?void 0:z.configTrue)||void 0===e?void 0:e.amount)||void 0===t?void 0:t.value)&&void 0!==a?a:0,{showCurrency:!1,customDecimals:N,roundUp:!0})," $TRUE"]}):(0,r.jsx)("div",{children:se.bp.formatCash(null!==(s=null===(n=null===(i=null==z?void 0:z.configCash)||void 0===i?void 0:i.amount)||void 0===n?void 0:n.value)&&void 0!==s?s:0,{customCurrency:null===(l=null===(o=null==z?void 0:z.configCash)||void 0===o?void 0:o.amount)||void 0===l?void 0:l.currency,customDecimals:null===(c=null===(d=null==z?void 0:z.configCash)||void 0===d?void 0:d.amount)||void 0===c?void 0:c.decimals,roundUp:!0})})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Wr,{width:8,height:8})}),(0,r.jsxs)("div",{children:[E("DROP.006","Min. bet to participate:")," ",(0,r.jsx)("span",{className:"text-medium-bold",children:se.bp.formatCash(x)})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-7 text-left",children:[(0,r.jsx)("div",{children:(0,r.jsx)(Wr,{width:8,height:8})}),(0,r.jsxs)("div",{children:[E("DROP.007","Every qualified bet can win")," 🚀"]})]})]})]}),(0,r.jsx)(ka,{dateStart:u,dateEnd:v,className:"text-medium-bold mt-0 flex items-center justify-center"})]})})]}),(0,r.jsx)(Cr,{className:"!pb-30 ml:!pb-10",children:(0,r.jsxs)("div",{className:"mx-auto flex w-full max-w-560 gap-14 px-14 ml:gap-10 ml:px-0",children:[(0,r.jsx)(Xt.$,{className:"!min-w-170 flex-1",onClick:e=>{e.stopPropagation(),P()},variant:"secondary",children:E("DROP.009","Later")}),(0,r.jsx)(ea,{text:E("DROP.010","Join now"),loadingText:E("DROP.011","Joining..."),isLoading:C.isPending,onClick:()=>{se.h$.emit("pdModalLive:startJoin"),S(ar({campaignId:j}))},className:"text-medium-bold !min-w-170 flex-1 !bg-brand-gradient"})]})})]})},Jr=()=>{const e=(0,Gt.GV)(_a.uB),t=(0,Qt.Bd)(),a=b();(0,g.useEffect)(()=>{se.h$.emit("pdModalEventCancelled:opened")},[]);const i=()=>{se.h$.emit("pdModalEventCancelled:closed"),a(je("prizeDropResultCancelled"))};return(0,r.jsxs)(yr,{modalName:"prizeDropResultCancelled",onClose:i,children:[e&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:ba.f.get(h),alt:"event"}),!e&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:ba.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropResultCancelled",onClose:i,children:(0,r.jsx)("div",{})}),(0,r.jsx)(Dr,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-604 py-30 ml:pb-20 ml:pt-25",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-10 px-50 pb-22 text-center ml:pb-18",children:[(0,r.jsx)("img",{className:"h-74 w-140",src:ba.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:t("DROP.022","Event cancelled")}),(0,r.jsx)("div",{className:"text-medium-reg",children:`${t("DROP.023","The current event has been cancelled. Stay tuned for new events ")} 🚀`})]})]}),(0,r.jsx)(Xt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),i()},children:t("DROP.014","OK")})]})})]})},Kr=()=>{const e=(0,Gt.GV)(_a.uB),t=(0,Qt.Bd)(),a=b();(0,g.useEffect)(()=>{se.h$.emit("pdModalEventEnded:opened")},[]);const i=()=>{se.h$.emit("pdModalEventEnded:closed"),a(je("prizeDropResultFinished"))};return(0,r.jsxs)(yr,{modalName:"prizeDropResultFinished",onClose:i,children:[e&&(0,r.jsx)("img",{className:"absolute left-0 right-0 top-0 w-full",src:ba.f.get(h),alt:"event"}),!e&&(0,r.jsx)("img",{className:"absolute left-1/2 right-0 top-0 max-w-620 -translate-x-1/2",src:ba.f.get(m),alt:"event"}),(0,r.jsx)(Pr,{modalName:"prizeDropResultFinished",onClose:i,children:(0,r.jsx)("div",{})}),(0,r.jsx)(Dr,{children:(0,r.jsxs)("div",{className:"mx-auto max-w-604 py-30 ml:pb-20 ml:pt-25",children:[(0,r.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-10 px-50 pb-22 text-center ml:pb-18",children:[(0,r.jsx)("img",{className:"h-74 w-140",src:ba.f.get(f),alt:"event"}),(0,r.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,r.jsx)("div",{className:"title-h2-bold",children:t("DROP.024","Event ended")}),(0,r.jsx)("div",{className:"text-medium-reg",children:`${t("DROP.025","The current event is over. Stay tuned for new events")} 🚀`})]})]}),(0,r.jsx)(Xt.$,{className:"mx-auto w-full max-w-354 !bg-brand-gradient ml:max-w-560",onClick:e=>{e.stopPropagation(),i()},children:t("DROP.014","OK")})]})})]})},Qr=()=>{const e=b(),t=(0,Qt.Bd)();(0,g.useEffect)(()=>{se.h$.emit("pdModalSuccess:opened")},[]);const a=()=>{se.h$.emit("pdModalSuccess:closed"),e(je("prizeDropSuccess"))};return(0,r.jsxs)(yr,{onClose:a,modalName:"prizeDropSuccess",children:[(0,r.jsx)(Pr,{onClose:a,returnType:"home",modalName:"prizeDropSuccess",children:(0,r.jsx)("div",{className:"mx-auto mt-25 flex h-46 w-46 items-center justify-center rounded-full bg-green",children:(0,r.jsx)(Fr.A,{className:"",width:46,height:46})})}),(0,r.jsx)(Dr,{children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-20 pb-30 pt-20",children:[(0,r.jsx)("h1",{className:"title-h1-bold",children:t("DROP.012","Success").toUpperCase()}),(0,r.jsx)("span",{className:"text-medium-reg",children:t("DROP.013","You have successfully joined the event!")}),(0,r.jsx)(Xt.$,{className:"w-full max-w-354 !bg-brand-gradient uppercase",onClick:e=>{e.stopPropagation(),a()},children:t("DROP.014","OK")})]})})]})},qr=()=>{const e=w(yt),t=(0,Qt.Bd)(),a=[{id:"events",title:t("DROP.027","Event")},{id:"rules",title:t("DROP.028","Rules")}],[i,n]=(0,g.useState)("events");return(0,r.jsxs)("div",{className:Ht()(e&&"!pb-64"),children:[(0,r.jsx)("div",{className:"mb-16 flex flex-col items-center",children:(0,r.jsx)(tr,{activeTab:i,setActiveTab:n,config:a})}),(0,r.jsx)("div",{className:"mx-auto",children:"events"===i?(0,r.jsx)(Ga,{}):(0,r.jsx)(er,{})})]})},Xr=()=>{const e=(0,Qt.Bd)(),t=e=>e.split(/(\$TRUE)/g).map((e,t)=>(0,r.jsx)("span",{className:"$TRUE"===e?"text-medium-bold text-white opacity-100":"opacity-60",children:e},`${e}-${t}`));return(0,r.jsxs)("div",{className:"mx-auto flex w-full flex-col items-center pb-28",children:[(0,r.jsx)("h2",{className:"w-340 text-28 font-black leading-[1.3] text-white",children:e("LOBBY.041","Welcome to TRUE World. Play. Earn. Unlock more.")}),(0,r.jsx)("div",{className:"h-322",children:(0,r.jsx)("img",{src:ba.f.get(s),alt:"true coin",className:"h-full object-cover object-center"})}),(0,r.jsxs)("div",{className:"text-medium-reg mx-auto max-w-340 text-white",children:[(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.042","TRUE World is your gateway to the next generation of rewards inside TRUE LABS games."))}),(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.043","As you play, you automatically earn $TRUE tokens through Prize Drops, leaderboard tournaments, and exclusive airdrops. No extra steps - just enjoy your favorite games and collect rewards."))}),(0,r.jsx)("p",{className:"mb-12",children:t(e("LOBBY.044","Your $TRUE tokens open the door to a growing universe of opportunities: trade collectibles on the Marketplace, stake tokens for added benefits, or explore new features across the TRUE World portal."))}),(0,r.jsx)("p",{children:t(e("LOBBY.045","Ownership of $TRUE is more than a bonus - it's your entry ticket to special events and tournaments, unique in-game content, and future perks across the entire TRUE ecosystem. You can even spend $TRUE on exclusive TRUE LABS merchandise and other real-world items."))})]})]})},Zr=()=>{const e=(0,Qt.Bd)();return(0,r.jsxs)("div",{className:"flex w-full flex-col items-center gap-16 pb-28",children:[(0,r.jsx)("img",{src:ba.f.get(n),alt:"coming soon",className:"h-310 w-414 max-w-none object-cover object-center"}),(0,r.jsxs)("div",{className:"flex w-340 flex-col items-center gap-6 text-center",children:[(0,r.jsx)("h2",{className:"title-h1-bold text-white",children:e("LOBBY.029","Your character's progress")}),(0,r.jsxs)("p",{className:"text-medium-reg text-white opacity-60",children:[e("LOBBY.030","Let your hero grow with every spin!"),(0,r.jsx)("br",{}),e("LOBBY.031","Tease your luck, uncover in-game secrets, and unlock real-world rewards.")]}),(0,r.jsx)("p",{className:"text-medium-bold text-white",children:e("LOBBY.032","Coming soon. Stay tuned!")})]})]})};var ei=a(6861),ti=a(454);const ai=({text:e,className:t=""})=>(0,r.jsxs)("div",{className:Ht()("relative flex min-w-290 items-center justify-center gap-12 rounded-8 bg-main-ui px-16 py-12 shadow-notify-modals",t),children:[(0,r.jsx)("div",{className:"absolute h-full w-full rounded-8 bg-white-10"}),(0,r.jsx)("div",{className:"bg-add-gradient flex min-h-22 min-w-22 shrink-0 items-center justify-center overflow-hidden rounded-full",children:(0,r.jsx)(_r,{className:"h-full w-full"})}),(0,r.jsx)("div",{className:"text-medium-med",children:e})]}),ri=(0,g.createContext)(null),ii=({children:e})=>{const[t,a]=(0,g.useState)(null),i=(0,g.useRef)(null),n=(0,g.useCallback)((e,t)=>{clearTimeout(i.current),a({type:e,text:t}),i.current=setTimeout(()=>{a(null)},1500)},[]),s=(0,g.useCallback)((e="Reward claimed")=>{n("success",e)},[n]),o=(0,g.useCallback)((e="Something went wrong")=>{n("failed",e)},[n]),l=(0,g.useCallback)((e="Unfortunately, the reward expiration time has ended.")=>{n("expired",e)},[n]),d=(0,g.useMemo)(()=>({showSuccessToast:s,showFailedToast:o,showExpiredToast:l}),[s,o,l]);return(0,r.jsxs)(ri.Provider,{value:d,children:[e,t&&(0,r.jsxs)("div",{className:"pointer-events-none fixed left-1/2 top-28 z-[71] min-w-290 -translate-x-1/2 text-wrap px-16",children:["success"===t.type&&(0,r.jsx)(ti.r,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"}),"expired"===t.type&&(0,r.jsx)(ai,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"}),"failed"===t.type&&(0,r.jsx)(ei.v,{text:t.text,className:"w-full !bg-brand-black shadow-notify-modals"})]})]})},ni=()=>{const e=(0,g.useContext)(ri);if(!e)throw new Error("usePromoLobbyToast must be used within PromoLobbyToastProvider");return e},si=e=>{if(!e)return"expired";const t=new Date(e).getTime()-Date.now();if(t<=0)return"expired";const a=Math.floor(t/36e5);return a<1?"lessThanHour":a},oi=({reward:e,onClaimRequested:t=()=>!0})=>{var a,i,n,s,o;const l=(0,Qt.Bd)(),c=b(),{showExpiredToast:p}=ni(),[u,m]=(0,g.useState)(()=>si(e.expiresAt)),h=w(e=>e.prizeDrop.apiClaim),{error:f}=h,[v,x]=(0,g.useState)(!1),y=w(e=>e.wallet.trueDecimal),j=w(re),D=!!(C=e.expiresAt)&&new Date(C).getTime()<=Date.now();var C;const z="number"==typeof j&&j>0;(0,g.useEffect)(()=>{if(!e.expiresAt)return;const t=()=>m(si(e.expiresAt)),a=setInterval(t,6e4);return t(),()=>clearInterval(a)},[e.expiresAt]),(0,g.useEffect)(()=>{f&&v&&x(!1)},[f,v]);const N=(0,g.useMemo)(()=>"expired"===u?l("LOBBY.035","Unfortunately, the reward expiration time has ended."):"lessThanHour"===u?l("LOBBY.038","expires in <1 hour"):1===u?l("LOBBY.038","expires in <1 hour").replace("<1","1"):l("LOBBY.009","expires in <HOURS> hours",{"<HOURS>":String(u)}),[u,l]),E=(0,g.useRef)(!1);return(0,g.useEffect)(()=>{D&&!E.current&&(E.current=!0,e.direct||se.h$.emit("reward:expired",(0,ne.rx)(e,"expired")),p(l("LOBBY.035","Unfortunately, the reward expiration time has ended.")),c($(e.dropId)),c(ft(e.dropId)))},[c,e,e.dropId,D,p,l]),D?null:(0,r.jsxs)("div",{className:"mt-12 flex items-center gap-10 border-b border-white-10 pb-12 first:pt-0 last:border-b-0 last:pb-0",children:[(0,r.jsx)("img",{className:"h-54 w-54",src:d,alt:"Reward"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-small-reg",children:l("LOBBY.007","Prizedrop reward")}),(0,r.jsxs)("div",{className:"title-h2-bold mt-2 flex items-center gap-4",children:[(0,r.jsx)(xa,{className:"h-16 w-16"}),se.bp.formatCash(null===(i=null===(a=e.prize.configTrue)||void 0===a?void 0:a.amount)||void 0===i?void 0:i.value,{showCurrency:!1,customDecimals:y,roundUp:!0})]}),z&&(0,r.jsxs)("div",{className:"text-xs-reg mt-1 opacity-70",children:["~",se.bp.formatCash((null!==(o=null===(s=null===(n=e.prize.configTrue)||void 0===n?void 0:n.amount)||void 0===s?void 0:s.value)&&void 0!==o?o:0)/j,{roundUp:!0})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-4",children:[(0,r.jsx)(ea,{size:"small",text:l("LOBBY.008","Claim"),loadingText:l("LOBBY.036","Pending"),isLoading:v,className:"!min-w-120 !bg-brand-gradient",onClick:()=>{t(e)&&(se.h$.emit("reward:claimClicked",(0,ne.rx)(e,"new")),x(!0),c(Rr({campaignId:e.campaignId,prizeId:e.prize.prizeId,dropId:e.dropId})))},disabled:D||v}),(0,r.jsx)("span",{className:"text-super-xs-reg text-center opacity-40",children:N})]})]})},li=()=>{const e=w(e=>e.prizeDrop.rewardHubDrops),t=w(e=>e.prizeDrop.apiClaim),{data:a,error:i}=t,n=(0,Qt.Bd)(),s=(0,g.useRef)(!1),o=(0,g.useRef)(null),{showSuccessToast:l,showFailedToast:d,showExpiredToast:c}=ni();(0,g.useEffect)(()=>{a&&s.current&&o.current&&(l(n("LOBBY.034","The reward has been successfully credited to your balance.")),se.h$.emit("reward:claimSuccess",(0,ne.rx)(o.current,"claimed")),s.current=!1,o.current=null)},[a,l,n]),(0,g.useEffect)(()=>{i&&s.current&&o.current&&(d(Tr({t:n,error:i,fallbackKey:"LOBBY.037",fallbackMessage:"Something went wrong. Please try again later."})),se.h$.emit("reward:claimFailed",Object.assign(Object.assign({},(0,ne.rx)(o.current,"new")),{error_code:i.name})),s.current=!1,o.current=null)},[i,d,c,n]);const p=e=>{return(t=e.expiresAt)&&new Date(t).getTime()<=Date.now()?(se.h$.emit("reward:expired",(0,ne.rx)(e,"expired")),c(n("LOBBY.035","Unfortunately, the reward expiration time has ended.")),!1):(s.current=!0,o.current=e,!0);var t};return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"flex w-full flex-col rounded-12 bg-white-10 p-16",children:[(0,r.jsx)("h2",{className:"title-h2-bold",children:n("LOBBY.002","Rewards Hub")}),e.map(e=>(0,r.jsx)(oi,{reward:e,onClaimRequested:p},e.dropId)),0===e.length&&(0,r.jsxs)("div",{className:"text-medium-reg mt-6 opacity-60",children:[n("LOBBY.003","Just play TRUE LABS games and unlock extra rewards")," 🎁"]})]})})},di=()=>{const e=b();return(0,g.useEffect)(()=>{e(nr())},[e]),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-16 pb-12",children:[(0,r.jsx)(li,{}),(0,r.jsx)(Xa,{})]})};const ci=()=>{const e=b(),t=!!w(e=>e.prizeDrop.restData),a=!!w(e=>{var t;return null===(t=e.transaction.apiTransactions.fake)||void 0===t?void 0:t.enabled}),r=w(ae),i=t||a;(0,g.useEffect)(()=>{i&&(e(St()),r&&e((e,t)=>{return a=void 0,r=void 0,n=function*(){t().wallet.isWalletAvailable&&e(Pt(void 0)).unwrap().catch(e=>{se.vF.error(e)})},new((i=void 0)||(i=Promise))(function(e,t){function s(e){try{l(n.next(e))}catch(e){t(e)}}function o(e){try{l(n.throw(e))}catch(e){t(e)}}function l(t){var a;t.done?e(t.value):(a=t.value,a instanceof i?a:new i(function(e){e(a)})).then(s,o)}l((n=n.apply(a,r||[])).next())});var a,r,i,n}),e(nr()))},[e,i,r])},pi=()=>(ci(),(0,r.jsxs)("div",{className:"flex flex-col gap-24",children:[(0,r.jsx)(Da,{}),(0,r.jsx)(gr,{})]})),ui=()=>{const e=w(e=>e.promoLobby.activeScreen),t=w(e=>e.promoLobby.topBarScreen);return(0,r.jsxs)(r.Fragment,{children:["info"===t&&(0,r.jsx)(Xr,{}),"profile"===t&&(0,r.jsx)(Zr,{}),"wallet"===t&&(0,r.jsx)(pi,{}),null===t&&(0,r.jsxs)(r.Fragment,{children:["true-world"===e&&(0,r.jsx)(di,{}),"campaign"===e&&(0,r.jsx)(qr,{})]})]})};var mi,hi,fi,gi,vi;function xi(){return xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},xi.apply(null,arguments)}function bi(){return bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},bi.apply(null,arguments)}function wi(){return wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},wi.apply(null,arguments)}function yi(){return yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},yi.apply(null,arguments)}function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ji.apply(null,arguments)}const Di={trueWorld:{title:"True World",icon:e=>g.createElement("svg",ji({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),vi||(vi=g.createElement("path",{fill:"#fff",d:"m27.844 15-9.866 9.88L8.11 15l9.867-9.879zM11.3 21.686l-2.466 2.47-2.467-2.47 2.467-2.47zM9.133 9.038l-3.488 3.493-3.489-3.493 3.489-3.493z"}))),screens:["true-world","campaign"],comingSoon:!1},trueGames:{title:"True Games",icon:e=>g.createElement("svg",yi({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),gi||(gi=g.createElement("path",{fill:"#fff",d:"M5.294 15a1.08 1.08 0 0 0 1.078 1.078h6.471A1.08 1.08 0 0 0 13.921 15V6.372a1.08 1.08 0 0 0-1.078-1.078h-6.47a1.08 1.08 0 0 0-1.08 1.078zm0 8.627a1.08 1.08 0 0 0 1.078 1.079h6.471a1.08 1.08 0 0 0 1.078-1.079v-4.313a1.08 1.08 0 0 0-1.078-1.079h-6.47a1.08 1.08 0 0 0-1.08 1.079zm10.784 0a1.08 1.08 0 0 0 1.079 1.079h6.47a1.08 1.08 0 0 0 1.079-1.079V15a1.08 1.08 0 0 0-1.079-1.079h-6.47A1.08 1.08 0 0 0 16.078 15zm1.079-18.333a1.08 1.08 0 0 0-1.079 1.078v4.314a1.08 1.08 0 0 0 1.079 1.079h6.47a1.08 1.08 0 0 0 1.079-1.079V6.372a1.08 1.08 0 0 0-1.079-1.078z"}))),screens:["true-games"],comingSoon:!0},tournaments:{title:"Tournaments",icon:e=>g.createElement("svg",wi({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),fi||(fi=g.createElement("path",{fill:"#fff",d:"M21.353 4.412v3.176h4.236q-.044 3.834-1.205 5.407l-.119.152q-.933 1.12-3.187 1.592a6.36 6.36 0 0 1-5.017 4.408l-.002.088a4.235 4.235 0 0 0 4.235 4.236v2.117H9.707v-2.117a4.235 4.235 0 0 0 4.236-4.236l-.003-.088a6.36 6.36 0 0 1-5.016-4.408q-2.254-.471-3.187-1.592-1.279-1.534-1.324-5.559h4.235V4.412zM15 6.529l-1.224 2.91-3.01.326 2.256 2.118-.64 3.117L15 13.399l2.618 1.6-.64-3.112 2.258-2.118-3.012-.326zM8.647 9.706H6.676l.023.152c.136.87.344 1.486.594 1.842l.07.091c.195.235.562.455 1.106.641l.178.056zm14.678 0h-1.972v2.782l.179-.056c.544-.186.91-.406 1.106-.64l.07-.091c.25-.357.458-.974.594-1.843z"}))),screens:["tournaments"],comingSoon:!0},quests:{title:"Quests",icon:e=>g.createElement("svg",xi({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),mi||(mi=g.createElement("path",{fill:"#fff",d:"M25.106 6.805a.53.53 0 0 1 .483.527v15.08l-7.412 3.177-6.353-3.177-6.674 2.86a.53.53 0 0 1-.738-.487V9.706l3.314-1.42a7.41 7.41 0 0 0 2.033 6.66L15 20.19l5.241-5.242A7.41 7.41 0 0 0 22.21 7.98l2.642-1.133a.5.5 0 0 1 .255-.041M15 4.412a5.296 5.296 0 0 1 3.744 9.037L15 17.192l-3.744-3.743A5.295 5.295 0 0 1 15 4.412m0 3.53a1.765 1.765 0 1 0 0 3.529 1.765 1.765 0 0 0 0-3.53"}))),screens:["quests"],comingSoon:!0},marketplace:{title:"Marketplace",icon:e=>g.createElement("svg",bi({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 30 30"},e),hi||(hi=g.createElement("path",{fill:"#fff",d:"M4.995 4.445a.814.814 0 0 1 1.012.552l.597 2.022H22.52c1.998 0 3.524 1.864 2.948 3.811l-1.797 6.082c-.382 1.296-1.598 2.16-2.948 2.16h-9.943c-1.351 0-2.565-.864-2.949-2.16L4.446 5.458a.814.814 0 0 1 .55-1.013m3.76 18.7a2.443 2.443 0 1 1 4.887 0 2.443 2.443 0 0 1-4.886 0m8.688 0a2.443 2.443 0 1 1 4.886 0 2.443 2.443 0 0 1-4.886 0"}))),screens:["marketplace"],comingSoon:!0}},Ci=({item:e,isActive:t})=>{const a=e.icon,i=e.comingSoon,n=(0,Qt.Bd)(),s=b();return(0,r.jsxs)("button",{disabled:i,onClick:()=>{s(S(e.screens[0]))},type:"button",className:Ht()("relative flex flex-1 flex-col items-center justify-center gap-2 ml:flex-none"),children:[(0,r.jsxs)("div",{className:Ht()("flex flex-col items-center justify-center gap-2 ml:w-70",t(e.screens)?"text-white":"opacity-40",i&&"cursor-default !opacity-15",!i&&"cursor-pointer hover:opacity-100"),children:[(0,r.jsx)(a,{className:"h-30 w-30"}),(0,r.jsx)("div",{className:"text-super-xs-bold",children:e.title})]}),e.comingSoon&&(0,r.jsx)("div",{className:"absolute right-0 top-0 z-10 rounded-10 border border-brand-black bg-[#262626] px-5 py-1",children:(0,r.jsx)("div",{className:"text-super-xss-bold uppercase opacity-40 ",children:n("","Soon")})})]},e.title)},zi=()=>{const e=w(e=>e.promoLobby.activeScreen),t=t=>t.includes(e);return(0,r.jsx)("div",{className:"md:navbar-gradient-border absolute bottom-40 left-0 right-0 flex justify-between gap-6 bg-brand-black px-20 pb-18 pt-14 mp:rounded-t-20 ml:right-auto ml:top-20 ml:flex-col ml:justify-start ml:gap-20 ml:px-8 ml:pb-16 ml:pt-16",children:Object.values(Di).map(e=>(0,r.jsx)(Ci,{item:e,isActive:t},e.title))})};var Ni,Ei;function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Si.apply(null,arguments)}const Pi=e=>g.createElement("svg",Si({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 46 46"},e),Ni||(Ni=g.createElement("path",{fill:"#fff",d:"M46 23c0 12.703-10.297 23-23 23S0 35.703 0 23 10.298 0 23 0s23 10.298 23 23M2.3 23c0 11.432 9.268 20.7 20.7 20.7S43.7 34.432 43.7 23 34.432 2.3 23 2.3 2.3 11.568 2.3 23"})),Ei||(Ei=g.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M23 6a17 17 0 0 1 17 17c0 9.389-7.611 17-17 17S6 32.389 6 23 13.611 6 23 6m1.7 18.7h-3.4a10.2 10.2 0 0 0-9.38 6.188A13.58 13.58 0 0 0 23 36.6c4.57 0 8.615-2.255 11.08-5.713A10.2 10.2 0 0 0 24.7 24.7M23 11.1a5.1 5.1 0 1 0 0 10.2 5.1 5.1 0 0 0 0-10.2",clipRule:"evenodd"})));var ki;function Ri(){return Ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},Ri.apply(null,arguments)}const Oi=e=>g.createElement("svg",Ri({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16"},e),ki||(ki=g.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 8v3m0-5.224V5.75M2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8"}))),Ii=({className:e=""})=>{var t;const a=w(e=>e.promoLobby.topBarScreen),i=w(ee),n=w(ae),{isPending:s,error:o}=w(e=>e.prizeDrop.apiLobbyInit),l=w(e=>e.wallet.trueDecimal),d=null!==(t=null==i?void 0:i.balance)&&void 0!==t?t:0,c=s||!!o||!n,p=b();return(0,r.jsxs)("div",{className:Ht()("flex w-full max-w-560 items-center justify-between gap-12 px-15 pb-16 ml:px-0",e),children:[(0,r.jsxs)("div",{className:"flex items-center gap-10",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{p(k("profile"))},className:Ht()("cursor-pointer opacity-20 transition-all hover:opacity-30","profile"===a&&"opacity-40"),"aria-label":"Profile",children:(0,r.jsx)(Pi,{className:"h-46 w-46"})}),(0,r.jsxs)("button",{type:"button","aria-label":"Wallet",onClick:()=>{p(k("wallet"))},className:Ht()("flex items-center gap-6 rounded-full bg-white-10 py-6 pl-6 pr-14 transition-all","wallet"===a&&"bg-white-20"),children:[(0,r.jsx)(xa,{className:"h-28 w-28 shrink-0 text-white"}),c?(0,r.jsx)(wa,{}):(0,r.jsx)("span",{className:"text-medium-bold",children:se.bp.formatCash(Number(d),{showCurrency:!1,customDecimals:l,roundUp:!0})})]})]}),(0,r.jsx)("button",{type:"button",className:Ht()("flex h-36 w-36 cursor-pointer items-center justify-center rounded-full bg-white-10 transition-all","info"===a&&"bg-white-20"),onClick:()=>{p(k("info"))},children:(0,r.jsx)(Oi,{className:"h-16 w-16"})})]})},Bi=()=>{const e=w(e=>e.promoLobby.topBarScreen),t=w(e=>e.promoLobby.screenHistory),a=w(e=>e.prizeDrop.rewardHubDrops),i=w(e=>e.prizeDrop.campaigns),n=w(yt),s=w(e=>e.prizeDrop.displayedCampaign),o=w(e=>e.prizeDrop.apiJoinCampaign),l=w(wt),d=w(e=>e.promoLobby.activeScreen),c=b(),p=(0,Qt.Bd)(),u=(0,g.useRef)(!1),m=(0,g.useRef)(""),h=(0,g.useRef)(""),f=(0,g.useRef)(!1),v=(0,g.useRef)(null),{showSuccessToast:x,showFailedToast:y}=ni();(0,g.useEffect)(()=>(se.h$.emit("promoLobby:opened"),()=>{se.h$.emit("promoLobby:closed")}),[]),(0,g.useEffect)(()=>{u.current||(u.current=!0,c(Q()));const e=a.map(e=>e.dropId).sort().join(",");e!==m.current&&(m.current=e,c(U(a.map(e=>e.dropId))));const t=i.filter(e=>"scheduled"===e.status).map(e=>e.campaignId),r=[...t].sort().join(",");r!==h.current&&(h.current=r,c(V(t)))},[a,i,c]),(0,g.useEffect)(()=>{f.current&&(o.data&&(o.data.joined?(x(p("DROP.042","You have successfully joined!")),se.h$.emit("pdModal:joinSuccess")):(y(Tr({t:p,error:o.error,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),se.h$.emit("pdModal:joinError")),f.current=!1),o.error&&(y(Tr({t:p,error:o.error,fallbackKey:"DROP.043",fallbackMessage:"Something went wrong"})),se.h$.emit("pdModal:joinError"),f.current=!1))},[o.data,o.error,y,x,p]),(0,g.useEffect)(()=>{"info"===e&&"info"!==v.current&&se.h$.emit("promoLobby:infoViewed"),v.current=e},[e]);const j="info"===e,D="campaign"===d,C=t.length>0,z=()=>{c(je("promoLobby"))};return(0,r.jsxs)(kr,{onClose:z,children:[(0,r.jsx)(Pr,{onReturn:C?()=>{c(R())}:void 0,onClose:z,classes:{closeButton:"!top-23",returnButton:"!top-23 ml:!left-98"},children:(0,r.jsx)("div",{className:"title-h1-bold pb-20 pt-34 text-center uppercase",children:p("LOBBY.001","True world")})}),(0,r.jsx)(Ii,{}),(0,r.jsx)(Dr,{scrollbarInsetBottom:D&&n&&!e?64:void 0,className:"mb-120 ml:mb-40",contentClassName:j?"!px-0 !max-w-full":"",children:(0,r.jsx)(ui,{})}),D&&n&&!e&&(0,r.jsx)(Cr,{className:"fixed !bottom-120 left-0 right-0 !bg-brand-black ml:!bottom-40 ",children:(0,r.jsx)(ta,{isLoading:o.isPending,onClick:()=>{se.h$.emit("pdModal:startJoin"),f.current=!0,c(ar({campaignId:s.campaignId}))},className:"!bg-brand-gradient",disabled:l})}),(0,r.jsx)(zi,{})]})},Li=()=>(0,r.jsx)(ii,{children:(0,r.jsx)(Bi,{})}),_i=()=>{const e=w(e=>e.modals.current);return(0,r.jsx)("div",{className:"pointer-events-auto",children:e.map(e=>(e=>{switch(e){case"promoLobby":return(0,r.jsx)(Li,{},e);case"prizeDropCongratulation":return(0,r.jsx)($r,{},e);case"prizeDropClaimed":return(0,r.jsx)(Ir,{},e);case"prizeDropClaimedSuccess":return(0,r.jsx)(Ur,{},e);case"prizeDropClaimedFailed":return(0,r.jsx)(Ar,{},e);case"prizeDropClaimedExpired":return(0,r.jsx)(Mr,{},e);case"prizeDropSuccess":return(0,r.jsx)(Qr,{},e);case"prizeDropResultFinished":return(0,r.jsx)(Kr,{},e);case"prizeDropResultCancelled":return(0,r.jsx)(Jr,{},e);case"prizeDropLive":return(0,r.jsx)(Hr,{},e);case"prizeDropJoinError":return(0,r.jsx)(Yr,{},e);default:return null}})(e))})};var Mi,Ti,Ai,Fi,Ui;function $i(){return $i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},$i.apply(null,arguments)}const Yi=e=>g.createElement("svg",$i({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 52 52"},e),Mi||(Mi=g.createElement("path",{fill:"#000",fillOpacity:.5,stroke:"url(#promo-lobby-icon_svg__a)",strokeWidth:1.7,d:"M15 1.85h22c7.263 0 13.15 5.887 13.15 13.15v22c0 7.263-5.887 13.15-13.15 13.15H15C7.737 50.15 1.85 44.263 1.85 37V15C1.85 7.737 7.737 1.85 15 1.85Z"})),Ti||(Ti=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__b)",d:"M41.5 26 29.593 38 17.687 26l11.906-12z"})),Ai||(Ai=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__c)",d:"m21.535 34.122-2.977 3-2.976-3 2.976-3z"})),Fi||(Fi=g.createElement("path",{fill:"url(#promo-lobby-icon_svg__d)",d:"M18.92 18.758 14.71 23l-4.21-4.243 4.21-4.243z"})),Ui||(Ui=g.createElement("defs",null,g.createElement("linearGradient",{id:"promo-lobby-icon_svg__a",x1:29.826,x2:30.02,y1:50.743,y2:10.567,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__b",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__c",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"})),g.createElement("linearGradient",{id:"promo-lobby-icon_svg__d",x1:28.372,x2:28.444,y1:37.877,y2:18.592,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#FFCF55"}),g.createElement("stop",{offset:.401,stopColor:"#FFAE11"}),g.createElement("stop",{offset:1,stopColor:"#FFF7B2"}))))),Vi=e=>{return"true"===e.prize.type&&!((t=e.expiresAt)&&new Date(t).getTime()<=Date.now());var t},Gi=e=>"expired"!==e.claimUiStatus&&Vi(e.drop);const Wi=({disabled:e=!1,gridClassName:t=""})=>{const a=function(){const e=(0,Gt.GV)(e=>e.play.isActive),t=w(te),a=w(e=>e.notification.viewedRewardDropIds),r=w(e=>e.notification.viewedCampaignIds),i=w(e=>e.prizeDrop.rewardHubDrops),n=w(e=>e.prizeDrop.dropsQueue),s=w(e=>e.prizeDrop.campaigns.filter(e=>"scheduled"===e.status)),o=w(e=>e.prizeDrop.hasDefferedModal),l=w(e=>!!e.prizeDrop.defferedCampaign),d=w(e=>e.prizeDrop.winDropItem),c=!!d&&Vi(d),p=w(e=>e.modals.current.some(e=>ke.includes(e))),u=(0,g.useMemo)(()=>((e,t,a)=>{const r=Date.now(),i=[];e.forEach(e=>{e.expiresAt&&i.push(new Date(e.expiresAt).getTime())}),t.forEach(e=>{e.drop.expiresAt&&i.push(new Date(e.drop.expiresAt).getTime())}),(null==a?void 0:a.expiresAt)&&i.push(new Date(a.expiresAt).getTime());const n=i.filter(e=>e>r);return n.length?Math.min(...n):null})(i,n,d),[i,n,d]),[,m]=(0,g.useReducer)(e=>e+1,0);(0,g.useEffect)(()=>{if(null===u)return;const e=Math.max(0,u-Date.now())+50,t=setTimeout(m,e);return()=>clearTimeout(t)},[u]);const h=((e,t)=>!t&&e)((({isActiveWalletNew:e,viewedRewardDropIds:t,viewedCampaignIds:a,rewardHubDrops:r,dropsQueue:i,scheduledCampaigns:n,hasDefferedModal:s,hasDefferedCampaign:o,hasDefferedReward:l})=>{if(e)return!0;const d=r.some(e=>Vi(e)&&!t.includes(e.dropId)),c=i.some(Gi),p=n.some(e=>!a.includes(e.campaignId));return d||c||p||!!s&&(o||l)})({isActiveWalletNew:t,viewedRewardDropIds:a,viewedCampaignIds:r,rewardHubDrops:i,dropsQueue:n,scheduledCampaigns:s,hasDefferedModal:o,hasDefferedCampaign:l,hasDefferedReward:c}),p),f=(0,g.useRef)(null),{value:v,nextFrozen:x}=((e,t,a)=>{if(!e)return{value:t,nextFrozen:null};const r=null!=a?a:t;return{value:r,nextFrozen:r}})(e,h,f.current);return f.current=x,v}(),i=(0,Gt.jL)(),n=b(),s=(0,g.useRef)(null);return(0,g.useEffect)(()=>{null===s.current?(s.current=a,a&&se.h$.emit("notification_badge_shown")):s.current!==a&&(s.current=a,a?se.h$.emit("notification_badge_shown"):se.h$.emit("notification_badge_cleared"))},[a]),(0,r.jsx)("div",{className:t?`${t} relative bottom-64 h-52 w-52 ml:h-46 ml:w-46`:"",children:(0,r.jsxs)("button",{disabled:e,type:"button",onClick:t=>{t.stopPropagation(),e||(n(ye("promoLobby")),i((0,le.Pp)(!0)))},className:Ht()("pointer-events-auto absolute cursor-pointer items-center justify-center rounded-14",!t&&"bottom-105 left-1/2 m-1 flex origin-top -translate-x-188 ml:bottom-auto ml:left-29 ml:top-1/2 ml:translate-x-0 ml:translate-y-[calc(-100%+167px)]",vr.T.prizeDrop,["[&_svg_stop:nth-child(1)]:[stop-color:var(--colors-gold-stop-0)]","[&_svg_stop:nth-child(2)]:[stop-color:var(--colors-gold-stop-1)]","[&_svg_stop:nth-child(3)]:[stop-color:var(--colors-gold-stop-2)]"],!e&&'after:absolute after:bottom-0 after:left-0 after:right-0 after:top-0 after:rounded-14 after:transition-all after:content-[""] hover:after:bg-white-10',"active:opacity-70","disabled:cursor-default disabled:opacity-40 disabled:hover:after:bg-transparent disabled:active:bg-transparent"),children:[a&&(0,r.jsx)("div",{className:"absolute right-0 top-0 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-gold",children:(0,r.jsx)("div",{className:"bg-neon-rouge h-8 w-8 rounded-full"})}),(0,r.jsx)(Yi,{className:"relative z-1 h-52 w-52 ml:h-46 ml:w-46"})]})})},Hi=()=>{var e;const t=(0,Gt.GV)(_a.ge),a=(0,Gt.GV)(e=>e.round.isRestore),i=(null===(e=(0,Gt.GV)(e=>e.freeRounds.current))||void 0===e?void 0:e.count)>0,n=(0,Gt.GV)(e=>e.play.isActive),s=(0,Gt.GV)(e=>e.app.isUIHidden),o=a||i||n;return(0,r.jsxs)(r.Fragment,{children:[t&&!s&&(0,r.jsx)(Wi,{disabled:o}),!t&&!s&&(0,r.jsx)("div",{className:Ht()("pointer-events-none fixed grid","mp:bottom-42 mp:left-1/2 mp:-translate-x-1/2 mp:items-end mp:gap-x-12","ml:right-21 ml:top-1/2 ml:-translate-y-1/2 ml:justify-items-center ml:gap-y-10","mp:grid-cols-[52px_52px_118px_52px_52px]","ml:grid-rows-[46px_46px_110px_46px_46px]",'mp:[grid-template-areas:"menu_stakeAmounts_play_auto_bonus"]','ml:[grid-template-areas:"menu""stakeAmounts""play""auto""bonus"]',"ml:opacity-0","z-51"),children:(0,r.jsx)(Wi,{gridClassName:"[grid-area:menu]",disabled:o})})]})},Ji=()=>{const e=(0,Gt.GV)(e=>"main"===e.app.screen);return(()=>{const e=(0,Gt.GV)(e=>e.app.modulesConfig.promoLobby),t=b(),a=null==e?void 0:e.fakeApi,r=null==e?void 0:e.fakeSocket,i=null==e?void 0:e.lang;(0,g.useEffect)(()=>{e&&a&&(t(Ge(a.prizeDropLobbyInit)),t(We(a.prizeDropJoinCampaign)),t(He(a.prizeDropClaim)),t(kt(a.walletTransactions)))},[a]),(0,g.useEffect)(()=>{e&&r&&t(Ze(r))},[r]),(0,g.useEffect)(()=>{e&&t(Je({url:e.url,token:e.token}))},[e]),(0,g.useEffect)(()=>{e&&i&&t(P(e.lang))},[e])})(),function(){const e=(0,Gt.jL)(),t=b();(0,g.useEffect)(()=>{pr.j.on("round:opened",()=>{var t,a;try{"live"===vt(At.getState(),null===(t=At.getState().prizeDrop.activeCampaign)||void 0===t?void 0:t.campaignId)&&xt(At.getState())&&e((0,dr.Nl)({pdCampaignId:null===(a=At.getState().prizeDrop.activeCampaign)||void 0===a?void 0:a.campaignId}))}catch(t){const a=t;(0,Ne.PI)(a),se.vF.error(a),e((0,oe.qX)(a))}}).on("round:ended",()=>{try{const{hasDefferedModal:a,winDropItem:r,defferedCampaign:i,dropsQueue:n}=At.getState().prizeDrop;if(i&&t(Ue(i)),a){if(e((0,lr.X2)()),e((0,cr.SE)()),e((0,H.Zv)(!1)),"finished"===(null==i?void 0:i.status)?t(ye("prizeDropResultFinished")):"cancelled"===(null==i?void 0:i.status)&&t(ye("prizeDropResultCancelled")),r){const e=n.find(e=>e.drop.dropId===r.dropId);let a;a=e?Oe(e):"true"===r.prize.type?"prizeDropClaimed":"prizeDropCongratulation",t(ye(a))}t(et(!1)),t(rt())}}catch(t){const a=t;(0,Ne.PI)(a),se.vF.error(a),e((0,oe.qX)(a))}}).on("autoplay:restarted",()=>{t((e,t)=>{var a;const r=t(),i=r.modals.current.filter(e=>Re.includes(e)),n=i.some(e=>ke.includes(e)),s=i.includes("prizeDropClaimed"),o=null===(a=r.prizeDrop.winDropItem)||void 0===a?void 0:a.dropId,l=r.modals.current.includes("promoLobby")&&"true-world"===r.promoLobby.activeScreen&&null===r.promoLobby.topBarScreen;i.forEach(t=>{(e=>{switch(e){case"prizeDropCongratulation":case"prizeDropClaimed":return void se.h$.emit("pdModalWinDrop:closed");case"prizeDropClaimedSuccess":return void se.h$.emit("pdModalClaimSuccess:closed");case"prizeDropClaimedFailed":return void se.h$.emit("pdModalClaimFailed:closed");case"prizeDropClaimedExpired":return void se.h$.emit("pdModalClaimExpired:closed");case"prizeDropResultFinished":se.h$.emit("pdModalEventEnded:closed");break;case"prizeDropResultCancelled":se.h$.emit("pdModalEventCancelled:closed")}})(t),e(je(t))}),s&&o&&l&&e(F(o)),n&&o&&e(nt(o)),(n||r.prizeDrop.hasDefferedModal)&&(e(Ve()),e(ht())),e(et(!1)),e(rt())})})},[])}(),(()=>{var e;const t=(0,Gt.jL)(),a=b(),r=!!w(e=>e.prizeDrop.restData),i=w(e=>e.prizeDrop.campaignsQueue),n=w(e=>e.prizeDrop.displayedCampaign),s=w(e=>e.prizeDrop.apiLobbyInit.isPending),o=(0,Gt.GV)(e=>e.play.isActive),l=(0,Gt.GV)(e=>e.freeRounds.isActive),d=(null===(e=(0,Gt.GV)(e=>e.freeRounds.current))||void 0===e?void 0:e.count)>0,c=w(xe),p=(0,Gt.GV)(e=>e.modals.hasOpened),u=(0,Gt.GV)(e=>e.round.isRestore),m=(0,g.useRef)(!1);(0,g.useEffect)(()=>{!m.current&&r&&(a(ir({shouldFreezeUi:!0})),m.current=!0)},[a,r]),(0,g.useEffect)(()=>{var e;if(!(({hasInitialized:e,hasPromoLobby:t,isPromoLobbyInitPending:a,campaignsQueueLength:r,isPlayActive:i,isFreeRoundsActive:n,isFreeRoundsCurrent:s,hasOpenedModalByCore:o,isRestore:l,isModalMode:d})=>e&&t&&!a&&r>0&&!i&&!n&&!s&&!o&&!l&&!d)({hasInitialized:m.current,hasPromoLobby:r,isPromoLobbyInitPending:s,campaignsQueueLength:null!==(e=null==i?void 0:i.length)&&void 0!==e?e:0,isPlayActive:o,isFreeRoundsActive:l,isFreeRoundsCurrent:d,hasOpenedModalByCore:p,isRestore:u,isModalMode:c}))return;const h=i[0];h&&((null==n?void 0:n.campaignId)!==h.campaignId&&a(Fe(h)),t((0,H.M5)()),a(ye("prizeDropLive")))},[i,a,null==n?void 0:n.campaignId,p,l,d,c,o,r,s,u,t])})(),function(){const e=b(),t=(0,g.useCallback)(t=>{e((e=>t=>{t(X(e.active))})(t)),t.active&&e(nr())},[e]);(0,g.useEffect)(()=>{ze.on(De.CAMPAIGN_UPDATED,({payload:t})=>{e(sr(t))}),ze.on(De.DROP,({payload:t})=>{e(Dt(t))}),ze.on(De.WALLET_STATUS,({payload:e})=>{t(e)})},[e,t]),(0,g.useEffect)(()=>{const a=a=>{var r,i,n;if(a.data.isGUI){if((null===(r=a.data)||void 0===r?void 0:r.type)===De.CAMPAIGN_UPDATED){const{payload:t}=a.data;se.vF.socketEvent(De.CAMPAIGN_UPDATED,t),e(sr(t))}if((null===(i=a.data)||void 0===i?void 0:i.type)===De.DROP){const{payload:t}=a.data;se.vF.socketEvent(De.DROP,t),e(Dt(t))}if((null===(n=a.data)||void 0===n?void 0:n.type)===De.WALLET_STATUS){const{payload:e}=a.data;se.vF.socketEvent(De.WALLET_STATUS,e),t(e)}}};return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[e,t])}(),(0,r.jsx)("div",{className:"promo-lobby-container pointer-events-auto",children:e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Hi,{}),(0,r.jsx)(_i,{})]})})},Ki=({dispatch:e})=>{null==e||e((0,i.JI)((()=>{const e=[];return e.push(m,h,f,u,o,l,c,p,s,n,d),e.filter(e=>!!e)})()))},Qi=()=>(0,r.jsx)(Yt,{children:(0,r.jsx)(Ji,{})})}}]);
|