@kalamba/sdk 0.8.1 → 0.9.1

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.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 b=(r,i,t)=>{if(!i.has(r))throw TypeError("Cannot "+t)};var m=(r,i,t)=>(b(r,i,"read from private field"),t?t.call(r):i.get(r)),e=(r,i,t)=>{if(i.has(r))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(r):i.set(r,t)},u=(r,i,t,n)=>(b(r,i,"write to private field"),n?n.call(r,t):i.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("./errors-358575c3.cjs");function I(r){const i=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&i==="[object Date]"?new r.constructor(+r):typeof r=="number"||i==="[object Number]"||typeof r=="string"||i==="[object String]"?new Date(r):new Date(NaN)}function U(r){const i=I(r);return i.setHours(23,59,59,999),i}function k(){return U(Date.now())}function L(r){const i=I(r);return i.setHours(0,0,0,0),i}function P(){return L(Date.now())}const $=3e4;var F,S;class G{constructor(i){e(this,F,void 0);e(this,S,$);u(this,F,i)}buildHeaders(){const i={};return m(this,F).token&&(i.Authorization=`Bearer ${m(this,F).token}`),i}async request(i,t){const n=new URL(i,m(this,F).apiUrl??window.location.origin);return n.search=new URLSearchParams({...t}).toString(),await(await fetch(n,{signal:AbortSignal.timeout(m(this,S)),headers:this.buildHeaders()})).json()}async getRounds(i){return this.request("/rounds",i)}async getRound(i,t){return this.request(`/rounds/${i}`,t)}}F=new WeakMap,S=new WeakMap;const N={limit:100,page:0};var s,l;class A{constructor({config:i}){e(this,s,void 0);e(this,l,void 0);u(this,s,i),u(this,l,new G({apiUrl:i.api.gameHistoryUrl}))}async getRound(i,{pagination:t=N}={}){return m(this,l).getRound(i,{gameCode:m(this,s).api.game,operatorCode:m(this,s).api.brand,username:m(this,s).api.user,...t})}async getLastRound(){return m(this,s).api.lastRoundId?this.getRound(m(this,s).api.lastRoundId):null}async getRounds({searchPeriod:i={fromDateTime:P(),toDateTime:k()},pagination:t=N}={}){const n=m(this,s).api.user.replace(/^user_/,"").replace(new RegExp(`_${m(this,s).api.integration}$`),"");return m(this,l).getRounds({gameCode:m(this,s).api.game,operatorCode:m(this,s).api.integration,username:n,fromDataTime:i.fromDateTime.toISOString(),toDateTime:i.toDateTime.toISOString(),...t})}}s=new WeakMap,l=new WeakMap;function _(r,i){return r*i/100}function O(r,i,t){if(!["string","number"].includes(typeof i))return"NaN";const{locales:n}=r;try{return new Intl.NumberFormat(n,{...t,numberingSystem:"latn",style:"decimal"}).format(+i)}catch{return`${i}`}}const w="XTS";var y=(r=>(r.Currency="Currency",r.Number="Number",r))(y||{}),f=(r=>(r.Coins="Coins",r.Money="Money",r))(f||{});const T={ARSB:{displayAs:"ARS",maximumFractionDigits:2,minimumFractionDigits:2},CHIPS:{maximumFractionDigits:0,minimumFractionDigits:0},BNB:{maximumFractionDigits:6,minimumFractionDigits:6},BUSD:{maximumFractionDigits:4,minimumFractionDigits:4},BTC:{maximumFractionDigits:8,minimumFractionDigits:2},mBTC:{maximumFractionDigits:5,minimumFractionDigits:2},uBTC:{maximumFractionDigits:2,minimumFractionDigits:2},BCH:{maximumFractionDigits:8,minimumFractionDigits:2},mBCH:{maximumFractionDigits:2,minimumFractionDigits:2},ETH:{maximumFractionDigits:8,minimumFractionDigits:2},mETH:{maximumFractionDigits:5,minimumFractionDigits:2},uETH:{maximumFractionDigits:2,minimumFractionDigits:2},SOC:{maximumFractionDigits:8,minimumFractionDigits:2},LTC:{maximumFractionDigits:8,minimumFractionDigits:2},mLTC:{maximumFractionDigits:5,minimumFractionDigits:2},uLTC:{maximumFractionDigits:2,minimumFractionDigits:2},DOG:{maximumFractionDigits:4,minimumFractionDigits:2},USDC:{maximumFractionDigits:4,minimumFractionDigits:4},USDT:{maximumFractionDigits:4,minimumFractionDigits:2},TRX:{maximumFractionDigits:2,minimumFractionDigits:2},TUSD:{maximumFractionDigits:2,minimumFractionDigits:2},DAI:{maximumFractionDigits:2,minimumFractionDigits:2},XMR:{maximumFractionDigits:4,minimumFractionDigits:4},CBET:{maximumFractionDigits:0,minimumFractionDigits:0},kCBET:{maximumFractionDigits:2,minimumFractionDigits:2},SHIB:{maximumFractionDigits:0,minimumFractionDigits:0},kSHIB:{maximumFractionDigits:4,minimumFractionDigits:2},NEO:{maximumFractionDigits:4,minimumFractionDigits:4},BSV:{maximumFractionDigits:4,minimumFractionDigits:4},EOS:{maximumFractionDigits:4,minimumFractionDigits:4},DASH:{maximumFractionDigits:4,minimumFractionDigits:4},XLM:{maximumFractionDigits:2,minimumFractionDigits:2},KRW:{maximumFractionDigits:2,minimumFractionDigits:2},kVND:{maximumFractionDigits:4,minimumFractionDigits:2},kIDR:{maximumFractionDigits:4,minimumFractionDigits:2},RSD:{maximumFractionDigits:2,minimumFractionDigits:2},STAKEGC:{displayAs:"GC",maximumFractionDigits:0,minimumFractionDigits:0},STAKESC:{displayAs:"SC",maximumFractionDigits:2,minimumFractionDigits:2},"BK.":{maximumFractionDigits:2,minimumFractionDigits:2},"BT.":{maximumFractionDigits:2,minimumFractionDigits:2},"FC.":{maximumFractionDigits:2,minimumFractionDigits:2},"GC.":{maximumFractionDigits:2,minimumFractionDigits:2},"SC.":{maximumFractionDigits:2,minimumFractionDigits:2},GLD:{displayAs:"GC.",maximumFractionDigits:2,minimumFractionDigits:2},SS1:{displayAs:"SC.",maximumFractionDigits:2,minimumFractionDigits:2},SVC:{maximumFractionDigits:2,minimumFractionDigits:2},DOT:{maximumFractionDigits:4,minimumFractionDigits:4},SOL:{maximumFractionDigits:4,minimumFractionDigits:4},XRP:{maximumFractionDigits:4,minimumFractionDigits:4},ADA:{maximumFractionDigits:4,minimumFractionDigits:4},TON:{maximumFractionDigits:4,minimumFractionDigits:4},FTN:{maximumFractionDigits:4,minimumFractionDigits:4}};function M(r){return r in T}function j(r){return M(r)?{...T[r],currency:w}:{currency:r}}function q(r,i,t){const n=i.format(+r);return M(t)?n.replace(w,T[t].displayAs??t):n}function K(r,i,t){const{maximumFractionDigits:n,minimumFractionDigits:o}=t.resolvedOptions();return O(r,i,{maximumFractionDigits:n,minimumFractionDigits:o})}function V(r,i,{as:t}={as:"Currency"}){const{canShowCurrency:n,currency:o}=r;return t==="Number"||!n?`${i}`:`${i} ${o}`}function v(r,i,{as:t,from:n}={as:"Currency",from:"Money"},o){if(!["string","number"].includes(typeof i))return"NaN";const{canShowCurrency:a=!0,coinValueInCents:g,currency:x,locales:R}=r;n==="Coins"&&(i=_(+i,g));try{const H=j(x),E=new Intl.NumberFormat(R,{...H,...o,currencyDisplay:"symbol",numberingSystem:"latn",style:"currency"});return t==="Number"||!a?K(r,i,E):q(i,E,x)}catch{return V(r,i,{as:t})}}var c;class B{constructor({config:i}){e(this,c,void 0);u(this,c,i)}formatNumber(i,t){const n={locales:[m(this,c).ui.language]};return O(n,i,t)}formatCurrency(i,t={as:y.Currency,from:f.Money},n){const o=m(this,c).ui.feature.showCurrency,a=m(this,c).api.coinValueInCents,g=m(this,c).api.currency||w,x=[m(this,c).ui.language];return v({canShowCurrency:o,coinValueInCents:a,currency:g,locales:x},i,t,n)}formatCoins(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Coins},t)}formatCoinsWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Coins},t)}formatMoney(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Money},t)}formatMoneyWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Money},t)}}c=new WeakMap;const X=()=>{};var d,h,p,C;class z{constructor({messagePort:i}){e(this,d,void 0);e(this,h,void 0);e(this,p,void 0);e(this,C,void 0);u(this,C,i),this.on("configured",t=>{u(this,d,t),u(this,p,new B({config:t})),u(this,h,new A({config:t}))}),this.on("playResponse",t=>{this.config.api.lastRoundId=t.contract.roundId})}get config(){if(!m(this,d))throw new Error("config is not initialized, you must open game first");return m(this,d)}get history(){if(!m(this,h))throw new Error("config is not initialized, you must open game first");return m(this,h)}get i18n(){if(!m(this,p))throw new Error("i18n is not initialized, you must open game first");return m(this,p)}request(i,...[t]){return new Promise(n=>{this.on(`${i}Response`,o=>n({type:"response",response:o}),{once:!0}),this.on(`${i}Error`,o=>n({type:"error",error:o}),{once:!0}),this.send(i,t)})}on(i,t,n){const o=function a(g){g.data.message===`kalamba:wrapper:${i}`&&(X("on",g.data.message.replace(/^kalamba:/,""),g.data.payload),t(g.data.payload),n!=null&&n.once&&window.removeEventListener("message",a))};window.addEventListener("message",o)}send(i,...[t]){m(this,C).postMessage({message:`kalamba:sdk:${i}`,payload:t},"*")}configure(i){this.send("configure",i)}async openGame(){const i=new Promise(n=>this.on("configured",n,{once:!0})),t=await this.request("openGame");if(t.type==="response")return await i,t.response;throw t.error.type==="timeout"?new D.TimeoutError:new D.RgsError(t.error.data)}async play(i,t,n="SPIN"){const o={contract:i,extra:t,actionType:n},a=await this.request("play",o);if(a.type==="response")return a.response;throw a.error.type==="timeout"?new D.TimeoutError:new D.RgsError(a.error.data)}}d=new WeakMap,h=new WeakMap,p=new WeakMap,C=new WeakMap;exports.RgsError=D.RgsError;exports.RgsErrorCode=D.RgsErrorCode;exports.TimeoutError=D.TimeoutError;exports.History=A;exports.I18n=B;exports.KalambaSdk=z;
5
+ "use strict";var b=(r,i,t)=>{if(!i.has(r))throw TypeError("Cannot "+t)};var m=(r,i,t)=>(b(r,i,"read from private field"),t?t.call(r):i.get(r)),e=(r,i,t)=>{if(i.has(r))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(r):i.set(r,t)},u=(r,i,t,n)=>(b(r,i,"write to private field"),n?n.call(r,t):i.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("./errors-358575c3.cjs");function A(r){const i=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&i==="[object Date]"?new r.constructor(+r):typeof r=="number"||i==="[object Number]"||typeof r=="string"||i==="[object String]"?new Date(r):new Date(NaN)}function U(r){const i=A(r);return i.setHours(23,59,59,999),i}function L(){return U(Date.now())}function P(r){const i=A(r);return i.setHours(0,0,0,0),i}function k(){return P(Date.now())}const G=3e4;var F,S;class ${constructor(i){e(this,F,void 0);e(this,S,G);u(this,F,i)}buildHeaders(){const i={};return m(this,F).token&&(i.Authorization=`Bearer ${m(this,F).token}`),i}async request(i,t){const n=new URL(i,m(this,F).apiUrl??window.location.origin);return n.search=new URLSearchParams({...t}).toString(),await(await fetch(n,{signal:AbortSignal.timeout(m(this,S)),headers:this.buildHeaders()})).json()}async getRounds(i){return this.request("/rounds",i)}async getRound(i,t){return this.request(`/rounds/${i}`,t)}}F=new WeakMap,S=new WeakMap;const N={limit:100,page:0};var s,l;class I{constructor({config:i}){e(this,s,void 0);e(this,l,void 0);u(this,s,i),u(this,l,new $({apiUrl:i.api.gameHistoryUrl}))}async getRound(i,{pagination:t=N}={}){return m(this,l).getRound(i,{gameCode:m(this,s).api.game,operatorCode:m(this,s).api.brand,username:m(this,s).api.user,...t})}async getLastRound(){return m(this,s).api.lastRoundId?this.getRound(m(this,s).api.lastRoundId):null}async getRounds({searchPeriod:i={fromDateTime:k(),toDateTime:L()},pagination:t=N}={}){const n=m(this,s).api.user.replace(/^user_/,"").replace(new RegExp(`_${m(this,s).api.integration}$`),"");return m(this,l).getRounds({gameCode:m(this,s).api.game,operatorCode:m(this,s).api.integration,username:n,fromDataTime:i.fromDateTime.toISOString(),toDateTime:i.toDateTime.toISOString(),...t})}}s=new WeakMap,l=new WeakMap;function _(r,i){return r*i/100}function O(r,i,t){if(!["string","number"].includes(typeof i))return"NaN";const{locales:n}=r;try{return new Intl.NumberFormat(n,{...t,numberingSystem:"latn",style:"decimal"}).format(+i)}catch{return`${i}`}}const w="XTS";var y=(r=>(r.Currency="Currency",r.Number="Number",r))(y||{}),f=(r=>(r.Coins="Coins",r.Money="Money",r))(f||{});const T={ARSB:{displayAs:"ARS",maximumFractionDigits:2,minimumFractionDigits:2},CHIPS:{maximumFractionDigits:0,minimumFractionDigits:0},BNB:{maximumFractionDigits:6,minimumFractionDigits:6},BUSD:{maximumFractionDigits:4,minimumFractionDigits:4},BTC:{maximumFractionDigits:8,minimumFractionDigits:2},mBTC:{maximumFractionDigits:5,minimumFractionDigits:2},uBTC:{maximumFractionDigits:2,minimumFractionDigits:2},BCH:{maximumFractionDigits:8,minimumFractionDigits:2},mBCH:{maximumFractionDigits:2,minimumFractionDigits:2},ETH:{maximumFractionDigits:8,minimumFractionDigits:2},mETH:{maximumFractionDigits:5,minimumFractionDigits:2},uETH:{maximumFractionDigits:2,minimumFractionDigits:2},SOC:{maximumFractionDigits:8,minimumFractionDigits:2},LTC:{maximumFractionDigits:8,minimumFractionDigits:2},mLTC:{maximumFractionDigits:5,minimumFractionDigits:2},uLTC:{maximumFractionDigits:2,minimumFractionDigits:2},DOG:{maximumFractionDigits:4,minimumFractionDigits:2},USDC:{maximumFractionDigits:4,minimumFractionDigits:4},USDT:{maximumFractionDigits:4,minimumFractionDigits:2},TRX:{maximumFractionDigits:2,minimumFractionDigits:2},TUSD:{maximumFractionDigits:2,minimumFractionDigits:2},DAI:{maximumFractionDigits:2,minimumFractionDigits:2},XMR:{maximumFractionDigits:4,minimumFractionDigits:4},CBET:{maximumFractionDigits:0,minimumFractionDigits:0},kCBET:{maximumFractionDigits:2,minimumFractionDigits:2},SHIB:{maximumFractionDigits:0,minimumFractionDigits:0},kSHIB:{maximumFractionDigits:4,minimumFractionDigits:2},NEO:{maximumFractionDigits:4,minimumFractionDigits:4},BSV:{maximumFractionDigits:4,minimumFractionDigits:4},EOS:{maximumFractionDigits:4,minimumFractionDigits:4},DASH:{maximumFractionDigits:4,minimumFractionDigits:4},XLM:{maximumFractionDigits:2,minimumFractionDigits:2},KRW:{maximumFractionDigits:2,minimumFractionDigits:2},kVND:{maximumFractionDigits:4,minimumFractionDigits:2},kIDR:{maximumFractionDigits:4,minimumFractionDigits:2},RSD:{maximumFractionDigits:2,minimumFractionDigits:2},STAKEGC:{displayAs:"GC",maximumFractionDigits:0,minimumFractionDigits:0},STAKESC:{displayAs:"SC",maximumFractionDigits:2,minimumFractionDigits:2},"BK.":{maximumFractionDigits:2,minimumFractionDigits:2},"BT.":{maximumFractionDigits:2,minimumFractionDigits:2},"FC.":{maximumFractionDigits:2,minimumFractionDigits:2},"GC.":{maximumFractionDigits:2,minimumFractionDigits:2},"SC.":{maximumFractionDigits:2,minimumFractionDigits:2},GLD:{displayAs:"GC.",maximumFractionDigits:2,minimumFractionDigits:2},SS1:{displayAs:"SC.",maximumFractionDigits:2,minimumFractionDigits:2},SWEP:{displayAs:"SC.",maximumFractionDigits:2,minimumFractionDigits:2},GCLC:{displayAs:"GC.",maximumFractionDigits:2,minimumFractionDigits:2},SVC:{maximumFractionDigits:2,minimumFractionDigits:2},DOT:{maximumFractionDigits:4,minimumFractionDigits:4},SOL:{maximumFractionDigits:4,minimumFractionDigits:4},XRP:{maximumFractionDigits:4,minimumFractionDigits:4},ADA:{maximumFractionDigits:4,minimumFractionDigits:4},TON:{maximumFractionDigits:4,minimumFractionDigits:4},FTN:{maximumFractionDigits:4,minimumFractionDigits:4}};function M(r){return r in T}function j(r){return M(r)?{...T[r],currency:w}:{currency:r}}function q(r,i,t){const n=i.format(+r);return M(t)?n.replace(w,T[t].displayAs??t):n}function K(r,i,t){const{maximumFractionDigits:n,minimumFractionDigits:o}=t.resolvedOptions();return O(r,i,{maximumFractionDigits:n,minimumFractionDigits:o})}function V(r,i,{as:t}={as:"Currency"}){const{canShowCurrency:n,currency:o}=r;return t==="Number"||!n?`${i}`:`${i} ${o}`}function v(r,i,{as:t,from:n}={as:"Currency",from:"Money"},o){if(!["string","number"].includes(typeof i))return"NaN";const{canShowCurrency:a=!0,coinValueInCents:g,currency:x,locales:E}=r;n==="Coins"&&(i=_(+i,g));try{const H=j(x),R=new Intl.NumberFormat(E,{...H,...o,currencyDisplay:"symbol",numberingSystem:"latn",style:"currency"});return t==="Number"||!a?K(r,i,R):q(i,R,x)}catch{return V(r,i,{as:t})}}var c;class B{constructor({config:i}){e(this,c,void 0);u(this,c,i)}formatNumber(i,t){const n={locales:[m(this,c).ui.language]};return O(n,i,t)}formatCurrency(i,t={as:y.Currency,from:f.Money},n){const o=m(this,c).ui.feature.showCurrency,a=m(this,c).api.coinValueInCents,g=m(this,c).api.currency||w,x=[m(this,c).ui.language];return v({canShowCurrency:o,coinValueInCents:a,currency:g,locales:x},i,t,n)}formatCoins(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Coins},t)}formatCoinsWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Coins},t)}formatMoney(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Money},t)}formatMoneyWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Money},t)}}c=new WeakMap;const X=()=>{};var d,h,C,p;class z{constructor({messagePort:i}){e(this,d,void 0);e(this,h,void 0);e(this,C,void 0);e(this,p,void 0);u(this,p,i),this.on("configured",t=>{u(this,d,t),u(this,C,new B({config:t})),u(this,h,new I({config:t}))}),this.on("playResponse",t=>{this.config.api.lastRoundId=t.contract.roundId})}get config(){if(!m(this,d))throw new Error("config is not initialized, you must open game first");return m(this,d)}get history(){if(!m(this,h))throw new Error("config is not initialized, you must open game first");return m(this,h)}get i18n(){if(!m(this,C))throw new Error("i18n is not initialized, you must open game first");return m(this,C)}request(i,...[t]){return new Promise(n=>{this.on(`${i}Response`,o=>n({type:"response",response:o}),{once:!0}),this.on(`${i}Error`,o=>n({type:"error",error:o}),{once:!0}),this.send(i,t)})}on(i,t,n){const o=function a(g){g.data.message===`kalamba:wrapper:${i}`&&(X("on",g.data.message.replace(/^kalamba:/,""),g.data.payload),t(g.data.payload),n!=null&&n.once&&window.removeEventListener("message",a))};window.addEventListener("message",o)}send(i,...[t]){m(this,p).postMessage({message:`kalamba:sdk:${i}`,payload:t},"*")}configure(i){this.send("configure",i)}async openGame(){const i=new Promise(n=>this.on("configured",n,{once:!0})),t=await this.request("openGame");if(t.type==="response")return await i,t.response;throw t.error.type==="timeout"?new D.TimeoutError:new D.RgsError(t.error.data)}async play(i,t,n="SPIN"){const o={contract:i,extra:t,actionType:n},a=await this.request("play",o);if(a.type==="response")return a.response;throw a.error.type==="timeout"?new D.TimeoutError:new D.RgsError(a.error.data)}}d=new WeakMap,h=new WeakMap,C=new WeakMap,p=new WeakMap;exports.RgsError=D.RgsError;exports.RgsErrorCode=D.RgsErrorCode;exports.TimeoutError=D.TimeoutError;exports.History=I;exports.I18n=B;exports.KalambaSdk=z;
package/dist/index.d.ts CHANGED
@@ -99,6 +99,34 @@ export declare type ForwardToSdkMessage = keyof ToSdkForwardedMessageMap;
99
99
 
100
100
  export declare type ForwardToSdkMessagePayload<M extends ForwardToSdkMessage> = ToSdkForwardedMessageMap[M];
101
101
 
102
+ export declare type FreeRound = {
103
+ conf: {
104
+ base: number;
105
+ multiplier: number;
106
+ numAwarded: number;
107
+ };
108
+ data: {
109
+ numPlayed: number;
110
+ win: number;
111
+ numLeft: number;
112
+ };
113
+ id: string;
114
+ rejectable: boolean;
115
+ skippable: boolean;
116
+ status: 'PENDING' | 'ACTIVE' | 'FINISHED';
117
+ type: string;
118
+ };
119
+
120
+ export declare type FreeRoundsAction = {
121
+ action: 'ACCEPT' | 'DECLINE' | 'SKIP';
122
+ id: string;
123
+ };
124
+
125
+ export declare type FreeRoundsResponse = {
126
+ action: 'ACCEPT' | 'DECLINE' | 'SKIP';
127
+ id: string;
128
+ };
129
+
102
130
  export declare interface GetRoundOptions {
103
131
  pagination?: Pagination;
104
132
  }
@@ -163,6 +191,10 @@ export declare type MessageMessageEvent<M extends Message> = MessageEvent<{
163
191
 
164
192
  export declare type MessagePayload<M extends Message> = MessageMap[M];
165
193
 
194
+ declare type NestedRecord<K extends string | number | symbol, V> = {
195
+ [k in K]: V | NestedRecord<K, V>;
196
+ };
197
+
166
198
  export declare type OpenGameResponse = {
167
199
  contract: {
168
200
  bet: {
@@ -176,6 +208,7 @@ export declare type OpenGameResponse = {
176
208
  coins: number;
177
209
  version: number;
178
210
  };
211
+ freeRounds: FreeRound[];
179
212
  gameModel: string;
180
213
  metaData: {
181
214
  rtpValues: {
@@ -226,6 +259,7 @@ export declare type PlayResponse = {
226
259
  coins: number;
227
260
  version: number;
228
261
  };
262
+ freeRounds: FreeRound[];
229
263
  roundId: string;
230
264
  serverTime: number;
231
265
  stateType: {
@@ -330,6 +364,8 @@ export declare type RgsOnlyMessagePayloadMap = {
330
364
  openGameResponse: OpenGameResponse;
331
365
  playError: RgsErrorWithType;
332
366
  playResponse: PlayResponse;
367
+ freeRoundsResponse: FreeRoundsResponse;
368
+ freeRoundsError: RgsErrorWithType;
333
369
  realityCheck: {
334
370
  duration: number;
335
371
  sumBetAmount: number;
@@ -456,9 +492,7 @@ export declare type SdkOnlyMessagePayloadMap = {
456
492
  playCycleEnd: PlayResponse;
457
493
  playCycleStart: ContractPlayPayload;
458
494
  playEnd: PlayResponse;
459
- playReady: {
460
- ready: boolean;
461
- };
495
+ playReady: never;
462
496
  playStart: ContractPlayPayload;
463
497
  /**
464
498
  * ```typescript
@@ -472,16 +506,15 @@ export declare type SdkOnlyMessagePayloadMap = {
472
506
  * }
473
507
  * ```
474
508
  */
475
- translations: Record<string, Record<string, string>>;
509
+ translations: Record<string, NestedRecord<string, string>>;
476
510
  settings: Settings;
477
511
  'telemetry.click': {
478
512
  location: string;
479
513
  name: string;
480
514
  };
481
515
  'telemetry.orientationChange': never;
482
- freeRoundsOffer: any;
483
- freeRoundsInfo: any;
484
- freeRoundsComplete: any;
516
+ freeRounds: FreeRoundsAction;
517
+ freeRoundsPopup: never;
485
518
  };
486
519
 
487
520
  export declare interface SearchPeriod {
@@ -551,11 +584,23 @@ export declare type WrapperOnlyMessagePayloadMap = {
551
584
  state: WrapperState;
552
585
  suspend: never;
553
586
  unfreeze: never;
587
+ legalBets: Record<number, number[]>;
588
+ play: PlayRequest & {
589
+ payloadToInject?: Record<string, unknown>;
590
+ };
591
+ freeRounds: FreeRoundsAction;
592
+ freeRoundsOffer: FreeRound;
593
+ freeRoundsInfo: FreeRound;
594
+ freeRoundsComplete: FreeRound;
595
+ freeRoundsPopup: never;
554
596
  };
555
597
 
556
598
  export declare type WrapperState = {
557
599
  balance: number;
558
600
  bet: Bet;
601
+ openGameResponse?: OpenGameResponse;
602
+ lastPlayResponse?: PlayResponse;
603
+ freeRoundId?: string;
559
604
  };
560
605
 
561
606
  export { }
package/dist/index.js CHANGED
@@ -28,15 +28,15 @@ function L(n) {
28
28
  const i = I(n);
29
29
  return i.setHours(0, 0, 0, 0), i;
30
30
  }
31
- function k() {
31
+ function P() {
32
32
  return L(Date.now());
33
33
  }
34
- const P = 3e4;
34
+ const k = 3e4;
35
35
  var D, x;
36
- class $ {
36
+ class G {
37
37
  constructor(i) {
38
38
  e(this, D, void 0);
39
- e(this, x, P);
39
+ e(this, x, k);
40
40
  u(this, D, i);
41
41
  }
42
42
  buildHeaders() {
@@ -64,21 +64,21 @@ const A = {
64
64
  limit: 100,
65
65
  page: 0
66
66
  };
67
- var s, y;
68
- class G {
67
+ var s, f;
68
+ class $ {
69
69
  constructor({
70
70
  config: i
71
71
  }) {
72
72
  e(this, s, void 0);
73
- e(this, y, void 0);
74
- u(this, s, i), u(this, y, new $({
73
+ e(this, f, void 0);
74
+ u(this, s, i), u(this, f, new G({
75
75
  apiUrl: i.api.gameHistoryUrl
76
76
  }));
77
77
  }
78
78
  async getRound(i, {
79
79
  pagination: t = A
80
80
  } = {}) {
81
- return m(this, y).getRound(i, {
81
+ return m(this, f).getRound(i, {
82
82
  gameCode: m(this, s).api.game,
83
83
  operatorCode: m(this, s).api.brand,
84
84
  username: m(this, s).api.user,
@@ -90,13 +90,13 @@ class G {
90
90
  }
91
91
  async getRounds({
92
92
  searchPeriod: i = {
93
- fromDateTime: k(),
93
+ fromDateTime: P(),
94
94
  toDateTime: U()
95
95
  },
96
96
  pagination: t = A
97
97
  } = {}) {
98
98
  const r = m(this, s).api.user.replace(/^user_/, "").replace(new RegExp(`_${m(this, s).api.integration}$`), "");
99
- return m(this, y).getRounds({
99
+ return m(this, f).getRounds({
100
100
  gameCode: m(this, s).api.game,
101
101
  operatorCode: m(this, s).api.integration,
102
102
  username: r,
@@ -106,7 +106,7 @@ class G {
106
106
  });
107
107
  }
108
108
  }
109
- s = new WeakMap(), y = new WeakMap();
109
+ s = new WeakMap(), f = new WeakMap();
110
110
  function _(n, i) {
111
111
  return n * i / 100;
112
112
  }
@@ -127,7 +127,7 @@ function O(n, i, t) {
127
127
  }
128
128
  }
129
129
  const S = "XTS";
130
- var F = /* @__PURE__ */ ((n) => (n.Currency = "Currency", n.Number = "Number", n))(F || {}), f = /* @__PURE__ */ ((n) => (n.Coins = "Coins", n.Money = "Money", n))(f || {});
130
+ var F = /* @__PURE__ */ ((n) => (n.Currency = "Currency", n.Number = "Number", n))(F || {}), y = /* @__PURE__ */ ((n) => (n.Coins = "Coins", n.Money = "Money", n))(y || {});
131
131
  const w = {
132
132
  /* eslint-disable sort-keys-fix/sort-keys-fix */
133
133
  // ARSB is the internal currency relevant for invoicing purposes, players should see it as ARS
@@ -210,6 +210,9 @@ const w = {
210
210
  "SC.": { maximumFractionDigits: 2, minimumFractionDigits: 2 },
211
211
  GLD: { displayAs: "GC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
212
212
  SS1: { displayAs: "SC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
213
+ // Softswiss
214
+ SWEP: { displayAs: "SC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
215
+ GCLC: { displayAs: "GC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
213
216
  // Silvercash
214
217
  SVC: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
215
218
  // Polkadot
@@ -286,7 +289,7 @@ class v {
286
289
  const r = { locales: [m(this, c).ui.language] };
287
290
  return O(r, i, t);
288
291
  }
289
- formatCurrency(i, t = { as: F.Currency, from: f.Money }, r) {
292
+ formatCurrency(i, t = { as: F.Currency, from: y.Money }, r) {
290
293
  const o = m(this, c).ui.feature.showCurrency, a = m(this, c).api.coinValueInCents, g = m(this, c).api.currency || S, C = [m(this, c).ui.language];
291
294
  return X({
292
295
  canShowCurrency: o,
@@ -296,16 +299,16 @@ class v {
296
299
  }, i, t, r);
297
300
  }
298
301
  formatCoins(i, t) {
299
- return this.formatCurrency(i, { as: F.Number, from: f.Coins }, t);
302
+ return this.formatCurrency(i, { as: F.Number, from: y.Coins }, t);
300
303
  }
301
304
  formatCoinsWithCurrency(i, t) {
302
- return this.formatCurrency(i, { as: F.Currency, from: f.Coins }, t);
305
+ return this.formatCurrency(i, { as: F.Currency, from: y.Coins }, t);
303
306
  }
304
307
  formatMoney(i, t) {
305
- return this.formatCurrency(i, { as: F.Number, from: f.Money }, t);
308
+ return this.formatCurrency(i, { as: F.Number, from: y.Money }, t);
306
309
  }
307
310
  formatMoneyWithCurrency(i, t) {
308
- return this.formatCurrency(i, { as: F.Currency, from: f.Money }, t);
311
+ return this.formatCurrency(i, { as: F.Currency, from: y.Money }, t);
309
312
  }
310
313
  }
311
314
  c = new WeakMap();
@@ -319,7 +322,7 @@ class Y {
319
322
  e(this, p, void 0);
320
323
  e(this, d, void 0);
321
324
  u(this, d, i), this.on("configured", (t) => {
322
- u(this, l, t), u(this, p, new v({ config: t })), u(this, h, new G({ config: t }));
325
+ u(this, l, t), u(this, p, new v({ config: t })), u(this, h, new $({ config: t }));
323
326
  }), this.on("playResponse", (t) => {
324
327
  this.config.api.lastRoundId = t.contract.roundId;
325
328
  });
@@ -380,7 +383,7 @@ class Y {
380
383
  }
381
384
  l = new WeakMap(), h = new WeakMap(), p = new WeakMap(), d = new WeakMap();
382
385
  export {
383
- G as History,
386
+ $ as History,
384
387
  v as I18n,
385
388
  Y as KalambaSdk,
386
389
  E as RgsError,
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 zt=Object.defineProperty;var qt=(i,t,e)=>t in i?zt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var b=(i,t,e)=>(qt(i,typeof t!="symbol"?t+"":t,e),e),ct=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var y=(i,t,e)=>(ct(i,t,"read from private field"),e?e.call(i):t.get(i)),C=(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)},v=(i,t,e,a)=>(ct(i,t,"write to private field"),a?a.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Re=require("./errors-358575c3.cjs"),dt=require("./noop-b3c54b76.cjs");function U(i,t){return(e,...a)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...a)}}function _t(i,t){return Math.round(i*100/t)}class G{constructor(t,e){b(this,"config");b(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,a){const n=function(s){s.data.message!==`kalamba:wrapper-casino:${t}`&&s.data.message!==`kalamba:wrapper:${t}`||e(s.data.payload)};window.addEventListener("message",n,a)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}const Gt=U("BasicPlugin","color:#000000;font-weight:bold;");class Wt extends G{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Gt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,payload:a}=t.data;switch(e){case"doAudioSettings":this.send("settings",{music:a==null?void 0:a.musicEnabled,sounds:a==null?void 0:a.soundEnabled});return;case"doBalanceUpdate":const{currency:n,coinValueInCents:r}=this.sdkConfig.api;a.currency===n&&typeof a.balanceInCurrency=="number"?this.send("balance",{balance:_t(a.balanceInCurrency,r)}):(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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const k=U("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),$t=U("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class jt extends G{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){$t(...t),this.send(...t)}}const Kt=U("GigPlugin","color:#000000;font-weight:bold;");class Qt extends G{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Kt("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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.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 Jt extends G{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Xt("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:e,param:a}=t.data;switch(e){case"doBalanceUpdate":this.send("balance",{balance:a});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 lt=U("PariplayPlugin","color:#000000;font-weight:bold;");function Ve(i){try{window.top.location=i}catch{window.location=i}}function ze(i,t){return new Promise(function(a,n){const r=new XMLHttpRequest;r.onload=function(){r.status>=200&&r.status<300?a(r.responseText):n(r.responseText)},r.open(i,t),r.send()})}function qe(){}function Yt(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function Ge(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Ft(i){try{return JSON.parse(i.text)}catch{return{}}}function Zt(i){return i.map(Ft).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function ei(i){return i.map(Ft).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ti extends G{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),lt("configured")}postMessage(t,e){const a={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};e!=null&&(a.data=e),lt("postMessage",a),window.parent.postMessage(a,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&ze("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":ze("GET",t.link),e();return;case"AJAXRESPONSE":ze("GET",t.link).then(()=>{e()});return;case"REDIRECT":Ve(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,a)=>e.then(()=>new Promise(n=>{Object.assign({},a,{buttons:a.buttons.filter(r=>r.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(r=>Object.assign({},r,{onRelease:()=>{const s=a.messageType.toUpperCase()==="POPUP"?qe:n,h=this.buttonActions[r.action.toUpperCase()];h?h(r,s):s()}}))})}).catch(qe)),Promise.resolve()).then(()=>{}).catch(qe)}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 a;try{const n=JSON.parse(JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token),r=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");a={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:r}}catch{a=void 0}this.postMessage("gameDataLoaded",{LoadGameData:a,success:!0});try{const n=Ge(e.contract.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.sdkConfig.api.homeUrl)if(this.sdkConfig.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.sdkConfig.api.homeUrl==="(api)"?this.postMessage("quit"):Ve(this.sdkConfig.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.contract.balance.coins),win:this.coinsToCurrency(e.contract.win.round)});try{const a=Ge(e.contract.uiMessages);this.processInfoUiMessages(a)}catch{}}),this.on("playError",e=>{var a,n;this.postMessage("ticketReceived",{ErrorCode:(a=e.data)==null?void 0:a.code,ErrorMessage:"ERROR",Status:{ErrCode:(n=e.data)==null?void 0:n.code}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.contract.balance.coins+e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier)});const a=["BaseGame","PaidSpin"].includes(e.contract.stateType.thisRound),n=Yt(e.contract.uiMessages),r=Ge(e.contract.uiMessages),s=Zt(n),h=ei(n);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.contract.balance.coins),BetAmount:a?this.coinsToCurrency(e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier):0,CreditTransactionId:s.betId,DebitTransactionId:s.winId,Message:r,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.contract.win.round)})}),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.sdkConfig.api.cashierUrl&&(this.sdkConfig.api.cashierUrl==="(api)"?this.postMessage("cashier"):Ve(this.sdkConfig.api.cashierUrl))})}}const ge=U("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ii extends G{constructor(...e){super(...e);b(this,"VERSION","1.15.0");const a=document.createElement("script");a.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,a.onload=()=>{ge("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),ge("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(a)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>ge("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>ge("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>ge("!!! 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:a})=>{window.FEIM.send.betUpdate(e*a)}),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 a={balance:e.contract.balance.coins,bet:e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,win:{win:e.contract.win.total}};window.FEIM.send.roundFinished(a)}),this.on("playResponse",e=>{const a={balance:e.contract.balance.coins,playResponse:e.data};window.FEIM.send.roundStarted(a)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}const We=U("TukoPlugin","color:#000000;font-weight:bold;");class ai extends G{constructor(...e){super(...e);b(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(),We("configured")}ping(e){const a=new XMLHttpRequest;a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&(a.status===0||a.status>=200&&a.status<400?We("ping ok",a):We("ping error",a))},a.open("GET",e),a.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:a,payload:n}=e.data;switch(a){case"doAudioSettings":this.send("settings",{music:n==null?void 0:n.musicEnabled,sounds:n==null?void 0:n.soundEnabled});return;case"doBalanceUpdate":const{currency:r,coinValueInCents:s}=this.sdkConfig.api;n.currency===r&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:_t(n.balanceInCurrency,s)}):(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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}class Dt{constructor(t,e){b(this,"config");b(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,a){const n=function(s){s.data.message!==`kalamba:wrapper-rgs:${t}`&&s.data.message!==`kalamba:wrapper:${t}`||e(s.data.payload)};window.addEventListener("message",n,a)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}}class ni{constructor(t){b(this,"socket",null);b(this,"webSocketUrl");b(this,"eventListeners",{close:[],error:[],message:[]});b(this,"connect",()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(e=>{t.addEventListener("open",a=>{this.handleOpen(a),e(this.socket)})})});b(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});b(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)})});b(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)})});b(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});b(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});b(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 a=this.eventListeners[t].indexOf(e);a!==-1&&this.eventListeners[t].splice(a,1)}}function Me(i){return JSON.parse(i==null?void 0:i.data)}function si(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function ut(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}function Le(i){return i.header.name==="GameEvent"}function oi(i){return Le(i)&&i.body.event==="OPEN_GAME"}function ht(i){return i.header.code!==1}function ri(i){return Le(i)&&i.body.event.includes("_RESULT")}var ie,ve;class ci extends ni{constructor(e,a){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());b(this,"cId",0);b(this,"mId",0);b(this,"seqId",10);b(this,"gameCode");C(this,ie,void 0);C(this,ve,void 0);b(this,"onMessage",e=>{const a=Me(e);(Le(a)||si(a)||ut(a))&&this.sendAcknowledgement(a),ut(a)&&this.handleRealityCheck(a)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,v(this,ie,a.requestTimeoutMs),v(this,ve,a.gameVersion??"unknown"),this.addEventListener("message",this.onMessage)}handleRealityCheck(e){this.eventListeners.realityCheck.forEach(a=>{a(e.body)})}addEventListener(e,a){super.addEventListener(e,a)}removeEventListener(e,a){super.removeEventListener(e,a)}buildHeader(e,a=null){return{cId:a??++this.cId,code:a!==null?1:void 0,mId:++this.mId,name:e}}buildPayload(e,a){return JSON.stringify({body:a,header:e})}getBodyExtras(e){return{action:e,seqId:++this.seqId}}request(e,a){const n=this.buildPayload(e,a);return new Promise((r,s)=>{setTimeout(()=>s({type:"timeout"}),y(this,ie));const h=g=>{const w=Me(g);try{e.cId===w.header.cId&&(this.removeEventListener("message",h),w.header.code===1?r(w):s({message:w,type:"error"}))}catch{s({message:w,type:"error"})}};this.addEventListener("message",h),this.send(n)})}activateFreeRound(e){const a=this.buildHeader("ActivateFreeRound");return this.request(a,e)}authenticate(e=!1){const a=this.buildHeader("Authenticate"),n={clientType:3,version:y(this,ve),reconnect:e};return this.request(a,n).then(r=>r.body).catch(r=>{var s;throw{data:(s=r==null?void 0:r.message)==null?void 0:s.body,type:r.type}})}openGame(){const e=this.buildHeader("OpenGame"),a={gameCode:this.gameCode};return new Promise((n,r)=>{const s=h=>{const g=Me(h);oi(g)?(this.removeEventListener("message",s),n(g.body)):ht(g)&&r({data:g.body,type:"error"})};this.addEventListener("message",s),this.request(e,a).catch(h=>{var g;return r({data:(g=h==null?void 0:h.message)==null?void 0:g.body,type:h.type})})})}sendAcknowledgement(e){const{name:a,cId:n}=e.header,r=this.buildHeader(a,n),s=this.buildPayload(r,{});this.send(s)}sendAction(e,a){const n=this.buildHeader("GameAction"),r={...this.getBodyExtras(e),data:a};return new Promise((s,h)=>{const g=w=>{const p=Me(w);Le(p)&&r.seqId===p.body.correlationSeqId&&(this.removeEventListener("message",g),ri(p)?s(p.body):ht(p)&&h({data:p.body,type:"error"}))};this.addEventListener("message",g),this.request(n,r).catch(w=>{var p;return h({data:(p=w==null?void 0:w.message)==null?void 0:p.body,type:w.type})})})}setRequestTimeoutMs(e){v(this,ie,e)}}ie=new WeakMap,ve=new WeakMap;function di(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 li(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??Re.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function ui(i,t){return t.contract?{contract:{bet:{available:t.contract.availableMultipliersPerBaseBet,default:{base:t.contract.defaultBet.baseBet,multiplier:t.contract.defaultBet.betMultiplier},max:t.contract.maxBetInCoins,last:t.contract.lastBet?{base:t.contract.lastBet.baseBet,multiplier:t.contract.lastBet.betMultiplier}:null,lastPaid:t.contract.lastMainGameBet?{base:t.contract.lastMainGameBet.baseBet,multiplier:t.contract.lastMainGameBet.betMultiplier}:null},balance:{coins:t.contract.balanceInCoins,version:t.contract.balanceVersion},gameModel:t.contract.gameModelFile,metaData:t.contract.metaData,roundId:t.contract.roundId,serverTime:t.contract.serverTime,sessionId:t.contract.sessionId,stateType:{thisRound:t.contract.stateTypeThisRound,nextRound:t.contract.stateTypeNextRound},uiMessages:i.contract.uiMessages.concat(t.contract.uiMessages),win:{round:t.contract.roundWin,total:t.contract.totalWin}},data:t.opaqueGameServerToUi}:{contract:{bet:{available:t.data.additionalConfigData.availableMultipliersPerBaseBet,default:{base:t.data.additionalConfigData.defaultBet.baseBet,multiplier:t.data.additionalConfigData.defaultBet.betMultiplier},max:t.data.additionalConfigData.maxAllowedOverallBetInCoins,last:t.data.gameState.betFromCurrentRound?{base:t.data.gameState.betFromCurrentRound.baseBet,multiplier:t.data.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:t.data.gameState.lastPlacedMainGameBet?{base:t.data.gameState.lastPlacedMainGameBet.baseBet,multiplier:t.data.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:t.balance,version:t.balanceVersion},gameModel:t.data.additionalConfigData.gameModelFile,metaData:t.data.gameConfigData.metaData,roundId:t.data.gameState.cycleId,serverTime:t.balanceVersion,sessionId:t.data.gameState.sessionId,stateType:{thisRound:t.data.gameState.stateTypeThisRound,nextRound:t.data.gameState.stateTypeNextRound},uiMessages:i.uiMessages,win:{round:t.data.gameState.totalWinFromCurrentRound,total:t.data.gameState.totalWinFromCurrentGameCycle}},data:t.data}}function hi(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??Re.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function gi(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}}function wi(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??Re.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}const bi={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"},pi=U("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class mi extends Dt{constructor(...e){super(...e);b(this,"socket");this.on("openGame",async()=>{try{const a=await this.openGame();this.send("openGameResponse",a)}catch(a){this.send("openGameError",a)}}),this.on("play",async a=>{try{const n=await this.play(a);this.send("playResponse",n)}catch(n){this.send("playError",n)}}),this.on("configured",a=>{this.socket.setRequestTimeoutMs(a.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new ci(e,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),this.socket.addEventListener("close",a=>{a.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",a=>pi("error",a)),this.socket.addEventListener("realityCheck",a=>{this.send("realityCheck",a)})}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),a=e.get("apiUrl"),n=e.get("cageCode"),r=e.get("gameCode"),s=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),w=e.get("username"),p=e.get("gameHistoryUrl"),P=e.get("homeUrl")??void 0,N=e.get("cashierUrl")??void 0;this.initialize({apiUrl:a,cageCode:n,gameCode:r,operatorCode:s,playMode:h,token:g,username:w});try{await this.socket.connect()}catch{throw{type:"error",data:{code:Re.RgsErrorCode.CONNECTION_ERROR}}}let K;try{K=await this.socket.authenticate()}catch(B){throw{type:B.type,data:B.type==="error"?li(B.data):void 0}}let Q;try{Q=await this.socket.openGame()}catch(B){throw{type:B.type,data:B.type==="error"?hi(B.data):void 0}}const L=di(K),he=ui(K,Q);this.sdkConfig.api={brand:n,game:r,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:p,homeUrl:P,cashierUrl:N,sessionId:he.contract.sessionId,lastRoundId:he.contract.roundId};const x=e.get("languageCode");return x&&(this.sdkConfig.ui.language=x.length===3?bi[x]??x:x),he}async play(e){const{contract:{bet:a,forcedOutcomes:n,...r},extra:s,actionType:h}=e,g={bet:a?{baseBet:a.base,betMultiplier:a.multiplier}:void 0,forcedOutcomes:n,...r,opaqueUiToGameServer:s};let w;try{w=await this.socket.sendAction(h,g)}catch(p){throw{type:p.type,data:p.type==="error"?wi(p.data):void 0}}return gi(w)}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:a,integrationData:n,jurisdiction:r,user:s,gameHistoryUrl:h},ui:{language:g}}=this.sdkConfig,w=s.replace(/^user_/,"").replace(new RegExp(`_${a}$`),""),p=new URL(h);p.searchParams.set("gameCode",e),p.searchParams.set("jurisdiction",r),p.searchParams.set("operatorCode",a),p.searchParams.set("token",n.token),p.searchParams.set("username",w),p.searchParams.set("languageCode",g),window.open(p.toString(),"_blank")})}}var fi="2.0.0-beta.2",de="",gt="?",Ye="function",z="undefined",le="object",Ze="string",fe="major",d="model",o="name",l="type",u="vendor",c="version",M="architecture",Z="console",m="mobile",f="tablet",I="smarttv",Y="wearable",et="embedded",wt="user-agent",tt=500,nt="brands",$="formFactor",st="fullVersionList",ee="platform",ot="platformVersion",Ne="bitness",W="sec-ch-ua",yi=W+"-full-version-list",vi=W+"-arch",ki=W+"-"+Ne,Ei=W+"-form-factor",Ci=W+"-"+m,Mi=W+"-"+d,Rt=W+"-"+ee,Si=Rt+"-version",Nt=[nt,st,m,d,ee,ot,M,$,Ne],T="browser",_="cpu",O="device",F="engine",A="os",te="result",Se="Amazon",we="Apple",bt="ASUS",pt="BlackBerry",Ie="Google",mt="Huawei",ft="Lenovo",$e="LG",Ue="Microsoft",yt="Motorola",Te="Samsung",vt="Sharp",Pe="Sony",je="Xiaomi",Ke="Zebra",X="Mobile ",J=" Browser",Ae="Chrome",Ii="Edge",be="Firefox",pe="Opera",kt="Facebook",Et="Sogou",it="Windows",Ti=typeof window!==z,S=Ti&&window.navigator?window.navigator:void 0,H=S&&S.userAgentData?S.userAgentData:void 0,Pi=function(i,t){var e={};for(var a in i)e[a]=t[a]&&t[a].length%2===0?t[a].concat(i[a]):i[a];return e},He=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},at=function(i,t){if(typeof i===le&&i.length>0){for(var e in i)if(q(i[e])==q(t))return!0;return!1}return ue(i)?q(t).indexOf(q(i))!==-1:!1},Ct=function(i){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)},ue=function(i){return typeof i===Ze},Qe=function(i){if(i){for(var t=[],e=j(/\\?\"/g,i).split(","),a=0;a<e.length;a++)if(e[a].indexOf(";")>-1){var n=ye(e[a]).split(";v=");t[a]={brand:n[0],version:n[1]}}else t[a]=ye(e[a]);return t}},q=function(i){return ue(i)?i.toLowerCase():i},Xe=function(i){return ue(i)?j(/[^\d\.]/g,i).split(".")[0]:void 0},D=function(i){for(var t in i){var e=i[t];typeof e==le&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},j=function(i,t){return ue(t)?t.replace(i,de):t},me=function(i){return j(/\\?\"/g,i)},ye=function(i,t){if(ue(i))return i=j(/^\s\s*/,i),typeof t===z?i:i.substring(0,tt)},Mt=function(i,t){if(!(!i||!t))for(var e=0,a,n,r,s,h,g;e<t.length&&!h;){var w=t[e],p=t[e+1];for(a=n=0;a<w.length&&!h&&w[a];)if(h=w[a++].exec(i),h)for(r=0;r<p.length;r++)g=h[++n],s=p[r],typeof s===le&&s.length>0?s.length===2?typeof s[1]==Ye?this[s[0]]=s[1].call(this,g):this[s[0]]=s[1]:s.length===3?typeof s[1]===Ye&&!(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;e+=2}},Be=function(i,t){for(var e in t)if(typeof t[e]===le&&t[e].length>0){for(var a=0;a<t[e].length;a++)if(at(t[e][a],i))return e===gt?void 0:e}else if(at(t[e],i))return e===gt?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},St={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"},It={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:["VR","XR","Watch"],"?":["Desktop","Unknown"],"*":void 0},Tt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[o,X+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[o,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[o,c],[/opios[\/ ]+([\w\.]+)/i],[c,[o,pe+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[c,[o,pe+" GX"]],[/\bopr\/([\w\.]+)/i],[c,[o,pe]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[c,[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,c],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[o,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[c,[o,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[o,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[o,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[c,[o,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[c,[o,"Smart "+ft+J]],[/(avast|avg)\/([\w\.]+)/i],[[o,/(.+)/,"$1 Secure"+J],c],[/\bfocus\/([\w\.]+)/i],[c,[o,be+" Focus"]],[/\bopt\/([\w\.]+)/i],[c,[o,pe+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[o,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[o,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[o,pe+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[o,"MIUI"+J]],[/fxios\/([\w\.-]+)/i],[c,[o,X+be]],[/\bqihu|(qi?ho?o?|360)browser/i],[[o,"360"+J]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[o,/(.+)/,"$1"+J],c],[/samsungbrowser\/([\w\.]+)/i],[c,[o,Te+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[o,/_/g," "],c],[/metasr[\/ ]?([\d\.]+)/i],[c,[o,Et+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[o,Et+" Mobile"],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[o,c],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[o],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[o,kt],c],[/(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,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[o,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[c,[o,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[o,Ae+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[o,Ae+" WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[o,"Android"+J]],[/chrome\/([\w\.]+) mobile/i],[c,[o,X+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[o,c],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[c,[o,X+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[o,X+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[c,o],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[o,[c,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[o,c],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[o,X+be],c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[o,"Netscape"],c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[o,be+" 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,c],[/(cobalt)\/([\w\.]+)/i],[o,[c,/[^\d\.]+./,de]]],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/,de,q]],[/(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,q]]],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,f]],[/\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,we],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[u,we],[l,f]],[/(macintosh);/i],[d,[u,we]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[u,vt],[l,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[u,mt],[l,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[u,mt],[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,je],[l,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[u,je],[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,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,yt],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[u,yt],[l,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[u,$e],[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,$e],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[u,ft],[l,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[u,"Nokia"],[l,m]],[/(pixel c)\b/i],[d,[u,Ie],[l,f]],[/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,Pe],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[u,Pe],[l,f]],[/ (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,Se],[l,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[u,Se],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[d,u,[l,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[u,pt],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[u,bt],[l,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[u,bt],[l,m]],[/(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,m]],[/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,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,f]],[/(surface duo)/i],[d,[u,Ue],[l,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[u,"Fairphone"],[l,m]],[/(shield[\w ]+) b/i],[d,[u,"Nvidia"],[l,f]],[/(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,Ke],[l,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[u,Ke],[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,$e],[l,I]],[/(apple) ?tv/i],[u,[d,we+" TV"],[l,I]],[/crkey/i],[[d,Ae+"cast"],[u,Ie],[l,I]],[/droid.+aft(\w+)( bui|\))/i],[d,[u,Se],[l,I]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[u,vt],[l,I]],[/(bravia[\w ]+)( bui|\))/i],[d,[u,Pe],[l,I]],[/(mitv-\w{5}) bui/i],[d,[u,je],[l,I]],[/Hbbtv.*(technisat) (.*);/i],[u,d,[l,I]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,ye],[d,ye],[l,I]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,I]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,d,[l,Z]],[/droid.+; (shield) bui/i],[d,[u,"Nvidia"],[l,Z]],[/(playstation \w+)/i],[d,[u,Pe],[l,Z]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[u,Ue],[l,Z]],[/((pebble))app/i],[u,d,[l,Y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[u,we],[l,Y]],[/droid.+; (glass) \d/i],[d,[u,Ie],[l,Y]],[/droid.+; (wt63?0{2,3})\)/i],[d,[u,Ke],[l,Y]],[/(quest( 2| pro)?)/i],[d,[u,kt],[l,Y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,et]],[/(aeobc)\b/i],[d,[u,Se],[l,et]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[l,m]],[/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,m]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[o,Ii+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[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,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,o]],os:[[/microsoft (windows) (vista|xp)/i],[o,c],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[o,[c,Be,St]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,Be,St],[o,it]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[o,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[o,"macOS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[c,o],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[o,c],[/\(bb(10);/i],[c,[o,pt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[o,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[o,be+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[o,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[c,[o,"watchOS"]],[/crkey\/([\d\.]+)/i],[c,[o,Ae+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[o,"Chrome OS"],c],[/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,c],[/(sunos) ?([\w\.\d]*)/i],[[o,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[o,c]]},xe=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return D.call(i.init,[[T,[o,c,fe]],[_,[M]],[O,[l,d,u]],[F,[o,c]],[A,[o,c]]]),D.call(i.isIgnore,[[T,[c,fe]],[F,[c]],[A,[c]]]),D.call(i.isIgnoreRgx,[[T,/ ?browser$/i],[A,/ ?os$/i]]),D.call(i.toString,[[T,[o,c]],[_,[M]],[O,[u,d]],[F,[o,c]],[A,[o,c]]]),i}(),Ai=function(i,t){var e=xe.init[t],a=xe.isIgnore[t]||0,n=xe.isIgnoreRgx[t]||0,r=xe.toString[t]||0;function s(){D.call(this,e)}return s.prototype.getItem=function(){return i},s.prototype.withClientHints=function(){return H?H.getHighEntropyValues(Nt).then(function(h){return i.setCH(new Ht(h,!1)).parseCH().get()}):i.parseCH().get()},s.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=te&&(s.prototype.is=function(h){var g=!1;for(var w in this)if(this.hasOwnProperty(w)&&!at(a,w)&&q(n?j(n,this[w]):this[w])==q(n?j(n,h):h)){if(g=!0,h!=z)break}else if(h==z&&g){g=!g;break}return g},s.prototype.toString=function(){var h=de;for(var g in r)typeof this[r[g]]!==z&&(h+=(h?" ":de)+this[r[g]]);return h||z}),H||(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 p=new w;return h(p),p}),new s};function Ht(i,t){if(i=i||{},D.call(this,Nt),t)D.call(this,[[nt,Qe(i[W])],[st,Qe(i[yi])],[m,/\?1/.test(i[Ci])],[d,me(i[Mi])],[ee,me(i[Rt])],[ot,me(i[Si])],[M,me(i[vi])],[$,Qe(i[Ei])],[Ne,me(i[ki])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==z&&(this[e]=i[e])}function Pt(i,t,e,a){return this.get=function(n){return n?this.data.hasOwnProperty(n)?this.data[n]:void 0:this.data},this.set=function(n,r){return this.data[n]=r,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(S&&S.userAgent==this.ua)switch(this.itemType){case T:S.brave&&typeof S.brave.isBrave==Ye&&this.set(o,"Brave");break;case O:!this.get(l)&&H&&H[m]&&this.set(l,m),this.get(d)=="Macintosh"&&S&&typeof S.standalone!==z&&S.maxTouchPoints&&S.maxTouchPoints>2&&this.set(d,"iPad").set(l,f);break;case A:!this.get(o)&&H&&H[ee]&&this.set(o,H[ee]);break;case te:var n=this.data,r=function(s){return n[s].getItem().detectFeature().get()};this.set(T,r(T)).set(_,r(_)).set(O,r(O)).set(F,r(F)).set(A,r(A))}return this},this.parseUA=function(){return this.itemType!=te&&Mt.call(this.data,this.ua,this.rgxMap),this.itemType==T&&this.set(fe,Xe(this.get(c))),this},this.parseCH=function(){var n=this.uaCH,r=this.rgxMap;switch(this.itemType){case T:var s=n[st]||n[nt],h;if(s)for(var g in s){var w=j(/(Google|Microsoft) /,s[g].brand||s[g]),p=s[g].version;!/not.a.brand/i.test(w)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(w))&&(this.set(o,w).set(c,p).set(fe,Xe(p)),h=w)}break;case _:var P=n[M];P&&(P&&n[Ne]=="64"&&(P+="64"),Mt.call(this.data,P+";",r));break;case O:if(n[m]&&this.set(l,m),n[d]&&this.set(d,n[d]),n[d]=="Xbox"&&this.set(l,Z).set(u,Ue),n[$]){var N;if(typeof n[$]!="string")for(var K=0;!N&&K<n[$].length;)N=Be(n[$][K++],It);else N=Be(n[$],It);this.set(l,N)}break;case A:var Q=n[ee];if(Q){var L=n[ot];Q==it&&(L=parseInt(Xe(L),10)>=13?"11":"10"),this.set(o,Q).set(c,L)}this.get(o)==it&&n[d]=="Xbox"&&this.set(o,"Xbox").set(c,void 0);break;case te:var he=this.data,x=function(B){return he[B].getItem().setCH(n).parseCH().get()};this.set(T,x(T)).set(_,x(_)).set(O,x(O)).set(F,x(F)).set(A,x(A))}return this},D.call(this,[["itemType",i],["ua",t],["uaCH",a],["rgxMap",e],["data",Ai(this,i)]]),this}function R(i,t,e){if(typeof i===le?(Ct(i)?(typeof t===le&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===Ze&&!Ct(t)&&(e=t,t=void 0),!(this instanceof R))return new R(i,t,e).getResult();var a=typeof i===Ze?i:S&&S.userAgent?S.userAgent:e&&e[wt]?e[wt]:de,n=new Ht(e,!0),r=t?Pi(Tt,t):Tt,s=function(h){return h==te?function(){return new Pt(h,a,r,n).set("ua",a).set(T,this.getBrowser()).set(_,this.getCPU()).set(O,this.getDevice()).set(F,this.getEngine()).set(A,this.getOS()).get()}:function(){return new Pt(h,a,r[h],n).parseUA().get()}};return D.call(this,[["getBrowser",s(T)],["getCPU",s(_)],["getDevice",s(O)],["getEngine",s(F)],["getOS",s(A)],["getResult",s(te)],["getUA",function(){return a}],["setUA",function(h){return ue(h)&&(a=h.length>tt?ye(h,tt):h),this}]]).setUA(a),this}R.VERSION=fi;R.BROWSER=He([o,c,fe]);R.CPU=He([M]);R.DEVICE=He([d,u,l,Z,m,I,f,Y,et]);R.ENGINE=R.OS=He([o,c]);class Vt{constructor(t,e,a){b(this,"trackers");b(this,"config");b(this,"sdkConfig");this.trackers=t,this.config=e,this.sdkConfig=a}on(t,e,a){const n=function(s){s.data.message!==`kalamba:wrapper-telemetry:${t}`&&s.data.message!==`kalamba:wrapper:${t}`||e(s.data.payload)};window.addEventListener("message",n,a)}track(t,e){this.trackers.forEach(a=>a.track(t,e))}}function At(i){return i.reduce((t,e)=>t+e,0)}function xi(i){const t=i.length,e=At(i)/t,a=i.map(r=>Math.pow(r-e,2)),n=At(a)/t;return Math.sqrt(n)}class xt{constructor(){b(this,"rafId",-1);b(this,"startTime",0);b(this,"stopTime",0);b(this,"frames",[]);b(this,"calculateFPS",()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(e=>Math.floor((e-this.startTime)/1e3)).reduce((e,a,n,r)=>(r[n]!==r[n-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});b(this,"getReport",()=>{const t=this.calculateFPS(),e=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),a=t.length>0?Math.max(...t):e,n=t.length>0?Math.min(...t):e,r=t.length>0?xi(t):0;return{fpsAvg:e,fpsMax:a,fpsMin:n,fpsStdDev:r}});b(this,"start",()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()});b(this,"stop",()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()});b(this,"trackFrames",()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)})}}const Oi="landscape",Ui="portrait";function Li(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Bi(){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 Je(){return window.innerWidth>=window.innerHeight?Oi:Ui}var _e,ae,ne,se,ke,Fe,Ee,De;class _i extends Vt{constructor(...e){super(...e);b(this,"FPS_SAMPLE_INTERVAL",1e4);C(this,_e,0);C(this,ae,"");C(this,ne,void 0);C(this,se,void 0);C(this,ke,!1);C(this,Fe,!1);C(this,Ee,"");C(this,De,[]);v(this,ne,{}),v(this,se,this.deviceInfo()),this.on("state",({balance:a,version:n})=>{v(this,ae,n),v(this,_e,a)}),this.on("autoplay",({action:a})=>{["start","resume"].includes(a)?v(this,ke,!0):v(this,ke,!1)}),this.on("settings",({fastPlay:a})=>{a!==void 0&&v(this,Fe,a)}),this.registerEvents()}async registerEvents(){y(this,se).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.messageCode,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{v(this,Ee,e.contract.stateType.nextRound),v(this,ne,{balanceInCoins:e.contract.balance.coins,clientVersion:y(this,ae),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,defaultBaseBet:e.contract.bet.default.base,defaultBetMultiplier:e.contract.bet.default.multiplier,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,gameModelFile:e.contract.gameModel,jurisdiction:this.sdkConfig.api.jurisdiction,languageCode:this.sdkConfig.ui.language,operatorName:"kalamba",partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,referrer:window.location.hostname,serverVersion:e.contract.metaData.version}),this.track("Game Open",y(this,ne))}),this.on("playCycleEnd",async e=>{const a=await y(this,se),{base:n,multiplier:r,specialAction:s}=e.contract.bet.lastPaid??{},h=e.contract.balance.coins,g=e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,w=e.contract.win.total,p=w-g,P=s||"spin",N=e.contract.roundId;this.track("Betting Activity",{balance:h-p,balanceAfter:h,baseBet:n,betMultiplier:r,betType:P,gameVersion:y(this,ae),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,isMobile:a.isMobile,netResult:p,operatorName:"kalamba",orientation:Je(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:N,roundTypes:["BaseGame"],totalBet:g,totalWin:w}),v(this,De,[])}),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 xt,a=()=>{e.stop();const r=e.getReport();this.track("FPS Performance",{...r,fpsType:"sample"}),n()},n=async()=>{e.start(),setTimeout(a,this.FPS_SAMPLE_INTERVAL)};n()}reportFpsRound(){const e=new xt;this.on("playCycleStart",()=>{e.start()}),this.on("playCycleEnd",()=>{e.stop();const a=e.getReport();this.track("FPS Performance",{...a,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Je(),stateType:y(this,Ee)}}async deviceInfo(){var g;const e=new R(navigator.userAgent),a=Li(),n=await Bi(),r=e.getBrowser(),s=e.getDevice(),h=e.getOS();return{browserName:r.name,browserVersion:r.version,connection:(g=navigator.connection)==null?void 0:g.effectiveType,deviceName:s.model,deviceType:s.type,isMobile:["mobile","tablet"].includes(s.type??""),isWebGLSupported:a,isWebPSupported:n,manufacturer:s.vendor,operatingSystem:h.name,operatingSystemVersion:h.version,orientation:Je(),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}}}_e=new WeakMap,ae=new WeakMap,ne=new WeakMap,se=new WeakMap,ke=new WeakMap,Fe=new WeakMap,Ee=new WeakMap,De=new WeakMap;let Oe;const Fi=new Uint8Array(16);function Di(){if(!Oe&&(Oe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oe(Fi)}const E=[];for(let i=0;i<256;++i)E.push((i+256).toString(16).slice(1));function Ri(i,t=0){return E[i[t+0]]+E[i[t+1]]+E[i[t+2]]+E[i[t+3]]+"-"+E[i[t+4]]+E[i[t+5]]+"-"+E[i[t+6]]+E[i[t+7]]+"-"+E[i[t+8]]+E[i[t+9]]+"-"+E[i[t+10]]+E[i[t+11]]+E[i[t+12]]+E[i[t+13]]+E[i[t+14]]+E[i[t+15]]}const Ni=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ot={randomUUID:Ni};function Ut(i,t,e){if(Ot.randomUUID&&!t&&!i)return Ot.randomUUID();i=i||{};const a=i.random||(i.rng||Di)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,t){e=e||0;for(let n=0;n<16;++n)t[e+n]=a[n];return t}return Ri(a)}class rt{constructor(t,e){b(this,"config");b(this,"sdkConfig");this.config=t,this.sdkConfig=e}}const Lt=25,Bt=1e4;var oe,re,ce,V,Ce;class Hi extends rt{constructor(...e){super(...e);C(this,oe,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");C(this,re,void 0);C(this,ce,void 0);C(this,V,[]);C(this,Ce,void 0);b(this,"processQueueForced");v(this,re,new Date().getTime()),v(this,V,[]),v(this,Ce,Ut()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,oe),{method:"OPTIONS"}).catch(dt.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,ce)&&clearTimeout(y(this,ce)),v(this,ce,window.setTimeout(()=>this.processQueue(),Bt))}send(e){v(this,re,new Date().getTime());try{navigator.sendBeacon(y(this,oe),JSON.stringify(e))}catch{fetch(y(this,oe),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(dt.noop)}this.schedule()}addToQueue(e){y(this,V).push(e),this.processQueue()}processQueue(e=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!e&&y(this,V).length<Lt&&new Date().getTime()-y(this,re)<Bt))for(;y(this,V).length;){const a=y(this,V).splice(0,Lt).map(n=>({...n,sessionID:y(this,Ce),userID:this.sdkConfig.api.user}));this.send(a)}}track(e,a){this.addToQueue({eventName:e,eventParams:a,eventTimestamp:new Date().getTime(),eventUUID:Ut()})}}oe=new WeakMap,re=new WeakMap,ce=new WeakMap,V=new WeakMap,Ce=new WeakMap;const Vi=U("LoggingTracker","color:#000000;font-weight:bold;");class zi extends rt{track(t,e){Vi(`@${this.sdkConfig.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=Wt;exports.CasinoPlugin=G;exports.DebuggingPlugin=jt;exports.GigPlugin=Qt;exports.KalambaBullseyePlugin=mi;exports.KalambaStargazerPlugin=_i;exports.KalambaStargazerTracker=Hi;exports.LoggingTracker=zi;exports.OryxPlugin=Jt;exports.PariplayPlugin=ti;exports.RelaxFEIMPlugin=ii;exports.RgsPlygin=Dt;exports.TelemetryPlugin=Vt;exports.Tracker=rt;exports.TukoPlugin=ai;
5
+ "use strict";var Vt=Object.defineProperty;var zt=(i,t,e)=>t in i?Vt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var p=(i,t,e)=>(zt(i,typeof t!="symbol"?t+"":t,e),e),ct=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var y=(i,t,e)=>(ct(i,t,"read from private field"),e?e.call(i):t.get(i)),M=(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)},k=(i,t,e,s)=>(ct(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const De=require("./errors-358575c3.cjs"),dt=require("./noop-b3c54b76.cjs");function U(i,t){return(e,...s)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...s)}}function Rt(i,t){return Math.round(i*100/t)}class q{constructor(t,e){p(this,"config");p(this,"sdkConfig");this.config=t,this.sdkConfig=e}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})}}const qt=U("BasicPlugin","color:#000000;font-weight:bold;");class Wt extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),qt("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:o}=this.sdkConfig.api;s.currency===n&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:Rt(s.balanceInCurrency,o)}):(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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}const v=U("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),jt=U("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class $t extends q{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=>v("autoplay",t)),this.on("balance",t=>v("balance",t)),this.on("bet",t=>v("bet",t)),this.on("cashier",t=>v("cashier",t)),this.on("choice",t=>v("choice",t)),this.on("close",t=>v("close",t)),this.on("error",t=>v("error",t)),this.on("loadEnd",t=>v("loadEnd",t)),this.on("loadProgress",t=>v("loadProgress",t)),this.on("loadStart",t=>v("loadStart",t)),this.on("playCycleStart",t=>v("playCycleStart",t)),this.on("playCycleEnd",t=>v("playCycleEnd",t)),this.on("playEnd",t=>v("playEnd",t)),this.on("playError",t=>v("playError",t)),this.on("playReady",t=>v("playReady",t)),this.on("playStart",t=>v("playStart",t)),this.on("settings",t=>v("settings",t))}_send(...t){jt(...t),this.send(...t)}}const Kt=U("GigPlugin","color:#000000;font-weight:bold;");class Qt extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Kt("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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.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 Jt extends q{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 lt=U("PariplayPlugin","color:#000000;font-weight:bold;");function He(i){try{window.top.location=i}catch{window.location=i}}function Ve(i,t){return new Promise(function(s,n){const o=new XMLHttpRequest;o.onload=function(){o.status>=200&&o.status<300?s(o.responseText):n(o.responseText)},o.open(i,t),o.send()})}function ze(){}function Yt(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function qe(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function _t(i){try{return JSON.parse(i.text)}catch{return{}}}function Zt(i){return i.map(_t).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function ei(i){return i.map(_t).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ti extends q{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),lt("configured")}postMessage(t,e){const s={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};e!=null&&(s.data=e),lt("postMessage",s),window.parent.postMessage(s,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&Ve("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":Ve("GET",t.link),e();return;case"AJAXRESPONSE":Ve("GET",t.link).then(()=>{e()});return;case"REDIRECT":He(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(o=>o.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(o=>Object.assign({},o,{onRelease:()=>{const a=s.messageType.toUpperCase()==="POPUP"?ze:n,h=this.buttonActions[o.action.toUpperCase()];h?h(o,a):a()}}))})}).catch(ze)),Promise.resolve()).then(()=>{}).catch(ze)}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.sdkConfig.api.integrationData.token.split(".")[1])).token),o=JSON.parse(n.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:n.integrationSpecificAttributes.clientToken,CurrencyCode:n.currency,PlayerTokenId:n.user,SessionData:o}}catch{s=void 0}this.postMessage("gameDataLoaded",{LoadGameData:s,success:!0});try{const n=qe(e.contract.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.sdkConfig.api.homeUrl)if(this.sdkConfig.api.homeUrl==="(back)")try{window.top.history.back()}catch{window.history.back()}else this.sdkConfig.api.homeUrl==="(api)"?this.postMessage("quit"):He(this.sdkConfig.api.homeUrl)}),this.on("playEnd",e=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(e.contract.balance.coins),win:this.coinsToCurrency(e.contract.win.round)});try{const s=qe(e.contract.uiMessages);this.processInfoUiMessages(s)}catch{}}),this.on("playError",e=>{var s,n;this.postMessage("ticketReceived",{ErrorCode:(s=e.data)==null?void 0:s.code,ErrorMessage:"ERROR",Status:{ErrCode:(n=e.data)==null?void 0:n.code}})}),this.on("playResponse",e=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(e.contract.balance.coins+e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier)});const s=["BaseGame","PaidSpin"].includes(e.contract.stateType.thisRound),n=Yt(e.contract.uiMessages),o=qe(e.contract.uiMessages),a=Zt(n),h=ei(n);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(e.contract.balance.coins),BetAmount:s?this.coinsToCurrency(e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier):0,CreditTransactionId:a.betId,DebitTransactionId:a.winId,Message:o,SessionData:h,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(e.contract.win.round)})}),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.sdkConfig.api.cashierUrl&&(this.sdkConfig.api.cashierUrl==="(api)"?this.postMessage("cashier"):He(this.sdkConfig.api.cashierUrl))})}}const ge=U("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class ii extends q{constructor(...e){super(...e);p(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=()=>{ge("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),ge("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(()=>ge("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>ge("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>ge("!!! 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.contract.balance.coins,bet:e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,win:{win:e.contract.win.total}};window.FEIM.send.roundFinished(s)}),this.on("playResponse",e=>{const s={balance:e.contract.balance.coins,playResponse:e.data};window.FEIM.send.roundStarted(s)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",e=>{window.FEIM.send.updateSettings(e)})}}const We=U("TukoPlugin","color:#000000;font-weight:bold;");class si extends q{constructor(...e){super(...e);p(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(),We("configured")}ping(e){const s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&(s.status===0||s.status>=200&&s.status<400?We("ping ok",s):We("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:o,coinValueInCents:a}=this.sdkConfig.api;n.currency===o&&typeof n.balanceInCurrency=="number"?this.send("balance",{balance:Rt(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.sdkConfig.api.homeUrl)try{window.top.location=this.sdkConfig.api.homeUrl}catch{window.location=this.sdkConfig.api.homeUrl}else try{window.top.history.back()}catch{window.history.back()}})}}class Ft{constructor(t,e){p(this,"config");p(this,"sdkConfig");this.config=t,this.sdkConfig=e}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})}}class ni{constructor(t){p(this,"socket",null);p(this,"webSocketUrl");p(this,"eventListeners",{close:[],error:[],message:[]});p(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)})})});p(this,"send",t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)});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",t=>{console.log(t)})});p(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)})});p(this,"handleError",t=>{this.eventListeners.error.forEach(e=>{e(t)})});p(this,"handleMessage",t=>{this.eventListeners.message.forEach(e=>{e(t)})});p(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){return JSON.parse(i==null?void 0:i.data)}function ai(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function ut(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}function Le(i){return i.header.name==="GameEvent"}function oi(i){return Le(i)&&i.body.event==="OPEN_GAME"}function ht(i){return i.header.code!==1}function ri(i){return Le(i)&&i.body.event.includes("_RESULT")}var ie,ke;class ci 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());p(this,"cId",0);p(this,"mId",0);p(this,"seqId",10);p(this,"gameCode");M(this,ie,void 0);M(this,ke,void 0);p(this,"onMessage",e=>{const s=Me(e);(Le(s)||ai(s)||ut(s))&&this.sendAcknowledgement(s),ut(s)&&this.handleRealityCheck(s)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,k(this,ie,s.requestTimeoutMs),k(this,ke,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((o,a)=>{setTimeout(()=>a({type:"timeout"}),y(this,ie));const h=g=>{const w=Me(g);try{e.cId===w.header.cId&&(this.removeEventListener("message",h),w.header.code===1?o(w):a({message:w,type:"error"}))}catch{a({message:w,type:"error"})}};this.addEventListener("message",h),this.send(n)})}freeRounds(e){const s=this.buildHeader("ActivateFreeRound");return this.request(s,e).then(n=>n.body).catch(n=>{var o;throw{data:(o=n==null?void 0:n.message)==null?void 0:o.body,type:n.type}})}authenticate(e=!1){const s=this.buildHeader("Authenticate"),n={clientType:3,version:y(this,ke),reconnect:e};return this.request(s,n).then(o=>o.body).catch(o=>{var a;throw{data:(a=o==null?void 0:o.message)==null?void 0:a.body,type:o.type}})}openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((n,o)=>{const a=h=>{const g=Me(h);oi(g)?(this.removeEventListener("message",a),n(g.body)):ht(g)&&o({data:g.body,type:"error"})};this.addEventListener("message",a),this.request(e,s).catch(h=>{var g;return o({data:(g=h==null?void 0:h.message)==null?void 0:g.body,type:h.type})})})}sendAcknowledgement(e){const{name:s,cId:n}=e.header,o=this.buildHeader(s,n),a=this.buildPayload(o,{});this.send(a)}sendAction(e,s){const n=this.buildHeader("GameAction"),o={...this.getBodyExtras(e),data:s};return new Promise((a,h)=>{const g=w=>{const m=Me(w);Le(m)&&o.seqId===m.body.correlationSeqId&&(this.removeEventListener("message",g),ri(m)?a(m.body):ht(m)&&h({data:m.body,type:"error"}))};this.addEventListener("message",g),this.request(n,o).catch(w=>{var m;return h({data:(m=w==null?void 0:w.message)==null?void 0:m.body,type:w.type})})})}setRequestTimeoutMs(e){k(this,ie,e)}}ie=new WeakMap,ke=new WeakMap;function di(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 li(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??De.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function ui(i,t){const e=t.contract;if(!e){const s=t.data;return{contract:{bet:{available:s.additionalConfigData.availableMultipliersPerBaseBet,default:{base:s.additionalConfigData.defaultBet.baseBet,multiplier:s.additionalConfigData.defaultBet.betMultiplier},max:s.additionalConfigData.maxAllowedOverallBetInCoins,last:s.gameState.betFromCurrentRound?{base:s.gameState.betFromCurrentRound.baseBet,multiplier:s.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:s.gameState.lastPlacedMainGameBet?{base:s.gameState.lastPlacedMainGameBet.baseBet,multiplier:s.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:t.balance,version:t.balanceVersion},freeRounds:(s.FREE_ROUNDS??[]).map(n=>({conf:{base:n.conf.baseBet,multiplier:n.conf.betMultiplier,numAwarded:n.conf.numAwarded},data:{numPlayed:n.data.numPlayed,win:n.data.winAmount,numLeft:n.data.numLeft},id:n.id,rejectable:n.rejectable,skippable:n.skippable,status:n.status,type:n.type})),gameModel:s.additionalConfigData.gameModelFile,metaData:s.gameConfigData.metaData,roundId:s.gameState.cycleId,serverTime:t.balanceVersion,sessionId:s.gameState.sessionId,stateType:{thisRound:s.gameState.stateTypeThisRound,nextRound:s.gameState.stateTypeNextRound},uiMessages:i.uiMessages,win:{round:s.gameState.totalWinFromCurrentRound,total:s.gameState.totalWinFromCurrentGameCycle}},data:s}}return{contract:{bet:{available:e.availableMultipliersPerBaseBet,default:{base:e.defaultBet.baseBet,multiplier:e.defaultBet.betMultiplier},max:e.maxBetInCoins,last:e.lastBet?{base:e.lastBet.baseBet,multiplier:e.lastBet.betMultiplier}:null,lastPaid:e.lastMainGameBet?{base:e.lastMainGameBet.baseBet,multiplier:e.lastMainGameBet.betMultiplier}:null},balance:{coins:e.balanceInCoins,version:e.balanceVersion},freeRounds:(e.freeRounds??[]).map(s=>({conf:{base:s.conf.baseBet,multiplier:s.conf.betMultiplier,numAwarded:s.conf.numAwarded},data:{numPlayed:s.data.numPlayed,win:s.data.winAmount,numLeft:s.data.numLeft},id:s.id,rejectable:s.rejectable,skippable:s.skippable,status:s.status,type:s.type})),gameModel:e.gameModelFile,metaData:e.metaData,roundId:e.roundId,serverTime:e.serverTime,sessionId:e.sessionId,stateType:{thisRound:e.stateTypeThisRound,nextRound:e.stateTypeNextRound},uiMessages:i.contract.uiMessages.concat(e.uiMessages),win:{round:e.roundWin,total:e.totalWin}},data:t.opaqueGameServerToUi}}function hi(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??De.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function gi(i){const t=i.contract;if(!t){const e=i.data;return{contract:{bet:{last:e.gameState.betFromCurrentRound?{base:e.gameState.betFromCurrentRound.baseBet,multiplier:e.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:e.gameState.lastPlacedMainGameBet.baseBet,multiplier:e.gameState.lastPlacedMainGameBet.betMultiplier}},balance:{coins:i.balance,version:i.balanceVersion},freeRounds:(e.FREE_ROUNDS??[]).map(s=>({conf:{base:s.conf.baseBet,multiplier:s.conf.betMultiplier,numAwarded:s.conf.numAwarded},data:{numPlayed:s.data.numPlayed,win:s.data.winAmount,numLeft:s.data.numLeft},id:s.id,rejectable:s.rejectable,skippable:s.skippable,status:s.status,type:s.type})),serverTime:i.balanceVersion,roundId:e.gameState.cycleId,stateType:{thisRound:e.gameState.stateTypeThisRound,nextRound:e.gameState.stateTypeNextRound},uiMessages:e.uiMessages,win:{round:e.gameState.totalWinFromCurrentRound,total:e.gameState.totalWinFromCurrentGameCycle}},data:e}}return{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},freeRounds:(t.freeRounds??[]).map(e=>({conf:{base:e.conf.baseBet,multiplier:e.conf.betMultiplier,numAwarded:e.conf.numAwarded},data:{numPlayed:e.data.numPlayed,win:e.data.winAmount,numLeft:e.data.numLeft},id:e.id,rejectable:e.rejectable,skippable:e.skippable,status:e.status,type:e.type})),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}}function pi(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??De.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}const wi={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"},mi=U("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class bi extends Ft{constructor(...e){super(...e);p(this,"socket");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("freeRounds",async s=>{try{await this.socket.freeRounds(s),this.send("freeRoundsResponse",s)}catch(n){this.send("freeRoundsError",n)}}),this.on("configured",s=>{this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs)}),this.registerFromSdkEvents()}initialize(e){this.socket=new ci(e,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.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=>mi("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"),o=e.get("gameCode"),a=e.get("operatorCode"),h=e.get("playMode"),g=e.get("token"),w=e.get("username"),m=e.get("gameHistoryUrl"),C=e.get("homeUrl")??void 0,N=e.get("cashierUrl")??void 0;this.initialize({apiUrl:s,cageCode:n,gameCode:o,operatorCode:a,playMode:h,token:g,username:w});try{await this.socket.connect()}catch{throw{type:"error",data:{code:De.RgsErrorCode.CONNECTION_ERROR}}}let K;try{K=await this.socket.authenticate()}catch(B){throw{type:B.type,data:B.type==="error"?li(B.data):void 0}}let Q;try{Q=await this.socket.openGame()}catch(B){throw{type:B.type,data:B.type==="error"?hi(B.data):void 0}}const L=di(K),he=ui(K,Q);this.sdkConfig.api={brand:n,game:o,integration:a,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:C,cashierUrl:N,sessionId:he.contract.sessionId,lastRoundId:he.contract.roundId};const x=e.get("languageCode");return x&&(this.sdkConfig.ui.language=x.length===3?wi[x]??x:x),he}async play(e){const{contract:{bet:s,forcedOutcomes:n,...o},extra:a,payloadToInject:h,actionType:g}=e,w={bet:s?{baseBet:s.base,betMultiplier:s.multiplier}:void 0,forcedOutcomes:n,...o,...h,opaqueUiToGameServer:a};let m;try{m=await this.socket.sendAction(g,w)}catch(C){throw{type:C.type,data:C.type==="error"?pi(C.data):void 0}}return gi(m)}registerFromSdkEvents(){this.on("history",()=>{const{api:{game:e,integration:s,integrationData:n,jurisdiction:o,user:a,gameHistoryUrl:h},ui:{language:g}}=this.sdkConfig,w=a.replace(/^user_/,"").replace(new RegExp(`_${s}$`),""),m=new URL(h);m.searchParams.set("gameCode",e),m.searchParams.set("jurisdiction",o),m.searchParams.set("operatorCode",s),m.searchParams.set("token",n.token),m.searchParams.set("username",w),m.searchParams.set("languageCode",g),window.open(m.toString(),"_blank")})}}var fi="2.0.0-beta.2",de="",gt="?",Ye="function",V="undefined",le="object",Ze="string",fe="major",d="model",r="name",l="type",u="vendor",c="version",S="architecture",Z="console",b="mobile",f="tablet",T="smarttv",Y="wearable",et="embedded",pt="user-agent",tt=500,nt="brands",j="formFactor",at="fullVersionList",ee="platform",ot="platformVersion",Ne="bitness",W="sec-ch-ua",yi=W+"-full-version-list",ki=W+"-arch",vi=W+"-"+Ne,Ei=W+"-form-factor",Ci=W+"-"+b,Mi=W+"-"+d,Dt=W+"-"+ee,Si=Dt+"-version",Nt=[nt,at,b,d,ee,ot,S,j,Ne],P="browser",R="cpu",O="device",_="engine",A="os",te="result",Se="Amazon",pe="Apple",wt="ASUS",mt="BlackBerry",Ie="Google",bt="Huawei",ft="Lenovo",je="LG",Ue="Microsoft",yt="Motorola",Te="Samsung",kt="Sharp",Pe="Sony",$e="Xiaomi",Ke="Zebra",X="Mobile ",J=" Browser",Ae="Chrome",Ii="Edge",we="Firefox",me="Opera",vt="Facebook",Et="Sogou",it="Windows",Ti=typeof window!==V,I=Ti&&window.navigator?window.navigator:void 0,G=I&&I.userAgentData?I.userAgentData:void 0,Pi=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},Ge=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},st=function(i,t){if(typeof i===le&&i.length>0){for(var e in i)if(z(i[e])==z(t))return!0;return!1}return ue(i)?z(t).indexOf(z(i))!==-1:!1},Ct=function(i){for(var t in i)return/^(browser|cpu|device|engine|os)$/.test(t)},ue=function(i){return typeof i===Ze},Qe=function(i){if(i){for(var t=[],e=$(/\\?\"/g,i).split(","),s=0;s<e.length;s++)if(e[s].indexOf(";")>-1){var n=ye(e[s]).split(";v=");t[s]={brand:n[0],version:n[1]}}else t[s]=ye(e[s]);return t}},z=function(i){return ue(i)?i.toLowerCase():i},Xe=function(i){return ue(i)?$(/[^\d\.]/g,i).split(".")[0]:void 0},F=function(i){for(var t in i){var e=i[t];typeof e==le&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},$=function(i,t){return ue(t)?t.replace(i,de):t},be=function(i){return $(/\\?\"/g,i)},ye=function(i,t){if(ue(i))return i=$(/^\s\s*/,i),typeof t===V?i:i.substring(0,tt)},Mt=function(i,t){if(!(!i||!t))for(var e=0,s,n,o,a,h,g;e<t.length&&!h;){var w=t[e],m=t[e+1];for(s=n=0;s<w.length&&!h&&w[s];)if(h=w[s++].exec(i),h)for(o=0;o<m.length;o++)g=h[++n],a=m[o],typeof a===le&&a.length>0?a.length===2?typeof a[1]==Ye?this[a[0]]=a[1].call(this,g):this[a[0]]=a[1]:a.length===3?typeof a[1]===Ye&&!(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}},Be=function(i,t){for(var e in t)if(typeof t[e]===le&&t[e].length>0){for(var s=0;s<t[e].length;s++)if(st(t[e][s],i))return e===gt?void 0:e}else if(st(t[e],i))return e===gt?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},St={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"},It={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:["VR","XR","Watch"],"?":["Desktop","Unknown"],"*":void 0},Tt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[r,X+"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[r,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[r,c],[/opios[\/ ]+([\w\.]+)/i],[c,[r,me+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[c,[r,me+" GX"]],[/\bopr\/([\w\.]+)/i],[c,[r,me]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[c,[r,"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],[r,c],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[r,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[c,[r,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[r,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[r,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[c,[r,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[c,[r,"Smart "+ft+J]],[/(avast|avg)\/([\w\.]+)/i],[[r,/(.+)/,"$1 Secure"+J],c],[/\bfocus\/([\w\.]+)/i],[c,[r,we+" Focus"]],[/\bopt\/([\w\.]+)/i],[c,[r,me+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[r,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[r,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[r,me+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[r,"MIUI"+J]],[/fxios\/([\w\.-]+)/i],[c,[r,X+we]],[/\bqihu|(qi?ho?o?|360)browser/i],[[r,"360"+J]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[r,/(.+)/,"$1"+J],c],[/samsungbrowser\/([\w\.]+)/i],[c,[r,Te+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],c],[/metasr[\/ ]?([\d\.]+)/i],[c,[r,Et+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[r,Et+" Mobile"],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[r,c],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[r],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[r,vt],c],[/(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],[r,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[r,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[c,[r,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[r,Ae+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[r,Ae+" WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[r,"Android"+J]],[/chrome\/([\w\.]+) mobile/i],[c,[r,X+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[r,c],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[c,[r,X+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[r,X+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[c,r],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[r,[c,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[r,c],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[r,X+we],c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[r,"Netscape"],c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[r,we+" 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],[r,c],[/(cobalt)\/([\w\.]+)/i],[r,[c,/[^\d\.]+./,de]]],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/,de,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,Te],[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,Te],[l,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[u,pe],[l,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[u,pe],[l,f]],[/(macintosh);/i],[d,[u,pe]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[u,kt],[l,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[u,bt],[l,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[u,bt],[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,yt],[l,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[u,yt],[l,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[u,je],[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,je],[l,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[u,ft],[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,Pe],[l,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[u,Pe],[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,Se],[l,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[u,Se],[l,b]],[/(playbook);[-\w\),; ]+(rim)/i],[d,u,[l,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[u,mt],[l,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[u,wt],[l,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[u,wt],[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,Ue],[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,Ue],[l,b]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[u,Ke],[l,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[u,Ke],[l,b]],[/smart-tv.+(samsung)/i],[u,[l,T]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[u,Te],[l,T]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,je],[l,T]],[/(apple) ?tv/i],[u,[d,pe+" TV"],[l,T]],[/crkey/i],[[d,Ae+"cast"],[u,Ie],[l,T]],[/droid.+aft(\w+)( bui|\))/i],[d,[u,Se],[l,T]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[u,kt],[l,T]],[/(bravia[\w ]+)( bui|\))/i],[d,[u,Pe],[l,T]],[/(mitv-\w{5}) bui/i],[d,[u,$e],[l,T]],[/Hbbtv.*(technisat) (.*);/i],[u,d,[l,T]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,ye],[d,ye],[l,T]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,T]],[/(ouya)/i,/(nintendo) (\w+)/i],[u,d,[l,Z]],[/droid.+; (shield) bui/i],[d,[u,"Nvidia"],[l,Z]],[/(playstation \w+)/i],[d,[u,Pe],[l,Z]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[u,Ue],[l,Z]],[/((pebble))app/i],[u,d,[l,Y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[u,pe],[l,Y]],[/droid.+; (glass) \d/i],[d,[u,Ie],[l,Y]],[/droid.+; (wt63?0{2,3})\)/i],[d,[u,Ke],[l,Y]],[/(quest( 2| pro)?)/i],[d,[u,vt],[l,Y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,et]],[/(aeobc)\b/i],[d,[u,Se],[l,et]],[/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],[c,[r,Ii+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[r,"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],[r,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,r]],os:[[/microsoft (windows) (vista|xp)/i],[r,c],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[r,[c,Be,St]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,Be,St],[r,it]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[r,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[r,"macOS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[c,r],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[r,c],[/\(bb(10);/i],[c,[r,mt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[r,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[r,we+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[r,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[c,[r,"watchOS"]],[/crkey\/([\d\.]+)/i],[c,[r,Ae+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[r,"Chrome OS"],c],[/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],[r,c],[/(sunos) ?([\w\.\d]*)/i],[[r,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[r,c]]},xe=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return F.call(i.init,[[P,[r,c,fe]],[R,[S]],[O,[l,d,u]],[_,[r,c]],[A,[r,c]]]),F.call(i.isIgnore,[[P,[c,fe]],[_,[c]],[A,[c]]]),F.call(i.isIgnoreRgx,[[P,/ ?browser$/i],[A,/ ?os$/i]]),F.call(i.toString,[[P,[r,c]],[R,[S]],[O,[u,d]],[_,[r,c]],[A,[r,c]]]),i}(),Ai=function(i,t){var e=xe.init[t],s=xe.isIgnore[t]||0,n=xe.isIgnoreRgx[t]||0,o=xe.toString[t]||0;function a(){F.call(this,e)}return a.prototype.getItem=function(){return i},a.prototype.withClientHints=function(){return G?G.getHighEntropyValues(Nt).then(function(h){return i.setCH(new Gt(h,!1)).parseCH().get()}):i.parseCH().get()},a.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=te&&(a.prototype.is=function(h){var g=!1;for(var w in this)if(this.hasOwnProperty(w)&&!st(s,w)&&z(n?$(n,this[w]):this[w])==z(n?$(n,h):h)){if(g=!0,h!=V)break}else if(h==V&&g){g=!g;break}return g},a.prototype.toString=function(){var h=de;for(var g in o)typeof this[o[g]]!==V&&(h+=(h?" ":de)+this[o[g]]);return h||V}),G||(a.prototype.then=function(h){var g=this,w=function(){for(var C in g)g.hasOwnProperty(C)&&(this[C]=g[C])};w.prototype={is:a.prototype.is,toString:a.prototype.toString};var m=new w;return h(m),m}),new a};function Gt(i,t){if(i=i||{},F.call(this,Nt),t)F.call(this,[[nt,Qe(i[W])],[at,Qe(i[yi])],[b,/\?1/.test(i[Ci])],[d,be(i[Mi])],[ee,be(i[Dt])],[ot,be(i[Si])],[S,be(i[ki])],[j,Qe(i[Ei])],[Ne,be(i[vi])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==V&&(this[e]=i[e])}function Pt(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,o){return this.data[n]=o,this},this.setCH=function(n){return this.uaCH=n,this},this.detectFeature=function(){if(I&&I.userAgent==this.ua)switch(this.itemType){case P:I.brave&&typeof I.brave.isBrave==Ye&&this.set(r,"Brave");break;case O:!this.get(l)&&G&&G[b]&&this.set(l,b),this.get(d)=="Macintosh"&&I&&typeof I.standalone!==V&&I.maxTouchPoints&&I.maxTouchPoints>2&&this.set(d,"iPad").set(l,f);break;case A:!this.get(r)&&G&&G[ee]&&this.set(r,G[ee]);break;case te:var n=this.data,o=function(a){return n[a].getItem().detectFeature().get()};this.set(P,o(P)).set(R,o(R)).set(O,o(O)).set(_,o(_)).set(A,o(A))}return this},this.parseUA=function(){return this.itemType!=te&&Mt.call(this.data,this.ua,this.rgxMap),this.itemType==P&&this.set(fe,Xe(this.get(c))),this},this.parseCH=function(){var n=this.uaCH,o=this.rgxMap;switch(this.itemType){case P:var a=n[at]||n[nt],h;if(a)for(var g in a){var w=$(/(Google|Microsoft) /,a[g].brand||a[g]),m=a[g].version;!/not.a.brand/i.test(w)&&(!h||/chrom/i.test(h)&&!/chromi/i.test(w))&&(this.set(r,w).set(c,m).set(fe,Xe(m)),h=w)}break;case R:var C=n[S];C&&(C&&n[Ne]=="64"&&(C+="64"),Mt.call(this.data,C+";",o));break;case O:if(n[b]&&this.set(l,b),n[d]&&this.set(d,n[d]),n[d]=="Xbox"&&this.set(l,Z).set(u,Ue),n[j]){var N;if(typeof n[j]!="string")for(var K=0;!N&&K<n[j].length;)N=Be(n[j][K++],It);else N=Be(n[j],It);this.set(l,N)}break;case A:var Q=n[ee];if(Q){var L=n[ot];Q==it&&(L=parseInt(Xe(L),10)>=13?"11":"10"),this.set(r,Q).set(c,L)}this.get(r)==it&&n[d]=="Xbox"&&this.set(r,"Xbox").set(c,void 0);break;case te:var he=this.data,x=function(B){return he[B].getItem().setCH(n).parseCH().get()};this.set(P,x(P)).set(R,x(R)).set(O,x(O)).set(_,x(_)).set(A,x(A))}return this},F.call(this,[["itemType",i],["ua",t],["uaCH",s],["rgxMap",e],["data",Ai(this,i)]]),this}function D(i,t,e){if(typeof i===le?(Ct(i)?(typeof t===le&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===Ze&&!Ct(t)&&(e=t,t=void 0),!(this instanceof D))return new D(i,t,e).getResult();var s=typeof i===Ze?i:I&&I.userAgent?I.userAgent:e&&e[pt]?e[pt]:de,n=new Gt(e,!0),o=t?Pi(Tt,t):Tt,a=function(h){return h==te?function(){return new Pt(h,s,o,n).set("ua",s).set(P,this.getBrowser()).set(R,this.getCPU()).set(O,this.getDevice()).set(_,this.getEngine()).set(A,this.getOS()).get()}:function(){return new Pt(h,s,o[h],n).parseUA().get()}};return F.call(this,[["getBrowser",a(P)],["getCPU",a(R)],["getDevice",a(O)],["getEngine",a(_)],["getOS",a(A)],["getResult",a(te)],["getUA",function(){return s}],["setUA",function(h){return ue(h)&&(s=h.length>tt?ye(h,tt):h),this}]]).setUA(s),this}D.VERSION=fi;D.BROWSER=Ge([r,c,fe]);D.CPU=Ge([S]);D.DEVICE=Ge([d,u,l,Z,b,T,f,Y,et]);D.ENGINE=D.OS=Ge([r,c]);class Ht{constructor(t,e,s){p(this,"trackers");p(this,"config");p(this,"sdkConfig");this.trackers=t,this.config=e,this.sdkConfig=s}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 At(i){return i.reduce((t,e)=>t+e,0)}function xi(i){const t=i.length,e=At(i)/t,s=i.map(o=>Math.pow(o-e,2)),n=At(s)/t;return Math.sqrt(n)}class xt{constructor(){p(this,"rafId",-1);p(this,"startTime",0);p(this,"stopTime",0);p(this,"frames",[]);p(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,o)=>(o[n]!==o[n-1]?e.push(1):e[e.length-1]++,e),[]).slice(0,t)});p(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,o=t.length>0?xi(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:n,fpsStdDev:o}});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 Oi="landscape",Ui="portrait";function Li(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Bi(){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 Je(){return window.innerWidth>=window.innerHeight?Oi:Ui}var Re,se,ne,ae,ve,_e,Ee,Fe;class Ri extends Ht{constructor(...e){super(...e);p(this,"FPS_SAMPLE_INTERVAL",1e4);M(this,Re,0);M(this,se,void 0);M(this,ne,void 0);M(this,ae,void 0);M(this,ve,!1);M(this,_e,!1);M(this,Ee,"");M(this,Fe,[]);k(this,ne,{}),k(this,ae,this.deviceInfo()),k(this,se,this.config.gameVersion),this.on("state",({balance:s})=>{k(this,Re,s)}),this.on("autoplay",({action:s})=>{["start","resume"].includes(s)?k(this,ve,!0):k(this,ve,!1)}),this.on("settings",({fastPlay:s})=>{s!==void 0&&k(this,_e,s)}),this.registerEvents()}async registerEvents(){y(this,ae).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.messageCode,systemMessageType:e.type})}),this.on("openGameResponse",async e=>{k(this,Ee,e.contract.stateType.nextRound),k(this,ne,{balanceInCoins:e.contract.balance.coins,clientVersion:y(this,se),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,defaultBaseBet:e.contract.bet.default.base,defaultBetMultiplier:e.contract.bet.default.multiplier,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,gameModelFile:e.contract.gameModel,jurisdiction:this.sdkConfig.api.jurisdiction,languageCode:this.sdkConfig.ui.language,operatorName:"kalamba",partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,referrer:window.location.hostname,serverVersion:e.contract.metaData.version}),this.track("Game Open",y(this,ne))}),this.on("playCycleEnd",async e=>{const s=await y(this,ae),{base:n,multiplier:o,specialAction:a}=e.contract.bet.lastPaid??{},h=e.contract.balance.coins,g=e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,w=e.contract.win.total,m=w-g,C=a||"spin",N=e.contract.roundId;this.track("Betting Activity",{balance:h-m,balanceAfter:h,baseBet:n,betMultiplier:o,betType:C,gameVersion:y(this,se),coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,isMobile:s.isMobile,netResult:m,operatorName:"kalamba",orientation:Je(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:N,roundTypes:["BaseGame"],totalBet:g,totalWin:w}),k(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 xt,s=()=>{e.stop();const o=e.getReport();this.track("FPS Performance",{...o,fpsType:"sample"}),n()},n=async()=>{e.start(),setTimeout(s,this.FPS_SAMPLE_INTERVAL)};n()}reportFpsRound(){const e=new xt;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:Je(),stateType:y(this,Ee)}}async deviceInfo(){var g;const e=new D(navigator.userAgent),s=Li(),n=await Bi(),o=e.getBrowser(),a=e.getDevice(),h=e.getOS();return{browserName:o.name,browserVersion:o.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:Je(),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}}}Re=new WeakMap,se=new WeakMap,ne=new WeakMap,ae=new WeakMap,ve=new WeakMap,_e=new WeakMap,Ee=new WeakMap,Fe=new WeakMap;let Oe;const _i=new Uint8Array(16);function Fi(){if(!Oe&&(Oe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oe(_i)}const E=[];for(let i=0;i<256;++i)E.push((i+256).toString(16).slice(1));function Di(i,t=0){return E[i[t+0]]+E[i[t+1]]+E[i[t+2]]+E[i[t+3]]+"-"+E[i[t+4]]+E[i[t+5]]+"-"+E[i[t+6]]+E[i[t+7]]+"-"+E[i[t+8]]+E[i[t+9]]+"-"+E[i[t+10]]+E[i[t+11]]+E[i[t+12]]+E[i[t+13]]+E[i[t+14]]+E[i[t+15]]}const Ni=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ot={randomUUID:Ni};function Ut(i,t,e){if(Ot.randomUUID&&!t&&!i)return Ot.randomUUID();i=i||{};const s=i.random||(i.rng||Fi)();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 Di(s)}class rt{constructor(t,e){p(this,"config");p(this,"sdkConfig");this.config=t,this.sdkConfig=e}}const Lt=25,Bt=1e4;var oe,re,ce,H,Ce;class Gi extends rt{constructor(...e){super(...e);M(this,oe,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");M(this,re,void 0);M(this,ce,void 0);M(this,H,[]);M(this,Ce,void 0);p(this,"processQueueForced");k(this,re,new Date().getTime()),k(this,H,[]),k(this,Ce,Ut()),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(y(this,oe),{method:"OPTIONS"}).catch(dt.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,ce)&&clearTimeout(y(this,ce)),k(this,ce,window.setTimeout(()=>this.processQueue(),Bt))}send(e){k(this,re,new Date().getTime());try{navigator.sendBeacon(y(this,oe),JSON.stringify(e))}catch{fetch(y(this,oe),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(dt.noop)}this.schedule()}addToQueue(e){y(this,H).push(e),this.processQueue()}processQueue(e=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!e&&y(this,H).length<Lt&&new Date().getTime()-y(this,re)<Bt))for(;y(this,H).length;){const s=y(this,H).splice(0,Lt).map(n=>({...n,sessionID:y(this,Ce),userID:this.sdkConfig.api.user}));this.send(s)}}track(e,s){this.addToQueue({eventName:e,eventParams:s,eventTimestamp:new Date().getTime(),eventUUID:Ut()})}}oe=new WeakMap,re=new WeakMap,ce=new WeakMap,H=new WeakMap,Ce=new WeakMap;const Hi=U("LoggingTracker","color:#000000;font-weight:bold;");class Vi extends rt{track(t,e){Hi(`@${this.sdkConfig.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=Wt;exports.CasinoPlugin=q;exports.DebuggingPlugin=$t;exports.GigPlugin=Qt;exports.KalambaBullseyePlugin=bi;exports.KalambaStargazerPlugin=Ri;exports.KalambaStargazerTracker=Gi;exports.LoggingTracker=Vi;exports.OryxPlugin=Jt;exports.PariplayPlugin=ti;exports.RelaxFEIMPlugin=ii;exports.RgsPlygin=Ft;exports.TelemetryPlugin=Ht;exports.Tracker=rt;exports.TukoPlugin=si;