From 7483737572d3a4bbb3f4886aa3710c0dfaf8cd8d Mon Sep 17 00:00:00 2001 From: davitsedrakian Date: Tue, 1 Sep 2026 10:39:03 +0000 Subject: [PATCH] Automated Extension submission for issue #2253 --- extensions/reviewed/PlaygamaBridge.json | 2620 +++++++++++++---------- 1 file changed, 1491 insertions(+), 1129 deletions(-) diff --git a/extensions/reviewed/PlaygamaBridge.json b/extensions/reviewed/PlaygamaBridge.json index 757e5648e..aab477b07 100644 --- a/extensions/reviewed/PlaygamaBridge.json +++ b/extensions/reviewed/PlaygamaBridge.json @@ -1,7 +1,6 @@ { "author": "Playgama", "category": "Ads", - "dimension": "", "extensionNamespace": "", "fullName": "Playgama Bridge", "gdevelopVersion": "", @@ -10,10 +9,10 @@ "name": "PlaygamaBridge", "previewIconUrl": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMTcgMTU0LjM2MlY5Ni4wMDAxSDIyMy4xMjlWNDE2SDExN1YzNTkuMjU0SDE1OC40NFYxNTQuMzYySDExN1oiIGZpbGw9ImJsYWNrIi8+CjxwYXRoIGQ9Ik0zOTUgMTU0LjM2MlY5NkgyODguODcxVjQxNkgzOTVWMzU5LjI1NEgzNTMuNTZWMTU0LjM2MkgzOTVaIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4K", "shortDescription": "One SDK for cross-platform publishing HTML5 games.", - "version": "1.31.0", + "version": "2.1.0", "description": [ "One SDK for cross-platform publishing HTML5 games. ", - "Please refer to [Playgama documentation](https://wiki.playgama.com/playgama/sdk/getting-started) for detailed guidance." + "Please refer to [Playgama documentation](https://wiki.playgama.com/playgama/sdk/engines/gdevelop) for detailed guidance." ], "origin": { "identifier": "PlaygamaBridge", @@ -63,22 +62,10 @@ " isLastActionCompletedSuccessfully: false,", " actionParametersContainer: {},", "", - " // game", - " isVisibilityStateChanged: false,", - " visibilityState: null,", - " prevVisibilityState: null,", - " visibilityStateStack: [],", - "", " // platform", " serverTime: 0,", " isGetServerTimeCompleted: false,", " nextIsGetServerTimeCompleted: false,", - " allGames: [],", - " gameById: null,", - " isGetAllGamesCompleted: false,", - " nextIsGetAllGamesCompleted: false,", - " isGetGameByIdCompleted: false,", - " nextIsGetGameByIdCompleted: false,", " isPlatformAudioStateChanged: false,", " platformAudioStateStack: [],", " platformAudioState: null,", @@ -167,16 +154,49 @@ " // achievements", " isAchievementsUnlockCompleted: false,", " isAchievementsGetListCompleted: false,", - " isAchievementsShowNativePopupCompleted: false,", " nextIsAchievementsUnlockCompleted: false,", " nextIsAchievementsGetListCompleted: false,", - " nextIsAchievementsShowNativePopupCompleted: false,", " achievementsList: [],", "", + " // tasks", + " isTasksGetTasksCompleted: false,", + " nextIsTasksGetTasksCompleted: false,", + " isTasksAddProgressCompleted: false,", + " nextIsTasksAddProgressCompleted: false,", + " isTasksClaimRewardCompleted: false,", + " nextIsTasksClaimRewardCompleted: false,", + " tasksList: [],", + "", + " // daily rewards", + " isDailyRewardsGetRewardsCompleted: false,", + " nextIsDailyRewardsGetRewardsCompleted: false,", + " isDailyRewardsGetCurrentDayCompleted: false,", + " nextIsDailyRewardsGetCurrentDayCompleted: false,", + " isDailyRewardsGetCurrentRewardCompleted: false,", + " nextIsDailyRewardsGetCurrentRewardCompleted: false,", + " isDailyRewardsClaimCurrentRewardCompleted: false,", + " nextIsDailyRewardsClaimCurrentRewardCompleted: false,", + " dailyRewardsList: [],", + " dailyRewardsCurrentDay: 0,", + " dailyRewardsCurrentReward: null,", + "", " // remote", " remoteConfig: {},", " isRemoteConfigGotCompleted: false,", " nextIsRemoteConfigGotCompleted: false,", + "", + " // cross-promo", + " crossPromoGames: [],", + " isGetGamesListCompleted: false,", + " nextIsGetGamesListCompleted: false,", + "", + " // notifications", + " isNotificationsScheduleCompleted: false,", + " nextIsNotificationsScheduleCompleted: false,", + " isNotificationsCancelCompleted: false,", + " nextIsNotificationsCancelCompleted: false,", + " isNotificationsCancelAllCompleted: false,", + " nextIsNotificationsCancelAllCompleted: false,", "}", "", "// utils", @@ -215,6 +235,7 @@ "function initializeBridge() {", " clearTimeout(bridgeTimeout)", " bridge.engine = 'gdevelop'", + " bridge.gameVersion = gdjs.projectData.properties.version", " bridge.initialize(bridgeOptions)", " .then(() => {", " bridge.advertisement.on('banner_state_changed', state => {", @@ -234,10 +255,6 @@ " gdjs._playgamaBridgeExtension.advancedBannersStateStack.push(state);", " });", "", - " bridge.game.on('visibility_state_changed', state => {", - " gdjs._playgamaBridgeExtension.visibilityStateStack.push(state)", - " });", - "", " bridge.platform.on('audio_state_changed', state => {", " gdjs._playgamaBridgeExtension.platformAudioStateStack.push(state)", " });", @@ -247,17 +264,6 @@ " });", "", " function updateState() {", - " // visibility", - " if (gdjs._playgamaBridgeExtension.visibilityStateStack.length > 0) {", - " gdjs._playgamaBridgeExtension.visibilityState = gdjs._playgamaBridgeExtension.visibilityStateStack.shift();", - " }", - "", - " gdjs._playgamaBridgeExtension.isVisibilityStateChanged = gdjs._playgamaBridgeExtension.visibilityState !== gdjs._playgamaBridgeExtension.prevVisibilityState;", - "", - " if (gdjs._playgamaBridgeExtension.isVisibilityStateChanged) {", - " gdjs._playgamaBridgeExtension.prevVisibilityState = gdjs._playgamaBridgeExtension.visibilityState;", - " }", - "", " // advertisement", " if (gdjs._playgamaBridgeExtension.bannerStateStack.length > 0) {", " gdjs._playgamaBridgeExtension.bannerState = gdjs._playgamaBridgeExtension.bannerStateStack.shift();", @@ -338,20 +344,13 @@ " gdjs._playgamaBridgeExtension.nextIsGetServerTimeCompleted = false;", " }", "", - " if (gdjs._playgamaBridgeExtension.isGetAllGamesCompleted !== gdjs._playgamaBridgeExtension.nextIsGetAllGamesCompleted) {", - " gdjs._playgamaBridgeExtension.isGetAllGamesCompleted = gdjs._playgamaBridgeExtension.nextIsGetAllGamesCompleted", - " }", - "", - " if (gdjs._playgamaBridgeExtension.nextIsGetAllGamesCompleted) {", - " gdjs._playgamaBridgeExtension.nextIsGetAllGamesCompleted = false;", + " // cross-promo", + " if (gdjs._playgamaBridgeExtension.isGetGamesListCompleted !== gdjs._playgamaBridgeExtension.nextIsGetGamesListCompleted) {", + " gdjs._playgamaBridgeExtension.isGetGamesListCompleted = gdjs._playgamaBridgeExtension.nextIsGetGamesListCompleted", " }", "", - " if (gdjs._playgamaBridgeExtension.isGetGameByIdCompleted !== gdjs._playgamaBridgeExtension.nextIsGetGameByIdCompleted) {", - " gdjs._playgamaBridgeExtension.isGetGameByIdCompleted = gdjs._playgamaBridgeExtension.nextIsGetGameByIdCompleted", - " }", - "", - " if (gdjs._playgamaBridgeExtension.nextIsGetGameByIdCompleted) {", - " gdjs._playgamaBridgeExtension.nextIsGetGameByIdCompleted = false;", + " if (gdjs._playgamaBridgeExtension.nextIsGetGamesListCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsGetGamesListCompleted = false;", " }", "", " // storage", @@ -520,12 +519,62 @@ " gdjs._playgamaBridgeExtension.nextIsAchievementsGetListCompleted = false;", " }", "", - " if (gdjs._playgamaBridgeExtension.isAchievementsShowNativePopupCompleted !== gdjs._playgamaBridgeExtension.nextIsAchievementsShowNativePopupCompleted) {", - " gdjs._playgamaBridgeExtension.isAchievementsShowNativePopupCompleted = gdjs._playgamaBridgeExtension.nextIsAchievementsShowNativePopupCompleted", + " // tasks", + " if (gdjs._playgamaBridgeExtension.isTasksGetTasksCompleted !== gdjs._playgamaBridgeExtension.nextIsTasksGetTasksCompleted) {", + " gdjs._playgamaBridgeExtension.isTasksGetTasksCompleted = gdjs._playgamaBridgeExtension.nextIsTasksGetTasksCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsTasksGetTasksCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsTasksGetTasksCompleted = false;", + " }", + "", + " if (gdjs._playgamaBridgeExtension.isTasksAddProgressCompleted !== gdjs._playgamaBridgeExtension.nextIsTasksAddProgressCompleted) {", + " gdjs._playgamaBridgeExtension.isTasksAddProgressCompleted = gdjs._playgamaBridgeExtension.nextIsTasksAddProgressCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsTasksAddProgressCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsTasksAddProgressCompleted = false;", + " }", + "", + " if (gdjs._playgamaBridgeExtension.isTasksClaimRewardCompleted !== gdjs._playgamaBridgeExtension.nextIsTasksClaimRewardCompleted) {", + " gdjs._playgamaBridgeExtension.isTasksClaimRewardCompleted = gdjs._playgamaBridgeExtension.nextIsTasksClaimRewardCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsTasksClaimRewardCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsTasksClaimRewardCompleted = false;", + " }", + "", + " // daily rewards", + " if (gdjs._playgamaBridgeExtension.isDailyRewardsGetRewardsCompleted !== gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetRewardsCompleted) {", + " gdjs._playgamaBridgeExtension.isDailyRewardsGetRewardsCompleted = gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetRewardsCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetRewardsCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetRewardsCompleted = false;", + " }", + "", + " if (gdjs._playgamaBridgeExtension.isDailyRewardsGetCurrentDayCompleted !== gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentDayCompleted) {", + " gdjs._playgamaBridgeExtension.isDailyRewardsGetCurrentDayCompleted = gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentDayCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentDayCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentDayCompleted = false;", " }", "", - " if (gdjs._playgamaBridgeExtension.nextIsAchievementsShowNativePopupCompleted) {", - " gdjs._playgamaBridgeExtension.nextIsAchievementsShowNativePopupCompleted = false;", + " if (gdjs._playgamaBridgeExtension.isDailyRewardsGetCurrentRewardCompleted !== gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentRewardCompleted) {", + " gdjs._playgamaBridgeExtension.isDailyRewardsGetCurrentRewardCompleted = gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentRewardCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentRewardCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentRewardCompleted = false;", + " }", + "", + " if (gdjs._playgamaBridgeExtension.isDailyRewardsClaimCurrentRewardCompleted !== gdjs._playgamaBridgeExtension.nextIsDailyRewardsClaimCurrentRewardCompleted) {", + " gdjs._playgamaBridgeExtension.isDailyRewardsClaimCurrentRewardCompleted = gdjs._playgamaBridgeExtension.nextIsDailyRewardsClaimCurrentRewardCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsDailyRewardsClaimCurrentRewardCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsDailyRewardsClaimCurrentRewardCompleted = false;", " }", "", " // remote configs", @@ -536,6 +585,31 @@ " if (gdjs._playgamaBridgeExtension.nextIsRemoteConfigGotCompleted) {", " gdjs._playgamaBridgeExtension.nextIsRemoteConfigGotCompleted = false;", " }", + "", + " // notifications", + " if (gdjs._playgamaBridgeExtension.isNotificationsScheduleCompleted !== gdjs._playgamaBridgeExtension.nextIsNotificationsScheduleCompleted) {", + " gdjs._playgamaBridgeExtension.isNotificationsScheduleCompleted = gdjs._playgamaBridgeExtension.nextIsNotificationsScheduleCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsNotificationsScheduleCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsNotificationsScheduleCompleted = false;", + " }", + "", + " if (gdjs._playgamaBridgeExtension.isNotificationsCancelCompleted !== gdjs._playgamaBridgeExtension.nextIsNotificationsCancelCompleted) {", + " gdjs._playgamaBridgeExtension.isNotificationsCancelCompleted = gdjs._playgamaBridgeExtension.nextIsNotificationsCancelCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsNotificationsCancelCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsNotificationsCancelCompleted = false;", + " }", + "", + " if (gdjs._playgamaBridgeExtension.isNotificationsCancelAllCompleted !== gdjs._playgamaBridgeExtension.nextIsNotificationsCancelAllCompleted) {", + " gdjs._playgamaBridgeExtension.isNotificationsCancelAllCompleted = gdjs._playgamaBridgeExtension.nextIsNotificationsCancelAllCompleted", + " }", + "", + " if (gdjs._playgamaBridgeExtension.nextIsNotificationsCancelAllCompleted) {", + " gdjs._playgamaBridgeExtension.nextIsNotificationsCancelAllCompleted = false;", + " }", " }", "", " gdjs.registerRuntimeScenePostEventsCallback(updateState)", @@ -560,7 +634,7 @@ "}", "", "bridgeScript = document.createElement('script')", - "bridgeScript.src = 'https://bridge.playgama.com/v1/stable/playgama-bridge.js'", + "bridgeScript.src = 'https://bridge.playgama.com/v2/stable/playgama-bridge.js'", "bridgeScript.onload = initializeBridge", "bridgeScript.onerror = addLocalBridge", "", @@ -572,7 +646,7 @@ "document.head.appendChild(bridgeScript)", "", "function evalLocalScript() {", - " (()=>{\"use strict\";var t={446:(t,e,r)=>{function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)}(t)||function(t,e){if(!t)return;if(\"string\"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===r&&t.constructor&&(r=t.constructor.name);if(\"Map\"===r||\"Set\"===r)return Array.from(t);if(\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?r-1:0),i=1;iu,aA:()=>i,iL:()=>s});var a={};function s(t){t.on=function(t,e){a.on(t,e)},t.off=function(t,e){a.off(t,e)},t.once=function(t,e){a.once(t,e)}}i(a);const u=a},166:(t,e,r)=>{function n(t){return n=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},n(t)}function o(t,e){for(var r=0;rh});var l=new WeakMap,f=new WeakMap,p=new WeakMap;const h=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),a(this,l,{writable:!0,value:void 0}),a(this,f,{writable:!0,value:void 0}),a(this,p,{writable:!0,value:void 0}),s(this,l,new Promise((function(t,r){s(e,f,t),s(e,p,r)})))}var e,r,n;return e=t,(r=[{key:\"promise\",get:function(){return u(this,l)}},{key:\"resolve\",value:function(t){u(this,f).call(this,t)}},{key:\"reject\",value:function(t){u(this,p).call(this,t)}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),t}()},383:(t,e,r)=>{r.d(e,{$H:()=>_,CS:()=>C,D1:()=>k,DQ:()=>b,Dz:()=>m,QG:()=>g,R2:()=>j,RH:()=>A,SC:()=>N,Tg:()=>R,XA:()=>y,X_:()=>S,ZP:()=>O,ZT:()=>f,dG:()=>v,dY:()=>w,eE:()=>I,f_:()=>d,fn:()=>M,fr:()=>L,kM:()=>h,my:()=>T,n_:()=>D,pb:()=>p,t0:()=>P});var n=r(843);function o(t){return o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},o(t)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:\"undefined\"!=typeof Symbol&&t[Symbol.iterator]||t[\"@@iterator\"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(!t)return;if(\"string\"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===r&&t.constructor&&(r=t.constructor.name);if(\"Map\"===r||\"Set\"===r)return Array.from(t);if(\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t,e)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=document.createElement(\"script\");o.src=t;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(t,a){var c=document.createElement(\"script\");c.src=\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\",c.setAttribute(\"data-ad-client\",e),r?c.setAttribute(\"data-ad-channel\",r):n&&c.setAttribute(\"data-ad-host\",n),o&&c.setAttribute(\"data-admob-interstitial-slot\",o),i&&c.setAttribute(\"data-admob-rewarded-slot\",i),l&&c.setAttribute(\"data-adbreak-test\",\"on\"),c.setAttribute(\"data-ad-frequency-hint\",s),c.setAttribute(\"crossorigin\",\"anonymous\"),c.addEventListener(\"load\",(function(){window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push(u({preloadAdBreaks:\"on\",sound:\"on\",onReady:function(){}},f)),t((function(t){return window.adsbygoogle.push(t)}))})),c.addEventListener(\"error\",(function(){a(new Error(\"adsbygoogle script failed to load\"))})),document.head.appendChild(c)}))};function h(t){var e=document.createElement(\"div\");switch(e.id=n._g,e.style.position=\"absolute\",document.body.appendChild(e),t){case n.Cb.TOP:e.style.top=\"0px\",e.style.height=\"90px\",e.style.width=\"100%\";break;case n.Cb.BOTTOM:default:e.style.bottom=\"0px\",e.style.height=\"90px\",e.style.width=\"100%\"}return e}function d(t){var e=[];return t.forEach((function(t,r){var o=document.createElement(\"div\"),i=\"\".concat(n.Qh).concat(r);o.id=i,o.style.position=\"absolute\",o.style.zIndex=\"9999\",t.width&&(o.style.width=t.width),t.height&&(o.style.height=t.height),t.top&&(o.style.top=t.top),t.bottom&&(o.style.bottom=t.bottom),t.left&&(o.style.left=t.left),t.right&&(o.style.right=t.right),document.body.appendChild(o),e.push(i)})),e}function y(){document.querySelectorAll('[id^=\"'.concat(n.Qh,'\"]')).forEach((function(t){return t.remove()}))}function m(){var t=document.createElement(\"div\");t.style.position=\"fixed\",t.style.top=\"0\",t.style.left=\"0\",t.style.width=\"100vw\",t.style.height=\"100vh\",t.style.backgroundColor=\"rgba(0, 0, 0, 0.5)\",t.style.display=\"flex\",t.style.justifyContent=\"center\",t.style.alignItems=\"center\",t.style.zIndex=\"9999\",t.id=\"loading-overlay\";var e=document.createElement(\"div\");return e.style.fontSize=\"24px\",e.style.color=\"#fff\",e.innerText=\"Loading...\",t.appendChild(e),t}function v(){if(!document.getElementById(\"bridge-orientation-overlay-styles\")){var t=document.createElement(\"style\");t.id=\"bridge-orientation-overlay-styles\",t.textContent=\"\\n #\".concat(n.Uw,\" {\\n position: fixed;\\n top: 0;\\n left: 0;\\n width: 100vw;\\n height: 100vh;\\n background-color: rgba(0, 0, 0, 0.95);\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n z-index: 9999999;\\n }\\n\\n #bridge-orientation-icon {\\n width: 80px;\\n height: 80px;\\n animation: bridge-rotate-phone 1.5s ease-in-out infinite;\\n }\\n\\n #bridge-orientation-message {\\n color: #fff;\\n font-size: 18px;\\n font-family: Arial, sans-serif;\\n margin-top: 20px;\\n text-align: center;\\n }\\n\\n @keyframes bridge-rotate-phone {\\n 0%, 100% { transform: rotate(0deg); }\\n 50% { transform: rotate(90deg); }\\n }\\n \"),document.head.appendChild(t)}var e=document.createElement(\"div\");e.id=n.Uw;var r=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");r.setAttribute(\"id\",\"bridge-orientation-icon\"),r.setAttribute(\"viewBox\",\"0 0 24 24\"),r.setAttribute(\"fill\",\"none\"),r.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\"),r.innerHTML='\\n \\n \\n ';var o=document.createElement(\"div\");return o.id=\"bridge-orientation-message\",o.innerText=\"Please rotate your device\",e.appendChild(r),e.appendChild(o),e}function g(t){if(!document.getElementById(\"bridge-info-popup-styles\")){var e=document.createElement(\"style\");e.id=\"bridge-info-popup-styles\",e.textContent=\"\\n #bridge-info-popup-overlay {\\n position: fixed;\\n inset: 0;\\n display: none;\\n align-items: center;\\n justify-content: center;\\n padding: 18px;\\n background: rgba(0, 0, 0, 0.24);\\n z-index: 9999;\\n }\\n\\n #bridge-info-popup {\\n width: min(92vw, 320px);\\n padding: 24px 20px 20px;\\n border-radius: 26px;\\n background: #ffffff;\\n color: #24304d;\\n text-align: center;\\n box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);\\n font-family: Inter, Arial, sans-serif;\\n }\\n\\n #bridge-info-popup-emoji {\\n font-size: 42px;\\n margin-bottom: 10px;\\n line-height: 1;\\n }\\n\\n #bridge-info-popup-title {\\n margin: 0 0 10px;\\n font-size: 24px;\\n line-height: 1.1;\\n }\\n\\n #bridge-info-popup-message {\\n margin: 0 0 18px;\\n font-size: 15px;\\n line-height: 1.45;\\n color: #66708b;\\n }\\n\\n #bridge-info-popup-button {\\n min-width: 140px;\\n height: 46px;\\n padding: 0 24px;\\n border: 0;\\n border-radius: 999px;\\n font-weight: 700;\\n font-size: 15px;\\n color: #ffffff;\\n background: linear-gradient(180deg, #5f8cff, #4c71e6);\\n box-shadow: 0 8px 20px rgba(76, 113, 230, 0.32);\\n cursor: pointer;\\n font-family: Inter, Arial, sans-serif;\\n }\\n\\n #bridge-info-popup-button:active {\\n transform: translateY(1px);\\n }\",document.head.appendChild(e)}var r=document.getElementById(\"bridge-info-popup-overlay\");r||((r=document.createElement(\"div\")).id=\"bridge-info-popup-overlay\",document.body.appendChild(r));var n=document.getElementById(\"bridge-info-popup\");n||((n=document.createElement(\"div\")).id=\"bridge-info-popup\",r.appendChild(n)),n.innerHTML=\"\";var o=document.createElement(\"div\");o.id=\"bridge-info-popup-emoji\",o.textContent=\"🎬\",n.appendChild(o);var i=document.createElement(\"h3\");i.id=\"bridge-info-popup-title\",i.textContent=t,n.appendChild(i);var a=document.createElement(\"button\");return a.id=\"bridge-info-popup-button\",a.textContent=\"Continue\",n.appendChild(a),new Promise((function(t){a.onclick=function(){r.style.display=\"none\",t()},r.style.display=\"flex\"}))}function b(){if(!document.getElementById(\"bridge-ad-failure-popup-fonts\")){var t=document.createElement(\"link\");t.rel=\"preconnect\",t.href=\"https://fonts.googleapis.com\",document.head.appendChild(t);var e=document.createElement(\"link\");e.rel=\"preconnect\",e.href=\"https://fonts.gstatic.com\",e.crossOrigin=\"anonymous\",document.head.appendChild(e);var r=document.createElement(\"link\");r.id=\"bridge-ad-failure-popup-fonts\",r.rel=\"stylesheet\",r.href=\"https://fonts.googleapis.com/css2?family=Cal+Sans&display=swap\",document.head.appendChild(r)}if(!document.getElementById(\"bridge-ad-failure-popup-styles\")){var n=document.createElement(\"style\");n.id=\"bridge-ad-failure-popup-styles\",n.textContent=\"\\n #bridge-ad-failure-popup {\\n position: fixed;\\n top: 0;\\n left: 0;\\n height: 100%;\\n width: 100%;\\n box-sizing: border-box;\\n padding: 24px 16px;\\n background: #682eb2;\\n display: none;\\n grid-template-columns: 1fr 1fr;\\n grid-template-rows: 32px 1fr;\\n z-index: 9999999;\\n font-family: 'Cal Sans', -apple-system, BlinkMacSystemFont, sans-serif;\\n color: #fff;\\n cursor: pointer;\\n }\\n\\n #bridge-ad-failure-popup-logo {\\n height: 32px;\\n }\\n\\n #bridge-ad-failure-popup-close {\\n all: unset;\\n cursor: pointer;\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n width: 32px;\\n height: 32px;\\n background: #fff;\\n border-radius: 50%;\\n justify-self: end;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n grid-column: span 2;\\n font-size: 21px;\\n font-style: normal;\\n font-weight: 400;\\n line-height: 110%;\\n align-self: end;\\n margin: 0;\\n }\\n\\n @media (min-width: 320px) {\\n #bridge-ad-failure-popup {\\n padding: 24px;\\n grid-template-rows: 40px 1fr;\\n }\\n\\n #bridge-ad-failure-popup-logo {\\n height: 40px;\\n }\\n\\n #bridge-ad-failure-popup-close {\\n width: 40px;\\n height: 40px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n font-size: 25px;\\n align-self: center;\\n }\\n }\\n\\n @media (orientation: landscape) {\\n #bridge-ad-failure-popup {\\n gap: 40px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n width: 60%;\\n align-self: start;\\n }\\n }\\n\\n @media (orientation: landscape) and (min-width: 800px) {\\n #bridge-ad-failure-popup {\\n gap: 80px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n width: 50%;\\n font-size: 33px;\\n }\\n }\\n \",document.head.appendChild(n)}var o=document.getElementById(\"bridge-ad-failure-popup\");if(!o){(o=document.createElement(\"div\")).id=\"bridge-ad-failure-popup\";var i=document.createElement(\"div\");i.innerHTML='\\n \\n \\n \\n \\n ',o.appendChild(i);var a=document.createElement(\"button\");a.id=\"bridge-ad-failure-popup-close\",a.innerHTML='\\n \\n \\n \\n ',o.appendChild(a);var s=document.createElement(\"p\");s.id=\"bridge-ad-failure-popup-text\",o.appendChild(s),document.body.appendChild(o)}var u=document.getElementById(\"bridge-ad-failure-popup-close\");return new Promise((function(t){var e=function(){o.style.display=\"none\",t()};u.onclick=e,o.onclick=e;var r=[\"If you see this message, no Ad was returned for the Ad request.

Please ask the developer to check the Ad setup.\",\"This is placeholder for the Ad. Playgama helps games reach players worldwide.\"];document.getElementById(\"bridge-ad-failure-popup-text\").innerHTML=r[Math.floor(Math.random()*r.length)],o.style.display=\"grid\"}))}function _(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.createElement(\"style\");r.textContent=\"\\n .fullscreen {\\n background: #242424;\\n width: 100vw;\\n height: 100vh;\\n position: absolute;\\n top: 0px;\\n left: 0px;\\n }\\n\\n #loading-overlay {\\n font-size: 20px;\\n z-index: 1;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n }\\n\\n #logo {\\n width: 10%;\\n max-width: 300px;\\n min-width: 120px;\\n overflow: visible;\\n }\\n\\n #loading-hint {\\n width: 8%;\\n max-width: 240px;\\n min-width: 96px;\\n margin-top: clamp(17px, 1.7vw, 33px);\\n text-align: center;\\n color: #aa76ff;\\n font-size: clamp(11px, 1.3vw, 16px);\\n font-family: -apple-system, BlinkMacSystemFont, sans-serif;\\n letter-spacing: 0.04em;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n transition: opacity 0.4s ease;\\n }\\n\\n .fill-rect {\\n transform: translateY(100%);\\n transition: transform 0.3s ease-out;\\n }\\n\\n #gradientMover {\\n display: none;\\n }\\n\\n .gradient-mover {\\n animation: moveGradient 0.4s linear;\\n }\\n\\n @keyframes moveGradient {\\n 0% { transform: translateX(0); }\\n 100% { transform: translateX(-250%); }\\n }\\n\\n .logo-fade-out {\\n animation: logoFadeOut 1s linear;\\n }\\n\\n .logo-fade-out path {\\n fill: white;\\n stroke: white;\\n }\\n\\n @keyframes logoFadeOut {\\n 0% { opacity: 1; }\\n 50% { opacity: 0; }\\n 100% { opacity: 0; }\\n }\\n \",document.head.appendChild(r);var n=document.createElement(\"div\");n.id=\"loading-overlay\",n.className=\"fullscreen\",document.body.appendChild(n);var a=!1===t?{viewBox:\"0 0 633 819\",paths:[\"M632 1V632H1V1H632ZM350 125.586V507.414L380.586 538H546V451H478.599L478.308 451.278L454.598 474H443.406L450.944 452.328L451 452.169V187.459L457.369 182H546V95H380.586L350 125.586ZM283 125.586L252.414 95H87V182H175.631L182 187.459V445.54L175.631 451H87V538H252.414L283 507.414V125.586Z\",\"M633 687V660H548V687H560V791H548V819H633V792H601L592 801H587L590 792V752H627V725H590V687H633Z\",\"M533 718V675L518 660H450L435 675V802L450 819H518L533 804V734H482V761H503V788L499 792H476L467 801H462L465 792V691L469 687H499L503 691V718H533Z\",\"M402 660H310V687H322V792H310V819H402L417 804V675L402 660ZM387 788L383 792H363L354 801H349L352 792V687H383L387 691V788Z\",\"M295 687V660H239V687H251V792H239V819H295V792H283V687H295Z\",\"M215 791L200 760H209L224 745V675L209 660H121V687H132V792H121V819H162V760H166L193 819H227V791H215ZM194 729L190 733H173L164 742H159L162 733V687H190L194 691V729Z\",\"M106 724V675L91 660H0V687H12V792H0V819H91L106 804V749L89 744V728L106 724ZM73 788L69 792H53L44 801H39L42 792V752H73V788ZM73 725H53L44 734H39L42 725V687H69L73 691V725Z\"],fillColor:\"#aa76ff\",strokeColor:\"#aa76ff\",gradientStops:[{offset:\"0.235577\",color:\"#aa76ff\"},{offset:\"0.240685\",color:\"white\"},{offset:\"0.659749\",color:\"#aa76ff\"}]}:{viewBox:\"0 0 633 986\",paths:[\"M224.044 880.996V933.01H247.059V880.996H269.036V954.011C269.036 972.997 256.033 986 234.056 986H202.067V967.991H231.064C242.053 967.991 247.059 960.97 247.059 952.973V949.981H202.067V880.996H224.044Z\",{d:\"M355.051 880.996V952.912C355.051 971.959 340.094 985.939 320.071 985.939H289.059V966.953H319.033C328.007 966.953 333.013 960.97 333.013 952.973V949.981H317.019C297.972 949.981 281.001 935.024 281.001 915C281.001 896.014 298.033 880.996 317.019 880.996H355.051ZM320.01 897.968C310.975 897.968 304.992 904.927 304.992 914.939C304.992 925.928 311.036 932.949 320.01 932.949H333.013V897.968H320.01Z\",fillRule:\"evenodd\"},{d:\"M34.0643 880.996C53.05 880.996 71.0593 895.953 71.0593 915C71.0593 934.963 53.05 949.981 34.0643 949.981H22.0378V970.982H0.0608089V880.996H34.0643ZM22.0378 897.968V932.949H32.0498C41.0238 932.949 47.0672 925.989 47.0672 914.939C47.0672 904.989 41.0238 897.968 32.0498 897.968H22.0378Z\",fillRule:\"evenodd\"},\"M105.062 870.007V949.981H81.0707V870.007H105.062Z\",{d:\"M187.049 880.996V949.981H152.069C133.022 949.981 116.051 935.024 116.051 915C116.051 896.014 133.083 880.996 152.069 880.996H187.049ZM154.999 897.968C145.964 897.968 139.981 904.927 139.981 914.939C139.981 925.928 146.025 932.949 154.999 932.949H165.011V897.968H154.999Z\",fillRule:\"evenodd\"},{d:\"M436 880.996V949.981H401.02C381.973 949.981 365.002 935.024 365.002 915C365.002 896.014 382.034 880.996 401.02 880.996H436ZM404.011 897.968C394.976 897.968 388.994 904.927 388.994 914.939C388.994 925.928 395.037 932.949 404.011 932.949H414.023V897.968H404.011Z\",fillRule:\"evenodd\"},\"M521.039 880.996C538.987 880.996 551.99 894 551.99 912.009V949.981H530.013V908.957C530.013 903.951 525.984 897.968 520.001 897.968H512.004V949.981H490.027V897.968H472.018V949.981H450.041V880.996H521.039Z\",{d:\"M633 880.996V949.981H598.019C579.034 949.981 563.039 935.024 563.039 915C563.039 896.014 579.034 880.996 598.019 880.996H633ZM603.025 897.968C593.014 897.968 587.031 904.927 587.031 914.939C587.031 925.928 593.014 932.949 603.025 932.949H611.023V897.968H603.025Z\",fillRule:\"evenodd\"},\"M522.993 663.967L538.01 678.986V732.037H504.068V695.041L500.038 691.012H482.029L478.001 695.041V829.044L475.009 838.018H480.015L488.989 829.044H499.978L504.007 825.015V775.015H491.004V748.032H538.01V841.009L522.993 856.027H459.015L443.997 838.994V678.986L459.015 663.967H522.993Z\",\"M633 664.029V691.073H601.011V739.057H627.017V766.041H601.011V829.044L598.019 838.018H603.025L611.999 829.044H633V856.027H553.028V828.006H567.007V691.012H553.028V664.029H633Z\",{d:\"M89.0069 664.029L104.025 679.046V738.02L87.0533 741.927V757.922L104.025 762.928V840.948L89.0069 855.966H0V828.983H13.9801V691.012H0V664.029H89.0069ZM47.983 765.98V828.983L44.992 837.956H49.998L59.0329 828.983H65.9919L70.0214 824.953H69.96V765.98H47.983ZM47.983 691.012V738.997L44.992 747.971H49.998L59.0329 738.997H70.0214V695.041L65.9919 691.012H47.983Z\",fillRule:\"evenodd\"},{d:\"M210.003 664.029L225.02 679.046V759.02L210.003 774.039L217.023 828.006V827.945H227.951V855.966H184.973L176.976 773.977H166.964V855.966H118.981V828.983H132.961V691.012H118.981V664.029H210.003ZM167.025 691.012V746.994L164.034 755.968H169.04L178.014 746.994H186.988L191.017 742.965H191.078V695.041L187.049 691.012H167.025Z\",fillRule:\"evenodd\"},\"M302.001 664.029V691.012H288.021V828.983H302.001V855.966H239.977V828.983H253.957V691.012H239.977V664.029H302.001Z\",{d:\"M411.032 663.967L426.05 678.924V840.887L411.032 855.905H317.019V828.921H330.999V690.951H317.019V663.967H411.032ZM365.002 691.012V828.983L362.011 837.956H367.017L376.052 828.983H388.078L392.046 824.953H391.985V695.041L388.017 691.012H365.002Z\",fillRule:\"evenodd\"},{d:\"M633 0V635.946H0.0608089V0H633ZM88.0298 92.0008V177.042H176.06L183.02 183.024V446.023L176.06 452.006H88.0298V536.986H252.003L252.004 536.986H252.065L282.039 507.011V121.976L252.065 92.0008H88.0298ZM382.034 92.0008L351.999 122.037V507.011L382.034 536.986H546.007L546.008 452.006H480.015L456.024 475.021H443.021L451.018 452.006V183.024L458.038 177.042H546.008V92.0616L546.007 92.0008H382.034Z\",fillRule:\"evenodd\"}],fillColor:\"#aa76ff\",strokeColor:\"#aa76ff\",gradientStops:[{offset:\"0.235577\",color:\"#aa76ff\"},{offset:\"0.240685\",color:\"white\"},{offset:\"0.659749\",color:\"#aa76ff\"}]};a.gradientWidthMultiplier=4;var s=i(a.viewBox.split(/[ ,]+/),4),u=s[2],c=s[3],l=Number(u),f=Number(c),p=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");p.setAttribute(\"id\",\"logo\"),p.setAttribute(\"viewBox\",a.viewBox),p.setAttribute(\"fill\",\"none\"),p.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\");var h=document.createElementNS(p.namespaceURI,\"defs\"),d=document.createElementNS(p.namespaceURI,\"mask\");d.setAttribute(\"id\",\"logo-mask\");var y=document.createElementNS(p.namespaceURI,\"rect\");y.setAttribute(\"x\",\"0\"),y.setAttribute(\"y\",\"0\"),y.setAttribute(\"width\",\"100%\"),y.setAttribute(\"height\",\"100%\"),y.setAttribute(\"fill\",\"black\"),d.appendChild(y),a.paths.forEach((function(t){var e=document.createElementNS(p.namespaceURI,\"path\");e.setAttribute(\"d\",\"string\"==typeof t?t:t.d),e.setAttribute(\"fill\",\"object\"===o(t)&&t.maskFill?t.maskFill:\"white\"),\"object\"===o(t)&&t.fillRule&&e.setAttribute(\"fill-rule\",t.fillRule),d.appendChild(e)})),h.appendChild(d);var m=document.createElementNS(p.namespaceURI,\"linearGradient\");m.setAttribute(\"id\",\"shineGradient\"),m.setAttribute(\"x1\",String(2*l)),m.setAttribute(\"y1\",\"0\"),m.setAttribute(\"x2\",String(3*l)),m.setAttribute(\"y2\",String(f)),m.setAttribute(\"gradientUnits\",\"userSpaceOnUse\"),a.gradientStops.forEach((function(t){var e=t.offset,r=t.color,n=document.createElementNS(p.namespaceURI,\"stop\");n.setAttribute(\"offset\",e),n.setAttribute(\"stop-color\",r),m.appendChild(n)})),h.appendChild(m),p.appendChild(h);var v=document.createElementNS(p.namespaceURI,\"g\");v.setAttribute(\"mask\",\"url(#logo-mask)\");var g=document.createElementNS(p.namespaceURI,\"rect\");g.setAttribute(\"id\",\"gradientMover\"),g.setAttribute(\"x\",\"0\"),g.setAttribute(\"y\",\"0\"),g.setAttribute(\"width\",String(l*a.gradientWidthMultiplier)),g.setAttribute(\"height\",String(f)),g.setAttribute(\"fill\",\"url(#shineGradient)\"),g.style.transform=\"translateX(0)\",v.appendChild(g),p.appendChild(v);var b=document.createElementNS(p.namespaceURI,\"g\");b.setAttribute(\"mask\",\"url(#logo-mask)\");var _=document.createElementNS(p.namespaceURI,\"rect\");_.setAttribute(\"id\",\"fillRect\"),_.setAttribute(\"class\",\"fill-rect\"),_.setAttribute(\"x\",\"0\"),_.setAttribute(\"y\",\"0\"),_.setAttribute(\"width\",\"100%\"),_.setAttribute(\"height\",String(f)),_.setAttribute(\"fill\",a.fillColor),b.appendChild(_),p.appendChild(b);var S=String(Math.round(3*l/633));if(a.paths.forEach((function(t){if(\"object\"!==o(t)||\"black\"!==t.maskFill){var e=document.createElementNS(p.namespaceURI,\"path\");e.setAttribute(\"d\",\"string\"==typeof t?t:t.d),e.setAttribute(\"stroke\",a.strokeColor),e.setAttribute(\"stroke-width\",S),\"object\"===o(t)&&t.fillRule&&e.setAttribute(\"fill-rule\",t.fillRule),p.appendChild(e)}})),n.appendChild(p),e){var w=[\"Loading GPU\",\"Parsing AST\",\"Linking libs\",\"Baking mesh\",\"Warming JIT\",\"Tracing rays\",\"Packing data\",\"Flushing GPU\",\"Loading WASM\",\"Alloc memory\",\"Init shaders\",\"Optimize FPS\",\"Sync textures\",\"Build navmesh\",\"Compile code\",\"Load physics\",\"Stream assets\",\"Cache buffers\",\"Map controls\",\"Decode audio\",\"Init network\",\"Setup scene\"],E=document.createElement(\"div\");E.id=\"loading-hint\",E.style.opacity=\"0\";var P=Math.floor(Math.random()*w.length);E.textContent=w[P],n.appendChild(E);var A=function(){return 1e3*(2+Math.random())},O=null,k=function t(){O=setTimeout((function(){E.style.opacity=\"0\",setTimeout((function(){P=(P+1)%w.length,E.textContent=w[P],E.style.opacity=\"1\",t()}),400)}),A())};O=setTimeout((function(){E.style.opacity=\"1\",k()}),A());var T=new MutationObserver((function(t){t.forEach((function(t){t.removedNodes.forEach((function(t){t===n&&(clearTimeout(O),T.disconnect())}))}))}));T.observe(document.body,{childList:!0})}}var S=function(){for(var t=arguments.length,e=new Array(t),r=0;r2&&void 0!==arguments[2]&&arguments[2];if(Array.isArray(t))return t.reduce((function(t,n,o){if(t[o]=E(e,n),r)try{t[o]=JSON.parse(t[o])}catch(t){}return t}),new Array(t.length));var n=E(e,t);if(r&&\"string\"==typeof n)try{n=JSON.parse(n)}catch(t){}return n}function A(t,e){for(var r=u({},t),n=Object.keys(e),o=0;oe.indexOf(\".\")?parseFloat(e.replace(/\\./g,\"\").replace(\",\",\".\")):e.includes(\",\")&&-1!==e.lastIndexOf(\",\")&&e.lastIndexOf(\",\")===e.length-4?parseInt(e.replace(/,/,\"\"),10):e.includes(\",\")&&-1!==e.lastIndexOf(\",\")&&e.lastIndexOf(\",\")!==e.length-3?parseFloat(e.replace(\",\",\".\")):e.includes(\".\")&&-1!==e.lastIndexOf(\".\")&&e.lastIndexOf(\".\")===e.length-4?parseInt(e.replace(/\\./,\"\"),10):e.includes(\".\")?parseFloat(e):parseInt(e,10)}function k(){var t=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\",e=Array.from({length:8},(function(){return t.charAt(Math.floor(62*Math.random()))})).join(\"\"),r=Date.now().toString(36);return\"\".concat(e).concat(r)}function T(){var t,e=\"bridge_player_guest_id\";try{t=localStorage.getItem(e)}catch(t){}if(!t){t=k();try{localStorage.setItem(e,t)}catch(t){}}return{id:t,name:\"Guest \".concat(t)}}function D(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"*\";window.parent&&window.parent[l](t,e)}function I(t){window.system&&window.system[l](t)}function R(t){window.chrome&&window.chrome.webview&&\"function\"==typeof window.chrome.webview.postMessage&&window.chrome.webview[l](t)}function L(){return window.innerHeight>window.innerWidth?n.AR.PORTRAIT:n.AR.LANDSCAPE}function j(){var t=document.createElement(\"div\");t.style.cssText=\"position:fixed;top:env(safe-area-inset-top);bottom:env(safe-area-inset-bottom);left:env(safe-area-inset-left);right:env(safe-area-inset-right);pointer-events:none;visibility:hidden;\",document.body.appendChild(t);var e=t.getBoundingClientRect(),r={top:e.top,bottom:window.innerHeight-e.bottom,left:e.left,right:window.innerWidth-e.right};return t.remove(),r}function M(){var t=document.createElement(\"style\");t.id=\"bridge-safe-area-styles\",t.textContent=\"\\n html, body {\\n height: calc(100% - env(safe-area-inset-top) - env(safe-area-inset-bottom));\\n padding-top: env(safe-area-inset-top);\\n padding-bottom: env(safe-area-inset-bottom);\\n box-sizing: border-box;\\n }\\n \",document.head.appendChild(t)}function C(){if(!document.getElementById(\"bridge-browser-defaults-protection\")){var t=document.createElement(\"style\");t.id=\"bridge-browser-defaults-protection\",t.textContent=\"\\n html, body {\\n -webkit-user-select: none;\\n user-select: none;\\n -webkit-touch-callout: none;\\n overscroll-behavior: contain;\\n }\\n input, textarea, [contenteditable] {\\n -webkit-user-select: text;\\n user-select: text;\\n -webkit-touch-callout: default;\\n }\\n \",document.head.appendChild(t),document.addEventListener(\"contextmenu\",(function(t){return t.preventDefault()}))}}function N(){return document.querySelector(\"canvas\")}},843:(t,e,r)=>{r.d(e,{AR:()=>b,Cb:()=>p,Dt:()=>S,Kk:()=>f,LS:()=>E,Lb:()=>i,Lh:()=>g,Mn:()=>P,Qh:()=>y,T2:()=>o,Uw:()=>_,W1:()=>s,WA:()=>c,YU:()=>u,Z:()=>w,_g:()=>d,b3:()=>l,b9:()=>n,bD:()=>m,me:()=>v,oF:()=>a,pn:()=>A,qV:()=>h});var n=\"https://api.playgama.com/api/bridge/v1\",o=\"https://api.playgama.com/api/v1/timestamp/now\",i={VK:\"vk\",OK:\"ok\",YANDEX:\"yandex\",CRAZY_GAMES:\"crazy_games\",ABSOLUTE_GAMES:\"absolute_games\",GAME_DISTRIBUTION:\"game_distribution\",PLAYGAMA:\"playgama\",STANDALONE:\"standalone\",PLAYDECK:\"playdeck\",TELEGRAM:\"telegram\",Y8:\"y8\",LAGGED:\"lagged\",FACEBOOK:\"facebook\",POKI:\"poki\",MOCK:\"mock\",QA_TOOL:\"qa_tool\",MSN:\"msn\",MICROSOFT_STORE:\"microsoft_store\",HUAWEI:\"huawei\",BITQUEST:\"bitquest\",GAMEPUSH:\"gamepush\",DISCORD:\"discord\",JIO_GAMES:\"jio_games\",YOUTUBE:\"youtube\",PORTAL:\"portal\",REDDIT:\"reddit\",XIAOMI:\"xiaomi\",TIKTOK:\"tiktok\",DLIGHTEK:\"dlightek\",GAMESNACKS:\"gamesnacks\",SAMSUNG:\"samsung\"},a={CORE:\"core\",PLATFORM:\"platform\",PLAYER:\"player\",GAME:\"game\",STORAGE:\"storage\",ADVERTISEMENT:\"advertisement\",SOCIAL:\"social\",DEVICE:\"device\",LEADERBOARDS:\"leaderboards\",PAYMENTS:\"payments\",REMOTE_CONFIG:\"remote_config\",CLIPBOARD:\"clipboard\",ACHIEVEMENTS:\"achievements\",ANALYTICS:\"analytics\",RECORDER:\"recorder\",CROSS_PROMO:\"cross_promo\"},s={INTERSTITIAL_STATE_CHANGED:\"interstitial_state_changed\",REWARDED_STATE_CHANGED:\"rewarded_state_changed\",BANNER_STATE_CHANGED:\"banner_state_changed\",ADVANCED_BANNERS_STATE_CHANGED:\"advanced_banners_state_changed\",VISIBILITY_STATE_CHANGED:\"visibility_state_changed\",AUDIO_STATE_CHANGED:\"audio_state_changed\",PAUSE_STATE_CHANGED:\"pause_state_changed\",ORIENTATION_STATE_CHANGED:\"orientation_state_changed\",SCREEN_SIZE_CHANGED:\"screen_size_changed\",PLATFORM_MESSAGE_SENT:\"platform_message_sent\"},u={VISIBLE:\"visible\",HIDDEN:\"hidden\"},c={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\"},l={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\",REWARDED:\"rewarded\"},f={LOADING:\"loading\",SHOWN:\"shown\",HIDDEN:\"hidden\",FAILED:\"failed\"},p={TOP:\"top\",BOTTOM:\"bottom\"},h={SHOW:\"show\",HIDE:\"hide\"},d=\"banner-container\",y=\"advanced-banner-\",m={LOCAL_STORAGE:\"local_storage\",PLATFORM_INTERNAL:\"platform_internal\"},v={DESKTOP:\"desktop\",MOBILE:\"mobile\",TABLET:\"tablet\",TV:\"tv\"},g={WINDOWS:\"windows\",MACOS:\"macos\",LINUX:\"linux\",ANDROID:\"android\",IOS:\"ios\",OTHER:\"other\"},b={PORTRAIT:\"portrait\",LANDSCAPE:\"landscape\"},_=\"bridge-orientation-overlay\",S={GAME_READY:\"game_ready\",LEVEL_STARTED:\"level_started\",LEVEL_COMPLETED:\"level_completed\",LEVEL_FAILED:\"level_failed\",LEVEL_PAUSED:\"level_paused\",LEVEL_RESUMED:\"level_resumed\",IN_GAME_LOADING_STARTED:\"in_game_loading_started\",IN_GAME_LOADING_STOPPED:\"in_game_loading_stopped\",GAMEPLAY_STARTED:\"gameplay_started\",GAMEPLAY_STOPPED:\"gameplay_stopped\",PLAYER_GOT_ACHIEVEMENT:\"player_got_achievement\"},w={NOT_AVAILABLE:\"not_available\",IN_GAME:\"in_game\",NATIVE:\"native\",NATIVE_POPUP:\"native_popup\"},E={NOTIFICATION:\"notification\"},P={INITIALIZE:\"initialize\",AUTHORIZE_PLAYER:\"authorize_player\",SHARE:\"share\",INVITE_FRIENDS:\"invite_friends\",JOIN_COMMUNITY:\"join_community\",CREATE_POST:\"create_post\",ADD_TO_HOME_SCREEN:\"add_to_home_screen\",ADD_TO_FAVORITES:\"add_to_favorites\",RATE:\"rate\",LEADERBOARDS_SET_SCORE:\"leaderboards_set_score\",LEADERBOARDS_GET_ENTRIES:\"leaderboards_get_entries\",LEADERBOARDS_SHOW_NATIVE_POPUP:\"leaderboards_show_native_popup\",GET_PURCHASES:\"get_purchases\",GET_CATALOG:\"get_catalog\",PURCHASE:\"purchase\",CONSUME_PURCHASE:\"consume_purchase\",GET_REMOTE_CONFIG:\"get_remote_config\",GET_STORAGE_DATA:\"get_storage_data\",SET_STORAGE_DATA:\"set_storage_data\",DELETE_STORAGE_DATA:\"delete_storage_data\",CLIPBOARD_WRITE:\"clipboard_write\",ADBLOCK_DETECT:\"adblock_detect\",SET_INTERSTITIAL_STATE:\"set_interstitial_state\",SET_REWARDED_STATE:\"set_rewarded_state\",SHOW_INTERSTITIAL:\"show_interstitial\",SHOW_REWARDED:\"show_rewarded\"},A={SDK_NOT_INITIALIZED:{message:\"Before using the SDK you must initialize it\"},STORAGE_NOT_SUPPORTED:{message:\"Storage not supported\"},STORAGE_NOT_AVAILABLE:{message:\"Storage not available\"},GAME_PARAMS_NOT_FOUND:{message:\"Game params are not found\"},INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:{message:\"Message is too long\"}}},784:(t,e,r)=>{r.d(e,{Z:()=>St});var n=r(843);const o={i8:\"1.31.0\"};var i=r(383),a=r(23);function s(t){return s=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},s(t)}function u(){u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",c=i.asyncIterator||\"@@asyncIterator\",l=i.toStringTag||\"@@toStringTag\";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},\"\")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new L(n||[]);return o(a,\"_invoke\",{value:T(t,r,s)}),a}function h(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=p;var d=\"suspendedStart\",y=\"suspendedYield\",m=\"executing\",v=\"completed\",g={};function b(){}function _(){}function S(){}var w={};f(w,a,(function(){return this}));var E=Object.getPrototypeOf,P=E&&E(E(j([])));P&&P!==r&&n.call(P,a)&&(w=P);var A=S.prototype=b.prototype=Object.create(w);function O(t){[\"next\",\"throw\",\"return\"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,u){var c=h(t[o],t,i);if(\"throw\"!==c.type){var l=c.arg,f=l.value;return f&&\"object\"==s(f)&&n.call(f,\"__await\")?e.resolve(f.__await).then((function(t){r(\"next\",t,a,u)}),(function(t){r(\"throw\",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r(\"throw\",t,a,u)}))}u(c.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error(\"Generator is already running\");if(o===v){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=m;var c=h(e,r,n);if(\"normal\"===c.type){if(o=n.done?v:y,c.arg===g)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(o=v,n.method=\"throw\",n.arg=c.arg)}}}function D(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,D(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),g;var i=h(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,g):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||\"\"===e){var r=e[a];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;R(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),g}},e}function c(t,e,r){return(e=y(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)}(t)||function(t,e){if(!t)return;if(\"string\"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===r&&t.constructor&&(r=t.constructor.name);if(\"Map\"===r||\"Set\"===r)return Array.from(t);if(\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{};return{event_name:t,timestamp:new Date(Date.now()+E(this,B)).toISOString(),data:e}}function at(){var t,e,r,n={bridge_version:o.i8,platform_id:this._platformBridge.platformId,game_id:E(this,L),session_id:E(this,M),player_id:this._platformBridge.playerId,player_guest_id:E(this,j),device_type:this._platformBridge.deviceType,device_os:this._platformBridge.deviceOs,clid:null!==(t=null===(e=this._platformBridge.additionalData)||void 0===e?void 0:e.clid)&&void 0!==t?t:\"\",launch_source:this._platformBridge.launchSource},i=null===(r=this._platformBridge.options)||void 0===r||null===(r=r.saas)||void 0===r?void 0:r.publicToken;return i&&(n.public_token=i),n}function st(t){return ut.apply(this,arguments)}function ut(){return(ut=h(u().mark((function t(e){var r,n,o;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=JSON.stringify(e),n=new Blob([r]).stream(),o=n.pipeThrough(new CompressionStream(\"gzip\")),t.abrupt(\"return\",new Response(o).blob());case 4:case\"end\":return t.stop()}}),t)})))).apply(this,arguments)}function ct(){return this._platformBridge.platformId===n.Lb.DISCORD?T:k}function lt(t){return{meta:P(this,V,at).call(this),events:t}}function ft(){return pt.apply(this,arguments)}function pt(){return(pt=h(u().mark((function t(){var e;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==E(this,I).length&&!E(this,N)){t.next=2;break}return t.abrupt(\"return\");case 2:return e=l(E(this,I)),A(this,I,[]),t.next=6,P(this,J,ht).call(this,P(this,Y,lt).call(this,e));case 6:t.sent||E(this,N)||A(this,I,[].concat(l(e),l(E(this,I))));case 8:case\"end\":return t.stop()}}),t,this)})))).apply(this,arguments)}function ht(t){return dt.apply(this,arguments)}function dt(){return(dt=h(u().mark((function t(e){var r,n,o;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,r={\"Content-Type\":\"application/json\"},!E(this,F)){t.next=16;break}return t.prev=3,r[\"Content-Encoding\"]=\"gzip\",t.next=7,P(this,Z,st).call(this,e);case 7:n=t.sent,t.next=14;break;case 10:t.prev=10,t.t0=t.catch(3),delete r[\"Content-Encoding\"],n=JSON.stringify(e);case 14:t.next=17;break;case 16:n=JSON.stringify(e);case 17:return t.next=19,fetch(P(this,z,ct).call(this),{method:\"POST\",headers:r,body:n});case 19:if((o=t.sent).ok){t.next=22;break}throw new Error(\"Network response was not ok: \".concat(o.status));case 22:return A(this,C,0),t.abrupt(\"return\",!0);case 26:return t.prev=26,t.t1=t.catch(0),A(this,C,E(this,C)+1),E(this,C)>=D&&P(this,Q,vt).call(this),t.abrupt(\"return\",!1);case 31:case\"end\":return t.stop()}}),t,this,[[0,26],[3,10]])})))).apply(this,arguments)}function yt(){if(0!==E(this,I).length&&!E(this,N)){var t=l(E(this,I));A(this,I,[]);var e=P(this,z,ct).call(this),r=P(this,Y,lt).call(this,t),n=JSON.stringify(r);if(navigator.sendBeacon){var o=new Blob([n],{type:\"application/json\"});navigator.sendBeacon(e,o)}}}function mt(){var t=this;A(this,G,(function(){P(t,q,yt).call(t)})),A(this,x,(function(){\"hidden\"===document.visibilityState&&P(t,q,yt).call(t)})),document.addEventListener(\"visibilitychange\",E(this,x)),window.addEventListener(\"pagehide\",E(this,G))}function vt(){A(this,N,!0),A(this,I,[]),E(this,R)&&(clearInterval(E(this,R)),A(this,R,null)),E(this,x)&&(document.removeEventListener(\"visibilitychange\",E(this,x)),A(this,x,null)),E(this,G)&&(window.removeEventListener(\"pagehide\",E(this,G)),A(this,G,null))}function gt(){var t=this._platformBridge,e=t.options,r=t.platformId,o=c(c(c(c(c(c(c({},n.Lb.GAME_DISTRIBUTION,\"gameId\"),n.Lb.Y8,\"gameId\"),n.Lb.MSN,\"gameId\"),n.Lb.HUAWEI,\"appId\"),n.Lb.DISCORD,\"appId\"),n.Lb.GAMEPUSH,\"projectId\"),n.Lb.MICROSOFT_STORE,\"gameId\")[r];return(o?null==e?void 0:e[o]:null)||P(this,tt,bt).call(this,window.location.href)}function bt(t){try{var e=new URL(t),r=e.pathname.split(\"/\").filter(Boolean),o=this._platformBridge.platformId,i=c(c(c({},n.Lb.YANDEX,{pathKey:\"app\"}),n.Lb.LAGGED,{pathKey:\"g\"}),n.Lb.CRAZY_GAMES,{pathKey:\"game\"})[o];if(i){var a=r.indexOf(i.pathKey),s=-1!==a?r[a+1]:null;if(s)return s}if(o===n.Lb.XIAOMI)if(\"index.html\"===r[r.length-1]&&r.length>=2)return r[r.length-2];if(o===n.Lb.PLAYGAMA){if(e.searchParams.get(\"game_id\"))return e.searchParams.get(\"game_id\");var u=e.hostname.match(/^([a-z0-9-]+)\\.games\\.playgama\\.net$/i);if(u)return u[1]}}catch(t){return null}return null}function _t(){var t=this;E(this,R)||A(this,R,setInterval((function(){t.send(\"\".concat(n.oF.CORE,\"_ping\")),P(t,K,ft).call(t)}),3e4))}const St=new(function(t){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&m(t,e)}(s,t);var e,r,o,a=v(s);function s(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,s),_(g(t=a.call(this)),et),_(g(t),tt),_(g(t),$),_(g(t),Q),_(g(t),X),_(g(t),q),_(g(t),J),_(g(t),K),_(g(t),Y),_(g(t),z),_(g(t),Z),_(g(t),V),_(g(t),U),_(g(t),W),_(g(t),H),S(g(t),I,{writable:!0,value:[]}),S(g(t),R,{writable:!0,value:null}),S(g(t),L,{writable:!0,value:null}),S(g(t),j,{writable:!0,value:null}),S(g(t),M,{writable:!0,value:null}),S(g(t),C,{writable:!0,value:0}),S(g(t),N,{writable:!0,value:!1}),S(g(t),x,{writable:!0,value:null}),S(g(t),G,{writable:!0,value:null}),S(g(t),B,{writable:!0,value:0}),S(g(t),F,{writable:!0,value:\"undefined\"!=typeof CompressionStream}),A(g(t),M,P(g(t),H,rt).call(g(t))),t}return e=s,r=[{key:\"initialize\",value:function(t){var e;this._platformBridge=t,this._platformBridge.platformId===n.Lb.PLAYGAMA||!1!==(null===(e=this._platformBridge.options)||void 0===e?void 0:e.sendAnalyticsEvents)||A(this,N,!0);var r=window.location.href;return(r.startsWith(\"file://\")||r.includes(\"localhost\")||r.includes(\"127.0.0.1\"))&&A(this,N,!0),E(this,N)||P(this,W,nt).call(this),A(this,L,P(this,$,gt).call(this)),A(this,j,(0,i.my)().id),this.send(\"\".concat(n.oF.CORE,\"_initialization_started\")),P(this,et,_t).call(this),P(this,X,mt).call(this),this}},{key:\"send\",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!E(this,N)){var r=P(this,U,it).call(this,t,e);E(this,I).push(r)}}}],r&&d(e.prototype,r),o&&d(e,o),Object.defineProperty(e,\"prototype\",{writable:!1}),s}(a.Z))},66:(t,e,r)=>{r.d(e,{ZP:()=>V});var n=r(383),o=r(23);function i(t){return i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},i(t)}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t,e,r){return(e=f(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(){u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a=\"function\"==typeof Symbol?Symbol:{},s=a.iterator||\"@@iterator\",c=a.asyncIterator||\"@@asyncIterator\",l=a.toStringTag||\"@@toStringTag\";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},\"\")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new L(n||[]);return o(a,\"_invoke\",{value:T(t,r,s)}),a}function h(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=p;var d=\"suspendedStart\",y=\"suspendedYield\",m=\"executing\",v=\"completed\",g={};function b(){}function _(){}function S(){}var w={};f(w,s,(function(){return this}));var E=Object.getPrototypeOf,P=E&&E(E(j([])));P&&P!==r&&n.call(P,s)&&(w=P);var A=S.prototype=b.prototype=Object.create(w);function O(t){[\"next\",\"throw\",\"return\"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,s,u){var c=h(t[o],t,a);if(\"throw\"!==c.type){var l=c.arg,f=l.value;return f&&\"object\"==i(f)&&n.call(f,\"__await\")?e.resolve(f.__await).then((function(t){r(\"next\",t,s,u)}),(function(t){r(\"throw\",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r(\"throw\",t,s,u)}))}u(c.arg)}var a;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function T(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error(\"Generator is already running\");if(o===v){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=m;var c=h(e,r,n);if(\"normal\"===c.type){if(o=n.done?v:y,c.arg===g)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(o=v,n.method=\"throw\",n.arg=c.arg)}}}function D(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,D(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),g;var i=h(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,g):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||\"\"===e){var r=e[s];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;R(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),g}},e}function c(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function l(t,e){for(var r=0;r1&&void 0!==i[1]?i[1]:{},_(this,j,e||S(this,I)),_(this,B,r),t.prev=3,_(this,R,P),t.next=7,fetch(S(this,j));case 7:if((n=t.sent).ok){t.next=10;break}throw new Error(\"Failed to load bridge config: \".concat(S(this,j),\" \").concat(n.status,\" (\").concat(n.statusText,\")\"));case 10:return t.next=12,n.text();case 12:o=t.sent,_(this,M,o),_(this,R,A),b(this,F,W).call(this,o),t.next=24;break;case 18:t.prev=18,t.t0=t.catch(3),b(this,H,U).call(this,S(this,B)),_(this,R,O),_(this,N,t.t0.message||String(t.t0)),console.error(t.t0);case 24:case\"end\":return t.stop()}}),t,this,[[3,18]])})),a=function(){var t=this,e=arguments;return new Promise((function(r,n){var o=i.apply(t,e);function a(t){c(o,r,n,a,s,\"next\",t)}function s(t){c(o,r,n,a,s,\"throw\",t)}a(void 0)}))},function(t){return a.apply(this,arguments)})},{key:\"getPlatformOptions\",value:function(t){var e,r=null===(e=this.options.platforms)||void 0===e?void 0:e[t];return r?(0,n.RH)(this.options,r):this.options}}],r&&l(e.prototype,r),o&&l(e,o),Object.defineProperty(e,\"prototype\",{writable:!1}),f}(o.Z))},500:(t,e,r)=>{r.d(e,{Z:()=>C});var n=r(66),o=r(446),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r0;n-=1){var o=Math.floor(Math.random()*(n+1)),i=r[n];r[n]=r[o],r[o]=i}return r.slice(0,e)}function L(){if(!document.getElementById(m)){var t=document.createElement(\"style\");t.id=m,t.textContent=g,document.head.appendChild(t)}}function j(t,e){var r=this,n=document.createElement(\"div\");n.id=v;var o=document.createElement(\"div\");o.className=\"bridge-cp-modal\";var i=document.createElement(\"div\");i.className=\"bridge-cp-header\";var a=document.createElement(\"h2\");a.className=\"bridge-cp-title\",a.textContent=\"string\"==typeof e&&e.length>0?e:\"More games\",i.appendChild(a);var s=document.createElement(\"button\");s.className=\"bridge-cp-close\",s.type=\"button\",s.setAttribute(\"aria-label\",\"Close\"),s.textContent=\"×\",i.appendChild(s),o.appendChild(i);var u=document.createElement(\"div\");return u.className=\"bridge-cp-grid\",t.forEach((function(t){u.appendChild(p(r,k,M).call(r,t))})),o.appendChild(u),n.appendChild(o),n.addEventListener(\"click\",(function(t){t.target===n&&r.hide()})),o.addEventListener(\"click\",(function(t){var e=t.target.closest(\".bridge-cp-tile\");if(t.target.closest(\".bridge-cp-close\"))return t.preventDefault(),void r.hide();e||r.hide()})),n}function M(t){var e=document.createElement(\"a\");e.className=\"bridge-cp-tile\",e.href=t.url,e.target=\"_blank\",e.rel=\"noopener noreferrer\";var r=document.createElement(\"div\");if(r.className=\"bridge-cp-thumb\",t.icon&&(r.style.backgroundImage=\"url('\".concat(t.icon.replace(/'/g,\"\\\\'\"),\"')\")),e.appendChild(r),t.name){var n=document.createElement(\"div\");n.className=\"bridge-cp-name\",n.textContent=t.name,e.appendChild(n)}return e}const C=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),c(this,k),c(this,O),c(this,A),c(this,P),c(this,E),c(this,w),c(this,S),l(this,b,{writable:!0,value:null}),l(this,_,{writable:!0,value:null})}var e,r,n;return e=t,(r=[{key:\"isVisible\",get:function(){return null!==d(this,_)}},{key:\"init\",value:function(t){h(this,b,t),p(this,S,T).call(this)}},{key:\"show\",value:function(){if(!d(this,_)){var t=p(this,w,D).call(this),e=p(this,E,I).call(this,t);if(0!==e.length){var r=p(this,P,R).call(this,e,4);p(this,A,L).call(this),h(this,_,p(this,O,j).call(this,r,t.title)),document.body.appendChild(d(this,_))}}}},{key:\"hide\",value:function(){d(this,_)&&(d(this,_).remove(),h(this,_,null))}}])&&s(e.prototype,r),n&&s(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),t}())},23:(t,e,r)=>{r.d(e,{Z:()=>s});var n=r(446);function o(t){return o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},o(t)}function i(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>_});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e{r.r(e),r.d(e,{default:()=>P});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;R(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),g}},e}function f(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){f(i,n,o,a,s,\"next\",t)}function s(t){f(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function h(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>U});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},u=i.iterator||\"@@iterator\",c=i.asyncIterator||\"@@asyncIterator\",l=i.toStringTag||\"@@toStringTag\";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},\"\")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new L(n||[]);return o(a,\"_invoke\",{value:T(t,r,s)}),a}function h(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=p;var d=\"suspendedStart\",y=\"suspendedYield\",m=\"executing\",v=\"completed\",g={};function b(){}function _(){}function S(){}var w={};f(w,u,(function(){return this}));var E=Object.getPrototypeOf,P=E&&E(E(j([])));P&&P!==r&&n.call(P,u)&&(w=P);var A=S.prototype=b.prototype=Object.create(w);function O(t){[\"next\",\"throw\",\"return\"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,s,u){var c=h(t[o],t,i);if(\"throw\"!==c.type){var l=c.arg,f=l.value;return f&&\"object\"==a(f)&&n.call(f,\"__await\")?e.resolve(f.__await).then((function(t){r(\"next\",t,s,u)}),(function(t){r(\"throw\",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r(\"throw\",t,s,u)}))}u(c.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error(\"Generator is already running\");if(o===v){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=m;var c=h(e,r,n);if(\"normal\"===c.type){if(o=n.done?v:y,c.arg===g)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(o=v,n.method=\"throw\",n.arg=c.arg)}}}function D(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,D(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),g;var i=h(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,g):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||\"\"===e){var r=e[u];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;R(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),g}},e}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e{r.r(e),r.d(e,{default:()=>v});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e{r.r(e),r.d(e,{default:()=>P});var n=r(640),o=r(843),i=r(383);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>N});var n=r(640),o=r(383),i=r(843);function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},s=i.iterator||\"@@iterator\",u=i.asyncIterator||\"@@asyncIterator\",c=i.toStringTag||\"@@toStringTag\";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},\"\")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new L(n||[]);return o(a,\"_invoke\",{value:T(t,r,s)}),a}function h(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=p;var d=\"suspendedStart\",y=\"suspendedYield\",m=\"executing\",v=\"completed\",g={};function b(){}function _(){}function S(){}var w={};f(w,s,(function(){return this}));var E=Object.getPrototypeOf,P=E&&E(E(j([])));P&&P!==r&&n.call(P,s)&&(w=P);var A=S.prototype=b.prototype=Object.create(w);function O(t){[\"next\",\"throw\",\"return\"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,s){var u=h(t[o],t,i);if(\"throw\"!==u.type){var c=u.arg,f=c.value;return f&&\"object\"==l(f)&&n.call(f,\"__await\")?e.resolve(f.__await).then((function(t){r(\"next\",t,a,s)}),(function(t){r(\"throw\",t,a,s)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return r(\"throw\",t,a,s)}))}s(u.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error(\"Generator is already running\");if(o===v){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=m;var c=h(e,r,n);if(\"normal\"===c.type){if(o=n.done?v:y,c.arg===g)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(o=v,n.method=\"throw\",n.arg=c.arg)}}}function D(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,D(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),g;var i=h(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,g):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||\"\"===e){var r=e[s];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;R(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),g}},e}function s(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedInterstitialPromises[t])return this._preloadedInterstitialPromises[t];var r=null;return this._preloadedInterstitialPromises[t]=this._platformSdk.getInterstitialAdAsync(t).then((function(t){return r=t,t.loadAsync()})).then((function(){return r})).catch((function(){return e._preloadedInterstitialPromises[t]=null,Promise.reject()})),this._preloadedInterstitialPromises[t]}function j(t){var e=this;if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this._preloadedRewardedPromises[t])return this._preloadedRewardedPromises[t];var r=null;return this._preloadedRewardedPromises[t]=this._platformSdk.getRewardedVideoAsync(t).then((function(t){return r=t,t.loadAsync()})).then((function(){return r})).catch((function(){return e._preloadedRewardedPromises[t]=null,Promise.reject()})),this._preloadedRewardedPromises[t]}function M(){return C.apply(this,arguments)}function C(){var t;return t=a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._platformSdk.player.isSubscribedBotAsync();case 3:if(!t.sent){t.next=6;break}return t.abrupt(\"return\",Promise.resolve());case 6:t.next=14;break;case 8:if(t.prev=8,t.t0=t.catch(0),\"INVALID_OPERATION\"!==(null===t.t0||void 0===t.t0?void 0:t.t0.code)){t.next=13;break}t.next=14;break;case 13:throw new Error(t.t0);case 14:return t.prev=15,t.next=18,this._platformSdk.player.canSubscribeBotAsync();case 18:if(!t.sent){t.next=21;break}return t.abrupt(\"return\",this._platformSdk.player.subscribeBotAsync());case 21:t.next=28;break;case 23:if(t.prev=23,t.t1=t.catch(15),\"INVALID_OPERATION\"!==(null===t.t1||void 0===t.t1?void 0:t.t1.code)){t.next=27;break}return t.abrupt(\"return\",Promise.resolve());case 27:throw new Error(t.t1);case 28:return t.abrupt(\"return\",Promise.resolve());case 29:case\"end\":return t.stop()}}),t,this,[[0,8],[15,23]])})),C=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){s(i,n,o,a,u,\"next\",t)}function u(t){s(i,n,o,a,u,\"throw\",t)}a(void 0)}))},C.apply(this,arguments)}const N=function(t){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&y(t,e)}(s,t);var e,r,n,a=m(s);function s(){var t,e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,s);for(var o=arguments.length,u=new Array(o),c=0;c\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n',\"\",{players:r},(function(t){t.showAsync(),e._overlay=t,n.remove(),e._resolvePromiseDecorator(i.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP)}),(function(t,r){n.remove(),e._rejectPromiseDecorator(i.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,r)})).iframeElement;o.style.zIndex=9999,o.style.position=\"absolute\",o.style.top=0,o.style.left=0,o.style.height=\"100vh\",o.style.width=\"100vw\",o.style.border=0,o.id=o.name,document.body.appendChild(o)})).catch((function(t){n.remove(),e._rejectPromiseDecorator(i.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,t)}))}return r.promise}},{key:\"paymentsPurchase\",value:function(t){var e=this,r=this._paymentsGetProductPlatformData(t);r||(r={id:t});var n=this._getPromiseDecorator(i.Mn.PURCHASE);if(!n){n=this._createPromiseDecorator(i.Mn.PURCHASE);var o=r.platformProductId?r.platformProductId:r.id;this._platformSdk.payments.purchaseAsync({productID:o.toLowerCase()}).then((function(r){var n=c({id:t},r);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(i.Mn.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.PURCHASE,t)}))}return n.promise}},{key:\"paymentsConsumePurchase\",value:function(t){var e=this,r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(i.Mn.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(i.Mn.CONSUME_PURCHASE),this._platformSdk.payments.consumePurchaseAsync(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(i.Mn.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(i.Mn.CONSUME_PURCHASE,t)}))),n.promise}},{key:\"paymentsGetCatalog\",value:function(){var t=this,e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();var r=this._getPromiseDecorator(i.Mn.GET_CATALOG);return r||(r=this._createPromiseDecorator(i.Mn.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((function(r){var n=e.map((function(t){var e=r.find((function(e){return e.productID===t.platformProductId}));return{id:t.id,title:e.title,description:e.description,imageURI:e.imageURI,price:e.price,priceCurrencyCode:e.priceCurrencyCode,priceValue:e.priceAmount}}));t._resolvePromiseDecorator(i.Mn.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.GET_CATALOG,e)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var t=this,e=this._getPromiseDecorator(i.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(i.Mn.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=c({id:r.find((function(e){return e.id===t.productID})).id},t);return delete e.productID,e})),t._resolvePromiseDecorator(i.Mn.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.GET_PURCHASES,e)}))),e.promise}},{key:\"inviteFriends\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.image||!e.text)return Promise.reject();if(!(0,o.dY)(e.image))return Promise.reject(new Error(\"Image is not base64\"));var r=this._getPromiseDecorator(i.Mn.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(i.Mn.INVITE_FRIENDS),this._platformSdk.inviteAsync(e).then((function(){t._resolvePromiseDecorator(i.Mn.INVITE_FRIENDS)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.INVITE_FRIENDS,e)}))),r.promise}},{key:\"joinCommunity\",value:function(t){var e=this,r=this._getPromiseDecorator(i.Mn.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(i.Mn.JOIN_COMMUNITY),t&&!0===t.isPage?this._platformSdk.community.followOfficialPageAsync().then((function(t){return e._resolvePromiseDecorator(i.Mn.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(i.Mn.JOIN_COMMUNITY,t)})):this._platformSdk.community.joinOfficialGroupAsync().then((function(t){return e._resolvePromiseDecorator(i.Mn.JOIN_COMMUNITY,t)})).catch((function(t){return e._rejectPromiseDecorator(i.Mn.JOIN_COMMUNITY,t)}))),r.promise}},{key:\"share\",value:function(t){var e=this;if(!t.image||!t.text)return Promise.reject();if(!(0,o.dY)(t.image))return Promise.reject(new Error(\"Image is not base64\"));var r=this._getPromiseDecorator(i.Mn.SHARE);return r||(r=this._createPromiseDecorator(i.Mn.SHARE),this._platformSdk.shareAsync(c({intent:\"REQUEST\"},t)).then((function(){e._resolvePromiseDecorator(i.Mn.SHARE)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.SHARE,t)}))),r.promise}}],r&&h(e.prototype,r),n&&h(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),s}(n.Z)},441:(t,e,r)=>{r.r(e),r.d(e,{default:()=>g});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>S});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>_});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case i.Dt.GAME_READY:return this._platformSdk.game.ready(),Promise.resolve();case i.Dt.LEVEL_FAILED:return this._platformSdk.game.gameOver(),Promise.resolve();case i.Dt.LEVEL_COMPLETED:var r=Number(e.level);return Number.isFinite(r)?(this._platformSdk.game.levelComplete(r),Promise.resolve()):Promise.reject(new Error(\"Level is required for level_completed message\"));default:return u(p(_.prototype),\"sendMessage\",this).call(this,t,e)}}},{key:\"showInterstitial\",value:function(t){var e=this;this._platformSdk.ad.break({type:\"next\",name:t||\"interstitial\",beforeAd:function(){e._setInterstitialState(i.WA.OPENED)},afterAd:function(){e.interstitialState!==i.WA.FAILED&&e._setInterstitialState(i.WA.CLOSED)},adBreakDone:function(t){\"viewed\"!==(null==t?void 0:t.breakStatus)&&e._showAdFailurePopup(!1)}})}},{key:\"showRewarded\",value:function(t){var e=this;this._platformSdk.ad.break({type:\"reward\",name:t||\"rewarded\",beforeAd:function(){e._setRewardedState(i.b3.OPENED)},afterAd:function(){e.rewardedState!==i.b3.FAILED&&e._setRewardedState(i.b3.CLOSED)},beforeReward:function(t){t()},adDismissed:function(){e._showAdFailurePopup(!0)},adViewed:function(){e._setRewardedState(i.b3.REWARDED)},adBreakDone:function(t){\"frequencyCapped\"!==(null==t?void 0:t.breakStatus)&&\"other\"!==(null==t?void 0:t.breakStatus)||e._showAdFailurePopup(!0)}})}},{key:\"checkAdBlock\",value:function(){return Promise.resolve(!1)}},{key:\"isStorageSupported\",value:function(t){return t===i.bD.PLATFORM_INTERNAL||u(p(_.prototype),\"isStorageSupported\",this).call(this,t)}},{key:\"isStorageAvailable\",value:function(t){return t===i.bD.PLATFORM_INTERNAL||u(p(_.prototype),\"isStorageAvailable\",this).call(this,t)}},{key:\"getDataFromStorage\",value:function(t,e,r){var n=this;if(e===i.bD.PLATFORM_INTERNAL){if(Array.isArray(t)){var o=t.map((function(t){return y(n,v,b).call(n,n._platformSdk.storage.getItem(t),r)}));return Promise.resolve(o)}var a=y(this,v,b).call(this,this._platformSdk.storage.getItem(t),r);return Promise.resolve(a)}return u(p(_.prototype),\"getDataFromStorage\",this).call(this,t,e,r)}},{key:\"setDataToStorage\",value:function(t,e,r){if(r===i.bD.PLATFORM_INTERNAL){if(Array.isArray(t)){for(var n=0;n{r.r(e),r.d(e,{default:()=>Z});var n=r(640),o=r(843),i=r(383);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e=0&&this._paymentsPurchases.splice(e,1),this._resolvePromiseDecorator(o.Mn.CONSUME_PURCHASE,t)}else this._rejectPromiseDecorator(o.Mn.CONSUME_PURCHASE,new Error(t))}function H(t){if(t.success){var e=this._paymentsGetProductsPlatformData();this._paymentsPurchases=t.data.map((function(t){var r=JSON.parse(t),n=u({id:e.find((function(t){return t.id===r.productId})).id},r);return delete n.productId,n})),this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(o.Mn.GET_PURCHASES,new Error(t))}function W(t){t.success?this._resolvePromiseDecorator(o.Mn.GET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.GET_STORAGE_DATA,new Error(t))}function U(t){t.success?this._resolvePromiseDecorator(o.Mn.SET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.SET_STORAGE_DATA,new Error(t))}function V(t){t.success?this._resolvePromiseDecorator(o.Mn.DELETE_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.DELETE_STORAGE_DATA,new Error(t))}const Z=function(t){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&f(t,e)}(a,t);var e,r,n,i=p(a);function a(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,a);for(var e=arguments.length,r=new Array(e),n=0;n{r.r(e),r.d(e,{default:()=>w});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}var s=[\"gamer_id\",\"gamer_name\",\"gamer_avatar_url\"];function u(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function c(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>h});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r0&&(t._playerId=o,t._playerName=a,t._playerPhotos.push(s),t._isPlayerAuthorized=!0),t._isInitialized=!0,t._resolvePromiseDecorator(i.Mn.INITIALIZE)}))}))})):this._rejectPromiseDecorator(i.Mn.INITIALIZE,i.pn.GAME_PARAMS_NOT_FOUND)),e.promise}},{key:\"isStorageSupported\",value:function(t){return t!==i.bD.PLATFORM_INTERNAL&&c(p(u.prototype),\"isStorageSupported\",this).call(this,t)}},{key:\"isStorageAvailable\",value:function(t){return t!==i.bD.PLATFORM_INTERNAL&&c(p(u.prototype),\"isStorageAvailable\",this).call(this,t)}},{key:\"showInterstitial\",value:function(){var t=this;this._setInterstitialState(i.WA.OPENED),this._platformSdk.APIAds.show((function(){t._setInterstitialState(i.WA.CLOSED)}))}},{key:\"showRewarded\",value:function(){var t=this;this._setRewardedState(i.b3.OPENED),this._platformSdk.GEvents.reward((function(e,r){e?r():t._showAdFailurePopup(!0)}),(function(e){e?(t._setRewardedState(i.b3.REWARDED),t._setRewardedState(i.b3.CLOSED)):t._showAdFailurePopup(!0)}))}},{key:\"leaderboardsSetScore\",value:function(t,e){var r=this,n=this._getPromiseDecorator(i.Mn.LEADERBOARDS_SET_SCORE);if(!n){n=this._createPromiseDecorator(i.Mn.LEADERBOARDS_SET_SCORE);var o={score:e,board:t};this._platformSdk.Scores.save(o,(function(t){t.success?r._resolvePromiseDecorator(i.Mn.LEADERBOARDS_SET_SCORE):r._rejectPromiseDecorator(i.Mn.LEADERBOARDS_SET_SCORE,t.errormsg)}))}return n.promise}},{key:\"unlockAchievement\",value:function(t){var e=this;return t.achievement?new Promise((function(r,n){e._platformSdk.Achievements.save(Array.isArray(t.achievement)?t.achievement:[t.achievement],(function(t){t.success?r(t):n(t.errormsg)}))})):Promise.reject()}}])&&s(e.prototype,r),n&&s(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),u}(n.Z)},572:(t,e,r)=>{r.r(e),r.d(e,{default:()=>rt});var n=r(640),o=r(843),i=r(383);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e=0&&this._paymentsPurchases.splice(i,1),this._resolvePromiseDecorator(o.Mn.CONSUME_PURCHASE,n)}else this._rejectPromiseDecorator(o.Mn.CONSUME_PURCHASE,new Error(t))}function X(t){if(null!=t&&t.success){var e=this._paymentsGetProductsPlatformData();this._paymentsPurchases=(t.data||[]).map((function(t){var r=e.find((function(e){return e.platformProductId===t.id}));return u(u({},t),{},{id:null==r?void 0:r.id,platformProductId:t.id})})),this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,this._paymentsPurchases)}else this._rejectPromiseDecorator(o.Mn.GET_PURCHASES,new Error(t))}function Q(t){this._pauseStateAggregator.setState(\"rate\",!1),t&&!1!==t.success?this._resolvePromiseDecorator(o.Mn.RATE):this._rejectPromiseDecorator(o.Mn.RATE,new Error(t))}function $(t){null!=t&&t.success?this._resolvePromiseDecorator(o.Mn.GET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.GET_STORAGE_DATA,new Error(t))}function tt(t){null!=t&&t.success?this._resolvePromiseDecorator(o.Mn.SET_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.SET_STORAGE_DATA,new Error(t))}function et(t){null!=t&&t.success?this._resolvePromiseDecorator(o.Mn.DELETE_STORAGE_DATA,t.data):this._rejectPromiseDecorator(o.Mn.DELETE_STORAGE_DATA,new Error(t))}const rt=function(t){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&f(t,e)}(s,t);var e,r,n,a=p(s);function s(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,s);for(var e=arguments.length,r=new Array(e),n=0;n{r.r(e),r.d(e,{default:()=>K});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},u=i.iterator||\"@@iterator\",c=i.asyncIterator||\"@@asyncIterator\",l=i.toStringTag||\"@@toStringTag\";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},\"\")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new L(n||[]);return o(a,\"_invoke\",{value:T(t,r,s)}),a}function h(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=p;var d=\"suspendedStart\",y=\"suspendedYield\",m=\"executing\",v=\"completed\",g={};function b(){}function _(){}function S(){}var w={};f(w,u,(function(){return this}));var E=Object.getPrototypeOf,P=E&&E(E(j([])));P&&P!==r&&n.call(P,u)&&(w=P);var A=S.prototype=b.prototype=Object.create(w);function O(t){[\"next\",\"throw\",\"return\"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,s,u){var c=h(t[o],t,i);if(\"throw\"!==c.type){var l=c.arg,f=l.value;return f&&\"object\"==a(f)&&n.call(f,\"__await\")?e.resolve(f.__await).then((function(t){r(\"next\",t,s,u)}),(function(t){r(\"throw\",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r(\"throw\",t,s,u)}))}u(c.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error(\"Generator is already running\");if(o===v){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=m;var c=h(e,r,n);if(\"normal\"===c.type){if(o=n.done?v:y,c.arg===g)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(o=v,n.method=\"throw\",n.arg=c.arg)}}}function D(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,D(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),g;var i=h(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,g):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||\"\"===e){var r=e[u];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;R(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),g}},e}function u(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,s,\"next\",t)}function s(t){u(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function l(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)}(t)||function(t,e){if(!t)return;if(\"string\"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===r&&t.constructor&&(r=t.constructor.name);if(\"Map\"===r||\"Set\"===r)return Array.from(t);if(\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rs&&(s=e,a=t)})),\"\".concat(e,\":\").concat(a[0],\"x\").concat(a[1])}function U(t,e){if(\"string\"!=typeof t)return null;if(t.endsWith(\"%\")){var r=parseFloat(t);return Number.isNaN(r)?null:Math.floor(e*r/100)}var n=parseInt(t,10);return Number.isNaN(n)?null:n}function V(t){var e=void 0!==t.top,r=void 0!==t.bottom,n=void 0!==t.left,o=void 0!==t.right;return e&&n?\"topleft\":e&&o?\"topright\":r&&n?\"bottomleft\":r&&o?\"bottomright\":e?\"top\":r?\"bottom\":n?\"left\":o?\"right\":null}function Z(t){t?(this._isPlayerAuthorized=!0,this._playerId=t.playerId,this._playerName=t.playerDisplayName,this._playerExtra=t,A(this,L,\"personal\"===t.userAccountType.toLowerCase())):this._playerApplyGuestData()}function z(t){return Y.apply(this,arguments)}function Y(){return Y=c(s().mark((function t(e){var r,n=arguments;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.length>1&&void 0!==n[1]&&n[1],this._platformStorageCachedData){t.next=5;break}return t.next=4,this.platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});case 4:this._platformStorageCachedData=t.sent;case 5:return t.abrupt(\"return\",(0,o.t0)(e,this._platformStorageCachedData,r));case 6:case\"end\":return t.stop()}}),t,this)}))),Y.apply(this,arguments)}const K=function(t){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&m(t,e)}(w,t);var e,r,n,a,u,f,p=v(w);function w(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,w);for(var e=arguments.length,r=new Array(e),n=0;n{r.r(e),r.d(e,{default:()=>ct});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r120?this._rejectPromiseDecorator(i.Mn.INVITE_FRIENDS,i.pn.INVITE_FRIENDS_MESSAGE_LENGTH_ERROR):this._platformSdk.UI.showInvite(e)),r.promise}},{key:\"rate\",value:function(){var t=this._getPromiseDecorator(i.Mn.RATE);return t||(t=this._createPromiseDecorator(i.Mn.RATE),this._platformSdk.UI.showRatingDialog()),t.promise}},{key:\"createPost\",value:function(t){if(!t||null==t||!t.media)return Promise.reject();var e,r=this._getPromiseDecorator(i.Mn.CREATE_POST);return r||(r=this._createPromiseDecorator(i.Mn.CREATE_POST),this._platformSdk.UI.postMediatopic(t,null!==(e=t.status)&&void 0!==e&&e)),r.promise}},{key:\"joinCommunity\",value:function(t){if(!t||null==t||!t.groupId)return Promise.reject();var e,r=this._getPromiseDecorator(i.Mn.JOIN_COMMUNITY);return r||(r=this._createPromiseDecorator(i.Mn.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(t.groupId,null!==(e=t.enableMessages)&&void 0!==e&&e)),r.promise}}])&&s(e.prototype,r),n&&s(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),y}(n.Z)},640:(t,e,r)=>{r.d(e,{Z:()=>x});var n=r(446),o=r(843),i=r(784),a=r(166);function s(t){return s=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},s(t)}function u(t,e){for(var r=0;r1?o.Lh.IOS:/windows/i.test(i)?o.Lh.WINDOWS:/macintosh|mac os/i.test(i)?o.Lh.MACOS:/linux/i.test(i)?o.Lh.LINUX:o.Lh.OTHER}},{key:\"isPaymentsSupported\",get:function(){return!1}},{key:\"leaderboardsType\",get:function(){return o.Z.NOT_AVAILABLE}},{key:\"isRemoteConfigSupported\",get:function(){return!1}},{key:\"isClipboardSupported\",get:function(){return!0}},{key:\"isAchievementsSupported\",get:function(){return!1}},{key:\"isGetAchievementsListSupported\",get:function(){return!1}},{key:\"isAchievementsNativePopupSupported\",get:function(){return!1}},{key:\"initialize\",value:function(){return Promise.resolve()}},{key:\"sendMessage\",value:function(){return Promise.resolve()}},{key:\"sendCustomMessage\",value:function(){return Promise.resolve()}},{key:\"getServerTime\",value:function(){return new Promise((function(t,e){fetch(o.T2).then((function(t){if(!t.ok)throw new Error(\"Network response was not ok\");return t.json()})).then((function(e){t(1e3*e.timestamp)})).catch((function(){e()}))}))}},{key:\"getAllGames\",value:function(){return Promise.reject()}},{key:\"getGameById\",value:function(){return Promise.reject()}},{key:\"authorizePlayer\",value:function(){return Promise.reject()}},{key:\"isStorageSupported\",value:function(t){switch(t){case o.bD.LOCAL_STORAGE:return null!==this._localStorage;case o.bD.PLATFORM_INTERNAL:default:return!1}}},{key:\"isStorageAvailable\",value:function(t){switch(t){case o.bD.LOCAL_STORAGE:return null!==this._localStorage;case o.bD.PLATFORM_INTERNAL:default:return!1}}},{key:\"getDataFromStorage\",value:function(t,e,r){if(e===o.bD.LOCAL_STORAGE){if(this._localStorage){if(Array.isArray(t)){for(var n=[],i=0;i{r.r(e),r.d(e,{default:()=>w});var n=r(640),o=r(843),i=r(383);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>G});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}var s=[\"bridgeId\"];function u(){u=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},s=i.iterator||\"@@iterator\",c=i.asyncIterator||\"@@asyncIterator\",l=i.toStringTag||\"@@toStringTag\";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},\"\")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new L(n||[]);return o(a,\"_invoke\",{value:T(t,r,s)}),a}function h(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=p;var d=\"suspendedStart\",y=\"suspendedYield\",m=\"executing\",v=\"completed\",g={};function b(){}function _(){}function S(){}var w={};f(w,s,(function(){return this}));var E=Object.getPrototypeOf,P=E&&E(E(j([])));P&&P!==r&&n.call(P,s)&&(w=P);var A=S.prototype=b.prototype=Object.create(w);function O(t){[\"next\",\"throw\",\"return\"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,s,u){var c=h(t[o],t,i);if(\"throw\"!==c.type){var l=c.arg,f=l.value;return f&&\"object\"==a(f)&&n.call(f,\"__await\")?e.resolve(f.__await).then((function(t){r(\"next\",t,s,u)}),(function(t){r(\"throw\",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r(\"throw\",t,s,u)}))}u(c.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error(\"Generator is already running\");if(o===v){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=m;var c=h(e,r,n);if(\"normal\"===c.type){if(o=n.done?v:y,c.arg===g)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(o=v,n.method=\"throw\",n.arg=c.arg)}}}function D(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,D(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),g;var i=h(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,g):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||\"\"===e){var r=e[s];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;R(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),g}},e}function c(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function l(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var e=1;e1&&void 0!==n[1])||n[1],this._platformStorageCachedData){t.next=5;break}return t.next=4,this.platformSdk.cloudSaveApi.getState();case 4:this._platformStorageCachedData=t.sent;case 5:return t.abrupt(\"return\",(0,o.t0)(e,this._platformStorageCachedData,r));case 6:case\"end\":return t.stop()}}),t,this)})),N=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,s,\"next\",t)}function s(t){c(i,n,o,a,s,\"throw\",t)}a(void 0)}))},N.apply(this,arguments)}function x(){var t,e,r;null!==(t=this._platformSdk.platformService)&&void 0!==t&&t.getIsPlayerAuthorizationSupported&&P(this,I,this._platformSdk.platformService.getIsPlayerAuthorizationSupported()),null!==(e=this._platformSdk.platformService)&&void 0!==e&&e.getIsCloudSaveSupported&&P(this,T,this._platformSdk.platformService.getIsCloudSaveSupported()),null!==(r=this._platformSdk.platformService)&&void 0!==r&&r.getIsPaymentsSupported&&P(this,D,this._platformSdk.platformService.getIsPaymentsSupported())}const G=function(t){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&y(t,e)}(u,t);var e,r,n,a=m(u);function u(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,u);for(var e=arguments.length,r=new Array(e),n=0;n=0&&e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(i.Mn.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(i.Mn.CONSUME_PURCHASE,t)})),n.promise}return d(g(u.prototype),\"paymentsConsumePurchase\",this).call(this,t)}},{key:\"paymentsGetCatalog\",value:function(){var t=this._paymentsGetProductsPlatformData();if(!t)return Promise.reject();var e=t.map((function(t){return{id:t.id,price:\"\".concat(t.amount,\" Gam\"),priceCurrencyCode:\"Gam\",priceCurrencyImage:\"https://games.playgama.com/assets/gold-fennec-coin-large.webp\",priceValue:t.amount}}));return Promise.resolve(e)}}])&&h(e.prototype,r),n&&h(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),u}(n.Z)},514:(t,e,r)=>{r.r(e),r.d(e,{default:()=>h});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>m});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e{r.r(e),r.d(e,{ACTION_NAME_QA:()=>pt,INTERNAL_STORAGE_POLICY:()=>ft,SUPPORTED_FEATURES:()=>Rt,default:()=>se});var n=r(640),o=r(383);function i(t){return i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},i(t)}function a(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:\"*\";(0,o.n_)(t,e)}},{key:\"addListener\",value:function(t){window.addEventListener(\"message\",t)}},{key:\"removeListener\",value:function(t){window.removeEventListener(\"message\",t)}},{key:\"generateMessageId\",value:function(){return\"\".concat(Date.now(),\"-\").concat(Math.random())}}],r&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),t}(),c=r(66);function l(t){return l=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},l(t)}function f(){f=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",u=i.toStringTag||\"@@toStringTag\";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},\"\")}catch(t){c=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),s=new L(n||[]);return o(a,\"_invoke\",{value:T(t,r,s)}),a}function h(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=p;var d=\"suspendedStart\",y=\"suspendedYield\",m=\"executing\",v=\"completed\",g={};function b(){}function _(){}function S(){}var w={};c(w,a,(function(){return this}));var E=Object.getPrototypeOf,P=E&&E(E(j([])));P&&P!==r&&n.call(P,a)&&(w=P);var A=S.prototype=b.prototype=Object.create(w);function O(t){[\"next\",\"throw\",\"return\"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,a,s){var u=h(t[o],t,i);if(\"throw\"!==u.type){var c=u.arg,f=c.value;return f&&\"object\"==l(f)&&n.call(f,\"__await\")?e.resolve(f.__await).then((function(t){r(\"next\",t,a,s)}),(function(t){r(\"throw\",t,a,s)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return r(\"throw\",t,a,s)}))}s(u.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var o=d;return function(i,a){if(o===m)throw new Error(\"Generator is already running\");if(o===v){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=D(s,n);if(u){if(u===g)continue;return u}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=m;var c=h(e,r,n);if(\"normal\"===c.type){if(o=n.done?v:y,c.arg===g)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(o=v,n.method=\"throw\",n.arg=c.arg)}}}function D(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,D(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),g;var i=h(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,g):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,g)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(I,this),this.reset(!0)}function j(e){if(e||\"\"===e){var r=e[a];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;R(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:j(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),g}},e}function p(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){p(i,n,o,a,s,\"next\",t)}function s(t){p(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function d(t,e){for(var r=0;r0&&void 0!==h[0]?h[0]:{},o=this.checkAvailability(),i=o.available,a=o.reason,i){t.next=5;break}return null===(s=b(this,T))||void 0===s||s.call(this,a),t.abrupt(\"return\");case 5:return u=_(this,I,M).call(this),S(this,P,u.captureStream(n.fps||30)),n.contentHint&&(c=b(this,P).getVideoTracks()[0])&&(c.contentHint=n.contentHint),S(this,E,new RTCPeerConnection),b(this,P).getTracks().forEach((function(t){return b(p,E).addTrack(t,b(p,P))})),b(this,E).onicecandidate=function(t){var e;t.candidate&&(null===(e=b(p,O))||void 0===e||e.call(p,t.candidate.toJSON()))},t.next=13,b(this,E).createOffer();case 13:return l=t.sent,t.next=16,b(this,E).setLocalDescription(l);case 16:_(this,D,j).call(this,n),null===(e=b(this,A))||void 0===e||e.call(this,l.sdp),null===(r=b(this,k))||void 0===r||r.call(this);case 19:case\"end\":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:\"handleAnswer\",value:(i=h(f().mark((function t(e){var r;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.sdp,!b(this,E)){t.next=4;break}return t.next=4,b(this,E).setRemoteDescription(new RTCSessionDescription({type:\"answer\",sdp:r}));case 4:case\"end\":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:\"handleIce\",value:(o=h(f().mark((function t(e){return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!b(this,E)||!e){t.next=3;break}return t.next=3,b(this,E).addIceCandidate(new RTCIceCandidate(e));case 3:case\"end\":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:\"takeScreenshot\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.type,r=void 0===e?\"image/png\":e,n=t.quality,o=void 0===n?.92:n,i=_(this,I,M).call(this);return i?{success:!0,reason:null,data:i.toDataURL(r,o)}:{success:!1,reason:\"Canvas not found\",data:null}}},{key:\"stopCapture\",value:function(){var t,e;null===(t=b(this,P))||void 0===t||t.getTracks().forEach((function(t){return t.stop()})),null===(e=b(this,E))||void 0===e||e.close(),S(this,E,null),S(this,P,null)}}],r&&d(e.prototype,r),n&&d(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),t}());var G,B=r(843);function F(){F=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",u=i.toStringTag||\"@@toStringTag\";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},\"\")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,\"_invoke\",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=l;var p=\"suspendedStart\",h=\"suspendedYield\",d=\"executing\",y=\"completed\",m={};function v(){}function g(){}function b(){}var _={};c(_,a,(function(){return this}));var S=Object.getPrototypeOf,w=S&&S(S(R([])));w&&w!==r&&n.call(w,a)&&(_=w);var E=b.prototype=v.prototype=Object.create(_);function P(t){[\"next\",\"throw\",\"return\"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if(\"throw\"!==u.type){var c=u.arg,l=c.value;return l&&\"object\"==z(l)&&n.call(l,\"__await\")?e.resolve(l.__await).then((function(t){r(\"next\",t,a,s)}),(function(t){r(\"throw\",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r(\"throw\",t,a,s)}))}s(u.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error(\"Generator is already running\");if(o===y){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===m)continue;return u}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=d;var c=f(e,r,n);if(\"normal\"===c.type){if(o=n.done?y:h,c.arg===m)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(o=y,n.method=\"throw\",n.arg=c.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,k(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),m;var i=f(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,m):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,m)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(T,this),this.reset(!0)}function R(e){if(e||\"\"===e){var r=e[a];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function H(t){return function(t){if(Array.isArray(t))return W(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)}(t)||function(t,e){if(!t)return;if(\"string\"==typeof t)return W(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===r&&t.constructor&&(r=t.constructor.name);if(\"Map\"===r||\"Set\"===r)return Array.from(t);if(\"Arguments\"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return W(t,e)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{};return[B.Dt.GAME_READY,B.Dt.LEVEL_STARTED,B.Dt.LEVEL_COMPLETED,B.Dt.LEVEL_FAILED,B.Dt.LEVEL_PAUSED,B.Dt.LEVEL_RESUMED,B.Dt.IN_GAME_LOADING_STARTED,B.Dt.IN_GAME_LOADING_STOPPED,B.Dt.GAMEPLAY_STARTED,B.Dt.GAMEPLAY_STOPPED,B.Dt.PLAYER_GOT_ACHIEVEMENT].includes(t)?(ot(this,xt,Xt).call(this,{type:B.oF.PLATFORM,action:t,options:e}),Promise.resolve()):Q($(a.prototype),\"sendMessage\",this).call(this,t,e)}},{key:\"getServerTime\",value:function(){return ot(this,Gt,Qt).call(this,B.oF.PLATFORM,pt.GET_SERVER_TIME,{options:{}},{timeout:5e3}).then((function(t){var e=t.time;if(!e)throw new Error(\"Invalid server time\");return e})).catch((function(){throw new Error(\"Server time request timeout\")}))}},{key:\"isStorageSupported\",value:function(t){return ot(this,xt,Xt).call(this,{type:B.oF.STORAGE,action:pt.IS_STORAGE_SUPPORTED,options:{storageType:t}}),!(t!==B.bD.PLATFORM_INTERNAL||!this._supportedFeatures.includes(Rt.STORAGE_INTERNAL))||!(t!==B.bD.LOCAL_STORAGE||!this._supportedFeatures.includes(Rt.STORAGE_LOCAL))}},{key:\"isStorageAvailable\",value:function(t){return ot(this,xt,Xt).call(this,{type:B.oF.STORAGE,action:pt.IS_STORAGE_AVAILABLE,options:{storageType:t}}),(t===B.bD.PLATFORM_INTERNAL&&this._supportedFeatures.includes(Rt.STORAGE_INTERNAL)&&ot(this,Ut,oe).call(this)||!(t!==B.bD.LOCAL_STORAGE||!this._supportedFeatures.includes(Rt.STORAGE_LOCAL)))&&Q($(a.prototype),\"isStorageAvailable\",this).call(this,B.bD.LOCAL_STORAGE)}},{key:\"getDataFromStorage\",value:function(t,e,r){return this.isStorageSupported(e)?ot(this,Gt,Qt).call(this,B.oF.STORAGE,pt.GET_DATA_FROM_STORAGE,{options:{key:t,storageType:e,tryParseJson:r}}).then((function(e){var n=e.storage;return(0,o.t0)(t,n,r)})):Promise.reject(B.pn.STORAGE_NOT_SUPPORTED)}},{key:\"setDataToStorage\",value:function(t,e,r){return ot(this,xt,Xt).call(this,{type:B.oF.STORAGE,action:pt.SET_DATA_TO_STORAGE,options:{key:t,value:e,storageType:r}}),this.isStorageSupported(r)?r===B.bD.PLATFORM_INTERNAL||r===B.bD.LOCAL_STORAGE?Promise.resolve():Q($(a.prototype),\"setDataToStorage\",this).call(this,t,e,r):Promise.reject(B.pn.STORAGE_NOT_SUPPORTED)}},{key:\"deleteDataFromStorage\",value:function(t,e){return ot(this,xt,Xt).call(this,{type:B.oF.STORAGE,action:pt.DELETE_DATA_FROM_STORAGE,options:{key:t,storageType:e}}),this.isStorageSupported(e)?e===B.bD.PLATFORM_INTERNAL||e===B.bD.LOCAL_STORAGE?Promise.resolve():Q($(a.prototype),\"deleteDataFromStorage\",this).call(this,t,e):Promise.reject(B.pn.STORAGE_NOT_SUPPORTED)}},{key:\"showInterstitial\",value:function(t){this.isInterstitialSupported&&ot(this,xt,Xt).call(this,{type:B.oF.ADVERTISEMENT,action:it,options:{placement:t}})}},{key:\"showRewarded\",value:function(t){this.isRewardedSupported&&ot(this,xt,Xt).call(this,{type:B.oF.ADVERTISEMENT,action:at,options:{placement:t}})}},{key:\"showBanner\",value:function(t,e){this.isBannerSupported&&(this._setBannerState(B.Kk.SHOWN),ot(this,xt,Xt).call(this,{type:B.oF.ADVERTISEMENT,action:B.Kk.SHOWN,options:{type:st,position:t,placement:e}}))}},{key:\"hideBanner\",value:function(){this.isBannerSupported&&(this._setBannerState(B.Kk.HIDDEN),ot(this,xt,Xt).call(this,{type:B.oF.ADVERTISEMENT,action:B.Kk.HIDDEN,options:{type:st}}))}},{key:\"showAdvancedBanners\",value:function(t){this.isAdvancedBannersSupported&&(this._setAdvancedBannersState(B.Kk.LOADING),ot(this,xt,Xt).call(this,{type:B.oF.ADVERTISEMENT,action:pt.SHOW_ADVANCED_BANNERS,options:{banners:t}}))}},{key:\"hideAdvancedBanners\",value:function(){this.isAdvancedBannersSupported&&(this._setAdvancedBannersState(B.Kk.HIDDEN),ot(this,xt,Xt).call(this,{type:B.oF.ADVERTISEMENT,action:pt.HIDE_ADVANCED_BANNERS}))}},{key:\"checkAdBlock\",value:function(){return ot(this,xt,Xt).call(this,{type:pt.CHECK_ADBLOCK,action:B.Mn.ADBLOCK_DETECT}),Q($(a.prototype),\"checkAdBlock\",this).call(this)}},{key:\"inviteFriends\",value:function(){if(!this.isInviteFriendsSupported)return Promise.reject();var t=this._getPromiseDecorator(B.Mn.INVITE_FRIENDS);return t||(t=this._createPromiseDecorator(B.Mn.INVITE_FRIENDS),this._resolvePromiseDecorator(B.Mn.INVITE_FRIENDS),ot(this,xt,Xt).call(this,{type:B.oF.SOCIAL,action:B.Mn.INVITE_FRIENDS})),t.promise}},{key:\"joinCommunity\",value:function(){if(!this.isJoinCommunitySupported)return Promise.reject();var t=this._getPromiseDecorator(B.Mn.JOIN_COMMUNITY);return t||(t=this._createPromiseDecorator(B.Mn.JOIN_COMMUNITY),this._resolvePromiseDecorator(B.Mn.JOIN_COMMUNITY),ot(this,xt,Xt).call(this,{type:B.oF.SOCIAL,action:B.Mn.JOIN_COMMUNITY})),t.promise}},{key:\"share\",value:function(){if(!this.isShareSupported)return Promise.reject();var t=this._getPromiseDecorator(B.Mn.SHARE);return t||(t=this._createPromiseDecorator(B.Mn.SHARE),this._resolvePromiseDecorator(B.Mn.SHARE),ot(this,xt,Xt).call(this,{type:B.oF.SOCIAL,action:B.Mn.SHARE})),t.promise}},{key:\"createPost\",value:function(){if(!this.isCreatePostSupported)return Promise.reject();var t=this._getPromiseDecorator(B.Mn.CREATE_POST);return t||(t=this._createPromiseDecorator(B.Mn.CREATE_POST),this._resolvePromiseDecorator(B.Mn.CREATE_POST),ot(this,xt,Xt).call(this,{type:B.oF.SOCIAL,action:B.Mn.CREATE_POST})),t.promise}},{key:\"addToHomeScreen\",value:function(){if(!this.isAddToHomeScreenSupported)return Promise.reject();var t=this._getPromiseDecorator(B.Mn.ADD_TO_HOME_SCREEN);return t||(t=this._createPromiseDecorator(B.Mn.ADD_TO_HOME_SCREEN),this._resolvePromiseDecorator(B.Mn.ADD_TO_HOME_SCREEN),ot(this,xt,Xt).call(this,{type:B.oF.SOCIAL,action:B.Mn.ADD_TO_HOME_SCREEN})),t.promise}},{key:\"addToFavorites\",value:function(){if(!this.isAddToFavoritesSupported)return Promise.reject();var t=this._getPromiseDecorator(B.Mn.ADD_TO_FAVORITES);return t||(t=this._createPromiseDecorator(B.Mn.ADD_TO_FAVORITES),this._resolvePromiseDecorator(B.Mn.ADD_TO_FAVORITES),ot(this,xt,Xt).call(this,{type:B.oF.SOCIAL,action:B.Mn.ADD_TO_FAVORITES})),t.promise}},{key:\"rate\",value:function(){if(!this.isRateSupported)return Promise.reject();var t=this._getPromiseDecorator(B.Mn.RATE);return t||(t=this._createPromiseDecorator(B.Mn.RATE),this._resolvePromiseDecorator(B.Mn.RATE),ot(this,xt,Xt).call(this,{type:B.oF.SOCIAL,action:B.Mn.RATE})),t.promise}},{key:\"paymentsPurchase\",value:function(t,e){var r=this;if(!this.isPaymentsSupported)return Promise.reject();var n=this._paymentsGetProductPlatformData(t);if(!n)return Promise.reject();e&&e.externalId&&(n.externalId=e.externalId),n.externalId||(n.externalId=this._paymentsGenerateTransactionId(t));var o=this._getPromiseDecorator(B.Mn.PURCHASE);return o||(o=this._createPromiseDecorator(B.Mn.PURCHASE),ot(this,Gt,Qt).call(this,B.oF.PAYMENTS,B.Mn.PURCHASE,{options:{product:n}}).then((function(e){var n=e.purchase;if(n&&\"object\"===z(n))if(null!=n&&n.status){var o=Z({id:t},n.purchaseData);r._paymentsPurchases.push(o),r._resolvePromiseDecorator(B.Mn.PURCHASE,o)}else r._rejectPromiseDecorator(B.Mn.PURCHASE,(null==n?void 0:n.error)||new Error(\"Unknown purchase error\"));else r._rejectPromiseDecorator(B.Mn.PURCHASE,new Error(\"Invalid purchase\"))}))),o.promise}},{key:\"paymentsConsumePurchase\",value:function(t){var e=this;if(!this.isPaymentsSupported)return Promise.reject();var r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(B.Mn.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(B.Mn.CONSUME_PURCHASE),ot(this,Gt,Qt).call(this,B.oF.PAYMENTS,B.Mn.CONSUME_PURCHASE,{options:{product:this._paymentsPurchases[r]}}).then((function(n){var o=n.purchase;if(o&&\"object\"===z(o))if(null!=o&&o.status){var i=Z({id:t},o);e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(B.Mn.CONSUME_PURCHASE,i)}else e._rejectPromiseDecorator(B.Mn.CONSUME_PURCHASE,(null==o?void 0:o.error)||new Error(\"Unknown consume purchase error\"));else e._rejectPromiseDecorator(B.Mn.CONSUME_PURCHASE,new Error(\"Invalid purchase\"))}))),n.promise}},{key:\"paymentsGetCatalog\",value:function(){var t=this;if(!this.isPaymentsSupported)return Promise.reject();var e=this._getPromiseDecorator(B.Mn.GET_CATALOG);if(!e){e=this._createPromiseDecorator(B.Mn.GET_CATALOG);var r=this._paymentsGetProductsPlatformData();ot(this,Gt,Qt).call(this,B.oF.PAYMENTS,B.Mn.GET_CATALOG,{options:{products:r}}).then((function(){var e=r.map((function(t){return{id:t.id,price:\"\".concat(t.amount,\" Gam\"),priceCurrencyCode:\"Gam\",priceCurrencyImage:\"https://games.playgama.com/assets/gold-fennec-coin-large.webp\",priceValue:t.amount}}));t._resolvePromiseDecorator(B.Mn.GET_CATALOG,e)}))}return e.promise}},{key:\"paymentsGetPurchases\",value:function(){var t=this;if(!this.isPaymentsSupported)return Promise.reject();var e=this._getPromiseDecorator(B.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(B.Mn.GET_PURCHASES),ot(this,Gt,Qt).call(this,B.oF.PAYMENTS,B.Mn.GET_PURCHASES,{options:{products:this._paymentsGetProductsPlatformData()}}).then((function(e){var r=e.purchases,n=t._paymentsGetProductsPlatformData();t._paymentsPurchases=r.map((function(t){return Z({id:n.find((function(e){return e.id===t.id})).id},t.purchaseData)})),t._resolvePromiseDecorator(B.Mn.GET_PURCHASES,t._paymentsPurchases)}))),e.promise}},{key:\"getRemoteConfig\",value:function(){var t=this;if(!this.isRemoteConfigSupported)return Promise.reject();var e=this._getPromiseDecorator(B.Mn.GET_REMOTE_CONFIG);return e||(e=this._createPromiseDecorator(B.Mn.GET_REMOTE_CONFIG),ot(this,Gt,Qt).call(this,B.oF.REMOTE_CONFIG,B.Mn.GET_REMOTE_CONFIG).then((function(e){var r=e.result;t._resolvePromiseDecorator(B.Mn.GET_REMOTE_CONFIG,r)}))),e.promise}},{key:\"clipboardWrite\",value:function(t){var e=this;if(!this.isClipboardSupported)return Promise.reject();var r=this._getPromiseDecorator(B.Mn.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(B.Mn.CLIPBOARD_WRITE),ot(this,Gt,Qt).call(this,B.oF.CLIPBOARD,B.Mn.CLIPBOARD_WRITE,{options:{text:t}}).then((function(){e._resolvePromiseDecorator(B.Mn.CLIPBOARD_WRITE,!0)}))),r.promise}},{key:\"clipboardRead\",value:function(){var t=this;if(!this.isClipboardSupported)return Promise.reject();var e=this._getPromiseDecorator(pt.CLIPBOARD_READ);return e||(e=this._createPromiseDecorator(pt.CLIPBOARD_READ),ot(this,Gt,Qt).call(this,B.oF.CLIPBOARD,pt.CLIPBOARD_READ,{options:{}}).then((function(e){var r=e.text;t._resolvePromiseDecorator(pt.CLIPBOARD_READ,r)}))),e.promise}},{key:\"leaderboardsSetScore\",value:function(t,e){if(this.leaderboardsType===B.Z.NOT_AVAILABLE)return Promise.reject(new Error(\"Leaderboards are not available\"));var r=this._getPromiseDecorator(B.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(B.Mn.LEADERBOARDS_SET_SCORE);var n={id:t,score:e};ot(this,xt,Xt).call(this,{type:B.oF.LEADERBOARDS,action:B.Mn.LEADERBOARDS_SET_SCORE,options:n}),this._resolvePromiseDecorator(B.Mn.LEADERBOARDS_SET_SCORE)}return r.promise}},{key:\"leaderboardsGetEntries\",value:function(t){var e=this;if(this.leaderboardsType!==B.Z.IN_GAME)return Promise.reject(new Error(\"Leaderboards are not available\"));var r=this._getPromiseDecorator(B.Mn.LEADERBOARDS_GET_ENTRIES);return r||(r=this._createPromiseDecorator(B.Mn.LEADERBOARDS_GET_ENTRIES),ot(this,Gt,Qt).call(this,B.oF.LEADERBOARDS,B.Mn.LEADERBOARDS_GET_ENTRIES,{options:{id:t}},{timeout:5e3}).then((function(t){var r=t.entries;e._resolvePromiseDecorator(B.Mn.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(){e._rejectPromiseDecorator(B.Mn.LEADERBOARDS_GET_ENTRIES)}))),r.promise}},{key:\"leaderboardsShowNativePopup\",value:function(t){return this.leaderboardsType!==B.Z.NATIVE_POPUP?Promise.reject(new Error(\"Leaderboards are not available\")):(ot(this,xt,Xt).call(this,{type:B.oF.LEADERBOARDS,action:B.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,options:{id:t}}),Promise.resolve(B.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP))}},{key:\"unlockAchievement\",value:function(t){return this.isAchievementsSupported?ot(this,Gt,Qt).call(this,B.oF.ACHIEVEMENTS,pt.UNLOCK_ACHIEVEMENT,{options:t}).then((function(t){return t.result})):Promise.reject()}},{key:\"getAchievementsList\",value:function(t){return this.isGetAchievementsListSupported?ot(this,Gt,Qt).call(this,B.oF.ACHIEVEMENTS,pt.GET_ACHIEVEMENTS,{options:t}).then((function(t){return t.result})):Promise.reject()}},{key:\"showAchievementsNativePopup\",value:function(){return this.isAchievementsNativePopupSupported?(ot(this,xt,Xt).call(this,{type:B.oF.ACHIEVEMENTS,action:pt.SHOW_ACHIEVEMENTS_NATIVE_POPUP}),Promise.resolve()):Promise.reject()}},{key:\"_paymentsGetProductsPlatformData\",value:function(){return this._options.payments?this._options.payments.map((function(t){return Z({id:t.id},t.playgama)})):[]}},{key:\"_paymentsGetProductPlatformData\",value:function(t){var e=this._options.payments;if(!e)return null;var r=e.find((function(e){return e.id===t}));return r?Z({id:r.id},r.playgama):null}}],r&&Y(e.prototype,r),n&&Y(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),a}(n.Z);function Yt(t){var e,r,n,o,i;this._supportedFeatures=t.supportedFeatures||[],this._isBannerSupported=this._supportedFeatures.includes(Rt.BANNER),this._isAdvancedBannersSupported=this._supportedFeatures.includes(Rt.ADVANCED_BANNERS);var a=t.config,s=void 0===a?{}:a;this._deviceType=null!==(e=s.deviceType)&&void 0!==e?e:Q($(G.prototype),\"deviceType\",this),this._platformLanguage=s.platformLanguage?s.platformLanguage.toLowerCase():Q($(G.prototype),\"platformLanguage\",this),this._platformTld=null!==(r=s.platformTld)&&void 0!==r?r:Q($(G.prototype),\"platformTld\",this),this._platformPayload=null!==(n=s.platformPayload)&&void 0!==n?n:Q($(G.prototype),\"platformPayload\",this),this._leaderboardsType=null!==(o=s.leaderboardsType)&&void 0!==o?o:B.Z.NOT_AVAILABLE,this._internalStoragePolicy=null!==(i=s.internalStoragePolicy)&&void 0!==i?i:ft.AUTHORIZED_ONLY,this._paymentsPurchases=t.purchases||[],this._isInitialized=!0,this._resolvePromiseDecorator(B.Mn.INITIALIZE),ot(this,Vt,ie).call(this),ot(this,xt,Xt).call(this,{type:lt,action:pt.LIVENESS_PING,options:{version:\"1.31.0\"}})}function Kt(t){this._setAudioState(t.options.isEnabled)}function Jt(t){this._setPauseState(t.options.isPaused)}function qt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Array.isArray(e)?e:[],n=performance.getEntriesByType(\"resource\")||[],o=r.length>0?r:[\"name\",\"initiatorType\"],i=n.map((function(t){var e={};return o.forEach((function(r){r in t&&(e[r]=t[r])})),e}));return ot(this,xt,Xt).call(this,{type:B.oF.PLATFORM,action:pt.GET_PERFORMANCE_RESOURCES,id:t,options:{resources:i}}),Promise.resolve(n)}function Xt(t){nt(this,Lt).send(Z({source:ct},t))}function Qt(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=nt(this,Lt).generateMessageId(),a=Z({timeout:0},o);return new Promise((function(s,u){var c=function n(o){var a=o.data;(null==a?void 0:a.type)===t&&(null==a?void 0:a.action)===e&&(null==a?void 0:a.id)===i&&(null==a?void 0:a.source)!==ct&&(nt(r,Lt).removeListener(n),s(a))};nt(r,Lt).addListener(c),ot(r,xt,Xt).call(r,Z({type:t,action:e,id:i,options:o},n)),a.timeout>0&&setTimeout((function(){u(new Error(\"Request timeout\")),nt(r,Lt).removeListener(c)}),a.timeout)}))}function $t(){return te.apply(this,arguments)}function te(){var t;return t=F().mark((function t(){var e=this;return F().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt(\"return\",ot(this,Gt,Qt).call(this,B.oF.PLAYER,pt.GET_PLAYER).then((function(t){var r=t.player;null!=r&&r.isAuthorized?(e._playerId=r.userId,e._isPlayerAuthorized=r.isAuthorized,e._playerName=r.name,Array.isArray(r.photos)&&(e._playerPhotos=H(r.photos)),e._playerExtra=r,ot(e,Vt,ie).call(e)):e._playerApplyGuestData()})).catch((function(){e._playerApplyGuestData()})));case 1:case\"end\":return t.stop()}}),t,this)})),te=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){U(i,n,o,a,s,\"next\",t)}function s(t){U(i,n,o,a,s,\"throw\",t)}a(void 0)}))},te.apply(this,arguments)}function ee(t){var e=t.action,r=t.payload;if(e===it){if(!this.isInterstitialSupported)return;switch(r.status){case wt:this._setInterstitialState(B.WA.LOADING);break;case Et:this._setInterstitialState(B.WA.OPENED);break;case At:this._showAdFailurePopup(!1);break;case Pt:this._setInterstitialState(B.WA.CLOSED)}}else if(e===at){if(!this.isRewardedSupported)return;switch(r.status){case Ot:this._setRewardedState(B.b3.LOADING);break;case kt:this._setRewardedState(B.b3.OPENED);break;case Tt:this._setRewardedState(B.b3.REWARDED);break;case Dt:this._setRewardedState(B.b3.CLOSED);break;case It:this._showAdFailurePopup(!0)}}else if(e===ut)switch(r.status){case B.Kk.SHOWN:this._setAdvancedBannersState(B.Kk.SHOWN);break;case B.Kk.HIDDEN:this._setAdvancedBannersState(B.Kk.HIDDEN);break;case B.Kk.FAILED:this._setAdvancedBannersState(B.Kk.FAILED);break;case B.Kk.LOADING:this._setAdvancedBannersState(B.Kk.LOADING)}}function re(t){switch(t.action){case ht:x.startCapture(t.options||{});break;case dt:x.stopCapture();break;case mt:x.handleAnswer(t.options);break;case vt:x.handleIce(t.options);break;case _t:var e=x.takeScreenshot(t.options||{});ot(this,xt,Xt).call(this,{type:B.oF.RECORDER,action:St,payload:e})}}function ne(){var t=this;x.onOffer=function(e){ot(t,xt,Xt).call(t,{type:B.oF.RECORDER,action:yt,payload:{sdp:e}})},x.onIceCandidate=function(e){ot(t,xt,Xt).call(t,{type:B.oF.RECORDER,action:vt,payload:e})},x.onStarted=function(){ot(t,xt,Xt).call(t,{type:B.oF.RECORDER,action:gt})},x.onError=function(e){ot(t,xt,Xt).call(t,{type:B.oF.RECORDER,action:bt,payload:{message:e}})}}function oe(){return this._internalStoragePolicy===ft.AUTHORIZED_ONLY&&this._isPlayerAuthorized||this._internalStoragePolicy===ft.ALWAYS}function ie(){ot(this,Ut,oe).call(this)?this._defaultStorageType=B.bD.PLATFORM_INTERNAL:this._defaultStorageType=B.bD.LOCAL_STORAGE}function ae(){\"unity\"===this.engine&&indexedDB.deleteDatabase(\"UnityCache\")}G=zt;const se=zt},381:(t,e,r)=>{r.r(e),r.d(e,{default:()=>b});var n=r(640),o=r(843);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function a(t,e,r){return(e=c(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t){return s=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},s(t)}function u(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=e.method,n=void 0===r?\"GET\":r,o=e.body,i={method:n,headers:{}};return void 0!==o&&(i.headers[\"Content-Type\"]=\"application/json\",i.body=JSON.stringify(o)),fetch(t,i).then((function(e){return e.ok?e.text().then((function(t){if(!t)return null;try{return JSON.parse(t)}catch(t){return null}})):e.text().then((function(r){var o=r?\": \".concat(r):\"\";throw new Error(\"\".concat(n,\" \").concat(t,\" failed (\").concat(e.status,\")\").concat(o))}))}))}const b=function(t){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&f(t,e)}(b,t);var e,r,n,c=p(b);function b(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,b);for(var e=arguments.length,r=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},r=this._getPromiseDecorator(o.Mn.CREATE_POST);return r||(r=this._createPromiseDecorator(o.Mn.CREATE_POST),m(this,v,g).call(this,\"/api/create-post\",{method:\"POST\",body:{options:e}}).then((function(){t._resolvePromiseDecorator(o.Mn.CREATE_POST)})).catch((function(e){t._rejectPromiseDecorator(o.Mn.CREATE_POST,e)}))),r.promise}},{key:\"joinCommunity\",value:function(){var t=this,e=this._getPromiseDecorator(o.Mn.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(o.Mn.JOIN_COMMUNITY),m(this,v,g).call(this,\"/api/join-community\",{method:\"POST\"}).then((function(){t._resolvePromiseDecorator(o.Mn.JOIN_COMMUNITY)})).catch((function(e){t._rejectPromiseDecorator(o.Mn.JOIN_COMMUNITY,e)}))),e.promise}}],r&&u(e.prototype,r),n&&u(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),b}(n.Z)},673:(t,e,r)=>{r.r(e),r.d(e,{default:()=>C});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r=2&&(t._platformLanguage=r.substring(0,2).toLowerCase());var n=t._platformSdk.canCreateShortCut();return g(t,S,Boolean(n)&&!n.err),t._platformSdk.setOnPauseCallback((function(){t._setPauseState(!0)})),t._platformSdk.setOnResumeCallback((function(){t._setPauseState(!1)})),v(t,A,I).call(t)})).then((function(){return v(t,O,R).call(t),t._platformSdk.startGameAsync()})).then((function(e){if(e&&e.err)throw new Error(\"Samsung startGameAsync failed: \".concat(e.err));t._isInitialized=!0,t._resolvePromiseDecorator(i.Mn.INITIALIZE)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.INITIALIZE,e)}))),e.promise}},{key:\"authorizePlayer\",value:function(){var t=this;if(this._isPlayerAuthorized)return Promise.resolve();var e=this._getPromiseDecorator(i.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(i.Mn.AUTHORIZE_PLAYER),this._platformSdk.loginAsync().catch((function(t){if(!t||\"ALREADY_LOGGED_IN\"!==t.err)throw t})).then((function(){return t._platformSdk.player.getPlayerIdAsync()})).then((function(e){t._isPlayerAuthorized=!0,t._playerId=e,t._resolvePromiseDecorator(i.Mn.AUTHORIZE_PLAYER)})).catch((function(e){var r=e&&e.err||(\"string\"==typeof e?e:\"samsung_auth_failed\");t._rejectPromiseDecorator(i.Mn.AUTHORIZE_PLAYER,new Error(r))}))),e.promise}},{key:\"isStorageSupported\",value:function(t){return t===i.bD.PLATFORM_INTERNAL||u(p(y.prototype),\"isStorageSupported\",this).call(this,t)}},{key:\"isStorageAvailable\",value:function(t){return t===i.bD.PLATFORM_INTERNAL?this._isPlayerAuthorized:u(p(y.prototype),\"isStorageAvailable\",this).call(this,t)}},{key:\"getDataFromStorage\",value:function(t,e,r){var n=this;if(e===i.bD.PLATFORM_INTERNAL){var o=Array.isArray(t)?t:[t];return this._platformSdk.getDataAsync(o).then((function(e){return Array.isArray(t)?t.map((function(t){return v(n,T,j).call(n,e,t,r)})):v(n,T,j).call(n,e,t,r)}))}return u(p(y.prototype),\"getDataFromStorage\",this).call(this,t,e,r)}},{key:\"setDataToStorage\",value:function(t,e,r){if(r===i.bD.PLATFORM_INTERNAL){var n={};if(Array.isArray(t))for(var o=0;o{r.r(e),r.d(e,{default:()=>p});var n=r(735),o=r(843);function i(t){return i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},i(t)}function a(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>E});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>D});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>w});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:\"result\",i=this._getPromiseDecorator(t);return i||(i=this._createPromiseDecorator(t),this._platformSdk.send(e,n).then((function(e){e[o]?r._resolvePromiseDecorator(t):r._rejectPromiseDecorator(t)})).catch((function(e){r._rejectPromiseDecorator(t,e)}))),i.promise}const w=function(t){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&c(t,e)}(g,t);var e,r,n,a=l(g);function g(){var t,e,r;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,g);for(var n=arguments.length,o=new Array(n),i=0;i{r.r(e),r.d(e,{default:()=>S});var n=r(640),o=r(843),i=r(383);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){for(var r=0;r{r.r(e),r.d(e,{default:()=>L});var n=r(640),o=r(383),i=r(843),a=[\"player\"];function s(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e{r.r(e),r.d(e,{default:()=>D});var n=r(640),o=r(383),i=r(843);function a(t){return a=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},a(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e0?t.entries.map((function(t){return{id:t.player.uniqueID,name:t.player.publicName,score:t.score,rank:t.rank,photo:t.player.getAvatarSrc(\"large\")}})):[],e._resolvePromiseDecorator(i.Mn.LEADERBOARDS_GET_ENTRIES,r)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.LEADERBOARDS_GET_ENTRIES,t)}))}return r.promise}},{key:\"paymentsPurchase\",value:function(t){var e=this;if(!S(this,A))return Promise.reject();var r=this._paymentsGetProductPlatformData(t);r||(r={id:t});var n=this._getPromiseDecorator(i.Mn.PURCHASE);return n||(n=this._createPromiseDecorator(i.Mn.PURCHASE),S(this,A).purchase(r).then((function(r){var n=u({id:t},r.purchaseData);delete n.productID,e._paymentsPurchases.push(n),e._resolvePromiseDecorator(i.Mn.PURCHASE,n)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.PURCHASE,t)}))),n.promise}},{key:\"paymentsConsumePurchase\",value:function(t){var e=this;if(!S(this,A))return Promise.reject();var r=this._paymentsPurchases.findIndex((function(e){return e.id===t}));if(r<0)return Promise.reject();var n=this._getPromiseDecorator(i.Mn.CONSUME_PURCHASE);return n||(n=this._createPromiseDecorator(i.Mn.CONSUME_PURCHASE),S(this,A).consumePurchase(this._paymentsPurchases[r].purchaseToken).then((function(){e._paymentsPurchases.splice(r,1),e._resolvePromiseDecorator(i.Mn.CONSUME_PURCHASE,{id:t})})).catch((function(t){e._rejectPromiseDecorator(i.Mn.CONSUME_PURCHASE,t)}))),n.promise}},{key:\"paymentsGetCatalog\",value:function(){var t=this;if(!S(this,A))return Promise.reject();var e=this._paymentsGetProductsPlatformData(),r=this._getPromiseDecorator(i.Mn.GET_CATALOG);return r||(r=this._createPromiseDecorator(i.Mn.GET_CATALOG),S(this,A).getCatalog().then((function(r){var n=e.map((function(t){var e,n=r.find((function(e){return e.id===t.id}));return{id:t.id,title:n.title,description:n.description,imageURI:n.imageURI,price:n.price,priceCurrencyCode:n.priceCurrencyCode,priceValue:n.priceValue,priceCurrencyImage:null===(e=n.getPriceCurrencyImage)||void 0===e?void 0:e.call(n,\"medium\")}}));t._resolvePromiseDecorator(i.Mn.GET_CATALOG,n)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.GET_CATALOG,e)}))),r.promise}},{key:\"paymentsGetPurchases\",value:function(){var t=this;if(!S(this,A))return Promise.reject();var e=this._getPromiseDecorator(i.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(i.Mn.GET_PURCHASES),S(this,A).getPurchases().then((function(e){var r=t._paymentsGetProductsPlatformData();t._paymentsPurchases=e.map((function(t){var e=u({id:r.find((function(e){return e.id===t.productID})).id},t.purchaseData);return delete e.productID,e})),t._resolvePromiseDecorator(i.Mn.GET_PURCHASES,t._paymentsPurchases)})).catch((function(e){t._rejectPromiseDecorator(i.Mn.GET_PURCHASES,e)}))),e.promise}},{key:\"getRemoteConfig\",value:function(t){var e=this;if(!this._platformSdk)return Promise.reject();var r=t;r||(r={}),r.clientFeatures||(r.clientFeatures=[]);var n=this._getPromiseDecorator(i.Mn.GET_REMOTE_CONFIG);return n||(n=this._createPromiseDecorator(i.Mn.GET_REMOTE_CONFIG),this._platformSdk.getFlags(r).then((function(t){e._resolvePromiseDecorator(i.Mn.GET_REMOTE_CONFIG,t)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.GET_REMOTE_CONFIG,t)}))),n.promise}},{key:\"clipboardWrite\",value:function(t){var e=this,r=this._getPromiseDecorator(i.Mn.CLIPBOARD_WRITE);return r||(r=this._createPromiseDecorator(i.Mn.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(t).then((function(){e._resolvePromiseDecorator(i.Mn.CLIPBOARD_WRITE,!0)})).catch((function(t){e._rejectPromiseDecorator(i.Mn.CLIPBOARD_WRITE,t)}))),r.promise}}])&&l(e.prototype,r),n&&l(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),s}(n.Z)},151:(t,e,r)=>{r.r(e),r.d(e,{default:()=>R});var n=r(640),o=r(500),i=r(383),a=r(843);function s(t){return s=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},s(t)}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e\\n \\n \\n \\n \\n
\\n \\n \\n \\n \\n \\n \\n
\\n ',document.body.appendChild(e),e}const R=function(t){!function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,\"prototype\",{writable:!1}),e&&d(t,e)}(u,t);var e,r,n,s=y(u);function u(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,u);for(var e=arguments.length,r=new Array(e),n=0;n2?e.slice(0,2):e)}));t._platformStorageCachedData={};var r=t._platformSdk.game.loadData().then((function(e){\"string\"==typeof e&&\"\"!==e&&(t._platformStorageCachedData=JSON.parse(e))}));t._platformSdk.system.onAudioEnabledChange((function(e){t._setAudioState(e)})),t._platformSdk.system.onPause((function(){t._setPauseState(!0),S(t,k,D).call(t)})),t._platformSdk.system.onResume((function(){t._setPauseState(!1),o.Z.hide()})),Promise.all([e,r]).finally((function(){t._isInitialized=!0,t._resolvePromiseDecorator(a.Mn.INITIALIZE),t._platformSdk.game.firstFrameReady()}))}))),e.promise}},{key:\"isStorageSupported\",value:function(t){return t===a.bD.PLATFORM_INTERNAL||h(v(u.prototype),\"isStorageSupported\",this).call(this,t)}},{key:\"isStorageAvailable\",value:function(t){return t===a.bD.PLATFORM_INTERNAL||h(v(u.prototype),\"isStorageAvailable\",this).call(this,t)}},{key:\"getDataFromStorage\",value:function(t,e,r){var n=this;return e===a.bD.PLATFORM_INTERNAL?new Promise((function(e,o){n._platformSdk.game.loadData().then((function(o){if(\"string\"==typeof o&&\"\"!==o&&(n._platformStorageCachedData=JSON.parse(o)),Array.isArray(t)){for(var i=[],a=0;a{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},(()=>{var t=r(843),e=r(446),n=r(166),o=r(383),i=r(66),a=r(23),s=r(784);function u(t){return u=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},u(t)}function c(t,e){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if(!(this._loadingProcessCompleted||e&&null!==this._currentLoadingProgress)){var r=document.getElementById(\"fillRect\"),n=document.getElementById(\"gradientMover\"),o=document.getElementById(\"logo\"),i=document.getElementById(\"loading-overlay\");if(r&&n&&o&&i){this._currentLoadingProgress=t;var a=Math.max(0,Math.min(100,t)),s=100-a;r.style.transform=\"translateY(\".concat(s,\"%)\"),100===a?(this._loadingProcessCompleted=!0,setTimeout((function(){r.style.display=\"none\",n.style.display=\"block\",n.classList.add(\"gradient-mover\")}),400),setTimeout((function(){return o.classList.add(\"logo-fade-out\")}),900),setTimeout((function(){return i.remove()}),1400)):n.classList.remove(\"gradient-mover\")}}}}],n&&L(r.prototype,n),i&&L(r,i),Object.defineProperty(r,\"prototype\",{writable:!1}),s}(a.Z);(0,e.iL)(B.prototype);const F=B;function H(t){return H=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},H(t)}function W(t,e){for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(e){var n=e[this._platformBridge.platformId];if(n)return this.get(t,n,r)}var o=e;return o||(o=this.defaultType),this._platformBridge.isStorageAvailable(o)?Array.isArray(t)&&0===t.length?Promise.resolve([]):this._platformBridge.getDataFromStorage(t,o,r):Promise.reject()}},{key:\"set\",value:function(t,e,r){if(r){var n=r[this._platformBridge.platformId];if(n)return this.set(t,e,n)}var o=r;if(o||(o=this.defaultType),!this._platformBridge.isStorageAvailable(o))return Promise.reject();if(Array.isArray(t)){if(!Array.isArray(e))return Promise.reject(new Error(\"Value must be an array when key is an array\"));if(t.length!==e.length)return Promise.reject(new Error(\"Key and value arrays must have the same length\"));if(0===t.length)return Promise.resolve()}return this._platformBridge.setDataToStorage(t,e,o)}},{key:\"delete\",value:function(t,e){if(e){var r=e[this._platformBridge.platformId];if(r)return this.delete(t,r)}var n=e;return n||(n=this.defaultType),this._platformBridge.isStorageAvailable(n)?Array.isArray(t)&&0===t.length?Promise.resolve():this._platformBridge.deleteDataFromStorage(t,n):Promise.reject()}}],r&&W(e.prototype,r),n&&W(e,n),Object.defineProperty(e,\"prototype\",{writable:!1}),i}(a.Z);function K(t){return K=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},K(t)}function J(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:t.Cb.BOTTOM,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.bannerState!==t.Kk.LOADING&&this.bannerState!==t.Kk.SHOWN){var o=Object.values(t.Cb).includes(r)?r:t.Cb.BOTTOM;It(this,Gt,o);var i,a=n;if(a||null!==(i=this._platformBridge.options)&&void 0!==i&&null!==(i=i.advertisement)&&void 0!==i&&null!==(i=i.banner)&&void 0!==i&&i.placementFallback&&(a=this._platformBridge.options.advertisement.banner.placementFallback),It(this,Bt,a),Rt(this,ae,Le).call(this,t.Kk.LOADING),this.isBannerSupported){var s=null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.banner)||void 0===e?void 0:e.placements,u=Rt(this,we,Ke).call(this,a,s);this._platformBridge.showBanner(o,u)}else Rt(this,ae,Le).call(this,t.Kk.FAILED)}}},{key:\"hideBanner\",value:function(){this.bannerState!==t.Kk.LOADING&&this.bannerState!==t.Kk.HIDDEN&&this.isBannerSupported&&this._platformBridge.hideBanner()}},{key:\"preloadInterstitial\",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isInterstitialSupported){var r,n=e;n&&\"string\"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.interstitial)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.interstitial.placementFallback);var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.interstitial)||void 0===t?void 0:t.placements,i=Rt(this,we,Ke).call(this,n,o);this._platformBridge.preloadInterstitial(i)}}},{key:\"showInterstitial\",value:function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!Rt(this,oe,Ie).call(this)){var n,o=r;if(o||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.interstitial)&&void 0!==n&&n.placementFallback&&(o=this._platformBridge.options.advertisement.interstitial.placementFallback),It(this,Ht,o),Rt(this,se,je).call(this,t.WA.LOADING),this.isInterstitialSupported){var i=Rt(this,re,Te).call(this);if(i>0&&(null===Lt(this,Vt)||(Date.now()-Lt(this,Vt))/1e30&&void 0!==arguments[0]?arguments[0]:null;if(this.isRewardedSupported){var r,n=e;n&&\"string\"==typeof n||null!==(r=this._platformBridge.options)&&void 0!==r&&null!==(r=r.advertisement)&&void 0!==r&&null!==(r=r.rewarded)&&void 0!==r&&r.placementFallback&&(n=this._platformBridge.options.advertisement.rewarded.placementFallback);var o=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t||null===(t=t.rewarded)||void 0===t?void 0:t.placements,i=Rt(this,we,Ke).call(this,n,o);this._platformBridge.preloadRewarded(i)}}},{key:\"showRewarded\",value:function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!Rt(this,oe,Ie).call(this)){var n;It(this,zt,r),Lt(this,zt)||null!==(n=this._platformBridge.options)&&void 0!==n&&null!==(n=n.advertisement)&&void 0!==n&&null!==(n=n.rewarded)&&void 0!==n&&n.placementFallback&&It(this,zt,this._platformBridge.options.advertisement.rewarded.placementFallback);var o=null===(e=this._platformBridge.options)||void 0===e||null===(e=e.advertisement)||void 0===e||null===(e=e.rewarded)||void 0===e?void 0:e.placements,i=Rt(this,we,Ke).call(this,Lt(this,zt),o);Rt(this,ue,Me).call(this,t.b3.LOADING),this.isRewardedSupported?this._platformBridge.showRewarded(i):Rt(this,ue,Me).call(this,t.b3.FAILED)}}},{key:\"showAdvancedBanners\",value:function(t){var e,r=t;r||null!==(e=Lt(this,he))&&void 0!==e&&e.placementFallback&&(r=Lt(this,he).placementFallback),Rt(this,le,Ne).call(this,r)}},{key:\"hideAdvancedBanners\",value:function(){this.isAdvancedBannersSupported&&(Rt(this,ye,He).call(this),Rt(this,de,Fe).call(this),Rt(this,ie,Re).call(this,t.Kk.HIDDEN))}},{key:\"checkAdBlock\",value:function(){return this._platformBridge.checkAdBlock()}}],o&&St(n.prototype,o),i&&St(n,i),Object.defineProperty(n,\"prototype\",{writable:!1}),s}(a.Z);function Pe(t){It(this,Ut,t),Lt(this,Wt)&&(Lt(this,Wt).stop(),Rt(this,ne,De).call(this))}function Ae(t){if(\"number\"==typeof t)return t;if(\"string\"==typeof t){var e=parseInt(t,10);return Number.isNaN(e)?null:e}return null}function Oe(){var t=Rt(this,ee,ke).call(this);if(void 0!==t){var e=Rt(this,$t,Ae).call(this,t);null!==e&&Rt(this,Qt,Pe).call(this,e)}}function ke(){var t;return null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t?void 0:t.minimumDelayBetweenInterstitial}function Te(){var t,e=null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t?void 0:t.initialInterstitialDelay,r=Rt(this,$t,Ae).call(this,e);return null!==r?r:this._platformBridge.initialInterstitialDelay}function De(){Lt(this,Ut)>0&&this._platformBridge.isMinimumDelayBetweenInterstitialEnabled&&(It(this,Wt,new bt(Lt(this,Ut))),Lt(this,Wt).start())}function Ie(){var e=[t.WA.LOADING,t.WA.OPENED].includes(Lt(this,Ft)),r=[t.b3.LOADING,t.b3.OPENED,t.b3.REWARDED].includes(Lt(this,Zt));return e||r}function Re(r){Lt(this,Yt)!==r&&(It(this,Yt,r),r!==t.Kk.LOADING&&s.Z.send(\"\".concat(t.oF.ADVERTISEMENT,\"_advanced_banners_\").concat(r),{placement:Lt(this,Kt)}),e.ZP.emit(t.W1.ADVANCED_BANNERS_STATE_CHANGED,Lt(this,Yt)))}function Le(r){Lt(this,xt)!==r&&(It(this,xt,r),r!==t.Kk.LOADING&&s.Z.send(\"\".concat(t.oF.ADVERTISEMENT,\"_banner_\").concat(r),{position:Lt(this,Gt),placement:Lt(this,Bt)}),e.ZP.emit(t.W1.BANNER_STATE_CHANGED,Lt(this,xt)))}function je(r){Lt(this,Ft)!==r&&(It(this,Ft,r),r!==t.WA.LOADING&&s.Z.send(\"\".concat(t.oF.ADVERTISEMENT,\"_interstitial_\").concat(r),{placement:Lt(this,Ht)}),e.ZP.emit(t.W1.INTERSTITIAL_STATE_CHANGED,Lt(this,Ft)))}function Me(r){Lt(this,Zt)!==r&&(It(this,Zt,r),r!==t.b3.LOADING&&s.Z.send(\"\".concat(t.oF.ADVERTISEMENT,\"_rewarded_\").concat(r),{placement:Lt(this,zt)}),e.ZP.emit(t.W1.REWARDED_STATE_CHANGED,Lt(this,Zt)))}function Ce(e){e===t.Dt.GAME_READY&&It(this,Vt,Date.now()),Rt(this,le,Ne).call(this,e)}function Ne(e){var r,n;if(this.isAdvancedBannersSupported){var o=null===(r=Lt(this,he))||void 0===r?void 0:r[e];if(o){if((null!==(n=o.action)&&void 0!==n?n:t.qV.SHOW)===t.qV.HIDE)return Rt(this,ye,He).call(this),void Rt(this,de,Fe).call(this);Rt(this,ie,Re).call(this,t.Kk.LOADING);var i=Rt(this,ge,Ve).call(this,o);It(this,Kt,e),Lt(this,Jt)&&!i&&this._platformBridge.hideAdvancedBanners(),It(this,Jt,i),i?Rt(this,oe,Ie).call(this)?It(this,qt,!0):this._platformBridge.showAdvancedBanners(i):Rt(this,ie,Re).call(this,t.Kk.FAILED)}}}function xe(){var t=this;Lt(this,Xt)&&clearTimeout(Lt(this,Xt)),It(this,Xt,setTimeout((function(){It(t,Xt,null),Rt(t,pe,Ge).call(t)}),200))}function Ge(){var e;if(Lt(this,Kt)){var r=null===(e=Lt(this,he))||void 0===e?void 0:e[Lt(this,Kt)];if(r){var n=Rt(this,ge,Ve).call(this,r);if(n!==Lt(this,Jt)){var o=Lt(this,Jt);It(this,Jt,n),Lt(this,qt)||(o&&this._platformBridge.hideAdvancedBanners(),n?this._platformBridge.showAdvancedBanners(n):o&&Rt(this,ie,Re).call(this,t.Kk.HIDDEN))}}}}function Be(){var t;return null===(t=this._platformBridge.options)||void 0===t||null===(t=t.advertisement)||void 0===t?void 0:t.advancedBanners}function Fe(){It(this,Kt,null),It(this,Jt,null),It(this,qt,!1)}function He(){Lt(this,Jt)&&!Lt(this,qt)&&this._platformBridge.hideAdvancedBanners()}function We(){Lt(this,Jt)&&!Lt(this,qt)&&(It(this,qt,!0),this._platformBridge.hideAdvancedBanners())}function Ue(){Lt(this,qt)&&(Rt(this,oe,Ie).call(this)||(It(this,qt,!1),Lt(this,Jt)&&this._platformBridge.showAdvancedBanners(Lt(this,Jt))))}function Ve(t){var e,r=this,n={deviceType:this._platformBridge.deviceType,orientation:(0,o.fr)(),canvas:(0,o.SC)()},i=\"default\",a=null!==(e=t.default)&&void 0!==e?e:null,s=-1;return Object.keys(t).filter((function(t){return\"action\"!==t&&\"default\"!==t})).forEach((function(e){var o=Rt(r,be,Ze).call(r,e,n);o.matched&&((o.score>s||o.score===s&&e.split(\":\").length>i.split(\":\").length)&&(s=o.score,i=e,a=t[e]))})),a}function Ze(t,e){var r=this,n=e.deviceType,o=e.orientation,i=e.canvas,a=t.split(\":\"),s=a.includes(\"canvas\"),u=0;return s&&!i?{matched:!1,score:u}:(s&&(u+=Mt.CANVAS),{matched:a.every((function(t){if(\"canvas\"===t)return!0;if(Ct.has(t)){if(t!==n)return!1;u+=Mt.DEVICE_TYPE}else if(Nt.has(t)){if(t!==o)return!1;u+=Mt.ORIENTATION}else{var e=/^([wh])([><]=?)(\\d+)$/.exec(t),a=/^ar([><]=?)(\\d+(?:\\.\\d+)?)$/.exec(t);if(e){var c=s?i.width:window.innerWidth,l=s?i.height:window.innerHeight,f=\"w\"===e[1]?c:l,p=e[2],h=parseInt(e[3],10);if(!Rt(r,_e,ze).call(r,f,p,h))return!1;u+=Mt.DIMENSION+Rt(r,Se,Ye).call(r,f,h)}else{if(!a)return!1;var d=(s?i.width:window.innerWidth)/(s?i.height:window.innerHeight),y=a[1],m=parseFloat(a[2]);if(!Rt(r,_e,ze).call(r,d,y,m))return!1;u+=Mt.DIMENSION+Rt(r,Se,Ye).call(r,d,m,1e3)}}return!0})),score:u})}function ze(t,e,r){switch(e){case\">\":return t>r;case\"<\":return t=\":return t>=r;case\"<=\":return t<=r;default:return!1}}function Ye(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return.9/(1+Math.abs(t-e)*r)}function Ke(t,e){if(!t)return t;if(!e)return t;var r=e.find((function(e){return e.id===t}));return r&&r[this._platformBridge.platformId]?r[this._platformBridge.platformId]:t}(0,e.iL)(Ee.prototype);const Je=Ee;function qe(t){return qe=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},qe(t)}function Xe(t,e){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function en(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function rn(t){for(var e=1;e=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function vn(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function gn(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){vn(i,n,o,a,s,\"next\",t)}function s(t){vn(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function bn(t,e){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function no(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}var oo={};function io(t){return ao.apply(this,arguments)}function ao(){var t;return t=ro().mark((function t(e){var r,n,o;return ro().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=oo[e])){t.next=7;break}return t.next=4,r();case 4:return n=t.sent,o=n.default,t.abrupt(\"return\",o);case 7:return t.abrupt(\"return\",to.Z);case 8:case\"end\":return t.stop()}}),t)})),ao=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){no(i,n,o,a,s,\"next\",t)}function s(t){no(i,n,o,a,s,\"throw\",t)}a(void 0)}))},ao.apply(this,arguments)}function so(t){return so=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},so(t)}function uo(){uo=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",s=i.asyncIterator||\"@@asyncIterator\",u=i.toStringTag||\"@@toStringTag\";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},\"\")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new I(n||[]);return o(a,\"_invoke\",{value:O(t,r,s)}),a}function f(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)}}catch(t){return{type:\"throw\",arg:t}}}e.wrap=l;var p=\"suspendedStart\",h=\"suspendedYield\",d=\"executing\",y=\"completed\",m={};function v(){}function g(){}function b(){}var _={};c(_,a,(function(){return this}));var S=Object.getPrototypeOf,w=S&&S(S(R([])));w&&w!==r&&n.call(w,a)&&(_=w);var E=b.prototype=v.prototype=Object.create(_);function P(t){[\"next\",\"throw\",\"return\"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if(\"throw\"!==u.type){var c=u.arg,l=c.value;return l&&\"object\"==so(l)&&n.call(l,\"__await\")?e.resolve(l.__await).then((function(t){r(\"next\",t,a,s)}),(function(t){r(\"throw\",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r(\"throw\",t,a,s)}))}s(u.arg)}var i;o(this,\"_invoke\",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error(\"Generator is already running\");if(o===y){if(\"throw\"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===m)continue;return u}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=d;var c=f(e,r,n);if(\"normal\"===c.type){if(o=n.done?y:h,c.arg===m)continue;return{value:c.arg,done:n.done}}\"throw\"===c.type&&(o=y,n.method=\"throw\",n.arg=c.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator.return&&(r.method=\"return\",r.arg=t,k(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),m;var i=f(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,m):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,m)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(T,this),this.reset(!0)}function R(e){if(e||\"\"===e){var r=e[a];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if(\"root\"===a.tryLoc)return o(\"end\");if(a.tryLoc<=this.prev){var u=n.call(a,\"catchLoc\"),c=n.call(a,\"finallyLoc\");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;D(r)}return o}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),m}},e}function co(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function lo(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){co(i,n,o,a,s,\"next\",t)}function s(t){co(i,n,o,a,s,\"throw\",t)}a(void 0)}))}}function fo(t,e){for(var r=0;r{\"use strict\";var e={8902:(e,t,r)=>{r.d(t,{Mn:()=>a,Hd:()=>d,pn:()=>l,Bq:()=>o,W1:()=>i,LS:()=>h,oF:()=>s});const s={CORE:\"core\",PLATFORM:\"platform\",PLAYER:\"player\",STORAGE:\"storage\",ADVERTISEMENT:\"advertisement\",SOCIAL:\"social\",DEVICE:\"device\",LEADERBOARDS:\"leaderboards\",PAYMENTS:\"payments\",REMOTE_CONFIG:\"remote_config\",CLIPBOARD:\"clipboard\",ACHIEVEMENTS:\"achievements\",ANALYTICS:\"analytics\",NOTIFICATIONS:\"notifications\",DAILY_REWARDS:\"daily_rewards\",TASKS:\"tasks\",CROSS_PROMO:\"cross_promo\"},i={INTERSTITIAL_STATE_CHANGED:\"interstitial_state_changed\",REWARDED_STATE_CHANGED:\"rewarded_state_changed\",BANNER_STATE_CHANGED:\"banner_state_changed\",ADVANCED_BANNERS_STATE_CHANGED:\"advanced_banners_state_changed\",AUDIO_STATE_CHANGED:\"audio_state_changed\",PAUSE_STATE_CHANGED:\"pause_state_changed\",ORIENTATION_STATE_CHANGED:\"orientation_state_changed\",SCREEN_SIZE_CHANGED:\"screen_size_changed\",PLATFORM_MESSAGE_SENT:\"platform_message_sent\",PLATFORM_STORAGE_AVAILABILITY_CHANGED:\"platform_storage_availability_changed\",VISIBILITY_STATE_CHANGED:\"visibility_state_changed\",STORAGE_SET:\"storage_set\",CROSS_PROMO_SHOWN:\"cross_promo_shown\",DAILY_REWARDS_CLAIMED:\"daily_rewards_claimed\",DAILY_REWARDS_STREAK_RESET:\"daily_rewards_streak_reset\",TASKS_REWARD_CLAIMED:\"tasks_reward_claimed\",TASKS_PERIOD_ROLLED_OVER:\"tasks_period_rolled_over\"},a={INITIALIZE:\"initialize\",AUTHORIZE_PLAYER:\"authorize_player\",SHARE:\"share\",INVITE_FRIENDS:\"invite_friends\",JOIN_COMMUNITY:\"join_community\",CREATE_POST:\"create_post\",ADD_TO_HOME_SCREEN:\"add_to_home_screen\",ADD_TO_FAVORITES:\"add_to_favorites\",RATE:\"rate\",LEADERBOARDS_SET_SCORE:\"leaderboards_set_score\",LEADERBOARDS_GET_ENTRIES:\"leaderboards_get_entries\",LEADERBOARDS_SHOW_NATIVE_POPUP:\"leaderboards_show_native_popup\",GET_PURCHASES:\"get_purchases\",GET_CATALOG:\"get_catalog\",PURCHASE:\"purchase\",CONSUME_PURCHASE:\"consume_purchase\",GET_REMOTE_CONFIG:\"get_remote_config\",GET_STORAGE_DATA:\"get_storage_data\",SET_STORAGE_DATA:\"set_storage_data\",DELETE_STORAGE_DATA:\"delete_storage_data\",CLIPBOARD_WRITE:\"clipboard_write\",ADBLOCK_DETECT:\"adblock_detect\",SET_INTERSTITIAL_STATE:\"set_interstitial_state\",SET_REWARDED_STATE:\"set_rewarded_state\",SHOW_INTERSTITIAL:\"show_interstitial\",SHOW_REWARDED:\"show_rewarded\"},o={SDK_NOT_INITIALIZED:\"SDK_NOT_INITIALIZED\",INITIALIZATION_FAILED:\"INITIALIZATION_FAILED\",CONFIG_LOAD_FAILED:\"CONFIG_LOAD_FAILED\",CONFIG_PARSE_FAILED:\"CONFIG_PARSE_FAILED\",STORAGE_NOT_SUPPORTED:\"STORAGE_NOT_SUPPORTED\",STORAGE_NOT_AVAILABLE:\"STORAGE_NOT_AVAILABLE\",STORAGE_QUOTA_EXCEEDED:\"STORAGE_QUOTA_EXCEEDED\",GAME_PARAMS_NOT_FOUND:\"GAME_PARAMS_NOT_FOUND\",INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:\"INVITE_FRIENDS_MESSAGE_LENGTH_ERROR\",NOTIFICATIONS_NOT_SUPPORTED:\"NOTIFICATIONS_NOT_SUPPORTED\",NOTIFICATION_INVALID_PARAMETERS:\"NOTIFICATION_INVALID_PARAMETERS\"},n={SDK_NOT_INITIALIZED:\"Before using the SDK you must initialize it\",INITIALIZATION_FAILED:\"SDK initialization failed\",CONFIG_LOAD_FAILED:\"Failed to load the bridge config file\",CONFIG_PARSE_FAILED:\"Failed to parse the bridge config file\",STORAGE_NOT_SUPPORTED:\"Storage not supported\",STORAGE_NOT_AVAILABLE:\"Storage not available\",STORAGE_QUOTA_EXCEEDED:\"Storage quota exceeded\",GAME_PARAMS_NOT_FOUND:\"Game params are not found\",INVITE_FRIENDS_MESSAGE_LENGTH_ERROR:\"Message is too long\",NOTIFICATIONS_NOT_SUPPORTED:\"Notifications not supported\",NOTIFICATION_INVALID_PARAMETERS:\"Invalid notification parameters\"};class d extends Error{code;originalError;constructor(e,t){super(n[e]),this.name=\"BridgeError\",this.code=e,this.originalError=t}}const l=Object.fromEntries(Object.keys(o).map((e=>[e,{code:e,message:n[e]}]))),h={NOTIFICATION:\"notification\"}},6039:(e,t,r)=>{r.d(t,{Z:()=>s});const s=class{get promise(){return this.#e}#e;#t;#r;constructor(){this.#e=new Promise(((e,t)=>{this.#t=e,this.#r=t}))}resolve(e){this.#t(e)}reject(e){this.#r(e)}}},1558:(e,t,r)=>{r.d(t,{ZP:()=>d,aA:()=>i,iL:()=>n});var s=r(1302);function i(e){const t=e;t.on=function(e,t){this._eventListeners||(this._eventListeners={}),this._eventListeners[e]||(this._eventListeners[e]=[]),this._eventListeners[e].push(t)},t.off=function(e,t){this._eventListeners?.[e]&&(t?this._eventListeners[e]=this._eventListeners[e].filter((e=>e!==t&&e._original!==t)):delete this._eventListeners[e])},t.once=function(e,t){const r=(...s)=>{this.off(e,r),t(...s)};r._original=t,this.on(e,r)},t.emit=function(e,...t){if(!this._eventListeners?.[e])return;[...this._eventListeners[e]].forEach((r=>{try{r(...t)}catch(t){s.ZP.error(`[EventBus] Listener error on \"${e}\":`,t)}}))}}const a={};i(a);const o=a.emit.bind(a);function n(e){const t=e;t.on=function(e,t){a.on(e,t)},t.off=function(e,t){a.off(e,t)},t.once=function(e,t){a.once(e,t)}}a.emit=function(e,...t){s.ZP.info(`[event] ${e}`,...t),o(e,...t)};const d=a},6873:(e,t,r)=>{r.d(t,{Z:()=>s});const s=new class{get isAvailable(){return null!==this.#s}#s=null;constructor(){try{this.#s=window.localStorage}catch{this.#s=null}}getItem(e){if(!this.#s)return null;try{return this.#s.getItem(e)}catch{return null}}setItem(e,t){this.#s&&this.#s.setItem(e,t)}removeItem(e){if(this.#s)try{this.#s.removeItem(e)}catch{}}}},5095:(e,t,r)=>{r.d(t,{Z:()=>s});const s=class{#i=null;#a=null;#o;constructor(e){this.#o=e}getServerTime(){return null!==this.#i?Promise.resolve(Date.now()+this.#i):(this.#a||(this.#a=Promise.resolve().then((()=>this.#o())).then((e=>(this.#i=e-Date.now(),this.#a=null,e))).catch((e=>{throw this.#a=null,e}))),this.#a)}}},5819:(e,t,r)=>{r.d(t,{ao:()=>d,as:()=>n});var s=r(3806);const i=\"https://api.playgama.com\",a=\"/playgama\";let o=i;function n(e){o=e===s.Lb.DISCORD?a:i}function d(){return o}},5230:(e,t,r)=>{r.d(t,{ZP:()=>w});var s=r(8960),i=r(8902),a=r(1302);const o=\"bridge-remote-config-cache\",n=[\"forciblySetPlatformId\",\"remoteConfigUrl\"];var d=r(6873);const l=\"pending\",h=\"loading\",c=\"success\",u=\"failed\",p=\"timeout\",m=\"skipped\",_=\"network\",g=\"fresh-cache\",S=\"stale-cache\";const A=class{get loadStatus(){return this.#n}get loadError(){return this.#d}get appliedSource(){return this.#l}#h;#c;#u;#n=l;#d=\"\";#l=null;constructor({url:e,timeoutMs:t,ttlMs:r}){this.#h=e,this.#c=\"number\"==typeof t?t:2e3,this.#u=\"number\"==typeof r?r:36e5}async load(){if(!this.#h)return this.#n=m,{source:null,options:null};const e=this.#p();if(e&&!this.#m(e))return this.#l=g,this.#n=c,this.refreshInBackground(),{source:g,options:e.options};try{this.#n=h;const e=await this.#_(this.#c);return this.#g(e),this.#l=_,this.#n=c,{source:_,options:e}}catch(t){const r=\"AbortError\"===t?.name;return this.#n=r?p:u,this.#d=t?.message||String(t),a.ZP.error(\"Remote config load failed:\",t),e?(this.#l=S,{source:S,options:e.options,error:this.#d}):{source:null,options:null,error:this.#d}}}refreshInBackground(){this.#h&&this.#_(this.#c).then((e=>{this.#g(e)})).catch((e=>{a.ZP.error(\"Remote config background refresh failed:\",e)}))}async#_(e){const t=new AbortController,r=setTimeout((()=>t.abort()),e);try{const e=await fetch(this.#h,{signal:t.signal});if(!e.ok)throw new Error(`Failed to load remote bridge config: ${this.#h} ${e.status} (${e.statusText})`);const r=await e.text(),s=JSON.parse(r);if(!s||\"object\"!=typeof s||Array.isArray(s))throw new Error(\"Remote bridge config must be a JSON object\");return s}finally{clearTimeout(r)}}#p(){const e=d.Z.getItem(o);if(!e)return null;try{const t=JSON.parse(e);return t&&t.url===this.#h&&\"number\"==typeof t.savedAt&&t.options&&\"object\"==typeof t.options?t:null}catch{return null}}#g(e){try{const t={url:this.#h,savedAt:Date.now(),options:e};d.Z.setItem(o,JSON.stringify(t))}catch{}}#m(e){return e.savedAt+this.#u{e in this.#I&&(s[e]=this.#I[e])})),this.#v({...r.options,...s})}}},1302:(e,t,r)=>{r.d(t,{zY:()=>l,dw:()=>u,ZP:()=>p});const s=\"info\",i=\"warn\",a=\"error\",o=\"#9747FF\",n=`background: ${o}; color: #fff; padding: 1px 6px; border-radius: 4px`,d=`background: ${o}; color: white; padding: 1px 6px; border-radius: 4px`,l=\"debug\",h=[\"on\",\"off\",\"once\",\"emit\"];const c=new class{get enabled(){return this.#R}set enabled(e){this.#R=e}#R=!1;info(e,...t){this.#b(s,e,t)}warn(e,...t){this.#b(i,e,t)}error(e,...t){this.#b(a,e,t)}banner(e){console.info(`%c ${e} `,d)}#b(e,t,r){if(e!==a&&!this.#R)return;const s=[`%c PlaygamaBridge %c ${t}`,n,\"\",...r];switch(e){case a:console.error(...s);break;case i:console.warn(...s);break;default:console.info(...s)}}};function u(e,t){const r=new Map;return new Proxy(t,{get(t,s){const i=Reflect.get(t,s,t);if(\"function\"!=typeof i)return i;let a=r.get(s);if(!a){const o=String(s),n=i,d=!h.includes(o);a=(...r)=>{if(!d)return n.apply(t,r);c.info(`[${e}] ${o}()`,...r);const s=n.apply(t,r);return function(e){return null!=e&&(\"object\"==typeof e||\"function\"==typeof e)&&\"function\"==typeof e.then}(s)&&s.then((t=>c.info(`[${e}] ${o} → resolved`,t)),(t=>c.warn(`[${e}] ${o} → rejected`,t))),s},r.set(s,a)}return a}})}const p=c},9541:(e,t,r)=>{r.d(t,{k:()=>a});var s=r(5095),i=r(5819);const a=new s.Z((async function(){const e=await fetch(`${(0,i.ao)()}/api/bridge/v1/timestamp/now`);if(!e.ok)throw new Error(\"Network response was not ok\");return 1e3*(await e.json()).timestamp}))},9778:(e,t,r)=>{r.d(t,{Z:()=>o});var s=r(1558),i=r(5230),a=r(3806);const o=class{_platformBridge;initialize(e){return this._platformBridge=e,this}_forwardEvent(e){this._platformBridge.on(e,((...t)=>s.ZP.emit(e,...t)))}_isSaas(e){const t=this._platformBridge.platformId,{saas:r}=i.ZP.getValues(),s=r?.[e];return!!s&&(!(t!==a.Lb.PLAYGAMA||!r?.publicToken)||Boolean(Array.isArray(s.platforms)&&null!=t&&s.platforms.includes(t)))}}},5334:(e,t,r)=>{r.d(t,{ZP:()=>h,dk:()=>a});var s=r(9778),i=r(5230);function a(e,t,r){if(!e)return null;const s=e.find((e=>{const s=e[t];return Boolean(s&&\"object\"==typeof s&&r(s))}));return s?s.id:null}var o=r(9979);const n=\"bridge-achievements-state\";const d=class{#C;#L=null;#O=null;constructor(e){this.#C=e}async unlock(e){if(!e)return;const t=await this.#M();t.unlocked.includes(e)||(t.unlocked.push(e),await this.#N())}async getList(){const e=await this.#M();return this.#C.map((t=>({id:t.id,name:\"string\"==typeof t.name?t.name:void 0,description:\"string\"==typeof t.description?t.description:void 0,unlocked:e.unlocked.includes(t.id)})))}#M(){return this.#L?Promise.resolve(this.#L):(this.#O||(this.#O=o.Z.get(n,!0).then((e=>(this.#L=this.#k(e),this.#O=null,this.#L))).catch((()=>(this.#L=this.#H(),this.#O=null,this.#L)))),this.#O)}#N(){return this.#L?o.Z.set(n,this.#L):Promise.resolve()}#H(){return{unlocked:[]}}#k(e){if(!e||\"object\"!=typeof e)return this.#H();const t=e;return{unlocked:Array.isArray(t.unlocked)?t.unlocked.filter((e=>\"string\"==typeof e)):[]}}};class l extends s.Z{#B;initialize(e){return super.initialize(e),this.#B=new d(this.#G()??[]),this}unlock(e){if(this._platformBridge.isAchievementsSupported){const t=function(e,t,r){if(!r||!e)return r;const s=e.find((e=>e.id===r));if(!s)return r;const i=s[t];return i&&\"object\"==typeof i?i:r}(this.#G(),this._platformBridge.platformId,e);return this._platformBridge.achievementsUnlock(t)}return this.#B.unlock(e)}getAchievements(){return this._platformBridge.isAchievementsSupported?this._platformBridge.achievementsGetList():this.#B.getList()}#G(){const e=i.ZP.getValues();return e?.achievements}}const h=new l},9221:(e,t,r)=>{r.d(t,{Cb:()=>i,Kk:()=>a,My:()=>p,Qh:()=>h,WA:()=>o,_g:()=>l,az:()=>m,b3:()=>n,lY:()=>u,m1:()=>_,qJ:()=>c,qV:()=>d});var s=r(66);const i={TOP:\"top\",BOTTOM:\"bottom\"},a={LOADING:\"loading\",SHOWN:\"shown\",HIDDEN:\"hidden\",FAILED:\"failed\"},o={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\"},n={LOADING:\"loading\",OPENED:\"opened\",CLOSED:\"closed\",FAILED:\"failed\",REWARDED:\"rewarded\"},d={SHOW:\"show\",HIDE:\"hide\"},l=\"banner-container\",h=\"advanced-banner-\",c=60,u=200,p={DEVICE_TYPE:4,ORIENTATION:2,DIMENSION:1,CANVAS:1},m=new Set(Object.values(s.me)),_=new Set(Object.values(s.AR))},8467:(e,t,r)=>{r.d(t,{f_:()=>T,kM:()=>D,ZP:()=>L,XA:()=>w,DQ:()=>R,QG:()=>v});var s=r(1558),i=r(5230),a=r(9778),o=r(6170),n=r(8902),d=r(3806),l=r(9221);function h(e){if(\"number\"==typeof e)return e;if(\"string\"==typeof e){const t=parseInt(e,10);return Number.isNaN(t)?null:t}return null}function c(e,t,r){if(!e)return e??null;if(!t)return e;const s=t.find((t=>t.id===e));return s&&s[r]?s[r]:e}const u=class{get isSupported(){const e=i.ZP.getValues().advertisement?.banner?.disable;return!0!==e&&this.#F.isBannerSupported}get state(){return this.#L}#F;#x;#L=l.Kk.HIDDEN;#U=null;#V=null;constructor(e,t){this.#F=e,this.#x=t,this.#F.on(n.W1.BANNER_STATE_CHANGED,(e=>this.#Z(e)))}show(e=l.Cb.BOTTOM,t=null){if(this.#L===l.Kk.LOADING||this.#L===l.Kk.SHOWN)return;const r=Object.values(l.Cb).includes(e)?e:l.Cb.BOTTOM;this.#U=r;let s=t;if(!s){const e=i.ZP.getValues().advertisement?.banner?.placementFallback;e&&(s=e)}if(this.#V=s,this.#Z(l.Kk.LOADING),!this.isSupported)return void this.#Z(l.Kk.FAILED);const a=i.ZP.getValues().advertisement?.banner?.placements,o=c(s,a,this.#F.platformId);this.#F.showBanner(r,o)}hide(){this.#L!==l.Kk.LOADING&&this.#L!==l.Kk.HIDDEN&&this.isSupported&&this.#F.hideBanner()}#Z(e){this.#L!==e&&(this.#L=e,e!==l.Kk.LOADING&&this.#x.send(`${n.oF.ADVERTISEMENT}_banner_${e}`,{position:this.#U,placement:this.#V}),s.ZP.emit(n.W1.BANNER_STATE_CHANGED,this.#L))}},p=\"state_changed\",m=\"time_left_changed\",_=\"created\",g=\"started\",S=\"stopped\",A=\"completed\";class E{get state(){return this.#L}#j=0;#z=0;#L=_;#W=0;constructor(e){this.#j=e}start(){this.#L!==g&&(this.#z=this.#j,this.#Z(g),this.#W=setInterval((()=>{this.#z-=1,this.emit(m,this.#z),this.#z<=0&&(this.#K(),this.#Z(A))}),1e3))}stop(){this.#K(),this.#L===g&&this.#Z(S)}#Z(e){this.#L=e,this.emit(p,this.#L)}#K(){this.#W&&clearInterval(this.#W),this.#z=0}}(0,s.aA)(E.prototype);const f=E;const P=class{get isSupported(){const e=i.ZP.getValues().advertisement?.interstitial?.disable;return!0!==e&&this.#F.isInterstitialSupported}get state(){return this.#L}get minimumDelayBetweenInterstitial(){return this.#Y}get isInProgress(){return[l.WA.LOADING,l.WA.OPENED].includes(this.#L)}#F;#x;#L=l.WA.CLOSED;#V=null;#$;#Y=l.qJ;#q=null;#J;constructor(e,t,r){this.#F=e,this.#x=t,this.#J=r,this.#F.on(n.W1.INTERSTITIAL_STATE_CHANGED,(e=>{const t=e;this.#Z(t),t===l.WA.CLOSED&&this.#X()})),s.ZP.on(n.W1.PLATFORM_MESSAGE_SENT,(e=>{e===d.Dt.GAME_READY&&(this.#q=Date.now())})),this.#Q()}preload(e=null){if(!this.isSupported)return;let t=e;if(!t||\"string\"!=typeof t){const e=i.ZP.getValues().advertisement?.interstitial?.placementFallback;e&&(t=e)}const r=i.ZP.getValues().advertisement?.interstitial?.placements,s=c(t,r,this.#F.platformId);this.#F.preloadInterstitial(s)}show(e=null){let t=e;if(!t){const e=i.ZP.getValues().advertisement?.interstitial?.placementFallback;e&&(t=e)}if(this.#V=t,this.#Z(l.WA.LOADING),!this.isSupported)return void this.#Z(l.WA.FAILED);const r=this.#ee();if(r>0&&(null===this.#q||(Date.now()-this.#q)/1e30&&this.#F.isMinimumDelayBetweenInterstitialEnabled&&(this.#$=new f(this.#Y),this.#$.start())}};const I=class{get isSupported(){const e=i.ZP.getValues().advertisement?.rewarded?.disable;return!0!==e&&this.#F.isRewardedSupported}get state(){return this.#L}get placement(){return this.#V}get isInProgress(){return[l.b3.LOADING,l.b3.OPENED,l.b3.REWARDED].includes(this.#L)}#F;#x;#L=l.b3.CLOSED;#V=null;#J;constructor(e,t,r){this.#F=e,this.#x=t,this.#J=r,this.#F.on(n.W1.REWARDED_STATE_CHANGED,(e=>this.#Z(e)))}preload(e=null){if(!this.isSupported)return;let t=e;if(!t||\"string\"!=typeof t){const e=i.ZP.getValues().advertisement?.rewarded?.placementFallback;e&&(t=e)}const r=i.ZP.getValues().advertisement?.rewarded?.placements,s=c(t,r,this.#F.platformId);this.#F.preloadRewarded(s)}show(e=null){if(this.#V=e,!this.#V){const e=i.ZP.getValues().advertisement?.rewarded?.placementFallback;e&&(this.#V=e)}const t=i.ZP.getValues().advertisement?.rewarded?.placements,r=c(this.#V,t,this.#F.platformId);this.#Z(l.b3.LOADING),this.isSupported?this.#F.showRewarded(r):this.#Z(l.b3.FAILED)}#Z(e){this.#L!==e&&(this.#L=e,e!==l.b3.LOADING&&this.#x.send(`${n.oF.ADVERTISEMENT}_rewarded_${e}`,{placement:this.#V}),s.ZP.emit(n.W1.REWARDED_STATE_CHANGED,this.#L),this.#J(this.#L))}};var y=r(3117);function D(e){const t=document.createElement(\"div\");switch(t.id=l._g,t.style.position=\"absolute\",document.body.appendChild(t),e){case l.Cb.TOP:t.style.top=\"0px\",t.style.height=\"90px\",t.style.width=\"100%\";break;case l.Cb.BOTTOM:default:t.style.bottom=\"0px\",t.style.height=\"90px\",t.style.width=\"100%\"}return t}function T(e){const t=[];return e.forEach(((e,r)=>{const s=document.createElement(\"div\"),i=`${l.Qh}${r}`;s.id=i,s.style.position=\"absolute\",s.style.zIndex=\"9999\",e.width&&(s.style.width=e.width),e.height&&(s.style.height=e.height),e.top&&(s.style.top=e.top),e.bottom&&(s.style.bottom=e.bottom),e.left&&(s.style.left=e.left),e.right&&(s.style.right=e.right),document.body.appendChild(s),t.push(i)})),t}function w(){document.querySelectorAll(`[id^=\"${l.Qh}\"]`).forEach((e=>e.remove()))}function v(e){if(!document.getElementById(\"bridge-info-popup-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-info-popup-styles\",e.textContent=\"\\n #bridge-info-popup-overlay {\\n position: fixed;\\n inset: 0;\\n display: none;\\n align-items: center;\\n justify-content: center;\\n padding: 18px;\\n background: rgba(0, 0, 0, 0.24);\\n z-index: 9999;\\n }\\n\\n #bridge-info-popup {\\n width: min(92vw, 320px);\\n padding: 24px 20px 20px;\\n border-radius: 26px;\\n background: #ffffff;\\n color: #24304d;\\n text-align: center;\\n box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);\\n font-family: Inter, Arial, sans-serif;\\n }\\n\\n #bridge-info-popup-emoji {\\n font-size: 42px;\\n margin-bottom: 10px;\\n line-height: 1;\\n }\\n\\n #bridge-info-popup-title {\\n margin: 0 0 10px;\\n font-size: 24px;\\n line-height: 1.1;\\n }\\n\\n #bridge-info-popup-message {\\n margin: 0 0 18px;\\n font-size: 15px;\\n line-height: 1.45;\\n color: #66708b;\\n }\\n\\n #bridge-info-popup-button {\\n min-width: 140px;\\n height: 46px;\\n padding: 0 24px;\\n border: 0;\\n border-radius: 999px;\\n font-weight: 700;\\n font-size: 15px;\\n color: #ffffff;\\n background: linear-gradient(180deg, #5f8cff, #4c71e6);\\n box-shadow: 0 8px 20px rgba(76, 113, 230, 0.32);\\n cursor: pointer;\\n font-family: Inter, Arial, sans-serif;\\n }\\n\\n #bridge-info-popup-button:active {\\n transform: translateY(1px);\\n }\",document.head.appendChild(e)}let t=document.getElementById(\"bridge-info-popup-overlay\");t||(t=document.createElement(\"div\"),t.id=\"bridge-info-popup-overlay\",document.body.appendChild(t));let r=document.getElementById(\"bridge-info-popup\");r||(r=document.createElement(\"div\"),r.id=\"bridge-info-popup\",t.appendChild(r)),r.innerHTML=\"\";const s=document.createElement(\"div\");s.id=\"bridge-info-popup-emoji\",s.textContent=\"🎬\",r.appendChild(s);const i=document.createElement(\"h3\");i.id=\"bridge-info-popup-title\",i.textContent=e,r.appendChild(i);const a=document.createElement(\"button\");a.id=\"bridge-info-popup-button\",a.textContent=\"Continue\",r.appendChild(a);const o=t;return new Promise((e=>{a.onclick=()=>{o.style.display=\"none\",e()},o.style.display=\"flex\"}))}function R(){if(!document.getElementById(\"bridge-ad-failure-popup-fonts\")){const e=document.createElement(\"link\");e.rel=\"preconnect\",e.href=\"https://fonts.googleapis.com\",document.head.appendChild(e);const t=document.createElement(\"link\");t.rel=\"preconnect\",t.href=\"https://fonts.gstatic.com\",t.crossOrigin=\"anonymous\",document.head.appendChild(t);const r=document.createElement(\"link\");r.id=\"bridge-ad-failure-popup-fonts\",r.rel=\"stylesheet\",r.href=\"https://fonts.googleapis.com/css2?family=Cal+Sans&display=swap\",document.head.appendChild(r)}if(!document.getElementById(\"bridge-ad-failure-popup-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-ad-failure-popup-styles\",e.textContent=\"\\n #bridge-ad-failure-popup {\\n position: fixed;\\n top: 0;\\n left: 0;\\n height: 100%;\\n width: 100%;\\n box-sizing: border-box;\\n padding: 24px 16px;\\n background: #682eb2;\\n display: none;\\n grid-template-columns: 1fr 1fr;\\n grid-template-rows: 32px 1fr;\\n z-index: 9999999;\\n font-family: 'Cal Sans', -apple-system, BlinkMacSystemFont, sans-serif;\\n color: #fff;\\n cursor: pointer;\\n }\\n\\n #bridge-ad-failure-popup-logo {\\n height: 32px;\\n }\\n\\n #bridge-ad-failure-popup-close {\\n all: unset;\\n cursor: pointer;\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n width: 32px;\\n height: 32px;\\n background: #fff;\\n border-radius: 50%;\\n justify-self: end;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n grid-column: span 2;\\n font-size: 21px;\\n font-style: normal;\\n font-weight: 400;\\n line-height: 110%;\\n align-self: end;\\n margin: 0;\\n }\\n\\n @media (min-width: 320px) {\\n #bridge-ad-failure-popup {\\n padding: 24px;\\n grid-template-rows: 40px 1fr;\\n }\\n\\n #bridge-ad-failure-popup-logo {\\n height: 40px;\\n }\\n\\n #bridge-ad-failure-popup-close {\\n width: 40px;\\n height: 40px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n font-size: 25px;\\n align-self: center;\\n }\\n }\\n\\n @media (orientation: landscape) {\\n #bridge-ad-failure-popup {\\n gap: 40px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n width: 60%;\\n align-self: start;\\n }\\n }\\n\\n @media (orientation: landscape) and (min-width: 800px) {\\n #bridge-ad-failure-popup {\\n gap: 80px;\\n }\\n\\n #bridge-ad-failure-popup-text {\\n width: 50%;\\n font-size: 33px;\\n }\\n }\\n \",document.head.appendChild(e)}let e=document.getElementById(\"bridge-ad-failure-popup\");if(!e){e=document.createElement(\"div\"),e.id=\"bridge-ad-failure-popup\";const t=document.createElement(\"div\");t.innerHTML='\\n \\n \\n \\n \\n ',e.appendChild(t);const r=document.createElement(\"button\");r.id=\"bridge-ad-failure-popup-close\",r.innerHTML='\\n \\n \\n \\n ',e.appendChild(r);const s=document.createElement(\"p\");s.id=\"bridge-ad-failure-popup-text\",e.appendChild(s),document.body.appendChild(e)}const t=document.getElementById(\"bridge-ad-failure-popup-close\"),r=e;return new Promise((e=>{const s=()=>{r.style.display=\"none\",e()};t&&(t.onclick=s),r.onclick=s;const i=[\"If you see this message, no Ad was returned for the Ad request.

Please ask the developer to check the Ad setup.\",\"This is placeholder for the Ad. Playgama helps games reach players worldwide.\"],a=document.getElementById(\"bridge-ad-failure-popup-text\");a&&(a.innerHTML=i[Math.floor(Math.random()*i.length)]),r.style.display=\"grid\"}))}const b=class{get isSupported(){return!0!==this.#se?.disable&&this.#F.isAdvancedBannersSupported}get state(){return this.#L}get options(){return this.#se}#F;#x;#L=l.Kk.HIDDEN;#V=null;#ie=null;#ae=!1;#oe=null;#ne;constructor(e,t,r){this.#F=e,this.#x=t,this.#ne=r,this.#F.on(n.W1.ADVANCED_BANNERS_STATE_CHANGED,(e=>this.#Z(e))),s.ZP.on(n.W1.ORIENTATION_STATE_CHANGED,(()=>this.#de())),s.ZP.on(n.W1.SCREEN_SIZE_CHANGED,(()=>this.#de()))}show(e){let t=e;if(!t){const e=this.#se?.placementFallback;\"string\"==typeof e&&(t=e)}this.tryShow(t)}hide(){this.isSupported&&(this.#le(),this.#he(),this.#Z(l.Kk.HIDDEN))}tryShow(e){if(!this.isSupported)return;if(null===e)return;const t=this.#se?.[e];if(!t)return;if((t.action??l.qV.SHOW)===l.qV.HIDE)return this.#le(),void this.#he();this.#Z(l.Kk.LOADING);const r=this.#t(t);this.#V=e,this.#ie&&!r&&this.#F.hideAdvancedBanners(),this.#ie=r,r?this.#ne()?this.#ae=!0:this.#F.showAdvancedBanners(r):this.#Z(l.Kk.FAILED)}hideByAd(){this.#ie&&!this.#ae&&(this.#ae=!0,this.#F.hideAdvancedBanners())}restoreAfterAd(){this.#ae&&(this.#ne()||(this.#ae=!1,this.#ie&&this.#F.showAdvancedBanners(this.#ie)))}get#se(){return i.ZP.getValues().advertisement?.advancedBanners}#Z(e){this.#L!==e&&(this.#L=e,e!==l.Kk.LOADING&&this.#x.send(`${n.oF.ADVERTISEMENT}_advanced_banners_${e}`,{placement:this.#V}),s.ZP.emit(n.W1.ADVANCED_BANNERS_STATE_CHANGED,this.#L))}#he(){this.#V=null,this.#ie=null,this.#ae=!1}#le(){this.#ie&&!this.#ae&&this.#F.hideAdvancedBanners()}#de(){this.#oe&&clearTimeout(this.#oe),this.#oe=setTimeout((()=>{this.#oe=null,this.#ce()}),l.lY)}#ce(){if(!this.#V)return;const e=this.#se?.[this.#V];if(!e)return;const t=this.#t(e);if(t===this.#ie)return;const r=this.#ie;this.#ie=t,this.#ae||(r&&this.#F.hideAdvancedBanners(),t?this.#F.showAdvancedBanners(t):r&&this.#Z(l.Kk.HIDDEN))}#t(e){const{deviceType:t}=this.#F,r={deviceType:t,orientation:(0,y.f)(),canvas:document.querySelector(\"canvas\")};let s=\"default\",i=e.default??null,a=-1;return Object.keys(e).filter((e=>\"action\"!==e&&\"default\"!==e)).forEach((t=>{const o=this.#ue(t,r);if(!o.matched)return;(o.score>a||o.score===a&&t.split(\":\").length>s.split(\":\").length)&&(a=o.score,s=t,i=e[t])})),i}#ue(e,t){const{deviceType:r,orientation:s,canvas:i}=t,a=e.split(\":\"),o=a.includes(\"canvas\");let n=0;if(o&&!i)return{matched:!1,score:n};o&&(n+=l.My.CANVAS);return{matched:a.every((e=>{if(\"canvas\"===e)return!0;if(l.az.has(e)){if(e!==r)return!1;n+=l.My.DEVICE_TYPE}else if(l.m1.has(e)){if(e!==s||window.innerWidth===window.innerHeight)return!1;n+=l.My.ORIENTATION}else{const t=/^([wh])([><]=?)(\\d+)$/.exec(e),r=/^ar([><]=?)(\\d+(?:\\.\\d+)?)$/.exec(e);if(t){const e=o&&i?i.width:window.innerWidth,r=o&&i?i.height:window.innerHeight,s=\"w\"===t[1]?e:r,a=t[2],d=parseInt(t[3],10);if(!this.#pe(s,a,d))return!1;n+=l.My.DIMENSION+this.#me(s,d)}else{if(!r)return!1;{const e=(o&&i?i.width:window.innerWidth)/(o&&i?i.height:window.innerHeight),t=r[1],s=parseFloat(r[2]);if(!this.#pe(e,t,s))return!1;n+=l.My.DIMENSION+this.#me(e,s,1e3)}}}return!0})),score:n}}#pe(e,t,r){switch(t){case\">\":return e>r;case\"<\":return e=\":return e>=r;case\"<=\":return e<=r;default:return!1}}#me(e,t,r=1){return.9/(1+Math.abs(e-t)*r)}};class C extends a.Z{get isBannerSupported(){return this.#_e.isSupported}get bannerState(){return this.#_e.state}get isInterstitialSupported(){return this.#ge.isSupported}get interstitialState(){return this.#ge.state}get isRewardedSupported(){return this.#Se.isSupported}get rewardedPlacement(){return this.#Se.placement}get rewardedState(){return this.#Se.state}get minimumDelayBetweenInterstitial(){return this.#ge.minimumDelayBetweenInterstitial}get isAdvancedBannersSupported(){return this.#Ae.isSupported}get advancedBannersState(){return this.#Ae.state}#_e;#ge;#Se;#Ae;initialize(e){return super.initialize(e),this.#_e=new u(e,o.rh),this.#ge=new P(e,o.rh,(e=>this.#Ee(e))),this.#Se=new I(e,o.rh,(e=>this.#fe(e))),this.#Ae=new b(e,o.rh,(()=>this.#Pe())),s.ZP.on(n.W1.PLATFORM_MESSAGE_SENT,(e=>{this.#Ae.tryShow(e),this.#Ie(e)})),s.ZP.on(n.W1.STORAGE_SET,(()=>{this.#Ie(n.W1.STORAGE_SET)})),e.on(n.W1.VISIBILITY_STATE_CHANGED,(e=>{e===d.YU.VISIBLE&&this.#Ie(`visibility_state_${d.YU.VISIBLE}`)})),this}setMinimumDelayBetweenInterstitial(e){this.#ge.setMinimumDelay(e)}showBanner(e=l.Cb.BOTTOM,t=null){this.#_e.show(e,t)}hideBanner(){this.#_e.hide()}preloadInterstitial(e=null){this.#ge.preload(e)}showInterstitial(e=null){this.#Pe()||this.#ge.show(e)}preloadRewarded(e=null){this.#Se.preload(e)}showRewarded(e=null){this.#Pe()||this.#Se.show(e)}showAdvancedBanners(e){this.#Ae.show(e)}hideAdvancedBanners(){this.#Ae.hide()}checkAdBlock(){return this._platformBridge.checkAdBlock()}#Ie(e){const t=i.ZP.getValues().advertisement?.interstitial?.autoShow;Array.isArray(t)&&t.includes(e)&&this.showInterstitial(e)}#Pe(){return this.#ge.isInProgress||this.#Se.isInProgress}#Ee(e){e===l.WA.LOADING||e===l.WA.OPENED?this.#Ae.hideByAd():e!==l.WA.CLOSED&&e!==l.WA.FAILED||this.#Ae.restoreAfterAd()}#fe(e){e===l.b3.LOADING||e===l.b3.OPENED?this.#Ae.hideByAd():e!==l.b3.CLOSED&&e!==l.b3.FAILED||this.#Ae.restoreAfterAd()}}(0,s.iL)(C.prototype);const L=new C},6170:(e,t,r)=>{r.d(t,{ZP:()=>_,rh:()=>m});var s=r(8902),i=r(9541),a=r(3806);const o=\"2.1.0\";var n=r(8960),d=r(3941),l=r(9778),h=r(5230),c=r(5819);class u extends l.Z{set gameVersion(e){this.#ye=e}#De=[];#Te=null;#we=null;#ve=null;#ye=null;#Re;#be=!1;#Ce=null;#Le=null;#Oe=!1;#i=0;#Me=\"undefined\"!=typeof CompressionStream;constructor(){super(),this.#Re=this.#Ne()}initialize(e){super.initialize(e);this._platformBridge.platformId===a.Lb.PLAYGAMA||!1!==h.ZP.getValues().sendAnalyticsEvents||(this.#be=!0);const{href:t}=window.location;return(t.startsWith(\"file://\")||t.includes(\"localhost\")||t.includes(\"127.0.0.1\"))&&(this.#be=!0),this._platformBridge.isPlatformExternalCallsSupported||(this.#be=!0),this.#we=this.#ke(),this.#ve=(0,d.m)().id,this.#be||(this.#He(),this.send(`${s.oF.CORE}_initialization_started`),this.#Be(),this.#Ge()),this}send(e,t={}){if(this.#be)return;const r=this.#Fe(e,t);this.#De.push(r)}#Ne(){return\"undefined\"!=typeof crypto&&\"function\"==typeof crypto.randomUUID?crypto.randomUUID():(0,n.D1)()}async#He(){try{const e=await i.k.getServerTime();this.#i=e-Date.now();for(let e=0;e{this.#Ke(),e.persisted&&this.#Ye()},this.#Ce=()=>{\"hidden\"===document.visibilityState?(this.#$e(),this.#Ke()):this.#Ye()},document.addEventListener(\"visibilitychange\",this.#Ce),window.addEventListener(\"pagehide\",this.#Le)}#Ye(){this.#be||(this.#Oe=!1,this.#Be())}#Ke(){this.#Oe||this.#be||(this.#Oe=!0,this.send(`${s.oF.CORE}_session_end`),this.#We())}#ke(){const{platformId:e}=this._platformBridge,t=h.ZP.getValues(),r={[a.Lb.GAME_DISTRIBUTION]:\"gameId\",[a.Lb.Y8]:\"gameId\",[a.Lb.MSN]:\"gameId\",[a.Lb.HUAWEI]:\"appId\",[a.Lb.DISCORD]:\"appId\",[a.Lb.GAMEPUSH]:\"projectId\",[a.Lb.MICROSOFT_STORE]:\"gameId\"}[e],s=r?t?.[r]:null;return\"string\"==typeof s&&s?s:this.#qe(window.location.href)}#qe(e){try{const t=new URL(e),r=t.pathname.split(\"/\").filter(Boolean),{platformId:s}=this._platformBridge,i={[a.Lb.YANDEX]:{pathKey:\"app\"},[a.Lb.LAGGED]:{pathKey:\"g\"},[a.Lb.CRAZY_GAMES]:{pathKey:\"game\"}}[s];if(i){const e=r.indexOf(i.pathKey),t=-1!==e?r[e+1]:null;if(t)return t}if(s===a.Lb.XIAOMI){if(\"index.html\"===r[r.length-1]&&r.length>=2)return r[r.length-2]}if(s===a.Lb.PLAYGAMA||s===a.Lb.STANDALONE){const e=t.searchParams.get(\"game_id\");if(e)return e;const r=t.hostname.match(/^([a-z0-9-]+)\\.games\\.playgama\\.net$/i);if(r)return r[1]}}catch{return null}return null}#Be(){this.#Te||(this.#Te=setInterval((()=>{this.send(`${s.oF.CORE}_ping`),this.#je()}),3e4))}#$e(){this.#Te&&(clearInterval(this.#Te),this.#Te=null)}}const p=new u,m=p,_=p},5555:(e,t,r)=>{r.d(t,{Z:()=>S});var s=r(9778),i=r(1558),a=r(5230),o=r(8902),n=r(9221);const d=\"bridge-cross-promo-styles\",l=\"bridge-cross-promo\",h=\"config\",c=\"platform\",u=`\\n #${l} {\\n position: fixed;\\n inset: 0;\\n z-index: 9999998;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n background: rgba(0, 0, 0, 0.72);\\n font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;\\n animation: bridge-cp-fade-in 180ms ease-out;\\n padding: 16px;\\n box-sizing: border-box;\\n }\\n\\n #${l} .bridge-cp-modal {\\n position: relative;\\n width: 100%;\\n max-width: 640px;\\n max-height: 100%;\\n background: #212121;\\n border-radius: 12px;\\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);\\n padding: 24px;\\n box-sizing: border-box;\\n display: flex;\\n flex-direction: column;\\n overflow: hidden;\\n color: #ffffff;\\n }\\n\\n #${l} .bridge-cp-header {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n gap: 12px;\\n margin-bottom: 20px;\\n }\\n\\n #${l} .bridge-cp-title {\\n margin: 0;\\n color: #ffffff;\\n font-size: 20px;\\n font-weight: 700;\\n line-height: 1.2;\\n letter-spacing: -0.2px;\\n }\\n\\n #${l} .bridge-cp-close {\\n flex-shrink: 0;\\n width: 36px;\\n height: 36px;\\n border: 0;\\n border-radius: 50%;\\n background: transparent;\\n color: #aaaaaa;\\n font-size: 24px;\\n line-height: 1;\\n cursor: pointer;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n padding: 0;\\n transition: background 200ms ease, color 200ms ease;\\n }\\n\\n #${l} .bridge-cp-close:hover {\\n background: rgba(255, 255, 255, 0.1);\\n color: #ffffff;\\n }\\n\\n #${l} .bridge-cp-grid {\\n display: grid;\\n grid-template-columns: repeat(2, minmax(0, 1fr));\\n gap: 16px;\\n overflow-y: auto;\\n padding: 4px;\\n margin: -4px;\\n -webkit-overflow-scrolling: touch;\\n }\\n\\n #${l} .bridge-cp-tile {\\n display: flex;\\n flex-direction: column;\\n text-decoration: none;\\n color: inherit;\\n cursor: pointer;\\n }\\n\\n #${l} .bridge-cp-thumb {\\n position: relative;\\n width: 100%;\\n aspect-ratio: 183 / 256;\\n border-radius: 12px;\\n overflow: hidden;\\n background: #333333 center/cover no-repeat;\\n transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 250ms ease;\\n }\\n\\n #${l} .bridge-cp-tile:hover .bridge-cp-thumb {\\n transform: translateY(-4px);\\n box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);\\n }\\n\\n #${l} .bridge-cp-name {\\n margin-top: 8px;\\n font-size: 14px;\\n font-weight: 500;\\n text-align: center;\\n color: #f1f1f1;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n transition: color 200ms ease;\\n }\\n\\n #${l} .bridge-cp-tile:hover .bridge-cp-name {\\n color: #3ea6ff;\\n }\\n\\n @keyframes bridge-cp-fade-in {\\n from { opacity: 0; }\\n to { opacity: 1; }\\n }\\n\\n @media (min-width: 600px) {\\n #${l} .bridge-cp-grid {\\n grid-template-columns: repeat(4, minmax(0, 1fr));\\n }\\n }\\n`;function p(e){return\"string\"==typeof e&&e.length>0?e:void 0}function m(e){return{name:p(e.name),url:e.url,iconUrl:p(e.icon),payload:e}}function _(e){const t=e.appID??e.id;return{id:null==t?void 0:String(t),name:p(e.title)??p(e.name),url:p(e.url)??\"\",iconUrl:p(e.coverURL)??p(e.icon)??p(e.iconUrl),coverUrl:p(e.coverURL)??p(e.coverUrl),payload:e}}class g extends s.Z{get isVisible(){return null!==this.#Je}#Je=null;#Xe=h;initialize(e){return super.initialize(e),this.#Xe=this.#Qe(),this.#et(),this}getGames(){return this.#Xe===c?this.#tt():Promise.resolve(this.#rt())}async show(){if(this.#Je)return;const e=await this.getGames();if(this.#Je)return;const t=e.filter((e=>e&&e.url));if(0===t.length)return;const r=function(e,t){if(e.length<=t)return e.slice();const r=e.slice();for(let e=r.length-1;e>0;e-=1){const t=Math.floor(Math.random()*(e+1)),s=r[e];r[e]=r[t],r[t]=s}return r.slice(0,t)}(t,4);this.#st(),this.#Je=this.#it(r,this.#at().title),document.body.appendChild(this.#Je);const s={source:this.#Xe,games:r};i.ZP.emit(o.W1.CROSS_PROMO_SHOWN,s)}hide(){this.#Je&&(this.#Je.remove(),this.#Je=null)}#Qe(){const{source:e}=this.#at();return e===c||e===h?e:h}#et(){i.ZP.on(o.W1.INTERSTITIAL_STATE_CHANGED,(e=>{e!==n.WA.LOADING&&e!==n.WA.OPENED||this.hide()})),i.ZP.on(o.W1.REWARDED_STATE_CHANGED,(e=>{e!==n.b3.LOADING&&e!==n.b3.OPENED||this.hide()}))}#at(){return a.ZP.getValues().crossPromo??{}}#rt(){const{games:e}=this.#at();return Array.isArray(e)?e.filter((e=>e&&e.url)).map(m):[]}#tt(){return this._platformBridge.isPlatformGamesListSupported?this._platformBridge.getGamesList().then((e=>Array.isArray(e)?e.map(_):[])).catch((()=>[])):Promise.resolve([])}#st(){if(document.getElementById(d))return;const e=document.createElement(\"style\");e.id=d,e.textContent=u,document.head.appendChild(e)}#it(e,t){const r=document.createElement(\"div\");r.id=l;const s=document.createElement(\"div\");s.className=\"bridge-cp-modal\";const i=document.createElement(\"div\");i.className=\"bridge-cp-header\";const a=document.createElement(\"h2\");a.className=\"bridge-cp-title\",a.textContent=\"string\"==typeof t&&t.length>0?t:\"More games\",i.appendChild(a);const o=document.createElement(\"button\");o.className=\"bridge-cp-close\",o.type=\"button\",o.setAttribute(\"aria-label\",\"Close\"),o.textContent=\"×\",i.appendChild(o),s.appendChild(i);const n=document.createElement(\"div\");return n.className=\"bridge-cp-grid\",e.forEach((e=>{n.appendChild(this.#ot(e))})),s.appendChild(n),r.appendChild(s),r.addEventListener(\"click\",(e=>{e.target===r&&this.hide()})),s.addEventListener(\"click\",(e=>{const t=e.target,r=t.closest(\".bridge-cp-tile\");if(t.closest(\".bridge-cp-close\"))return e.preventDefault(),void this.hide();r||this.hide()})),r}#ot(e){const t=document.createElement(\"a\");t.className=\"bridge-cp-tile\",t.href=e.url,t.target=\"_blank\",t.rel=\"noopener noreferrer\";const r=document.createElement(\"div\");if(r.className=\"bridge-cp-thumb\",e.iconUrl&&(r.style.backgroundImage=`url('${e.iconUrl.replace(/'/g,\"\\\\'\")}')`),t.appendChild(r),e.name){const r=document.createElement(\"div\");r.className=\"bridge-cp-name\",r.textContent=e.name,t.appendChild(r)}return t}}const S=new g},66:(e,t,r)=>{r.d(t,{AR:()=>a,Lh:()=>i,Uw:()=>o,me:()=>s});const s={DESKTOP:\"desktop\",MOBILE:\"mobile\",TABLET:\"tablet\",TV:\"tv\"},i={WINDOWS:\"windows\",MACOS:\"macos\",LINUX:\"linux\",ANDROID:\"android\",IOS:\"ios\",OTHER:\"other\"},a={PORTRAIT:\"portrait\",LANDSCAPE:\"landscape\"},o=\"bridge-orientation-overlay\"},3117:(e,t,r)=>{r.d(t,{f:()=>i});var s=r(66);function i(){return window.innerHeight>window.innerWidth?s.AR.PORTRAIT:s.AR.LANDSCAPE}},7408:(e,t,r)=>{r.d(t,{Z:()=>s});const s={NOT_AVAILABLE:\"not_available\",IN_GAME:\"in_game\",NATIVE:\"native\",NATIVE_POPUP:\"native_popup\"}},1147:(e,t,r)=>{r.d(t,{ZP:()=>h,cE:()=>l,iv:()=>d,om:()=>n});var s=r(9778),i=r(6170),a=r(8902);class o extends s.Z{get isSupported(){return this._platformBridge.isPaymentsSupported}purchase(e,t){return this._platformBridge.isPaymentsSupported?(i.rh.send(`${a.oF.PAYMENTS}_purchase_started`,{id:e}),this._platformBridge.paymentsPurchase(e,t).then((t=>(i.rh.send(`${a.oF.PAYMENTS}_purchase_completed`,{id:e}),t))).catch((t=>{throw i.rh.send(`${a.oF.PAYMENTS}_purchase_failed`,{id:e}),t}))):Promise.reject()}getPurchases(){return this._platformBridge.isPaymentsSupported?this._platformBridge.paymentsGetPurchases():Promise.reject()}getCatalog(){return this._platformBridge.isPaymentsSupported?this._platformBridge.paymentsGetCatalog():Promise.reject()}consumePurchase(e){return this._platformBridge.isPaymentsSupported?(i.rh.send(`${a.oF.PAYMENTS}_consume_purchase_started`,{id:e}),this._platformBridge.paymentsConsumePurchase(e).then((t=>(i.rh.send(`${a.oF.PAYMENTS}_consume_purchase_completed`,{id:e}),t))).catch((t=>{throw i.rh.send(`${a.oF.PAYMENTS}_consume_purchase_failed`,{id:e}),t}))):Promise.reject()}}function n(e,t){return e?e.map((e=>{const r={...e[t]??{}};return r.platformProductId=r.id??e.id,r.id=e.id,r})):[]}function d(e,t,r){if(!e)return null;const s=e.find((e=>e.id===r));if(!s)return null;const i={...s[t]??{}};return i.platformProductId=i.id??s.id,i.id=s.id,i}function l(e){return`${e}_${Date.now()}_${Math.random().toString(36).substring(2,10)}`}const h=new o},3806:(e,t,r)=>{r.d(t,{Dt:()=>i,Lb:()=>s,YU:()=>a});const s={VK:\"vk\",OK:\"ok\",YANDEX:\"yandex\",CRAZY_GAMES:\"crazy_games\",GAME_DISTRIBUTION:\"game_distribution\",PLAYGAMA:\"playgama\",STANDALONE:\"standalone\",TELEGRAM:\"telegram\",Y8:\"y8\",LAGGED:\"lagged\",FACEBOOK:\"facebook\",POKI:\"poki\",MOCK:\"mock\",QA_TOOL:\"qa_tool\",MSN:\"msn\",MICROSOFT_STORE:\"microsoft_store\",HUAWEI:\"huawei\",GAMEPUSH:\"gamepush\",DISCORD:\"discord\",JIO_GAMES:\"jio_games\",YOUTUBE:\"youtube\",PORTAL:\"portal\",REDDIT:\"reddit\",XIAOMI:\"xiaomi\",TIKTOK:\"tiktok\",DLIGHTEK:\"dlightek\",GAMESNACKS:\"gamesnacks\",SAMSUNG:\"samsung\"},i={GAME_READY:\"game_ready\",LEVEL_STARTED:\"level_started\",LEVEL_COMPLETED:\"level_completed\",LEVEL_FAILED:\"level_failed\",LEVEL_PAUSED:\"level_paused\",LEVEL_RESUMED:\"level_resumed\",IN_GAME_LOADING_STARTED:\"in_game_loading_started\",IN_GAME_LOADING_STOPPED:\"in_game_loading_stopped\",GAMEPLAY_STARTED:\"gameplay_started\",GAMEPLAY_STOPPED:\"gameplay_stopped\",PLAYER_GOT_ACHIEVEMENT:\"player_got_achievement\"},a={VISIBLE:\"visible\",HIDDEN:\"hidden\"}},3941:(e,t,r)=>{r.d(t,{Z:()=>u,m:()=>h});var s=r(9778),i=r(8960),a=r(6873),o=r(9146);const n=\"bridge-player-guest-id\",d=\"bridge_player_guest_id\";let l=null;function h(){if(l)return{id:l,name:`Guest ${l}`};let e=a.Z.getItem(n)||a.Z.getItem(d);e||(e=(0,o.D)());try{a.Z.setItem(n,e)}catch{}return l=e,{id:e,name:`Guest ${e}`}}class c extends s.Z{get isAuthorizationSupported(){return this._platformBridge.isPlayerAuthorizationSupported}get isAuthorized(){return this._platformBridge.isPlayerAuthorized}get isGuest(){if(!this._platformBridge.isPlayerAuthorized)return!0;const e=this._platformBridge.playerId;return!e||e===h().id}get id(){return this._platformBridge.playerId}get name(){return this._platformBridge.playerName}get photos(){return this._platformBridge.playerPhotos}get extra(){return this._platformBridge.playerExtra}authorize(e){const t=(0,i.ju)(e,this._platformBridge.platformId);return this.isAuthorizationSupported?this._platformBridge.authorizePlayer(t):Promise.reject()}}const u=new c},9979:(e,t,r)=>{r.d(t,{Z:()=>p});var s=r(1558),i=r(9778),a=r(8902),o=r(6873);function n(e){return null==e||\"\"===e}function d(e,t){if(n(e))return null;if(!t||\"string\"!=typeof e)return e;try{return JSON.parse(e)}catch{return e}}function l(e){return null==e||\"string\"==typeof e?e:JSON.stringify(e)}const h=class{#nt=new Map;#dt=new Set;#lt=new Set;has(e){return this.#nt.has(e)}get(e){return this.#nt.get(e)}isDirty(e){return this.#dt.has(e)}isDeleted(e){return this.#lt.has(e)}dirtyKeys(){return[...this.#dt]}deletedKeys(){return[...this.#lt]}set(e,t){n(t)?this.delete(e):(this.#nt.set(e,t),this.#dt.delete(e),this.#lt.delete(e))}setDirty(e,t){n(t)?this.delete(e):(this.#nt.set(e,t),this.#dt.add(e),this.#lt.delete(e))}delete(e){this.#nt.delete(e),this.#dt.delete(e),this.#lt.delete(e)}tombstone(e){this.#nt.delete(e),this.#dt.delete(e),this.#lt.add(e)}keys(){return[...this.#nt.keys()]}clear(){this.#nt.clear(),this.#dt.clear(),this.#lt.clear()}};const c=class{#ht=Promise.resolve();enqueue(e){const t=this.#ht.then(e,e);return this.#ht=t.then((()=>{}),(()=>{})),t}};class u extends i.Z{#ct=new h;#ut=new c;initialize(e){return super.initialize(e),this._platformBridge.on(a.W1.PLATFORM_STORAGE_AVAILABILITY_CHANGED,(e=>{this.#ut.enqueue((()=>this.#pt(Boolean(e)))).catch((()=>{}))})),this}get(e,t=!0){const r=Array.isArray(e);if(r&&0===e.length)return Promise.resolve([]);const s=r?e:[e],i=this.#ut.enqueue((()=>this.#mt(s,t)));return r?i:i.then((e=>e[0]))}set(e,t){return s.ZP.emit(a.W1.STORAGE_SET),Array.isArray(e)?Array.isArray(t)?e.length!==t.length?Promise.reject(new Error(\"Key and value arrays must have the same length\")):0===e.length?Promise.resolve():this.#ut.enqueue((()=>this.#_t(this.#gt(e,t)))):Promise.reject(new Error(\"Value must be an array when key is an array\")):this.#ut.enqueue((()=>this.#_t(this.#gt([e],[t]))))}delete(e){const t=Array.isArray(e)?e:[e];return 0===t.length?Promise.resolve():this.#ut.enqueue((()=>this.#St(t)))}#gt(e,t){const r={sets:[],deletes:[]};return e.forEach(((e,s)=>{n(t[s])?r.deletes.push(e):r.sets.push({key:e,value:l(t[s])})})),r}async#mt(e,t){if(e.every((e=>this.#ct.has(e))))return e.map((e=>d(this.#ct.get(e),t)));if(!this.#At())return this.#Et(e,t);try{const t=e.filter((e=>!this.#ct.has(e)&&!this.#ct.isDeleted(e)));if(t.length>0){const e=await this._platformBridge.getDataFromStorage(t);Object.keys(e).forEach((t=>{this.#ct.isDirty(t)||this.#ct.isDeleted(t)||this.#ct.set(t,e[t])}))}}catch{return this.#Et(e,t)}return(await this.#ft(e)).map((e=>d(e,t)))}async#ft(e){const t=[],r=[],s=e.map((e=>{if(this.#ct.has(e))return this.#ct.isDirty(e)?r.push({key:e,value:this.#ct.get(e)}):t.push(e),this.#ct.get(e);if(this.#ct.isDeleted(e))return null;const s=this.#Pt(e);return n(s)?null:(r.push({key:e,value:s}),s)}));return this.#It(t),r.length>0&&await this.#yt(r),s}async#yt(e){try{await this._platformBridge.setDataToStorage(this.#Dt(e)),e.forEach((e=>this.#ct.set(e.key,e.value))),this.#It(e.map((e=>e.key)))}catch{}}async#_t(e){if(this.#At())try{return e.sets.length>0&&await this._platformBridge.setDataToStorage(this.#Dt(e.sets)),e.deletes.length>0&&await this._platformBridge.deleteDataFromStorage(e.deletes),this.#Tt(e,!1),void this.#It([...e.sets.map((e=>e.key)),...e.deletes])}catch{}this.#wt(e)}#wt(e){if(!o.Z.isAvailable)throw new a.Hd(a.Bq.STORAGE_NOT_SUPPORTED);try{e.sets.forEach((e=>o.Z.setItem(e.key,e.value))),e.deletes.forEach((e=>o.Z.removeItem(e)))}catch(e){if(e&&\"QuotaExceededError\"===e.name)throw new a.Hd(a.Bq.STORAGE_QUOTA_EXCEEDED);throw e}this.#Tt(e,!0),this._platformBridge.notifyLocalDataChanged?.(e)}async#St(e){if(this.#It(e),this.#At())try{return await this._platformBridge.deleteDataFromStorage(e),void e.forEach((e=>this.#ct.delete(e)))}catch{}e.forEach((e=>this.#ct.tombstone(e))),this._platformBridge.notifyLocalDataChanged?.({sets:[],deletes:e})}async#pt(e){if(e&&this.#At()){const e=this.#ct.dirtyKeys(),t=this.#ct.deletedKeys();try{if(e.length>0){const t=e.map((e=>({key:e,value:this.#ct.get(e)})));await this._platformBridge.setDataToStorage(this.#Dt(t))}t.length>0&&await this._platformBridge.deleteDataFromStorage(t),this.#It([...this.#ct.keys(),...t]),this.#ct.clear()}catch{}}else o.Z.isAvailable&&this.#ct.keys().forEach((e=>{try{o.Z.setItem(e,l(this.#ct.get(e)))}catch{}}))}#Et(e,t){if(!o.Z.isAvailable)throw new a.Hd(a.Bq.STORAGE_NOT_SUPPORTED);return e.map((e=>{if(this.#ct.has(e))return d(this.#ct.get(e),t);if(this.#ct.isDeleted(e))return null;const r=o.Z.getItem(e);return this.#ct.setDirty(e,r),d(r,t)}))}#Pt(e){return o.Z.isAvailable?o.Z.getItem(e):null}#It(e){o.Z.isAvailable&&e.forEach((e=>o.Z.removeItem(e)))}#Tt(e,t){e.sets.forEach((e=>{t?this.#ct.setDirty(e.key,e.value):this.#ct.set(e.key,e.value)})),e.deletes.forEach((e=>{t?this.#ct.tombstone(e):this.#ct.delete(e)}))}#Dt(e){const t={};return e.forEach((e=>{t[e.key]=e.value})),t}#At(){return this._platformBridge.isPlatformStorageAvailable}}const p=new u},9163:(e,t,r)=>{r.r(t),r.d(t,{default:()=>u});var s=r(8166),i=r(8960),a=r(8467),o=r(8902),n=r(3806),d=r(66),l=r(9221);const h=\"https://store.xsolla.com/api/v2/project\";class c extends s.Z{get platformId(){return n.Lb.CRAZY_GAMES}get platformLanguage(){return this.#vt?this._platformSdk.user.systemInfo.countryCode.toLowerCase():super.platformLanguage}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlayerAuthorizationSupported(){return this.#vt}get isPaymentsSupported(){return!!this.options.xsollaProjectId}get deviceType(){if(this.#vt){const e=this._platformSdk.user.systemInfo.device.type.toLowerCase();if([d.me.DESKTOP,d.me.MOBILE,d.me.TABLET].includes(e))return e}return super.deviceType}#Rt=!1;#vt=!1;#bt={adStarted:()=>{this.#Rt?this._setRewardedState(l.b3.OPENED):this._setInterstitialState(l.WA.OPENED)},adFinished:()=>{this.#Rt?(this._setRewardedState(l.b3.REWARDED),this._setRewardedState(l.b3.CLOSED)):this._setInterstitialState(l.WA.CLOSED)},adError:()=>{this._showAdFailurePopup(this.#Rt)}};initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(o.Mn.INITIALIZE),(0,i.ZT)(\"https://sdk.crazygames.com/crazygames-sdk-v3.js\").then((()=>{(0,i.X_)(\"CrazyGames\",\"SDK\",\"init\").then((()=>{this._platformSdk=window.CrazyGames.SDK,this._setPlatformStorageAvailable(!0),this._isBannerSupported=!0,this._isAdvancedBannersSupported=!0,this._platformSdk.init().then((()=>{this.#vt=this._platformSdk.user.isUserAccountAvailable;const e=this.#Ct();this._platformSdk.game.addSettingsChangeListener((e=>{this._setAudioState(!e.muteAudio)})),this._setAudioState(!this._platformSdk.game.settings.muteAudio),this.options.xsollaProjectId&&this.#Lt(),Promise.all([e]).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)}))}))}))}))),e.promise}authorizePlayer(){if(!this.#vt)return Promise.reject();if(this._isPlayerAuthorized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(o.Mn.AUTHORIZE_PLAYER),this._platformSdk.user.showAuthPrompt().then((()=>{this.#Ct().then((()=>{this._resolvePromiseDecorator(o.Mn.AUTHORIZE_PLAYER)}))})).catch((e=>{this._rejectPromiseDecorator(o.Mn.AUTHORIZE_PLAYER,e)}))),e.promise}sendMessage(e){const t=this._platformSdk;switch(e){case n.Dt.IN_GAME_LOADING_STARTED:return t.game.loadingStart(),Promise.resolve();case n.Dt.IN_GAME_LOADING_STOPPED:return t.game.loadingStop(),Promise.resolve();case n.Dt.GAMEPLAY_STARTED:case n.Dt.LEVEL_STARTED:case n.Dt.LEVEL_RESUMED:return t.game.gameplayStart(),Promise.resolve();case n.Dt.GAMEPLAY_STOPPED:case n.Dt.LEVEL_PAUSED:case n.Dt.LEVEL_COMPLETED:case n.Dt.LEVEL_FAILED:return t.game.gameplayStop(),Promise.resolve();case n.Dt.PLAYER_GOT_ACHIEVEMENT:return t.game.happytime(),Promise.resolve();default:return super.sendMessage(e)}}getDataFromStorage(e){const{data:t}=this._platformSdk,r={};return e.forEach((e=>{const s=t.getItem(e);null!=s&&\"\"!==s&&(r[e]=s)})),Promise.resolve(r)}setDataToStorage(e){const t=this._platformSdk;return Object.keys(e).forEach((r=>t.data.setItem(r,e[r]))),Promise.resolve()}deleteDataFromStorage(e){const t=this._platformSdk;return e.forEach((e=>t.data.removeItem(e))),Promise.resolve()}showBanner(e){let t=document.getElementById(l._g);t||(t=(0,a.kM)(e)),t.style.display=\"block\",this._platformSdk.banner.requestResponsiveBanner([l._g]).then((()=>{this._setBannerState(l.Kk.SHOWN)})).catch((()=>{this._setBannerState(l.Kk.FAILED),t.style.display=\"none\"}))}hideBanner(){const e=document.getElementById(l._g);e&&(e.style.display=\"none\"),this._platformSdk.banner.clearAllBanners(),this._setBannerState(l.Kk.HIDDEN)}showAdvancedBanners(e){this._setAdvancedBannersState(l.Kk.LOADING),(0,a.XA)();const t=(0,a.f_)(e),r=this._platformSdk,s=t.map((e=>r.banner.requestResponsiveBanner(e)));Promise.all(s).then((()=>{this._setAdvancedBannersState(l.Kk.SHOWN)})).catch((()=>{this._setAdvancedBannersState(l.Kk.FAILED),(0,a.XA)()}))}hideAdvancedBanners(){(0,a.XA)(),this._platformSdk.banner.clearAllBanners(),this._setAdvancedBannersState(l.Kk.HIDDEN)}showInterstitial(){this.#Rt=!1,this._platformSdk.ad.requestAd(\"midgame\",this.#bt)}showRewarded(){this.#Rt=!0,this._platformSdk.ad.requestAd(\"rewarded\",this.#bt)}checkAdBlock(){return new Promise((e=>{this._platformSdk.ad.hasAdblock().then((t=>{e(t)}))}))}paymentsPurchase(e){let t=this._paymentsGetProductPlatformData(e);t||(t={id:e});const r=t.platformProductId||t.id;let s=this._getPromiseDecorator(o.Mn.PURCHASE);return s||(s=this._createPromiseDecorator(o.Mn.PURCHASE),this.#Lt().then((()=>this.#Ot())).then((async e=>{const s=await fetch(`${h}/${this.options.xsollaProjectId}/payment/item/${r}`,{method:\"POST\",headers:{Authorization:`Bearer ${e}`,\"Content-Type\":\"application/json\"}});if(!s.ok)throw new Error(`Xsolla create order HTTP ${s.status}`);const i=await s.json(),a=i.token,n=i.order_id,d=window.XPayStationWidget;if(!d)throw new Error(\"Xsolla Pay Station widget not loaded\");d.init({access_token:a,sandbox:this.options.isSandbox||!1,childWindow:{target:\"_blank\"}});let l,c=!1;const u=()=>{document.removeEventListener(\"visibilitychange\",l)};l=()=>{\"visible\"!==document.visibilityState||c||setTimeout((()=>{c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,new Error(\"Purchase canceled/closed\")))}),1500)},d.on(d.eventTypes.STATUS,((s,i)=>{try{const s=i&&i.paymentInfo||{};s.status&&/done|charged|success/i.test(String(s.status))&&this.#Mt(this.options.xsollaProjectId,n,e).then((e=>{this._platformSdk.analytics.trackOrder(\"xsolla\",e);const s={id:t.id,sku:r,orderId:n,...e};this._paymentsPurchases.push(s),c||(c=!0,u(),this._resolvePromiseDecorator(o.Mn.PURCHASE,s))})).catch((e=>{c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,e))}))}catch(e){c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,e))}})),d.on(\"close\",(()=>{c||(c=!0,u(),this._rejectPromiseDecorator(o.Mn.PURCHASE,new Error(\"Purchase canceled/closed\")))})),d.open(),document.addEventListener(\"visibilitychange\",l)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.PURCHASE,e)}))),s.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject(new Error(\"No platform products available\"));let t=this._getPromiseDecorator(o.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(o.Mn.GET_CATALOG),this.#Ot().then((e=>fetch(`${h}/${this.options.xsollaProjectId}/items?limit=50`,{headers:{Authorization:`Bearer ${e}`}}))).then((e=>{if(!e.ok)throw new Error(`Xsolla catalog HTTP ${e.status}`);return e.json()})).then((t=>{const r=t.items||[],s=new Map(r.map((e=>[e.sku,e]))),i=e.map((e=>{const t=s.get(e.platformProductId),r=t?.price;return{id:e.id,name:t?.name??e.name??e.id,description:t?.description??e.description??\"\",price:r?.amount??null,priceCurrencyCode:r?.currency??null,priceValue:r?.amount??null}}));this._resolvePromiseDecorator(o.Mn.GET_CATALOG,i)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.GET_CATALOG,e)}))),t.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject(new Error(\"No such purchase to consume\"));let r=this._getPromiseDecorator(o.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(o.Mn.CONSUME_PURCHASE);const s=this._paymentsPurchases[t],i=s.sku||s.id;this.#Ot().then((e=>fetch(`${h}/${this.options.xsollaProjectId}/user/inventory/item/consume`,{method:\"POST\",headers:{Authorization:`Bearer ${e}`,\"Content-Type\":\"application/json\"},body:JSON.stringify({sku:i,quantity:1})}))).then((r=>{if(!r.ok)throw new Error(`Xsolla consume HTTP ${r.status}`);this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(o.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(o.Mn.CONSUME_PURCHASE,e)}))}return r.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(o.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(o.Mn.GET_PURCHASES),this.#Ot().then((e=>fetch(`${h}/${this.options.xsollaProjectId}/user/inventory/items`,{headers:{Authorization:`Bearer ${e}`}}))).then((e=>{if(!e.ok)throw new Error(`Xsolla inventory HTTP ${e.status}`);return e.json()})).then((e=>{const t=this._paymentsGetProductsPlatformData()||[];this._paymentsPurchases=(e.items||[]).map((e=>{const r=t.find((t=>t.id===e.sku));if(!r)return null;return{id:r.id,...e}})).filter((e=>null!==e)),this._resolvePromiseDecorator(o.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.GET_PURCHASES,e)}))),e.promise}#Ct(){return this.#vt?new Promise(((e,t)=>{this._platformSdk.user.getUser().then((r=>{r?(this._isPlayerAuthorized=!0,r.username&&(this._playerName=r.username),r.profilePictureUrl&&(this._playerPhotos=[r.profilePictureUrl]),this._playerExtra=r,this._options.useUserToken?this._platformSdk.user.getUserToken().then((e=>{this._playerExtra.jwt=e})).finally((()=>{e()})):e()):t()})).catch((e=>{t(e)}))})):Promise.reject()}async#Lt(){window.XPayStationWidget||await(0,i.ZT)(\"https://cdn.xsolla.net/payments-bucket-prod/embed/1.5.0/widget.min.js\")}async#Ot(){return await this._platformSdk.user.getXsollaUserToken()}async#Mt(e,t,r){const s=await fetch(`${h}/${e}/order/${t}`,{headers:{Authorization:`Bearer ${r}`}});if(!s.ok)throw new Error(`Xsolla order HTTP ${s.status}`);return s.json()}}const u=c},1634:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806);const n=\"https://discord.com/api/v10\";class d extends s.Z{get platformId(){return o.Lb.DISCORD}get isPlayerAuthorizationSupported(){return!0}get isPaymentsSupported(){return!0}get isInviteFriendsSupported(){return!0}get isShareSupported(){return!0}_appId=null;_accessToken=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.appId?(this._appId=this._options.appId,(0,i.ZT)(\"/cdn/discord/discord-v2.0.0.min.js\").then((()=>{(0,i.X_)(\"discord\",\"DiscordSDK\").then((()=>(this._platformSdk=new window.discord.DiscordSDK(this._appId),this._platformSdk.ready()))).then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.DISCORD_GAME_PARAMS_NOT_FOUND)),e.promise}authorizePlayer(e){const t=e,r=t?.scope||[\"identify\"];let s=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);if(!s){s=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);const e=this._platformSdk;e.commands.authorize({client_id:this._appId,response_type:\"code\",state:\"\",prompt:\"none\",scope:r}).then((({code:e})=>fetch(\"/api/discord/auth-token\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({code:e,appId:this._appId})}))).then((e=>e.json())).then((t=>(this._accessToken=t.accessToken,this._playerExtra={token:t.token,accessToken:this._accessToken,channelId:e.channelId},e.commands.authenticate({access_token:this._accessToken})))).then((e=>{if(null===e)throw new Error(\"Authorization failed\");return fetch(`${n}/users/@me`,{method:\"GET\",headers:{Authorization:`Bearer ${this._accessToken}`,\"Content-Type\":\"application/json\"}})})).then((e=>e.json())).then((e=>{this._playerId=e.id,this._playerName=e.username,e.avatar&&this._playerPhotos.push(`https://cdn.discordapp.com/avatars/${e.id}/${e.avatar}.png`),this._playerExtra={...this._playerExtra,...e},this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)})).catch((e=>{this._accessToken=null,this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,e)}))}return s.promise}paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.PURCHASE),this._platformSdk.commands.startPurchase({sku_id:t.platformProductId}).then((t=>{if(!t)throw new Error(\"Purchase failed\");const r={id:e,...t};this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))),r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);const s=this._paymentsPurchases[t].purchaseToken;fetch(`${n}/applications/${this._appId}/entitlements/${s}/consume`,{method:\"POST\",headers:{Authorization:`Bearer ${this._accessToken}`,\"Content-Type\":\"application/json\"},body:JSON.stringify({})}).then((()=>{this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}))}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this._platformSdk.commands.getSkus().then((({skus:t})=>{const r=e.map((e=>{const r=t.find((t=>t.id===e.platformProductId)),s=window.discord.PriceUtils.formatPrice(r.price),a=(0,i.ZP)(s),o=r.price?.currency?.toUpperCase(),n=`${a} ${o}`;return{id:e.id,title:r.name,price:n,priceValue:a,priceCurrencyCode:o}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this._platformSdk.commands.getEntitlements().then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.entitlements.map((e=>{const r={id:t.find((t=>t.id===e.id)).id};return Object.assign(r,e),r})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))),e.promise}inviteFriends(){let e=this._getPromiseDecorator(a.Mn.INVITE_FRIENDS);return e||(e=this._createPromiseDecorator(a.Mn.INVITE_FRIENDS),this._platformSdk.commands.openInviteDialog().then((()=>{this._resolvePromiseDecorator(a.Mn.INVITE_FRIENDS)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS,e)}))),e.promise}share(e){const{image:t,url:r,...s}=e??{},o=t&&!(0,i.dY)(t)?t:r;if(!o)return Promise.reject();let n=this._getPromiseDecorator(a.Mn.SHARE);return n||(n=this._createPromiseDecorator(a.Mn.SHARE),this._platformSdk.commands.openShareMomentDialog({...s,mediaUrl:o}).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),n.promise}}const l=d},7430:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960),l=r(8467);class h extends s.Z{get platformId(){return o.Lb.DLIGHTEK}get isBannerSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}_bannerContainer=null;_bannerPlacement=null;#Nt=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.appKey&&this._options?.adSenseId?(0,d.ZT)(\"https://www.hippoobox.com/static/sdk/adsdk_1.9.5.js\").then((()=>{if(!window.h5sdk)throw new Error(\"Dlightek SDK not found\");this._platformSdk=window.h5sdk;const e=this._platformSdk;this.#Nt=setTimeout((()=>{this._isInitialized||this.#kt()}),5e3);const t={client:this._options.adSenseId,\"data-ad-frequency-hint\":\"45s\",callback:()=>{e.adConfig({preloadAdBreaks:\"on\",sound:\"on\",onReady:()=>{this._isInitialized||(this.#Nt&&clearTimeout(this.#Nt),this.#kt())}})}};this._options.adChannel&&(t[\"data-ad-channel\"]=this._options.adChannel),this._options.testMode&&(t[\"data-adbreak-test\"]=\"on\"),e.init(this._options.appKey,\"\",\"\",\"\",\"\",{adsense:t})})).catch((()=>{this.#kt()})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?new Promise((e=>{try{const e=this._platformSdk;e&&e.gameLoadingCompleted&&e.gameLoadingCompleted()}catch(e){i.ZP.error(\"Dlightek error:\",e)}e(void 0)})):super.sendMessage(e)}showInterstitial(e){this._platformSdk?this._platformSdk.adBreak({type:\"start\",name:e,beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e.breakStatus&&this._showAdFailurePopup(!1)}}):this._showAdFailurePopup(!1)}showRewarded(e){this._platformSdk?this._platformSdk.adBreak({type:\"reward\",name:e,beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e(0)},adDismissed:()=>{},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e.breakStatus&&\"other\"!==e.breakStatus||this._showAdFailurePopup(!0)}}):this._showAdFailurePopup(!0)}showBanner(e,t){if(this._bannerContainer)return;this._bannerPlacement=t,this._bannerContainer=(0,l.kM)(e);const r=this.#Ht(t);this._bannerContainer.appendChild(r),this._setBannerState(n.Kk.SHOWN)}hideBanner(){this._bannerContainer?.remove(),this._bannerContainer=null,this._setBannerState(n.Kk.HIDDEN)}#kt(){this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}#Ht(e){const t=document.createElement(\"ins\");return t.style.display=\"block\",t.classList.add(\"adsbygoogle\"),t.setAttribute(\"data-ad-client\",this._options.adSenseId),t.setAttribute(\"data-ad-slot\",String(e??\"\")),t.setAttribute(\"data-ad-format\",\"auto\"),t.setAttribute(\"data-container-id\",n._g),t.setAttribute(\"data-full-width-responsive\",\"true\"),this._options.testMode&&t.setAttribute(\"data-adtest\",\"on\"),t}}const c=h},2769:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(66),d=r(9221),l=r(7408);class h extends s.Z{get platformId(){return o.Lb.FACEBOOK}get platformLanguage(){return this._platformLanguage||super.platformLanguage}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get deviceType(){switch(this._platformSdk&&this._platformSdk.getPlatform()){case\"IOS\":case\"ANDROID\":case\"MOBILE_WEB\":return n.me.MOBILE;case\"WEB\":return n.me.DESKTOP;default:return super.deviceType}}get isPlayerAuthorizationSupported(){return!0}get isBannerSupported(){return!0}get leaderboardsType(){return l.Z.NATIVE_POPUP}get isPaymentsSupported(){return!0}get isInviteFriendsSupported(){return this._supportedApis.includes(\"inviteAsync\")}get isJoinCommunitySupported(){return this._isJoinCommunitySupported}get isShareSupported(){return this._supportedApis.includes(\"shareAsync\")}_platformLanguage=null;_contextId=null;_supportedApis=[];_preloadedInterstitialPromises={};_preloadedRewardedPromises={};_isPlatformStorageAvailable=!0;_isJoinCommunitySupported=!1;_overlay=null;#Bt=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://connect.facebook.net/en_US/fbinstant.8.0.js\").then((()=>(0,i.X_)(\"FBInstant\"))).then((()=>(this._platformSdk=window.FBInstant,this._platformSdk.initializeAsync()))).then((()=>{const e=this._platformSdk;this._isPlayerAuthorized=!0,this._playerId=e.player.getID(),this._contextId=e.context.getID();let t=e.getLocale();return\"string\"==typeof t&&(t=t.substring(0,2).toLowerCase()),this._platformLanguage=t,this._supportedApis=e.getSupportedAPIs(),this.#Gt(),Promise.allSettled([e.community.canFollowOfficialPageAsync(),e.community.canJoinOfficialGroupAsync()]).then((([e,t])=>{const r=\"fulfilled\"===e.status&&e.value,s=\"fulfilled\"===t.status&&t.value;this._isJoinCommunitySupported=!0===r&&!0===s}))})).then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})).catch((e=>this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)))),e.promise}sendMessage(e,t){if(e===o.Dt.GAME_READY){const e=this._platformSdk;return e.setLoadingProgress(100),this._options.subscribeForNotificationsOnStart&&setTimeout((()=>this.#Ft()),0),new Promise((t=>{e.startGameAsync().then(t)}))}return super.sendMessage(e,t)}authorizePlayer(e){return Promise.resolve()}async getDataFromStorage(e){await this.#xt();const t=await this._platformSdk.player.getDataAsync(e),r={};return e.forEach((e=>{const s=t[e];null!=s&&\"\"!==s&&(r[e]=\"string\"==typeof s?s:JSON.stringify(s))})),r}async setDataToStorage(e){return await this.#xt(),this._platformSdk.player.setDataAsync(e).then((()=>{}))}async deleteDataFromStorage(e){await this.#xt();const t={};return e.forEach((e=>{t[e]=null})),this._platformSdk.player.setDataAsync(t).then((()=>{}))}showBanner(e,t){this._platformSdk.loadBannerAdAsync(t,e).then((()=>{this._setBannerState(d.Kk.SHOWN)})).catch((()=>{this._setBannerState(d.Kk.FAILED)}))}hideBanner(){this._platformSdk.hideBannerAdAsync().then((()=>{this._setBannerState(d.Kk.HIDDEN)})).catch((()=>{this._setBannerState(d.Kk.FAILED)}))}preloadInterstitial(e){this.#Ut(e)}showInterstitial(e){this.#Ut(e).then((e=>(this._setInterstitialState(d.WA.OPENED),e.showAsync()))).then((()=>{this._setInterstitialState(d.WA.CLOSED),this.#Ut(e,!0)})).catch((()=>this._advertisementShowErrorPopup(!1)))}preloadRewarded(e){this.#Vt(e)}showRewarded(e){this.#Vt(e).then((e=>(this._setRewardedState(d.b3.OPENED),e.showAsync()))).then((()=>{this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED),this.#Vt(e,!0)})).catch((()=>this._advertisementShowErrorPopup(!0)))}leaderboardsSetScore(e,t){let r=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);const s=\"number\"==typeof t?t:parseInt(t,10);this._platformSdk.globalLeaderboards.setScoreAsync(e,s).then((()=>{this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,e)}))}return r.promise}leaderboardsShowNativePopup(e){let t=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP);if(!t){t=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP);const r=function(){const e=document.createElement(\"div\");e.style.position=\"fixed\",e.style.top=\"0\",e.style.left=\"0\",e.style.width=\"100vw\",e.style.height=\"100vh\",e.style.backgroundColor=\"rgba(0, 0, 0, 0.5)\",e.style.display=\"flex\",e.style.justifyContent=\"center\",e.style.alignItems=\"center\",e.style.zIndex=\"9999\",e.id=\"loading-overlay\";const t=document.createElement(\"div\");return t.style.fontSize=\"24px\",t.style.color=\"#fff\",t.innerText=\"Loading...\",e.appendChild(t),e}();document.body.appendChild(r);const s=this._platformSdk;s.globalLeaderboards.getTopEntriesAsync(e,20).then((e=>{const t=e.map((e=>({score:e.getScore(),sessionID:e.getPlayer().getSessionID()}))),i=s.overlayViews.createOverlayViewWithXMLString('\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n',\"\",{players:t},(e=>{e.showAsync(),this._overlay=e,r.remove(),this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP)}),((e,t)=>{r.remove(),this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,t)})),{iframeElement:o}=i;o.style.zIndex=\"9999\",o.style.position=\"absolute\",o.style.top=\"0\",o.style.left=\"0\",o.style.height=\"100vh\",o.style.width=\"100vw\",o.style.border=\"0\",o.id=o.name,document.body.appendChild(o)})).catch((e=>{r.remove(),this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,e)}))}return t.promise}paymentsPurchase(e){let t=this._paymentsGetProductPlatformData(e);t||(t={id:e});let r=this._getPromiseDecorator(a.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.PURCHASE);const s=t.platformProductId?t.platformProductId:t.id;this._platformSdk.payments.purchaseAsync({productID:s.toLowerCase()}).then((t=>{const r={id:e,...t};delete r.productID,this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))}return r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);const s=this._paymentsPurchases[t].purchaseToken;this._platformSdk.payments.consumePurchaseAsync(s).then((()=>{this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}))}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this._platformSdk.payments.getCatalogAsync().then((t=>{const r=e.map((e=>{const r=t.find((t=>t.productID===e.platformProductId));return{id:e.id,title:r.title,description:r.description,imageURI:r.imageURI,price:r.price,priceCurrencyCode:r.priceCurrencyCode,priceValue:r.priceAmount}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this._platformSdk.payments.getPurchasesAsync().then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.map((e=>{const r={id:t.find((t=>t.id===e.productID)).id,...e};return delete r.productID,r})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))),e.promise}inviteFriends(e){const t=e??{};if(!t.image||!t.text)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(a.Mn.INVITE_FRIENDS),(0,i.kh)(t.image).then((e=>this._platformSdk.inviteAsync({...t,image:e}))).then((()=>{this._resolvePromiseDecorator(a.Mn.INVITE_FRIENDS)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS,e)}))),r.promise}joinCommunity(e){let t=this._getPromiseDecorator(a.Mn.JOIN_COMMUNITY);if(!t){t=this._createPromiseDecorator(a.Mn.JOIN_COMMUNITY);const r=e,s=this._platformSdk;r&&!0===r.isPage?s.community.followOfficialPageAsync().then((e=>this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY,e))).catch((e=>this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,e))):s.community.joinOfficialGroupAsync().then((e=>this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY,e))).catch((e=>this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,e)))}return t.promise}share(e){const t=e??{};if(!t.image||!t.text)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.SHARE);return r||(r=this._createPromiseDecorator(a.Mn.SHARE),(0,i.kh)(t.image).then((e=>this._platformSdk.shareAsync({intent:\"REQUEST\",...t,image:e}))).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),r.promise}#Gt(){const e=this;e._platformSdk.overlayViews.setCustomEventHandler((t=>{if(\"leaderboard\"===t)e.#Bt=!0;else if(\"close\"===t){if(e.#Bt)return void(e.#Bt=!1);if(e._overlay){const t=e._overlay.iframeElement.id,r=document.getElementById(t);r&&document.body.removeChild(r),e._overlay.dismissAsync(),e._overlay=null}}}))}#Ut(e,t=!1){if(!t&&this._preloadedInterstitialPromises[e])return this._preloadedInterstitialPromises[e];let r=null;const s=this._platformSdk.getInterstitialAdAsync(e).then((e=>(r=e,e.loadAsync()))).then((()=>r)).catch((()=>(this._preloadedInterstitialPromises[e]=null,Promise.reject())));return this._preloadedInterstitialPromises[e]=s,s}#Vt(e,t=!1){if(!t&&this._preloadedRewardedPromises[e])return this._preloadedRewardedPromises[e];let r=null;const s=this._platformSdk.getRewardedVideoAsync(e).then((e=>(r=e,e.loadAsync()))).then((()=>r)).catch((()=>(this._preloadedRewardedPromises[e]=null,Promise.reject())));return this._preloadedRewardedPromises[e]=s,s}async#Ft(){const e=this._platformSdk;try{if(await e.player.isSubscribedBotAsync())return Promise.resolve()}catch(e){if(\"INVALID_OPERATION\"!==e?.code)throw new Error(e)}let t=!1;try{if(t=await e.player.canSubscribeBotAsync(),t)return e.player.subscribeBotAsync()}catch(e){if(\"INVALID_OPERATION\"===e?.code)return Promise.resolve();throw new Error(e)}return Promise.resolve()}#xt(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}}const c=h},3777:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8467),o=r(8902),n=r(3806),d=r(9221);class l extends s.Z{get platformId(){return n.Lb.GAME_DISTRIBUTION}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isMinimumDelayBetweenInterstitialEnabled(){return!1}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}#Rt=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);if(!e)if(e=this._createPromiseDecorator(o.Mn.INITIALIZE),this._options&&\"string\"==typeof this._options.gameId){const e=this;window.GD_OPTIONS={gameId:this._options.gameId,onEvent(t){switch(t.name){case\"SDK_READY\":e._platformSdk=window.gdsdk,e._isInitialized=!0,e.showInterstitial(),e._resolvePromiseDecorator(o.Mn.INITIALIZE);break;case\"SDK_GAME_START\":e.#Rt?(e._setRewardedState(d.b3.CLOSED),e._platformSdk.preloadAd(\"rewarded\")):e._setInterstitialState(d.WA.CLOSED);break;case\"SDK_GAME_PAUSE\":e.#Rt?e._setRewardedState(d.b3.OPENED):e._setInterstitialState(d.WA.OPENED);break;case\"SDK_REWARDED_WATCH_COMPLETE\":e._setRewardedState(d.b3.REWARDED)}}},this._setPlatformStorageAvailable(!1),this._isBannerSupported=!0,(0,i.ZT)(\"https://html5.api.gamedistribution.com/main.min.js\")}else this._rejectPromiseDecorator(o.Mn.INITIALIZE,o.pn.GAME_PARAMS_NOT_FOUND);return e.promise}showBanner(e,t){let r=document.getElementById(d._g);r||(r=(0,a.kM)(e)),r.style.display=\"block\",this._platformSdk.showAd(\"display\",{containerId:d._g}).then((()=>{this._setBannerState(d.Kk.SHOWN)})).catch((()=>{this._setBannerState(d.Kk.FAILED),r&&(r.style.display=\"none\")}))}hideBanner(){const e=document.getElementById(d._g);e&&(e.style.display=\"none\"),this._setBannerState(d.Kk.HIDDEN)}showInterstitial(){this.#Rt=!1,this._platformSdk?this._platformSdk.showAd().catch((()=>{this._showAdFailurePopup(!1)})):this._showAdFailurePopup(!1)}preloadRewarded(){this._platformSdk.preloadAd(\"rewarded\")}showRewarded(){this.#Rt=!0,this._platformSdk?this._platformSdk.showAd(\"rewarded\").catch((()=>{this._showAdFailurePopup(!0)})):this._showAdFailurePopup(!0)}}const h=l},4499:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.GAMEPUSH}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}_isBannerSupported=!0;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e)if(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options&&this._options.projectId&&this._options.publicToken){const e=`https://gamepush.com/sdk/game-score.js?projectId=${this._options.projectId}&publicToken=${this._options.publicToken}`;(0,i.ZT)(e).then((()=>{(0,i.X_)(\"GamePush\").then((()=>{this._platformSdk=window.GamePush;const e=this._platformSdk?.player;if(e){const{id:t=null,name:r=\"\",avatar:s=\"\"}=e;this._isPlayerAuthorized=!0,this._playerId=t??null,this._playerName=r,s&&this._playerPhotos.push(s)}this._isInitialized=!0,this.#Zt(),this.#jt(),this.#zt(),this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}else this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND);return e.promise}showInterstitial(){this._platformSdk.ads.showFullscreen()}showRewarded(){this._platformSdk.ads.showRewardedVideo().catch((()=>{this._showAdFailurePopup(!0)}))}showBanner(){this._platformSdk.ads.showSticky()}hideBanner(){this._platformSdk.ads.closeSticky()}checkAdBlock(){return new Promise((e=>{this._platformSdk.ads.isAdblockEnabled().then((t=>{e(t)}))}))}#jt(){const e=this._platformSdk;e.ads.on(\"rewarded:start\",(()=>{this._setRewardedState(n.b3.OPENED)})),e.ads.on(\"rewarded:close\",(e=>{e||this._showAdFailurePopup(!0)})),e.ads.on(\"rewarded:reward\",(()=>{this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)}))}#Zt(){const e=this._platformSdk;e.ads.on(\"fullscreen:start\",(()=>{this._setInterstitialState(n.WA.OPENED)})),e.ads.on(\"fullscreen:close\",(()=>{this._setInterstitialState(n.WA.CLOSED)}))}#zt(){const e=this._platformSdk;e.ads.on(\"sticky:render\",(()=>{this._setBannerState(n.Kk.SHOWN)})),e.ads.on(\"sticky:close\",(()=>{this._setBannerState(n.Kk.HIDDEN)}))}}const l=d},9819:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408);class l extends s.Z{get platformId(){return o.Lb.GAMESNACKS}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformPageVisibilityApiAllowed(){return!1}get leaderboardsType(){return d.Z.NATIVE}_isBannerSupported=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.X_)(\"GameSnacks\").then((()=>{this._platformSdk=window.GameSnacks,this._setPlatformStorageAvailable(!0);const e=this._platformSdk;e.game.onPause((()=>{this._setPauseState(!0)})),e.game.onResume((()=>{this._setPauseState(!1)})),e.audio.subscribe((e=>{this._setAudioState(e)})),e.game.firstFrameReady(),this._setAudioState(e.audio.isEnabled()),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))),e.promise}sendMessage(e,t){const r=this._platformSdk,s=t??{};switch(e){case o.Dt.GAME_READY:return r.game.ready(),Promise.resolve();case o.Dt.LEVEL_FAILED:return r.game.gameOver(),Promise.resolve();case o.Dt.LEVEL_COMPLETED:{const e=Number(s.level);return r.game.levelComplete(Number.isFinite(e)?e:0),Promise.resolve()}default:return super.sendMessage(e,t)}}showInterstitial(e){this._platformSdk.ad.break({type:\"next\",name:e||\"interstitial\",beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{const{interstitialState:e}=this;e!==n.WA.FAILED&&this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e?.breakStatus&&this._showAdFailurePopup(!1)}})}showRewarded(e){this._platformSdk.ad.break({type:\"reward\",name:e||\"rewarded\",beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this.rewardedState!==n.b3.FAILED&&this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e()},adDismissed:()=>{this._showAdFailurePopup(!0)},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e?.breakStatus&&\"other\"!==e?.breakStatus||this._showAdFailurePopup(!0)}})}checkAdBlock(){return Promise.resolve(!1)}getDataFromStorage(e){const t={};return e.forEach((e=>{const r=this._platformSdk.storage.getItem(e);null!=r&&\"\"!==r&&(t[e]=r)})),Promise.resolve(t)}setDataToStorage(e){return Object.keys(e).forEach((t=>{this._platformSdk.storage.setItem(t,e[t])})),Promise.resolve()}deleteDataFromStorage(e){return e.forEach((e=>{this._platformSdk.storage.removeItem(e)})),Promise.resolve()}leaderboardsSetScore(e,t){return this._platformSdk.score.update(t)}}const h=l},7490:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960);class l extends s.Z{get platformId(){return o.Lb.HUAWEI}get isPlayerAuthorizationSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPaymentsSupported(){return!0}get isPlatformExternalLinksAllowed(){return!0}_isPlatformStorageAvailable=!0;#Wt=null;#Kt=Promise.resolve();initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options&&this._options.appId?(this.#Wt=this._options.appId,this.#Yt(),this.#$t(a.Mn.INITIALIZE,this.#Wt)):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}authorizePlayer(){let e=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this.#$t(a.Mn.AUTHORIZE_PLAYER)),e.promise}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await this.#qt((()=>{const t=this._createPromiseDecorator(a.Mn.GET_STORAGE_DATA);return this.#$t(a.Mn.GET_STORAGE_DATA,e),t.promise}));null!=r&&\"\"!==r&&(t[e]=r)}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>this.#qt((()=>{const r=this._createPromiseDecorator(a.Mn.SET_STORAGE_DATA);return this.#$t(a.Mn.SET_STORAGE_DATA,{key:t,value:e[t]}),r.promise}))))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>this.#qt((()=>{const t=this._createPromiseDecorator(a.Mn.DELETE_STORAGE_DATA);return this.#$t(a.Mn.DELETE_STORAGE_DATA,e),t.promise}))))).then((()=>{}))}showInterstitial(e){this.#$t(a.Mn.SHOW_INTERSTITIAL,e)}showRewarded(e){this.#$t(a.Mn.SHOW_REWARDED,e)}paymentsPurchase(e){if(!this._paymentsGetProductPlatformData(e))return Promise.reject();let t=this._getPromiseDecorator(a.Mn.PURCHASE);return t||(t=this._createPromiseDecorator(a.Mn.PURCHASE),this.#$t(a.Mn.PURCHASE,e)),t.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE),this.#$t(a.Mn.CONSUME_PURCHASE,this._paymentsPurchases[t].purchaseToken)),r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this.#$t(a.Mn.GET_CATALOG,e.map((({id:e})=>e)))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this.#$t(a.Mn.GET_PURCHASES)),e.promise}#qt(e){const t=this.#Kt.catch((()=>{})).then((()=>e()));return this.#Kt=t.catch((()=>{})),t}#$t(e,t){(0,d.eE)(JSON.stringify({action:e,data:t}))}#Yt(){window.system&&(window.system.onmessage=e=>{try{const{action:t,data:r}=JSON.parse(e);t===a.Mn.INITIALIZE?this.#Jt(r):t===a.Mn.AUTHORIZE_PLAYER?this.#Xt(r):t===a.Mn.SET_INTERSTITIAL_STATE?this.#Qt(r):t===a.Mn.SET_REWARDED_STATE?this.#er(r):t===a.Mn.GET_CATALOG?this.#tr(r):t===a.Mn.PURCHASE?this.#rr(r):t===a.Mn.CONSUME_PURCHASE?this.#sr(r):t===a.Mn.GET_PURCHASES?this.#ir(r):t===a.Mn.GET_STORAGE_DATA?this.#ar(r):t===a.Mn.SET_STORAGE_DATA?this.#or(r):t===a.Mn.DELETE_STORAGE_DATA&&this.#nr(r)}catch(e){i.ZP.error(\"Error parsing Huawei message:\",e)}})}#Jt(e){e.success?(this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE,e)):this._rejectPromiseDecorator(a.Mn.INITIALIZE,new Error(String(e)))}#Xt(e){e.success?(this._playerId=e.playerId,this._playerName=e.playerName,this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)):this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,new Error(String(e)))}#Qt(e){const t=e.state;Object.values(n.WA).includes(t)&&(t===n.WA.FAILED?this._showAdFailurePopup(!1):this._setInterstitialState(t))}#er(e){const t=e.state;Object.values(n.b3).includes(t)&&(t===n.b3.FAILED?this._showAdFailurePopup(!0):this._setRewardedState(t))}#tr(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.GET_CATALOG,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[],s=t.map((e=>{const t=r.find((t=>t.productId===e.id));return{id:e.id,title:t.productName,description:t.productDesc,price:t.price,priceCurrencyCode:t.currency,priceValue:1e-6*t.microsPrice,subSpecialPeriodCycles:t.subSpecialPeriodCycles,subProductLevel:t.subProductLevel,priceType:t.priceType}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,s)}#rr(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.PURCHASE,new Error(String(e)));const t=e.data,r={id:e.id,...t};delete r.productId,this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)}#sr(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,new Error(String(e)));const t=this._paymentsPurchases.findIndex((t=>t.purchaseToken===e.purchaseToken));t>=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}#ir(e){if(!e.success)return void this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[];this._paymentsPurchases=r.map((e=>{const r=JSON.parse(e),s=t.find((e=>e.id===r.productId)),i={id:s?.id,...r};return delete i.productId,i})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)}#ar(e){e.success?this._resolvePromiseDecorator(a.Mn.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.GET_STORAGE_DATA,new Error(String(e)))}#or(e){e.success?this._resolvePromiseDecorator(a.Mn.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.SET_STORAGE_DATA,new Error(String(e)))}#nr(e){e.success?this._resolvePromiseDecorator(a.Mn.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.DELETE_STORAGE_DATA,new Error(String(e)))}}const h=l},2974:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8960),o=r(8902),n=r(3806),d=r(9221),l=r(7408);class h extends s.Z{get platformId(){return n.Lb.JIO_GAMES}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isBannerSupported(){return!0}get leaderboardsType(){return l.Z.NATIVE}get isPlatformExternalLinksAllowed(){return!1}_preloadInterstitialPromise=null;_preloadRewardedPromise=null;_isBannerAvailable=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(o.Mn.INITIALIZE),window.onSdkReady=()=>{this._platformSdk=window.JioGames;const e=this._platformSdk;if(e.playerInfo){const{gamer_id:t,gamer_name:r,gamer_avatar_url:s,...i}=e.playerInfo;this._playerId=t||null,this._playerName=r||null,s&&this._playerPhotos.push(s),this._playerExtra=i,this._isPlayerAuthorized=!0}this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)},window.onBannerReady=()=>{this._isBannerAvailable=!0};const t=this._options.adTestMode;(0,a.ZT)(\"https://jiogames.akamaized.net/gameSDK/jiogames/stable/v2.0/jiogames_sdk.js\",t?{\"data-jg-test-environment\":\"on\"}:{}).catch((e=>{this._rejectPromiseDecorator(o.Mn.INITIALIZE,JSON.stringify(e))}))}return e.promise}preloadInterstitial(){this.#Ut()}showInterstitial(){this.#Ut().then((()=>{this._platformSdk.showAd(window.AdType?.Interstitial??\"Interstitial\",{onAdClosed:()=>{this._setInterstitialState(d.WA.CLOSED)},onAdFailedToLoad:e=>{i.ZP.error(\"JioGames interstitial failed to load:\",e),this._showAdFailurePopup(!1)}}),this._setInterstitialState(d.WA.OPENED),this._preloadInterstitialPromise=null}))}preloadRewarded(){this.#Vt()}showRewarded(){this.#Vt().then((()=>{this._platformSdk.showAd(window.AdType?.Rewarded??\"Rewarded\",{onAdClosed:e=>{e&&this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED)},onAdFailedToLoad:e=>{i.ZP.error(\"JioGames rewarded failed to load:\",e),this._showAdFailurePopup(!0)}}),this._setRewardedState(d.b3.OPENED),this._preloadRewardedPromise=null}))}showBanner(e){this._isBannerAvailable?window.JGBanner?.loadBanner().then((()=>{this._setBannerState(d.Kk.SHOWN),window.JGBanner?.showBanner(e||(window.BannerPosition?.TOP??\"TOP\"))})).catch((e=>{i.ZP.error(\"JioGames banner failed to load:\",e),this._setBannerState(d.Kk.FAILED)})):this._setBannerState(d.Kk.FAILED)}hideBanner(){window.JGBanner?.hideBanner(),this._setBannerState(d.Kk.HIDDEN)}leaderboardsSetScore(e,t,r){if(!r)return Promise.reject();const s=\"string\"==typeof t?parseInt(t,10):t;return this._platformSdk.postScore(s),Promise.resolve()}#Ut(){return this._preloadInterstitialPromise||(this._preloadInterstitialPromise=new Promise(((e,t)=>{this._platformSdk.cacheAd(window?.AdType?.Interstitial??\"Interstitial\",{onAdPrepared:()=>e(void 0),onAdFailedToLoad:e=>{this._preloadInterstitialPromise=null,t(new Error(String(e)))}})}))),this._preloadInterstitialPromise}#Vt(){return this._preloadRewardedPromise||(this._preloadRewardedPromise=new Promise(((e,t)=>{this._platformSdk.cacheAd(window?.AdType?.Rewarded??\"Rewarded\",{onAdPrepared:()=>e(void 0),onAdFailedToLoad:e=>{this._preloadRewardedPromise=null,t(new Error(String(e)))}})}))),this._preloadRewardedPromise}}const c=h},4902:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408);class l extends s.Z{get platformId(){return o.Lb.LAGGED}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get leaderboardsType(){return d.Z.NATIVE}get isAchievementsSupported(){return!0}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options&&this._options.devId&&this._options.publisherId?(0,i.ZT)(\"https://lagged.com/api/rev-share/lagged.js\").then((()=>{(0,i.X_)(\"LaggedAPI\").then((()=>{this._platformSdk=window.LaggedAPI;const e=this._platformSdk;e.init(this._options.devId,this._options.publisherId),e.User.get((e=>{const{id:t,name:r,avatar:s}=e?.user??{};\"number\"==typeof t&&t>0&&(this._playerId=String(t),this._playerName=r??null,s&&this._playerPhotos.push(s),this._isPlayerAuthorized=!0),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}showInterstitial(){this._setInterstitialState(n.WA.OPENED),this._platformSdk.APIAds.show((()=>{this._setInterstitialState(n.WA.CLOSED)}))}showRewarded(){this._setRewardedState(n.b3.OPENED);this._platformSdk.GEvents.reward(((e,t)=>{e?t():this._showAdFailurePopup(!0)}),(e=>{e?(this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)):this._showAdFailurePopup(!0)}))}leaderboardsSetScore(e,t){let r=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);const s={score:t,board:e};this._platformSdk.Scores.save(s,(e=>{e.success?this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE):this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,e.errormsg)}))}return r.promise}achievementsUnlock(e){const t=\"string\"==typeof e?e:e?.id;return t&&\"string\"==typeof t?new Promise(((e,r)=>{this._platformSdk.Achievements.save([t],(t=>{t.success?e(t):r(t.errormsg)}))})):Promise.reject()}}const h=l},4951:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960);const l=\"playgama_ads_promise\";class h extends s.Z{get platformId(){return o.Lb.MICROSOFT_STORE}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlayerAuthorizationSupported(){return!0}get isPaymentsSupported(){return!0}get isRateSupported(){return!0}_isPlatformStorageAvailable=!0;#dr=null;#lr=this._createPromiseDecorator(l).promise;#hr=0;#Kt=Promise.resolve();initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e){if(e=this._createPromiseDecorator(a.Mn.INITIALIZE),!this._options||!this._options.gameId||!this._options.playgamaAdsId)return this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND),e.promise;try{this.#Yt(),this.#$t(a.Mn.INITIALIZE)}catch(e){this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)}const t=this._options.playgamaAdsId;(0,d.ZT)(\"https://playgama.com/ads/msn.v0.1.js\").then((()=>(0,d.X_)(\"pgAds\"))).then((()=>window.pgAds.init(t))).then((()=>{this.#dr=window.pgAds;const e=this._options.gameId;this.#dr.updateTargeting({gameId:e}),this._resolvePromiseDecorator(l)})).catch((e=>{this._rejectPromiseDecorator(l,e)}))}return e.promise}authorizePlayer(){let e=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);if(!e){if(e=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this._isPlayerAuthorized)return this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER),e.promise;this.#$t(a.Mn.AUTHORIZE_PLAYER)}return e.promise}showInterstitial(){if(this.#hr+=1,3===this.#hr)return this._setInterstitialState(n.WA.CLOSED),void this.rate();this.#dr?new Promise((e=>{this.#dr.requestOutOfPageAd(\"interstitial\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!1).then((()=>e()));case\"ready\":this._setInterstitialState(n.WA.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setInterstitialState(n.WA.OPENED),t.show()})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!1).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setInterstitialState(n.WA.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!1)}showRewarded(){this.#dr?new Promise((e=>{this.#dr.requestOutOfPageAd(\"rewarded\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!0).then((()=>e()));case\"ready\":this._setRewardedState(n.b3.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setRewardedState(n.b3.OPENED),t.show()})),t.addEventListener(\"rewarded\",(()=>{this._setRewardedState(n.b3.REWARDED)})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!0).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setRewardedState(n.b3.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!0)}async getDataFromStorage(e){await this.#xt();const t={};return await Promise.all(e.map((async e=>{const r=this.#cr(e),s=await this.#qt((()=>{const e=this._createPromiseDecorator(a.Mn.GET_STORAGE_DATA);return this.#$t(a.Mn.GET_STORAGE_DATA,r),e.promise}));null!=s&&\"\"!==s&&(t[e]=s)}))),t}async setDataToStorage(e){return await this.#xt(),Promise.all(Object.keys(e).map((t=>{const r=this.#cr(t);return this.#qt((()=>{const s=this._createPromiseDecorator(a.Mn.SET_STORAGE_DATA);return this.#$t(a.Mn.SET_STORAGE_DATA,{key:r,value:e[t]}),s.promise}))}))).then((()=>{}))}async deleteDataFromStorage(e){return await this.#xt(),Promise.all(e.map((e=>{const t=this.#cr(e);return this.#qt((()=>{const e=this._createPromiseDecorator(a.Mn.DELETE_STORAGE_DATA);return this.#$t(a.Mn.DELETE_STORAGE_DATA,t),e.promise}))}))).then((()=>{}))}paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(a.Mn.PURCHASE),this.#$t(a.Mn.PURCHASE,t.platformProductId)),r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e)),r=this._paymentsGetProductPlatformData(e);if(t<0||!r)return Promise.reject();let s=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);return s||(s=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE),this.#$t(a.Mn.CONSUME_PURCHASE,r.platformProductId)),s.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this.#$t(a.Mn.GET_CATALOG,e.map((e=>e.platformProductId)))),t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(a.Mn.GET_PURCHASES),this.#$t(a.Mn.GET_PURCHASES)),e.promise}rate(){let e=this._getPromiseDecorator(a.Mn.RATE);return e||(e=this._createPromiseDecorator(a.Mn.RATE),this.#$t(a.Mn.RATE),this._pauseStateAggregator?.setState(\"rate\",!0)),e.promise}#xt(){return this._isInitialized?Promise.resolve():Promise.reject()}#qt(e){const t=this.#Kt.catch((()=>{})).then((()=>e()));return this.#Kt=t.catch((()=>{})),t}#ur(){const e=this._options?.gameId;return e?`pg_${e}_`:null}#cr(e){const t=this.#ur();return t?Array.isArray(e)?e.map((e=>`${t}${e}`)):`${t}${e}`:e}#$t(e,t){(0,d.Tg)(JSON.stringify({action:e,data:t}))}#Yt(){window.chrome?.webview?.addEventListener(\"message\",(e=>{try{let{data:t}=e;\"string\"==typeof t&&(t=JSON.parse(t));const r=t??{},{action:s}=r;s===a.Mn.INITIALIZE?this.#Jt(r):s===a.Mn.AUTHORIZE_PLAYER?this.#Xt(r):s===a.Mn.GET_CATALOG?this.#tr(r):s===a.Mn.PURCHASE?this.#rr(r):s===a.Mn.CONSUME_PURCHASE?this.#sr(r):s===a.Mn.GET_PURCHASES?this.#ir(r):s===a.Mn.RATE?this.#pr(r):s===a.Mn.GET_STORAGE_DATA?this.#ar(r):s===a.Mn.SET_STORAGE_DATA?this.#or(r):s===a.Mn.DELETE_STORAGE_DATA&&this.#nr(r)}catch(e){i.ZP.error(\"Error parsing Microsoft Store message:\",e)}}))}#Jt(e){e?.success?this.#lr.then((()=>{this.showInterstitial()})).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE,e)})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,new Error(String(e)))}#Xt(e){e?.success?(this._playerExtra=e.data,this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)):this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,new Error(String(e)))}#tr(e){if(!e?.success)return void this._rejectPromiseDecorator(a.Mn.GET_CATALOG,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[],s=t.map((e=>{const t=r.find((t=>t.id===e.platformProductId)),s=t?.price??{},i=s.formattedPrice,a=i?(0,d.ZP)(i):null,o=s.currencyCode||null,n=i||null;return{id:e.id,title:t?.title||null,description:t?.description||null,price:n,priceValue:a,priceCurrencyCode:o}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,s)}#rr(e){if(!e?.success||!e.data)return void this._rejectPromiseDecorator(a.Mn.PURCHASE,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data,s=t.find((e=>e.platformProductId===r.id)),i={...r,id:s?.id,platformProductId:r.id};this._paymentsPurchases.push(i),this._resolvePromiseDecorator(a.Mn.PURCHASE,i)}#sr(e){if(!e?.success)return void this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??{},s=t.find((e=>e.platformProductId===r.id)),i={...r,id:s?.id,platformProductId:r.id},o=this._paymentsPurchases.findIndex((e=>e.id===s?.id));o>=0&&this._paymentsPurchases.splice(o,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,i)}#ir(e){if(!e?.success)return void this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,new Error(String(e)));const t=this._paymentsGetProductsPlatformData(),r=e.data??[];this._paymentsPurchases=r.map((e=>{const r=t.find((t=>t.platformProductId===e.id));return{...e,id:r?.id,platformProductId:e.id}})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)}#pr(e){this._pauseStateAggregator?.setState(\"rate\",!1),e&&!1!==e.success?this._resolvePromiseDecorator(a.Mn.RATE):this._rejectPromiseDecorator(a.Mn.RATE,new Error(String(e)))}#ar(e){e?.success?this._resolvePromiseDecorator(a.Mn.GET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.GET_STORAGE_DATA,new Error(String(e)))}#or(e){e?.success?this._resolvePromiseDecorator(a.Mn.SET_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.SET_STORAGE_DATA,new Error(String(e)))}#nr(e){e?.success?this._resolvePromiseDecorator(a.Mn.DELETE_STORAGE_DATA,e.data):this._rejectPromiseDecorator(a.Mn.DELETE_STORAGE_DATA,new Error(String(e)))}}const c=h},5244:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408);const l=604800,h=[{title:\"Ready for another round?\",description:\"Jump back in right where you left off.\",type:8,minDelayInSeconds:86400,payload:\"msn_auto_24h\"},{title:\"Missing your moves\",description:\"It's perfect time to come back\",type:9,minDelayInSeconds:259200,payload:\"msn_auto_3d\"},{title:\"We miss you\",description:\"Seriously. Come play.\",type:10,minDelayInSeconds:604800,payload:\"msn_auto_7d\"}];const c={top:[[728,90],[970,250],[320,50]],bottom:[[320,50]],left:[[300,250],[300,600],[320,50],[160,600]],right:[[300,250],[300,600],[320,50],[160,600]],topleft:[[300,250]],topright:[[300,250]],bottomleft:[[300,250]],bottomright:[[300,250]]};class u extends s.Z{get platformId(){return o.Lb.MSN}get launchSource(){return new URLSearchParams(window.location.search).has(\"notificationPayload\")?a.LS.NOTIFICATION:super.launchSource}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlayerAuthorizationSupported(){return!0}get isShareSupported(){return!0}get isAddToHomeScreenSupported(){const e=this._platformSdk;return\"function\"==typeof e?.promptInstallAsync}get leaderboardsType(){return d.Z.NATIVE}get isBannerSupported(){return!0}get isPaymentsSupported(){return this.#mr}get isNotificationsSupported(){return!0}get platformPayload(){const e=this._platformSdk;if(\"function\"==typeof e?.getNotificationPayload){const t=e.getNotificationPayload();if(t)return t}return super.platformPayload}_isAdvancedBannersSupported=!0;#dr=null;#mr=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://assets.msn.com/staticsb/statics/latest/msstart-games-sdk/msstart-v1.0.0-rc.21.min.js\").then((()=>(0,i.X_)(\"$msstart\"))).then((()=>{this._platformSdk=window.$msstart,!0!==this._options?.disableAutoNotifications&&h.forEach((e=>{this._platformSdk.scheduleNotificationAsync(e).catch((()=>{}))})),this._platformSdk.getSignedInUserAsync().then((e=>{this.#_r(e)})).catch((()=>{this.#_r(null)})).finally((()=>{this._setPlatformStorageAvailable(this._isPlayerAuthorized),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}));const t=this._options?.advertisement,r=t?.backfillId;r&&(0,i.ZT)(\"https://playgama.com/ads/msn.v0.1.js\").then((()=>(0,i.X_)(\"pgAds\"))).then((()=>{const{pgAds:e}=window;e&&e.init(r).then((()=>{this.#dr=e;const t=this._options.gameId;this.#dr.updateTargeting({gameId:t})}))}))}return e.promise}authorizePlayer(){return this._isPlayerAuthorized?Promise.resolve():new Promise(((e,t)=>{this._platformSdk.signInAsync().then((t=>{this.#_r(t),e(void 0)})).catch((e=>{this.#_r(null),t(e)}))}))}getDataFromStorage(){return this._platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId})}async setDataToStorage(e){const t=await this._platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});Object.keys(e).forEach((r=>{t[r]=e[r]})),await this._platformSdk.cloudSave.saveDataAsync({data:t,gameId:this._options.gameId})}async deleteDataFromStorage(e){const t=await this._platformSdk.cloudSave.getDataAsync({gameId:this._options.gameId});e.forEach((e=>{t[e]=null})),await this._platformSdk.cloudSave.saveDataAsync({data:t,gameId:this._options.gameId})}share(e){return new Promise(((t,r)=>{this._platformSdk.shareAsync(e).then(t).catch(r)}))}addToHomeScreen(){let e=this._getPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN),this._platformSdk.promptInstallAsync().then((e=>{\"accepted\"!==e?this._rejectPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN):this._resolvePromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN,e)}))),e.promise}leaderboardsSetScore(e,t){return new Promise(((e,r)=>{this._platformSdk.submitGameResultsAsync(t).then(e).catch(r)}))}notificationsSchedule(e,t){const r=\"number\"==typeof(s=t)?s:\"string\"==typeof s&&\"\"!==s.trim()?Number(s):void 0;var s;const i=this.#gr(e,r);if(i)return Promise.reject(new a.Hd(a.Bq.NOTIFICATION_INVALID_PARAMETERS,i));const o={title:e.title,description:e.description,type:r};return void 0!==e.image&&(o.imageData=e.image),void 0!==e.payload&&(o.payload=e.payload),void 0!==e.delaySeconds&&(o.minDelayInSeconds=e.delaySeconds),void 0!==e.callToAction&&(o.callToAction=e.callToAction),this._platformSdk.scheduleNotificationAsync(o)}showBanner(e){let t;switch(e){case n.Cb.TOP:t=\"top:728x90\";break;case n.Cb.BOTTOM:default:t=\"bottom:320x50\"}this._platformSdk.showDisplayAdsAsync([t]).then((()=>{this._setBannerState(n.Kk.SHOWN)})).catch((()=>{this._setBannerState(n.Kk.FAILED)}))}hideBanner(){this._platformSdk.hideDisplayAdsAsync().then((()=>{this._setBannerState(n.Kk.HIDDEN)}))}showAdvancedBanners(e){this._setAdvancedBannersState(n.Kk.LOADING);const t=[...new Set((e??[]).map((e=>this.#Sr(e))).filter((e=>Boolean(e))))].slice(0,2);0!==t.length?this._platformSdk.showDisplayAdsAsync(t).then((()=>{this._setAdvancedBannersState(n.Kk.SHOWN)})).catch((()=>{this._setAdvancedBannersState(n.Kk.FAILED)})):this._setAdvancedBannersState(n.Kk.FAILED)}hideAdvancedBanners(){this._platformSdk.hideDisplayAdsAsync().then((()=>{this._setAdvancedBannersState(n.Kk.HIDDEN)}))}showInterstitial(){const e=this._platformSdk;e.loadAdsAsync(!1).then((t=>e.showAdsAsync(t.instanceId))).then((e=>(this._setInterstitialState(n.WA.OPENED),e.showAdsCompletedAsync))).then((()=>this._setInterstitialState(n.WA.CLOSED))).catch((()=>this.#Ar()))}showRewarded(){const e=this._platformSdk;e.loadAdsAsync(!0).then((t=>e.showAdsAsync(t.instanceId))).then((e=>(this._setRewardedState(n.b3.OPENED),e.showAdsCompletedAsync))).then((()=>{this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)})).catch((()=>this.#Er()))}async paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);if(!t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.PURCHASE);try{this._isPlayerAuthorized||await this.authorizePlayer();const r=await this._platformSdk.iap.purchaseAsync({productId:t.platformProductId});if(\"IAP_PURCHASE_FAILURE\"===r.code)throw new Error(r.description);const s={id:e,...r.receipt,receiptSignature:r.receiptSignature};this._paymentsPurchases.push(s),this._resolvePromiseDecorator(a.Mn.PURCHASE,s)}catch(e){this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}}return r.promise}async paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.CONSUME_PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);try{this._isPlayerAuthorized||await this.authorizePlayer();const r=await this._platformSdk.iap.consumeAsync({productId:this._paymentsPurchases[t].productId});if(\"IAP_CONSUME_FAILURE\"===r.code)throw new Error(r.description);this._paymentsPurchases.splice(t,1);const s={id:e,...r.consumptionReceipt,consumptionSignature:r.consumptionSignature};delete s.productId,this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,s)}catch(e){this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)}}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(a.Mn.GET_CATALOG),this._platformSdk.iap.getAllAddOnsAsync({productId:this._options.gameId}).then((t=>{if(\"IAP_GET_ALL_ADD_ONS_FAILURE\"===t.code)return void this._rejectPromiseDecorator(a.Mn.GET_CATALOG,t.description);const r=t,s=e.map((e=>{const t=r.find((t=>t.productId===e.platformProductId)),s=t?.price??{},i=s.listPrice??null,a=s.currencyCode||null,o=null!==i&&a?`${i} ${a} `:null;return{id:e.id,title:t?.title||null,description:t?.description||null,publisherName:t?.publisherName||null,inAppOfferToken:t?.inAppOfferToken||null,isConsumable:t?.isConsumable??null,price:o,priceCurrencyCode:a,priceValue:i}}));this._resolvePromiseDecorator(a.Mn.GET_CATALOG,s)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))),t.promise}async paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);if(!e){e=this._createPromiseDecorator(a.Mn.GET_PURCHASES);try{this._isPlayerAuthorized||await this.authorizePlayer();const e=await this._platformSdk.iap.getAllPurchasesAsync({productId:this._options.gameId}),t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.receipts.map((r=>{const s=t.find((e=>e.platformProductId===r.productId));return{id:s?.id,...r,receiptSignature:e.receiptSignature}})),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)}catch(e){\"IAP_GET_ALL_PURCHASES_FAILURE\"===e?.code?this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,[]):this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}}return e.promise}#Ar(){return this.#dr?new Promise((e=>{this.#dr.requestOutOfPageAd(\"interstitial\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!1).then((()=>e()));case\"ready\":this._setInterstitialState(n.WA.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setInterstitialState(n.WA.OPENED),t.show()})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!1).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setInterstitialState(n.WA.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!1)}#Er(){return this.#dr?new Promise((e=>{this.#dr.requestOutOfPageAd(\"rewarded\").then((t=>{switch(t.state){case\"empty\":return void this._advertisementShowErrorPopup(!0).then((()=>e()));case\"ready\":this._setRewardedState(n.b3.OPENED),t.show()}t.addEventListener(\"ready\",(()=>{this._setRewardedState(n.b3.OPENED),t.show()})),t.addEventListener(\"rewarded\",(()=>{this._setRewardedState(n.b3.REWARDED)})),t.addEventListener(\"empty\",(()=>{this._advertisementShowErrorPopup(!0).then((()=>e()))})),t.addEventListener(\"closed\",(()=>{this._setRewardedState(n.b3.CLOSED),e()}))}))})):this._advertisementShowErrorPopup(!0)}#gr(e,t){if(void 0===t||Number.isNaN(t)||!Number.isInteger(t)||t<0||t>15)return`Notification \"${e.id}\" must be mapped to an integer MSN type (0-15) in the \"notifications\" config section`;if(!0!==this._options?.disableAutoNotifications&&h.some((e=>e.type===t))){return`MSN types ${h.map((e=>e.type)).join(\", \")} are reserved for built-in auto notifications; set \"disableAutoNotifications\": true to use them`}return e.title.length>60?'Notification \"title\" must be at most 60 characters':e.description.length>200?'Notification \"description\" must be at most 200 characters':void 0!==e.delaySeconds&&e.delaySeconds>l?'Notification \"delaySeconds\" must be at most 604800 (7 days)':null}#Sr(e){const t=this.#fr(e);if(!t)return null;const r=c[t];if(!r||0===r.length)return null;const s=this.#Pr(e.width,window.innerWidth),i=this.#Pr(e.height,window.innerHeight);if(null===s||null===i)return null;const a=r.filter((e=>e[0]<=s&&e[1]<=i));if(0===a.length)return null;let o=a[0],n=o[0]*o[1];return a.forEach((e=>{const t=e[0]*e[1];t>n&&(n=t,o=e)})),`${t}:${o[0]}x${o[1]}`}#Pr(e,t){if(\"string\"!=typeof e)return null;if(e.endsWith(\"%\")){const r=parseFloat(e);return Number.isNaN(r)?null:Math.floor(t*r/100)}const r=parseInt(e,10);return Number.isNaN(r)?null:r}#fr(e){const t=void 0!==e.top,r=void 0!==e.bottom,s=void 0!==e.left,i=void 0!==e.right;return t&&s?\"topleft\":t&&i?\"topright\":r&&s?\"bottomleft\":r&&i?\"bottomright\":t?\"top\":r?\"bottom\":s?\"left\":i?\"right\":null}#_r(e){e&&(this._isPlayerAuthorized=!0,this._playerId=e.playerId??e.publisherPlayerId,this._playerName=e.playerDisplayName,this._playerExtra=e,this.#mr=\"personal\"===e.userAccountType.toLowerCase(),this._setPlatformStorageAvailable(!0))}}const p=u},9623:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);const d=\"AUTHORIZED\",l={VALUABLE_ACCESS:\"VALUABLE_ACCESS\",PHOTO_CONTENT:\"PHOTO_CONTENT\"};class h extends s.Z{get platformId(){return o.Lb.OK}get isPlayerAuthorizationSupported(){return!0}get isBannerSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isJoinCommunitySupported(){return!0}get isInviteFriendsSupported(){return!0}get isCreatePostSupported(){return!0}get isRateSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isClipboardSupported(){return!1}_hasValuableAccessPermission=!1;_hasValuableAccessPermissionShowed=!1;_platformBannerOptions={};#Ir=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"//api.ok.ru/js/fapi5.js\").then((()=>{(0,i.X_)(\"FAPI\").then((()=>{this._platformSdk=window.FAPI,window.API_callback=(e,t,r)=>{const s=this.#yr;s[e]?.(t,r)};const e=this._platformSdk,t=e.Util.getRequestParameters()||{};t.api_server&&t.apiconnection?e.init(t.api_server,t.apiconnection,(()=>{const e=this._platformSdk?.saved_state;this._isPlayerAuthorized=!e||e===d,this._isPlayerAuthorized?this._platformSdk.Client.call(this.#Dr.userProfile,this.#Tr.userProfileCallback):(this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE))}),(()=>{this._rejectPromiseDecorator(a.Mn.INITIALIZE)})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)}))}))),e.promise}authorizePlayer(){if(this._isPlayerAuthorized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this._platformSdk.UI.showLoginSuggestion(d)),e.promise}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await new Promise(((t,r)=>{const s={method:\"storage.get\",keys:[e],scope:\"CUSTOM\"};this._platformSdk.Client.call(s,((s,i,a)=>{if(!i)return void r(a);const o=(i.data||{})[e];t(\"\"===o||void 0===o?null:o)}))}));null!=r&&\"\"!==r&&(t[e]=\"string\"==typeof r?r:JSON.stringify(r))}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>new Promise(((r,s)=>{const i={method:\"storage.set\",key:t,value:e[t]};this._platformSdk.Client.call(i,((e,t)=>{t?r():s()}))}))))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>new Promise(((t,r)=>{const s={method:\"storage.set\",key:e,value:\"\"};this._platformSdk.Client.call(s,((e,s)=>{s?t():r()}))}))))).then((()=>{}))}showInterstitial(){try{this._platformSdk.UI.showAd()}catch{this._showAdFailurePopup(!1)}}showRewarded(){try{this._platformSdk.UI.loadAd()}catch{this._showAdFailurePopup(!0)}}showBanner(e){this.#Ir=e,this._platformSdk.invokeUIMethod(\"requestBannerAds\")}hideBanner(){this._platformSdk.invokeUIMethod(\"hideBannerAds\")}checkAdBlock(){let e=this._getPromiseDecorator(a.Mn.ADBLOCK_DETECT);return e||(e=this._createPromiseDecorator(a.Mn.ADBLOCK_DETECT),this._platformSdk.invokeUIMethod(\"isAdBlockEnabled\")),e.promise}inviteFriends(e){const{text:t}=e||{};if(!e||\"string\"!=typeof t)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.INVITE_FRIENDS);return r||(r=this._createPromiseDecorator(a.Mn.INVITE_FRIENDS),t.length>120?this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS,a.pn.INVITE_FRIENDS_MESSAGE_LENGTH_ERROR):this._platformSdk.UI.showInvite(t)),r.promise}rate(){let e=this._getPromiseDecorator(a.Mn.RATE);return e||(e=this._createPromiseDecorator(a.Mn.RATE),this._platformSdk.UI.showRatingDialog()),e.promise}createPost(e){const{text:t,url:r,status:s,...i}=e??{};if(!t&&!r&&!i.media)return Promise.reject();const o=[];t&&o.push({type:\"text\",text:t}),r&&o.push({type:\"link\",url:r});let n=this._getPromiseDecorator(a.Mn.CREATE_POST);return n||(n=this._createPromiseDecorator(a.Mn.CREATE_POST),this._platformSdk.UI.postMediatopic({media:o,...i},s??!1)),n.promise}joinCommunity(e){if(!e||!e?.groupId)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.JOIN_COMMUNITY);return t||(t=this._createPromiseDecorator(a.Mn.JOIN_COMMUNITY),this._platformSdk.UI.joinGroup(e.groupId,e.enableMessages??!1)),t.promise}get#Dr(){return{userProfile:{fields:\"uid,name,pic50x50,pic128x128,pic_base\",method:\"users.getCurrentUser\"},hasAppPermission:e=>({method:\"users.hasAppPermission\",ext_perm:e})}}get#Tr(){return{userProfileCallback:(e,t,r)=>this.#wr(e,t,r),hasValueAccessCallback:(e,t,r)=>this.#vr(t,r)}}get#yr(){return{showPermissions:()=>this.#Rr(),loadAd:e=>this.#br(e),showLoadedAd:(e,t)=>this.#Cr(t),showAd:(e,t)=>this.#Lr(t),requestBannerAds:(e,t)=>this.#Or(e,t),showBannerAds:(e,t)=>this.#Mr(t),hideBannerAds:(e,t)=>this.#Nr(t),setBannerFormat:e=>this.#kr(e),showInvite:e=>this.#Hr(e),showRatingDialog:(e,t)=>this.#Br(e,t),joinGroup:(e,t)=>this.#Gr(e,t),showLoginSuggestion:(e,t)=>this.#Fr(e,t),postMediatopic:(e,t)=>this.#xr(e,t),isAdBlockEnabled:(e,t)=>this.#Ur(e,t)}}#wr(e,t,r){\"ok\"===e&&(this._playerId=t.uid,this._playerName=t.name,this._playerPhotos=[t.pic50x50,t.pic128x128,t.pic_base]),this._isInitialized=!0,this._platformSdk.Client.call(this.#Dr.hasAppPermission(l.VALUABLE_ACCESS),this.#Tr.hasValueAccessCallback)}#Fr(e,t){if(\"error\"===e)return this._isPlayerAuthorized=!1,void this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,t);this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)}#vr(e,t){if(this._hasValuableAccessPermission=!!e,this._setPlatformStorageAvailable(this._hasValuableAccessPermission),this._hasValuableAccessPermission||this._hasValuableAccessPermissionShowed)this._resolvePromiseDecorator(a.Mn.INITIALIZE);else{const e=Object.values(l).map((e=>`\"${e}\"`)).join(\",\");this._platformSdk.UI.showPermissions(`[${e}]`)}}#Rr(){this._hasValuableAccessPermissionShowed=!0,this._platformSdk.Client.call(this.#Dr.hasAppPermission(l.VALUABLE_ACCESS),this.#Tr.hasValueAccessCallback)}#br(e){\"error\"===e?this._showAdFailurePopup(!0):(this._setRewardedState(n.b3.OPENED),this._platformSdk.UI.showLoadedAd())}#Cr(e){switch(e){case\"complete\":this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED);break;case\"skip\":this._setRewardedState(n.b3.CLOSED);break;default:this._showAdFailurePopup(!0)}}#Lr(e){switch(e){case\"ready\":case\"ad_prepared\":break;case\"ad_shown\":this._setInterstitialState(n.WA.OPENED),this._setInterstitialState(n.WA.CLOSED);break;default:this._showAdFailurePopup(!1)}}#Or(e,t){if(\"error\"!==e)switch(t){case\"ad_loaded\":this._platformSdk.invokeUIMethod(\"showBannerAds\",this.#Ir);break;case\"banner_shown\":case\"ad_shown\":this._setBannerState(n.Kk.SHOWN);break;case\"hidden_by_user\":this._setBannerState(n.Kk.HIDDEN)}else this._setBannerState(n.Kk.FAILED)}#Nr(e){e?this._setBannerState(n.Kk.HIDDEN):this._setBannerState(n.Kk.FAILED)}#Mr(e){e||this._setBannerState(n.Kk.FAILED)}#kr(e){\"error\"===e?this._setBannerState(n.Kk.FAILED):this.showBanner(this._platformBannerOptions)}#Hr(e){\"error\"===e?this._rejectPromiseDecorator(a.Mn.INVITE_FRIENDS):this._resolvePromiseDecorator(a.Mn.INVITE_FRIENDS)}#Br(e,t){\"error\"===e?this._rejectPromiseDecorator(a.Mn.RATE,t):this._resolvePromiseDecorator(a.Mn.RATE)}#Gr(e,t){\"error\"===e?this._rejectPromiseDecorator(a.Mn.JOIN_COMMUNITY,t):this._resolvePromiseDecorator(a.Mn.JOIN_COMMUNITY)}#xr(e,t){\"error\"===e?this._rejectPromiseDecorator(a.Mn.CREATE_POST,t):this._resolvePromiseDecorator(a.Mn.CREATE_POST)}#Ur(e,t){\"ok\"===e?this._resolvePromiseDecorator(a.Mn.ADBLOCK_DETECT,\"true\"===t):this._rejectPromiseDecorator(a.Mn.ADBLOCK_DETECT)}}const c=h},8166:(e,t,r)=>{r.d(t,{Z:()=>A});var s=r(1558),i=r(8902),a=r(9541),o=r(3806),n=r(66),d=r(9221),l=r(7408),h=r(6170),c=r(1147),u=r(6039);const p=class{#Vr={};#Zr=!1;#jr;constructor(e,t){this.#jr=t,e.forEach((e=>{this.#Vr[e]=!1}))}setState(e,t){e in this.#Vr&&\"boolean\"==typeof t&&this.#Vr[e]!==t&&(this.#Vr[e]=t,this.#zr())}getState(e){return e in this.#Vr&&this.#Vr[e]}getAggregatedState(){return this.#Zr}resetAll(){Object.keys(this.#Vr).forEach((e=>{this.#Vr[e]=!1})),this.#zr()}#zr(){const e=Object.values(this.#Vr).some((e=>!0===e));this.#Zr!==e&&(this.#Zr=e,this.#jr(this.#Zr))}};var m=r(8467),_=r(3941),g=r(5230);class S{get options(){return this._options}get platformId(){return o.Lb.MOCK}get platformSdk(){return this._platformSdk}get additionalData(){return this._additionalData??{}}get platformLanguage(){const e=navigator.language;return\"string\"==typeof e?e.substring(0,2).toLowerCase():\"en\"}get platformPayload(){return new URL(window.location.href).searchParams.get(\"payload\")}get platformTld(){return null}get launchSource(){return null}get isPlatformGamesListSupported(){return!1}get isPlatformExternalCallsSupported(){return!0}get isPlatformAudioEnabled(){return!this._audioStateAggregator||!this._audioStateAggregator.getAggregatedState()}get isPlatformPaused(){return!!this._pauseStateAggregator&&this._pauseStateAggregator.getAggregatedState()}get isPlayerAuthorizationSupported(){return!1}get isPlayerAuthorized(){return this._isPlayerAuthorized}get playerId(){return this._playerId}get playerName(){return this._playerName}get playerPhotos(){return this._playerPhotos}get playerExtra(){return this._playerExtra}get isPlatformStorageAvailable(){return this._isPlatformStorageAvailable}get isBannerSupported(){return this._isBannerSupported}get isAdvancedBannersSupported(){return this._isAdvancedBannersSupported}get isInterstitialSupported(){return!1}get isMinimumDelayBetweenInterstitialEnabled(){return!0}get initialInterstitialDelay(){return 60}get isRewardedSupported(){return!1}get isInviteFriendsSupported(){return!1}get isJoinCommunitySupported(){return!1}get isShareSupported(){return!1}get isCreatePostSupported(){return!1}get isAddToHomeScreenSupported(){return!1}get isAddToHomeScreenRewardSupported(){return!1}get isAddToFavoritesSupported(){return!1}get isAddToFavoritesRewardSupported(){return!1}get isRateSupported(){return!1}get isPlatformExternalLinksAllowed(){return!0}get isPlatformPageVisibilityApiAllowed(){return!0}get deviceType(){if(navigator&&navigator.userAgent){const e=navigator.userAgent.toLowerCase();if(/android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(e))return n.me.MOBILE;if(/ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP)))/.test(e))return n.me.TABLET}return n.me.DESKTOP}get deviceOs(){const e=navigator?.userAgent??\"\";return/android/i.test(e)?n.Lh.ANDROID:/iphone|ipod|ipad/i.test(e)||\"MacIntel\"===navigator?.platform&&navigator?.maxTouchPoints>1?n.Lh.IOS:/windows/i.test(e)?n.Lh.WINDOWS:/macintosh|mac os/i.test(e)?n.Lh.MACOS:/linux/i.test(e)?n.Lh.LINUX:n.Lh.OTHER}get isPaymentsSupported(){return!1}get leaderboardsType(){return l.Z.NOT_AVAILABLE}get isRemoteConfigSupported(){return!1}get isClipboardSupported(){return!0}get isAchievementsSupported(){return!1}get isNotificationsSupported(){return!1}_options;_additionalData=null;_isInitialized=!1;_platformSdk=null;_isPlayerAuthorized=!1;_playerId=null;_playerName=null;_playerPhotos=[];_playerExtra={};_visibilityState=null;_isPlatformStorageAvailable=!1;_isBannerSupported=!1;_isAdvancedBannersSupported=!1;_useAdvertisementErrorPopup=!1;_paymentsPurchases=[];_pauseStateAggregator=null;_audioStateAggregator=null;#Wr={};#Kr=0;constructor(){this._playerApplyGuestData();const e=[\"interstitial\",\"rewarded\",\"visibility\",\"platform\",\"rate\"];this._pauseStateAggregator=new p(e,(e=>this.emit(i.W1.PAUSE_STATE_CHANGED,e))),this._audioStateAggregator=new p(e,(e=>this.emit(i.W1.AUDIO_STATE_CHANGED,!e))),this.isPlatformPageVisibilityApiAllowed&&(this._visibilityState=document.visibilityState,document.addEventListener(\"visibilitychange\",(()=>{this._setVisibilityState(document.visibilityState)})),window.addEventListener(\"blur\",(()=>{this._setVisibilityState(o.YU.HIDDEN)})),window.addEventListener(\"focus\",(()=>{this._setVisibilityState(o.YU.VISIBLE)}))),this._options=g.ZP.getValues()}initialize(){return Promise.resolve()}sendMessage(e,t){return Promise.resolve()}sendCustomMessage(e,t){return Promise.resolve()}getServerTime(){return a.k.getServerTime()}getGamesList(){return Promise.resolve([])}getDataFromStorage(e){return Promise.reject(new i.Hd(i.Bq.STORAGE_NOT_SUPPORTED))}setDataToStorage(e){return Promise.reject(new i.Hd(i.Bq.STORAGE_NOT_SUPPORTED))}deleteDataFromStorage(e){return Promise.reject(new i.Hd(i.Bq.STORAGE_NOT_SUPPORTED))}showBanner(e,t){this._setBannerState(d.Kk.FAILED)}hideBanner(){this._setBannerState(d.Kk.HIDDEN)}showAdvancedBanners(e){this._setAdvancedBannersState(d.Kk.FAILED)}hideAdvancedBanners(){this._setAdvancedBannersState(d.Kk.HIDDEN)}preloadInterstitial(e){}showInterstitial(e){this._showAdFailurePopup(!1)}preloadRewarded(e){}showRewarded(e){this._showAdFailurePopup(!0)}checkAdBlock(){const e=document.createElement(\"div\");e.className=\"textads banner-ads banner_ads ad-unit ad-zone ad-space adsbox\",e.style.position=\"absolute\",e.style.left=\"-9999px\",e.style.width=\"1px\",e.style.height=\"1px\",document.body.appendChild(e);const t={method:\"HEAD\",mode:\"no-cors\"};return new Promise((r=>{fetch(\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\",t).then((t=>{t.redirected?r(t.redirected):window.setTimeout((()=>{const t=0===e.offsetHeight||\"none\"===window.getComputedStyle(e)?.display;r(t),e.remove()}),100)})).catch((()=>{r(!0)}))}))}paymentsPurchase(e){const t={id:e};return this._paymentsPurchases.push(t),Promise.resolve(t)}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));return t<0?Promise.reject():(this._paymentsPurchases.splice(t,1),Promise.resolve({id:e}))}paymentsGetCatalog(){return Promise.resolve(this._paymentsGetProductsPlatformData())}paymentsGetPurchases(){return Promise.resolve(this._paymentsPurchases)}clipboardRead(){return window.navigator&&window.navigator.clipboard?window.navigator.clipboard.readText():Promise.reject()}clipboardWrite(e){return window.navigator&&window.navigator.clipboard?window.navigator.clipboard.writeText(e):Promise.reject()}achievementsUnlock(e){return Promise.reject()}achievementsGetList(){return Promise.reject()}notificationsSchedule(e,t){return Promise.reject(new i.Hd(i.Bq.NOTIFICATIONS_NOT_SUPPORTED))}notificationsCancel(e,t){return Promise.reject(new i.Hd(i.Bq.NOTIFICATIONS_NOT_SUPPORTED))}notificationsCancelAll(){return Promise.reject(new i.Hd(i.Bq.NOTIFICATIONS_NOT_SUPPORTED))}_setPlatformStorageAvailable(e){this._isPlatformStorageAvailable!==e&&(this._isPlatformStorageAvailable=e,this.emit(i.W1.PLATFORM_STORAGE_AVAILABILITY_CHANGED,e))}_setVisibilityState(e){if(this._visibilityState===e)return;this._visibilityState=e,this.emit(i.W1.VISIBILITY_STATE_CHANGED,e);const t=e===o.YU.HIDDEN;this._pauseStateAggregator&&this._pauseStateAggregator.setState(\"visibility\",t),this._audioStateAggregator&&this._audioStateAggregator.setState(\"visibility\",t)}_setBannerState(e){this.emit(i.W1.BANNER_STATE_CHANGED,e)}_setAdvancedBannersState(e){this.emit(i.W1.ADVANCED_BANNERS_STATE_CHANGED,e)}_setInterstitialState(e){this.emit(i.W1.INTERSTITIAL_STATE_CHANGED,e);const t=e===d.WA.OPENED;this._pauseStateAggregator&&this._pauseStateAggregator.setState(\"interstitial\",t),this._audioStateAggregator&&this._audioStateAggregator.setState(\"interstitial\",t)}_setRewardedState(e){this.emit(i.W1.REWARDED_STATE_CHANGED,e);const t=e===d.b3.OPENED||e===d.b3.REWARDED;this._pauseStateAggregator&&this._pauseStateAggregator.setState(\"rewarded\",t),this._audioStateAggregator&&this._audioStateAggregator.setState(\"rewarded\",t)}_setAudioState(e){this._audioStateAggregator?this._audioStateAggregator.setState(\"platform\",!e):this.emit(i.W1.AUDIO_STATE_CHANGED,e)}_setPauseState(e){this._pauseStateAggregator?this._pauseStateAggregator.setState(\"platform\",e):this.emit(i.W1.PAUSE_STATE_CHANGED,e)}_createPromiseDecorator(e){const t=new u.Z;return this.#Wr[e]=t,t}_getPromiseDecorator(e){return this.#Wr[e]}_resolvePromiseDecorator(e,t){this.#Wr[e]&&(this.#Wr[e].resolve(t),delete this.#Wr[e])}_rejectPromiseDecorator(e,t){this.#Wr[e]&&(this.#Wr[e].reject(t),delete this.#Wr[e])}_paymentsGetProductsPlatformData(){return(0,c.om)(this._options.payments,this.platformId)}_paymentsGetProductPlatformData(e){return(0,c.iv)(this._options.payments,this.platformId,e)}_paymentsGenerateTransactionId(e){return(0,c.cE)(e)}_advertisementShowErrorPopup(e){const t=this._options?.advertisement?.useBuiltInErrorPopup;return t?(0,m.QG)(\"Oops! It looks like you closed the ad too early, or it isn't available right now.\").then((()=>{e?this._setRewardedState(d.b3.FAILED):this._setInterstitialState(d.WA.FAILED)})):(e?this._setRewardedState(d.b3.FAILED):this._setInterstitialState(d.WA.FAILED),Promise.resolve())}_showAdFailurePopup(e){if(!(this._options?.advertisement?.useAdvertisementErrorPopup??this._useAdvertisementErrorPopup))return e?this._setRewardedState(d.b3.FAILED):this._setInterstitialState(d.WA.FAILED),Promise.resolve();if(!e){const e=this._options?.advertisement?.builtInErrorPopupCooldown??180,t=Date.now();if((t-this.#Kr)/1e3{e?(h.rh.send(`${i.oF.ADVERTISEMENT}_rewarded_fallback_closed`),this._setRewardedState(d.b3.FAILED)):(h.rh.send(`${i.oF.ADVERTISEMENT}_interstitial_fallback_closed`),this._setInterstitialState(d.WA.FAILED))}))}_playerApplyGuestData(){const e=(0,_.m)();this._playerId=e.id,this._playerName=e.name}}(0,s.aA)(S.prototype);const A=S},3153:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.PLAYGAMA}get sdkUrl(){return\"https://playgama.com/platform-sdk/v1.js\"}get sdkGlobalName(){return\"PLAYGAMA_SDK\"}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isShareSupported(){return this.#Yr}get isAddToHomeScreenSupported(){return this.#$r}get isPlayerAuthorizationSupported(){return this.#qr}get isPaymentsSupported(){return this.#mr}get platformLanguage(){return this._platformSdk?.platformService?.getLanguage?.()||super.platformLanguage}_isAdvancedBannersSupported=!0;#mr=!0;#Jr=!0;#qr=!0;#Yr=!1;#$r=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(this.sdkUrl).then((()=>{(0,i.X_)(this.sdkGlobalName).then((()=>{const e=window;this._platformSdk=e[this.sdkGlobalName],this._platformSdk.advService.subscribeToAdStateChanges(((e,t)=>{if(\"interstitial\"===e)switch(t){case\"open\":this._setInterstitialState(n.WA.OPENED);break;case\"empty\":case\"error\":this._showAdFailurePopup(!1);break;case\"close\":this._setInterstitialState(n.WA.CLOSED)}else if(\"rewarded\"===e)switch(t){case\"open\":this._setRewardedState(n.b3.OPENED);break;case\"empty\":case\"error\":this._showAdFailurePopup(!0);break;case\"rewarded\":this._setRewardedState(n.b3.REWARDED);break;case\"close\":this._setRewardedState(n.b3.CLOSED)}}));const t=this._platformSdk;(t.platformService?.isReady??Promise.resolve()).then((()=>(this.#Xr(),t.platformService?.getAdditionalParams&&(this._additionalData=t.platformService.getAdditionalParams()||{}),this.#Ct()))).then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}))),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?(this._platformSdk.gameService?.gameReady?.(),Promise.resolve()):(this._platformSdk.gameService?.sendMessage?.(String(e),t??{}),super.sendMessage(e,t))}async getDataFromStorage(){return await this.#xt(),this._platformSdk.cloudSaveApi.getState()}async setDataToStorage(e){await this.#xt();const t=await this._platformSdk.cloudSaveApi.getState();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this._platformSdk.cloudSaveApi.setItems(t)}async deleteDataFromStorage(e){await this.#xt();const t=await this._platformSdk.cloudSaveApi.getState();e.forEach((e=>{delete t[e]})),await this._platformSdk.cloudSaveApi.setItems(t)}notifyLocalDataChanged(e){const t=this._platformSdk?.storageApi;if(t){if(e.sets.length>0){const r={};e.sets.forEach((e=>{r[e.key]=e.value})),t.setItems?.(r)}e.deletes.length>0&&t.deleteItems?.(e.deletes)}}showInterstitial(){this._platformSdk.advService.showInterstitial()}showRewarded(){this._platformSdk.advService.showRewarded()}showAdvancedBanners(e){this._setAdvancedBannersState(n.Kk.LOADING),this._platformSdk.advService.showAdvancedBanners(e).then((()=>{this._setAdvancedBannersState(n.Kk.SHOWN)})).catch((()=>{this._setAdvancedBannersState(n.Kk.FAILED)}))}hideAdvancedBanners(){this._platformSdk.advService.hideAdvancedBanners(),this._setAdvancedBannersState(n.Kk.HIDDEN)}checkAdBlock(){return this._platformSdk.advService.checkAdBlock()}authorizePlayer(e){let t=this._getPromiseDecorator(a.Mn.AUTHORIZE_PLAYER);return t||(t=this._createPromiseDecorator(a.Mn.AUTHORIZE_PLAYER),this._isPlayerAuthorized?this.#Ct(e).then((()=>{this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)})):this._platformSdk.userService.authorizeUser().then((()=>{this.#Ct(e).then((()=>{this._resolvePromiseDecorator(a.Mn.AUTHORIZE_PLAYER)}))})).catch((e=>{this._rejectPromiseDecorator(a.Mn.AUTHORIZE_PLAYER,e)}))),t.promise}paymentsPurchase(e,t){const r=this._paymentsGetProductPlatformData(e);if(!r)return Promise.reject();t&&t.externalId&&(r.externalId=t.externalId),r.externalId||(r.externalId=this._paymentsGenerateTransactionId(e)),r.bridgeId=e;let s=this._getPromiseDecorator(a.Mn.PURCHASE);if(!s){s=this._createPromiseDecorator(a.Mn.PURCHASE);const t=this._platformSdk;t.inGamePaymentsApi.purchase(r).then((r=>{if(\"PAID\"===r.status){const s={id:e,...r};this._paymentsPurchases.push(s),t.inGamePaymentsApi.confirmDelivery&&t.inGamePaymentsApi.confirmDelivery({orderId:r.orderId,externalId:s.externalId}).catch((()=>{})),this._resolvePromiseDecorator(a.Mn.PURCHASE,s)}else this._rejectPromiseDecorator(a.Mn.PURCHASE,r.error)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))}return s.promise}paymentsGetPurchases(){const e=this._platformSdk;if(e.inGamePaymentsApi.getPurchases){const t=this._createPromiseDecorator(a.Mn.GET_PURCHASES);return e.inGamePaymentsApi.getPurchases().then((e=>{this._paymentsPurchases=e.map((({bridgeId:e,...t})=>e?{...t,id:e}:t)),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((()=>{this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})),t.promise}return Promise.resolve(this._paymentsPurchases)}paymentsConsumePurchase(e){const t=this._paymentsPurchases.find((t=>t.id===e));if(!t)return Promise.reject();const r=this._platformSdk;if(r.inGamePaymentsApi.consumePurchase){const s=this._createPromiseDecorator(a.Mn.CONSUME_PURCHASE);return r.inGamePaymentsApi.consumePurchase(t.orderId,t.externalId).then((()=>{const t=this._paymentsPurchases.findIndex((t=>t.id===e));t>=0&&this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(a.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(a.Mn.CONSUME_PURCHASE,e)})),s.promise}return super.paymentsConsumePurchase(e)}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();const t=e.map((e=>({id:e.id,price:`${e.amount} Gam`,priceCurrencyCode:\"Gam\",priceCurrencyImage:\"https://games.playgama.com/assets/gold-fennec-coin-large.webp\",priceValue:e.amount})));return Promise.resolve(t)}share(e){const t=this._platformSdk?.socialService;if(\"function\"!=typeof t?.share)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.SHARE);return r||(r=this._createPromiseDecorator(a.Mn.SHARE),t.share(e).then((()=>{this._resolvePromiseDecorator(a.Mn.SHARE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.SHARE,e)}))),r.promise}addToHomeScreen(){const e=this._platformSdk?.socialService;if(\"function\"!=typeof e?.addToHomeScreen)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN);return t||(t=this._createPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN),e.addToHomeScreen().then((()=>{this._resolvePromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.ADD_TO_HOME_SCREEN,e)}))),t.promise}#Ct(e){const t=this._platformSdk;return\"function\"!=typeof t.userService?.getUser?(this._playerApplyGuestData(),Promise.resolve()):new Promise((e=>{t.userService.getUser().then((e=>{e.id&&(this._playerId=e.id),e.isAuthorized&&(this._isPlayerAuthorized=!0,this._playerName=e.name,this._playerPhotos=e.photos,this._playerExtra=e,this.#Jr&&this._setPlatformStorageAvailable(!0))})).catch((()=>{})).finally((()=>{e()}))}))}#Xr(){const e=this._platformSdk;e.platformService?.getIsPlayerAuthorizationSupported&&(this.#qr=e.platformService.getIsPlayerAuthorizationSupported()),e.platformService?.getIsCloudSaveSupported&&(this.#Jr=e.platformService.getIsCloudSaveSupported()),this.#Qr&&this._setPlatformStorageAvailable(this.#Jr),e.platformService?.getIsPaymentsSupported&&(this.#mr=e.platformService.getIsPaymentsSupported());const{socialService:t}=e;this.#Yr=t?.getIsShareSupported?.()??!1,this.#$r=t?.getIsAddToHomeScreenSupported?.()??!1}get#Qr(){return!0===this._options.storage?.allowAnonymousCloudSave}#xt(){return this.#Jr&&(this.#Qr||this._isPlayerAuthorized)?Promise.resolve():Promise.reject()}}const l=d},7789:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.POKI}get isPlatformExternalCallsSupported(){return!1}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isClipboardSupported(){return!1}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://game-cdn.poki.com/scripts/v2/poki-sdk.js\").then((()=>{(0,i.X_)(\"PokiSDK\",\"init\").then((()=>{this._platformSdk=window.PokiSDK,this._platformSdk.init().then((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}))),e.promise}sendMessage(e){const t=this._platformSdk;switch(e){case o.Dt.GAME_READY:return t.gameLoadingFinished(),Promise.resolve();case o.Dt.GAMEPLAY_STARTED:case o.Dt.LEVEL_STARTED:case o.Dt.LEVEL_RESUMED:return t.gameplayStart(),Promise.resolve();case o.Dt.GAMEPLAY_STOPPED:case o.Dt.LEVEL_PAUSED:case o.Dt.LEVEL_COMPLETED:case o.Dt.LEVEL_FAILED:return t.gameplayStop(),Promise.resolve();default:return super.sendMessage(e)}}showInterstitial(){let e=!1;this._platformSdk.commercialBreak((()=>{e=!0,this._setInterstitialState(n.WA.OPENED)})).then((()=>{e?this._setInterstitialState(n.WA.CLOSED):this._showAdFailurePopup(!1)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(){let e=!1;this._platformSdk.rewardedBreak((()=>{e=!0,this._setRewardedState(n.b3.OPENED)})).then((t=>{e?(t&&this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)):this._showAdFailurePopup(!0)})).catch((()=>{this._showAdFailurePopup(!0)}))}}const l=d},6328:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221);class d extends s.Z{get platformId(){return o.Lb.PORTAL}get isPaymentsSupported(){return!0}get platformLanguage(){return this._platformSdk.getLocale()||super.platformLanguage}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://storage.googleapis.com/social-networth/scripts/sdk.umd.js\").then((()=>{(0,i.X_)(\"PortalSDK\").then((()=>{this._platformSdk=window.PortalSDK;const e=this._platformSdk;e.initialize().then((()=>{e.initializeOverlay(),this._setPlatformStorageAvailable(!0),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.INITIALIZE,e)}))}))}))),e.promise}async getDataFromStorage(e){const t=this._platformSdk,r={};return await Promise.all(e.map((async e=>{const s=await Promise.resolve(t.getValue(e));null!=s&&\"\"!==s&&(r[e]=s)}))),r}setDataToStorage(e){const t=this._platformSdk;return Promise.all(Object.keys(e).map((r=>Promise.resolve(t.setValue(r,e[r]))))).then((()=>{}))}deleteDataFromStorage(e){const t=this._platformSdk;return Promise.all(e.map((e=>Promise.resolve(t.removeValue(e))))).then((()=>{}))}showInterstitial(){this._platformSdk.requestAd().then((()=>{this._setInterstitialState(n.WA.OPENED),this._setInterstitialState(n.WA.CLOSED)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(){this._platformSdk.requestRewardAd().then((e=>{e?(this._setRewardedState(n.b3.OPENED),this._setRewardedState(n.b3.REWARDED),this._setRewardedState(n.b3.CLOSED)):this._showAdFailurePopup(!0)})).catch((()=>{this._showAdFailurePopup(!0)}))}sendMessage(e,t){return e===o.Dt.GAME_READY?(this._platformSdk.gameReady(),Promise.resolve()):super.sendMessage(e,t)}paymentsPurchase(e){const t=this._paymentsGetProductPlatformData(e);let r=this._getPromiseDecorator(a.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(a.Mn.PURCHASE);const s=t?.id,i=this._platformSdk;Promise.resolve(i.getShopItems()).then((e=>{const t=e.find((e=>e&&e.id===s));if(!t)throw new Error(\"Shop item not found in catalog\");return i.openPurchaseConfirmModal(t)})).then((t=>{if(!t||\"success\"!==t.status)throw new Error(\"Purchase failed\");{const r={id:e,...t};this._paymentsPurchases.push(r),this._resolvePromiseDecorator(a.Mn.PURCHASE,r)}})).catch((e=>{this._rejectPromiseDecorator(a.Mn.PURCHASE,e)}))}return r.promise}paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e||!Array.isArray(e)||0===e.length)return Promise.reject(new Error(\"No platform products available\"));let t=this._getPromiseDecorator(a.Mn.GET_CATALOG);if(!t){t=this._createPromiseDecorator(a.Mn.GET_CATALOG);const r=this._platformSdk;Promise.resolve(r.getShopItems()).then((t=>{if(!Array.isArray(t))throw new Error(\"Catalog response is not an array\");const r=e.map((e=>{const r=e.id,s=t.find((e=>e&&e.id===r));return s?{id:e.id,name:s.name,price:`${s.price} Gems`,priceCurrencyCode:\"Gems\",priceValue:s.price}:null})).filter(Boolean);this._resolvePromiseDecorator(a.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_CATALOG,e)}))}return t.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(a.Mn.GET_PURCHASES);if(!e){e=this._createPromiseDecorator(a.Mn.GET_PURCHASES);const t=this._platformSdk;Promise.resolve(t.getPurchasedShopItems()).then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.map((e=>{const r=e.id,s=t.find((e=>e.id===r));if(!s)return null;return{id:s.id,...e}})).filter((e=>null!==e)),this._resolvePromiseDecorator(a.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(a.Mn.GET_PURCHASES,e)}))}return e.promise}}const l=d},1298:(e,t,r)=>{r.r(t),r.d(t,{ACTION_NAME_QA:()=>I,SUPPORTED_FEATURES:()=>U,default:()=>Z});var s=r(8166),i=r(1558),a=r(5095),o=r(8960);class n{send(e,t=\"*\"){(0,o.n_)(e,t)}addListener(e){window.addEventListener(\"message\",e)}removeListener(e){window.removeEventListener(\"message\",e)}generateMessageId(){return`${Date.now()}-${Math.random()}`}}var d=r(5230);const l=class{#es=0;#ts=null;#rs=[];#ss=null;#is=null;#as=null;#os=null;#ns=null;set onOffer(e){this.#is=e}set onIceCandidate(e){this.#as=e}set onStarted(e){this.#os=e}set onError(e){this.#ns=e}checkAvailability(){return this.#ds()?this.#ls()?this.#hs()?{available:!0,reason:null}:{available:!1,reason:\"Canvas not found\"}:{available:!1,reason:\"captureStream is not supported\"}:{available:!1,reason:\"RTCPeerConnection is not supported\"}}async startCapture(e={}){const{available:t,reason:r}=this.checkAvailability();if(!t)return void this.#ns?.(r);const s=this.#hs();if(!s)return;this.#es+=1;const i=this.#es;this.#cs();const a=s.captureStream(e.fps||30);let o,n;this.#ss=a;try{o=e.iceServers?.length?new RTCPeerConnection({iceServers:e.iceServers}):new RTCPeerConnection}catch(e){throw this.#cs(),e}if(this.#ts=o,e.contentHint){const t=a.getVideoTracks()[0];t&&(t.contentHint=e.contentHint)}a.getTracks().forEach((e=>o.addTrack(e,a))),o.onicecandidate=e=>{e.candidate&&this.#us(i,o)&&this.#as?.(e.candidate.toJSON())};try{if(n=await o.createOffer(),!this.#us(i,o))return;if(await o.setLocalDescription(n),!this.#us(i,o))return}catch(e){if(!this.#us(i,o))return;throw this.#cs(),e}this.#ps(o,e),this.#is?.(n.sdp),this.#os?.()}async handleAnswer({sdp:e}){const t=this.#ts;if(!t)return;if(await t.setRemoteDescription(new RTCSessionDescription({type:\"answer\",sdp:e})),t!==this.#ts)return;const r=this.#rs;this.#rs=[],await Promise.all(r.map((e=>t.addIceCandidate(new RTCIceCandidate(e)))))}async handleIce(e){const t=this.#ts;t&&e&&(t.remoteDescription?await t.addIceCandidate(new RTCIceCandidate(e)):this.#rs.push(e))}takeScreenshot(e={}){const t=this.#hs();return t?this.#ms(t,t.width,t.height,e,t):{success:!1,reason:\"Canvas not found\",data:null}}async takeScreenshotFromSurface(e={}){const t=this.#hs();if(!t)return{success:!1,reason:\"Canvas not found\",data:null};if(0===t.width||0===t.height)return{success:!1,reason:\"Canvas has no drawable area\",data:null};if(\"function\"!=typeof t.captureStream)return this.takeScreenshot(e);let r=null,s=null;try{r=t.captureStream(30);const i=r.getVideoTracks()[0];return i?(s=document.createElement(\"video\"),s.srcObject=r,s.muted=!0,s.playsInline=!0,await this.#_s(s,i),this.#ms(s,s.videoWidth,s.videoHeight,e)):{success:!1,reason:\"Canvas capture has no video track\",data:null}}catch(e){return{success:!1,reason:e&&\"object\"==typeof e&&\"message\"in e?String(e.message):\"Screenshot capture failed\",data:null}}finally{s?.pause(),s&&(s.srcObject=null),r?.getTracks().forEach((e=>e.stop()))}}stopCapture(){this.#es+=1,this.#cs()}#cs(){this.#ss?.getTracks().forEach((e=>e.stop())),this.#ts?.close(),this.#ts=null,this.#rs=[],this.#ss=null}#ms(e,t,r,{type:s=\"image/png\",quality:i=.92,maxWidth:a,maxHeight:o}={},n=null){if(0===t||0===r)return{success:!1,reason:\"Screenshot source has no drawable area\",data:null};try{const d=this.#gs(e,t,r,a,o,n);if(!d)return{success:!1,reason:\"Canvas context is not available\",data:null};const l=Number.isFinite(i)?Math.min(1,Math.max(0,i)):.92,h=d.toDataURL(s,l);return\"data:,\"===h?{success:!1,reason:\"Canvas produced an empty screenshot\",data:null}:{success:!0,reason:null,data:h}}catch(e){return{success:!1,reason:e&&\"object\"==typeof e&&\"message\"in e?String(e.message):\"Screenshot capture failed\",data:null}}}#gs(e,t,r,s,i,a){const o=\"number\"==typeof s&&Number.isFinite(s)&&s>0?s:t,n=\"number\"==typeof i&&Number.isFinite(i)&&i>0?i:r,d=Math.min(1,o/t,n/r);if(1===d&&a)return a;const l=document.createElement(\"canvas\");l.width=Math.max(1,Math.round(t*d)),l.height=Math.max(1,Math.round(r*d));const h=l.getContext(\"2d\");return h?(h.drawImage(e,0,0,l.width,l.height),l):null}#ps(e,{maxBitrate:t,minBitrate:r,maxFramerate:s,scaleResolutionDownBy:i,priority:a,networkPriority:o,scalabilityMode:n}){e.getSenders().forEach((e=>{if(\"video\"!==e.track?.kind)return;const d=e.getParameters();if(d.encodings?.length||(d.encodings=[{}]),void 0!==t&&(d.encodings[0].maxBitrate=t),void 0!==r&&(d.encodings[0].minBitrate=r),void 0!==s&&(d.encodings[0].maxFramerate=s),void 0!==i&&(d.encodings[0].scaleResolutionDownBy=i),void 0!==a&&(d.encodings[0].priority=a),void 0!==o&&(d.encodings[0].networkPriority=o),void 0!==n){d.encodings[0].scalabilityMode=n}e.setParameters(d)}))}#us(e,t){return e===this.#es&&t===this.#ts}#hs(){return document.querySelector(\"canvas\")}#ds(){return\"undefined\"!=typeof RTCPeerConnection}#ls(){return\"function\"==typeof HTMLCanvasElement.prototype.captureStream}#_s(e,t){return new Promise(((r,s)=>{const i=[];let a=null,o=!1;const n=e=>{o||(o=!0,i.forEach((e=>e())),e())},d=()=>n((()=>s(new Error(\"Canvas capture ended before its first frame\")))),l=()=>n(r),h=setTimeout((()=>n((()=>s(new Error(\"Canvas capture produced no video frames\"))))),1e3);i.push((()=>clearTimeout(h))),t.addEventListener(\"ended\",d,{once:!0}),i.push((()=>t.removeEventListener(\"ended\",d))),\"function\"==typeof e.requestVideoFrameCallback?(a=e.requestVideoFrameCallback((()=>n(r))),i.push((()=>{null!==a&&\"function\"==typeof e.cancelVideoFrameCallback&&e.cancelVideoFrameCallback(a)}))):(e.addEventListener(\"loadeddata\",l,{once:!0}),i.push((()=>e.removeEventListener(\"loadeddata\",l)))),Promise.resolve(e.play()).then((()=>{\"function\"!=typeof e.requestVideoFrameCallback&&e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&n(r)})).catch((e=>n((()=>s(e)))))}))}};var h=r(8902),c=r(3806),u=r(9221),p=r(7408);const m=\"interstitial\",_=\"reward\",g=\"banner\",S=\"advanced\",A=\"bridge\",E=\"platform_internal\",f=\"liveness\",P=\"recorder\",I={GET_DATA_FROM_STORAGE:\"get_data_from_storage\",SET_DATA_TO_STORAGE:\"set_data_to_storage\",DELETE_DATA_FROM_STORAGE:\"delete_data_from_storage\",GET_SERVER_TIME:\"get_server_time\",CHECK_ADBLOCK:\"check_adblock\",CLIPBOARD_READ:\"clipboard_read\",LIVENESS_PING:\"ping\",UNLOCK_ACHIEVEMENT:\"unlock_achievement\",GET_ACHIEVEMENTS:\"get_achievements\",GET_PERFORMANCE_RESOURCES:\"get_performance_resources\",GET_LANGUAGE:\"get_language\",GET_PLAYER:\"get_player\",AUDIO_STATE:\"audio_state\",PAUSE_STATE:\"pause_state\",CLEAN_CACHE:\"clean_cache\",SHOW_ADVANCED_BANNERS:\"show_advanced_banners\",HIDE_ADVANCED_BANNERS:\"hide_advanced_banners\",CROSS_PROMO_SHOWN:\"cross_promo_shown\",DAILY_REWARDS_CLAIMED:\"daily_rewards_claimed\",DAILY_REWARDS_STREAK_RESET:\"daily_rewards_streak_reset\",TASKS_REWARD_CLAIMED:\"tasks_reward_claimed\",TASKS_PERIOD_ROLLED_OVER:\"tasks_period_rolled_over\"},y=\"start_capture\",D=\"stop_capture\",T=\"rtc_offer\",w=\"rtc_answer\",v=\"rtc_ice\",R=\"capture_started\",b=\"capture_error\",C=\"take_screenshot\",L=\"screenshot_result\",O=\"start\",M=\"open\",N=\"close\",k=\"failed\",H=\"start\",B=\"open\",G=\"rewarded\",F=\"close\",x=\"failed\",U={PLAYER_AUTHORIZATION:\"isPlayerAuthorizationSupported\",PAYMENTS:\"isPaymentsSupported\",REMOTE_CONFIG:\"isRemoteConfigSupported\",SOCIAL_SHARE:\"isShareSupported\",SOCIAL_JOIN_COMMUNITY:\"isJoinCommunitySupported\",SOCIAL_INVITE_FRIENDS:\"isInviteFriendsSupported\",SOCIAL_CREATE_POST:\"isCreatePostSupported\",SOCIAL_ADD_TO_FAVORITES:\"isAddToFavoritesSupported\",SOCIAL_ADD_TO_HOME_SCREEN:\"isAddToHomeScreenSupported\",SOCIAL_RATE:\"isRateSupported\",BANNER:\"isBannerSupported\",INTERSTITIAL:\"isInterstitialSupported\",REWARDED:\"isRewardedSupported\",CLIPBOARD:\"isClipboardSupported\",ADVANCED_BANNERS:\"isAdvancedBannersSupported\",ACHIEVEMENTS:\"isAchievementsSupported\"};class V extends s.Z{get platformId(){return c.Lb.QA_TOOL}get platformLanguage(){return this.#Ss({type:h.oF.PLATFORM,action:I.GET_LANGUAGE,options:{language:this._platformLanguage}}),this._platformLanguage??super.platformLanguage}get platformTld(){return this._platformTld}get deviceType(){return this._deviceType??super.deviceType}get platformPayload(){return this._platformPayload}get isPlayerAuthorizationSupported(){return this._supportedFeatures.includes(U.PLAYER_AUTHORIZATION)}get isBannerSupported(){return this._supportedFeatures.includes(U.BANNER)}get isAdvancedBannersSupported(){return this._supportedFeatures.includes(U.ADVANCED_BANNERS)}get isInterstitialSupported(){return this._supportedFeatures.includes(U.INTERSTITIAL)}get isRewardedSupported(){return this._supportedFeatures.includes(U.REWARDED)}get isAchievementsSupported(){return this._supportedFeatures.includes(U.ACHIEVEMENTS)}get isInviteFriendsSupported(){return this._supportedFeatures.includes(U.SOCIAL_INVITE_FRIENDS)}get isJoinCommunitySupported(){return this._supportedFeatures.includes(U.SOCIAL_JOIN_COMMUNITY)}get isShareSupported(){return this._supportedFeatures.includes(U.SOCIAL_SHARE)}get isCreatePostSupported(){return this._supportedFeatures.includes(U.SOCIAL_CREATE_POST)}get isAddToHomeScreenSupported(){return this._supportedFeatures.includes(U.SOCIAL_ADD_TO_HOME_SCREEN)}get isAddToFavoritesSupported(){return this._supportedFeatures.includes(U.SOCIAL_ADD_TO_FAVORITES)}get isRateSupported(){return this._supportedFeatures.includes(U.SOCIAL_RATE)}get isPaymentsSupported(){return this._supportedFeatures.includes(U.PAYMENTS)}get isRemoteConfigSupported(){return this._supportedFeatures.includes(U.REMOTE_CONFIG)}get isClipboardSupported(){return this._supportedFeatures.includes(U.CLIPBOARD)}get leaderboardsType(){return this._leaderboardsType??p.Z.NOT_AVAILABLE}get safeArea(){return null}_supportedFeatures=[];_leaderboardsType=null;_platformLanguage;_platformTld=null;_platformPayload=null;_deviceType=null;_isPlatformStorageAvailable=!0;engine=\"javascript\";#As=new n;#Es=new l;#fs=new a.Z((()=>this.#Ps()));initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(h.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(h.Mn.INITIALIZE),this.on(h.W1.AUDIO_STATE_CHANGED,(e=>{this.#Ss({type:h.oF.PLATFORM,action:I.AUDIO_STATE,options:{isEnabled:e}})})),this.on(h.W1.PAUSE_STATE_CHANGED,(e=>{this.#Ss({type:h.oF.PLATFORM,action:I.PAUSE_STATE,options:{isPaused:e}})})),i.ZP.on(h.W1.CROSS_PROMO_SHOWN,(e=>{this.#Ss({type:h.oF.CROSS_PROMO,action:I.CROSS_PROMO_SHOWN,options:{...e}})})),i.ZP.on(h.W1.DAILY_REWARDS_CLAIMED,(e=>{this.#Ss({type:h.oF.DAILY_REWARDS,action:I.DAILY_REWARDS_CLAIMED,options:{...e}})})),i.ZP.on(h.W1.DAILY_REWARDS_STREAK_RESET,(e=>{this.#Ss({type:h.oF.DAILY_REWARDS,action:I.DAILY_REWARDS_STREAK_RESET,options:{...e}})})),i.ZP.on(h.W1.TASKS_REWARD_CLAIMED,(e=>{this.#Ss({type:h.oF.TASKS,action:I.TASKS_REWARD_CLAIMED,options:{...e}})})),i.ZP.on(h.W1.TASKS_PERIOD_ROLLED_OVER,(e=>{this.#Ss({type:h.oF.TASKS,action:I.TASKS_PERIOD_ROLLED_OVER,options:{...e}})}));const t=e=>{const t=e.data;if(t?.type&&t?.source!==A)if(t.type===h.oF.PLATFORM)if(t.action===h.Mn.INITIALIZE)this.#Ct().then((()=>{this.#Is(t)}));else if(t.action===I.AUDIO_STATE)this.#ys(t);else if(t.action===I.PAUSE_STATE)this.#Ds(t);else if(t.action===I.GET_PERFORMANCE_RESOURCES){const e=this.#As.generateMessageId(),r=t?.options?.resources||[];this.#Ts(e,r)}else t.action===I.CLEAN_CACHE&&this.#ws();else t.type===h.oF.ADVERTISEMENT?this.#vs(t):t.type===P&&this.#Rs(t)};this.#As.addListener(t),this.#bs(),this.#Ss({type:h.oF.PLATFORM,action:h.Mn.INITIALIZE,payload:{engine:this.engine,version:\"2.1.0\",configFile:{loadingStatus:d.ZP.loadStatus,parsingStatus:d.ZP.parseStatus,loadError:d.ZP.loadError,parseError:d.ZP.parseError,options:d.ZP.getRawValues(),resolvedOptions:d.ZP.getValues(),path:d.ZP.path,remoteLoadStatus:d.ZP.remoteLoadStatus,remoteLoadError:d.ZP.remoteLoadError,remoteAppliedSource:d.ZP.remoteAppliedSource}}})}return e.promise}authorizePlayer(e){let t=this._getPromiseDecorator(h.Mn.AUTHORIZE_PLAYER);return t||(t=this._createPromiseDecorator(h.Mn.AUTHORIZE_PLAYER),this.#Cs(h.oF.PLAYER,h.Mn.AUTHORIZE_PLAYER,{options:e}).then((e=>{const{auth:t}=e;\"success\"===t.status?this.#Ct().then((()=>{this._resolvePromiseDecorator(h.Mn.AUTHORIZE_PLAYER)})):this._rejectPromiseDecorator(h.Mn.AUTHORIZE_PLAYER,t.error)}))),t.promise}sendMessage(e,t={}){const r=[c.Dt.GAME_READY,c.Dt.LEVEL_STARTED,c.Dt.LEVEL_COMPLETED,c.Dt.LEVEL_FAILED,c.Dt.LEVEL_PAUSED,c.Dt.LEVEL_RESUMED,c.Dt.IN_GAME_LOADING_STARTED,c.Dt.IN_GAME_LOADING_STOPPED,c.Dt.GAMEPLAY_STARTED,c.Dt.GAMEPLAY_STOPPED,c.Dt.PLAYER_GOT_ACHIEVEMENT];return\"string\"==typeof e&&r.includes(e)?(this.#Ss({type:h.oF.PLATFORM,action:e,options:t}),Promise.resolve()):super.sendMessage(e,t)}getServerTime(){return this.#fs.getServerTime()}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await this.#Cs(h.oF.STORAGE,I.GET_DATA_FROM_STORAGE,{options:{key:e,storageType:E}}).then((t=>{const{storage:r}=t;return r&&r[e]}));null!=r&&\"\"!==r&&(t[e]=r)}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>(this.#Ss({type:h.oF.STORAGE,action:I.SET_DATA_TO_STORAGE,options:{key:t,value:e[t],storageType:E}}),Promise.resolve())))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>(this.#Ss({type:h.oF.STORAGE,action:I.DELETE_DATA_FROM_STORAGE,options:{key:e,storageType:E}}),Promise.resolve())))).then((()=>{}))}showInterstitial(e){this.isInterstitialSupported&&this.#Ss({type:h.oF.ADVERTISEMENT,action:m,options:{placement:e}})}showRewarded(e){this.isRewardedSupported&&this.#Ss({type:h.oF.ADVERTISEMENT,action:_,options:{placement:e}})}showBanner(e,t){this.isBannerSupported&&(this._setBannerState(u.Kk.SHOWN),this.#Ss({type:h.oF.ADVERTISEMENT,action:u.Kk.SHOWN,options:{type:g,position:e,placement:t}}))}hideBanner(){this.isBannerSupported&&(this._setBannerState(u.Kk.HIDDEN),this.#Ss({type:h.oF.ADVERTISEMENT,action:u.Kk.HIDDEN,options:{type:g}}))}showAdvancedBanners(e){this.isAdvancedBannersSupported&&(this._setAdvancedBannersState(u.Kk.LOADING),this.#Ss({type:h.oF.ADVERTISEMENT,action:I.SHOW_ADVANCED_BANNERS,options:{banners:e}}))}hideAdvancedBanners(){this.isAdvancedBannersSupported&&(this._setAdvancedBannersState(u.Kk.HIDDEN),this.#Ss({type:h.oF.ADVERTISEMENT,action:I.HIDE_ADVANCED_BANNERS}))}checkAdBlock(){return this.#Ss({type:I.CHECK_ADBLOCK,action:h.Mn.ADBLOCK_DETECT}),super.checkAdBlock()}inviteFriends(){let e=this._getPromiseDecorator(h.Mn.INVITE_FRIENDS);return e||(e=this._createPromiseDecorator(h.Mn.INVITE_FRIENDS),this._resolvePromiseDecorator(h.Mn.INVITE_FRIENDS),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.INVITE_FRIENDS})),e.promise}joinCommunity(){let e=this._getPromiseDecorator(h.Mn.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(h.Mn.JOIN_COMMUNITY),this._resolvePromiseDecorator(h.Mn.JOIN_COMMUNITY),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.JOIN_COMMUNITY})),e.promise}share(){let e=this._getPromiseDecorator(h.Mn.SHARE);return e||(e=this._createPromiseDecorator(h.Mn.SHARE),this._resolvePromiseDecorator(h.Mn.SHARE),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.SHARE})),e.promise}createPost(){let e=this._getPromiseDecorator(h.Mn.CREATE_POST);return e||(e=this._createPromiseDecorator(h.Mn.CREATE_POST),this._resolvePromiseDecorator(h.Mn.CREATE_POST),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.CREATE_POST})),e.promise}addToHomeScreen(){let e=this._getPromiseDecorator(h.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(h.Mn.ADD_TO_HOME_SCREEN),this._resolvePromiseDecorator(h.Mn.ADD_TO_HOME_SCREEN),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.ADD_TO_HOME_SCREEN})),e.promise}addToFavorites(){let e=this._getPromiseDecorator(h.Mn.ADD_TO_FAVORITES);return e||(e=this._createPromiseDecorator(h.Mn.ADD_TO_FAVORITES),this._resolvePromiseDecorator(h.Mn.ADD_TO_FAVORITES),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.ADD_TO_FAVORITES})),e.promise}rate(){let e=this._getPromiseDecorator(h.Mn.RATE);return e||(e=this._createPromiseDecorator(h.Mn.RATE),this._resolvePromiseDecorator(h.Mn.RATE),this.#Ss({type:h.oF.SOCIAL,action:h.Mn.RATE})),e.promise}paymentsPurchase(e,t){let r=this._getPromiseDecorator(h.Mn.PURCHASE);if(!r){r=this._createPromiseDecorator(h.Mn.PURCHASE);const s=t?.externalId||this._paymentsGenerateTransactionId(e),i={id:e,externalId:s};this.#Cs(h.oF.PAYMENTS,h.Mn.PURCHASE,{options:{product:i}}).then((t=>{const{purchase:r}=t;if(r&&\"object\"==typeof r)if(r?.status){const t={id:e,...r.purchaseData};this._paymentsPurchases.push(t),this._resolvePromiseDecorator(h.Mn.PURCHASE,t)}else this._rejectPromiseDecorator(h.Mn.PURCHASE,r?.error||new Error(\"Unknown purchase error\"));else this._rejectPromiseDecorator(h.Mn.PURCHASE,new Error(\"Invalid purchase\"))}))}return r.promise}paymentsConsumePurchase(e){const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(h.Mn.CONSUME_PURCHASE);return r||(r=this._createPromiseDecorator(h.Mn.CONSUME_PURCHASE),this.#Cs(h.oF.PAYMENTS,h.Mn.CONSUME_PURCHASE,{options:{product:this._paymentsPurchases[t]}}).then((r=>{const{purchase:s}=r;if(s&&\"object\"==typeof s)if(s?.status){const r={id:e,...s};this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(h.Mn.CONSUME_PURCHASE,r)}else this._rejectPromiseDecorator(h.Mn.CONSUME_PURCHASE,s?.error||new Error(\"Unknown consume purchase error\"));else this._rejectPromiseDecorator(h.Mn.CONSUME_PURCHASE,new Error(\"Invalid purchase\"))}))),r.promise}paymentsGetCatalog(){let e=this._getPromiseDecorator(h.Mn.GET_CATALOG);return e||(e=this._createPromiseDecorator(h.Mn.GET_CATALOG),this.#Cs(h.oF.PAYMENTS,h.Mn.GET_CATALOG).then((e=>{const{payload:t}=e,r=t.products.map((e=>({id:e.id,price:`${e.price} ${e.currency}`,priceCurrencyCode:e.currency,priceCurrencyImage:e.priceCurrencyImage,priceValue:e.price})));this._resolvePromiseDecorator(h.Mn.GET_CATALOG,r)}))),e.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(h.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(h.Mn.GET_PURCHASES),this.#Cs(h.oF.PAYMENTS,h.Mn.GET_PURCHASES).then((e=>{const{purchases:t}=e;this._paymentsPurchases=t.map((e=>e.purchaseData)),this._resolvePromiseDecorator(h.Mn.GET_PURCHASES,this._paymentsPurchases)}))),e.promise}getRemoteConfig(){let e=this._getPromiseDecorator(h.Mn.GET_REMOTE_CONFIG);return e||(e=this._createPromiseDecorator(h.Mn.GET_REMOTE_CONFIG),this.#Cs(h.oF.REMOTE_CONFIG,h.Mn.GET_REMOTE_CONFIG).then((e=>{const{result:t}=e;this._resolvePromiseDecorator(h.Mn.GET_REMOTE_CONFIG,t)}))),e.promise}clipboardWrite(e){let t=this._getPromiseDecorator(h.Mn.CLIPBOARD_WRITE);return t||(t=this._createPromiseDecorator(h.Mn.CLIPBOARD_WRITE),this.#Cs(h.oF.CLIPBOARD,h.Mn.CLIPBOARD_WRITE,{options:{text:e}}).then((()=>{this._resolvePromiseDecorator(h.Mn.CLIPBOARD_WRITE,!0)}))),t.promise}clipboardRead(){let e=this._getPromiseDecorator(I.CLIPBOARD_READ);return e||(e=this._createPromiseDecorator(I.CLIPBOARD_READ),this.#Cs(h.oF.CLIPBOARD,I.CLIPBOARD_READ,{options:{}}).then((e=>{const{text:t}=e;this._resolvePromiseDecorator(I.CLIPBOARD_READ,t)}))),e.promise}leaderboardsSetScore(e,t,r){let s=this._getPromiseDecorator(h.Mn.LEADERBOARDS_SET_SCORE);if(!s){s=this._createPromiseDecorator(h.Mn.LEADERBOARDS_SET_SCORE);const r={id:e,score:t};this.#Ss({type:h.oF.LEADERBOARDS,action:h.Mn.LEADERBOARDS_SET_SCORE,options:r}),this._resolvePromiseDecorator(h.Mn.LEADERBOARDS_SET_SCORE)}return s.promise}leaderboardsGetEntries(e){let t=this._getPromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES);return t||(t=this._createPromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES),this.#Cs(h.oF.LEADERBOARDS,h.Mn.LEADERBOARDS_GET_ENTRIES,{options:{id:e}},{timeout:5e3}).then((e=>{const{entries:t}=e;this._resolvePromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES,t)})).catch((()=>{this._rejectPromiseDecorator(h.Mn.LEADERBOARDS_GET_ENTRIES)}))),t.promise}leaderboardsShowNativePopup(e){return this.#Ss({type:h.oF.LEADERBOARDS,action:h.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP,options:{id:e}}),Promise.resolve(h.Mn.LEADERBOARDS_SHOW_NATIVE_POPUP)}achievementsUnlock(e){return this.isAchievementsSupported?this.#Cs(h.oF.ACHIEVEMENTS,I.UNLOCK_ACHIEVEMENT,{options:{achievement:e}}).then((e=>e.result)):Promise.reject()}achievementsGetList(){return this.isAchievementsSupported?this.#Cs(h.oF.ACHIEVEMENTS,I.GET_ACHIEVEMENTS,{options:{}}).then((e=>e.result??[])):Promise.reject()}#Is(e){this._supportedFeatures=e.supportedFeatures||[],this._isBannerSupported=this._supportedFeatures.includes(U.BANNER),this._isAdvancedBannersSupported=this._supportedFeatures.includes(U.ADVANCED_BANNERS);const t=e.config??{};this._deviceType=t.deviceType??super.deviceType,this._platformLanguage=t.platformLanguage?t.platformLanguage.toLowerCase():super.platformLanguage,this._platformTld=t.platformTld??super.platformTld,this._platformPayload=t.platformPayload??super.platformPayload,this._leaderboardsType=t.leaderboardsType??p.Z.NOT_AVAILABLE,this._paymentsPurchases=e.purchases||[],this._isInitialized=!0,this._resolvePromiseDecorator(h.Mn.INITIALIZE),this.#Ss({type:f,action:I.LIVENESS_PING,options:{version:\"2.1.0\"}})}#ys(e){this._setAudioState(e.options.isEnabled)}#Ds(e){this._setPauseState(e.options.isPaused)}#Ts(e,t=[]){const r=Array.isArray(t)?t:[],s=performance.getEntriesByType(\"resource\")||[],i=r.length>0?r:[\"name\",\"initiatorType\"],a=s.map((e=>{const t={};return i.forEach((r=>{r in e&&(t[r]=e[r])})),t}));return this.#Ss({type:h.oF.PLATFORM,action:I.GET_PERFORMANCE_RESOURCES,id:e,options:{resources:a}}),Promise.resolve(s)}#Ss(e){this.#As.send({source:A,...e})}#Ps(){return this.#Cs(h.oF.PLATFORM,I.GET_SERVER_TIME,{options:{}},{timeout:5e3}).then((e=>{const{time:t}=e;if(!t)throw new Error(\"Invalid server time\");return t})).catch((()=>{throw new Error(\"Server time request timeout\")}))}#Cs(e,t,r={},s={}){const i=this.#As.generateMessageId(),a={timeout:0,...s};return new Promise(((o,n)=>{const d=r=>{const s=r.data;s?.type===e&&s?.action===t&&s?.id===i&&s?.source!==A&&(this.#As.removeListener(d),o(s))};this.#As.addListener(d),this.#Ss({type:e,action:t,id:i,options:s,...r}),(a.timeout??0)>0&&setTimeout((()=>{n(new Error(\"Request timeout\")),this.#As.removeListener(d)}),a.timeout)}))}async#Ct(){return this.#Cs(h.oF.PLAYER,I.GET_PLAYER).then((e=>{const{player:t}=e;t?.isAuthorized&&(this._playerId=t.userId??null,this._isPlayerAuthorized=!!t.isAuthorized,this._playerName=t.name??null,Array.isArray(t.photos)&&(this._playerPhotos=[...t.photos]),this._playerExtra=t)})).catch((()=>{}))}#vs(e){const{action:t,payload:r}=e,s=r?.status;if(t===m){if(!this.isInterstitialSupported)return;switch(s){case O:this._setInterstitialState(u.WA.LOADING);break;case M:this._setInterstitialState(u.WA.OPENED);break;case k:this._showAdFailurePopup(!1);break;case N:this._setInterstitialState(u.WA.CLOSED)}}else if(t===_){if(!this.isRewardedSupported)return;switch(s){case H:this._setRewardedState(u.b3.LOADING);break;case B:this._setRewardedState(u.b3.OPENED);break;case G:this._setRewardedState(u.b3.REWARDED);break;case F:this._setRewardedState(u.b3.CLOSED);break;case x:this._showAdFailurePopup(!0)}}else if(t===S)switch(s){case u.Kk.SHOWN:this._setAdvancedBannersState(u.Kk.SHOWN);break;case u.Kk.HIDDEN:this._setAdvancedBannersState(u.Kk.HIDDEN);break;case u.Kk.FAILED:this._setAdvancedBannersState(u.Kk.FAILED);break;case u.Kk.LOADING:this._setAdvancedBannersState(u.Kk.LOADING)}}#Rs(e){switch(e.action){case y:this.#Es.startCapture(e.options||{});break;case D:this.#Es.stopCapture();break;case w:this.#Es.handleAnswer(e.options);break;case v:this.#Es.handleIce(e.options);break;case C:this.#Es.takeScreenshotFromSurface(e.options).then((t=>{this.#Ss({type:P,action:L,id:e.id,payload:t})}))}}#bs(){this.#Es.onOffer=e=>{this.#Ss({type:P,action:T,payload:{sdp:e}})},this.#Es.onIceCandidate=e=>{this.#Ss({type:P,action:v,payload:e})},this.#Es.onStarted=()=>{this.#Ss({type:P,action:R})},this.#Es.onError=e=>{this.#Ss({type:P,action:b,payload:{message:e}})}}#ws(){\"unity\"===this.engine&&indexedDB.deleteDatabase(\"UnityCache\")}}const Z=V},6539:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var s=r(8166),i=r(8902),a=r(3806);class o extends s.Z{get platformId(){return a.Lb.REDDIT}get isPlatformExternalCallsSupported(){return!1}get isJoinCommunitySupported(){return!0}get isCreatePostSupported(){return!0}get isPaymentsSupported(){return!0}initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(i.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(i.Mn.INITIALIZE),this.#Ls(\"/api/initialize\").then((e=>{const t=e||{};this._isPlayerAuthorized=!!t.isPlayerAuthorized,this._isPlayerAuthorized&&(this._playerId=t.playerId??null,this._playerName=t.playerName??null,t.playerPhoto&&this._playerPhotos.push(t.playerPhoto),this._setPlatformStorageAvailable(!0)),this._isInitialized=!0,this._resolvePromiseDecorator(i.Mn.INITIALIZE)})).catch((e=>{this._rejectPromiseDecorator(i.Mn.INITIALIZE,e)}))),e.promise}async getDataFromStorage(e){await this.#xt();const t={};return await Promise.all(e.map((async e=>{const r=await this.#Ls(\"/api/storage/get\",{method:\"POST\",body:{key:e}});null!=r&&\"\"!==r&&(t[e]=r)}))),t}async setDataToStorage(e){return await this.#xt(),Promise.all(Object.keys(e).map((t=>this.#Ls(\"/api/storage/set\",{method:\"POST\",body:{key:t,value:e[t]}})))).then((()=>{}))}async deleteDataFromStorage(e){return await this.#xt(),Promise.all(e.map((e=>this.#Ls(\"/api/storage/delete\",{method:\"POST\",body:{key:e}})))).then((()=>{}))}checkAdBlock(){return Promise.resolve(!1)}paymentsPurchase(e){const t=\"undefined\"!=typeof window&&window.__playgama_devvit?window.__playgama_devvit.purchase:null;if(\"function\"!=typeof t)return Promise.reject(new Error(\"window.__playgama_devvit.purchase is not registered. Set window.__playgama_devvit = { purchase } using purchase() from @devvit/web/client before calling bridge.initialize().\"));let r=this._getPromiseDecorator(i.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(i.Mn.PURCHASE),Promise.resolve(t(e)).then((t=>{const r=t&&\"object\"==typeof t?{...t}:{};r.id||(r.id=e),this._paymentsPurchases.push(r),this._resolvePromiseDecorator(i.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(i.Mn.PURCHASE,e)}))),r.promise}paymentsGetCatalog(){if(!this._paymentsGetProductsPlatformData())return Promise.reject();let e=this._getPromiseDecorator(i.Mn.GET_CATALOG);return e||(e=this._createPromiseDecorator(i.Mn.GET_CATALOG),this.#Ls(\"/api/catalog\").then((e=>{this._resolvePromiseDecorator(i.Mn.GET_CATALOG,this.#Os(e))})).catch((e=>{this._rejectPromiseDecorator(i.Mn.GET_CATALOG,e)}))),e.promise}paymentsGetPurchases(){let e=this._getPromiseDecorator(i.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(i.Mn.GET_PURCHASES),this.#Ls(\"/api/purchases\").then((e=>{this._resolvePromiseDecorator(i.Mn.GET_PURCHASES,this.#Os(e))})).catch((e=>{this._rejectPromiseDecorator(i.Mn.GET_PURCHASES,e)}))),e.promise}createPost(e={}){let t=this._getPromiseDecorator(i.Mn.CREATE_POST);return t||(t=this._createPromiseDecorator(i.Mn.CREATE_POST),this.#Ls(\"/api/create-post\",{method:\"POST\",body:{options:e}}).then((()=>{this._resolvePromiseDecorator(i.Mn.CREATE_POST)})).catch((e=>{this._rejectPromiseDecorator(i.Mn.CREATE_POST,e)}))),t.promise}joinCommunity(){let e=this._getPromiseDecorator(i.Mn.JOIN_COMMUNITY);return e||(e=this._createPromiseDecorator(i.Mn.JOIN_COMMUNITY),this.#Ls(\"/api/join-community\",{method:\"POST\"}).then((()=>{this._resolvePromiseDecorator(i.Mn.JOIN_COMMUNITY)})).catch((e=>{this._rejectPromiseDecorator(i.Mn.JOIN_COMMUNITY,e)}))),e.promise}#xt(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}#Os(e){if(Array.isArray(e))return e;const t=e?.data;return Array.isArray(t)?t:[]}#Ls(e,{method:t=\"GET\",body:r}={}){const s={},i={method:t,headers:s};return void 0!==r&&(s[\"Content-Type\"]=\"application/json\",i.body=JSON.stringify(r)),fetch(e,i).then((r=>r.ok?r.text().then((e=>{if(!e)return null;try{return JSON.parse(e)}catch{return null}})):r.text().then((s=>{const i=s?`: ${s}`:\"\";throw new Error(`${t} ${e} failed (${r.status})${i}`)}))))}}const n=o},9793:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(1302),o=r(8902),n=r(3806),d=r(9221);function l(e){if(e&&\"object\"==typeof e)return e.err}class h extends s.Z{get platformId(){return n.Lb.SAMSUNG}get platformLanguage(){return this.#Ms||super.platformLanguage}get isPlayerAuthorizationSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isAddToHomeScreenSupported(){return this.#Ns}get isPlatformExternalLinksAllowed(){return!1}#Ms=null;#Ns=!1;#ks=!1;#Hs=!1;#Bs=!1;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(o.Mn.INITIALIZE);(void 0!==window.GSInstant?Promise.resolve():(0,i.ZT)(\"https://gtg.samsungapps.com/gsinstant-sdk/gsinstant.0.45.js\")).then((()=>(0,i.X_)(\"GSInstant\"))).then((()=>(this._platformSdk=window.GSInstant,this._platformSdk.initializeAsync()))).then((e=>{if(l(e))throw new Error(`Samsung initializeAsync failed: ${l(e)}`);const t=this._platformSdk,r=t.getLocale();\"string\"==typeof r&&r.length>=2&&(this.#Ms=r.substring(0,2).toLowerCase());const s=t.canCreateShortCut();return this.#Ns=Boolean(s)&&!l(s),t.setOnPauseCallback((()=>{this._setPauseState(!0)})),t.setOnResumeCallback((()=>{this._setPauseState(!1)})),this.#Gs()})).then((()=>(this.#Fs(),this._platformSdk.startGameAsync()))).then((e=>{if(l(e))throw new Error(`Samsung startGameAsync failed: ${l(e)}`);this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.INITIALIZE,e)}))}return e.promise}authorizePlayer(){if(this._isPlayerAuthorized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);if(!e){e=this._createPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);const t=this._platformSdk;t.loginAsync().catch((e=>{if(!e||\"ALREADY_LOGGED_IN\"!==e.err)throw e})).then((()=>t.player.getPlayerIdAsync())).then((e=>{this._isPlayerAuthorized=!0,this._playerId=e,this._setPlatformStorageAvailable(!0),this._resolvePromiseDecorator(o.Mn.AUTHORIZE_PLAYER)})).catch((e=>{const t=e&&e.err||(\"string\"==typeof e?e:\"samsung_auth_failed\");this._rejectPromiseDecorator(o.Mn.AUTHORIZE_PLAYER,new Error(String(t)))}))}return e.promise}async getDataFromStorage(e){await this.#xt();const t={};return await Promise.all(e.map((async e=>{const r=await this._platformSdk.getDataAsync([e]),s=r&&void 0!==r[e]?r[e]:null;null!=s&&\"\"!==s&&(t[e]=\"string\"==typeof s?s:JSON.stringify(s))}))),t}async setDataToStorage(e){return await this.#xt(),Promise.all(Object.keys(e).map((t=>this._platformSdk.setDataAsync({[t]:e[t]})))).then((()=>{}))}async deleteDataFromStorage(e){return await this.#xt(),Promise.all(e.map((e=>this._platformSdk.setDataAsync({[e]:null})))).then((()=>{}))}preloadInterstitial(){if(!this.#ks)return;const e=this._platformSdk.advertisement2.loadAd({adFormat:\"INTERSTITIAL\"});l(e)&&a.ZP.warn(\"Samsung loadAd(INTERSTITIAL) error:\",l(e))}showInterstitial(){if(!this.#ks)return void this._showAdFailurePopup(!1);this.#Hs=!1,this.#Bs=!0;const e=this._platformSdk.advertisement2.showAd({adFormat:\"INTERSTITIAL\"});l(e)&&(a.ZP.warn(\"Samsung showAd(INTERSTITIAL) error:\",l(e)),this.#Bs=!1,this._showAdFailurePopup(!1))}preloadRewarded(){if(!this.#ks)return;const e=this._platformSdk.advertisement2.loadAd({adFormat:\"REWARD\"});l(e)&&a.ZP.warn(\"Samsung loadAd(REWARD) error:\",l(e))}showRewarded(){if(!this.#ks)return void this._showAdFailurePopup(!0);this.#Hs=!0,this.#Bs=!0;const e=this._platformSdk.advertisement2.showAd({adFormat:\"REWARD\"});l(e)&&(a.ZP.warn(\"Samsung showAd(REWARD) error:\",l(e)),this.#Bs=!1,this._showAdFailurePopup(!0))}addToHomeScreen(){const e=l(this._platformSdk.createShortCut());return e?Promise.reject(new Error(String(e))):Promise.resolve()}#xt(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}#Gs(){const e=this._platformSdk,t=e.getLoginStatus();return t&&!t.err&&\"LOGIN\"===t.result?e.player.getPlayerIdAsync().then((e=>{this._isPlayerAuthorized=!0,this._playerId=e,this._setPlatformStorageAvailable(!0)})).catch((()=>{this._isPlayerAuthorized=!1,this._playerApplyGuestData()})):(this._isPlayerAuthorized=!1,this._playerApplyGuestData(),Promise.resolve())}#Fs(){const e=this._platformSdk.advertisement2;if(!e||\"function\"!=typeof e.initAd)return void a.ZP.warn(\"Samsung advertisement2 API not available on this Galaxy Store Client\");const t=this._options,r={},s=this.#xs(\"interstitial\");s&&(r.samsungInterstitialAdPlacementId=s);const i=this.#xs(\"rewarded\");if(i&&(r.samsungRewardedAdPlacementId=i),t.admobInterstitialAdUnitId&&(r.admobInterstitialAdUnitId=t.admobInterstitialAdUnitId),t.admobRewardedAdUnitId&&(r.admobRewardedAdUnitId=t.admobRewardedAdUnitId),t.gameTitle&&(r.gameTitle=t.gameTitle),0===Object.keys(r).length)return;const o=e.initAd(r);l(o)?a.ZP.warn(\"Samsung ad init error:\",l(o)):(this.#ks=!0,e.addEventListener(\"AD_START\",(()=>{this.#Bs&&(this.#Hs?this._setRewardedState(d.b3.OPENED):this._setInterstitialState(d.WA.OPENED))})),e.addEventListener(\"AD_COMPLETE\",(()=>{this.#Bs&&(this.#Hs?(this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED)):this._setInterstitialState(d.WA.CLOSED),this.#Bs=!1)})),e.addEventListener(\"AD_SKIP\",(()=>{this.#Bs&&(this.#Hs?this._setRewardedState(d.b3.CLOSED):this._setInterstitialState(d.WA.CLOSED),this.#Bs=!1)})),e.addEventListener(\"AD_CLOSE\",(()=>{this.#Bs&&(this.#Hs?this._setRewardedState(d.b3.CLOSED):this._setInterstitialState(d.WA.CLOSED),this.#Bs=!1)})),e.addEventListener(\"AD_LOAD_ERROR\",(()=>{this.#Bs&&(this._showAdFailurePopup(this.#Hs),this.#Bs=!1)})),e.addEventListener(\"AD_SHOW_ERROR\",(()=>{this.#Bs&&(this._showAdFailurePopup(this.#Hs),this.#Bs=!1)})),e.addEventListener(\"AD_VIDEO_ERROR\",(()=>{this.#Bs&&(this._showAdFailurePopup(this.#Hs),this.#Bs=!1)})))}#xs(e){const t=this._options.advertisement,r=t?.[e],s=r?.placements;if(!Array.isArray(s)||0===s.length)return null;const i=r?.placementFallback;if(i){const e=s.find((e=>e.id===i));if(e?.[n.Lb.SAMSUNG])return e[n.Lb.SAMSUNG]}const a=s.find((e=>e[n.Lb.SAMSUNG]));return a?.[n.Lb.SAMSUNG]??null}}const c=h},8200:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var s=r(3153),i=r(3806),a=r(1147);const o=\"USD\";class n extends s.default{get platformId(){return i.Lb.STANDALONE}get sdkUrl(){return\"https://playgama.com/platform-sdk/wrap.v1.js\"}get sdkGlobalName(){return\"PLAYGAMA_WRAP\"}get isPlatformExternalLinksAllowed(){return!0}_isAdvancedBannersSupported=!0;paymentsGetCatalog(){const e=this._paymentsGetProductsPlatformData();if(!e)return Promise.reject();const t=e.map((e=>{const{price:t,currency:r}=this.#Us(e);return{id:e.id,price:null!==t?`${t} ${r}`:null,priceCurrencyCode:null!==t?r:null,priceValue:t}}));return Promise.resolve(t)}#Us(e){const t=this.#Vs(e.amount);if(null!==t){return{price:t,currency:\"string\"==typeof e.currency&&\"\"!==e.currency?e.currency:o}}const r=(0,a.iv)(this._options.payments,i.Lb.PLAYGAMA,e.id),s=this.#Vs(r?.amount);return null!==s?{price:s/10,currency:o}:{price:null,currency:o}}#Vs(e){if(\"number\"==typeof e&&Number.isFinite(e))return e;if(\"string\"==typeof e&&\"\"!==e){const t=Number(e);if(Number.isFinite(t))return t}return null}}const d=n},6465:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(66),d=r(9221);const l=\"clipboard_read\";class h extends s.Z{get platformId(){return o.Lb.TELEGRAM}get platformLanguage(){return this._platformSdk?this._platformSdk.initDataUnsafe.user.language_code:super.platformLanguage}get isInterstitialSupported(){return!!this.#Zs}get isRewardedSupported(){return!!this.#Zs}get deviceType(){switch(this.#js){case\"android\":case\"android_x\":case\"ios\":return n.me.MOBILE;case\"tdesktop\":case\"unigram\":case\"macos\":return n.me.DESKTOP;default:return super.deviceType}}get deviceOs(){switch(this.#js){case\"android\":case\"android_x\":return n.Lh.ANDROID;case\"ios\":return n.Lh.IOS;case\"macos\":return n.Lh.MACOS;default:return super.deviceOs}}get isPlayerAuthorizationSupported(){return!0}_isPlatformStorageAvailable=!0;_isPlayerAuthorized=!0;#js;#Zs;#zs={onStart:()=>this._setRewardedState(d.b3.OPENED),onSkip:()=>this._setRewardedState(d.b3.CLOSED),onReward:()=>this._setRewardedState(d.b3.REWARDED),onError:()=>this._showAdFailurePopup(!0)};#Ws={onStart:()=>this._setInterstitialState(d.WA.OPENED),onSkip:()=>this._setInterstitialState(d.WA.CLOSED),onError:()=>this._showAdFailurePopup(!1)};initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),(0,i.ZT)(\"https://telegram.org/js/telegram-web-app.js\").then((()=>{this._platformSdk=window.Telegram.WebApp;const e=this._platformSdk,{initDataUnsafe:t}=e,r=t.user;this._playerId=String(r.id),this._playerName=[r.first_name,r.last_name].filter(Boolean).join(\" \"),this._playerPhotos=r.photo_url?[r.photo_url]:[],this.#js=e.platform,this._isInitialized=!0,this._options&&this._options.adsgramBlockId?(0,i.ZT)(\"https://sad.adsgram.ai/js/sad.min.js\").then((()=>{this.#Zs=window.Adsgram.init({blockId:this._options.adsgramBlockId})})).finally((()=>{this._resolvePromiseDecorator(a.Mn.INITIALIZE)})):this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?(this._platformSdk.ready(),Promise.resolve()):super.sendMessage(e,t)}getDataFromStorage(e){return new Promise(((t,r)=>{if(!e||0===e.length)return void t({});this._platformSdk.CloudStorage.getItems(e,((s,i)=>{if(s)return void r(s);const a={};e.forEach((e=>{const t=i?i[e]:void 0;null!=t&&\"\"!==t&&(a[e]=t)})),t(a)}))}))}setDataToStorage(e){const t=this._platformSdk;return Promise.all(Object.keys(e).map((r=>new Promise(((s,i)=>{t.CloudStorage.setItem(r,e[r],(e=>{e?i(e):s()}))}))))).then((()=>{}))}deleteDataFromStorage(e){const t=this._platformSdk;return Promise.all(e.map((e=>new Promise(((r,s)=>{t.CloudStorage.removeItem(e,(e=>{e?s(e):r()}))}))))).then((()=>{}))}showInterstitial(){if(!this.#Zs)return void this._showAdFailurePopup(!1);const e=this.#Zs;e.addEventListener(\"onStart\",this.#Ws.onStart),e.addEventListener(\"onSkip\",this.#Ws.onSkip),e.addEventListener(\"onError\",this.#Ws.onError),e.addEventListener(\"onBannerNotFound\",this.#Ws.onError),e.show().finally((()=>{e.removeEventListener(\"onStart\",this.#Ws.onStart),e.removeEventListener(\"onSkip\",this.#Ws.onSkip),e.removeEventListener(\"onError\",this.#Ws.onError),e.removeEventListener(\"onBannerNotFound\",this.#Ws.onError)}))}showRewarded(){if(!this.#Zs)return void this._showAdFailurePopup(!0);const e=this.#Zs;e.addEventListener(\"onStart\",this.#zs.onStart),e.addEventListener(\"onSkip\",this.#zs.onSkip),e.addEventListener(\"onReward\",this.#zs.onReward),e.addEventListener(\"onError\",this.#zs.onError),e.addEventListener(\"onBannerNotFound\",this.#zs.onError),e.show().finally((()=>{e.removeEventListener(\"onStart\",this.#zs.onStart),e.removeEventListener(\"onSkip\",this.#zs.onSkip),e.removeEventListener(\"onReward\",this.#zs.onReward),e.removeEventListener(\"onError\",this.#zs.onError),e.removeEventListener(\"onBannerNotFound\",this.#zs.onError)}))}clipboardRead(){let e=this._getPromiseDecorator(l);return e||(e=this._createPromiseDecorator(l),this._platformSdk.readTextFromClipboard((e=>{e?this._resolvePromiseDecorator(l,e):this._rejectPromiseDecorator(l)}))),e.promise}}const c=h},755:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(8960),a=r(3941),o=r(8902),n=r(3806),d=r(66),l=r(9221);class h extends s.Z{get platformId(){return n.Lb.TIKTOK}get platformLanguage(){return this.#Ks?this.#Ks.language:super.platformLanguage}get isPlayerAuthorizationSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"login\"))}get isInterstitialSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"createInterstitialAd\"))}get isRewardedSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"createRewardedVideoAd\"))}get isAddToHomeScreenSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"addShortcut\"))}get isAddToHomeScreenRewardSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"getShortcutMissionReward\"))}get isAddToFavoritesSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"startEntranceMission\"))}get isAddToFavoritesRewardSupported(){const e=this._platformSdk;return!(!e||!e.canIUse(\"getEntranceMissionReward\"))}get safeArea(){return this.#Ys?{top:this.#Ys.bottom,bottom:0,left:0,right:0}:null}get deviceType(){if(this.#Ks){const{platform:e}=this.#Ks;if(\"ios\"===e||\"android\"===e)return d.me.MOBILE}return super.deviceType}get deviceOs(){if(this.#Ks){const{platform:e}=this.#Ks;if(\"android\"===e)return d.Lh.ANDROID;if(\"ios\"===e)return d.Lh.IOS}return super.deviceOs}get isClipboardSupported(){return!1}#Ks=null;#Ys=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(o.Mn.INITIALIZE),(0,i.X_)(\"TTMinis\").then((()=>{this._platformSdk=window.TTMinis.game;const e=this._platformSdk;this._options&&this._options.clientKey?(e.init({clientKey:this._options.clientKey}),e.canIUse(\"getStorage\")&&this._setPlatformStorageAvailable(!0),e.canIUse(\"getSystemInfoSync\")&&(this.#Ks=e.getSystemInfoSync()),e.canIUse(\"getMenuButtonBoundingClientRect\")&&(this.#Ys=e.getMenuButtonBoundingClientRect()),e.canIUse(\"onShow\")&&e.onShow((()=>{this._setVisibilityState(n.YU.VISIBLE)})),e.canIUse(\"onHide\")&&e.onHide((()=>{this._setVisibilityState(n.YU.HIDDEN)})),this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE)):this._rejectPromiseDecorator(o.Mn.INITIALIZE,o.pn.GAME_PARAMS_NOT_FOUND)}))),e.promise}sendMessage(e,t){if(e===n.Dt.GAME_READY){const e=this._platformSdk;return e.canIUse(\"setLoadingProgress\")&&e.setLoadingProgress({progress:1}),Promise.resolve()}return super.sendMessage(e)}authorizePlayer(){let e=this._getPromiseDecorator(o.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(o.Mn.AUTHORIZE_PLAYER),this._platformSdk.login({success:()=>{const e=(0,a.m)();this._playerId=e.id,this._playerName=e.name,this._isPlayerAuthorized=!0,this._resolvePromiseDecorator(o.Mn.AUTHORIZE_PLAYER)},fail:e=>{this._rejectPromiseDecorator(o.Mn.AUTHORIZE_PLAYER,e)}})),e.promise}async getDataFromStorage(e){const t={};return await Promise.all(e.map((async e=>{const r=await this.#$s(e).catch((()=>{}));null!=r&&\"\"!==r&&(t[e]=r)}))),t}setDataToStorage(e){return Promise.all(Object.keys(e).map((t=>this.#qs(t,e[t])))).then((()=>{}))}deleteDataFromStorage(e){return Promise.all(e.map((e=>this.#Js(e)))).then((()=>{}))}showInterstitial(e){const t=this._platformSdk.createInterstitialAd({adUnitId:e});t.onClose((()=>{this._setInterstitialState(l.WA.CLOSED)})),t.onError((()=>{this._showAdFailurePopup(!1)})),t.show().then((()=>{this._setInterstitialState(l.WA.OPENED)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(e){const t=this._platformSdk.createRewardedVideoAd({adUnitId:e});t.onClose((e=>{e&&e.isEnded&&this._setRewardedState(l.b3.REWARDED),this._setRewardedState(l.b3.CLOSED)})),t.onError((()=>{this._showAdFailurePopup(!0)})),t.show().then((()=>{this._setRewardedState(l.b3.OPENED)})).catch((()=>{this._showAdFailurePopup(!0)}))}addToHomeScreen(){let e=this._getPromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN),this._platformSdk.addShortcut({success:()=>{this._resolvePromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN)},fail:e=>{this._rejectPromiseDecorator(o.Mn.ADD_TO_HOME_SCREEN,e)}})),e.promise}getAddToHomeScreenReward(){return new Promise(((e,t)=>{this._platformSdk.getShortcutMissionReward({success:r=>{r?.canReceiveReward?e(void 0):t()},fail:()=>{t()}})}))}addToFavorites(){let e=this._getPromiseDecorator(o.Mn.ADD_TO_FAVORITES);return e||(e=this._createPromiseDecorator(o.Mn.ADD_TO_FAVORITES),this._platformSdk.startEntranceMission({success:()=>{this._resolvePromiseDecorator(o.Mn.ADD_TO_FAVORITES)},fail:e=>{this._rejectPromiseDecorator(o.Mn.ADD_TO_FAVORITES,e)}})),e.promise}getAddToFavoritesReward(){return new Promise(((e,t)=>{this._platformSdk.getEntranceMissionReward({success:r=>{r?.canReceiveReward?e(void 0):t()},fail:()=>{t()}})}))}#$s(e){return new Promise(((t,r)=>{this._platformSdk.getStorage({key:e,success:e=>t(e.data),fail:e=>r(e)})}))}#qs(e,t){return new Promise(((r,s)=>{this._platformSdk.setStorage({key:e,data:\"object\"==typeof t?JSON.stringify(t):t,success:()=>{r()},fail:e=>{s(e)}})}))}#Js(e){return new Promise(((t,r)=>{this._platformSdk.removeStorage({key:e,success:()=>{t()},fail:e=>{r(e)}})}))}}const c=h},7226:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(66),d=r(9221);class l extends s.Z{get platformId(){return o.Lb.VK}get platformLanguage(){const e=new URL(window.location.href);if(e.searchParams.has(\"language\")){const t=e.searchParams.get(\"language\");let r=0;try{r=parseInt(t,10)}catch(e){r=0}switch(r){case 0:default:return\"ru\";case 1:return\"uk\";case 2:return\"be\";case 3:return\"en\"}}return super.platformLanguage}get platformPayload(){const e=new URL(window.location.href);return e.searchParams.has(\"hash\")?e.searchParams.get(\"hash\"):super.platformPayload}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get deviceType(){switch(this.#js){case\"html5_ios\":case\"html5_android\":case\"html5_mobile\":return n.me.MOBILE;case\"web\":return n.me.DESKTOP;default:return super.deviceType}}get isPlayerAuthorizationSupported(){return!0}get isPlayerAuthorized(){return!0}get isInviteFriendsSupported(){return!0}get isJoinCommunitySupported(){return!0}get isShareSupported(){return!0}get isAddToHomeScreenSupported(){return\"html5_android\"===this.#js}get isAddToFavoritesSupported(){return!0}_isBannerSupported=!0;#js=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);if(!e){e=this._createPromiseDecorator(a.Mn.INITIALIZE);const t=new URL(window.location.href);t.searchParams.has(\"platform\")&&(this.#js=t.searchParams.get(\"platform\")),(0,i.ZT)(\"https://unpkg.com/@vkontakte/vk-bridge/dist/browser.min.js\").then((()=>{(0,i.X_)(\"vkBridge\").then((()=>{this._platformSdk=window.vkBridge,this._platformSdk.send(\"VKWebAppInit\").then((()=>{this._platformSdk.send(\"VKWebAppGetUserInfo\").then((e=>{e&&(this._playerId=e.id,this._playerName=`${e.first_name} ${e.last_name}`,e.photo_100&&this._playerPhotos.push(e.photo_100),e.photo_200&&this._playerPhotos.push(e.photo_200),e.photo_max_orig&&this._playerPhotos.push(e.photo_max_orig))})).finally((()=>{this._isInitialized=!0,this._setPlatformStorageAvailable(!0),this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))}))}))}))}return e.promise}authorizePlayer(){return Promise.resolve()}async getDataFromStorage(e){const t=this._platformSdk,r=await t.send(\"VKWebAppStorageGet\",{keys:e}),s={};return r.keys.forEach((e=>{\"\"!==e.value&&(s[e.key]=e.value)})),s}setDataToStorage(e){const t=this._platformSdk;return Promise.all(Object.keys(e).map((r=>t.send(\"VKWebAppStorageSet\",{key:r,value:e[r]})))).then((()=>{}))}deleteDataFromStorage(e){const t=this._platformSdk;return Promise.all(e.map((e=>t.send(\"VKWebAppStorageSet\",{key:e,value:\"\"})))).then((()=>{}))}showBanner(e){this._platformSdk.send(\"VKWebAppShowBannerAd\",{banner_location:e}).then((e=>{e.result?this._setBannerState(d.Kk.SHOWN):this._setBannerState(d.Kk.FAILED)})).catch((()=>{this._setBannerState(d.Kk.FAILED)}))}hideBanner(){this._platformSdk.send(\"VKWebAppHideBannerAd\").then((e=>{e.result&&this._setBannerState(d.Kk.HIDDEN)}))}showInterstitial(){this._platformSdk.send(\"VKWebAppCheckNativeAds\",{ad_format:\"interstitial\"}).then((e=>{e.result&&this._setInterstitialState(d.WA.OPENED)})).finally((()=>{this._platformSdk.send(\"VKWebAppShowNativeAds\",{ad_format:\"interstitial\"}).then((e=>{e.result?this._setInterstitialState(d.WA.CLOSED):this._showAdFailurePopup(!1)})).catch((()=>{this._showAdFailurePopup(!1)}))}))}showRewarded(){this._platformSdk.send(\"VKWebAppCheckNativeAds\",{ad_format:\"reward\",use_waterfall:!0}).then((e=>{e.result&&this._setRewardedState(d.b3.OPENED)})).finally((()=>{this._platformSdk.send(\"VKWebAppShowNativeAds\",{ad_format:\"reward\",use_waterfall:!0}).then((e=>{e.result?(this._setRewardedState(d.b3.REWARDED),this._setRewardedState(d.b3.CLOSED)):this._showAdFailurePopup(!0)})).catch((()=>{this._showAdFailurePopup(!0)}))}))}inviteFriends(){return this.#Xs(a.Mn.INVITE_FRIENDS,\"VKWebAppShowInviteBox\",{},\"success\")}joinCommunity(e){if(!e||!e.groupId)return Promise.reject();const{groupId:t,...r}=e;let s=t;return\"string\"==typeof s&&(s=parseInt(s,10),Number.isNaN(s))?Promise.reject():this.#Xs(a.Mn.JOIN_COMMUNITY,\"VKWebAppJoinGroup\",{...r,group_id:s}).then((()=>{window.open(`https://vk.com/public${s}`)}))}share(e){const{url:t,...r}=e??{},s={...r};return t&&(s.link=t),this.#Xs(a.Mn.SHARE,\"VKWebAppShare\",s,\"type\")}addToHomeScreen(){return this.#Xs(a.Mn.ADD_TO_HOME_SCREEN,\"VKWebAppAddToHomeScreen\")}addToFavorites(){return this.#Xs(a.Mn.ADD_TO_FAVORITES,\"VKWebAppAddToFavorites\")}clipboardWrite(e){return this.#Xs(a.Mn.CLIPBOARD_WRITE,\"VKWebAppCopyText\",{text:e}).then((()=>{}))}#Xs(e,t,r={},s=\"result\"){let i=this._getPromiseDecorator(e);return i||(i=this._createPromiseDecorator(e),this._platformSdk.send(t,r).then((t=>{t[s]?this._resolvePromiseDecorator(e):this._rejectPromiseDecorator(e)})).catch((t=>{this._rejectPromiseDecorator(e,t)}))),i.promise}}const h=l},7121:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var s=r(8166),i=r(1302),a=r(8902),o=r(3806),n=r(9221),d=r(8960),l=r(8467);class h extends s.Z{get platformId(){return o.Lb.XIAOMI}get isBannerSupported(){return!0}get isInterstitialSupported(){return!0}get initialInterstitialDelay(){return 30}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}#Qs=null;#ei=null;initialize(){if(this._isInitialized)return Promise.resolve();try{window.funmax&&window.funmax.loadStart&&window.funmax.loadStart()}catch(e){i.ZP.error(\"Xiaomi error:\",e)}let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.adSenseId?(0,d.pb)({adSenseId:this._options.adSenseId,testMode:!!this._options.testMode}).then((e=>{this.#Qs=e})).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}sendMessage(e,t){return e===o.Dt.GAME_READY?new Promise((e=>{try{window.funmax&&window.funmax.loadReady&&window.funmax.loadReady()}catch(e){i.ZP.error(\"Xiaomi error:\",e)}e(void 0)})):super.sendMessage(e,t)}showBanner(e,t){if(this.#ei)return;this.#ei=(0,l.kM)(e);const r=this.#Ht(t);this.#ei.appendChild(r),this._setBannerState(n.Kk.SHOWN)}hideBanner(){this.#ei?.remove(),this.#ei=null,this._setBannerState(n.Kk.HIDDEN)}showInterstitial(e){this.#Qs?this.#Qs({type:\"start\",name:e,beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{this.interstitialState!==n.WA.FAILED&&this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e.breakStatus&&this._showAdFailurePopup(!1)}}):this._showAdFailurePopup(!1)}showRewarded(e){this.#Qs?this.#Qs({type:\"reward\",name:e,beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this.rewardedState!==n.b3.FAILED&&this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e(0)},adDismissed:()=>{},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e.breakStatus&&\"other\"!==e.breakStatus||this._showAdFailurePopup(!0)}}):this._showAdFailurePopup(!0)}#Ht(e){const t=document.createElement(\"ins\");return t.style.display=\"block\",t.classList.add(\"adsbygoogle\"),t.setAttribute(\"data-ad-client\",this._options.adSenseId),t.setAttribute(\"data-ad-slot\",e),t.setAttribute(\"data-ad-format\",\"auto\"),t.setAttribute(\"data-container-id\",n._g),t.setAttribute(\"data-full-width-responsive\",\"true\"),this._options.testMode&&t.setAttribute(\"data-adtest\",\"on\"),t}}const c=h},3369:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(8166),i=r(8960),a=r(8902),o=r(3806),n=r(9221),d=r(7408),l=r(5334);const h=\"userData\",c=\"6129580795478709\";class u extends s.Z{get platformId(){return o.Lb.Y8}get isInterstitialSupported(){return!0}get initialInterstitialDelay(){return 180}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isPlayerAuthorizationSupported(){return!0}get leaderboardsType(){return d.Z.IN_GAME}get isAchievementsSupported(){return!0}#Qs=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(a.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(a.Mn.INITIALIZE),this._options?.gameId?(0,i.ZT)(\"https://cdn.y8.com/api/sdk.js\").then((()=>{(0,i.X_)(\"ID\").then((()=>{this._platformSdk=window.ID,this._platformSdk.Event.subscribe(\"id.init\",(()=>{(0,i.pb)({adSenseId:this._options.channelId?`ca-pub-${c}`:this._options.adsenseId,channelId:this._options.channelId,hostId:`ca-host-pub-${c}`}).then((e=>{this.#Qs=e})),this._platformSdk.getLoginStatus((e=>{this.#_r(e),this._isInitialized=!0,this._resolvePromiseDecorator(a.Mn.INITIALIZE)}))})),this._platformSdk.init({appId:this._options.gameId})}))})):this._rejectPromiseDecorator(a.Mn.INITIALIZE,a.pn.GAME_PARAMS_NOT_FOUND)),e.promise}authorizePlayer(){return this._isPlayerAuthorized?Promise.resolve():new Promise(((e,t)=>{this._platformSdk.login((r=>{this.#_r(r),\"ok\"===r.status?e(void 0):t()}))}))}async getDataFromStorage(){return await this.#xt(),new Promise(((e,t)=>{this._platformSdk.api(\"user_data/retrieve\",\"POST\",{key:h},(r=>{if(r.error&&\"Key not found\"!==r.error)return void t(r);let s={};try{r.jsondata&&(s=JSON.parse(r.jsondata))}catch{s={}}e(s)}))}))}async setDataToStorage(e){await this.#xt();const t=await this.getDataFromStorage();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this.#ti(t)}async deleteDataFromStorage(e){await this.#xt();const t=await this.getDataFromStorage();e.forEach((e=>{delete t[e]})),await this.#ti(t)}showInterstitial(){this.#Qs?this.#Qs({type:\"start\",name:\"start-game\",beforeAd:()=>{this._setInterstitialState(n.WA.OPENED)},afterAd:()=>{const{interstitialState:e}=this;e!==n.WA.FAILED&&this._setInterstitialState(n.WA.CLOSED)},adBreakDone:e=>{\"viewed\"!==e.breakStatus&&this._showAdFailurePopup(!1)}}):this._showAdFailurePopup(!1)}showRewarded(){this.#Qs?this.#Qs({type:\"reward\",name:\"rewarded Ad\",beforeAd:()=>{this._setRewardedState(n.b3.OPENED)},afterAd:()=>{this.rewardedState!==n.b3.FAILED&&this._setRewardedState(n.b3.CLOSED)},beforeReward:e=>{e(0)},adDismissed:()=>{this._showAdFailurePopup(!0)},adViewed:()=>{this._setRewardedState(n.b3.REWARDED)},adBreakDone:e=>{\"frequencyCapped\"!==e.breakStatus&&\"other\"!==e.breakStatus||this._showAdFailurePopup(!0)}}):this._showAdFailurePopup(!0)}leaderboardsSetScore(e,t){if(!this._isPlayerAuthorized)return Promise.reject();let r=this._getPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);if(!r){r=this._createPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE);const s={table:e,points:t};this._platformSdk.GameAPI.Leaderboards.save(s,(({success:e,errormessage:t})=>{e?this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE):this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_SET_SCORE,t)}))}return r.promise}leaderboardsGetEntries(e){if(!this._isPlayerAuthorized)return Promise.reject();let t=this._getPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES);if(!t){t=this._createPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES);const r={table:e,mode:\"alltime\"};this._platformSdk.GameAPI.Leaderboards.listCustom(r,(({scores:e,success:t,errormessage:r})=>{if(t){const t=e.map((e=>({id:e.playerid,name:e.playername,score:e.points,rank:e.rank,photo:null})));this._resolvePromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES,t)}else this._rejectPromiseDecorator(a.Mn.LEADERBOARDS_GET_ENTRIES,r)}))}return t.promise}achievementsUnlock(e){if(!this._isPlayerAuthorized)return Promise.reject();const t=e;return t&&\"object\"==typeof t&&t.achievement&&t.achievementkey?new Promise((e=>{this._platformSdk.GameAPI.Achievements.save(t,(t=>{e(t)}))})):Promise.reject()}achievementsGetList(){return new Promise(((e,t)=>{this._platformSdk.GameAPI.Achievements.listCustom({},(r=>{if(r.success){const t=this._options.achievements;e(r.achievements.map((e=>({id:(0,l.dk)(t,o.Lb.Y8,(t=>t.achievementkey===e.achievementkey))??e.achievementkey,name:\"string\"==typeof e.achievement?e.achievement:void 0,description:\"string\"==typeof e.description?e.description:void 0,unlocked:!0===e.awarded}))))}else t(new Error(r.errorcode))}))}))}#xt(){return this._isPlayerAuthorized?Promise.resolve():Promise.reject()}#ti(e){return new Promise(((t,r)=>{this._platformSdk.api(\"user_data/submit\",\"POST\",{key:h,value:JSON.stringify(e)},(e=>{\"ok\"===e.status?t():r(e)}))}))}#_r(e){if(\"ok\"===e.status&&e.authResponse){this._isPlayerAuthorized=!0,this._setPlatformStorageAvailable(!0);const{pid:t,locale:r,nickname:s,first_name:i,last_name:a,avatars:o}=e.authResponse.details;t&&(this._playerId=t),this._platformLanguage=r,this._playerName=[i,a].filter((e=>!!e)).join(\" \")||s||null,this._playerPhotos=[];const{thumb_url:n,medium_url:d,large_url:l}=o;n&&this._playerPhotos.push(n),d&&this._playerPhotos.push(d),l&&this._playerPhotos.push(l)}}}const p=u},1323:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var s=r(8166),i=r(5095),a=r(1302),o=r(8960),n=r(8902),d=r(3806),l=r(66),h=r(9221),c=r(7408);class u extends s.Z{get platformId(){return d.Lb.YANDEX}get platformLanguage(){return this._platformSdk?this._platformSdk.environment.i18n.lang.toLowerCase():super.platformLanguage}get platformTld(){return this._platformSdk?this._platformSdk.environment.i18n.tld.toLowerCase():super.platformTld}get isPlatformGamesListSupported(){return!0}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get deviceType(){switch(this._platformSdk&&this._platformSdk.deviceInfo.type){case l.me.DESKTOP:return l.me.DESKTOP;case l.me.MOBILE:return l.me.MOBILE;case l.me.TABLET:return l.me.TABLET;case l.me.TV:return l.me.TV;default:return super.deviceType}}get isPlayerAuthorizationSupported(){return!0}get isAddToHomeScreenSupported(){return this.#$r}get isRateSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get leaderboardsType(){return c.Z.IN_GAME}get isPaymentsSupported(){return!0}get isRemoteConfigSupported(){return!0}_isPlatformStorageAvailable=!0;#$r=!1;#ri=null;#si=null;#ii=null;#fs=new i.Z((()=>Promise.resolve(this._platformSdk.serverTime())));initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(n.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(n.Mn.INITIALIZE),(0,o.ZT)(\"/sdk.js\").then((()=>{(0,o.X_)(\"YaGames\",\"init\").then((()=>{window.YaGames.init().then((e=>{this._platformSdk=e,this.#ii=this.#Ct();const t=this._platformSdk.features.PluginEngineDataReporterAPI?.report({engineName:\"\",engineVersion:\"\",pluginName:\"playgama-bridge\",pluginVersion:\"2.1.0\"}),r=this._platformSdk.shortcut.canShowPrompt().then((e=>{this.#$r=e.canShow})),s=new Promise((e=>{setTimeout(e,1e3)})),i=Promise.race([r,s]),a=this._platformSdk.getPayments().then((e=>{this.#si=e}));this._isBannerSupported=!0;const o=this._platformSdk.adv.getBannerAdvStatus().then((e=>{e.stickyAdvIsShowing&&this._setBannerState(h.Kk.SHOWN)}));this._platformSdk.on(\"game_api_pause\",(()=>{this._setPauseState(!0),this._setAudioState(!1)})),this._platformSdk.on(\"game_api_resume\",(()=>{this._setPauseState(!1),this._setAudioState(!0)})),Promise.all([t,i,a,o]).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(n.Mn.INITIALIZE)}))}))}))}))),e.promise}sendMessage(e){switch(e){case d.Dt.GAME_READY:return this._platformSdk.features.LoadingAPI?.ready(),Promise.resolve();case d.Dt.GAMEPLAY_STARTED:case d.Dt.LEVEL_STARTED:case d.Dt.LEVEL_RESUMED:return this._platformSdk.features.GameplayAPI?.start(),Promise.resolve();case d.Dt.GAMEPLAY_STOPPED:case d.Dt.LEVEL_PAUSED:case d.Dt.LEVEL_COMPLETED:case d.Dt.LEVEL_FAILED:return this._platformSdk.features.GameplayAPI?.stop(),Promise.resolve();default:return super.sendMessage(e)}}getServerTime(){return this.#fs.getServerTime()}getGamesList(){const{GamesAPI:e}=this._platformSdk.features;return e.getAllGames().then((({games:t})=>{const r=Array.isArray(t)?t:[];return Promise.all(r.map((t=>{const r=t.appID??t.id;return void 0===r?t:e.getGameByID(r).then((({game:e,isAvailable:r})=>({...t,...e,isAvailable:r}))).catch((()=>t))})))}))}authorizePlayer(){let e=this._getPromiseDecorator(n.Mn.AUTHORIZE_PLAYER);return e||(e=this._createPromiseDecorator(n.Mn.AUTHORIZE_PLAYER),this._isPlayerAuthorized?(this.#ii=this.#Ct(),this.#ii.then((()=>{this._resolvePromiseDecorator(n.Mn.AUTHORIZE_PLAYER)}))):this._platformSdk.auth.openAuthDialog().then((()=>{this.#ii=this.#Ct(),this.#ii.then((()=>{this._resolvePromiseDecorator(n.Mn.AUTHORIZE_PLAYER)}))})).catch((e=>{this._rejectPromiseDecorator(n.Mn.AUTHORIZE_PLAYER,e)}))),e.promise}async getDataFromStorage(){return await this.#xt(),this.#ri.getData()}async setDataToStorage(e){await this.#xt();const t=await this.#ri.getData();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this.#ri.setData(t)}async deleteDataFromStorage(e){await this.#xt();const t=await this.#ri.getData();e.forEach((e=>{delete t[e]})),await this.#ri.setData(t)}showBanner(){this._platformSdk.adv.showBannerAdv().then((e=>{e.stickyAdvIsShowing?this._setBannerState(h.Kk.SHOWN):this._setBannerState(h.Kk.FAILED)})).catch((()=>{this._setBannerState(h.Kk.FAILED)}))}hideBanner(){this._platformSdk.adv.hideBannerAdv().then((e=>{e.stickyAdvIsShowing||this._setBannerState(h.Kk.HIDDEN)}))}showInterstitial(){this._platformSdk.adv.showFullscreenAdv({callbacks:{onOpen:()=>{this._setInterstitialState(h.WA.OPENED)},onClose:e=>{e?this._setInterstitialState(h.WA.CLOSED):this._showAdFailurePopup(!1)},onError:e=>{a.ZP.error(\"Yandex interstitial error:\",e)}}})}showRewarded(){this._platformSdk.adv.showRewardedVideo({callbacks:{onOpen:()=>{this._setRewardedState(h.b3.OPENED)},onRewarded:()=>{this._setRewardedState(h.b3.REWARDED)},onClose:()=>{this._setRewardedState(h.b3.CLOSED)},onError:()=>{this._showAdFailurePopup(!0)}}})}checkAdBlock(){return new Promise((e=>{e(!1)}))}addToHomeScreen(){let e=this._getPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN);return e||(e=this._createPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN),this._platformSdk.shortcut.showPrompt().then((e=>{\"accepted\"!==e.outcome?this._rejectPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN):this._resolvePromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.ADD_TO_HOME_SCREEN,e)}))),e.promise}rate(){let e=this._getPromiseDecorator(n.Mn.RATE);return e||(e=this._createPromiseDecorator(n.Mn.RATE),this._platformSdk.feedback.canReview().then((e=>{e.value?this._platformSdk.feedback.requestReview().then((({feedbackSent:e})=>{e?this._resolvePromiseDecorator(n.Mn.RATE):this._rejectPromiseDecorator(n.Mn.RATE)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.RATE,e)})):this._rejectPromiseDecorator(n.Mn.RATE,e.reason)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.RATE,e)}))),e.promise}leaderboardsSetScore(e,t){if(!this._isPlayerAuthorized)return Promise.reject();let r=this._getPromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE);return r||(r=this._createPromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE),this._platformSdk.leaderboards.setScore(e,t).then((()=>{this._resolvePromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.LEADERBOARDS_SET_SCORE,e)}))),r.promise}leaderboardsGetEntries(e){let t=this._getPromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES);if(!t){t=this._createPromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES);const r={quantityTop:20};this._isPlayerAuthorized&&(r.includeUser=!0,r.quantityAround=3),this._platformSdk.leaderboards.getEntries(e,r).then((e=>{let t;t=e&&e.entries.length>0?e.entries.map((e=>({id:e.player.uniqueID,name:e.player.publicName,score:e.score,rank:e.rank,photo:e.player.getAvatarSrc(\"large\")}))):[],this._resolvePromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES,t)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.LEADERBOARDS_GET_ENTRIES,e)}))}return t.promise}paymentsPurchase(e){if(!this.#si)return Promise.reject();let t=this._paymentsGetProductPlatformData(e);t||(t={id:e});let r=this._getPromiseDecorator(n.Mn.PURCHASE);return r||(r=this._createPromiseDecorator(n.Mn.PURCHASE),this.#si.purchase(t).then((t=>{const r={id:e,...t.purchaseData};delete r.productID,this._paymentsPurchases.push(r),this._resolvePromiseDecorator(n.Mn.PURCHASE,r)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.PURCHASE,e)}))),r.promise}paymentsConsumePurchase(e){if(!this.#si)return Promise.reject();const t=this._paymentsPurchases.findIndex((t=>t.id===e));if(t<0)return Promise.reject();let r=this._getPromiseDecorator(n.Mn.CONSUME_PURCHASE);return r||(r=this._createPromiseDecorator(n.Mn.CONSUME_PURCHASE),this.#si.consumePurchase(this._paymentsPurchases[t].purchaseToken).then((()=>{this._paymentsPurchases.splice(t,1),this._resolvePromiseDecorator(n.Mn.CONSUME_PURCHASE,{id:e})})).catch((e=>{this._rejectPromiseDecorator(n.Mn.CONSUME_PURCHASE,e)}))),r.promise}paymentsGetCatalog(){if(!this.#si)return Promise.reject();const e=this._paymentsGetProductsPlatformData();let t=this._getPromiseDecorator(n.Mn.GET_CATALOG);return t||(t=this._createPromiseDecorator(n.Mn.GET_CATALOG),this.#si.getCatalog().then((t=>{const r=e.map((e=>{const r=t.find((t=>t.id===e.id));return{id:e.id,title:r.title,description:r.description,imageURI:r.imageURI,price:r.price,priceCurrencyCode:r.priceCurrencyCode,priceValue:r.priceValue,priceCurrencyImage:r.getPriceCurrencyImage?.(\"medium\")}}));this._resolvePromiseDecorator(n.Mn.GET_CATALOG,r)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.GET_CATALOG,e)}))),t.promise}paymentsGetPurchases(){if(!this.#si)return Promise.reject();let e=this._getPromiseDecorator(n.Mn.GET_PURCHASES);return e||(e=this._createPromiseDecorator(n.Mn.GET_PURCHASES),this.#si.getPurchases().then((e=>{const t=this._paymentsGetProductsPlatformData();this._paymentsPurchases=e.map((e=>{const r={id:t.find((t=>t.id===e.productID)).id,...e.purchaseData};return delete r.productID,r})),this._resolvePromiseDecorator(n.Mn.GET_PURCHASES,this._paymentsPurchases)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.GET_PURCHASES,e)}))),e.promise}getRemoteConfig(e){if(!this._platformSdk)return Promise.reject();const t={clientFeatures:[]};e&&Object.keys(e).length>0&&(t.clientFeatures=Object.entries(e).map((([e,t])=>({name:e,value:String(t)}))));let r=this._getPromiseDecorator(n.Mn.GET_REMOTE_CONFIG);return r||(r=this._createPromiseDecorator(n.Mn.GET_REMOTE_CONFIG),this._platformSdk.getFlags(t).then((e=>{this._resolvePromiseDecorator(n.Mn.GET_REMOTE_CONFIG,e)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.GET_REMOTE_CONFIG,e)}))),r.promise}clipboardWrite(e){let t=this._getPromiseDecorator(n.Mn.CLIPBOARD_WRITE);return t||(t=this._createPromiseDecorator(n.Mn.CLIPBOARD_WRITE),this._platformSdk.clipboard.writeText(e).then((()=>{this._resolvePromiseDecorator(n.Mn.CLIPBOARD_WRITE,!0)})).catch((e=>{this._rejectPromiseDecorator(n.Mn.CLIPBOARD_WRITE,e)}))),t.promise.then((()=>{}))}#xt(){return this.#ii?this.#ii.then((()=>{if(!this._isPlayerAuthorized)return Promise.reject()})):Promise.reject()}#Ct(){return new Promise((e=>{let t=!1;this._options&&this._options.useSignedData&&(t=this._options.useSignedData),this._platformSdk.getPlayer({signed:t}).then((e=>{this._playerId=e.getUniqueID(),this._isPlayerAuthorized=e.isAuthorized(),this._setPlatformStorageAvailable(this._isPlayerAuthorized);const r=e.getName();\"\"!==r&&(this._playerName=r),this._playerPhotos=[];const s=e.getPhoto(\"small\"),i=e.getPhoto(\"medium\"),a=e.getPhoto(\"large\");s&&this._playerPhotos.push(s),i&&this._playerPhotos.push(i),a&&this._playerPhotos.push(a),this._playerExtra={payingStatus:e.getPayingStatus()},t&&(this._playerExtra.signature=e.signature),this.#ri=e})).finally((()=>{e()}))}))}}const p=u},8347:(e,t,r)=>{r.r(t),r.d(t,{default:()=>u});var s=r(8166),i=r(5555),a=r(8960),o=r(8902),n=r(3806),d=r(66),l=r(9221),h=r(7408);class c extends s.Z{get platformId(){return n.Lb.YOUTUBE}get isPlatformExternalCallsSupported(){return!1}get platformLanguage(){return this.#Ms?this.#Ms:super.platformLanguage}get isInterstitialSupported(){return!0}get isRewardedSupported(){return!0}get isPlatformExternalLinksAllowed(){return!1}get isClipboardSupported(){return!1}get leaderboardsType(){return h.Z.NATIVE}#Ms;#ai=null;#oi=null;initialize(){if(this._isInitialized)return Promise.resolve();let e=this._getPromiseDecorator(o.Mn.INITIALIZE);return e||(e=this._createPromiseDecorator(o.Mn.INITIALIZE),this.deviceType===d.me.DESKTOP&&(this.#ai=this.#ni(),this.#oi=this.#di()),(0,a.X_)(\"ytgame\").then((()=>{this._platformSdk=window.ytgame;const e=this._platformSdk;this._setPlatformStorageAvailable(!0);const t=e.system.getLanguage().then((e=>{this.#Ms=e.length>2?e.slice(0,2):e}));e.system.onAudioEnabledChange((e=>{this._setAudioState(e)})),this.#li(),document.addEventListener(\"visibilitychange\",(()=>{document.visibilityState===n.YU.VISIBLE&&this.#li()})),window.addEventListener(\"pageshow\",(()=>{this.#li()})),e.system.onPause((()=>{this._setPauseState(!0),this.#hi()})),e.system.onResume((()=>{this._setPauseState(!1),i.Z.hide(),this.#li()})),Promise.all([t]).finally((()=>{this._isInitialized=!0,this._resolvePromiseDecorator(o.Mn.INITIALIZE),e.game.firstFrameReady()}))}))),e.promise}getDataFromStorage(){return this._platformSdk.game.loadData().then((e=>{if(\"string\"==typeof e&&\"\"!==e)try{return JSON.parse(e)}catch{return{}}return{}}))}async setDataToStorage(e){const t=await this.getDataFromStorage();Object.keys(e).forEach((r=>{t[r]=e[r]})),await this._platformSdk.game.saveData(JSON.stringify(t))}async deleteDataFromStorage(e){const t=await this.getDataFromStorage();e.forEach((e=>{delete t[e]})),await this._platformSdk.game.saveData(JSON.stringify(t))}sendMessage(e,t){return e===n.Dt.GAME_READY?(this._platformSdk.game.gameReady(),this.#ai&&(this.#ai.remove(),this.#ai=null),this.#oi&&(this.#oi.remove(),this.#oi=null),Promise.resolve()):super.sendMessage(e)}showInterstitial(){this._setInterstitialState(l.WA.OPENED),this._platformSdk.ads.requestInterstitialAd().then((()=>{this._setInterstitialState(l.WA.CLOSED)})).catch((()=>{this._showAdFailurePopup(!1)}))}showRewarded(e){this._setRewardedState(l.b3.OPENED),this._platformSdk.ads.requestRewardedAd(e).then((e=>{e&&this._setRewardedState(l.b3.REWARDED),this._setRewardedState(l.b3.CLOSED)})).catch((()=>{this._showAdFailurePopup(!0)}))}leaderboardsSetScore(e,t,r){if(!r)return Promise.reject();let s=this._getPromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE);if(!s){s=this._createPromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE);const e=\"string\"==typeof t?parseInt(t,10):t;this._platformSdk.engagement.sendScore({value:e}).then((()=>{this._resolvePromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE)})).catch((e=>{this._rejectPromiseDecorator(o.Mn.LEADERBOARDS_SET_SCORE,e)}))}return s.promise}#li(){this._setAudioState(this._platformSdk.system.isAudioEnabled())}#hi(){const e=this._pauseStateAggregator?.getState(\"interstitial\"),t=this._pauseStateAggregator?.getState(\"rewarded\");e||t||i.Z.show()}#ni(){if(!document.getElementById(\"bridge-youtube-subscribe-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-youtube-subscribe-styles\",e.textContent=\"\\n #bridge-youtube-subscribe {\\n position: fixed;\\n inset: 0;\\n pointer-events: none;\\n transform-origin: 168px calc(100% - 56px);\\n z-index: 9999999;\\n animation: bridge-yt-press 650ms ease-in-out 1270ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-button {\\n position: fixed;\\n bottom: -24px;\\n left: 24px;\\n width: 220.8px;\\n height: 64px;\\n border-radius: 107.8px;\\n padding: 11.2px 25.6px 12.8px 25.6px;\\n background-color: #9747FF;\\n box-shadow: inset 0 0 17.06px 0 rgba(151, 71, 255, 0.7), inset 0 0 16px 0 rgba(255, 255, 255, 0.7);\\n box-sizing: border-box;\\n border: none;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n opacity: 0;\\n overflow: hidden;\\n white-space: nowrap;\\n pointer-events: none;\\n animation:\\n bridge-yt-rise-button 285ms ease-out 590ms forwards,\\n bridge-yt-button-shrink 295ms cubic-bezier(0.4, 0, 0.2, 1) 2100ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-title {\\n width: 168.8px;\\n height: 28.8px;\\n display: block;\\n flex-shrink: 0;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-ball {\\n position: fixed;\\n bottom: -88px;\\n left: 248px;\\n width: 64px;\\n height: 64px;\\n border-radius: 50%;\\n background-color: #9747FF;\\n box-shadow: inset 0 0 17.06px 0 rgba(151, 71, 255, 0.7), inset 0 0 16px 0 rgba(255, 255, 255, 0.7);\\n box-sizing: border-box;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n opacity: 0;\\n animation:\\n bridge-yt-rise-ball 285ms ease-out 630ms forwards,\\n bridge-yt-ball-roll 470ms cubic-bezier(0.34, 1.2, 0.5, 1) 2100ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-ball svg {\\n position: absolute;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-arrow {\\n width: 25.6px;\\n height: 25.6px;\\n opacity: 1;\\n animation: bridge-yt-arrow-fade-out 235ms ease 2220ms forwards;\\n }\\n\\n #bridge-youtube-subscribe .bridge-yt-hand {\\n width: 28.8px;\\n height: 28.8px;\\n opacity: 0;\\n animation: bridge-yt-hand-fade-in 235ms ease 2335ms forwards;\\n }\\n\\n @keyframes bridge-yt-rise-button {\\n 0% { bottom: -24px; opacity: 0; }\\n 40% { bottom: 25.6px; opacity: 1; }\\n 48% { bottom: 33.6px; }\\n 60% { bottom: 32px; }\\n 70% { bottom: 30.4px; }\\n 79% { bottom: 28.8px; }\\n 88% { bottom: 27.2px; }\\n 95% { bottom: 25.6px; }\\n 100% { bottom: 24px; opacity: 1; }\\n }\\n @keyframes bridge-yt-rise-ball {\\n 0% { bottom: -88px; opacity: 0; }\\n 40% { bottom: 25.6px; opacity: 1; }\\n 48% { bottom: 33.6px; }\\n 60% { bottom: 32px; }\\n 70% { bottom: 30.4px; }\\n 79% { bottom: 28.8px; }\\n 88% { bottom: 27.2px; }\\n 95% { bottom: 25.6px; }\\n 100% { bottom: 24px; opacity: 1; }\\n }\\n @keyframes bridge-yt-press {\\n 0% { transform: scale(1); }\\n 25% { transform: scale(0.94); }\\n 40% { transform: scale(0.9); }\\n 65% { transform: scale(1.01); }\\n 82% { transform: scale(0.995); }\\n 100% { transform: scale(1); }\\n }\\n @keyframes bridge-yt-button-shrink {\\n 0% { width: 220.8px; opacity: 1; }\\n 100% { width: 64px; opacity: 0; }\\n }\\n @keyframes bridge-yt-ball-roll {\\n 0% { left: 248px; transform: rotate(0deg); }\\n 100% { left: 24px; transform: rotate(-360deg); }\\n }\\n @keyframes bridge-yt-arrow-fade-out {\\n to { opacity: 0; }\\n }\\n @keyframes bridge-yt-hand-fade-in {\\n to { opacity: 1; }\\n }\\n \",document.head.appendChild(e)}const e=document.createElement(\"div\");return e.id=\"bridge-youtube-subscribe\",e.innerHTML='\\n
\\n \\n \\n \\n
\\n
\\n \\n \\n \\n \\n \\n \\n
\\n ',document.body.appendChild(e),e}#di(){const e=(this._options.videoPreviews??[]).filter((e=>Boolean(e?.image&&e?.videoId)));if(0===e.length)return null;const{image:t,videoId:r}=e[Math.floor(Math.random()*e.length)];if(!document.getElementById(\"bridge-youtube-video-preview-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-youtube-video-preview-styles\",e.textContent=\"\\n #bridge-youtube-video-preview {\\n position: fixed;\\n bottom: -24px;\\n right: 24px;\\n width: min(256px, 40vw);\\n border-radius: 16px;\\n overflow: hidden;\\n background-color: #000;\\n box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.4);\\n cursor: pointer;\\n opacity: 0;\\n z-index: 9999999;\\n animation: bridge-yt-preview-rise 285ms ease-out 590ms forwards;\\n }\\n\\n #bridge-youtube-video-preview .bridge-yt-preview-image {\\n display: block;\\n width: 100%;\\n aspect-ratio: 16 / 9;\\n object-fit: cover;\\n user-select: none;\\n -webkit-user-drag: none;\\n }\\n\\n #bridge-youtube-video-preview .bridge-yt-preview-play {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n width: 48px;\\n height: 34px;\\n transform: translate(-50%, -50%);\\n pointer-events: none;\\n }\\n\\n @keyframes bridge-yt-preview-rise {\\n 0% { bottom: -24px; opacity: 0; }\\n 40% { bottom: 25.6px; opacity: 1; }\\n 48% { bottom: 33.6px; }\\n 60% { bottom: 32px; }\\n 70% { bottom: 30.4px; }\\n 79% { bottom: 28.8px; }\\n 88% { bottom: 27.2px; }\\n 95% { bottom: 25.6px; }\\n 100% { bottom: 24px; opacity: 1; }\\n }\\n \",document.head.appendChild(e)}const s=document.createElement(\"div\");s.id=\"bridge-youtube-video-preview\";const i=document.createElement(\"img\");return i.className=\"bridge-yt-preview-image\",i.src=t,i.alt=\"\",i.draggable=!1,s.appendChild(i),s.insertAdjacentHTML(\"beforeend\",'\\n \\n \\n \\n \\n '),s.addEventListener(\"click\",(()=>{window.ytgame?.engagement.openYTContent({id:r}).catch((()=>{}))})),document.body.appendChild(s),s}}const u=c},8960:(e,t,r)=>{r.d(t,{pb:()=>i,ZT:()=>s,CS:()=>o,RH:()=>p,ZP:()=>_,D1:()=>S.D,dY:()=>m,n_:()=>d,eE:()=>l,Tg:()=>h,ju:()=>u,kh:()=>g,X_:()=>c});const s=function(e,t={}){return new Promise(((r,s)=>{const i=document.createElement(\"script\");i.src=e;for(let e=0;es(new Error(`Failed to load: ${e}`)))),document.head.appendChild(i)}))},i=({adSenseId:e,channelId:t,hostId:r,interstitialPlacementId:s,rewardedPlacementId:i,adFrequencyHint:a=\"180s\",testMode:o=!1},n={})=>new Promise(((d,l)=>{const h=document.createElement(\"script\");h.src=\"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\",h.setAttribute(\"data-ad-client\",e),t?h.setAttribute(\"data-ad-channel\",t):r&&h.setAttribute(\"data-ad-host\",r),s&&h.setAttribute(\"data-admob-interstitial-slot\",s),i&&h.setAttribute(\"data-admob-rewarded-slot\",i),o&&h.setAttribute(\"data-adbreak-test\",\"on\"),h.setAttribute(\"data-ad-frequency-hint\",a),h.setAttribute(\"crossorigin\",\"anonymous\"),h.addEventListener(\"load\",(()=>{const e=window.adsbygoogle??[];window.adsbygoogle=e,e.push({preloadAdBreaks:\"on\",sound:\"on\",onReady:()=>{},...n}),d((t=>e.push(t)))})),h.addEventListener(\"error\",(()=>{l(new Error(\"adsbygoogle script failed to load\"))})),document.head.appendChild(h)})),a=\"bridge-browser-defaults-protection\";function o(){if(document.getElementById(a))return;const e=document.createElement(\"style\");e.id=a,e.textContent=\"\\n html, body {\\n -webkit-user-select: none;\\n user-select: none;\\n -webkit-touch-callout: none;\\n overscroll-behavior: contain;\\n }\\n input, textarea, [contenteditable] {\\n -webkit-user-select: text;\\n user-select: text;\\n -webkit-touch-callout: default;\\n }\\n \",document.head.appendChild(e),document.addEventListener(\"contextmenu\",(e=>e.preventDefault()))}const n=[\"post\",\"Message\"].join(\"\");function d(e,t=\"*\"){window.parent&&window.parent[n](e,t)}function l(e){window.system&&window.system[n](e)}function h(e){window.chrome&&window.chrome.webview&&\"function\"==typeof window.chrome.webview.postMessage&&window.chrome.webview[n](e)}const c=function(...e){return e.length<=0?Promise.resolve():new Promise((t=>{const r=setInterval((()=>{let s=window;for(let t=0;tt.indexOf(\".\")?parseFloat(t.replace(/\\./g,\"\").replace(\",\",\".\")):t.includes(\",\")&&-1!==t.lastIndexOf(\",\")&&t.lastIndexOf(\",\")===t.length-4?parseInt(t.replace(/,/,\"\"),10):t.includes(\",\")&&-1!==t.lastIndexOf(\",\")&&t.lastIndexOf(\",\")!==t.length-3?parseFloat(t.replace(\",\",\".\")):t.includes(\".\")&&-1!==t.lastIndexOf(\".\")&&t.lastIndexOf(\".\")===t.length-4?parseInt(t.replace(/\\./,\"\"),10):t.includes(\".\")?parseFloat(t):parseInt(t,10)}function g(e){return m(e)?Promise.resolve(e):fetch(e).then((e=>e.blob())).then((e=>new Promise(((t,r)=>{const s=new FileReader;s.onloadend=()=>t(s.result),s.onerror=()=>r(s.error),s.readAsDataURL(e)}))))}var S=r(9146)},9146:(e,t,r)=>{function s(){const e=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";return`${Array.from({length:8},(()=>e.charAt(Math.floor(62*Math.random())))).join(\"\")}${Date.now().toString(36)}`}r.d(t,{D:()=>s})}},t={};function r(s){var i=t[s];if(void 0!==i)return i.exports;var a=t[s]={exports:{}};return e[s](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},(()=>{var e=r(8902),t=r(3806),s=r(66),i=r(9221),a=r(1558),o=r(6039);const n=\"loading-overlay\",d=\"logo\",l=\"fillRect\",h=\"gradientMover\",c=\"loading-hint\",u={viewBox:\"0 0 633 819\",paths:[\"M632 1V632H1V1H632ZM350 125.586V507.414L380.586 538H546V451H478.599L478.308 451.278L454.598 474H443.406L450.944 452.328L451 452.169V187.459L457.369 182H546V95H380.586L350 125.586ZM283 125.586L252.414 95H87V182H175.631L182 187.459V445.54L175.631 451H87V538H252.414L283 507.414V125.586Z\",\"M633 687V660H548V687H560V791H548V819H633V792H601L592 801H587L590 792V752H627V725H590V687H633Z\",\"M533 718V675L518 660H450L435 675V802L450 819H518L533 804V734H482V761H503V788L499 792H476L467 801H462L465 792V691L469 687H499L503 691V718H533Z\",\"M402 660H310V687H322V792H310V819H402L417 804V675L402 660ZM387 788L383 792H363L354 801H349L352 792V687H383L387 691V788Z\",\"M295 687V660H239V687H251V792H239V819H295V792H283V687H295Z\",\"M215 791L200 760H209L224 745V675L209 660H121V687H132V792H121V819H162V760H166L193 819H227V791H215ZM194 729L190 733H173L164 742H159L162 733V687H190L194 691V729Z\",\"M106 724V675L91 660H0V687H12V792H0V819H91L106 804V749L89 744V728L106 724ZM73 788L69 792H53L44 801H39L42 792V752H73V788ZM73 725H53L44 734H39L42 725V687H69L73 691V725Z\"],fillColor:\"#aa76ff\",strokeColor:\"#aa76ff\",gradientStops:[{offset:\"0.235577\",color:\"#aa76ff\"},{offset:\"0.240685\",color:\"white\"},{offset:\"0.659749\",color:\"#aa76ff\"}],gradientWidthMultiplier:4},p={viewBox:\"0 0 633 986\",paths:[\"M224.044 880.996V933.01H247.059V880.996H269.036V954.011C269.036 972.997 256.033 986 234.056 986H202.067V967.991H231.064C242.053 967.991 247.059 960.97 247.059 952.973V949.981H202.067V880.996H224.044Z\",{d:\"M355.051 880.996V952.912C355.051 971.959 340.094 985.939 320.071 985.939H289.059V966.953H319.033C328.007 966.953 333.013 960.97 333.013 952.973V949.981H317.019C297.972 949.981 281.001 935.024 281.001 915C281.001 896.014 298.033 880.996 317.019 880.996H355.051ZM320.01 897.968C310.975 897.968 304.992 904.927 304.992 914.939C304.992 925.928 311.036 932.949 320.01 932.949H333.013V897.968H320.01Z\",fillRule:\"evenodd\"},{d:\"M34.0643 880.996C53.05 880.996 71.0593 895.953 71.0593 915C71.0593 934.963 53.05 949.981 34.0643 949.981H22.0378V970.982H0.0608089V880.996H34.0643ZM22.0378 897.968V932.949H32.0498C41.0238 932.949 47.0672 925.989 47.0672 914.939C47.0672 904.989 41.0238 897.968 32.0498 897.968H22.0378Z\",fillRule:\"evenodd\"},\"M105.062 870.007V949.981H81.0707V870.007H105.062Z\",{d:\"M187.049 880.996V949.981H152.069C133.022 949.981 116.051 935.024 116.051 915C116.051 896.014 133.083 880.996 152.069 880.996H187.049ZM154.999 897.968C145.964 897.968 139.981 904.927 139.981 914.939C139.981 925.928 146.025 932.949 154.999 932.949H165.011V897.968H154.999Z\",fillRule:\"evenodd\"},{d:\"M436 880.996V949.981H401.02C381.973 949.981 365.002 935.024 365.002 915C365.002 896.014 382.034 880.996 401.02 880.996H436ZM404.011 897.968C394.976 897.968 388.994 904.927 388.994 914.939C388.994 925.928 395.037 932.949 404.011 932.949H414.023V897.968H404.011Z\",fillRule:\"evenodd\"},\"M521.039 880.996C538.987 880.996 551.99 894 551.99 912.009V949.981H530.013V908.957C530.013 903.951 525.984 897.968 520.001 897.968H512.004V949.981H490.027V897.968H472.018V949.981H450.041V880.996H521.039Z\",{d:\"M633 880.996V949.981H598.019C579.034 949.981 563.039 935.024 563.039 915C563.039 896.014 579.034 880.996 598.019 880.996H633ZM603.025 897.968C593.014 897.968 587.031 904.927 587.031 914.939C587.031 925.928 593.014 932.949 603.025 932.949H611.023V897.968H603.025Z\",fillRule:\"evenodd\"},\"M522.993 663.967L538.01 678.986V732.037H504.068V695.041L500.038 691.012H482.029L478.001 695.041V829.044L475.009 838.018H480.015L488.989 829.044H499.978L504.007 825.015V775.015H491.004V748.032H538.01V841.009L522.993 856.027H459.015L443.997 838.994V678.986L459.015 663.967H522.993Z\",\"M633 664.029V691.073H601.011V739.057H627.017V766.041H601.011V829.044L598.019 838.018H603.025L611.999 829.044H633V856.027H553.028V828.006H567.007V691.012H553.028V664.029H633Z\",{d:\"M89.0069 664.029L104.025 679.046V738.02L87.0533 741.927V757.922L104.025 762.928V840.948L89.0069 855.966H0V828.983H13.9801V691.012H0V664.029H89.0069ZM47.983 765.98V828.983L44.992 837.956H49.998L59.0329 828.983H65.9919L70.0214 824.953H69.96V765.98H47.983ZM47.983 691.012V738.997L44.992 747.971H49.998L59.0329 738.997H70.0214V695.041L65.9919 691.012H47.983Z\",fillRule:\"evenodd\"},{d:\"M210.003 664.029L225.02 679.046V759.02L210.003 774.039L217.023 828.006V827.945H227.951V855.966H184.973L176.976 773.977H166.964V855.966H118.981V828.983H132.961V691.012H118.981V664.029H210.003ZM167.025 691.012V746.994L164.034 755.968H169.04L178.014 746.994H186.988L191.017 742.965H191.078V695.041L187.049 691.012H167.025Z\",fillRule:\"evenodd\"},\"M302.001 664.029V691.012H288.021V828.983H302.001V855.966H239.977V828.983H253.957V691.012H239.977V664.029H302.001Z\",{d:\"M411.032 663.967L426.05 678.924V840.887L411.032 855.905H317.019V828.921H330.999V690.951H317.019V663.967H411.032ZM365.002 691.012V828.983L362.011 837.956H367.017L376.052 828.983H388.078L392.046 824.953H391.985V695.041L388.017 691.012H365.002Z\",fillRule:\"evenodd\"},{d:\"M633 0V635.946H0.0608089V0H633ZM88.0298 92.0008V177.042H176.06L183.02 183.024V446.023L176.06 452.006H88.0298V536.986H252.003L252.004 536.986H252.065L282.039 507.011V121.976L252.065 92.0008H88.0298ZM382.034 92.0008L351.999 122.037V507.011L382.034 536.986H546.007L546.008 452.006H480.015L456.024 475.021H443.021L451.018 452.006V183.024L458.038 177.042H546.008V92.0616L546.007 92.0008H382.034Z\",fillRule:\"evenodd\"}],fillColor:\"#aa76ff\",strokeColor:\"#aa76ff\",gradientStops:[{offset:\"0.235577\",color:\"#aa76ff\"},{offset:\"0.240685\",color:\"white\"},{offset:\"0.659749\",color:\"#aa76ff\"}],gradientWidthMultiplier:4},m=[\"Loading GPU\",\"Parsing AST\",\"Linking libs\",\"Baking mesh\",\"Warming JIT\",\"Tracing rays\",\"Packing data\",\"Flushing GPU\",\"Loading WASM\",\"Alloc memory\",\"Init shaders\",\"Optimize FPS\",\"Sync textures\",\"Build navmesh\",\"Compile code\",\"Load physics\",\"Stream assets\",\"Cache buffers\",\"Map controls\",\"Decode audio\",\"Init network\",\"Setup scene\"];const _=class{#ci=null;#ui=!1;#pi=null;setHideGate(e){this.#pi=e}show({showFullLogo:e=!1,showLoadingText:t=!1}={}){this.#st();const r=this.#mi(),s=e?p:u;r.appendChild(this.#_i(s)),t&&this.#gi(r)}setProgress(e,t=!1){if(this.#ui)return;if(t&&null!==this.#ci)return;const r=document.getElementById(l),s=document.getElementById(h),i=document.getElementById(d),a=document.getElementById(n);if(!(r&&s&&i&&a))return;this.#ci=e;const o=Math.max(0,Math.min(100,e)),c=100-o;if(r.style.transform=`translateY(${c}%)`,100===o){this.#ui=!0;const e=()=>{setTimeout((()=>{r.style.display=\"none\",s.style.display=\"block\",s.classList.add(\"gradient-mover\")}),400),setTimeout((()=>i.classList.add(\"logo-fade-out\")),900),setTimeout((()=>a.remove()),1400)};if(this.#pi){const t=new Promise((e=>{setTimeout(e,3e3)}));Promise.race([this.#pi.catch((()=>{})),t]).then(e)}else e()}else s.classList.remove(\"gradient-mover\")}#st(){const e=document.createElement(\"style\");e.textContent=`\\n .fullscreen {\\n background: #242424;\\n width: 100vw;\\n height: 100vh;\\n position: absolute;\\n top: 0px;\\n left: 0px;\\n }\\n\\n #${n} {\\n font-size: 20px;\\n z-index: 9999999;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n }\\n\\n #${d} {\\n width: 10%;\\n max-width: 300px;\\n min-width: 120px;\\n overflow: visible;\\n }\\n\\n #${c} {\\n width: 8%;\\n max-width: 240px;\\n min-width: 96px;\\n margin-top: clamp(17px, 1.7vw, 33px);\\n text-align: center;\\n color: #aa76ff;\\n font-size: clamp(11px, 1.3vw, 16px);\\n font-family: -apple-system, BlinkMacSystemFont, sans-serif;\\n letter-spacing: 0.04em;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n transition: opacity 0.4s ease;\\n }\\n\\n .fill-rect {\\n transform: translateY(100%);\\n transition: transform 0.3s ease-out;\\n }\\n\\n #${h} {\\n display: none;\\n }\\n\\n .gradient-mover {\\n animation: moveGradient 0.4s linear;\\n }\\n\\n @keyframes moveGradient {\\n 0% { transform: translateX(0); }\\n 100% { transform: translateX(-250%); }\\n }\\n\\n .logo-fade-out {\\n animation: logoFadeOut 1s linear;\\n }\\n\\n .logo-fade-out path {\\n fill: white;\\n stroke: white;\\n }\\n\\n @keyframes logoFadeOut {\\n 0% { opacity: 1; }\\n 50% { opacity: 0; }\\n 100% { opacity: 0; }\\n }\\n `,document.head.appendChild(e)}#mi(){const e=document.createElement(\"div\");return e.id=n,e.className=\"fullscreen\",document.body.appendChild(e),e}#_i(e){const t=e.gradientWidthMultiplier??4,[,,r,s]=e.viewBox.split(/[ ,]+/),i=Number(r),a=Number(s),o=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");o.setAttribute(\"id\",d),o.setAttribute(\"viewBox\",e.viewBox),o.setAttribute(\"fill\",\"none\"),o.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\");const n=document.createElementNS(o.namespaceURI,\"defs\"),c=document.createElementNS(o.namespaceURI,\"mask\");c.setAttribute(\"id\",\"logo-mask\");const u=document.createElementNS(o.namespaceURI,\"rect\");u.setAttribute(\"x\",\"0\"),u.setAttribute(\"y\",\"0\"),u.setAttribute(\"width\",\"100%\"),u.setAttribute(\"height\",\"100%\"),u.setAttribute(\"fill\",\"black\"),c.appendChild(u),e.paths.forEach((e=>{const t=document.createElementNS(o.namespaceURI,\"path\");t.setAttribute(\"d\",\"string\"==typeof e?e:e.d),t.setAttribute(\"fill\",\"object\"==typeof e&&e.maskFill?e.maskFill:\"white\"),\"object\"==typeof e&&e.fillRule&&t.setAttribute(\"fill-rule\",e.fillRule),c.appendChild(t)})),n.appendChild(c);const p=document.createElementNS(o.namespaceURI,\"linearGradient\");p.setAttribute(\"id\",\"shineGradient\"),p.setAttribute(\"x1\",String(2*i)),p.setAttribute(\"y1\",\"0\"),p.setAttribute(\"x2\",String(3*i)),p.setAttribute(\"y2\",String(a)),p.setAttribute(\"gradientUnits\",\"userSpaceOnUse\"),e.gradientStops.forEach((({offset:e,color:t})=>{const r=document.createElementNS(o.namespaceURI,\"stop\");r.setAttribute(\"offset\",e),r.setAttribute(\"stop-color\",t),p.appendChild(r)})),n.appendChild(p),o.appendChild(n);const m=document.createElementNS(o.namespaceURI,\"g\");m.setAttribute(\"mask\",\"url(#logo-mask)\");const _=document.createElementNS(o.namespaceURI,\"rect\");_.setAttribute(\"id\",h),_.setAttribute(\"x\",\"0\"),_.setAttribute(\"y\",\"0\"),_.setAttribute(\"width\",String(i*t)),_.setAttribute(\"height\",String(a)),_.setAttribute(\"fill\",\"url(#shineGradient)\"),_.style.transform=\"translateX(0)\",m.appendChild(_),o.appendChild(m);const g=document.createElementNS(o.namespaceURI,\"g\");g.setAttribute(\"mask\",\"url(#logo-mask)\");const S=document.createElementNS(o.namespaceURI,\"rect\");S.setAttribute(\"id\",l),S.setAttribute(\"class\",\"fill-rect\"),S.setAttribute(\"x\",\"0\"),S.setAttribute(\"y\",\"0\"),S.setAttribute(\"width\",\"100%\"),S.setAttribute(\"height\",String(a)),S.setAttribute(\"fill\",e.fillColor),g.appendChild(S),o.appendChild(g);const A=String(Math.round(3*i/633));return e.paths.forEach((t=>{if(\"object\"==typeof t&&\"black\"===t.maskFill)return;const r=document.createElementNS(o.namespaceURI,\"path\");r.setAttribute(\"d\",\"string\"==typeof t?t:t.d),r.setAttribute(\"stroke\",e.strokeColor),r.setAttribute(\"stroke-width\",A),\"object\"==typeof t&&t.fillRule&&r.setAttribute(\"fill-rule\",t.fillRule),o.appendChild(r)})),o}#gi(e){const t=document.createElement(\"div\");t.id=c,t.style.opacity=\"0\";let r=Math.floor(Math.random()*m.length);t.textContent=m[r],e.appendChild(t);const s=()=>1e3*(2+Math.random());let i=null;const a=()=>{i=setTimeout((()=>{t.style.opacity=\"0\",setTimeout((()=>{r=(r+1)%m.length,t.textContent=m[r],t.style.opacity=\"1\",a()}),400)}),s())};i=setTimeout((()=>{t.style.opacity=\"1\",a()}),s());const o=new MutationObserver((t=>{t.forEach((t=>{t.removedNodes.forEach((t=>{t===e&&(i&&clearTimeout(i),o.disconnect())}))}))}));o.observe(document.body,{childList:!0})}};var g=r(1302);const S=class{get finished(){return this.#Si.promise}#Ai;#Si=new o.Z;#Ei=!1;constructor({url:e}){this.#Ai=new Audio(e),this.#Ai.preload=\"auto\",this.#Ai.addEventListener(\"ended\",(()=>this.#fi())),this.#Ai.addEventListener(\"error\",(()=>this.#fi(`Loading sound failed to load: ${e}`))),this.#Ai.load()}play(){this.#Ei||this.#Ai.play().catch((e=>{this.#fi(`Loading sound playback rejected: ${e?.message||String(e)}`)}))}cancel(){this.#Ai.pause(),this.#fi()}#fi(e){this.#Ei||(this.#Ei=!0,e&&g.ZP.warn(e),this.#Si.resolve())}},A=\"bridge-safe-area-styles\";const E=class{static getInsets(){const e=document.createElement(\"div\");e.style.cssText=\"position:fixed;top:env(safe-area-inset-top);bottom:env(safe-area-inset-bottom);left:env(safe-area-inset-left);right:env(safe-area-inset-right);pointer-events:none;visibility:hidden;\",document.body.appendChild(e);const t=e.getBoundingClientRect(),r={top:t.top,bottom:window.innerHeight-t.bottom,left:t.left,right:window.innerWidth-t.right};return e.remove(),r}static applyStyles(){if(document.getElementById(A))return;const e=document.createElement(\"style\");e.id=A,e.textContent=\"\\n html, body {\\n height: calc(100% - env(safe-area-inset-top) - env(safe-area-inset-bottom));\\n padding-top: env(safe-area-inset-top);\\n padding-bottom: env(safe-area-inset-bottom);\\n box-sizing: border-box;\\n }\\n \",document.head.appendChild(e)}};var f=r(5230),P=r(5819),I=r(9778),y=r(6170);class D extends I.Z{get id(){return this._platformBridge.platformId}get sdk(){return this._platformBridge.platformSdk}get language(){return this._platformBridge.platformLanguage}get payload(){return this._platformBridge.platformPayload}get tld(){return this._platformBridge.platformTld}get launchSource(){return this._platformBridge.launchSource}get isExternalCallsSupported(){return this._platformBridge.isPlatformExternalCallsSupported}get isExternalLinksAllowed(){return this._platformBridge.isPlatformExternalLinksAllowed}get isAudioEnabled(){return this._platformBridge.isPlatformAudioEnabled}get isPaused(){return this._platformBridge.isPlatformPaused}#Pi=!1;#Ii=0;#yi=new Set([t.Dt.GAMEPLAY_STARTED,t.Dt.GAMEPLAY_STOPPED,t.Dt.IN_GAME_LOADING_STARTED,t.Dt.IN_GAME_LOADING_STOPPED]);initialize(t){return super.initialize(t),this.#Ii=performance.now(),this._forwardEvent(e.W1.AUDIO_STATE_CHANGED),this._forwardEvent(e.W1.PAUSE_STATE_CHANGED),this}sendMessage(r,s){const i=s??{},o={};if(r===t.Dt.GAME_READY){if(this.#Pi)return Promise.reject();this.#Pi=!0;const e=performance.now();o.time_s=((e-this.#Ii)/1e3).toFixed(2);const t=document.getElementById(\"loading-overlay\");t&&t.remove()}return void 0!==i.world&&(o.world=String(i.world)),void 0!==i.level&&(o.level=String(i.level)),this.#yi.has(r)||y.rh.send(`${e.oF.PLATFORM}_message_${r}`,o),a.ZP.emit(e.W1.PLATFORM_MESSAGE_SENT,r),this._platformBridge.sendMessage(r,i)}sendCustomMessage(t,r){return y.rh.send(`${e.oF.PLATFORM}_custom_message`,{id:t}),a.ZP.emit(e.W1.PLATFORM_MESSAGE_SENT,t),this._platformBridge.sendCustomMessage(t,r)}getServerTime(){return this._platformBridge.getServerTime()}}(0,a.iL)(D.prototype);const T=new D;var w=r(3941),v=r(9979),R=r(8467),b=r(8960);class C extends I.Z{get isInviteFriendsSupported(){return this._platformBridge.isInviteFriendsSupported}get isJoinCommunitySupported(){return this._platformBridge.isJoinCommunitySupported}get isShareSupported(){return this._platformBridge.isShareSupported}get isCreatePostSupported(){return this._platformBridge.isCreatePostSupported}get isAddToHomeScreenSupported(){return this._platformBridge.isAddToHomeScreenSupported}get isAddToHomeScreenRewardSupported(){return this._platformBridge.isAddToHomeScreenRewardSupported}get isAddToFavoritesSupported(){return this._platformBridge.isAddToFavoritesSupported}get isAddToFavoritesRewardSupported(){return this._platformBridge.isAddToFavoritesRewardSupported}get isRateSupported(){return this._platformBridge.isRateSupported}inviteFriends(e){return this._platformBridge.isInviteFriendsSupported?this._platformBridge.inviteFriends(this.#t(\"inviteFriends\",e)):Promise.reject()}joinCommunity(e){return this._platformBridge.isJoinCommunitySupported?this._platformBridge.joinCommunity(this.#t(\"joinCommunity\",e)):Promise.reject()}share(e){return this._platformBridge.isShareSupported?this._platformBridge.share(this.#t(\"share\",e)):Promise.reject()}createPost(e){return this._platformBridge.isCreatePostSupported?this._platformBridge.createPost(this.#t(\"createPost\",e)):Promise.reject()}addToHomeScreen(){return this._platformBridge.isAddToHomeScreenSupported?this._platformBridge.addToHomeScreen():Promise.reject()}getAddToHomeScreenReward(){return this._platformBridge.isAddToHomeScreenRewardSupported?this._platformBridge.getAddToHomeScreenReward():Promise.reject()}addToFavorites(){return this._platformBridge.isAddToFavoritesSupported?this._platformBridge.addToFavorites():Promise.reject()}getAddToFavoritesReward(){return this._platformBridge.isAddToFavoritesRewardSupported?this._platformBridge.getAddToFavoritesReward():Promise.reject()}rate(){return this._platformBridge.isRateSupported?this._platformBridge.rate():Promise.reject()}#t(e,t){return function(e,t,r){const s=e?.[t],i=s&&\"object\"==typeof s?s:{},a=r??{};return(0,b.RH)(i,a)}(this._platformBridge.options?.social,e,t)}}const L=new C;var O=r(3117);class M extends I.Z{get type(){return this._platformBridge.deviceType}get os(){return this._platformBridge.deviceOs}get orientation(){return this.#Di}get safeArea(){return this._platformBridge.safeArea??E.getInsets()}#Di=null;#Ti=null;#wi=null;#vi=!1;#Ri=0;#bi=0;#Ci=null;initialize(e){return super.initialize(e),this.#Li(),this.#Oi(),this}#Li(){this.#Di=(0,O.f)(),window.screen.orientation?window.screen.orientation.addEventListener(\"change\",(()=>this.#Mi())):window.addEventListener(\"orientationchange\",(()=>this.#Mi())),window.addEventListener(\"resize\",(()=>this.#Mi())),this.#Ni()}#Ni(){const{deviceType:e}=this._platformBridge;if(!(e===s.me.MOBILE||e===s.me.TABLET))return;const t=f.ZP.getValues().device;this.#vi=t?.useBuiltInOrientationPopup??!1,this.#wi=t?.supportedOrientations??[s.AR.PORTRAIT,s.AR.LANDSCAPE],this.#ki()}#Mi(){const t=(0,O.f)();t!==this.#Di&&(this.#Di=t,a.ZP.emit(e.W1.ORIENTATION_STATE_CHANGED,this.#Di),this.#ki())}#ki(){if(!this.#vi)return;if(!this.#wi||1!==this.#wi.length)return void this.#Hi();const e=this.#wi[0];this.#Di!==e?this.#Bi():this.#Hi()}#Bi(){this.#Ti||(this.#Ti=function(){if(!document.getElementById(\"bridge-orientation-overlay-styles\")){const e=document.createElement(\"style\");e.id=\"bridge-orientation-overlay-styles\",e.textContent=`\\n #${s.Uw} {\\n position: fixed;\\n top: 0;\\n left: 0;\\n width: 100vw;\\n height: 100vh;\\n background-color: rgba(0, 0, 0, 0.95);\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n z-index: 9999999;\\n }\\n\\n #bridge-orientation-icon {\\n width: 80px;\\n height: 80px;\\n animation: bridge-rotate-phone 1.5s ease-in-out infinite;\\n }\\n\\n #bridge-orientation-message {\\n color: #fff;\\n font-size: 18px;\\n font-family: Arial, sans-serif;\\n margin-top: 20px;\\n text-align: center;\\n }\\n\\n @keyframes bridge-rotate-phone {\\n 0%, 100% { transform: rotate(0deg); }\\n 50% { transform: rotate(90deg); }\\n }\\n `,document.head.appendChild(e)}const e=document.createElement(\"div\");e.id=s.Uw;const t=document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\");t.setAttribute(\"id\",\"bridge-orientation-icon\"),t.setAttribute(\"viewBox\",\"0 0 24 24\"),t.setAttribute(\"fill\",\"none\"),t.setAttribute(\"xmlns\",\"http://www.w3.org/2000/svg\"),t.innerHTML='\\n \\n \\n ';const r=document.createElement(\"div\");return r.id=\"bridge-orientation-message\",r.innerText=\"Please rotate your device\",e.appendChild(t),e.appendChild(r),e}(),document.body.appendChild(this.#Ti))}#Hi(){this.#Ti&&(this.#Ti.remove(),this.#Ti=null)}#Oi(){this.#Ri=window.innerWidth,this.#bi=window.innerHeight,window.addEventListener(\"resize\",(()=>this.#Gi()))}#Gi(){this.#Ci&&clearTimeout(this.#Ci),this.#Ci=setTimeout((()=>{const t=window.innerWidth,r=window.innerHeight;t===this.#Ri&&r===this.#bi||(this.#Ri=t,this.#bi=r,a.ZP.emit(e.W1.SCREEN_SIZE_CHANGED,{width:t,height:r}))}),200)}}(0,a.iL)(M.prototype);const N=new M;var k=r(7408);class H{get baseUrl(){return f.ZP.getValues().saas?.baseUrl||`${(0,P.ao)()}/api/bridge/v1`}get xHeaders(){return{\"x-player-id\":this.#F.playerId||\"\",\"x-platform-id\":this.#F.platformId,\"x-public-token\":f.ZP.getValues().saas?.publicToken||\"\"}}#F;constructor(e){this.#F=e}get(e){return fetch(`${this.baseUrl}/${e}`,{method:\"GET\",credentials:\"include\",headers:{\"Content-Type\":\"application/json\",...this.xHeaders}}).then((e=>e.json()))}post(e,t){return fetch(`${this.baseUrl}/${e}`,{method:\"POST\",body:JSON.stringify(t),credentials:\"include\",headers:{\"Content-Type\":\"application/json\",...this.xHeaders}}).then((e=>e.json()))}}class B extends I.Z{get type(){return this.#Fi?k.Z.IN_GAME:this._platformBridge.leaderboardsType}#Fi=null;initialize(t){return super.initialize(t),this._isSaas(e.oF.LEADERBOARDS)&&(this.#Fi=new H(t)),this}setScore(e,t){if(this.type===k.Z.NOT_AVAILABLE)return Promise.reject();if(this.#Fi)return this._platformBridge.playerId?this.#Fi.post(`leaderboards/${e}`,{score:t}):Promise.reject();const r=this._getPlatformLeaderboardId(e),s=this.#xi(e);return this._platformBridge.leaderboardsSetScore(r,t,s)}getEntries(e){if(this.type!==k.Z.IN_GAME)return Promise.reject();if(this.#Fi)return this.#Fi.get(`leaderboards/${e}`);const t=this._getPlatformLeaderboardId(e);return this._platformBridge.leaderboardsGetEntries(t)}showNativePopup(e){if(this._platformBridge.leaderboardsType!==k.Z.NATIVE_POPUP)return Promise.reject();const t=this._getPlatformLeaderboardId(e);return this._platformBridge.leaderboardsShowNativePopup(t)}_getPlatformLeaderboardId(e){if(!e)return e;const{leaderboards:t}=f.ZP.getValues();if(!t)return e;const r=t.find((t=>t.id===e));if(!r)return e;const s=r[this._platformBridge.platformId];return\"string\"==typeof s&&s?s:e}#xi(e){const{leaderboards:t}=f.ZP.getValues();if(!t)return!1;const r=t.find((t=>t.id===e));return!!r&&!0===r.isMain}}const G=new B;var F=r(1147);class x extends I.Z{get isSupported(){return this._platformBridge.isRemoteConfigSupported}#Ui={};setContext(e){this.#Ui={...this.#Ui,...e}}get(){return this._platformBridge.isRemoteConfigSupported?this._platformBridge.getRemoteConfig(this.#Ui):Promise.reject()}}const U=new x;class V extends I.Z{get isSupported(){return this._platformBridge.isClipboardSupported}read(){return this._platformBridge.isClipboardSupported?this._platformBridge.clipboardRead():Promise.reject()}write(e){return this._platformBridge.isClipboardSupported?this._platformBridge.clipboardWrite(e):Promise.reject()}}const Z=new V;var j=r(5334);class z extends I.Z{get isSupported(){return this._platformBridge.isNotificationsSupported}schedule(t){const r=this.#Vi(t);if(r)return Promise.reject(new e.Hd(e.Bq.NOTIFICATION_INVALID_PARAMETERS,r));const s=this.#Zi(t.id);return this._platformBridge.notificationsSchedule(t,s)}cancel(t){return\"string\"!=typeof t||0===t.length?Promise.reject(new e.Hd(e.Bq.NOTIFICATION_INVALID_PARAMETERS,'Notification \"id\" must be a non-empty string')):this._platformBridge.notificationsCancel(t,this.#Zi(t))}cancelAll(){return this._platformBridge.notificationsCancelAll()}#Vi(e){if(!e||\"object\"!=typeof e)return\"Notification must be an object\";if(\"string\"!=typeof e.id||0===e.id.length)return'Notification \"id\" must be a non-empty string';if(\"string\"!=typeof e.title||0===e.title.length)return'Notification \"title\" must be a non-empty string';if(\"string\"!=typeof e.description||0===e.description.length)return'Notification \"description\" must be a non-empty string';if(void 0!==e.delaySeconds&&(!Number.isInteger(e.delaySeconds)||e.delaySeconds<0))return'Notification \"delaySeconds\" must be a non-negative integer';const t=[\"image\",\"callToAction\",\"payload\"].find((t=>{const r=e[t];return void 0!==r&&\"string\"!=typeof r}));return t?`Notification \"${t}\" must be a string`:null}#Zi(e){const{notifications:t}=f.ZP.getValues();if(!t)return;const r=t.find((t=>t.id===e));if(!r)return;const s=r[this._platformBridge.platformId];return\"string\"==typeof s||\"number\"==typeof s?s:void 0}}const W=new z,K=\"bridge-daily-rewards-state\";class Y extends I.Z{#ji=[];#zi=!0;#Wi=!0;#L=null;#O=null;initialize(e){super.initialize(e);const t=f.ZP.getValues().dailyRewards;return this.#ji=Array.isArray(t?.rewards)?t.rewards:[],this.#zi=\"boolean\"!=typeof t?.cycle||t.cycle,this.#Wi=\"boolean\"!=typeof t?.resetOnMiss||t.resetOnMiss,this}async getRewards(){return[...this.#ji]}async getCurrentDay(){const e=await this.#Ki();return(await this.#Yi(e)).day}async getCurrentReward(){const e=await this.#Ki(),t=await this.#Yi(e);return this.#$i(t,e)?this.#ji[t.day]:null}async claimCurrentReward(){const t=await this.#Ki(),r=await this.#Yi(t);if(!this.#$i(r,t))return!1;const s=r.day;r.lastClaimEpochDay=t,r.day=this.#zi?(r.day+1)%this.#ji.length:r.day+1,await this.#N();const i={day:s,reward:this.#ji[s]};return a.ZP.emit(e.W1.DAILY_REWARDS_CLAIMED,i),!0}async#Yi(t){const r=await this.#M();if(this.#Wi&&null!==r.lastClaimEpochDay&&r.day>0&&t-r.lastClaimEpochDay>=2){const t=r.day;r.day=0,await this.#N();const s={day:t};a.ZP.emit(e.W1.DAILY_REWARDS_STREAK_RESET,s)}return r}#$i(e,t){return!(e.day>=this.#ji.length)&&(null===e.lastClaimEpochDay||t>e.lastClaimEpochDay)}async#Ki(){let e;try{e=await this._platformBridge.getServerTime()}catch{e=Date.now()}return\"number\"==typeof e&&Number.isFinite(e)||(e=Date.now()),Math.floor(e/864e5)}#M(){return this.#L?Promise.resolve(this.#L):(this.#O||(this.#O=v.Z.get(K,!0).then((e=>(this.#L=this.#k(e),this.#O=null,this.#L))).catch((()=>(this.#L=this.#H(),this.#O=null,this.#L)))),this.#O)}#N(){return this.#L?v.Z.set(K,this.#L):Promise.resolve()}#H(){return{day:0,lastClaimEpochDay:null}}#k(e){if(!e||\"object\"!=typeof e)return this.#H();const t=e;return{day:\"number\"==typeof t.day&&t.day>=0?Math.floor(t.day):0,lastClaimEpochDay:\"number\"==typeof t.lastClaimEpochDay?Math.floor(t.lastClaimEpochDay):null}}}const $=new Y,q=\"bridge-tasks-state\",J={DAILY:\"daily\",WEEKLY:\"weekly\",PERMANENT:\"permanent\"};class X extends I.Z{#qi=[];#L=null;#O=null;initialize(e){super.initialize(e);const t=f.ZP.getValues().tasks;return this.#qi=Array.isArray(t)?t.filter((e=>this.#Ji(e))):[],this}async getTasks(){const{state:e,active:t}=await this.#Xi(),r=[];return t.forEach((({group:t,key:s})=>{e.groups[s].tasks.forEach((e=>{const s=this.#Qi(t,e.id);s&&r.push(this.#ea(t,e,s))}))})),r}async addProgress(e,t=1){const{state:r,active:s}=await this.#Xi();let i=!1;s.forEach((({group:s,key:a})=>{r.groups[a].tasks.forEach((r=>{const a=this.#Qi(s,r.id);a&&a.targets.forEach((s=>{if(s.id!==e)return;const a=this.#ta(r,s.id),o=a.progress;a.progress=Math.min(Math.max(0,o+t),s.amount),a.progress!==o&&(i=!0)}))}))})),i&&await this.#N()}async claimReward(t){const{state:r,active:s}=await this.#Xi(),i=this.#ra(s,r,t);if(!i||i.task.claimed)return!1;const o=this.#Qi(i.group,i.task.id);if(!o||!this.#sa(o,i.task))return!1;i.task.claimed=!0,await this.#N();const n={taskId:o.id,groupId:i.group.id,type:i.group.type,rewards:o.rewards.map((e=>({id:e.id,amount:e.amount})))};return a.ZP.emit(e.W1.TASKS_REWARD_CLAIMED,n),!0}async#Xi(){const t=await this.#M(),r=await this.#ia(),s=[],i=[];let o=!1;return this.#qi.forEach((e=>{const a=e.id,n=this.#aa(e,r),d=t.groups[a];d&&d.periodKey===n||(d&&i.push({groupId:a,type:e.type,periodKey:n,previousPeriodKey:d.periodKey}),t.groups[a]={periodKey:n,tasks:this.#oa(e)},o=!0),s.push({group:e,key:a})})),o&&await this.#N(),i.forEach((t=>{a.ZP.emit(e.W1.TASKS_PERIOD_ROLLED_OVER,t)})),{state:t,active:s}}#aa(e,t){switch(e.type){case J.DAILY:return Math.floor(t/864e5);case J.WEEKLY:return Math.floor(t/6048e5);default:return 0}}#oa(e){return e.items.map((e=>({id:e.id,targets:e.targets.map((e=>({id:e.id,progress:0}))),claimed:!1})))}#ta(e,t){let r=e.targets.find((e=>e.id===t));return r||(r={id:t,progress:0},e.targets.push(r)),r}#sa(e,t){return e.targets.every((e=>{const r=t.targets.find((t=>t.id===e.id));return null!=r&&r.progress>=e.amount}))}#ra(e,t,r){let s=null;return e.some((({group:e,key:i})=>{const a=t.groups[i].tasks.find((e=>e.id===r));return!!a&&(s={group:e,task:a},!0)})),s}#Qi(e,t){return e.items.find((e=>e.id===t))}#ea(e,t,r){const s=r.targets.map((e=>{const r=t.targets.find((t=>t.id===e.id)),s=Math.min(r?r.progress:0,e.amount);return{id:e.id,amount:e.amount,progress:s,completed:s>=e.amount}}));return{id:r.id,type:e.type,targets:s,rewards:r.rewards.map((e=>({id:e.id,amount:e.amount}))),completed:s.every((e=>e.completed)),claimed:t.claimed}}#Ji(e){if(!e||\"object\"!=typeof e)return!1;const t=e,r=Object.values(J);return\"string\"==typeof t.id&&\"string\"==typeof t.type&&r.includes(t.type)&&Array.isArray(t.items)}async#ia(){let e;try{e=await this._platformBridge.getServerTime()}catch{e=Date.now()}return\"number\"==typeof e&&Number.isFinite(e)||(e=Date.now()),e}#M(){return this.#L?Promise.resolve(this.#L):(this.#O||(this.#O=v.Z.get(q,!0).then((e=>(this.#L=this.#k(e),this.#O=null,this.#L))).catch((()=>(this.#L=this.#H(),this.#O=null,this.#L)))),this.#O)}#N(){return this.#L?v.Z.set(q,this.#L):Promise.resolve()}#H(){return{groups:{}}}#k(e){if(!e||\"object\"!=typeof e)return this.#H();const t=e.groups;if(!t||\"object\"!=typeof t)return this.#H();const r={};return Object.keys(t).forEach((e=>{const s=this.#na(t[e]);s&&(r[e]=s)})),{groups:r}}#na(e){if(!e||\"object\"!=typeof e)return null;const t=e;if(\"number\"!=typeof t.periodKey)return null;const r=Array.isArray(t.tasks)?t.tasks.map((e=>this.#da(e))).filter((e=>null!==e)):[];return{periodKey:Math.floor(t.periodKey),tasks:r}}#da(e){if(!e||\"object\"!=typeof e)return null;const t=e;if(\"string\"!=typeof t.id)return null;const r=Array.isArray(t.targets)?t.targets.map((e=>this.#la(e))).filter((e=>null!==e)):[];return{id:t.id,targets:r,claimed:!0===t.claimed}}#la(e){if(!e||\"object\"!=typeof e)return null;const t=e;if(\"string\"!=typeof t.id)return null;const r=\"number\"==typeof t.progress&&t.progress>=0?Math.floor(t.progress):0;return{id:t.id,progress:r}}}const Q=new X;var ee=r(5555),te=r(8166);const re={};re[t.Lb.VK]=()=>Promise.resolve().then(r.bind(r,7226)),re[t.Lb.OK]=()=>Promise.resolve().then(r.bind(r,9623)),re[t.Lb.YANDEX]=()=>Promise.resolve().then(r.bind(r,1323)),re[t.Lb.CRAZY_GAMES]=()=>Promise.resolve().then(r.bind(r,9163)),re[t.Lb.GAME_DISTRIBUTION]=()=>Promise.resolve().then(r.bind(r,3777)),re[t.Lb.PLAYGAMA]=()=>Promise.resolve().then(r.bind(r,3153)),re[t.Lb.STANDALONE]=()=>Promise.resolve().then(r.bind(r,8200)),re[t.Lb.TELEGRAM]=()=>Promise.resolve().then(r.bind(r,6465)),re[t.Lb.Y8]=()=>Promise.resolve().then(r.bind(r,3369)),re[t.Lb.LAGGED]=()=>Promise.resolve().then(r.bind(r,4902)),re[t.Lb.FACEBOOK]=()=>Promise.resolve().then(r.bind(r,2769)),re[t.Lb.POKI]=()=>Promise.resolve().then(r.bind(r,7789)),re[t.Lb.QA_TOOL]=()=>Promise.resolve().then(r.bind(r,1298)),re[t.Lb.MSN]=()=>Promise.resolve().then(r.bind(r,5244)),re[t.Lb.MICROSOFT_STORE]=()=>Promise.resolve().then(r.bind(r,4951)),re[t.Lb.HUAWEI]=()=>Promise.resolve().then(r.bind(r,7490)),re[t.Lb.GAMEPUSH]=()=>Promise.resolve().then(r.bind(r,4499)),re[t.Lb.DISCORD]=()=>Promise.resolve().then(r.bind(r,1634)),re[t.Lb.JIO_GAMES]=()=>Promise.resolve().then(r.bind(r,2974)),re[t.Lb.YOUTUBE]=()=>Promise.resolve().then(r.bind(r,8347)),re[t.Lb.PORTAL]=()=>Promise.resolve().then(r.bind(r,6328)),re[t.Lb.REDDIT]=()=>Promise.resolve().then(r.bind(r,6539)),re[t.Lb.XIAOMI]=()=>Promise.resolve().then(r.bind(r,7121)),re[t.Lb.TIKTOK]=()=>Promise.resolve().then(r.bind(r,755)),re[t.Lb.DLIGHTEK]=()=>Promise.resolve().then(r.bind(r,7430)),re[t.Lb.GAMESNACKS]=()=>Promise.resolve().then(r.bind(r,9819)),re[t.Lb.SAMSUNG]=()=>Promise.resolve().then(r.bind(r,9793));const se=[{platformId:t.Lb.YANDEX,predicate:({hostname:e,hash:t})=>e.includes([\"y\",\"a\",\"n\",\"d\",\"e\",\"x\",\".\",\"n\",\"e\",\"t\"].join(\"\"))||t.includes(\"yandex\")},{platformId:t.Lb.CRAZY_GAMES,predicate:({hostname:e})=>e.includes(\"crazygames.\")||e.includes(\"1001juegos.com\")},{platformId:t.Lb.GAME_DISTRIBUTION,predicate:({hostname:e})=>e.includes(\"gamedistribution.com\")},{platformId:t.Lb.LAGGED,predicate:({hostname:e})=>e.includes(\"lagged.\")},{platformId:t.Lb.VK,predicate:({searchParams:e})=>e.has(\"api_id\")&&e.has(\"viewer_id\")&&e.has(\"auth_key\")||e.has(\"vk_app_id\")},{platformId:t.Lb.TELEGRAM,predicate:({hash:e})=>e.includes(\"tgWebAppData\")},{platformId:t.Lb.Y8,predicate:({hostname:e})=>e.includes(\"y8\")},{platformId:t.Lb.FACEBOOK,predicate:({hostname:e})=>e.includes(\"fbsbx\")},{platformId:t.Lb.POKI,predicate:({hostname:e})=>e.includes(\"poki-gdn\")||e.includes(\"poki-user-content\")},{platformId:t.Lb.MSN,predicate:({hostname:e})=>e.includes(\"msn.\")||e.includes(\"msnfun.\")||e.includes(\"start.gg\")},{platformId:t.Lb.GAMEPUSH,predicate:({hostname:e})=>e.includes(\"eponesh.\")},{platformId:t.Lb.DISCORD,predicate:({hostname:e})=>e.includes(\"discordsays.com\")},{platformId:t.Lb.YOUTUBE,predicate:({hostname:e})=>e.includes(\"usercontent.goog\")},{platformId:t.Lb.PORTAL,predicate:({hostname:e})=>e.includes(\"portalapp.\")},{platformId:t.Lb.REDDIT,predicate:({hostname:e})=>e.includes(\"devvit.\")},{platformId:t.Lb.DLIGHTEK,predicate:({hostname:e})=>e.includes(\"hippoobox.com\")||e.includes(\"ahagamecenter.com\")},{platformId:t.Lb.TIKTOK,predicate:({win:e})=>void 0!==e.TTMinis},{platformId:t.Lb.GAMESNACKS,predicate:({win:e})=>void 0!==e.GameSnacks},{platformId:t.Lb.SAMSUNG,predicate:({win:e})=>void 0!==e.GSInstant}];function ie(e){return Object.values(t.Lb).includes(e)?e:t.Lb.MOCK}class ae{get version(){return\"2.1.0\"}get isInitialized(){return this.#ha}get options(){return this.#ca?.options}get platform(){return this.#ua(e.oF.PLATFORM)}get player(){return this.#ua(e.oF.PLAYER)}get storage(){return this.#ua(e.oF.STORAGE)}get advertisement(){return this.#ua(e.oF.ADVERTISEMENT)}get social(){return this.#ua(e.oF.SOCIAL)}get device(){return this.#ua(e.oF.DEVICE)}get leaderboards(){return this.#ua(e.oF.LEADERBOARDS)}get payments(){return this.#ua(e.oF.PAYMENTS)}get achievements(){return this.#ua(e.oF.ACHIEVEMENTS)}get remoteConfig(){return this.#ua(e.oF.REMOTE_CONFIG)}get clipboard(){return this.#ua(e.oF.CLIPBOARD)}get notifications(){return this.#ua(e.oF.NOTIFICATIONS)}get analytics(){return this.#ua(e.oF.ANALYTICS)}get dailyRewards(){return this.#ua(e.oF.DAILY_REWARDS)}get tasks(){return this.#ua(e.oF.TASKS)}get crossPromo(){return this.#ua(e.oF.CROSS_PROMO)}get engine(){return this.#pa}set engine(e){this.#pa=e}set gameVersion(e){y.ZP.gameVersion=e}#ha=!1;#ma=null;#ca=null;#_a={};#ga=null;#Sa=null;#pa=\"javascript\";async initialize(r){if(this.#ha)return Promise.resolve();if(!this.#ma){this.#ma=new o.Z;const s=new URL(window.location.href),i=s.searchParams.has(g.zY);i&&(g.ZP.enabled=\"false\"!==s.searchParams.get(g.zY)),g.ZP.info(\"Initialization started\");const a=performance.now(),n=r?.configFilePath;await f.ZP.load(n,r);const d=function(e){const r=new URL(window.location.href);if(e)return ie(String(e).toLowerCase());if(r.searchParams.has(\"platform_id\"))return ie((r.searchParams.get(\"platform_id\")??\"\").toLowerCase());const s={url:r,hostname:r.hostname,hash:r.hash,searchParams:r.searchParams,referrer:document.referrer,win:window},i=se.find((({predicate:e})=>e(s)));return i?i.platformId:t.Lb.MOCK}(f.ZP.getRawValues().forciblySetPlatformId);f.ZP.initialize(d),(0,P.as)(d),i||(g.ZP.enabled=!0===f.ZP.getValues().debug),g.ZP.info(\"Config loaded\"),(0,b.CS)(),await this.#Aa(d);const l=this.#ca;l.engine=this.engine,this.#Ea(l);[{name:e.oF.PLATFORM,module:T},{name:e.oF.PLAYER,module:w.Z},{name:e.oF.STORAGE,module:v.Z},{name:e.oF.ADVERTISEMENT,module:R.ZP},{name:e.oF.SOCIAL,module:L},{name:e.oF.DEVICE,module:N},{name:e.oF.LEADERBOARDS,module:G},{name:e.oF.PAYMENTS,module:F.ZP},{name:e.oF.REMOTE_CONFIG,module:U},{name:e.oF.CLIPBOARD,module:Z},{name:e.oF.ACHIEVEMENTS,module:j.ZP},{name:e.oF.NOTIFICATIONS,module:W},{name:e.oF.ANALYTICS,module:y.ZP},{name:e.oF.DAILY_REWARDS,module:$},{name:e.oF.TASKS,module:Q},{name:e.oF.CROSS_PROMO,module:ee.Z}].forEach((({name:e,module:t})=>{t.initialize(l),this.#_a[e]=(0,g.dw)(e,t)})),l.initialize().then((()=>{this.#ha=!0,this.#fa(l),g.ZP.banner(`PlaygamaBridge v${this.version} initialized.`),this.#ma&&(this.#ma.resolve(),this.#ma=null);const t=f.ZP.getValues().advertisement,r=this.#_a[e.oF.ADVERTISEMENT];t?.interstitial?.preloadOnStart&&r.preloadInterstitial(t.interstitial.preloadOnStart),t?.rewarded?.preloadOnStart&&r.preloadRewarded(t.rewarded.preloadOnStart)})).catch((t=>{this.#Sa?.cancel();const r=((performance.now()-a)/1e3).toFixed(2),s=t?.message||String(t);y.rh.send(`${e.oF.CORE}_initialization_failed`,{error:s,time_s:r});const i=new e.Hd(e.Bq.INITIALIZATION_FAILED,t);g.ZP.error(i.message,t),this.#ma&&(this.#ma.reject(i),this.#ma=null)})).finally((()=>{setTimeout((()=>this.#ga?.setProgress(100,!0)),700)}))}return this.#ma.promise}setGameLoadingProgress(e){this.#ga?.setProgress(e)}async#Aa(e){g.ZP.info(`Platform detected: ${e}`);const t=await async function(e){const t=re[e];if(t){const{default:e}=await t();return e}return te.Z}(e);this.#ca=new t}#Ea(e){const r=f.ZP.getValues();if(!r.disableLoadingLogo){const s=e.platformId!==t.Lb.YANDEX&&e.platformId!==t.Lb.Y8&&!1!==r.showFullLoadingLogo,i=e.platformId===t.Lb.XIAOMI||!0===r.showLoadingText;this.#ga=new _,this.#ga.show({showFullLogo:s,showLoadingText:i}),r.loadingSound?.url&&(this.#Sa=new S(r.loadingSound),this.#ga.setHideGate(this.#Sa.finished))}r.game?.adaptToSafeArea&&E.applyStyles()}#fa(e){this.#Sa&&(e.isPlatformAudioEnabled?this.#Sa.play():this.#Sa.cancel())}#ua(t){return this.#ha||g.ZP.error(e.pn.SDK_NOT_INITIALIZED.message),this.#_a[t]}}(0,a.iL)(ae.prototype),Object.assign(ae.prototype,{PLATFORM_ID:t.Lb,PLATFORM_MESSAGE:t.Dt,MODULE_NAME:e.oF,EVENT_NAME:e.W1,INTERSTITIAL_STATE:i.WA,REWARDED_STATE:i.b3,BANNER_STATE:i.Kk,DEVICE_TYPE:s.me,DEVICE_ORIENTATION:s.AR,LAUNCH_SOURCE:e.LS});const oe=ae;window.bridge||window.playgamaBridge||(window.bridge=new oe,window.playgamaBridge=window.bridge)})()})();", "", " initializeBridge()", "}" @@ -823,35 +897,16 @@ "objectGroups": [] }, { - "description": "Is Get All Games Supported.", - "fullName": "Is Get All Games Supported", - "functionType": "Condition", - "group": "Platform", - "name": "IsGetAllGamesSupported", - "sentence": "Is Get All Games Supported", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = bridge.platform.isGetAllGamesSupported;", - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Is Get Game By Id Supported.", - "fullName": "Is Get Game By Id Supported", + "description": "Is External Calls Supported.", + "fullName": "Is External Calls Supported", "functionType": "Condition", "group": "Platform", - "name": "IsGetGameByIdSupported", - "sentence": "Is Get Game By Id Supported", + "name": "IsExternalCallsSupported", + "sentence": "Is External Calls Supported", "events": [ { "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = bridge.platform.isGetGameByIdSupported;", + "inlineCode": "eventsFunctionContext.returnValue = bridge.platform.isExternalCallsSupported;", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false @@ -861,35 +916,16 @@ "objectGroups": [] }, { - "description": "On Get All Games Completed.", - "fullName": "On Get All Games Completed", + "description": "On Get Games List Completed.", + "fullName": "On Get Games List Completed", "functionType": "Condition", - "group": "Platform", - "name": "OnGetAllGamesCompleted", - "sentence": "On Get All Games Completed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isGetAllGamesCompleted;", - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "On Get Game By Id Completed.", - "fullName": "On Get Game By Id Completed", - "functionType": "Condition", - "group": "Platform", - "name": "OnGetGameByIdCompleted", - "sentence": "On Get Game By Id Completed", + "group": "Cross Promo", + "name": "OnGetGamesListCompleted", + "sentence": "On Get Games List Completed", "events": [ { "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isGetGameByIdCompleted;", + "inlineCode": "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isGetGamesListCompleted;", "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false @@ -899,12 +935,12 @@ "objectGroups": [] }, { - "description": "Platform Get All Games.", - "fullName": "Platform Get All Games", + "description": "Cross Promo Get Games List.", + "fullName": "Cross Promo Get Games List", "functionType": "Action", - "group": "Platform", - "name": "PlatformGetAllGames", - "sentence": "Platform Get All Games", + "group": "Cross Promo", + "name": "CrossPromoGetGamesList", + "sentence": "Cross Promo Get Games List", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -912,14 +948,14 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "return new Promise(resolve => {", - " bridge.platform.getAllGames()", + " bridge.crossPromo.getGames()", " .then(data => {", " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", - " gdjs._playgamaBridgeExtension.allGames = data;", + " gdjs._playgamaBridgeExtension.crossPromoGames = Array.isArray(data) ? data : [];", " })", " .catch(error => console.log(error))", " .finally(() => {", - " gdjs._playgamaBridgeExtension.nextIsGetAllGamesCompleted = true;", + " gdjs._playgamaBridgeExtension.nextIsGetGamesListCompleted = true;", " resolve();", " });", "});", @@ -934,12 +970,12 @@ "objectGroups": [] }, { - "description": "Platform Get Game By Id.", - "fullName": "Platform Get Game By Id", + "description": "Cross Promo Show.", + "fullName": "Cross Promo Show", "functionType": "Action", - "group": "Platform", - "name": "PlatformGetGameById", - "sentence": "Platform Get Game By Id", + "group": "Cross Promo", + "name": "CrossPromoShow", + "sentence": "Cross Promo Show", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -947,15 +983,12 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "return new Promise(resolve => {", - " bridge.platform.getGameById(gdjs._playgamaBridgeExtension.actionParametersContainer)", - " .then(data => {", + " Promise.resolve(bridge.crossPromo.show())", + " .then(() => {", " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", - " gdjs._playgamaBridgeExtension.gameById = data;", " })", " .catch(error => console.log(error))", " .finally(() => {", - " gdjs._playgamaBridgeExtension.actionParametersContainer = {};", - " gdjs._playgamaBridgeExtension.nextIsGetGameByIdCompleted = true;", " resolve();", " });", "});", @@ -970,17 +1003,55 @@ "objectGroups": [] }, { - "description": "Platform All Games Count.", - "fullName": "Platform All Games Count", + "description": "Cross Promo Hide.", + "fullName": "Cross Promo Hide", + "functionType": "Action", + "group": "Cross Promo", + "name": "CrossPromoHide", + "sentence": "Cross Promo Hide", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "bridge.crossPromo.hide();", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Cross Promo Is Visible.", + "fullName": "Cross Promo Is Visible", + "functionType": "Condition", + "group": "Cross Promo", + "name": "CrossPromoIsVisible", + "sentence": "Cross Promo Is Visible", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = bridge.crossPromo.isVisible;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Cross Promo Games Count.", + "fullName": "Cross Promo Games Count", "functionType": "Expression", - "group": "Platform", - "name": "PlatformAllGamesCount", + "group": "Cross Promo", + "name": "CrossPromoGamesCount", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.allGames.length;", + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.crossPromoGames.length;", "" ], "parameterObjects": "", @@ -995,18 +1066,18 @@ "objectGroups": [] }, { - "description": "Platform All Game Properties Count.", - "fullName": "Platform All Game Properties Count", + "description": "Cross Promo Game Properties Count.", + "fullName": "Cross Promo Game Properties Count", "functionType": "Expression", - "group": "Platform", - "name": "PlatformAllGamePropertiesCount", + "group": "Cross Promo", + "name": "CrossPromoGamePropertiesCount", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.allGames.length > 0 ", - " ? Object.keys(gdjs._playgamaBridgeExtension.allGames[0] || {}).length", + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.crossPromoGames.length > 0 ", + " ? Object.keys(gdjs._playgamaBridgeExtension.crossPromoGames[0] || {}).length", " : 0" ], "parameterObjects": "", @@ -1021,11 +1092,11 @@ "objectGroups": [] }, { - "description": "Platform All Games Property Name.", - "fullName": "Platform All Games Property Name", + "description": "Cross Promo Games Property Name.", + "fullName": "Cross Promo Games Property Name", "functionType": "StringExpression", - "group": "Platform", - "name": "PlatformAllGamesPropertyName", + "group": "Cross Promo", + "name": "CrossPromoGamesPropertyName", "sentence": "", "events": [ { @@ -1033,8 +1104,8 @@ "inlineCode": [ "const propertyIndex = eventsFunctionContext.getArgument(\"PropertyIndex\");", "", - "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.allGames", - " ? Object.keys(gdjs._playgamaBridgeExtension.allGames[0])[propertyIndex]", + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.crossPromoGames.length > 0", + " ? Object.keys(gdjs._playgamaBridgeExtension.crossPromoGames[0])[propertyIndex]", " : '';", "", "" @@ -1057,11 +1128,11 @@ "objectGroups": [] }, { - "description": "Platform All Games Property Value.", - "fullName": "Platform All Games Property Value", + "description": "Cross Promo Games Property Value.", + "fullName": "Cross Promo Games Property Value", "functionType": "StringExpression", - "group": "Platform", - "name": "PlatformAllGamesPropertyValue", + "group": "Cross Promo", + "name": "CrossPromoGamesPropertyValue", "sentence": "", "events": [ { @@ -1070,8 +1141,8 @@ "const gameIndex = eventsFunctionContext.getArgument(\"GameIndex\");", "const property = eventsFunctionContext.getArgument(\"Property\");", "", - "if (gdjs._playgamaBridgeExtension.allGames.length > 0) {", - " const game = gdjs._playgamaBridgeExtension.allGames[gameIndex];", + "if (gdjs._playgamaBridgeExtension.crossPromoGames.length > 0) {", + " const game = gdjs._playgamaBridgeExtension.crossPromoGames[gameIndex];", "", " eventsFunctionContext.returnValue = isNaN(+property) ", " ? game[property]", @@ -1103,50 +1174,6 @@ ], "objectGroups": [] }, - { - "description": "Platform Game By Id Property Value.", - "fullName": "Platform Game By Id Property Value", - "functionType": "Expression", - "group": "Platform", - "name": "PlatformGameByIdPropertyValue", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const property = eventsFunctionContext.getArgument(\"Property\");", - "", - "if (!gdjs._playgamaBridgeExtension.gameById) {", - " eventsFunctionContext.returnValue = '';", - " return;", - "}", - "", - "if (typeof property === 'number') {", - " let properties = Object.keys(gdjs._playgamaBridgeExtension.gameById);", - " let propertyName = properties[property];", - " eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.gameById[propertyName];", - " return;", - "}", - "", - "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.gameById[property];" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Property", - "name": "Property", - "type": "string" - } - ], - "objectGroups": [] - }, { "description": "Platform On Audio State Changed.", "fullName": "Platform On Audio State Changed", @@ -1497,81 +1524,6 @@ ], "objectGroups": [] }, - { - "description": "Visibility State.", - "fullName": "Visibility State", - "functionType": "StringExpression", - "group": "Game", - "name": "VisibilityState", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.visibilityState !== null", - " ? gdjs._playgamaBridgeExtension.visibilityState", - " : bridge.game.visibilityState;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [], - "objectGroups": [] - }, - { - "description": "On Visibility State Changed.", - "fullName": "On Visibility State Changed", - "functionType": "Condition", - "group": "Game", - "name": "OnVisibilityStateChanged", - "sentence": "On Visibility State Changed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isVisibilityStateChanged;", - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Default Storage Type.", - "fullName": "Default Storage Type", - "functionType": "StringExpression", - "group": "Storage", - "name": "DefaultStorageType", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "eventsFunctionContext.returnValue = bridge.storage.defaultType;", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [], - "objectGroups": [] - }, { "description": "Storage Data.", "fullName": "Storage Data", @@ -1758,7 +1710,7 @@ "functionType": "Action", "group": "Storage", "name": "SendStorageDataGetRequest", - "sentence": "Send Storage Data Get Request _PARAM1_", + "sentence": "Send Storage Data Get Request", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -1766,10 +1718,9 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "const { storageData, storageDataGetRequestKeys } = gdjs._playgamaBridgeExtension;", - "const storageType = eventsFunctionContext.getArgument(\"StorageType\");", "", "return new Promise(resolve => {", - " bridge.storage.get(storageDataGetRequestKeys, storageType === \"default\" ? null : storageType)", + " bridge.storage.get(storageDataGetRequestKeys)", " .then(data => {", " for (let i = 0; i < data.length; i++) {", " let key = storageDataGetRequestKeys[i];", @@ -1793,14 +1744,7 @@ "eventsSheetExpanded": true } ], - "parameters": [ - { - "description": "Storage Type", - "name": "StorageType", - "supplementaryInformation": "[\"default\",\"local_storage\",\"platform_internal\"]", - "type": "stringWithSelector" - } - ], + "parameters": [], "objectGroups": [] }, { @@ -1809,7 +1753,7 @@ "functionType": "Action", "group": "Storage", "name": "SendStorageDataSetRequest", - "sentence": "Send Storage Data Set Request _PARAM1_", + "sentence": "Send Storage Data Set Request", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -1817,10 +1761,9 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false", "", "const { storageData, storageDataSetRequestKeys, storageDataSetRequestValues } = gdjs._playgamaBridgeExtension;", - "const storageType = eventsFunctionContext.getArgument(\"StorageType\");", "", "return new Promise(resolve => {", - " bridge.storage.set(storageDataSetRequestKeys, storageDataSetRequestValues, storageType === \"default\" ? null : storageType)", + " bridge.storage.set(storageDataSetRequestKeys, storageDataSetRequestValues)", " .then(() => {", " for (let i = 0; i < storageDataSetRequestKeys.length; i++) {", " let key = storageDataSetRequestKeys[i]", @@ -1844,14 +1787,7 @@ "eventsSheetExpanded": true } ], - "parameters": [ - { - "description": "Storage Type", - "name": "StorageType", - "supplementaryInformation": "[\"default\",\"local_storage\",\"platform_internal\"]", - "type": "stringWithSelector" - } - ], + "parameters": [], "objectGroups": [] }, { @@ -1860,7 +1796,7 @@ "functionType": "Action", "group": "Storage", "name": "SendStorageDataDeleteRequest", - "sentence": "Send Storage Data Delete Request _PARAM1_", + "sentence": "Send Storage Data Delete Request", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -1868,10 +1804,9 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "const { storageData, storageDataDeleteRequestKeys } = gdjs._playgamaBridgeExtension;", - "const storageType = eventsFunctionContext.getArgument(\"StorageType\");", "", "return new Promise(resolve => {", - " bridge.storage.delete(storageDataDeleteRequestKeys, storageType === \"default\" ? null : storageType)", + " bridge.storage.delete(storageDataDeleteRequestKeys)", " .then(() => {", " if (storageData) {", " for (const key of storageDataDeleteRequestKeys) {", @@ -1895,14 +1830,7 @@ "eventsSheetExpanded": true } ], - "parameters": [ - { - "description": "Storage Type", - "name": "StorageType", - "supplementaryInformation": "[\"default\",\"local_storage\",\"platform_internal\"]", - "type": "stringWithSelector" - } - ], + "parameters": [], "objectGroups": [] }, { @@ -1996,18 +1924,19 @@ "objectGroups": [] }, { - "description": "Is Storage Supported.", - "fullName": "Is Storage Supported", - "functionType": "Condition", - "group": "Storage", - "name": "IsStorageSupported", - "sentence": "Is Storage Supported _PARAM1_", + "description": "Set Minimum Delay Between Interstitial.", + "fullName": "Set Minimum Delay Between Interstitial", + "functionType": "Action", + "group": "Advertisement", + "name": "SetMinimumDelayBetweenInterstitial", + "sentence": "Set Minimum Delay Between Interstitial _PARAM1_", "events": [ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "const storageType = eventsFunctionContext.getArgument(\"StorageType\");", - "eventsFunctionContext.returnValue = bridge.storage.isSupported(storageType);", + "const seconds = eventsFunctionContext.getArgument(\"Seconds\");", + "", + "bridge.advertisement.setMinimumDelayBetweenInterstitial(seconds);", "" ], "parameterObjects": "", @@ -2017,28 +1946,27 @@ ], "parameters": [ { - "description": "Storage Type", - "name": "StorageType", - "supplementaryInformation": "[\"platform_internal\",\"local_storage\"]", - "type": "stringWithSelector" + "description": "Seconds", + "name": "Seconds", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Is Storage Available.", - "fullName": "Is Storage Available", - "functionType": "Condition", - "group": "Storage", - "name": "IsStorageAvailable", - "sentence": "Is Storage Available _PARAM1_", + "description": "Show Banner.", + "fullName": "Show Banner", + "functionType": "Action", + "group": "Advertisement", + "name": "ShowBanner", + "sentence": "Show Banner on _PARAM1_ with placement _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "const storageType = eventsFunctionContext.getArgument(\"StorageType\");", - "eventsFunctionContext.returnValue = bridge.storage.isAvailable(storageType);", - "" + "const position = eventsFunctionContext.getArgument(\"Position\");", + "const placement = eventsFunctionContext.getArgument(\"Placement\");", + "bridge.advertisement.showBanner(position, placement);" ], "parameterObjects": "", "useStrict": true, @@ -2047,69 +1975,9 @@ ], "parameters": [ { - "description": "Storage Type", - "name": "StorageType", - "supplementaryInformation": "[\"platform_internal\",\"local_storage\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Set Minimum Delay Between Interstitial.", - "fullName": "Set Minimum Delay Between Interstitial", - "functionType": "Action", - "group": "Advertisement", - "name": "SetMinimumDelayBetweenInterstitial", - "sentence": "Set Minimum Delay Between Interstitial _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const seconds = eventsFunctionContext.getArgument(\"Seconds\");", - "", - "bridge.advertisement.setMinimumDelayBetweenInterstitial(seconds);", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Seconds", - "name": "Seconds", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Show Banner.", - "fullName": "Show Banner", - "functionType": "Action", - "group": "Advertisement", - "name": "ShowBanner", - "sentence": "Show Banner on _PARAM1_ with placement _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const position = eventsFunctionContext.getArgument(\"Position\");", - "const placement = eventsFunctionContext.getArgument(\"Placement\");", - "bridge.advertisement.showBanner(position, placement);" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [ - { - "description": "Position", - "name": "Position", - "supplementaryInformation": "[\"bottom\",\"top\"]", + "description": "Position", + "name": "Position", + "supplementaryInformation": "[\"bottom\",\"top\"]", "type": "stringWithSelector" }, { @@ -2181,7 +2049,9 @@ "events": [ { "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "bridge.advertisement.hideAdvancedBanners();", + "inlineCode": [ + "bridge.advertisement.hideAdvancedBanners();" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false @@ -3581,6 +3451,28 @@ "parameters": [], "objectGroups": [] }, + { + "description": "Is Player Guest.", + "fullName": "Is Player Guest", + "functionType": "Condition", + "group": "Player", + "name": "IsPlayerGuest", + "sentence": "Is Player Guest", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = bridge.player.isGuest;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, { "description": "On Authorize Player Completed.", "fullName": "On Authorize Player Completed", @@ -4201,14 +4093,14 @@ "description": "Is External Links Allowed.", "fullName": "Is External Links Allowed", "functionType": "Condition", - "group": "Social", + "group": "Platform", "name": "IsExternalLinksAllowed", "sentence": "Is External Links Allowed", "events": [ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "eventsFunctionContext.returnValue = bridge.social.isExternalLinksAllowed;", + "eventsFunctionContext.returnValue = bridge.platform.isExternalLinksAllowed;", "" ], "parameterObjects": "", @@ -5468,72 +5360,6 @@ ], "objectGroups": [] }, - { - "description": "Is Achievements Supported.", - "fullName": "Is Achievements Supported", - "functionType": "Condition", - "group": "Achievements", - "name": "IsAchievementsSupported", - "sentence": "Is Achievements Supported", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "eventsFunctionContext.returnValue = bridge.achievements.isSupported;", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Is Achievements Get List Supported.", - "fullName": "Is Achievements Get List Supported", - "functionType": "Condition", - "group": "Achievements", - "name": "IsAchievementsGetListSupported", - "sentence": "Is Achievements Get List Supported", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "eventsFunctionContext.returnValue = bridge.achievements.isGetListSupported;", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Is Achievements Native Popup Supported.", - "fullName": "Is Achievements Native Popup Supported", - "functionType": "Condition", - "group": "Achievements", - "name": "IsAchievementsNativePopupSupported", - "sentence": "Is Achievements Native Popup Supported", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "eventsFunctionContext.returnValue = bridge.achievements.isNativePopupSupported;", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, { "description": "On Achievements Unlock Completed.", "fullName": "On Achievements Unlock Completed", @@ -5578,28 +5404,6 @@ "parameters": [], "objectGroups": [] }, - { - "description": "On Achievements Show Native Popup Completed.", - "fullName": "On Achievements Show Native Popup Completed", - "functionType": "Condition", - "group": "Achievements", - "name": "OnAchievementsShowNativePopupCompleted", - "sentence": "On Achievements Show Native Popup Completed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isAchievementsShowNativePopupCompleted;", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, { "description": "Achievements Count.", "fullName": "Achievements Count", @@ -5744,7 +5548,7 @@ "functionType": "Action", "group": "Achievements", "name": "AchievementsUnlock", - "sentence": "Achievements Unlock", + "sentence": "Achievements Unlock - Id: _PARAM1_", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -5752,13 +5556,13 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "return new Promise(resolve => {", - " bridge.achievements.unlock(gdjs._playgamaBridgeExtension.actionParametersContainer)", + " const id = eventsFunctionContext.getArgument('Id');", + " bridge.achievements.unlock(id)", " .then(() => {", " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", " })", " .catch(error => console.log(error))", " .finally(() => {", - " gdjs._playgamaBridgeExtension.actionParametersContainer = {};", " gdjs._playgamaBridgeExtension.nextIsAchievementsUnlockCompleted = true;", " resolve();", " });", @@ -5770,7 +5574,13 @@ "eventsSheetExpanded": true } ], - "parameters": [], + "parameters": [ + { + "description": "Id", + "name": "Id", + "type": "string" + } + ], "objectGroups": [] }, { @@ -5787,14 +5597,13 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "return new Promise(resolve => {", - " bridge.achievements.getList(gdjs._playgamaBridgeExtension.actionParametersContainer)", + " bridge.achievements.getAchievements()", " .then(data => {", " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", " gdjs._playgamaBridgeExtension.achievementsList = data;", " })", " .catch(error => console.log(error))", " .finally(() => {", - " gdjs._playgamaBridgeExtension.actionParametersContainer = {};", " gdjs._playgamaBridgeExtension.nextIsAchievementsGetListCompleted = true;", " resolve();", " });", @@ -5808,41 +5617,6 @@ "parameters": [], "objectGroups": [] }, - { - "description": "Achievements Show Native Popup.", - "fullName": "Achievements Show Native Popup", - "functionType": "Action", - "group": "Achievements", - "name": "AchievementsShowNativePopup", - "sentence": "Achievements Show Native Popup", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", - "", - "return new Promise(resolve => {", - " bridge.achievements.showNativePopup(gdjs._playgamaBridgeExtension.actionParametersContainer)", - " .then(() => {", - " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", - " })", - " .catch(error => console.log(error))", - " .finally(() => {", - " gdjs._playgamaBridgeExtension.actionParametersContainer = {};", - " gdjs._playgamaBridgeExtension.nextIsAchievementsShowNativePopupCompleted = true;", - " resolve();", - " });", - "});", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, { "description": "Is Remote Config Supported.", "fullName": "Is Remote Config Supported", @@ -5968,7 +5742,8 @@ "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", "", "return new Promise(resolve => {", - " window.bridge.remoteConfig.get(gdjs._playgamaBridgeExtension.actionParametersContainer)", + " window.bridge.remoteConfig.setContext(gdjs._playgamaBridgeExtension.actionParametersContainer)", + " window.bridge.remoteConfig.get()", " .then(data => {", " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", " gdjs._playgamaBridgeExtension.remoteConfig = data;", @@ -6007,625 +5782,1212 @@ ], "parameters": [], "objectGroups": [] - } - ], - "eventsFunctionsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "functionName": "onFirstSceneLoaded" - }, - { - "folderName": "Common", - "children": [ - { - "functionName": "AddActionParameter" - }, - { - "functionName": "AddBoolActionParameter" - }, - { - "functionName": "IsInitialized" - }, - { - "functionName": "IsLastActionCompletedSuccessfully" - } - ] - }, - { - "folderName": "Platform", - "children": [ - { - "functionName": "PlatformId" - }, - { - "functionName": "PlatformLanguage" - }, - { - "functionName": "PlatformPayload" - }, - { - "functionName": "PlatformTld" - }, - { - "functionName": "PlatformIsAudioEnabled" - }, - { - "functionName": "PlatformIsPaused" - }, - { - "functionName": "IsGetAllGamesSupported" - }, - { - "functionName": "IsGetGameByIdSupported" - }, - { - "functionName": "OnGetAllGamesCompleted" - }, - { - "functionName": "OnGetGameByIdCompleted" - }, - { - "functionName": "PlatformGetAllGames" - }, - { - "functionName": "PlatformGetGameById" - }, - { - "functionName": "PlatformAllGamesCount" - }, - { - "functionName": "PlatformAllGamePropertiesCount" - }, - { - "functionName": "PlatformAllGamesPropertyName" - }, - { - "functionName": "PlatformAllGamesPropertyValue" - }, - { - "functionName": "PlatformGameByIdPropertyValue" - }, - { - "functionName": "PlatformOnAudioStateChanged" - }, - { - "functionName": "PlatformOnPauseStateChanged" - }, - { - "functionName": "SendMessage" - }, - { - "functionName": "SendCustomMessage" - }, - { - "functionName": "GetServerTime" - }, - { - "functionName": "ServerTime" - }, - { - "functionName": "OnGetServerTimeCompleted" - }, - { - "functionName": "HasServerTime" - } - ] - }, - { - "folderName": "Device", - "children": [ - { - "functionName": "DeviceType" - }, - { - "functionName": "IsMobile" - }, - { - "functionName": "IsTablet" - }, - { - "functionName": "IsDesktop" - }, - { - "functionName": "IsTv" - } - ] - }, - { - "folderName": "Player", - "children": [ - { - "functionName": "PlayerId" - }, - { - "functionName": "PlayerName" - }, - { - "functionName": "PlayerExtraPropertiesCount" - }, - { - "functionName": "PlayerExtraPropertyName" - }, - { - "functionName": "PlayerExtraPropertyValue" - }, - { - "functionName": "PlayerPhotosCount" - }, - { - "functionName": "PlayerPhoto" - }, - { - "functionName": "AuthorizePlayer" - }, - { - "functionName": "IsPlayerAuthorizationSupported" - }, - { - "functionName": "IsPlayerAuthorized" - }, - { - "functionName": "OnAuthorizePlayerCompleted" - }, - { - "functionName": "DoesPlayerHaveName" - }, - { - "functionName": "DoesPlayerHavePhoto" - } - ] - }, - { - "folderName": "Game", - "children": [ - { - "functionName": "VisibilityState" - }, - { - "functionName": "OnVisibilityStateChanged" - } - ] - }, - { - "folderName": "Storage", - "children": [ - { - "functionName": "DefaultStorageType" - }, - { - "functionName": "StorageData" - }, - { - "functionName": "StorageDataAsJSON" - }, - { - "functionName": "AppendStorageDataGetRequest" - }, - { - "functionName": "AppendStorageDataSetRequest" - }, - { - "functionName": "AppendStorageDataDeleteRequest" - }, - { - "functionName": "SendStorageDataGetRequest" - }, - { - "functionName": "SendStorageDataSetRequest" - }, - { - "functionName": "SendStorageDataDeleteRequest" - }, - { - "functionName": "OnStorageDataGetRequestCompleted" - }, - { - "functionName": "OnStorageDataSetRequestCompleted" - }, - { - "functionName": "OnStorageDataDeleteRequestCompleted" - }, - { - "functionName": "HasStorageData" - }, - { - "functionName": "IsStorageSupported" - }, - { - "functionName": "IsStorageAvailable" - } - ] - }, - { - "folderName": "Advertisement", - "children": [ - { - "functionName": "SetMinimumDelayBetweenInterstitial" - }, - { - "functionName": "ShowBanner" - }, - { - "functionName": "HideBanner" - }, - { - "functionName": "ShowAdvancedBanners" - }, - { - "functionName": "HideAdvancedBanners" - }, - { - "functionName": "ShowInterstitial" - }, - { - "functionName": "ShowRewarded" - }, - { - "functionName": "CheckAdBlock" - }, - { - "functionName": "MinimumDelayBetweenInterstitial" - }, - { - "functionName": "BannerState" - }, - { - "functionName": "InterstitialState" - }, - { - "functionName": "RewardedState" - }, - { - "functionName": "RewardedPlacement" - }, - { - "functionName": "AdvancedBannersState" - }, - { - "functionName": "IsBannerSupported" - }, - { - "functionName": "IsInterstitialSupported" - }, - { - "functionName": "IsRewardedSupported" - }, - { - "functionName": "IsAdvancedBannersSupported" - }, - { - "functionName": "OnBannerStateChanged" - }, - { - "functionName": "OnBannerLoading" - }, - { - "functionName": "OnBannerShown" - }, - { - "functionName": "OnBannerHidden" - }, - { - "functionName": "OnBannerFailed" - }, - { - "functionName": "OnAdvancedBannersStateChanged" - }, - { - "functionName": "OnAdvancedBannersLoading" - }, - { - "functionName": "OnAdvancedBannersShown" - }, - { - "functionName": "OnAdvancedBannersHidden" - }, - { - "functionName": "OnAdvancedBannersFailed" - }, - { - "functionName": "OnInterstitialStateChanged" - }, - { - "functionName": "OnInterstitialLoading" - }, - { - "functionName": "OnInterstitialOpened" - }, - { - "functionName": "OnInterstitialClosed" - }, - { - "functionName": "OnInterstitialFailed" - }, - { - "functionName": "OnRewardedStateChanged" - }, - { - "functionName": "OnRewardedLoading" - }, - { - "functionName": "OnRewardedOpened" - }, - { - "functionName": "OnRewardedClosed" - }, - { - "functionName": "OnRewardedRewarded" - }, - { - "functionName": "OnRewardedFailed" - }, - { - "functionName": "OnCheckAdBlockCompleted" - }, - { - "functionName": "IsAdBlockDetected" - } - ] - }, - { - "folderName": "Social", - "children": [ - { - "functionName": "Share" - }, - { - "functionName": "InviteFriends" - }, - { - "functionName": "JoinCommunity" - }, - { - "functionName": "CreatePost" - }, - { - "functionName": "AddToHomeScreen" - }, - { - "functionName": "AddToFavorites" - }, - { - "functionName": "Rate" - }, - { - "functionName": "IsShareSupported" - }, - { - "functionName": "OnShareCompleted" - }, - { - "functionName": "IsInviteFriendsSupported" - }, - { - "functionName": "OnInviteFriendsCompleted" - }, - { - "functionName": "IsJoinCommunitySupported" - }, - { - "functionName": "OnJoinCommunityCompleted" - }, - { - "functionName": "IsCreatePostSupported" - }, - { - "functionName": "OnCreatePostCompleted" - }, - { - "functionName": "IsAddToHomeScreenSupported" - }, - { - "functionName": "OnAddToHomeScreenCompleted" - }, - { - "functionName": "IsAddToFavoritesSupported" - }, - { - "functionName": "OnAddToFavoritesCompleted" - }, - { - "functionName": "IsRateSupported" - }, - { - "functionName": "OnRateCompleted" - }, - { - "functionName": "IsExternalLinksAllowed" - } - ] - }, - { - "folderName": "Leaderboards", - "children": [ - { - "functionName": "LeaderboardsSetScore" - }, - { - "functionName": "LeaderboardsGetEntries" - }, - { - "functionName": "LeaderboardsShowNativePopup" - }, - { - "functionName": "LeaderboardsType" - }, - { - "functionName": "LeaderboardsTypeNotAvailable" - }, - { - "functionName": "LeaderboardsTypeInGame" - }, - { - "functionName": "LeaderboardsTypeNative" - }, - { - "functionName": "LeaderboardsTypeNativePopup" - }, - { - "functionName": "OnLeaderboardsSetScoreCompleted" - }, - { - "functionName": "OnLeaderboardsGetEntriesCompleted" - }, - { - "functionName": "OnLeaderboardsShowNativePopupCompleted" - }, - { - "functionName": "LeaderboardEntriesCount" - }, - { - "functionName": "LeaderboardEntryId" - }, - { - "functionName": "LeaderboardEntryName" - }, - { - "functionName": "LeaderboardEntryPhoto" - }, - { - "functionName": "LeaderboardEntryRank" - }, - { - "functionName": "LeaderboardEntryScore" - } - ] - }, - { - "folderName": "Payments", - "children": [ - { - "functionName": "PaymentsPurchase" - }, - { - "functionName": "PaymentsGetPurchases" - }, - { - "functionName": "PaymentsGetCatalog" - }, - { - "functionName": "PaymentsConsumePurchase" - }, - { - "functionName": "IsPaymentsSupported" - }, - { - "functionName": "OnPaymentsPurchaseCompleted" - }, - { - "functionName": "OnPaymentsGetPurchasesCompleted" - }, - { - "functionName": "OnPaymentsGetCatalogCompleted" - }, - { - "functionName": "OnPaymentsConsumePurchaseCompleted" - }, - { - "functionName": "PaymentsLastPurchasePropertiesCount" - }, - { - "functionName": "PaymentsLastPurchasePropertyName" - }, - { - "functionName": "PaymentsLastPurchasePropertyValue" - }, - { - "functionName": "PaymentsPurchasesCount" - }, - { - "functionName": "PaymentsPurchasePropertiesCount" - }, - { - "functionName": "PaymentsPurchasePropertyName" - }, - { - "functionName": "PaymentsPurchasePropertyValue" - }, - { - "functionName": "PaymentsCatalogItemsCount" - }, - { - "functionName": "PaymentsCatalogItemPropertiesCount" - }, - { - "functionName": "PaymentsCatalogItemPropertyName" - }, - { - "functionName": "PaymentsCatalogItemPropertyValue" - }, - { - "functionName": "PaymentsFirstCatalogItemPropertyValue" - } - ] - }, - { - "folderName": "Achievements", - "children": [ - { - "functionName": "IsAchievementsSupported" - }, - { - "functionName": "IsAchievementsGetListSupported" - }, - { - "functionName": "IsAchievementsNativePopupSupported" - }, - { - "functionName": "OnAchievementsUnlockCompleted" - }, - { - "functionName": "OnAchievementsGetListCompleted" - }, - { - "functionName": "OnAchievementsShowNativePopupCompleted" - }, - { - "functionName": "AchievementsCount" - }, - { - "functionName": "AchievementPropertiesCount" - }, - { - "functionName": "AchievementPropertyName" - }, - { - "functionName": "AchievementPropertyValue" - }, - { - "functionName": "AchievementsUnlock" - }, - { - "functionName": "AchievementsGetList" - }, - { - "functionName": "AchievementsShowNativePopup" - } - ] - }, - { - "folderName": "Remote", - "children": [ - { - "functionName": "IsRemoteConfigSupported" - }, - { - "functionName": "OnRemoteConfigGotCompleted" - }, - { - "functionName": "HasRemoteConfigValue" - }, - { - "functionName": "RemoteConfigValue" - }, - { - "functionName": "SendRemoteConfigGetRequest" - } - ] - } - ] - }, + }, + { + "description": "Tasks Get Tasks.", + "fullName": "Tasks Get Tasks", + "functionType": "Action", + "group": "Tasks", + "name": "TasksGetTasks", + "sentence": "Tasks Get Tasks", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " bridge.tasks.getTasks()", + " .then(data => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", + " gdjs._playgamaBridgeExtension.tasksList = data;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsTasksGetTasksCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Tasks Add Progress.", + "fullName": "Tasks Add Progress", + "functionType": "Action", + "group": "Tasks", + "name": "TasksAddProgress", + "sentence": "Tasks add progress to _PARAM0_ by _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const metric = eventsFunctionContext.getArgument(\"Metric\");", + "const amount = eventsFunctionContext.getArgument(\"Amount\");", + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " bridge.tasks.addProgress(metric, amount)", + " .then(() => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsTasksAddProgressCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Metric", + "name": "Metric", + "type": "string" + }, + { + "description": "Amount", + "name": "Amount", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Tasks Claim Reward.", + "fullName": "Tasks Claim Reward", + "functionType": "Action", + "group": "Tasks", + "name": "TasksClaimReward", + "sentence": "Tasks claim reward for task _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const taskId = eventsFunctionContext.getArgument(\"TaskId\");", + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " bridge.tasks.claimReward(taskId)", + " .then(claimed => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = claimed === true;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsTasksClaimRewardCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "TaskId", + "name": "TaskId", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "On Tasks Get Tasks Completed.", + "fullName": "On Tasks Get Tasks Completed", + "functionType": "Condition", + "group": "Tasks", + "name": "OnTasksGetTasksCompleted", + "sentence": "On Tasks Get Tasks Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isTasksGetTasksCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "On Tasks Add Progress Completed.", + "fullName": "On Tasks Add Progress Completed", + "functionType": "Condition", + "group": "Tasks", + "name": "OnTasksAddProgressCompleted", + "sentence": "On Tasks Add Progress Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isTasksAddProgressCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "On Tasks Claim Reward Completed.", + "fullName": "On Tasks Claim Reward Completed", + "functionType": "Condition", + "group": "Tasks", + "name": "OnTasksClaimRewardCompleted", + "sentence": "On Tasks Claim Reward Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isTasksClaimRewardCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Is Task Completed.", + "fullName": "Is Task Completed", + "functionType": "Condition", + "group": "Tasks", + "name": "IsTaskCompleted", + "sentence": "Task _PARAM0_ is completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const i = eventsFunctionContext.getArgument(\"TaskIndex\");", + "const t = gdjs._playgamaBridgeExtension.tasksList[i];", + "eventsFunctionContext.returnValue = !!(t && t.completed);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Is Task Claimed.", + "fullName": "Is Task Claimed", + "functionType": "Condition", + "group": "Tasks", + "name": "IsTaskClaimed", + "sentence": "Task _PARAM0_ is claimed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const i = eventsFunctionContext.getArgument(\"TaskIndex\");", + "const t = gdjs._playgamaBridgeExtension.tasksList[i];", + "eventsFunctionContext.returnValue = !!(t && t.claimed);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Is Task Target Completed.", + "fullName": "Is Task Target Completed", + "functionType": "Condition", + "group": "Tasks", + "name": "IsTaskTargetCompleted", + "sentence": "Task _PARAM0_ target _PARAM1_ is completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const i = eventsFunctionContext.getArgument(\"TaskIndex\");", + "const j = eventsFunctionContext.getArgument(\"TargetIndex\");", + "const t = gdjs._playgamaBridgeExtension.tasksList[i];", + "const tg = t && t.targets && t.targets[j];", + "eventsFunctionContext.returnValue = !!(tg && tg.completed);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + }, + { + "description": "Target Index", + "name": "TargetIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Tasks Count.", + "fullName": "Tasks Count", + "functionType": "Expression", + "group": "Tasks", + "name": "TasksCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.tasksList.length;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Task Targets Count.", + "fullName": "Task Targets Count", + "functionType": "Expression", + "group": "Tasks", + "name": "TaskTargetsCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const t = gdjs._playgamaBridgeExtension.tasksList[eventsFunctionContext.getArgument(\"TaskIndex\")];", + "eventsFunctionContext.returnValue = t && t.targets ? t.targets.length : 0;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Task Target Amount.", + "fullName": "Task Target Amount", + "functionType": "Expression", + "group": "Tasks", + "name": "TaskTargetAmount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const t = gdjs._playgamaBridgeExtension.tasksList[eventsFunctionContext.getArgument(\"TaskIndex\")];", + "const tg = t && t.targets && t.targets[eventsFunctionContext.getArgument(\"TargetIndex\")];", + "eventsFunctionContext.returnValue = tg ? tg.amount : 0;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + }, + { + "description": "Target Index", + "name": "TargetIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Task Target Progress.", + "fullName": "Task Target Progress", + "functionType": "Expression", + "group": "Tasks", + "name": "TaskTargetProgress", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const t = gdjs._playgamaBridgeExtension.tasksList[eventsFunctionContext.getArgument(\"TaskIndex\")];", + "const tg = t && t.targets && t.targets[eventsFunctionContext.getArgument(\"TargetIndex\")];", + "eventsFunctionContext.returnValue = tg ? tg.progress : 0;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + }, + { + "description": "Target Index", + "name": "TargetIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Task Rewards Count.", + "fullName": "Task Rewards Count", + "functionType": "Expression", + "group": "Tasks", + "name": "TaskRewardsCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const t = gdjs._playgamaBridgeExtension.tasksList[eventsFunctionContext.getArgument(\"TaskIndex\")];", + "eventsFunctionContext.returnValue = t && t.rewards ? t.rewards.length : 0;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Task Reward Amount.", + "fullName": "Task Reward Amount", + "functionType": "Expression", + "group": "Tasks", + "name": "TaskRewardAmount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const t = gdjs._playgamaBridgeExtension.tasksList[eventsFunctionContext.getArgument(\"TaskIndex\")];", + "const r = t && t.rewards && t.rewards[eventsFunctionContext.getArgument(\"RewardIndex\")];", + "eventsFunctionContext.returnValue = r ? r.amount : 0;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + }, + { + "description": "Reward Index", + "name": "RewardIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Tasks As JSON.", + "fullName": "Tasks As JSON", + "functionType": "StringExpression", + "group": "Tasks", + "name": "TasksAsJSON", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = JSON.stringify(gdjs._playgamaBridgeExtension.tasksList);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Task Id.", + "fullName": "Task Id", + "functionType": "StringExpression", + "group": "Tasks", + "name": "TaskId", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const t = gdjs._playgamaBridgeExtension.tasksList[eventsFunctionContext.getArgument(\"TaskIndex\")];", + "eventsFunctionContext.returnValue = t ? t.id : \"\";", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Task Type.", + "fullName": "Task Type", + "functionType": "StringExpression", + "group": "Tasks", + "name": "TaskType", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const t = gdjs._playgamaBridgeExtension.tasksList[eventsFunctionContext.getArgument(\"TaskIndex\")];", + "eventsFunctionContext.returnValue = t ? t.type : \"\";", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Task Target Id.", + "fullName": "Task Target Id", + "functionType": "StringExpression", + "group": "Tasks", + "name": "TaskTargetId", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const t = gdjs._playgamaBridgeExtension.tasksList[eventsFunctionContext.getArgument(\"TaskIndex\")];", + "const tg = t && t.targets && t.targets[eventsFunctionContext.getArgument(\"TargetIndex\")];", + "eventsFunctionContext.returnValue = tg ? tg.id : \"\";", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + }, + { + "description": "Target Index", + "name": "TargetIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Task Reward Id.", + "fullName": "Task Reward Id", + "functionType": "StringExpression", + "group": "Tasks", + "name": "TaskRewardId", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const t = gdjs._playgamaBridgeExtension.tasksList[eventsFunctionContext.getArgument(\"TaskIndex\")];", + "const r = t && t.rewards && t.rewards[eventsFunctionContext.getArgument(\"RewardIndex\")];", + "eventsFunctionContext.returnValue = r ? r.id : \"\";", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Task Index", + "name": "TaskIndex", + "type": "expression" + }, + { + "description": "Reward Index", + "name": "RewardIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Daily Rewards Get Rewards.", + "fullName": "Daily Rewards Get Rewards", + "functionType": "Action", + "group": "Daily Rewards", + "name": "DailyRewardsGetRewards", + "sentence": "Daily Rewards Get Rewards", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " bridge.dailyRewards.getRewards()", + " .then(data => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", + " gdjs._playgamaBridgeExtension.dailyRewardsList = data;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetRewardsCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Daily Rewards Get Current Day.", + "fullName": "Daily Rewards Get Current Day", + "functionType": "Action", + "group": "Daily Rewards", + "name": "DailyRewardsGetCurrentDay", + "sentence": "Daily Rewards Get Current Day", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " bridge.dailyRewards.getCurrentDay()", + " .then(day => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", + " gdjs._playgamaBridgeExtension.dailyRewardsCurrentDay = day;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentDayCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Daily Rewards Get Current Reward.", + "fullName": "Daily Rewards Get Current Reward", + "functionType": "Action", + "group": "Daily Rewards", + "name": "DailyRewardsGetCurrentReward", + "sentence": "Daily Rewards Get Current Reward", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " bridge.dailyRewards.getCurrentReward()", + " .then(reward => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", + " gdjs._playgamaBridgeExtension.dailyRewardsCurrentReward = reward;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsDailyRewardsGetCurrentRewardCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Daily Rewards Claim Current Reward.", + "fullName": "Daily Rewards Claim Current Reward", + "functionType": "Action", + "group": "Daily Rewards", + "name": "DailyRewardsClaimCurrentReward", + "sentence": "Daily Rewards Claim Current Reward", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " bridge.dailyRewards.claimCurrentReward()", + " .then(claimed => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = claimed === true;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsDailyRewardsClaimCurrentRewardCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "On Daily Rewards Get Rewards Completed.", + "fullName": "On Daily Rewards Get Rewards Completed", + "functionType": "Condition", + "group": "Daily Rewards", + "name": "OnDailyRewardsGetRewardsCompleted", + "sentence": "On Daily Rewards Get Rewards Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isDailyRewardsGetRewardsCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "On Daily Rewards Get Current Day Completed.", + "fullName": "On Daily Rewards Get Current Day Completed", + "functionType": "Condition", + "group": "Daily Rewards", + "name": "OnDailyRewardsGetCurrentDayCompleted", + "sentence": "On Daily Rewards Get Current Day Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isDailyRewardsGetCurrentDayCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "On Daily Rewards Get Current Reward Completed.", + "fullName": "On Daily Rewards Get Current Reward Completed", + "functionType": "Condition", + "group": "Daily Rewards", + "name": "OnDailyRewardsGetCurrentRewardCompleted", + "sentence": "On Daily Rewards Get Current Reward Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isDailyRewardsGetCurrentRewardCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "On Daily Rewards Claim Current Reward Completed.", + "fullName": "On Daily Rewards Claim Current Reward Completed", + "functionType": "Condition", + "group": "Daily Rewards", + "name": "OnDailyRewardsClaimCurrentRewardCompleted", + "sentence": "On Daily Rewards Claim Current Reward Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isDailyRewardsClaimCurrentRewardCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Daily Rewards Count.", + "fullName": "Daily Rewards Count", + "functionType": "Expression", + "group": "Daily Rewards", + "name": "DailyRewardsCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.dailyRewardsList.length;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Daily Rewards Current Day.", + "fullName": "Daily Rewards Current Day", + "functionType": "Expression", + "group": "Daily Rewards", + "name": "DailyRewardsCurrentDay", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.dailyRewardsCurrentDay;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Daily Rewards As JSON.", + "fullName": "Daily Rewards As JSON", + "functionType": "StringExpression", + "group": "Daily Rewards", + "name": "DailyRewardsAsJSON", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = JSON.stringify(gdjs._playgamaBridgeExtension.dailyRewardsList);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Daily Reward Id.", + "fullName": "Daily Reward Id", + "functionType": "StringExpression", + "group": "Daily Rewards", + "name": "DailyRewardId", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const reward = gdjs._playgamaBridgeExtension.dailyRewardsList[eventsFunctionContext.getArgument(\"RewardIndex\")];", + "eventsFunctionContext.returnValue = reward ? reward : \"\";", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Reward Index", + "name": "RewardIndex", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Daily Rewards Current Reward.", + "fullName": "Daily Rewards Current Reward", + "functionType": "StringExpression", + "group": "Daily Rewards", + "name": "DailyRewardsCurrentReward", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const reward = gdjs._playgamaBridgeExtension.dailyRewardsCurrentReward;", + "eventsFunctionContext.returnValue = reward ? reward : \"\";", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Schedule a notification built with Add Action Parameter (id, title, description, delaySeconds, image, callToAction, payload).", + "fullName": "Notifications Schedule", + "functionType": "Action", + "group": "Notifications", + "name": "NotificationsSchedule", + "sentence": "Notifications Schedule", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "const notification = gdjs._playgamaBridgeExtension.actionParametersContainer;", + "gdjs._playgamaBridgeExtension.actionParametersContainer = {};", + "", + "return new Promise(resolve => {", + " bridge.notifications.schedule(notification)", + " .then(() => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsNotificationsScheduleCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "On Notifications Schedule Completed.", + "fullName": "On Notifications Schedule Completed", + "functionType": "Condition", + "group": "Notifications", + "name": "OnNotificationsScheduleCompleted", + "sentence": "On Notifications Schedule Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isNotificationsScheduleCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Cancel a previously scheduled notification with the given id.", + "fullName": "Notifications Cancel", + "functionType": "Action", + "group": "Notifications", + "name": "NotificationsCancel", + "sentence": "Notifications Cancel - Id: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " const id = eventsFunctionContext.getArgument('Id');", + " bridge.notifications.cancel(id)", + " .then(() => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsNotificationsCancelCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Id", + "name": "Id", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "On Notifications Cancel Completed.", + "fullName": "On Notifications Cancel Completed", + "functionType": "Condition", + "group": "Notifications", + "name": "OnNotificationsCancelCompleted", + "sentence": "On Notifications Cancel Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isNotificationsCancelCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Cancel every notification scheduled by the game.", + "fullName": "Notifications Cancel All", + "functionType": "Action", + "group": "Notifications", + "name": "NotificationsCancelAll", + "sentence": "Notifications Cancel All", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = false;", + "", + "return new Promise(resolve => {", + " bridge.notifications.cancelAll()", + " .then(() => {", + " gdjs._playgamaBridgeExtension.isLastActionCompletedSuccessfully = true;", + " })", + " .catch(error => console.log(error))", + " .finally(() => {", + " gdjs._playgamaBridgeExtension.nextIsNotificationsCancelAllCompleted = true;", + " resolve();", + " });", + "});" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "On Notifications Cancel All Completed.", + "fullName": "On Notifications Cancel All Completed", + "functionType": "Condition", + "group": "Notifications", + "name": "OnNotificationsCancelAllCompleted", + "sentence": "On Notifications Cancel All Completed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = gdjs._playgamaBridgeExtension.isNotificationsCancelAllCompleted;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Is Notifications Supported.", + "fullName": "Is Notifications Supported", + "functionType": "Condition", + "group": "Notifications", + "name": "IsNotificationsSupported", + "sentence": "Is Notifications Supported", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "eventsFunctionContext.returnValue = bridge.notifications.isSupported;", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + } + ], "eventsBasedBehaviors": [], "eventsBasedObjects": [] -} \ No newline at end of file +}