@kalamba/sdk 0.27.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/plugins.cjs CHANGED
@@ -1,5 +1,247 @@
1
1
  /**
2
2
  * BSD 3-Clause License
3
- * Copyright (c) 2025, Kalamba Games Limited
3
+ * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- "use strict";var cs=Object.defineProperty;var kt=i=>{throw TypeError(i)};var ds=(i,t,e)=>t in i?cs(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var b=(i,t,e)=>ds(i,typeof t!="symbol"?t+"":t,e),vt=(i,t,e)=>t.has(i)||kt("Cannot "+e);var k=(i,t,e)=>(vt(i,t,"read from private field"),e?e.call(i):t.get(i)),M=(i,t,e)=>t.has(i)?kt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),v=(i,t,e,s)=>(vt(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("./errors-BXO3dlhS.cjs"),je=require("./encoders-DVHzIpWT.cjs"),wt=require("./v4-Cj9BnqmU.cjs");function A(i,t){return(e,...s)=>{console.log(`[%c${i}\x1B[m] %s`,t,e,...s)}}function Qt(i,t){return Math.round(i*100/t)}class U{constructor(t,e){b(this,"config");b(this,"sdkConfig");this.config=t,this.sdkConfig=e}on(t,e,s){const a=function(o){o.data.message!==`kalamba:wrapper-casino:${t}`&&o.data.message!==`kalamba:wrapper:${t}`||e(o.data.payload)};window.addEventListener("message",a,s)}send(t,...[e]){window.postMessage({message:`kalamba:casino:${t}`,payload:e})}}const ls=A("BasicPlugin","color:#000000;font-weight:bold;");class us extends U{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ls("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:a,coinValueInCents:c}=this.sdkConfig.api;s.currency===a&&typeof s.balanceInCurrency=="number"?this.send("balance",{balance:Qt(s.balanceInCurrency,c)}):(s.balanceInCoins,this.send("balance",{balance:s.balanceInCoins}));return;case"doGamePause":this.send("freeze");return;case"doGameResume":this.send("unfreeze");return;case"doGameSuspend":this.send("suspend");return;default:return}}catch{}})}registerFromSdkEvents(){this.on("close",()=>{if(this.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 C=A("▼ DebuggingPlugin IN ▼","color:#444444;font-weight:bold;"),hs=A("▲ DebuggingPlugin OUT ▲","color:#444444;font-weight:bold;");class gs extends U{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=>C("autoplay",t)),this.on("balance",t=>C("balance",t)),this.on("bet",t=>C("bet",t)),this.on("cashier",t=>C("cashier",t)),this.on("choice",t=>C("choice",t)),this.on("close",t=>C("close",t)),this.on("error",t=>C("error",t)),this.on("loadEnd",t=>C("loadEnd",t)),this.on("loadProgress",t=>C("loadProgress",t)),this.on("loadStart",t=>C("loadStart",t)),this.on("playCycleStart",t=>C("playCycleStart",t)),this.on("playCycleEnd",t=>C("playCycleEnd",t)),this.on("playEnd",t=>C("playEnd",t)),this.on("playError",t=>C("playError",t)),this.on("playReady",t=>C("playReady",t)),this.on("playStart",t=>C("playStart",t)),this.on("settings",t=>C("settings",t))}_send(...t){hs.apply(null,t),this.send.apply(this,t)}}const Et=A("GigPlugin","color:#000000;font-weight:bold;");class ps extends U{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Et("configured")}postMessage(t){const e={event:t};Et("postMessage",e),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 ws=A("OryxPlugin","color:#000000;font-weight:bold;");class ms extends U{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),ws("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 $e=A("PariplayPlugin","color:#000000;font-weight:bold;");function Ke(i){try{window.top.location=i}catch{window.location=i}}function Qe(i,t){return new Promise(function(s,a){const c=new XMLHttpRequest;c.onload=function(){c.status>=200&&c.status<300?s(c.responseText):a(c.responseText)},c.open(i,t),c.send()})}function Xe(){}function bs(i){return i.filter(function(e){return e.messageType.toUpperCase()==="DATA"})}function Je(i){return i.filter(function(e){return["NOTIFICATION","POPUP"].includes(e.messageType.toUpperCase())})}function Xt(i){try{return JSON.parse(i.text)}catch{return{}}}function fs(i){return i.map(Xt).filter(Boolean).find(function(e){return e.betId!=null&&e.winId!=null})||{}}function ys(i){return i.map(Xt).filter(Boolean).find(function(e){return e.TotalBet!=null&&e.TotalWin!=null})||{}}class ks extends U{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),$e("configured")}postMessage(t,e){const s={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};e!=null&&(s.data=e),$e("postMessage",s),window.parent.postMessage(s,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,e){t.link&&Qe("GET",t.link),e()}handleLinkButton(t,e){switch(t.linkType.toUpperCase()){case"AJAX":Qe("GET",t.link),e();return;case"AJAXRESPONSE":Qe("GET",t.link).then(()=>{e()});return;case"REDIRECT":Ke(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(a=>{const c=Object.assign({},s,{buttons:s.buttons.filter(o=>o.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(o=>Object.assign({},o,{onRelease:()=>{const g=s.messageType.toUpperCase()==="POPUP"?Xe:a,h=this.buttonActions[o.action.toUpperCase()];h?h(o,g):g()}}))});$e("showMessage",c)}).catch(Xe)),Promise.resolve()).then(()=>{}).catch(Xe)}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 a=JSON.parse(JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token),c=JSON.parse(a.integrationSpecificAttributes.sessionData||"{}");s={ClientToken:a.integrationSpecificAttributes.clientToken,CurrencyCode:a.currency,PlayerTokenId:a.user,SessionData:c}}catch{s=void 0}this.postMessage("gameDataLoaded",{LoadGameData:s,success:!0});try{const a=Je(e.contract.uiMessages);this.processInfoUiMessages(a)}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"):Ke(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=Je(e.contract.uiMessages);this.processInfoUiMessages(s)}catch{}}),this.on("playError",e=>{this.postMessage("ticketReceived",{ErrorCode:e.type==="error"?e.data.code:"TIMEOUT",ErrorMessage:"ERROR",Status:{ErrCode:e.type==="error"?e.data.code:"TIMEOUT"}})}),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),a=bs(e.contract.uiMessages),c=Je(e.contract.uiMessages),o=fs(a),g=ys(a);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:o.betId,DebitTransactionId:o.winId,Message:c,SessionData:g,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"):Ke(this.sdkConfig.api.cashierUrl))})}}const be=A("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class vs extends U{constructor(...e){super(...e);b(this,"VERSION","1.17.0");const s=document.createElement("script");s.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,s.onload=()=>{be("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),be("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(()=>be("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>be("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>be("!!! 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",e=>{const s="message"in e?e.message:"Unknown error";window.FEIM.send.errorMessage(s)}),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 Ye=A("TukoPlugin","color:#000000;font-weight:bold;");class Es extends U{constructor(...e){super(...e);b(this,"PING_INTERVAL",1e4);const a=new URLSearchParams(window.location.search).get("pingCallbackUrl");a&&window.setInterval(()=>{this.ping(a)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),Ye("configured")}ping(e){const s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===XMLHttpRequest.DONE&&(s.status===0||s.status>=200&&s.status<400?Ye("ping ok",s):Ye("ping error",s))},s.open("GET",e),s.send()}registerToSdkEvents(){window.addEventListener("message",e=>{try{const{type:s,payload:a}=e.data;switch(s){case"doAudioSettings":this.send("settings",{music:a==null?void 0:a.musicEnabled,sounds:a==null?void 0:a.soundEnabled});return;case"doBalanceUpdate":const{currency:c,coinValueInCents:o}=this.sdkConfig.api;a.currency===c&&typeof a.balanceInCurrency=="number"?this.send("balance",{balance:Qt(a.balanceInCurrency,o)}):(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 Ct=A("QuantaPlugin","color:#000000;font-weight:bold;");class Cs extends U{constructor(...t){super(...t),this.registerFromSdkEvents(),Ct("configured")}postMessage(t){const e={event:t};Ct("postMessage",e),window.parent.postMessage(e,"*")}registerFromSdkEvents(){this.on("close",()=>{this.postMessage("GameClosed")}),this.on("loadEnd",()=>{this.postMessage("GameLoaded")}),this.on("playCycleStart",()=>{this.postMessage("RoundStarted")}),this.on("playCycleEnd",()=>{this.postMessage("RoundEnded")}),this.on("playError",()=>{this.postMessage("RoundEnded")})}}const Mt=A("SoftSwissPlugin","color:#000000;font-weight:bold;");class Ms extends U{constructor(...t){super(...t),this.registerFromSdkEvents(),Mt("configured")}postMessage(t,e){const s={event:t,payload:e};Mt("postMessage",s),window.top.postMessage(s,"*")}registerFromSdkEvents(){this.on("loadStart",()=>{this.postMessage("gameLoadStarted")}),this.on("loadProgress",({progress:t})=>{this.postMessage("gameLoadProgress",{progress:t})}),this.on("loadEnd",()=>{this.postMessage("gameLoadCompleted")}),this.on("playCycleStart",()=>{this.postMessage("gameAnimationStart")}),this.on("playCycleEnd",t=>{this.postMessage("winUpdate",{win:t.contract.win.total}),this.postMessage("gameAnimationCompleted")}),this.on("playError",()=>{this.postMessage("gameAnimationCompleted")}),this.on("balance",({balance:t})=>{this.postMessage("balanceUpdate",{balance:t})}),this.on("bet",t=>{this.postMessage("stakeUpdate",{bet:t})})}}const St=A("EveryMatrixPlugin","color:#000000;font-weight:bold;");class Ss extends U{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),St("configured")}postMessage(t,e){const s={name:t,sender:"game",data:e};St("postMessage",s),window.top.postMessage(s,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{name:e,sender:s}=t.data;if(s!=="emwindow")return;switch(e){case"updateBalance":this.send("getBalance");return;case"togglePaytable":this.send("paytable");return;case"stopAutoplay":this.send("suspend");return;case"showHelp":this.send("help",{show:!0});return;default:return}}catch{}})}registerFromSdkEvents(){this.on("loadProgress",({progress:t})=>{this.postMessage("loadProgress",{progress:t})}),this.on("loadEnd",()=>{this.postMessage("loadCompleted")}),this.on("settings",t=>{(t!=null&&t.music||t!=null&&t.sounds)&&this.postMessage("audioToggle")}),this.on("playCycleStart",()=>{this.postMessage("roundStart")}),this.on("playCycleEnd",()=>{this.postMessage("roundEnd")}),this.on("playError",()=>{this.postMessage("errorMessage")}),this.on("error",()=>{this.postMessage("errorMessage")}),this.on("close",()=>{this.postMessage("close")}),this.on("bet",()=>{this.postMessage("stakeUpdate")})}}var Is="2.0.5",ut=500,It="user-agent",he="",Tt="?",Fe="function",W="undefined",ge="object",ht="string",S="browser",D="cpu",B="device",O="engine",x="os",ie="result",l="name",n="type",d="vendor",u="version",I="architecture",Ie="major",r="model",Me="console",m="mobile",f="tablet",y="smarttv",R="wearable",Oe="xr",Se="embedded",Z="inapp",mt="brands",J="formFactors",bt="fullVersionList",ae="platform",ft="platformVersion",qe="bitness",$="sec-ch-ua",Ts=$+"-full-version-list",Ps=$+"-arch",As=$+"-"+qe,xs=$+"-form-factors",Os=$+"-"+m,Us=$+"-"+r,Jt=$+"-"+ae,Rs=Jt+"-version",Yt=[mt,bt,m,r,ae,ft,I,J,qe],Ue="Amazon",ee="Apple",Pt="ASUS",At="BlackBerry",X="Google",xt="Huawei",Ze="Lenovo",Ot="Honor",Re="LG",et="Microsoft",tt="Motorola",st="Nvidia",Ut="OnePlus",it="OPPO",fe="Samsung",Rt="Sharp",ye="Sony",at="Xiaomi",nt="Zebra",Lt="Chrome",Bt="Chromium",V="Chromecast",_e="Edge",ke="Firefox",ve="Opera",ot="Facebook",_t="Sogou",te="Mobile ",Ee=" Browser",gt="Windows",Ls=typeof window!==W,T=Ls&&window.navigator?window.navigator:void 0,z=T&&T.userAgentData?T.userAgentData:void 0,Bs=function(i,t){var e={},s=t;if(!De(t)){s={};for(var a in t)for(var c in t[a])s[c]=t[a][c].concat(s[c]?s[c]:[])}for(var o in i)e[o]=s[o]&&s[o].length%2===0?s[o].concat(i[o]):i[o];return e},We=function(i){for(var t={},e=0;e<i.length;e++)t[i[e].toUpperCase()]=i[e];return t},pt=function(i,t){if(typeof i===ge&&i.length>0){for(var e in i)if(j(t)==j(i[e]))return!0;return!1}return we(i)?j(t)==j(i):!1},De=function(i,t){for(var e in i)return/^(browser|cpu|device|engine|os)$/.test(e)||(t?De(i[e]):!1)},we=function(i){return typeof i===ht},rt=function(i){if(i){for(var t=[],e=pe(/\\?\"/g,i).split(","),s=0;s<e.length;s++)if(e[s].indexOf(";")>-1){var a=Ne(e[s]).split(";v=");t[s]={brand:a[0],version:a[1]}}else t[s]=Ne(e[s]);return t}},j=function(i){return we(i)?i.toLowerCase():i},ct=function(i){return we(i)?pe(/[^\d\.]/g,i).split(".")[0]:void 0},N=function(i){for(var t in i)if(i.hasOwnProperty(t)){var e=i[t];typeof e==ge&&e.length==2?this[e[0]]=e[1]:this[e]=void 0}return this},pe=function(i,t){return we(t)?t.replace(i,he):t},Ce=function(i){return pe(/\\?\"/g,i)},Ne=function(i,t){if(we(i))return i=pe(/^\s\s*/,i),typeof t===W?i:i.substring(0,ut)},dt=function(i,t){if(!(!i||!t))for(var e=0,s,a,c,o,g,h;e<t.length&&!g;){var w=t[e],p=t[e+1];for(s=a=0;s<w.length&&!g&&w[s];)if(g=w[s++].exec(i),g)for(c=0;c<p.length;c++)h=g[++a],o=p[c],typeof o===ge&&o.length>0?o.length===2?typeof o[1]==Fe?this[o[0]]=o[1].call(this,h):this[o[0]]=o[1]:o.length>=3&&(typeof o[1]===Fe&&!(o[1].exec&&o[1].test)?o.length>3?this[o[0]]=h?o[1].apply(this,o.slice(2)):void 0:this[o[0]]=h?o[1].call(this,h,o[2]):void 0:o.length==3?this[o[0]]=h?h.replace(o[1],o[2]):void 0:o.length==4?this[o[0]]=h?o[3].call(this,h.replace(o[1],o[2])):void 0:o.length>4&&(this[o[0]]=h?o[3].apply(this,[h.replace(o[1],o[2])].concat(o.slice(4))):void 0)):this[o]=h||void 0;e+=2}},L=function(i,t){for(var e in t)if(typeof t[e]===ge&&t[e].length>0){for(var s=0;s<t[e].length;s++)if(pt(t[e][s],i))return e===Tt?void 0:e}else if(pt(t[e],i))return e===Tt?void 0:e;return t.hasOwnProperty("*")?t["*"]:i},Ft={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Dt={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},_s={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Nt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[u,[l,te+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[u,[l,_e+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[u,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,u],[/opios[\/ ]+([\w\.]+)/i],[u,[l,ve+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[u,[l,ve+" GX"]],[/\bopr\/([\w\.]+)/i],[u,[l,ve]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[u,[l,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[u,[l,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[l,u],[/quark(?:pc)?\/([-\w\.]+)/i],[u,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[u,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[u,[l,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[u,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[u,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[u,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[u,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[u,[l,"Smart "+Ze+Ee]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure"+Ee],u],[/\bfocus\/([\w\.]+)/i],[u,[l,ke+" Focus"]],[/\bopt\/([\w\.]+)/i],[u,[l,ve+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[u,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[u,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[u,[l,ve+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[u,[l,"MIUI"+Ee]],[/fxios\/([\w\.-]+)/i],[u,[l,te+ke]],[/\bqihoobrowser\/?([\w\.]*)/i],[u,[l,"360"]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],u],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+Ee],u],[/samsungbrowser\/([\w\.]+)/i],[u,[l,fe+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[u,[l,_t+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,_t+" Mobile"],u],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[l,u],[/(lbbrowser|rekonq)/i],[l],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[u,l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,ot],u,[n,Z]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[l,u,[n,Z]],[/\bgsa\/([\w\.]+) .*safari\//i],[u,[l,"GSA"],[n,Z]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[u,[l,"TikTok"],[n,Z]],[/\[(linkedin)app\]/i],[l,[n,Z]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[l,/(.+)/,"Zalo"],u,[n,Z]],[/(chromium)[\/ ]([-\w\.]+)/i],[l,u],[/headlesschrome(?:\/([\w\.]+)| )/i],[u,[l,Lt+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[u,[l,_e+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,Lt+" WebView"],u],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[u,[l,"Android"+Ee]],[/chrome\/([\w\.]+) mobile/i],[u,[l,te+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,u],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[u,[l,te+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[l,te+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[u,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[u,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[l,u],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[l,te+ke],u],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],u],[/(wolvic|librewolf)\/([\w\.]+)/i],[l,u],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[u,[l,ke+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[l,[u,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[u,/[^\d\.]+./,he]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[I,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[I,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[I,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[I,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[I,"arm"]],[/ sun4\w[;\)]/i],[[I,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[I,/ower/,he,j]],[/winnt.+\[axp/i],[[I,"alpha"]]],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],[r,[d,fe],[n,f]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[r,[d,fe],[n,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[r,[d,ee],[n,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[r,[d,ee],[n,f]],[/(macintosh);/i],[r,[d,ee]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[r,[d,Rt],[n,m]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[r,[d,Ot],[n,f]],[/honor([-\w ]+)[;\)]/i],[r,[d,Ot],[n,m]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[r,[d,xt],[n,f]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[r,[d,xt],[n,m]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[r,/_/g," "],[d,at],[n,f]],[/\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|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[r,/_/g," "],[d,at],[n,m]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[r,[d,Ut],[n,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[r,[d,it],[n,m]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[r,[d,L,{OnePlus:["203","304","403","404","413","415"],"*":it}],[n,f]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[r,[d,"BLU"],[n,m]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[r,[d,"Vivo"],[n,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[r,[d,"Realme"],[n,m]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[r,[d,Ze],[n,f]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[r,[d,Ze],[n,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[r,[d,tt],[n,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[r,[d,tt],[n,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[r,[d,Re],[n,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[r,[d,Re],[n,m]],[/(nokia) (t[12][01])/i],[d,r,[n,f]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[r,/_/g," "],[n,m],[d,"Nokia"]],[/(pixel (c|tablet))\b/i],[r,[d,X],[n,f]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[r,[d,X],[n,m]],[/(google) (pixelbook( go)?)/i],[d,r],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[r,[d,ye],[n,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[r,"Xperia Tablet"],[d,ye],[n,f]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[r,[d,Ue],[n,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[r,/(.+)/g,"Fire Phone $1"],[d,Ue],[n,m]],[/(playbook);[-\w\),; ]+(rim)/i],[r,d,[n,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[r,[d,At],[n,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[r,[d,Pt],[n,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[r,[d,Pt],[n,m]],[/(nexus 9)/i],[r,[d,"HTC"],[n,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[r,/_/g," "],[n,m]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[r,[d,"TCL"],[n,f]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[r,[d,"TCL"],[n,m]],[/(itel) ((\w+))/i],[[d,j],r,[n,L,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[r,[d,"Acer"],[n,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[r,[d,"Meizu"],[n,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[r,[d,"Ulefone"],[n,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[r,[d,"Energizer"],[n,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[r,[d,"Cat"],[n,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[r,[d,"Smartfren"],[n,m]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[r,[d,"Nothing"],[n,m]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[r,[d,"Archos"],[n,f]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[r,[d,"Archos"],[n,m]],[/; (n159v)/i],[r,[d,"HMD"],[n,m]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[d,r,[n,f]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[d,r,[n,m]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[d,r,[n,f]],[/(surface duo)/i],[r,[d,et],[n,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[r,[d,"Fairphone"],[n,m]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[r,[d,st],[n,f]],[/(sprint) (\w+)/i],[d,r,[n,m]],[/(kin\.[onetw]{3})/i],[[r,/\./g," "],[d,et],[n,m]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[r,[d,nt],[n,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[r,[d,nt],[n,m]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[d,[n,y]],[/hbbtv.+maple;(\d+)/i],[[r,/^/,"SmartTV"],[d,fe],[n,y]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[d,r,[n,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,Re],[n,y]],[/(apple) ?tv/i],[d,[r,ee+" TV"],[n,y]],[/crkey.*devicetype\/chromecast/i],[[r,V+" Third Generation"],[d,X],[n,y]],[/crkey.*devicetype\/([^/]*)/i],[[r,/^/,"Chromecast "],[d,X],[n,y]],[/fuchsia.*crkey/i],[[r,V+" Nest Hub"],[d,X],[n,y]],[/crkey/i],[[r,V],[d,X],[n,y]],[/(portaltv)/i],[r,[d,ot],[n,y]],[/droid.+aft(\w+)( bui|\))/i],[r,[d,Ue],[n,y]],[/(shield \w+ tv)/i],[r,[d,st],[n,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[r,[d,Rt],[n,y]],[/(bravia[\w ]+)( bui|\))/i],[r,[d,ye],[n,y]],[/(mi(tv|box)-?\w+) bui/i],[r,[d,at],[n,y]],[/Hbbtv.*(technisat) (.*);/i],[d,r,[n,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,/.+\/(\w+)/,"$1",L,{LG:"lge"}],[r,Ne],[n,y]],[/(playstation \w+)/i],[r,[d,ye],[n,Me]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[r,[d,et],[n,Me]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[d,r,[n,Me]],[/droid.+; (shield)( bui|\))/i],[r,[d,st],[n,Me]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[r,[d,fe],[n,R]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[d,r,[n,R]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[r,[d,it],[n,R]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[r,[d,ee],[n,R]],[/(opwwe\d{3})/i],[r,[d,Ut],[n,R]],[/(moto 360)/i],[r,[d,tt],[n,R]],[/(smartwatch 3)/i],[r,[d,ye],[n,R]],[/(g watch r)/i],[r,[d,Re],[n,R]],[/droid.+; (wt63?0{2,3})\)/i],[r,[d,nt],[n,R]],[/droid.+; (glass) \d/i],[r,[d,X],[n,Oe]],[/(pico) ([\w ]+) os\d/i],[d,r,[n,Oe]],[/(quest( \d| pro)?s?).+vr/i],[r,[d,ot],[n,Oe]],[/mobile vr; rv.+firefox/i],[[n,Oe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[n,Se]],[/(aeobc)\b/i],[r,[d,Ue],[n,Se]],[/(homepod).+mac os/i],[r,[d,ee],[n,Se]],[/windows iot/i],[[n,Se]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[r,[n,y]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[n,y]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[r,[n,L,{mobile:"Mobile",xr:"VR","*":f}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[n,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[n,m]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[r,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[u,[l,_e+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[l,u],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[u,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,u],[/ladybird\//i],[[l,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[u,l]],os:[[/(windows nt) (6\.[23]); arm/i],[[l,/N/,"R"],[u,L,Ft]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[l,u],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[u,/(;|\))/g,"",L,Ft],[l,gt]],[/(windows ce)\/?([\d\.]*)/i],[l,u],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[u,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[l,"macOS"],[u,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[u,[l,V+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[u,[l,V+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[u,[l,V+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[u,[l,V+" Linux"]],[/crkey\/([\d\.]+)/i],[u,[l,V]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[u,l],[/(ubuntu) ([\w\.]+) like android/i],[[l,/(.+)/,"$1 Touch"],u],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[l,u],[/\(bb(10);/i],[u,[l,At]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[u,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[u,[l,ke+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[u,[l,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[u,L,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[u,[l,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,"Chrome OS"],u],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[l,u],[/(sunos) ?([\d\.]*)/i],[[l,"Solaris"],u],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,u]]},Le=function(){var i={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return N.call(i.init,[[S,[l,u,Ie,n]],[D,[I]],[B,[n,r,d]],[O,[l,u]],[x,[l,u]]]),N.call(i.isIgnore,[[S,[u,Ie]],[O,[u]],[x,[u]]]),N.call(i.isIgnoreRgx,[[S,/ ?browser$/i],[x,/ ?os$/i]]),N.call(i.toString,[[S,[l,u]],[D,[I]],[B,[d,r]],[O,[l,u]],[x,[l,u]]]),i}(),Fs=function(i,t){var e=Le.init[t],s=Le.isIgnore[t]||0,a=Le.isIgnoreRgx[t]||0,c=Le.toString[t]||0;function o(){N.call(this,e)}return o.prototype.getItem=function(){return i},o.prototype.withClientHints=function(){return z?z.getHighEntropyValues(Yt).then(function(g){return i.setCH(new Zt(g,!1)).parseCH().get()}):i.parseCH().get()},o.prototype.withFeatureCheck=function(){return i.detectFeature().get()},t!=ie&&(o.prototype.is=function(g){var h=!1;for(var w in this)if(this.hasOwnProperty(w)&&!pt(s,w)&&j(a?pe(a,this[w]):this[w])==j(a?pe(a,g):g)){if(h=!0,g!=W)break}else if(g==W&&h){h=!h;break}return h},o.prototype.toString=function(){var g=he;for(var h in c)typeof this[c[h]]!==W&&(g+=(g?" ":he)+this[c[h]]);return g||W}),z||(o.prototype.then=function(g){var h=this,w=function(){for(var E in h)h.hasOwnProperty(E)&&(this[E]=h[E])};w.prototype={is:o.prototype.is,toString:o.prototype.toString};var p=new w;return g(p),p}),new o};function Zt(i,t){if(i=i||{},N.call(this,Yt),t)N.call(this,[[mt,rt(i[$])],[bt,rt(i[Ts])],[m,/\?1/.test(i[Os])],[r,Ce(i[Us])],[ae,Ce(i[Jt])],[ft,Ce(i[Rs])],[I,Ce(i[Ps])],[J,rt(i[xs])],[qe,Ce(i[As])]]);else for(var e in i)this.hasOwnProperty(e)&&typeof i[e]!==W&&(this[e]=i[e])}function Gt(i,t,e,s){return this.get=function(a){return a?this.data.hasOwnProperty(a)?this.data[a]:void 0:this.data},this.set=function(a,c){return this.data[a]=c,this},this.setCH=function(a){return this.uaCH=a,this},this.detectFeature=function(){if(T&&T.userAgent==this.ua)switch(this.itemType){case S:T.brave&&typeof T.brave.isBrave==Fe&&this.set(l,"Brave");break;case B:!this.get(n)&&z&&z[m]&&this.set(n,m),this.get(r)=="Macintosh"&&T&&typeof T.standalone!==W&&T.maxTouchPoints&&T.maxTouchPoints>2&&this.set(r,"iPad").set(n,f);break;case x:!this.get(l)&&z&&z[ae]&&this.set(l,z[ae]);break;case ie:var a=this.data,c=function(o){return a[o].getItem().detectFeature().get()};this.set(S,c(S)).set(D,c(D)).set(B,c(B)).set(O,c(O)).set(x,c(x))}return this},this.parseUA=function(){return this.itemType!=ie&&dt.call(this.data,this.ua,this.rgxMap),this.itemType==S&&this.set(Ie,ct(this.get(u))),this},this.parseCH=function(){var a=this.uaCH,c=this.rgxMap;switch(this.itemType){case S:case O:var o=a[bt]||a[mt],g;if(o)for(var h=0;h<o.length;h++){var w=o[h].brand||o[h],p=o[h].version;this.itemType==S&&!/not.a.brand/i.test(w)&&(!g||/Chrom/.test(g)&&w!=Bt||g==_e&&/WebView2/.test(w))&&(w=L(w,_s),g=this.get(l),g&&!/Chrom/.test(g)&&/Chrom/.test(w)||this.set(l,w).set(u,p).set(Ie,ct(p)),g=w),this.itemType==O&&w==Bt&&this.set(u,p)}break;case D:var E=a[I];E&&(E&&a[qe]=="64"&&(E+="64"),dt.call(this.data,E+";",c));break;case B:if(a[m]&&this.set(n,m),a[r]&&(this.set(r,a[r]),!this.get(n)||!this.get(d))){var P={};dt.call(P,"droid 9; "+a[r]+")",c),!this.get(n)&&P.type&&this.set(n,P.type),!this.get(d)&&P.vendor&&this.set(d,P.vendor)}if(a[J]){var G;if(typeof a[J]!="string")for(var me=0;!G&&me<a[J].length;)G=L(a[J][me++],Dt);else G=L(a[J],Dt);this.set(n,G)}break;case x:var F=a[ae];if(F){var Y=a[ft];F==gt&&(Y=parseInt(ct(Y),10)>=13?"11":"10"),this.set(l,F).set(u,Y)}this.get(l)==gt&&a[r]=="Xbox"&&this.set(l,"Xbox").set(u,void 0);break;case ie:var K=this.data,H=function(xe){return K[xe].getItem().setCH(a).parseCH().get()};this.set(S,H(S)).set(D,H(D)).set(B,H(B)).set(O,H(O)).set(x,H(x))}return this},N.call(this,[["itemType",i],["ua",t],["uaCH",s],["rgxMap",e],["data",Fs(this,i)]]),this}function _(i,t,e){if(typeof i===ge?(De(i,!0)?(typeof t===ge&&(e=t),t=i):(e=i,t=void 0),i=void 0):typeof i===ht&&!De(t,!0)&&(e=t,t=void 0),e)if(typeof e.append===Fe){var s={};e.forEach(function(p,E){s[String(E).toLowerCase()]=p}),e=s}else{var a={};for(var c in e)e.hasOwnProperty(c)&&(a[String(c).toLowerCase()]=e[c]);e=a}if(!(this instanceof _))return new _(i,t,e).getResult();var o=typeof i===ht?i:e&&e[It]?e[It]:T&&T.userAgent?T.userAgent:he,g=new Zt(e,!0),h=t?Bs(Nt,t):Nt,w=function(p){return p==ie?function(){return new Gt(p,o,h,g).set("ua",o).set(S,this.getBrowser()).set(D,this.getCPU()).set(B,this.getDevice()).set(O,this.getEngine()).set(x,this.getOS()).get()}:function(){return new Gt(p,o,h[p],g).parseUA().get()}};return N.call(this,[["getBrowser",w(S)],["getCPU",w(D)],["getDevice",w(B)],["getEngine",w(O)],["getOS",w(x)],["getResult",w(ie)],["getUA",function(){return o}],["setUA",function(p){return we(p)&&(o=p.length>ut?Ne(p,ut):p),this}]]).setUA(o),this}_.VERSION=Is;_.BROWSER=We([l,u,Ie,n]);_.CPU=We([I]);_.DEVICE=We([r,d,n,Me,m,y,f,R,Se]);_.ENGINE=_.OS=We([l,u]);class es{constructor(t,e){b(this,"config");b(this,"sdkConfig");b(this,"error");this.config=t,this.sdkConfig=e,this.on("openGame",async()=>{try{this.error=void 0;const s=await this.openGame();this.send("openGameResponse",s)}catch(s){this.error=s,this.send("openGameError",this.error)}}),this.on("play",async s=>{try{this.error=void 0;const a=await this.play(s);this.send("playResponse",a)}catch(a){this.error=a,this.send("playError",this.error)}}),this.on("freeRounds",async s=>{try{this.error=void 0;const a=await this.freeRounds(s);this.send("freeRoundsResponse",a)}catch(a){this.error=a,this.send("freeRoundsError",this.error)}}),this.on("getBalance",async()=>{try{this.error=void 0;const s=await this.getBalance();this.send("balance",s)}catch{}}),this.showHistory=this.showHistory.bind(this),this.on("history",this.showHistory)}on(t,e,s){const a=function(o){o.data.message!==`kalamba:wrapper-rgs:${t}`&&o.data.message!==`kalamba:wrapper:${t}`||e(o.data.payload)};window.addEventListener("message",a,s)}send(t,...[e]){window.postMessage({message:`kalamba:rgs:${t}`,payload:e})}async openGame(){throw new Error("Not implemented")}async play(t){throw new Error("Not implemented")}async freeRounds(t){throw new Error("Not implemented")}async getBalance(){throw new Error("Not implemented")}async showHistory(){throw new Error("Not implemented")}}class Ds{constructor(t){b(this,"socket",null);b(this,"webSocketUrl");b(this,"eventListeners",{close:[],error:[],message:[]});b(this,"connect",async()=>{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)},{once:!0})})});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()});b(this,"handleClose",t=>{this.eventListeners.close.forEach(e=>{e(t)}),this.socket.removeEventListener("message",this.handleMessage),this.socket.removeEventListener("close",this.handleClose),this.socket.removeEventListener("error",this.handleError),this.socket=null});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 s=this.eventListeners[t].indexOf(e);s!==-1&&this.eventListeners[t].splice(s,1)}}function Be(i){return JSON.parse(i==null?void 0:i.data)}function Ns(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="Ping"}function Ht(i){var t;return((t=i==null?void 0:i.header)==null?void 0:t.name)==="RealityCheck"}function Ge(i){return i.header.name==="GameEvent"}function Gs(i){return Ge(i)&&i.body.event==="OPEN_GAME"}function Vt(i){return i.header.code!==1}function Hs(i){return Ge(i)&&i.body.event.includes("_RESULT")}var ne,Te;class Vs extends Ds{constructor(e,s){const a=new URL(e.apiUrl);a.searchParams.set("cageCode",e.cageCode),a.searchParams.set("gameCode",e.gameCode),a.searchParams.set("operatorCode",e.operatorCode),a.searchParams.set("playMode",e.playMode),a.searchParams.set("token",e.token),a.searchParams.set("username",e.username);super(a.toString());b(this,"cId",0);b(this,"mId",0);b(this,"seqId",0);b(this,"gameCode");M(this,ne);M(this,Te);b(this,"onMessage",e=>{const s=Be(e);(Ge(s)||Ns(s)||Ht(s))&&this.sendAcknowledgement(s),Ht(s)&&this.handleRealityCheck(s)});this.eventListeners.realityCheck=[],this.gameCode=e.gameCode,v(this,ne,s.requestTimeoutMs),v(this,Te,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 a=this.buildPayload(e,s);return new Promise((c,o)=>{setTimeout(()=>o({type:"timeout"}),k(this,ne));const g=h=>{const w=Be(h);try{e.cId===w.header.cId&&(this.removeEventListener("message",g),w.header.code===1?c(w):o({message:w,type:"error"}))}catch{o({message:w,type:"error"})}};this.addEventListener("message",g),this.send(a)})}freeRounds(e){const s=this.buildHeader("ActivateFreeRound");return this.request(s,e).then(a=>a.body).catch(a=>{var c;throw{data:(c=a==null?void 0:a.message)==null?void 0:c.body,type:a.type}})}async authenticate(e=!1){const s=this.buildHeader("Authenticate"),a={clientType:3,version:k(this,Te),reconnect:e};return this.request(s,a).then(c=>c.body).catch(c=>{var o;throw{data:(o=c==null?void 0:c.message)==null?void 0:o.body,type:c.type}})}async getBalance(){const e=this.buildHeader("GetBalance"),s={};return this.request(e,s).then(a=>a.body).catch(a=>{var c;throw{data:(c=a==null?void 0:a.message)==null?void 0:c.body,type:a.type}})}async openGame(){const e=this.buildHeader("OpenGame"),s={gameCode:this.gameCode};return new Promise((a,c)=>{const o=g=>{const h=Be(g);Gs(h)?(this.removeEventListener("message",o),a(h.body)):Vt(h)&&c({data:h.body,type:"error"})};this.addEventListener("message",o),this.request(e,s).catch(g=>{var h;return c({data:(h=g==null?void 0:g.message)==null?void 0:h.body,type:g.type})})})}sendAcknowledgement(e){const{name:s,cId:a}=e.header,c=this.buildHeader(s,a),o=this.buildPayload(c,{});this.send(o)}sendAction(e,s){const a=this.buildHeader("GameAction"),c={...this.getBodyExtras(e),data:s};return new Promise((o,g)=>{const h=w=>{const p=Be(w);Ge(p)&&c.seqId===p.body.correlationSeqId&&(this.removeEventListener("message",h),Hs(p)?o(p.body):Vt(p)&&g({data:p.body,type:"error"}))};this.addEventListener("message",h),this.request(a,c).catch(w=>{var p;return g({data:(p=w==null?void 0:w.message)==null?void 0:p.body,type:w.type})})})}setRequestTimeoutMs(e){v(this,ne,e)}}ne=new WeakMap,Te=new WeakMap;const zs={CA_BC:"CA",CA_ON:"CA",GER:"DE",US_CT:"US",US_MI:"US",US_NJ:"US",USA:"US"};function zt(i){return!i||i==="NOT_APPLICABLE"?null:zs[i]??i}function ts(i){const t=i.contract;return t?{contract:{balance:{coins:t.balance,version:t.balanceVersion},coinValueInCents:t.coinValueInCents,country:t.countryCode,currency:t.currencyCode,jurisdiction:zt(t.jurisdictionCode),uiMessages:t.uiMessages,username:t.username}}:{contract:{balance:{coins:i.balance,version:i.balanceVersion},coinValueInCents:i.coinValueInCents,country:i.countryCode,currency:i.currencyCode,jurisdiction:zt(i.jurisdictionCode),uiMessages:i.uiMessages,username:i.username}}}function ss(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??se.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function is(i,t,e){const s=t.contract;if(!s){const a=t.data;return{contract:{bet:{available:a.additionalConfigData.availableMultipliersPerBaseBet,default:{base:a.additionalConfigData.defaultBet.baseBet,multiplier:a.additionalConfigData.defaultBet.betMultiplier},max:a.additionalConfigData.maxAllowedOverallBetInCoins??null,last:a.gameState.betFromCurrentRound?{base:a.gameState.betFromCurrentRound.baseBet,multiplier:a.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:a.gameState.lastPlacedMainGameBet?{base:a.gameState.lastPlacedMainGameBet.baseBet,multiplier:a.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:t.balance,version:t.balanceVersion},freeRounds:(a.FREE_ROUNDS??[]).map(c=>({conf:{base:c.conf.baseBet,multiplier:c.conf.betMultiplier,numAwarded:c.conf.numAwarded},data:{numPlayed:c.data.numPlayed,win:c.data.winAmount,numLeft:c.data.numLeft},id:c.id,rejectable:c.rejectable,skippable:c.skippable,status:c.status,type:c.type})),gameModel:a.additionalConfigData.gameModelFile,metaData:a.gameConfigData.metaData,roundId:a.gameState.cycleId,serverTime:t.balanceVersion,sessionId:a.gameState.sessionId,stateType:{thisRound:a.gameState.stateTypeThisRound,nextRound:a.gameState.stateTypeNextRound},uiMessages:i.uiMessages,win:{max:a.maxWin??null,round:a.gameState.totalWinFromCurrentRound,total:a.gameState.totalWinFromCurrentGameCycle}},data:a}}return{contract:{bet:{available:s.availableMultipliersPerBaseBet,default:{base:s.defaultBet.baseBet,multiplier:s.defaultBet.betMultiplier},max:s.maxBetInCoins??null,last:s.lastBet?{base:s.lastBet.baseBet,multiplier:s.lastBet.betMultiplier}:null,lastPaid:s.lastMainGameBet?{base:s.lastMainGameBet.baseBet,multiplier:s.lastMainGameBet.betMultiplier}:null},balance:{coins:s.balanceInCoins,version:s.balanceVersion},freeRounds:(s.freeRounds??[]).map(a=>({conf:{base:a.conf.baseBet,multiplier:a.conf.betMultiplier,numAwarded:a.conf.numAwarded},data:{numPlayed:a.data.numPlayed,win:a.data.winAmount,numLeft:a.data.numLeft},id:a.id,rejectable:a.rejectable,skippable:a.skippable,status:a.status,type:a.type})),gameModel:s.gameModelFile,metaData:s.metaData,roundId:s.roundId,serverTime:s.serverTime,sessionId:s.sessionId,stateType:{thisRound:s.stateTypeThisRound,nextRound:s.stateTypeNextRound},uiMessages:i.contract.uiMessages.concat(s.uiMessages),win:{max:s.maxWinInCoins??null,round:s.roundWin,total:s.totalWin}},data:e?e(t.opaqueGameServerToUi):t.opaqueGameServerToUi}}function as(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??se.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}function ns(i,t){const e=i.contract;if(!e){const s=i.data;return{contract:{bet:{last:s.gameState.betFromCurrentRound?{base:s.gameState.betFromCurrentRound.baseBet,multiplier:s.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:(s.gameState.lastPlacedMainGameBet??s.gameState.betFromCurrentRound).baseBet,multiplier:(s.gameState.lastPlacedMainGameBet??s.gameState.betFromCurrentRound).betMultiplier}},balance:{coins:i.balance,version:i.balanceVersion},freeRounds:(s.FREE_ROUNDS??[]).map(a=>({conf:{base:a.conf.baseBet,multiplier:a.conf.betMultiplier,numAwarded:a.conf.numAwarded},data:{numPlayed:a.data.numPlayed,win:a.data.winAmount,numLeft:a.data.numLeft},id:a.id,rejectable:a.rejectable,skippable:a.skippable,status:a.status,type:a.type})),serverTime:i.balanceVersion,roundId:s.gameState.cycleId,stateType:{thisRound:s.gameState.stateTypeThisRound,nextRound:s.gameState.stateTypeNextRound},uiMessages:s.uiMessages,win:{round:s.gameState.totalWinFromCurrentRound,total:s.gameState.totalWinFromCurrentGameCycle}},data:s}}return{contract:{bet:{last:e.lastBet?{base:e.lastBet.baseBet,multiplier:e.lastBet.betMultiplier}:null,lastPaid:{base:e.lastMainGameBet.baseBet,multiplier:e.lastMainGameBet.betMultiplier}},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})),serverTime:e.serverTime,roundId:e.roundId,stateType:{thisRound:e.stateTypeThisRound,nextRound:e.stateTypeNextRound},uiMessages:e.uiMessages,win:{round:e.roundWin,total:e.totalWin}},data:t?t(i.opaqueGameServerToUi):i.opaqueGameServerToUi}}function os(i){var t,e;return{code:((t=i.data)==null?void 0:t.code)??se.RgsErrorCode.UNKNOWN,details:(e=i.data)==null?void 0:e.details}}const qs={parseAuthenticateResponse:ts,parseAuthenticateError:ss,parseOpenGameResponse:is,parseOpenGameError:as,parsePlayResponse:ns,parsePlayError:os},Ws={aze:"az",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"},{device:js}=_(navigator.userAgent),$s=A("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class Ks extends es{constructor(...e){super(...e);b(this,"socket");this.on("configured",s=>{this.socket.setRequestTimeoutMs(s.ui.requestTimeoutMs)})}initialize(e){this.socket=new Vs(e,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),["fireboltroulette"].includes(e.gameCode)||(this.socket.addEventListener("close",s=>{s.code===1008?this.error||this.send("error",{type:"CLOSE",messageCode:"TOO_MANY_OPEN_GAMES",messageKey:"RgsError.TOO_MANY_OPEN_GAMES"}):s.code===1011?this.error||this.send("error",{type:"CLOSE",messageCode:"UNKNOWN",messageKey:"RgsError.UNKNOWN"}):this.reconnect()}),["mobile","tablet"].includes(js.type??"")&&document.addEventListener("visibilitychange",async()=>{document.hidden||(this.socket.socket?this.socket.socket&&[WebSocket.CONNECTING,WebSocket.OPEN].includes(this.socket.socket.readyState)&&this.socket.close():this.reconnect())})),this.socket.addEventListener("error",s=>$s("error",s)),this.socket.addEventListener("realityCheck",s=>{this.send("realityCheck",s)})}async reconnect(){try{await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}catch{this.send("error",{type:"CLOSE",messageCode:"CONNECTION_ERROR",messageKey:"RgsError.CONNECTION_ERROR"})}}async openGame(){var H,xe;const e=new URLSearchParams(window.location.search),s=e.get("apiUrl"),a=e.get("cageCode"),c=e.get("gameCode"),o=e.get("operatorCode"),g=e.get("playMode"),h=e.get("token"),w=e.get("username"),p=e.get("gameHistoryUrl"),E=e.get("homeUrl")??void 0,P=e.get("cashierUrl")??void 0;this.initialize({apiUrl:s,cageCode:a,gameCode:c,operatorCode:o,playMode:g,token:h,username:w});try{await this.socket.connect()}catch{throw{type:"error",data:{code:se.RgsErrorCode.CONNECTION_ERROR}}}let G;try{G=await this.socket.authenticate()}catch(Q){throw{type:Q.type,data:Q.type==="error"?ss(Q.data):void 0}}let me;try{me=await this.socket.openGame()}catch(Q){throw{type:Q.type,data:Q.type==="error"?as(Q.data):void 0}}const F=ts(G),Y=is(G,me,this.config.dataDecoder&&je.decoders[this.config.dataDecoder]);this.sdkConfig.api={...this.sdkConfig.api,brand:a,game:c,integration:o,jurisdiction:F.contract.jurisdiction,playMode:g,user:F.contract.username,integrationData:{token:h},country:F.contract.country,currency:F.contract.currency,coinValueInCents:F.contract.coinValueInCents,gameHistoryUrl:p,homeUrl:E,cashierUrl:P,backendSessionId:Y.contract.sessionId};const K=(xe=(H=e.get("languageCode"))==null?void 0:H.split("_"))==null?void 0:xe[0];return K&&(this.sdkConfig.ui.language=K.length===3?Ws[K]??K:K),Y}async play(e){for(;!this.socket.socket;)await new Promise(P=>setTimeout(()=>P(),500));const{contract:{bet:s,forcedOutcomes:a,...c},extra:o,payloadToInject:g}=e,h=this.config.dataEncoder&&je.encoders[this.config.dataEncoder],w=s===null?"BG_ACTION":"SPIN",p={bet:s?{baseBet:s.base,betMultiplier:s.multiplier}:void 0,forcedOutcomes:a,...c,...g,opaqueUiToGameServer:h?h(o):o};let E;try{E=await this.socket.sendAction(w,p)}catch(P){throw{type:P.type,data:P.type==="error"?os(P.data):void 0}}return ns(E,this.config.dataDecoder&&je.decoders[this.config.dataDecoder])}async freeRounds(e){try{await this.socket.freeRounds(e)}catch{throw{type:"error",data:{code:se.RgsErrorCode.UNKNOWN}}}return e}async getBalance(){try{return{balance:(await this.socket.getBalance()).balance}}catch{throw{type:"error",data:{code:se.RgsErrorCode.UNKNOWN}}}}async showHistory(){const{api:{game:e,integration:s,integrationData:a,jurisdiction:c,user:o,gameHistoryUrl:g},ui:{language:h}}=this.sdkConfig,w=o.replace(/^user_/,"").replace(new RegExp(`_${s}$`),""),p=new URL(window.location.href);p.hostname=p.hostname.replace(/^v\./,"").replace(/^play\./,"history."),p.pathname=p.pathname.replace(/(\/[0-9]+\.[0-9]+\.[0-9]+)?\/wrapper\.html/,"/list/index.html"),p.search="",p.searchParams.set("apiUrl",new URL(g).origin),p.searchParams.set("gameCode",e),c&&p.searchParams.set("jurisdiction",c),p.searchParams.set("operatorCode",s),p.searchParams.set("token",a.token),p.searchParams.set("username",w),p.searchParams.set("languageCode",h),this.config.gameHistoryUrl&&p.searchParams.set("gameHistoryUrl",this.config.gameHistoryUrl),window.open(p.toString(),"_blank")}}class rs{constructor(t,e,s){b(this,"trackers");b(this,"config");b(this,"sdkConfig");this.trackers=t,this.config=e,this.sdkConfig=s}on(t,e,s){const a=function(o){o.data.message!==`kalamba:wrapper-telemetry:${t}`&&o.data.message!==`kalamba:wrapper:${t}`||e(o.data.payload)};window.addEventListener("message",a,s)}track(t,e){this.trackers.forEach(s=>s.track(t,e))}}function qt(i){return i.reduce((t,e)=>t+e,0)}function Qs(i){const t=i.length,e=qt(i)/t,s=i.map(c=>Math.pow(c-e,2)),a=qt(s)/t;return Math.sqrt(a)}class Wt{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,s,a,c)=>(c[a]!==c[a-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)),s=t.length>0?Math.max(...t):e,a=t.length>0?Math.min(...t):e,c=t.length>0?Qs(t):0;return{fpsAvg:e,fpsMax:s,fpsMin:a,fpsStdDev:c}});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 Xs="landscape",Js="portrait";function Ys(){try{const i=document.createElement("canvas");return!!window.WebGLRenderingContext&&(i.getContext("webgl")||i.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function Zs(){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 lt(){return window.innerWidth>=window.innerHeight?Xs:Js}var He,oe,re,ce,Pe,Ve,Ae,ze;class ei extends rs{constructor(...e){super(...e);b(this,"FPS_SAMPLE_INTERVAL",1e4);M(this,He,0);M(this,oe);M(this,re);M(this,ce);M(this,Pe,!1);M(this,Ve,!1);M(this,Ae,"");M(this,ze,[]);v(this,re,{}),v(this,ce,this.deviceInfo()),v(this,oe,this.config.gameVersion),this.on("state",({balance:s})=>{v(this,He,s)}),this.on("autoplay",({action:s})=>{["start","resume"].includes(s)?v(this,Pe,!0):v(this,Pe,!1)}),this.on("settings",({fastPlay:s})=>{s!==void 0&&v(this,Ve,s)}),this.registerEvents()}async registerEvents(){k(this,ce).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,Ae,e.contract.stateType.nextRound),v(this,re,{balanceInCoins:e.contract.balance.coins,clientVersion:k(this,oe),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,rootTrackingSessionID:this.sdkConfig.api.sessionId,backendSessionID:this.sdkConfig.api.backendSessionId,serverVersion:e.contract.metaData.version}),this.track("Game Open",k(this,re))}),this.on("playCycleEnd",async e=>{const s=await k(this,ce),{base:a,multiplier:c}=e.contract.bet.lastPaid??{},o=e.contract.balance.coins,g=e.contract.bet.lastPaid.base*e.contract.bet.lastPaid.multiplier,h=e.contract.win.total,w=h-g,p="spin",E=e.contract.roundId;this.track("Betting Activity",{balance:o-w,balanceAfter:o,baseBet:a,betMultiplier:c,betType:p,gameVersion:k(this,oe),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:w,operatorName:"kalamba",orientation:lt(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:E,roundTypes:["BaseGame"],totalBet:g,totalWin:h}),v(this,ze,[])}),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 Wt,s=()=>{e.stop();const c=e.getReport();this.track("FPS Performance",{...c,fpsType:"sample"}),a()},a=async()=>{e.start(),setTimeout(s,this.FPS_SAMPLE_INTERVAL)};a()}reportFpsRound(){const e=new Wt;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:lt(),stateType:k(this,Ae)}}async deviceInfo(){var g;const{browser:e,device:s,os:a}=_(navigator.userAgent),c=Ys(),o=await Zs();return{browserName:e.name,browserVersion:e.version,connection:(g=navigator.connection)==null?void 0:g.effectiveType,deviceName:s.model,deviceType:s.type,isMobile:["mobile","tablet"].includes(s.type??""),isWebGLSupported:c,isWebPSupported:o,manufacturer:s.vendor,operatingSystem:a.name,operatingSystemVersion:a.version,orientation:lt(),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}}}He=new WeakMap,oe=new WeakMap,re=new WeakMap,ce=new WeakMap,Pe=new WeakMap,Ve=new WeakMap,Ae=new WeakMap,ze=new WeakMap;var ti=wt.requireNoop();const jt=wt.getDefaultExportFromCjs(ti);class yt{constructor(t,e){b(this,"config");b(this,"sdkConfig");this.config=t,this.sdkConfig=e}}const $t=25,Kt=1e4;var de,le,ue,q;class si extends yt{constructor(...e){super(...e);M(this,de,"https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events");M(this,le);M(this,ue);M(this,q,[]);b(this,"processQueueForced");v(this,le,new Date().getTime()),v(this,q,[]),this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(k(this,de),{method:"OPTIONS"}).catch(jt),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){k(this,ue)&&clearTimeout(k(this,ue)),v(this,ue,window.setTimeout(()=>this.processQueue(),Kt))}send(e){v(this,le,new Date().getTime());try{navigator.sendBeacon(k(this,de),JSON.stringify(e))}catch{fetch(k(this,de),{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(jt)}this.schedule()}addToQueue(e){k(this,q).push(e),this.processQueue()}processQueue(e=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!e&&k(this,q).length<$t&&new Date().getTime()-k(this,le)<Kt))for(;k(this,q).length;){const s=k(this,q).splice(0,$t).map(a=>({...a,sessionID:this.sdkConfig.api.sessionId,userID:this.sdkConfig.api.user}));this.send(s)}}track(e,s){this.addToQueue({eventName:e,eventParams:s,eventTimestamp:new Date().getTime(),eventUUID:wt.v4()})}}de=new WeakMap,le=new WeakMap,ue=new WeakMap,q=new WeakMap;const ii=A("LoggingTracker","color:#000000;font-weight:bold;");class ai extends yt{track(t,e){ii(`@${this.sdkConfig.api.user}`,`[${t}]`,e)}}exports.BasicPlugin=us;exports.CasinoPlugin=U;exports.DebuggingPlugin=gs;exports.EveryMatrixPlugin=Ss;exports.GigPlugin=ps;exports.KalambaBullseyeParsers=qs;exports.KalambaBullseyePlugin=Ks;exports.KalambaStargazerPlugin=ei;exports.KalambaStargazerTracker=si;exports.LoggingTracker=ai;exports.OryxPlugin=ms;exports.PariplayPlugin=ks;exports.QuantaPlugin=Cs;exports.RelaxFEIMPlugin=vs;exports.RgsPlugin=es;exports.SoftSwissPlugin=Ms;exports.TelemetryPlugin=rs;exports.Tracker=yt;exports.TukoPlugin=Es;
5
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tt=require("./encoders-C-jSxC0Z.cjs"),Ee=require("./errors-BZBs3Z5K.cjs"),Ht=require("./v4-BIWLDecr.cjs");function U(e,t){return(n,...o)=>{console.log(`[%c${e}\x1B[m] %s`,t,n,...o)}}function to(e,t){return Math.round(e*100/t)}class B{config;sdkConfig;state;i18n;injectPayload;constructor(t,n,o,i){this.config=t,this.sdkConfig=n,this.state=o,this.i18n=new tt.I18n({config:n}),this.injectPayload=i}on(t,n,o){const i=function(s){s.data.message!==`kalamba:wrapper-casino:${t}`&&s.data.message!==`kalamba:wrapper:${t}`||n(s.data.payload)};window.addEventListener("message",i,o)}send(t,...[n]){window.postMessage({message:`kalamba:casino:${t}`,payload:n})}}const Uo=U("BasicPlugin","color:#000000;font-weight:bold;");class Lo extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Uo("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n,payload:o}=t.data;switch(n){case"doAudioSettings":this.send("settings",{music:o?.musicEnabled,sounds:o?.soundEnabled});return;case"doBalanceUpdate":const{currency:i,coinValueInCents:r}=this.sdkConfig.api;o?.currency===i&&typeof o?.balanceInCurrency=="number"?this.send("balance",{balance:to(o.balanceInCurrency,r)}):typeof o?.balanceInCoins=="number"?this.send("balance",{balance:o.balanceInCoins}):this.send("getBalance");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 rn=e=>{let t;const n=new Set,o=(u,f)=>{const b=typeof u=="function"?u(t):u;if(!Object.is(b,t)){const v=t;t=f??(typeof b!="object"||b===null)?b:Object.assign({},t,b),n.forEach(k=>k(t,v))}},i=()=>t,a={setState:o,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(o,i,a);return a},Do=e=>e?rn(e):rn,Bo={},jo=({onSwitchPlayMode:e})=>Do(()=>({...Bo,switchPlayMode:e})),A=U("BspotPlugin","color:#000000;font-weight:bold;");class Vt extends B{#o="current";static store;#e;#t;#i;#n;constructor(...t){super(...t);const n=new URLSearchParams(window.location.search);this.#i=n.get("bspotEnv")||"prod",this.#e=this.#d(),Vt.store=jo({onSwitchPlayMode:()=>this.#l()}),this.#c(),this.registerFromSdkEvents(),A("configured")}#c(){this.send("translations",{UI:{Balance:"CREDITS"}})}#s(){const o=this.#i==="prod"?"bspot.com":"sb.bspot.com";return`https://games.kl.luckycdn.net/games/static/assets/${this.sdkConfig.api.game.replace(/-eo(v2)?$/,"")}/metadata/${o}/`}async#r(){(await this.#e).getBalances()}async#a(){await new Promise(t=>{this.#t=t}),A("handleReconnect"),this.#r(),this.#a()}async#l(){A("switchPlayMode");const t=await this.#e,n=this.sdkConfig.api.playMode==="REAL",o=!!t._token;if(!n&&!o){t.login();return}const i=new URL(t.config().urls.redirect);i.searchParams.set("demo",String(n)),i.searchParams.set("bspotEnv",this.#i),t._token&&i.searchParams.set("jwt",t._token),i.hash=window.location.hash,window.location.href=i.toString()}#u(t,n){return A("processActiveTokens",{tokens:n}),n.reduce((o,i,r)=>o.then(()=>new Promise(s=>{const a=this.i18n.formatMoneyWithCurrency(i.denomination),c=this.i18n.formatMoneyWithCurrency(i.value),u=this.state.lastPlayResponse?.stateType.thisRound==="PaidSpin",f=`We found a game you may not have finished. You have ${a} in play, press continue to finish playing.`,b=`We found a game you may not have finished. You had ${a} in play, but there were no winnings to reveal this time.`,v=`We found a game you may not have finished. You had ${a} in play, and won ${c}! Congratulations!`,C={buttons:[{action:"CONTINUE",link:"",linkType:"",onRelease:()=>{t.revealToken(i.id,this.config.gameName),s()},text:"Continue"}],messageType:"NOTIFICATION",text:u?+i.value==0?b:v:f,title:n.length>1?`Unfinished Game #${r+1} of ${n.length}`:"Unfinished Game"};A("Incomplete game found",C),s()}).catch(()=>{})),Promise.resolve()).catch(()=>{})}async#d(){const t=`https://sdk.bspot.com/javascript/v1/bspot-sdk-${this.#o}.min.js`,n=document.createElement("script");n.src=t;const o=new Promise(r=>{this.#t=r}),i=new Promise(r=>{n.onload=()=>r()}).then(()=>o).then(()=>(this.#a(),new Promise(r=>{if(!window.bspot)throw new Error("Bspot SDK not loaded");const s=this.sdkConfig.api.playMode==="REAL"?{authenticated:()=>{A("authenticated"),a.getBalances(c=>{const u=this.sdkConfig.api.coinValueInCents,f=parseFloat(c.availableGameplayBalance)*100/u;this.send("balance",{balance:f}),a.getActiveTokens(b=>{this.#u(a,b)}),this.#r()})},balancesUpdated:c=>{A("balancesUpdated",{balances:c})},context:this.#s(),deposited:()=>{A("deposited"),a.getBalances()},errored:c=>{A("errored",{errorMessage:c})},tokenRevealed:c=>{A("tokenRevealed",{balances:c})},unauthenticated:()=>{A("unauthenticated"),a.login()},wagered:c=>{A("wagered",{balances:c})}}:{context:this.#s()},a=new window.bspot.Api(s);a.initialize(),r(a),A("API initialized",{api:a})})));return document.head.appendChild(n),i}registerFromSdkEvents(){this.on("openGameResponse",()=>{this.#t?.()}),this.on("close",()=>{this.#e.then(t=>{window.location.href=t.domain})}),this.on("playEnd",t=>{if(A("playEnd",t),this.sdkConfig.api.playMode==="REAL")try{const n=t.roundResult?.winnings?.nonReelGridResults?.filter(o=>o.Triggers?.some(i=>i.name==="HHRBonusWin"))?.map(o=>o.Win)?.reduce((o,i)=>o+i,0)||0;n>0&&A("Bonus win",`Congratulations! You've been awarded a bonus win of ${this.i18n.formatCoinsWithCurrency(n)}`)}catch(n){A("error processing bonus win",n)}}),this.on("playError",t=>{A("playError",t)}),this.on("playCycleEnd",async t=>{A("playCycleEnd",t),(await this.#e).revealToken(this.#n.id,this.config.gameName)}),this.injectPayload("bspot",async t=>{if(this.sdkConfig.api.playMode!=="REAL")return{};if((this.state.lastPlayResponse?.stateType.thisRound??"PaidSpin")!=="PaidSpin"||t.bet==null)return{};const o=await this.#e,i=1,r=this.i18n.formatCoins(t.bet.base*t.bet.multiplier),s="TOKENA",a=10,c=new window.bspot.PlayToken(i,r,s,a),f=(await new Promise(v=>{o.startPlay(c,v)}))[0];return this.#n=f,A("startPlay result",{token:f}),{integrationSpecificData:JSON.stringify(Object.assign({winAmount:f.value}))}}),this.on("cashier",t=>{A("cashier",t),t.type==="ON_DEMAND"&&this.#e.then(n=>{n.wager()})})}}function l(e,t,n){function o(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(const f in s.prototype)f in a||Object.defineProperty(a,f,{value:s.prototype[f].bind(a)});a._zod.constr=s,a._zod.def=c}const i=n?.Parent??Object;class r extends i{}Object.defineProperty(r,"name",{value:e});function s(a){var c;const u=n?.Parent?new r:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class _e extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class no extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const oo={};function re(e){return oo}function Go(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,i])=>t.indexOf(+o)===-1).map(([o,i])=>i)}function Zt(e,t){return typeof t=="bigint"?t.toString():t}function Wt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function qt(e){return e==null}function Kt(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ho(e,t){const n=(e.toString().split(".")[1]||"").length,o=t.toString();let i=(o.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(o)){const c=o.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}const r=n>i?n:i,s=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return s%a/10**r}const an=Symbol("evaluating");function x(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==an)return o===void 0&&(o=an,o=n()),o},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function me(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fe(...e){const t={};for(const n of e){const o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function cn(e){return JSON.stringify(e)}const io="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ot(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Vo=Wt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Se(e){if(ot(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(ot(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function so(e){return Se(e)?{...e}:Array.isArray(e)?[...e]:e}const Wo=new Set(["string","number","symbol"]);function dt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ue(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function w(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function qo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Ko={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Jo(e,t){const n=e._zod.def,o=fe(e._zod.def,{get shape(){const i={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(i[r]=n.shape[r])}return me(this,"shape",i),i},checks:[]});return ue(e,o)}function Xo(e,t){const n=e._zod.def,o=fe(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&delete i[r]}return me(this,"shape",i),i},checks:[]});return ue(e,o)}function Yo(e,t){if(!Se(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=fe(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return me(this,"shape",r),r},checks:[]});return ue(e,i)}function Qo(e,t){if(!Se(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const o={...e._zod.def.shape,...t};return me(this,"shape",o),o},checks:e._zod.def.checks};return ue(e,n)}function ei(e,t){const n=fe(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return me(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return ue(e,n)}function ti(e,t,n){const o=fe(t._zod.def,{get shape(){const i=t._zod.def.shape,r={...i};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(r[s]=e?new e({type:"optional",innerType:i[s]}):i[s])}else for(const s in i)r[s]=e?new e({type:"optional",innerType:i[s]}):i[s];return me(this,"shape",r),r},checks:[]});return ue(t,o)}function ni(e,t,n){const o=fe(t._zod.def,{get shape(){const i=t._zod.def.shape,r={...i};if(n)for(const s in n){if(!(s in r))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(r[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(const s in i)r[s]=new e({type:"nonoptional",innerType:i[s]});return me(this,"shape",r),r},checks:[]});return ue(t,o)}function ye(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ke(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Ve(e){return typeof e=="string"?e:e?.message}function ae(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const i=Ve(e.inst?._zod.def?.error?.(e))??Ve(t?.error?.(e))??Ve(n.customError?.(e))??Ve(n.localeError?.(e))??"Invalid input";o.message=i}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function Jt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Be(...e){const[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}const ro=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Zt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ao=l("$ZodError",ro),co=l("$ZodError",ro,{Parent:Error});function oi(e,t=n=>n.message){const n={},o=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):o.push(t(i));return{formErrors:o,fieldErrors:n}}function ii(e,t=n=>n.message){const n={_errors:[]},o=i=>{for(const r of i.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(s=>o({issues:s}));else if(r.code==="invalid_key")o({issues:r.issues});else if(r.code==="invalid_element")o({issues:r.issues});else if(r.path.length===0)n._errors.push(t(r));else{let s=n,a=0;for(;a<r.path.length;){const c=r.path[a];a===r.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(r))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return o(e),n}const Xt=e=>(t,n,o,i)=>{const r=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new _e;if(s.issues.length){const a=new(i?.Err??e)(s.issues.map(c=>ae(c,r,re())));throw io(a,i?.callee),a}return s.value},Yt=e=>async(t,n,o,i)=>{const r=o?Object.assign(o,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(i?.Err??e)(s.issues.map(c=>ae(c,r,re())));throw io(a,i?.callee),a}return s.value},lt=e=>(t,n,o)=>{const i=o?{...o,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},i);if(r instanceof Promise)throw new _e;return r.issues.length?{success:!1,error:new(e??ao)(r.issues.map(s=>ae(s,i,re())))}:{success:!0,data:r.value}},si=lt(co),pt=e=>async(t,n,o)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(s=>ae(s,i,re())))}:{success:!0,data:r.value}},ri=pt(co),ai=e=>(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Xt(e)(t,n,i)},ci=e=>(t,n,o)=>Xt(e)(t,n,o),ui=e=>async(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Yt(e)(t,n,i)},di=e=>async(t,n,o)=>Yt(e)(t,n,o),li=e=>(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return lt(e)(t,n,i)},pi=e=>(t,n,o)=>lt(e)(t,n,o),hi=e=>async(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return pt(e)(t,n,i)},gi=e=>async(t,n,o)=>pt(e)(t,n,o),mi=/^[cC][^\s-]{8,}$/,fi=/^[0-9a-z]+$/,bi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wi=/^[0-9a-vA-V]{20}$/,vi=/^[A-Za-z0-9]{27}$/,yi=/^[a-zA-Z0-9_-]{21}$/,ki=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ei=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,un=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_i=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ci="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xi(){return new RegExp(Ci,"u")}const Si=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ii=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,zi=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ti=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,uo=/^[A-Za-z0-9_-]*$/,Ai=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Pi=/^\+(?:[0-9]){6,14}[0-9]$/,lo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Oi=new RegExp(`^${lo}$`);function po(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $i(e){return new RegExp(`^${po(e)}$`)}function Ri(e){const t=po({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${n.join("|")})`;return new RegExp(`^${lo}T(?:${o})$`)}const Ni=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Zi=/^-?\d+$/,Fi=/^-?\d+(?:\.\d+)?/,Ui=/^(?:true|false)$/i,Li=/^null$/i,Di=/^undefined$/i,Bi=/^[^A-Z]*$/,ji=/^[^a-z]*$/,Z=l("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ho={number:"number",bigint:"bigint",object:"date"},go=l("$ZodCheckLessThan",(e,t)=>{Z.init(e,t);const n=ho[typeof t.value];e._zod.onattach.push(o=>{const i=o._zod.bag,r=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),mo=l("$ZodCheckGreaterThan",(e,t)=>{Z.init(e,t);const n=ho[typeof t.value];e._zod.onattach.push(o=>{const i=o._zod.bag,r=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Gi=l("$ZodCheckMultipleOf",(e,t)=>{Z.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Ho(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Hi=l("$ZodCheckNumberFormat",(e,t)=>{Z.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),o=n?"int":"number",[i,r]=Ko[t.format];e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,a.minimum=i,a.maximum=r,n&&(a.pattern=Zi)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}}),Vi=l("$ZodCheckMaxLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!qt(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const i=o.value;if(i.length<=t.maximum)return;const s=Jt(i);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Wi=l("$ZodCheckMinLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!qt(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const i=o.value;if(i.length>=t.minimum)return;const s=Jt(i);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),qi=l("$ZodCheckLengthEquals",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!qt(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=o=>{const i=o.value,r=i.length;if(r===t.length)return;const s=Jt(i),a=r>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),ht=l("$ZodCheckStringFormat",(e,t)=>{var n,o;Z.init(e,t),e._zod.onattach.push(i=>{const r=i._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Ki=l("$ZodCheckRegex",(e,t)=>{ht.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ji=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bi),ht.init(e,t)}),Xi=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ji),ht.init(e,t)}),Yi=l("$ZodCheckIncludes",(e,t)=>{Z.init(e,t);const n=dt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(i=>{const r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Qi=l("$ZodCheckStartsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`^${dt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),es=l("$ZodCheckEndsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`.*${dt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),ts=l("$ZodCheckOverwrite",(e,t)=>{Z.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ns{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
6
+ `).filter(s=>s),i=Math.min(...o.map(s=>s.length-s.trimStart().length)),r=o.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of r)this.content.push(s)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(r=>` ${r}`)];return new t(...n,i.join(`
7
+ `))}}const os={major:4,minor:1,patch:12},I=l("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=os;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const i of o)for(const r of i._zod.onattach)r(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(s,a,c)=>{let u=ye(s),f;for(const b of a){if(b._zod.def.when){if(!b._zod.def.when(s))continue}else if(u)continue;const v=s.issues.length,k=b._zod.check(s);if(k instanceof Promise&&c?.async===!1)throw new _e;if(f||k instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await k,s.issues.length!==v&&(u||(u=ye(s,v)))});else{if(s.issues.length===v)continue;u||(u=ye(s,v))}}return f?f.then(()=>s):s},r=(s,a,c)=>{if(ye(s))return s.aborted=!0,s;const u=i(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new _e;return u.then(f=>e._zod.parse(f,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){const u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(f=>r(f,s,a)):r(u,s,a)}const c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new _e;return c.then(u=>i(u,o,a))}return i(c,o,a)}}e["~standard"]={validate:i=>{try{const r=si(e,i);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return ri(e,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Qt=l("$ZodString",(e,t)=>{I.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ni(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),z=l("$ZodStringFormat",(e,t)=>{ht.init(e,t),Qt.init(e,t)}),is=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ei),z.init(e,t)}),ss=l("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=un(o))}else t.pattern??(t.pattern=un());z.init(e,t)}),rs=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_i),z.init(e,t)}),as=l("$ZodURL",(e,t)=>{z.init(e,t),e._zod.check=n=>{try{const o=n.value.trim(),i=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Ai.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),cs=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=xi()),z.init(e,t)}),us=l("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=yi),z.init(e,t)}),ds=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=mi),z.init(e,t)}),ls=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fi),z.init(e,t)}),ps=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bi),z.init(e,t)}),hs=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wi),z.init(e,t)}),gs=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vi),z.init(e,t)}),ms=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ri(t)),z.init(e,t)}),fs=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Oi),z.init(e,t)}),bs=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$i(t)),z.init(e,t)}),ws=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ki),z.init(e,t)}),vs=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Si),z.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format="ipv4"})}),ys=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ii),z.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ks=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zi),z.init(e,t)}),Es=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ti),z.init(e,t),e._zod.check=n=>{const o=n.value.split("/");try{if(o.length!==2)throw new Error;const[i,r]=o;if(!r)throw new Error;const s=Number(r);if(`${s}`!==r)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fo(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const _s=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Mi),z.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{fo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Cs(e){if(!uo.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fo(n)}const xs=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=uo),z.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{Cs(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ss=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Pi),z.init(e,t)});function Is(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[o]=n;if(!o)return!1;const i=JSON.parse(atob(o));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const zs=l("$ZodJWT",(e,t)=>{z.init(e,t),e._zod.check=n=>{Is(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),bo=l("$ZodNumber",(e,t)=>{I.init(e,t),e._zod.pattern=e._zod.bag.pattern??Fi,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const r=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...r?{received:r}:{}}),n}}),Ts=l("$ZodNumber",(e,t)=>{Hi.init(e,t),bo.init(e,t)}),Ms=l("$ZodBoolean",(e,t)=>{I.init(e,t),e._zod.pattern=Ui,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),As=l("$ZodUndefined",(e,t)=>{I.init(e,t),e._zod.pattern=Di,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),Ps=l("$ZodNull",(e,t)=>{I.init(e,t),e._zod.pattern=Li,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),Os=l("$ZodAny",(e,t)=>{I.init(e,t),e._zod.parse=n=>n}),$s=l("$ZodUnknown",(e,t)=>{I.init(e,t),e._zod.parse=n=>n}),Rs=l("$ZodNever",(e,t)=>{I.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function dn(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}const Ns=l("$ZodArray",(e,t)=>{I.init(e,t),e._zod.parse=(n,o)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const r=[];for(let s=0;s<i.length;s++){const a=i[s],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?r.push(c.then(u=>dn(u,n,s))):dn(c,n,s)}return r.length?Promise.all(r).then(()=>n):n}});function it(e,t,n,o){e.issues.length&&t.issues.push(...ke(n,e.issues)),e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function wo(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=qo(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function vo(e,t,n,o,i,r){const s=[],a=i.keySet,c=i.catchall._zod,u=c.def.type;for(const f of Object.keys(t)){if(a.has(f))continue;if(u==="never"){s.push(f);continue}const b=c.run({value:t[f],issues:[]},o);b instanceof Promise?e.push(b.then(v=>it(v,n,f,t))):it(b,n,f,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then(()=>n):n}const Zs=l("$ZodObject",(e,t)=>{if(I.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const o=Wt(()=>wo(t));x(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const f=a[u]._zod;if(f.values){c[u]??(c[u]=new Set);for(const b of f.values)c[u].add(b)}}return c});const i=ot,r=t.catchall;let s;e._zod.parse=(a,c)=>{s??(s=o.value);const u=a.value;if(!i(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const f=[],b=s.shape;for(const v of s.keys){const C=b[v]._zod.run({value:u[v],issues:[]},c);C instanceof Promise?f.push(C.then(F=>it(F,a,v,u))):it(C,a,v,u)}return r?vo(f,u,a,c,o.value,e):f.length?Promise.all(f).then(()=>a):a}}),Fs=l("$ZodObjectJIT",(e,t)=>{Zs.init(e,t);const n=e._zod.parse,o=Wt(()=>wo(t)),i=v=>{const k=new ns(["shape","payload","ctx"]),C=o.value,F=H=>{const W=cn(H);return`shape[${W}]._zod.run({ value: input[${W}], issues: [] }, ctx)`};k.write("const input = payload.value;");const L=Object.create(null);let G=0;for(const H of C.keys)L[H]=`key_${G++}`;k.write("const newResult = {};");for(const H of C.keys){const W=L[H],Ae=cn(H);k.write(`const ${W} = ${F(H)};`),k.write(`
8
+ if (${W}.issues.length) {
9
+ payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
10
+ ...iss,
11
+ path: iss.path ? [${Ae}, ...iss.path] : [${Ae}]
12
+ })));
13
+ }
14
+
15
+
16
+ if (${W}.value === undefined) {
17
+ if (${Ae} in input) {
18
+ newResult[${Ae}] = undefined;
19
+ }
20
+ } else {
21
+ newResult[${Ae}] = ${W}.value;
22
+ }
23
+
24
+ `)}k.write("payload.value = newResult;"),k.write("return payload;");const le=k.compile();return(H,W)=>le(v,H,W)};let r;const s=ot,a=!oo.jitless,u=a&&Vo.value,f=t.catchall;let b;e._zod.parse=(v,k)=>{b??(b=o.value);const C=v.value;return s(C)?a&&u&&k?.async===!1&&k.jitless!==!0?(r||(r=i(t.shape)),v=r(v,k),f?vo([],C,v,k,b,e):v):n(v,k):(v.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),v)}});function ln(e,t,n,o){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const i=e.filter(r=>!ye(r));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(r=>r.issues.map(s=>ae(s,o,re())))}),t)}const Us=l("$ZodUnion",(e,t)=>{I.init(e,t),x(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),x(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),x(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),x(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>Kt(r.source)).join("|")})$`)}});const n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(i,r)=>{if(n)return o(i,r);let s=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(c=>ln(c,i,e,r)):ln(a,i,e,r)}}),Ls=l("$ZodIntersection",(e,t)=>{I.init(e,t),e._zod.parse=(n,o)=>{const i=n.value,r=t.left._zod.run({value:i,issues:[]},o),s=t.right._zod.run({value:i,issues:[]},o);return r instanceof Promise||s instanceof Promise?Promise.all([r,s]).then(([c,u])=>pn(n,c,u)):pn(n,r,s)}});function Ft(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Se(e)&&Se(t)){const n=Object.keys(t),o=Object.keys(e).filter(r=>n.indexOf(r)!==-1),i={...e,...t};for(const r of o){const s=Ft(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};i[r]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const i=e[o],r=t[o],s=Ft(i,r);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),ye(e))return e;const o=Ft(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Ds=l("$ZodRecord",(e,t)=>{I.init(e,t),e._zod.parse=(n,o)=>{const i=n.value;if(!Se(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const r=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){const u=t.valueType._zod.run({value:i[c],issues:[]},o);u instanceof Promise?r.push(u.then(f=>{f.issues.length&&n.issues.push(...ke(c,f.issues)),n.value[c]=f.value})):(u.issues.length&&n.issues.push(...ke(c,u.issues)),n.value[c]=u.value)}let a;for(const c in i)s.has(c)||(a=a??[],a.push(c));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(i)){if(s==="__proto__")continue;const a=t.keyType._zod.run({value:s,issues:[]},o);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(u=>ae(u,o,re())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:i[s],issues:[]},o);c instanceof Promise?r.push(c.then(u=>{u.issues.length&&n.issues.push(...ke(s,u.issues)),n.value[a.value]=u.value})):(c.issues.length&&n.issues.push(...ke(s,c.issues)),n.value[a.value]=c.value)}}return r.length?Promise.all(r).then(()=>n):n}}),Bs=l("$ZodEnum",(e,t)=>{I.init(e,t);const n=Go(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(i=>Wo.has(typeof i)).map(i=>typeof i=="string"?dt(i):i.toString()).join("|")})$`),e._zod.parse=(i,r)=>{const s=i.value;return o.has(s)||i.issues.push({code:"invalid_value",values:n,input:s,inst:e}),i}}),js=l("$ZodTransform",(e,t)=>{I.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new no(e.constructor.name);const i=t.transform(n.value,n);if(o.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(n.value=s,n));if(i instanceof Promise)throw new _e;return n.value=i,n}});function hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Gs=l("$ZodOptional",(e,t)=>{I.init(e,t),e._zod.optin="optional",e._zod.optout="optional",x(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),x(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Kt(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(r=>hn(r,n.value)):hn(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Hs=l("$ZodNullable",(e,t)=>{I.init(e,t),x(e._zod,"optin",()=>t.innerType._zod.optin),x(e._zod,"optout",()=>t.innerType._zod.optout),x(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Kt(n.source)}|null)$`):void 0}),x(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),Vs=l("$ZodDefault",(e,t)=>{I.init(e,t),e._zod.optin="optional",x(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(r=>gn(r,t)):gn(i,t)}});function gn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ws=l("$ZodPrefault",(e,t)=>{I.init(e,t),e._zod.optin="optional",x(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),qs=l("$ZodNonOptional",(e,t)=>{I.init(e,t),x(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(r=>mn(r,e)):mn(i,e)}});function mn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ks=l("$ZodCatch",(e,t)=>{I.init(e,t),x(e._zod,"optin",()=>t.innerType._zod.optin),x(e._zod,"optout",()=>t.innerType._zod.optout),x(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(r=>(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(s=>ae(s,o,re()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(r=>ae(r,o,re()))},input:n.value}),n.issues=[]),n)}}),Js=l("$ZodPipe",(e,t)=>{I.init(e,t),x(e._zod,"values",()=>t.in._zod.values),x(e._zod,"optin",()=>t.in._zod.optin),x(e._zod,"optout",()=>t.out._zod.optout),x(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){const r=t.out._zod.run(n,o);return r instanceof Promise?r.then(s=>We(s,t.in,o)):We(r,t.in,o)}const i=t.in._zod.run(n,o);return i instanceof Promise?i.then(r=>We(r,t.out,o)):We(i,t.out,o)}});function We(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Xs=l("$ZodReadonly",(e,t)=>{I.init(e,t),x(e._zod,"propValues",()=>t.innerType._zod.propValues),x(e._zod,"values",()=>t.innerType._zod.values),x(e._zod,"optin",()=>t.innerType._zod.optin),x(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(fn):fn(i)}});function fn(e){return e.value=Object.freeze(e.value),e}const Ys=l("$ZodCustom",(e,t)=>{Z.init(e,t),I.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{const o=n.value,i=t.fn(o);if(i instanceof Promise)return i.then(r=>bn(r,n,o,e));bn(i,n,o,e)}});function bn(e,t,n,o){if(!e){const i={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(i.params=o._zod.def.params),t.issues.push(Be(i))}}class Qs{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const o=n[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const o={...this.get(n)??{}};delete o.id;const i={...o,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function er(){return new Qs}const qe=er();function tr(e,t){return new e({type:"string",...w(t)})}function nr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...w(t)})}function wn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...w(t)})}function or(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...w(t)})}function ir(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...w(t)})}function sr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...w(t)})}function rr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(t)})}function ar(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...w(t)})}function cr(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...w(t)})}function ur(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(t)})}function dr(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...w(t)})}function lr(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(t)})}function pr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...w(t)})}function hr(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...w(t)})}function gr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(t)})}function mr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(t)})}function fr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(t)})}function br(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(t)})}function wr(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(t)})}function vr(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...w(t)})}function yr(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...w(t)})}function kr(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...w(t)})}function Er(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...w(t)})}function _r(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(t)})}function Cr(e,t){return new e({type:"string",format:"date",check:"string_format",...w(t)})}function xr(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...w(t)})}function Sr(e,t){return new e({type:"string",format:"duration",check:"string_format",...w(t)})}function Ir(e,t){return new e({type:"number",checks:[],...w(t)})}function zr(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...w(t)})}function Tr(e,t){return new e({type:"boolean",...w(t)})}function Mr(e,t){return new e({type:"undefined",...w(t)})}function Ar(e,t){return new e({type:"null",...w(t)})}function Pr(e){return new e({type:"any"})}function Or(e){return new e({type:"unknown"})}function $r(e,t){return new e({type:"never",...w(t)})}function vn(e,t){return new go({check:"less_than",...w(t),value:e,inclusive:!1})}function ft(e,t){return new go({check:"less_than",...w(t),value:e,inclusive:!0})}function yn(e,t){return new mo({check:"greater_than",...w(t),value:e,inclusive:!1})}function bt(e,t){return new mo({check:"greater_than",...w(t),value:e,inclusive:!0})}function kn(e,t){return new Gi({check:"multiple_of",...w(t),value:e})}function yo(e,t){return new Vi({check:"max_length",...w(t),maximum:e})}function st(e,t){return new Wi({check:"min_length",...w(t),minimum:e})}function ko(e,t){return new qi({check:"length_equals",...w(t),length:e})}function Rr(e,t){return new Ki({check:"string_format",format:"regex",...w(t),pattern:e})}function Nr(e){return new Ji({check:"string_format",format:"lowercase",...w(e)})}function Zr(e){return new Xi({check:"string_format",format:"uppercase",...w(e)})}function Fr(e,t){return new Yi({check:"string_format",format:"includes",...w(t),includes:e})}function Ur(e,t){return new Qi({check:"string_format",format:"starts_with",...w(t),prefix:e})}function Lr(e,t){return new es({check:"string_format",format:"ends_with",...w(t),suffix:e})}function Ge(e){return new ts({check:"overwrite",tx:e})}function Dr(e){return Ge(t=>t.normalize(e))}function Br(){return Ge(e=>e.trim())}function jr(){return Ge(e=>e.toLowerCase())}function Gr(){return Ge(e=>e.toUpperCase())}function Hr(e,t,n){return new e({type:"array",element:t,...w(n)})}function Vr(e,t,n){return new e({type:"custom",check:"custom",fn:t,...w(n)})}function Wr(e){const t=qr(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Be(o,n.value,t._zod.def));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Be(i))}},e(n.value,n)));return t}function qr(e,t){const n=new Z({check:"custom",...w(t)});return n._zod.check=e,n}const Kr=l("ZodISODateTime",(e,t)=>{ms.init(e,t),M.init(e,t)});function Jr(e){return _r(Kr,e)}const Xr=l("ZodISODate",(e,t)=>{fs.init(e,t),M.init(e,t)});function Yr(e){return Cr(Xr,e)}const Qr=l("ZodISOTime",(e,t)=>{bs.init(e,t),M.init(e,t)});function ea(e){return xr(Qr,e)}const ta=l("ZodISODuration",(e,t)=>{ws.init(e,t),M.init(e,t)});function na(e){return Sr(ta,e)}const oa=(e,t)=>{ao.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ii(e,n)},flatten:{value:n=>oi(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Zt,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Zt,2)}},isEmpty:{get(){return e.issues.length===0}}})},j=l("ZodError",oa,{Parent:Error}),ia=Xt(j),sa=Yt(j),ra=lt(j),aa=pt(j),ca=ai(j),ua=ci(j),da=ui(j),la=di(j),pa=li(j),ha=pi(j),ga=hi(j),ma=gi(j),T=l("ZodType",(e,t)=>(I.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(fe(t,{checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(n,o)=>ue(e,n,o),e.brand=()=>e,e.register=(n,o)=>(n.add(e,o),e),e.parse=(n,o)=>ia(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>ra(e,n,o),e.parseAsync=async(n,o)=>sa(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>aa(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>ca(e,n,o),e.decode=(n,o)=>ua(e,n,o),e.encodeAsync=async(n,o)=>da(e,n,o),e.decodeAsync=async(n,o)=>la(e,n,o),e.safeEncode=(n,o)=>pa(e,n,o),e.safeDecode=(n,o)=>ha(e,n,o),e.safeEncodeAsync=async(n,o)=>ga(e,n,o),e.safeDecodeAsync=async(n,o)=>ma(e,n,o),e.refine=(n,o)=>e.check(lc(n,o)),e.superRefine=n=>e.check(pc(n)),e.overwrite=n=>e.check(Ge(n)),e.optional=()=>xn(e),e.nullable=()=>Sn(e),e.nullish=()=>xn(Sn(e)),e.nonoptional=n=>ic(e,n),e.array=()=>Q(e),e.or=n=>en([e,n]),e.and=n=>qa(e,n),e.transform=n=>In(e,Ya(n)),e.default=n=>tc(e,n),e.prefault=n=>oc(e,n),e.catch=n=>rc(e,n),e.pipe=n=>In(e,n),e.readonly=()=>uc(e),e.describe=n=>{const o=e.clone();return qe.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return qe.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return qe.get(e);const o=e.clone();return qe.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Eo=l("_ZodString",(e,t)=>{Qt.init(e,t),T.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Rr(...o)),e.includes=(...o)=>e.check(Fr(...o)),e.startsWith=(...o)=>e.check(Ur(...o)),e.endsWith=(...o)=>e.check(Lr(...o)),e.min=(...o)=>e.check(st(...o)),e.max=(...o)=>e.check(yo(...o)),e.length=(...o)=>e.check(ko(...o)),e.nonempty=(...o)=>e.check(st(1,...o)),e.lowercase=o=>e.check(Nr(o)),e.uppercase=o=>e.check(Zr(o)),e.trim=()=>e.check(Br()),e.normalize=(...o)=>e.check(Dr(...o)),e.toLowerCase=()=>e.check(jr()),e.toUpperCase=()=>e.check(Gr())}),fa=l("ZodString",(e,t)=>{Qt.init(e,t),Eo.init(e,t),e.email=n=>e.check(nr(ba,n)),e.url=n=>e.check(ar(wa,n)),e.jwt=n=>e.check(Er(Oa,n)),e.emoji=n=>e.check(cr(va,n)),e.guid=n=>e.check(wn(En,n)),e.uuid=n=>e.check(or(Ke,n)),e.uuidv4=n=>e.check(ir(Ke,n)),e.uuidv6=n=>e.check(sr(Ke,n)),e.uuidv7=n=>e.check(rr(Ke,n)),e.nanoid=n=>e.check(ur(ya,n)),e.guid=n=>e.check(wn(En,n)),e.cuid=n=>e.check(dr(ka,n)),e.cuid2=n=>e.check(lr(Ea,n)),e.ulid=n=>e.check(pr(_a,n)),e.base64=n=>e.check(vr(Ma,n)),e.base64url=n=>e.check(yr(Aa,n)),e.xid=n=>e.check(hr(Ca,n)),e.ksuid=n=>e.check(gr(xa,n)),e.ipv4=n=>e.check(mr(Sa,n)),e.ipv6=n=>e.check(fr(Ia,n)),e.cidrv4=n=>e.check(br(za,n)),e.cidrv6=n=>e.check(wr(Ta,n)),e.e164=n=>e.check(kr(Pa,n)),e.datetime=n=>e.check(Jr(n)),e.date=n=>e.check(Yr(n)),e.time=n=>e.check(ea(n)),e.duration=n=>e.check(na(n))});function O(e){return tr(fa,e)}const M=l("ZodStringFormat",(e,t)=>{z.init(e,t),Eo.init(e,t)}),ba=l("ZodEmail",(e,t)=>{rs.init(e,t),M.init(e,t)}),En=l("ZodGUID",(e,t)=>{is.init(e,t),M.init(e,t)}),Ke=l("ZodUUID",(e,t)=>{ss.init(e,t),M.init(e,t)}),wa=l("ZodURL",(e,t)=>{as.init(e,t),M.init(e,t)}),va=l("ZodEmoji",(e,t)=>{cs.init(e,t),M.init(e,t)}),ya=l("ZodNanoID",(e,t)=>{us.init(e,t),M.init(e,t)}),ka=l("ZodCUID",(e,t)=>{ds.init(e,t),M.init(e,t)}),Ea=l("ZodCUID2",(e,t)=>{ls.init(e,t),M.init(e,t)}),_a=l("ZodULID",(e,t)=>{ps.init(e,t),M.init(e,t)}),Ca=l("ZodXID",(e,t)=>{hs.init(e,t),M.init(e,t)}),xa=l("ZodKSUID",(e,t)=>{gs.init(e,t),M.init(e,t)}),Sa=l("ZodIPv4",(e,t)=>{vs.init(e,t),M.init(e,t)}),Ia=l("ZodIPv6",(e,t)=>{ys.init(e,t),M.init(e,t)}),za=l("ZodCIDRv4",(e,t)=>{ks.init(e,t),M.init(e,t)}),Ta=l("ZodCIDRv6",(e,t)=>{Es.init(e,t),M.init(e,t)}),Ma=l("ZodBase64",(e,t)=>{_s.init(e,t),M.init(e,t)}),Aa=l("ZodBase64URL",(e,t)=>{xs.init(e,t),M.init(e,t)}),Pa=l("ZodE164",(e,t)=>{Ss.init(e,t),M.init(e,t)}),Oa=l("ZodJWT",(e,t)=>{zs.init(e,t),M.init(e,t)}),_o=l("ZodNumber",(e,t)=>{bo.init(e,t),T.init(e,t),e.gt=(o,i)=>e.check(yn(o,i)),e.gte=(o,i)=>e.check(bt(o,i)),e.min=(o,i)=>e.check(bt(o,i)),e.lt=(o,i)=>e.check(vn(o,i)),e.lte=(o,i)=>e.check(ft(o,i)),e.max=(o,i)=>e.check(ft(o,i)),e.int=o=>e.check(_n(o)),e.safe=o=>e.check(_n(o)),e.positive=o=>e.check(yn(0,o)),e.nonnegative=o=>e.check(bt(0,o)),e.negative=o=>e.check(vn(0,o)),e.nonpositive=o=>e.check(ft(0,o)),e.multipleOf=(o,i)=>e.check(kn(o,i)),e.step=(o,i)=>e.check(kn(o,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function S(e){return Ir(_o,e)}const $a=l("ZodNumberFormat",(e,t)=>{Ts.init(e,t),_o.init(e,t)});function _n(e){return zr($a,e)}const Ra=l("ZodBoolean",(e,t)=>{Ms.init(e,t),T.init(e,t)});function X(e){return Tr(Ra,e)}const Na=l("ZodUndefined",(e,t)=>{As.init(e,t),T.init(e,t)});function Za(e){return Mr(Na,e)}const Fa=l("ZodNull",(e,t)=>{Ps.init(e,t),T.init(e,t)});function Ua(e){return Ar(Fa,e)}const La=l("ZodAny",(e,t)=>{Os.init(e,t),T.init(e,t)});function Cn(){return Pr(La)}const Da=l("ZodUnknown",(e,t)=>{$s.init(e,t),T.init(e,t)});function ce(){return Or(Da)}const Ba=l("ZodNever",(e,t)=>{Rs.init(e,t),T.init(e,t)});function ja(e){return $r(Ba,e)}const Ga=l("ZodArray",(e,t)=>{Ns.init(e,t),T.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(st(n,o)),e.nonempty=n=>e.check(st(1,n)),e.max=(n,o)=>e.check(yo(n,o)),e.length=(n,o)=>e.check(ko(n,o)),e.unwrap=()=>e.element});function Q(e,t){return Hr(Ga,e,t)}const Ha=l("ZodObject",(e,t)=>{Fs.init(e,t),T.init(e,t),x(e,"shape",()=>t.shape),e.keyof=()=>He(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ce()}),e.loose=()=>e.clone({...e._zod.def,catchall:ce()}),e.strict=()=>e.clone({...e._zod.def,catchall:ja()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Yo(e,n),e.safeExtend=n=>Qo(e,n),e.merge=n=>ei(e,n),e.pick=n=>Jo(e,n),e.omit=n=>Xo(e,n),e.partial=(...n)=>ti(Co,e,n[0]),e.required=(...n)=>ni(xo,e,n[0])});function _(e,t){const n={type:"object",shape:e??{},...w(t)};return new Ha(n)}const Va=l("ZodUnion",(e,t)=>{Us.init(e,t),T.init(e,t),e.options=t.options});function en(e,t){return new Va({type:"union",options:e,...w(t)})}const Wa=l("ZodIntersection",(e,t)=>{Ls.init(e,t),T.init(e,t)});function qa(e,t){return new Wa({type:"intersection",left:e,right:t})}const Ka=l("ZodRecord",(e,t)=>{Ds.init(e,t),T.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ja(e,t,n){return new Ka({type:"record",keyType:e,valueType:t,...w(n)})}const Ut=l("ZodEnum",(e,t)=>{Bs.init(e,t),T.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(o,i)=>{const r={};for(const s of o)if(n.has(s))r[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Ut({...t,checks:[],...w(i),entries:r})},e.exclude=(o,i)=>{const r={...t.entries};for(const s of o)if(n.has(s))delete r[s];else throw new Error(`Key ${s} not found in enum`);return new Ut({...t,checks:[],...w(i),entries:r})}});function He(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Ut({type:"enum",entries:n,...w(t)})}const Xa=l("ZodTransform",(e,t)=>{js.init(e,t),T.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new no(e.constructor.name);n.addIssue=r=>{if(typeof r=="string")n.issues.push(Be(r,n.value,t));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(Be(s))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(r=>(n.value=r,n)):(n.value=i,n)}});function Ya(e){return new Xa({type:"transform",transform:e})}const Co=l("ZodOptional",(e,t)=>{Gs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xn(e){return new Co({type:"optional",innerType:e})}const Qa=l("ZodNullable",(e,t)=>{Hs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Sn(e){return new Qa({type:"nullable",innerType:e})}const ec=l("ZodDefault",(e,t)=>{Vs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tc(e,t){return new ec({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():so(t)}})}const nc=l("ZodPrefault",(e,t)=>{Ws.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function oc(e,t){return new nc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():so(t)}})}const xo=l("ZodNonOptional",(e,t)=>{qs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ic(e,t){return new xo({type:"nonoptional",innerType:e,...w(t)})}const sc=l("ZodCatch",(e,t)=>{Ks.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rc(e,t){return new sc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ac=l("ZodPipe",(e,t)=>{Js.init(e,t),T.init(e,t),e.in=t.in,e.out=t.out});function In(e,t){return new ac({type:"pipe",in:e,out:t})}const cc=l("ZodReadonly",(e,t)=>{Xs.init(e,t),T.init(e,t),e.unwrap=()=>e._zod.def.innerType});function uc(e){return new cc({type:"readonly",innerType:e})}const dc=l("ZodCustom",(e,t)=>{Ys.init(e,t),T.init(e,t)});function lc(e,t={}){return Vr(dc,e,t)}function pc(e){return Wr(e)}const Pe=en([Za(),Ua()]),ge=_({base:S(),multiplier:S()}),hc=_({fastPlay:X().optional(),sounds:X().optional(),music:X().optional()}).refine(e=>Object.values(e).some(t=>t!==void 0),{message:"Object must have at least one property defined"}),gc=_({source:He(["realityCheck","settings","casino"])}),mc=_({type:He(["ON_DEMAND","BALANCE_LOW","BALANCE_INSUFFICIENT"])}),fc=_({action:He(["start","stop","pause","resume"])}),bc=_({progress:S().min(0).max(100)}),wc=_({lock:O().optional()}),So=_({conf:_({base:S(),multiplier:S(),numAwarded:S()}),data:_({numPlayed:S(),win:S(),numLeft:S()}),id:O(),rejectable:X(),skippable:X(),status:He(["PENDING","ACTIVE","FINISHED"]),type:O()}),vc=_({contract:_({bet:_({available:Ja(en([O(),S()]),Q(S())),default:ge,max:S().nullable(),last:ge.nullable(),lastPaid:ge.nullable()}),balance:_({coins:S(),version:S()}),freeRounds:Q(So),gameModel:O(),metaData:_({rtpValues:Q(_({key:O(),rtpValue:O()})),maxWin:Q(_({key:O(),maxWinValueXBet:S(),maxWinOdds:S()})),version:O()}),roundId:O().optional(),serverTime:S(),sessionId:O(),stateType:_({thisRound:O(),nextRound:O()}),uiMessages:Q(ce()),win:_({max:S().nullable(),round:S(),total:S()})}),data:ce()}),wt=_({contract:_({bet:_({last:ge.nullable(),lastPaid:ge}),balance:_({coins:S(),version:S()}),freeRounds:Q(So),roundId:O(),serverTime:S(),stateType:_({thisRound:O(),nextRound:O()}),uiMessages:Q(ce()),win:_({round:S(),total:S()})}),data:ce()}),Lt=_({bet:ge.nullable(),forcedOutcomes:ce().optional()}).passthrough(),yc=_({contract:Lt,extra:ce().optional()}),kc=_({dataDecoder:Cn().optional(),dataEncoder:Cn().optional(),gameName:O().optional(),gameVersion:O().optional(),gameHistoryUrl:O().optional(),showFreeRounds:X().optional(),showPromoPanel:X().optional(),showRealityCheck:X().optional(),showErrors:X().optional(),showBars:X().optional(),skipErrors:Q(O()).optional()}).passthrough(),Ec={configure:kc,openGame:Pe,loadStart:Pe,loadEnd:Pe,playReady:Pe,bet:ge,play:yc,playCycleStart:Lt,playCycleEnd:wt,playStart:Lt,playEnd:wt,history:gc,close:Pe,cashier:mc,fullscreen:wc,autoplay:fc,loadProgress:bc,settings:hc,openGameResponse:vc,playResponse:wt};function _c(e){return Ec[e]}function Cc(e){return e.issues.map(t=>`[${t.path.length>0?t.path.join("."):"root"}] ${t.message}`).join(`
25
+ `)}class xc{#o;#e;#t;#i;#n;#c;#s;#r;#a=[];#l=new Map;#u=!1;#d={x:0,y:0};constructor(t,n){this.#n=t,this.#c=n,this.#f(),this.#o=this.#b(),this.#s=this.#w(),this.#r=this.#v(),this.#i=this.#y(),this.#e=this.#k(),this.#C(),this.#x()}#f(){const t="dbg-plugin-styles";if(!document.getElementById(t)){const n=document.createElement("style");n.id=t,n.textContent=`
26
+ .dbg-toggle {
27
+ position: fixed; top: 3px; left: 50%; transform: translateX(-50%); z-index: 10000;
28
+ background: #111827; color: #fff; border: 1px solid #1f2937;
29
+ border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer;
30
+ box-shadow: 0 2px 8px rgba(0,0,0,.15);
31
+ transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
32
+ }
33
+ .dbg-toggle:hover { background: #0b1220; box-shadow: 0 4px 12px rgba(0,0,0,.2); transform: translate(-50%, -1px); }
34
+
35
+ .dbg-popup {
36
+ position: absolute; top: 10px; left: 10px; z-index: 9999;
37
+ background: #ffffff; border: 1px solid #E5E7EB; border-radius: 10px;
38
+ box-shadow: 0 10px 30px rgba(0,0,0,.12);
39
+ display: flex; flex-direction: column;
40
+ width: min(800px, 95vw); height: min(650px, 95vh);
41
+ min-width: min(400px, 95vw); min-height: min(400px, 95vh);
42
+ max-width: 95vw; max-height: 95vh;
43
+ overflow: hidden; resize: both;
44
+ container-type: inline-size;
45
+ }
46
+ .dbg-drag-handle {
47
+ background: #F9FAFB; border-bottom: 1px solid #E5E7EB;
48
+ padding: 8px 16px; cursor: move; user-select: none;
49
+ -webkit-user-select: none; touch-action: none;
50
+ border-radius: 10px 10px 0 0;
51
+ display: flex; align-items: center; justify-content: space-between;
52
+ color: #6B7280; font-size: 11px; font-weight: 600;
53
+ letter-spacing: 0.05em; text-transform: uppercase;
54
+ }
55
+ .dbg-drag-handle:hover { background: #F3F4F6; }
56
+ .dbg-drag-handle.dragging { cursor: grabbing; background: #E5E7EB; }
57
+ .dbg-drag-title { display: flex; align-items: center; gap: 8px; }
58
+ .dbg-popup-content {
59
+ display: flex; flex-direction: row; gap: 16px; padding: 16px;
60
+ flex: 1; overflow-y: auto; overflow-x: hidden;
61
+ }
62
+ @container (max-width: 700px) {
63
+ .dbg-popup-content {
64
+ flex-direction: column;
65
+ }
66
+ .dbg-sections {
67
+ max-width: 100% !important;
68
+ min-width: 100%;
69
+ }
70
+ .dbg-logs-panel {
71
+ max-width: 100% !important;
72
+ min-width: 100%;
73
+ }
74
+ .dbg-event-checks {
75
+ min-height: 100px;
76
+ }
77
+ }
78
+ .dbg-close {
79
+ width: 24px; height: 24px; flex-shrink: 0;
80
+ background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer;
81
+ color: #6B7280; font-size: 14px; font-weight: 600; line-height: 1;
82
+ display: flex; align-items: center; justify-content: center;
83
+ transition: background .15s ease, border-color .15s ease, color .15s ease;
84
+ }
85
+ .dbg-close:hover { background: #E5E7EB; border-color: #D1D5DB; color: #374151; }
86
+
87
+ .dbg-sections {
88
+ display: flex; flex-direction: column; gap: 12px; flex-shrink: 0;
89
+ min-width: 260px; max-width: 260px;
90
+ }
91
+ .dbg-logs-panel {
92
+ display: flex; flex-direction: column; gap: 8px;
93
+ min-width: 350px; max-width: 550px; flex: 1;
94
+ min-height: 0;
95
+ }
96
+ .dbg-logs-header { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
97
+ .dbg-logs-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6B7280; }
98
+ .dbg-logs-actions { display: flex; gap: 6px; }
99
+ .dbg-filter-container { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
100
+ .dbg-filter-input {
101
+ flex: 1; padding: 6px 8px; font-size: 12px; border: 1px solid #E5E7EB;
102
+ border-radius: 4px; background: #F9FAFB; color: #111827;
103
+ transition: border-color .15s ease, background .15s ease;
104
+ }
105
+ .dbg-filter-input:focus { outline: none; border-color: #93C5FD; background: #ffffff; }
106
+ .dbg-filter-input::placeholder { color: #9CA3AF; }
107
+ .dbg-logs-btn {
108
+ padding: 4px 8px; font-size: 11px; background: #F3F4F6; border: 1px solid #E5E7EB;
109
+ border-radius: 4px; cursor: pointer; color: #374151; transition: background .15s ease;
110
+ }
111
+ .dbg-logs-btn:hover { background: #E5E7EB; }
112
+ .dbg-logs-container {
113
+ width: 100%; height: 200px; min-height: 60px; resize: vertical;
114
+ font-family: 'Monaco', 'Menlo', monospace;
115
+ font-size: 11px; line-height: 1.4; padding: 8px; border: 1px solid #E5E7EB;
116
+ border-radius: 6px; background: #F9FAFB; color: #111827; overflow-y: auto;
117
+ text-align: left;
118
+ }
119
+ .dbg-logs-container:focus-within { outline: 2px solid #93C5FD; outline-offset: -1px; }
120
+ .dbg-log-header {
121
+ display: flex; align-items: center; gap: 6px; cursor: pointer;
122
+ user-select: none; color: #111827;
123
+ }
124
+ .dbg-log-header:hover { color: #3B82F6; }
125
+ .dbg-log-toggle {
126
+ display: inline-block; width: 14px; text-align: center;
127
+ font-weight: bold; color: #6B7280; flex-shrink: 0; font-size: 13px;
128
+ }
129
+ .dbg-log-timestamp { color: #6B7280; }
130
+ .dbg-log-name { font-weight: 600; }
131
+ .dbg-log-payload {
132
+ margin-top: 4px; padding-left: 0; color: #374151;
133
+ white-space: pre; word-wrap: break-word; text-align: left;
134
+ }
135
+ .dbg-log-payload.collapsed { display: none; }
136
+ .dbg-log-entry.validation-error {
137
+ border-left: 3px solid #d32f2f; background: #fdecea;
138
+ padding-left: 8px; margin-left: -8px;
139
+ }
140
+ .dbg-log-error-message {
141
+ font-family: 'Monaco', 'Menlo', monospace;
142
+ color: #c62828; white-space: pre-wrap; margin-top: 4px;
143
+ font-size: 10px; padding: 4px 0;
144
+ }
145
+ .dbg-section { min-height: 100px; }
146
+ .dbg-section.event-checks-section {
147
+ display: flex; flex-direction: column;
148
+ flex: 1; min-height: 100px;
149
+ }
150
+ .dbg-section-title {
151
+ font-size: 12px; font-weight: 700; text-transform: uppercase;
152
+ letter-spacing: .06em; color: #6B7280; margin: 0 0 8px 0;
153
+ text-align: left;
154
+ }
155
+ .dbg-buttons {
156
+ display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px;
157
+ }
158
+ .dbg-button {
159
+ appearance: none; padding: 6px 10px; font-size: 12px; line-height: 1.1;
160
+ border-radius: 6px; border: 1px solid transparent; cursor: pointer;
161
+ transition: background .15s ease, transform .1s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
162
+ box-shadow: 0 1px 0 rgba(0,0,0,.02);
163
+ }
164
+ .dbg-button:hover { transform: translateY(-1px); }
165
+
166
+ /* Color variants: primary (blue), success (green), warning (yellow), danger (red), neutral (gray) */
167
+ .dbg-button.is-primary { background: #DBEAFE; border-color: #93C5FD; color: #1D4ED8; }
168
+ .dbg-button.is-primary:hover { background: #BFDBFE; }
169
+
170
+ .dbg-button.is-success { background: #DCFCE7; border-color: #86EFAC; color: #166534; }
171
+ .dbg-button.is-success:hover { background: #BBF7D0; }
172
+
173
+ .dbg-button.is-warning { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
174
+ .dbg-button.is-warning:hover { background: #FDE68A; }
175
+
176
+ .dbg-button.is-danger { background: #FEE2E2; border-color: #FCA5A5; color: #991B1B; }
177
+ .dbg-button.is-danger:hover { background: #FCA5A5; }
178
+
179
+ .dbg-button.is-neutral { background: #F3F4F6; border-color: #E5E7EB; color: #111827; }
180
+ .dbg-button.is-neutral:hover { background: #E5E7EB; }
181
+
182
+ .dbg-separator { height: 1px; background: #E5E7EB; margin: 10px 0 4px; border: 0; }
183
+ .dbg-event-checks {
184
+ display: flex; flex-direction: column; gap: 10px;
185
+ flex: 1; overflow-y: auto;
186
+ padding-right: 4px;
187
+ min-height: 100px;
188
+ }
189
+ .dbg-event-group { display: flex; flex-direction: column; gap: 4px; }
190
+ .dbg-event-group-title {
191
+ font-size: 10px; font-weight: 600; text-transform: uppercase;
192
+ letter-spacing: 0.05em; display: flex; align-items: center; gap: 6px;
193
+ margin: 1em 0;
194
+ }
195
+ .dbg-event-group-title .dbg-event-indicator {
196
+ width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
197
+ }
198
+ .dbg-event-group-title.required { color: #991B1B; }
199
+ .dbg-event-group-title.required .dbg-event-indicator { background: #DC2626; }
200
+ .dbg-event-group-title.nice-to-have { color: #92400E; }
201
+ .dbg-event-group-title.nice-to-have .dbg-event-indicator { background: #F59E0B; }
202
+ .dbg-event-group-title.optional { color: #6B7280; }
203
+ .dbg-event-group-title.optional .dbg-event-indicator { background: #9CA3AF; }
204
+ .dbg-event-group-items {
205
+ display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
206
+ }
207
+ .dbg-event-checks::-webkit-scrollbar { width: 6px; }
208
+ .dbg-event-checks::-webkit-scrollbar-track { background: #F3F4F6; border-radius: 3px; }
209
+ .dbg-event-checks::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
210
+ .dbg-event-checks::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }
211
+ .dbg-event-item {
212
+ display: flex; align-items: center; gap: 5px; padding: 4px 6px;
213
+ border-radius: 4px; font-size: 10px; font-family: 'Monaco', 'Menlo', monospace;
214
+ transition: background .15s ease, color .15s ease;
215
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
216
+ cursor: default;
217
+ }
218
+ .dbg-event-item .dbg-event-indicator {
219
+ width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
220
+ transition: background .2s ease;
221
+ }
222
+ /* Required - red when pending, green when received */
223
+ .dbg-event-item.required.pending { color: #991B1B; }
224
+ .dbg-event-item.required.pending .dbg-event-indicator { background: #DC2626; }
225
+ .dbg-event-item.required.received { color: #166534; }
226
+ .dbg-event-item.required.received .dbg-event-indicator { background: #16A34A; }
227
+ /* Nice to have - yellow when pending, green when received */
228
+ .dbg-event-item.nice-to-have.pending { color: #92400E; }
229
+ .dbg-event-item.nice-to-have.pending .dbg-event-indicator { background: #F59E0B; }
230
+ .dbg-event-item.nice-to-have.received { color: #166534; }
231
+ .dbg-event-item.nice-to-have.received .dbg-event-indicator { background: #16A34A; }
232
+ /* Optional - gray when pending, green when received */
233
+ .dbg-event-item.optional.pending { color: #6B7280; }
234
+ .dbg-event-item.optional.pending .dbg-event-indicator { background: #9CA3AF; }
235
+ .dbg-event-item.optional.received { color: #166534; }
236
+ .dbg-event-item.optional.received .dbg-event-indicator { background: #16A34A; }
237
+ `,document.head.appendChild(n)}}#b(){const t=document.createElement("button");return t.textContent="DEBUG",t.className="dbg-toggle",t}#w(){const t=document.createElement("div");return t.className="dbg-logs-container",t}#v(){const t=document.createElement("input");return t.type="text",t.className="dbg-filter-input",t.placeholder="Filter by event name...",t}#y(){const t=document.createElement("button");return t.innerHTML="×",t.className="dbg-close",t.title="Close debug panel",t}#k(){const t=document.createElement("div");t.className="dbg-popup",t.style.display="none",this.#t=document.createElement("div"),this.#t.className="dbg-drag-handle";const n=document.createElement("div");n.className="dbg-drag-title",n.innerHTML="<span>⋮⋮</span> <span>Debug Panel</span>",this.#t.appendChild(n),this.#t.appendChild(this.#i),t.appendChild(this.#t);const o=document.createElement("div");o.className="dbg-popup-content",t.appendChild(o);const i=document.createElement("div");i.className="dbg-sections",o.appendChild(i);const r=[{title:"Game",items:[{text:"Freeze",action:()=>this.#n("freeze"),variant:"neutral"},{text:"Unfreeze",action:()=>this.#n("unfreeze"),variant:"neutral"},{text:"Suspend",action:()=>this.#n("suspend"),variant:"neutral"},{text:"Resume",action:()=>this.#n("resume"),variant:"neutral"}]},{title:"Help",items:[{text:"Show Help",action:()=>this.#n("help",{show:!0}),variant:"success"},{text:"Hide Help",action:()=>this.#n("help",{show:!1}),variant:"danger"},{text:"Toggle Help",action:()=>this.#n("help"),variant:"primary"}]},{title:"Paytable (Optional)",items:[{text:"Show Paytable",action:()=>this.#n("paytable",{show:!0}),variant:"success"},{text:"Hide Paytable",action:()=>this.#n("paytable",{show:!1}),variant:"danger"},{text:"Toggle Paytable",action:()=>this.#n("paytable"),variant:"primary"}]},{title:"Audio Settings",items:[{text:"Enable Sounds",action:()=>this.#n("settings",{sounds:!0}),variant:"success"},{text:"Disable Sounds",action:()=>this.#n("settings",{sounds:!1}),variant:"danger"},{text:"Enable Music",action:()=>this.#n("settings",{music:!0}),variant:"success"},{text:"Disable Music",action:()=>this.#n("settings",{music:!1}),variant:"danger"}]}];this.#E(r,i);const s=document.createElement("div");s.className="dbg-logs-panel";const a=document.createElement("div");a.className="dbg-logs-header";const c=document.createElement("div");c.className="dbg-logs-title",c.textContent="Event Logs",a.appendChild(c);const u=document.createElement("div");u.className="dbg-logs-actions";const f=document.createElement("button");f.textContent="Clear",f.className="dbg-button is-warning",f.addEventListener("click",()=>this.#z()),u.appendChild(f);const b=document.createElement("button");b.textContent="Copy",b.className="dbg-logs-btn",b.addEventListener("click",()=>this.#M()),u.appendChild(b),a.appendChild(u),s.appendChild(a);const v=document.createElement("div");return v.className="dbg-filter-container",v.appendChild(this.#r),s.appendChild(v),s.appendChild(this.#s),this.#_(s),o.appendChild(s),t}#E(t,n){t.forEach(o=>{const i=document.createElement("div");i.className="dbg-section";const r=document.createElement("div");r.className="dbg-section-title",r.textContent=o.title,i.appendChild(r);const s=document.createElement("div");s.className="dbg-buttons",o.items.forEach(({text:c,action:u,variant:f})=>{const b=document.createElement("button");b.textContent=c,b.className=`dbg-button is-${f}`,b.addEventListener("click",u),s.appendChild(b)}),i.appendChild(s),n.appendChild(i);const a=document.createElement("div");a.className="dbg-separator",n.appendChild(a)})}#_(t){const n=document.createElement("div");n.className="dbg-section event-checks-section";const o=document.createElement("div");o.className="dbg-section-title",o.textContent="Event Checks",n.appendChild(o);const i=document.createElement("div");i.className="dbg-event-checks",[{type:"required",title:"Required",events:["configure","openGame","loadStart","loadEnd","playReady","bet","play","playCycleStart","playStart","playEnd","playCycleEnd","history","close"]},{type:"nice-to-have",title:"Nice to have",events:["cashier","fullscreen","autoplay"]},{type:"optional",title:"Optional",events:["loadProgress","settings"]}].forEach(({type:s,title:a,events:c})=>{if(c.length===0)return;const u=document.createElement("div");u.className="dbg-event-group";const f=document.createElement("div");f.className=`dbg-event-group-title ${s}`,f.innerHTML=`
238
+ <span class="dbg-event-indicator"></span>
239
+ <span>${a}</span>
240
+ `,u.appendChild(f);const b=document.createElement("div");b.className="dbg-event-group-items",c.forEach(v=>{const k=document.createElement("div");k.className=`dbg-event-item ${s} pending`,k.title=v,k.innerHTML=`
241
+ <span class="dbg-event-indicator"></span>
242
+ <span>${v}</span>
243
+ `,b.appendChild(k),this.#l.set(v,k),this.#c(v,C=>{const F=this.#h(v,C);F.status==="error"?this.#g(v,C,F):this.#O(v)})}),u.appendChild(b),i.appendChild(u)}),n.appendChild(i),t.appendChild(n)}#C(){this.#o.addEventListener("click",()=>this.#S()),this.#i.addEventListener("click",()=>this.#I()),this.#r.addEventListener("input",()=>this.#T()),this.#t.addEventListener("pointerdown",t=>this.#A(t)),document.addEventListener("pointermove",t=>this.#P(t)),document.addEventListener("pointerup",t=>this.#m(t)),document.addEventListener("pointercancel",t=>this.#m(t))}#x(){document.body.appendChild(this.#o),document.body.appendChild(this.#e)}#S(){this.#e.style.display="flex",this.#o.style.display="none";const t=this.#e.offsetWidth,n=this.#e.offsetHeight,o=window.innerWidth,i=window.innerHeight,r=Math.min(10,Math.max(0,o-t-10)),s=Math.min(10,Math.max(0,i-n-10));this.#e.style.left=`${r}px`,this.#e.style.top=`${s}px`}#I(){this.#e.style.display="none",this.#o.style.display="block"}#h(t,n){const o=_c(t);if(!o)return{status:"skipped"};const i=o.safeParse(n);return i.success?{status:"success"}:{status:"error",errorMessage:Cc(i.error)}}#g(t,n,o){const i=new Date().toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3});this.#a.push({eventName:t,payload:n,timestamp:i,expanded:!1,validation:o}),this.#a.length>100&&this.#a.shift(),this.#p()}#z(){this.#a=[],this.#s.innerHTML=""}#T(){this.#p()}#p(){const t=this.#r.value.toLowerCase(),n=this.#a.filter(o=>o.eventName.toLowerCase().includes(t));if(this.#s.innerHTML="",n.length===0){this.#s.innerHTML='<div style="color: #9CA3AF; padding: 20px; text-align: center;">Events will appear here...</div>';return}n.forEach(o=>{const i=document.createElement("div");i.className="dbg-log-entry",o.validation?.status==="error"&&i.classList.add("validation-error");const r=document.createElement("div");r.className="dbg-log-header";const s=o.payload!==void 0&&o.payload!==null,a=document.createElement("span");a.className="dbg-log-timestamp",a.textContent=`[${o.timestamp}]`;const c=document.createElement("span");c.className="dbg-log-name",c.textContent=o.eventName;const u=document.createElement("span");if(u.className="dbg-log-toggle",u.textContent=s?o.expanded?"−":"+":"",r.appendChild(a),r.appendChild(c),r.appendChild(u),s&&r.addEventListener("click",()=>{const f=this.#s.scrollTop;o.expanded=!o.expanded,this.#p(),this.#s.scrollTop=f}),i.appendChild(r),s){const f=document.createElement("div");f.className=`dbg-log-payload${o.expanded?"":" collapsed"}`,f.textContent=JSON.stringify(o.payload,null,2),i.appendChild(f)}if(o.validation?.status==="error"&&o.validation.errorMessage){const f=document.createElement("div");f.className="dbg-log-error-message",f.textContent=`❌ Validation Error:
244
+ ${o.validation.errorMessage}`,i.appendChild(f)}this.#s.appendChild(i)}),this.#s.scrollTop=this.#s.scrollHeight}#M(){const t=this.#r.value.toLowerCase(),o=this.#a.filter(i=>i.eventName.toLowerCase().includes(t)).map(i=>{const r=i.payload!==void 0?JSON.stringify(i.payload,null,2):"";return`[${i.timestamp}] ${i.eventName}${r?`
245
+ `+r:""}
246
+ `}).join(`
247
+ `);navigator.clipboard.writeText(o).catch(()=>{const i=document.createElement("textarea");i.value=o,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)})}registerEvent(t){this.#c(t,n=>{const o=this.#h(t,n);this.#g(t,n,o)})}#A(t){if(t.target.closest(".dbg-close"))return;this.#u=!0,this.#t.classList.add("dragging"),this.#t.setPointerCapture(t.pointerId);const n=this.#e.getBoundingClientRect();this.#d.x=t.clientX-n.left,this.#d.y=t.clientY-n.top,t.preventDefault()}#P(t){if(!this.#u)return;const n=t.clientX-this.#d.x,o=t.clientY-this.#d.y,i=window.innerWidth-this.#e.offsetWidth,r=window.innerHeight-this.#e.offsetHeight,s=Math.max(0,Math.min(n,i)),a=Math.max(0,Math.min(o,r));this.#e.style.left=`${s}px`,this.#e.style.top=`${a}px`}#m(t){this.#u&&(this.#u=!1,this.#t.classList.remove("dragging"),t&&this.#t.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId))}#O(t){const n=this.#l.get(t);n&&n.classList.contains("pending")&&(n.classList.remove("pending"),n.classList.add("received"))}}const Sc=U("DebuggingPlugin","color:#444444;font-weight:bold;");class Ic extends B{#o;constructor(...t){super(...t),this.#o=new xc(this.send.bind(this),this.on.bind(this)),this.registerSdkToDebugEvents(),Sc("configured")}registerSdkToDebugEvents(){["autoplay","balance","bet","cashier","choice","close","configure","configured","error","loadEnd","loadProgress","loadStart","playCycleStart","playCycleEnd","playEnd","playError","playReady","playStart","settings","openGame","openGameResponse","playResponse"].forEach(n=>{this.#o.registerEvent(n)})}}const zn=U("GigPlugin","color:#000000;font-weight:bold;");class zc extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),zn("configured")}postMessage(t){const n={event:t};zn("postMessage",n),window.top.postMessage(n,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{data:n}=t;switch(n){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 Tc=U("OryxPlugin","color:#000000;font-weight:bold;");class Mc extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),Tc("configured")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n,param:o}=t.data;switch(n){case"doBalanceUpdate":this.send("balance",{balance:o});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:n})=>{t!==n&&(t=n,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:n})=>{switch(n){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 vt=U("PariplayPlugin","color:#000000;font-weight:bold;");function yt(e){try{window.top.location=e}catch{window.location=e}}function kt(e,t){return new Promise(function(o,i){const r=new XMLHttpRequest;r.onload=function(){r.status>=200&&r.status<300?o(r.responseText):i(r.responseText)},r.open(e,t),r.send()})}function Et(){}function Ac(e){return e.filter(function(n){return n.messageType.toUpperCase()==="DATA"})}function _t(e){return e.filter(function(n){return["NOTIFICATION","POPUP"].includes(n.messageType.toUpperCase())})}function Io(e){try{return JSON.parse(e.text)}catch{return{}}}function Pc(e){return e.map(Io).filter(Boolean).find(function(n){return n.betId!=null&&n.winId!=null})||{}}function Oc(e){return e.map(Io).filter(Boolean).find(function(n){return n.TotalBet!=null&&n.TotalWin!=null})||{}}class $c extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),vt("configured")}postMessage(t,n){const o={lang:this.sdkConfig.ui.language,sender:this.sdkConfig.api.game,type:t};n!=null&&(o.data=n),vt("postMessage",o),window.parent.postMessage(o,"*")}coinsToCurrency(t){return t*this.sdkConfig.api.coinValueInCents/100}handleContinueButton(t,n){t.link&&kt("GET",t.link),n()}handleLinkButton(t,n){switch(t.linkType.toUpperCase()){case"AJAX":kt("GET",t.link),n();return;case"AJAXRESPONSE":kt("GET",t.link).then(()=>{n()});return;case"REDIRECT":yt(t.link),n();return}}handleQuitButton(t,n){this.send("close"),n()}handleCashierButton(t,n){this.send("cashier",{type:"ON_DEMAND"}),n()}handleHistoryButton(t,n){this.send("history",{source:"casino"}),n()}get buttonActions(){return{CASHIER:this.handleCashierButton,CONTINUE:this.handleContinueButton,HISTORY:this.handleHistoryButton,LINK:this.handleLinkButton,QUIT:this.handleQuitButton}}processInfoUiMessages(t){return t.reduce((n,o)=>n.then(()=>new Promise(i=>{const r=Object.assign({},o,{buttons:o.buttons.filter(s=>s.action.toUpperCase()==="CASHIER"?!!this.sdkConfig.api.cashierUrl:!0).map(s=>Object.assign({},s,{onRelease:()=>{const a=o.messageType.toUpperCase()==="POPUP"?Et:i,c=this.buttonActions[s.action.toUpperCase()];c?c(s,a):a()}}))});vt("showMessage",r)}).catch(Et)),Promise.resolve()).then(()=>{}).catch(Et)}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n}=t.data;switch(n){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",n=>{let o;try{const i=JSON.parse(JSON.parse(atob(this.sdkConfig.api.integrationData.token.split(".")[1])).token),r=JSON.parse(i.integrationSpecificAttributes.sessionData||"{}");o={ClientToken:i.integrationSpecificAttributes.clientToken,CurrencyCode:i.currency,PlayerTokenId:i.user,SessionData:r}}catch{o=void 0}this.postMessage("gameDataLoaded",{LoadGameData:o,success:!0});try{const i=_t(n.contract.uiMessages);this.processInfoUiMessages(i)}catch{}}),this.on("balance",({balance:n})=>{t!==n&&(t=n,this.postMessage("balance",{amount:this.coinsToCurrency(n)}))}),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"):yt(this.sdkConfig.api.homeUrl)}),this.on("playEnd",n=>{this.postMessage("roundEnded",{balanceAfter:this.coinsToCurrency(n.contract.balance.coins),win:this.coinsToCurrency(n.contract.win.round)});try{const o=_t(n.contract.uiMessages);this.processInfoUiMessages(o)}catch{}}),this.on("playError",n=>{this.postMessage("ticketReceived",{ErrorCode:n.type==="error"?n.data.code:"TIMEOUT",ErrorMessage:"ERROR",Status:{ErrCode:n.type==="error"?n.data.code:"TIMEOUT"}})}),this.on("playResponse",n=>{this.postMessage("roundStarted",{balanceBefore:this.coinsToCurrency(n.contract.balance.coins+n.contract.bet.lastPaid.base*n.contract.bet.lastPaid.multiplier)});const o=["BaseGame","PaidSpin"].includes(n.contract.stateType.thisRound),i=Ac(n.contract.uiMessages),r=_t(n.contract.uiMessages),s=Pc(i),a=Oc(i);this.postMessage("ticketReceived",{Balance:this.coinsToCurrency(n.contract.balance.coins),BetAmount:o?this.coinsToCurrency(n.contract.bet.lastPaid.base*n.contract.bet.lastPaid.multiplier):0,CreditTransactionId:s.betId,DebitTransactionId:s.winId,Message:r,SessionData:a,Status:{ErrCode:0},WinAmount:this.coinsToCurrency(n.contract.win.round)})}),this.on("playStart",n=>{n.bet&&this.postMessage("roundStart",{totalBet:this.coinsToCurrency(n.bet.base*n.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"):yt(this.sdkConfig.api.cashierUrl))})}}const Oe=U("RelaxFEIMPlugin","color:#000000;font-weight:bold;");class Rc extends B{VERSION="1.17.0";constructor(...t){super(...t);const n=document.createElement("script");n.src=`https://d3nsdzdtjbr5ml.cloudfront.net/casino/relaxlibs/feim/${this.VERSION}/rlxfeim.min.js`,n.onload=()=>{Oe("loaded"),window.FEIM.configure({p2pConfig:{currency:this.sdkConfig.api.currency,launchParams:{homeurl:"homeUrl"}}}),Oe("configured"),this.registerToSdkEvents(),this.registerFromSdkEvents()},document.body.appendChild(n)}registerToSdkEvents(){window.FEIM.on.errorMessageDismissed(()=>this.send("unfreeze")),window.FEIM.on.errorMessageDisplayed(()=>this.send("freeze")),window.FEIM.on.exitingGame(()=>Oe("!!! NOT IMPLEMENTED: exitingGame !!!")),window.FEIM.on.freeze(()=>this.send("freeze")),window.FEIM.on.initialized(()=>Oe("!!! NOT IMPLEMENTED: initialized !!!")),window.FEIM.on.pauseAutoPlay(()=>this.send("suspend")),window.FEIM.on.refreshBalance(()=>Oe("!!! NOT IMPLEMENTED: refreshBalance !!!")),window.FEIM.on.toggleGameHelp(()=>{this.send("help")}),window.FEIM.on.togglePaytable(()=>{this.send("paytable")}),window.FEIM.on.unfreeze(()=>this.send("unfreeze")),window.FEIM.on.updateSettings(({payload:[t]})=>this.send("settings",{sounds:t.sounds,fastPlay:t.fastPlay}))}registerFromSdkEvents(){this.on("autoplay",({action:t})=>{switch(t){case"start":window.FEIM.send.autoPlayStarted();break;case"stop":window.FEIM.send.autoPlayFinished();break}}),this.on("balance",({balance:t})=>{window.FEIM.send.balanceUpdate(t)}),this.on("bet",({base:t,multiplier:n})=>{window.FEIM.send.betUpdate(t*n)}),this.on("error",t=>{const n="message"in t?t.message:"Unknown error";window.FEIM.send.errorMessage(n)}),this.on("close",()=>{window.FEIM.send.exitGame()}),this.on("loadEnd",()=>{window.FEIM.send.gameLoadCompleted()}),this.on("loadProgress",({progress:t})=>{window.FEIM.send.gameLoadProgress(t)}),this.on("loadStart",()=>{window.FEIM.send.gameLoadStarted()}),this.on("cashier",()=>{window.FEIM.send.openQuickDeposit()}),this.on("playCycleEnd",t=>{const n={balance:t.contract.balance.coins,bet:t.contract.bet.lastPaid.base*t.contract.bet.lastPaid.multiplier,win:{win:t.contract.win.total}};window.FEIM.send.roundFinished(n)}),this.on("playResponse",t=>{const n={balance:t.contract.balance.coins,playResponse:t.data};window.FEIM.send.roundStarted(n)}),this.on("history",()=>{window.FEIM.send.showHistory()}),this.on("settings",t=>{window.FEIM.send.updateSettings(t)})}}const Ct=U("TukoPlugin","color:#000000;font-weight:bold;");class Nc extends B{PING_INTERVAL=1e4;constructor(...t){super(...t);const o=new URLSearchParams(window.location.search).get("pingCallbackUrl");o&&window.setInterval(()=>{this.ping(o)},this.PING_INTERVAL),this.registerToSdkEvents(),this.registerFromSdkEvents(),Ct("configured")}ping(t){const n=new XMLHttpRequest;n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&(n.status===0||n.status>=200&&n.status<400?Ct("ping ok",n):Ct("ping error",n))},n.open("GET",t),n.send()}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{type:n,payload:o}=t.data;switch(n){case"doAudioSettings":this.send("settings",{music:o?.musicEnabled,sounds:o?.soundEnabled});return;case"doBalanceUpdate":const{currency:i,coinValueInCents:r}=this.sdkConfig.api;o.currency===i&&typeof o.balanceInCurrency=="number"?this.send("balance",{balance:to(o.balanceInCurrency,r)}):(o.balanceInCoins,this.send("balance",{balance:o.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 Tn=U("QuantaPlugin","color:#000000;font-weight:bold;");class Zc extends B{constructor(...t){super(...t),this.registerFromSdkEvents(),Tn("configured")}postMessage(t){const n={event:t};Tn("postMessage",n),window.parent.postMessage(n,"*")}registerFromSdkEvents(){this.on("close",()=>{this.postMessage("GameClosed")}),this.on("loadEnd",()=>{this.postMessage("GameLoaded")}),this.on("playCycleStart",()=>{this.postMessage("RoundStarted")}),this.on("playCycleEnd",()=>{this.postMessage("RoundEnded")}),this.on("playError",()=>{this.postMessage("RoundEnded")})}}const Mn=U("SoftSwissPlugin","color:#000000;font-weight:bold;");class Fc extends B{constructor(...t){super(...t),this.registerFromSdkEvents(),Mn("configured")}postMessage(t,n){const o={event:t,payload:n};Mn("postMessage",o),window.top.postMessage(o,"*")}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("loadStart",()=>{this.postMessage("gameLoadStarted")}),this.on("loadProgress",({progress:t})=>{this.postMessage("gameLoadProgress",{progress:t})}),this.on("loadEnd",()=>{this.postMessage("gameLoadCompleted")}),this.on("playCycleStart",()=>{this.postMessage("gameAnimationStart")}),this.on("playCycleEnd",t=>{this.postMessage("winUpdate",{win:t.contract.win.total}),this.postMessage("gameAnimationCompleted")}),this.on("playError",()=>{this.postMessage("gameAnimationCompleted")}),this.on("balance",({balance:t})=>{this.postMessage("balanceUpdate",{balance:t})}),this.on("bet",t=>{this.postMessage("stakeUpdate",{bet:t})})}}const An=U("EveryMatrixPlugin","color:#000000;font-weight:bold;");class Uc extends B{constructor(...t){super(...t),this.registerToSdkEvents(),this.registerFromSdkEvents(),An("configured")}postMessage(t,n){const o={name:t,sender:"game",data:n};An("postMessage",o),window.top.postMessage(o,"*")}registerToSdkEvents(){window.addEventListener("message",t=>{try{const{name:n,sender:o}=t.data;if(o!=="emwindow")return;switch(n){case"updateBalance":this.send("getBalance");return;case"togglePaytable":this.send("paytable");return;case"stopAutoplay":this.send("suspend");return;case"showHelp":this.send("help",{show:!0});return;default:return}}catch{}})}registerFromSdkEvents(){this.on("loadProgress",({progress:t})=>{this.postMessage("loadProgress",{progress:t})}),this.on("loadEnd",()=>{this.postMessage("loadCompleted")}),this.on("settings",t=>{(t?.music||t?.sounds)&&this.postMessage("audioToggle")}),this.on("playCycleStart",()=>{this.postMessage("roundStart")}),this.on("playCycleEnd",()=>{this.postMessage("roundEnd")}),this.on("playError",()=>{this.postMessage("errorMessage")}),this.on("error",()=>{this.postMessage("errorMessage")}),this.on("close",()=>{this.postMessage("close")}),this.on("bet",()=>{this.postMessage("stakeUpdate")})}}var Lc="2.0.5",Dt=500,Pn="user-agent",Ie="",On="?",rt="function",ie="undefined",ze="object",Bt="string",$="browser",ee="cpu",J="device",V="engine",D="os",Ce="result",g="name",d="type",h="vendor",m="version",R="architecture",je="major",p="model",Le="console",y="mobile",E="tablet",P="smarttv",q="wearable",Je="xr",De="embedded",be="inapp",tn="brands",he="formFactors",nn="fullVersionList",xe="platform",on="platformVersion",gt="bitness",de="sec-ch-ua",Dc=de+"-full-version-list",Bc=de+"-arch",jc=de+"-"+gt,Gc=de+"-form-factors",Hc=de+"-"+y,Vc=de+"-"+p,zo=de+"-"+xe,Wc=zo+"-version",To=[tn,nn,y,p,xe,on,R,he,gt],Xe="Amazon",we="Apple",$n="ASUS",Rn="BlackBerry",pe="Google",Nn="Huawei",xt="Lenovo",Zn="Honor",Ye="LG",St="Microsoft",It="Motorola",zt="Nvidia",Fn="OnePlus",Tt="OPPO",$e="Samsung",Un="Sharp",Re="Sony",Mt="Xiaomi",At="Zebra",Ln="Chrome",Dn="Chromium",ne="Chromecast",nt="Edge",Ne="Firefox",Ze="Opera",Pt="Facebook",Bn="Sogou",ve="Mobile ",Fe=" Browser",jt="Windows",qc=typeof window!==ie,N=qc&&window.navigator?window.navigator:void 0,oe=N&&N.userAgentData?N.userAgentData:void 0,Kc=function(e,t){var n={},o=t;if(!at(t)){o={};for(var i in t)for(var r in t[i])o[r]=t[i][r].concat(o[r]?o[r]:[])}for(var s in e)n[s]=o[s]&&o[s].length%2===0?o[s].concat(e[s]):e[s];return n},mt=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Gt=function(e,t){if(typeof e===ze&&e.length>0){for(var n in e)if(se(t)==se(e[n]))return!0;return!1}return Me(e)?se(t)==se(e):!1},at=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?at(e[n]):!1)},Me=function(e){return typeof e===Bt},Ot=function(e){if(e){for(var t=[],n=Te(/\\?\"/g,e).split(","),o=0;o<n.length;o++)if(n[o].indexOf(";")>-1){var i=ct(n[o]).split(";v=");t[o]={brand:i[0],version:i[1]}}else t[o]=ct(n[o]);return t}},se=function(e){return Me(e)?e.toLowerCase():e},$t=function(e){return Me(e)?Te(/[^\d\.]/g,e).split(".")[0]:void 0},te=function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];typeof n==ze&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Te=function(e,t){return Me(t)?t.replace(e,Ie):t},Ue=function(e){return Te(/\\?\"/g,e)},ct=function(e,t){if(Me(e))return e=Te(/^\s\s*/,e),typeof t===ie?e:e.substring(0,Dt)},Rt=function(e,t){if(!(!e||!t))for(var n=0,o,i,r,s,a,c;n<t.length&&!a;){var u=t[n],f=t[n+1];for(o=i=0;o<u.length&&!a&&u[o];)if(a=u[o++].exec(e),a)for(r=0;r<f.length;r++)c=a[++i],s=f[r],typeof s===ze&&s.length>0?s.length===2?typeof s[1]==rt?this[s[0]]=s[1].call(this,c):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===rt&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=c?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=c?s[1].call(this,c,s[2]):void 0:s.length==3?this[s[0]]=c?c.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=c?s[3].call(this,c.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=c?s[3].apply(this,[c.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=c||void 0;n+=2}},K=function(e,t){for(var n in t)if(typeof t[n]===ze&&t[n].length>0){for(var o=0;o<t[n].length;o++)if(Gt(t[n][o],e))return n===On?void 0:n}else if(Gt(t[n],e))return n===On?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},jn={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Gn={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Jc={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Hn={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[m,[g,ve+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[m,[g,nt+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[m,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,m],[/opios[\/ ]+([\w\.]+)/i],[m,[g,Ze+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[m,[g,Ze+" GX"]],[/\bopr\/([\w\.]+)/i],[m,[g,Ze]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[m,[g,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[m,[g,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[g,m],[/quark(?:pc)?\/([-\w\.]+)/i],[m,[g,"Quark"]],[/\bddg\/([\w\.]+)/i],[m,[g,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[m,[g,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[m,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[m,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[m,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[m,[g,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[m,[g,"Smart "+xt+Fe]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure"+Fe],m],[/\bfocus\/([\w\.]+)/i],[m,[g,Ne+" Focus"]],[/\bopt\/([\w\.]+)/i],[m,[g,Ze+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[m,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[m,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[m,[g,Ze+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[m,[g,"MIUI"+Fe]],[/fxios\/([\w\.-]+)/i],[m,[g,ve+Ne]],[/\bqihoobrowser\/?([\w\.]*)/i],[m,[g,"360"]],[/\b(qq)\/([\w\.]+)/i],[[g,/(.+)/,"$1Browser"],m],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1"+Fe],m],[/samsungbrowser\/([\w\.]+)/i],[m,[g,$e+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[m,[g,Bn+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[g,Bn+" Mobile"],m],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[g,m],[/(lbbrowser|rekonq)/i],[g],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[m,g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,Pt],m,[d,be]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[g,m,[d,be]],[/\bgsa\/([\w\.]+) .*safari\//i],[m,[g,"GSA"],[d,be]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[m,[g,"TikTok"],[d,be]],[/\[(linkedin)app\]/i],[g,[d,be]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[g,/(.+)/,"Zalo"],m,[d,be]],[/(chromium)[\/ ]([-\w\.]+)/i],[g,m],[/headlesschrome(?:\/([\w\.]+)| )/i],[m,[g,Ln+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[m,[g,nt+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,Ln+" WebView"],m],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[m,[g,"Android"+Fe]],[/chrome\/([\w\.]+) mobile/i],[m,[g,ve+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,m],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[m,[g,ve+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[g,ve+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[m,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[m,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[g,m],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[g,ve+Ne],m],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],m],[/(wolvic|librewolf)\/([\w\.]+)/i],[g,m],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[m,[g,Ne+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[g,[m,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[g,[m,/[^\d\.]+./,Ie]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[R,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[R,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[R,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[R,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[R,"arm"]],[/ sun4\w[;\)]/i],[[R,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[R,/ower/,Ie,se]],[/winnt.+\[axp/i],[[R,"alpha"]]],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],[p,[h,$e],[d,E]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[p,[h,$e],[d,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[h,we],[d,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[h,we],[d,E]],[/(macintosh);/i],[p,[h,we]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[h,Un],[d,y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[p,[h,Zn],[d,E]],[/honor([-\w ]+)[;\)]/i],[p,[h,Zn],[d,y]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[p,[h,Nn],[d,E]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[h,Nn],[d,y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[p,/_/g," "],[h,Mt],[d,E]],[/\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|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[p,/_/g," "],[h,Mt],[d,y]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[h,Fn],[d,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[h,Tt],[d,y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[p,[h,K,{OnePlus:["203","304","403","404","413","415"],"*":Tt}],[d,E]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[p,[h,"BLU"],[d,y]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[h,"Vivo"],[d,y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[h,"Realme"],[d,y]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[p,[h,xt],[d,E]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[p,[h,xt],[d,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[p,[h,It],[d,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[h,It],[d,E]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[h,Ye],[d,E]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[h,Ye],[d,y]],[/(nokia) (t[12][01])/i],[h,p,[d,E]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[p,/_/g," "],[d,y],[h,"Nokia"]],[/(pixel (c|tablet))\b/i],[p,[h,pe],[d,E]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[p,[h,pe],[d,y]],[/(google) (pixelbook( go)?)/i],[h,p],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[h,Re],[d,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[h,Re],[d,E]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[h,Xe],[d,E]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[h,Xe],[d,y]],[/(playbook);[-\w\),; ]+(rim)/i],[p,h,[d,E]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[h,Rn],[d,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[h,$n],[d,E]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[h,$n],[d,y]],[/(nexus 9)/i],[p,[h,"HTC"],[d,E]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[p,/_/g," "],[d,y]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[p,[h,"TCL"],[d,E]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[p,[h,"TCL"],[d,y]],[/(itel) ((\w+))/i],[[h,se],p,[d,K,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[h,"Acer"],[d,E]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[h,"Meizu"],[d,y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[h,"Ulefone"],[d,y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[h,"Energizer"],[d,y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[h,"Cat"],[d,y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[h,"Smartfren"],[d,y]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[p,[h,"Nothing"],[d,y]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[p,[h,"Archos"],[d,E]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[p,[h,"Archos"],[d,y]],[/; (n159v)/i],[p,[h,"HMD"],[d,y]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[h,p,[d,E]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[h,p,[d,y]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[h,p,[d,E]],[/(surface duo)/i],[p,[h,St],[d,E]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[h,"Fairphone"],[d,y]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[p,[h,zt],[d,E]],[/(sprint) (\w+)/i],[h,p,[d,y]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[h,St],[d,y]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[h,At],[d,E]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[h,At],[d,y]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[h,[d,P]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[h,$e],[d,P]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[h,p,[d,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,Ye],[d,P]],[/(apple) ?tv/i],[h,[p,we+" TV"],[d,P]],[/crkey.*devicetype\/chromecast/i],[[p,ne+" Third Generation"],[h,pe],[d,P]],[/crkey.*devicetype\/([^/]*)/i],[[p,/^/,"Chromecast "],[h,pe],[d,P]],[/fuchsia.*crkey/i],[[p,ne+" Nest Hub"],[h,pe],[d,P]],[/crkey/i],[[p,ne],[h,pe],[d,P]],[/(portaltv)/i],[p,[h,Pt],[d,P]],[/droid.+aft(\w+)( bui|\))/i],[p,[h,Xe],[d,P]],[/(shield \w+ tv)/i],[p,[h,zt],[d,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[h,Un],[d,P]],[/(bravia[\w ]+)( bui|\))/i],[p,[h,Re],[d,P]],[/(mi(tv|box)-?\w+) bui/i],[p,[h,Mt],[d,P]],[/Hbbtv.*(technisat) (.*);/i],[h,p,[d,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,/.+\/(\w+)/,"$1",K,{LG:"lge"}],[p,ct],[d,P]],[/(playstation \w+)/i],[p,[h,Re],[d,Le]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[h,St],[d,Le]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[h,p,[d,Le]],[/droid.+; (shield)( bui|\))/i],[p,[h,zt],[d,Le]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[p,[h,$e],[d,q]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[h,p,[d,q]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[p,[h,Tt],[d,q]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[h,we],[d,q]],[/(opwwe\d{3})/i],[p,[h,Fn],[d,q]],[/(moto 360)/i],[p,[h,It],[d,q]],[/(smartwatch 3)/i],[p,[h,Re],[d,q]],[/(g watch r)/i],[p,[h,Ye],[d,q]],[/droid.+; (wt63?0{2,3})\)/i],[p,[h,At],[d,q]],[/droid.+; (glass) \d/i],[p,[h,pe],[d,Je]],[/(pico) ([\w ]+) os\d/i],[h,p,[d,Je]],[/(quest( \d| pro)?s?).+vr/i],[p,[h,Pt],[d,Je]],[/mobile vr; rv.+firefox/i],[[d,Je]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[d,De]],[/(aeobc)\b/i],[p,[h,Xe],[d,De]],[/(homepod).+mac os/i],[p,[h,we],[d,De]],[/windows iot/i],[[d,De]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[p,[d,P]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[d,P]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[p,[d,K,{mobile:"Mobile",xr:"VR","*":E}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,E]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[p,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[m,[g,nt+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[g,m],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[m,[g,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[g,m],[/ladybird\//i],[[g,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[m,g]],os:[[/(windows nt) (6\.[23]); arm/i],[[g,/N/,"R"],[m,K,jn]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[g,m],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[m,/(;|\))/g,"",K,jn],[g,jt]],[/(windows ce)\/?([\d\.]*)/i],[g,m],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[m,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[g,"macOS"],[m,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[m,[g,ne+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[m,[g,ne+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[m,[g,ne+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[m,[g,ne+" Linux"]],[/crkey\/([\d\.]+)/i],[m,[g,ne]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[m,g],[/(ubuntu) ([\w\.]+) like android/i],[[g,/(.+)/,"$1 Touch"],m],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[g,m],[/\(bb(10);/i],[m,[g,Rn]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[m,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[m,[g,Ne+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[m,[g,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[m,K,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[m,[g,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,"Chrome OS"],m],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[g,m],[/(sunos) ?([\d\.]*)/i],[[g,"Solaris"],m],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,m]]},Qe=function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return te.call(e.init,[[$,[g,m,je,d]],[ee,[R]],[J,[d,p,h]],[V,[g,m]],[D,[g,m]]]),te.call(e.isIgnore,[[$,[m,je]],[V,[m]],[D,[m]]]),te.call(e.isIgnoreRgx,[[$,/ ?browser$/i],[D,/ ?os$/i]]),te.call(e.toString,[[$,[g,m]],[ee,[R]],[J,[h,p]],[V,[g,m]],[D,[g,m]]]),e}(),Xc=function(e,t){var n=Qe.init[t],o=Qe.isIgnore[t]||0,i=Qe.isIgnoreRgx[t]||0,r=Qe.toString[t]||0;function s(){te.call(this,n)}return s.prototype.getItem=function(){return e},s.prototype.withClientHints=function(){return oe?oe.getHighEntropyValues(To).then(function(a){return e.setCH(new Mo(a,!1)).parseCH().get()}):e.parseCH().get()},s.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=Ce&&(s.prototype.is=function(a){var c=!1;for(var u in this)if(this.hasOwnProperty(u)&&!Gt(o,u)&&se(i?Te(i,this[u]):this[u])==se(i?Te(i,a):a)){if(c=!0,a!=ie)break}else if(a==ie&&c){c=!c;break}return c},s.prototype.toString=function(){var a=Ie;for(var c in r)typeof this[r[c]]!==ie&&(a+=(a?" ":Ie)+this[r[c]]);return a||ie}),oe||(s.prototype.then=function(a){var c=this,u=function(){for(var b in c)c.hasOwnProperty(b)&&(this[b]=c[b])};u.prototype={is:s.prototype.is,toString:s.prototype.toString};var f=new u;return a(f),f}),new s};function Mo(e,t){if(e=e||{},te.call(this,To),t)te.call(this,[[tn,Ot(e[de])],[nn,Ot(e[Dc])],[y,/\?1/.test(e[Hc])],[p,Ue(e[Vc])],[xe,Ue(e[zo])],[on,Ue(e[Wc])],[R,Ue(e[Bc])],[he,Ot(e[Gc])],[gt,Ue(e[jc])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==ie&&(this[n]=e[n])}function Vn(e,t,n,o){return this.get=function(i){return i?this.data.hasOwnProperty(i)?this.data[i]:void 0:this.data},this.set=function(i,r){return this.data[i]=r,this},this.setCH=function(i){return this.uaCH=i,this},this.detectFeature=function(){if(N&&N.userAgent==this.ua)switch(this.itemType){case $:N.brave&&typeof N.brave.isBrave==rt&&this.set(g,"Brave");break;case J:!this.get(d)&&oe&&oe[y]&&this.set(d,y),this.get(p)=="Macintosh"&&N&&typeof N.standalone!==ie&&N.maxTouchPoints&&N.maxTouchPoints>2&&this.set(p,"iPad").set(d,E);break;case D:!this.get(g)&&oe&&oe[xe]&&this.set(g,oe[xe]);break;case Ce:var i=this.data,r=function(s){return i[s].getItem().detectFeature().get()};this.set($,r($)).set(ee,r(ee)).set(J,r(J)).set(V,r(V)).set(D,r(D))}return this},this.parseUA=function(){return this.itemType!=Ce&&Rt.call(this.data,this.ua,this.rgxMap),this.itemType==$&&this.set(je,$t(this.get(m))),this},this.parseCH=function(){var i=this.uaCH,r=this.rgxMap;switch(this.itemType){case $:case V:var s=i[nn]||i[tn],a;if(s)for(var c=0;c<s.length;c++){var u=s[c].brand||s[c],f=s[c].version;this.itemType==$&&!/not.a.brand/i.test(u)&&(!a||/Chrom/.test(a)&&u!=Dn||a==nt&&/WebView2/.test(u))&&(u=K(u,Jc),a=this.get(g),a&&!/Chrom/.test(a)&&/Chrom/.test(u)||this.set(g,u).set(m,f).set(je,$t(f)),a=u),this.itemType==V&&u==Dn&&this.set(m,f)}break;case ee:var b=i[R];b&&(b&&i[gt]=="64"&&(b+="64"),Rt.call(this.data,b+";",r));break;case J:if(i[y]&&this.set(d,y),i[p]&&(this.set(p,i[p]),!this.get(d)||!this.get(h))){var v={};Rt.call(v,"droid 9; "+i[p]+")",r),!this.get(d)&&v.type&&this.set(d,v.type),!this.get(h)&&v.vendor&&this.set(h,v.vendor)}if(i[he]){var k;if(typeof i[he]!="string")for(var C=0;!k&&C<i[he].length;)k=K(i[he][C++],Gn);else k=K(i[he],Gn);this.set(d,k)}break;case D:var F=i[xe];if(F){var L=i[on];F==jt&&(L=parseInt($t(L),10)>=13?"11":"10"),this.set(g,F).set(m,L)}this.get(g)==jt&&i[p]=="Xbox"&&this.set(g,"Xbox").set(m,void 0);break;case Ce:var G=this.data,le=function(H){return G[H].getItem().setCH(i).parseCH().get()};this.set($,le($)).set(ee,le(ee)).set(J,le(J)).set(V,le(V)).set(D,le(D))}return this},te.call(this,[["itemType",e],["ua",t],["uaCH",o],["rgxMap",n],["data",Xc(this,e)]]),this}function Y(e,t,n){if(typeof e===ze?(at(e,!0)?(typeof t===ze&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===Bt&&!at(t,!0)&&(n=t,t=void 0),n)if(typeof n.append===rt){var o={};n.forEach(function(f,b){o[String(b).toLowerCase()]=f}),n=o}else{var i={};for(var r in n)n.hasOwnProperty(r)&&(i[String(r).toLowerCase()]=n[r]);n=i}if(!(this instanceof Y))return new Y(e,t,n).getResult();var s=typeof e===Bt?e:n&&n[Pn]?n[Pn]:N&&N.userAgent?N.userAgent:Ie,a=new Mo(n,!0),c=t?Kc(Hn,t):Hn,u=function(f){return f==Ce?function(){return new Vn(f,s,c,a).set("ua",s).set($,this.getBrowser()).set(ee,this.getCPU()).set(J,this.getDevice()).set(V,this.getEngine()).set(D,this.getOS()).get()}:function(){return new Vn(f,s,c[f],a).parseUA().get()}};return te.call(this,[["getBrowser",u($)],["getCPU",u(ee)],["getDevice",u(J)],["getEngine",u(V)],["getOS",u(D)],["getResult",u(Ce)],["getUA",function(){return s}],["setUA",function(f){return Me(f)&&(s=f.length>Dt?ct(f,Dt):f),this}]]).setUA(s),this}Y.VERSION=Lc;Y.BROWSER=mt([g,m,je,d]);Y.CPU=mt([R]);Y.DEVICE=mt([p,h,d,Le,y,P,E,q,De]);Y.ENGINE=Y.OS=mt([g,m]);class Ao{config;sdkConfig;error;constructor(t,n){this.config=t,this.sdkConfig=n,this.on("openGame",async()=>{try{this.error=void 0;const o=await this.openGame();this.send("openGameResponse",o)}catch(o){this.error=o,this.send("openGameError",this.error)}}),this.on("play",async o=>{try{this.error=void 0;const i=await this.play(o);this.send("playResponse",i)}catch(i){this.error=i,this.send("playError",this.error)}}),this.on("freeRounds",async o=>{try{this.error=void 0;const i=await this.freeRounds(o);this.send("freeRoundsResponse",i)}catch(i){this.error=i,this.send("freeRoundsError",this.error)}}),this.on("getBalance",async()=>{try{this.error=void 0;const o=await this.getBalance();this.send("balance",o)}catch{}}),this.showHistory=this.showHistory.bind(this),this.on("history",this.showHistory)}on(t,n,o){const i=function(s){s.data.message!==`kalamba:wrapper-rgs:${t}`&&s.data.message!==`kalamba:wrapper:${t}`||n(s.data.payload)};window.addEventListener("message",i,o)}send(t,...[n]){window.postMessage({message:`kalamba:rgs:${t}`,payload:n})}async openGame(){throw new Error("Not implemented")}async play(t){throw new Error("Not implemented")}async freeRounds(t){throw new Error("Not implemented")}async getBalance(){throw new Error("Not implemented")}async showHistory(){throw new Error("Not implemented")}}class Yc{socket=null;webSocketUrl;eventListeners={close:[],error:[],message:[]};constructor(t){this.webSocketUrl=t}connect=async()=>{const t=new WebSocket(this.webSocketUrl);return t.addEventListener("message",this.handleMessage),new Promise(n=>{t.addEventListener("open",o=>{this.handleOpen(o),n(this.socket)},{once:!0})})};send=t=>{if(this.socket==null)throw new Error("Cannot send message, the WebSocket connection is not open");this.socket.send(t)};close=()=>{if(this.socket==null)throw new Error("Cannot close the WebSocket connection that is not open");this.socket.close()};addEventListener(t,n){this.eventListeners[t].push(n)}removeEventListener(t,n){const o=this.eventListeners[t].indexOf(n);o!==-1&&this.eventListeners[t].splice(o,1)}handleClose=t=>{this.eventListeners.close.forEach(n=>{n(t)}),this.socket.removeEventListener("message",this.handleMessage),this.socket.removeEventListener("close",this.handleClose),this.socket.removeEventListener("error",this.handleError),this.socket=null};handleError=t=>{this.eventListeners.error.forEach(n=>{n(t)})};handleMessage=t=>{this.eventListeners.message.forEach(n=>{n(t)})};handleOpen=t=>{const n=t.target;n.addEventListener("close",this.handleClose),n.addEventListener("error",this.handleError),this.socket=n}}function et(e){return JSON.parse(e?.data)}function Qc(e){return e?.header?.name==="Ping"}function Wn(e){return e?.header?.name==="RealityCheck"}function ut(e){return e.header.name==="GameEvent"}function eu(e){return ut(e)&&e.body.event==="OPEN_GAME"}function qn(e){return e.header.code!==1}function tu(e){return ut(e)&&e.body.event.includes("_RESULT")}class nu extends Yc{cId=0;mId=0;seqId=0;gameCode;#o;#e;constructor(t,n){const o=new URL(t.apiUrl);o.searchParams.set("cageCode",t.cageCode),o.searchParams.set("gameCode",t.gameCode),o.searchParams.set("operatorCode",t.operatorCode),o.searchParams.set("playMode",t.playMode),o.searchParams.set("token",t.token),o.searchParams.set("username",t.username),super(o.toString()),this.eventListeners.realityCheck=[],this.gameCode=t.gameCode,this.#o=n.requestTimeoutMs,this.#e=n.gameVersion??"unknown",this.addEventListener("message",this.onMessage)}handleRealityCheck(t){this.eventListeners.realityCheck.forEach(n=>{n(t.body)})}addEventListener(t,n){super.addEventListener(t,n)}removeEventListener(t,n){super.removeEventListener(t,n)}onMessage=t=>{const n=et(t);(ut(n)||Qc(n)||Wn(n))&&this.sendAcknowledgement(n),Wn(n)&&this.handleRealityCheck(n)};buildHeader(t,n=null){return{cId:n??++this.cId,code:n!==null?1:void 0,mId:++this.mId,name:t}}buildPayload(t,n){return JSON.stringify({body:n,header:t})}getBodyExtras(t){return{action:t,seqId:++this.seqId}}request(t,n){const o=this.buildPayload(t,n);return new Promise((i,r)=>{setTimeout(()=>r({type:"timeout"}),this.#o);const s=a=>{const c=et(a);try{t.cId===c.header.cId&&(this.removeEventListener("message",s),c.header.code===1?i(c):r({message:c,type:"error"}))}catch{r({message:c,type:"error"})}};this.addEventListener("message",s),this.send(o)})}freeRounds(t){const n=this.buildHeader("ActivateFreeRound");return this.request(n,t).then(o=>o.body).catch(o=>{throw{data:o?.message?.body,type:o.type}})}async authenticate(t=!1){const n=this.buildHeader("Authenticate"),o={clientType:3,version:this.#e,reconnect:t};return this.request(n,o).then(i=>i.body).catch(i=>{throw{data:i?.message?.body,type:i.type}})}async getBalance(){const t=this.buildHeader("GetBalance"),n={};return this.request(t,n).then(o=>o.body).catch(o=>{throw{data:o?.message?.body,type:o.type}})}async openGame(){const t=this.buildHeader("OpenGame"),n={gameCode:this.gameCode};return new Promise((o,i)=>{const r=s=>{const a=et(s);eu(a)?(this.removeEventListener("message",r),o(a.body)):qn(a)&&i({data:a.body,type:"error"})};this.addEventListener("message",r),this.request(t,n).catch(s=>i({data:s?.message?.body,type:s.type}))})}sendAcknowledgement(t){const{name:n,cId:o}=t.header,i=this.buildHeader(n,o),r=this.buildPayload(i,{});this.send(r)}sendAction(t,n){const o=this.buildHeader("GameAction"),i={...this.getBodyExtras(t),data:n};return new Promise((r,s)=>{const a=c=>{const u=et(c);ut(u)&&i.seqId===u.body.correlationSeqId&&(this.removeEventListener("message",a),tu(u)?r(u.body):qn(u)&&s({data:u.body,type:"error"}))};this.addEventListener("message",a),this.request(o,i).catch(c=>s({data:c?.message?.body,type:c.type}))})}setRequestTimeoutMs(t){this.#o=t}}const ou={CA_BC:"CA",CA_ON:"CA",CAON:"CA",CAAB:"CA",GER:"DE",US_CT:"US",US_MI:"US",US_NJ:"US",USA:"US"};function Kn(e){return!e||e==="NOT_APPLICABLE"?null:ou[e]??e}function Po(e){const t=e.contract;return t?{contract:{balance:{coins:t.balance,version:t.balanceVersion},coinValueInCents:t.coinValueInCents,country:t.countryCode,currency:t.currencyCode,jurisdiction:Kn(t.jurisdictionCode),uiMessages:t.uiMessages,username:t.username}}:{contract:{balance:{coins:e.balance,version:e.balanceVersion},coinValueInCents:e.coinValueInCents,country:e.countryCode,currency:e.currencyCode,jurisdiction:Kn(e.jurisdictionCode),uiMessages:e.uiMessages,username:e.username}}}function Oo(e){return{code:e.data?.code??Ee.RgsErrorCode.UNKNOWN,details:e.data?.details}}function $o(e,t,n){const o=t.contract;if(!o){const i=t.data;return{contract:{bet:{available:i.additionalConfigData.availableMultipliersPerBaseBet,default:{base:i.additionalConfigData.defaultBet.baseBet,multiplier:i.additionalConfigData.defaultBet.betMultiplier},max:i.additionalConfigData.maxAllowedOverallBetInCoins??null,last:i.gameState.betFromCurrentRound?{base:i.gameState.betFromCurrentRound.baseBet,multiplier:i.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:i.gameState.lastPlacedMainGameBet?{base:i.gameState.lastPlacedMainGameBet.baseBet,multiplier:i.gameState.lastPlacedMainGameBet.betMultiplier}:null},balance:{coins:t.balance,version:t.balanceVersion},freeRounds:(i.FREE_ROUNDS??[]).map(r=>({conf:{base:r.conf.baseBet,multiplier:r.conf.betMultiplier,numAwarded:r.conf.numAwarded},data:{numPlayed:r.data.numPlayed,win:r.data.winAmount,numLeft:r.data.numLeft},id:r.id,rejectable:r.rejectable,skippable:r.skippable,status:r.status,type:r.type})),gameModel:i.additionalConfigData.gameModelFile,metaData:i.gameConfigData.metaData,roundId:i.gameState.cycleId,serverTime:t.balanceVersion,sessionId:i.gameState.sessionId,stateType:{thisRound:i.gameState.stateTypeThisRound,nextRound:i.gameState.stateTypeNextRound},uiMessages:e.uiMessages,win:{max:i.maxWin??null,round:i.gameState.totalWinFromCurrentRound,total:i.gameState.totalWinFromCurrentGameCycle}},data:i}}return{contract:{bet:{available:o.availableMultipliersPerBaseBet,default:{base:o.defaultBet.baseBet,multiplier:o.defaultBet.betMultiplier},max:o.maxBetInCoins??null,last:o.lastBet?{base:o.lastBet.baseBet,multiplier:o.lastBet.betMultiplier}:null,lastPaid:o.lastMainGameBet?{base:o.lastMainGameBet.baseBet,multiplier:o.lastMainGameBet.betMultiplier}:null},balance:{coins:o.balanceInCoins,version:o.balanceVersion},freeRounds:(o.freeRounds??[]).map(i=>({conf:{base:i.conf.baseBet,multiplier:i.conf.betMultiplier,numAwarded:i.conf.numAwarded},data:{numPlayed:i.data.numPlayed,win:i.data.winAmount,numLeft:i.data.numLeft},id:i.id,rejectable:i.rejectable,skippable:i.skippable,status:i.status,type:i.type})),gameModel:o.gameModelFile,metaData:o.metaData,roundId:o.roundId,serverTime:o.serverTime,sessionId:o.sessionId,stateType:{thisRound:o.stateTypeThisRound,nextRound:o.stateTypeNextRound},uiMessages:e.contract.uiMessages.concat(o.uiMessages),win:{max:o.maxWinInCoins??null,round:o.roundWin,total:o.totalWin}},data:n?n(t.opaqueGameServerToUi):t.opaqueGameServerToUi}}function Ro(e){return{code:e.data?.code??Ee.RgsErrorCode.UNKNOWN,details:e.data?.details}}function No(e,t){const n=e.contract;if(!n){const o=e.data;return{contract:{bet:{last:o.gameState.betFromCurrentRound?{base:o.gameState.betFromCurrentRound.baseBet,multiplier:o.gameState.betFromCurrentRound.betMultiplier}:null,lastPaid:{base:(o.gameState.lastPlacedMainGameBet??o.gameState.betFromCurrentRound).baseBet,multiplier:(o.gameState.lastPlacedMainGameBet??o.gameState.betFromCurrentRound).betMultiplier}},balance:{coins:e.balance,version:e.balanceVersion},freeRounds:(o.FREE_ROUNDS??[]).map(i=>({conf:{base:i.conf.baseBet,multiplier:i.conf.betMultiplier,numAwarded:i.conf.numAwarded},data:{numPlayed:i.data.numPlayed,win:i.data.winAmount,numLeft:i.data.numLeft},id:i.id,rejectable:i.rejectable,skippable:i.skippable,status:i.status,type:i.type})),serverTime:e.balanceVersion,roundId:o.gameState.cycleId,stateType:{thisRound:o.gameState.stateTypeThisRound,nextRound:o.gameState.stateTypeNextRound},uiMessages:o.uiMessages,win:{round:o.gameState.totalWinFromCurrentRound,total:o.gameState.totalWinFromCurrentGameCycle}},data:o}}return{contract:{bet:{last:n.lastBet?{base:n.lastBet.baseBet,multiplier:n.lastBet.betMultiplier}:null,lastPaid:{base:n.lastMainGameBet.baseBet,multiplier:n.lastMainGameBet.betMultiplier}},balance:{coins:n.balanceInCoins,version:n.balanceVersion},freeRounds:(n.freeRounds??[]).map(o=>({conf:{base:o.conf.baseBet,multiplier:o.conf.betMultiplier,numAwarded:o.conf.numAwarded},data:{numPlayed:o.data.numPlayed,win:o.data.winAmount,numLeft:o.data.numLeft},id:o.id,rejectable:o.rejectable,skippable:o.skippable,status:o.status,type:o.type})),serverTime:n.serverTime,roundId:n.roundId,stateType:{thisRound:n.stateTypeThisRound,nextRound:n.stateTypeNextRound},uiMessages:n.uiMessages,win:{round:n.roundWin,total:n.totalWin}},data:t?t(e.opaqueGameServerToUi):e.opaqueGameServerToUi}}function Zo(e){return{code:e.data?.code??Ee.RgsErrorCode.UNKNOWN,details:e.data?.details}}const iu={parseAuthenticateResponse:Po,parseAuthenticateError:Oo,parseOpenGameResponse:$o,parseOpenGameError:Ro,parsePlayResponse:No,parsePlayError:Zo},su={aze:"az",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",lav:"lv",may:"ms",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"},{device:ru}=Y(navigator.userAgent),au=U("KalambaBullseyePlugin","color:#000000;font-weight:bold;");class cu extends Ao{socket;constructor(...t){super(...t),this.on("configured",n=>{this.socket.setRequestTimeoutMs(n.ui.requestTimeoutMs)})}initialize(t){this.socket=new nu(t,{gameVersion:this.config.gameVersion,requestTimeoutMs:this.sdkConfig.ui.requestTimeoutMs}),["fireboltroulette"].includes(t.gameCode)||(this.socket.addEventListener("close",n=>{n.code===1008?this.error||this.send("error",{type:"CLOSE",messageCode:"TOO_MANY_OPEN_GAMES",messageKey:"RgsError.TOO_MANY_OPEN_GAMES"}):n.code===1011?this.error||this.send("error",{type:"CLOSE",messageCode:"UNKNOWN",messageKey:"RgsError.UNKNOWN"}):this.reconnect()}),["mobile","tablet"].includes(ru.type??"")&&document.addEventListener("visibilitychange",async()=>{document.hidden||(this.socket.socket?this.socket.socket&&[WebSocket.CONNECTING,WebSocket.OPEN].includes(this.socket.socket.readyState)&&this.socket.close():this.reconnect())})),this.socket.addEventListener("error",n=>au("error",n)),this.socket.addEventListener("realityCheck",n=>{this.send("realityCheck",n)})}async reconnect(){try{await this.socket.connect(),await this.socket.authenticate(!0),await this.socket.openGame()}catch{this.send("error",{type:"CLOSE",messageCode:"CONNECTION_ERROR",messageKey:"RgsError.CONNECTION_ERROR"})}}async openGame(){const t=new URLSearchParams(window.location.search),n=t.get("apiUrl"),o=t.get("cageCode"),i=t.get("gameCode"),r=t.get("operatorCode"),s=t.get("playMode"),a=t.get("token"),c=t.get("username"),u=t.get("gameHistoryUrl"),f=t.get("homeUrl")??void 0,b=t.get("cashierUrl")??void 0;this.initialize({apiUrl:n,cageCode:o,gameCode:i,operatorCode:r,playMode:s,token:a,username:c});try{await this.socket.connect()}catch{throw{type:"error",data:{code:Ee.RgsErrorCode.CONNECTION_ERROR}}}let v;try{v=await this.socket.authenticate()}catch(G){throw{type:G.type,data:G.type==="error"?Oo(G.data):void 0}}let k;try{k=await this.socket.openGame()}catch(G){throw{type:G.type,data:G.type==="error"?Ro(G.data):void 0}}const C=Po(v),F=$o(v,k,this.config.dataDecoder&&tt.decoders[this.config.dataDecoder]);this.sdkConfig.api={...this.sdkConfig.api,brand:o,game:i,integration:r,jurisdiction:C.contract.jurisdiction,playMode:s,user:C.contract.username,integrationData:{token:a},country:C.contract.country,currency:C.contract.currency,coinValueInCents:C.contract.coinValueInCents,gameHistoryUrl:u,homeUrl:f,cashierUrl:b,backendSessionId:F.contract.sessionId};const L=t.get("languageCode")?.split("_")?.[0];return L&&(this.sdkConfig.ui.language=L.length===3?su[L]??L:L),F}async play(t){for(;!this.socket.socket;)await new Promise(b=>setTimeout(()=>b(),500));const{contract:{bet:n,forcedOutcomes:o,...i},extra:r,payloadToInject:s}=t,a=this.config.dataEncoder&&tt.encoders[this.config.dataEncoder],c=n===null?"BG_ACTION":"SPIN",u={bet:n?{baseBet:n.base,betMultiplier:n.multiplier}:void 0,forcedOutcomes:o,...i,...s,opaqueUiToGameServer:a?a(r):r};let f;try{f=await this.socket.sendAction(c,u)}catch(b){throw{type:b.type,data:b.type==="error"?Zo(b.data):void 0}}return No(f,this.config.dataDecoder&&tt.decoders[this.config.dataDecoder])}async freeRounds(t){try{await this.socket.freeRounds(t)}catch{throw{type:"error",data:{code:Ee.RgsErrorCode.UNKNOWN}}}return t}async getBalance(){try{return{balance:(await this.socket.getBalance()).balance}}catch{throw{type:"error",data:{code:Ee.RgsErrorCode.UNKNOWN}}}}async showHistory(){const{api:{game:t,integration:n,integrationData:o,jurisdiction:i,user:r,gameHistoryUrl:s},ui:{language:a}}=this.sdkConfig,c=r.replace(/^user_/,"").replace(new RegExp(`_${n}$`),""),u=new URL(window.location.href);u.hostname=u.hostname.replace(/^v\./,"").replace(/^play\./,"history."),u.pathname=u.pathname.replace(/(\/[0-9]+\.[0-9]+\.[0-9]+)?\/wrapper\.html/,"/list/index.html"),u.search="",u.searchParams.set("apiUrl",new URL(s).origin),u.searchParams.set("gameCode",t),i&&u.searchParams.set("jurisdiction",i),u.searchParams.set("operatorCode",n),u.searchParams.set("token",o.token),u.searchParams.set("username",c),u.searchParams.set("languageCode",a),this.config.gameHistoryUrl&&u.searchParams.set("gameHistoryUrl",this.config.gameHistoryUrl),window.open(u.toString(),"_blank")}}class Fo{trackers;config;sdkConfig;constructor(t,n,o){this.trackers=t,this.config=n,this.sdkConfig=o}on(t,n,o){const i=function(s){s.data.message!==`kalamba:wrapper-telemetry:${t}`&&s.data.message!==`kalamba:wrapper:${t}`||n(s.data.payload)};window.addEventListener("message",i,o)}track(t,n){this.trackers.forEach(o=>o.track(t,n))}}function Jn(e){return e.reduce((t,n)=>t+n,0)}function uu(e){const t=e.length,n=Jn(e)/t,o=e.map(r=>Math.pow(r-n,2)),i=Jn(o)/t;return Math.sqrt(i)}class Xn{rafId=-1;startTime=0;stopTime=0;frames=[];calculateFPS=()=>{const t=Math.floor((this.stopTime-this.startTime)/1e3);return this.frames.map(n=>Math.floor((n-this.startTime)/1e3)).reduce((n,o,i,r)=>(r[i]!==r[i-1]?n.push(1):n[n.length-1]++,n),[]).slice(0,t)};getReport=()=>{const t=this.calculateFPS(),n=Math.floor(this.frames.length/((this.stopTime-this.startTime)/1e3)),o=t.length>0?Math.max(...t):n,i=t.length>0?Math.min(...t):n,r=t.length>0?uu(t):0;return{fpsAvg:n,fpsMax:o,fpsMin:i,fpsStdDev:r}};start=()=>{this.startTime=Date.now(),this.frames=[],this.trackFrames()};stop=()=>{cancelAnimationFrame(this.rafId),this.stopTime=Date.now()};trackFrames=()=>{this.frames.push(Date.now()),this.rafId=requestAnimationFrame(this.trackFrames)}}const du="landscape",lu="portrait";function pu(){try{const e=document.createElement("canvas");return!!window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl"))instanceof WebGLRenderingContext}catch{return!1}}async function hu(){if(!window.createImageBitmap)return!1;const n=await(await fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=")).blob();try{return await createImageBitmap(n),!0}catch{return!1}}function Nt(){return window.innerWidth>=window.innerHeight?du:lu}class gu extends Fo{FPS_SAMPLE_INTERVAL=1e4;#o=0;#e;#t;#i;#n=!1;#c=!1;#s="";#r=[];constructor(...t){super(...t),this.#t={},this.#i=this.deviceInfo(),this.#e=this.config.gameVersion,this.on("state",({balance:n})=>{this.#o=n}),this.on("autoplay",({action:n})=>{["start","resume"].includes(n)?this.#n=!0:this.#n=!1}),this.on("settings",({fastPlay:n})=>{n!==void 0&&(this.#c=n)}),this.registerEvents()}async registerEvents(){this.#i.then(t=>{this.track("Device Information",t)}),this.on("loadStart",()=>{this.track("Game Loading",{progress:0,step:"initial"})}),this.on("loadProgress",t=>{this.track("Game Loading",{progress:t.progress})}),this.on("loadEnd",()=>{this.track("Game Loading",{progress:100,step:"complete"})}),this.on("error",t=>{this.track("System Message",{systemMessageText:t.messageCode,systemMessageType:t.type})}),this.on("openGameResponse",async t=>{this.#s=t.contract.stateType.nextRound,this.#t={balanceInCoins:t.contract.balance.coins,clientVersion:this.#e,coinValueInCents:this.sdkConfig.api.coinValueInCents,coinValueInCentsFloat:this.sdkConfig.api.coinValueInCents,currency:this.sdkConfig.api.currency,defaultBaseBet:t.contract.bet.default.base,defaultBetMultiplier:t.contract.bet.default.multiplier,environment:"release",gameCode:this.sdkConfig.api.game,gameCodeServer:this.sdkConfig.api.game,gameModelFile:t.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,rootTrackingSessionID:this.sdkConfig.api.sessionId,backendSessionID:this.sdkConfig.api.backendSessionId,serverVersion:t.contract.metaData.version},this.track("Game Open",this.#t)}),this.on("playCycleEnd",async t=>{const n=await this.#i,{base:o,multiplier:i}=t.contract.bet.lastPaid??{},r=t.contract.balance.coins,s=t.contract.bet.lastPaid.base*t.contract.bet.lastPaid.multiplier,a=t.contract.win.total,c=a-s,u="spin",f=t.contract.roundId;this.track("Betting Activity",{balance:r-c,balanceAfter:r,baseBet:o,betMultiplier:i,betType:u,gameVersion:this.#e,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:n.isMobile,netResult:c,operatorName:"kalamba",orientation:Nt(),partnerId:this.sdkConfig.api.brand,partnerParentId:this.sdkConfig.api.integration,platform:"WEB",playMode:this.sdkConfig.api.playMode,roundId:f,roundTypes:["BaseGame"],totalBet:s,totalWin:a}),this.#r=[]}),this.on("telemetry.click",t=>{this.track("UI Interaction",{action:"click",...this.getExtraUiInteractionData(),...t})}),this.on("telemetry.orientationChange",()=>{this.track("UI Interaction",{action:"orientationChange",...this.getExtraUiInteractionData()})}),this.reportFpsSample(),this.reportFpsRound()}reportFpsSample(){const t=new Xn,n=()=>{t.stop();const i=t.getReport();this.track("FPS Performance",{...i,fpsType:"sample"}),o()},o=async()=>{t.start(),setTimeout(n,this.FPS_SAMPLE_INTERVAL)};o()}reportFpsRound(){const t=new Xn;this.on("playCycleStart",()=>{t.start()}),this.on("playCycleEnd",()=>{t.stop();const n=t.getReport();this.track("FPS Performance",{...n,fpsType:"playCycleStart->playCycleEnd"})})}getExtraUiInteractionData(){return{orientation:Nt(),stateType:this.#s}}async deviceInfo(){const{browser:t,device:n,os:o}=Y(navigator.userAgent),i=pu(),r=await hu();return{browserName:t.name,browserVersion:t.version,connection:navigator.connection?.effectiveType,deviceName:n.model,deviceType:n.type,isMobile:["mobile","tablet"].includes(n.type??""),isWebGLSupported:i,isWebPSupported:r,manufacturer:n.vendor,operatingSystem:o.name,operatingSystemVersion:o.version,orientation:Nt(),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}}}var mu=Ht.requireNoop();const Yn=Ht.getDefaultExportFromCjs(mu);class sn{config;sdkConfig;constructor(t,n){this.config=t,this.sdkConfig=n}}const Qn=25,eo=1e4;class fu extends sn{#o="https://europe-west3-stargazer-328808.cloudfunctions.net/collect-events";#e;#t;#i=[];processQueueForced;constructor(...t){super(...t),this.#e=new Date().getTime(),this.#i=[],this.processQueueForced=this.processQueue.bind(this,!0),this.schedule(),fetch(this.#o,{method:"OPTIONS"}).catch(Yn),this.subscribe()}subscribe(){window.addEventListener("beforeunload",this.processQueueForced,!1),window.addEventListener("pagehide",this.processQueueForced,!1),window.addEventListener("visibilitychange",this.processQueueForced,!1)}schedule(){this.#t&&clearTimeout(this.#t),this.#t=window.setTimeout(()=>this.processQueue(),eo)}send(t){this.#e=new Date().getTime();try{navigator.sendBeacon(this.#o,JSON.stringify(t))}catch{fetch(this.#o,{body:JSON.stringify(t),method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0}).catch(Yn)}this.schedule()}addToQueue(t){this.#i.push(t),this.processQueue()}processQueue(t=!1){if(!(this.sdkConfig==null||!this.sdkConfig.ui.feature.allowTelemetry)&&!(!t&&this.#i.length<Qn&&new Date().getTime()-this.#e<eo))for(;this.#i.length;){const n=this.#i.splice(0,Qn).map(o=>({...o,sessionID:this.sdkConfig.api.sessionId,userID:this.sdkConfig.api.user}));this.send(n)}}track(t,n){this.addToQueue({eventName:t,eventParams:n,eventTimestamp:new Date().getTime(),eventUUID:Ht.v4()})}}const bu=U("LoggingTracker","color:#000000;font-weight:bold;");class wu extends sn{track(t,n){bu(`@${this.sdkConfig.api.user}`,`[${t}]`,n)}}exports.BasicPlugin=Lo;exports.BspotPlugin=Vt;exports.CasinoPlugin=B;exports.DebuggingPlugin=Ic;exports.EveryMatrixPlugin=Uc;exports.GigPlugin=zc;exports.KalambaBullseyeParsers=iu;exports.KalambaBullseyePlugin=cu;exports.KalambaStargazerPlugin=gu;exports.KalambaStargazerTracker=fu;exports.LoggingTracker=wu;exports.OryxPlugin=Mc;exports.PariplayPlugin=$c;exports.QuantaPlugin=Zc;exports.RelaxFEIMPlugin=Rc;exports.RgsPlugin=Ao;exports.SoftSwissPlugin=Fc;exports.TelemetryPlugin=Fo;exports.Tracker=sn;exports.TukoPlugin=Nc;