@kalamba/sdk 0.2.1 → 0.3.0
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/index.d.ts +65 -6
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.ts +159 -33
- package/dist/plugins.js +1039 -879
- package/dist/wrapper.cjs +1 -1
- package/dist/wrapper.d.ts +65 -6
- package/dist/wrapper.js +4 -2
- package/package.json +9 -2
package/dist/index.d.ts
CHANGED
|
@@ -83,8 +83,6 @@ export { Error_2 as Error }
|
|
|
83
83
|
|
|
84
84
|
export declare type ExtraPlayPayload = {
|
|
85
85
|
[key: string]: any;
|
|
86
|
-
} & {
|
|
87
|
-
bet?: never;
|
|
88
86
|
};
|
|
89
87
|
|
|
90
88
|
export declare type ForwardToPluginsMessage<P extends PluginDomain> = keyof ForwardToPluginsMessageMap<'sdk'>[P] | keyof ForwardToPluginsMessageMap<'rgs'>[P] | keyof ForwardToPluginsMessageMap<'casino'>[P] | keyof ForwardToPluginsMessageMap<'telemetry'>[P];
|
|
@@ -147,8 +145,47 @@ export declare type OpenGameRequest = {
|
|
|
147
145
|
};
|
|
148
146
|
|
|
149
147
|
export declare type OpenGameResponse = {
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
contract: {
|
|
149
|
+
bet: {
|
|
150
|
+
available: Record<number, number[]>;
|
|
151
|
+
default: {
|
|
152
|
+
base: number;
|
|
153
|
+
multiplier: number;
|
|
154
|
+
};
|
|
155
|
+
max: number;
|
|
156
|
+
last: Bet | null;
|
|
157
|
+
lastPaid: Bet | null;
|
|
158
|
+
};
|
|
159
|
+
balance: {
|
|
160
|
+
coins: number;
|
|
161
|
+
version: number;
|
|
162
|
+
};
|
|
163
|
+
gameModel: string;
|
|
164
|
+
metaData: {
|
|
165
|
+
rtpValues: {
|
|
166
|
+
key: string;
|
|
167
|
+
rtpValue: string;
|
|
168
|
+
}[];
|
|
169
|
+
maxWin: {
|
|
170
|
+
key: string;
|
|
171
|
+
maxWinValueXBet: number;
|
|
172
|
+
maxWinOdds: number;
|
|
173
|
+
}[];
|
|
174
|
+
version: string;
|
|
175
|
+
};
|
|
176
|
+
serverTime: number;
|
|
177
|
+
sessionId: string;
|
|
178
|
+
stateType: {
|
|
179
|
+
thisRound: string;
|
|
180
|
+
nextRound: string;
|
|
181
|
+
};
|
|
182
|
+
uiMessages: unknown[];
|
|
183
|
+
win: {
|
|
184
|
+
round: number;
|
|
185
|
+
total: number;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
data: unknown;
|
|
152
189
|
};
|
|
153
190
|
|
|
154
191
|
export declare class PlayError extends Error {
|
|
@@ -168,8 +205,28 @@ export declare type PlayRequest = {
|
|
|
168
205
|
};
|
|
169
206
|
|
|
170
207
|
export declare type PlayResponse = {
|
|
171
|
-
|
|
172
|
-
|
|
208
|
+
contract: {
|
|
209
|
+
bet: {
|
|
210
|
+
last: Bet | null;
|
|
211
|
+
lastPaid: Bet;
|
|
212
|
+
};
|
|
213
|
+
balance: {
|
|
214
|
+
coins: number;
|
|
215
|
+
version: number;
|
|
216
|
+
};
|
|
217
|
+
serverTime: number;
|
|
218
|
+
roundId: string;
|
|
219
|
+
stateType: {
|
|
220
|
+
thisRound: string;
|
|
221
|
+
nextRound: string;
|
|
222
|
+
};
|
|
223
|
+
uiMessages: unknown[];
|
|
224
|
+
win: {
|
|
225
|
+
round: number;
|
|
226
|
+
total: number;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
data: unknown;
|
|
173
230
|
};
|
|
174
231
|
|
|
175
232
|
export declare type PluginDomain = keyof ForwardToPluginsMessageMap<any>;
|
|
@@ -240,6 +297,8 @@ export declare interface SdkConfig {
|
|
|
240
297
|
jurisdiction: string;
|
|
241
298
|
playMode: 'FUN' | 'REAL';
|
|
242
299
|
user: string;
|
|
300
|
+
sessionId: string;
|
|
301
|
+
lastRoundId?: string;
|
|
243
302
|
};
|
|
244
303
|
ui: {
|
|
245
304
|
autoplay: {
|
package/dist/plugins.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* BSD 3-Clause License
|
|
3
3
|
* Copyright (c) 2024, Kalamba Games Limited
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var Nt=Object.defineProperty;var Ht=(i,t,e)=>t in i?Nt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var w=(i,t,e)=>(Ht(i,typeof t!="symbol"?t+"":t,e),e),ot=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var y=(i,t,e)=>(ot(i,t,"read from private field"),e?e.call(i):t.get(i)),v=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},E=(i,t,e,s)=>(ot(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("./noop-b3c54b76.cjs");function x(i,t){return(e,...s)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...s)}}class V{constructor(t){w(this,"config");this.config=t}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-casino:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}function zt(i,t){return Math.round(i*100/t)}const Vt=x("BasicPlugin","color:#000000;font-weight:bold;");class qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Vt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,payload:s}=t.data;switch(e){case"doAudioSettings":this.send("settings",{music:s==null?void 0:s.musicEnabled,sounds:s==null?void 0:s.soundEnabled});return;case"doBalanceUpdate":const{currency:n,coinValueInCents:c}=this.config.api;s.currency===n&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:zt(s.balanceInCurrency,c)}):(s.balanceInCoins,this.send("balance",{balance:s.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const k=x("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),Wt=x("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class $t extends V{constructor(...t){super(...t),this.registerDebugToSdkEvents(),this.registerSdkToDebugEvents()}registerDebugToSdkEvents(){window.DebuggingPlugin={balance:t=>this._send("balance",t),bet:t=>this._send("bet",t),choice:t=>this._send("choice",t),close:t=>this._send("close",t),help:t=>this._send("help",t),history:t=>this._send("history",t),freeze:t=>this._send("freeze",t),paytable:t=>this._send("paytable",t),settings:t=>this._send("settings",t),suspend:t=>this._send("suspend",t),unfreeze:t=>this._send("unfreeze",t)}}registerSdkToDebugEvents(){this.on("autoplay",t=>k("autoplay",t)),this.on("balance",t=>k("balance",t)),this.on("bet",t=>k("bet",t)),this.on("cashier",t=>k("cashier",t)),this.on("choice",t=>k("choice",t)),this.on("close",t=>k("close",t)),this.on("error",t=>k("error",t)),this.on("loadEnd",t=>k("loadEnd",t)),this.on("loadProgress",t=>k("loadProgress",t)),this.on("loadStart",t=>k("loadStart",t)),this.on("playCycleStart",t=>k("playCycleStart",t)),this.on("playCycleEnd",t=>k("playCycleEnd",t)),this.on("playEnd",t=>k("playEnd",t)),this.on("playError",t=>k("playError",t)),this.on("playReady",t=>k("playReady",t)),this.on("playStart",t=>k("playStart",t)),this.on("settings",t=>k("settings",t))}_send(...t){Wt(...t),this.send(...t)}}const jt=x("GigPlugin","color:#000000;font-weight:bold;");class Qt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),jt("configured")}postMessage(t){const e={event:t};window.top.postMessage(e,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{data:e}=t;switch(e){case"STOP_AUTO_PLAY":this.send("suspend");return;case"BLOCK_BETS":this.send("freeze");return;case"UNBLOCK_BETS":this.send("unfreeze");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const Xt=x("OryxPlugin","color:#000000;font-weight:bold;");class Kt extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Xt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,param:s}=t.data;switch(e){case"doBalanceUpdate":this.send("balance",{balance:s});return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("close",()=>{window.top.postMessage({wpgaction:"close"},"*"),window.parent.postMessage({wpgaction:"close.parent"},"*")}),this.on("balance",({balance:e})=>{t!==e&&(t=e,window.top.postMessage({param:{},wpgaction:"balance"},"*"),window.parent.postMessage({param:{},wpgaction:"balance.parent"},"*"))}),this.on("loadStart",()=>{window.top.postMessage({wpgaction:"loadStart"},"*"),window.parent.postMessage({wpgaction:"loadStart.parent"},"*")}),this.on("loadEnd",()=>{window.top.postMessage({wpgaction:"loadEnd"},"*"),window.parent.postMessage({wpgaction:"loadEnd.parent"},"*")}),this.on("playStart",()=>{window.top.postMessage({wpgaction:"gameSpinStart"},"*"),window.parent.postMessage({wpgaction:"gameSpinStart.parent"},"*")}),this.on("playEnd",()=>{window.top.postMessage({wpgaction:"gameSpinEnd"},"*"),window.parent.postMessage({wpgaction:"gameSpinEnd.parent"},"*")}),this.on("cashier",({type:e})=>{switch(e){case"BALANCE_LOW":window.top.postMessage({wpgaction:"cashier"},"*"),window.parent.postMessage({wpgaction:"cashier.parent"},"*");break;case"BALANCE_INSUFFICIENT":window.top.postMessage({wpgaction:"errorOutOfMoney"},"*"),window.parent.postMessage({wpgaction:"errorOutOfMoney.parent"},"*");break}})}}const ct=x("PariplayPlugin","color:#000000;font-weight:bold;");function Ge(i){try{window.top.location=i}catch{window.location=i}}function Ne(i,t){return new Promise(function(s,n){const c=new XMLHttpRequest;c.onload=function(){c.status>=200&&c.status<300?s(c.responseText):n(c.responseText)},c.open(i,t),c.send()})}function He(){}function Jt(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function ze(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Ut(i){try{return JSON.parse(i.text)}catch{return{}}}function Yt(i){return i.map(Ut).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function Zt(i){return i.map(Ut).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ei extends V{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ct("configured")}postMessage(t,e){const s={lang:this.config.ui.language,sender:this.config.api.game,type:t};e!=null&&(s.data=e),ct("postMessage",s),window.parent.postMessage(s,"*")}coinsToCurrency(t){return t*this.config.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&Ne("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":Ne("GET",t.link),e();return;case"AJAXRESPONSE":Ne("GET",t.link).then(()=>{e()});return;case"REDIRECT":Ge(t.link),e();return}}handleQuitButton(t,e){this.send("close"),e()}handleCashierButton(t,e){this.send("cashier",{type:"ON_DEMAND"}),e()}handleHistoryButton(t,e){this.send("history",{source:"casino"}),e()}get buttonActions(){return{CASHIER:this.handleCashierButton,CONTINUE:this.handleContinueButton,HISTORY:this.handleHistoryButton,LINK:this.handleLinkButton,QUIT:this.handleQuitButton}}processInfoUiMessages(t){return t.reduce((e,s)=>e.then(()=>new Promise(n=>{Object.assign({},s,{buttons:s.buttons.filter(c=>c.action.toUpperCase()==="CASHIER"?!!this.config.api.cashierUrl:!0).map(c=>Object.assign({},c,{onRelease:()=>{const a=s.messageType.toUpperCase()==="POPUP"?He:n,h=this.buttonActions[c.action.toUpperCase()];h?h(c,a):a()}}))})}).catch(He)),Promise.resolve()).then(()=>{}).catch(He)}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e}=t.data;switch(e){case"pause":case"disableSpin":this.send("freeze");return;case"resume":case"enableSpin":this.send("unfreeze");return;case"stopAutobet":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let t=0;this.on("openGameResponse",e=>{let s;try{const n=JSON.parse(JSON.parse(atob(this.config.api.integrationData.token.split(".")[1])).token),c=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:c}}catch{s=void 0}this.postMessage("gameDataLoaded",{LoadGameData:s,success:!0});try{const n=ze(e.data.uiMessages);this.processInfoUiMessages(n)}catch{}}),this.on("balance",({balance:e})=>{t!==e&&(t=e,this.postMessage("balance",{amount:this.coinsToCurrency(e)}))}),this.on("close",()=>{if(this.config.api.homeUrl)if(this.config.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.config.api.homeUrl==="(api)"?this.postMessage("quit"):Ge(this.config.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.balance),win:this.coinsToCurrency(e.data.gameRoundResult.win)});try{const s=ze(e.data.uiMessages);this.processInfoUiMessages(s)}catch{}}),this.on("playError",e=>{this.postMessage("ticketReceived",{ErrorCode:e.data.data.data.operatorSpecificErrorCode,ErrorMessage:e.data.data.data.operatorSpecificErrorMessage,Status:{ErrCode:e.data.data.data.operatorSpecificErrorCode}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.balance+e.data.gameState.totalBetFromCurrentGameCycle)});const s=e.data.gameState.stateTypeThisRound==="BaseGame",n=Jt(e.data.uiMessages),c=ze(e.data.uiMessages),a=Yt(n),h=Zt(n);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.balance),BetAmount:s?this.coinsToCurrency(e.data.gameState.totalBetFromCurrentGameCycle):0,CreditTransactionId:a.betId,DebitTransactionId:a.winId,Message:c,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.data.gameRoundResult.win)})}),this.on("playStart",e=>{e.bet&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(e.bet.base*e.bet.multiplier)})}),this.on("loadEnd",()=>{this.postMessage("gameReady")}),this.on("loadStart",()=>{this.postMessage("onAppFrameReady")}),this.on("cashier",()=>{this.config.api.cashierUrl&&(this.config.api.cashierUrl==="(api)"?this.postMessage("cashier"):Ge(this.config.api.cashierUrl))})}}const he=x("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ti extends V{constructor(...e){super(...e);w(this,"VERSION","1.15.0");const s=document.createElement("script");s.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,s.onload=()=>{he("loaded"),window.FEIM.configure({p2pConfig:{currency:this.config.api.currency,launchParams:{homeurl:"homeUrl"}}}),he("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(s)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>he("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>he("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>he("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{this.send("help",{})}),window.FEIM.on.togglePaytable(()=>{this.send("paytable",{})}),window.FEIM.on.unfreeze(()=>this.send("unfreeze")),window.FEIM.on.updateSettings(({payload:[e]})=>this.send("settings",{sounds:e.sounds,fastPlay:e.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:e})=>{switch(e){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:e})=>{window.FEIM.send.balanceUpdate(e)}),this.on("bet",({base:e,multiplier:s})=>{window.FEIM.send.betUpdate(e*s)}),this.on("error",({message:e})=>{window.FEIM.send.errorMessage(e)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:e})=>{window.FEIM.send.gameLoadProgress(e)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",e=>{const s={balance:e.balance,bet:e.data.gameState.totalBetFromCurrentGameCycle,win:{win:e.data.gameState.totalWinFromCurrentGameCycle}};window.FEIM.send.roundFinished(s)}),this.on("playResponse",e=>{const s={balance:e.balance,playResponse:e.data};window.FEIM.send.roundStarted(s)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}function ii(i,t){return Math.round(i*100/t)}const Ve=x("TukoPlugin","color:#000000;font-weight:bold;");class si extends V{constructor(...e){super(...e);w(this,"PING_INTERVAL",1e4);const n=new URLSearchParams(window.location.search).get("pingCallbackUrl");n&&window.setInterval(()=>{this.ping(n)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),Ve("configured")}ping(e){const s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&(s.status===0||s.status>=200&&s.status<400?Ve("ping ok",s):Ve("ping error",s))},s.open("GET",e),s.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:s,payload:n}=e.data;switch(s){case"doAudioSettings":this.send("settings",{music:n==null?void 0:n.musicEnabled,sounds:n==null?void 0:n.soundEnabled});return;case"doBalanceUpdate":const{currency:c,coinValueInCents:a}=this.config.api;n.currency===c&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:ii(n.balanceInCurrency,a)}):(n.balanceInCoins,this.send("balance",{balance:n.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}class ni{constructor(t){w(this,"socket",null);w(this,"webSocketUrl");w(this,"eventListeners",{close:[],error:[],message:[]});w(this,"connect",()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(e=>{t.addEventListener("open",s=>{this.handleOpen(s),e(this.socket)})})});w(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});w(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close(),this.addEventListener("error",t=>{console.log(t)})});w(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)})});w(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});w(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});w(this,"handleOpen",t=>{const e=t.target;e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),this.socket=e});this.webSocketUrl=t}addEventListener(t,e){this.eventListeners[t].push(e)}removeEventListener(t,e){const s=this.eventListeners[t].indexOf(e);s!==-1&&this.eventListeners[t].splice(s,1)}}function Me(i){try{return JSON.parse(i==null?void 0:i.data)}catch(t){return console.error("fakap",t),null}}function oe(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="GameEvent"}function ai(i){return oe(i)&&i.body.event==="OPEN_GAME"}function oi(i){return oe(i)&&i.body.event==="SPIN_ERROR"}function ri(i){return oe(i)&&i.body.event==="SPIN_RESULT"}function ci(i){return oe(i)&&i.body.event==="BG_RESULT"}function di(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="OpenGame"}function li(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function dt(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}var Z,ye;class ui extends ni{constructor(e,s){const n=new URL(e.apiUrl);n.searchParams.set("cageCode",e.cageCode),n.searchParams.set("gameCode",e.gameCode),n.searchParams.set("operatorCode",e.operatorCode),n.searchParams.set("playMode",e.playMode),n.searchParams.set("token",e.token),n.searchParams.set("username",e.username);super(n.toString());w(this,"cId",0);w(this,"mId",0);w(this,"seqId",10);w(this,"gameCode");v(this,Z,void 0);v(this,ye,void 0);w(this,"onMessage",e=>{const s=Me(e);(oe(s)||li(s)||dt(s))&&this.sendAcknowledgement(s),dt(s)&&this.handleRealityCheck(s)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,E(this,Z,s.requestTimeoutMs),E(this,ye,s.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(e){this.eventListeners.realityCheck.forEach(s=>{s(e.body)})}addEventListener(e,s){super.addEventListener(e,s)}removeEventListener(e,s){super.removeEventListener(e,s)}buildHeader(e,s=null){return{cId:s??++this.cId,code:s!==null?1:void 0,mId:++this.mId,name:e}}buildPayload(e,s){return JSON.stringify({body:s,header:e})}getBodyExtras(e){return{action:e,seqId:++this.seqId}}request(e,s){const n=this.buildPayload(e,s);return new Promise((c,a)=>{setTimeout(()=>a({request:{body:s,header:e},type:"timeout"}),y(this,Z));const h=g=>{const p=Me(g);try{e.cId===(p==null?void 0:p.header.cId)&&(this.removeEventListener("message",h),p.header.code===1?c(p):a({response:p,type:"response"}))}catch{a({response:p,type:"error"})}};this.addEventListener("message",h),this.send(n)})}activateFreeRound(e){const s=this.buildHeader("ActivateFreeRound");return this.request(s,e)}authenticate(e=!1){const s=this.buildHeader("Authenticate"),n={clientType:3,version:y(this,ye),reconnect:e};return this.request(s,n).then(c=>c.body)}openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((n,c)=>{const a=h=>{const g=Me(h);ai(g)&&(this.removeEventListener("message",a),n(g.body))};this.addEventListener("message",a),this.request(e,s).catch(h=>{di(h.response)&&c(h),c(h)})})}sendAcknowledgement(e){const{name:s,cId:n}=e.header,c=this.buildHeader(s,n),a=this.buildPayload(c,{});this.send(a)}sendAction(e,s){const n=this.buildHeader("GameAction"),c={...this.getBodyExtras(e),data:s};return new Promise((a,h)=>{const g=p=>{const f=Me(p);oe(f)&&c.seqId===f.body.correlationSeqId&&(this.removeEventListener("message",g),ri(f)||ci(f)?a(f.body):oi(f)&&h(f.body))};this.addEventListener("message",g),this.request(n,c).catch(p=>{h(p)})})}setRequestTimeoutMs(e){E(this,Z,e)}}Z=new WeakMap,ye=new WeakMap;class Ot{constructor(t){w(this,"config");this.config=t}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-rgs:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}}const hi={bul:"bg",chi:"zh",zho:"zh",hrv:"hr",cze:"cs",dan:"da",dut:"nl",eng:"en",est:"et",fin:"fi",fra:"fr",ger:"de",gre:"el",hun:"hu",ind:"id",ita:"it",jpn:"ja",kor:"ko",nor:"no",pol:"pl",por:"pt",rum:"ro",rus:"ru",srp:"sr",slo:"sk",spa:"es",swe:"sv",tha:"th",tur:"tr",ukr:"uk",vie:"vi"},gi=x("KalambaBullseyePlugin","color:#000000;font-weight:bold;");var Ee;class pi extends Ot{constructor(...e){super(...e);w(this,"socket");v(this,Ee,"");this.on("openGame",async()=>{try{const s=await this.openGame();this.send("openGameResponse",s)}catch(s){this.send("openGameError",s)}}),this.on("play",async s=>{try{const n=await this.play(s);this.send("playResponse",n)}catch(n){this.send("playError",n)}}),this.on("state",({version:s})=>{E(this,Ee,s)}),this.on("configured",s=>{this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new ui(e,{gameVersion:y(this,Ee),requestTimeoutMs:this.config.ui.requestTimeoutMs}),this.socket.addEventListener("close",s=>{s.code===1006&&this.reconnect(e)}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.socket.socket&&this.socket.socket.readyState!==WebSocket.OPEN&&this.reconnect(e)}),this.socket.addEventListener("error",s=>gi("error",s)),this.socket.addEventListener("realityCheck",s=>{this.send("realityCheck",s)})}async reconnect(e){this.initialize(e),await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}async openGame(){const e=new URLSearchParams(window.location.search),s=e.get("apiUrl"),n=e.get("cageCode"),c=e.get("gameCode"),a=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),p=e.get("username"),f=e.get("gameHistoryUrl"),A=e.get("homeUrl")??void 0,D=e.get("cashierUrl")??void 0;this.initialize({apiUrl:s,cageCode:n,gameCode:c,operatorCode:a,playMode:h,token:g,username:p}),await this.socket.connect();const B=await this.socket.authenticate(),le=await this.socket.openGame();this.config.api={brand:n,game:c,integration:a,jurisdiction:B.jurisdictionCode,playMode:h,user:B.username,integrationData:{token:g},country:B.countryCode,currency:B.currencyCode,coinValueInCents:B.coinValueInCents,gameHistoryUrl:f,homeUrl:A,cashierUrl:D};const U=e.get("languageCode");return U&&(this.config.ui.language=U.length===3?hi[U]??U:U),le}play(e){const{contract:{bet:s,...n},extra:c,actionType:a}=e;return this.socket.sendAction(a,{bet:s?{baseBet:s.base,betMultiplier:s.multiplier}:void 0,...n,...c})}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:s,integrationData:n,jurisdiction:c,user:a,gameHistoryUrl:h},ui:{language:g}}=this.config,p=a.replace(/^user_/,"").replace(new RegExp(`_${s}$`),""),f=new URL(h);f.searchParams.set("gameCode",e),f.searchParams.set("jurisdiction",c),f.searchParams.set("operatorCode",s),f.searchParams.set("token",n.token),f.searchParams.set("username",p),f.searchParams.set("languageCode",g),window.open(f.toString(),"_blank")})}}Ee=new WeakMap;var wi="2.0.0-beta.2",re="",lt="?",Ke="function",H="undefined",ce="object",Je="string",fe="major",d="model",o="name",l="type",u="vendor",r="version",M="architecture",K="console",m="mobile",b="tablet",I="smarttv",X="wearable",Ye="embedded",ut="user-agent",Ze=500,it="brands",W="formFactor",st="fullVersionList",J="platform",nt="platformVersion",De="bitness",q="sec-ch-ua",mi=q+"-full-version-list",fi=q+"-arch",bi=q+"-"+De,yi=q+"-form-factor",Ei=q+"-"+m,vi=q+"-"+d,Lt=q+"-"+J,ki=Lt+"-version",_t=[it,st,m,d,J,nt,M,W,De],T="browser",O="cpu",R="device",L="engine",P="os",Y="result",Ce="Amazon",ge="Apple",ht="ASUS",gt="BlackBerry",Ie="Google",pt="Huawei",wt="Lenovo",qe="LG",Ue="Microsoft",mt="Motorola",Te="Samsung",ft="Sharp",Ae="Sony",We="Xiaomi",$e="Zebra",j="Mobile ",Q=" Browser",Pe="Chrome",Si="Edge",pe="Firefox",we="Opera",bt="Facebook",yt="Sogou",et="Windows",Mi=typeof window!==H,C=Mi&&window.navigator?window.navigator:void 0,G=C&&C.userAgentData?C.userAgentData:void 0,Ci=function(i,t){var e={};for(var s in i)e[s]=t[s]&&t[s].length%2===0?t[s].concat(i[s]):i[s];return e},Be=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},tt=function(i,t){if(typeof i===ce&&i.length>0){for(var e in i)if(z(i[e])==z(t))return!0;return!1}return de(i)?z(t).indexOf(z(i))!==-1:!1},Et=function(i){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)},de=function(i){return typeof i===Je},je=function(i){if(i){for(var t=[],e=$(/\\?\"/g,i).split(","),s=0;s<e.length;s++)if(e[s].indexOf(";")>-1){var n=be(e[s]).split(";v=");t[s]={brand:n[0],version:n[1]}}else t[s]=be(e[s]);return t}},z=function(i){return de(i)?i.toLowerCase():i},Qe=function(i){return de(i)?$(/[^\d\.]/g,i).split(".")[0]:void 0},_=function(i){for(var t in i){var e=i[t];typeof e==ce&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},$=function(i,t){return de(t)?t.replace(i,re):t},me=function(i){return $(/\\?\"/g,i)},be=function(i,t){if(de(i))return i=$(/^\s\s*/,i),typeof t===H?i:i.substring(0,Ze)},vt=function(i,t){if(!(!i||!t))for(var e=0,s,n,c,a,h,g;e<t.length&&!h;){var p=t[e],f=t[e+1];for(s=n=0;s<p.length&&!h&&p[s];)if(h=p[s++].exec(i),h)for(c=0;c<f.length;c++)g=h[++n],a=f[c],typeof a===ce&&a.length>0?a.length===2?typeof a[1]==Ke?this[a[0]]=a[1].call(this,g):this[a[0]]=a[1]:a.length===3?typeof a[1]===Ke&&!(a[1].exec&&a[1].test)?this[a[0]]=g?a[1].call(this,g,a[2]):void 0:this[a[0]]=g?g.replace(a[1],a[2]):void 0:a.length===4&&(this[a[0]]=g?a[3].call(this,g.replace(a[1],a[2])):void 0):this[a]=g||void 0;e+=2}},Oe=function(i,t){for(var e in t)if(typeof t[e]===ce&&t[e].length>0){for(var s=0;s<t[e].length;s++)if(tt(t[e][s],i))return e===lt?void 0:e}else if(tt(t[e],i))return e===lt?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},kt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},St={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:["VR","XR","Watch"],"?":["Desktop","Unknown"],"*":void 0},Mt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[r,[o,j+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[r,[o,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[o,r],[/opios[\/ ]+([\w\.]+)/i],[r,[o,we+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[r,[o,we+" GX"]],[/\bopr\/([\w\.]+)/i],[r,[o,we]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[r,[o,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[o,r],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[r,[o,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[r,[o,"WeChat"]],[/konqueror\/([\w\.]+)/i],[r,[o,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[r,[o,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[r,[o,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[r,[o,"Smart "+wt+Q]],[/(avast|avg)\/([\w\.]+)/i],[[o,/(.+)/,"$1 Secure"+Q],r],[/\bfocus\/([\w\.]+)/i],[r,[o,pe+" Focus"]],[/\bopt\/([\w\.]+)/i],[r,[o,we+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[r,[o,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[r,[o,"Dolphin"]],[/coast\/([\w\.]+)/i],[r,[o,we+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[r,[o,"MIUI"+Q]],[/fxios\/([\w\.-]+)/i],[r,[o,j+pe]],[/\bqihu|(qi?ho?o?|360)browser/i],[[o,"360"+Q]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[o,/(.+)/,"$1"+Q],r],[/samsungbrowser\/([\w\.]+)/i],[r,[o,Te+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[o,/_/g," "],r],[/metasr[\/ ]?([\d\.]+)/i],[r,[o,yt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[o,yt+" Mobile"],r],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[o,r],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[o],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[o,bt],r],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[o,r],[/\bgsa\/([\w\.]+) .*safari\//i],[r,[o,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[r,[o,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[r,[o,Pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[o,Pe+" WebView"],r],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[r,[o,"Android"+Q]],[/chrome\/([\w\.]+) mobile/i],[r,[o,j+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[o,r],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[r,[o,j+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[o,j+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[r,o],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[o,[r,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[o,r],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[o,j+pe],r],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[o,"Netscape"],r],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[r,[o,pe+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[o,r],[/(cobalt)\/([\w\.]+)/i],[o,[r,/[^\d\.]+./,re]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[M,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[M,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[M,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[M,"armhf"]],[/windows (ce|mobile); ppc;/i],[[M,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[M,/ower/,re,z]],[/(sun4\w)[;\)]/i],[[M,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[M,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[u,Te],[l,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[u,Te],[l,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[u,ge],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[u,ge],[l,b]],[/(macintosh);/i],[d,[u,ge]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[u,ft],[l,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[u,pt],[l,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[u,pt],[l,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[u,We],[l,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[u,We],[l,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[u,"OPPO"],[l,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[u,"Vivo"],[l,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[u,"Realme"],[l,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[u,mt],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[u,mt],[l,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[u,qe],[l,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[u,qe],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[u,wt],[l,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[u,"Nokia"],[l,m]],[/(pixel c)\b/i],[d,[u,Ie],[l,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[u,Ie],[l,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[u,Ae],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[u,Ae],[l,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[u,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[u,Ce],[l,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[u,Ce],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[d,u,[l,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[u,gt],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[u,ht],[l,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[u,ht],[l,m]],[/(nexus 9)/i],[d,[u,"HTC"],[l,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[d,/_/g," "],[l,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[u,"Acer"],[l,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[u,"Meizu"],[l,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[u,"Ulefone"],[l,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,d,[l,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,d,[l,b]],[/(surface duo)/i],[d,[u,Ue],[l,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[u,"Fairphone"],[l,m]],[/(shield[\w ]+) b/i],[d,[u,"Nvidia"],[l,b]],[/(sprint) (\w+)/i],[u,d,[l,m]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[u,Ue],[l,m]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[u,$e],[l,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[u,$e],[l,m]],[/smart-tv.+(samsung)/i],[u,[l,I]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[u,Te],[l,I]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,qe],[l,I]],[/(apple) ?tv/i],[u,[d,ge+" TV"],[l,I]],[/crkey/i],[[d,Pe+"cast"],[u,Ie],[l,I]],[/droid.+aft(\w+)( bui|\))/i],[d,[u,Ce],[l,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[u,ft],[l,I]],[/(bravia[\w ]+)( bui|\))/i],[d,[u,Ae],[l,I]],[/(mitv-\w{5}) bui/i],[d,[u,We],[l,I]],[/Hbbtv.*(technisat) (.*);/i],[u,d,[l,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,be],[d,be],[l,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,d,[l,K]],[/droid.+; (shield) bui/i],[d,[u,"Nvidia"],[l,K]],[/(playstation \w+)/i],[d,[u,Ae],[l,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[u,Ue],[l,K]],[/((pebble))app/i],[u,d,[l,X]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[u,ge],[l,X]],[/droid.+; (glass) \d/i],[d,[u,Ie],[l,X]],[/droid.+; (wt63?0{2,3})\)/i],[d,[u,$e],[l,X]],[/(quest( 2| pro)?)/i],[d,[u,bt],[l,X]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,Ye]],[/(aeobc)\b/i],[d,[u,Ce],[l,Ye]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[l,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[r,[o,Si+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[r,[o,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[o,r],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[r,o]],os:[[/microsoft (windows) (vista|xp)/i],[o,r],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[o,[r,Oe,kt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[r,Oe,kt],[o,et]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[r,/_/g,"."],[o,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[o,"macOS"],[r,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[r,o],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[o,r],[/\(bb(10);/i],[r,[o,gt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[r,[o,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[r,[o,pe+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[r,[o,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[r,[o,"watchOS"]],[/crkey\/([\d\.]+)/i],[r,[o,Pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[o,"Chrome OS"],r],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[o,r],[/(sunos) ?([\w\.\d]*)/i],[[o,"Solaris"],r],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[o,r]]},Re=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return _.call(i.init,[[T,[o,r,fe]],[O,[M]],[R,[l,d,u]],[L,[o,r]],[P,[o,r]]]),_.call(i.isIgnore,[[T,[r,fe]],[L,[r]],[P,[r]]]),_.call(i.isIgnoreRgx,[[T,/ ?browser$/i],[P,/ ?os$/i]]),_.call(i.toString,[[T,[o,r]],[O,[M]],[R,[u,d]],[L,[o,r]],[P,[o,r]]]),i}(),Ii=function(i,t){var e=Re.init[t],s=Re.isIgnore[t]||0,n=Re.isIgnoreRgx[t]||0,c=Re.toString[t]||0;function a(){_.call(this,e)}return a.prototype.getItem=function(){return i},a.prototype.withClientHints=function(){return G?G.getHighEntropyValues(_t).then(function(h){return i.setCH(new Ft(h,!1)).parseCH().get()}):i.parseCH().get()},a.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=Y&&(a.prototype.is=function(h){var g=!1;for(var p in this)if(this.hasOwnProperty(p)&&!tt(s,p)&&z(n?$(n,this[p]):this[p])==z(n?$(n,h):h)){if(g=!0,h!=H)break}else if(h==H&&g){g=!g;break}return g},a.prototype.toString=function(){var h=re;for(var g in c)typeof this[c[g]]!==H&&(h+=(h?" ":re)+this[c[g]]);return h||H}),G||(a.prototype.then=function(h){var g=this,p=function(){for(var A in g)g.hasOwnProperty(A)&&(this[A]=g[A])};p.prototype={is:a.prototype.is,toString:a.prototype.toString};var f=new p;return h(f),f}),new a};function Ft(i,t){if(i=i||{},_.call(this,_t),t)_.call(this,[[it,je(i[q])],[st,je(i[mi])],[m,/\?1/.test(i[Ei])],[d,me(i[vi])],[J,me(i[Lt])],[nt,me(i[ki])],[M,me(i[fi])],[W,je(i[yi])],[De,me(i[bi])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==H&&(this[e]=i[e])}function Ct(i,t,e,s){return this.get=function(n){return n?this.data.hasOwnProperty(n)?this.data[n]:void 0:this.data},this.set=function(n,c){return this.data[n]=c,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(C&&C.userAgent==this.ua)switch(this.itemType){case T:C.brave&&typeof C.brave.isBrave==Ke&&this.set(o,"Brave");break;case R:!this.get(l)&&G&&G[m]&&this.set(l,m),this.get(d)=="Macintosh"&&C&&typeof C.standalone!==H&&C.maxTouchPoints&&C.maxTouchPoints>2&&this.set(d,"iPad").set(l,b);break;case P:!this.get(o)&&G&&G[J]&&this.set(o,G[J]);break;case Y:var n=this.data,c=function(a){return n[a].getItem().detectFeature().get()};this.set(T,c(T)).set(O,c(O)).set(R,c(R)).set(L,c(L)).set(P,c(P))}return this},this.parseUA=function(){return this.itemType!=Y&&vt.call(this.data,this.ua,this.rgxMap),this.itemType==T&&this.set(fe,Qe(this.get(r))),this},this.parseCH=function(){var n=this.uaCH,c=this.rgxMap;switch(this.itemType){case T:var a=n[st]||n[it],h;if(a)for(var g in a){var p=$(/(Google|Microsoft) /,a[g].brand||a[g]),f=a[g].version;!/not.a.brand/i.test(p)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(p))&&(this.set(o,p).set(r,f).set(fe,Qe(f)),h=p)}break;case O:var A=n[M];A&&(A&&n[De]=="64"&&(A+="64"),vt.call(this.data,A+";",c));break;case R:if(n[m]&&this.set(l,m),n[d]&&this.set(d,n[d]),n[d]=="Xbox"&&this.set(l,K).set(u,Ue),n[W]){var D;if(typeof n[W]!="string")for(var B=0;!D&&B<n[W].length;)D=Oe(n[W][B++],St);else D=Oe(n[W],St);this.set(l,D)}break;case P:var le=n[J];if(le){var U=n[nt];le==et&&(U=parseInt(Qe(U),10)>=13?"11":"10"),this.set(o,le).set(r,U)}this.get(o)==et&&n[d]=="Xbox"&&this.set(o,"Xbox").set(r,void 0);break;case Y:var Bt=this.data,ue=function(Gt){return Bt[Gt].getItem().setCH(n).parseCH().get()};this.set(T,ue(T)).set(O,ue(O)).set(R,ue(R)).set(L,ue(L)).set(P,ue(P))}return this},_.call(this,[["itemType",i],["ua",t],["uaCH",s],["rgxMap",e],["data",Ii(this,i)]]),this}function F(i,t,e){if(typeof i===ce?(Et(i)?(typeof t===ce&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===Je&&!Et(t)&&(e=t,t=void 0),!(this instanceof F))return new F(i,t,e).getResult();var s=typeof i===Je?i:C&&C.userAgent?C.userAgent:e&&e[ut]?e[ut]:re,n=new Ft(e,!0),c=t?Ci(Mt,t):Mt,a=function(h){return h==Y?function(){return new Ct(h,s,c,n).set("ua",s).set(T,this.getBrowser()).set(O,this.getCPU()).set(R,this.getDevice()).set(L,this.getEngine()).set(P,this.getOS()).get()}:function(){return new Ct(h,s,c[h],n).parseUA().get()}};return _.call(this,[["getBrowser",a(T)],["getCPU",a(O)],["getDevice",a(R)],["getEngine",a(L)],["getOS",a(P)],["getResult",a(Y)],["getUA",function(){return s}],["setUA",function(h){return de(h)&&(s=h.length>Ze?be(h,Ze):h),this}]]).setUA(s),this}F.VERSION=wi;F.BROWSER=Be([o,r,fe]);F.CPU=Be([M]);F.DEVICE=Be([d,u,l,K,m,I,b,X,Ye]);F.ENGINE=F.OS=Be([o,r]);class Dt{constructor(t,e){w(this,"trackers");w(this,"config");this.trackers=t,this.config=e}on(t,e,s){const n=function(a){a.data.message!==`kalamba:wrapper-telemetry:${t}`&&a.data.message!==`kalamba:wrapper:${t}`||e(a.data.payload)};window.addEventListener("message",n,s)}track(t,e){this.trackers.forEach(s=>s.track(t,e))}}function It(i){return i.reduce((t,e)=>t+e,0)}function Ti(i){const t=i.length,e=It(i)/t,s=i.map(c=>Math.pow(c-e,2)),n=It(s)/t;return Math.sqrt(n)}class Tt{constructor(){w(this,"rafId",-1);w(this,"startTime",0);w(this,"stopTime",0);w(this,"frames",[]);w(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(e=>Math.floor((e-this.startTime)/1e3)).reduce((e,s,n,c)=>(c[n]!==c[n-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});w(this,"getReport",()=>{const t=this.calculateFPS(),e=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),s=t.length>0?Math.max(...t):e,n=t.length>0?Math.min(...t):e,c=t.length>0?Ti(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:n,fpsStdDev:c}});w(this,"start",()=>{this.startTime=Date.now(),this.trackFrames()});w(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});w(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Ai="landscape",Pi="portrait";function Ri(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function xi(){if(!window.createImageBitmap)return!1;const e=await(await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();try{return await createImageBitmap(e),!0}catch{return!1}}function Xe(){return window.innerWidth>=window.innerHeight?Ai:Pi}var Le,ee,te,ie,ve,_e,ke,Fe;class Ui extends Dt{constructor(...e){super(...e);w(this,"FPS_SAMPLE_INTERVAL",1e4);v(this,Le,0);v(this,ee,"");v(this,te,void 0);v(this,ie,void 0);v(this,ve,!1);v(this,_e,!1);v(this,ke,"");v(this,Fe,[]);E(this,te,{}),E(this,ie,this.deviceInfo()),this.on("state",({balance:s,version:n})=>{E(this,ee,n),E(this,Le,s)}),this.on("autoplay",({action:s})=>{["start","resume"].includes(s)?E(this,ve,!0):E(this,ve,!1)}),this.on("settings",({fastPlay:s})=>{s!==void 0&&E(this,_e,s)}),this.registerEvents()}async registerEvents(){y(this,ie).then(e=>{this.track("Device Information",e)}),this.on("loadStart",()=>{this.track("Game Loading",{progress:0,step:"initial"})}),this.on("loadProgress",e=>{this.track("Game Loading",{progress:e.progress})}),this.on("loadEnd",()=>{this.track("Game Loading",{progress:100,step:"complete"})}),this.on("error",e=>{this.track("System Message",{systemMessageText:e.messageKey,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{E(this,ke,e.data.gameState.stateTypeNextRound),E(this,te,{balanceInCoins:e.balance,clientVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,defaultBaseBet:e.data.additionalConfigData.defaultBet.baseBet,defaultBetMultiplier:e.data.additionalConfigData.defaultBet.betMultiplier,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,gameModelFile:e.data.additionalConfigData.gameModelFile,jurisdiction:this.config.api.jurisdiction,languageCode:this.config.ui.language,operatorName:"kalamba",partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,referrer:window.location.hostname,serverVersion:e.data.gameConfigData.metaData.version}),this.track("Game Open",y(this,te))}),this.on("playCycleEnd",async e=>{const s=await y(this,ie),{baseBet:n,betMultiplier:c,specialAction:a}=e.data.gameState.lastPlacedMainGameBet??{},h=e.balance,g=e.data.gameState.totalBetFromCurrentGameCycle,p=e.data.gameState.totalWinFromCurrentGameCycle,f=p-g,A=a||"spin",D=e.data.gameState.cycleId;this.track("Betting Activity",{balance:h-f,balanceAfter:h,baseBet:n,betMultiplier:c,betType:A,gameVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,isMobile:s.isMobile,netResult:f,operatorName:"kalamba",orientation:Xe(),partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,roundId:D,roundTypes:["BaseGame"],totalBet:g,totalWin:p}),E(this,Fe,[])}),this.on("telemetry.click",e=>{this.track("UI Interaction",{action:"click",...this.getExtraUiInteractionData(),...e})}),this.on("telemetry.orientationChange",()=>{this.track("UI Interaction",{action:"orientationChange",...this.getExtraUiInteractionData()})}),this.reportFpsSample(),this.reportFpsRound()}reportFpsSample(){const e=new Tt,s=()=>{e.stop();const c=e.getReport();this.track("FPS Performance",{...c,fpsType:"sample"}),n()},n=async()=>{e.start(),setTimeout(s,this.FPS_SAMPLE_INTERVAL)};n()}reportFpsRound(){const e=new Tt;this.on("playCycleStart",()=>{e.start()}),this.on("playCycleEnd",()=>{e.stop();const s=e.getReport();this.track("FPS Performance",{...s,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Xe(),stateType:y(this,ke)}}async deviceInfo(){var g;const e=new F(navigator.userAgent),s=Ri(),n=await xi(),c=e.getBrowser(),a=e.getDevice(),h=e.getOS();return{browserName:c.name,browserVersion:c.version,connection:(g=navigator.connection)==null?void 0:g.effectiveType,deviceName:a.model,deviceType:a.type,isMobile:["mobile","tablet"].includes(a.type??""),isWebGLSupported:s,isWebPSupported:n,manufacturer:a.vendor,operatingSystem:h.name,operatingSystemVersion:h.version,orientation:Xe(),pixelRatio:window.devicePixelRatio,screenHeight:window.screen.height,screenSize:`${window.screen.width}x${window.screen.height}`,screenWidth:window.screen.width,timezoneOffsetMinutes:new Date().getTimezoneOffset(),windowHeight:window.innerHeight,windowSize:`${window.innerWidth}x${window.innerHeight}`,windowWidth:window.innerWidth}}}Le=new WeakMap,ee=new WeakMap,te=new WeakMap,ie=new WeakMap,ve=new WeakMap,_e=new WeakMap,ke=new WeakMap,Fe=new WeakMap;let xe;const Oi=new Uint8Array(16);function Li(){if(!xe&&(xe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xe(Oi)}const S=[];for(let i=0;i<256;++i)S.push((i+256).toString(16).slice(1));function _i(i,t=0){return S[i[t+0]]+S[i[t+1]]+S[i[t+2]]+S[i[t+3]]+"-"+S[i[t+4]]+S[i[t+5]]+"-"+S[i[t+6]]+S[i[t+7]]+"-"+S[i[t+8]]+S[i[t+9]]+"-"+S[i[t+10]]+S[i[t+11]]+S[i[t+12]]+S[i[t+13]]+S[i[t+14]]+S[i[t+15]]}const Fi=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),At={randomUUID:Fi};function Pt(i,t,e){if(At.randomUUID&&!t&&!i)return At.randomUUID();i=i||{};const s=i.random||(i.rng||Li)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t){e=e||0;for(let n=0;n<16;++n)t[e+n]=s[n];return t}return _i(s)}class at{constructor(t){w(this,"config");this.config=t}}const Rt=25,xt=1e4;var se,ne,ae,N,Se;class Di extends at{constructor(...e){super(...e);v(this,se,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");v(this,ne,void 0);v(this,ae,void 0);v(this,N,[]);v(this,Se,void 0);w(this,"processQueueForced");E(this,ne,new Date().getTime()),E(this,N,[]),E(this,Se,Pt()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,se),{method:"OPTIONS"}).catch(rt.noop),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){y(this,ae)&&clearTimeout(y(this,ae)),E(this,ae,window.setTimeout(()=>this.processQueue(),xt))}send(e){E(this,ne,new Date().getTime());try{navigator.sendBeacon(y(this,se),JSON.stringify(e))}catch{fetch(y(this,se),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(rt.noop)}this.schedule()}addToQueue(e){y(this,N).push(e),this.processQueue()}processQueue(e=!1){if(!(this.config==null||!this.config.ui.feature.allowTelemetry)&&!(!e&&y(this,N).length<Rt&&new Date().getTime()-y(this,ne)<xt))for(;y(this,N).length;){const s=y(this,N).splice(0,Rt).map(n=>({...n,sessionID:y(this,Se),userID:this.config.api.user}));this.send(s)}}track(e,s){this.addToQueue({eventName:e,eventParams:s,eventTimestamp:new Date().getTime(),eventUUID:Pt()})}}se=new WeakMap,ne=new WeakMap,ae=new WeakMap,N=new WeakMap,Se=new WeakMap;const Bi=x("LoggingTracker","color:#000000;font-weight:bold;");class Gi extends at{track(t,e){Bi(`@${this.config.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=qt;exports.CasinoPlugin=V;exports.DebuggingPlugin=$t;exports.GigPlugin=Qt;exports.KalambaBullseyePlugin=pi;exports.KalambaStargazerPlugin=Ui;exports.KalambaStargazerTracker=Di;exports.LoggingTracker=Gi;exports.OryxPlugin=Kt;exports.PariplayPlugin=ei;exports.RelaxFEIMPlugin=ti;exports.RgsPlygin=Ot;exports.TelemetryPlugin=Dt;exports.Tracker=at;exports.TukoPlugin=si;
|
|
5
|
+
"use strict";var Vt=Object.defineProperty;var zt=(i,e,t)=>e in i?Vt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var p=(i,e,t)=>(zt(i,typeof e!="symbol"?e+"":e,t),t),rt=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var y=(i,e,t)=>(rt(i,e,"read from private field"),t?t.call(i):e.get(i)),E=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},v=(i,e,t,n)=>(rt(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ct=require("./noop-b3c54b76.cjs");function U(i,e){return(t,...n)=>{console.log(`[%c${i}\x1B[m] %s`,e,t,...n)}}function Lt(i,e){return Math.round(i*100/e)}class q{constructor(e){p(this,"config");this.config=e}on(e,t,n){const a=function(s){s.data.message!==`kalamba:wrapper-casino:${e}`&&s.data.message!==`kalamba:wrapper:${e}`||t(s.data.payload)};window.addEventListener("message",a,n)}send(e,...[t]){window.postMessage({message:`kalamba:casino:${e}`,payload:t})}}const qt=U("BasicPlugin","color:#000000;font-weight:bold;");class Gt extends q{constructor(...e){super(...e),this.registerToSdkEvents(),this.registerFromSdkEvents(),qt("configured")}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:t,payload:n}=e.data;switch(t){case"doAudioSettings":this.send("settings",{music:n==null?void 0:n.musicEnabled,sounds:n==null?void 0:n.soundEnabled});return;case"doBalanceUpdate":const{currency:a,coinValueInCents:c}=this.config.api;n.currency===a&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:Lt(n.balanceInCurrency,c)}):(n.balanceInCoins,this.send("balance",{balance:n.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const k=U("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),Wt=U("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class $t extends q{constructor(...e){super(...e),this.registerDebugToSdkEvents(),this.registerSdkToDebugEvents()}registerDebugToSdkEvents(){window.DebuggingPlugin={balance:e=>this._send("balance",e),bet:e=>this._send("bet",e),choice:e=>this._send("choice",e),close:e=>this._send("close",e),help:e=>this._send("help",e),history:e=>this._send("history",e),freeze:e=>this._send("freeze",e),paytable:e=>this._send("paytable",e),settings:e=>this._send("settings",e),suspend:e=>this._send("suspend",e),unfreeze:e=>this._send("unfreeze",e)}}registerSdkToDebugEvents(){this.on("autoplay",e=>k("autoplay",e)),this.on("balance",e=>k("balance",e)),this.on("bet",e=>k("bet",e)),this.on("cashier",e=>k("cashier",e)),this.on("choice",e=>k("choice",e)),this.on("close",e=>k("close",e)),this.on("error",e=>k("error",e)),this.on("loadEnd",e=>k("loadEnd",e)),this.on("loadProgress",e=>k("loadProgress",e)),this.on("loadStart",e=>k("loadStart",e)),this.on("playCycleStart",e=>k("playCycleStart",e)),this.on("playCycleEnd",e=>k("playCycleEnd",e)),this.on("playEnd",e=>k("playEnd",e)),this.on("playError",e=>k("playError",e)),this.on("playReady",e=>k("playReady",e)),this.on("playStart",e=>k("playStart",e)),this.on("settings",e=>k("settings",e))}_send(...e){Wt(...e),this.send(...e)}}const jt=U("GigPlugin","color:#000000;font-weight:bold;");class Qt extends q{constructor(...e){super(...e),this.registerToSdkEvents(),this.registerFromSdkEvents(),jt("configured")}postMessage(e){const t={event:e};window.top.postMessage(t,"*")}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{data:t}=e;switch(t){case"STOP_AUTO_PLAY":this.send("suspend");return;case"BLOCK_BETS":this.send("freeze");return;case"UNBLOCK_BETS":this.send("unfreeze");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}}),this.on("playReady",()=>{this.postMessage("GAME_READY")})}}const Xt=U("OryxPlugin","color:#000000;font-weight:bold;");class Kt extends q{constructor(...e){super(...e),this.registerToSdkEvents(),this.registerFromSdkEvents(),Xt("configured")}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:t,param:n}=e.data;switch(t){case"doBalanceUpdate":this.send("balance",{balance:n});return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let e=0;this.on("close",()=>{window.top.postMessage({wpgaction:"close"},"*"),window.parent.postMessage({wpgaction:"close.parent"},"*")}),this.on("balance",({balance:t})=>{e!==t&&(e=t,window.top.postMessage({param:{},wpgaction:"balance"},"*"),window.parent.postMessage({param:{},wpgaction:"balance.parent"},"*"))}),this.on("loadStart",()=>{window.top.postMessage({wpgaction:"loadStart"},"*"),window.parent.postMessage({wpgaction:"loadStart.parent"},"*")}),this.on("loadEnd",()=>{window.top.postMessage({wpgaction:"loadEnd"},"*"),window.parent.postMessage({wpgaction:"loadEnd.parent"},"*")}),this.on("playStart",()=>{window.top.postMessage({wpgaction:"gameSpinStart"},"*"),window.parent.postMessage({wpgaction:"gameSpinStart.parent"},"*")}),this.on("playEnd",()=>{window.top.postMessage({wpgaction:"gameSpinEnd"},"*"),window.parent.postMessage({wpgaction:"gameSpinEnd.parent"},"*")}),this.on("cashier",({type:t})=>{switch(t){case"BALANCE_LOW":window.top.postMessage({wpgaction:"cashier"},"*"),window.parent.postMessage({wpgaction:"cashier.parent"},"*");break;case"BALANCE_INSUFFICIENT":window.top.postMessage({wpgaction:"errorOutOfMoney"},"*"),window.parent.postMessage({wpgaction:"errorOutOfMoney.parent"},"*");break}})}}const dt=U("PariplayPlugin","color:#000000;font-weight:bold;");function He(i){try{window.top.location=i}catch{window.location=i}}function Ve(i,e){return new Promise(function(n,a){const c=new XMLHttpRequest;c.onload=function(){c.status>=200&&c.status<300?n(c.responseText):a(c.responseText)},c.open(i,e),c.send()})}function ze(){}function Jt(i){return i.filter(function(t){return t.messageType.toUpperCase()==="DATA"})}function qe(i){return i.filter(function(t){return["NOTIFICATION","POPUP"].includes(t.messageType.toUpperCase())})}function Bt(i){try{return JSON.parse(i.text)}catch{return{}}}function Yt(i){return i.map(Bt).filter(Boolean).find(function(t){return t.betId!=null&&t.winId!=null})||{}}function Zt(i){return i.map(Bt).filter(Boolean).find(function(t){return t.TotalBet!=null&&t.TotalWin!=null})||{}}class ei extends q{constructor(...e){super(...e),this.registerToSdkEvents(),this.registerFromSdkEvents(),dt("configured")}postMessage(e,t){const n={lang:this.config.ui.language,sender:this.config.api.game,type:e};t!=null&&(n.data=t),dt("postMessage",n),window.parent.postMessage(n,"*")}coinsToCurrency(e){return e*this.config.api.coinValueInCents/100}handleContinueButton(e,t){e.link&&Ve("GET",e.link),t()}handleLinkButton(e,t){switch(e.linkType.toUpperCase()){case"AJAX":Ve("GET",e.link),t();return;case"AJAXRESPONSE":Ve("GET",e.link).then(()=>{t()});return;case"REDIRECT":He(e.link),t();return}}handleQuitButton(e,t){this.send("close"),t()}handleCashierButton(e,t){this.send("cashier",{type:"ON_DEMAND"}),t()}handleHistoryButton(e,t){this.send("history",{source:"casino"}),t()}get buttonActions(){return{CASHIER:this.handleCashierButton,CONTINUE:this.handleContinueButton,HISTORY:this.handleHistoryButton,LINK:this.handleLinkButton,QUIT:this.handleQuitButton}}processInfoUiMessages(e){return e.reduce((t,n)=>t.then(()=>new Promise(a=>{Object.assign({},n,{buttons:n.buttons.filter(c=>c.action.toUpperCase()==="CASHIER"?!!this.config.api.cashierUrl:!0).map(c=>Object.assign({},c,{onRelease:()=>{const s=n.messageType.toUpperCase()==="POPUP"?ze:a,h=this.buttonActions[c.action.toUpperCase()];h?h(c,s):s()}}))})}).catch(ze)),Promise.resolve()).then(()=>{}).catch(ze)}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:t}=e.data;switch(t){case"pause":case"disableSpin":this.send("freeze");return;case"resume":case"enableSpin":this.send("unfreeze");return;case"stopAutobet":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){let e=0;this.on("openGameResponse",t=>{let n;try{const a=JSON.parse(JSON.parse(atob(this.config.api.integrationData.token.split(".")[1])).token),c=JSON.parse(a.integrationSpecificAttributes.sessionData||"{}");n={ClientToken:a.integrationSpecificAttributes.clientToken,CurrencyCode:a.currency,PlayerTokenId:a.user,SessionData:c}}catch{n=void 0}this.postMessage("gameDataLoaded",{LoadGameData:n,success:!0});try{const a=qe(t.data.uiMessages);this.processInfoUiMessages(a)}catch{}}),this.on("balance",({balance:t})=>{e!==t&&(e=t,this.postMessage("balance",{amount:this.coinsToCurrency(t)}))}),this.on("close",()=>{if(this.config.api.homeUrl)if(this.config.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.config.api.homeUrl==="(api)"?this.postMessage("quit"):He(this.config.api.homeUrl)}),this.on("playEnd",t=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(t.balance),win:this.coinsToCurrency(t.data.gameRoundResult.win)});try{const n=qe(t.data.uiMessages);this.processInfoUiMessages(n)}catch{}}),this.on("playError",t=>{this.postMessage("ticketReceived",{ErrorCode:t.data.data.data.operatorSpecificErrorCode,ErrorMessage:t.data.data.data.operatorSpecificErrorMessage,Status:{ErrCode:t.data.data.data.operatorSpecificErrorCode}})}),this.on("playResponse",t=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(t.balance+t.data.gameState.totalBetFromCurrentGameCycle)});const n=t.data.gameState.stateTypeThisRound==="BaseGame",a=Jt(t.data.uiMessages),c=qe(t.data.uiMessages),s=Yt(a),h=Zt(a);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(t.balance),BetAmount:n?this.coinsToCurrency(t.data.gameState.totalBetFromCurrentGameCycle):0,CreditTransactionId:s.betId,DebitTransactionId:s.winId,Message:c,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(t.data.gameRoundResult.win)})}),this.on("playStart",t=>{t.bet&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(t.bet.base*t.bet.multiplier)})}),this.on("loadEnd",()=>{this.postMessage("gameReady")}),this.on("loadStart",()=>{this.postMessage("onAppFrameReady")}),this.on("cashier",()=>{this.config.api.cashierUrl&&(this.config.api.cashierUrl==="(api)"?this.postMessage("cashier"):He(this.config.api.cashierUrl))})}}const ue=U("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ti extends q{constructor(...t){super(...t);p(this,"VERSION","1.15.0");const n=document.createElement("script");n.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,n.onload=()=>{ue("loaded"),window.FEIM.configure({p2pConfig:{currency:this.config.api.currency,launchParams:{homeurl:"homeUrl"}}}),ue("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(n)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>ue("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>ue("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>ue("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{this.send("help",{})}),window.FEIM.on.togglePaytable(()=>{this.send("paytable",{})}),window.FEIM.on.unfreeze(()=>this.send("unfreeze")),window.FEIM.on.updateSettings(({payload:[t]})=>this.send("settings",{sounds:t.sounds,fastPlay:t.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:t})=>{switch(t){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:t})=>{window.FEIM.send.balanceUpdate(t)}),this.on("bet",({base:t,multiplier:n})=>{window.FEIM.send.betUpdate(t*n)}),this.on("error",({message:t})=>{window.FEIM.send.errorMessage(t)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:t})=>{window.FEIM.send.gameLoadProgress(t)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",t=>{const n={balance:t.contract.balance.coins,bet:t.contract.bet.lastPaid.base*t.contract.bet.lastPaid.multiplier,win:{win:t.contract.win.total}};window.FEIM.send.roundFinished(n)}),this.on("playResponse",t=>{const n={balance:t.contract.balance.coins,playResponse:t.data};window.FEIM.send.roundStarted(n)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",t=>{window.FEIM.send.updateSettings(t)})}}const Ge=U("TukoPlugin","color:#000000;font-weight:bold;");class ii extends q{constructor(...t){super(...t);p(this,"PING_INTERVAL",1e4);const a=new URLSearchParams(window.location.search).get("pingCallbackUrl");a&&window.setInterval(()=>{this.ping(a)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),Ge("configured")}ping(t){const n=new XMLHttpRequest;n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&(n.status===0||n.status>=200&&n.status<400?Ge("ping ok",n):Ge("ping error",n))},n.open("GET",t),n.send()}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n,payload:a}=t.data;switch(n){case"doAudioSettings":this.send("settings",{music:a==null?void 0:a.musicEnabled,sounds:a==null?void 0:a.soundEnabled});return;case"doBalanceUpdate":const{currency:c,coinValueInCents:s}=this.config.api;a.currency===c&&typeof a.balanceInCurrency=="number"?this.send("balance",{balance:Lt(a.balanceInCurrency,s)}):(a.balanceInCoins,this.send("balance",{balance:a.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.config.api.homeUrl)try{window.top.location=this.config.api.homeUrl}catch{window.location=this.config.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}class Ft{constructor(e){p(this,"config");this.config=e}on(e,t,n){const a=function(s){s.data.message!==`kalamba:wrapper-rgs:${e}`&&s.data.message!==`kalamba:wrapper:${e}`||t(s.data.payload)};window.addEventListener("message",a,n)}send(e,...[t]){window.postMessage({message:`kalamba:rgs:${e}`,payload:t})}}class ni{constructor(e){p(this,"socket",null);p(this,"webSocketUrl");p(this,"eventListeners",{close:[],error:[],message:[]});p(this,"connect",()=>{const e=new WebSocket(this.webSocketUrl);return e.addEventListener("message",this.handleMessage),new Promise(t=>{e.addEventListener("open",n=>{this.handleOpen(n),t(this.socket)})})});p(this,"send",e=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(e)});p(this,"close",()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close(),this.addEventListener("error",e=>{console.log(e)})});p(this,"handleClose",e=>{this.eventListeners.close.forEach(t=>{t(e)})});p(this,"handleError",e=>{this.eventListeners.error.forEach(t=>{t(e)})});p(this,"handleMessage",e=>{this.eventListeners.message.forEach(t=>{t(e)})});p(this,"handleOpen",e=>{const t=e.target;t.addEventListener("close",this.handleClose),t.addEventListener("error",this.handleError),this.socket=t});this.webSocketUrl=e}addEventListener(e,t){this.eventListeners[e].push(t)}removeEventListener(e,t){const n=this.eventListeners[e].indexOf(t);n!==-1&&this.eventListeners[e].splice(n,1)}}function Te(i){try{return JSON.parse(i==null?void 0:i.data)}catch(e){return console.error("fakap",e),null}}function be(i){var e;return((e=i==null?void 0:i.header)==null?void 0:e.name)==="GameEvent"}function ai(i){return be(i)&&i.body.event==="OPEN_GAME"}function si(i){return be(i)&&i.body.event==="SPIN_ERROR"}function oi(i){return be(i)&&i.body.event.includes("_RESULT")}function ri(i){var e;return((e=i==null?void 0:i.header)==null?void 0:e.name)==="OpenGame"}function ci(i){var e;return((e=i==null?void 0:i.header)==null?void 0:e.name)==="Ping"}function lt(i){var e;return((e=i==null?void 0:i.header)==null?void 0:e.name)==="RealityCheck"}var Z,ye;class di extends ni{constructor(t,n){const a=new URL(t.apiUrl);a.searchParams.set("cageCode",t.cageCode),a.searchParams.set("gameCode",t.gameCode),a.searchParams.set("operatorCode",t.operatorCode),a.searchParams.set("playMode",t.playMode),a.searchParams.set("token",t.token),a.searchParams.set("username",t.username);super(a.toString());p(this,"cId",0);p(this,"mId",0);p(this,"seqId",10);p(this,"gameCode");E(this,Z,void 0);E(this,ye,void 0);p(this,"onMessage",t=>{const n=Te(t);(be(n)||ci(n)||lt(n))&&this.sendAcknowledgement(n),lt(n)&&this.handleRealityCheck(n)});this.eventListeners.realityCheck=[],this.gameCode=t.gameCode,v(this,Z,n.requestTimeoutMs),v(this,ye,n.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(t){this.eventListeners.realityCheck.forEach(n=>{n(t.body)})}addEventListener(t,n){super.addEventListener(t,n)}removeEventListener(t,n){super.removeEventListener(t,n)}buildHeader(t,n=null){return{cId:n??++this.cId,code:n!==null?1:void 0,mId:++this.mId,name:t}}buildPayload(t,n){return JSON.stringify({body:n,header:t})}getBodyExtras(t){return{action:t,seqId:++this.seqId}}request(t,n){const a=this.buildPayload(t,n);return new Promise((c,s)=>{setTimeout(()=>s({request:{body:n,header:t},type:"timeout"}),y(this,Z));const h=g=>{const w=Te(g);try{t.cId===(w==null?void 0:w.header.cId)&&(this.removeEventListener("message",h),w.header.code===1?c(w):s({response:w,type:"response"}))}catch{s({response:w,type:"error"})}};this.addEventListener("message",h),this.send(a)})}activateFreeRound(t){const n=this.buildHeader("ActivateFreeRound");return this.request(n,t)}authenticate(t=!1){const n=this.buildHeader("Authenticate"),a={clientType:3,version:y(this,ye),reconnect:t};return this.request(n,a).then(c=>c.body)}openGame(){const t=this.buildHeader("OpenGame"),n={gameCode:this.gameCode};return new Promise((a,c)=>{const s=h=>{const g=Te(h);ai(g)&&(this.removeEventListener("message",s),a(g.body))};this.addEventListener("message",s),this.request(t,n).catch(h=>{ri(h.response)&&c(h),c(h)})})}sendAcknowledgement(t){const{name:n,cId:a}=t.header,c=this.buildHeader(n,a),s=this.buildPayload(c,{});this.send(s)}sendAction(t,n){const a=this.buildHeader("GameAction"),c={...this.getBodyExtras(t),data:n};return new Promise((s,h)=>{const g=w=>{const m=Te(w);be(m)&&c.seqId===m.body.correlationSeqId&&(this.removeEventListener("message",g),oi(m)?s(m.body):si(m)&&h(m.body))};this.addEventListener("message",g),this.request(a,c).catch(w=>{h(w)})})}setRequestTimeoutMs(t){v(this,Z,t)}}Z=new WeakMap,ye=new WeakMap;function li(i){return i.contract?{contract:{balance:{coins:i.contract.balance,version:i.contract.balanceVersion},coinValueInCents:i.contract.coinValueInCents,country:i.contract.countryCode,currency:i.contract.currencyCode,jurisdiction:i.contract.jurisdictionCode,uiMessages:i.contract.uiMessages,username:i.contract.username}}:{contract:{balance:{coins:i.balance,version:i.balanceVersion},coinValueInCents:i.coinValueInCents,country:i.countryCode,currency:i.currencyCode,jurisdiction:i.jurisdictionCode,uiMessages:i.uiMessages,username:i.username}}}function ui(i,e){return e.contract?{contract:{bet:{available:e.contract.availableMultipliersPerBaseBet,default:{base:e.contract.defaultBet.baseBet,multiplier:e.contract.defaultBet.betMultiplier},max:e.contract.maxBetInCoins,last:e.contract.lastBet?{base:e.contract.lastBet.baseBet,multiplier:e.contract.lastBet.betMultiplier}:null,lastPaid:e.contract.lastMainGameBet?{base:e.contract.lastMainGameBet.baseBet,multiplier:e.contract.lastMainGameBet.betMultiplier}:null},balance:{coins:e.contract.balanceInCoins,version:e.contract.balanceVersion},gameModel:e.contract.gameModelFile,metaData:e.contract.metaData,serverTime:e.contract.serverTime,sessionId:e.contract.sessionId,stateType:{thisRound:e.contract.stateTypeThisRound,nextRound:e.contract.stateTypeNextRound},uiMessages:i.contract.uiMessages.concat(e.contract.uiMessages),win:{round:e.contract.roundWin,total:e.contract.totalWin}},data:e.opaqueGameServerToUi}:{contract:{bet:{available:e.data.additionalConfigData.availableMultipliersPerBaseBet,default:{base:e.data.additionalConfigData.defaultBet.baseBet,multiplier:e.data.additionalConfigData.defaultBet.betMultiplier},max:e.data.additionalConfigData.maxAllowedOverallBetInCoins,last:e.data.gameState.betFromCurrentRound?{base:e.data.gameState.betFromCurrentRound.baseBet,multiplier:e.data.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:e.data.gameState.lastPlacedMainGameBet?{base:e.data.gameState.lastPlacedMainGameBet.baseBet,multiplier:e.data.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:e.balance,version:e.balanceVersion},gameModel:e.data.additionalConfigData.gameModelFile,metaData:e.data.gameConfigData.metaData,serverTime:e.balanceVersion,sessionId:e.data.gameState.sessionId,stateType:{thisRound:e.data.gameState.stateTypeThisRound,nextRound:e.data.gameState.stateTypeNextRound},uiMessages:i.uiMessages,win:{round:e.data.gameState.totalWinFromCurrentRound,total:e.data.gameState.totalWinFromCurrentGameCycle}},data:e.data}}function hi(i){return i.contract?{contract:{bet:{last:i.contract.lastBet?{base:i.contract.lastBet.baseBet,multiplier:i.contract.lastBet.betMultiplier}:null,lastPaid:{base:i.contract.lastMainGameBet.baseBet,multiplier:i.contract.lastMainGameBet.betMultiplier}},balance:{coins:i.contract.balanceInCoins,version:i.contract.balanceVersion},serverTime:i.contract.serverTime,roundId:i.contract.roundId,stateType:{thisRound:i.contract.stateTypeThisRound,nextRound:i.contract.stateTypeNextRound},uiMessages:i.contract.uiMessages,win:{round:i.contract.roundWin,total:i.contract.totalWin}},data:i.opaqueGameServerToUi}:{contract:{bet:{last:i.data.gameState.betFromCurrentRound?{base:i.data.gameState.betFromCurrentRound.baseBet,multiplier:i.data.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:i.data.gameState.lastPlacedMainGameBet.baseBet,multiplier:i.data.gameState.lastPlacedMainGameBet.betMultiplier}},balance:{coins:i.balance,version:i.balanceVersion},serverTime:i.balanceVersion,roundId:i.data.gameState.cycleId,stateType:{thisRound:i.data.gameState.stateTypeThisRound,nextRound:i.data.gameState.stateTypeNextRound},uiMessages:i.data.uiMessages,win:{round:i.data.gameState.totalWinFromCurrentRound,total:i.data.gameState.totalWinFromCurrentGameCycle}},data:i.data}}const gi={bul:"bg",chi:"zh",zho:"zh",hrv:"hr",cze:"cs",dan:"da",dut:"nl",eng:"en",est:"et",fin:"fi",fra:"fr",ger:"de",gre:"el",hun:"hu",ind:"id",ita:"it",jpn:"ja",kor:"ko",nor:"no",pol:"pl",por:"pt",rum:"ro",rus:"ru",srp:"sr",slo:"sk",spa:"es",swe:"sv",tha:"th",tur:"tr",ukr:"uk",vie:"vi"},wi=U("KalambaBullseyePlugin","color:#000000;font-weight:bold;");var ve;class pi extends Ft{constructor(...t){super(...t);p(this,"socket");E(this,ve,"");this.on("openGame",async()=>{try{const n=await this.openGame();this.send("openGameResponse",n)}catch(n){this.send("openGameError",n)}}),this.on("play",async n=>{try{const a=await this.play(n);this.send("playResponse",a)}catch(a){this.send("playError",a)}}),this.on("state",({version:n})=>{v(this,ve,n)}),this.on("configured",n=>{this.socket.setRequestTimeoutMs(n.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(t){this.socket=new di(t,{gameVersion:y(this,ve),requestTimeoutMs:this.config.ui.requestTimeoutMs}),this.socket.addEventListener("close",n=>{n.code===1006&&this.reconnect(t)}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.socket.socket&&this.socket.socket.readyState!==WebSocket.OPEN&&this.reconnect(t)}),this.socket.addEventListener("error",n=>wi("error",n)),this.socket.addEventListener("realityCheck",n=>{this.send("realityCheck",n)})}async reconnect(t){this.initialize(t),await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}async openGame(){const t=new URLSearchParams(window.location.search),n=t.get("apiUrl"),a=t.get("cageCode"),c=t.get("gameCode"),s=t.get("operatorCode"),h=t.get("playMode"),g=t.get("token"),w=t.get("username"),m=t.get("gameHistoryUrl"),P=t.get("homeUrl")??void 0,R=t.get("cashierUrl")??void 0;this.initialize({apiUrl:n,cageCode:a,gameCode:c,operatorCode:s,playMode:h,token:g,username:w}),await this.socket.connect();const de=await this.socket.authenticate(),le=await this.socket.openGame(),L=li(de),Se=ui(de,le);this.config.api={brand:a,game:c,integration:s,jurisdiction:L.contract.jurisdiction,playMode:h,user:L.contract.username,integrationData:{token:g},country:L.contract.country,currency:L.contract.currency,coinValueInCents:L.contract.coinValueInCents,gameHistoryUrl:m,homeUrl:P,cashierUrl:R,sessionId:Se.contract.sessionId};const x=t.get("languageCode");return x&&(this.config.ui.language=x.length===3?gi[x]??x:x),Se}async play(t){const{contract:{bet:n,...a},extra:c,actionType:s}=t,h=await this.socket.sendAction(s,{bet:n?{baseBet:n.base,betMultiplier:n.multiplier}:void 0,...a,opaqueUiToGameServer:c}),g=hi(h);return this.config.api.lastRoundId=g.contract.roundId,g}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:t,integration:n,integrationData:a,jurisdiction:c,user:s,gameHistoryUrl:h},ui:{language:g}}=this.config,w=s.replace(/^user_/,"").replace(new RegExp(`_${n}$`),""),m=new URL(h);m.searchParams.set("gameCode",t),m.searchParams.set("jurisdiction",c),m.searchParams.set("operatorCode",n),m.searchParams.set("token",a.token),m.searchParams.set("username",w),m.searchParams.set("languageCode",g),window.open(m.toString(),"_blank")})}}ve=new WeakMap;var bi="2.0.0-beta.2",oe="",ut="?",Je="function",V="undefined",re="object",Ye="string",me="major",d="model",o="name",l="type",u="vendor",r="version",S="architecture",K="console",b="mobile",f="tablet",C="smarttv",X="wearable",Ze="embedded",ht="user-agent",et=500,nt="brands",W="formFactor",at="fullVersionList",J="platform",st="platformVersion",Re="bitness",G="sec-ch-ua",mi=G+"-full-version-list",fi=G+"-arch",yi=G+"-"+Re,vi=G+"-form-factor",Ei=G+"-"+b,ki=G+"-"+d,_t=G+"-"+J,Mi=_t+"-version",Dt=[nt,at,b,d,J,st,S,W,Re],I="browser",B="cpu",O="device",F="engine",A="os",Y="result",Ce="Amazon",he="Apple",gt="ASUS",wt="BlackBerry",Ie="Google",pt="Huawei",bt="Lenovo",We="LG",Le="Microsoft",mt="Motorola",Pe="Samsung",ft="Sharp",Ae="Sony",$e="Xiaomi",je="Zebra",j="Mobile ",Q=" Browser",xe="Chrome",Si="Edge",ge="Firefox",we="Opera",yt="Facebook",vt="Sogou",tt="Windows",Ti=typeof window!==V,T=Ti&&window.navigator?window.navigator:void 0,N=T&&T.userAgentData?T.userAgentData:void 0,Ci=function(i,e){var t={};for(var n in i)t[n]=e[n]&&e[n].length%2===0?e[n].concat(i[n]):i[n];return t},Ne=function(i){for(var e={},t=0;t<i.length;t++)e[i[t].toUpperCase()]=i[t];return e},it=function(i,e){if(typeof i===re&&i.length>0){for(var t in i)if(z(i[t])==z(e))return!0;return!1}return ce(i)?z(e).indexOf(z(i))!==-1:!1},Et=function(i){for(var e in i)return/^(browser|cpu|device|engine|os)$/.test(e)},ce=function(i){return typeof i===Ye},Qe=function(i){if(i){for(var e=[],t=$(/\\?\"/g,i).split(","),n=0;n<t.length;n++)if(t[n].indexOf(";")>-1){var a=fe(t[n]).split(";v=");e[n]={brand:a[0],version:a[1]}}else e[n]=fe(t[n]);return e}},z=function(i){return ce(i)?i.toLowerCase():i},Xe=function(i){return ce(i)?$(/[^\d\.]/g,i).split(".")[0]:void 0},_=function(i){for(var e in i){var t=i[e];typeof t==re&&t.length==2?this[t[0]]=t[1]:this[t]=void 0}return this},$=function(i,e){return ce(e)?e.replace(i,oe):e},pe=function(i){return $(/\\?\"/g,i)},fe=function(i,e){if(ce(i))return i=$(/^\s\s*/,i),typeof e===V?i:i.substring(0,et)},kt=function(i,e){if(!(!i||!e))for(var t=0,n,a,c,s,h,g;t<e.length&&!h;){var w=e[t],m=e[t+1];for(n=a=0;n<w.length&&!h&&w[n];)if(h=w[n++].exec(i),h)for(c=0;c<m.length;c++)g=h[++a],s=m[c],typeof s===re&&s.length>0?s.length===2?typeof s[1]==Je?this[s[0]]=s[1].call(this,g):this[s[0]]=s[1]:s.length===3?typeof s[1]===Je&&!(s[1].exec&&s[1].test)?this[s[0]]=g?s[1].call(this,g,s[2]):void 0:this[s[0]]=g?g.replace(s[1],s[2]):void 0:s.length===4&&(this[s[0]]=g?s[3].call(this,g.replace(s[1],s[2])):void 0):this[s]=g||void 0;t+=2}},Be=function(i,e){for(var t in e)if(typeof e[t]===re&&e[t].length>0){for(var n=0;n<e[t].length;n++)if(it(e[t][n],i))return t===ut?void 0:t}else if(it(e[t],i))return t===ut?void 0:t;return e.hasOwnProperty("*")?e["*"]:i},Mt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},St={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:["VR","XR","Watch"],"?":["Desktop","Unknown"],"*":void 0},Tt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[r,[o,j+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[r,[o,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[o,r],[/opios[\/ ]+([\w\.]+)/i],[r,[o,we+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[r,[o,we+" GX"]],[/\bopr\/([\w\.]+)/i],[r,[o,we]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[r,[o,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[o,r],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[r,[o,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[r,[o,"WeChat"]],[/konqueror\/([\w\.]+)/i],[r,[o,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[r,[o,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[r,[o,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[r,[o,"Smart "+bt+Q]],[/(avast|avg)\/([\w\.]+)/i],[[o,/(.+)/,"$1 Secure"+Q],r],[/\bfocus\/([\w\.]+)/i],[r,[o,ge+" Focus"]],[/\bopt\/([\w\.]+)/i],[r,[o,we+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[r,[o,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[r,[o,"Dolphin"]],[/coast\/([\w\.]+)/i],[r,[o,we+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[r,[o,"MIUI"+Q]],[/fxios\/([\w\.-]+)/i],[r,[o,j+ge]],[/\bqihu|(qi?ho?o?|360)browser/i],[[o,"360"+Q]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[o,/(.+)/,"$1"+Q],r],[/samsungbrowser\/([\w\.]+)/i],[r,[o,Pe+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[o,/_/g," "],r],[/metasr[\/ ]?([\d\.]+)/i],[r,[o,vt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[o,vt+" Mobile"],r],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[o,r],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[o],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[o,yt],r],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[o,r],[/\bgsa\/([\w\.]+) .*safari\//i],[r,[o,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[r,[o,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[r,[o,xe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[o,xe+" WebView"],r],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[r,[o,"Android"+Q]],[/chrome\/([\w\.]+) mobile/i],[r,[o,j+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[o,r],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[r,[o,j+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[o,j+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[r,o],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[o,[r,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[o,r],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[o,j+ge],r],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[o,"Netscape"],r],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[r,[o,ge+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[o,r],[/(cobalt)\/([\w\.]+)/i],[o,[r,/[^\d\.]+./,oe]]],cpu:[[/\b(?:(amd|x|x86[-_]?|wow|win)64)\b/i],[[S,"amd64"]],[/(ia32(?=;))/i,/((?:i[346]|x)86)[;\)]/i],[[S,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[S,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[S,"armhf"]],[/windows (ce|mobile); ppc;/i],[[S,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[S,/ower/,oe,z]],[/(sun4\w)[;\)]/i],[[S,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[S,z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[u,Pe],[l,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[u,Pe],[l,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[u,he],[l,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[u,he],[l,f]],[/(macintosh);/i],[d,[u,he]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[u,ft],[l,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[u,pt],[l,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[u,pt],[l,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[u,$e],[l,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[u,$e],[l,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[u,"OPPO"],[l,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[u,"Vivo"],[l,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[u,"Realme"],[l,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[u,mt],[l,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[u,mt],[l,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[u,We],[l,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[u,We],[l,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[u,bt],[l,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[u,"Nokia"],[l,b]],[/(pixel c)\b/i],[d,[u,Ie],[l,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[u,Ie],[l,b]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[u,Ae],[l,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[u,Ae],[l,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[u,"OnePlus"],[l,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[u,Ce],[l,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[u,Ce],[l,b]],[/(playbook);[-\w\),; ]+(rim)/i],[d,u,[l,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[u,wt],[l,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[u,gt],[l,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[u,gt],[l,b]],[/(nexus 9)/i],[d,[u,"HTC"],[l,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[d,/_/g," "],[l,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[u,"Acer"],[l,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[u,"Meizu"],[l,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[u,"Ulefone"],[l,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,d,[l,b]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[u,d,[l,f]],[/(surface duo)/i],[d,[u,Le],[l,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[u,"Fairphone"],[l,b]],[/(shield[\w ]+) b/i],[d,[u,"Nvidia"],[l,f]],[/(sprint) (\w+)/i],[u,d,[l,b]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[u,Le],[l,b]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[u,je],[l,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[u,je],[l,b]],[/smart-tv.+(samsung)/i],[u,[l,C]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[u,Pe],[l,C]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,We],[l,C]],[/(apple) ?tv/i],[u,[d,he+" TV"],[l,C]],[/crkey/i],[[d,xe+"cast"],[u,Ie],[l,C]],[/droid.+aft(\w+)( bui|\))/i],[d,[u,Ce],[l,C]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[u,ft],[l,C]],[/(bravia[\w ]+)( bui|\))/i],[d,[u,Ae],[l,C]],[/(mitv-\w{5}) bui/i],[d,[u,$e],[l,C]],[/Hbbtv.*(technisat) (.*);/i],[u,d,[l,C]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,fe],[d,fe],[l,C]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,C]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,d,[l,K]],[/droid.+; (shield) bui/i],[d,[u,"Nvidia"],[l,K]],[/(playstation \w+)/i],[d,[u,Ae],[l,K]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[u,Le],[l,K]],[/((pebble))app/i],[u,d,[l,X]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[u,he],[l,X]],[/droid.+; (glass) \d/i],[d,[u,Ie],[l,X]],[/droid.+; (wt63?0{2,3})\)/i],[d,[u,je],[l,X]],[/(quest( 2| pro)?)/i],[d,[u,yt],[l,X]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,Ze]],[/(aeobc)\b/i],[d,[u,Ce],[l,Ze]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[l,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[l,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,b]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[r,[o,Si+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[r,[o,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[o,r],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[r,o]],os:[[/microsoft (windows) (vista|xp)/i],[o,r],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[o,[r,Be,Mt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[r,Be,Mt],[o,tt]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[r,/_/g,"."],[o,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[o,"macOS"],[r,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[r,o],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[o,r],[/\(bb(10);/i],[r,[o,wt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[r,[o,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[r,[o,ge+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[r,[o,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[r,[o,"watchOS"]],[/crkey\/([\d\.]+)/i],[r,[o,xe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[o,"Chrome OS"],r],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[o,r],[/(sunos) ?([\w\.\d]*)/i],[[o,"Solaris"],r],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[o,r]]},Oe=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return _.call(i.init,[[I,[o,r,me]],[B,[S]],[O,[l,d,u]],[F,[o,r]],[A,[o,r]]]),_.call(i.isIgnore,[[I,[r,me]],[F,[r]],[A,[r]]]),_.call(i.isIgnoreRgx,[[I,/ ?browser$/i],[A,/ ?os$/i]]),_.call(i.toString,[[I,[o,r]],[B,[S]],[O,[u,d]],[F,[o,r]],[A,[o,r]]]),i}(),Ii=function(i,e){var t=Oe.init[e],n=Oe.isIgnore[e]||0,a=Oe.isIgnoreRgx[e]||0,c=Oe.toString[e]||0;function s(){_.call(this,t)}return s.prototype.getItem=function(){return i},s.prototype.withClientHints=function(){return N?N.getHighEntropyValues(Dt).then(function(h){return i.setCH(new Rt(h,!1)).parseCH().get()}):i.parseCH().get()},s.prototype.withFeatureCheck=function(){return i.detectFeature().get()},e!=Y&&(s.prototype.is=function(h){var g=!1;for(var w in this)if(this.hasOwnProperty(w)&&!it(n,w)&&z(a?$(a,this[w]):this[w])==z(a?$(a,h):h)){if(g=!0,h!=V)break}else if(h==V&&g){g=!g;break}return g},s.prototype.toString=function(){var h=oe;for(var g in c)typeof this[c[g]]!==V&&(h+=(h?" ":oe)+this[c[g]]);return h||V}),N||(s.prototype.then=function(h){var g=this,w=function(){for(var P in g)g.hasOwnProperty(P)&&(this[P]=g[P])};w.prototype={is:s.prototype.is,toString:s.prototype.toString};var m=new w;return h(m),m}),new s};function Rt(i,e){if(i=i||{},_.call(this,Dt),e)_.call(this,[[nt,Qe(i[G])],[at,Qe(i[mi])],[b,/\?1/.test(i[Ei])],[d,pe(i[ki])],[J,pe(i[_t])],[st,pe(i[Mi])],[S,pe(i[fi])],[W,Qe(i[vi])],[Re,pe(i[yi])]]);else for(var t in i)this.hasOwnProperty(t)&&typeof i[t]!==V&&(this[t]=i[t])}function Ct(i,e,t,n){return this.get=function(a){return a?this.data.hasOwnProperty(a)?this.data[a]:void 0:this.data},this.set=function(a,c){return this.data[a]=c,this},this.setCH=function(a){return this.uaCH=a,this},this.detectFeature=function(){if(T&&T.userAgent==this.ua)switch(this.itemType){case I:T.brave&&typeof T.brave.isBrave==Je&&this.set(o,"Brave");break;case O:!this.get(l)&&N&&N[b]&&this.set(l,b),this.get(d)=="Macintosh"&&T&&typeof T.standalone!==V&&T.maxTouchPoints&&T.maxTouchPoints>2&&this.set(d,"iPad").set(l,f);break;case A:!this.get(o)&&N&&N[J]&&this.set(o,N[J]);break;case Y:var a=this.data,c=function(s){return a[s].getItem().detectFeature().get()};this.set(I,c(I)).set(B,c(B)).set(O,c(O)).set(F,c(F)).set(A,c(A))}return this},this.parseUA=function(){return this.itemType!=Y&&kt.call(this.data,this.ua,this.rgxMap),this.itemType==I&&this.set(me,Xe(this.get(r))),this},this.parseCH=function(){var a=this.uaCH,c=this.rgxMap;switch(this.itemType){case I:var s=a[at]||a[nt],h;if(s)for(var g in s){var w=$(/(Google|Microsoft) /,s[g].brand||s[g]),m=s[g].version;!/not.a.brand/i.test(w)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(w))&&(this.set(o,w).set(r,m).set(me,Xe(m)),h=w)}break;case B:var P=a[S];P&&(P&&a[Re]=="64"&&(P+="64"),kt.call(this.data,P+";",c));break;case O:if(a[b]&&this.set(l,b),a[d]&&this.set(d,a[d]),a[d]=="Xbox"&&this.set(l,K).set(u,Le),a[W]){var R;if(typeof a[W]!="string")for(var de=0;!R&&de<a[W].length;)R=Be(a[W][de++],St);else R=Be(a[W],St);this.set(l,R)}break;case A:var le=a[J];if(le){var L=a[st];le==tt&&(L=parseInt(Xe(L),10)>=13?"11":"10"),this.set(o,le).set(r,L)}this.get(o)==tt&&a[d]=="Xbox"&&this.set(o,"Xbox").set(r,void 0);break;case Y:var Se=this.data,x=function(Ht){return Se[Ht].getItem().setCH(a).parseCH().get()};this.set(I,x(I)).set(B,x(B)).set(O,x(O)).set(F,x(F)).set(A,x(A))}return this},_.call(this,[["itemType",i],["ua",e],["uaCH",n],["rgxMap",t],["data",Ii(this,i)]]),this}function D(i,e,t){if(typeof i===re?(Et(i)?(typeof e===re&&(t=e),e=i):(t=i,e=void 0),i=void 0):typeof i===Ye&&!Et(e)&&(t=e,e=void 0),!(this instanceof D))return new D(i,e,t).getResult();var n=typeof i===Ye?i:T&&T.userAgent?T.userAgent:t&&t[ht]?t[ht]:oe,a=new Rt(t,!0),c=e?Ci(Tt,e):Tt,s=function(h){return h==Y?function(){return new Ct(h,n,c,a).set("ua",n).set(I,this.getBrowser()).set(B,this.getCPU()).set(O,this.getDevice()).set(F,this.getEngine()).set(A,this.getOS()).get()}:function(){return new Ct(h,n,c[h],a).parseUA().get()}};return _.call(this,[["getBrowser",s(I)],["getCPU",s(B)],["getDevice",s(O)],["getEngine",s(F)],["getOS",s(A)],["getResult",s(Y)],["getUA",function(){return n}],["setUA",function(h){return ce(h)&&(n=h.length>et?fe(h,et):h),this}]]).setUA(n),this}D.VERSION=bi;D.BROWSER=Ne([o,r,me]);D.CPU=Ne([S]);D.DEVICE=Ne([d,u,l,K,b,C,f,X,Ze]);D.ENGINE=D.OS=Ne([o,r]);class Nt{constructor(e,t){p(this,"trackers");p(this,"config");this.trackers=e,this.config=t}on(e,t,n){const a=function(s){s.data.message!==`kalamba:wrapper-telemetry:${e}`&&s.data.message!==`kalamba:wrapper:${e}`||t(s.data.payload)};window.addEventListener("message",a,n)}track(e,t){this.trackers.forEach(n=>n.track(e,t))}}function It(i){return i.reduce((e,t)=>e+t,0)}function Pi(i){const e=i.length,t=It(i)/e,n=i.map(c=>Math.pow(c-t,2)),a=It(n)/e;return Math.sqrt(a)}class Pt{constructor(){p(this,"rafId",-1);p(this,"startTime",0);p(this,"stopTime",0);p(this,"frames",[]);p(this,"calculateFPS",()=>{const e=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(t=>Math.floor((t-this.startTime)/1e3)).reduce((t,n,a,c)=>(c[a]!==c[a-1]?t.push(1):t[t.length-1]++,t),[]).slice(0,e)});p(this,"getReport",()=>{const e=this.calculateFPS(),t=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),n=e.length>0?Math.max(...e):t,a=e.length>0?Math.min(...e):t,c=e.length>0?Pi(e):0;return{fpsAvg:t,fpsMax:n,fpsMin:a,fpsStdDev:c}});p(this,"start",()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()});p(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});p(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Ai="landscape",xi="portrait";function Oi(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Ui(){if(!window.createImageBitmap)return!1;const t=await(await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();try{return await createImageBitmap(t),!0}catch{return!1}}function Ke(){return window.innerWidth>=window.innerHeight?Ai:xi}var Fe,ee,te,ie,Ee,_e,ke,De;class Li extends Nt{constructor(...t){super(...t);p(this,"FPS_SAMPLE_INTERVAL",1e4);E(this,Fe,0);E(this,ee,"");E(this,te,void 0);E(this,ie,void 0);E(this,Ee,!1);E(this,_e,!1);E(this,ke,"");E(this,De,[]);v(this,te,{}),v(this,ie,this.deviceInfo()),this.on("state",({balance:n,version:a})=>{v(this,ee,a),v(this,Fe,n)}),this.on("autoplay",({action:n})=>{["start","resume"].includes(n)?v(this,Ee,!0):v(this,Ee,!1)}),this.on("settings",({fastPlay:n})=>{n!==void 0&&v(this,_e,n)}),this.registerEvents()}async registerEvents(){y(this,ie).then(t=>{this.track("Device Information",t)}),this.on("loadStart",()=>{this.track("Game Loading",{progress:0,step:"initial"})}),this.on("loadProgress",t=>{this.track("Game Loading",{progress:t.progress})}),this.on("loadEnd",()=>{this.track("Game Loading",{progress:100,step:"complete"})}),this.on("error",t=>{this.track("System Message",{systemMessageText:t.messageKey,systemMessageType:t.type})}),this.on("openGameResponse",async t=>{v(this,ke,t.contract.stateType.nextRound),v(this,te,{balanceInCoins:t.contract.balance.coins,clientVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,defaultBaseBet:t.contract.bet.default.base,defaultBetMultiplier:t.contract.bet.default.multiplier,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,gameModelFile:t.contract.gameModel,jurisdiction:this.config.api.jurisdiction,languageCode:this.config.ui.language,operatorName:"kalamba",partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,referrer:window.location.hostname,serverVersion:t.contract.metaData.version}),this.track("Game Open",y(this,te))}),this.on("playCycleEnd",async t=>{const n=await y(this,ie),{base:a,multiplier:c,specialAction:s}=t.contract.bet.lastPaid??{},h=t.contract.balance.coins,g=t.contract.bet.lastPaid.base*t.contract.bet.lastPaid.multiplier,w=t.contract.win.total,m=w-g,P=s||"spin",R=t.contract.roundId;this.track("Betting Activity",{balance:h-m,balanceAfter:h,baseBet:a,betMultiplier:c,betType:P,gameVersion:y(this,ee),coinValueInCents:this.config.api.coinValueInCents,coinValueInCentsFloat:this.config.api.coinValueInCents,currency:this.config.api.currency,environment:"release",gameCode:this.config.api.game,gameCodeServer:this.config.api.game,isMobile:n.isMobile,netResult:m,operatorName:"kalamba",orientation:Ke(),partnerId:this.config.api.brand,partnerParentId:this.config.api.integration,platform:"WEB",playMode:this.config.api.playMode,roundId:R,roundTypes:["BaseGame"],totalBet:g,totalWin:w}),v(this,De,[])}),this.on("telemetry.click",t=>{this.track("UI Interaction",{action:"click",...this.getExtraUiInteractionData(),...t})}),this.on("telemetry.orientationChange",()=>{this.track("UI Interaction",{action:"orientationChange",...this.getExtraUiInteractionData()})}),this.reportFpsSample(),this.reportFpsRound()}reportFpsSample(){const t=new Pt,n=()=>{t.stop();const c=t.getReport();this.track("FPS Performance",{...c,fpsType:"sample"}),a()},a=async()=>{t.start(),setTimeout(n,this.FPS_SAMPLE_INTERVAL)};a()}reportFpsRound(){const t=new Pt;this.on("playCycleStart",()=>{t.start()}),this.on("playCycleEnd",()=>{t.stop();const n=t.getReport();this.track("FPS Performance",{...n,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Ke(),stateType:y(this,ke)}}async deviceInfo(){var g;const t=new D(navigator.userAgent),n=Oi(),a=await Ui(),c=t.getBrowser(),s=t.getDevice(),h=t.getOS();return{browserName:c.name,browserVersion:c.version,connection:(g=navigator.connection)==null?void 0:g.effectiveType,deviceName:s.model,deviceType:s.type,isMobile:["mobile","tablet"].includes(s.type??""),isWebGLSupported:n,isWebPSupported:a,manufacturer:s.vendor,operatingSystem:h.name,operatingSystemVersion:h.version,orientation:Ke(),pixelRatio:window.devicePixelRatio,screenHeight:window.screen.height,screenSize:`${window.screen.width}x${window.screen.height}`,screenWidth:window.screen.width,timezoneOffsetMinutes:new Date().getTimezoneOffset(),windowHeight:window.innerHeight,windowSize:`${window.innerWidth}x${window.innerHeight}`,windowWidth:window.innerWidth}}}Fe=new WeakMap,ee=new WeakMap,te=new WeakMap,ie=new WeakMap,Ee=new WeakMap,_e=new WeakMap,ke=new WeakMap,De=new WeakMap;let Ue;const Bi=new Uint8Array(16);function Fi(){if(!Ue&&(Ue=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ue))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ue(Bi)}const M=[];for(let i=0;i<256;++i)M.push((i+256).toString(16).slice(1));function _i(i,e=0){return M[i[e+0]]+M[i[e+1]]+M[i[e+2]]+M[i[e+3]]+"-"+M[i[e+4]]+M[i[e+5]]+"-"+M[i[e+6]]+M[i[e+7]]+"-"+M[i[e+8]]+M[i[e+9]]+"-"+M[i[e+10]]+M[i[e+11]]+M[i[e+12]]+M[i[e+13]]+M[i[e+14]]+M[i[e+15]]}const Di=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),At={randomUUID:Di};function xt(i,e,t){if(At.randomUUID&&!e&&!i)return At.randomUUID();i=i||{};const n=i.random||(i.rng||Fi)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let a=0;a<16;++a)e[t+a]=n[a];return e}return _i(n)}class ot{constructor(e){p(this,"config");this.config=e}}const Ot=25,Ut=1e4;var ne,ae,se,H,Me;class Ri extends ot{constructor(...t){super(...t);E(this,ne,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");E(this,ae,void 0);E(this,se,void 0);E(this,H,[]);E(this,Me,void 0);p(this,"processQueueForced");v(this,ae,new Date().getTime()),v(this,H,[]),v(this,Me,xt()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,ne),{method:"OPTIONS"}).catch(ct.noop),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){y(this,se)&&clearTimeout(y(this,se)),v(this,se,window.setTimeout(()=>this.processQueue(),Ut))}send(t){v(this,ae,new Date().getTime());try{navigator.sendBeacon(y(this,ne),JSON.stringify(t))}catch{fetch(y(this,ne),{body:JSON.stringify(t),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(ct.noop)}this.schedule()}addToQueue(t){y(this,H).push(t),this.processQueue()}processQueue(t=!1){if(!(this.config==null||!this.config.ui.feature.allowTelemetry)&&!(!t&&y(this,H).length<Ot&&new Date().getTime()-y(this,ae)<Ut))for(;y(this,H).length;){const n=y(this,H).splice(0,Ot).map(a=>({...a,sessionID:y(this,Me),userID:this.config.api.user}));this.send(n)}}track(t,n){this.addToQueue({eventName:t,eventParams:n,eventTimestamp:new Date().getTime(),eventUUID:xt()})}}ne=new WeakMap,ae=new WeakMap,se=new WeakMap,H=new WeakMap,Me=new WeakMap;const Ni=U("LoggingTracker","color:#000000;font-weight:bold;");class Hi extends ot{track(e,t){Ni(`@${this.config.api.user}`,`[${e}]`,t)}}exports.BasicPlugin=Gt;exports.CasinoPlugin=q;exports.DebuggingPlugin=$t;exports.GigPlugin=Qt;exports.KalambaBullseyePlugin=pi;exports.KalambaStargazerPlugin=Li;exports.KalambaStargazerTracker=Ri;exports.LoggingTracker=Hi;exports.OryxPlugin=Kt;exports.PariplayPlugin=ei;exports.RelaxFEIMPlugin=ti;exports.RgsPlygin=Ft;exports.TelemetryPlugin=Nt;exports.Tracker=ot;exports.TukoPlugin=ii;
|
package/dist/plugins.d.ts
CHANGED
|
@@ -93,8 +93,6 @@ declare type Error_2 = {
|
|
|
93
93
|
|
|
94
94
|
declare type ExtraPlayPayload = {
|
|
95
95
|
[key: string]: any;
|
|
96
|
-
} & {
|
|
97
|
-
bet?: never;
|
|
98
96
|
};
|
|
99
97
|
|
|
100
98
|
declare type ForwardToPluginsMessage<P extends PluginDomain> = keyof ForwardToPluginsMessageMap<'sdk'>[P] | keyof ForwardToPluginsMessageMap<'rgs'>[P] | keyof ForwardToPluginsMessageMap<'casino'>[P] | keyof ForwardToPluginsMessageMap<'telemetry'>[P];
|
|
@@ -128,18 +126,8 @@ export declare class KalambaBullseyePlugin extends RgsPlygin {
|
|
|
128
126
|
constructor(...args: ConstructorParameters<typeof RgsPlygin>);
|
|
129
127
|
initialize(init: KalambaWebSocketClientInit): void;
|
|
130
128
|
reconnect(init: KalambaWebSocketClientInit): Promise<void>;
|
|
131
|
-
openGame(): Promise<
|
|
132
|
-
|
|
133
|
-
balanceVersion: number;
|
|
134
|
-
correlationSeqId: number;
|
|
135
|
-
data: unknown;
|
|
136
|
-
event: "OPEN_GAME";
|
|
137
|
-
} & {
|
|
138
|
-
correlationSeqId?: number | undefined;
|
|
139
|
-
event: "BG_RESULT" | "OPEN_GAME" | "SPIN_ERROR" | "SPIN_RESULT";
|
|
140
|
-
seqId: number;
|
|
141
|
-
}>;
|
|
142
|
-
play(payload: PlayRequest): any;
|
|
129
|
+
openGame(): Promise<OpenGameResponse>;
|
|
130
|
+
play(payload: PlayRequest): Promise<PlayResponse>;
|
|
143
131
|
registerFromSdkEvents(): void;
|
|
144
132
|
}
|
|
145
133
|
|
|
@@ -186,29 +174,106 @@ declare class KalambaWebSocketClient extends WebSocketClient {
|
|
|
186
174
|
private getBodyExtras;
|
|
187
175
|
private request;
|
|
188
176
|
activateFreeRound(body: any): Promise<WebSocketResponse<any, Record<string, unknown>, unknown>>;
|
|
189
|
-
authenticate(reconnect?: boolean): Promise<{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
177
|
+
authenticate(reconnect?: boolean): Promise<Record<string, unknown> & {
|
|
178
|
+
contract: {
|
|
179
|
+
balance: number;
|
|
180
|
+
balanceVersion: number;
|
|
181
|
+
coinValueInCents: number;
|
|
182
|
+
countryCode: string;
|
|
183
|
+
currencyCode: string;
|
|
184
|
+
jurisdictionCode: string;
|
|
185
|
+
uiMessages: unknown[];
|
|
186
|
+
username: string;
|
|
187
|
+
};
|
|
198
188
|
}>;
|
|
199
|
-
openGame(): Promise<{
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
189
|
+
openGame(): Promise<Record<string, unknown> & {
|
|
190
|
+
contract: {
|
|
191
|
+
availableMultipliersPerBaseBet: Record<number, number[]>;
|
|
192
|
+
balanceInCoins: number;
|
|
193
|
+
balanceVersion: number;
|
|
194
|
+
defaultBet: {
|
|
195
|
+
baseBet: number;
|
|
196
|
+
betMultiplier: number;
|
|
197
|
+
};
|
|
198
|
+
lastBet?: {
|
|
199
|
+
baseBet: number;
|
|
200
|
+
betMultiplier: number;
|
|
201
|
+
} | undefined;
|
|
202
|
+
lastMainGameBet?: {
|
|
203
|
+
baseBet: number;
|
|
204
|
+
betMultiplier: number;
|
|
205
|
+
} | undefined;
|
|
206
|
+
maxBetInCoins: number;
|
|
207
|
+
metaData: {
|
|
208
|
+
rtpValues: {
|
|
209
|
+
key: string;
|
|
210
|
+
rtpValue: string;
|
|
211
|
+
}[];
|
|
212
|
+
maxWin: {
|
|
213
|
+
key: string;
|
|
214
|
+
maxWinValueXBet: number;
|
|
215
|
+
maxWinOdds: number;
|
|
216
|
+
}[];
|
|
217
|
+
version: string;
|
|
218
|
+
};
|
|
219
|
+
uiMessages: unknown[];
|
|
220
|
+
gameModelFile: string;
|
|
221
|
+
sessionId: string;
|
|
222
|
+
roundWin: number;
|
|
223
|
+
totalWin: number;
|
|
224
|
+
realityCheck?: {
|
|
225
|
+
duration: number;
|
|
226
|
+
sumBetAmount: number;
|
|
227
|
+
sumWinAmount: number;
|
|
228
|
+
} | undefined;
|
|
229
|
+
stateTypeThisRound: string;
|
|
230
|
+
stateTypeNextRound: string;
|
|
231
|
+
nextSpinType: string;
|
|
232
|
+
serverTime: number;
|
|
233
|
+
};
|
|
234
|
+
opaqueGameServerToUi: unknown;
|
|
203
235
|
data: unknown;
|
|
204
236
|
event: "OPEN_GAME";
|
|
205
237
|
} & {
|
|
206
|
-
correlationSeqId
|
|
238
|
+
correlationSeqId: number;
|
|
207
239
|
event: GameEventName;
|
|
208
240
|
seqId: number;
|
|
209
241
|
}>;
|
|
210
242
|
private sendAcknowledgement;
|
|
211
|
-
sendAction(action: GameAction, data: any): Promise<unknown
|
|
243
|
+
sendAction(action: GameAction, data: any): Promise<Record<string, unknown> & {
|
|
244
|
+
contract: {
|
|
245
|
+
balanceInCoins: number;
|
|
246
|
+
balanceVersion: number;
|
|
247
|
+
lastBet?: {
|
|
248
|
+
baseBet: number;
|
|
249
|
+
betMultiplier: number;
|
|
250
|
+
} | undefined;
|
|
251
|
+
lastMainGameBet: {
|
|
252
|
+
baseBet: number;
|
|
253
|
+
betMultiplier: number;
|
|
254
|
+
};
|
|
255
|
+
uiMessages: unknown[];
|
|
256
|
+
roundId: string;
|
|
257
|
+
roundWin: number;
|
|
258
|
+
totalWin: number;
|
|
259
|
+
realityCheck?: {
|
|
260
|
+
duration: number;
|
|
261
|
+
sumBetAmount: number;
|
|
262
|
+
sumWinAmount: number;
|
|
263
|
+
} | undefined;
|
|
264
|
+
stateTypeThisRound: string;
|
|
265
|
+
stateTypeNextRound: string;
|
|
266
|
+
nextSpinType: string;
|
|
267
|
+
serverTime: number;
|
|
268
|
+
};
|
|
269
|
+
opaqueGameServerToUi: unknown;
|
|
270
|
+
data: unknown;
|
|
271
|
+
event: "BG_RESULT" | "SPIN_RESULT";
|
|
272
|
+
} & {
|
|
273
|
+
correlationSeqId: number;
|
|
274
|
+
event: GameEventName;
|
|
275
|
+
seqId: number;
|
|
276
|
+
}>;
|
|
212
277
|
setRequestTimeoutMs(ms: number): void;
|
|
213
278
|
}
|
|
214
279
|
|
|
@@ -255,8 +320,47 @@ declare type OpenGameRequest = {
|
|
|
255
320
|
};
|
|
256
321
|
|
|
257
322
|
declare type OpenGameResponse = {
|
|
258
|
-
|
|
259
|
-
|
|
323
|
+
contract: {
|
|
324
|
+
bet: {
|
|
325
|
+
available: Record<number, number[]>;
|
|
326
|
+
default: {
|
|
327
|
+
base: number;
|
|
328
|
+
multiplier: number;
|
|
329
|
+
};
|
|
330
|
+
max: number;
|
|
331
|
+
last: Bet | null;
|
|
332
|
+
lastPaid: Bet | null;
|
|
333
|
+
};
|
|
334
|
+
balance: {
|
|
335
|
+
coins: number;
|
|
336
|
+
version: number;
|
|
337
|
+
};
|
|
338
|
+
gameModel: string;
|
|
339
|
+
metaData: {
|
|
340
|
+
rtpValues: {
|
|
341
|
+
key: string;
|
|
342
|
+
rtpValue: string;
|
|
343
|
+
}[];
|
|
344
|
+
maxWin: {
|
|
345
|
+
key: string;
|
|
346
|
+
maxWinValueXBet: number;
|
|
347
|
+
maxWinOdds: number;
|
|
348
|
+
}[];
|
|
349
|
+
version: string;
|
|
350
|
+
};
|
|
351
|
+
serverTime: number;
|
|
352
|
+
sessionId: string;
|
|
353
|
+
stateType: {
|
|
354
|
+
thisRound: string;
|
|
355
|
+
nextRound: string;
|
|
356
|
+
};
|
|
357
|
+
uiMessages: unknown[];
|
|
358
|
+
win: {
|
|
359
|
+
round: number;
|
|
360
|
+
total: number;
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
data: unknown;
|
|
260
364
|
};
|
|
261
365
|
|
|
262
366
|
export declare class OryxPlugin extends CasinoPlugin {
|
|
@@ -292,8 +396,28 @@ declare type PlayRequest = {
|
|
|
292
396
|
};
|
|
293
397
|
|
|
294
398
|
declare type PlayResponse = {
|
|
295
|
-
|
|
296
|
-
|
|
399
|
+
contract: {
|
|
400
|
+
bet: {
|
|
401
|
+
last: Bet | null;
|
|
402
|
+
lastPaid: Bet;
|
|
403
|
+
};
|
|
404
|
+
balance: {
|
|
405
|
+
coins: number;
|
|
406
|
+
version: number;
|
|
407
|
+
};
|
|
408
|
+
serverTime: number;
|
|
409
|
+
roundId: string;
|
|
410
|
+
stateType: {
|
|
411
|
+
thisRound: string;
|
|
412
|
+
nextRound: string;
|
|
413
|
+
};
|
|
414
|
+
uiMessages: unknown[];
|
|
415
|
+
win: {
|
|
416
|
+
round: number;
|
|
417
|
+
total: number;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
data: unknown;
|
|
297
421
|
};
|
|
298
422
|
|
|
299
423
|
declare type PluginDomain = keyof ForwardToPluginsMessageMap<any>;
|
|
@@ -357,6 +481,8 @@ declare interface SdkConfig {
|
|
|
357
481
|
jurisdiction: string;
|
|
358
482
|
playMode: 'FUN' | 'REAL';
|
|
359
483
|
user: string;
|
|
484
|
+
sessionId: string;
|
|
485
|
+
lastRoundId?: string;
|
|
360
486
|
};
|
|
361
487
|
ui: {
|
|
362
488
|
autoplay: {
|